@arolariu/components 0.1.2 → 0.3.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/DEBUGGING.md +396 -396
- package/LICENSE.md +21 -21
- package/changelog.md +120 -118
- package/dist/components/ui/accordion.d.ts +6 -6
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +20 -28
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +19 -13
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +40 -63
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +7 -8
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +18 -21
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +1 -2
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -8
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +5 -5
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +17 -20
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/background-beams.d.ts.map +1 -1
- package/dist/components/ui/background-beams.js +6 -6
- package/dist/components/ui/background-beams.js.map +1 -1
- package/dist/components/ui/badge.d.ts +7 -7
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +9 -12
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +17 -9
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +32 -39
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble-background.d.ts +1 -1
- package/dist/components/ui/bubble-background.d.ts.map +1 -1
- package/dist/components/ui/bubble-background.js +13 -13
- package/dist/components/ui/bubble-background.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +13 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +47 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +8 -7
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +16 -15
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +22 -22
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +33 -46
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +7 -8
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +30 -21
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts +37 -29
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +29 -27
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +11 -13
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +4 -5
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +3 -20
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts +79 -17
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +52 -77
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +23 -21
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +60 -104
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/counting-number.d.ts +1 -1
- package/dist/components/ui/counting-number.d.ts.map +1 -1
- package/dist/components/ui/counting-number.js +4 -3
- package/dist/components/ui/counting-number.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +17 -13
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +38 -66
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dot-background.d.ts +10 -17
- package/dist/components/ui/dot-background.d.ts.map +1 -1
- package/dist/components/ui/dot-background.js +2 -2
- package/dist/components/ui/dot-background.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +20 -11
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +37 -62
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +23 -21
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +65 -109
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +3 -3
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +13 -16
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +65 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +135 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/fireworks-background.d.ts.map +1 -1
- package/dist/components/ui/fireworks-background.js +1 -1
- package/dist/components/ui/fireworks-background.js.map +1 -1
- package/dist/components/ui/flip-button.d.ts +1 -1
- package/dist/components/ui/flip-button.d.ts.map +1 -1
- package/dist/components/ui/flip-button.js +3 -3
- package/dist/components/ui/flip-button.js.map +1 -1
- package/dist/components/ui/form.d.ts +7 -8
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +29 -28
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/gradient-background.d.ts +1 -1
- package/dist/components/ui/gradient-background.d.ts.map +1 -1
- package/dist/components/ui/gradient-background.js +2 -2
- package/dist/components/ui/gradient-background.js.map +1 -1
- package/dist/components/ui/gradient-text.d.ts +1 -1
- package/dist/components/ui/gradient-text.d.ts.map +1 -1
- package/dist/components/ui/gradient-text.js +5 -5
- package/dist/components/ui/gradient-text.js.map +1 -1
- package/dist/components/ui/highlight-text.d.ts +1 -1
- package/dist/components/ui/highlight-text.d.ts.map +1 -1
- package/dist/components/ui/highlight-text.js +3 -3
- package/dist/components/ui/highlight-text.js.map +1 -1
- package/dist/components/ui/hole-background.d.ts.map +1 -1
- package/dist/components/ui/hole-background.js +11 -10
- package/dist/components/ui/hole-background.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +5 -5
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +12 -26
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +91 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +31 -8
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +24 -27
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +7 -8
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +3 -2
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +9 -8
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +20 -18
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +75 -95
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +11 -13
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +39 -58
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +25 -10
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +33 -41
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +6 -6
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +10 -26
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +2 -2
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +8 -10
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +3 -3
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +17 -20
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +21 -6
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +9 -21
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/ripple-button.d.ts +1 -1
- package/dist/components/ui/ripple-button.d.ts.map +1 -1
- package/dist/components/ui/ripple-button.js +4 -4
- package/dist/components/ui/ripple-button.js.map +1 -1
- package/dist/components/ui/scratcher.d.ts.map +1 -1
- package/dist/components/ui/scratcher.js +7 -5
- package/dist/components/ui/scratcher.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +3 -3
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +14 -18
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +11 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +55 -78
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +7 -8
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +24 -12
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +56 -68
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +35 -39
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +115 -124
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +2 -3
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +12 -31
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +4 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +8 -5
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +8 -10
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +9 -9
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +40 -49
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +6 -6
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +18 -27
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +7 -8
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +9 -4
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +12 -16
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +9 -6
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +8 -9
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +6 -6
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +14 -39
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typewriter.d.ts.map +1 -1
- package/dist/components/ui/typewriter.js +9 -9
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/hooks/useIsMobile.d.ts +2 -5
- package/dist/hooks/useIsMobile.d.ts.map +1 -1
- package/dist/hooks/useIsMobile.js +1 -1
- package/dist/hooks/useIsMobile.js.map +1 -1
- package/dist/hooks/useWindowSize.d.ts +0 -1
- package/dist/hooks/useWindowSize.d.ts.map +1 -1
- package/dist/hooks/useWindowSize.js +1 -1
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/index.css +841 -1128
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +43 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/lib/utilities.d.ts +9 -0
- package/dist/lib/utilities.d.ts.map +1 -0
- package/dist/lib/{utils.js → utilities.js} +1 -1
- package/dist/lib/utilities.js.map +1 -0
- package/package.json +121 -90
- package/{README.md → readme.md} +627 -627
- package/src/components/ui/accordion.tsx +55 -66
- package/src/components/ui/alert-dialog.tsx +124 -160
- package/src/components/ui/alert.tsx +56 -69
- package/src/components/ui/aspect-ratio.tsx +7 -12
- package/src/components/ui/avatar.tsx +43 -53
- package/src/components/ui/background-beams.tsx +145 -142
- package/src/components/ui/badge.tsx +39 -48
- package/src/components/ui/breadcrumb.tsx +94 -117
- package/src/components/ui/bubble-background.tsx +170 -189
- package/src/components/ui/button-group.tsx +69 -0
- package/src/components/ui/button.tsx +55 -61
- package/src/components/ui/calendar.tsx +175 -216
- package/src/components/ui/card.tsx +64 -97
- package/src/components/ui/carousel.tsx +216 -241
- package/src/components/ui/chart.tsx +293 -385
- package/src/components/ui/checkbox.tsx +27 -32
- package/src/components/ui/collapsible.tsx +11 -34
- package/src/components/ui/command.tsx +138 -184
- package/src/components/ui/context-menu.tsx +186 -255
- package/src/components/ui/counting-number.tsx +92 -108
- package/src/components/ui/dialog.tsx +106 -146
- package/src/components/ui/dot-background.tsx +153 -158
- package/src/components/ui/drawer.tsx +105 -141
- package/src/components/ui/dropdown-menu.tsx +188 -260
- package/src/components/ui/dropdrawer.tsx +865 -973
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +198 -0
- package/src/components/ui/fireworks-background.tsx +325 -378
- package/src/components/ui/flip-button.tsx +89 -110
- package/src/components/ui/form.tsx +144 -174
- package/src/components/ui/gradient-background.tsx +30 -43
- package/src/components/ui/gradient-text.tsx +62 -65
- package/src/components/ui/highlight-text.tsx +54 -71
- package/src/components/ui/hole-background.tsx +326 -361
- package/src/components/ui/hover-card.tsx +29 -44
- package/src/components/ui/input-group.tsx +145 -0
- package/src/components/ui/input-otp.tsx +66 -77
- package/src/components/ui/input.tsx +21 -22
- package/src/components/ui/item.tsx +163 -0
- package/src/components/ui/kbd.tsx +31 -0
- package/src/components/ui/label.tsx +23 -24
- package/src/components/ui/menubar.tsx +233 -279
- package/src/components/ui/navigation-menu.tsx +120 -171
- package/src/components/ui/pagination.tsx +92 -129
- package/src/components/ui/popover.tsx +33 -48
- package/src/components/ui/progress.tsx +24 -31
- package/src/components/ui/radio-group.tsx +43 -45
- package/src/components/ui/resizable.tsx +38 -56
- package/src/components/ui/ripple-button.tsx +90 -111
- package/src/components/ui/scratcher.tsx +167 -171
- package/src/components/ui/scroll-area.tsx +42 -58
- package/src/components/ui/select.tsx +145 -191
- package/src/components/ui/separator.tsx +26 -28
- package/src/components/ui/sheet.tsx +112 -145
- package/src/components/ui/sidebar.tsx +664 -729
- package/src/components/ui/skeleton.tsx +15 -19
- package/src/components/ui/slider.tsx +23 -63
- package/src/components/ui/sonner.tsx +36 -26
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +28 -31
- package/src/components/ui/table.tsx +93 -119
- package/src/components/ui/tabs.tsx +54 -66
- package/src/components/ui/textarea.tsx +21 -20
- package/src/components/ui/toggle-group.tsx +53 -73
- package/src/components/ui/toggle.tsx +44 -47
- package/src/components/ui/tooltip.tsx +32 -61
- package/src/components/ui/typewriter.tsx +173 -188
- package/src/hooks/useIsMobile.tsx +42 -45
- package/src/hooks/useWindowSize.tsx +66 -72
- package/src/index.css +67 -67
- package/src/index.ts +342 -408
- package/src/lib/utilities.ts +12 -0
- package/dist/lib/utils.d.ts +0 -7
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/src/lib/utils.ts +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
4
3
|
import { useInView, useMotionValue, useSpring } from "motion/react";
|
|
4
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
5
5
|
const CountingNumber = /*#__PURE__*/ forwardRef(({ number, fromNumber = 0, padStart = false, inView = false, inViewMargin = "0px", inViewOnce = true, decimalSeparator = ".", transition = {
|
|
6
6
|
stiffness: 90,
|
|
7
7
|
damping: 50
|
|
@@ -9,7 +9,7 @@ const CountingNumber = /*#__PURE__*/ forwardRef(({ number, fromNumber = 0, padSt
|
|
|
9
9
|
const localRef = useRef(null);
|
|
10
10
|
useImperativeHandle(ref, ()=>localRef.current);
|
|
11
11
|
const numberStr = number.toString();
|
|
12
|
-
const decimals = "number" == typeof decimalPlaces ? decimalPlaces : numberStr.includes(".") ? numberStr
|
|
12
|
+
const decimals = "number" == typeof decimalPlaces ? decimalPlaces : numberStr.includes(".") ? numberStr?.split(".")[1].length : 0;
|
|
13
13
|
const motionVal = useMotionValue(fromNumber);
|
|
14
14
|
const springVal = useSpring(motionVal, transition);
|
|
15
15
|
const inViewResult = useInView(localRef, {
|
|
@@ -47,7 +47,8 @@ const CountingNumber = /*#__PURE__*/ forwardRef(({ number, fromNumber = 0, padSt
|
|
|
47
47
|
decimalSeparator
|
|
48
48
|
]);
|
|
49
49
|
const finalIntLength = Math.floor(Math.abs(number)).toString().length;
|
|
50
|
-
const
|
|
50
|
+
const suffix = decimals > 0 ? `${decimalSeparator}${"0".repeat(decimals)}` : "";
|
|
51
|
+
const initialText = padStart ? `${"0".padStart(finalIntLength, "0")}${suffix}` : `0${suffix}`;
|
|
51
52
|
return /*#__PURE__*/ jsx("span", {
|
|
52
53
|
ref: localRef,
|
|
53
54
|
className: className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\counting-number.js","sources":["webpack://@arolariu/components/./src/components/ui/counting-number.tsx"],"sourcesContent":["\n\nimport
|
|
1
|
+
{"version":3,"file":"components\\ui\\counting-number.js","sources":["webpack://@arolariu/components/./src/components/ui/counting-number.tsx"],"sourcesContent":["\r\n\r\nimport {type SpringOptions, type UseInViewOptions, useInView, useMotionValue, useSpring} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\ninterface CountingNumberProps extends React.HTMLAttributes<HTMLSpanElement> {\r\n number: number;\r\n fromNumber?: number;\r\n padStart?: boolean;\r\n inView?: boolean;\r\n inViewMargin?: UseInViewOptions[\"margin\"];\r\n inViewOnce?: boolean;\r\n decimalSeparator?: string;\r\n transition?: SpringOptions;\r\n decimalPlaces?: number;\r\n}\r\n\r\nconst CountingNumber = React.forwardRef<HTMLSpanElement, CountingNumberProps>(\r\n (\r\n {\r\n number,\r\n fromNumber = 0,\r\n padStart = false,\r\n inView = false,\r\n inViewMargin = \"0px\",\r\n inViewOnce = true,\r\n decimalSeparator = \".\",\r\n transition = {stiffness: 90, damping: 50},\r\n decimalPlaces = 0,\r\n className,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const localRef = React.useRef<HTMLSpanElement>(null);\r\n React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);\r\n\r\n const numberStr = number.toString();\r\n const decimals = typeof decimalPlaces === \"number\" ? decimalPlaces : numberStr.includes(\".\") ? numberStr?.split(\".\")[1].length : 0;\r\n\r\n const motionVal = useMotionValue(fromNumber);\r\n const springVal = useSpring(motionVal, transition);\r\n const inViewResult = useInView(localRef, {\r\n once: inViewOnce,\r\n margin: inViewMargin,\r\n });\r\n const isInView = !inView || inViewResult;\r\n\r\n React.useEffect(() => {\r\n if (isInView) motionVal.set(number);\r\n }, [isInView, number, motionVal]);\r\n\r\n React.useEffect(() => {\r\n const unsubscribe = springVal.on(\"change\", (latest) => {\r\n if (localRef.current) {\r\n let formatted = decimals > 0 ? latest.toFixed(decimals) : Math.round(latest).toString();\r\n\r\n if (decimals > 0) {\r\n formatted = formatted.replace(\".\", decimalSeparator);\r\n }\r\n\r\n if (padStart) {\r\n const finalIntLength = Math.floor(Math.abs(number)).toString().length;\r\n const [intPart, fracPart] = formatted.split(decimalSeparator);\r\n const paddedInt = intPart.padStart(finalIntLength, \"0\");\r\n formatted = fracPart ? `${paddedInt}${decimalSeparator}${fracPart}` : paddedInt;\r\n }\r\n\r\n localRef.current.textContent = formatted;\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, [springVal, decimals, padStart, number, decimalSeparator]);\r\n\r\n const finalIntLength = Math.floor(Math.abs(number)).toString().length;\r\n const suffix = decimals > 0 ? `${decimalSeparator}${\"0\".repeat(decimals)}` : \"\";\r\n const initialText = padStart ? `${\"0\".padStart(finalIntLength, \"0\")}${suffix}` : `0${suffix}`;\r\n\r\n return (\r\n <span\r\n ref={localRef}\r\n className={className}\r\n {...props}>\r\n {initialText}\r\n </span>\r\n );\r\n },\r\n);\r\n\r\nCountingNumber.displayName = \"CountingNumber\";\r\n\r\nexport {CountingNumber, type CountingNumberProps};\r\n"],"names":["CountingNumber","React","number","fromNumber","padStart","inView","inViewMargin","inViewOnce","decimalSeparator","transition","decimalPlaces","className","props","ref","localRef","numberStr","decimals","motionVal","useMotionValue","springVal","useSpring","inViewResult","useInView","isInView","unsubscribe","latest","formatted","Math","finalIntLength","intPart","fracPart","paddedInt","suffix","initialText"],"mappings":";;;;AAiBA,MAAMA,iBAAiB,WAAjBA,GAAiBC,WACrB,CACE,EACEC,MAAM,EACNC,aAAa,CAAC,EACdC,WAAW,KAAK,EAChBC,SAAS,KAAK,EACdC,eAAe,KAAK,EACpBC,aAAa,IAAI,EACjBC,mBAAmB,GAAG,EACtBC,aAAa;IAAC,WAAW;IAAI,SAAS;AAAE,CAAC,EACzCC,gBAAgB,CAAC,EACjBC,SAAS,EACT,GAAGC,OACJ,EACDC;IAEA,MAAMC,WAAWb,OAA8B;IAC/CA,oBAA0BY,KAAK,IAAMC,SAAS,OAAO;IAErD,MAAMC,YAAYb,OAAO,QAAQ;IACjC,MAAMc,WAAW,mBAAON,gBAA6BA,gBAAgBK,UAAU,QAAQ,CAAC,OAAOA,WAAW,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS;IAEjI,MAAME,YAAYC,eAAef;IACjC,MAAMgB,YAAYC,UAAUH,WAAWR;IACvC,MAAMY,eAAeC,UAAUR,UAAU;QACvC,MAAMP;QACN,QAAQD;IACV;IACA,MAAMiB,WAAW,CAAClB,UAAUgB;IAE5BpB,UAAgB;QACd,IAAIsB,UAAUN,UAAU,GAAG,CAACf;IAC9B,GAAG;QAACqB;QAAUrB;QAAQe;KAAU;IAEhChB,UAAgB;QACd,MAAMuB,cAAcL,UAAU,EAAE,CAAC,UAAU,CAACM;YAC1C,IAAIX,SAAS,OAAO,EAAE;gBACpB,IAAIY,YAAYV,WAAW,IAAIS,OAAO,OAAO,CAACT,YAAYW,KAAK,KAAK,CAACF,QAAQ,QAAQ;gBAErF,IAAIT,WAAW,GACbU,YAAYA,UAAU,OAAO,CAAC,KAAKlB;gBAGrC,IAAIJ,UAAU;oBACZ,MAAMwB,iBAAiBD,KAAK,KAAK,CAACA,KAAK,GAAG,CAACzB,SAAS,QAAQ,GAAG,MAAM;oBACrE,MAAM,CAAC2B,SAASC,SAAS,GAAGJ,UAAU,KAAK,CAAClB;oBAC5C,MAAMuB,YAAYF,QAAQ,QAAQ,CAACD,gBAAgB;oBACnDF,YAAYI,WAAW,GAAGC,YAAYvB,mBAAmBsB,UAAU,GAAGC;gBACxE;gBAEAjB,SAAS,OAAO,CAAC,WAAW,GAAGY;YACjC;QACF;QACA,OAAO,IAAMF;IACf,GAAG;QAACL;QAAWH;QAAUZ;QAAUF;QAAQM;KAAiB;IAE5D,MAAMoB,iBAAiBD,KAAK,KAAK,CAACA,KAAK,GAAG,CAACzB,SAAS,QAAQ,GAAG,MAAM;IACrE,MAAM8B,SAAShB,WAAW,IAAI,GAAGR,mBAAmB,IAAI,MAAM,CAACQ,WAAW,GAAG;IAC7E,MAAMiB,cAAc7B,WAAW,GAAG,IAAI,QAAQ,CAACwB,gBAAgB,OAAOI,QAAQ,GAAG,CAAC,CAAC,EAAEA,QAAQ;IAE7F,OAAO,WAAP,GACE,IAAC;QACC,KAAKlB;QACL,WAAWH;QACV,GAAGC,KAAK;kBACRqB;;AAGP;AAGFjC,eAAe,WAAW,GAAG"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
19
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
16
20
|
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,8JAYjB,CAAC;AAGH,QAAA,MAAM,aAAa,8JAoBjB,CAAC;AAGH,QAAA,MAAM,YAAY;8BAA2B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKhF,CAAC;AAGF,QAAA,MAAM,YAAY;8BAA2B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKhF,CAAC;AAGF,QAAA,MAAM,WAAW,oKASf,CAAC;AAGH,QAAA,MAAM,iBAAiB,8KASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -1,56 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
3
|
import { Close, Content, Description, Overlay, Portal, Root, Title, Trigger } from "@radix-ui/react-dialog";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { cn } from "../../lib/utilities.js";
|
|
7
|
+
const Dialog = Root;
|
|
8
|
+
const DialogTrigger = Trigger;
|
|
9
|
+
const DialogPortal = Portal;
|
|
10
|
+
const DialogClose = Close;
|
|
11
|
+
const DialogOverlay = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Overlay, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80", className),
|
|
10
14
|
...props
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return /*#__PURE__*/ jsx(Trigger, {
|
|
15
|
-
"data-slot": "dialog-trigger",
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function DialogPortal({ ...props }) {
|
|
20
|
-
return /*#__PURE__*/ jsx(Portal, {
|
|
21
|
-
"data-slot": "dialog-portal",
|
|
22
|
-
...props
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function DialogClose({ ...props }) {
|
|
26
|
-
return /*#__PURE__*/ jsx(Close, {
|
|
27
|
-
"data-slot": "dialog-close",
|
|
28
|
-
...props
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function DialogOverlay({ className, ...props }) {
|
|
32
|
-
return /*#__PURE__*/ jsx(Overlay, {
|
|
33
|
-
"data-slot": "dialog-overlay",
|
|
34
|
-
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
35
|
-
...props
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
39
|
-
return /*#__PURE__*/ jsxs(DialogPortal, {
|
|
40
|
-
"data-slot": "dialog-portal",
|
|
15
|
+
}));
|
|
16
|
+
DialogOverlay.displayName = Overlay.displayName;
|
|
17
|
+
const DialogContent = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(DialogPortal, {
|
|
41
18
|
children: [
|
|
42
19
|
/*#__PURE__*/ jsx(DialogOverlay, {}),
|
|
43
20
|
/*#__PURE__*/ jsxs(Content, {
|
|
44
|
-
|
|
45
|
-
className: cn("
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950", className),
|
|
46
23
|
...props,
|
|
47
24
|
children: [
|
|
48
25
|
children,
|
|
49
|
-
|
|
50
|
-
"data-
|
|
51
|
-
className: "ring-offset-white focus:ring-neutral-950 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400",
|
|
26
|
+
/*#__PURE__*/ jsxs(Close, {
|
|
27
|
+
className: "absolute top-4 right-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400",
|
|
52
28
|
children: [
|
|
53
|
-
/*#__PURE__*/ jsx(
|
|
29
|
+
/*#__PURE__*/ jsx(X, {
|
|
30
|
+
className: "h-4 w-4"
|
|
31
|
+
}),
|
|
54
32
|
/*#__PURE__*/ jsx("span", {
|
|
55
33
|
className: "sr-only",
|
|
56
34
|
children: "Close"
|
|
@@ -60,36 +38,30 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
|
|
|
60
38
|
]
|
|
61
39
|
})
|
|
62
40
|
]
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"data-slot": "dialog-header",
|
|
68
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
41
|
+
}));
|
|
42
|
+
DialogContent.displayName = Content.displayName;
|
|
43
|
+
const DialogHeader = ({ className, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
44
|
+
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className),
|
|
69
45
|
...props
|
|
70
46
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"data-slot": "dialog-footer",
|
|
75
|
-
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
47
|
+
DialogHeader.displayName = "DialogHeader";
|
|
48
|
+
const DialogFooter = ({ className, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
49
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
76
50
|
...props
|
|
77
51
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
52
|
+
DialogFooter.displayName = "DialogFooter";
|
|
53
|
+
const DialogTitle = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Title, {
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
83
56
|
...props
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
className: cn("text-neutral-500 text-sm dark:text-neutral-400", className),
|
|
57
|
+
}));
|
|
58
|
+
DialogTitle.displayName = Title.displayName;
|
|
59
|
+
const DialogDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Description, {
|
|
60
|
+
ref: ref,
|
|
61
|
+
className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
|
|
90
62
|
...props
|
|
91
|
-
});
|
|
92
|
-
|
|
63
|
+
}));
|
|
64
|
+
DialogDescription.displayName = Description.displayName;
|
|
93
65
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
94
66
|
|
|
95
67
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\dialog.js","sources":["webpack://@arolariu/components/./src/components/ui/dialog.tsx"],"sourcesContent":["\n\nimport * as
|
|
1
|
+
{"version":3,"file":"components\\ui\\dialog.js","sources":["webpack://@arolariu/components/./src/components/ui/dialog.tsx"],"sourcesContent":["\r\n\r\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\r\nimport {X} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Dialog = DialogPrimitive.Root;\r\n\r\nconst DialogTrigger = DialogPrimitive.Trigger;\r\n\r\nconst DialogPortal = DialogPrimitive.Portal;\r\n\r\nconst DialogClose = DialogPrimitive.Close;\r\n\r\nconst DialogOverlay = React.forwardRef<\r\n React.ElementRef<typeof DialogPrimitive.Overlay>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Overlay\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\r\n\r\nconst DialogContent = React.forwardRef<\r\n React.ElementRef<typeof DialogPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\r\n>(({className, children, ...props}, ref) => (\r\n <DialogPortal>\r\n <DialogOverlay />\r\n <DialogPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <DialogPrimitive.Close className='absolute top-4 right-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400'>\r\n <X className='h-4 w-4' />\r\n <span className='sr-only'>Close</span>\r\n </DialogPrimitive.Close>\r\n </DialogPrimitive.Content>\r\n </DialogPortal>\r\n));\r\nDialogContent.displayName = DialogPrimitive.Content.displayName;\r\n\r\nconst DialogHeader = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)}\r\n {...props}\r\n />\r\n);\r\nDialogHeader.displayName = \"DialogHeader\";\r\n\r\nconst DialogFooter = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\r\n {...props}\r\n />\r\n);\r\nDialogFooter.displayName = \"DialogFooter\";\r\n\r\nconst DialogTitle = React.forwardRef<\r\n React.ElementRef<typeof DialogPrimitive.Title>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Title\r\n ref={ref}\r\n className={cn(\"text-lg leading-none font-semibold tracking-tight\", className)}\r\n {...props}\r\n />\r\n));\r\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\r\n\r\nconst DialogDescription = React.forwardRef<\r\n React.ElementRef<typeof DialogPrimitive.Description>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Description\r\n ref={ref}\r\n className={cn(\"text-sm text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n));\r\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\r\n\r\nexport {\r\n Dialog,\r\n DialogClose,\r\n DialogContent,\r\n DialogDescription,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogOverlay,\r\n DialogPortal,\r\n DialogTitle,\r\n DialogTrigger,\r\n};\r\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","cn","DialogContent","children","X","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;;AAQA,MAAMA,SAASC;AAEf,MAAMC,gBAAgBD;AAEtB,MAAME,eAAeF;AAErB,MAAMG,cAAcH;AAEpB,MAAMI,gBAAgB,WAAhBA,GAAgBC,WAGpB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,SAAuB;QACtB,KAAKQ;QACL,WAAWC,GACT,0JACAH;QAED,GAAGC,KAAK;;AAGbH,cAAc,WAAW,GAAGJ,QAAAA,WAAmC;AAE/D,MAAMU,gBAAgB,WAAhBA,GAAgBL,WAGpB,CAAC,EAACC,SAAS,EAAEK,QAAQ,EAAE,GAAGJ,OAAM,EAAEC,MAAAA,WAAAA,GAClC,KAACN,cAAAA;;0BACC,IAACE,eAAAA,CAAAA;0BACD,KAACJ,SAAuB;gBACtB,KAAKQ;gBACL,WAAWC,GACT,yjBACAH;gBAED,GAAGC,KAAK;;oBACRI;kCACD,KAACX,OAAqB;wBAAC,WAAU;;0CAC/B,IAACY,GAACA;gCAAC,WAAU;;0CACb,IAAC;gCAAK,WAAU;0CAAU;;;;;;;;AAKlCF,cAAc,WAAW,GAAGV,QAAAA,WAAmC;AAE/D,MAAMa,eAAe,CAAC,EAACP,SAAS,EAAE,GAAGC,OAA4C,iBAC/E,IAAC;QACC,WAAWE,GAAG,sDAAsDH;QACnE,GAAGC,KAAK;;AAGbM,aAAa,WAAW,GAAG;AAE3B,MAAMC,eAAe,CAAC,EAACR,SAAS,EAAE,GAAGC,OAA4C,iBAC/E,IAAC;QACC,WAAWE,GAAG,iEAAiEH;QAC9E,GAAGC,KAAK;;AAGbO,aAAa,WAAW,GAAG;AAE3B,MAAMC,cAAc,WAAdA,GAAcV,WAGlB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,OAAqB;QACpB,KAAKQ;QACL,WAAWC,GAAG,qDAAqDH;QAClE,GAAGC,KAAK;;AAGbQ,YAAY,WAAW,GAAGf,MAAAA,WAAiC;AAE3D,MAAMgB,oBAAoB,WAApBA,GAAoBX,WAGxB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,aAA2B;QAC1B,KAAKQ;QACL,WAAWC,GAAG,kDAAkDH;QAC/D,GAAGC,KAAK;;AAGbS,kBAAkB,WAAW,GAAGhB,YAAAA,WAAuC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/**
|
|
3
3
|
* DotBackground Component Props
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param {boolean} [glow=false] - Whether dots should have a glowing animation effect
|
|
4
|
+
* @param width The horizontal spacing between dots
|
|
5
|
+
* @param height The vertical spacing between dots
|
|
6
|
+
* @param x The x-offset of the entire pattern
|
|
7
|
+
* @param y The y-offset of the entire pattern
|
|
8
|
+
* @param cx The x-offset of individual dots
|
|
9
|
+
* @param cy The y-offset of individual dots
|
|
10
|
+
* @param cr The radius of each dot
|
|
11
|
+
* @param className Additional CSS classes to apply to the SVG container
|
|
12
|
+
* @param glow Whether dots should have a glowing animation effect
|
|
14
13
|
*/
|
|
15
14
|
interface DotBackgroundProps extends React.SVGProps<SVGSVGElement> {
|
|
16
15
|
width?: number;
|
|
@@ -26,14 +25,9 @@ interface DotBackgroundProps extends React.SVGProps<SVGSVGElement> {
|
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* DotBackground Component
|
|
29
|
-
*
|
|
30
28
|
* A React component that creates an animated or static dot pattern background using SVG.
|
|
31
29
|
* The pattern automatically adjusts to fill its container and can optionally display glowing dots.
|
|
32
|
-
*
|
|
33
|
-
* @component
|
|
34
|
-
*
|
|
35
30
|
* @see DotBackgroundProps for the props interface.
|
|
36
|
-
*
|
|
37
31
|
* @example
|
|
38
32
|
* // Basic usage
|
|
39
33
|
* <DotBackground />
|
|
@@ -45,8 +39,7 @@ interface DotBackgroundProps extends React.SVGProps<SVGSVGElement> {
|
|
|
45
39
|
* glow={true}
|
|
46
40
|
* className="opacity-50"
|
|
47
41
|
* />
|
|
48
|
-
|
|
49
|
-
* @notes
|
|
42
|
+
*@summary Summary:
|
|
50
43
|
* - The component is client-side only ("use client")
|
|
51
44
|
* - Automatically responds to container size changes
|
|
52
45
|
* - When glow is enabled, dots will animate with random delays and durations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dot-background.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"dot-background.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dot-background.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,aAAa,CAAC,EAC5B,KAAU,EACV,MAAW,EACX,CAAK,EACL,CAAK,EACL,EAAM,EACN,EAAM,EACN,EAAM,EACN,SAAS,EACT,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAsFpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../../lib/
|
|
3
|
+
import { cn } from "../../lib/utilities.js";
|
|
4
4
|
import { motion } from "motion/react";
|
|
5
5
|
import { useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
function DotBackground({ width = 16, height = 16, x = 0, y = 0, cx = 1, cy = 1, cr = 1, className, glow = false, ...props }) {
|
|
@@ -59,7 +59,7 @@ function DotBackground({ width = 16, height = 16, x = 0, y = 0, cx = 1, cy = 1,
|
|
|
59
59
|
]
|
|
60
60
|
})
|
|
61
61
|
}),
|
|
62
|
-
dots.map((dot
|
|
62
|
+
dots.map((dot)=>/*#__PURE__*/ jsx(motion.circle, {
|
|
63
63
|
cx: dot.x,
|
|
64
64
|
cy: dot.y,
|
|
65
65
|
r: cr,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\dot-background.js","sources":["webpack://@arolariu/components/./src/components/ui/dot-background.tsx"],"sourcesContent":["\n\nimport {
|
|
1
|
+
{"version":3,"file":"components\\ui\\dot-background.js","sources":["webpack://@arolariu/components/./src/components/ui/dot-background.tsx"],"sourcesContent":["\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport {motion} from \"motion/react\";\r\nimport React, {useEffect, useId, useRef, useState} from \"react\";\r\n\r\n/**\r\n * DotBackground Component Props\r\n * @param width The horizontal spacing between dots\r\n * @param height The vertical spacing between dots\r\n * @param x The x-offset of the entire pattern\r\n * @param y The y-offset of the entire pattern\r\n * @param cx The x-offset of individual dots\r\n * @param cy The y-offset of individual dots\r\n * @param cr The radius of each dot\r\n * @param className Additional CSS classes to apply to the SVG container\r\n * @param glow Whether dots should have a glowing animation effect\r\n */\r\ninterface DotBackgroundProps extends React.SVGProps<SVGSVGElement> {\r\n width?: number;\r\n height?: number;\r\n x?: number;\r\n y?: number;\r\n cx?: number;\r\n cy?: number;\r\n cr?: number;\r\n className?: string;\r\n glow?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n/**\r\n * DotBackground Component\r\n * A React component that creates an animated or static dot pattern background using SVG.\r\n * The pattern automatically adjusts to fill its container and can optionally display glowing dots.\r\n * @see DotBackgroundProps for the props interface.\r\n * @example\r\n * // Basic usage\r\n * <DotBackground />\r\n *\r\n * // With glowing effect and custom spacing\r\n * <DotBackground\r\n * width={20}\r\n * height={20}\r\n * glow={true}\r\n * className=\"opacity-50\"\r\n * />\r\n *@summary Summary:\r\n * - The component is client-side only (\"use client\")\r\n * - Automatically responds to container size changes\r\n * - When glow is enabled, dots will animate with random delays and durations\r\n * - Uses Motion for animations\r\n * - Dots color can be controlled via the text color utility classes\r\n */\r\n\r\nexport function DotBackground({\r\n width = 16,\r\n height = 16,\r\n x = 0,\r\n y = 0,\r\n cx = 1,\r\n cy = 1,\r\n cr = 1,\r\n className,\r\n glow = false,\r\n ...props\r\n}: DotBackgroundProps) {\r\n const id = useId();\r\n const containerRef = useRef<SVGSVGElement>(null);\r\n const [dimensions, setDimensions] = useState({width: 0, height: 0});\r\n\r\n useEffect(() => {\r\n const updateDimensions = () => {\r\n if (containerRef.current) {\r\n const {width, height} = containerRef.current.getBoundingClientRect();\r\n setDimensions({width, height});\r\n }\r\n };\r\n\r\n updateDimensions();\r\n window.addEventListener(\"resize\", updateDimensions);\r\n return () => window.removeEventListener(\"resize\", updateDimensions);\r\n }, []);\r\n\r\n const dots = Array.from(\r\n {\r\n length: Math.ceil(dimensions.width / width) * Math.ceil(dimensions.height / height),\r\n },\r\n (_, i) => {\r\n const col = i % Math.ceil(dimensions.width / width);\r\n const row = Math.floor(i / Math.ceil(dimensions.width / width));\r\n return {\r\n x: col * width + cx,\r\n y: row * height + cy,\r\n delay: Math.random() * 5,\r\n duration: Math.random() * 3 + 2,\r\n };\r\n },\r\n );\r\n\r\n return (\r\n <svg\r\n ref={containerRef}\r\n aria-hidden='true'\r\n className={cn(\"pointer-events-none absolute inset-0 h-full w-full\", className)}\r\n {...props}>\r\n <defs>\r\n <radialGradient id={`${id}-gradient`}>\r\n <stop\r\n offset='0%'\r\n stopColor='currentColor'\r\n stopOpacity='1'\r\n />\r\n <stop\r\n offset='100%'\r\n stopColor='currentColor'\r\n stopOpacity='0'\r\n />\r\n </radialGradient>\r\n </defs>\r\n {dots.map((dot) => (\r\n <motion.circle\r\n key={`${dot.x}-${dot.y}`}\r\n cx={dot.x}\r\n cy={dot.y}\r\n r={cr}\r\n fill={glow ? `url(#${id}-gradient)` : \"currentColor\"}\r\n className='text-neutral-400/80'\r\n initial={glow ? {opacity: 0.4, scale: 1} : {}}\r\n animate={\r\n glow\r\n ? {\r\n opacity: [0.4, 1, 0.4],\r\n scale: [1, 1.5, 1],\r\n }\r\n : {}\r\n }\r\n transition={\r\n glow\r\n ? {\r\n duration: dot.duration,\r\n repeat: Infinity,\r\n repeatType: \"reverse\",\r\n delay: dot.delay,\r\n ease: \"easeInOut\",\r\n }\r\n : {}\r\n }\r\n />\r\n ))}\r\n </svg>\r\n );\r\n}\r\n"],"names":["DotBackground","width","height","x","y","cx","cy","cr","className","glow","props","id","useId","containerRef","useRef","dimensions","setDimensions","useState","useEffect","updateDimensions","window","dots","Array","Math","_","i","col","row","cn","dot","motion","Infinity"],"mappings":";;;;;AAuDO,SAASA,cAAc,EAC5BC,QAAQ,EAAE,EACVC,SAAS,EAAE,EACXC,IAAI,CAAC,EACLC,IAAI,CAAC,EACLC,KAAK,CAAC,EACNC,KAAK,CAAC,EACNC,KAAK,CAAC,EACNC,SAAS,EACTC,OAAO,KAAK,EACZ,GAAGC,OACgB;IACnB,MAAMC,KAAKC;IACX,MAAMC,eAAeC,OAAsB;IAC3C,MAAM,CAACC,YAAYC,cAAc,GAAGC,SAAS;QAAC,OAAO;QAAG,QAAQ;IAAC;IAEjEC,UAAU;QACR,MAAMC,mBAAmB;YACvB,IAAIN,aAAa,OAAO,EAAE;gBACxB,MAAM,EAACZ,KAAK,EAAEC,MAAM,EAAC,GAAGW,aAAa,OAAO,CAAC,qBAAqB;gBAClEG,cAAc;oBAACf;oBAAOC;gBAAM;YAC9B;QACF;QAEAiB;QACAC,OAAO,gBAAgB,CAAC,UAAUD;QAClC,OAAO,IAAMC,OAAO,mBAAmB,CAAC,UAAUD;IACpD,GAAG,EAAE;IAEL,MAAME,OAAOC,MAAM,IAAI,CACrB;QACE,QAAQC,KAAK,IAAI,CAACR,WAAW,KAAK,GAAGd,SAASsB,KAAK,IAAI,CAACR,WAAW,MAAM,GAAGb;IAC9E,GACA,CAACsB,GAAGC;QACF,MAAMC,MAAMD,IAAIF,KAAK,IAAI,CAACR,WAAW,KAAK,GAAGd;QAC7C,MAAM0B,MAAMJ,KAAK,KAAK,CAACE,IAAIF,KAAK,IAAI,CAACR,WAAW,KAAK,GAAGd;QACxD,OAAO;YACL,GAAGyB,MAAMzB,QAAQI;YACjB,GAAGsB,MAAMzB,SAASI;YAClB,OAAOiB,IAAAA,KAAK,MAAM;YAClB,UAAUA,IAAAA,KAAK,MAAM,KAAS;QAChC;IACF;IAGF,OAAO,WAAP,GACE,KAAC;QACC,KAAKV;QACL,eAAY;QACZ,WAAWe,GAAG,sDAAsDpB;QACnE,GAAGE,KAAK;;0BACT,IAAC;0BACC,mBAAC;oBAAe,IAAI,GAAGC,GAAG,SAAS,CAAC;;sCAClC,IAAC;4BACC,QAAO;4BACP,WAAU;4BACV,aAAY;;sCAEd,IAAC;4BACC,QAAO;4BACP,WAAU;4BACV,aAAY;;;;;YAIjBU,KAAK,GAAG,CAAC,CAACQ,MAAAA,WAAAA,GACT,IAACC,OAAO,MAAM;oBAEZ,IAAID,IAAI,CAAC;oBACT,IAAIA,IAAI,CAAC;oBACT,GAAGtB;oBACH,MAAME,OAAO,CAAC,KAAK,EAAEE,GAAG,UAAU,CAAC,GAAG;oBACtC,WAAU;oBACV,SAASF,OAAO;wBAAC,SAAS;wBAAK,OAAO;oBAAC,IAAI,CAAC;oBAC5C,SACEA,OACI;wBACE,SAAS;4BAAC;4BAAK;4BAAG;yBAAI;wBACtB,OAAO;4BAAC;4BAAG;4BAAK;yBAAE;oBACpB,IACA,CAAC;oBAEP,YACEA,OACI;wBACE,UAAUoB,IAAI,QAAQ;wBACtB,QAAQE;wBACR,YAAY;wBACZ,OAAOF,IAAI,KAAK;wBAChB,MAAM;oBACR,IACA,CAAC;mBAxBF,GAAGA,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,EAAE;;;AA8BlC"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare
|
|
8
|
-
declare
|
|
9
|
-
declare
|
|
10
|
-
declare
|
|
11
|
-
declare
|
|
12
|
-
declare
|
|
13
|
-
|
|
3
|
+
declare const Drawer: {
|
|
4
|
+
({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const DrawerPortal: typeof import("vaul").Portal;
|
|
9
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DrawerHeader: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const DrawerFooter: {
|
|
17
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, };
|
|
14
23
|
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,MAAM,IAAI,eAAe,EAAC,MAAM,MAAM,CAAC;AAI/C,QAAA,MAAM,MAAM;0CAA8C,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;;CAK1G,CAAC;AAGF,QAAA,MAAM,aAAa,+HAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,8BAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,6HAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,kOASjB,CAAC;AAGH,QAAA,MAAM,aAAa,kOAiBjB,CAAC;AAGH,QAAA,MAAM,YAAY;8BAA2B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKhF,CAAC;AAGF,QAAA,MAAM,YAAY;8BAA2B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAKhF,CAAC;AAGF,QAAA,MAAM,WAAW,qLASf,CAAC;AAGH,QAAA,MAAM,iBAAiB,+LASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
|
|
@@ -1,86 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
import { Drawer } from "vaul";
|
|
5
|
-
import { cn } from "../../lib/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function DrawerClose({ ...props }) {
|
|
25
|
-
return /*#__PURE__*/ jsx(Drawer.Close, {
|
|
26
|
-
"data-slot": "drawer-close",
|
|
27
|
-
...props
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function DrawerOverlay({ className, ...props }) {
|
|
31
|
-
return /*#__PURE__*/ jsx(Drawer.Overlay, {
|
|
32
|
-
"data-slot": "drawer-overlay",
|
|
33
|
-
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
34
|
-
...props
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function DrawerContent({ className, children, ...props }) {
|
|
38
|
-
return /*#__PURE__*/ jsxs(DrawerPortal, {
|
|
39
|
-
"data-slot": "drawer-portal",
|
|
5
|
+
import { cn } from "../../lib/utilities.js";
|
|
6
|
+
const drawer_Drawer = ({ shouldScaleBackground = true, ...props })=>/*#__PURE__*/ jsx(Drawer.Root, {
|
|
7
|
+
shouldScaleBackground: shouldScaleBackground,
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
drawer_Drawer.displayName = "Drawer";
|
|
11
|
+
const DrawerTrigger = Drawer.Trigger;
|
|
12
|
+
const DrawerPortal = Drawer.Portal;
|
|
13
|
+
const DrawerClose = Drawer.Close;
|
|
14
|
+
const DrawerOverlay = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Drawer.Overlay, {
|
|
15
|
+
ref: ref,
|
|
16
|
+
className: cn("fixed inset-0 z-50 bg-black/80", className),
|
|
17
|
+
...props
|
|
18
|
+
}));
|
|
19
|
+
DrawerOverlay.displayName = Drawer.Overlay.displayName;
|
|
20
|
+
const DrawerContent = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(DrawerPortal, {
|
|
40
21
|
children: [
|
|
41
22
|
/*#__PURE__*/ jsx(DrawerOverlay, {}),
|
|
42
23
|
/*#__PURE__*/ jsxs(Drawer.Content, {
|
|
43
|
-
|
|
44
|
-
className: cn("
|
|
24
|
+
ref: ref,
|
|
25
|
+
className: cn("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-950", className),
|
|
45
26
|
...props,
|
|
46
27
|
children: [
|
|
47
28
|
/*#__PURE__*/ jsx("div", {
|
|
48
|
-
className: "
|
|
29
|
+
className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-neutral-100 dark:bg-neutral-800"
|
|
49
30
|
}),
|
|
50
31
|
children
|
|
51
32
|
]
|
|
52
33
|
})
|
|
53
34
|
]
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"data-slot": "drawer-header",
|
|
59
|
-
className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
|
|
35
|
+
}));
|
|
36
|
+
DrawerContent.displayName = "DrawerContent";
|
|
37
|
+
const DrawerHeader = ({ className, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
38
|
+
className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
60
39
|
...props
|
|
61
40
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return /*#__PURE__*/ jsx("div", {
|
|
65
|
-
"data-slot": "drawer-footer",
|
|
41
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
42
|
+
const DrawerFooter = ({ className, ...props })=>/*#__PURE__*/ jsx("div", {
|
|
66
43
|
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
67
44
|
...props
|
|
68
45
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className: cn("text-neutral-950 font-semibold dark:text-neutral-50", className),
|
|
46
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
47
|
+
const DrawerTitle = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Drawer.Title, {
|
|
48
|
+
ref: ref,
|
|
49
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
74
50
|
...props
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
className: cn("text-neutral-500 text-sm dark:text-neutral-400", className),
|
|
51
|
+
}));
|
|
52
|
+
DrawerTitle.displayName = Drawer.Title.displayName;
|
|
53
|
+
const DrawerDescription = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Drawer.Description, {
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
|
|
81
56
|
...props
|
|
82
|
-
});
|
|
83
|
-
|
|
57
|
+
}));
|
|
58
|
+
DrawerDescription.displayName = Drawer.Description.displayName;
|
|
84
59
|
export { drawer_Drawer as Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
85
60
|
|
|
86
61
|
//# sourceMappingURL=drawer.js.map
|