@codefast/ui 0.3.9 → 0.3.10
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 +11 -0
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +126 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +74 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +12 -19
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +9 -9
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +8 -8
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +10 -12
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +10 -12
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.d.ts +3 -3
- 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 +18 -1
- 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 +8 -12
- 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 +130 -131
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +385 -38
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)) 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,4 +1,21 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
18
|
+
export declare function useCopyToClipboard({ onCopy, timeout }?: {
|
|
2
19
|
onCopy?: () => void;
|
|
3
20
|
timeout?: number;
|
|
4
21
|
}): {
|
|
@@ -1,2 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useState
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
function useCopyToClipboard({ onCopy, timeout = 2000 } = {}) {
|
|
4
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
5
|
+
const copyToClipboard = async (value)=>{
|
|
6
|
+
if ("u" < typeof window || !('clipboard' in navigator)) return;
|
|
7
|
+
if (!value) return;
|
|
8
|
+
try {
|
|
9
|
+
await navigator.clipboard.writeText(value);
|
|
10
|
+
setIsCopied(true);
|
|
11
|
+
if (onCopy) onCopy();
|
|
12
|
+
setTimeout(()=>{
|
|
13
|
+
setIsCopied(false);
|
|
14
|
+
}, timeout);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error(error);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
copyToClipboard,
|
|
21
|
+
isCopied
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export { useCopyToClipboard };
|
|
@@ -1,2 +1,40 @@
|
|
|
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
|
+
useIsMobile: ()=>useIsMobile
|
|
29
|
+
});
|
|
30
|
+
const external_use_media_query_cjs_namespaceObject = require("./use-media-query.cjs");
|
|
31
|
+
function useIsMobile(mobileBreakpoint = 768) {
|
|
32
|
+
return (0, external_use_media_query_cjs_namespaceObject.useMediaQuery)(`(max-width: ${(mobileBreakpoint - 1).toString()}px)`);
|
|
33
|
+
}
|
|
34
|
+
exports.useIsMobile = __webpack_exports__.useIsMobile;
|
|
35
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
36
|
+
"useIsMobile"
|
|
37
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
38
|
+
Object.defineProperty(exports, '__esModule', {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Determine whether the current viewport should be treated as mobile.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Uses {@link useMediaQuery} to evaluate a max-width media query derived from the
|
|
5
|
+
* provided breakpoint. By default, widths below 768px are considered mobile.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
7
|
+
* @param mobileBreakpoint - Pixel width used as the mobile breakpoint. Values strictly
|
|
8
|
+
* less than this breakpoint are treated as mobile. Defaults to 768.
|
|
9
|
+
* @returns true when the viewport width is less than the given breakpoint; otherwise false.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const isMobile = useIsMobile();
|
|
14
|
+
* if (isMobile) {
|
|
15
|
+
* // Render compact layout
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
9
18
|
*/
|
|
10
|
-
export declare function useIsMobile(): boolean;
|
|
19
|
+
export declare function useIsMobile(mobileBreakpoint?: number): boolean;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useMediaQuery
|
|
2
|
+
import { useMediaQuery } from "./use-media-query.js";
|
|
3
|
+
function useIsMobile(mobileBreakpoint = 768) {
|
|
4
|
+
return useMediaQuery(`(max-width: ${(mobileBreakpoint - 1).toString()}px)`);
|
|
5
|
+
}
|
|
6
|
+
export { useIsMobile };
|
|
@@ -1,2 +1,57 @@
|
|
|
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
|
+
useMediaQuery: ()=>useMediaQuery
|
|
29
|
+
});
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
function useMediaQuery(query) {
|
|
32
|
+
const [matches, setMatches] = (0, external_react_namespaceObject.useState)(()=>{
|
|
33
|
+
if ("u" > typeof window && 'function' == typeof window.matchMedia) return window.matchMedia(query).matches;
|
|
34
|
+
return false;
|
|
35
|
+
});
|
|
36
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
37
|
+
if ("u" < typeof window) return;
|
|
38
|
+
const mediaQueryList = window.matchMedia(query);
|
|
39
|
+
const onChange = (event)=>{
|
|
40
|
+
setMatches(event.matches);
|
|
41
|
+
};
|
|
42
|
+
mediaQueryList.addEventListener('change', onChange);
|
|
43
|
+
return ()=>{
|
|
44
|
+
mediaQueryList.removeEventListener('change', onChange);
|
|
45
|
+
};
|
|
46
|
+
}, [
|
|
47
|
+
query
|
|
48
|
+
]);
|
|
49
|
+
return matches;
|
|
50
|
+
}
|
|
51
|
+
exports.useMediaQuery = __webpack_exports__.useMediaQuery;
|
|
52
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
53
|
+
"useMediaQuery"
|
|
54
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
55
|
+
Object.defineProperty(exports, '__esModule', {
|
|
56
|
+
value: true
|
|
57
|
+
});
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Subscribe to a CSS media query and receive its match state.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Evaluates the query immediately (when supported) and updates on changes
|
|
5
|
+
* via an event listener.
|
|
6
|
+
*
|
|
7
|
+
* @param query - A valid media query string (e.g., "(max-width: 768px)").
|
|
8
|
+
* @returns true when the media query currently matches; otherwise false.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const isNarrow = useMediaQuery("(max-width: 768px)");
|
|
13
|
+
* ```
|
|
6
14
|
*/
|
|
7
15
|
export declare function useMediaQuery(query: string): boolean;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useEffect
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
function useMediaQuery(query) {
|
|
4
|
+
const [matches, setMatches] = useState(()=>{
|
|
5
|
+
if ("u" > typeof window && 'function' == typeof window.matchMedia) return window.matchMedia(query).matches;
|
|
6
|
+
return false;
|
|
7
|
+
});
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
if ("u" < typeof window) return;
|
|
10
|
+
const mediaQueryList = window.matchMedia(query);
|
|
11
|
+
const onChange = (event)=>{
|
|
12
|
+
setMatches(event.matches);
|
|
13
|
+
};
|
|
14
|
+
mediaQueryList.addEventListener('change', onChange);
|
|
15
|
+
return ()=>{
|
|
16
|
+
mediaQueryList.removeEventListener('change', onChange);
|
|
17
|
+
};
|
|
18
|
+
}, [
|
|
19
|
+
query
|
|
20
|
+
]);
|
|
21
|
+
return matches;
|
|
22
|
+
}
|
|
23
|
+
export { useMediaQuery };
|
|
@@ -1,2 +1,57 @@
|
|
|
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
|
+
useMutationObserver: ()=>useMutationObserver
|
|
29
|
+
});
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const defaultOptions = {
|
|
32
|
+
attributes: true,
|
|
33
|
+
characterData: true,
|
|
34
|
+
childList: true,
|
|
35
|
+
subtree: true
|
|
36
|
+
};
|
|
37
|
+
function useMutationObserver(ref, callback, options = defaultOptions) {
|
|
38
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
39
|
+
if (!ref.current) return;
|
|
40
|
+
const observer = new MutationObserver(callback);
|
|
41
|
+
observer.observe(ref.current, options);
|
|
42
|
+
return ()=>{
|
|
43
|
+
observer.disconnect();
|
|
44
|
+
};
|
|
45
|
+
}, [
|
|
46
|
+
ref,
|
|
47
|
+
callback,
|
|
48
|
+
options
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
exports.useMutationObserver = __webpack_exports__.useMutationObserver;
|
|
52
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
53
|
+
"useMutationObserver"
|
|
54
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
55
|
+
Object.defineProperty(exports, '__esModule', {
|
|
56
|
+
value: true
|
|
57
|
+
});
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import type { RefObject } from
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* function when mutations occur in the observed elements.
|
|
3
|
+
* Observe DOM mutations on a referenced element and invoke a callback.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param options - Configuration options for the MutationObserver, defaults to watching all changes
|
|
9
|
-
* @returns void
|
|
5
|
+
* Attaches a MutationObserver to the provided element reference with the given
|
|
6
|
+
* options and calls the callback whenever mutations occur.
|
|
10
7
|
*
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* when mutations occur.
|
|
8
|
+
* @param ref - Ref to the target HTMLElement to observe.
|
|
9
|
+
* @param callback - Mutation callback invoked with observed records.
|
|
10
|
+
* @param options - Observer configuration. Defaults watch attributes, characterData, childList, subtree.
|
|
11
|
+
* @returns void
|
|
16
12
|
*
|
|
17
13
|
* @see [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)
|
|
18
14
|
*/
|