cuenti-dna 0.1.0-beta.1
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/README.md +133 -0
- package/dist/index.cjs +1346 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +491 -0
- package/dist/index.d.ts +491 -0
- package/dist/index.js +1295 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2035 -0
- package/package.json +76 -0
- package/scripts/postinstall.cjs +569 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Button: () => Button,
|
|
24
|
+
Card: () => Card,
|
|
25
|
+
CardAction: () => CardAction,
|
|
26
|
+
CardContent: () => CardContent,
|
|
27
|
+
CardDescription: () => CardDescription,
|
|
28
|
+
CardFooter: () => CardFooter,
|
|
29
|
+
CardHeader: () => CardHeader,
|
|
30
|
+
CardTitle: () => CardTitle,
|
|
31
|
+
Check: () => Check,
|
|
32
|
+
Checkbox: () => Checkbox,
|
|
33
|
+
CloseX: () => CloseX,
|
|
34
|
+
Input: () => Input,
|
|
35
|
+
Minus: () => Minus,
|
|
36
|
+
MoneyInput: () => MoneyInput,
|
|
37
|
+
NumberInput: () => NumberInput,
|
|
38
|
+
PasswordInput: () => PasswordInput,
|
|
39
|
+
Radio: () => RadioItem,
|
|
40
|
+
RadioGroup: () => RadioGroup,
|
|
41
|
+
RadioItem: () => RadioItem,
|
|
42
|
+
Switch: () => Switch,
|
|
43
|
+
cn: () => cn,
|
|
44
|
+
inputTypes: () => inputTypes,
|
|
45
|
+
useFormattedNumericInput: () => useFormattedNumericInput,
|
|
46
|
+
useRadio: () => useRadio,
|
|
47
|
+
useRadioGroup: () => useRadioGroup
|
|
48
|
+
});
|
|
49
|
+
module.exports = __toCommonJS(index_exports);
|
|
50
|
+
|
|
51
|
+
// src/components/inputs/button.tsx
|
|
52
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
53
|
+
|
|
54
|
+
// src/utils/cn.ts
|
|
55
|
+
var import_clsx = require("clsx");
|
|
56
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
57
|
+
function cn(...inputs) {
|
|
58
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/components/inputs/button.tsx
|
|
62
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
63
|
+
var baseStyles = "inline-flex items-center justify-center gap-2 whitespace-nowrap text-base transition-all duration-300 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] cursor-pointer disabled:bg-neutral-600 disabled:text-neutral-700 font-bold disabled:cursor-not-allowed";
|
|
64
|
+
var variants = {
|
|
65
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-400 aria-pressed:bg-primary-400",
|
|
66
|
+
alt: "bg-primary-400 text-primary-foreground hover:bg-primary-500 active:bg-primary-300 aria-pressed:bg-primary-300",
|
|
67
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 active:bg-secondary-400 aria-pressed:bg-secondary-400",
|
|
68
|
+
ghost: "bg-transparent hover:bg-neutral-400 active:bg-neutral-500 aria-pressed:bg-neutral-500 text-muted-foreground hover:text-neutral-800",
|
|
69
|
+
"primary-ghost": "bg-transparent hover:bg-primary-50 active:bg-primary-100 aria-pressed:bg-primary-100 text-primary hover:text-primary-600",
|
|
70
|
+
link: "bg-transparent underline-offset-4 hover:underline text-neutral-700 hover:text-info active:text-info-400 aria-pressed:text-info-400",
|
|
71
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive-600 active:bg-destructive-400 aria-pressed:bg-destructive-400",
|
|
72
|
+
success: "bg-success text-success-foreground hover:bg-success-600 active:bg-success-400 aria-pressed:bg-success-400",
|
|
73
|
+
accent: "bg-accent text-accent-foreground hover:bg-accent-600 active:bg-accent-400 aria-pressed:bg-accent-400 font-bold",
|
|
74
|
+
outline: "border-2 border-neutral-500 bg-transparent text-neutral-700 hover:border-neutral-600 hover:bg-neutral-300 active:bg-neutral-300 active:border-neutral-600 aria-pressed:bg-neutral-300 aria-pressed:border-neutral-600 disabled:bg-transparent disabled:border-neutral-400 disabled:text-neutral-600",
|
|
75
|
+
"secondary-outline": "border-2 border-neutral-500 bg-transparent text-neutral-700 hover:border-secondary-300 hover:bg-secondary-25 hover:text-secondary-300 active:bg-secondary-50 active:border-secondary-200 active:text-secondary-300 aria-pressed:bg-secondary-50 aria-pressed:border-secondary-200 aria-pressed:text-secondary-300 disabled:bg-transparent disabled:border-neutral-400 disabled:text-neutral-600"
|
|
76
|
+
};
|
|
77
|
+
var sizes = {
|
|
78
|
+
md: "h-12 px-5 has-[>svg]:px-3 rounded-md",
|
|
79
|
+
sm: "h-10 gap-1.5 px-5 has-[>svg]:px-3 rounded-sm",
|
|
80
|
+
lg: "h-13 px-5 has-[>svg]:px-5 rounded-lg",
|
|
81
|
+
icon: "size-12 aspect-square rounded-md",
|
|
82
|
+
"icon-sm": "size-10 aspect-square rounded-sm",
|
|
83
|
+
"icon-lg": "size-13 aspect-square rounded-lg"
|
|
84
|
+
};
|
|
85
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(baseStyles, {
|
|
86
|
+
variants: {
|
|
87
|
+
variant: variants,
|
|
88
|
+
size: sizes
|
|
89
|
+
},
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
variant: "primary",
|
|
92
|
+
size: "md"
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
function Button({
|
|
96
|
+
variant,
|
|
97
|
+
size,
|
|
98
|
+
className,
|
|
99
|
+
children,
|
|
100
|
+
type = "button",
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
const classes = cn(buttonVariants({ variant, size }), className);
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: classes, type, ...props, children });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/components/inputs/checkbox.tsx
|
|
108
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
109
|
+
var import_react = require("react");
|
|
110
|
+
|
|
111
|
+
// src/components/icons/interface/check.tsx
|
|
112
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
113
|
+
function Check({ className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
115
|
+
"svg",
|
|
116
|
+
{
|
|
117
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
118
|
+
fill: "none",
|
|
119
|
+
viewBox: "0 0 20 20",
|
|
120
|
+
className,
|
|
121
|
+
...props,
|
|
122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
123
|
+
"path",
|
|
124
|
+
{
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeLinecap: "round",
|
|
127
|
+
strokeLinejoin: "round",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
d: "m5 10 3.54 3.54 7.07-7.08"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/components/icons/interface/minus.tsx
|
|
137
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
138
|
+
function Minus({ ...props }) {
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
140
|
+
"svg",
|
|
141
|
+
{
|
|
142
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
143
|
+
fill: "none",
|
|
144
|
+
viewBox: "0 0 24 24",
|
|
145
|
+
...props,
|
|
146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
147
|
+
"path",
|
|
148
|
+
{
|
|
149
|
+
stroke: "currentColor",
|
|
150
|
+
strokeLinecap: "round",
|
|
151
|
+
strokeLinejoin: "round",
|
|
152
|
+
strokeWidth: "2",
|
|
153
|
+
d: "M6 12h12"
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// src/components/inputs/checkbox.tsx
|
|
161
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
162
|
+
var baseStyles2 = "size-6 shrink-0 appearance-none border-2 border-neutral-600 bg-transparent transition-all duration-200 outline-none disabled:border-neutral-400 disabled:bg-transparent focus-visible:ring-2 focus-visible:bg-neutral-400 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed group-data-[readonly=true]/checkbox:cursor-default";
|
|
163
|
+
var variants2 = {
|
|
164
|
+
default: "hover:border-info-500 hover:bg-info-50 focus-visible:border-info-500 focus-visible:ring-info-500/20 focus-visible:checked:border-info-500 focus-visible:checked:bg-info-500 checked:border-info-500 checked:bg-info-500 checked:hover:border-info-600 checked:hover:bg-info-600 indeterminate:border-info-500 indeterminate:bg-info-500 indeterminate:hover:border-info-600 indeterminate:hover:bg-info-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent",
|
|
165
|
+
success: "hover:border-success-500 hover:bg-success-50 focus-visible:border-success-500 focus-visible:ring-success-500/20 focus-visible:checked:border-success-500 focus-visible:checked:bg-success-500 checked:border-success-500 checked:bg-success-500 checked:hover:border-success-600 checked:hover:bg-success-600 indeterminate:border-success-500 indeterminate:bg-success-500 indeterminate:hover:border-success-600 indeterminate:hover:bg-success-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent"
|
|
166
|
+
};
|
|
167
|
+
var sizes2 = {
|
|
168
|
+
square: "rounded-[8px]",
|
|
169
|
+
rounded: "rounded-full"
|
|
170
|
+
};
|
|
171
|
+
var checkboxVariants = (0, import_class_variance_authority2.cva)(baseStyles2, {
|
|
172
|
+
variants: {
|
|
173
|
+
variant: variants2,
|
|
174
|
+
size: sizes2
|
|
175
|
+
},
|
|
176
|
+
defaultVariants: {
|
|
177
|
+
variant: "default",
|
|
178
|
+
size: "square"
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
function Checkbox({
|
|
182
|
+
variant,
|
|
183
|
+
size,
|
|
184
|
+
indeterminate = false,
|
|
185
|
+
children,
|
|
186
|
+
className,
|
|
187
|
+
classNames,
|
|
188
|
+
readOnly,
|
|
189
|
+
onClick,
|
|
190
|
+
onChange,
|
|
191
|
+
disabled,
|
|
192
|
+
...props
|
|
193
|
+
}) {
|
|
194
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
195
|
+
const generatedId = (0, import_react.useId)();
|
|
196
|
+
const id = props.id || generatedId;
|
|
197
|
+
const isReadOnly = Boolean(readOnly);
|
|
198
|
+
(0, import_react.useEffect)(() => {
|
|
199
|
+
if (inputRef.current) {
|
|
200
|
+
inputRef.current.indeterminate = indeterminate;
|
|
201
|
+
}
|
|
202
|
+
}, [indeterminate]);
|
|
203
|
+
const classes = cn(
|
|
204
|
+
checkboxVariants({ variant, size }),
|
|
205
|
+
className,
|
|
206
|
+
classNames?.input
|
|
207
|
+
);
|
|
208
|
+
const handleClick = (event) => {
|
|
209
|
+
if (isReadOnly || disabled) {
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
onClick?.(event);
|
|
214
|
+
};
|
|
215
|
+
const handleChange = (event) => {
|
|
216
|
+
if (isReadOnly || disabled) {
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
onChange?.(event);
|
|
221
|
+
};
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
"data-slot": "checkbox",
|
|
226
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
227
|
+
"data-readonly": isReadOnly ? "true" : void 0,
|
|
228
|
+
className: cn(
|
|
229
|
+
"group/checkbox inline-flex cursor-pointer items-center gap-3 data-[disabled=true]:cursor-not-allowed data-[readonly=true]:cursor-default",
|
|
230
|
+
classNames?.root
|
|
231
|
+
),
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "group/control relative flex size-6 shrink-0 items-center justify-center text-white", children: [
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
235
|
+
"input",
|
|
236
|
+
{
|
|
237
|
+
ref: inputRef,
|
|
238
|
+
id,
|
|
239
|
+
type: "checkbox",
|
|
240
|
+
"aria-checked": indeterminate ? "mixed" : void 0,
|
|
241
|
+
"aria-readonly": isReadOnly || void 0,
|
|
242
|
+
className: classes,
|
|
243
|
+
readOnly: isReadOnly,
|
|
244
|
+
disabled,
|
|
245
|
+
onClick: handleClick,
|
|
246
|
+
onChange: handleChange,
|
|
247
|
+
...props
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
251
|
+
Check,
|
|
252
|
+
{
|
|
253
|
+
"aria-hidden": "true",
|
|
254
|
+
className: "pointer-events-none absolute z-10 size-5 opacity-0 transition-opacity group-has-checked/control:opacity-100 group-has-indeterminate/control:opacity-0"
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
258
|
+
Minus,
|
|
259
|
+
{
|
|
260
|
+
"aria-hidden": "true",
|
|
261
|
+
className: "pointer-events-none absolute z-10 size-5 opacity-0 transition-opacity group-has-indeterminate/control:opacity-100"
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] }),
|
|
265
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
266
|
+
"label",
|
|
267
|
+
{
|
|
268
|
+
"data-slot": "checkbox-label",
|
|
269
|
+
htmlFor: id,
|
|
270
|
+
className: cn(
|
|
271
|
+
"cursor-pointer transition-colors group-data-[disabled=true]/checkbox:cursor-not-allowed group-data-[readonly=true]/checkbox:cursor-default group-data-[disabled=true]/checkbox:text-neutral-600",
|
|
272
|
+
classNames?.label
|
|
273
|
+
),
|
|
274
|
+
children
|
|
275
|
+
}
|
|
276
|
+
) : null
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/components/inputs/input/input.tsx
|
|
283
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
284
|
+
|
|
285
|
+
// src/components/inputs/input/money-input.tsx
|
|
286
|
+
var import_react3 = require("react");
|
|
287
|
+
|
|
288
|
+
// src/hooks/use-formatted-numeric-input.ts
|
|
289
|
+
var import_react2 = require("react");
|
|
290
|
+
function useFormattedNumericInput({
|
|
291
|
+
value,
|
|
292
|
+
defaultValue,
|
|
293
|
+
onChange,
|
|
294
|
+
onBlur,
|
|
295
|
+
onFocus,
|
|
296
|
+
normalizeRawValue,
|
|
297
|
+
rawToEditableValue,
|
|
298
|
+
rawToDisplayValue,
|
|
299
|
+
editableToRawValue,
|
|
300
|
+
sanitizeEditableValue
|
|
301
|
+
}) {
|
|
302
|
+
const initialRawValue = normalizeRawValue(value ?? defaultValue);
|
|
303
|
+
const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
|
|
304
|
+
const [rawValue, setRawValue] = (0, import_react2.useState)(initialRawValue);
|
|
305
|
+
const [displayValue, setDisplayValue] = (0, import_react2.useState)(
|
|
306
|
+
() => rawToDisplayValue(initialRawValue)
|
|
307
|
+
);
|
|
308
|
+
(0, import_react2.useEffect)(() => {
|
|
309
|
+
if (value === void 0) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const nextRawValue = normalizeRawValue(value);
|
|
313
|
+
setRawValue(nextRawValue);
|
|
314
|
+
setDisplayValue(
|
|
315
|
+
isFocused ? rawToEditableValue(nextRawValue) : rawToDisplayValue(nextRawValue)
|
|
316
|
+
);
|
|
317
|
+
}, [
|
|
318
|
+
value,
|
|
319
|
+
isFocused,
|
|
320
|
+
normalizeRawValue,
|
|
321
|
+
rawToEditableValue,
|
|
322
|
+
rawToDisplayValue
|
|
323
|
+
]);
|
|
324
|
+
(0, import_react2.useEffect)(() => {
|
|
325
|
+
if (value !== void 0) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
setDisplayValue(
|
|
329
|
+
isFocused ? rawToEditableValue(rawValue) : rawToDisplayValue(rawValue)
|
|
330
|
+
);
|
|
331
|
+
}, [value, isFocused, rawValue, rawToEditableValue, rawToDisplayValue]);
|
|
332
|
+
const normalizeEditableValue = (editableValue) => sanitizeEditableValue ? sanitizeEditableValue(editableValue) : editableValue;
|
|
333
|
+
const emitRawValue = (event, nextRawValue) => {
|
|
334
|
+
event.currentTarget.value = nextRawValue;
|
|
335
|
+
};
|
|
336
|
+
const handleFocus = (event) => {
|
|
337
|
+
setIsFocused(true);
|
|
338
|
+
setDisplayValue(rawToEditableValue(rawValue));
|
|
339
|
+
onFocus?.(event);
|
|
340
|
+
};
|
|
341
|
+
const handleChange = (event) => {
|
|
342
|
+
const editableValue = normalizeEditableValue(event.currentTarget.value);
|
|
343
|
+
const nextRawValue = editableToRawValue(editableValue);
|
|
344
|
+
setRawValue(nextRawValue);
|
|
345
|
+
setDisplayValue(editableValue);
|
|
346
|
+
emitRawValue(event, nextRawValue);
|
|
347
|
+
onChange?.(event);
|
|
348
|
+
};
|
|
349
|
+
const handleBlur = (event) => {
|
|
350
|
+
const editableValue = normalizeEditableValue(displayValue);
|
|
351
|
+
const nextRawValue = editableToRawValue(editableValue);
|
|
352
|
+
setRawValue(nextRawValue);
|
|
353
|
+
setIsFocused(false);
|
|
354
|
+
setDisplayValue(rawToDisplayValue(nextRawValue));
|
|
355
|
+
emitRawValue(event, nextRawValue);
|
|
356
|
+
onBlur?.(event);
|
|
357
|
+
};
|
|
358
|
+
return {
|
|
359
|
+
rawValue,
|
|
360
|
+
displayValue,
|
|
361
|
+
isFocused,
|
|
362
|
+
handleFocus,
|
|
363
|
+
handleChange,
|
|
364
|
+
handleBlur
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// src/utils/input/keyboard.ts
|
|
369
|
+
var NAVIGATION_KEYS = /* @__PURE__ */ new Set([
|
|
370
|
+
"Backspace",
|
|
371
|
+
"Delete",
|
|
372
|
+
"ArrowLeft",
|
|
373
|
+
"ArrowRight",
|
|
374
|
+
"Home",
|
|
375
|
+
"End",
|
|
376
|
+
"Tab"
|
|
377
|
+
]);
|
|
378
|
+
var isControlShortcut = (event) => event.ctrlKey || event.metaKey;
|
|
379
|
+
var isNavigationKey = (key) => NAVIGATION_KEYS.has(key);
|
|
380
|
+
var buildNextValue = (currentValue, selectionStart, selectionEnd, nextText) => `${currentValue.slice(0, selectionStart)}${nextText}${currentValue.slice(selectionEnd)}`;
|
|
381
|
+
|
|
382
|
+
// src/utils/input/money.ts
|
|
383
|
+
var DEFAULT_MONEY_SYMBOL = "$";
|
|
384
|
+
var MONEY_MAX_DECIMALS = 4;
|
|
385
|
+
var MONEY_INPUT_PATTERN = "^([0-9]+)(,[0-9]{0,4})?$";
|
|
386
|
+
var MONEY_ALLOWED_CHAR_REGEX = /[0-9,]/;
|
|
387
|
+
var MONEY_PASTE_REGEX = /^[0-9,]+$/;
|
|
388
|
+
var isAllowedMoneyCharacter = (key) => MONEY_ALLOWED_CHAR_REGEX.test(key);
|
|
389
|
+
var isValidMoneyPaste = (value) => MONEY_PASTE_REGEX.test(value);
|
|
390
|
+
var sanitizeMoneyEditableValue = (value) => {
|
|
391
|
+
const cleaned = value.replace(/[^\d,]/g, "");
|
|
392
|
+
const [integerPart = "", ...decimalParts] = cleaned.split(",");
|
|
393
|
+
const mergedDecimals = decimalParts.join("").slice(0, MONEY_MAX_DECIMALS);
|
|
394
|
+
const normalizedInteger = integerPart.replace(/^0+(?=\d)/, "");
|
|
395
|
+
if (decimalParts.length > 0) {
|
|
396
|
+
return `${normalizedInteger},${mergedDecimals}`;
|
|
397
|
+
}
|
|
398
|
+
return normalizedInteger;
|
|
399
|
+
};
|
|
400
|
+
var editableMoneyToRawValue = (editableValue) => {
|
|
401
|
+
if (!editableValue) {
|
|
402
|
+
return "";
|
|
403
|
+
}
|
|
404
|
+
const [integerPart = "", decimalPart] = editableValue.split(",");
|
|
405
|
+
const normalizedInteger = integerPart || "0";
|
|
406
|
+
if (decimalPart === void 0 || decimalPart.length === 0) {
|
|
407
|
+
return normalizedInteger;
|
|
408
|
+
}
|
|
409
|
+
return `${normalizedInteger}.${decimalPart}`;
|
|
410
|
+
};
|
|
411
|
+
var rawMoneyToEditableValue = (rawValue) => {
|
|
412
|
+
if (!rawValue) {
|
|
413
|
+
return "";
|
|
414
|
+
}
|
|
415
|
+
const [integerPart = "", decimalPart] = rawValue.split(".");
|
|
416
|
+
if (decimalPart === void 0 || decimalPart.length === 0) {
|
|
417
|
+
return integerPart;
|
|
418
|
+
}
|
|
419
|
+
return `${integerPart},${decimalPart.slice(0, MONEY_MAX_DECIMALS)}`;
|
|
420
|
+
};
|
|
421
|
+
var normalizeMoneyRawValue = (value) => {
|
|
422
|
+
const normalized = Array.isArray(value) ? value[0] : value;
|
|
423
|
+
if (normalized === void 0 || normalized === null) {
|
|
424
|
+
return "";
|
|
425
|
+
}
|
|
426
|
+
const asString = String(normalized).trim();
|
|
427
|
+
if (!asString) {
|
|
428
|
+
return "";
|
|
429
|
+
}
|
|
430
|
+
const fromRaw = asString.match(/^(\d+)(?:[.,](\d{0,4}))?$/);
|
|
431
|
+
if (fromRaw) {
|
|
432
|
+
const integerPart = fromRaw[1] ?? "";
|
|
433
|
+
const decimalPart = fromRaw[2] ?? "";
|
|
434
|
+
if (!decimalPart) {
|
|
435
|
+
return integerPart;
|
|
436
|
+
}
|
|
437
|
+
return `${integerPart}.${decimalPart}`;
|
|
438
|
+
}
|
|
439
|
+
return editableMoneyToRawValue(sanitizeMoneyEditableValue(asString));
|
|
440
|
+
};
|
|
441
|
+
var formatMoneyValue = (rawValue, moneySymbol) => {
|
|
442
|
+
if (!rawValue) {
|
|
443
|
+
return "";
|
|
444
|
+
}
|
|
445
|
+
const [integerPart = "0", decimalPart = ""] = rawValue.split(".");
|
|
446
|
+
const integerWithGrouping = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
447
|
+
const decimalSection = decimalPart ? `,${decimalPart}` : "";
|
|
448
|
+
const prefix = moneySymbol.trim();
|
|
449
|
+
if (!prefix) {
|
|
450
|
+
return `${integerWithGrouping}${decimalSection}`;
|
|
451
|
+
}
|
|
452
|
+
return `${prefix} ${integerWithGrouping}${decimalSection}`;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
// src/components/inputs/input/money-input.tsx
|
|
456
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
457
|
+
function MoneyInput({
|
|
458
|
+
size: _size,
|
|
459
|
+
classNames,
|
|
460
|
+
moneySymbol,
|
|
461
|
+
reset,
|
|
462
|
+
...props
|
|
463
|
+
}) {
|
|
464
|
+
const {
|
|
465
|
+
value,
|
|
466
|
+
defaultValue,
|
|
467
|
+
onChange,
|
|
468
|
+
onKeyDown,
|
|
469
|
+
onBlur,
|
|
470
|
+
onFocus,
|
|
471
|
+
onPaste,
|
|
472
|
+
className,
|
|
473
|
+
inputMode,
|
|
474
|
+
pattern,
|
|
475
|
+
name,
|
|
476
|
+
disabled,
|
|
477
|
+
...restProps
|
|
478
|
+
} = props;
|
|
479
|
+
const symbol = moneySymbol ?? DEFAULT_MONEY_SYMBOL;
|
|
480
|
+
const rawToDisplayValue = (0, import_react3.useCallback)(
|
|
481
|
+
(rawValue2) => formatMoneyValue(rawValue2, symbol),
|
|
482
|
+
[symbol]
|
|
483
|
+
);
|
|
484
|
+
const {
|
|
485
|
+
rawValue,
|
|
486
|
+
displayValue,
|
|
487
|
+
isFocused,
|
|
488
|
+
handleFocus,
|
|
489
|
+
handleChange,
|
|
490
|
+
handleBlur
|
|
491
|
+
} = useFormattedNumericInput({
|
|
492
|
+
value,
|
|
493
|
+
defaultValue,
|
|
494
|
+
onChange,
|
|
495
|
+
onBlur,
|
|
496
|
+
onFocus,
|
|
497
|
+
normalizeRawValue: normalizeMoneyRawValue,
|
|
498
|
+
rawToEditableValue: rawMoneyToEditableValue,
|
|
499
|
+
rawToDisplayValue,
|
|
500
|
+
editableToRawValue: editableMoneyToRawValue,
|
|
501
|
+
sanitizeEditableValue: sanitizeMoneyEditableValue
|
|
502
|
+
});
|
|
503
|
+
const resolvedPattern = pattern ?? (isFocused ? MONEY_INPUT_PATTERN : void 0);
|
|
504
|
+
const handleKeyDown = (event) => {
|
|
505
|
+
if (!isControlShortcut(event) && !isNavigationKey(event.key)) {
|
|
506
|
+
const isAllowed = isAllowedMoneyCharacter(event.key);
|
|
507
|
+
if (!isAllowed) {
|
|
508
|
+
event.preventDefault();
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
onKeyDown?.(event);
|
|
512
|
+
};
|
|
513
|
+
const handlePaste = (event) => {
|
|
514
|
+
const pastedText = event.clipboardData.getData("text");
|
|
515
|
+
if (!isValidMoneyPaste(pastedText)) {
|
|
516
|
+
event.preventDefault();
|
|
517
|
+
}
|
|
518
|
+
onPaste?.(event);
|
|
519
|
+
};
|
|
520
|
+
if (reset) {
|
|
521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("w-fit", classNames?.root), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { ...props, className: cn(classNames?.input, className) }) });
|
|
522
|
+
}
|
|
523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("w-fit", classNames?.root), children: [
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
525
|
+
"input",
|
|
526
|
+
{
|
|
527
|
+
...restProps,
|
|
528
|
+
type: "text",
|
|
529
|
+
name: void 0,
|
|
530
|
+
value: displayValue,
|
|
531
|
+
disabled,
|
|
532
|
+
inputMode: inputMode ?? "decimal",
|
|
533
|
+
pattern: resolvedPattern,
|
|
534
|
+
onFocus: handleFocus,
|
|
535
|
+
onChange: handleChange,
|
|
536
|
+
onBlur: handleBlur,
|
|
537
|
+
onKeyDown: handleKeyDown,
|
|
538
|
+
onPaste: handlePaste,
|
|
539
|
+
className: cn(classNames?.input, className)
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "hidden", name, value: rawValue, disabled }) : null
|
|
543
|
+
] });
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// src/utils/input/number.ts
|
|
547
|
+
var NUMBER_INPUT_PATTERN = "^([0-9]{1,3}(\\.[0-9]{3})*|[0-9]+)?(,[0-9]*)?$";
|
|
548
|
+
var NUMBER_ALLOWED_CHAR_REGEX = /[0-9.,]/;
|
|
549
|
+
var NUMBER_INPUT_REGEX = /^(\d{1,3}(\.\d{3})*|\d+)?(,\d*)?$/;
|
|
550
|
+
var NUMBER_RAW_REGEX = /^\d+(?:\.\d+)?$/;
|
|
551
|
+
var isAllowedNumberCharacter = (key) => NUMBER_ALLOWED_CHAR_REGEX.test(key);
|
|
552
|
+
var isValidNumberInput = (value) => NUMBER_INPUT_REGEX.test(value);
|
|
553
|
+
var displayNumberToRawValue = (displayValue) => {
|
|
554
|
+
if (!displayValue) {
|
|
555
|
+
return "";
|
|
556
|
+
}
|
|
557
|
+
const cleaned = displayValue.replace(/[^\d.,]/g, "");
|
|
558
|
+
const [integerPart = "", ...decimalParts] = cleaned.split(",");
|
|
559
|
+
const integerWithoutGrouping = integerPart.replace(/\./g, "");
|
|
560
|
+
const decimalPart = decimalParts.join("");
|
|
561
|
+
if (!integerWithoutGrouping && !decimalPart) {
|
|
562
|
+
return "";
|
|
563
|
+
}
|
|
564
|
+
if (!decimalPart) {
|
|
565
|
+
return integerWithoutGrouping;
|
|
566
|
+
}
|
|
567
|
+
return `${integerWithoutGrouping || "0"}.${decimalPart}`;
|
|
568
|
+
};
|
|
569
|
+
var rawNumberToDisplayValue = (rawValue) => {
|
|
570
|
+
if (!rawValue) {
|
|
571
|
+
return "";
|
|
572
|
+
}
|
|
573
|
+
const [integerPart = "0", decimalPart = ""] = rawValue.split(".");
|
|
574
|
+
const integerWithGrouping = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
575
|
+
if (!decimalPart) {
|
|
576
|
+
return integerWithGrouping;
|
|
577
|
+
}
|
|
578
|
+
return `${integerWithGrouping},${decimalPart}`;
|
|
579
|
+
};
|
|
580
|
+
var rawNumberToEditableValue = (rawValue) => {
|
|
581
|
+
if (!rawValue) {
|
|
582
|
+
return "";
|
|
583
|
+
}
|
|
584
|
+
const [integerPart = "", decimalPart] = rawValue.split(".");
|
|
585
|
+
if (decimalPart === void 0 || decimalPart.length === 0) {
|
|
586
|
+
return integerPart;
|
|
587
|
+
}
|
|
588
|
+
return `${integerPart},${decimalPart}`;
|
|
589
|
+
};
|
|
590
|
+
var normalizeNumberRawValue = (value) => {
|
|
591
|
+
const normalized = Array.isArray(value) ? value[0] : value;
|
|
592
|
+
if (normalized === void 0 || normalized === null) {
|
|
593
|
+
return "";
|
|
594
|
+
}
|
|
595
|
+
const asString = String(normalized).trim();
|
|
596
|
+
if (!asString) {
|
|
597
|
+
return "";
|
|
598
|
+
}
|
|
599
|
+
if (NUMBER_RAW_REGEX.test(asString)) {
|
|
600
|
+
return asString;
|
|
601
|
+
}
|
|
602
|
+
if (NUMBER_INPUT_REGEX.test(asString)) {
|
|
603
|
+
return displayNumberToRawValue(asString);
|
|
604
|
+
}
|
|
605
|
+
return displayNumberToRawValue(asString);
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
// src/components/inputs/input/number-input.tsx
|
|
609
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
610
|
+
function NumberInput({
|
|
611
|
+
size: _size,
|
|
612
|
+
classNames,
|
|
613
|
+
reset,
|
|
614
|
+
...props
|
|
615
|
+
}) {
|
|
616
|
+
const {
|
|
617
|
+
value,
|
|
618
|
+
defaultValue,
|
|
619
|
+
onChange,
|
|
620
|
+
onBlur,
|
|
621
|
+
onFocus,
|
|
622
|
+
onKeyDown,
|
|
623
|
+
onPaste,
|
|
624
|
+
inputMode,
|
|
625
|
+
pattern,
|
|
626
|
+
className,
|
|
627
|
+
name,
|
|
628
|
+
disabled,
|
|
629
|
+
...restProps
|
|
630
|
+
} = props;
|
|
631
|
+
const { rawValue, displayValue, handleFocus, handleChange, handleBlur } = useFormattedNumericInput({
|
|
632
|
+
value,
|
|
633
|
+
defaultValue,
|
|
634
|
+
onChange,
|
|
635
|
+
onBlur,
|
|
636
|
+
onFocus,
|
|
637
|
+
normalizeRawValue: normalizeNumberRawValue,
|
|
638
|
+
rawToEditableValue: rawNumberToEditableValue,
|
|
639
|
+
rawToDisplayValue: rawNumberToDisplayValue,
|
|
640
|
+
editableToRawValue: displayNumberToRawValue
|
|
641
|
+
});
|
|
642
|
+
const handleKeyDown = (event) => {
|
|
643
|
+
if (!isControlShortcut(event) && !isNavigationKey(event.key)) {
|
|
644
|
+
const isAllowedChar = isAllowedNumberCharacter(event.key);
|
|
645
|
+
if (!isAllowedChar) {
|
|
646
|
+
event.preventDefault();
|
|
647
|
+
} else {
|
|
648
|
+
const inputElement = event.currentTarget;
|
|
649
|
+
const selectionStart = inputElement.selectionStart ?? 0;
|
|
650
|
+
const selectionEnd = inputElement.selectionEnd ?? selectionStart;
|
|
651
|
+
const nextValue = buildNextValue(
|
|
652
|
+
inputElement.value,
|
|
653
|
+
selectionStart,
|
|
654
|
+
selectionEnd,
|
|
655
|
+
event.key
|
|
656
|
+
);
|
|
657
|
+
if (!isValidNumberInput(nextValue)) {
|
|
658
|
+
event.preventDefault();
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
onKeyDown?.(event);
|
|
663
|
+
};
|
|
664
|
+
const handlePaste = (event) => {
|
|
665
|
+
const pastedText = event.clipboardData.getData("text");
|
|
666
|
+
const inputElement = event.currentTarget;
|
|
667
|
+
const selectionStart = inputElement.selectionStart ?? 0;
|
|
668
|
+
const selectionEnd = inputElement.selectionEnd ?? selectionStart;
|
|
669
|
+
const nextValue = buildNextValue(
|
|
670
|
+
inputElement.value,
|
|
671
|
+
selectionStart,
|
|
672
|
+
selectionEnd,
|
|
673
|
+
pastedText
|
|
674
|
+
);
|
|
675
|
+
if (!isValidNumberInput(nextValue)) {
|
|
676
|
+
event.preventDefault();
|
|
677
|
+
}
|
|
678
|
+
onPaste?.(event);
|
|
679
|
+
};
|
|
680
|
+
if (reset) {
|
|
681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("w-fit", classNames?.root), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
682
|
+
"input",
|
|
683
|
+
{
|
|
684
|
+
...props,
|
|
685
|
+
type: "number",
|
|
686
|
+
className: cn(classNames?.input, className)
|
|
687
|
+
}
|
|
688
|
+
) });
|
|
689
|
+
}
|
|
690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("w-fit", classNames?.root), children: [
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
692
|
+
"input",
|
|
693
|
+
{
|
|
694
|
+
...restProps,
|
|
695
|
+
type: "text",
|
|
696
|
+
name: void 0,
|
|
697
|
+
value: displayValue,
|
|
698
|
+
disabled,
|
|
699
|
+
inputMode: inputMode ?? "decimal",
|
|
700
|
+
pattern: pattern ?? NUMBER_INPUT_PATTERN,
|
|
701
|
+
onFocus: handleFocus,
|
|
702
|
+
onChange: handleChange,
|
|
703
|
+
onBlur: handleBlur,
|
|
704
|
+
onKeyDown: handleKeyDown,
|
|
705
|
+
onPaste: handlePaste,
|
|
706
|
+
className: cn(classNames?.input, className)
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "hidden", name, value: rawValue, disabled }) : null
|
|
710
|
+
] });
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/components/inputs/input/password-input.tsx
|
|
714
|
+
var import_lucide_react = require("lucide-react");
|
|
715
|
+
var import_react4 = require("react");
|
|
716
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
717
|
+
var buttonSizeClasses = {
|
|
718
|
+
sm: "size-8 rounded-sm",
|
|
719
|
+
md: "size-10 rounded-sm",
|
|
720
|
+
lg: "size-11 rounded-md"
|
|
721
|
+
};
|
|
722
|
+
var iconSizeClasses = {
|
|
723
|
+
sm: "size-4",
|
|
724
|
+
md: "size-5",
|
|
725
|
+
lg: "size-6"
|
|
726
|
+
};
|
|
727
|
+
function PasswordInput({
|
|
728
|
+
size,
|
|
729
|
+
classNames,
|
|
730
|
+
...props
|
|
731
|
+
}) {
|
|
732
|
+
const [viewPassword, setViewPassword] = (0, import_react4.useState)(false);
|
|
733
|
+
const EyeIcon = viewPassword ? import_lucide_react.Eye : import_lucide_react.EyeOff;
|
|
734
|
+
const { className, ...restProps } = props;
|
|
735
|
+
const currentSize = size ?? "md";
|
|
736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("relative w-fit", classNames?.root), children: [
|
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
738
|
+
"input",
|
|
739
|
+
{
|
|
740
|
+
...restProps,
|
|
741
|
+
type: viewPassword ? "text" : "password",
|
|
742
|
+
className: cn(
|
|
743
|
+
"placeholder:tracking-normal [[type='password']]:tracking-[0.16em]",
|
|
744
|
+
classNames?.input,
|
|
745
|
+
className
|
|
746
|
+
)
|
|
747
|
+
}
|
|
748
|
+
),
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
750
|
+
Button,
|
|
751
|
+
{
|
|
752
|
+
variant: "ghost",
|
|
753
|
+
size: "icon",
|
|
754
|
+
className: cn(
|
|
755
|
+
"absolute top-1/2 right-1 -translate-y-1/2",
|
|
756
|
+
buttonSizeClasses[currentSize]
|
|
757
|
+
),
|
|
758
|
+
type: "button",
|
|
759
|
+
"aria-label": viewPassword ? "Hide password" : "Show password",
|
|
760
|
+
title: viewPassword ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a",
|
|
761
|
+
onClick: () => setViewPassword((prev) => !prev),
|
|
762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
763
|
+
EyeIcon,
|
|
764
|
+
{
|
|
765
|
+
"aria-hidden": "true",
|
|
766
|
+
className: cn(iconSizeClasses[currentSize])
|
|
767
|
+
}
|
|
768
|
+
)
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
] });
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// src/types/atoms/inputs/input/input.ts
|
|
775
|
+
var inputTypes = [
|
|
776
|
+
"text",
|
|
777
|
+
"password",
|
|
778
|
+
"email",
|
|
779
|
+
"number",
|
|
780
|
+
"money"
|
|
781
|
+
];
|
|
782
|
+
|
|
783
|
+
// src/components/inputs/input/input.tsx
|
|
784
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
785
|
+
var baseStyles3 = [
|
|
786
|
+
"bg-transparent transition-colors duration-200 ease-in-out disabled:bg-neutral-200 disabled:text-neutral-600 disabled:border-neutral-400 disabled:cursor-not-allowed"
|
|
787
|
+
];
|
|
788
|
+
var variants3 = {
|
|
789
|
+
default: [
|
|
790
|
+
"border border-neutral-500 text-foreground",
|
|
791
|
+
"placeholder:text-neutral-500",
|
|
792
|
+
"hover:border-neutral-700",
|
|
793
|
+
"focus:border-info-500 focus:ring-0 focus:outline-none"
|
|
794
|
+
],
|
|
795
|
+
error: [
|
|
796
|
+
"border border-destructive text-foreground",
|
|
797
|
+
"placeholder:text-destructive-400/70",
|
|
798
|
+
"hover:border-destructive-600",
|
|
799
|
+
"focus:border-destructive-400 focus:ring-0 focus:outline-none"
|
|
800
|
+
],
|
|
801
|
+
success: [
|
|
802
|
+
"border border-success text-foreground",
|
|
803
|
+
"placeholder:text-success/60",
|
|
804
|
+
"hover:border-success-600",
|
|
805
|
+
"focus:border-success-400 focus:ring-0 focus:outline-none"
|
|
806
|
+
]
|
|
807
|
+
};
|
|
808
|
+
var sizes3 = {
|
|
809
|
+
sm: ["h-10 rounded-[14px] px-3 py-2.5 font-normal text-sm"],
|
|
810
|
+
md: ["h-12 rounded-md px-3 pt-3 pb-3.5 text-base"],
|
|
811
|
+
lg: ["h-13 rounded-lg px-3 py-[15px] text-base"]
|
|
812
|
+
};
|
|
813
|
+
var switchVariants = (0, import_class_variance_authority3.cva)(baseStyles3, {
|
|
814
|
+
variants: {
|
|
815
|
+
variant: variants3,
|
|
816
|
+
size: sizes3
|
|
817
|
+
},
|
|
818
|
+
defaultVariants: {
|
|
819
|
+
variant: "default",
|
|
820
|
+
size: "md"
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
function Input({
|
|
824
|
+
variant,
|
|
825
|
+
size,
|
|
826
|
+
classNames,
|
|
827
|
+
moneySymbol,
|
|
828
|
+
type,
|
|
829
|
+
...props
|
|
830
|
+
}) {
|
|
831
|
+
const inputClasses = cn(switchVariants({ variant, size }), props.className);
|
|
832
|
+
const specializedClassNames = {
|
|
833
|
+
input: cn(inputClasses, classNames?.input),
|
|
834
|
+
root: classNames?.root
|
|
835
|
+
};
|
|
836
|
+
if (type && !inputTypes.includes(type)) {
|
|
837
|
+
throw new Error(
|
|
838
|
+
`Invalid input type: ${type}. Allowed types are: ${inputTypes.join(", ")}`
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
if (type !== "password" && type !== "number" && type !== "money") {
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("w-fit", classNames?.root), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
843
|
+
"input",
|
|
844
|
+
{
|
|
845
|
+
...props,
|
|
846
|
+
type,
|
|
847
|
+
className: cn(inputClasses, classNames?.input)
|
|
848
|
+
}
|
|
849
|
+
) });
|
|
850
|
+
}
|
|
851
|
+
if (type === "password") {
|
|
852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
853
|
+
PasswordInput,
|
|
854
|
+
{
|
|
855
|
+
size,
|
|
856
|
+
classNames: specializedClassNames,
|
|
857
|
+
...props
|
|
858
|
+
}
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
if (type === "number") {
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NumberInput, { size, classNames: specializedClassNames, ...props });
|
|
863
|
+
}
|
|
864
|
+
if (type === "money") {
|
|
865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
866
|
+
MoneyInput,
|
|
867
|
+
{
|
|
868
|
+
size,
|
|
869
|
+
moneySymbol,
|
|
870
|
+
classNames: specializedClassNames,
|
|
871
|
+
...props
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// src/components/inputs/radio.tsx
|
|
878
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
879
|
+
|
|
880
|
+
// src/hooks/use-radio.ts
|
|
881
|
+
var import_react6 = require("react");
|
|
882
|
+
|
|
883
|
+
// src/hooks/context/radio-group.ts
|
|
884
|
+
var import_react5 = require("react");
|
|
885
|
+
var RadioGroupContext = (0, import_react5.createContext)(null);
|
|
886
|
+
function useRadioGroupContext() {
|
|
887
|
+
const context = (0, import_react5.useContext)(RadioGroupContext);
|
|
888
|
+
if (!context) {
|
|
889
|
+
throw new Error("RadioItem must be used within a RadioGroup");
|
|
890
|
+
}
|
|
891
|
+
return context;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// src/hooks/use-radio.ts
|
|
895
|
+
function useRadio({
|
|
896
|
+
variant,
|
|
897
|
+
readOnly,
|
|
898
|
+
disabled,
|
|
899
|
+
value,
|
|
900
|
+
onClick,
|
|
901
|
+
onChange,
|
|
902
|
+
id
|
|
903
|
+
}) {
|
|
904
|
+
const context = useRadioGroupContext();
|
|
905
|
+
const generatedId = (0, import_react6.useId)();
|
|
906
|
+
const finalId = id || generatedId;
|
|
907
|
+
const resolvedVariant = variant || context.variant;
|
|
908
|
+
const isReadOnly = Boolean(readOnly || context.readOnly);
|
|
909
|
+
const isDisabled = Boolean(disabled || context.disabled);
|
|
910
|
+
const isChecked = context.value === value;
|
|
911
|
+
const name = context.name;
|
|
912
|
+
const handleClick = (event) => {
|
|
913
|
+
if (isReadOnly || isDisabled) {
|
|
914
|
+
event.preventDefault();
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
onClick?.(event);
|
|
918
|
+
};
|
|
919
|
+
const handleChange = (event) => {
|
|
920
|
+
if (isReadOnly || isDisabled) {
|
|
921
|
+
event.preventDefault();
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
context.onValueChange(value);
|
|
925
|
+
onChange?.(event);
|
|
926
|
+
};
|
|
927
|
+
return {
|
|
928
|
+
id: finalId,
|
|
929
|
+
name,
|
|
930
|
+
resolvedVariant,
|
|
931
|
+
isReadOnly,
|
|
932
|
+
isDisabled,
|
|
933
|
+
isChecked,
|
|
934
|
+
handleClick,
|
|
935
|
+
handleChange
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// src/hooks/use-radio-group.ts
|
|
940
|
+
var import_react7 = require("react");
|
|
941
|
+
function useRadioGroup({
|
|
942
|
+
value,
|
|
943
|
+
defaultValue,
|
|
944
|
+
onValueChange,
|
|
945
|
+
name,
|
|
946
|
+
variant = "default",
|
|
947
|
+
disabled = false,
|
|
948
|
+
readOnly = false
|
|
949
|
+
}) {
|
|
950
|
+
const generatedName = (0, import_react7.useId)();
|
|
951
|
+
const groupName = name || generatedName;
|
|
952
|
+
const [internalValue, setInternalValue] = (0, import_react7.useState)(defaultValue);
|
|
953
|
+
const isControlled = value !== void 0;
|
|
954
|
+
const selectedValue = isControlled ? value : internalValue;
|
|
955
|
+
const handleValueChange = (0, import_react7.useCallback)(
|
|
956
|
+
(nextValue) => {
|
|
957
|
+
if (disabled || readOnly) {
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
if (!isControlled) {
|
|
961
|
+
setInternalValue(nextValue);
|
|
962
|
+
}
|
|
963
|
+
onValueChange?.(nextValue);
|
|
964
|
+
},
|
|
965
|
+
[disabled, readOnly, isControlled, onValueChange]
|
|
966
|
+
);
|
|
967
|
+
const contextValue = (0, import_react7.useMemo)(
|
|
968
|
+
() => ({
|
|
969
|
+
name: groupName,
|
|
970
|
+
value: selectedValue,
|
|
971
|
+
variant,
|
|
972
|
+
disabled,
|
|
973
|
+
readOnly,
|
|
974
|
+
onValueChange: handleValueChange
|
|
975
|
+
}),
|
|
976
|
+
[groupName, selectedValue, variant, disabled, readOnly, handleValueChange]
|
|
977
|
+
);
|
|
978
|
+
return {
|
|
979
|
+
contextValue
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// src/providers/radio-group-provider.tsx
|
|
984
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
985
|
+
function RadioGroupProvider({ value, children }) {
|
|
986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RadioGroupContext.Provider, { value, children });
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
// src/components/inputs/radio.tsx
|
|
990
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
991
|
+
var baseStyles4 = "size-6 shrink-0 appearance-none rounded-full border-2 border-neutral-600 bg-transparent transition-all duration-200 outline-none disabled:border-neutral-400 disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed group-data-[readonly=true]/radio:cursor-default";
|
|
992
|
+
var variants4 = {
|
|
993
|
+
default: "hover:border-info-500 hover:bg-info-50 focus-visible:border-info-500 focus-visible:ring-info-500/20 checked:border-info-500 checked:hover:border-info-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent",
|
|
994
|
+
success: "hover:border-success-500 hover:bg-success-50 focus-visible:border-success-500 focus-visible:ring-success-500/20 checked:border-success-500 checked:hover:border-success-600 disabled:hover:border-neutral-400 disabled:hover:bg-transparent"
|
|
995
|
+
};
|
|
996
|
+
var indicatorVariants = (0, import_class_variance_authority4.cva)(
|
|
997
|
+
"pointer-events-none absolute z-10 size-3 rounded-full opacity-0 transition-opacity group-has-checked/control:opacity-100",
|
|
998
|
+
{
|
|
999
|
+
variants: {
|
|
1000
|
+
variant: {
|
|
1001
|
+
default: "bg-info-500",
|
|
1002
|
+
success: "bg-success-500"
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
defaultVariants: {
|
|
1006
|
+
variant: "default"
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
);
|
|
1010
|
+
var radioVariants = (0, import_class_variance_authority4.cva)(baseStyles4, {
|
|
1011
|
+
variants: {
|
|
1012
|
+
variant: variants4
|
|
1013
|
+
},
|
|
1014
|
+
defaultVariants: {
|
|
1015
|
+
variant: "default"
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
function RadioGroup({
|
|
1019
|
+
value,
|
|
1020
|
+
defaultValue,
|
|
1021
|
+
onValueChange,
|
|
1022
|
+
name,
|
|
1023
|
+
variant = "default",
|
|
1024
|
+
disabled = false,
|
|
1025
|
+
readOnly = false,
|
|
1026
|
+
className,
|
|
1027
|
+
children,
|
|
1028
|
+
...props
|
|
1029
|
+
}) {
|
|
1030
|
+
const { contextValue } = useRadioGroup({
|
|
1031
|
+
value,
|
|
1032
|
+
defaultValue,
|
|
1033
|
+
onValueChange,
|
|
1034
|
+
name,
|
|
1035
|
+
variant,
|
|
1036
|
+
disabled,
|
|
1037
|
+
readOnly
|
|
1038
|
+
});
|
|
1039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadioGroupProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1040
|
+
"div",
|
|
1041
|
+
{
|
|
1042
|
+
role: "radiogroup",
|
|
1043
|
+
"aria-disabled": contextValue.disabled || void 0,
|
|
1044
|
+
"aria-readonly": contextValue.readOnly || void 0,
|
|
1045
|
+
"data-slot": "radio-group",
|
|
1046
|
+
"data-disabled": contextValue.disabled ? "true" : void 0,
|
|
1047
|
+
"data-readonly": contextValue.readOnly ? "true" : void 0,
|
|
1048
|
+
className: cn("flex flex-col gap-4", className),
|
|
1049
|
+
...props,
|
|
1050
|
+
children
|
|
1051
|
+
}
|
|
1052
|
+
) });
|
|
1053
|
+
}
|
|
1054
|
+
function RadioItem({
|
|
1055
|
+
variant,
|
|
1056
|
+
children,
|
|
1057
|
+
className,
|
|
1058
|
+
classNames,
|
|
1059
|
+
readOnly,
|
|
1060
|
+
onClick,
|
|
1061
|
+
onChange,
|
|
1062
|
+
disabled,
|
|
1063
|
+
value,
|
|
1064
|
+
id: propId,
|
|
1065
|
+
...props
|
|
1066
|
+
}) {
|
|
1067
|
+
const {
|
|
1068
|
+
handleChange,
|
|
1069
|
+
handleClick,
|
|
1070
|
+
id,
|
|
1071
|
+
isChecked,
|
|
1072
|
+
isDisabled,
|
|
1073
|
+
isReadOnly,
|
|
1074
|
+
resolvedVariant,
|
|
1075
|
+
name
|
|
1076
|
+
} = useRadio({
|
|
1077
|
+
variant,
|
|
1078
|
+
readOnly,
|
|
1079
|
+
disabled,
|
|
1080
|
+
value,
|
|
1081
|
+
onClick,
|
|
1082
|
+
onChange,
|
|
1083
|
+
id: propId
|
|
1084
|
+
});
|
|
1085
|
+
const classes = cn(
|
|
1086
|
+
radioVariants({ variant: resolvedVariant }),
|
|
1087
|
+
className,
|
|
1088
|
+
classNames?.input
|
|
1089
|
+
);
|
|
1090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1091
|
+
"label",
|
|
1092
|
+
{
|
|
1093
|
+
"data-slot": "radio",
|
|
1094
|
+
"data-state": isChecked ? "checked" : "unchecked",
|
|
1095
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
1096
|
+
"data-readonly": isReadOnly ? "true" : void 0,
|
|
1097
|
+
className: cn(
|
|
1098
|
+
"group/radio inline-flex w-fit cursor-pointer items-center gap-3 data-[disabled=true]:cursor-not-allowed data-[readonly=true]:cursor-default",
|
|
1099
|
+
classNames?.root
|
|
1100
|
+
),
|
|
1101
|
+
children: [
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1103
|
+
"span",
|
|
1104
|
+
{
|
|
1105
|
+
role: "presentation",
|
|
1106
|
+
className: "group/control relative flex size-6 shrink-0 items-center justify-center",
|
|
1107
|
+
children: [
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1109
|
+
"input",
|
|
1110
|
+
{
|
|
1111
|
+
id,
|
|
1112
|
+
type: "radio",
|
|
1113
|
+
name,
|
|
1114
|
+
value,
|
|
1115
|
+
checked: isChecked,
|
|
1116
|
+
className: classes,
|
|
1117
|
+
readOnly: isReadOnly,
|
|
1118
|
+
disabled: isDisabled,
|
|
1119
|
+
onClick: handleClick,
|
|
1120
|
+
onChange: handleChange,
|
|
1121
|
+
...props
|
|
1122
|
+
}
|
|
1123
|
+
),
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1125
|
+
"span",
|
|
1126
|
+
{
|
|
1127
|
+
"aria-hidden": "true",
|
|
1128
|
+
role: "presentation",
|
|
1129
|
+
className: cn(
|
|
1130
|
+
indicatorVariants({ variant: resolvedVariant }),
|
|
1131
|
+
classNames?.indicator
|
|
1132
|
+
)
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
]
|
|
1136
|
+
}
|
|
1137
|
+
),
|
|
1138
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1139
|
+
"span",
|
|
1140
|
+
{
|
|
1141
|
+
"data-slot": "radio-label",
|
|
1142
|
+
className: cn(
|
|
1143
|
+
"cursor-pointer transition-colors group-data-[disabled=true]/radio:cursor-not-allowed group-data-[readonly=true]/radio:cursor-default group-data-[disabled=true]/radio:text-neutral-600",
|
|
1144
|
+
classNames?.label
|
|
1145
|
+
),
|
|
1146
|
+
children
|
|
1147
|
+
}
|
|
1148
|
+
) : null
|
|
1149
|
+
]
|
|
1150
|
+
}
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// src/components/inputs/switch.tsx
|
|
1155
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1156
|
+
var import_react8 = require("react");
|
|
1157
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1158
|
+
var baseStyles5 = [
|
|
1159
|
+
"group relative inline-flex h-6 w-11 items-center rounded-sm p-0.5 transition-colors duration-300",
|
|
1160
|
+
"[&_>span]:block [&_>span]:size-5 [&_>span]:rounded-full [&_>span]:transition-all [&_>span]:duration-300 [&_>span]:group-has-checked:translate-x-full",
|
|
1161
|
+
"bg-neutral-300 group-hover:bg-neutral-400",
|
|
1162
|
+
"[&_>span]:bg-neutral-500 group-hover:[&_>span]:bg-neutral-600",
|
|
1163
|
+
"group-has-checked:[&_>span]:bg-neutral-300 group-has-checked:group-hover:[&_>span]:bg-neutral-300",
|
|
1164
|
+
"outline-info-500/20 group-has-focus-visible:outline-3 group-has-focus-visible:ring-0",
|
|
1165
|
+
"group-has-disabled:bg-neutral-200 group-has-disabled:cursor-not-allowed",
|
|
1166
|
+
"group-has-disabled:group-hover:bg-neutral-200 group-has-disabled:[&_>span]:bg-neutral-400 group-has-disabled:group-hover:[&_>span]:bg-neutral-400",
|
|
1167
|
+
"group-has-disabled:group-has-checked:[&_>span]:bg-neutral-200 group-has-disabled:group-has-checked:group-hover:[&_>span]:bg-neutral-200"
|
|
1168
|
+
];
|
|
1169
|
+
var variants5 = {
|
|
1170
|
+
default: [
|
|
1171
|
+
"group-has-checked:bg-info-500 group-has-checked:group-hover:bg-info-700",
|
|
1172
|
+
"group-has-disabled:group-has-checked:bg-info-50 group-has-disabled:group-has-checked:group-hover:bg-info-50"
|
|
1173
|
+
],
|
|
1174
|
+
alt: [
|
|
1175
|
+
"group-has-checked:bg-alt2-500 group-has-checked:group-hover:bg-alt2-700",
|
|
1176
|
+
"group-has-disabled:group-has-checked:bg-alt2-50 group-has-disabled:group-has-checked:group-hover:bg-alt2-50"
|
|
1177
|
+
]
|
|
1178
|
+
};
|
|
1179
|
+
var switchVariants2 = (0, import_class_variance_authority5.cva)(baseStyles5, {
|
|
1180
|
+
variants: {
|
|
1181
|
+
variant: variants5
|
|
1182
|
+
},
|
|
1183
|
+
defaultVariants: {
|
|
1184
|
+
variant: "default"
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
function Switch({
|
|
1188
|
+
variant,
|
|
1189
|
+
classNames,
|
|
1190
|
+
id: propsId,
|
|
1191
|
+
children,
|
|
1192
|
+
className,
|
|
1193
|
+
...props
|
|
1194
|
+
}) {
|
|
1195
|
+
const generatedId = (0, import_react8.useId)();
|
|
1196
|
+
const id = propsId || generatedId;
|
|
1197
|
+
const classes = cn(switchVariants2({ variant }), classNames?.input);
|
|
1198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1199
|
+
"label",
|
|
1200
|
+
{
|
|
1201
|
+
htmlFor: id,
|
|
1202
|
+
className: cn(
|
|
1203
|
+
"group inline-flex items-center gap-2",
|
|
1204
|
+
props.disabled ? "cursor-not-allowed text-neutral-700" : "cursor-pointer",
|
|
1205
|
+
className,
|
|
1206
|
+
classNames?.root
|
|
1207
|
+
),
|
|
1208
|
+
children: [
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: classes, children: [
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { ...props, id, type: "checkbox", className: "sr-only" }),
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", className: cn(classNames?.indicator) })
|
|
1212
|
+
] }),
|
|
1213
|
+
children
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
// src/components/surfaces/card.tsx
|
|
1220
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1221
|
+
function Card({ as = "div", className, interactive, ...props }) {
|
|
1222
|
+
const cardClassName = cn(
|
|
1223
|
+
"flex flex-col gap-5 rounded-lg bg-card p-4 text-card-foreground",
|
|
1224
|
+
interactive && "cursor-pointer transition-shadow focus-within:ring-2 focus-within:ring-ring/40 hover:shadow-lg",
|
|
1225
|
+
className
|
|
1226
|
+
);
|
|
1227
|
+
if (as === "article") {
|
|
1228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("article", { "data-slot": "card", className: cardClassName, ...props });
|
|
1229
|
+
}
|
|
1230
|
+
if (as === "section") {
|
|
1231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { "data-slot": "card", className: cardClassName, ...props });
|
|
1232
|
+
}
|
|
1233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { "data-slot": "card", className: cardClassName, ...props });
|
|
1234
|
+
}
|
|
1235
|
+
function CardHeader({ className, ...props }) {
|
|
1236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1237
|
+
"header",
|
|
1238
|
+
{
|
|
1239
|
+
"data-slot": "card-header",
|
|
1240
|
+
className: cn(
|
|
1241
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
1242
|
+
className
|
|
1243
|
+
),
|
|
1244
|
+
...props
|
|
1245
|
+
}
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
function CardTitle({ className, ...props }) {
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1250
|
+
"h3",
|
|
1251
|
+
{
|
|
1252
|
+
"data-slot": "card-title",
|
|
1253
|
+
className: cn("font-semibold leading-none", className),
|
|
1254
|
+
...props
|
|
1255
|
+
}
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
function CardDescription({ className, ...props }) {
|
|
1259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1260
|
+
"p",
|
|
1261
|
+
{
|
|
1262
|
+
"data-slot": "card-description",
|
|
1263
|
+
className: cn("text-neutral-700 text-sm", className),
|
|
1264
|
+
...props
|
|
1265
|
+
}
|
|
1266
|
+
);
|
|
1267
|
+
}
|
|
1268
|
+
function CardAction({ className, ...props }) {
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
"data-slot": "card-action",
|
|
1273
|
+
className: cn(
|
|
1274
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
1275
|
+
className
|
|
1276
|
+
),
|
|
1277
|
+
...props
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
function CardContent({ className, ...props }) {
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { "data-slot": "card-content", className: cn(className), ...props });
|
|
1283
|
+
}
|
|
1284
|
+
function CardFooter({ className, ...props }) {
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1286
|
+
"footer",
|
|
1287
|
+
{
|
|
1288
|
+
"data-slot": "card-footer",
|
|
1289
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
1290
|
+
...props
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
// src/components/icons/menu/closeX.tsx
|
|
1296
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1297
|
+
function CloseX({ className, ...props }) {
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1299
|
+
"svg",
|
|
1300
|
+
{
|
|
1301
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1302
|
+
fill: "none",
|
|
1303
|
+
viewBox: "0 0 24 24",
|
|
1304
|
+
className,
|
|
1305
|
+
...props,
|
|
1306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1307
|
+
"path",
|
|
1308
|
+
{
|
|
1309
|
+
stroke: "currentColor",
|
|
1310
|
+
strokeLinecap: "round",
|
|
1311
|
+
strokeLinejoin: "round",
|
|
1312
|
+
d: "m18 18-6-6m0 0L6 6m6 6 6-6m-6 6-6 6"
|
|
1313
|
+
}
|
|
1314
|
+
)
|
|
1315
|
+
}
|
|
1316
|
+
);
|
|
1317
|
+
}
|
|
1318
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1319
|
+
0 && (module.exports = {
|
|
1320
|
+
Button,
|
|
1321
|
+
Card,
|
|
1322
|
+
CardAction,
|
|
1323
|
+
CardContent,
|
|
1324
|
+
CardDescription,
|
|
1325
|
+
CardFooter,
|
|
1326
|
+
CardHeader,
|
|
1327
|
+
CardTitle,
|
|
1328
|
+
Check,
|
|
1329
|
+
Checkbox,
|
|
1330
|
+
CloseX,
|
|
1331
|
+
Input,
|
|
1332
|
+
Minus,
|
|
1333
|
+
MoneyInput,
|
|
1334
|
+
NumberInput,
|
|
1335
|
+
PasswordInput,
|
|
1336
|
+
Radio,
|
|
1337
|
+
RadioGroup,
|
|
1338
|
+
RadioItem,
|
|
1339
|
+
Switch,
|
|
1340
|
+
cn,
|
|
1341
|
+
inputTypes,
|
|
1342
|
+
useFormattedNumericInput,
|
|
1343
|
+
useRadio,
|
|
1344
|
+
useRadioGroup
|
|
1345
|
+
});
|
|
1346
|
+
//# sourceMappingURL=index.cjs.map
|