@deepnoid/ui 0.0.98 → 0.0.100

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.
@@ -19,7 +19,7 @@ var Pagination = forwardRef((originalProps, ref) => {
19
19
  currentPage,
20
20
  groupSize,
21
21
  totalPage,
22
- showPageNumber,
22
+ showPageNumber = true,
23
23
  showPageLabel,
24
24
  showFirstLastButtons,
25
25
  handleChangePage
@@ -151,12 +151,19 @@ var pagination = tv(
151
151
  secondary: {
152
152
  label: "text-secondary-main"
153
153
  }
154
+ },
155
+ isDisabled: {
156
+ true: {
157
+ icon: "!text-neutral-light !cursor-default",
158
+ button: "!text-neutral-light !cursor-default"
159
+ }
154
160
  }
155
161
  },
156
162
  defaultVariants: {
157
163
  variant: "solid",
158
164
  color: "primary",
159
- size: "md"
165
+ size: "md",
166
+ isDisabled: false
160
167
  },
161
168
  compoundVariants: [
162
169
  {
@@ -18,7 +18,7 @@ import { tv } from "tailwind-variants";
18
18
  import { jsx, jsxs } from "react/jsx-runtime";
19
19
  var Table = forwardRef((originalProps, ref) => {
20
20
  const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
21
- const { classNames, rows, columns, isLoading, className, emptyContent, onRowAction, ...tableComponentsProps } = props;
21
+ const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
22
22
  const [checkedRows, setCheckedRows] = useState(/* @__PURE__ */ new Set());
23
23
  const [selectedRows, setSelectedRows] = useState(/* @__PURE__ */ new Set());
24
24
  useEffect(() => {
@@ -38,10 +38,17 @@ var Table = forwardRef((originalProps, ref) => {
38
38
  const getTableProps = useCallback(
39
39
  (props2) => ({
40
40
  ...props2,
41
- className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table, className) })
41
+ className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
42
42
  }),
43
43
  [classNames == null ? void 0 : classNames.table, slots]
44
44
  );
45
+ const getLoadingWrapperProps = useCallback(
46
+ (props2) => ({
47
+ ...props2,
48
+ className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
49
+ }),
50
+ [classNames == null ? void 0 : classNames.loadingWrapper, slots]
51
+ );
45
52
  const handleCheckAll = (isChecked) => {
46
53
  const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
47
54
  setCheckedRows(newCheckedRows);
@@ -79,53 +86,55 @@ var Table = forwardRef((originalProps, ref) => {
79
86
  setCheckedRows,
80
87
  setSelectedRows
81
88
  }));
82
- return /* @__PURE__ */ jsx("div", { ref, "data-table": "base", ...getBaseProps(), children: /* @__PURE__ */ jsxs("table", { ...getTableProps(tableComponentsProps), children: [
83
- /* @__PURE__ */ jsx(
84
- table_head_default,
85
- {
86
- classNames,
87
- slots,
88
- columns,
89
- size: originalProps.size,
90
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
91
- isChecked: originalProps.isChecked,
92
- isExpanded: originalProps.isExpanded,
93
- onCheckAll: handleCheckAll,
94
- isCheckedAll: checkedRows.size === rows.length
95
- }
96
- ),
97
- /* @__PURE__ */ jsx(
98
- table_body_default,
99
- {
100
- rows,
101
- columns,
102
- slots,
103
- size: originalProps.size,
104
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
105
- isSelected: originalProps.isSelected,
106
- isChecked: originalProps.isChecked,
107
- isCheckedRow: originalProps.isCheckedRow,
108
- isExpanded: originalProps.isExpanded,
109
- isLoading,
110
- classNames,
111
- emptyContent,
112
- selectedRows,
113
- checkedRows,
114
- onCheckedRow: handleCheckRow,
115
- onSelectedRow: handleSelectRow,
116
- onRowAction
117
- }
118
- )
119
- ] }) });
89
+ return /* @__PURE__ */ jsxs("div", { ref, "data-table": "base", ...getBaseProps(), children: [
90
+ /* @__PURE__ */ jsxs("table", { ...getTableProps(tableComponentsProps), children: [
91
+ /* @__PURE__ */ jsx(
92
+ table_head_default,
93
+ {
94
+ classNames,
95
+ slots,
96
+ columns,
97
+ size: originalProps.size,
98
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
99
+ isChecked: originalProps.isChecked,
100
+ isExpanded: originalProps.isExpanded,
101
+ onCheckAll: handleCheckAll,
102
+ isCheckedAll: checkedRows.size === rows.length
103
+ }
104
+ ),
105
+ /* @__PURE__ */ jsx(
106
+ table_body_default,
107
+ {
108
+ rows,
109
+ columns,
110
+ slots,
111
+ size: originalProps.size,
112
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
113
+ isSelected: originalProps.isSelected,
114
+ isChecked: originalProps.isChecked,
115
+ isCheckedRow: originalProps.isCheckedRow,
116
+ isExpanded: originalProps.isExpanded,
117
+ classNames,
118
+ emptyContent,
119
+ selectedRows,
120
+ checkedRows,
121
+ onCheckedRow: handleCheckRow,
122
+ onSelectedRow: handleSelectRow,
123
+ onRowAction
124
+ }
125
+ )
126
+ ] }),
127
+ /* @__PURE__ */ jsx("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
128
+ ] });
120
129
  });
121
130
  Table.displayName = "Table";
122
131
  var table_default = Table;
123
132
  var table = tv({
124
133
  slots: {
125
- base: "flex flex-col relative gap-4",
134
+ base: "flex flex-col relative gap-4 select-none",
126
135
  table: "w-full h-auto",
127
136
  thead: "[&>tr]:first:rounded-lg",
128
- tbody: "w-full",
137
+ tbody: "",
129
138
  tr: ["group", "outline-none", "w-full"],
130
139
  th: [
131
140
  "text-foreground",
@@ -164,7 +173,18 @@ var table = tv({
164
173
  "data-[direction=ascending]:rotate-180"
165
174
  ],
166
175
  emptyWrapper: "text-neutral-light align-middle text-center h-40",
167
- loadingWrapper: "absolute inset-0 flex items-center justify-center"
176
+ loadingWrapper: [
177
+ "absolute",
178
+ "inset-0",
179
+ "flex",
180
+ "items-center",
181
+ "justify-center",
182
+ "bg-black/40",
183
+ "text-white",
184
+ "transition-opacity",
185
+ "duration-200",
186
+ "ease-in-out"
187
+ ]
168
188
  },
169
189
  variants: {
170
190
  variant: {
@@ -210,6 +230,14 @@ var table = tv({
210
230
  expandedTr: "border-trans-light"
211
231
  }
212
232
  },
233
+ isLoading: {
234
+ true: {
235
+ loadingWrapper: "visible opacity-100"
236
+ },
237
+ false: {
238
+ loadingWrapper: "invisible opacity-0"
239
+ }
240
+ },
213
241
  isSelected: {
214
242
  true: {}
215
243
  },
@@ -101,7 +101,7 @@ var Pagination = (0, import_react2.forwardRef)((originalProps, ref) => {
101
101
  currentPage,
102
102
  groupSize,
103
103
  totalPage,
104
- showPageNumber,
104
+ showPageNumber = true,
105
105
  showPageLabel,
106
106
  showFirstLastButtons,
107
107
  handleChangePage
@@ -233,12 +233,19 @@ var pagination = tv(
233
233
  secondary: {
234
234
  label: "text-secondary-main"
235
235
  }
236
+ },
237
+ isDisabled: {
238
+ true: {
239
+ icon: "!text-neutral-light !cursor-default",
240
+ button: "!text-neutral-light !cursor-default"
241
+ }
236
242
  }
237
243
  },
238
244
  defaultVariants: {
239
245
  variant: "solid",
240
246
  color: "primary",
241
- size: "md"
247
+ size: "md",
248
+ isDisabled: false
242
249
  },
243
250
  compoundVariants: [
244
251
  {
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-7B7LRG5J.mjs";
3
3
  import {
4
4
  pagination_default
5
- } from "../../chunk-B4KZBOGT.mjs";
5
+ } from "../../chunk-UZL66GNP.mjs";
6
6
  import "../../chunk-F3HENRVM.mjs";
7
7
  import "../../chunk-E3G5QXSH.mjs";
8
8
  import "../../chunk-J725QONZ.mjs";
@@ -57,6 +57,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
57
57
  label: string;
58
58
  };
59
59
  };
60
+ isDisabled: {
61
+ true: {
62
+ icon: string;
63
+ button: string;
64
+ };
65
+ };
60
66
  }, {
61
67
  base: string;
62
68
  label: string;
@@ -125,6 +131,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
125
131
  label: string;
126
132
  };
127
133
  };
134
+ isDisabled: {
135
+ true: {
136
+ icon: string;
137
+ button: string;
138
+ };
139
+ };
128
140
  }, {
129
141
  base: string;
130
142
  label: string;
@@ -171,6 +183,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
171
183
  label: string;
172
184
  };
173
185
  };
186
+ isDisabled: {
187
+ true: {
188
+ icon: string;
189
+ button: string;
190
+ };
191
+ };
174
192
  }, {
175
193
  base: string;
176
194
  label: string;
@@ -57,6 +57,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
57
57
  label: string;
58
58
  };
59
59
  };
60
+ isDisabled: {
61
+ true: {
62
+ icon: string;
63
+ button: string;
64
+ };
65
+ };
60
66
  }, {
61
67
  base: string;
62
68
  label: string;
@@ -125,6 +131,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
125
131
  label: string;
126
132
  };
127
133
  };
134
+ isDisabled: {
135
+ true: {
136
+ icon: string;
137
+ button: string;
138
+ };
139
+ };
128
140
  }, {
129
141
  base: string;
130
142
  label: string;
@@ -171,6 +183,12 @@ declare const pagination: tailwind_variants.TVReturnType<{
171
183
  label: string;
172
184
  };
173
185
  };
186
+ isDisabled: {
187
+ true: {
188
+ icon: string;
189
+ button: string;
190
+ };
191
+ };
174
192
  }, {
175
193
  base: string;
176
194
  label: string;
@@ -101,7 +101,7 @@ var Pagination = (0, import_react2.forwardRef)((originalProps, ref) => {
101
101
  currentPage,
102
102
  groupSize,
103
103
  totalPage,
104
- showPageNumber,
104
+ showPageNumber = true,
105
105
  showPageLabel,
106
106
  showFirstLastButtons,
107
107
  handleChangePage
@@ -233,12 +233,19 @@ var pagination = tv(
233
233
  secondary: {
234
234
  label: "text-secondary-main"
235
235
  }
236
+ },
237
+ isDisabled: {
238
+ true: {
239
+ icon: "!text-neutral-light !cursor-default",
240
+ button: "!text-neutral-light !cursor-default"
241
+ }
236
242
  }
237
243
  },
238
244
  defaultVariants: {
239
245
  variant: "solid",
240
246
  color: "primary",
241
- size: "md"
247
+ size: "md",
248
+ isDisabled: false
242
249
  },
243
250
  compoundVariants: [
244
251
  {
@@ -3,7 +3,7 @@ import {
3
3
  Pagination,
4
4
  pagination,
5
5
  pagination_default
6
- } from "../../chunk-B4KZBOGT.mjs";
6
+ } from "../../chunk-UZL66GNP.mjs";
7
7
  import "../../chunk-F3HENRVM.mjs";
8
8
  import "../../chunk-E3G5QXSH.mjs";
9
9
  import "../../chunk-J725QONZ.mjs";
@@ -12946,7 +12946,7 @@ var Pagination = (0, import_react2.forwardRef)((originalProps, ref) => {
12946
12946
  currentPage,
12947
12947
  groupSize,
12948
12948
  totalPage,
12949
- showPageNumber,
12949
+ showPageNumber = true,
12950
12950
  showPageLabel,
12951
12951
  showFirstLastButtons,
12952
12952
  handleChangePage
@@ -13078,12 +13078,19 @@ var pagination = tv(
13078
13078
  secondary: {
13079
13079
  label: "text-secondary-main"
13080
13080
  }
13081
+ },
13082
+ isDisabled: {
13083
+ true: {
13084
+ icon: "!text-neutral-light !cursor-default",
13085
+ button: "!text-neutral-light !cursor-default"
13086
+ }
13081
13087
  }
13082
13088
  },
13083
13089
  defaultVariants: {
13084
13090
  variant: "solid",
13085
13091
  color: "primary",
13086
- size: "md"
13092
+ size: "md",
13093
+ isDisabled: false
13087
13094
  },
13088
13095
  compoundVariants: [
13089
13096
  {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  pagination_default
4
- } from "../../chunk-B4KZBOGT.mjs";
4
+ } from "../../chunk-UZL66GNP.mjs";
5
5
  import "../../chunk-F3HENRVM.mjs";
6
6
  import {
7
7
  render
@@ -4052,7 +4052,7 @@ var import_tailwind_variants3 = require("tailwind-variants");
4052
4052
  var import_jsx_runtime6 = require("react/jsx-runtime");
4053
4053
  var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
4054
4054
  const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
4055
- const { classNames, rows, columns, isLoading, className, emptyContent, onRowAction, ...tableComponentsProps } = props;
4055
+ const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
4056
4056
  const [checkedRows, setCheckedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
4057
4057
  const [selectedRows, setSelectedRows] = (0, import_react6.useState)(/* @__PURE__ */ new Set());
4058
4058
  (0, import_react6.useEffect)(() => {
@@ -4072,10 +4072,17 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
4072
4072
  const getTableProps = (0, import_react6.useCallback)(
4073
4073
  (props2) => ({
4074
4074
  ...props2,
4075
- className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table, className) })
4075
+ className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
4076
4076
  }),
4077
4077
  [classNames == null ? void 0 : classNames.table, slots]
4078
4078
  );
4079
+ const getLoadingWrapperProps = (0, import_react6.useCallback)(
4080
+ (props2) => ({
4081
+ ...props2,
4082
+ className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
4083
+ }),
4084
+ [classNames == null ? void 0 : classNames.loadingWrapper, slots]
4085
+ );
4079
4086
  const handleCheckAll = (isChecked) => {
4080
4087
  const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
4081
4088
  setCheckedRows(newCheckedRows);
@@ -4113,53 +4120,55 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
4113
4120
  setCheckedRows,
4114
4121
  setSelectedRows
4115
4122
  }));
4116
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref, "data-table": "base", ...getBaseProps(), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
4117
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4118
- table_head_default,
4119
- {
4120
- classNames,
4121
- slots,
4122
- columns,
4123
- size: originalProps.size,
4124
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
4125
- isChecked: originalProps.isChecked,
4126
- isExpanded: originalProps.isExpanded,
4127
- onCheckAll: handleCheckAll,
4128
- isCheckedAll: checkedRows.size === rows.length
4129
- }
4130
- ),
4131
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4132
- table_body_default,
4133
- {
4134
- rows,
4135
- columns,
4136
- slots,
4137
- size: originalProps.size,
4138
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
4139
- isSelected: originalProps.isSelected,
4140
- isChecked: originalProps.isChecked,
4141
- isCheckedRow: originalProps.isCheckedRow,
4142
- isExpanded: originalProps.isExpanded,
4143
- isLoading,
4144
- classNames,
4145
- emptyContent,
4146
- selectedRows,
4147
- checkedRows,
4148
- onCheckedRow: handleCheckRow,
4149
- onSelectedRow: handleSelectRow,
4150
- onRowAction
4151
- }
4152
- )
4153
- ] }) });
4123
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
4124
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
4125
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4126
+ table_head_default,
4127
+ {
4128
+ classNames,
4129
+ slots,
4130
+ columns,
4131
+ size: originalProps.size,
4132
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
4133
+ isChecked: originalProps.isChecked,
4134
+ isExpanded: originalProps.isExpanded,
4135
+ onCheckAll: handleCheckAll,
4136
+ isCheckedAll: checkedRows.size === rows.length
4137
+ }
4138
+ ),
4139
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4140
+ table_body_default,
4141
+ {
4142
+ rows,
4143
+ columns,
4144
+ slots,
4145
+ size: originalProps.size,
4146
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
4147
+ isSelected: originalProps.isSelected,
4148
+ isChecked: originalProps.isChecked,
4149
+ isCheckedRow: originalProps.isCheckedRow,
4150
+ isExpanded: originalProps.isExpanded,
4151
+ classNames,
4152
+ emptyContent,
4153
+ selectedRows,
4154
+ checkedRows,
4155
+ onCheckedRow: handleCheckRow,
4156
+ onSelectedRow: handleSelectRow,
4157
+ onRowAction
4158
+ }
4159
+ )
4160
+ ] }),
4161
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
4162
+ ] });
4154
4163
  });
4155
4164
  Table.displayName = "Table";
4156
4165
  var table_default = Table;
4157
4166
  var table = (0, import_tailwind_variants3.tv)({
4158
4167
  slots: {
4159
- base: "flex flex-col relative gap-4",
4168
+ base: "flex flex-col relative gap-4 select-none",
4160
4169
  table: "w-full h-auto",
4161
4170
  thead: "[&>tr]:first:rounded-lg",
4162
- tbody: "w-full",
4171
+ tbody: "",
4163
4172
  tr: ["group", "outline-none", "w-full"],
4164
4173
  th: [
4165
4174
  "text-foreground",
@@ -4198,7 +4207,18 @@ var table = (0, import_tailwind_variants3.tv)({
4198
4207
  "data-[direction=ascending]:rotate-180"
4199
4208
  ],
4200
4209
  emptyWrapper: "text-neutral-light align-middle text-center h-40",
4201
- loadingWrapper: "absolute inset-0 flex items-center justify-center"
4210
+ loadingWrapper: [
4211
+ "absolute",
4212
+ "inset-0",
4213
+ "flex",
4214
+ "items-center",
4215
+ "justify-center",
4216
+ "bg-black/40",
4217
+ "text-white",
4218
+ "transition-opacity",
4219
+ "duration-200",
4220
+ "ease-in-out"
4221
+ ]
4202
4222
  },
4203
4223
  variants: {
4204
4224
  variant: {
@@ -4244,6 +4264,14 @@ var table = (0, import_tailwind_variants3.tv)({
4244
4264
  expandedTr: "border-trans-light"
4245
4265
  }
4246
4266
  },
4267
+ isLoading: {
4268
+ true: {
4269
+ loadingWrapper: "visible opacity-100"
4270
+ },
4271
+ false: {
4272
+ loadingWrapper: "invisible opacity-0"
4273
+ }
4274
+ },
4247
4275
  isSelected: {
4248
4276
  true: {}
4249
4277
  },
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-2UUH2MBF.mjs";
3
3
  import {
4
4
  table_default
5
- } from "../../chunk-PNFR2J4Q.mjs";
5
+ } from "../../chunk-YVBOTJAH.mjs";
6
6
  import "../../chunk-QDDEQY63.mjs";
7
7
  import "../../chunk-PO3ADNA5.mjs";
8
8
  import "../../chunk-QZ3LVYJW.mjs";
@@ -12,7 +12,6 @@ type TableBodyProps = {
12
12
  slots: TableReturnType;
13
13
  rows: TableRow[];
14
14
  columns: TableColumn[];
15
- isLoading?: boolean;
16
15
  isExpanded?: boolean;
17
16
  isSelected?: boolean;
18
17
  isChecked?: boolean;
@@ -12,7 +12,6 @@ type TableBodyProps = {
12
12
  slots: TableReturnType;
13
13
  rows: TableRow[];
14
14
  columns: TableColumn[];
15
- isLoading?: boolean;
16
15
  isExpanded?: boolean;
17
16
  isSelected?: boolean;
18
17
  isChecked?: boolean;