@caffeinebounce/ui 0.62.2
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/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/FinancialStatementTable-BNUrdTU4.d.cts +249 -0
- package/dist/FinancialStatementTable-BNUrdTU4.d.ts +249 -0
- package/dist/NewsletterSignup-BPreFi5W.d.cts +37 -0
- package/dist/NewsletterSignup-BPreFi5W.d.ts +37 -0
- package/dist/TestimonialsSection-DtPu2OeR.d.ts +736 -0
- package/dist/TestimonialsSection-z-yotRfv.d.cts +736 -0
- package/dist/UnifiedTableControls-CG299y9h.d.ts +1233 -0
- package/dist/UnifiedTableControls-CIjRpNhy.d.cts +1233 -0
- package/dist/blog.d.cts +99 -0
- package/dist/blog.d.ts +99 -0
- package/dist/blog.js +292 -0
- package/dist/blog.mjs +279 -0
- package/dist/button-BHnoRUkF.d.cts +34 -0
- package/dist/button-BHnoRUkF.d.ts +34 -0
- package/dist/charts.d.cts +80 -0
- package/dist/charts.d.ts +80 -0
- package/dist/charts.js +19 -0
- package/dist/charts.mjs +2 -0
- package/dist/chunk-33JR5SYE.js +44 -0
- package/dist/chunk-3NDB4YPC.js +247 -0
- package/dist/chunk-5RW4PYZ6.js +1504 -0
- package/dist/chunk-5THF4YP6.mjs +155 -0
- package/dist/chunk-6BUBNZPG.mjs +164 -0
- package/dist/chunk-6DVWMJ3H.mjs +7029 -0
- package/dist/chunk-6TGV2DNP.js +120 -0
- package/dist/chunk-72JGQ7IJ.mjs +1498 -0
- package/dist/chunk-7DHKQODW.mjs +2932 -0
- package/dist/chunk-7IKHZKAC.js +160 -0
- package/dist/chunk-ADIDI7AJ.js +11 -0
- package/dist/chunk-BFWX5GJZ.mjs +940 -0
- package/dist/chunk-BMFQG6RA.mjs +5537 -0
- package/dist/chunk-C4UT5V3P.js +65 -0
- package/dist/chunk-CC4KUIKC.js +2004 -0
- package/dist/chunk-D3QXPL47.mjs +1814 -0
- package/dist/chunk-DQWHYBV2.js +36 -0
- package/dist/chunk-E42B4GSB.js +993 -0
- package/dist/chunk-ESZ7CBA2.js +1007 -0
- package/dist/chunk-EYJJQVV4.js +111 -0
- package/dist/chunk-FRRS2YZH.mjs +129 -0
- package/dist/chunk-G5TQWWQA.mjs +37 -0
- package/dist/chunk-GAIQJCAZ.js +5612 -0
- package/dist/chunk-GMBGWOCR.mjs +48 -0
- package/dist/chunk-GUSTCU2W.mjs +105 -0
- package/dist/chunk-HBLKVQIQ.mjs +23 -0
- package/dist/chunk-HMAMMC72.js +26 -0
- package/dist/chunk-IMKLN273.mjs +9 -0
- package/dist/chunk-J6OLBSZR.js +250 -0
- package/dist/chunk-JAE45W2T.js +28 -0
- package/dist/chunk-JORVSG52.js +606 -0
- package/dist/chunk-KB7UXIQZ.mjs +984 -0
- package/dist/chunk-KGGQ5NZV.js +186 -0
- package/dist/chunk-KHCC5UKW.mjs +22 -0
- package/dist/chunk-KRRIRS6A.mjs +1945 -0
- package/dist/chunk-LQCVRWVF.js +48 -0
- package/dist/chunk-MHZXUOGN.mjs +168 -0
- package/dist/chunk-MPZFPU4X.js +349 -0
- package/dist/chunk-MVYRNJA6.js +74 -0
- package/dist/chunk-N6AFNFZR.mjs +565 -0
- package/dist/chunk-OFQLWSUR.mjs +214 -0
- package/dist/chunk-OLAAXLXY.mjs +219 -0
- package/dist/chunk-OZZWDIOY.js +1859 -0
- package/dist/chunk-PZRI43EZ.js +111 -0
- package/dist/chunk-Q256HRYD.js +176 -0
- package/dist/chunk-Q52ZEL62.mjs +223 -0
- package/dist/chunk-R26Y7LGJ.js +142 -0
- package/dist/chunk-RBUYW6QQ.js +39 -0
- package/dist/chunk-RVEFPVZF.mjs +43 -0
- package/dist/chunk-SORWLKOK.js +96 -0
- package/dist/chunk-STEP6C4C.mjs +33 -0
- package/dist/chunk-T5R6HUDG.mjs +22 -0
- package/dist/chunk-T6ZBA6VJ.js +7109 -0
- package/dist/chunk-UM7WMXIU.js +2995 -0
- package/dist/chunk-VBD4Q5LL.mjs +117 -0
- package/dist/chunk-WOITB4JL.js +195 -0
- package/dist/chunk-YKZEKJMZ.mjs +71 -0
- package/dist/chunk-YL7RZRHM.mjs +103 -0
- package/dist/chunk-YSLD2HLP.mjs +346 -0
- package/dist/chunk-ZFLZA7UP.mjs +140 -0
- package/dist/chunk-ZKUIUE7W.mjs +26 -0
- package/dist/chunk-ZOA7B32D.js +248 -0
- package/dist/data-table.d.cts +46 -0
- package/dist/data-table.d.ts +46 -0
- package/dist/data-table.js +270 -0
- package/dist/data-table.mjs +13 -0
- package/dist/editor.d.cts +89 -0
- package/dist/editor.d.ts +89 -0
- package/dist/editor.js +10 -0
- package/dist/editor.mjs +1 -0
- package/dist/forms.d.cts +142 -0
- package/dist/forms.d.ts +142 -0
- package/dist/forms.js +24 -0
- package/dist/forms.mjs +11 -0
- package/dist/hooks-8ORd7T1A.d.cts +751 -0
- package/dist/hooks-B2jU1GVT.d.ts +751 -0
- package/dist/hooks.d.cts +6 -0
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.js +99 -0
- package/dist/hooks.mjs +10 -0
- package/dist/index.d.cts +3141 -0
- package/dist/index.d.ts +3141 -0
- package/dist/index.js +7332 -0
- package/dist/index.mjs +5876 -0
- package/dist/layouts-DPfDDF53.d.cts +1001 -0
- package/dist/layouts-DPfDDF53.d.ts +1001 -0
- package/dist/layouts.d.cts +4 -0
- package/dist/layouts.d.ts +4 -0
- package/dist/layouts.js +100 -0
- package/dist/layouts.mjs +11 -0
- package/dist/marketing-3d.d.cts +51 -0
- package/dist/marketing-3d.d.ts +51 -0
- package/dist/marketing-3d.js +553 -0
- package/dist/marketing-3d.mjs +526 -0
- package/dist/marketing.d.cts +583 -0
- package/dist/marketing.d.ts +583 -0
- package/dist/marketing.js +299 -0
- package/dist/marketing.mjs +10 -0
- package/dist/media.d.cts +29 -0
- package/dist/media.d.ts +29 -0
- package/dist/media.js +189 -0
- package/dist/media.mjs +182 -0
- package/dist/navigation.d.cts +591 -0
- package/dist/navigation.d.ts +591 -0
- package/dist/navigation.js +108 -0
- package/dist/navigation.mjs +15 -0
- package/dist/portal.d.cts +58 -0
- package/dist/portal.d.ts +58 -0
- package/dist/portal.js +403 -0
- package/dist/portal.mjs +395 -0
- package/dist/primitives.d.cts +508 -0
- package/dist/primitives.d.ts +508 -0
- package/dist/primitives.js +295 -0
- package/dist/primitives.mjs +14 -0
- package/dist/settings.d.cts +216 -0
- package/dist/settings.d.ts +216 -0
- package/dist/settings.js +34 -0
- package/dist/settings.mjs +9 -0
- package/dist/shared-Dqn36QHZ.d.cts +4 -0
- package/dist/shared-Dqn36QHZ.d.ts +4 -0
- package/dist/styles.css +1213 -0
- package/package.json +189 -0
- package/styles.css +1 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk33JR5SYE_js = require('./chunk-33JR5SYE.js');
|
|
4
|
+
var chunkLQCVRWVF_js = require('./chunk-LQCVRWVF.js');
|
|
5
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var inputOtp = require('input-otp');
|
|
8
|
+
var lucideReact = require('lucide-react');
|
|
9
|
+
var React2 = require('react');
|
|
10
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
11
|
+
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
31
|
+
|
|
32
|
+
function Textarea({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
+
"textarea",
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "textarea",
|
|
37
|
+
className: chunkADIDI7AJ_js.cn(
|
|
38
|
+
"border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full min-w-0 max-w-full rounded-box border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm break-words [overflow-wrap:anywhere]",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function InputOTP({
|
|
46
|
+
className,
|
|
47
|
+
containerClassName,
|
|
48
|
+
...props
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
inputOtp.OTPInput,
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "input-otp",
|
|
54
|
+
containerClassName: chunkADIDI7AJ_js.cn(
|
|
55
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
56
|
+
containerClassName
|
|
57
|
+
),
|
|
58
|
+
className: chunkADIDI7AJ_js.cn("disabled:cursor-not-allowed", className),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function InputOTPGroup({ className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "input-otp-group",
|
|
68
|
+
className: chunkADIDI7AJ_js.cn("flex items-center", className),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function InputOTPSlot({
|
|
74
|
+
index,
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}) {
|
|
78
|
+
const inputOTPContext = React2__namespace.useContext(inputOtp.OTPInputContext);
|
|
79
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
80
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
"data-slot": "input-otp-slot",
|
|
84
|
+
"data-active": isActive,
|
|
85
|
+
className: chunkADIDI7AJ_js.cn(
|
|
86
|
+
"relative flex h-14 w-12 items-center justify-center border border-input bg-background text-xl font-semibold shadow-sm transition-all outline-none",
|
|
87
|
+
"first:rounded-l-lg last:rounded-r-lg -ml-px first:ml-0",
|
|
88
|
+
isActive && "z-10 ring-2 ring-ring ring-offset-2 ring-offset-background",
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
...props,
|
|
92
|
+
children: [
|
|
93
|
+
char,
|
|
94
|
+
hasFakeCaret && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function InputOTPSeparator({ ...props }) {
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "input-otp-separator", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, { className: "h-4 w-4 text-muted-foreground" }) });
|
|
101
|
+
}
|
|
102
|
+
function Checkbox({
|
|
103
|
+
className,
|
|
104
|
+
checked,
|
|
105
|
+
onCheckedChange,
|
|
106
|
+
disabled,
|
|
107
|
+
...props
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
"label",
|
|
111
|
+
{
|
|
112
|
+
className: chunkADIDI7AJ_js.cn(
|
|
113
|
+
"inline-flex items-center",
|
|
114
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
115
|
+
),
|
|
116
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative", children: [
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
+
"input",
|
|
119
|
+
{
|
|
120
|
+
type: "checkbox",
|
|
121
|
+
checked,
|
|
122
|
+
disabled,
|
|
123
|
+
onChange: (e) => onCheckedChange?.(e.target.checked),
|
|
124
|
+
className: "peer sr-only",
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
"span",
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "checkbox",
|
|
132
|
+
className: chunkADIDI7AJ_js.cn(
|
|
133
|
+
"border-input bg-background peer-focus-visible:ring-ring/50 peer-focus-visible:ring-[3px] flex size-4 shrink-0 items-center justify-center rounded-sm border shadow-xs transition-colors",
|
|
134
|
+
"peer-checked:bg-primary peer-checked:border-primary peer-checked:text-primary-foreground",
|
|
135
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
136
|
+
className
|
|
137
|
+
),
|
|
138
|
+
children: checked && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-3.5 stroke-3" })
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function FieldSet({ className, ...props }) {
|
|
146
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
+
"fieldset",
|
|
148
|
+
{
|
|
149
|
+
"data-slot": "field-set",
|
|
150
|
+
className: chunkADIDI7AJ_js.cn(
|
|
151
|
+
"flex flex-col gap-6",
|
|
152
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
153
|
+
className
|
|
154
|
+
),
|
|
155
|
+
...props
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function FieldLegend({
|
|
160
|
+
className,
|
|
161
|
+
variant = "legend",
|
|
162
|
+
...props
|
|
163
|
+
}) {
|
|
164
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
+
"legend",
|
|
166
|
+
{
|
|
167
|
+
"data-slot": "field-legend",
|
|
168
|
+
"data-variant": variant,
|
|
169
|
+
className: chunkADIDI7AJ_js.cn(
|
|
170
|
+
"mb-3 font-medium",
|
|
171
|
+
"data-[variant=legend]:text-base",
|
|
172
|
+
"data-[variant=label]:text-sm",
|
|
173
|
+
className
|
|
174
|
+
),
|
|
175
|
+
...props
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function FieldGroup({ className, ...props }) {
|
|
180
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
"data-slot": "field-group",
|
|
184
|
+
className: chunkADIDI7AJ_js.cn(
|
|
185
|
+
"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",
|
|
186
|
+
className
|
|
187
|
+
),
|
|
188
|
+
...props
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
var fieldVariants = classVarianceAuthority.cva(
|
|
193
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
194
|
+
{
|
|
195
|
+
variants: {
|
|
196
|
+
orientation: {
|
|
197
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
198
|
+
horizontal: [
|
|
199
|
+
"flex-row items-center",
|
|
200
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
201
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
202
|
+
],
|
|
203
|
+
responsive: [
|
|
204
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
205
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
206
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
defaultVariants: {
|
|
211
|
+
orientation: "vertical"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
function Field({
|
|
216
|
+
className,
|
|
217
|
+
orientation = "vertical",
|
|
218
|
+
...props
|
|
219
|
+
}) {
|
|
220
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
"fieldset",
|
|
222
|
+
{
|
|
223
|
+
"data-slot": "field",
|
|
224
|
+
"data-orientation": orientation,
|
|
225
|
+
className: chunkADIDI7AJ_js.cn(fieldVariants({ orientation }), className),
|
|
226
|
+
...props
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
function FieldContent({ className, ...props }) {
|
|
231
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
"data-slot": "field-content",
|
|
235
|
+
className: chunkADIDI7AJ_js.cn(
|
|
236
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
237
|
+
className
|
|
238
|
+
),
|
|
239
|
+
...props
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
function FieldLabel({
|
|
244
|
+
className,
|
|
245
|
+
...props
|
|
246
|
+
}) {
|
|
247
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
248
|
+
chunk33JR5SYE_js.Label,
|
|
249
|
+
{
|
|
250
|
+
"data-slot": "field-label",
|
|
251
|
+
className: chunkADIDI7AJ_js.cn(
|
|
252
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
253
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-box has-[>[data-slot=field]]:border *:data-[slot=field]:p-4",
|
|
254
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
255
|
+
className
|
|
256
|
+
),
|
|
257
|
+
...props
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
function FieldTitle({ className, ...props }) {
|
|
262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
"data-slot": "field-label",
|
|
266
|
+
className: chunkADIDI7AJ_js.cn(
|
|
267
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
268
|
+
className
|
|
269
|
+
),
|
|
270
|
+
...props
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
function FieldDescription({ className, ...props }) {
|
|
275
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
276
|
+
"p",
|
|
277
|
+
{
|
|
278
|
+
"data-slot": "field-description",
|
|
279
|
+
className: chunkADIDI7AJ_js.cn(
|
|
280
|
+
"text-muted-foreground text-sm leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance",
|
|
281
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
282
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
283
|
+
className
|
|
284
|
+
),
|
|
285
|
+
...props
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
function FieldSeparator({
|
|
290
|
+
children,
|
|
291
|
+
className,
|
|
292
|
+
...props
|
|
293
|
+
}) {
|
|
294
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
"data-slot": "field-separator",
|
|
298
|
+
"data-content": !!children,
|
|
299
|
+
className: chunkADIDI7AJ_js.cn(
|
|
300
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
301
|
+
className
|
|
302
|
+
),
|
|
303
|
+
...props,
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkLQCVRWVF_js.Separator, { className: "absolute inset-0 top-1/2" }),
|
|
306
|
+
children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
"span",
|
|
308
|
+
{
|
|
309
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
310
|
+
"data-slot": "field-separator-content",
|
|
311
|
+
children
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
function FieldError({
|
|
319
|
+
className,
|
|
320
|
+
children,
|
|
321
|
+
errors,
|
|
322
|
+
...props
|
|
323
|
+
}) {
|
|
324
|
+
const content = React2.useMemo(() => {
|
|
325
|
+
if (children) {
|
|
326
|
+
return children;
|
|
327
|
+
}
|
|
328
|
+
if (!errors?.length) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
const uniqueErrors = [
|
|
332
|
+
...new Map(errors.map((error) => [error?.message, error])).values()
|
|
333
|
+
];
|
|
334
|
+
if (uniqueErrors?.length === 1) {
|
|
335
|
+
return uniqueErrors[0]?.message;
|
|
336
|
+
}
|
|
337
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
338
|
+
(error) => error?.message && /* @__PURE__ */ jsxRuntime.jsx("li", { children: error.message }, error.message)
|
|
339
|
+
) });
|
|
340
|
+
}, [children, errors]);
|
|
341
|
+
if (!content) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
role: "alert",
|
|
348
|
+
"data-slot": "field-error",
|
|
349
|
+
className: chunkADIDI7AJ_js.cn("text-destructive text-xs font-normal -mt-2.5", className),
|
|
350
|
+
...props,
|
|
351
|
+
children: content
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
var PasswordInput = React2__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
356
|
+
const [showPassword, setShowPassword] = React2__namespace.useState(false);
|
|
357
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
359
|
+
"input",
|
|
360
|
+
{
|
|
361
|
+
ref,
|
|
362
|
+
type: showPassword ? "text" : "password",
|
|
363
|
+
"data-slot": "input",
|
|
364
|
+
"data-autofill-aware": "true",
|
|
365
|
+
className: chunkADIDI7AJ_js.cn(
|
|
366
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-box border bg-transparent px-3 py-1 pr-10 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
367
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
368
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
369
|
+
className
|
|
370
|
+
),
|
|
371
|
+
...props
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
375
|
+
"button",
|
|
376
|
+
{
|
|
377
|
+
type: "button",
|
|
378
|
+
onClick: () => setShowPassword(!showPassword),
|
|
379
|
+
className: "text-muted-foreground hover:text-foreground absolute right-0 top-0 flex h-9 w-10 items-center justify-center rounded-r-box transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
380
|
+
tabIndex: -1,
|
|
381
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
382
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOffIcon, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
] });
|
|
386
|
+
});
|
|
387
|
+
PasswordInput.displayName = "PasswordInput";
|
|
388
|
+
var defaultPasswordRules = [
|
|
389
|
+
{
|
|
390
|
+
id: "min-length",
|
|
391
|
+
label: "Must be at least 8 characters long",
|
|
392
|
+
validator: (password) => password.length >= 8
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: "uppercase",
|
|
396
|
+
label: "Must contain an uppercase letter",
|
|
397
|
+
validator: (password) => /[A-Z]/.test(password)
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: "special",
|
|
401
|
+
label: "Must contain a special character",
|
|
402
|
+
validator: (password) => /[!@#$%^&*(),.?":{}|<>]/.test(password)
|
|
403
|
+
}
|
|
404
|
+
];
|
|
405
|
+
var extendedPasswordRules = [...defaultPasswordRules];
|
|
406
|
+
function PasswordRequirements({
|
|
407
|
+
password,
|
|
408
|
+
rules = defaultPasswordRules,
|
|
409
|
+
className,
|
|
410
|
+
...props
|
|
411
|
+
}) {
|
|
412
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: chunkADIDI7AJ_js.cn("flex flex-col gap-1.5 text-xs", className), ...props, children: rules.map((rule) => {
|
|
413
|
+
const isMet = password.length > 0 && rule.validator(password);
|
|
414
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
415
|
+
"li",
|
|
416
|
+
{
|
|
417
|
+
className: chunkADIDI7AJ_js.cn(
|
|
418
|
+
"flex items-center gap-1.5 transition-colors duration-200",
|
|
419
|
+
isMet ? "text-green-600" : "text-muted-foreground"
|
|
420
|
+
),
|
|
421
|
+
children: [
|
|
422
|
+
isMet ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2Icon, { className: "h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: rule.label })
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
rule.id
|
|
427
|
+
);
|
|
428
|
+
}) });
|
|
429
|
+
}
|
|
430
|
+
function VerificationCodeInput({
|
|
431
|
+
length = 6,
|
|
432
|
+
value = "",
|
|
433
|
+
onChange,
|
|
434
|
+
onComplete,
|
|
435
|
+
disabled = false,
|
|
436
|
+
autoFocus = true,
|
|
437
|
+
className
|
|
438
|
+
}) {
|
|
439
|
+
const [code, setCode] = React2.useState(
|
|
440
|
+
value.split("").concat(Array(length - value.length).fill(""))
|
|
441
|
+
);
|
|
442
|
+
const inputRefs = React2.useRef([]);
|
|
443
|
+
const hiddenInputRef = React2.useRef(null);
|
|
444
|
+
React2.useEffect(() => {
|
|
445
|
+
if (autoFocus && hiddenInputRef.current) {
|
|
446
|
+
hiddenInputRef.current.focus();
|
|
447
|
+
}
|
|
448
|
+
}, [autoFocus]);
|
|
449
|
+
React2.useEffect(() => {
|
|
450
|
+
const newCode = value.split("").concat(Array(length - value.length).fill(""));
|
|
451
|
+
setCode(newCode.slice(0, length));
|
|
452
|
+
}, [value, length]);
|
|
453
|
+
const handleHiddenInput = (e) => {
|
|
454
|
+
const inputValue = e.target.value.replace(/\D/g, "").slice(0, length);
|
|
455
|
+
const newCode = inputValue.split("").concat(Array(length - inputValue.length).fill(""));
|
|
456
|
+
setCode(newCode);
|
|
457
|
+
onChange?.(inputValue);
|
|
458
|
+
setTimeout(() => {
|
|
459
|
+
if (inputValue.length === length) {
|
|
460
|
+
onComplete?.(inputValue);
|
|
461
|
+
inputRefs.current[length - 1]?.focus();
|
|
462
|
+
} else if (inputValue.length > 0) {
|
|
463
|
+
inputRefs.current[Math.min(inputValue.length, length - 1)]?.focus();
|
|
464
|
+
}
|
|
465
|
+
}, 0);
|
|
466
|
+
};
|
|
467
|
+
const handleChange = (index, e) => {
|
|
468
|
+
const inputValue = e.target.value;
|
|
469
|
+
if (inputValue.length > 1) {
|
|
470
|
+
const pastedCode = inputValue.replace(/\D/g, "").slice(0, length);
|
|
471
|
+
const newCode2 = pastedCode.split("").concat(Array(length - pastedCode.length).fill(""));
|
|
472
|
+
setCode(newCode2);
|
|
473
|
+
onChange?.(pastedCode);
|
|
474
|
+
if (pastedCode.length === length) {
|
|
475
|
+
onComplete?.(pastedCode);
|
|
476
|
+
inputRefs.current[length - 1]?.blur();
|
|
477
|
+
} else {
|
|
478
|
+
inputRefs.current[Math.min(pastedCode.length, length - 1)]?.focus();
|
|
479
|
+
}
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const digit = inputValue.replace(/\D/g, "");
|
|
483
|
+
const newCode = [...code];
|
|
484
|
+
newCode[index] = digit;
|
|
485
|
+
setCode(newCode);
|
|
486
|
+
const codeString = newCode.join("");
|
|
487
|
+
onChange?.(codeString);
|
|
488
|
+
if (digit && index < length - 1) {
|
|
489
|
+
inputRefs.current[index + 1]?.focus();
|
|
490
|
+
}
|
|
491
|
+
const isComplete = newCode.every((d) => d !== "");
|
|
492
|
+
if (isComplete && codeString.length === length) {
|
|
493
|
+
onComplete?.(codeString);
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
const handleKeyDown = (index, e) => {
|
|
497
|
+
if (e.key === "Backspace") {
|
|
498
|
+
if (!code[index] && index > 0) {
|
|
499
|
+
inputRefs.current[index - 1]?.focus();
|
|
500
|
+
const newCode = [...code];
|
|
501
|
+
newCode[index - 1] = "";
|
|
502
|
+
setCode(newCode);
|
|
503
|
+
onChange?.(newCode.join(""));
|
|
504
|
+
} else {
|
|
505
|
+
const newCode = [...code];
|
|
506
|
+
newCode[index] = "";
|
|
507
|
+
setCode(newCode);
|
|
508
|
+
onChange?.(newCode.join(""));
|
|
509
|
+
}
|
|
510
|
+
} else if (e.key === "ArrowLeft" && index > 0) {
|
|
511
|
+
inputRefs.current[index - 1]?.focus();
|
|
512
|
+
} else if (e.key === "ArrowRight" && index < length - 1) {
|
|
513
|
+
inputRefs.current[index + 1]?.focus();
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
const handlePaste = (e) => {
|
|
517
|
+
e.preventDefault();
|
|
518
|
+
const pastedData = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, length);
|
|
519
|
+
if (pastedData.length === 0) return;
|
|
520
|
+
const newCode = pastedData.split("").concat(Array(length - pastedData.length).fill(""));
|
|
521
|
+
setCode(newCode.slice(0, length));
|
|
522
|
+
onChange?.(pastedData);
|
|
523
|
+
setTimeout(() => {
|
|
524
|
+
if (pastedData.length === length) {
|
|
525
|
+
onComplete?.(pastedData);
|
|
526
|
+
inputRefs.current[length - 1]?.focus();
|
|
527
|
+
} else {
|
|
528
|
+
inputRefs.current[Math.min(pastedData.length, length - 1)]?.focus();
|
|
529
|
+
}
|
|
530
|
+
}, 0);
|
|
531
|
+
};
|
|
532
|
+
const handleHiddenFocus = () => {
|
|
533
|
+
const firstEmptyIndex = code.indexOf("");
|
|
534
|
+
const targetIndex = firstEmptyIndex === -1 ? 0 : firstEmptyIndex;
|
|
535
|
+
inputRefs.current[targetIndex]?.focus();
|
|
536
|
+
};
|
|
537
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkADIDI7AJ_js.cn("relative", className), onPaste: handlePaste, children: [
|
|
538
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
539
|
+
"input",
|
|
540
|
+
{
|
|
541
|
+
ref: hiddenInputRef,
|
|
542
|
+
type: "text",
|
|
543
|
+
inputMode: "numeric",
|
|
544
|
+
pattern: "[0-9]*",
|
|
545
|
+
autoComplete: "one-time-code",
|
|
546
|
+
name: "otp",
|
|
547
|
+
id: "otp-input",
|
|
548
|
+
value: code.join(""),
|
|
549
|
+
onChange: handleHiddenInput,
|
|
550
|
+
onFocus: handleHiddenFocus,
|
|
551
|
+
disabled,
|
|
552
|
+
className: "absolute inset-0 w-full h-full opacity-0 cursor-text z-10",
|
|
553
|
+
style: { caretColor: "transparent" },
|
|
554
|
+
"aria-label": "One-time code"
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-2 justify-center", children: Array.from({ length }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
558
|
+
"input",
|
|
559
|
+
{
|
|
560
|
+
ref: (el) => {
|
|
561
|
+
inputRefs.current[index] = el;
|
|
562
|
+
},
|
|
563
|
+
type: "text",
|
|
564
|
+
inputMode: "numeric",
|
|
565
|
+
pattern: "[0-9]*",
|
|
566
|
+
autoComplete: "one-time-code",
|
|
567
|
+
maxLength: length,
|
|
568
|
+
value: code[index] || "",
|
|
569
|
+
onChange: (e) => handleChange(index, e),
|
|
570
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
571
|
+
onPaste: handlePaste,
|
|
572
|
+
disabled,
|
|
573
|
+
className: chunkADIDI7AJ_js.cn(
|
|
574
|
+
"w-12 h-14 text-center text-xl font-semibold rounded-lg border border-input bg-background",
|
|
575
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
576
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
577
|
+
"transition-colors"
|
|
578
|
+
),
|
|
579
|
+
"aria-label": `Digit ${index + 1}`
|
|
580
|
+
},
|
|
581
|
+
index
|
|
582
|
+
)) })
|
|
583
|
+
] });
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
exports.Checkbox = Checkbox;
|
|
587
|
+
exports.Field = Field;
|
|
588
|
+
exports.FieldContent = FieldContent;
|
|
589
|
+
exports.FieldDescription = FieldDescription;
|
|
590
|
+
exports.FieldError = FieldError;
|
|
591
|
+
exports.FieldGroup = FieldGroup;
|
|
592
|
+
exports.FieldLabel = FieldLabel;
|
|
593
|
+
exports.FieldLegend = FieldLegend;
|
|
594
|
+
exports.FieldSeparator = FieldSeparator;
|
|
595
|
+
exports.FieldSet = FieldSet;
|
|
596
|
+
exports.FieldTitle = FieldTitle;
|
|
597
|
+
exports.InputOTP = InputOTP;
|
|
598
|
+
exports.InputOTPGroup = InputOTPGroup;
|
|
599
|
+
exports.InputOTPSeparator = InputOTPSeparator;
|
|
600
|
+
exports.InputOTPSlot = InputOTPSlot;
|
|
601
|
+
exports.PasswordInput = PasswordInput;
|
|
602
|
+
exports.PasswordRequirements = PasswordRequirements;
|
|
603
|
+
exports.Textarea = Textarea;
|
|
604
|
+
exports.VerificationCodeInput = VerificationCodeInput;
|
|
605
|
+
exports.defaultPasswordRules = defaultPasswordRules;
|
|
606
|
+
exports.extendedPasswordRules = extendedPasswordRules;
|