@deepnoid/ui 0.1.20 → 0.1.22

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.
Files changed (56) hide show
  1. package/.turbo/turbo-build.log +162 -172
  2. package/dist/{chunk-LNYMVBV5.mjs → chunk-6OMHIMIA.mjs} +8 -6
  3. package/dist/{chunk-3DPVPTHL.mjs → chunk-EAK5DVWA.mjs} +2 -2
  4. package/dist/{chunk-3BKCODIL.mjs → chunk-ICZTNO4V.mjs} +3 -3
  5. package/dist/{chunk-EGHTZLZJ.mjs → chunk-IVK24VIL.mjs} +1 -1
  6. package/dist/chunk-MSAULFDB.mjs +348 -0
  7. package/dist/{chunk-JOCMCOEK.mjs → chunk-P5PJTJLY.mjs} +13 -2
  8. package/dist/{chunk-63WXGSTV.mjs → chunk-XRC5OUYQ.mjs} +23 -13
  9. package/dist/components/input/index.js +13 -2
  10. package/dist/components/input/index.mjs +1 -1
  11. package/dist/components/input/input.js +13 -2
  12. package/dist/components/input/input.mjs +1 -1
  13. package/dist/components/modal/index.mjs +1 -1
  14. package/dist/components/modal/modal.mjs +1 -1
  15. package/dist/components/pagination/index.js +13 -2
  16. package/dist/components/pagination/index.mjs +2 -2
  17. package/dist/components/pagination/pagination.js +13 -2
  18. package/dist/components/pagination/pagination.mjs +2 -2
  19. package/dist/components/select/index.d.mts +1 -1
  20. package/dist/components/select/index.d.ts +1 -1
  21. package/dist/components/select/index.js +301 -286
  22. package/dist/components/select/index.mjs +2 -3
  23. package/dist/components/select/select.d.mts +190 -177
  24. package/dist/components/select/select.d.ts +190 -177
  25. package/dist/components/select/select.js +301 -286
  26. package/dist/components/select/select.mjs +2 -3
  27. package/dist/components/table/form-table.js +3 -3
  28. package/dist/components/table/form-table.mjs +1 -1
  29. package/dist/components/table/index.js +46 -23
  30. package/dist/components/table/index.mjs +6 -6
  31. package/dist/components/table/table-body.d.mts +3 -2
  32. package/dist/components/table/table-body.d.ts +3 -2
  33. package/dist/components/table/table-body.js +23 -13
  34. package/dist/components/table/table-body.mjs +1 -1
  35. package/dist/components/table/table-head.d.mts +2 -2
  36. package/dist/components/table/table-head.d.ts +2 -2
  37. package/dist/components/table/table-head.js +2 -2
  38. package/dist/components/table/table-head.mjs +1 -1
  39. package/dist/components/table/table.d.mts +2 -1
  40. package/dist/components/table/table.d.ts +2 -1
  41. package/dist/components/table/table.js +43 -20
  42. package/dist/components/table/table.mjs +5 -5
  43. package/dist/index.js +493 -497
  44. package/dist/index.mjs +28 -30
  45. package/package.json +1 -1
  46. package/dist/chunk-BXXAMH3R.mjs +0 -255
  47. package/dist/chunk-OF3X4BXG.mjs +0 -76
  48. package/dist/chunk-S3QS5B7F.mjs +0 -61
  49. package/dist/components/select/option.d.mts +0 -17
  50. package/dist/components/select/option.d.ts +0 -17
  51. package/dist/components/select/option.js +0 -4359
  52. package/dist/components/select/option.mjs +0 -12
  53. package/dist/components/select/useSelect.d.mts +0 -31
  54. package/dist/components/select/useSelect.d.ts +0 -31
  55. package/dist/components/select/useSelect.js +0 -84
  56. package/dist/components/select/useSelect.mjs +0 -8
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  table_body_default
4
- } from "./chunk-63WXGSTV.mjs";
4
+ } from "./chunk-XRC5OUYQ.mjs";
5
5
  import {
6
6
  table_head_default
7
- } from "./chunk-3DPVPTHL.mjs";
7
+ } from "./chunk-EAK5DVWA.mjs";
8
8
  import {
9
9
  scrollArea_default
10
10
  } from "./chunk-M37VBNB3.mjs";
11
11
  import {
12
12
  pagination_default
13
- } from "./chunk-EGHTZLZJ.mjs";
13
+ } from "./chunk-IVK24VIL.mjs";
14
14
  import {
15
15
  clsx
16
16
  } from "./chunk-27Y6K5NK.mjs";
@@ -36,7 +36,8 @@ var Table = forwardRef((originalProps, ref) => {
36
36
  rows,
37
37
  columns,
38
38
  size,
39
- selectableRows,
39
+ rowCheckbox,
40
+ onRowClick,
40
41
  totalData,
41
42
  pagination,
42
43
  onPageChange,
@@ -73,7 +74,7 @@ var Table = forwardRef((originalProps, ref) => {
73
74
  {
74
75
  columns,
75
76
  size,
76
- selectableRows,
77
+ rowCheckbox,
77
78
  isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
78
79
  onCheckAll: handleCheckAll,
79
80
  classNames,
@@ -87,8 +88,9 @@ var Table = forwardRef((originalProps, ref) => {
87
88
  rows,
88
89
  columns,
89
90
  size,
90
- selectableRows,
91
+ rowCheckbox,
91
92
  checkedRows,
93
+ onRowClick,
92
94
  onCheckRow: handleCheck,
93
95
  emptyContent,
94
96
  isLoading,
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  // src/components/table/table-head.tsx
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
- var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, classNames, onCheckAll }) => {
11
+ var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
12
12
  const handleClickCheckAll = (e) => {
13
13
  e.preventDefault();
14
14
  onCheckAll(!isCheckedAll);
@@ -27,7 +27,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
27
27
  },
28
28
  `${column.field}${index}thead`
29
29
  ));
30
- const renderSelectAllCheckbox = () => selectableRows && /* @__PURE__ */ jsx("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: isCheckedAll }) }) });
30
+ const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ jsx("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: isCheckedAll }) }) });
31
31
  return /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
32
32
  renderColumnHeaders(),
33
33
  renderSelectAllCheckbox()
@@ -7,10 +7,10 @@ import {
7
7
  import { forwardRef, useMemo } from "react";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  var DEFAULT_COLUMN_CLASSES = [
10
- "w-[120px] h-[50px] px-[10px] font-bold text-md text-body-foreground border-r border-neutral-light",
11
- "px-[10px]"
10
+ "w-[120px] px-[10px] py-[9.5px] font-bold text-md text-body-foreground border-r border-neutral-light",
11
+ "px-[10px] py-[9.5px]"
12
12
  ];
13
- var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ jsx("tr", { className: "border-neutral-light border-b", children: columns.map((col, index) => {
13
+ var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ jsx("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
14
14
  var _a;
15
15
  return /* @__PURE__ */ jsx("td", { className: (_a = columnClasses[index]) != null ? _a : DEFAULT_COLUMN_CLASSES[index], children: col }, index);
16
16
  }) });
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-F3HENRVM.mjs";
5
5
  import {
6
6
  input_default
7
- } from "./chunk-JOCMCOEK.mjs";
7
+ } from "./chunk-P5PJTJLY.mjs";
8
8
  import {
9
9
  Icon_default
10
10
  } from "./chunk-HWL7TPUN.mjs";
@@ -0,0 +1,348 @@
1
+ "use client";
2
+ import {
3
+ Icon_default
4
+ } from "./chunk-HWL7TPUN.mjs";
5
+ import {
6
+ tv
7
+ } from "./chunk-4ZJFD3L3.mjs";
8
+ import {
9
+ clsx
10
+ } from "./chunk-27Y6K5NK.mjs";
11
+ import {
12
+ mapPropsVariants
13
+ } from "./chunk-E3G5QXSH.mjs";
14
+
15
+ // src/components/select/select.tsx
16
+ import { forwardRef, useMemo, useState, useRef, useEffect } from "react";
17
+ import { createPortal } from "react-dom";
18
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
+ var Select = forwardRef((originalProps, ref) => {
20
+ var _a;
21
+ const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
22
+ const {
23
+ label,
24
+ options,
25
+ helperText,
26
+ errorText,
27
+ classNames,
28
+ defaultSelectedOptions = [],
29
+ onChange,
30
+ multiple,
31
+ ...inputProps
32
+ } = props;
33
+ const slots = useMemo(() => select({ ...variantProps }), [variantProps]);
34
+ const [selectedOptions, setSelectedOptions] = useState(defaultSelectedOptions);
35
+ const [targetRect, setTargetRect] = useState(null);
36
+ const [optionWrapperHeight, setOptionWrapperHeight] = useState(0);
37
+ const [isVisible, setIsVisible] = useState(false);
38
+ const [isOpen, setIsOpen] = useState(false);
39
+ const selectWrapperRef = useRef(null);
40
+ const optionWrapperRef = useRef(null);
41
+ const handleToggleSelect = () => {
42
+ if (isOpen) {
43
+ setIsOpen(false);
44
+ setTimeout(() => setIsVisible(false), 150);
45
+ } else {
46
+ if (selectWrapperRef.current) {
47
+ const rect = selectWrapperRef.current.getBoundingClientRect();
48
+ setTargetRect(rect);
49
+ setIsVisible(true);
50
+ requestAnimationFrame(() => setIsOpen(true));
51
+ }
52
+ }
53
+ };
54
+ const calculatePositionWithScroll = (rect, height) => {
55
+ const scrollTop = window.scrollY;
56
+ const scrollLeft = window.scrollX;
57
+ const spaceBelow = window.innerHeight - (rect.y + rect.height + 4);
58
+ const spaceAbove = rect.y - 4;
59
+ const top = spaceBelow < height && spaceAbove > height ? rect.y - height - 4 : rect.y + rect.height + 4;
60
+ return {
61
+ top: top + scrollTop,
62
+ left: rect.x + scrollLeft
63
+ };
64
+ };
65
+ const handleChangeOption = (option) => {
66
+ let nextOptions;
67
+ if (multiple) {
68
+ const exists = selectedOptions.some((o) => o.key === option.key);
69
+ nextOptions = exists ? selectedOptions.filter((o) => o.key !== option.key) : [...selectedOptions, option];
70
+ } else {
71
+ nextOptions = [option];
72
+ setIsOpen(false);
73
+ setTimeout(() => setIsVisible(false), 150);
74
+ }
75
+ setSelectedOptions(nextOptions);
76
+ onChange == null ? void 0 : onChange(nextOptions);
77
+ };
78
+ useEffect(() => {
79
+ const handleClickOutside = (e) => {
80
+ var _a2;
81
+ if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
82
+ setIsOpen(false);
83
+ setTimeout(() => setIsVisible(false), 150);
84
+ }
85
+ };
86
+ window.addEventListener("mousedown", handleClickOutside);
87
+ return () => window.removeEventListener("mousedown", handleClickOutside);
88
+ }, []);
89
+ useEffect(() => {
90
+ if (optionWrapperRef.current) {
91
+ setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
92
+ }
93
+ }, [targetRect]);
94
+ const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
95
+ const displayValue = multiple ? selectedOptions.map((opt) => opt.value).join(", ") : ((_a = selectedOptions[0]) == null ? void 0 : _a.value) || "";
96
+ const Option = ({
97
+ option,
98
+ isSelected,
99
+ onClick
100
+ }) => {
101
+ const slot = select({ ...variantProps, isSelected });
102
+ return /* @__PURE__ */ jsxs("div", { title: option.value, onClick, className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })), children: [
103
+ option.value,
104
+ isSelected && /* @__PURE__ */ jsx(Icon_default, { name: "check", size: originalProps.size })
105
+ ] });
106
+ };
107
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
108
+ /* @__PURE__ */ jsxs(
109
+ "div",
110
+ {
111
+ className: clsx(
112
+ slots.base({ class: classNames == null ? void 0 : classNames.base }),
113
+ variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
114
+ ),
115
+ children: [
116
+ label && /* @__PURE__ */ jsx("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
117
+ /* @__PURE__ */ jsxs("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
118
+ /* @__PURE__ */ jsxs(
119
+ "div",
120
+ {
121
+ "data-expanded": isOpen,
122
+ className: clsx(
123
+ slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
124
+ inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
125
+ ),
126
+ ref: selectWrapperRef,
127
+ onClick: handleToggleSelect,
128
+ children: [
129
+ /* @__PURE__ */ jsx(
130
+ "input",
131
+ {
132
+ ...inputProps,
133
+ ref,
134
+ className: clsx(
135
+ slots.select({ class: classNames == null ? void 0 : classNames.select }),
136
+ inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
137
+ ),
138
+ value: displayValue,
139
+ readOnly: true,
140
+ size: 0
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsx(
144
+ Icon_default,
145
+ {
146
+ name: "brace-up",
147
+ size: originalProps.size,
148
+ className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
149
+ }
150
+ )
151
+ ]
152
+ }
153
+ ),
154
+ helperText && !errorText && /* @__PURE__ */ jsx("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
155
+ errorText && /* @__PURE__ */ jsx("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
156
+ ] })
157
+ ]
158
+ }
159
+ ),
160
+ isVisible && createPortal(
161
+ /* @__PURE__ */ jsx(
162
+ "div",
163
+ {
164
+ ref: optionWrapperRef,
165
+ className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
166
+ style: {
167
+ position: "absolute",
168
+ top: position == null ? void 0 : position.top,
169
+ left: position == null ? void 0 : position.left,
170
+ width: targetRect == null ? void 0 : targetRect.width,
171
+ zIndex: 1e3,
172
+ opacity: isOpen ? 1 : 0,
173
+ transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
174
+ transition: "opacity 150ms ease-out, transform 150ms ease-out"
175
+ },
176
+ children: options.map((option) => {
177
+ const isSelected = selectedOptions.some((o) => o.key === option.key);
178
+ return /* @__PURE__ */ jsx(
179
+ Option,
180
+ {
181
+ option,
182
+ isSelected,
183
+ onClick: () => handleChangeOption(option)
184
+ },
185
+ option.key
186
+ );
187
+ })
188
+ }
189
+ ),
190
+ document.body
191
+ )
192
+ ] });
193
+ });
194
+ Select.displayName = "Select";
195
+ var select_default = Select;
196
+ var select = tv({
197
+ slots: {
198
+ base: ["group/select", "flex"],
199
+ vertical: ["flex-col"],
200
+ horizon: ["flex-row", "gap-0"],
201
+ label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
202
+ wrapper: ["flex", "flex-col"],
203
+ selectWrapper: [
204
+ "flex",
205
+ "items-center",
206
+ "justify-between",
207
+ "border",
208
+ "cursor-pointer",
209
+ "text-neutral-main",
210
+ "hover:bg-trans-soft",
211
+ "group-has-[p.error]/select:border-danger-main",
212
+ "group-has-[p.error]/select:bg-danger-soft",
213
+ "group-has-[p.error]/select:text-danger-main",
214
+ "group-has-[p.error]/select:hover:bg-danger-soft"
215
+ ],
216
+ select: [
217
+ "bg-transparent",
218
+ "w-full",
219
+ "outline-none",
220
+ "placeholder:text-neutral-main",
221
+ "text-neutral-dark",
222
+ "group-has-[p.error]/select:text-danger-main",
223
+ "group-has-[p.error]/select:placeholder:text-danger-main"
224
+ ],
225
+ optionsWrapper: ["border", "rounded", "bg-white", "shadow", "overflow-auto"],
226
+ option: ["flex", "justify-between", "items-center", "cursor-pointer"],
227
+ helperText: ["text-neutral-main"],
228
+ errorText: ["text-danger-main"],
229
+ readonly: ["pointer-events-none", "!bg-trans-soft"]
230
+ },
231
+ variants: {
232
+ color: {
233
+ primary: {
234
+ selectWrapper: ["hover:text-primary-main"],
235
+ option: ["hover:bg-primary-soft", "hover:text-primary-main"]
236
+ },
237
+ secondary: {
238
+ selectWrapper: ["hover:text-secondary-main"],
239
+ select: ["text-secondary-main"],
240
+ option: ["hover:bg-secondary-soft", "hover:text-secondary-main"]
241
+ }
242
+ },
243
+ size: {
244
+ sm: {
245
+ base: ["text-sm", "gap-[4px]"],
246
+ label: ["text-sm"],
247
+ wrapper: ["gap-[4px]"],
248
+ selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
249
+ select: ["text-sm"],
250
+ option: ["px-[4px]", "py-[3px]", "text-sm"],
251
+ helperText: ["text-sm"],
252
+ errorText: ["text-sm"]
253
+ },
254
+ md: {
255
+ base: ["text-md", "gap-[6px]", "rounded-md"],
256
+ label: ["text-md"],
257
+ wrapper: ["gap-[6px]"],
258
+ selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
259
+ select: ["text-md"],
260
+ option: ["px-[6px]", "py-[5.5px]", "text-md"],
261
+ helperText: ["text-sm"],
262
+ errorText: ["text-sm"]
263
+ },
264
+ lg: {
265
+ base: ["text-lg", "gap-[8px]"],
266
+ label: ["text-lg"],
267
+ wrapper: ["gap-[8px]"],
268
+ selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
269
+ select: ["text-lg"],
270
+ option: ["px-[8px]", "py-[8px]", "text-lg"],
271
+ helperText: ["text-md"],
272
+ errorText: ["text-md"]
273
+ },
274
+ xl: {
275
+ base: ["text-xl", "gap-[10px]"],
276
+ label: ["text-xl"],
277
+ wrapper: ["gap-[10px]"],
278
+ selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
279
+ select: ["text-xl"],
280
+ option: ["px-[10px]", "py-[11.5px]"],
281
+ helperText: ["text-md"],
282
+ errorText: ["text-md"]
283
+ }
284
+ },
285
+ direction: {
286
+ vertical: "",
287
+ horizon: ""
288
+ },
289
+ full: {
290
+ true: {
291
+ base: ["w-full"],
292
+ wrapper: ["w-full"],
293
+ selectWrapper: ["w-full"]
294
+ }
295
+ },
296
+ disabled: {
297
+ true: {
298
+ base: ["pointer-events-none"],
299
+ selectWrapper: [
300
+ "bg-neutral-soft",
301
+ "border-neutral-light",
302
+ "group-has-[p.error]/select:text-danger-light",
303
+ "group-has-[p.error]/select:bg-danger-soft",
304
+ "group-has-[p.error]/select:border-danger-light"
305
+ ],
306
+ select: [
307
+ "text-neutral-light",
308
+ "placeholder:text-neutral-light",
309
+ "group-has-[p.error]/select:text-danger-light",
310
+ "group-has-[p.error]/select:placeholder:text-danger-light"
311
+ ],
312
+ helperText: ["!text-neutral-light"],
313
+ errorText: ["!text-danger-light"]
314
+ }
315
+ },
316
+ isSelected: {
317
+ true: "",
318
+ false: ""
319
+ }
320
+ },
321
+ compoundVariants: [
322
+ {
323
+ color: "primary",
324
+ isSelected: true,
325
+ class: {
326
+ option: "bg-primary-soft text-primary-main"
327
+ }
328
+ },
329
+ {
330
+ color: "secondary",
331
+ isSelected: true,
332
+ class: {
333
+ option: "bg-secondary-soft text-secondary-main"
334
+ }
335
+ }
336
+ ],
337
+ defaultVariants: {
338
+ color: "primary",
339
+ size: "md",
340
+ direction: "vertical",
341
+ disabled: false,
342
+ readonly: false
343
+ }
344
+ });
345
+
346
+ export {
347
+ select_default
348
+ };
@@ -98,7 +98,18 @@ var Input = forwardRef((originalProps, ref) => {
98
98
  ),
99
99
  children: [
100
100
  startContent && renderStartContent(),
101
- /* @__PURE__ */ jsx("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
101
+ /* @__PURE__ */ jsx(
102
+ "input",
103
+ {
104
+ ...inputProps,
105
+ ref: ref || inputRef,
106
+ className: clsx(
107
+ slots.input({ class: classNames == null ? void 0 : classNames.input }),
108
+ inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
109
+ ),
110
+ size: 0
111
+ }
112
+ ),
102
113
  renderEndContent()
103
114
  ]
104
115
  }
@@ -146,7 +157,7 @@ var inputStyle = tv(
146
157
  ],
147
158
  helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
148
159
  errorText: ["text-danger-main"],
149
- readonly: ["pointer-events-none"]
160
+ readonly: ["pointer-events-none", "!text-body-foreground"]
150
161
  },
151
162
  variants: {
152
163
  variant: {
@@ -15,9 +15,10 @@ var TableBody = ({
15
15
  columns,
16
16
  rows,
17
17
  size,
18
- selectableRows,
18
+ rowCheckbox,
19
19
  checkedRows,
20
20
  onCheckRow,
21
+ onRowClick,
21
22
  emptyContent,
22
23
  isLoading,
23
24
  classNames,
@@ -58,21 +59,30 @@ var TableBody = ({
58
59
  [classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
59
60
  );
60
61
  const hasRows = rows.length > 0;
61
- const colSpan = (columns.length || 1) + (selectableRows ? 1 : 0);
62
+ const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
62
63
  return /* @__PURE__ */ jsxs("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
63
64
  !isLoading && hasRows && rows.map((row, rowIndex) => {
64
65
  const isRowChecked = checkedRows.has(rowIndex);
65
- return /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "aria-checked": isRowChecked, children: [
66
- columns.map((column) => /* @__PURE__ */ createElement("td", { ...getCellProps(column, row), key: column.field })),
67
- selectableRows && /* @__PURE__ */ jsx("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
68
- checkbox_default,
69
- {
70
- size,
71
- checked: isRowChecked,
72
- onChange: (e) => onCheckRow(rowIndex, e.target.checked)
73
- }
74
- ) }) })
75
- ] }, rowIndex);
66
+ return /* @__PURE__ */ jsxs(
67
+ "tr",
68
+ {
69
+ className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
70
+ "aria-checked": isRowChecked,
71
+ onClick: () => onRowClick ? onRowClick(row) : void 0,
72
+ children: [
73
+ columns.map((column) => /* @__PURE__ */ createElement("td", { ...getCellProps(column, row), key: column.field })),
74
+ rowCheckbox && /* @__PURE__ */ jsx("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
75
+ checkbox_default,
76
+ {
77
+ size,
78
+ checked: isRowChecked,
79
+ onChange: (e) => onCheckRow(rowIndex, e.target.checked)
80
+ }
81
+ ) }) })
82
+ ]
83
+ },
84
+ rowIndex
85
+ );
76
86
  }),
77
87
  !isLoading && !hasRows && emptyContent && /* @__PURE__ */ jsx("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ jsx("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
78
88
  ] });
@@ -4441,7 +4441,18 @@ var Input = (0, import_react.forwardRef)((originalProps, ref) => {
4441
4441
  ),
4442
4442
  children: [
4443
4443
  startContent && renderStartContent(),
4444
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
4444
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4445
+ "input",
4446
+ {
4447
+ ...inputProps,
4448
+ ref: ref || inputRef,
4449
+ className: clsx(
4450
+ slots.input({ class: classNames == null ? void 0 : classNames.input }),
4451
+ inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
4452
+ ),
4453
+ size: 0
4454
+ }
4455
+ ),
4445
4456
  renderEndContent()
4446
4457
  ]
4447
4458
  }
@@ -4489,7 +4500,7 @@ var inputStyle = tv(
4489
4500
  ],
4490
4501
  helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
4491
4502
  errorText: ["text-danger-main"],
4492
- readonly: ["pointer-events-none"]
4503
+ readonly: ["pointer-events-none", "!text-body-foreground"]
4493
4504
  },
4494
4505
  variants: {
4495
4506
  variant: {
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-2GCSFWHD.mjs";
3
3
  import {
4
4
  input_default
5
- } from "../../chunk-JOCMCOEK.mjs";
5
+ } from "../../chunk-P5PJTJLY.mjs";
6
6
  import "../../chunk-ZYIIXWVY.mjs";
7
7
  import "../../chunk-HWL7TPUN.mjs";
8
8
  import "../../chunk-3IU2RPSM.mjs";
@@ -4440,7 +4440,18 @@ var Input = (0, import_react.forwardRef)((originalProps, ref) => {
4440
4440
  ),
4441
4441
  children: [
4442
4442
  startContent && renderStartContent(),
4443
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
4443
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4444
+ "input",
4445
+ {
4446
+ ...inputProps,
4447
+ ref: ref || inputRef,
4448
+ className: clsx(
4449
+ slots.input({ class: classNames == null ? void 0 : classNames.input }),
4450
+ inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
4451
+ ),
4452
+ size: 0
4453
+ }
4454
+ ),
4444
4455
  renderEndContent()
4445
4456
  ]
4446
4457
  }
@@ -4488,7 +4499,7 @@ var inputStyle = tv(
4488
4499
  ],
4489
4500
  helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
4490
4501
  errorText: ["text-danger-main"],
4491
- readonly: ["pointer-events-none"]
4502
+ readonly: ["pointer-events-none", "!text-body-foreground"]
4492
4503
  },
4493
4504
  variants: {
4494
4505
  variant: {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  inputStyle,
4
4
  input_default
5
- } from "../../chunk-JOCMCOEK.mjs";
5
+ } from "../../chunk-P5PJTJLY.mjs";
6
6
  import "../../chunk-ZYIIXWVY.mjs";
7
7
  import "../../chunk-HWL7TPUN.mjs";
8
8
  import "../../chunk-3IU2RPSM.mjs";
@@ -13,9 +13,9 @@ import "../../chunk-6PNKRBUT.mjs";
13
13
  import "../../chunk-ZYIIXWVY.mjs";
14
14
  import "../../chunk-HWL7TPUN.mjs";
15
15
  import "../../chunk-WFMFC7R6.mjs";
16
+ import "../../chunk-3IU2RPSM.mjs";
16
17
  import "../../chunk-SE5TU755.mjs";
17
18
  import "../../chunk-LL6F3WDX.mjs";
18
- import "../../chunk-3IU2RPSM.mjs";
19
19
  import "../../chunk-4ZJFD3L3.mjs";
20
20
  import "../../chunk-27Y6K5NK.mjs";
21
21
  import "../../chunk-E3G5QXSH.mjs";
@@ -12,9 +12,9 @@ import "../../chunk-6PNKRBUT.mjs";
12
12
  import "../../chunk-ZYIIXWVY.mjs";
13
13
  import "../../chunk-HWL7TPUN.mjs";
14
14
  import "../../chunk-WFMFC7R6.mjs";
15
+ import "../../chunk-3IU2RPSM.mjs";
15
16
  import "../../chunk-SE5TU755.mjs";
16
17
  import "../../chunk-LL6F3WDX.mjs";
17
- import "../../chunk-3IU2RPSM.mjs";
18
18
  import "../../chunk-4ZJFD3L3.mjs";
19
19
  import "../../chunk-27Y6K5NK.mjs";
20
20
  import "../../chunk-E3G5QXSH.mjs";
@@ -4469,7 +4469,18 @@ var Input = (0, import_react2.forwardRef)((originalProps, ref) => {
4469
4469
  ),
4470
4470
  children: [
4471
4471
  startContent && renderStartContent(),
4472
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
4472
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4473
+ "input",
4474
+ {
4475
+ ...inputProps,
4476
+ ref: ref || inputRef,
4477
+ className: clsx(
4478
+ slots.input({ class: classNames == null ? void 0 : classNames.input }),
4479
+ inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
4480
+ ),
4481
+ size: 0
4482
+ }
4483
+ ),
4473
4484
  renderEndContent()
4474
4485
  ]
4475
4486
  }
@@ -4517,7 +4528,7 @@ var inputStyle = tv(
4517
4528
  ],
4518
4529
  helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
4519
4530
  errorText: ["text-danger-main"],
4520
- readonly: ["pointer-events-none"]
4531
+ readonly: ["pointer-events-none", "!text-body-foreground"]
4521
4532
  },
4522
4533
  variants: {
4523
4534
  variant: {
@@ -2,10 +2,10 @@
2
2
  import "../../chunk-7B7LRG5J.mjs";
3
3
  import {
4
4
  pagination_default
5
- } from "../../chunk-EGHTZLZJ.mjs";
5
+ } from "../../chunk-IVK24VIL.mjs";
6
6
  import "../../chunk-F3HENRVM.mjs";
7
7
  import "../../chunk-2GCSFWHD.mjs";
8
- import "../../chunk-JOCMCOEK.mjs";
8
+ import "../../chunk-P5PJTJLY.mjs";
9
9
  import "../../chunk-ZYIIXWVY.mjs";
10
10
  import "../../chunk-HWL7TPUN.mjs";
11
11
  import "../../chunk-3IU2RPSM.mjs";