import { useMotionTemplate, useMotionValue } from 'framer-motion';
import { motion } from 'framer-motion';
import clsxm from '@/lib/clsxm';
import { DynamicImage } from '@/components/framework/DynamicImage';
import { GridPattern } from '@/components/framework/GridPattern';
import UnstyledLink from './framework/UnstyledLink';
function ResourcePattern({
mouseX,
mouseY,
...gridProps
}: {
mouseX: any;
mouseY: any;
y: number;
squares: number[][];
}) {
const maskImage = useMotionTemplate`radial-gradient(180px at ${mouseX}px ${mouseY}px, white, transparent)`;
const style = { maskImage, WebkitMaskImage: maskImage };
return (
);
}
const patterns = [
{
y: 16,
squares: [
[0, 1],
[1, 3],
],
},
{
y: -6,
squares: [
[-1, 2],
[1, 3],
],
},
{
y: 32,
squares: [
[0, 2],
[1, 4],
],
},
{
y: 22,
squares: [[0, 1]],
},
];
const ImageCard = ({ name, src, count = 0, patternIndex, ...props }) => {
const mouseX = useMotionValue(0);
const mouseY = useMotionValue(0);
function onMouseMove({ currentTarget, clientX, clientY }) {
const { left, top } = currentTarget.getBoundingClientRect();
mouseX.set(clientX - left);
mouseY.set(clientY - top);
}
function onTouchMove({ currentTarget, touches }) {
const { left, top } = currentTarget.getBoundingClientRect();
mouseX.set(touches[0].clientX - left);
mouseY.set(touches[0].clientY - top);
}
return (
{name}
{count > 0 && (
{count} Components
)}
);
};
const GridWrap = ({ children = null, list = [] }) => {
return (
{list.length > 0 ? : children}
);
};
const GridItems = ({
list,
}: {
list: { name: string; src: string; count?: number; href?: string }[];
}) => (
<>
{list.map(({ name, src, ...item }, i) => (
))}
>
);
const Components = () => {
const components = [
{
name: 'Accordion',
src: 'accordion',
},
{
name: 'Button',
src: 'button',
},
{
name: 'Menu',
src: 'menu',
},
{
name: 'Tab',
src: 'tab',
},
{
name: 'Toast',
src: 'toast',
},
{
name: 'Dialog (Modal)',
src: 'dialog',
},
];
return ;
};
const Forms = () => {
const components = [
{
name: 'Validation',
src: 'form-validation',
href: 'form/validation',
},
{
name: 'Switch',
src: 'form-switch',
href: 'form/switch',
},
{
name: 'Input',
src: 'form-input',
href: 'form/input',
},
{
name: 'Select',
src: 'form-select',
href: 'form/select',
},
{
name: 'ComboBox',
src: 'form-combobox',
href: 'form/combobox',
},
];
return ;
};
const UI = () => {
const uis = [
{
name: 'Card',
src: 'ui-card',
href: 'ui/card',
count: 3,
},
/* {
name: 'List',
src: 'ui-card',
href: 'ui/list',
count: 3,
}, */
];
return ;
};
const Plugins = () => {
const plugins = [
{
name: 'Button',
src: 'plugin-button',
href: 'plugin/button',
},
{
name: 'Tooltip',
src: 'plugin-tooltip',
href: 'plugin/tooltip',
},
];
return ;
};
Components.displayName = 'Components';
Forms.displayName = 'Forms';
UI.displayName = 'UI';
Plugins.displayName = 'Plugins';
export const Dashboard = Object.assign(
{},
{
Components,
Forms,
UI,
Plugins,
}
);