@deepnoid/ui 0.1.0 → 0.1.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/.turbo/turbo-build.log +168 -168
- package/dist/{chunk-VWMXZUR2.mjs → chunk-2TJDQIKB.mjs} +1 -1
- package/dist/{chunk-IE2BRM7Z.mjs → chunk-2ZT6V4QR.mjs} +0 -9
- package/dist/{chunk-PKVQXVCS.mjs → chunk-56VCX2QR.mjs} +1 -1
- package/dist/{chunk-UAMIPCUD.mjs → chunk-AMA53H3C.mjs} +2 -2
- package/dist/{chunk-MW6Y3FSE.mjs → chunk-AYWI2CRE.mjs} +2 -2
- package/dist/{chunk-XAA5KY6A.mjs → chunk-CF6O6TCF.mjs} +1 -1
- package/dist/chunk-DUOYMLZL.mjs +283 -0
- package/dist/{chunk-QNA2GDTN.mjs → chunk-GLBASISV.mjs} +1 -1
- package/dist/{chunk-QJHZJRSQ.mjs → chunk-HKXUNG3H.mjs} +1 -1
- package/dist/{chunk-XTGRSVYO.mjs → chunk-J5WJD6XZ.mjs} +1 -1
- package/dist/chunk-M2IRRTFM.mjs +79 -0
- package/dist/{chunk-Q5WACGVP.mjs → chunk-N4F3R6HG.mjs} +1 -1
- package/dist/{chunk-WQBOPCH6.mjs → chunk-ON5SGXHZ.mjs} +1 -1
- package/dist/chunk-OQS4LGZK.mjs +27 -0
- package/dist/{chunk-KCYJYS66.mjs → chunk-RCU5MLBU.mjs} +1 -1
- package/dist/chunk-RT5NKQX4.mjs +285 -0
- package/dist/{chunk-X2MQCISM.mjs → chunk-S65S7QZ5.mjs} +1 -1
- package/dist/chunk-SPX2BHO2.mjs +314 -0
- package/dist/{chunk-3AMZ55Y6.mjs → chunk-SSEQSF5F.mjs} +3 -3
- package/dist/{chunk-RRL6KBU4.mjs → chunk-U2YKMXVG.mjs} +1 -1
- package/dist/{chunk-VBFXKJTI.mjs → chunk-VRGHUYRU.mjs} +2 -2
- package/dist/{chunk-5S4XGPBB.mjs → chunk-VVOOYDJS.mjs} +1 -1
- package/dist/{chunk-FYJZ7Q5L.mjs → chunk-XIHAABHB.mjs} +1 -1
- package/dist/{chunk-CATOSBI7.mjs → chunk-YCMZELLD.mjs} +2 -2
- package/dist/{chunk-2HSK6XGZ.mjs → chunk-YZNQ2QGK.mjs} +1 -1
- package/dist/{chunk-P5WT7WJO.mjs → chunk-ZEZ6ZA3N.mjs} +1 -1
- package/dist/components/avatar/avatar.js +0 -9
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +0 -9
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/backdrop/backdrop.js +0 -9
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.js +0 -9
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +0 -9
- package/dist/components/breadcrumb/breadcrumb.mjs +2 -2
- package/dist/components/breadcrumb/index.js +0 -9
- package/dist/components/breadcrumb/index.mjs +2 -2
- package/dist/components/button/button-group.js +0 -9
- package/dist/components/button/button-group.mjs +2 -2
- package/dist/components/button/button.js +0 -9
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/index.js +0 -9
- package/dist/components/button/index.mjs +3 -3
- package/dist/components/checkbox/checkbox.js +0 -9
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.js +0 -9
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.js +0 -9
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.js +0 -9
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.js +0 -9
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.js +0 -9
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +0 -9
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +0 -9
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/input/index.d.mts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js +429 -379
- package/dist/components/input/index.mjs +3 -2
- package/dist/components/input/input.d.mts +96 -81
- package/dist/components/input/input.d.ts +96 -81
- package/dist/components/input/input.js +429 -379
- package/dist/components/input/input.mjs +3 -2
- package/dist/components/list/index.js +0 -9
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/list.js +0 -9
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +0 -9
- package/dist/components/list/listItem.mjs +3 -3
- package/dist/components/modal/index.js +0 -9
- package/dist/components/modal/index.mjs +4 -4
- package/dist/components/modal/modal.js +0 -9
- package/dist/components/modal/modal.mjs +4 -4
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +320 -292
- package/dist/components/pagination/index.mjs +5 -4
- package/dist/components/pagination/pagination.d.mts +39 -95
- package/dist/components/pagination/pagination.d.ts +39 -95
- package/dist/components/pagination/pagination.js +322 -296
- package/dist/components/pagination/pagination.mjs +7 -8
- package/dist/components/radio/index.js +0 -9
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.js +0 -9
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.js +0 -9
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/option.js +0 -9
- package/dist/components/select/option.mjs +2 -2
- package/dist/components/select/select.js +0 -9
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/index.js +1193 -775
- package/dist/components/table/index.mjs +10 -5
- package/dist/components/table/table-body.d.mts +10 -16
- package/dist/components/table/table-body.d.ts +10 -16
- package/dist/components/table/table-body.js +54 -3792
- package/dist/components/table/table-body.mjs +3 -6
- package/dist/components/table/table-head.d.mts +4 -6
- package/dist/components/table/table-head.d.ts +4 -6
- package/dist/components/table/table-head.js +6 -44
- package/dist/components/table/table-head.mjs +3 -3
- package/dist/components/table/table.d.mts +91 -231
- package/dist/components/table/table.d.ts +91 -231
- package/dist/components/table/table.js +1193 -775
- package/dist/components/table/table.mjs +10 -5
- package/dist/components/tabs/index.js +0 -9
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.js +0 -9
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.js +0 -9
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.js +0 -9
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.js +0 -9
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.js +0 -9
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.js +0 -9
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/index.js +822 -958
- package/dist/index.mjs +46 -46
- package/dist/utils/tailwind-variants.js +0 -9
- package/dist/utils/tailwind-variants.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-5IQKKLZY.mjs +0 -139
- package/dist/chunk-PFYYYUJW.mjs +0 -56
- package/dist/chunk-RQ76IOYC.mjs +0 -300
- package/dist/chunk-SK2A72R2.mjs +0 -263
- package/dist/chunk-YGOEKSNZ.mjs +0 -345
|
@@ -0,0 +1,285 @@
|
|
|
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 === "vertical" ? slots.vertical({ class: classNames == null ? void 0 : classNames.vertical }) : slots.horizon({ class: classNames == null ? void 0 : classNames.horizon })
|
|
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
|
+
slots: {
|
|
117
|
+
base: ["group/input", "flex"],
|
|
118
|
+
vertical: ["flex-col"],
|
|
119
|
+
horizon: ["flex-row", "gap-0"],
|
|
120
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "w-[80px]"],
|
|
121
|
+
innerWrapper: ["flex", "flex-col"],
|
|
122
|
+
inputWrapper: ["flex", "items-center", "transition", "duration-200", "group-has-[p.error]/input:bg-danger-soft"],
|
|
123
|
+
input: [
|
|
124
|
+
"w-full",
|
|
125
|
+
"h-full",
|
|
126
|
+
"bg-transparent",
|
|
127
|
+
"text-neutral-main",
|
|
128
|
+
"placeholder:text-neutral-main",
|
|
129
|
+
"focus:outline-none",
|
|
130
|
+
"focus:ring-0",
|
|
131
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
132
|
+
"group-has-[:hover]/input:placeholder:text-neutral-dark",
|
|
133
|
+
"group-has-[:focus]/input:text-neutral-dark",
|
|
134
|
+
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
135
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
136
|
+
"group-has-[p.error]/input:placeholder:text-danger-main"
|
|
137
|
+
],
|
|
138
|
+
content: [
|
|
139
|
+
"flex",
|
|
140
|
+
"items-center",
|
|
141
|
+
"select-none",
|
|
142
|
+
"text-neutral-main",
|
|
143
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
144
|
+
"group-has-[p.error]/input:text-danger-main"
|
|
145
|
+
],
|
|
146
|
+
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
147
|
+
errorText: ["text-danger-main"],
|
|
148
|
+
readonly: ["pointer-events-none"]
|
|
149
|
+
},
|
|
150
|
+
variants: {
|
|
151
|
+
variant: {
|
|
152
|
+
solid: {
|
|
153
|
+
inputWrapper: ["!border-transparent", "bg-trans-soft", "group-has-[:focus]/input:text-body-foreground"],
|
|
154
|
+
readonly: ["!bg-trans-light"]
|
|
155
|
+
},
|
|
156
|
+
outline: {
|
|
157
|
+
inputWrapper: [
|
|
158
|
+
"border-neutral-light",
|
|
159
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
160
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
161
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
162
|
+
],
|
|
163
|
+
readonly: ["!bg-trans-soft"]
|
|
164
|
+
},
|
|
165
|
+
underline: {
|
|
166
|
+
inputWrapper: [
|
|
167
|
+
"bg-transparent",
|
|
168
|
+
"!rounded-none",
|
|
169
|
+
"!border-t-transparent",
|
|
170
|
+
"!border-l-transparent",
|
|
171
|
+
"!border-r-transparent",
|
|
172
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
173
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
174
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
175
|
+
],
|
|
176
|
+
readonly: ["!bg-trans-soft"]
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
color: {
|
|
180
|
+
primary: {
|
|
181
|
+
content: [
|
|
182
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
183
|
+
"!group-has-[p.error]:not(input:focus):hover/input:text-primary-main"
|
|
184
|
+
],
|
|
185
|
+
helperText: [
|
|
186
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
187
|
+
"group-has-[:focus:hover]/input:text-primary-main",
|
|
188
|
+
"group-has-[:focus]/input:hover:text-primary-main"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
secondary: {
|
|
192
|
+
content: [
|
|
193
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
194
|
+
"!group-has-[p.error]:not(input:focus):hover/input:text-secondary-main"
|
|
195
|
+
],
|
|
196
|
+
helperText: [
|
|
197
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
198
|
+
"group-has-[:focus:hover]/input:text-secondary-main",
|
|
199
|
+
"group-has-[:focus]/input:hover:text-secondary-main"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
size: {
|
|
204
|
+
sm: {
|
|
205
|
+
base: ["text-sm", "gap-[4px]"],
|
|
206
|
+
label: ["text-sm"],
|
|
207
|
+
innerWrapper: ["gap-[4px]"],
|
|
208
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]", "border-sm"],
|
|
209
|
+
helperText: ["text-sm"],
|
|
210
|
+
errorText: ["text-sm"]
|
|
211
|
+
},
|
|
212
|
+
md: {
|
|
213
|
+
base: ["text-md", "gap-[6px]"],
|
|
214
|
+
label: ["text-md"],
|
|
215
|
+
innerWrapper: ["gap-[6px]"],
|
|
216
|
+
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]", "border-md"],
|
|
217
|
+
helperText: ["text-sm"],
|
|
218
|
+
errorText: ["text-sm"]
|
|
219
|
+
},
|
|
220
|
+
lg: {
|
|
221
|
+
base: ["text-lg", "gap-[8px]"],
|
|
222
|
+
label: ["text-lg"],
|
|
223
|
+
innerWrapper: ["gap-[8px]"],
|
|
224
|
+
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]", "border-lg"],
|
|
225
|
+
helperText: ["text-md"],
|
|
226
|
+
errorText: ["text-md"]
|
|
227
|
+
},
|
|
228
|
+
xl: {
|
|
229
|
+
base: ["text-xl", "gap-[10px]"],
|
|
230
|
+
label: ["text-xl"],
|
|
231
|
+
innerWrapper: ["gap-[10px]"],
|
|
232
|
+
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]", "border-xl"],
|
|
233
|
+
helperText: ["text-md"],
|
|
234
|
+
errorText: ["text-md"]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
direction: {
|
|
238
|
+
vertical: "",
|
|
239
|
+
horizon: ""
|
|
240
|
+
},
|
|
241
|
+
full: {
|
|
242
|
+
true: {
|
|
243
|
+
base: ["w-full"],
|
|
244
|
+
innerWrapper: ["flex-1"],
|
|
245
|
+
inputWrapper: ["w-full"]
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
disabled: {
|
|
249
|
+
true: {
|
|
250
|
+
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "!group-has-[p.error]/input:text-danger-light"],
|
|
251
|
+
input: [
|
|
252
|
+
"text-neutral-light",
|
|
253
|
+
"placeholder:text-neutral-light",
|
|
254
|
+
"group-has-[p.error]/input:text-danger-light",
|
|
255
|
+
"group-has-[p.error]/input:placeholder:text-danger-light"
|
|
256
|
+
],
|
|
257
|
+
content: ["text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
258
|
+
helperText: ["!text-neutral-light"],
|
|
259
|
+
errorText: ["!text-danger-light"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
compoundVariants: [
|
|
264
|
+
{
|
|
265
|
+
disabled: true,
|
|
266
|
+
variant: ["outline", "underline"],
|
|
267
|
+
class: {
|
|
268
|
+
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input:border-danger-light"]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
defaultVariants: {
|
|
273
|
+
variant: "solid",
|
|
274
|
+
color: "primary",
|
|
275
|
+
size: "md",
|
|
276
|
+
direction: "vertical",
|
|
277
|
+
disabled: false,
|
|
278
|
+
readonly: false
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
export {
|
|
283
|
+
input_default,
|
|
284
|
+
inputStyle
|
|
285
|
+
};
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
table_body_default
|
|
4
|
+
} from "./chunk-M2IRRTFM.mjs";
|
|
5
|
+
import {
|
|
6
|
+
table_head_default
|
|
7
|
+
} from "./chunk-OQS4LGZK.mjs";
|
|
8
|
+
import {
|
|
9
|
+
pagination_default
|
|
10
|
+
} from "./chunk-DUOYMLZL.mjs";
|
|
11
|
+
import {
|
|
12
|
+
mapPropsVariants
|
|
13
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
14
|
+
|
|
15
|
+
// src/components/table/table.tsx
|
|
16
|
+
import {
|
|
17
|
+
forwardRef,
|
|
18
|
+
useEffect,
|
|
19
|
+
useImperativeHandle,
|
|
20
|
+
useMemo,
|
|
21
|
+
useRef,
|
|
22
|
+
useState
|
|
23
|
+
} from "react";
|
|
24
|
+
import { tv } from "tailwind-variants";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
var Table = forwardRef((originalProps, ref) => {
|
|
27
|
+
const [props, variantProps] = mapPropsVariants(originalProps, tableStyle.variantKeys);
|
|
28
|
+
const {
|
|
29
|
+
classNames,
|
|
30
|
+
rows,
|
|
31
|
+
columns,
|
|
32
|
+
size,
|
|
33
|
+
selectableRows,
|
|
34
|
+
totalData,
|
|
35
|
+
pagination,
|
|
36
|
+
onPageChange,
|
|
37
|
+
emptyContent,
|
|
38
|
+
className,
|
|
39
|
+
color
|
|
40
|
+
} = { ...props, ...variantProps };
|
|
41
|
+
const [checkedRows, setCheckedRows] = useState(/* @__PURE__ */ new Set());
|
|
42
|
+
const divRef = useRef(null);
|
|
43
|
+
const { page, perPage } = pagination || { page: 1, perPage: 10 };
|
|
44
|
+
const showPagination = pagination && typeof totalData === "number";
|
|
45
|
+
useImperativeHandle(ref, () => ({
|
|
46
|
+
checkedRows,
|
|
47
|
+
setCheckedRows
|
|
48
|
+
}));
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
setCheckedRows(/* @__PURE__ */ new Set());
|
|
51
|
+
}, [rows]);
|
|
52
|
+
const handleCheckAll = (isChecked) => {
|
|
53
|
+
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
54
|
+
setCheckedRows(newCheckedRows);
|
|
55
|
+
};
|
|
56
|
+
const handleCheck = (rowIndex, isChecked) => {
|
|
57
|
+
const newChecked = new Set(checkedRows);
|
|
58
|
+
isChecked ? newChecked.add(rowIndex) : newChecked.delete(rowIndex);
|
|
59
|
+
setCheckedRows(newChecked);
|
|
60
|
+
};
|
|
61
|
+
const slots = useMemo(() => tableStyle(variantProps), [variantProps]);
|
|
62
|
+
return /* @__PURE__ */ jsxs("div", { ref: divRef, "data-table": "base", className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
63
|
+
/* @__PURE__ */ jsxs("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
table_head_default,
|
|
66
|
+
{
|
|
67
|
+
columns,
|
|
68
|
+
size,
|
|
69
|
+
selectableRows,
|
|
70
|
+
isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
|
|
71
|
+
onCheckAll: handleCheckAll,
|
|
72
|
+
classNames,
|
|
73
|
+
slots
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
table_body_default,
|
|
78
|
+
{
|
|
79
|
+
slots,
|
|
80
|
+
rows,
|
|
81
|
+
columns,
|
|
82
|
+
size,
|
|
83
|
+
selectableRows,
|
|
84
|
+
checkedRows,
|
|
85
|
+
onCheckRow: handleCheck,
|
|
86
|
+
emptyContent,
|
|
87
|
+
classNames
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
showPagination && /* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
92
|
+
pagination_default,
|
|
93
|
+
{
|
|
94
|
+
color,
|
|
95
|
+
currentPage: page,
|
|
96
|
+
totalPage: Math.ceil(totalData / perPage),
|
|
97
|
+
groupSize: 10,
|
|
98
|
+
handleChangePage: (currentPage) => onPageChange({ page: currentPage, perPage })
|
|
99
|
+
}
|
|
100
|
+
) })
|
|
101
|
+
] });
|
|
102
|
+
});
|
|
103
|
+
Table.displayName = "Table";
|
|
104
|
+
var table_default = Table;
|
|
105
|
+
var tableStyle = tv({
|
|
106
|
+
slots: {
|
|
107
|
+
base: ["flex", "flex-col", "relative", "select-none"],
|
|
108
|
+
table: ["w-full", "h-auto"],
|
|
109
|
+
thead: ["w-full"],
|
|
110
|
+
tbody: ["w-full"],
|
|
111
|
+
tr: ["group", "outline-none", "w-full", "h-full"],
|
|
112
|
+
th: [
|
|
113
|
+
"text-body-foreground",
|
|
114
|
+
"font-bold",
|
|
115
|
+
"whitespace-nowrap",
|
|
116
|
+
"outline-none",
|
|
117
|
+
"align-middle",
|
|
118
|
+
"px-[10px]",
|
|
119
|
+
"[&>div]:flex",
|
|
120
|
+
"[&>div]:gap-[10px]"
|
|
121
|
+
],
|
|
122
|
+
td: [
|
|
123
|
+
"relative",
|
|
124
|
+
"text-foreground",
|
|
125
|
+
"whitespace-normal",
|
|
126
|
+
"outline-none",
|
|
127
|
+
"[&>*]:z-1",
|
|
128
|
+
"[&>*]:relative",
|
|
129
|
+
"px-[10px]",
|
|
130
|
+
"gap-[10px]",
|
|
131
|
+
"transition duration-200",
|
|
132
|
+
"align-middle"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
variants: {
|
|
136
|
+
variant: {
|
|
137
|
+
solid: {
|
|
138
|
+
tbody: ["[&>tr]:border-b"]
|
|
139
|
+
},
|
|
140
|
+
outline: {
|
|
141
|
+
tbody: ["[&>td]:border"],
|
|
142
|
+
th: ["border"],
|
|
143
|
+
td: ["border"]
|
|
144
|
+
},
|
|
145
|
+
underline: {
|
|
146
|
+
tbody: ["[&>tr]:border-b"],
|
|
147
|
+
th: ["border-t-[2px]", "border-b"]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
size: {
|
|
151
|
+
sm: {
|
|
152
|
+
tr: ["text-sm"]
|
|
153
|
+
},
|
|
154
|
+
md: {
|
|
155
|
+
tr: ["text-md"]
|
|
156
|
+
},
|
|
157
|
+
lg: {
|
|
158
|
+
tr: ["text-lg"]
|
|
159
|
+
},
|
|
160
|
+
xl: {
|
|
161
|
+
tr: ["text-xl"]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
color: {
|
|
165
|
+
primary: {
|
|
166
|
+
tbody: ["[&>tr]:border-primary-light"]
|
|
167
|
+
},
|
|
168
|
+
secondary: {
|
|
169
|
+
tbody: ["[&>tr]:border-secondary-light"]
|
|
170
|
+
},
|
|
171
|
+
neutral: {
|
|
172
|
+
tbody: ["[&>tr]:border-neutral-light"]
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
height: {
|
|
176
|
+
narrow: {},
|
|
177
|
+
wide: {}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
compoundVariants: [
|
|
181
|
+
{
|
|
182
|
+
variant: "solid",
|
|
183
|
+
color: "primary",
|
|
184
|
+
class: {
|
|
185
|
+
th: ["bg-primary-soft"]
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
variant: "solid",
|
|
190
|
+
color: "secondary",
|
|
191
|
+
class: {
|
|
192
|
+
th: ["bg-secondary-soft"]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
variant: "solid",
|
|
197
|
+
color: "neutral",
|
|
198
|
+
class: {
|
|
199
|
+
th: ["bg-neutral-soft"]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
variant: "outline",
|
|
204
|
+
color: "primary",
|
|
205
|
+
class: {
|
|
206
|
+
th: ["bg-primary-soft", "border-primary-light"],
|
|
207
|
+
td: ["border-primary-light"]
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
variant: "outline",
|
|
212
|
+
color: "secondary",
|
|
213
|
+
class: {
|
|
214
|
+
th: ["bg-secondary-soft", "border-secondary-light"],
|
|
215
|
+
td: ["border-secondary-light"]
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
variant: "outline",
|
|
220
|
+
color: "neutral",
|
|
221
|
+
class: {
|
|
222
|
+
th: ["bg-neutral-soft", "border-neutral-light"],
|
|
223
|
+
td: ["border-neutral-light"]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
variant: "underline",
|
|
228
|
+
color: "primary",
|
|
229
|
+
class: {
|
|
230
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-primary-main"]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
variant: "underline",
|
|
235
|
+
color: "secondary",
|
|
236
|
+
class: {
|
|
237
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-secondary-main"]
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
variant: "underline",
|
|
242
|
+
color: "neutral",
|
|
243
|
+
class: {
|
|
244
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-neutral-main"]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
height: "narrow",
|
|
249
|
+
size: "sm",
|
|
250
|
+
class: {
|
|
251
|
+
tr: ["h-[30px]"]
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
height: "narrow",
|
|
256
|
+
size: "md",
|
|
257
|
+
class: {
|
|
258
|
+
tr: ["h-[40px]"]
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
height: "narrow",
|
|
263
|
+
size: "lg",
|
|
264
|
+
class: {
|
|
265
|
+
tr: ["h-[50px]"]
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
height: "narrow",
|
|
270
|
+
size: "xl",
|
|
271
|
+
class: {
|
|
272
|
+
tr: ["h-[60px]"]
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
height: "wide",
|
|
277
|
+
size: "sm",
|
|
278
|
+
class: {
|
|
279
|
+
tr: ["h-[40px]"]
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
height: "wide",
|
|
284
|
+
size: "md",
|
|
285
|
+
class: {
|
|
286
|
+
tr: ["h-[50px]"]
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
height: "wide",
|
|
291
|
+
size: "lg",
|
|
292
|
+
class: {
|
|
293
|
+
tr: ["h-[60px]"]
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
height: "wide",
|
|
298
|
+
size: "xl",
|
|
299
|
+
class: {
|
|
300
|
+
tr: ["h-[70px]"]
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
defaultVariants: {
|
|
305
|
+
variant: "solid",
|
|
306
|
+
size: "md",
|
|
307
|
+
color: "primary",
|
|
308
|
+
height: "narrow"
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
export {
|
|
313
|
+
table_default
|
|
314
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
timePicker_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YCMZELLD.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useDatePicker
|
|
7
7
|
} from "./chunk-FWJ2ZKH6.mjs";
|
|
8
8
|
import {
|
|
9
9
|
calendar_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HKXUNG3H.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Icon_default
|
|
13
13
|
} from "./chunk-24NQEB73.mjs";
|
|
14
14
|
import {
|
|
15
15
|
tv
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2ZT6V4QR.mjs";
|
|
17
17
|
import {
|
|
18
18
|
mapPropsVariants
|
|
19
19
|
} from "./chunk-E3G5QXSH.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
option_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YZNQ2QGK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useSelect
|
|
7
7
|
} from "./chunk-S3QS5B7F.mjs";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-24NQEB73.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2ZT6V4QR.mjs";
|
|
14
14
|
import {
|
|
15
15
|
mapPropsVariants
|
|
16
16
|
} from "./chunk-E3G5QXSH.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
list_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VVOOYDJS.mjs";
|
|
5
5
|
import {
|
|
6
6
|
listItem_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AYWI2CRE.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10
10
|
import { useState, useRef, useEffect } from "react";
|