@deepnoid/ui 0.1.28 → 0.1.30

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 (79) hide show
  1. package/.turbo/turbo-build.log +181 -161
  2. package/dist/chunk-6PN3DGOE.mjs +77 -0
  3. package/dist/chunk-CEZQCD6Z.mjs +79 -0
  4. package/dist/{chunk-JV7VLO2L.mjs → chunk-GLMM253Q.mjs} +37 -27
  5. package/dist/{chunk-K7VUN5BS.mjs → chunk-IC25OKBJ.mjs} +1 -1
  6. package/dist/{chunk-NHVIKP4H.mjs → chunk-K7V4VE7R.mjs} +4 -4
  7. package/dist/chunk-MZ76AA76.mjs +1 -0
  8. package/dist/{chunk-4OSN2OE2.mjs → chunk-NFQMXW4Z.mjs} +25 -18
  9. package/dist/chunk-NKH3OF6I.mjs +132 -0
  10. package/dist/chunk-P7YYNA6L.mjs +67 -0
  11. package/dist/{chunk-SO7BGWM7.mjs → chunk-QM4ZSQYX.mjs} +1 -1
  12. package/dist/chunk-RLXOHILK.mjs +1 -0
  13. package/dist/{chunk-BEQ3KZGS.mjs → chunk-VCVQMPC7.mjs} +2 -1
  14. package/dist/components/breadcrumb/breadcrumb.mjs +3 -3
  15. package/dist/components/breadcrumb/index.mjs +3 -3
  16. package/dist/components/button/button.mjs +2 -2
  17. package/dist/components/button/icon-button.mjs +2 -2
  18. package/dist/components/button/index.mjs +3 -3
  19. package/dist/components/dateTimePicker/dateTimePicker.mjs +5 -5
  20. package/dist/components/dateTimePicker/index.mjs +5 -5
  21. package/dist/components/dateTimePicker/timePicker.mjs +2 -2
  22. package/dist/components/fileUpload/fileUpload.d.mts +92 -0
  23. package/dist/components/fileUpload/fileUpload.d.ts +92 -0
  24. package/dist/components/fileUpload/fileUpload.js +5648 -0
  25. package/dist/components/fileUpload/fileUpload.mjs +28 -0
  26. package/dist/components/fileUpload/index.d.mts +5 -0
  27. package/dist/components/fileUpload/index.d.ts +5 -0
  28. package/dist/components/fileUpload/index.js +5647 -0
  29. package/dist/components/fileUpload/index.mjs +25 -0
  30. package/dist/components/input/index.js +2 -1
  31. package/dist/components/input/index.mjs +1 -1
  32. package/dist/components/input/input.js +2 -1
  33. package/dist/components/input/input.mjs +1 -1
  34. package/dist/components/list/index.mjs +3 -3
  35. package/dist/components/modal/index.mjs +4 -4
  36. package/dist/components/modal/modal.mjs +4 -4
  37. package/dist/components/pagination/index.js +2 -1
  38. package/dist/components/pagination/index.mjs +2 -2
  39. package/dist/components/pagination/pagination.js +2 -1
  40. package/dist/components/pagination/pagination.mjs +2 -2
  41. package/dist/components/ripple/index.mjs +3 -3
  42. package/dist/components/skeleton/index.d.mts +2 -0
  43. package/dist/components/skeleton/index.d.ts +2 -0
  44. package/dist/components/skeleton/index.js +141 -0
  45. package/dist/components/skeleton/index.mjs +10 -0
  46. package/dist/components/skeleton/skeleton.d.mts +14 -0
  47. package/dist/components/skeleton/skeleton.d.ts +14 -0
  48. package/dist/components/skeleton/skeleton.js +135 -0
  49. package/dist/components/skeleton/skeleton.mjs +9 -0
  50. package/dist/components/table/index.js +694 -615
  51. package/dist/components/table/index.mjs +9 -7
  52. package/dist/components/table/table-body.d.mts +6 -4
  53. package/dist/components/table/table-body.d.ts +6 -4
  54. package/dist/components/table/table-body.js +115 -64
  55. package/dist/components/table/table-body.mjs +3 -1
  56. package/dist/components/table/table-head.d.mts +3 -1
  57. package/dist/components/table/table-head.d.ts +3 -1
  58. package/dist/components/table/table-head.js +107 -21
  59. package/dist/components/table/table-head.mjs +3 -1
  60. package/dist/components/table/table.d.mts +1 -0
  61. package/dist/components/table/table.d.ts +1 -0
  62. package/dist/components/table/table.js +685 -606
  63. package/dist/components/table/table.mjs +7 -5
  64. package/dist/components/tree/index.js +25 -18
  65. package/dist/components/tree/index.mjs +1 -1
  66. package/dist/components/tree/tree.d.mts +20 -13
  67. package/dist/components/tree/tree.d.ts +20 -13
  68. package/dist/components/tree/tree.js +25 -18
  69. package/dist/components/tree/tree.mjs +1 -1
  70. package/dist/index.d.mts +2 -0
  71. package/dist/index.d.ts +2 -0
  72. package/dist/index.js +607 -401
  73. package/dist/index.mjs +50 -40
  74. package/package.json +1 -1
  75. package/dist/chunk-UNH3BCGN.mjs +0 -47
  76. package/dist/chunk-XRC5OUYQ.mjs +0 -94
  77. package/dist/{chunk-QIEKOGY7.mjs → chunk-7TAGGLNY.mjs} +3 -3
  78. package/dist/{chunk-KYJTZPXY.mjs → chunk-BFOK4HVC.mjs} +3 -3
  79. package/dist/{chunk-JTZUXVOU.mjs → chunk-UB4YBFOT.mjs} +3 -3
@@ -1,16 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  table_default
4
- } from "../../chunk-JV7VLO2L.mjs";
5
- import "../../chunk-XRC5OUYQ.mjs";
6
- import "../../chunk-UNH3BCGN.mjs";
4
+ } from "../../chunk-GLMM253Q.mjs";
5
+ import "../../chunk-CEZQCD6Z.mjs";
6
+ import "../../chunk-P7YYNA6L.mjs";
7
7
  import "../../chunk-DQRAFUDA.mjs";
8
8
  import "../../chunk-M37VBNB3.mjs";
9
+ import "../../chunk-MZ76AA76.mjs";
10
+ import "../../chunk-6PN3DGOE.mjs";
9
11
  import "../../chunk-7B7LRG5J.mjs";
10
- import "../../chunk-SO7BGWM7.mjs";
12
+ import "../../chunk-QM4ZSQYX.mjs";
11
13
  import "../../chunk-F3HENRVM.mjs";
12
14
  import "../../chunk-2GCSFWHD.mjs";
13
- import "../../chunk-BEQ3KZGS.mjs";
15
+ import "../../chunk-VCVQMPC7.mjs";
14
16
  import "../../chunk-QZ3LVYJW.mjs";
15
17
  import "../../chunk-D6QI3DJG.mjs";
16
18
  import "../../chunk-ZYIIXWVY.mjs";
@@ -4350,7 +4350,7 @@ function toVal(mix) {
4350
4350
  // src/components/tree/tree.tsx
4351
4351
  var import_jsx_runtime3 = require("react/jsx-runtime");
4352
4352
  var TreeNodeItem = (0, import_react.forwardRef)(
4353
- ({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
4353
+ ({ node, depth, fileIcon, selectedId, isLoading, classNames, onExpand }, ref) => {
4354
4354
  const [isOpen, setIsOpen] = (0, import_react.useState)(false);
4355
4355
  const [children, setChildren] = (0, import_react.useState)(node.children);
4356
4356
  const [isLoadingChildren, setIsLoadingChildren] = (0, import_react.useState)(false);
@@ -4374,10 +4374,10 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4374
4374
  }
4375
4375
  setIsOpen((prev) => !prev);
4376
4376
  }, [isOpen, children, onExpand, node]);
4377
- const handleClick = () => {
4377
+ const handleClick = (e) => {
4378
4378
  var _a;
4379
4379
  toggleOpen();
4380
- (_a = node.onClick) == null ? void 0 : _a.call(node);
4380
+ (_a = node.onClick) == null ? void 0 : _a.call(node, e);
4381
4381
  };
4382
4382
  const handleRightClick = (e) => {
4383
4383
  var _a;
@@ -4398,7 +4398,11 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4398
4398
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4399
4399
  "div",
4400
4400
  {
4401
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4401
+ className: clsx(
4402
+ slots.node({ class: classNames == null ? void 0 : classNames.node }),
4403
+ slots.clickable({ class: classNames == null ? void 0 : classNames.clickable }),
4404
+ selectedId == node.id ? "bg-neutral-soft" : ""
4405
+ ),
4402
4406
  onClick: handleClick,
4403
4407
  onContextMenu: handleRightClick,
4404
4408
  children: [
@@ -4413,7 +4417,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4413
4417
  }
4414
4418
  ),
4415
4419
  fileIcon,
4416
- node.label
4420
+ node.content
4417
4421
  ]
4418
4422
  }
4419
4423
  ),
@@ -4424,6 +4428,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4424
4428
  {
4425
4429
  node: child,
4426
4430
  depth: depth + 1,
4431
+ selectedId,
4427
4432
  classNames,
4428
4433
  fileIcon,
4429
4434
  onExpand
@@ -4442,16 +4447,15 @@ var Tree = ({
4442
4447
  group,
4443
4448
  groupIcon,
4444
4449
  fileIcon,
4450
+ selectedId,
4445
4451
  isLoading = false,
4446
4452
  classNames,
4447
4453
  onExpand
4448
4454
  }) => {
4449
4455
  const slots = (0, import_react.useMemo)(() => treeStyle(), []);
4450
- const [isOpen, setIsOpen] = (0, import_react.useState)(true);
4451
- const handleToggle = () => {
4456
+ const handleClick = (e) => {
4452
4457
  var _a;
4453
- setIsOpen((prev) => !prev);
4454
- (_a = group.onClick) == null ? void 0 : _a.call(group);
4458
+ (_a = group.onClick) == null ? void 0 : _a.call(group, e);
4455
4459
  };
4456
4460
  const handleRightClick = (e) => {
4457
4461
  var _a;
@@ -4464,22 +4468,26 @@ var Tree = ({
4464
4468
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4465
4469
  "div",
4466
4470
  {
4467
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4468
- onClick: handleToggle,
4471
+ className: clsx(
4472
+ slots.node({ class: classNames == null ? void 0 : classNames.node }),
4473
+ group.onClick || group.onRightClick ? slots.clickable({ class: classNames == null ? void 0 : classNames.clickable }) : ""
4474
+ ),
4475
+ onClick: handleClick,
4469
4476
  onContextMenu: handleRightClick,
4470
4477
  children: [
4471
4478
  groupIcon,
4472
- group.label
4479
+ group.content
4473
4480
  ]
4474
4481
  }
4475
4482
  ),
4476
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4483
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4477
4484
  TreeNodeItem,
4478
4485
  {
4479
4486
  node,
4480
4487
  depth: 1,
4481
4488
  classNames,
4482
4489
  fileIcon,
4490
+ selectedId,
4483
4491
  isLoading,
4484
4492
  onExpand
4485
4493
  },
@@ -4494,18 +4502,17 @@ var treeStyle = tv({
4494
4502
  slots: {
4495
4503
  base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
4496
4504
  wrapper: ["flex", "flex-col", "gap-[5px]"],
4497
- group: [
4505
+ node: [
4498
4506
  "flex",
4499
4507
  "items-center",
4500
4508
  "gap-[5px]",
4501
4509
  "text-md",
4502
4510
  "font-bold",
4503
4511
  "text-body-foreground",
4504
- "hover:bg-neutral-soft",
4505
- "p-[5px]",
4506
4512
  "rounded-[5px]",
4507
- "cursor-pointer"
4508
- ]
4513
+ "p-[5px]"
4514
+ ],
4515
+ clickable: ["hover:bg-neutral-soft", "cursor-pointer"]
4509
4516
  }
4510
4517
  });
4511
4518
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-MBLZYQCN.mjs";
3
3
  import {
4
4
  tree_default
5
- } from "../../chunk-4OSN2OE2.mjs";
5
+ } from "../../chunk-NFQMXW4Z.mjs";
6
6
  import "../../chunk-ZYIIXWVY.mjs";
7
7
  import "../../chunk-2TKEWFGH.mjs";
8
8
  import "../../chunk-2SDYFOZL.mjs";
@@ -6,28 +6,29 @@ import { SlotsToClasses } from '../../utils/types.mjs';
6
6
 
7
7
  type TreeNode = {
8
8
  id: number;
9
- label: string;
9
+ content: ReactNode | string;
10
10
  isLeaf?: boolean;
11
11
  children?: TreeNode[];
12
- onClick?: () => void;
13
- onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
12
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
13
+ onRightClick?: (event: MouseEvent<HTMLDivElement>) => void;
14
14
  };
15
15
  interface TreeProps {
16
16
  headerContent?: ReactNode;
17
17
  group: {
18
- label: string;
18
+ content: ReactNode | string;
19
19
  data: TreeNode[];
20
- onClick?: () => void;
21
- onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
20
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
21
+ onRightClick?: (event: MouseEvent<HTMLDivElement>) => void;
22
22
  };
23
23
  groupIcon?: ReactNode;
24
24
  fileIcon?: ReactNode;
25
+ selectedId?: number | string;
25
26
  isLoading?: boolean;
26
27
  classNames?: SlotsToClasses<TreeSlots>;
27
28
  onExpand?: (node: TreeNode) => Promise<TreeNode[]>;
28
29
  }
29
30
  declare const Tree: {
30
- ({ headerContent, group, groupIcon, fileIcon, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
31
+ ({ headerContent, group, groupIcon, fileIcon, selectedId, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
31
32
  displayName: string;
32
33
  };
33
34
 
@@ -35,38 +36,44 @@ declare const treeStyle: tailwind_variants.TVReturnType<{
35
36
  [key: string]: {
36
37
  [key: string]: tailwind_merge.ClassNameValue | {
37
38
  base?: tailwind_merge.ClassNameValue;
38
- group?: tailwind_merge.ClassNameValue;
39
39
  wrapper?: tailwind_merge.ClassNameValue;
40
+ node?: tailwind_merge.ClassNameValue;
41
+ clickable?: tailwind_merge.ClassNameValue;
40
42
  };
41
43
  };
42
44
  } | {
43
45
  [x: string]: {
44
46
  [x: string]: tailwind_merge.ClassNameValue | {
45
47
  base?: tailwind_merge.ClassNameValue;
46
- group?: tailwind_merge.ClassNameValue;
47
48
  wrapper?: tailwind_merge.ClassNameValue;
49
+ node?: tailwind_merge.ClassNameValue;
50
+ clickable?: tailwind_merge.ClassNameValue;
48
51
  };
49
52
  };
50
53
  } | {}, {
51
54
  base: string[];
52
55
  wrapper: string[];
53
- group: string[];
56
+ node: string[];
57
+ clickable: string[];
54
58
  }, undefined, {
55
59
  [key: string]: {
56
60
  [key: string]: tailwind_merge.ClassNameValue | {
57
61
  base?: tailwind_merge.ClassNameValue;
58
- group?: tailwind_merge.ClassNameValue;
59
62
  wrapper?: tailwind_merge.ClassNameValue;
63
+ node?: tailwind_merge.ClassNameValue;
64
+ clickable?: tailwind_merge.ClassNameValue;
60
65
  };
61
66
  };
62
67
  } | {}, {
63
68
  base: string[];
64
69
  wrapper: string[];
65
- group: string[];
70
+ node: string[];
71
+ clickable: string[];
66
72
  }, tailwind_variants.TVReturnType<unknown, {
67
73
  base: string[];
68
74
  wrapper: string[];
69
- group: string[];
75
+ node: string[];
76
+ clickable: string[];
70
77
  }, undefined, unknown, unknown, undefined>>;
71
78
  type TreeSlots = keyof ReturnType<typeof treeStyle>;
72
79
 
@@ -6,28 +6,29 @@ import { SlotsToClasses } from '../../utils/types.js';
6
6
 
7
7
  type TreeNode = {
8
8
  id: number;
9
- label: string;
9
+ content: ReactNode | string;
10
10
  isLeaf?: boolean;
11
11
  children?: TreeNode[];
12
- onClick?: () => void;
13
- onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
12
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
13
+ onRightClick?: (event: MouseEvent<HTMLDivElement>) => void;
14
14
  };
15
15
  interface TreeProps {
16
16
  headerContent?: ReactNode;
17
17
  group: {
18
- label: string;
18
+ content: ReactNode | string;
19
19
  data: TreeNode[];
20
- onClick?: () => void;
21
- onRightClick?: (event: MouseEvent<HTMLSpanElement>) => void;
20
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
21
+ onRightClick?: (event: MouseEvent<HTMLDivElement>) => void;
22
22
  };
23
23
  groupIcon?: ReactNode;
24
24
  fileIcon?: ReactNode;
25
+ selectedId?: number | string;
25
26
  isLoading?: boolean;
26
27
  classNames?: SlotsToClasses<TreeSlots>;
27
28
  onExpand?: (node: TreeNode) => Promise<TreeNode[]>;
28
29
  }
29
30
  declare const Tree: {
30
- ({ headerContent, group, groupIcon, fileIcon, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
31
+ ({ headerContent, group, groupIcon, fileIcon, selectedId, isLoading, classNames, onExpand, }: TreeProps): react_jsx_runtime.JSX.Element;
31
32
  displayName: string;
32
33
  };
33
34
 
@@ -35,38 +36,44 @@ declare const treeStyle: tailwind_variants.TVReturnType<{
35
36
  [key: string]: {
36
37
  [key: string]: tailwind_merge.ClassNameValue | {
37
38
  base?: tailwind_merge.ClassNameValue;
38
- group?: tailwind_merge.ClassNameValue;
39
39
  wrapper?: tailwind_merge.ClassNameValue;
40
+ node?: tailwind_merge.ClassNameValue;
41
+ clickable?: tailwind_merge.ClassNameValue;
40
42
  };
41
43
  };
42
44
  } | {
43
45
  [x: string]: {
44
46
  [x: string]: tailwind_merge.ClassNameValue | {
45
47
  base?: tailwind_merge.ClassNameValue;
46
- group?: tailwind_merge.ClassNameValue;
47
48
  wrapper?: tailwind_merge.ClassNameValue;
49
+ node?: tailwind_merge.ClassNameValue;
50
+ clickable?: tailwind_merge.ClassNameValue;
48
51
  };
49
52
  };
50
53
  } | {}, {
51
54
  base: string[];
52
55
  wrapper: string[];
53
- group: string[];
56
+ node: string[];
57
+ clickable: string[];
54
58
  }, undefined, {
55
59
  [key: string]: {
56
60
  [key: string]: tailwind_merge.ClassNameValue | {
57
61
  base?: tailwind_merge.ClassNameValue;
58
- group?: tailwind_merge.ClassNameValue;
59
62
  wrapper?: tailwind_merge.ClassNameValue;
63
+ node?: tailwind_merge.ClassNameValue;
64
+ clickable?: tailwind_merge.ClassNameValue;
60
65
  };
61
66
  };
62
67
  } | {}, {
63
68
  base: string[];
64
69
  wrapper: string[];
65
- group: string[];
70
+ node: string[];
71
+ clickable: string[];
66
72
  }, tailwind_variants.TVReturnType<unknown, {
67
73
  base: string[];
68
74
  wrapper: string[];
69
- group: string[];
75
+ node: string[];
76
+ clickable: string[];
70
77
  }, undefined, unknown, unknown, undefined>>;
71
78
  type TreeSlots = keyof ReturnType<typeof treeStyle>;
72
79
 
@@ -4349,7 +4349,7 @@ function toVal(mix) {
4349
4349
  // src/components/tree/tree.tsx
4350
4350
  var import_jsx_runtime3 = require("react/jsx-runtime");
4351
4351
  var TreeNodeItem = (0, import_react.forwardRef)(
4352
- ({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
4352
+ ({ node, depth, fileIcon, selectedId, isLoading, classNames, onExpand }, ref) => {
4353
4353
  const [isOpen, setIsOpen] = (0, import_react.useState)(false);
4354
4354
  const [children, setChildren] = (0, import_react.useState)(node.children);
4355
4355
  const [isLoadingChildren, setIsLoadingChildren] = (0, import_react.useState)(false);
@@ -4373,10 +4373,10 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4373
4373
  }
4374
4374
  setIsOpen((prev) => !prev);
4375
4375
  }, [isOpen, children, onExpand, node]);
4376
- const handleClick = () => {
4376
+ const handleClick = (e) => {
4377
4377
  var _a;
4378
4378
  toggleOpen();
4379
- (_a = node.onClick) == null ? void 0 : _a.call(node);
4379
+ (_a = node.onClick) == null ? void 0 : _a.call(node, e);
4380
4380
  };
4381
4381
  const handleRightClick = (e) => {
4382
4382
  var _a;
@@ -4397,7 +4397,11 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4397
4397
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4398
4398
  "div",
4399
4399
  {
4400
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4400
+ className: clsx(
4401
+ slots.node({ class: classNames == null ? void 0 : classNames.node }),
4402
+ slots.clickable({ class: classNames == null ? void 0 : classNames.clickable }),
4403
+ selectedId == node.id ? "bg-neutral-soft" : ""
4404
+ ),
4401
4405
  onClick: handleClick,
4402
4406
  onContextMenu: handleRightClick,
4403
4407
  children: [
@@ -4412,7 +4416,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4412
4416
  }
4413
4417
  ),
4414
4418
  fileIcon,
4415
- node.label
4419
+ node.content
4416
4420
  ]
4417
4421
  }
4418
4422
  ),
@@ -4423,6 +4427,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4423
4427
  {
4424
4428
  node: child,
4425
4429
  depth: depth + 1,
4430
+ selectedId,
4426
4431
  classNames,
4427
4432
  fileIcon,
4428
4433
  onExpand
@@ -4441,16 +4446,15 @@ var Tree = ({
4441
4446
  group,
4442
4447
  groupIcon,
4443
4448
  fileIcon,
4449
+ selectedId,
4444
4450
  isLoading = false,
4445
4451
  classNames,
4446
4452
  onExpand
4447
4453
  }) => {
4448
4454
  const slots = (0, import_react.useMemo)(() => treeStyle(), []);
4449
- const [isOpen, setIsOpen] = (0, import_react.useState)(true);
4450
- const handleToggle = () => {
4455
+ const handleClick = (e) => {
4451
4456
  var _a;
4452
- setIsOpen((prev) => !prev);
4453
- (_a = group.onClick) == null ? void 0 : _a.call(group);
4457
+ (_a = group.onClick) == null ? void 0 : _a.call(group, e);
4454
4458
  };
4455
4459
  const handleRightClick = (e) => {
4456
4460
  var _a;
@@ -4463,22 +4467,26 @@ var Tree = ({
4463
4467
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4464
4468
  "div",
4465
4469
  {
4466
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4467
- onClick: handleToggle,
4470
+ className: clsx(
4471
+ slots.node({ class: classNames == null ? void 0 : classNames.node }),
4472
+ group.onClick || group.onRightClick ? slots.clickable({ class: classNames == null ? void 0 : classNames.clickable }) : ""
4473
+ ),
4474
+ onClick: handleClick,
4468
4475
  onContextMenu: handleRightClick,
4469
4476
  children: [
4470
4477
  groupIcon,
4471
- group.label
4478
+ group.content
4472
4479
  ]
4473
4480
  }
4474
4481
  ),
4475
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4482
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4476
4483
  TreeNodeItem,
4477
4484
  {
4478
4485
  node,
4479
4486
  depth: 1,
4480
4487
  classNames,
4481
4488
  fileIcon,
4489
+ selectedId,
4482
4490
  isLoading,
4483
4491
  onExpand
4484
4492
  },
@@ -4493,18 +4501,17 @@ var treeStyle = tv({
4493
4501
  slots: {
4494
4502
  base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
4495
4503
  wrapper: ["flex", "flex-col", "gap-[5px]"],
4496
- group: [
4504
+ node: [
4497
4505
  "flex",
4498
4506
  "items-center",
4499
4507
  "gap-[5px]",
4500
4508
  "text-md",
4501
4509
  "font-bold",
4502
4510
  "text-body-foreground",
4503
- "hover:bg-neutral-soft",
4504
- "p-[5px]",
4505
4511
  "rounded-[5px]",
4506
- "cursor-pointer"
4507
- ]
4512
+ "p-[5px]"
4513
+ ],
4514
+ clickable: ["hover:bg-neutral-soft", "cursor-pointer"]
4508
4515
  }
4509
4516
  });
4510
4517
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  Tree,
4
4
  tree_default
5
- } from "../../chunk-4OSN2OE2.mjs";
5
+ } from "../../chunk-NFQMXW4Z.mjs";
6
6
  import "../../chunk-ZYIIXWVY.mjs";
7
7
  import "../../chunk-2TKEWFGH.mjs";
8
8
  import "../../chunk-2SDYFOZL.mjs";
package/dist/index.d.mts CHANGED
@@ -26,6 +26,8 @@ export { ToastProvider, useToast } from './components/toast/use-toast.mjs';
26
26
  export { default as DateTimePicker } from './components/dateTimePicker/dateTimePicker.mjs';
27
27
  export { default as ScrollArea } from './components/scroll/scrollArea.mjs';
28
28
  export { default as Tree, TreeNode } from './components/tree/tree.mjs';
29
+ export { default as FileUpload } from './components/fileUpload/fileUpload.mjs';
30
+ export { default as Skeleton } from './components/skeleton/skeleton.mjs';
29
31
  export { tv } from './utils/tailwind-variants.mjs';
30
32
  export { deepnoidUi } from '@deepnoid/tailwind-config';
31
33
  export { VariantProps } from 'tailwind-variants';
package/dist/index.d.ts CHANGED
@@ -26,6 +26,8 @@ export { ToastProvider, useToast } from './components/toast/use-toast.js';
26
26
  export { default as DateTimePicker } from './components/dateTimePicker/dateTimePicker.js';
27
27
  export { default as ScrollArea } from './components/scroll/scrollArea.js';
28
28
  export { default as Tree, TreeNode } from './components/tree/tree.js';
29
+ export { default as FileUpload } from './components/fileUpload/fileUpload.js';
30
+ export { default as Skeleton } from './components/skeleton/skeleton.js';
29
31
  export { tv } from './utils/tailwind-variants.js';
30
32
  export { deepnoidUi } from '@deepnoid/tailwind-config';
31
33
  export { VariantProps } from 'tailwind-variants';