@deepnoid/ui 0.1.2 → 0.1.4
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 +146 -146
- package/dist/{chunk-TMSBICKB.mjs → chunk-J7IAY6UH.mjs} +1 -1
- package/dist/{chunk-DNFBQYVG.mjs → chunk-SSEQSF5F.mjs} +1 -1
- package/dist/chunk-TDJJRQDC.mjs +343 -0
- package/dist/{chunk-OELLMF2V.mjs → chunk-WPUTPWQ4.mjs} +1 -1
- package/dist/{chunk-VP3NVHFU.mjs → chunk-YCMZELLD.mjs} +1 -1
- package/dist/components/dateTimePicker/dateTimePicker.mjs +4 -4
- package/dist/components/dateTimePicker/index.mjs +4 -4
- package/dist/components/dateTimePicker/timePicker.mjs +3 -3
- package/dist/components/input/index.js +212 -154
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input/input.js +212 -154
- package/dist/components/input/input.mjs +1 -1
- package/dist/components/list/index.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/pagination/index.js +212 -154
- package/dist/components/pagination/index.mjs +2 -2
- package/dist/components/pagination/pagination.js +212 -154
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/table/index.js +212 -154
- package/dist/components/table/index.mjs +4 -4
- package/dist/components/table/table.js +212 -154
- package/dist/components/table/table.mjs +4 -4
- package/dist/index.js +212 -154
- package/dist/index.mjs +45 -45
- package/package.json +1 -1
- package/dist/chunk-OYNGJ33M.mjs +0 -285
- package/dist/{chunk-KWWYMTJP.mjs → chunk-AYWI2CRE.mjs} +3 -3
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Icon_default
|
|
4
|
+
} from "./chunk-24NQEB73.mjs";
|
|
5
|
+
import {
|
|
6
|
+
tv
|
|
7
|
+
} from "./chunk-2ZT6V4QR.mjs";
|
|
8
|
+
import {
|
|
9
|
+
clsx
|
|
10
|
+
} from "./chunk-27Y6K5NK.mjs";
|
|
11
|
+
import {
|
|
12
|
+
mapPropsVariants
|
|
13
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
14
|
+
|
|
15
|
+
// src/components/input/input.tsx
|
|
16
|
+
import React, { forwardRef, useRef, useCallback, useMemo } from "react";
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var Input = forwardRef((originalProps, ref) => {
|
|
19
|
+
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
20
|
+
const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
|
|
21
|
+
const inputRef = useRef(null);
|
|
22
|
+
const slots = useMemo(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
23
|
+
const getContentProps = useCallback(
|
|
24
|
+
() => ({
|
|
25
|
+
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
26
|
+
size: originalProps.size
|
|
27
|
+
}),
|
|
28
|
+
[slots, classNames, originalProps.size]
|
|
29
|
+
);
|
|
30
|
+
const renderStartContent = () => {
|
|
31
|
+
if (React.isValidElement(startContent)) {
|
|
32
|
+
const existingProps = startContent.props;
|
|
33
|
+
const mergedProps = {
|
|
34
|
+
...getContentProps(),
|
|
35
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
36
|
+
};
|
|
37
|
+
return React.cloneElement(startContent, mergedProps);
|
|
38
|
+
} else {
|
|
39
|
+
const contentProps = getContentProps();
|
|
40
|
+
return /* @__PURE__ */ jsx("div", { ...contentProps, children: startContent });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
...getContentProps(),
|
|
47
|
+
onClick: () => {
|
|
48
|
+
const target = ref && "current" in ref ? ref.current : inputRef.current;
|
|
49
|
+
target == null ? void 0 : target.focus();
|
|
50
|
+
target == null ? void 0 : target.showPicker();
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ jsx(Icon_default, { name: props.type === "time" ? "clock" : "calendar", size: originalProps.size, className: "cursor-pointer" })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
const renderContentWithIcon = () => {
|
|
56
|
+
if (React.isValidElement(endContent)) {
|
|
57
|
+
const existingProps = endContent.props;
|
|
58
|
+
const mergedProps = {
|
|
59
|
+
...getContentProps(),
|
|
60
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
61
|
+
};
|
|
62
|
+
return React.cloneElement(endContent, mergedProps);
|
|
63
|
+
} else if (errorText) {
|
|
64
|
+
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { ...iconProps, children: /* @__PURE__ */ jsx(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
66
|
+
} else {
|
|
67
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const renderEndContent = () => {
|
|
71
|
+
switch (props.type) {
|
|
72
|
+
case "date":
|
|
73
|
+
case "datetime-local":
|
|
74
|
+
case "month":
|
|
75
|
+
case "week":
|
|
76
|
+
case "time":
|
|
77
|
+
return renderDateTimePickerIcon();
|
|
78
|
+
default:
|
|
79
|
+
return renderContentWithIcon();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: clsx(
|
|
86
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
87
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
88
|
+
),
|
|
89
|
+
children: [
|
|
90
|
+
label && /* @__PURE__ */ jsx("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper }), children: [
|
|
92
|
+
/* @__PURE__ */ jsxs(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: clsx(
|
|
96
|
+
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
97
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
98
|
+
),
|
|
99
|
+
children: [
|
|
100
|
+
startContent && renderStartContent(),
|
|
101
|
+
/* @__PURE__ */ jsx("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
|
|
102
|
+
renderEndContent()
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
helperText && !errorText && /* @__PURE__ */ jsx("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
107
|
+
errorText && /* @__PURE__ */ jsx("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
Input.displayName = "Input";
|
|
114
|
+
var input_default = Input;
|
|
115
|
+
var inputStyle = tv(
|
|
116
|
+
{
|
|
117
|
+
slots: {
|
|
118
|
+
base: ["group/input", "flex"],
|
|
119
|
+
vertical: ["flex-col"],
|
|
120
|
+
horizon: ["flex-row", "gap-0"],
|
|
121
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
122
|
+
innerWrapper: ["flex", "flex-col"],
|
|
123
|
+
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[.error]/input:bg-danger-soft"],
|
|
124
|
+
input: [
|
|
125
|
+
"w-full",
|
|
126
|
+
"h-full",
|
|
127
|
+
"bg-transparent",
|
|
128
|
+
"text-neutral-main",
|
|
129
|
+
"placeholder:text-neutral-main",
|
|
130
|
+
"outline-none",
|
|
131
|
+
"focus:ring-0",
|
|
132
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
133
|
+
"group-has-[:hover]/input:placeholder:text-neutral-dark",
|
|
134
|
+
"group-has-[:focus]/input:text-neutral-dark",
|
|
135
|
+
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
136
|
+
"group-has-[.error]/input:text-danger-main",
|
|
137
|
+
"group-has-[.error]/input:placeholder:text-danger-main"
|
|
138
|
+
],
|
|
139
|
+
content: [
|
|
140
|
+
"flex",
|
|
141
|
+
"items-center",
|
|
142
|
+
"select-none",
|
|
143
|
+
"text-neutral-main",
|
|
144
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
145
|
+
"group-has-[.error]/input:text-danger-main"
|
|
146
|
+
],
|
|
147
|
+
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
148
|
+
errorText: ["text-danger-main"],
|
|
149
|
+
readonly: ["pointer-events-none"]
|
|
150
|
+
},
|
|
151
|
+
variants: {
|
|
152
|
+
variant: {
|
|
153
|
+
solid: {
|
|
154
|
+
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
155
|
+
readonly: ["!bg-trans-light"]
|
|
156
|
+
},
|
|
157
|
+
outline: {
|
|
158
|
+
inputWrapper: [
|
|
159
|
+
"border-neutral-light",
|
|
160
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
161
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
162
|
+
"group-has-[.error]/input:border-danger-main"
|
|
163
|
+
],
|
|
164
|
+
readonly: ["!bg-trans-soft"]
|
|
165
|
+
},
|
|
166
|
+
underline: {
|
|
167
|
+
inputWrapper: [
|
|
168
|
+
"bg-transparent",
|
|
169
|
+
"rounded-none",
|
|
170
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
171
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
172
|
+
"group-has-[.error]/input:border-danger-main"
|
|
173
|
+
],
|
|
174
|
+
readonly: ["!bg-trans-soft"]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
color: {
|
|
178
|
+
primary: {
|
|
179
|
+
content: [
|
|
180
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
181
|
+
"!group-has-[.error]:not(input:focus):hover/input:text-primary-main"
|
|
182
|
+
],
|
|
183
|
+
helperText: [
|
|
184
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
185
|
+
"group-has-[:focus:hover]/input:text-primary-main",
|
|
186
|
+
"group-has-[:focus]/input:hover:text-primary-main"
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
secondary: {
|
|
190
|
+
content: [
|
|
191
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
192
|
+
"group-has-[:focus:hover]/input:text-secondary-main"
|
|
193
|
+
],
|
|
194
|
+
helperText: [
|
|
195
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
196
|
+
"group-has-[:focus:hover]/input:text-secondary-main",
|
|
197
|
+
"group-has-[:focus]/input:hover:text-secondary-main"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
size: {
|
|
202
|
+
sm: {
|
|
203
|
+
base: ["text-sm", "gap-[4px]"],
|
|
204
|
+
label: ["text-sm"],
|
|
205
|
+
innerWrapper: ["gap-[4px]"],
|
|
206
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]", "gap-[4px]"],
|
|
207
|
+
helperText: ["text-sm"],
|
|
208
|
+
errorText: ["text-sm"]
|
|
209
|
+
},
|
|
210
|
+
md: {
|
|
211
|
+
base: ["text-md", "gap-[6px]"],
|
|
212
|
+
label: ["text-md"],
|
|
213
|
+
innerWrapper: ["gap-[6px]"],
|
|
214
|
+
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]", "gap-[6px]"],
|
|
215
|
+
helperText: ["text-sm"],
|
|
216
|
+
errorText: ["text-sm"]
|
|
217
|
+
},
|
|
218
|
+
lg: {
|
|
219
|
+
base: ["text-lg", "gap-[8px]"],
|
|
220
|
+
label: ["text-lg"],
|
|
221
|
+
innerWrapper: ["gap-[8px]"],
|
|
222
|
+
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]", "gap-[8px]"],
|
|
223
|
+
helperText: ["text-md"],
|
|
224
|
+
errorText: ["text-md"]
|
|
225
|
+
},
|
|
226
|
+
xl: {
|
|
227
|
+
base: ["text-xl", "gap-[10px]"],
|
|
228
|
+
label: ["text-xl"],
|
|
229
|
+
innerWrapper: ["gap-[10px]"],
|
|
230
|
+
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]", "gap-[10px]"],
|
|
231
|
+
helperText: ["text-md"],
|
|
232
|
+
errorText: ["text-md"]
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
direction: {
|
|
236
|
+
vertical: "",
|
|
237
|
+
horizon: ""
|
|
238
|
+
},
|
|
239
|
+
full: {
|
|
240
|
+
true: {
|
|
241
|
+
base: ["w-full"],
|
|
242
|
+
innerWrapper: ["flex-1"],
|
|
243
|
+
inputWrapper: ["w-full"]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
disabled: {
|
|
247
|
+
true: {
|
|
248
|
+
inputWrapper: ["bg-neutral-soft", "pointer-events-none", "group-has-[.error]/input:text-danger-light"],
|
|
249
|
+
input: [
|
|
250
|
+
"text-neutral-light",
|
|
251
|
+
"placeholder:text-neutral-light",
|
|
252
|
+
"group-has-[.error]/input:text-danger-light",
|
|
253
|
+
"group-has-[.error]/input:placeholder:text-danger-light"
|
|
254
|
+
],
|
|
255
|
+
content: ["text-neutral-light", "group-has-[.error]/input:text-danger-light"],
|
|
256
|
+
helperText: ["!text-neutral-light"],
|
|
257
|
+
errorText: ["!text-danger-light"]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
compoundVariants: [
|
|
262
|
+
{
|
|
263
|
+
variant: "outline",
|
|
264
|
+
size: "sm",
|
|
265
|
+
class: {
|
|
266
|
+
inputWrapper: ["border-sm"]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
variant: "outline",
|
|
271
|
+
size: "md",
|
|
272
|
+
class: {
|
|
273
|
+
inputWrapper: ["border-md"]
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
variant: "outline",
|
|
278
|
+
size: "lg",
|
|
279
|
+
class: {
|
|
280
|
+
inputWrapper: ["border-lg"]
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
variant: "outline",
|
|
285
|
+
size: "xl",
|
|
286
|
+
class: {
|
|
287
|
+
inputWrapper: ["border-xl"]
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
variant: "underline",
|
|
292
|
+
size: "sm",
|
|
293
|
+
class: {
|
|
294
|
+
inputWrapper: ["border-b-sm"]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
variant: "underline",
|
|
299
|
+
size: "md",
|
|
300
|
+
class: {
|
|
301
|
+
inputWrapper: ["border-b-md"]
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
variant: "underline",
|
|
306
|
+
size: "lg",
|
|
307
|
+
class: {
|
|
308
|
+
inputWrapper: ["border-b-lg"]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
variant: "underline",
|
|
313
|
+
size: "xl",
|
|
314
|
+
class: {
|
|
315
|
+
inputWrapper: ["border-b-xl"]
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
disabled: true,
|
|
320
|
+
variant: ["outline", "underline"],
|
|
321
|
+
class: {
|
|
322
|
+
inputWrapper: ["!bg-body-background", "group-has-[.error]/input:border-danger-light"]
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
defaultVariants: {
|
|
327
|
+
variant: "solid",
|
|
328
|
+
color: "primary",
|
|
329
|
+
size: "md",
|
|
330
|
+
direction: "vertical",
|
|
331
|
+
disabled: false,
|
|
332
|
+
readonly: false
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
twMerge: false
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
export {
|
|
341
|
+
input_default,
|
|
342
|
+
inputStyle
|
|
343
|
+
};
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
dateTimePickerStyle,
|
|
4
4
|
dateTimePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-SSEQSF5F.mjs";
|
|
6
|
+
import "../../chunk-YCMZELLD.mjs";
|
|
7
7
|
import "../../chunk-7MVEAQ7Z.mjs";
|
|
8
8
|
import "../../chunk-VVOOYDJS.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-AYWI2CRE.mjs";
|
|
10
10
|
import "../../chunk-FWJ2ZKH6.mjs";
|
|
11
11
|
import "../../chunk-HKXUNG3H.mjs";
|
|
12
12
|
import "../../chunk-P732YGHO.mjs";
|
|
13
|
+
import "../../chunk-CF6O6TCF.mjs";
|
|
13
14
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
14
15
|
import "../../chunk-24NQEB73.mjs";
|
|
15
|
-
import "../../chunk-CF6O6TCF.mjs";
|
|
16
16
|
import "../../chunk-P2TMIZRH.mjs";
|
|
17
17
|
import "../../chunk-2ZT6V4QR.mjs";
|
|
18
18
|
import "../../chunk-E3G5QXSH.mjs";
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import "../../chunk-75HLCORR.mjs";
|
|
3
3
|
import {
|
|
4
4
|
dateTimePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-SSEQSF5F.mjs";
|
|
6
|
+
import "../../chunk-YCMZELLD.mjs";
|
|
7
7
|
import "../../chunk-7MVEAQ7Z.mjs";
|
|
8
8
|
import "../../chunk-VVOOYDJS.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-AYWI2CRE.mjs";
|
|
10
10
|
import "../../chunk-FWJ2ZKH6.mjs";
|
|
11
11
|
import "../../chunk-HKXUNG3H.mjs";
|
|
12
12
|
import "../../chunk-P732YGHO.mjs";
|
|
13
|
+
import "../../chunk-CF6O6TCF.mjs";
|
|
13
14
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
14
15
|
import "../../chunk-24NQEB73.mjs";
|
|
15
|
-
import "../../chunk-CF6O6TCF.mjs";
|
|
16
16
|
import "../../chunk-P2TMIZRH.mjs";
|
|
17
17
|
import "../../chunk-2ZT6V4QR.mjs";
|
|
18
18
|
import "../../chunk-E3G5QXSH.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
timePicker_default
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-YCMZELLD.mjs";
|
|
5
5
|
import "../../chunk-7MVEAQ7Z.mjs";
|
|
6
6
|
import "../../chunk-VVOOYDJS.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-AYWI2CRE.mjs";
|
|
8
|
+
import "../../chunk-CF6O6TCF.mjs";
|
|
8
9
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
9
10
|
import "../../chunk-24NQEB73.mjs";
|
|
10
|
-
import "../../chunk-CF6O6TCF.mjs";
|
|
11
11
|
import "../../chunk-P2TMIZRH.mjs";
|
|
12
12
|
import "../../chunk-2ZT6V4QR.mjs";
|
|
13
13
|
import "../../chunk-E3G5QXSH.mjs";
|