@deepnoid/ui 0.1.29 → 0.1.31
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/.turbo/turbo-build.log +183 -173
- package/dist/chunk-62X5AX5B.mjs +297 -0
- package/dist/chunk-6PN3DGOE.mjs +77 -0
- package/dist/{chunk-EHRFXDSN.mjs → chunk-AIIMJZ7L.mjs} +72 -42
- package/dist/{chunk-3KVZDFMV.mjs → chunk-BCMVEGJG.mjs} +3 -3
- package/dist/{chunk-QJJKJYNR.mjs → chunk-BFOK4HVC.mjs} +2 -2
- package/dist/{chunk-KXA73VTJ.mjs → chunk-CVQM3T2X.mjs} +4 -4
- package/dist/{chunk-RCJOJPRS.mjs → chunk-EBRCE7XY.mjs} +40 -30
- package/dist/{chunk-III2QUWF.mjs → chunk-G67WUZO3.mjs} +1 -1
- package/dist/{chunk-BB7MFKNQ.mjs → chunk-IBI3OVQI.mjs} +1 -1
- package/dist/{chunk-LR3SWRB4.mjs → chunk-IC25OKBJ.mjs} +5 -5
- package/dist/{chunk-KLUC2BV6.mjs → chunk-IEJRE6LT.mjs} +10 -7
- package/dist/{chunk-ECMBAKSJ.mjs → chunk-K7V4VE7R.mjs} +5 -5
- package/dist/chunk-LWRK5TPZ.mjs +80 -0
- package/dist/chunk-MZ76AA76.mjs +1 -0
- package/dist/{chunk-X4F7JYBA.mjs → chunk-NFQMXW4Z.mjs} +36 -14
- package/dist/chunk-P7YYNA6L.mjs +67 -0
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.mjs +4 -4
- package/dist/components/button/text-button.mjs +2 -2
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.mjs +6 -6
- package/dist/components/dateTimePicker/index.mjs +6 -6
- package/dist/components/dateTimePicker/timePicker.mjs +4 -4
- package/dist/components/fileUpload/fileUpload.js +62 -39
- package/dist/components/fileUpload/fileUpload.mjs +6 -6
- package/dist/components/fileUpload/index.js +62 -39
- package/dist/components/fileUpload/index.mjs +6 -6
- package/dist/components/input/index.js +62 -39
- package/dist/components/input/index.mjs +2 -2
- package/dist/components/input/input.d.mts +21 -14
- package/dist/components/input/input.d.ts +21 -14
- package/dist/components/input/input.js +62 -39
- package/dist/components/input/input.mjs +2 -2
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/index.mjs +6 -6
- package/dist/components/modal/modal.mjs +6 -6
- package/dist/components/pagination/index.js +62 -39
- package/dist/components/pagination/index.mjs +3 -3
- package/dist/components/pagination/pagination.js +62 -39
- package/dist/components/pagination/pagination.mjs +3 -3
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.js +7 -4
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/select.d.mts +9 -0
- package/dist/components/select/select.d.ts +9 -0
- package/dist/components/select/select.js +7 -4
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/skeleton/index.d.mts +2 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +141 -0
- package/dist/components/skeleton/index.mjs +10 -0
- package/dist/components/skeleton/skeleton.d.mts +14 -0
- package/dist/components/skeleton/skeleton.d.ts +14 -0
- package/dist/components/skeleton/skeleton.js +135 -0
- package/dist/components/skeleton/skeleton.mjs +9 -0
- package/dist/components/table/index.js +748 -646
- package/dist/components/table/index.mjs +11 -9
- package/dist/components/table/table-body.d.mts +6 -4
- package/dist/components/table/table-body.d.ts +6 -4
- package/dist/components/table/table-body.js +115 -63
- package/dist/components/table/table-body.mjs +5 -3
- package/dist/components/table/table-head.d.mts +3 -1
- package/dist/components/table/table-head.d.ts +3 -1
- package/dist/components/table/table-head.js +107 -21
- package/dist/components/table/table-head.mjs +5 -3
- package/dist/components/table/table.d.mts +3 -1
- package/dist/components/table/table.d.ts +3 -1
- package/dist/components/table/table.js +739 -637
- package/dist/components/table/table.mjs +9 -7
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/textarea/index.js +255 -138
- package/dist/components/textarea/index.mjs +2 -1
- package/dist/components/textarea/textarea.d.mts +157 -150
- package/dist/components/textarea/textarea.d.ts +157 -150
- package/dist/components/textarea/textarea.js +255 -138
- package/dist/components/textarea/textarea.mjs +2 -1
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.js +33 -11
- package/dist/components/tree/index.mjs +2 -2
- package/dist/components/tree/tree.d.mts +10 -8
- package/dist/components/tree/tree.d.ts +10 -8
- package/dist/components/tree/tree.js +33 -11
- package/dist/components/tree/tree.mjs +2 -2
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +799 -593
- package/dist/index.mjs +52 -47
- package/package.json +1 -1
- package/dist/chunk-26MNALVL.mjs +0 -47
- package/dist/chunk-A5KQHWS3.mjs +0 -94
- package/dist/chunk-BKE6QF6W.mjs +0 -209
- package/dist/{chunk-SSMMWMQC.mjs → chunk-2YMAKIZ6.mjs} +3 -3
- package/dist/{chunk-6K3E5BVO.mjs → chunk-7TAGGLNY.mjs} +3 -3
- package/dist/{chunk-X6D7C7QZ.mjs → chunk-A7RU3FU5.mjs} +3 -3
- package/dist/{chunk-YLRYHUTW.mjs → chunk-D6QI3DJG.mjs} +3 -3
- package/dist/{chunk-UFVQPPPW.mjs → chunk-HIVPDIEP.mjs} +3 -3
- package/dist/{chunk-P5QCU457.mjs → chunk-LL6F3WDX.mjs} +3 -3
- package/dist/{chunk-7W2ZI2DD.mjs → chunk-MEY4IL7D.mjs} +3 -3
- package/dist/{chunk-33LANVZV.mjs → chunk-QIRL6HY6.mjs} +3 -3
- package/dist/{chunk-W45H2ZMW.mjs → chunk-RT3S3VVJ.mjs} +3 -3
- package/dist/{chunk-7J3KVOTS.mjs → chunk-UB4YBFOT.mjs} +3 -3
- package/dist/{chunk-2PKM7SLZ.mjs → chunk-WFMFC7R6.mjs} +3 -3
- package/dist/{chunk-Y6XQTWB5.mjs → chunk-WLNLVX7Q.mjs} +3 -3
- package/dist/{chunk-IL5ENWCR.mjs → chunk-Z2537DF6.mjs} +3 -3
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
clsx
|
|
4
|
+
} from "./chunk-27Y6K5NK.mjs";
|
|
5
|
+
import {
|
|
6
|
+
mapPropsVariants
|
|
7
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
8
|
+
|
|
9
|
+
// src/components/textarea/textarea.tsx
|
|
10
|
+
import {
|
|
11
|
+
forwardRef,
|
|
12
|
+
useCallback,
|
|
13
|
+
useEffect,
|
|
14
|
+
useImperativeHandle,
|
|
15
|
+
useMemo,
|
|
16
|
+
useRef,
|
|
17
|
+
useState
|
|
18
|
+
} from "react";
|
|
19
|
+
import { tv } from "tailwind-variants";
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var Textarea = forwardRef((originalProps, ref) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const [props, variantProps] = mapPropsVariants(originalProps, textareaStyle.variantKeys);
|
|
24
|
+
const { classNames, label, helperMessage, errorMessage, ...textareaProps } = props;
|
|
25
|
+
const [length, setLength] = useState(((_b = (_a = originalProps.value) == null ? void 0 : _a.toString()) != null ? _b : "").length);
|
|
26
|
+
const innerRef = useRef(null);
|
|
27
|
+
useImperativeHandle(ref, () => innerRef.current);
|
|
28
|
+
const autoResize = useCallback(() => {
|
|
29
|
+
const el = innerRef.current;
|
|
30
|
+
if (el) {
|
|
31
|
+
el.style.height = "auto";
|
|
32
|
+
el.style.height = el.scrollHeight + "px";
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
35
|
+
const handleChange = useCallback(
|
|
36
|
+
(e) => {
|
|
37
|
+
var _a2;
|
|
38
|
+
setLength(e.target.value.length);
|
|
39
|
+
(_a2 = originalProps.onChange) == null ? void 0 : _a2.call(originalProps, e);
|
|
40
|
+
autoResize();
|
|
41
|
+
},
|
|
42
|
+
[originalProps, autoResize]
|
|
43
|
+
);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
autoResize();
|
|
46
|
+
}, [originalProps.value, autoResize]);
|
|
47
|
+
const slots = useMemo(() => textareaStyle({ ...variantProps }), [variantProps]);
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: clsx(
|
|
52
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
53
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
54
|
+
),
|
|
55
|
+
children: [
|
|
56
|
+
label && /* @__PURE__ */ jsx("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
57
|
+
/* @__PURE__ */ jsxs(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: clsx(
|
|
61
|
+
slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }),
|
|
62
|
+
textareaProps.readOnly ? slots.readonlyWrapper({ class: classNames == null ? void 0 : classNames.readonlyWrapper }) : ""
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"textarea",
|
|
67
|
+
{
|
|
68
|
+
ref: innerRef,
|
|
69
|
+
...textareaProps,
|
|
70
|
+
readOnly: props.readOnly,
|
|
71
|
+
onChange: handleChange,
|
|
72
|
+
className: slots.textarea({ class: classNames == null ? void 0 : classNames.textarea })
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
|
|
76
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx(
|
|
77
|
+
"p",
|
|
78
|
+
{
|
|
79
|
+
className: clsx(
|
|
80
|
+
slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }),
|
|
81
|
+
textareaProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
82
|
+
),
|
|
83
|
+
children: helperMessage
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
errorMessage && /* @__PURE__ */ jsx("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage }),
|
|
87
|
+
textareaProps.maxLength !== void 0 && /* @__PURE__ */ jsxs(
|
|
88
|
+
"p",
|
|
89
|
+
{
|
|
90
|
+
className: clsx(
|
|
91
|
+
slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }),
|
|
92
|
+
textareaProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
93
|
+
),
|
|
94
|
+
children: [
|
|
95
|
+
length,
|
|
96
|
+
" / ",
|
|
97
|
+
textareaProps.maxLength
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
Textarea.displayName = "Textarea";
|
|
110
|
+
var textarea_default = Textarea;
|
|
111
|
+
var textareaStyle = tv({
|
|
112
|
+
slots: {
|
|
113
|
+
base: ["group/textarea", "flex", "select-none"],
|
|
114
|
+
vertical: ["flex-col"],
|
|
115
|
+
horizon: ["flex-row", "gap-0"],
|
|
116
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
117
|
+
wrapper: ["flex", "flex-col"],
|
|
118
|
+
textarea: [
|
|
119
|
+
"w-full",
|
|
120
|
+
"h-full",
|
|
121
|
+
"bg-transparent",
|
|
122
|
+
"text-neutral-main",
|
|
123
|
+
"placeholder:!text-neutral-main",
|
|
124
|
+
"outline-none",
|
|
125
|
+
"resize-none",
|
|
126
|
+
"focus:ring-0",
|
|
127
|
+
"group-has-[:hover]/textarea:!text-neutral-dark",
|
|
128
|
+
"group-has-[:hover]/textarea:placeholder:!text-neutral-dark",
|
|
129
|
+
"group-has-[:focus]/textarea:!text-neutral-dark",
|
|
130
|
+
"group-has-[:focus]/textarea:placeholder:!text-neutral-dark",
|
|
131
|
+
"group-has-[p.error]/textarea:bg-danger-soft",
|
|
132
|
+
"group-has-[p.error]/textarea:text-danger-main",
|
|
133
|
+
"group-has-[p.error]/textarea:placeholder:!text-danger-main"
|
|
134
|
+
],
|
|
135
|
+
helperMessage: [
|
|
136
|
+
"text-neutral-main",
|
|
137
|
+
"group-has-[:hover]/textarea:text-neutral-dark",
|
|
138
|
+
"group-has-[p.error]/textarea:text-danger-main"
|
|
139
|
+
],
|
|
140
|
+
errorMessage: ["text-danger-main"],
|
|
141
|
+
readonlyWrapper: [
|
|
142
|
+
"pointer-events-none",
|
|
143
|
+
"[&>textarea]:!text-body-foreground",
|
|
144
|
+
"[&>textarea]:placeholder:!text-body-foreground"
|
|
145
|
+
],
|
|
146
|
+
readonly: []
|
|
147
|
+
},
|
|
148
|
+
variants: {
|
|
149
|
+
variant: {
|
|
150
|
+
solid: {
|
|
151
|
+
textarea: ["border-transparent", "bg-trans-soft"],
|
|
152
|
+
readonlyWrapper: ["[&>textarea]:!bg-trans-light"]
|
|
153
|
+
},
|
|
154
|
+
outline: {
|
|
155
|
+
textarea: [
|
|
156
|
+
"border-neutral-light",
|
|
157
|
+
"group-has-[:hover]/textarea:bg-trans-soft",
|
|
158
|
+
"group-has-[:focus]/textarea:bg-body-background",
|
|
159
|
+
"group-has-[p.error]/textarea:border-danger-main"
|
|
160
|
+
],
|
|
161
|
+
readonlyWrapper: ["[&>textarea]:!bg-trans-soft"]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
color: {
|
|
165
|
+
primary: {
|
|
166
|
+
helperMessage: [
|
|
167
|
+
"group-has-[:focus]/textarea:!text-primary-main",
|
|
168
|
+
"group-has-[:focus]/textarea:!text-primary-main",
|
|
169
|
+
"group-has-[:focus]/textarea:hover:!text-primary-main",
|
|
170
|
+
"group-has-[:focus:hover]/textarea:!text-primary-main",
|
|
171
|
+
"group-has-[p.error]:not(textarea:focus):hover/textarea:!text-primary-main"
|
|
172
|
+
],
|
|
173
|
+
readonly: ["!text-primary-main"]
|
|
174
|
+
},
|
|
175
|
+
secondary: {
|
|
176
|
+
helperMessage: [
|
|
177
|
+
"group-has-[:focus]/textarea:text-secondary-main",
|
|
178
|
+
"group-has-[:focus]/textarea:text-secondary-main",
|
|
179
|
+
"group-has-[:focus]/textarea:hover:text-secondary-main",
|
|
180
|
+
"group-has-[:focus:hover]/textarea:text-secondary-main",
|
|
181
|
+
"group-has-[p.error]:not(textarea:focus):hover/textarea:!text-secondary-main"
|
|
182
|
+
],
|
|
183
|
+
readonly: ["!text-secondary-main"]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
size: {
|
|
187
|
+
sm: {
|
|
188
|
+
base: ["text-sm", "gap-[4px]"],
|
|
189
|
+
label: ["text-sm"],
|
|
190
|
+
wrapper: ["gap-[4px]"],
|
|
191
|
+
textarea: ["w-[240px]", "h-[24px]", "rounded-sm", "p-[8px]", "gap-[4px]"],
|
|
192
|
+
helperMessage: ["text-sm"],
|
|
193
|
+
errorMessage: ["text-sm"]
|
|
194
|
+
},
|
|
195
|
+
md: {
|
|
196
|
+
base: ["text-md", "gap-[6px]"],
|
|
197
|
+
label: ["text-md"],
|
|
198
|
+
wrapper: ["gap-[6px]"],
|
|
199
|
+
textarea: ["w-[240px]", "h-[32px]", "rounded-md", "p-[8px]", "gap-[6px]"],
|
|
200
|
+
helperMessage: ["text-sm"],
|
|
201
|
+
errorMessage: ["text-sm"]
|
|
202
|
+
},
|
|
203
|
+
lg: {
|
|
204
|
+
base: ["text-lg", "gap-[8px]"],
|
|
205
|
+
label: ["text-lg"],
|
|
206
|
+
wrapper: ["gap-[8px]"],
|
|
207
|
+
textarea: ["w-[240px]", "h-[40px]", "rounded-lg", "p-[10px]", "gap-[8px]"],
|
|
208
|
+
helperMessage: ["text-md"],
|
|
209
|
+
errorMessage: ["text-md"]
|
|
210
|
+
},
|
|
211
|
+
xl: {
|
|
212
|
+
base: ["text-xl", "gap-[10px]"],
|
|
213
|
+
label: ["text-xl"],
|
|
214
|
+
wrapper: ["gap-[10px]"],
|
|
215
|
+
textarea: ["w-[240px]", "h-[50px]", "rounded-lg", "p-[10px]", "gap-[10px]"],
|
|
216
|
+
helperMessage: ["text-md"],
|
|
217
|
+
errorMessage: ["text-md"]
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
direction: {
|
|
221
|
+
vertical: "",
|
|
222
|
+
horizon: ""
|
|
223
|
+
},
|
|
224
|
+
full: {
|
|
225
|
+
true: {
|
|
226
|
+
base: ["w-full"],
|
|
227
|
+
wrapper: ["flex-1"],
|
|
228
|
+
textarea: ["w-full"]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
disabled: {
|
|
232
|
+
true: {
|
|
233
|
+
textarea: [
|
|
234
|
+
"bg-neutral-soft",
|
|
235
|
+
"pointer-events-none",
|
|
236
|
+
"text-neutral-light",
|
|
237
|
+
"placeholder:!text-neutral-light",
|
|
238
|
+
"group-has-[p.error]/textarea:text-danger-light",
|
|
239
|
+
"group-has-[p.error]/textarea:border-danger-light",
|
|
240
|
+
"group-has-[p.error]/textarea:placeholder:!text-danger-light"
|
|
241
|
+
],
|
|
242
|
+
helperMessage: ["!text-neutral-light", "group-has-[p.error]/textarea:!text-danger-light"],
|
|
243
|
+
errorMessage: ["!text-danger-light"]
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
compoundVariants: [
|
|
248
|
+
{
|
|
249
|
+
variant: "outline",
|
|
250
|
+
size: "sm",
|
|
251
|
+
class: {
|
|
252
|
+
textarea: ["border-sm"]
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
variant: "outline",
|
|
257
|
+
size: "md",
|
|
258
|
+
class: {
|
|
259
|
+
textarea: ["border-md"]
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
variant: "outline",
|
|
264
|
+
size: "lg",
|
|
265
|
+
class: {
|
|
266
|
+
textarea: ["border-lg"]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
variant: "outline",
|
|
271
|
+
size: "xl",
|
|
272
|
+
class: {
|
|
273
|
+
textarea: ["border-xl"]
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
disabled: true,
|
|
278
|
+
variant: ["outline"],
|
|
279
|
+
class: {
|
|
280
|
+
textarea: ["!bg-body-background", "group-has-[p.error]/input:border-danger-light"]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
defaultVariants: {
|
|
285
|
+
variant: "solid",
|
|
286
|
+
color: "primary",
|
|
287
|
+
size: "md",
|
|
288
|
+
direction: "vertical",
|
|
289
|
+
fullWidth: false,
|
|
290
|
+
disabled: false,
|
|
291
|
+
readonly: false
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
export {
|
|
296
|
+
textarea_default
|
|
297
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
clsx
|
|
4
|
+
} from "./chunk-27Y6K5NK.mjs";
|
|
5
|
+
|
|
6
|
+
// src/components/skeleton/skeleton.tsx
|
|
7
|
+
import { tv } from "tailwind-variants";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Skeleton = ({ color = "primary", className, speed = "normal", rounded = "md" }) => {
|
|
10
|
+
const speedMap = {
|
|
11
|
+
fast: "0.7s",
|
|
12
|
+
normal: "1.2s",
|
|
13
|
+
slow: "2s"
|
|
14
|
+
};
|
|
15
|
+
const slots = skeletonStyle();
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: clsx(slots.base({ color, rounded }), className),
|
|
20
|
+
style: {
|
|
21
|
+
"--shimmer-duration": speedMap[speed]
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ jsx("style", { children: `@keyframes shimmer {
|
|
24
|
+
100% {
|
|
25
|
+
transform: translateX(100%);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.skeleton-shimmer::before {
|
|
29
|
+
animation: shimmer var(--shimmer-duration) infinite linear;
|
|
30
|
+
}
|
|
31
|
+
` })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
Skeleton.displayName = "Skeleton";
|
|
36
|
+
var skeleton_default = Skeleton;
|
|
37
|
+
var skeletonStyle = tv({
|
|
38
|
+
slots: {
|
|
39
|
+
base: [
|
|
40
|
+
"relative",
|
|
41
|
+
"overflow-hidden",
|
|
42
|
+
"w-full",
|
|
43
|
+
"h-[18px]",
|
|
44
|
+
"skeleton-shimmer",
|
|
45
|
+
"before:absolute",
|
|
46
|
+
"before:inset-0",
|
|
47
|
+
"before:-translate-x-full",
|
|
48
|
+
"before:bg-gradient-to-r",
|
|
49
|
+
"before:from-transparent",
|
|
50
|
+
"before:via-white/40",
|
|
51
|
+
"before:to-transparent",
|
|
52
|
+
"before:content-['']"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
variants: {
|
|
56
|
+
color: {
|
|
57
|
+
primary: { base: "bg-primary-soft" },
|
|
58
|
+
secondary: { base: "bg-secondary-soft" },
|
|
59
|
+
neutral: { base: "bg-neutral-soft" }
|
|
60
|
+
},
|
|
61
|
+
rounded: {
|
|
62
|
+
sm: { base: "rounded-sm" },
|
|
63
|
+
md: { base: "rounded-md" },
|
|
64
|
+
lg: { base: "rounded-lg" },
|
|
65
|
+
xl: { base: "rounded-xl" },
|
|
66
|
+
full: { base: "rounded-full" }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
color: "primary",
|
|
71
|
+
rounded: "md"
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
skeleton_default
|
|
77
|
+
};
|
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Icon_default
|
|
4
4
|
} from "./chunk-2TKEWFGH.mjs";
|
|
5
|
+
import {
|
|
6
|
+
tv
|
|
7
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
5
8
|
import {
|
|
6
9
|
clsx
|
|
7
10
|
} from "./chunk-27Y6K5NK.mjs";
|
|
8
11
|
import {
|
|
9
12
|
mapPropsVariants
|
|
10
13
|
} from "./chunk-E3G5QXSH.mjs";
|
|
11
|
-
import {
|
|
12
|
-
tv
|
|
13
|
-
} from "./chunk-4ZJFD3L3.mjs";
|
|
14
14
|
|
|
15
15
|
// src/components/input/input.tsx
|
|
16
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
forwardRef,
|
|
18
|
+
useRef,
|
|
19
|
+
useCallback,
|
|
20
|
+
useMemo,
|
|
21
|
+
isValidElement,
|
|
22
|
+
cloneElement
|
|
23
|
+
} from "react";
|
|
17
24
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
25
|
var Input = forwardRef((originalProps, ref) => {
|
|
19
26
|
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
@@ -22,19 +29,22 @@ var Input = forwardRef((originalProps, ref) => {
|
|
|
22
29
|
const slots = useMemo(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
23
30
|
const getContentProps = useCallback(
|
|
24
31
|
() => ({
|
|
25
|
-
className:
|
|
32
|
+
className: clsx(
|
|
33
|
+
slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
34
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
35
|
+
),
|
|
26
36
|
size: originalProps.size
|
|
27
37
|
}),
|
|
28
38
|
[slots, classNames, originalProps.size]
|
|
29
39
|
);
|
|
30
40
|
const renderStartContent = () => {
|
|
31
|
-
if (
|
|
41
|
+
if (isValidElement(startContent)) {
|
|
32
42
|
const existingProps = startContent.props;
|
|
33
43
|
const mergedProps = {
|
|
34
44
|
...getContentProps(),
|
|
35
45
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
36
46
|
};
|
|
37
|
-
return
|
|
47
|
+
return cloneElement(startContent, mergedProps);
|
|
38
48
|
} else {
|
|
39
49
|
const contentProps = getContentProps();
|
|
40
50
|
return /* @__PURE__ */ jsx("div", { ...contentProps, children: startContent });
|
|
@@ -53,13 +63,13 @@ var Input = forwardRef((originalProps, ref) => {
|
|
|
53
63
|
}
|
|
54
64
|
);
|
|
55
65
|
const renderContentWithIcon = () => {
|
|
56
|
-
if (
|
|
66
|
+
if (isValidElement(endContent)) {
|
|
57
67
|
const existingProps = endContent.props;
|
|
58
68
|
const mergedProps = {
|
|
59
69
|
...getContentProps(),
|
|
60
70
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
61
71
|
};
|
|
62
|
-
return
|
|
72
|
+
return cloneElement(endContent, mergedProps);
|
|
63
73
|
} else if (errorMessage) {
|
|
64
74
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
65
75
|
return /* @__PURE__ */ jsx("div", { ...iconProps, children: /* @__PURE__ */ jsx(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
@@ -94,20 +104,17 @@ var Input = forwardRef((originalProps, ref) => {
|
|
|
94
104
|
{
|
|
95
105
|
className: clsx(
|
|
96
106
|
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
97
|
-
inputProps.readOnly ? slots.
|
|
107
|
+
inputProps.readOnly ? slots.readonlyWrapper({ class: classNames == null ? void 0 : classNames.readonlyWrapper }) : ""
|
|
98
108
|
),
|
|
99
109
|
children: [
|
|
100
110
|
startContent && renderStartContent(),
|
|
101
111
|
/* @__PURE__ */ jsx(
|
|
102
112
|
"input",
|
|
103
113
|
{
|
|
104
|
-
...inputProps,
|
|
105
114
|
ref: ref || inputRef,
|
|
115
|
+
...inputProps,
|
|
106
116
|
readOnly: props.readOnly,
|
|
107
|
-
className: clsx(
|
|
108
|
-
slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
109
|
-
inputProps.readOnly ? "!text-body-foreground placeholder:!text-body-foreground" : ""
|
|
110
|
-
),
|
|
117
|
+
className: clsx(slots.input({ class: classNames == null ? void 0 : classNames.input })),
|
|
111
118
|
size: 0
|
|
112
119
|
}
|
|
113
120
|
),
|
|
@@ -115,7 +122,16 @@ var Input = forwardRef((originalProps, ref) => {
|
|
|
115
122
|
]
|
|
116
123
|
}
|
|
117
124
|
),
|
|
118
|
-
helperMessage && !errorMessage && /* @__PURE__ */ jsx(
|
|
125
|
+
helperMessage && !errorMessage && /* @__PURE__ */ jsx(
|
|
126
|
+
"p",
|
|
127
|
+
{
|
|
128
|
+
className: clsx(
|
|
129
|
+
slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }),
|
|
130
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
131
|
+
),
|
|
132
|
+
children: helperMessage
|
|
133
|
+
}
|
|
134
|
+
),
|
|
119
135
|
errorMessage && /* @__PURE__ */ jsx("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
120
136
|
] })
|
|
121
137
|
]
|
|
@@ -127,12 +143,12 @@ var input_default = Input;
|
|
|
127
143
|
var inputStyle = tv(
|
|
128
144
|
{
|
|
129
145
|
slots: {
|
|
130
|
-
base: ["group/input", "flex select-none"],
|
|
146
|
+
base: ["group/input", "flex", "select-none"],
|
|
131
147
|
vertical: ["flex-col"],
|
|
132
148
|
horizon: ["flex-row", "gap-0"],
|
|
133
149
|
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
134
150
|
innerWrapper: ["flex", "flex-col"],
|
|
135
|
-
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input
|
|
151
|
+
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input:!bg-danger-soft"],
|
|
136
152
|
input: [
|
|
137
153
|
"w-full",
|
|
138
154
|
"h-full",
|
|
@@ -141,8 +157,8 @@ var inputStyle = tv(
|
|
|
141
157
|
"placeholder:text-neutral-main",
|
|
142
158
|
"outline-none",
|
|
143
159
|
"focus:ring-0",
|
|
144
|
-
"group-has-[:hover]/input
|
|
145
|
-
"group-has-[:hover]/input:placeholder
|
|
160
|
+
"group-has-[:hover]/input:!text-neutral-dark",
|
|
161
|
+
"group-has-[:hover]/input:placeholder:!text-neutral-dark",
|
|
146
162
|
"group-has-[:focus]/input:text-neutral-dark",
|
|
147
163
|
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
148
164
|
"group-has-[p.error]/input:text-danger-main",
|
|
@@ -158,13 +174,22 @@ var inputStyle = tv(
|
|
|
158
174
|
],
|
|
159
175
|
helperMessage: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
160
176
|
errorMessage: ["text-danger-main"],
|
|
161
|
-
|
|
177
|
+
readonlyWrapper: [
|
|
178
|
+
"pointer-events-none",
|
|
179
|
+
"!text-body-foreground",
|
|
180
|
+
"placeholder:!text-body-foreground",
|
|
181
|
+
"group-has-[p.error]/input:!text-danger-main",
|
|
182
|
+
"group-has-[p.error]/input:placeholder:!text-danger-main",
|
|
183
|
+
"[&>input]:!text-body-foreground",
|
|
184
|
+
"[&>input]:placeholder:!text-body-foreground"
|
|
185
|
+
],
|
|
186
|
+
readonly: []
|
|
162
187
|
},
|
|
163
188
|
variants: {
|
|
164
189
|
variant: {
|
|
165
190
|
solid: {
|
|
166
191
|
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
167
|
-
|
|
192
|
+
readonlyWrapper: ["!bg-trans-light"]
|
|
168
193
|
},
|
|
169
194
|
outline: {
|
|
170
195
|
inputWrapper: [
|
|
@@ -173,7 +198,7 @@ var inputStyle = tv(
|
|
|
173
198
|
"group-has-[:focus]/input:bg-body-background",
|
|
174
199
|
"group-has-[p.error]/input:border-danger-main"
|
|
175
200
|
],
|
|
176
|
-
|
|
201
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
177
202
|
},
|
|
178
203
|
underline: {
|
|
179
204
|
inputWrapper: [
|
|
@@ -183,30 +208,31 @@ var inputStyle = tv(
|
|
|
183
208
|
"group-has-[:focus]/input:bg-body-background",
|
|
184
209
|
"group-has-[p.error]/input:border-danger-main"
|
|
185
210
|
],
|
|
186
|
-
|
|
211
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
187
212
|
}
|
|
188
213
|
},
|
|
189
214
|
color: {
|
|
190
215
|
primary: {
|
|
191
216
|
content: [
|
|
192
|
-
"group-has-[:focus]/input
|
|
193
|
-
"
|
|
217
|
+
"group-has-[:focus]/input:!text-primary-main",
|
|
218
|
+
"group-has-[p.error]:not(input:focus):hover/input:!text-primary-main"
|
|
194
219
|
],
|
|
195
220
|
helperMessage: [
|
|
196
|
-
"group-has-[:focus]/input
|
|
197
|
-
"group-has-[:focus:hover]/input
|
|
198
|
-
"group-has-[:focus]/input:hover
|
|
199
|
-
]
|
|
221
|
+
"group-has-[:focus]/input:!text-primary-main",
|
|
222
|
+
"group-has-[:focus:hover]/input:!text-primary-main",
|
|
223
|
+
"group-has-[:focus]/input:hover:!text-primary-main"
|
|
224
|
+
],
|
|
225
|
+
readonly: ["!text-primary-main"]
|
|
200
226
|
},
|
|
201
227
|
secondary: {
|
|
202
228
|
content: [
|
|
203
|
-
"group-has-[:focus]/input
|
|
204
|
-
"
|
|
229
|
+
"group-has-[:focus]/input:!text-secondary-main",
|
|
230
|
+
"group-has-[p.error]:not(input:focus):hover/input:!text-secondary-main"
|
|
205
231
|
],
|
|
206
232
|
helperMessage: [
|
|
207
|
-
"group-has-[:focus]/input
|
|
208
|
-
"group-has-[:focus:hover]/input
|
|
209
|
-
"group-has-[:focus]/input:hover
|
|
233
|
+
"group-has-[:focus]/input:!text-secondary-main",
|
|
234
|
+
"group-has-[:focus:hover]/input:!text-secondary-main",
|
|
235
|
+
"group-has-[:focus]/input:hover:!text-secondary-main"
|
|
210
236
|
]
|
|
211
237
|
}
|
|
212
238
|
},
|
|
@@ -257,14 +283,14 @@ var inputStyle = tv(
|
|
|
257
283
|
},
|
|
258
284
|
disabled: {
|
|
259
285
|
true: {
|
|
260
|
-
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "
|
|
286
|
+
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "group-has-[p.error]/input:!text-danger-light"],
|
|
261
287
|
input: [
|
|
262
|
-
"text-neutral-light",
|
|
263
|
-
"placeholder
|
|
264
|
-
"group-has-[p.error]/input
|
|
265
|
-
"group-has-[p.error]/input:placeholder
|
|
288
|
+
"!text-neutral-light",
|
|
289
|
+
"placeholder:!text-neutral-light",
|
|
290
|
+
"group-has-[p.error]/input:!text-danger-light",
|
|
291
|
+
"group-has-[p.error]/input:placeholder:!text-danger-light"
|
|
266
292
|
],
|
|
267
|
-
content: ["text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
293
|
+
content: ["!text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
268
294
|
helperMessage: ["!text-neutral-light"],
|
|
269
295
|
errorMessage: ["!text-danger-light"]
|
|
270
296
|
}
|
|
@@ -331,7 +357,11 @@ var inputStyle = tv(
|
|
|
331
357
|
disabled: true,
|
|
332
358
|
variant: ["outline", "underline"],
|
|
333
359
|
class: {
|
|
334
|
-
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input
|
|
360
|
+
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input:!border-danger-light"],
|
|
361
|
+
content: [
|
|
362
|
+
"group-has-[p.error]/input:!text-danger-light",
|
|
363
|
+
"group-has-[p.error]/input:placeholder:!text-danger-light"
|
|
364
|
+
]
|
|
335
365
|
}
|
|
336
366
|
}
|
|
337
367
|
],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
input_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AIIMJZ7L.mjs";
|
|
5
5
|
import {
|
|
6
6
|
button_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UB4YBFOT.mjs";
|
|
8
8
|
import {
|
|
9
9
|
icon_button_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7TAGGLNY.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/fileUpload/fileUpload.tsx
|
|
13
13
|
import { useRef, useState, useEffect } from "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
listItem_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RT3S3VVJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
list_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HIVPDIEP.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10
10
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
} from "./chunk-F3HENRVM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
input_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AIIMJZ7L.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Icon_default
|
|
10
10
|
} from "./chunk-2TKEWFGH.mjs";
|
|
11
|
+
import {
|
|
12
|
+
tv
|
|
13
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
11
14
|
import {
|
|
12
15
|
clsx
|
|
13
16
|
} from "./chunk-27Y6K5NK.mjs";
|
|
14
17
|
import {
|
|
15
18
|
mapPropsVariants
|
|
16
19
|
} from "./chunk-E3G5QXSH.mjs";
|
|
17
|
-
import {
|
|
18
|
-
tv
|
|
19
|
-
} from "./chunk-4ZJFD3L3.mjs";
|
|
20
20
|
|
|
21
21
|
// src/components/pagination/pagination.tsx
|
|
22
22
|
import { forwardRef, useMemo, useState } from "react";
|