@codefast/ui 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +126 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +74 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +12 -19
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +9 -9
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +8 -8
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +10 -12
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +10 -12
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +18 -1
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +8 -12
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +130 -131
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +385 -38
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
1
|
+
import type { VariantProps } from '@codefast/tailwind-variants';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
import type { ButtonProps } from './button';
|
|
4
|
+
import type { InputProps } from './input';
|
|
5
|
+
import type { TextareaProps } from './textarea';
|
|
6
6
|
declare const inputGroupVariants: import("@codefast/tailwind-variants").VariantFunctionType<import("@codefast/tailwind-variants").ConfigurationSchema, Record<string, never>>;
|
|
7
7
|
declare const inputGroupAddonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
8
8
|
align: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
'block-end': string;
|
|
10
|
+
'block-start': string;
|
|
11
|
+
'inline-end': string;
|
|
12
|
+
'inline-start': string;
|
|
13
13
|
};
|
|
14
14
|
}, Record<string, never>>;
|
|
15
15
|
declare const inputGroupButtonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
16
16
|
size: {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
'icon-sm': string;
|
|
18
|
+
'icon-xs': string;
|
|
19
19
|
sm: string;
|
|
20
20
|
xs: string;
|
|
21
21
|
};
|
|
22
22
|
}, Record<string, never>>;
|
|
23
|
-
type InputGroupProps = ComponentProps<
|
|
23
|
+
type InputGroupProps = ComponentProps<'div'>;
|
|
24
24
|
declare function InputGroup({ className, ...props }: InputGroupProps): JSX.Element;
|
|
25
|
-
type InputGroupAddonProps = ComponentProps<
|
|
25
|
+
type InputGroupAddonProps = ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>;
|
|
26
26
|
declare function InputGroupAddon({ align, className, ...props }: InputGroupAddonProps): JSX.Element;
|
|
27
|
-
type InputGroupButtonProps = Omit<ButtonProps,
|
|
27
|
+
type InputGroupButtonProps = Omit<ButtonProps, 'size'> & VariantProps<typeof inputGroupButtonVariants>;
|
|
28
28
|
declare function InputGroupButton({ className, size, type, variant, ...props }: InputGroupButtonProps): JSX.Element;
|
|
29
|
-
type InputGroupTextProps = ComponentProps<
|
|
29
|
+
type InputGroupTextProps = ComponentProps<'span'>;
|
|
30
30
|
declare function InputGroupText({ className, ...props }: InputGroupTextProps): JSX.Element;
|
|
31
31
|
type InputGroupInputProps = InputProps;
|
|
32
32
|
declare function InputGroupInput({ className, ...props }: InputGroupInputProps): JSX.Element;
|
|
@@ -1,2 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Input } from "./input.js";
|
|
6
|
+
import { Textarea } from "./textarea.js";
|
|
7
|
+
const inputGroupVariants = tv({
|
|
8
|
+
base: cn('group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-lg border shadow-xs transition-[color,box-shadow] outline-none', 'h-9 min-w-0 has-[>textarea]:h-auto', 'has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-2', 'has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-2', 'has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:pb-3', 'has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:pt-3', 'has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-3', 'has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40')
|
|
9
|
+
});
|
|
10
|
+
const inputGroupAddonVariants = tv({
|
|
11
|
+
base: cn("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50"),
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
align: 'inline-start'
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
align: {
|
|
17
|
+
'block-end': 'order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5',
|
|
18
|
+
'block-start': 'order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5',
|
|
19
|
+
'inline-end': 'order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]',
|
|
20
|
+
'inline-start': 'order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const inputGroupButtonVariants = tv({
|
|
25
|
+
base: "text-sm shadow-none flex items-center gap-2 [&>svg:not([class*='size-'])]:size-4",
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: 'xs'
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
size: {
|
|
31
|
+
'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
|
|
32
|
+
'icon-xs': 'size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0',
|
|
33
|
+
sm: 'h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5',
|
|
34
|
+
xs: 'h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg]:size-3.5 has-[>svg]:px-2'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function InputGroup({ className, ...props }) {
|
|
39
|
+
return /*#__PURE__*/ jsx("div", {
|
|
40
|
+
className: inputGroupVariants({
|
|
41
|
+
className
|
|
42
|
+
}),
|
|
43
|
+
"data-slot": "input-group",
|
|
44
|
+
role: "group",
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function InputGroupAddon({ align = 'inline-start', className, ...props }) {
|
|
49
|
+
return /*#__PURE__*/ jsx("div", {
|
|
50
|
+
className: cn(inputGroupAddonVariants({
|
|
51
|
+
align
|
|
52
|
+
}), className),
|
|
53
|
+
"data-align": align,
|
|
54
|
+
"data-slot": "input-group-addon",
|
|
55
|
+
role: "group",
|
|
56
|
+
onPointerDown: (event)=>{
|
|
57
|
+
if (event.target.closest('button')) return;
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
const control = event.currentTarget.parentElement?.querySelector('input, textarea');
|
|
60
|
+
if (control instanceof HTMLElement) control.focus();
|
|
61
|
+
},
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function InputGroupButton({ className, size = 'xs', type = 'button', variant = 'ghost', ...props }) {
|
|
66
|
+
return /*#__PURE__*/ jsx(Button, {
|
|
67
|
+
className: cn(inputGroupButtonVariants({
|
|
68
|
+
size
|
|
69
|
+
}), className),
|
|
70
|
+
"data-size": size,
|
|
71
|
+
"data-slot": "input-group-button",
|
|
72
|
+
type: type,
|
|
73
|
+
variant: variant,
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function InputGroupText({ className, ...props }) {
|
|
78
|
+
return /*#__PURE__*/ jsx("span", {
|
|
79
|
+
className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
80
|
+
"data-slot": "input-group-text",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function InputGroupInput({ className, ...props }) {
|
|
85
|
+
return /*#__PURE__*/ jsx(Input, {
|
|
86
|
+
className: cn('flex-1 rounded-none border-0 bg-transparent px-3 py-1 shadow-none focus-visible:ring-0 dark:bg-transparent', className),
|
|
87
|
+
"data-slot": "input-group-control",
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
92
|
+
return /*#__PURE__*/ jsx(Textarea, {
|
|
93
|
+
className: cn('flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent', className),
|
|
94
|
+
"data-slot": "input-group-control",
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants };
|
|
@@ -1,2 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
InputNumber: ()=>InputNumber
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
33
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
34
|
+
const external_spinner_cjs_namespaceObject = require("./spinner.cjs");
|
|
35
|
+
const input_number_cjs_namespaceObject = require("../primitives/input-number.cjs");
|
|
36
|
+
function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }) {
|
|
37
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(input_number_cjs_namespaceObject.Root, {
|
|
38
|
+
ariaDecrementLabel: ariaDecrementLabel,
|
|
39
|
+
ariaIncrementLabel: ariaIncrementLabel,
|
|
40
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group border-input hover:not-has-disabled:not-focus-within:border-ring/60 focus-within:border-ring focus-within:ring-ring/50 [&>svg]:text-muted-foreground has-aria-invalid:border-destructive hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 dark:bg-input/30 peer flex h-9 w-full grow items-center gap-3 rounded-lg border px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:ring-3 has-disabled:opacity-50 md:text-sm [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
41
|
+
"data-slot": "input-number",
|
|
42
|
+
defaultValue: defaultValue,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
formatOptions: formatOptions,
|
|
45
|
+
id: id,
|
|
46
|
+
loaderPosition: loaderPosition,
|
|
47
|
+
loading: loading,
|
|
48
|
+
max: max,
|
|
49
|
+
min: min,
|
|
50
|
+
prefix: prefix,
|
|
51
|
+
readOnly: readOnly,
|
|
52
|
+
spinner: spinner ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_spinner_cjs_namespaceObject.Spinner, {}, "spinner"),
|
|
53
|
+
step: step,
|
|
54
|
+
suffix: suffix,
|
|
55
|
+
value: value,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_number_cjs_namespaceObject.Field, {
|
|
59
|
+
autoCapitalize: "none",
|
|
60
|
+
autoComplete: "off",
|
|
61
|
+
autoCorrect: "off",
|
|
62
|
+
className: "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
63
|
+
spellCheck: "false",
|
|
64
|
+
...props
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
67
|
+
className: (0, tailwind_variants_namespaceObject.cn)('divide-input border-l-input 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:border-l-ring group-focus-within:divide-ring group-has-aria-invalid:border-l-destructive group-has-aria-invalid:divide-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 order-last ml-auto grid h-full shrink-0 divide-y border-l transition', '*:[button]:focus-visible:bg-ring/50 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40 *:[button]:focus-visible:ring-0'),
|
|
68
|
+
"data-slot": "input-number-buttons",
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_number_cjs_namespaceObject.IncrementButton, {
|
|
71
|
+
"aria-label": "Increment",
|
|
72
|
+
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
73
|
+
className: 'text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]',
|
|
74
|
+
variant: 'ghost'
|
|
75
|
+
}),
|
|
76
|
+
"data-slot": "input-number-increment-button",
|
|
77
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronUpIcon, {})
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_number_cjs_namespaceObject.DecrementButton, {
|
|
80
|
+
"aria-label": "Decrement",
|
|
81
|
+
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
82
|
+
className: 'text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]',
|
|
83
|
+
variant: 'ghost'
|
|
84
|
+
}),
|
|
85
|
+
"data-slot": "input-number-decrement-button",
|
|
86
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {})
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
exports.InputNumber = __webpack_exports__.InputNumber;
|
|
94
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
95
|
+
"InputNumber"
|
|
96
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
97
|
+
Object.defineProperty(exports, '__esModule', {
|
|
98
|
+
value: true
|
|
99
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as InputNumberPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
import * as InputNumberPrimitive from '../primitives/input-number';
|
|
3
3
|
interface InputNumberProps extends ComponentProps<typeof InputNumberPrimitive.Field>, ComponentProps<typeof InputNumberPrimitive.Root> {
|
|
4
4
|
}
|
|
5
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;
|
|
@@ -1,2 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
+
import { buttonVariants } from "./button.js";
|
|
6
|
+
import { Spinner } from "./spinner.js";
|
|
7
|
+
import { DecrementButton, Field, IncrementButton, Root } from "../primitives/input-number.js";
|
|
8
|
+
function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }) {
|
|
9
|
+
return /*#__PURE__*/ jsxs(Root, {
|
|
10
|
+
ariaDecrementLabel: ariaDecrementLabel,
|
|
11
|
+
ariaIncrementLabel: ariaIncrementLabel,
|
|
12
|
+
className: cn("group border-input hover:not-has-disabled:not-focus-within:border-ring/60 focus-within:border-ring focus-within:ring-ring/50 [&>svg]:text-muted-foreground has-aria-invalid:border-destructive hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 dark:bg-input/30 peer flex h-9 w-full grow items-center gap-3 rounded-lg border px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:ring-3 has-disabled:opacity-50 md:text-sm [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
13
|
+
"data-slot": "input-number",
|
|
14
|
+
defaultValue: defaultValue,
|
|
15
|
+
disabled: disabled,
|
|
16
|
+
formatOptions: formatOptions,
|
|
17
|
+
id: id,
|
|
18
|
+
loaderPosition: loaderPosition,
|
|
19
|
+
loading: loading,
|
|
20
|
+
max: max,
|
|
21
|
+
min: min,
|
|
22
|
+
prefix: prefix,
|
|
23
|
+
readOnly: readOnly,
|
|
24
|
+
spinner: spinner ?? /*#__PURE__*/ jsx(Spinner, {}, "spinner"),
|
|
25
|
+
step: step,
|
|
26
|
+
suffix: suffix,
|
|
27
|
+
value: value,
|
|
28
|
+
onChange: onChange,
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ jsx(Field, {
|
|
31
|
+
autoCapitalize: "none",
|
|
32
|
+
autoComplete: "off",
|
|
33
|
+
autoCorrect: "off",
|
|
34
|
+
className: "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
35
|
+
spellCheck: "false",
|
|
36
|
+
...props
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsxs("div", {
|
|
39
|
+
className: cn('divide-input border-l-input 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:border-l-ring group-focus-within:divide-ring group-has-aria-invalid:border-l-destructive group-has-aria-invalid:divide-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 order-last ml-auto grid h-full shrink-0 divide-y border-l transition', '*:[button]:focus-visible:bg-ring/50 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40 *:[button]:focus-visible:ring-0'),
|
|
40
|
+
"data-slot": "input-number-buttons",
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ jsx(IncrementButton, {
|
|
43
|
+
"aria-label": "Increment",
|
|
44
|
+
className: buttonVariants({
|
|
45
|
+
className: 'text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]',
|
|
46
|
+
variant: 'ghost'
|
|
47
|
+
}),
|
|
48
|
+
"data-slot": "input-number-increment-button",
|
|
49
|
+
children: /*#__PURE__*/ jsx(ChevronUpIcon, {})
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ jsx(DecrementButton, {
|
|
52
|
+
"aria-label": "Decrement",
|
|
53
|
+
className: buttonVariants({
|
|
54
|
+
className: 'text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]',
|
|
55
|
+
variant: 'ghost'
|
|
56
|
+
}),
|
|
57
|
+
"data-slot": "input-number-decrement-button",
|
|
58
|
+
children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export { InputNumber };
|
|
@@ -1,2 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
InputOTPSlot: ()=>InputOTPSlot,
|
|
29
|
+
InputOTPSeparator: ()=>InputOTPSeparator,
|
|
30
|
+
REGEXP_ONLY_CHARS: ()=>external_input_otp_namespaceObject.REGEXP_ONLY_CHARS,
|
|
31
|
+
REGEXP_ONLY_DIGITS: ()=>external_input_otp_namespaceObject.REGEXP_ONLY_DIGITS,
|
|
32
|
+
InputOTP: ()=>InputOTP,
|
|
33
|
+
REGEXP_ONLY_DIGITS_AND_CHARS: ()=>external_input_otp_namespaceObject.REGEXP_ONLY_DIGITS_AND_CHARS,
|
|
34
|
+
InputOTPGroup: ()=>InputOTPGroup
|
|
35
|
+
});
|
|
36
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
37
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
38
|
+
const external_input_otp_namespaceObject = require("input-otp");
|
|
39
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
40
|
+
const external_react_namespaceObject = require("react");
|
|
41
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
42
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_otp_namespaceObject.OTPInput, {
|
|
43
|
+
"aria-label": "One-time password",
|
|
44
|
+
className: (0, tailwind_variants_namespaceObject.cn)(className),
|
|
45
|
+
containerClassName: (0, tailwind_variants_namespaceObject.cn)('flex items-center gap-2 has-disabled:opacity-50', containerClassName),
|
|
46
|
+
"data-slot": "input-otp",
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function InputOTPGroup({ className, ...props }) {
|
|
51
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
52
|
+
className: (0, tailwind_variants_namespaceObject.cn)('flex items-center -space-x-px', className),
|
|
53
|
+
"data-slot": "input-otp-group",
|
|
54
|
+
role: "group",
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function InputOTPSlot({ className, index, ...props }) {
|
|
59
|
+
const inputOTPContext = (0, external_react_namespaceObject.use)(external_input_otp_namespaceObject.OTPInputContext);
|
|
60
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
61
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
62
|
+
className: (0, tailwind_variants_namespaceObject.cn)('border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 relative flex size-9 items-center justify-center border text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg data-[active=true]:z-10 data-[active=true]:ring-3', className),
|
|
63
|
+
"data-active": isActive,
|
|
64
|
+
"data-slot": "input-otp-slot",
|
|
65
|
+
...props,
|
|
66
|
+
children: [
|
|
67
|
+
char,
|
|
68
|
+
hasFakeCaret ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
69
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
70
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
71
|
+
className: "animate-caret-blink bg-foreground animation-duration-1000 h-4 w-px"
|
|
72
|
+
})
|
|
73
|
+
}) : null
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function InputOTPSeparator({ ...props }) {
|
|
78
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
79
|
+
"data-slot": "input-otp-separator",
|
|
80
|
+
...props,
|
|
81
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.MinusIcon, {})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.InputOTP = __webpack_exports__.InputOTP;
|
|
85
|
+
exports.InputOTPGroup = __webpack_exports__.InputOTPGroup;
|
|
86
|
+
exports.InputOTPSeparator = __webpack_exports__.InputOTPSeparator;
|
|
87
|
+
exports.InputOTPSlot = __webpack_exports__.InputOTPSlot;
|
|
88
|
+
exports.REGEXP_ONLY_CHARS = __webpack_exports__.REGEXP_ONLY_CHARS;
|
|
89
|
+
exports.REGEXP_ONLY_DIGITS = __webpack_exports__.REGEXP_ONLY_DIGITS;
|
|
90
|
+
exports.REGEXP_ONLY_DIGITS_AND_CHARS = __webpack_exports__.REGEXP_ONLY_DIGITS_AND_CHARS;
|
|
91
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
92
|
+
"InputOTP",
|
|
93
|
+
"InputOTPGroup",
|
|
94
|
+
"InputOTPSeparator",
|
|
95
|
+
"InputOTPSlot",
|
|
96
|
+
"REGEXP_ONLY_CHARS",
|
|
97
|
+
"REGEXP_ONLY_DIGITS",
|
|
98
|
+
"REGEXP_ONLY_DIGITS_AND_CHARS"
|
|
99
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
100
|
+
Object.defineProperty(exports, '__esModule', {
|
|
101
|
+
value: true
|
|
102
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { OTPInput } from
|
|
1
|
+
import type { ComponentProps, JSX } from 'react';
|
|
2
|
+
import { OTPInput } from 'input-otp';
|
|
3
3
|
type InputOTPProps = ComponentProps<typeof OTPInput>;
|
|
4
4
|
declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
|
|
5
|
-
type InputOTPGroupProps = ComponentProps<
|
|
5
|
+
type InputOTPGroupProps = ComponentProps<'div'>;
|
|
6
6
|
declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
|
|
7
|
-
interface InputOTPSlotProps extends ComponentProps<
|
|
7
|
+
interface InputOTPSlotProps extends ComponentProps<'div'> {
|
|
8
8
|
index: number;
|
|
9
9
|
}
|
|
10
10
|
declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
|
|
11
|
-
type InputOTPSeparatorProps = ComponentProps<
|
|
11
|
+
type InputOTPSeparatorProps = ComponentProps<'div'>;
|
|
12
12
|
declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
|
|
13
|
-
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from
|
|
13
|
+
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
|
|
14
14
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
15
15
|
export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
|
|
@@ -1,2 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { OTPInput, OTPInputContext, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
5
|
+
import { MinusIcon } from "lucide-react";
|
|
6
|
+
import { use } from "react";
|
|
7
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
|
+
return /*#__PURE__*/ jsx(OTPInput, {
|
|
9
|
+
"aria-label": "One-time password",
|
|
10
|
+
className: cn(className),
|
|
11
|
+
containerClassName: cn('flex items-center gap-2 has-disabled:opacity-50', containerClassName),
|
|
12
|
+
"data-slot": "input-otp",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function InputOTPGroup({ className, ...props }) {
|
|
17
|
+
return /*#__PURE__*/ jsx("div", {
|
|
18
|
+
className: cn('flex items-center -space-x-px', className),
|
|
19
|
+
"data-slot": "input-otp-group",
|
|
20
|
+
role: "group",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function InputOTPSlot({ className, index, ...props }) {
|
|
25
|
+
const inputOTPContext = use(OTPInputContext);
|
|
26
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
27
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
28
|
+
className: cn('border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 relative flex size-9 items-center justify-center border text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg data-[active=true]:z-10 data-[active=true]:ring-3', className),
|
|
29
|
+
"data-active": isActive,
|
|
30
|
+
"data-slot": "input-otp-slot",
|
|
31
|
+
...props,
|
|
32
|
+
children: [
|
|
33
|
+
char,
|
|
34
|
+
hasFakeCaret ? /*#__PURE__*/ jsx("div", {
|
|
35
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
36
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
37
|
+
className: "animate-caret-blink bg-foreground animation-duration-1000 h-4 w-px"
|
|
38
|
+
})
|
|
39
|
+
}) : null
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function InputOTPSeparator({ ...props }) {
|
|
44
|
+
return /*#__PURE__*/ jsx("div", {
|
|
45
|
+
"data-slot": "input-otp-separator",
|
|
46
|
+
...props,
|
|
47
|
+
children: /*#__PURE__*/ jsx(MinusIcon, {})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
|
|
@@ -1,2 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
InputPassword: ()=>InputPassword
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
|
|
34
|
+
function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
35
|
+
const [type, setType] = (0, external_react_namespaceObject.useState)('password');
|
|
36
|
+
const togglePasswordVisibility = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
37
|
+
setType((previous)=>'password' === previous ? 'text' : 'password');
|
|
38
|
+
}, []);
|
|
39
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
40
|
+
className: className,
|
|
41
|
+
"data-disabled": disabled ? 'true' : void 0,
|
|
42
|
+
"data-slot": "input-password",
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
45
|
+
autoCapitalize: "none",
|
|
46
|
+
"data-slot": "input-password-item",
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
readOnly: readOnly,
|
|
49
|
+
type: type,
|
|
50
|
+
...props
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
|
|
53
|
+
"aria-label": 'password' === type ? 'Show password' : 'Hide password',
|
|
54
|
+
className: "focus-visible:not-disabled:bg-input rounded-full focus-visible:ring-0",
|
|
55
|
+
"data-slot": "input-password-toggle",
|
|
56
|
+
disabled: disabled,
|
|
57
|
+
size: "icon-sm",
|
|
58
|
+
type: "button",
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
onClick: togglePasswordVisibility,
|
|
61
|
+
children: 'password' === type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.EyeOffIcon, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.EyeIcon, {})
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.InputPassword = __webpack_exports__.InputPassword;
|
|
67
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
68
|
+
"InputPassword"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|