@neasg/design-system 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -14
- package/dist/animated-icons/arrow-down.d.ts +10 -0
- package/dist/animated-icons/arrow-down.js +54 -0
- package/dist/animated-icons/arrow-up.d.ts +10 -0
- package/dist/animated-icons/arrow-up.js +54 -0
- package/dist/animated-icons/bell.d.ts +10 -0
- package/dist/animated-icons/bell.js +42 -0
- package/dist/animated-icons/bold.d.ts +10 -0
- package/dist/animated-icons/bold.js +45 -0
- package/dist/animated-icons/book-open.d.ts +10 -0
- package/dist/animated-icons/book-open.js +55 -0
- package/dist/animated-icons/building.d.ts +10 -0
- package/dist/animated-icons/building.js +46 -0
- package/dist/animated-icons/check.d.ts +10 -0
- package/dist/animated-icons/check.js +55 -0
- package/dist/animated-icons/chevron-down.d.ts +10 -0
- package/dist/animated-icons/chevron-down.js +42 -0
- package/dist/animated-icons/chevron-left.d.ts +10 -0
- package/dist/animated-icons/chevron-left.js +42 -0
- package/dist/animated-icons/chevron-right.d.ts +10 -0
- package/dist/animated-icons/chevron-right.js +42 -0
- package/dist/animated-icons/chevron-up.d.ts +10 -0
- package/dist/animated-icons/chevron-up.js +42 -0
- package/dist/animated-icons/clipboard-check.d.ts +10 -0
- package/dist/animated-icons/clipboard-check.js +56 -0
- package/dist/animated-icons/download.d.ts +10 -0
- package/dist/animated-icons/download.js +47 -0
- package/dist/animated-icons/external-link.d.ts +10 -0
- package/dist/animated-icons/external-link.js +59 -0
- package/dist/animated-icons/eye.d.ts +10 -0
- package/dist/animated-icons/eye.js +41 -0
- package/dist/animated-icons/file-text.d.ts +11 -0
- package/dist/animated-icons/file-text.js +89 -0
- package/dist/animated-icons/filter.d.ts +10 -0
- package/dist/animated-icons/filter.js +78 -0
- package/dist/animated-icons/folder-open.d.ts +10 -0
- package/dist/animated-icons/folder-open.js +46 -0
- package/dist/animated-icons/form.d.ts +10 -0
- package/dist/animated-icons/form.js +56 -0
- package/dist/animated-icons/git-branch.d.ts +10 -0
- package/dist/animated-icons/git-branch.js +56 -0
- package/dist/animated-icons/grip-horizontal.d.ts +10 -0
- package/dist/animated-icons/grip-horizontal.js +70 -0
- package/dist/animated-icons/grip-vertical.d.ts +10 -0
- package/dist/animated-icons/grip-vertical.js +67 -0
- package/dist/animated-icons/grip.d.ts +10 -0
- package/dist/animated-icons/grip.js +72 -0
- package/dist/animated-icons/highlighter.d.ts +10 -0
- package/dist/animated-icons/highlighter.js +46 -0
- package/dist/animated-icons/history.d.ts +10 -0
- package/dist/animated-icons/history.js +80 -0
- package/dist/animated-icons/index.d.ts +100 -0
- package/dist/animated-icons/index.js +50 -0
- package/dist/animated-icons/italic.d.ts +10 -0
- package/dist/animated-icons/italic.js +45 -0
- package/dist/animated-icons/link.d.ts +10 -0
- package/dist/animated-icons/link.js +51 -0
- package/dist/animated-icons/list-ordered.d.ts +10 -0
- package/dist/animated-icons/list-ordered.js +46 -0
- package/dist/animated-icons/list.d.ts +10 -0
- package/dist/animated-icons/list.js +56 -0
- package/dist/animated-icons/loader-pinwheel.d.ts +10 -0
- package/dist/animated-icons/loader-pinwheel.js +51 -0
- package/dist/animated-icons/logout.d.ts +10 -0
- package/dist/animated-icons/logout.js +44 -0
- package/dist/animated-icons/maximize.d.ts +10 -0
- package/dist/animated-icons/maximize.js +45 -0
- package/dist/animated-icons/message-square.d.ts +10 -0
- package/dist/animated-icons/message-square.js +56 -0
- package/dist/animated-icons/palette.d.ts +10 -0
- package/dist/animated-icons/palette.js +45 -0
- package/dist/animated-icons/paperclip.d.ts +10 -0
- package/dist/animated-icons/paperclip.js +45 -0
- package/dist/animated-icons/pencil.d.ts +10 -0
- package/dist/animated-icons/pencil.js +46 -0
- package/dist/animated-icons/plus.d.ts +10 -0
- package/dist/animated-icons/plus.js +42 -0
- package/dist/animated-icons/search.d.ts +10 -0
- package/dist/animated-icons/search.js +44 -0
- package/dist/animated-icons/send.d.ts +10 -0
- package/dist/animated-icons/send.js +46 -0
- package/dist/animated-icons/settings.d.ts +10 -0
- package/dist/animated-icons/settings.js +42 -0
- package/dist/animated-icons/shield.d.ts +10 -0
- package/dist/animated-icons/shield.js +45 -0
- package/dist/animated-icons/strikethrough.d.ts +10 -0
- package/dist/animated-icons/strikethrough.js +45 -0
- package/dist/animated-icons/timer.d.ts +10 -0
- package/dist/animated-icons/timer.js +70 -0
- package/dist/animated-icons/trash.d.ts +10 -0
- package/dist/animated-icons/trash.js +56 -0
- package/dist/animated-icons/trending-down.d.ts +10 -0
- package/dist/animated-icons/trending-down.js +86 -0
- package/dist/animated-icons/trending-up.d.ts +10 -0
- package/dist/animated-icons/trending-up.js +86 -0
- package/dist/animated-icons/underline.d.ts +10 -0
- package/dist/animated-icons/underline.js +45 -0
- package/dist/animated-icons/upload.d.ts +10 -0
- package/dist/animated-icons/upload.js +47 -0
- package/dist/animated-icons/users.d.ts +10 -0
- package/dist/animated-icons/users.js +45 -0
- package/dist/animated-icons/x.d.ts +10 -0
- package/dist/animated-icons/x.js +45 -0
- package/dist/avatar.d.ts +32 -0
- package/dist/avatar.js +21 -0
- package/dist/badge.d.ts +4 -3
- package/dist/badge.js +7 -12
- package/dist/breadcrumb.d.ts +30 -0
- package/dist/breadcrumb.js +32 -0
- package/dist/button.d.ts +2 -2
- package/dist/button.js +84 -6
- package/dist/command-search.d.ts +44 -0
- package/dist/command-search.js +73 -0
- package/dist/command.d.ts +77 -0
- package/dist/command.js +24 -0
- package/dist/count-badge.d.ts +10 -0
- package/dist/count-badge.js +34 -0
- package/dist/dialog-primitive.d.ts +22 -0
- package/dist/dialog-primitive.js +23 -0
- package/dist/dialog.d.ts +28 -0
- package/dist/dialog.js +60 -0
- package/dist/draggable-tabs.d.ts +27 -0
- package/dist/draggable-tabs.js +61 -0
- package/dist/drawer.d.ts +30 -0
- package/dist/drawer.js +77 -0
- package/dist/editable-table.d.ts +31 -0
- package/dist/editable-table.js +122 -0
- package/dist/email-input.d.ts +16 -0
- package/dist/email-input.js +55 -0
- package/dist/empty-state.d.ts +11 -0
- package/dist/empty-state.js +7 -0
- package/dist/field.d.ts +6 -0
- package/dist/field.js +18 -0
- package/dist/filter-toggle.d.ts +12 -0
- package/dist/filter-toggle.js +23 -0
- package/dist/govt-masthead.d.ts +9 -0
- package/dist/govt-masthead.js +8 -0
- package/dist/index.d.ts +55 -4
- package/dist/index.js +32 -4
- package/dist/input-control.d.ts +4 -0
- package/dist/input-control.js +7 -0
- package/dist/input-validation.d.ts +9 -0
- package/dist/input-validation.js +75 -0
- package/dist/input.d.ts +16 -0
- package/dist/input.js +22 -0
- package/dist/label-value-grid.d.ts +13 -0
- package/dist/label-value-grid.js +61 -0
- package/dist/label-value.d.ts +11 -0
- package/dist/label-value.js +19 -0
- package/dist/layout.d.ts +57 -0
- package/dist/layout.js +166 -0
- package/dist/otp-input.d.ts +21 -0
- package/dist/otp-input.js +60 -0
- package/dist/page-header.d.ts +9 -0
- package/dist/page-header.js +6 -0
- package/dist/pagination.d.ts +12 -0
- package/dist/pagination.js +24 -0
- package/dist/phone-input.d.ts +36 -0
- package/dist/phone-input.js +135 -0
- package/dist/right-drawer.d.ts +2 -0
- package/dist/right-drawer.js +1 -0
- package/dist/search-input-shell.d.ts +8 -0
- package/dist/search-input-shell.js +9 -0
- package/dist/search-input.d.ts +20 -0
- package/dist/search-input.js +73 -0
- package/dist/select-primitive.d.ts +17 -0
- package/dist/select-primitive.js +33 -0
- package/dist/select.d.ts +31 -0
- package/dist/select.js +97 -0
- package/dist/styles.css +111 -1
- package/dist/table-toolbar.d.ts +7 -0
- package/dist/table-toolbar.js +7 -0
- package/dist/table.d.ts +87 -3
- package/dist/table.js +102 -5
- package/dist/tabs.d.ts +24 -7
- package/dist/tabs.js +22 -26
- package/dist/tailwind-preset.d.ts +4 -0
- package/dist/tailwind-preset.js +97 -0
- package/dist/textarea.d.ts +16 -0
- package/dist/textarea.js +23 -0
- package/dist/theme.d.ts +259 -0
- package/dist/theme.js +118 -0
- package/dist/tooltip.d.ts +15 -3
- package/dist/tooltip.js +9 -4
- package/dist/typography.d.ts +11 -0
- package/dist/typography.js +41 -0
- package/dist/use-search-highlight.d.ts +13 -0
- package/dist/use-search-highlight.js +46 -0
- package/package.json +126 -4
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { ArrowDownIcon } from "./arrow-down";
|
|
2
|
+
export { ArrowUpIcon } from "./arrow-up";
|
|
3
|
+
export { BellIcon } from "./bell";
|
|
4
|
+
export { BoldIcon } from "./bold";
|
|
5
|
+
export { BookOpenIcon } from "./book-open";
|
|
6
|
+
export { BuildingIcon } from "./building";
|
|
7
|
+
export { CheckIcon } from "./check";
|
|
8
|
+
export { ChevronDownIcon } from "./chevron-down";
|
|
9
|
+
export { ChevronLeftIcon } from "./chevron-left";
|
|
10
|
+
export { ChevronRightIcon } from "./chevron-right";
|
|
11
|
+
export { ChevronUpIcon } from "./chevron-up";
|
|
12
|
+
export { ClipboardCheckIcon } from "./clipboard-check";
|
|
13
|
+
export { DownloadIcon } from "./download";
|
|
14
|
+
export { ExternalLinkIcon } from "./external-link";
|
|
15
|
+
export { EyeIcon } from "./eye";
|
|
16
|
+
export { FileTextIcon } from "./file-text";
|
|
17
|
+
export { FilterIcon } from "./filter";
|
|
18
|
+
export { FolderOpenIcon } from "./folder-open";
|
|
19
|
+
export { FormIcon } from "./form";
|
|
20
|
+
export { GitBranchIcon } from "./git-branch";
|
|
21
|
+
export { GripHorizontalIcon } from "./grip-horizontal";
|
|
22
|
+
export { GripVerticalIcon } from "./grip-vertical";
|
|
23
|
+
export { GripIcon } from "./grip";
|
|
24
|
+
export { HighlighterIcon } from "./highlighter";
|
|
25
|
+
export { HistoryIcon } from "./history";
|
|
26
|
+
export { ItalicIcon } from "./italic";
|
|
27
|
+
export { LinkIcon } from "./link";
|
|
28
|
+
export { ListOrderedIcon } from "./list-ordered";
|
|
29
|
+
export { ListIcon } from "./list";
|
|
30
|
+
export { LoaderPinwheelIcon } from "./loader-pinwheel";
|
|
31
|
+
export { LogoutIcon } from "./logout";
|
|
32
|
+
export { MaximizeIcon } from "./maximize";
|
|
33
|
+
export { MessageSquareIcon } from "./message-square";
|
|
34
|
+
export { PaletteIcon } from "./palette";
|
|
35
|
+
export { PaperclipIcon } from "./paperclip";
|
|
36
|
+
export { PencilIcon } from "./pencil";
|
|
37
|
+
export { PlusIcon } from "./plus";
|
|
38
|
+
export { SearchIcon } from "./search";
|
|
39
|
+
export { SendIcon } from "./send";
|
|
40
|
+
export { SettingsIcon } from "./settings";
|
|
41
|
+
export { ShieldIcon } from "./shield";
|
|
42
|
+
export { StrikethroughIcon } from "./strikethrough";
|
|
43
|
+
export { TimerIcon } from "./timer";
|
|
44
|
+
export { TrashIcon } from "./trash";
|
|
45
|
+
export { TrendingDownIcon } from "./trending-down";
|
|
46
|
+
export { TrendingUpIcon } from "./trending-up";
|
|
47
|
+
export { UnderlineIcon } from "./underline";
|
|
48
|
+
export { UploadIcon } from "./upload";
|
|
49
|
+
export { UsersIcon } from "./users";
|
|
50
|
+
export { XIcon } from "./x";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface ItalicIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface ItalicIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const ItalicIcon: import("react").ForwardRefExoticComponent<ItalicIconProps & import("react").RefAttributes<ItalicIconHandle>>;
|
|
10
|
+
export { ItalicIcon };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const SVG_VARIANTS = {
|
|
7
|
+
normal: { skewX: 0 },
|
|
8
|
+
animate: {
|
|
9
|
+
skewX: [0, -5, 0],
|
|
10
|
+
transition: {
|
|
11
|
+
duration: 0.3,
|
|
12
|
+
ease: "easeInOut",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const ItalicIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 24, ...props }, ref) => {
|
|
17
|
+
const controls = useAnimation();
|
|
18
|
+
const isControlledRef = useRef(false);
|
|
19
|
+
useImperativeHandle(ref, () => {
|
|
20
|
+
isControlledRef.current = true;
|
|
21
|
+
return {
|
|
22
|
+
startAnimation: () => controls.start("animate"),
|
|
23
|
+
stopAnimation: () => controls.start("normal"),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const handleMouseEnter = useCallback((e) => {
|
|
27
|
+
if (isControlledRef.current) {
|
|
28
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
controls.start("animate");
|
|
32
|
+
}
|
|
33
|
+
}, [controls, onMouseEnter]);
|
|
34
|
+
const handleMouseLeave = useCallback((e) => {
|
|
35
|
+
if (isControlledRef.current) {
|
|
36
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
controls.start("normal");
|
|
40
|
+
}
|
|
41
|
+
}, [controls, onMouseLeave]);
|
|
42
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs(motion.svg, { animate: controls, fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", variants: SVG_VARIANTS, viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("line", { x1: "19", x2: "10", y1: "4", y2: "4" }), _jsx("line", { x1: "14", x2: "5", y1: "20", y2: "20" }), _jsx("line", { x1: "15", x2: "9", y1: "4", y2: "20" })] }) }));
|
|
43
|
+
});
|
|
44
|
+
ItalicIcon.displayName = "ItalicIcon";
|
|
45
|
+
export { ItalicIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface LinkIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface LinkIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const LinkIcon: import("react").ForwardRefExoticComponent<LinkIconProps & import("react").RefAttributes<LinkIconHandle>>;
|
|
10
|
+
export { LinkIcon };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const PATH_VARIANTS = {
|
|
7
|
+
initial: { pathLength: 1, pathOffset: 0, rotate: 0 },
|
|
8
|
+
animate: {
|
|
9
|
+
pathLength: [1, 0.97, 1, 0.97, 1],
|
|
10
|
+
pathOffset: [0, 0.05, 0, 0.05, 0],
|
|
11
|
+
rotate: [0, -5, 0],
|
|
12
|
+
transition: {
|
|
13
|
+
rotate: {
|
|
14
|
+
duration: 0.5,
|
|
15
|
+
},
|
|
16
|
+
duration: 1,
|
|
17
|
+
times: [0, 0.2, 0.4, 0.6, 1],
|
|
18
|
+
ease: "easeInOut",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const LinkIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
|
|
23
|
+
const controls = useAnimation();
|
|
24
|
+
const isControlledRef = useRef(false);
|
|
25
|
+
useImperativeHandle(ref, () => {
|
|
26
|
+
isControlledRef.current = true;
|
|
27
|
+
return {
|
|
28
|
+
startAnimation: () => controls.start("animate"),
|
|
29
|
+
stopAnimation: () => controls.start("normal"),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
const handleMouseEnter = useCallback((e) => {
|
|
33
|
+
if (isControlledRef.current) {
|
|
34
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
controls.start("animate");
|
|
38
|
+
}
|
|
39
|
+
}, [controls, onMouseEnter]);
|
|
40
|
+
const handleMouseLeave = useCallback((e) => {
|
|
41
|
+
if (isControlledRef.current) {
|
|
42
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
controls.start("normal");
|
|
46
|
+
}
|
|
47
|
+
}, [controls, onMouseLeave]);
|
|
48
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx(motion.path, { animate: controls, d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", variants: PATH_VARIANTS }), _jsx(motion.path, { animate: controls, d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", variants: PATH_VARIANTS })] }) }));
|
|
49
|
+
});
|
|
50
|
+
LinkIcon.displayName = "LinkIcon";
|
|
51
|
+
export { LinkIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface ListOrderedIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface ListOrderedIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const ListOrderedIcon: import("react").ForwardRefExoticComponent<ListOrderedIconProps & import("react").RefAttributes<ListOrderedIconHandle>>;
|
|
10
|
+
export { ListOrderedIcon };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const LINE_VARIANTS = {
|
|
7
|
+
normal: { scaleX: 1, opacity: 1 },
|
|
8
|
+
animate: {
|
|
9
|
+
scaleX: [0, 1],
|
|
10
|
+
opacity: [0.5, 1],
|
|
11
|
+
transition: {
|
|
12
|
+
duration: 0.3,
|
|
13
|
+
ease: "easeInOut",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const ListOrderedIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 24, ...props }, ref) => {
|
|
18
|
+
const controls = useAnimation();
|
|
19
|
+
const isControlledRef = useRef(false);
|
|
20
|
+
useImperativeHandle(ref, () => {
|
|
21
|
+
isControlledRef.current = true;
|
|
22
|
+
return {
|
|
23
|
+
startAnimation: () => controls.start("animate"),
|
|
24
|
+
stopAnimation: () => controls.start("normal"),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
const handleMouseEnter = useCallback((e) => {
|
|
28
|
+
if (isControlledRef.current) {
|
|
29
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
controls.start("animate");
|
|
33
|
+
}
|
|
34
|
+
}, [controls, onMouseEnter]);
|
|
35
|
+
const handleMouseLeave = useCallback((e) => {
|
|
36
|
+
if (isControlledRef.current) {
|
|
37
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
controls.start("normal");
|
|
41
|
+
}
|
|
42
|
+
}, [controls, onMouseLeave]);
|
|
43
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "10", x2: "21", y1: "6", y2: "6" }), _jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "10", x2: "21", y1: "12", y2: "12" }), _jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "10", x2: "21", y1: "18", y2: "18" }), _jsx("path", { d: "M4 6h1v4" }), _jsx("path", { d: "M4 10h2" }), _jsx("path", { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1" })] }) }));
|
|
44
|
+
});
|
|
45
|
+
ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
46
|
+
export { ListOrderedIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface ListIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface ListIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const ListIcon: import("react").ForwardRefExoticComponent<ListIconProps & import("react").RefAttributes<ListIconHandle>>;
|
|
10
|
+
export { ListIcon };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const LINE_VARIANTS = {
|
|
7
|
+
normal: { scaleX: 1, opacity: 1 },
|
|
8
|
+
animate: {
|
|
9
|
+
scaleX: [0, 1],
|
|
10
|
+
opacity: [0.5, 1],
|
|
11
|
+
transition: {
|
|
12
|
+
duration: 0.3,
|
|
13
|
+
ease: "easeInOut",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const DOT_VARIANTS = {
|
|
18
|
+
normal: { scale: 1 },
|
|
19
|
+
animate: {
|
|
20
|
+
scale: [0, 1.2, 1],
|
|
21
|
+
transition: {
|
|
22
|
+
duration: 0.3,
|
|
23
|
+
ease: "easeInOut",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const ListIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 24, ...props }, ref) => {
|
|
28
|
+
const controls = useAnimation();
|
|
29
|
+
const isControlledRef = useRef(false);
|
|
30
|
+
useImperativeHandle(ref, () => {
|
|
31
|
+
isControlledRef.current = true;
|
|
32
|
+
return {
|
|
33
|
+
startAnimation: () => controls.start("animate"),
|
|
34
|
+
stopAnimation: () => controls.start("normal"),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const handleMouseEnter = useCallback((e) => {
|
|
38
|
+
if (isControlledRef.current) {
|
|
39
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
controls.start("animate");
|
|
43
|
+
}
|
|
44
|
+
}, [controls, onMouseEnter]);
|
|
45
|
+
const handleMouseLeave = useCallback((e) => {
|
|
46
|
+
if (isControlledRef.current) {
|
|
47
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
controls.start("normal");
|
|
51
|
+
}
|
|
52
|
+
}, [controls, onMouseLeave]);
|
|
53
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "8", x2: "21", y1: "6", y2: "6" }), _jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "8", x2: "21", y1: "12", y2: "12" }), _jsx(motion.line, { animate: controls, style: { originX: 0 }, variants: LINE_VARIANTS, x1: "8", x2: "21", y1: "18", y2: "18" }), _jsx(motion.line, { animate: controls, variants: DOT_VARIANTS, x1: "3", x2: "3.01", y1: "6", y2: "6" }), _jsx(motion.line, { animate: controls, variants: DOT_VARIANTS, x1: "3", x2: "3.01", y1: "12", y2: "12" }), _jsx(motion.line, { animate: controls, variants: DOT_VARIANTS, x1: "3", x2: "3.01", y1: "18", y2: "18" })] }) }));
|
|
54
|
+
});
|
|
55
|
+
ListIcon.displayName = "ListIcon";
|
|
56
|
+
export { ListIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface LoaderPinwheelIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface LoaderPinwheelIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const LoaderPinwheelIcon: import("react").ForwardRefExoticComponent<LoaderPinwheelIconProps & import("react").RefAttributes<LoaderPinwheelIconHandle>>;
|
|
10
|
+
export { LoaderPinwheelIcon };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const G_VARIANTS = {
|
|
7
|
+
normal: { rotate: 0 },
|
|
8
|
+
animate: {
|
|
9
|
+
rotate: 360,
|
|
10
|
+
transition: {
|
|
11
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
12
|
+
duration: 1,
|
|
13
|
+
ease: "linear",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const DEFAULT_TRANSITION = {
|
|
18
|
+
type: "spring",
|
|
19
|
+
stiffness: 50,
|
|
20
|
+
damping: 10,
|
|
21
|
+
};
|
|
22
|
+
const LoaderPinwheelIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
|
|
23
|
+
const controls = useAnimation();
|
|
24
|
+
const isControlledRef = useRef(false);
|
|
25
|
+
useImperativeHandle(ref, () => {
|
|
26
|
+
isControlledRef.current = true;
|
|
27
|
+
return {
|
|
28
|
+
startAnimation: () => controls.start("animate"),
|
|
29
|
+
stopAnimation: () => controls.start("normal"),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
const handleMouseEnter = useCallback((e) => {
|
|
33
|
+
if (isControlledRef.current) {
|
|
34
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
controls.start("animate");
|
|
38
|
+
}
|
|
39
|
+
}, [controls, onMouseEnter]);
|
|
40
|
+
const handleMouseLeave = useCallback((e) => {
|
|
41
|
+
if (isControlledRef.current) {
|
|
42
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
controls.start("normal");
|
|
46
|
+
}
|
|
47
|
+
}, [controls, onMouseLeave]);
|
|
48
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsxs(motion.g, { animate: controls, transition: DEFAULT_TRANSITION, variants: G_VARIANTS, children: [_jsx("path", { d: "M22 12a1 1 0 0 1-10 0 1 1 0 0 0-10 0" }), _jsx("path", { d: "M7 20.7a1 1 0 1 1 5-8.7 1 1 0 1 0 5-8.6" }), _jsx("path", { d: "M7 3.3a1 1 0 1 1 5 8.6 1 1 0 1 0 5 8.6" })] }), _jsx("circle", { cx: "12", cy: "12", r: "10" })] }) }));
|
|
49
|
+
});
|
|
50
|
+
LoaderPinwheelIcon.displayName = "LoaderPinwheelIcon";
|
|
51
|
+
export { LoaderPinwheelIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface LogoutIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface LogoutIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const LogoutIcon: import("react").ForwardRefExoticComponent<LogoutIconProps & import("react").RefAttributes<LogoutIconHandle>>;
|
|
10
|
+
export { LogoutIcon };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const PATH_VARIANTS = {
|
|
7
|
+
animate: {
|
|
8
|
+
x: 2,
|
|
9
|
+
translateX: [0, -3, 0],
|
|
10
|
+
transition: {
|
|
11
|
+
duration: 0.4,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const LogoutIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
|
|
16
|
+
const controls = useAnimation();
|
|
17
|
+
const isControlledRef = useRef(false);
|
|
18
|
+
useImperativeHandle(ref, () => {
|
|
19
|
+
isControlledRef.current = true;
|
|
20
|
+
return {
|
|
21
|
+
startAnimation: () => controls.start("animate"),
|
|
22
|
+
stopAnimation: () => controls.start("normal"),
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const handleMouseEnter = useCallback((e) => {
|
|
26
|
+
if (isControlledRef.current) {
|
|
27
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
controls.start("animate");
|
|
31
|
+
}
|
|
32
|
+
}, [controls, onMouseEnter]);
|
|
33
|
+
const handleMouseLeave = useCallback((e) => {
|
|
34
|
+
if (isControlledRef.current) {
|
|
35
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
controls.start("normal");
|
|
39
|
+
}
|
|
40
|
+
}, [controls, onMouseLeave]);
|
|
41
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }), _jsx(motion.polyline, { animate: controls, points: "16 17 21 12 16 7", variants: PATH_VARIANTS }), _jsx(motion.line, { animate: controls, variants: PATH_VARIANTS, x1: "21", x2: "9", y1: "12", y2: "12" })] }) }));
|
|
42
|
+
});
|
|
43
|
+
LogoutIcon.displayName = "LogoutIcon";
|
|
44
|
+
export { LogoutIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface MaximizeIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface MaximizeIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const MaximizeIcon: import("react").ForwardRefExoticComponent<MaximizeIconProps & import("react").RefAttributes<MaximizeIconHandle>>;
|
|
10
|
+
export { MaximizeIcon };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const CORNER_VARIANTS = {
|
|
7
|
+
normal: { scale: 1 },
|
|
8
|
+
animate: {
|
|
9
|
+
scale: [1, 1.2, 1],
|
|
10
|
+
transition: {
|
|
11
|
+
duration: 0.4,
|
|
12
|
+
ease: "easeInOut",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const MaximizeIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 24, ...props }, ref) => {
|
|
17
|
+
const controls = useAnimation();
|
|
18
|
+
const isControlledRef = useRef(false);
|
|
19
|
+
useImperativeHandle(ref, () => {
|
|
20
|
+
isControlledRef.current = true;
|
|
21
|
+
return {
|
|
22
|
+
startAnimation: () => controls.start("animate"),
|
|
23
|
+
stopAnimation: () => controls.start("normal"),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const handleMouseEnter = useCallback((e) => {
|
|
27
|
+
if (isControlledRef.current) {
|
|
28
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
controls.start("animate");
|
|
32
|
+
}
|
|
33
|
+
}, [controls, onMouseEnter]);
|
|
34
|
+
const handleMouseLeave = useCallback((e) => {
|
|
35
|
+
if (isControlledRef.current) {
|
|
36
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
controls.start("normal");
|
|
40
|
+
}
|
|
41
|
+
}, [controls, onMouseLeave]);
|
|
42
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs("svg", { fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx(motion.polyline, { animate: controls, points: "15 3 21 3 21 9", style: { originX: 1, originY: 0 }, variants: CORNER_VARIANTS }), _jsx(motion.polyline, { animate: controls, points: "9 21 3 21 3 15", style: { originX: 0, originY: 1 }, variants: CORNER_VARIANTS }), _jsx(motion.line, { animate: controls, variants: CORNER_VARIANTS, x1: "21", x2: "14", y1: "3", y2: "10" }), _jsx(motion.line, { animate: controls, variants: CORNER_VARIANTS, x1: "3", x2: "10", y1: "21", y2: "14" })] }) }));
|
|
43
|
+
});
|
|
44
|
+
MaximizeIcon.displayName = "MaximizeIcon";
|
|
45
|
+
export { MaximizeIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface MessageSquareIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface MessageSquareIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const MessageSquareIcon: import("react").ForwardRefExoticComponent<MessageSquareIconProps & import("react").RefAttributes<MessageSquareIconHandle>>;
|
|
10
|
+
export { MessageSquareIcon };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const ICON_VARIANTS = {
|
|
7
|
+
normal: {
|
|
8
|
+
scale: 1,
|
|
9
|
+
rotate: 0,
|
|
10
|
+
},
|
|
11
|
+
animate: {
|
|
12
|
+
scale: 1.05,
|
|
13
|
+
rotate: [0, -7, 7, 0],
|
|
14
|
+
transition: {
|
|
15
|
+
rotate: {
|
|
16
|
+
duration: 0.5,
|
|
17
|
+
ease: "easeInOut",
|
|
18
|
+
},
|
|
19
|
+
scale: {
|
|
20
|
+
type: "spring",
|
|
21
|
+
stiffness: 400,
|
|
22
|
+
damping: 10,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const MessageSquareIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
|
|
28
|
+
const controls = useAnimation();
|
|
29
|
+
const isControlledRef = useRef(false);
|
|
30
|
+
useImperativeHandle(ref, () => {
|
|
31
|
+
isControlledRef.current = true;
|
|
32
|
+
return {
|
|
33
|
+
startAnimation: () => controls.start("animate"),
|
|
34
|
+
stopAnimation: () => controls.start("normal"),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const handleMouseEnter = useCallback((e) => {
|
|
38
|
+
if (isControlledRef.current) {
|
|
39
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
controls.start("animate");
|
|
43
|
+
}
|
|
44
|
+
}, [controls, onMouseEnter]);
|
|
45
|
+
const handleMouseLeave = useCallback((e) => {
|
|
46
|
+
if (isControlledRef.current) {
|
|
47
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
controls.start("normal");
|
|
51
|
+
}
|
|
52
|
+
}, [controls, onMouseLeave]);
|
|
53
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsx(motion.svg, { animate: controls, fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", variants: ICON_VARIANTS, viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }) }));
|
|
54
|
+
});
|
|
55
|
+
MessageSquareIcon.displayName = "MessageSquareIcon";
|
|
56
|
+
export { MessageSquareIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface PaletteIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface PaletteIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const PaletteIcon: import("react").ForwardRefExoticComponent<PaletteIconProps & import("react").RefAttributes<PaletteIconHandle>>;
|
|
10
|
+
export { PaletteIcon };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { motion, useAnimation } from "motion/react";
|
|
4
|
+
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const SVG_VARIANTS = {
|
|
7
|
+
normal: { rotate: 0 },
|
|
8
|
+
animate: {
|
|
9
|
+
rotate: [0, -10, 10, 0],
|
|
10
|
+
transition: {
|
|
11
|
+
duration: 0.4,
|
|
12
|
+
ease: "easeInOut",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const PaletteIcon = forwardRef(({ onMouseEnter, onMouseLeave, className, size = 24, ...props }, ref) => {
|
|
17
|
+
const controls = useAnimation();
|
|
18
|
+
const isControlledRef = useRef(false);
|
|
19
|
+
useImperativeHandle(ref, () => {
|
|
20
|
+
isControlledRef.current = true;
|
|
21
|
+
return {
|
|
22
|
+
startAnimation: () => controls.start("animate"),
|
|
23
|
+
stopAnimation: () => controls.start("normal"),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const handleMouseEnter = useCallback((e) => {
|
|
27
|
+
if (isControlledRef.current) {
|
|
28
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
controls.start("animate");
|
|
32
|
+
}
|
|
33
|
+
}, [controls, onMouseEnter]);
|
|
34
|
+
const handleMouseLeave = useCallback((e) => {
|
|
35
|
+
if (isControlledRef.current) {
|
|
36
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
controls.start("normal");
|
|
40
|
+
}
|
|
41
|
+
}, [controls, onMouseLeave]);
|
|
42
|
+
return (_jsx("div", { className: cn(className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props, children: _jsxs(motion.svg, { animate: controls, fill: "none", height: size, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", variants: SVG_VARIANTS, viewBox: "0 0 24 24", width: size, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor" }), _jsx("circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor" }), _jsx("circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor" }), _jsx("circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor" }), _jsx("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })] }) }));
|
|
43
|
+
});
|
|
44
|
+
PaletteIcon.displayName = "PaletteIcon";
|
|
45
|
+
export { PaletteIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface PaperclipIconHandle {
|
|
3
|
+
startAnimation: () => void;
|
|
4
|
+
stopAnimation: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface PaperclipIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const PaperclipIcon: import("react").ForwardRefExoticComponent<PaperclipIconProps & import("react").RefAttributes<PaperclipIconHandle>>;
|
|
10
|
+
export { PaperclipIcon };
|