@codefast/ui 0.3.9 → 0.3.11-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +124 -1
- package/dist/components/breadcrumb.js +72 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +11 -18
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +1 -1
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +6 -6
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +2 -2
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +8 -10
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +8 -10
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +17 -0
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +7 -11
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +1 -1
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +1 -1
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +1 -1
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +1 -1
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +405 -62
|
@@ -1,2 +1,156 @@
|
|
|
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
|
+
inputGroupAddonVariants: ()=>inputGroupAddonVariants,
|
|
29
|
+
inputGroupVariants: ()=>inputGroupVariants,
|
|
30
|
+
InputGroupText: ()=>InputGroupText,
|
|
31
|
+
InputGroupAddon: ()=>InputGroupAddon,
|
|
32
|
+
InputGroupTextarea: ()=>InputGroupTextarea,
|
|
33
|
+
InputGroupButton: ()=>InputGroupButton,
|
|
34
|
+
InputGroup: ()=>InputGroup,
|
|
35
|
+
InputGroupInput: ()=>InputGroupInput,
|
|
36
|
+
inputGroupButtonVariants: ()=>inputGroupButtonVariants
|
|
37
|
+
});
|
|
38
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
40
|
+
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
41
|
+
const external_input_cjs_namespaceObject = require("./input.cjs");
|
|
42
|
+
const external_textarea_cjs_namespaceObject = require("./textarea.cjs");
|
|
43
|
+
const inputGroupVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
44
|
+
base: (0, tailwind_variants_namespaceObject.cn)("group/input-group relative flex w-full items-center rounded-lg border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "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-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40")
|
|
45
|
+
});
|
|
46
|
+
const inputGroupAddonVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
47
|
+
base: (0, tailwind_variants_namespaceObject.cn)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4"),
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
align: "inline-start"
|
|
50
|
+
},
|
|
51
|
+
variants: {
|
|
52
|
+
align: {
|
|
53
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
|
|
54
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
55
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
56
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const inputGroupButtonVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
61
|
+
base: "flex items-center gap-2 text-sm shadow-none [&>svg:not([class*='size-'])]:size-4",
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
size: "xs"
|
|
64
|
+
},
|
|
65
|
+
variants: {
|
|
66
|
+
size: {
|
|
67
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
68
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
69
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
70
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg]:size-3.5"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
function InputGroup({ className, ...props }) {
|
|
75
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
76
|
+
className: inputGroupVariants({
|
|
77
|
+
className
|
|
78
|
+
}),
|
|
79
|
+
"data-slot": "input-group",
|
|
80
|
+
role: "group",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function InputGroupAddon({ align = "inline-start", className, ...props }) {
|
|
85
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
86
|
+
className: (0, tailwind_variants_namespaceObject.cn)(inputGroupAddonVariants({
|
|
87
|
+
align
|
|
88
|
+
}), className),
|
|
89
|
+
"data-align": align,
|
|
90
|
+
"data-slot": "input-group-addon",
|
|
91
|
+
role: "group",
|
|
92
|
+
onPointerDown: (event)=>{
|
|
93
|
+
if (event.target.closest("button")) return;
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
const control = event.currentTarget.parentElement?.querySelector("input, textarea");
|
|
96
|
+
if (control instanceof HTMLElement) control.focus();
|
|
97
|
+
},
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function InputGroupButton({ className, size = "xs", type = "button", variant = "ghost", ...props }) {
|
|
102
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
103
|
+
className: (0, tailwind_variants_namespaceObject.cn)(inputGroupButtonVariants({
|
|
104
|
+
size
|
|
105
|
+
}), className),
|
|
106
|
+
"data-size": size,
|
|
107
|
+
"data-slot": "input-group-button",
|
|
108
|
+
type: type,
|
|
109
|
+
variant: variant,
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function InputGroupText({ className, ...props }) {
|
|
114
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
115
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
116
|
+
"data-slot": "input-group-text",
|
|
117
|
+
...props
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function InputGroupInput({ className, ...props }) {
|
|
121
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
|
|
122
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex-1 rounded-none border-0 bg-transparent px-3 py-1 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
123
|
+
"data-slot": "input-group-control",
|
|
124
|
+
...props
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
128
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_textarea_cjs_namespaceObject.Textarea, {
|
|
129
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
130
|
+
"data-slot": "input-group-control",
|
|
131
|
+
...props
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
exports.InputGroup = __webpack_exports__.InputGroup;
|
|
135
|
+
exports.InputGroupAddon = __webpack_exports__.InputGroupAddon;
|
|
136
|
+
exports.InputGroupButton = __webpack_exports__.InputGroupButton;
|
|
137
|
+
exports.InputGroupInput = __webpack_exports__.InputGroupInput;
|
|
138
|
+
exports.InputGroupText = __webpack_exports__.InputGroupText;
|
|
139
|
+
exports.InputGroupTextarea = __webpack_exports__.InputGroupTextarea;
|
|
140
|
+
exports.inputGroupAddonVariants = __webpack_exports__.inputGroupAddonVariants;
|
|
141
|
+
exports.inputGroupButtonVariants = __webpack_exports__.inputGroupButtonVariants;
|
|
142
|
+
exports.inputGroupVariants = __webpack_exports__.inputGroupVariants;
|
|
143
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
144
|
+
"InputGroup",
|
|
145
|
+
"InputGroupAddon",
|
|
146
|
+
"InputGroupButton",
|
|
147
|
+
"InputGroupInput",
|
|
148
|
+
"InputGroupText",
|
|
149
|
+
"InputGroupTextarea",
|
|
150
|
+
"inputGroupAddonVariants",
|
|
151
|
+
"inputGroupButtonVariants",
|
|
152
|
+
"inputGroupVariants"
|
|
153
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
154
|
+
Object.defineProperty(exports, '__esModule', {
|
|
155
|
+
value: true
|
|
156
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
1
2
|
import type { ComponentProps, JSX } from "react";
|
|
2
3
|
import type { ButtonProps } from "./button";
|
|
3
4
|
import type { InputProps } from "./input";
|
|
4
5
|
import type { TextareaProps } from "./textarea";
|
|
5
|
-
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
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: {
|
|
@@ -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 relative flex w-full items-center rounded-lg border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "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-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40")
|
|
9
|
+
});
|
|
10
|
+
const inputGroupAddonVariants = tv({
|
|
11
|
+
base: cn("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4"),
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
align: "inline-start"
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
align: {
|
|
17
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
|
|
18
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
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: "flex items-center gap-2 text-sm shadow-none [&>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 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg]:size-3.5"
|
|
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("flex items-center gap-2 text-sm text-muted-foreground [&_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 peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 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),
|
|
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: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none 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",
|
|
63
|
+
spellCheck: "false",
|
|
64
|
+
...props
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
67
|
+
className: (0, tailwind_variants_namespaceObject.cn)("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 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition 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"),
|
|
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,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 peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 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),
|
|
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: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none 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",
|
|
35
|
+
spellCheck: "false",
|
|
36
|
+
...props
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsxs("div", {
|
|
39
|
+
className: cn("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 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition 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"),
|
|
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)("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", 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: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000"
|
|
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
|
+
});
|