@deepnoid/ui 0.1.27 → 0.1.29

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 (131) hide show
  1. package/.turbo/turbo-build.log +174 -164
  2. package/dist/{chunk-UNH3BCGN.mjs → chunk-26MNALVL.mjs} +1 -1
  3. package/dist/{chunk-3IU2RPSM.mjs → chunk-2SDYFOZL.mjs} +46 -35
  4. package/dist/{chunk-HWL7TPUN.mjs → chunk-2TKEWFGH.mjs} +1 -1
  5. package/dist/chunk-3KVZDFMV.mjs +132 -0
  6. package/dist/{chunk-PMMTMYRI.mjs → chunk-6K3E5BVO.mjs} +7 -7
  7. package/dist/{chunk-BQUZRVYW.mjs → chunk-7J3KVOTS.mjs} +7 -7
  8. package/dist/{chunk-OUAKGMDW.mjs → chunk-7W2ZI2DD.mjs} +4 -4
  9. package/dist/{chunk-XRC5OUYQ.mjs → chunk-A5KQHWS3.mjs} +1 -1
  10. package/dist/{chunk-YBDA3WQP.mjs → chunk-BB7MFKNQ.mjs} +1 -1
  11. package/dist/{chunk-SCFTSNCK.mjs → chunk-ECMBAKSJ.mjs} +6 -6
  12. package/dist/{chunk-GRA2LU42.mjs → chunk-EHRFXDSN.mjs} +6 -5
  13. package/dist/{chunk-IRAHS4WS.mjs → chunk-III2QUWF.mjs} +2 -2
  14. package/dist/{chunk-E4UUZOR4.mjs → chunk-KLUC2BV6.mjs} +4 -4
  15. package/dist/{chunk-C7OF5HJF.mjs → chunk-KXA73VTJ.mjs} +5 -5
  16. package/dist/{chunk-B3DFSXGC.mjs → chunk-LR3SWRB4.mjs} +6 -6
  17. package/dist/{chunk-DLQFMOBN.mjs → chunk-QJJKJYNR.mjs} +4 -4
  18. package/dist/{chunk-XA6PVFTW.mjs → chunk-RCJOJPRS.mjs} +6 -6
  19. package/dist/chunk-RLXOHILK.mjs +1 -0
  20. package/dist/{chunk-XQGD4ZIX.mjs → chunk-SP3JVQY3.mjs} +1 -1
  21. package/dist/{chunk-QY7LYAXT.mjs → chunk-W45H2ZMW.mjs} +5 -5
  22. package/dist/{chunk-PX4PFLJ3.mjs → chunk-X4F7JYBA.mjs} +18 -33
  23. package/dist/{chunk-Q72LZAPG.mjs → chunk-X6D7C7QZ.mjs} +4 -4
  24. package/dist/{chunk-6HX3PPL6.mjs → chunk-Y6XQTWB5.mjs} +4 -4
  25. package/dist/components/avatar/avatar.js +46 -35
  26. package/dist/components/avatar/avatar.mjs +2 -2
  27. package/dist/components/avatar/index.js +46 -35
  28. package/dist/components/avatar/index.mjs +2 -2
  29. package/dist/components/backdrop/backdrop.mjs +2 -2
  30. package/dist/components/backdrop/index.mjs +2 -2
  31. package/dist/components/breadcrumb/breadcrumb.js +46 -35
  32. package/dist/components/breadcrumb/breadcrumb.mjs +8 -8
  33. package/dist/components/breadcrumb/index.js +46 -35
  34. package/dist/components/breadcrumb/index.mjs +8 -8
  35. package/dist/components/button/button.js +46 -35
  36. package/dist/components/button/button.mjs +5 -5
  37. package/dist/components/button/icon-button.js +46 -35
  38. package/dist/components/button/icon-button.mjs +5 -5
  39. package/dist/components/button/index.js +46 -35
  40. package/dist/components/button/index.mjs +7 -7
  41. package/dist/components/button/text-button.mjs +2 -2
  42. package/dist/components/checkbox/checkbox.mjs +2 -2
  43. package/dist/components/checkbox/index.mjs +2 -2
  44. package/dist/components/chip/chip.js +46 -35
  45. package/dist/components/chip/chip.mjs +4 -4
  46. package/dist/components/chip/index.js +46 -35
  47. package/dist/components/chip/index.mjs +4 -4
  48. package/dist/components/dateTimePicker/calendar.js +46 -35
  49. package/dist/components/dateTimePicker/calendar.mjs +4 -4
  50. package/dist/components/dateTimePicker/dateTimePicker.js +46 -35
  51. package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
  52. package/dist/components/dateTimePicker/index.js +46 -35
  53. package/dist/components/dateTimePicker/index.mjs +9 -9
  54. package/dist/components/dateTimePicker/timePicker.js +46 -35
  55. package/dist/components/dateTimePicker/timePicker.mjs +7 -7
  56. package/dist/components/fileUpload/fileUpload.d.mts +92 -0
  57. package/dist/components/fileUpload/fileUpload.d.ts +92 -0
  58. package/dist/components/fileUpload/fileUpload.js +5648 -0
  59. package/dist/components/fileUpload/fileUpload.mjs +28 -0
  60. package/dist/components/fileUpload/index.d.mts +5 -0
  61. package/dist/components/fileUpload/index.d.ts +5 -0
  62. package/dist/components/fileUpload/index.js +5647 -0
  63. package/dist/components/fileUpload/index.mjs +25 -0
  64. package/dist/components/icon/Icon.d.mts +9 -5
  65. package/dist/components/icon/Icon.d.ts +9 -5
  66. package/dist/components/icon/Icon.js +46 -35
  67. package/dist/components/icon/Icon.mjs +2 -2
  68. package/dist/components/icon/index.js +46 -35
  69. package/dist/components/icon/index.mjs +2 -2
  70. package/dist/components/icon/template.d.mts +3 -2
  71. package/dist/components/icon/template.d.ts +3 -2
  72. package/dist/components/icon/template.js +46 -35
  73. package/dist/components/icon/template.mjs +1 -1
  74. package/dist/components/input/index.js +48 -36
  75. package/dist/components/input/index.mjs +4 -4
  76. package/dist/components/input/input.js +48 -36
  77. package/dist/components/input/input.mjs +4 -4
  78. package/dist/components/list/index.js +46 -35
  79. package/dist/components/list/index.mjs +8 -8
  80. package/dist/components/list/list.mjs +2 -2
  81. package/dist/components/list/listItem.js +46 -35
  82. package/dist/components/list/listItem.mjs +5 -5
  83. package/dist/components/modal/index.js +46 -35
  84. package/dist/components/modal/index.mjs +9 -9
  85. package/dist/components/modal/modal.js +46 -35
  86. package/dist/components/modal/modal.mjs +9 -9
  87. package/dist/components/pagination/index.js +48 -36
  88. package/dist/components/pagination/index.mjs +5 -5
  89. package/dist/components/pagination/pagination.js +48 -36
  90. package/dist/components/pagination/pagination.mjs +5 -5
  91. package/dist/components/radio/index.mjs +2 -2
  92. package/dist/components/radio/radio.mjs +2 -2
  93. package/dist/components/ripple/index.mjs +3 -3
  94. package/dist/components/select/index.js +46 -35
  95. package/dist/components/select/index.mjs +4 -4
  96. package/dist/components/select/select.js +46 -35
  97. package/dist/components/select/select.mjs +4 -4
  98. package/dist/components/table/index.js +48 -36
  99. package/dist/components/table/index.mjs +12 -12
  100. package/dist/components/table/table-body.mjs +3 -3
  101. package/dist/components/table/table-head.mjs +3 -3
  102. package/dist/components/table/table.js +48 -36
  103. package/dist/components/table/table.mjs +9 -9
  104. package/dist/components/tabs/index.mjs +2 -2
  105. package/dist/components/tabs/tabs.mjs +2 -2
  106. package/dist/components/toast/index.js +46 -35
  107. package/dist/components/toast/index.mjs +5 -5
  108. package/dist/components/toast/toast.js +46 -35
  109. package/dist/components/toast/toast.mjs +4 -4
  110. package/dist/components/toast/use-toast.js +46 -35
  111. package/dist/components/toast/use-toast.mjs +5 -5
  112. package/dist/components/tooltip/index.mjs +2 -2
  113. package/dist/components/tooltip/tooltip.mjs +2 -2
  114. package/dist/components/tree/index.js +60 -64
  115. package/dist/components/tree/index.mjs +4 -4
  116. package/dist/components/tree/tree.d.mts +10 -5
  117. package/dist/components/tree/tree.d.ts +10 -5
  118. package/dist/components/tree/tree.js +60 -64
  119. package/dist/components/tree/tree.mjs +4 -4
  120. package/dist/index.d.mts +1 -0
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.js +180 -65
  123. package/dist/index.mjs +54 -49
  124. package/package.json +1 -1
  125. package/dist/{chunk-WFMFC7R6.mjs → chunk-2PKM7SLZ.mjs} +3 -3
  126. package/dist/{chunk-QIRL6HY6.mjs → chunk-33LANVZV.mjs} +3 -3
  127. package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
  128. package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.mjs} +3 -3
  129. package/dist/{chunk-2YMAKIZ6.mjs → chunk-SSMMWMQC.mjs} +3 -3
  130. package/dist/{chunk-HIVPDIEP.mjs → chunk-UFVQPPPW.mjs} +3 -3
  131. package/dist/{chunk-D6QI3DJG.mjs → chunk-YLRYHUTW.mjs} +3 -3
@@ -843,22 +843,61 @@ var template = {
843
843
  }
844
844
  );
845
845
  },
846
- // ----------------------------------- old ---------------------------------
847
- // ** Status **
848
- plus: ({ className, fill }) => {
846
+ plus: ({ className }) => {
847
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
848
+ "svg",
849
+ {
850
+ xmlns: "http://www.w3.org/2000/svg",
851
+ width: "18",
852
+ height: "18",
853
+ viewBox: "0 0 18 18",
854
+ fill: "none",
855
+ className,
856
+ children: [
857
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
858
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13.5V4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
859
+ ]
860
+ }
861
+ );
862
+ },
863
+ minus: ({ className }) => {
849
864
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
850
865
  "svg",
851
866
  {
852
- width: "24",
853
- height: "24",
854
- viewBox: "0 0 24 24",
867
+ xmlns: "http://www.w3.org/2000/svg",
868
+ width: "18",
869
+ height: "18",
870
+ viewBox: "0 0 18 18",
855
871
  fill: "none",
872
+ className,
873
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
874
+ }
875
+ );
876
+ },
877
+ pencil: ({ className }) => {
878
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
879
+ "svg",
880
+ {
856
881
  xmlns: "http://www.w3.org/2000/svg",
882
+ width: "18",
883
+ height: "18",
884
+ viewBox: "0 0 18 18",
885
+ fill: "none",
857
886
  className,
858
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 4.5V19.5M19.5 12H4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
887
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
888
+ "path",
889
+ {
890
+ d: "M12.6465 3.36525L13.9117 2.09925C14.1755 1.83549 14.5332 1.68732 14.9062 1.68732C15.2793 1.68732 15.637 1.83549 15.9008 2.09925C16.1645 2.36301 16.3127 2.72074 16.3127 3.09375C16.3127 3.46676 16.1645 3.82449 15.9008 4.08825L7.9365 12.0525C7.53999 12.4488 7.05102 12.74 6.51375 12.9L4.5 13.5L5.1 11.4863C5.25996 10.949 5.55123 10.46 5.9475 10.0635L12.6465 3.36525ZM12.6465 3.36525L14.625 5.34375M13.5 10.5V14.0625C13.5 14.5101 13.3222 14.9393 13.0057 15.2557C12.6893 15.5722 12.2601 15.75 11.8125 15.75H3.9375C3.48995 15.75 3.06072 15.5722 2.74426 15.2557C2.42779 14.9393 2.25 14.5101 2.25 14.0625V6.1875C2.25 5.73995 2.42779 5.31073 2.74426 4.99426C3.06072 4.67779 3.48995 4.5 3.9375 4.5H7.5",
891
+ stroke: "currentColor",
892
+ strokeLinecap: "round",
893
+ strokeLinejoin: "round"
894
+ }
895
+ )
859
896
  }
860
897
  );
861
898
  },
899
+ // ----------------------------------- old ---------------------------------
900
+ // ** Status **
862
901
  check: ({ className, fill }) => {
863
902
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
864
903
  "svg",
@@ -2505,34 +2544,6 @@ var template = {
2505
2544
  }
2506
2545
  );
2507
2546
  },
2508
- pencil: ({ className, fill }) => {
2509
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2510
- "svg",
2511
- {
2512
- width: "24",
2513
- height: "24",
2514
- viewBox: "0 0 24 24",
2515
- fill: "none",
2516
- xmlns: "http://www.w3.org/2000/svg",
2517
- className,
2518
- children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2519
- "path",
2520
- {
2521
- d: "M21.7313 2.26918C21.239 1.77699 20.5714 1.50049 19.8753 1.50049C19.1791 1.50049 18.5115 1.77699 18.0193 2.26918L16.8623 3.42618L20.5743 7.13818L21.7313 5.98118C22.2234 5.48891 22.4999 4.8213 22.4999 4.12518C22.4999 3.42906 22.2234 2.76145 21.7313 2.26918ZM19.5133 8.19918L15.8013 4.48718L3.65125 16.6372C3.03411 17.254 2.58043 18.015 2.33125 18.8512L1.53125 21.5362C1.49263 21.6657 1.48975 21.8033 1.52292 21.9344C1.55608 22.0655 1.62407 22.1852 1.71967 22.2808C1.81527 22.3764 1.93494 22.4443 2.06601 22.4775C2.19709 22.5107 2.33469 22.5078 2.46425 22.4692L5.14925 21.6692C5.98548 21.42 6.74642 20.9663 7.36325 20.3492L19.5133 8.19918Z",
2522
- fill: "currentColor"
2523
- }
2524
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2525
- "path",
2526
- {
2527
- d: "M16.862 4.487L18.549 2.799C18.9007 2.44733 19.3777 2.24976 19.875 2.24976C20.3723 2.24976 20.8493 2.44733 21.201 2.799C21.5527 3.15068 21.7502 3.62766 21.7502 4.125C21.7502 4.62235 21.5527 5.09933 21.201 5.451L6.832 19.82C6.30332 20.3484 5.65137 20.7367 4.935 20.95L2.25 21.75L3.05 19.065C3.26328 18.3486 3.65163 17.6967 4.18 17.168L16.863 4.487H16.862ZM16.862 4.487L19.5 7.125",
2528
- stroke: "currentColor",
2529
- strokeLinecap: "round",
2530
- strokeLinejoin: "round"
2531
- }
2532
- )
2533
- }
2534
- );
2535
- },
2536
2547
  "pencil-square": ({ className, fill }) => {
2537
2548
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2538
2549
  "svg",
@@ -4338,7 +4349,7 @@ function toVal(mix) {
4338
4349
  // src/components/tree/tree.tsx
4339
4350
  var import_jsx_runtime3 = require("react/jsx-runtime");
4340
4351
  var TreeNodeItem = (0, import_react.forwardRef)(
4341
- ({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
4352
+ ({ node, depth, fileIcon, selectedId, isLoading, classNames, onExpand }, ref) => {
4342
4353
  const [isOpen, setIsOpen] = (0, import_react.useState)(false);
4343
4354
  const [children, setChildren] = (0, import_react.useState)(node.children);
4344
4355
  const [isLoadingChildren, setIsLoadingChildren] = (0, import_react.useState)(false);
@@ -4362,10 +4373,10 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4362
4373
  }
4363
4374
  setIsOpen((prev) => !prev);
4364
4375
  }, [isOpen, children, onExpand, node]);
4365
- const handleClick = () => {
4376
+ const handleClick = (e) => {
4366
4377
  var _a;
4367
4378
  toggleOpen();
4368
- (_a = node.onClick) == null ? void 0 : _a.call(node);
4379
+ (_a = node.onClick) == null ? void 0 : _a.call(node, e);
4369
4380
  };
4370
4381
  const handleRightClick = (e) => {
4371
4382
  var _a;
@@ -4386,7 +4397,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4386
4397
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4387
4398
  "div",
4388
4399
  {
4389
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4400
+ className: clsx(slots.node({ class: classNames == null ? void 0 : classNames.node }), selectedId == node.id ? "bg-neutral-soft" : ""),
4390
4401
  onClick: handleClick,
4391
4402
  onContextMenu: handleRightClick,
4392
4403
  children: [
@@ -4412,6 +4423,7 @@ var TreeNodeItem = (0, import_react.forwardRef)(
4412
4423
  {
4413
4424
  node: child,
4414
4425
  depth: depth + 1,
4426
+ selectedId,
4415
4427
  classNames,
4416
4428
  fileIcon,
4417
4429
  onExpand
@@ -4430,44 +4442,27 @@ var Tree = ({
4430
4442
  group,
4431
4443
  groupIcon,
4432
4444
  fileIcon,
4445
+ selectedId,
4433
4446
  isLoading = false,
4434
4447
  classNames,
4435
4448
  onExpand
4436
4449
  }) => {
4437
4450
  const slots = (0, import_react.useMemo)(() => treeStyle(), []);
4438
- const [isOpen, setIsOpen] = (0, import_react.useState)(true);
4439
- const handleToggle = () => {
4440
- var _a;
4441
- setIsOpen((prev) => !prev);
4442
- (_a = group.onClick) == null ? void 0 : _a.call(group);
4443
- };
4444
- const handleRightClick = (e) => {
4445
- var _a;
4446
- e.preventDefault();
4447
- (_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
4448
- };
4449
4451
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
4450
4452
  headerContent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: headerContent }),
4451
4453
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
4452
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4453
- "div",
4454
- {
4455
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
4456
- onClick: handleToggle,
4457
- onContextMenu: handleRightClick,
4458
- children: [
4459
- groupIcon,
4460
- group.label
4461
- ]
4462
- }
4463
- ),
4464
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4454
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.group({ class: classNames == null ? void 0 : classNames.group }), children: [
4455
+ groupIcon,
4456
+ group.label
4457
+ ] }),
4458
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4465
4459
  TreeNodeItem,
4466
4460
  {
4467
4461
  node,
4468
4462
  depth: 1,
4469
4463
  classNames,
4470
4464
  fileIcon,
4465
+ selectedId,
4471
4466
  isLoading,
4472
4467
  onExpand
4473
4468
  },
@@ -4482,7 +4477,8 @@ var treeStyle = tv({
4482
4477
  slots: {
4483
4478
  base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
4484
4479
  wrapper: ["flex", "flex-col", "gap-[5px]"],
4485
- group: [
4480
+ group: ["flex", "items-center", "gap-[5px]", "text-md", "font-bold", "text-body-foreground", "p-[5px]"],
4481
+ node: [
4486
4482
  "flex",
4487
4483
  "items-center",
4488
4484
  "gap-[5px]",
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  Tree,
4
4
  tree_default
5
- } from "../../chunk-PX4PFLJ3.mjs";
5
+ } from "../../chunk-X4F7JYBA.mjs";
6
6
  import "../../chunk-ZYIIXWVY.mjs";
7
- import "../../chunk-HWL7TPUN.mjs";
8
- import "../../chunk-3IU2RPSM.mjs";
9
- import "../../chunk-4ZJFD3L3.mjs";
7
+ import "../../chunk-2TKEWFGH.mjs";
8
+ import "../../chunk-2SDYFOZL.mjs";
10
9
  import "../../chunk-27Y6K5NK.mjs";
10
+ import "../../chunk-4ZJFD3L3.mjs";
11
11
  import "../../chunk-AC6TWLRT.mjs";
12
12
  export {
13
13
  Tree,
package/dist/index.d.mts CHANGED
@@ -26,6 +26,7 @@ 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';
29
30
  export { tv } from './utils/tailwind-variants.mjs';
30
31
  export { deepnoidUi } from '@deepnoid/tailwind-config';
31
32
  export { VariantProps } from 'tailwind-variants';
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ 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';
29
30
  export { tv } from './utils/tailwind-variants.js';
30
31
  export { deepnoidUi } from '@deepnoid/tailwind-config';
31
32
  export { VariantProps } from 'tailwind-variants';
package/dist/index.js CHANGED
@@ -111,6 +111,7 @@ __export(index_exports, {
111
111
  Chip: () => chip_default,
112
112
  DateTimePicker: () => dateTimePicker_default,
113
113
  DefinitionTable: () => definition_table_default,
114
+ FileUpload: () => fileUpload_default,
114
115
  Icon: () => Icon_default,
115
116
  IconButton: () => icon_button_default,
116
117
  Input: () => input_default,
@@ -658,22 +659,61 @@ var template = {
658
659
  }
659
660
  );
660
661
  },
661
- // ----------------------------------- old ---------------------------------
662
- // ** Status **
663
- plus: ({ className, fill }) => {
662
+ plus: ({ className }) => {
663
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
664
+ "svg",
665
+ {
666
+ xmlns: "http://www.w3.org/2000/svg",
667
+ width: "18",
668
+ height: "18",
669
+ viewBox: "0 0 18 18",
670
+ fill: "none",
671
+ className,
672
+ children: [
673
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
674
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13.5V4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
675
+ ]
676
+ }
677
+ );
678
+ },
679
+ minus: ({ className }) => {
664
680
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
665
681
  "svg",
666
682
  {
667
- width: "24",
668
- height: "24",
669
- viewBox: "0 0 24 24",
683
+ xmlns: "http://www.w3.org/2000/svg",
684
+ width: "18",
685
+ height: "18",
686
+ viewBox: "0 0 18 18",
670
687
  fill: "none",
688
+ className,
689
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
690
+ }
691
+ );
692
+ },
693
+ pencil: ({ className }) => {
694
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
695
+ "svg",
696
+ {
671
697
  xmlns: "http://www.w3.org/2000/svg",
698
+ width: "18",
699
+ height: "18",
700
+ viewBox: "0 0 18 18",
701
+ fill: "none",
672
702
  className,
673
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 4.5V19.5M19.5 12H4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
703
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
704
+ "path",
705
+ {
706
+ d: "M12.6465 3.36525L13.9117 2.09925C14.1755 1.83549 14.5332 1.68732 14.9062 1.68732C15.2793 1.68732 15.637 1.83549 15.9008 2.09925C16.1645 2.36301 16.3127 2.72074 16.3127 3.09375C16.3127 3.46676 16.1645 3.82449 15.9008 4.08825L7.9365 12.0525C7.53999 12.4488 7.05102 12.74 6.51375 12.9L4.5 13.5L5.1 11.4863C5.25996 10.949 5.55123 10.46 5.9475 10.0635L12.6465 3.36525ZM12.6465 3.36525L14.625 5.34375M13.5 10.5V14.0625C13.5 14.5101 13.3222 14.9393 13.0057 15.2557C12.6893 15.5722 12.2601 15.75 11.8125 15.75H3.9375C3.48995 15.75 3.06072 15.5722 2.74426 15.2557C2.42779 14.9393 2.25 14.5101 2.25 14.0625V6.1875C2.25 5.73995 2.42779 5.31073 2.74426 4.99426C3.06072 4.67779 3.48995 4.5 3.9375 4.5H7.5",
707
+ stroke: "currentColor",
708
+ strokeLinecap: "round",
709
+ strokeLinejoin: "round"
710
+ }
711
+ )
674
712
  }
675
713
  );
676
714
  },
715
+ // ----------------------------------- old ---------------------------------
716
+ // ** Status **
677
717
  check: ({ className, fill }) => {
678
718
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
679
719
  "svg",
@@ -2320,34 +2360,6 @@ var template = {
2320
2360
  }
2321
2361
  );
2322
2362
  },
2323
- pencil: ({ className, fill }) => {
2324
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2325
- "svg",
2326
- {
2327
- width: "24",
2328
- height: "24",
2329
- viewBox: "0 0 24 24",
2330
- fill: "none",
2331
- xmlns: "http://www.w3.org/2000/svg",
2332
- className,
2333
- children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2334
- "path",
2335
- {
2336
- d: "M21.7313 2.26918C21.239 1.77699 20.5714 1.50049 19.8753 1.50049C19.1791 1.50049 18.5115 1.77699 18.0193 2.26918L16.8623 3.42618L20.5743 7.13818L21.7313 5.98118C22.2234 5.48891 22.4999 4.8213 22.4999 4.12518C22.4999 3.42906 22.2234 2.76145 21.7313 2.26918ZM19.5133 8.19918L15.8013 4.48718L3.65125 16.6372C3.03411 17.254 2.58043 18.015 2.33125 18.8512L1.53125 21.5362C1.49263 21.6657 1.48975 21.8033 1.52292 21.9344C1.55608 22.0655 1.62407 22.1852 1.71967 22.2808C1.81527 22.3764 1.93494 22.4443 2.06601 22.4775C2.19709 22.5107 2.33469 22.5078 2.46425 22.4692L5.14925 21.6692C5.98548 21.42 6.74642 20.9663 7.36325 20.3492L19.5133 8.19918Z",
2337
- fill: "currentColor"
2338
- }
2339
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2340
- "path",
2341
- {
2342
- d: "M16.862 4.487L18.549 2.799C18.9007 2.44733 19.3777 2.24976 19.875 2.24976C20.3723 2.24976 20.8493 2.44733 21.201 2.799C21.5527 3.15068 21.7502 3.62766 21.7502 4.125C21.7502 4.62235 21.5527 5.09933 21.201 5.451L6.832 19.82C6.30332 20.3484 5.65137 20.7367 4.935 20.95L2.25 21.75L3.05 19.065C3.26328 18.3486 3.65163 17.6967 4.18 17.168L16.863 4.487H16.862ZM16.862 4.487L19.5 7.125",
2343
- stroke: "currentColor",
2344
- strokeLinecap: "round",
2345
- strokeLinejoin: "round"
2346
- }
2347
- )
2348
- }
2349
- );
2350
- },
2351
2363
  "pencil-square": ({ className, fill }) => {
2352
2364
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2353
2365
  "svg",
@@ -5946,9 +5958,10 @@ var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
5946
5958
  {
5947
5959
  ...inputProps,
5948
5960
  ref: ref || inputRef,
5961
+ readOnly: props.readOnly,
5949
5962
  className: clsx(
5950
5963
  slots.input({ class: classNames == null ? void 0 : classNames.input }),
5951
- inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
5964
+ inputProps.readOnly ? "!text-body-foreground placeholder:!text-body-foreground" : ""
5952
5965
  ),
5953
5966
  size: 0
5954
5967
  }
@@ -9995,7 +10008,7 @@ var dateTimePickerStyle = tv({
9995
10008
  var import_react34 = require("react");
9996
10009
  var import_jsx_runtime34 = require("react/jsx-runtime");
9997
10010
  var TreeNodeItem = (0, import_react34.forwardRef)(
9998
- ({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
10011
+ ({ node, depth, fileIcon, selectedId, isLoading, classNames, onExpand }, ref) => {
9999
10012
  const [isOpen, setIsOpen] = (0, import_react34.useState)(false);
10000
10013
  const [children, setChildren] = (0, import_react34.useState)(node.children);
10001
10014
  const [isLoadingChildren, setIsLoadingChildren] = (0, import_react34.useState)(false);
@@ -10019,10 +10032,10 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
10019
10032
  }
10020
10033
  setIsOpen((prev) => !prev);
10021
10034
  }, [isOpen, children, onExpand, node]);
10022
- const handleClick = () => {
10035
+ const handleClick = (e) => {
10023
10036
  var _a;
10024
10037
  toggleOpen();
10025
- (_a = node.onClick) == null ? void 0 : _a.call(node);
10038
+ (_a = node.onClick) == null ? void 0 : _a.call(node, e);
10026
10039
  };
10027
10040
  const handleRightClick = (e) => {
10028
10041
  var _a;
@@ -10043,7 +10056,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
10043
10056
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10044
10057
  "div",
10045
10058
  {
10046
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
10059
+ className: clsx(slots.node({ class: classNames == null ? void 0 : classNames.node }), selectedId == node.id ? "bg-neutral-soft" : ""),
10047
10060
  onClick: handleClick,
10048
10061
  onContextMenu: handleRightClick,
10049
10062
  children: [
@@ -10069,6 +10082,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
10069
10082
  {
10070
10083
  node: child,
10071
10084
  depth: depth + 1,
10085
+ selectedId,
10072
10086
  classNames,
10073
10087
  fileIcon,
10074
10088
  onExpand
@@ -10087,44 +10101,27 @@ var Tree = ({
10087
10101
  group,
10088
10102
  groupIcon,
10089
10103
  fileIcon,
10104
+ selectedId,
10090
10105
  isLoading = false,
10091
10106
  classNames,
10092
10107
  onExpand
10093
10108
  }) => {
10094
10109
  const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
10095
- const [isOpen, setIsOpen] = (0, import_react34.useState)(true);
10096
- const handleToggle = () => {
10097
- var _a;
10098
- setIsOpen((prev) => !prev);
10099
- (_a = group.onClick) == null ? void 0 : _a.call(group);
10100
- };
10101
- const handleRightClick = (e) => {
10102
- var _a;
10103
- e.preventDefault();
10104
- (_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
10105
- };
10106
10110
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
10107
10111
  headerContent && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: headerContent }),
10108
10112
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
10109
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10110
- "div",
10111
- {
10112
- className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
10113
- onClick: handleToggle,
10114
- onContextMenu: handleRightClick,
10115
- children: [
10116
- groupIcon,
10117
- group.label
10118
- ]
10119
- }
10120
- ),
10121
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10113
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.group({ class: classNames == null ? void 0 : classNames.group }), children: [
10114
+ groupIcon,
10115
+ group.label
10116
+ ] }),
10117
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10122
10118
  TreeNodeItem,
10123
10119
  {
10124
10120
  node,
10125
10121
  depth: 1,
10126
10122
  classNames,
10127
10123
  fileIcon,
10124
+ selectedId,
10128
10125
  isLoading,
10129
10126
  onExpand
10130
10127
  },
@@ -10139,7 +10136,8 @@ var treeStyle = tv({
10139
10136
  slots: {
10140
10137
  base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
10141
10138
  wrapper: ["flex", "flex-col", "gap-[5px]"],
10142
- group: [
10139
+ group: ["flex", "items-center", "gap-[5px]", "text-md", "font-bold", "text-body-foreground", "p-[5px]"],
10140
+ node: [
10143
10141
  "flex",
10144
10142
  "items-center",
10145
10143
  "gap-[5px]",
@@ -10153,6 +10151,122 @@ var treeStyle = tv({
10153
10151
  ]
10154
10152
  }
10155
10153
  });
10154
+
10155
+ // src/components/fileUpload/fileUpload.tsx
10156
+ var import_react35 = require("react");
10157
+ var import_tailwind_variants29 = require("tailwind-variants");
10158
+ var import_jsx_runtime35 = require("react/jsx-runtime");
10159
+ function FileUpload({
10160
+ buttonText,
10161
+ maxSizeMB = 10,
10162
+ placeholder,
10163
+ accept = [],
10164
+ acceptErrorMessage = "The file type is not allowed.",
10165
+ sizeErrorMessage = `File is too large.`,
10166
+ onFileUpload,
10167
+ helperMessage,
10168
+ showProgress,
10169
+ classNames
10170
+ }) {
10171
+ const fileInputRef = (0, import_react35.useRef)(null);
10172
+ const uploadIntervalRef = (0, import_react35.useRef)(null);
10173
+ const [file, setFile] = (0, import_react35.useState)(null);
10174
+ const [uploadProgress, setUploadProgress] = (0, import_react35.useState)(0);
10175
+ const [errorMessage, setErrorMessage] = (0, import_react35.useState)("");
10176
+ const slots = fileUploadStyle();
10177
+ const handleButtonClick = () => {
10178
+ var _a;
10179
+ (_a = fileInputRef.current) == null ? void 0 : _a.click();
10180
+ };
10181
+ const validateFile = (file2) => {
10182
+ if (accept.length && !accept.includes(file2.type)) {
10183
+ return acceptErrorMessage;
10184
+ }
10185
+ const sizeMB = file2.size / 1024 / 1024;
10186
+ if (sizeMB > maxSizeMB) {
10187
+ return `${sizeErrorMessage} (${maxSizeMB}MB)`;
10188
+ }
10189
+ return null;
10190
+ };
10191
+ const startUploadSimulation = (file2) => {
10192
+ let progress = 0;
10193
+ setUploadProgress(0);
10194
+ uploadIntervalRef.current = window.setInterval(() => {
10195
+ progress += 10;
10196
+ setUploadProgress(progress);
10197
+ if (progress >= 100) {
10198
+ clearInterval(uploadIntervalRef.current);
10199
+ onFileUpload == null ? void 0 : onFileUpload(file2);
10200
+ }
10201
+ }, 100);
10202
+ };
10203
+ const handleFileChange = (e) => {
10204
+ var _a;
10205
+ const selectedFile = (_a = e.target.files) == null ? void 0 : _a[0];
10206
+ if (!selectedFile) return;
10207
+ const error = validateFile(selectedFile);
10208
+ if (error) {
10209
+ setErrorMessage(error);
10210
+ setFile(null);
10211
+ return;
10212
+ }
10213
+ setFile(selectedFile);
10214
+ setErrorMessage("");
10215
+ startUploadSimulation(selectedFile);
10216
+ };
10217
+ const handleCancelUpload = () => {
10218
+ if (uploadIntervalRef.current) {
10219
+ clearInterval(uploadIntervalRef.current);
10220
+ }
10221
+ setFile(null);
10222
+ setUploadProgress(0);
10223
+ setErrorMessage("");
10224
+ };
10225
+ (0, import_react35.useEffect)(() => {
10226
+ return () => {
10227
+ if (uploadIntervalRef.current) {
10228
+ clearInterval(uploadIntervalRef.current);
10229
+ }
10230
+ };
10231
+ }, []);
10232
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
10233
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
10234
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: slots.inputWrapper(), children: [
10235
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(input_default, { name: "file", readOnly: true, variant: "outline", full: true, placeholder, defaultValue: file == null ? void 0 : file.name }),
10236
+ file && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
10237
+ icon_button_default,
10238
+ {
10239
+ name: "close",
10240
+ variant: "ghost",
10241
+ color: "neutral",
10242
+ onClick: handleCancelUpload,
10243
+ classNames: { base: slots.cancelButton() },
10244
+ "aria-label": "cancel"
10245
+ }
10246
+ )
10247
+ ] }),
10248
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, children: buttonText }),
10249
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
10250
+ ] }),
10251
+ showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: slots.progressBarContainer(), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: slots.progressBar(), style: { width: `${uploadProgress}%` } }) }),
10252
+ !errorMessage && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: slots.helperMessage(), children: helperMessage }),
10253
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: slots.errorMessage(), children: errorMessage })
10254
+ ] });
10255
+ }
10256
+ FileUpload.displayName = "FileUpload";
10257
+ var fileUpload_default = FileUpload;
10258
+ var fileUploadStyle = (0, import_tailwind_variants29.tv)({
10259
+ slots: {
10260
+ base: ["flex", "flex-col", "gap-[5px]"],
10261
+ container: ["flex", "items-center", "gap-[10px]"],
10262
+ inputWrapper: ["relative", "flex-1"],
10263
+ cancelButton: ["absolute", "top-1/2", "right-0", "-translate-y-1/2"],
10264
+ progressBarContainer: ["w-full", "h-[5px]", "bg-neutral-light", "rounded-full", "overflow-hidden"],
10265
+ progressBar: ["h-full", "bg-primary-main", "transition-all"],
10266
+ errorMessage: ["text-danger-main", "text-sm"],
10267
+ helperMessage: ["text-neutral-main", "text-sm"]
10268
+ }
10269
+ });
10156
10270
  // Annotate the CommonJS export names for ESM import in node:
10157
10271
  0 && (module.exports = {
10158
10272
  Avatar,
@@ -10164,6 +10278,7 @@ var treeStyle = tv({
10164
10278
  Chip,
10165
10279
  DateTimePicker,
10166
10280
  DefinitionTable,
10281
+ FileUpload,
10167
10282
  Icon,
10168
10283
  IconButton,
10169
10284
  Input,