@codefast/ui 0.3.13-canary.3 → 0.3.13
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 +44 -0
- package/dist/components/accordion.d.mts +37 -0
- package/dist/components/accordion.mjs +53 -0
- package/dist/components/alert-dialog.d.mts +74 -0
- package/dist/components/alert-dialog.mjs +92 -0
- package/dist/components/alert.d.mts +30 -0
- package/dist/components/alert.mjs +49 -0
- package/dist/components/aspect-ratio.d.mts +10 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +21 -0
- package/dist/components/avatar.mjs +28 -0
- package/dist/components/badge.d.mts +24 -0
- package/dist/components/badge.mjs +56 -0
- package/dist/components/breadcrumb.d.mts +44 -0
- package/dist/components/breadcrumb.mjs +67 -0
- package/dist/components/button-group.d.mts +34 -0
- package/dist/components/button-group.mjs +53 -0
- package/dist/components/button.d.mts +38 -0
- package/dist/components/button.mjs +99 -0
- package/dist/components/calendar.d.mts +27 -0
- package/dist/components/calendar.mjs +114 -0
- package/dist/components/card.d.mts +41 -0
- package/dist/components/card.mjs +55 -0
- package/dist/components/carousel.d.mts +68 -0
- package/dist/components/carousel.mjs +135 -0
- package/dist/components/chart.d.mts +93 -0
- package/dist/components/chart.mjs +189 -0
- package/dist/components/checkbox-cards.d.mts +17 -0
- package/dist/components/checkbox-cards.mjs +30 -0
- package/dist/components/checkbox-group.d.mts +16 -0
- package/dist/components/checkbox-group.mjs +27 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +20 -0
- package/dist/components/collapsible.d.mts +18 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/command.d.mts +57 -0
- package/dist/components/command.mjs +92 -0
- package/dist/components/context-menu.d.mts +91 -0
- package/dist/components/context-menu.mjs +122 -0
- package/dist/components/dialog.d.mts +65 -0
- package/dist/components/dialog.mjs +93 -0
- package/dist/components/drawer.d.mts +65 -0
- package/dist/components/drawer.mjs +78 -0
- package/dist/components/dropdown-menu.d.mts +92 -0
- package/dist/components/dropdown-menu.mjs +129 -0
- package/dist/components/empty.d.mts +44 -0
- package/dist/components/empty.mjs +64 -0
- package/dist/components/field.d.mts +79 -0
- package/dist/components/field.mjs +132 -0
- package/dist/components/form.d.mts +48 -0
- package/dist/components/form.mjs +92 -0
- package/dist/components/hover-card.d.mts +26 -0
- package/dist/components/hover-card.mjs +35 -0
- package/dist/components/input-group.d.mts +61 -0
- package/dist/components/input-group.mjs +142 -0
- package/dist/components/input-number.d.mts +28 -0
- package/dist/components/input-number.mjs +61 -0
- package/dist/components/input-otp.d.mts +29 -0
- package/dist/components/input-otp.mjs +48 -0
- package/dist/components/input-password.d.mts +13 -0
- package/dist/components/input-password.mjs +38 -0
- package/dist/components/input-search.d.mts +20 -0
- package/dist/components/input-search.mjs +50 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +82 -0
- package/dist/components/item.mjs +137 -0
- package/dist/components/kbd.d.mts +15 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +14 -0
- package/dist/components/menubar.d.mts +100 -0
- package/dist/components/menubar.mjs +133 -0
- package/dist/components/native-select.d.mts +19 -0
- package/dist/components/native-select.mjs +34 -0
- package/dist/components/navigation-menu.d.mts +44 -0
- package/dist/components/navigation-menu.mjs +79 -0
- package/dist/components/pagination.d.mts +46 -0
- package/dist/components/pagination.mjs +71 -0
- package/dist/components/popover.d.mts +30 -0
- package/dist/components/popover.mjs +41 -0
- package/dist/components/progress-circle.d.mts +124 -0
- package/dist/components/progress-circle.mjs +120 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +19 -0
- package/dist/components/{radio-cards.d.ts → radio-cards.d.mts} +10 -5
- package/dist/components/radio-cards.mjs +29 -0
- package/dist/components/radio-group.d.mts +16 -0
- package/dist/components/radio-group.mjs +25 -0
- package/dist/components/radio.d.mts +14 -0
- package/dist/components/radio.mjs +16 -0
- package/dist/components/resizable.d.mts +23 -0
- package/dist/components/resizable.mjs +32 -0
- package/dist/components/scroll-area.d.mts +40 -0
- package/dist/components/scroll-area.mjs +101 -0
- package/dist/components/select.d.mts +62 -0
- package/dist/components/select.mjs +101 -0
- package/dist/components/separator.d.mts +32 -0
- package/dist/components/separator.mjs +45 -0
- package/dist/components/sheet.d.mts +75 -0
- package/dist/components/sheet.mjs +134 -0
- package/dist/components/sidebar.d.mts +195 -0
- package/dist/components/sidebar.mjs +375 -0
- package/dist/components/skeleton.d.mts +10 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +40 -0
- package/dist/components/sonner.d.mts +10 -0
- package/dist/components/sonner.mjs +21 -0
- package/dist/components/spinner.d.mts +14 -0
- package/dist/components/spinner.mjs +40 -0
- package/dist/components/switch.d.mts +11 -0
- package/dist/components/switch.mjs +18 -0
- package/dist/components/table.d.mts +45 -0
- package/dist/components/table.mjs +65 -0
- package/dist/components/tabs.d.mts +26 -0
- package/dist/components/tabs.mjs +35 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +12 -0
- package/dist/components/toggle-group.d.mts +30 -0
- package/dist/components/toggle-group.mjs +53 -0
- package/dist/components/toggle.d.mts +28 -0
- package/dist/components/toggle.mjs +53 -0
- package/dist/components/tooltip.d.mts +30 -0
- package/dist/components/tooltip.mjs +42 -0
- package/dist/hooks/{use-animated-value.d.ts → use-animated-value.d.mts} +4 -2
- package/dist/hooks/use-animated-value.mjs +62 -0
- package/dist/hooks/{use-copy-to-clipboard.d.ts → use-copy-to-clipboard.d.mts} +11 -6
- package/dist/hooks/use-copy-to-clipboard.mjs +43 -0
- package/dist/hooks/{use-is-mobile.d.ts → use-is-mobile.d.mts} +4 -2
- package/dist/hooks/use-is-mobile.mjs +26 -0
- package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +4 -2
- package/dist/hooks/use-media-query.mjs +50 -0
- package/dist/hooks/{use-mutation-observer.d.ts → use-mutation-observer.d.mts} +6 -3
- package/dist/hooks/use-mutation-observer.mjs +41 -0
- package/dist/hooks/use-pagination.d.mts +44 -0
- package/dist/hooks/use-pagination.mjs +107 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.mjs +69 -0
- package/dist/lib/utils.d.mts +13 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +6 -0
- package/dist/primitives/checkbox-group.d.mts +144 -0
- package/dist/primitives/checkbox-group.mjs +126 -0
- package/dist/primitives/input-number.d.mts +73 -0
- package/dist/primitives/input-number.mjs +514 -0
- package/dist/primitives/input.d.mts +72 -0
- package/dist/primitives/input.mjs +75 -0
- package/dist/primitives/progress-circle.d.mts +146 -0
- package/dist/primitives/progress-circle.mjs +178 -0
- package/package.json +164 -170
- package/dist/components/accordion.d.ts +0 -19
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -26
- package/dist/components/alert-dialog.d.ts +0 -39
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -39
- package/dist/components/alert.d.ts +0 -19
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -41
- package/dist/components/aspect-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio.d.ts.map +0 -1
- package/dist/components/aspect-ratio.js +0 -10
- package/dist/components/avatar.d.ts +0 -11
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -17
- package/dist/components/badge.d.ts +0 -18
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -59
- package/dist/components/breadcrumb.d.ts +0 -22
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb.js +0 -31
- package/dist/components/button-group.d.ts +0 -20
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -48
- package/dist/components/button.d.ts +0 -29
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -92
- package/dist/components/calendar.d.ts +0 -13
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/calendar.js +0 -104
- package/dist/components/card.d.ts +0 -18
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -27
- package/dist/components/carousel.d.ts +0 -38
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -103
- package/dist/components/chart.d.ts +0 -58
- package/dist/components/chart.d.ts.map +0 -1
- package/dist/components/chart.js +0 -198
- package/dist/components/checkbox-cards.d.ts +0 -11
- package/dist/components/checkbox-cards.d.ts.map +0 -1
- package/dist/components/checkbox-cards.js +0 -16
- package/dist/components/checkbox-group.d.ts +0 -9
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox-group.js +0 -15
- package/dist/components/checkbox.d.ts +0 -7
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox.js +0 -12
- package/dist/components/collapsible.d.ts +0 -11
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -16
- package/dist/components/command.d.ts +0 -26
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -41
- package/dist/components/context-menu.d.ts +0 -42
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -54
- package/dist/components/dialog.d.ts +0 -35
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -41
- package/dist/components/drawer.d.ts +0 -34
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -36
- package/dist/components/dropdown-menu.d.ts +0 -42
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -54
- package/dist/components/empty.d.ts +0 -23
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -47
- package/dist/components/field.d.ts +0 -42
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -85
- package/dist/components/form.d.ts +0 -27
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -76
- package/dist/components/hover-card.d.ts +0 -13
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -20
- package/dist/components/input-group.d.ts +0 -37
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -127
- package/dist/components/input-number.d.ts +0 -8
- package/dist/components/input-number.d.ts.map +0 -1
- package/dist/components/input-number.js +0 -20
- package/dist/components/input-otp.d.ts +0 -16
- package/dist/components/input-otp.d.ts.map +0 -1
- package/dist/components/input-otp.js +0 -25
- package/dist/components/input-password.d.ts +0 -7
- package/dist/components/input-password.d.ts.map +0 -1
- package/dist/components/input-password.js +0 -17
- package/dist/components/input-search.d.ts +0 -11
- package/dist/components/input-search.d.ts.map +0 -1
- package/dist/components/input-search.js +0 -22
- package/dist/components/input.d.ts +0 -6
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -10
- package/dist/components/item.d.ts +0 -46
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/item.js +0 -94
- package/dist/components/kbd.d.ts +0 -8
- package/dist/components/kbd.d.ts.map +0 -1
- package/dist/components/kbd.js +0 -12
- package/dist/components/label.d.ts +0 -7
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -11
- package/dist/components/menubar.d.ts +0 -44
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/menubar.js +0 -57
- package/dist/components/native-select.d.ts +0 -10
- package/dist/components/native-select.d.ts.map +0 -1
- package/dist/components/native-select.js +0 -16
- package/dist/components/navigation-menu.d.ts +0 -21
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/navigation-menu.js +0 -43
- package/dist/components/pagination.d.ts +0 -26
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -29
- package/dist/components/popover.d.ts +0 -15
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress-circle.d.ts +0 -107
- package/dist/components/progress-circle.d.ts.map +0 -1
- package/dist/components/progress-circle.js +0 -83
- package/dist/components/progress.d.ts +0 -7
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -13
- package/dist/components/radio-cards.d.ts.map +0 -1
- package/dist/components/radio-cards.js +0 -15
- package/dist/components/radio-group.d.ts +0 -9
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -14
- package/dist/components/radio.d.ts +0 -8
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/radio.js +0 -11
- package/dist/components/resizable.d.ts +0 -13
- package/dist/components/resizable.d.ts.map +0 -1
- package/dist/components/resizable.js +0 -18
- package/dist/components/scroll-area.d.ts +0 -28
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -77
- package/dist/components/select.d.ts +0 -29
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -49
- package/dist/components/separator.d.ts +0 -23
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -36
- package/dist/components/sheet.d.ts +0 -43
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -90
- package/dist/components/sidebar.d.ts +0 -102
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -241
- package/dist/components/skeleton.d.ts +0 -6
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -9
- package/dist/components/slider.d.ts +0 -7
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/slider.js +0 -18
- package/dist/components/sonner.d.ts +0 -8
- package/dist/components/sonner.d.ts.map +0 -1
- package/dist/components/sonner.js +0 -18
- package/dist/components/spinner.d.ts +0 -8
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -27
- package/dist/components/switch.d.ts +0 -7
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -11
- package/dist/components/table.d.ts +0 -20
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -30
- package/dist/components/tabs.d.ts +0 -13
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -20
- package/dist/components/textarea.d.ts +0 -6
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -9
- package/dist/components/toggle-group.d.ts +0 -16
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle-group.js +0 -35
- package/dist/components/toggle.d.ts +0 -21
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -49
- package/dist/components/tooltip.d.ts +0 -15
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -23
- package/dist/hooks/use-animated-value.d.ts.map +0 -1
- package/dist/hooks/use-animated-value.js +0 -71
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.js +0 -46
- package/dist/hooks/use-is-mobile.d.ts.map +0 -1
- package/dist/hooks/use-is-mobile.js +0 -23
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-media-query.js +0 -53
- package/dist/hooks/use-mutation-observer.d.ts.map +0 -1
- package/dist/hooks/use-mutation-observer.js +0 -40
- package/dist/hooks/use-pagination.d.ts +0 -37
- package/dist/hooks/use-pagination.d.ts.map +0 -1
- package/dist/hooks/use-pagination.js +0 -107
- package/dist/index.d.ts +0 -131
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -68
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -10
- package/dist/primitives/checkbox-group.d.ts +0 -123
- package/dist/primitives/checkbox-group.d.ts.map +0 -1
- package/dist/primitives/checkbox-group.js +0 -112
- package/dist/primitives/input-number.d.ts +0 -63
- package/dist/primitives/input-number.d.ts.map +0 -1
- package/dist/primitives/input-number.js +0 -458
- package/dist/primitives/input.d.ts +0 -67
- package/dist/primitives/input.d.ts.map +0 -1
- package/dist/primitives/input.js +0 -76
- package/dist/primitives/progress-circle.d.ts +0 -116
- package/dist/primitives/progress-circle.d.ts.map +0 -1
- package/dist/primitives/progress-circle.js +0 -163
package/dist/components/empty.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "#lib/utils";
|
|
3
|
-
/* -----------------------------------------------------------------------------
|
|
4
|
-
* Variants: Empty
|
|
5
|
-
* -------------------------------------------------------------------------- */
|
|
6
|
-
const emptyMediaVariants = tv({
|
|
7
|
-
base: [
|
|
8
|
-
"mb-2 flex shrink-0 items-center justify-center",
|
|
9
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
10
|
-
],
|
|
11
|
-
defaultVariants: {
|
|
12
|
-
variant: "default",
|
|
13
|
-
},
|
|
14
|
-
variants: {
|
|
15
|
-
variant: {
|
|
16
|
-
default: "bg-transparent",
|
|
17
|
-
icon: [
|
|
18
|
-
"flex size-10 shrink-0 items-center justify-center",
|
|
19
|
-
"rounded-xl",
|
|
20
|
-
"bg-muted text-foreground",
|
|
21
|
-
"[&_svg:not([class*='size-'])]:size-6",
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
function Empty({ className, ...props }) {
|
|
27
|
-
return (_jsx("div", { className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 p-6", "rounded-xl border-dashed", "text-center text-balance", "md:p-12", className), "data-slot": "empty", ...props }));
|
|
28
|
-
}
|
|
29
|
-
function EmptyHeader({ className, ...props }) {
|
|
30
|
-
return (_jsx("div", { className: cn("flex max-w-sm flex-col items-center gap-2", "text-center", className), "data-slot": "empty-header", ...props }));
|
|
31
|
-
}
|
|
32
|
-
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
33
|
-
return (_jsx("div", { className: emptyMediaVariants({ className, variant }), "data-slot": "empty-icon", "data-variant": variant, ...props }));
|
|
34
|
-
}
|
|
35
|
-
function EmptyTitle({ className, ...props }) {
|
|
36
|
-
return (_jsx("div", { className: cn("text-lg font-medium tracking-tight", className), "data-slot": "empty-title", ...props }));
|
|
37
|
-
}
|
|
38
|
-
function EmptyDescription({ className, ...props }) {
|
|
39
|
-
return (_jsx("p", { className: cn("text-sm/relaxed text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4", "[&>a:hover]:text-primary", className), "data-slot": "empty-description", ...props }));
|
|
40
|
-
}
|
|
41
|
-
function EmptyContent({ className, ...props }) {
|
|
42
|
-
return (_jsx("div", { className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4", "text-sm text-balance", className), "data-slot": "empty-content", ...props }));
|
|
43
|
-
}
|
|
44
|
-
/* -----------------------------------------------------------------------------
|
|
45
|
-
* Exports
|
|
46
|
-
* -------------------------------------------------------------------------- */
|
|
47
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle, };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { VariantProps } from "#lib/utils";
|
|
2
|
-
import type { ComponentProps, JSX } from "react";
|
|
3
|
-
import { Label } from "#components/label";
|
|
4
|
-
declare const fieldVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
|
-
orientation: {
|
|
6
|
-
horizontal: string[];
|
|
7
|
-
responsive: string[];
|
|
8
|
-
vertical: string[];
|
|
9
|
-
};
|
|
10
|
-
}, Record<string, never>>;
|
|
11
|
-
type FieldSetProps = ComponentProps<"fieldset">;
|
|
12
|
-
declare function FieldSet({ className, ...props }: FieldSetProps): JSX.Element;
|
|
13
|
-
type FieldLegendProps = ComponentProps<"legend"> & {
|
|
14
|
-
variant?: "label" | "legend";
|
|
15
|
-
};
|
|
16
|
-
declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): JSX.Element;
|
|
17
|
-
type FieldGroupProps = ComponentProps<"div">;
|
|
18
|
-
declare function FieldGroup({ className, ...props }: FieldGroupProps): JSX.Element;
|
|
19
|
-
type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants>;
|
|
20
|
-
declare function Field({ className, orientation, ...props }: FieldProps): JSX.Element;
|
|
21
|
-
type FieldContentProps = ComponentProps<"div">;
|
|
22
|
-
declare function FieldContent({ className, ...props }: FieldContentProps): JSX.Element;
|
|
23
|
-
type FieldLabelProps = ComponentProps<typeof Label>;
|
|
24
|
-
declare function FieldLabel({ className, ...props }: FieldLabelProps): JSX.Element;
|
|
25
|
-
type FieldTitleProps = ComponentProps<"div">;
|
|
26
|
-
declare function FieldTitle({ className, ...props }: FieldTitleProps): JSX.Element;
|
|
27
|
-
type FieldDescriptionProps = ComponentProps<"p">;
|
|
28
|
-
declare function FieldDescription({ className, ...props }: FieldDescriptionProps): JSX.Element;
|
|
29
|
-
type FieldSeparatorProps = ComponentProps<"div"> & {
|
|
30
|
-
children?: ComponentProps<"span">["children"];
|
|
31
|
-
};
|
|
32
|
-
declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): JSX.Element;
|
|
33
|
-
interface FieldErrorMessage {
|
|
34
|
-
message?: string;
|
|
35
|
-
}
|
|
36
|
-
interface FieldErrorProps extends ComponentProps<"div"> {
|
|
37
|
-
errors?: (FieldErrorMessage | undefined)[];
|
|
38
|
-
}
|
|
39
|
-
declare function FieldError({ children, className, errors, ...props }: FieldErrorProps): JSX.Element | null;
|
|
40
|
-
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, fieldVariants, };
|
|
41
|
-
export type { FieldContentProps, FieldDescriptionProps, FieldErrorProps, FieldGroupProps, FieldLabelProps, FieldLegendProps, FieldProps, FieldSeparatorProps, FieldSetProps, FieldTitleProps, };
|
|
42
|
-
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1 +0,0 @@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AQ,EACR,UAAU,EACV,aAAa,GACd,CAAC;AAEF,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,CAAC"}
|
package/dist/components/field.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn, tv } from "#lib/utils";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
|
-
import { Label } from "#components/label";
|
|
6
|
-
import { Separator } from "#components/separator";
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Variants: Field
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
const fieldVariants = tv({
|
|
11
|
-
base: ["group/field flex w-full gap-3", "data-[invalid=true]:text-destructive"],
|
|
12
|
-
defaultVariants: {
|
|
13
|
-
orientation: "vertical",
|
|
14
|
-
},
|
|
15
|
-
variants: {
|
|
16
|
-
orientation: {
|
|
17
|
-
horizontal: [
|
|
18
|
-
"flex-row items-center",
|
|
19
|
-
"has-[>[data-slot=field-content]]:items-start",
|
|
20
|
-
"[&>[data-slot=field-label]]:flex-auto",
|
|
21
|
-
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
22
|
-
],
|
|
23
|
-
responsive: [
|
|
24
|
-
"flex-col",
|
|
25
|
-
"@md/field-group:flex-row @md/field-group:items-center",
|
|
26
|
-
"@md/field-group:has-[>[data-slot=field-content]]:items-start",
|
|
27
|
-
"[&>*]:w-full",
|
|
28
|
-
"@md/field-group:[&>*]:w-auto",
|
|
29
|
-
"[&>.sr-only]:w-auto",
|
|
30
|
-
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
31
|
-
"@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
32
|
-
],
|
|
33
|
-
vertical: ["flex-col", "[&>*]:w-full", "[&>.sr-only]:w-auto"],
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
function FieldSet({ className, ...props }) {
|
|
38
|
-
return (_jsx("fieldset", { className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3", "has-[>[data-slot=radio-group]]:gap-3", className), "data-slot": "field-set", ...props }));
|
|
39
|
-
}
|
|
40
|
-
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
41
|
-
return (_jsx("legend", { className: cn("mb-3", "text-base font-medium", "data-[variant=label]:text-sm", className), "data-slot": "field-legend", "data-variant": variant, ...props }));
|
|
42
|
-
}
|
|
43
|
-
function FieldGroup({ className, ...props }) {
|
|
44
|
-
return (_jsx("div", { className: cn("group/field-group @container/field-group flex w-full flex-col gap-7", "data-[slot=checkbox-group]:gap-3", "[&>[data-slot=field-group]]:gap-4", className), "data-slot": "field-group", ...props }));
|
|
45
|
-
}
|
|
46
|
-
function Field({ className, orientation = "vertical", ...props }) {
|
|
47
|
-
return (_jsx("div", { className: fieldVariants({ className, orientation }), "data-orientation": orientation, "data-slot": "field", role: "group", ...props }));
|
|
48
|
-
}
|
|
49
|
-
function FieldContent({ className, ...props }) {
|
|
50
|
-
return (_jsx("div", { className: cn("group/field-content flex flex-1 flex-col gap-1.5", "leading-snug", className), "data-slot": "field-content", ...props }));
|
|
51
|
-
}
|
|
52
|
-
function FieldLabel({ className, ...props }) {
|
|
53
|
-
return (_jsx(Label, { className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug", "group-data-disabled/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border", "has-data-checked:border-primary has-data-checked:bg-primary/5", "dark:has-data-checked:bg-primary/10", "[&>*]:data-[slot=field]:p-4", className), "data-slot": "field-label", ...props }));
|
|
54
|
-
}
|
|
55
|
-
function FieldTitle({ className, ...props }) {
|
|
56
|
-
return (_jsx("div", { className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium", "group-data-disabled/field:opacity-50", className), "data-slot": "field-label", ...props }));
|
|
57
|
-
}
|
|
58
|
-
function FieldDescription({ className, ...props }) {
|
|
59
|
-
return (_jsx("p", { className: cn("text-sm leading-normal font-normal text-muted-foreground", "group-has-data-[orientation=horizontal]/field:text-balance", "last:mt-0", "nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4", "[&>a:hover]:text-primary", "[[data-variant=legend]+&]:-mt-1.5", className), "data-slot": "field-description", ...props }));
|
|
60
|
-
}
|
|
61
|
-
function FieldSeparator({ children, className, ...props }) {
|
|
62
|
-
const hasContent = Boolean(children);
|
|
63
|
-
return (_jsxs("div", { className: cn("relative", "-my-2 h-5 text-sm", "group-data-[variant=outline]/field-group:-mb-2", className), "data-content": hasContent, "data-slot": "field-separator", ...props, children: [_jsx(Separator, { className: cn("absolute", "inset-0 top-1/2") }), hasContent ? (_jsx("span", { className: cn("relative block", "mx-auto w-fit px-2", "bg-background text-muted-foreground"), "data-slot": "field-separator-content", children: children })) : null] }));
|
|
64
|
-
}
|
|
65
|
-
function FieldError({ children, className, errors, ...props }) {
|
|
66
|
-
const fallbackContent = useMemo(() => {
|
|
67
|
-
if (!errors?.length) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
71
|
-
if (uniqueErrors.length === 1) {
|
|
72
|
-
return uniqueErrors[0]?.message ?? null;
|
|
73
|
-
}
|
|
74
|
-
return (_jsx("ul", { className: cn("flex flex-col gap-1", "ml-4", "list-disc"), children: uniqueErrors.map((error) => error?.message ? _jsx("li", { children: error.message }, error.message) : null) }));
|
|
75
|
-
}, [errors]);
|
|
76
|
-
const content = children ?? fallbackContent;
|
|
77
|
-
if (content === null || content === undefined || content === false) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
return (_jsx("div", { className: cn("text-sm font-normal text-destructive", className), "data-slot": "field-error", role: "alert", ...props, children: content }));
|
|
81
|
-
}
|
|
82
|
-
/* -----------------------------------------------------------------------------
|
|
83
|
-
* Exports
|
|
84
|
-
* -------------------------------------------------------------------------- */
|
|
85
|
-
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, fieldVariants, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Scope } from "@radix-ui/react-context";
|
|
2
|
-
import type * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
-
import type { ComponentProps, JSX, ReactNode } from "react";
|
|
4
|
-
import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
5
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
-
import { FormProvider } from "react-hook-form";
|
|
7
|
-
type FormProps = ComponentProps<typeof FormProvider>;
|
|
8
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
|
-
type ScopedProps<P> = P & {
|
|
10
|
-
__scopeFormField?: Scope;
|
|
11
|
-
};
|
|
12
|
-
declare const createFormFieldScope: import("@radix-ui/react-context").CreateScope;
|
|
13
|
-
type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ControllerProps<TFieldValues, TName>;
|
|
14
|
-
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(formFieldProps: ScopedProps<FormFieldProps<TFieldValues, TName>>): JSX.Element;
|
|
15
|
-
type FormItemProps = ComponentProps<"div">;
|
|
16
|
-
declare function FormItem({ __scopeFormField, className, ...props }: ScopedProps<FormItemProps>): JSX.Element;
|
|
17
|
-
type FormLabelProps = ComponentProps<typeof LabelPrimitive.Root>;
|
|
18
|
-
declare function FormLabel({ __scopeFormField, ...props }: ScopedProps<FormLabelProps>): JSX.Element;
|
|
19
|
-
type FormControlProps = ComponentProps<typeof Slot>;
|
|
20
|
-
declare function FormControl({ __scopeFormField, ...props }: ScopedProps<FormControlProps>): JSX.Element;
|
|
21
|
-
type FormDescriptionProps = ComponentProps<"p">;
|
|
22
|
-
declare function FormDescription({ __scopeFormField, className, ...props }: ScopedProps<FormDescriptionProps>): JSX.Element;
|
|
23
|
-
type FormMessageProps = ComponentProps<"p">;
|
|
24
|
-
declare function FormMessage({ __scopeFormField, children, className, ...props }: ScopedProps<FormMessageProps>): ReactNode;
|
|
25
|
-
export type { FormControlProps, FormDescriptionProps, FormFieldProps, FormItemProps, FormLabelProps, FormMessageProps, FormProps, };
|
|
26
|
-
export { createFormFieldScope, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, };
|
|
27
|
-
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,KAAK,cAAc,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAc,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI3F,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAc,YAAY,EAAgC,MAAM,iBAAiB,CAAC;AAQzF,KAAK,SAAS,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,QAAA,MAAM,IAAI,4MAAe,CAAC;AAQ1B,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,gBAAgB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AoB,CAAC,GAAG,GAAG,CAAC,OAAO,CAWjD;AAQD,KAAK,gBAAgB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAE5C,iBAAS,WAAW,CAAC,EACnB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAsB3C;AAMD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,SAAS,GACV,CAAC;AACF,OAAO,EACL,oBAAoB,EACpB,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,CAAC"}
|
package/dist/components/form.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { createContextScope } from "@radix-ui/react-context";
|
|
5
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
-
import { useId } from "react";
|
|
7
|
-
import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
|
|
8
|
-
import { Label } from "#components/label";
|
|
9
|
-
const Form = FormProvider;
|
|
10
|
-
/* -----------------------------------------------------------------------------
|
|
11
|
-
* Context: FormField
|
|
12
|
-
* -------------------------------------------------------------------------- */
|
|
13
|
-
const FORM_FIELD_NAME = "FormField";
|
|
14
|
-
const [createFormFieldContext, createFormFieldScope] = createContextScope(FORM_FIELD_NAME);
|
|
15
|
-
const [FormFieldContextProvider, useFormFieldContext] = createFormFieldContext(FORM_FIELD_NAME);
|
|
16
|
-
function useFormItem(consumerName, scope) {
|
|
17
|
-
const { id } = useFormItemContext(consumerName, scope);
|
|
18
|
-
const { name } = useFormFieldContext(consumerName, scope);
|
|
19
|
-
const { getFieldState } = useFormContext();
|
|
20
|
-
const formState = useFormState({ name });
|
|
21
|
-
const fieldState = getFieldState(name, formState);
|
|
22
|
-
return {
|
|
23
|
-
formDescriptionId: `form-item-description-${id}`,
|
|
24
|
-
formItemId: `form-item-${id}`,
|
|
25
|
-
formMessageId: `form-item-message-${id}`,
|
|
26
|
-
id,
|
|
27
|
-
name,
|
|
28
|
-
...fieldState,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function FormField(formFieldProps) {
|
|
32
|
-
const { __scopeFormField, ...props } = formFieldProps;
|
|
33
|
-
return (_jsx(FormFieldContextProvider, { name: props.name, scope: __scopeFormField, children: _jsx(Controller, { ...props }) }));
|
|
34
|
-
}
|
|
35
|
-
/* -----------------------------------------------------------------------------
|
|
36
|
-
* Context: FormItem
|
|
37
|
-
* -------------------------------------------------------------------------- */
|
|
38
|
-
const FORM_ITEM_NAME = "FormItem";
|
|
39
|
-
const [FormItemContextProvider, useFormItemContext] = createFormFieldContext(FORM_ITEM_NAME);
|
|
40
|
-
function FormItem({ __scopeFormField, className, ...props }) {
|
|
41
|
-
const id = useId();
|
|
42
|
-
return (_jsx(FormItemContextProvider, { id: id, scope: __scopeFormField, children: _jsx("div", { className: cn("grid gap-2", className), "data-slot": "form-item", ...props }) }));
|
|
43
|
-
}
|
|
44
|
-
/* -----------------------------------------------------------------------------
|
|
45
|
-
* Component: FormLabel
|
|
46
|
-
* -------------------------------------------------------------------------- */
|
|
47
|
-
const FORM_LABEL_NAME = "FormLabel";
|
|
48
|
-
function FormLabel({ __scopeFormField, ...props }) {
|
|
49
|
-
const { error, formItemId } = useFormItem(FORM_LABEL_NAME, __scopeFormField);
|
|
50
|
-
return (_jsx(Label, { "data-invalid": error ? true : undefined, "data-slot": "form-label", htmlFor: formItemId, ...props }));
|
|
51
|
-
}
|
|
52
|
-
/* -----------------------------------------------------------------------------
|
|
53
|
-
* Component: FormControl
|
|
54
|
-
* -------------------------------------------------------------------------- */
|
|
55
|
-
const FORM_CONTROL_NAME = "FormControl";
|
|
56
|
-
function FormControl({ __scopeFormField, ...props }) {
|
|
57
|
-
const { error, formDescriptionId, formItemId, formMessageId } = useFormItem(FORM_CONTROL_NAME, __scopeFormField);
|
|
58
|
-
return (_jsx(Slot, { "aria-describedby": error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId, "aria-invalid": Boolean(error), "data-slot": "form-control", id: formItemId, ...props }));
|
|
59
|
-
}
|
|
60
|
-
function FormDescription({ __scopeFormField, className, ...props }) {
|
|
61
|
-
const { formDescriptionId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);
|
|
62
|
-
return (_jsx("p", { className: cn("text-xs text-muted-foreground", className), "data-slot": "form-description", id: formDescriptionId, ...props }));
|
|
63
|
-
}
|
|
64
|
-
/* -----------------------------------------------------------------------------
|
|
65
|
-
* Component: FormMessage
|
|
66
|
-
* -------------------------------------------------------------------------- */
|
|
67
|
-
const FORM_MESSAGE_NAME = "FormMessage";
|
|
68
|
-
function FormMessage({ __scopeFormField, children, className, ...props }) {
|
|
69
|
-
const { error, formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);
|
|
70
|
-
const body = error?.message ?? children;
|
|
71
|
-
if (!body) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
return (_jsx("p", { className: cn("text-xs", error?.message ? "font-medium text-destructive" : "text-muted-foreground", className), "data-slot": "form-message", id: formMessageId, ...props, children: body }));
|
|
75
|
-
}
|
|
76
|
-
export { createFormFieldScope, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
-
type HoverCardProps = ComponentProps<typeof HoverCardPrimitive.Root>;
|
|
4
|
-
declare function HoverCard({ ...props }: HoverCardProps): JSX.Element;
|
|
5
|
-
type HoverCardTriggerProps = ComponentProps<typeof HoverCardPrimitive.Trigger>;
|
|
6
|
-
declare function HoverCardTrigger({ ...props }: HoverCardTriggerProps): JSX.Element;
|
|
7
|
-
type HoverCardContentProps = ComponentProps<typeof HoverCardPrimitive.Content>;
|
|
8
|
-
declare function HoverCardContent({ align, className, sideOffset, ...props }: HoverCardContentProps): JSX.Element;
|
|
9
|
-
type HoverCardArrowProps = ComponentProps<typeof HoverCardPrimitive.Arrow>;
|
|
10
|
-
declare function HoverCardArrow({ className, ...props }: HoverCardArrowProps): JSX.Element;
|
|
11
|
-
export { HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger };
|
|
12
|
-
export type { HoverCardArrowProps, HoverCardContentProps, HoverCardProps, HoverCardTriggerProps };
|
|
13
|
-
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAMjE,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAErE,iBAAS,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAE5D;AAMD,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE/E,iBAAS,gBAAgB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAE1E;AAMD,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE/E,iBAAS,gBAAgB,CAAC,EACxB,KAAgB,EAChB,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA6BrC;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAQjF;AAMD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
5
|
-
function HoverCard({ ...props }) {
|
|
6
|
-
return _jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
7
|
-
}
|
|
8
|
-
function HoverCardTrigger({ ...props }) {
|
|
9
|
-
return _jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
10
|
-
}
|
|
11
|
-
function HoverCardContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
12
|
-
return (_jsx(HoverCardPrimitive.Portal, { children: _jsx(HoverCardPrimitive.Content, { align: align, className: cn("z-50", "min-w-32 p-4", "rounded-lg border", "bg-popover text-popover-foreground shadow-lg", "ease-ui data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", "data-open:data-side-top:slide-in-from-bottom-2", "data-open:data-side-right:slide-in-from-left-2", "data-open:data-side-bottom:slide-in-from-top-2", "data-open:data-side-left:slide-in-from-right-2", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-closed:data-side-top:slide-out-to-bottom-2", "data-closed:data-side-right:slide-out-to-left-2", "data-closed:data-side-bottom:slide-out-to-top-2", "data-closed:data-side-left:slide-out-to-right-2", "origin-(--radix-hover-card-content-transform-origin)", className), "data-slot": "hover-card-content", sideOffset: sideOffset, ...props }) }));
|
|
13
|
-
}
|
|
14
|
-
function HoverCardArrow({ className, ...props }) {
|
|
15
|
-
return (_jsx(HoverCardPrimitive.Arrow, { className: cn("fill-popover", className), "data-slot": "hover-card-arrow", ...props }));
|
|
16
|
-
}
|
|
17
|
-
/* -----------------------------------------------------------------------------
|
|
18
|
-
* Exports
|
|
19
|
-
* -------------------------------------------------------------------------- */
|
|
20
|
-
export { HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { VariantProps } from "#lib/utils";
|
|
2
|
-
import type { ComponentProps, JSX } from "react";
|
|
3
|
-
import type { ButtonProps } from "#components/button";
|
|
4
|
-
import type { InputProps } from "#components/input";
|
|
5
|
-
import type { TextareaProps } from "#components/textarea";
|
|
6
|
-
declare const inputGroupVariants: import("@codefast/tailwind-variants").VariantFunctionType<import("@codefast/tailwind-variants").ConfigurationSchema, Record<string, never>>;
|
|
7
|
-
declare const inputGroupAddonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
8
|
-
align: {
|
|
9
|
-
"block-end": string[];
|
|
10
|
-
"block-start": string[];
|
|
11
|
-
"inline-end": string[];
|
|
12
|
-
"inline-start": string[];
|
|
13
|
-
};
|
|
14
|
-
}, Record<string, never>>;
|
|
15
|
-
declare const inputGroupButtonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
16
|
-
size: {
|
|
17
|
-
"icon-sm": string[];
|
|
18
|
-
"icon-xs": string[];
|
|
19
|
-
sm: string[];
|
|
20
|
-
xs: string[];
|
|
21
|
-
};
|
|
22
|
-
}, Record<string, never>>;
|
|
23
|
-
type InputGroupProps = ComponentProps<"div">;
|
|
24
|
-
declare function InputGroup({ className, ...props }: InputGroupProps): JSX.Element;
|
|
25
|
-
type InputGroupAddonProps = ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>;
|
|
26
|
-
declare function InputGroupAddon({ align, className, ...props }: InputGroupAddonProps): JSX.Element;
|
|
27
|
-
type InputGroupButtonProps = Omit<ButtonProps, "size"> & VariantProps<typeof inputGroupButtonVariants>;
|
|
28
|
-
declare function InputGroupButton({ className, size, type, variant, ...props }: InputGroupButtonProps): JSX.Element;
|
|
29
|
-
type InputGroupTextProps = ComponentProps<"span">;
|
|
30
|
-
declare function InputGroupText({ className, ...props }: InputGroupTextProps): JSX.Element;
|
|
31
|
-
type InputGroupInputProps = InputProps;
|
|
32
|
-
declare function InputGroupInput({ className, ...props }: InputGroupInputProps): JSX.Element;
|
|
33
|
-
type InputGroupTextareaProps = TextareaProps;
|
|
34
|
-
declare function InputGroupTextarea({ className, ...props }: InputGroupTextareaProps): JSX.Element;
|
|
35
|
-
export { InputGroup, InputGroupAddon, inputGroupAddonVariants, InputGroupButton, inputGroupButtonVariants, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupVariants, };
|
|
36
|
-
export type { InputGroupAddonProps, InputGroupButtonProps, InputGroupInputProps, InputGroupProps, InputGroupTextareaProps, InputGroupTextProps, };
|
|
37
|
-
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/components/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAU1D,QAAA,MAAM,kBAAkB,6IAiBtB,CAAC;AAMH,QAAA,MAAM,uBAAuB;;QAcvB,WAAW;QAKX,aAAa;QAKb,YAAY;QAMZ,cAAc;;yBAQlB,CAAC;AAM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AChB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,CAAC;AAEF,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn, tv } from "#lib/utils";
|
|
4
|
-
import { Button } from "#components/button";
|
|
5
|
-
import { Input } from "#components/input";
|
|
6
|
-
import { Textarea } from "#components/textarea";
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Variants: InputGroup
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
const inputGroupVariants = tv({
|
|
11
|
-
base: [
|
|
12
|
-
"group/input-group relative flex h-9 w-full min-w-0 items-center",
|
|
13
|
-
"rounded-lg border border-input shadow-xs outline-none",
|
|
14
|
-
"transition-[color,box-shadow]",
|
|
15
|
-
"dark:bg-input/30",
|
|
16
|
-
"has-[>textarea]:h-auto",
|
|
17
|
-
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col",
|
|
18
|
-
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",
|
|
19
|
-
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
|
|
20
|
-
"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20",
|
|
21
|
-
"dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
22
|
-
"has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:pt-3",
|
|
23
|
-
"has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:pb-3",
|
|
24
|
-
"has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-2",
|
|
25
|
-
"has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-2",
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
/* -----------------------------------------------------------------------------
|
|
29
|
-
* Variants: InputGroupAddon
|
|
30
|
-
* -------------------------------------------------------------------------- */
|
|
31
|
-
const inputGroupAddonVariants = tv({
|
|
32
|
-
base: [
|
|
33
|
-
"flex h-auto items-center justify-center gap-2 py-1.5",
|
|
34
|
-
"text-sm font-medium text-muted-foreground",
|
|
35
|
-
"cursor-text select-none",
|
|
36
|
-
"group-data-disabled/input-group:opacity-50",
|
|
37
|
-
"[&>kbd]:rounded-[calc(var(--radius)-5px)]",
|
|
38
|
-
"[&>svg:not([class*='size-'])]:size-4",
|
|
39
|
-
],
|
|
40
|
-
defaultVariants: {
|
|
41
|
-
align: "inline-start",
|
|
42
|
-
},
|
|
43
|
-
variants: {
|
|
44
|
-
align: {
|
|
45
|
-
"block-end": [
|
|
46
|
-
"order-last w-full justify-start px-3 pb-3",
|
|
47
|
-
"group-has-[>input]/input-group:pb-2.5",
|
|
48
|
-
"[.border-t]:pt-3",
|
|
49
|
-
],
|
|
50
|
-
"block-start": [
|
|
51
|
-
"order-first w-full justify-start px-3 pt-3",
|
|
52
|
-
"group-has-[>input]/input-group:pt-2.5",
|
|
53
|
-
"[.border-b]:pb-3",
|
|
54
|
-
],
|
|
55
|
-
"inline-end": [
|
|
56
|
-
"order-last",
|
|
57
|
-
"pr-3",
|
|
58
|
-
"has-[>button]:mr-[-0.45rem]",
|
|
59
|
-
"has-[>kbd]:mr-[-0.35rem]",
|
|
60
|
-
],
|
|
61
|
-
"inline-start": [
|
|
62
|
-
"order-first",
|
|
63
|
-
"pl-3",
|
|
64
|
-
"has-[>button]:ml-[-0.45rem]",
|
|
65
|
-
"has-[>kbd]:ml-[-0.35rem]",
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
/* -----------------------------------------------------------------------------
|
|
71
|
-
* Variants: InputGroupButton
|
|
72
|
-
* -------------------------------------------------------------------------- */
|
|
73
|
-
const inputGroupButtonVariants = tv({
|
|
74
|
-
base: [
|
|
75
|
-
"flex items-center gap-2",
|
|
76
|
-
"shadow-none",
|
|
77
|
-
"text-sm",
|
|
78
|
-
"[&>svg:not([class*='size-'])]:size-4",
|
|
79
|
-
],
|
|
80
|
-
defaultVariants: {
|
|
81
|
-
size: "xs",
|
|
82
|
-
},
|
|
83
|
-
variants: {
|
|
84
|
-
size: {
|
|
85
|
-
"icon-sm": ["size-8 p-0", "has-[>svg]:p-0"],
|
|
86
|
-
"icon-xs": ["size-6 p-0", "rounded-[calc(var(--radius)-5px)]", "has-[>svg]:p-0"],
|
|
87
|
-
sm: ["h-8 gap-1.5 px-2.5", "rounded-md", "has-[>svg]:px-2.5"],
|
|
88
|
-
xs: [
|
|
89
|
-
"h-6 gap-1 px-2",
|
|
90
|
-
"rounded-[calc(var(--radius)-5px)]",
|
|
91
|
-
"has-[>svg]:px-2",
|
|
92
|
-
"[&>svg]:size-3.5",
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
function InputGroup({ className, ...props }) {
|
|
98
|
-
return (_jsx("div", { className: inputGroupVariants({ className }), "data-slot": "input-group", role: "group", ...props }));
|
|
99
|
-
}
|
|
100
|
-
function InputGroupAddon({ align = "inline-start", className, ...props }) {
|
|
101
|
-
return (_jsx("div", { className: cn(inputGroupAddonVariants({ align }), className), "data-align": align, "data-slot": "input-group-addon", role: "group", onPointerDown: (event) => {
|
|
102
|
-
if (event.target.closest("button")) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
event.preventDefault();
|
|
106
|
-
const control = event.currentTarget.parentElement?.querySelector("input, textarea");
|
|
107
|
-
if (control instanceof HTMLElement) {
|
|
108
|
-
control.focus();
|
|
109
|
-
}
|
|
110
|
-
}, ...props }));
|
|
111
|
-
}
|
|
112
|
-
function InputGroupButton({ className, size = "xs", type = "button", variant = "ghost", ...props }) {
|
|
113
|
-
return (_jsx(Button, { className: cn(inputGroupButtonVariants({ size }), className), "data-size": size, "data-slot": "input-group-button", type: type, variant: variant, ...props }));
|
|
114
|
-
}
|
|
115
|
-
function InputGroupText({ className, ...props }) {
|
|
116
|
-
return (_jsx("span", { className: cn("flex items-center gap-2 text-sm text-muted-foreground", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4", className), "data-slot": "input-group-text", ...props }));
|
|
117
|
-
}
|
|
118
|
-
function InputGroupInput({ className, ...props }) {
|
|
119
|
-
return (_jsx(Input, { className: cn("flex-1", "px-3 py-1", "rounded-none border-0", "bg-transparent shadow-none", "focus-visible:ring-0", "dark:bg-transparent", className), "data-slot": "input-group-control", ...props }));
|
|
120
|
-
}
|
|
121
|
-
function InputGroupTextarea({ className, ...props }) {
|
|
122
|
-
return (_jsx(Textarea, { className: cn("flex-1", "py-3", "rounded-none border-0", "bg-transparent shadow-none", "resize-none", "focus-visible:ring-0", "dark:bg-transparent", className), "data-slot": "input-group-control", ...props }));
|
|
123
|
-
}
|
|
124
|
-
/* -----------------------------------------------------------------------------
|
|
125
|
-
* Exports
|
|
126
|
-
* -------------------------------------------------------------------------- */
|
|
127
|
-
export { InputGroup, InputGroupAddon, inputGroupAddonVariants, InputGroupButton, inputGroupButtonVariants, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupVariants, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as InputNumberPrimitive from "#primitives/input-number";
|
|
3
|
-
interface InputNumberProps extends ComponentProps<typeof InputNumberPrimitive.Field>, ComponentProps<typeof InputNumberPrimitive.Root> {
|
|
4
|
-
}
|
|
5
|
-
declare function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }: InputNumberProps): JSX.Element;
|
|
6
|
-
export { InputNumber };
|
|
7
|
-
export type { InputNumberProps };
|
|
8
|
-
//# sourceMappingURL=input-number.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["../../src/components/input-number.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AAMjE,UAAU,gBACR,SACE,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,EACjD,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC;CAAG;AAEvD,iBAAS,WAAW,CAAC,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,EAAE,EACF,cAAc,EACd,OAAO,EACP,GAAG,EACH,GAAG,EACH,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,MAAM,EACN,KAAK,EACL,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAyGhC;AAMD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
-
import { buttonVariants } from "#components/button";
|
|
6
|
-
import { Spinner } from "#components/spinner";
|
|
7
|
-
import * as InputNumberPrimitive from "#primitives/input-number";
|
|
8
|
-
function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }) {
|
|
9
|
-
return (_jsxs(InputNumberPrimitive.Root, { ariaDecrementLabel: ariaDecrementLabel, ariaIncrementLabel: ariaIncrementLabel, className: cn("group peer flex h-9 w-full grow items-center gap-3 px-3 pr-0", "rounded-lg border border-input", "text-base", "transition", "not-has-disabled:shadow-xs", "focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50", "hover:not-has-disabled:not-focus-within:border-ring/60", "has-disabled:opacity-50", "has-aria-invalid:border-destructive", "focus-within:has-aria-invalid:ring-destructive/20", "hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60", "md:text-sm", "dark:bg-input/30", "dark:focus-within:has-aria-invalid:ring-destructive/40", "[&_svg]:shrink-0", "[&_svg:not([class*='size-'])]:size-4", "[&>svg]:text-muted-foreground", className), "data-slot": "input-number", defaultValue: defaultValue, disabled: disabled, formatOptions: formatOptions, id: id, loaderPosition: loaderPosition, loading: loading, max: max, min: min, prefix: prefix, readOnly: readOnly, spinner: spinner ?? _jsx(Spinner, {}, "spinner"), step: step, suffix: suffix, value: value, onChange: onChange, children: [_jsx(InputNumberPrimitive.Field, { autoCapitalize: "none", autoComplete: "off", autoCorrect: "off", className: cn("h-9 w-full min-w-0 px-3 py-1", "rounded-md border border-input", "bg-transparent shadow-xs outline-none", "text-base", "transition-[color,box-shadow]", "selection:bg-primary selection:text-primary-foreground", "file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", "placeholder:text-muted-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20", "md:text-sm", "dark:bg-input/30", "dark:aria-invalid:ring-destructive/40"), spellCheck: "false", ...props }), _jsxs("div", { className: cn("order-last ml-auto grid h-full shrink-0", "divide-y divide-input border-l border-l-input", "transition", "group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60", "group-focus-within:divide-ring group-focus-within:border-l-ring", "group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive", "group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0", "group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20", "dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"), "data-slot": "input-number-buttons", children: [_jsx(InputNumberPrimitive.IncrementButton, { "aria-label": "Increment", className: buttonVariants({
|
|
10
|
-
className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
|
|
11
|
-
variant: "ghost",
|
|
12
|
-
}), "data-slot": "input-number-increment-button", children: _jsx(ChevronUpIcon, {}) }), _jsx(InputNumberPrimitive.DecrementButton, { "aria-label": "Decrement", className: buttonVariants({
|
|
13
|
-
className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
|
|
14
|
-
variant: "ghost",
|
|
15
|
-
}), "data-slot": "input-number-decrement-button", children: _jsx(ChevronDownIcon, {}) })] })] }));
|
|
16
|
-
}
|
|
17
|
-
/* -----------------------------------------------------------------------------
|
|
18
|
-
* Exports
|
|
19
|
-
* -------------------------------------------------------------------------- */
|
|
20
|
-
export { InputNumber };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import { OTPInput } from "input-otp";
|
|
3
|
-
type InputOTPProps = ComponentProps<typeof OTPInput>;
|
|
4
|
-
declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
|
|
5
|
-
type InputOTPGroupProps = ComponentProps<"div">;
|
|
6
|
-
declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
|
|
7
|
-
interface InputOTPSlotProps extends ComponentProps<"div"> {
|
|
8
|
-
index: number;
|
|
9
|
-
}
|
|
10
|
-
declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
|
|
11
|
-
type InputOTPSeparatorProps = ComponentProps<"div">;
|
|
12
|
-
declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
|
|
13
|
-
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
14
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
15
|
-
export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
|
|
16
|
-
//# sourceMappingURL=input-otp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.d.ts","sourceRoot":"","sources":["../../src/components/input-otp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAQtD,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAErD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAczF;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhD,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAS/E;AAMD,UAAU,iBAAkB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA0CpF;AAMD,KAAK,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEpD,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAM5E;AAMD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
|
-
import { MinusIcon } from "lucide-react";
|
|
6
|
-
import { use } from "react";
|
|
7
|
-
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
|
-
return (_jsx(OTPInput, { "aria-label": "One-time password", className: cn(className), containerClassName: cn("flex items-center gap-2", "has-disabled:opacity-50", containerClassName), "data-slot": "input-otp", ...props }));
|
|
9
|
-
}
|
|
10
|
-
function InputOTPGroup({ className, ...props }) {
|
|
11
|
-
return (_jsx("div", { className: cn("flex items-center -space-x-px", className), "data-slot": "input-otp-group", role: "group", ...props }));
|
|
12
|
-
}
|
|
13
|
-
function InputOTPSlot({ className, index, ...props }) {
|
|
14
|
-
const inputOTPContext = use(OTPInputContext);
|
|
15
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
16
|
-
return (_jsxs("div", { className: cn("relative flex size-9 items-center justify-center", "border border-input outline-hidden", "text-sm", "transition-all", "not-has-disabled:shadow-xs", "first:rounded-l-lg", "last:rounded-r-lg", "aria-invalid:border-destructive", "dark:bg-input/30", "data-active:z-10 data-active:border-ring data-active:ring-3 data-active:ring-ring/50", "data-active:aria-invalid:border-destructive data-active:aria-invalid:ring-destructive/20", "dark:data-active:aria-invalid:ring-destructive/40", className), "data-active": isActive, "data-slot": "input-otp-slot", ...props, children: [char, hasFakeCaret ? (_jsx("div", { className: cn("absolute inset-0 flex items-center justify-center", "pointer-events-none"), children: _jsx("div", { className: cn("h-4 w-px", "bg-foreground", "animate-caret-blink", "animation-duration-1000") }) })) : null] }));
|
|
17
|
-
}
|
|
18
|
-
function InputOTPSeparator({ ...props }) {
|
|
19
|
-
return (_jsx("div", { "data-slot": "input-otp-separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
20
|
-
}
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Exports
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
25
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import { InputGroupInput } from "#components/input-group";
|
|
3
|
-
type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
|
|
4
|
-
declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
|
|
5
|
-
export { InputPassword };
|
|
6
|
-
export type { InputPasswordProps };
|
|
7
|
-
//# sourceMappingURL=input-password.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAqB,MAAM,OAAO,CAAC;AAKpE,OAAO,EAAgC,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAMxF,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/E,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAuClC;AAMD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|