@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.
package/dist/index.js CHANGED
@@ -5466,7 +5466,7 @@ var import_tailwind_variants8 = require("tailwind-variants");
5466
5466
  var import_jsx_runtime11 = require("react/jsx-runtime");
5467
5467
  var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
5468
5468
  const [props, variantProps] = mapPropsVariants(originalProps, table.variantKeys);
5469
- const { classNames, rows, columns, isLoading, className, emptyContent, onRowAction, ...tableComponentsProps } = props;
5469
+ const { classNames, rows, columns, className, emptyContent, loadingContent, onRowAction, ...tableComponentsProps } = props;
5470
5470
  const [checkedRows, setCheckedRows] = (0, import_react11.useState)(/* @__PURE__ */ new Set());
5471
5471
  const [selectedRows, setSelectedRows] = (0, import_react11.useState)(/* @__PURE__ */ new Set());
5472
5472
  (0, import_react11.useEffect)(() => {
@@ -5486,10 +5486,17 @@ var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
5486
5486
  const getTableProps = (0, import_react11.useCallback)(
5487
5487
  (props2) => ({
5488
5488
  ...props2,
5489
- className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table, className) })
5489
+ className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
5490
5490
  }),
5491
5491
  [classNames == null ? void 0 : classNames.table, slots]
5492
5492
  );
5493
+ const getLoadingWrapperProps = (0, import_react11.useCallback)(
5494
+ (props2) => ({
5495
+ ...props2,
5496
+ className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
5497
+ }),
5498
+ [classNames == null ? void 0 : classNames.loadingWrapper, slots]
5499
+ );
5493
5500
  const handleCheckAll = (isChecked) => {
5494
5501
  const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
5495
5502
  setCheckedRows(newCheckedRows);
@@ -5527,53 +5534,55 @@ var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
5527
5534
  setCheckedRows,
5528
5535
  setSelectedRows
5529
5536
  }));
5530
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, "data-table": "base", ...getBaseProps(), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
5531
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5532
- table_head_default,
5533
- {
5534
- classNames,
5535
- slots,
5536
- columns,
5537
- size: originalProps.size,
5538
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
5539
- isChecked: originalProps.isChecked,
5540
- isExpanded: originalProps.isExpanded,
5541
- onCheckAll: handleCheckAll,
5542
- isCheckedAll: checkedRows.size === rows.length
5543
- }
5544
- ),
5545
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5546
- table_body_default,
5547
- {
5548
- rows,
5549
- columns,
5550
- slots,
5551
- size: originalProps.size,
5552
- color: originalProps.color === "neutral" ? "primary" : originalProps.color,
5553
- isSelected: originalProps.isSelected,
5554
- isChecked: originalProps.isChecked,
5555
- isCheckedRow: originalProps.isCheckedRow,
5556
- isExpanded: originalProps.isExpanded,
5557
- isLoading,
5558
- classNames,
5559
- emptyContent,
5560
- selectedRows,
5561
- checkedRows,
5562
- onCheckedRow: handleCheckRow,
5563
- onSelectedRow: handleSelectRow,
5564
- onRowAction
5565
- }
5566
- )
5567
- ] }) });
5537
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { ref, "data-table": "base", ...getBaseProps(), children: [
5538
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("table", { ...getTableProps(tableComponentsProps), children: [
5539
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5540
+ table_head_default,
5541
+ {
5542
+ classNames,
5543
+ slots,
5544
+ columns,
5545
+ size: originalProps.size,
5546
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
5547
+ isChecked: originalProps.isChecked,
5548
+ isExpanded: originalProps.isExpanded,
5549
+ onCheckAll: handleCheckAll,
5550
+ isCheckedAll: checkedRows.size === rows.length
5551
+ }
5552
+ ),
5553
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5554
+ table_body_default,
5555
+ {
5556
+ rows,
5557
+ columns,
5558
+ slots,
5559
+ size: originalProps.size,
5560
+ color: originalProps.color === "neutral" ? "primary" : originalProps.color,
5561
+ isSelected: originalProps.isSelected,
5562
+ isChecked: originalProps.isChecked,
5563
+ isCheckedRow: originalProps.isCheckedRow,
5564
+ isExpanded: originalProps.isExpanded,
5565
+ classNames,
5566
+ emptyContent,
5567
+ selectedRows,
5568
+ checkedRows,
5569
+ onCheckedRow: handleCheckRow,
5570
+ onSelectedRow: handleSelectRow,
5571
+ onRowAction
5572
+ }
5573
+ )
5574
+ ] }),
5575
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
5576
+ ] });
5568
5577
  });
5569
5578
  Table.displayName = "Table";
5570
5579
  var table_default = Table;
5571
5580
  var table = (0, import_tailwind_variants8.tv)({
5572
5581
  slots: {
5573
- base: "flex flex-col relative gap-4",
5582
+ base: "flex flex-col relative gap-4 select-none",
5574
5583
  table: "w-full h-auto",
5575
5584
  thead: "[&>tr]:first:rounded-lg",
5576
- tbody: "w-full",
5585
+ tbody: "",
5577
5586
  tr: ["group", "outline-none", "w-full"],
5578
5587
  th: [
5579
5588
  "text-foreground",
@@ -5612,7 +5621,18 @@ var table = (0, import_tailwind_variants8.tv)({
5612
5621
  "data-[direction=ascending]:rotate-180"
5613
5622
  ],
5614
5623
  emptyWrapper: "text-neutral-light align-middle text-center h-40",
5615
- loadingWrapper: "absolute inset-0 flex items-center justify-center"
5624
+ loadingWrapper: [
5625
+ "absolute",
5626
+ "inset-0",
5627
+ "flex",
5628
+ "items-center",
5629
+ "justify-center",
5630
+ "bg-black/40",
5631
+ "text-white",
5632
+ "transition-opacity",
5633
+ "duration-200",
5634
+ "ease-in-out"
5635
+ ]
5616
5636
  },
5617
5637
  variants: {
5618
5638
  variant: {
@@ -5658,6 +5678,14 @@ var table = (0, import_tailwind_variants8.tv)({
5658
5678
  expandedTr: "border-trans-light"
5659
5679
  }
5660
5680
  },
5681
+ isLoading: {
5682
+ true: {
5683
+ loadingWrapper: "visible opacity-100"
5684
+ },
5685
+ false: {
5686
+ loadingWrapper: "invisible opacity-0"
5687
+ }
5688
+ },
5661
5689
  isSelected: {
5662
5690
  true: {}
5663
5691
  },
@@ -6791,7 +6819,7 @@ var Pagination = (0, import_react19.forwardRef)((originalProps, ref) => {
6791
6819
  currentPage,
6792
6820
  groupSize,
6793
6821
  totalPage,
6794
- showPageNumber,
6822
+ showPageNumber = true,
6795
6823
  showPageLabel,
6796
6824
  showFirstLastButtons,
6797
6825
  handleChangePage
@@ -6923,12 +6951,19 @@ var pagination = tv(
6923
6951
  secondary: {
6924
6952
  label: "text-secondary-main"
6925
6953
  }
6954
+ },
6955
+ isDisabled: {
6956
+ true: {
6957
+ icon: "!text-neutral-light !cursor-default",
6958
+ button: "!text-neutral-light !cursor-default"
6959
+ }
6926
6960
  }
6927
6961
  },
6928
6962
  defaultVariants: {
6929
6963
  variant: "solid",
6930
6964
  color: "primary",
6931
- size: "md"
6965
+ size: "md",
6966
+ isDisabled: false
6932
6967
  },
6933
6968
  compoundVariants: [
6934
6969
  {
package/dist/index.mjs CHANGED
@@ -1,18 +1,4 @@
1
1
  "use client";
2
- import "./chunk-HIE2YRGA.mjs";
3
- import {
4
- tooltip_default
5
- } from "./chunk-FY5YCQL5.mjs";
6
- import "./chunk-DSBSLSJW.mjs";
7
- import "./chunk-ODMRJXLJ.mjs";
8
- import "./chunk-3MY6LO7N.mjs";
9
- import {
10
- tabs_default
11
- } from "./chunk-KRI5IALM.mjs";
12
- import "./chunk-RRAZM5D3.mjs";
13
- import {
14
- textarea_default
15
- } from "./chunk-OJ2OEI5B.mjs";
16
2
  import "./chunk-LUWGOKLG.mjs";
17
3
  import {
18
4
  ToastProvider,
@@ -26,12 +12,26 @@ import "./chunk-LVFI2NOH.mjs";
26
12
  import {
27
13
  switch_default
28
14
  } from "./chunk-S3O52LLG.mjs";
15
+ import "./chunk-RRAZM5D3.mjs";
16
+ import {
17
+ textarea_default
18
+ } from "./chunk-OJ2OEI5B.mjs";
19
+ import "./chunk-HIE2YRGA.mjs";
20
+ import {
21
+ tooltip_default
22
+ } from "./chunk-FY5YCQL5.mjs";
23
+ import "./chunk-DSBSLSJW.mjs";
24
+ import "./chunk-ODMRJXLJ.mjs";
29
25
  import "./chunk-2UUH2MBF.mjs";
30
26
  import {
31
27
  table_default
32
- } from "./chunk-PNFR2J4Q.mjs";
28
+ } from "./chunk-YVBOTJAH.mjs";
33
29
  import "./chunk-QDDEQY63.mjs";
34
30
  import "./chunk-PO3ADNA5.mjs";
31
+ import "./chunk-3MY6LO7N.mjs";
32
+ import {
33
+ tabs_default
34
+ } from "./chunk-KRI5IALM.mjs";
35
35
  import "./chunk-QCEKPS7U.mjs";
36
36
  import {
37
37
  select_default
@@ -57,17 +57,17 @@ import {
57
57
  import "./chunk-7B7LRG5J.mjs";
58
58
  import {
59
59
  pagination_default
60
- } from "./chunk-B4KZBOGT.mjs";
60
+ } from "./chunk-UZL66GNP.mjs";
61
61
  import "./chunk-F3HENRVM.mjs";
62
62
  import "./chunk-2GCSFWHD.mjs";
63
63
  import {
64
64
  input_default
65
65
  } from "./chunk-ZNEEYSIK.mjs";
66
- import "./chunk-HAOK24MK.mjs";
67
66
  import "./chunk-QZ3LVYJW.mjs";
67
+ import "./chunk-HAOK24MK.mjs";
68
68
  import {
69
- checkbox_default
70
- } from "./chunk-ANYPMQH4.mjs";
69
+ card_default
70
+ } from "./chunk-2ALY3PH5.mjs";
71
71
  import "./chunk-75HLCORR.mjs";
72
72
  import {
73
73
  dateTimePicker_default
@@ -92,8 +92,8 @@ import {
92
92
  button_default
93
93
  } from "./chunk-UR64ZUAU.mjs";
94
94
  import {
95
- card_default
96
- } from "./chunk-2ALY3PH5.mjs";
95
+ checkbox_default
96
+ } from "./chunk-ANYPMQH4.mjs";
97
97
  import "./chunk-27Y6K5NK.mjs";
98
98
  import {
99
99
  accordion_default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/ui",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",