@codefast/ui 0.3.9 → 0.3.11-canary.0
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/CHANGELOG.md +30 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +124 -1
- package/dist/components/breadcrumb.js +72 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +11 -18
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +1 -1
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +6 -6
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +2 -2
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +8 -10
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +8 -10
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +17 -0
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +7 -11
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +1 -1
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +1 -1
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +1 -1
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +1 -1
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +405 -62
package/dist/css/teal.css
CHANGED
|
@@ -1 +1,95 @@
|
|
|
1
|
-
:root
|
|
1
|
+
:root {
|
|
2
|
+
--input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
3
|
+
--border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
4
|
+
|
|
5
|
+
--ring: oklch(0.78 0.13 182); /* --color-teal-400 */
|
|
6
|
+
|
|
7
|
+
--background: oklch(1 0 0); /* --color-zinc-50 */
|
|
8
|
+
--foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
9
|
+
|
|
10
|
+
--primary: oklch(0.6 0.1 185); /* --color-teal-600 */
|
|
11
|
+
--primary-foreground: oklch(0.98 0.01 181); /* --color-teal-50 */
|
|
12
|
+
|
|
13
|
+
--secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
14
|
+
--secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
15
|
+
|
|
16
|
+
--destructive: oklch(0.577 0.245 27.325); /* --color-red-600 */
|
|
17
|
+
|
|
18
|
+
--accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
19
|
+
--accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
20
|
+
|
|
21
|
+
--muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
22
|
+
--muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
23
|
+
|
|
24
|
+
--popover: oklch(1 0 0); /* --color-zinc-50 */
|
|
25
|
+
--popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
26
|
+
|
|
27
|
+
--card: oklch(1 0 0); /* --color-zinc-50 */
|
|
28
|
+
--card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
29
|
+
|
|
30
|
+
--sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
31
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
32
|
+
|
|
33
|
+
--sidebar-primary: oklch(0.6 0.1 185); /* --color-teal-600 */
|
|
34
|
+
--sidebar-primary-foreground: oklch(0.98 0.01 181); /* --color-teal-50 */
|
|
35
|
+
|
|
36
|
+
--sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
38
|
+
|
|
39
|
+
--sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
40
|
+
--sidebar-ring: oklch(0.78 0.13 182); /* --color-teal-400 */
|
|
41
|
+
|
|
42
|
+
--chart-1: oklch(0.85 0.13 181); /* --color-teal-300 */
|
|
43
|
+
--chart-2: oklch(0.78 0.13 182); /* --color-teal-400 */
|
|
44
|
+
--chart-3: oklch(0.7 0.12 183); /* --color-teal-500 */
|
|
45
|
+
--chart-4: oklch(0.6 0.1 185); /* --color-teal-600 */
|
|
46
|
+
--chart-5: oklch(0.51 0.09 186); /* --color-teal-700 */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--input: oklch(1 0 0 / 15%); /* --color-white */
|
|
51
|
+
--border: oklch(1 0 0 / 10%); /* --color-white */
|
|
52
|
+
|
|
53
|
+
--ring: oklch(0.39 0.06 188); /* --color-teal-900 */
|
|
54
|
+
|
|
55
|
+
--background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
56
|
+
--foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
57
|
+
|
|
58
|
+
--primary: oklch(0.7 0.12 183); /* --color-teal-500 */
|
|
59
|
+
--primary-foreground: oklch(0.98 0.01 181); /* --color-teal-50 */
|
|
60
|
+
|
|
61
|
+
--secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
62
|
+
--secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
63
|
+
|
|
64
|
+
--destructive: oklch(0.704 0.191 22.216); /* --color-red-400 */
|
|
65
|
+
|
|
66
|
+
--accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
67
|
+
--accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
68
|
+
|
|
69
|
+
--muted: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
70
|
+
--muted-foreground: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
71
|
+
|
|
72
|
+
--popover: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
73
|
+
--popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
74
|
+
|
|
75
|
+
--card: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
76
|
+
--card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
77
|
+
|
|
78
|
+
--sidebar: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
79
|
+
--sidebar-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
80
|
+
|
|
81
|
+
--sidebar-primary: oklch(0.7 0.12 183); /* --color-teal-500 */
|
|
82
|
+
--sidebar-primary-foreground: oklch(0.98 0.01 181); /* --color-teal-50 */
|
|
83
|
+
|
|
84
|
+
--sidebar-accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
85
|
+
--sidebar-accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
86
|
+
|
|
87
|
+
--sidebar-border: oklch(1 0 0 / 10%); /* --color-white */
|
|
88
|
+
--sidebar-ring: oklch(0.39 0.06 188); /* --color-teal-900 */
|
|
89
|
+
|
|
90
|
+
--chart-1: oklch(0.85 0.13 181); /* --color-teal-300 */
|
|
91
|
+
--chart-2: oklch(0.78 0.13 182); /* --color-teal-400 */
|
|
92
|
+
--chart-3: oklch(0.7 0.12 183); /* --color-teal-500 */
|
|
93
|
+
--chart-4: oklch(0.6 0.1 185); /* --color-teal-600 */
|
|
94
|
+
--chart-5: oklch(0.51 0.09 186); /* --color-teal-700 */
|
|
95
|
+
}
|
package/dist/css/violet.css
CHANGED
|
@@ -1 +1,95 @@
|
|
|
1
|
-
:root
|
|
1
|
+
:root {
|
|
2
|
+
--input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
3
|
+
--border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
4
|
+
|
|
5
|
+
--ring: oklch(0.702 0.183 293.541); /* --color-violet-400 */
|
|
6
|
+
|
|
7
|
+
--background: oklch(1 0 0); /* --color-zinc-50 */
|
|
8
|
+
--foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
9
|
+
|
|
10
|
+
--primary: oklch(0.541 0.281 293.009); /* --color-violet-600 */
|
|
11
|
+
--primary-foreground: oklch(0.969 0.016 293.756); /* --color-violet-50 */
|
|
12
|
+
|
|
13
|
+
--secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
14
|
+
--secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
15
|
+
|
|
16
|
+
--destructive: oklch(0.577 0.245 27.325); /* --color-red-600 */
|
|
17
|
+
|
|
18
|
+
--accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
19
|
+
--accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
20
|
+
|
|
21
|
+
--muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
22
|
+
--muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
23
|
+
|
|
24
|
+
--popover: oklch(1 0 0); /* --color-zinc-50 */
|
|
25
|
+
--popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
26
|
+
|
|
27
|
+
--card: oklch(1 0 0); /* --color-zinc-50 */
|
|
28
|
+
--card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
29
|
+
|
|
30
|
+
--sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
31
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
32
|
+
|
|
33
|
+
--sidebar-primary: oklch(0.541 0.281 293.009); /* --color-violet-600 */
|
|
34
|
+
--sidebar-primary-foreground: oklch(0.969 0.016 293.756); /* --color-violet-50 */
|
|
35
|
+
|
|
36
|
+
--sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
38
|
+
|
|
39
|
+
--sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
40
|
+
--sidebar-ring: oklch(0.702 0.183 293.541); /* --color-violet-400 */
|
|
41
|
+
|
|
42
|
+
--chart-1: oklch(0.811 0.111 293.571); /* --color-violet-300 */
|
|
43
|
+
--chart-2: oklch(0.606 0.25 292.717); /* --color-violet-500 */
|
|
44
|
+
--chart-3: oklch(0.541 0.281 293.009); /* --color-violet-600 */
|
|
45
|
+
--chart-4: oklch(0.491 0.27 292.581); /* --color-violet-700 */
|
|
46
|
+
--chart-5: oklch(0.432 0.232 292.759); /* --color-violet-800 */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--input: oklch(1 0 0 / 15%); /* --color-white */
|
|
51
|
+
--border: oklch(1 0 0 / 10%); /* --color-white */
|
|
52
|
+
|
|
53
|
+
--ring: oklch(0.38 0.189 293.745); /* --color-violet-900 */
|
|
54
|
+
|
|
55
|
+
--background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
56
|
+
--foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
57
|
+
|
|
58
|
+
--primary: oklch(0.606 0.25 292.717); /* --color-violet-500 */
|
|
59
|
+
--primary-foreground: oklch(0.969 0.016 293.756); /* --color-violet-50 */
|
|
60
|
+
|
|
61
|
+
--secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
62
|
+
--secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
63
|
+
|
|
64
|
+
--destructive: oklch(0.704 0.191 22.216); /* --color-red-400 */
|
|
65
|
+
|
|
66
|
+
--accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
67
|
+
--accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
68
|
+
|
|
69
|
+
--muted: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
70
|
+
--muted-foreground: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
71
|
+
|
|
72
|
+
--popover: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
73
|
+
--popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
74
|
+
|
|
75
|
+
--card: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
76
|
+
--card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
77
|
+
|
|
78
|
+
--sidebar: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
79
|
+
--sidebar-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
80
|
+
|
|
81
|
+
--sidebar-primary: oklch(0.606 0.25 292.717); /* --color-violet-500 */
|
|
82
|
+
--sidebar-primary-foreground: oklch(0.969 0.016 293.756); /* --color-violet-50 */
|
|
83
|
+
|
|
84
|
+
--sidebar-accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
85
|
+
--sidebar-accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
86
|
+
|
|
87
|
+
--sidebar-border: oklch(1 0 0 / 10%); /* --color-white */
|
|
88
|
+
--sidebar-ring: oklch(0.38 0.189 293.745); /* --color-violet-900 */
|
|
89
|
+
|
|
90
|
+
--chart-1: oklch(0.811 0.111 293.571); /* --color-violet-300 */
|
|
91
|
+
--chart-2: oklch(0.606 0.25 292.717); /* --color-violet-500 */
|
|
92
|
+
--chart-3: oklch(0.541 0.281 293.009); /* --color-violet-600 */
|
|
93
|
+
--chart-4: oklch(0.491 0.27 292.581); /* --color-violet-700 */
|
|
94
|
+
--chart-5: oklch(0.432 0.232 292.759); /* --color-violet-800 */
|
|
95
|
+
}
|
package/dist/css/yellow.css
CHANGED
|
@@ -1 +1,95 @@
|
|
|
1
|
-
:root
|
|
1
|
+
:root {
|
|
2
|
+
--input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
3
|
+
--border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
4
|
+
|
|
5
|
+
--ring: oklch(0.852 0.199 91.936); /* --color-yellow-400 */
|
|
6
|
+
|
|
7
|
+
--background: oklch(1 0 0); /* --color-zinc-50 */
|
|
8
|
+
--foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
9
|
+
|
|
10
|
+
--primary: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
|
|
11
|
+
--primary-foreground: oklch(0.987 0.026 102.212); /* --color-yellow-50 */
|
|
12
|
+
|
|
13
|
+
--secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
14
|
+
--secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
15
|
+
|
|
16
|
+
--destructive: oklch(0.577 0.245 27.325); /* --color-red-600 */
|
|
17
|
+
|
|
18
|
+
--accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
19
|
+
--accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
20
|
+
|
|
21
|
+
--muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
22
|
+
--muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
23
|
+
|
|
24
|
+
--popover: oklch(1 0 0); /* --color-zinc-50 */
|
|
25
|
+
--popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
26
|
+
|
|
27
|
+
--card: oklch(1 0 0); /* --color-zinc-50 */
|
|
28
|
+
--card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
29
|
+
|
|
30
|
+
--sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
31
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
32
|
+
|
|
33
|
+
--sidebar-primary: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
|
|
34
|
+
--sidebar-primary-foreground: oklch(0.987 0.026 102.212); /* --color-yellow-50 */
|
|
35
|
+
|
|
36
|
+
--sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
38
|
+
|
|
39
|
+
--sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
40
|
+
--sidebar-ring: oklch(0.852 0.199 91.936); /* --color-yellow-400 */
|
|
41
|
+
|
|
42
|
+
--chart-1: oklch(0.905 0.182 98.111); /* --color-yellow-300 */
|
|
43
|
+
--chart-2: oklch(0.795 0.184 86.047); /* --color-yellow-500 */
|
|
44
|
+
--chart-3: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
|
|
45
|
+
--chart-4: oklch(0.554 0.135 66.442); /* --color-yellow-700 */
|
|
46
|
+
--chart-5: oklch(0.476 0.114 61.907); /* --color-yellow-800 */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--input: oklch(1 0 0 / 15%); /* --color-white */
|
|
51
|
+
--border: oklch(1 0 0 / 10%); /* --color-white */
|
|
52
|
+
|
|
53
|
+
--ring: oklch(0.421 0.095 57.708); /* --color-yellow-900 */
|
|
54
|
+
|
|
55
|
+
--background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
56
|
+
--foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
57
|
+
|
|
58
|
+
--primary: oklch(0.795 0.184 86.047); /* --color-yellow-500 */
|
|
59
|
+
--primary-foreground: oklch(0.421 0.095 57.708); /* --color-yellow-900 */
|
|
60
|
+
|
|
61
|
+
--secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
62
|
+
--secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
63
|
+
|
|
64
|
+
--destructive: oklch(0.704 0.191 22.216); /* --color-red-400 */
|
|
65
|
+
|
|
66
|
+
--accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
67
|
+
--accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
68
|
+
|
|
69
|
+
--muted: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
70
|
+
--muted-foreground: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
71
|
+
|
|
72
|
+
--popover: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
73
|
+
--popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
74
|
+
|
|
75
|
+
--card: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
76
|
+
--card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
77
|
+
|
|
78
|
+
--sidebar: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
79
|
+
--sidebar-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
80
|
+
|
|
81
|
+
--sidebar-primary: oklch(0.795 0.184 86.047); /* --color-yellow-500 */
|
|
82
|
+
--sidebar-primary-foreground: oklch(0.987 0.026 102.212); /* --color-yellow-50 */
|
|
83
|
+
|
|
84
|
+
--sidebar-accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
85
|
+
--sidebar-accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
86
|
+
|
|
87
|
+
--sidebar-border: oklch(1 0 0 / 10%); /* --color-white */
|
|
88
|
+
--sidebar-ring: oklch(0.421 0.095 57.708); /* --color-yellow-900 */
|
|
89
|
+
|
|
90
|
+
--chart-1: oklch(0.905 0.182 98.111); /* --color-yellow-300 */
|
|
91
|
+
--chart-2: oklch(0.795 0.184 86.047); /* --color-yellow-500 */
|
|
92
|
+
--chart-3: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
|
|
93
|
+
--chart-4: oklch(0.554 0.135 66.442); /* --color-yellow-700 */
|
|
94
|
+
--chart-5: oklch(0.476 0.114 61.907); /* --color-yellow-800 */
|
|
95
|
+
}
|
package/dist/css/zinc.css
CHANGED
|
@@ -1 +1,95 @@
|
|
|
1
|
-
:root
|
|
1
|
+
:root {
|
|
2
|
+
--input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
3
|
+
--border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
4
|
+
|
|
5
|
+
--ring: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
6
|
+
|
|
7
|
+
--background: oklch(1 0 0); /* --color-zinc-50 */
|
|
8
|
+
--foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
9
|
+
|
|
10
|
+
--primary: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
11
|
+
--primary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
12
|
+
|
|
13
|
+
--secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
14
|
+
--secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
15
|
+
|
|
16
|
+
--destructive: oklch(0.577 0.245 27.325); /* --color-red-600 */
|
|
17
|
+
|
|
18
|
+
--accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
19
|
+
--accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
20
|
+
|
|
21
|
+
--muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
22
|
+
--muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
23
|
+
|
|
24
|
+
--popover: oklch(1 0 0); /* --color-zinc-50 */
|
|
25
|
+
--popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
26
|
+
|
|
27
|
+
--card: oklch(1 0 0); /* --color-zinc-50 */
|
|
28
|
+
--card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
29
|
+
|
|
30
|
+
--sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
31
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
32
|
+
|
|
33
|
+
--sidebar-primary: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
34
|
+
--sidebar-primary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
35
|
+
|
|
36
|
+
--sidebar-accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
38
|
+
|
|
39
|
+
--sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
40
|
+
--sidebar-ring: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
41
|
+
|
|
42
|
+
--chart-1: oklch(0.646 0.222 41.116); /* --color-orange-600 */
|
|
43
|
+
--chart-2: oklch(0.6 0.118 184.704); /* --color-teal-600 */
|
|
44
|
+
--chart-3: oklch(0.398 0.07 227.392); /* --color-cyan-900 */
|
|
45
|
+
--chart-4: oklch(0.828 0.189 84.429); /* --color-amber-400 */
|
|
46
|
+
--chart-5: oklch(0.769 0.188 70.08); /* --color-amber-500 */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.dark {
|
|
50
|
+
--input: oklch(1 0 0 / 15%); /* --color-white */
|
|
51
|
+
--border: oklch(1 0 0 / 10%); /* --color-white */
|
|
52
|
+
|
|
53
|
+
--ring: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
54
|
+
|
|
55
|
+
--background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
|
|
56
|
+
--foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
57
|
+
|
|
58
|
+
--primary: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
|
|
59
|
+
--primary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
60
|
+
|
|
61
|
+
--secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
62
|
+
--secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
63
|
+
|
|
64
|
+
--destructive: oklch(0.704 0.191 22.216); /* --color-red-400 */
|
|
65
|
+
|
|
66
|
+
--accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
67
|
+
--accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
68
|
+
|
|
69
|
+
--muted: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
70
|
+
--muted-foreground: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
|
|
71
|
+
|
|
72
|
+
--popover: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
73
|
+
--popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
74
|
+
|
|
75
|
+
--card: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
76
|
+
--card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
77
|
+
|
|
78
|
+
--sidebar: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
|
|
79
|
+
--sidebar-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
80
|
+
|
|
81
|
+
--sidebar-primary: oklch(0.488 0.243 264.376); /* --color-blue-700 */
|
|
82
|
+
--sidebar-primary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
83
|
+
|
|
84
|
+
--sidebar-accent: oklch(0.274 0.006 286.033); /* --color-zinc-800 */
|
|
85
|
+
--sidebar-accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */
|
|
86
|
+
|
|
87
|
+
--sidebar-border: oklch(1 0 0 / 10%); /* --color-white */
|
|
88
|
+
--sidebar-ring: oklch(0.552 0.016 285.938); /* --color-zinc-500 */
|
|
89
|
+
|
|
90
|
+
--chart-1: oklch(0.488 0.243 264.376); /* --color-blue-700 */
|
|
91
|
+
--chart-2: oklch(0.696 0.17 162.48); /* --color-emerald-500 */
|
|
92
|
+
--chart-3: oklch(0.769 0.188 70.08); /* --color-amber-500 */
|
|
93
|
+
--chart-4: oklch(0.627 0.265 303.9); /* --color-purple-500 */
|
|
94
|
+
--chart-5: oklch(0.645 0.246 16.439); /* --color-rose-500 */
|
|
95
|
+
}
|
|
@@ -1,2 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
useAnimatedValue: ()=>useAnimatedValue
|
|
29
|
+
});
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
function useAnimatedValue(targetValue, duration, animate) {
|
|
32
|
+
const actualTargetValue = targetValue ?? 0;
|
|
33
|
+
const [animatedValue, setAnimatedValue] = (0, external_react_namespaceObject.useState)(actualTargetValue);
|
|
34
|
+
const animatedValueRef = (0, external_react_namespaceObject.useRef)(actualTargetValue);
|
|
35
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
36
|
+
animatedValueRef.current = animatedValue;
|
|
37
|
+
}, [
|
|
38
|
+
animatedValue
|
|
39
|
+
]);
|
|
40
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
41
|
+
if (!animate) return void setAnimatedValue(actualTargetValue);
|
|
42
|
+
const currentValue = animatedValueRef.current;
|
|
43
|
+
const valueRange = actualTargetValue - currentValue;
|
|
44
|
+
const startTime = performance.now();
|
|
45
|
+
if (duration <= 0 || 0 === valueRange) return void setAnimatedValue(actualTargetValue);
|
|
46
|
+
let animationFrame;
|
|
47
|
+
const animateValue = (currentTime)=>{
|
|
48
|
+
const elapsedTime = currentTime - startTime;
|
|
49
|
+
if (elapsedTime >= duration) setAnimatedValue(actualTargetValue);
|
|
50
|
+
else {
|
|
51
|
+
const progress = elapsedTime / duration;
|
|
52
|
+
const easeProgress = 1 - (1 - progress) * (1 - progress);
|
|
53
|
+
const nextValue = currentValue + valueRange * easeProgress;
|
|
54
|
+
setAnimatedValue(nextValue);
|
|
55
|
+
animationFrame = requestAnimationFrame(animateValue);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
animationFrame = requestAnimationFrame(animateValue);
|
|
59
|
+
return ()=>{
|
|
60
|
+
cancelAnimationFrame(animationFrame);
|
|
61
|
+
};
|
|
62
|
+
}, [
|
|
63
|
+
actualTargetValue,
|
|
64
|
+
duration,
|
|
65
|
+
animate
|
|
66
|
+
]);
|
|
67
|
+
return Math.round(animatedValue);
|
|
68
|
+
}
|
|
69
|
+
exports.useAnimatedValue = __webpack_exports__.useAnimatedValue;
|
|
70
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
71
|
+
"useAnimatedValue"
|
|
72
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
73
|
+
Object.defineProperty(exports, '__esModule', {
|
|
74
|
+
value: true
|
|
75
|
+
});
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Produce a smoothly animated numeric value in response to changes.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param animate - Enables the animation effect. If false, the value updates immediately
|
|
4
|
+
* Applies a time-based easing (easeOutQuad) between the current and target values
|
|
5
|
+
* over the specified duration. When disabled, the value updates immediately.
|
|
7
6
|
*
|
|
8
|
-
* @
|
|
7
|
+
* @param targetValue - Target number to animate toward; null resolves to 0.
|
|
8
|
+
* @param duration - Animation duration in milliseconds.
|
|
9
|
+
* @param animate - When false, bypasses animation and sets the value directly.
|
|
10
|
+
* @returns The current (rounded) animated value.
|
|
9
11
|
*
|
|
10
12
|
* @example
|
|
11
13
|
* ```tsx
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* // Display the animated value
|
|
16
|
-
* return <div>{animatedValue}%</div>;
|
|
14
|
+
* const value = useAnimatedValue(75, 1000, true);
|
|
15
|
+
* return <div>{value}%</div>;
|
|
17
16
|
* ```
|
|
18
17
|
*/
|
|
19
18
|
export declare function useAnimatedValue(targetValue: null | number, duration: number, animate?: boolean): number;
|
|
@@ -1,2 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useEffect
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
function useAnimatedValue(targetValue, duration, animate) {
|
|
4
|
+
const actualTargetValue = targetValue ?? 0;
|
|
5
|
+
const [animatedValue, setAnimatedValue] = useState(actualTargetValue);
|
|
6
|
+
const animatedValueRef = useRef(actualTargetValue);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
animatedValueRef.current = animatedValue;
|
|
9
|
+
}, [
|
|
10
|
+
animatedValue
|
|
11
|
+
]);
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
if (!animate) return void setAnimatedValue(actualTargetValue);
|
|
14
|
+
const currentValue = animatedValueRef.current;
|
|
15
|
+
const valueRange = actualTargetValue - currentValue;
|
|
16
|
+
const startTime = performance.now();
|
|
17
|
+
if (duration <= 0 || 0 === valueRange) return void setAnimatedValue(actualTargetValue);
|
|
18
|
+
let animationFrame;
|
|
19
|
+
const animateValue = (currentTime)=>{
|
|
20
|
+
const elapsedTime = currentTime - startTime;
|
|
21
|
+
if (elapsedTime >= duration) setAnimatedValue(actualTargetValue);
|
|
22
|
+
else {
|
|
23
|
+
const progress = elapsedTime / duration;
|
|
24
|
+
const easeProgress = 1 - (1 - progress) * (1 - progress);
|
|
25
|
+
const nextValue = currentValue + valueRange * easeProgress;
|
|
26
|
+
setAnimatedValue(nextValue);
|
|
27
|
+
animationFrame = requestAnimationFrame(animateValue);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
animationFrame = requestAnimationFrame(animateValue);
|
|
31
|
+
return ()=>{
|
|
32
|
+
cancelAnimationFrame(animationFrame);
|
|
33
|
+
};
|
|
34
|
+
}, [
|
|
35
|
+
actualTargetValue,
|
|
36
|
+
duration,
|
|
37
|
+
animate
|
|
38
|
+
]);
|
|
39
|
+
return Math.round(animatedValue);
|
|
40
|
+
}
|
|
41
|
+
export { useAnimatedValue };
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
useCopyToClipboard: ()=>useCopyToClipboard
|
|
29
|
+
});
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
function useCopyToClipboard({ onCopy, timeout = 2000 } = {}) {
|
|
32
|
+
const [isCopied, setIsCopied] = (0, external_react_namespaceObject.useState)(false);
|
|
33
|
+
const copyToClipboard = async (value)=>{
|
|
34
|
+
if ("u" < typeof window || !("clipboard" in navigator) || "function" != typeof navigator.clipboard.writeText) return;
|
|
35
|
+
if (!value) return;
|
|
36
|
+
try {
|
|
37
|
+
await navigator.clipboard.writeText(value);
|
|
38
|
+
setIsCopied(true);
|
|
39
|
+
if (onCopy) onCopy();
|
|
40
|
+
setTimeout(()=>{
|
|
41
|
+
setIsCopied(false);
|
|
42
|
+
}, timeout);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(error);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
copyToClipboard,
|
|
49
|
+
isCopied
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.useCopyToClipboard = __webpack_exports__.useCopyToClipboard;
|
|
53
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
54
|
+
"useCopyToClipboard"
|
|
55
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provide clipboard copy capability with a transient copied state.
|
|
3
|
+
*
|
|
4
|
+
* Internally uses the Clipboard API when available and sets a temporary
|
|
5
|
+
* `isCopied` flag for UI feedback. A custom callback may be invoked upon copy.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Configuration options.
|
|
8
|
+
* - onCopy: Callback invoked after a successful copy.
|
|
9
|
+
* - timeout: Duration in milliseconds to keep `isCopied` true. Defaults to 2000.
|
|
10
|
+
* @returns An object with a `copyToClipboard` function and an `isCopied` flag.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { copyToClipboard, isCopied } = useCopyToClipboard({ timeout: 1500 });
|
|
15
|
+
* <button onClick={() => copyToClipboard("Hello")}>{isCopied ? "Copied" : "Copy"}</button>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
1
18
|
export declare function useCopyToClipboard({ onCopy, timeout, }?: {
|
|
2
19
|
onCopy?: () => void;
|
|
3
20
|
timeout?: number;
|