@deepnoid/ui 0.1.26 → 0.1.28

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 (118) hide show
  1. package/.turbo/turbo-build.log +170 -166
  2. package/dist/{chunk-MSAULFDB.mjs → chunk-272FMLIL.mjs} +17 -17
  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-4OSN2OE2.mjs +178 -0
  6. package/dist/chunk-6TIIBU7J.mjs +35 -0
  7. package/dist/{chunk-Q72LZAPG.mjs → chunk-A7RU3FU5.mjs} +1 -1
  8. package/dist/{chunk-P5PJTJLY.mjs → chunk-BEQ3KZGS.mjs} +19 -19
  9. package/dist/{chunk-IRAHS4WS.mjs → chunk-G67WUZO3.mjs} +1 -1
  10. package/dist/{chunk-YBDA3WQP.mjs → chunk-IBI3OVQI.mjs} +1 -1
  11. package/dist/{chunk-BQUZRVYW.mjs → chunk-JTZUXVOU.mjs} +1 -1
  12. package/dist/{chunk-6OMHIMIA.mjs → chunk-JV7VLO2L.mjs} +2 -2
  13. package/dist/{chunk-B3DFSXGC.mjs → chunk-K7VUN5BS.mjs} +2 -2
  14. package/dist/{chunk-DLQFMOBN.mjs → chunk-KYJTZPXY.mjs} +1 -1
  15. package/dist/{chunk-OUAKGMDW.mjs → chunk-MEY4IL7D.mjs} +1 -1
  16. package/dist/{chunk-SCFTSNCK.mjs → chunk-NHVIKP4H.mjs} +6 -6
  17. package/dist/{chunk-PMMTMYRI.mjs → chunk-QIEKOGY7.mjs} +1 -1
  18. package/dist/{chunk-QY7LYAXT.mjs → chunk-RT3S3VVJ.mjs} +2 -2
  19. package/dist/{chunk-IVK24VIL.mjs → chunk-SO7BGWM7.mjs} +2 -2
  20. package/dist/{chunk-XQGD4ZIX.mjs → chunk-SP3JVQY3.mjs} +1 -1
  21. package/dist/{chunk-EAK5DVWA.mjs → chunk-UNH3BCGN.mjs} +8 -1
  22. package/dist/{chunk-6HX3PPL6.mjs → chunk-WLNLVX7Q.mjs} +1 -1
  23. package/dist/components/avatar/avatar.js +46 -35
  24. package/dist/components/avatar/avatar.mjs +2 -2
  25. package/dist/components/avatar/index.js +46 -35
  26. package/dist/components/avatar/index.mjs +2 -2
  27. package/dist/components/breadcrumb/breadcrumb.js +46 -35
  28. package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
  29. package/dist/components/breadcrumb/index.js +46 -35
  30. package/dist/components/breadcrumb/index.mjs +5 -5
  31. package/dist/components/button/button.js +46 -35
  32. package/dist/components/button/button.mjs +3 -3
  33. package/dist/components/button/icon-button.js +46 -35
  34. package/dist/components/button/icon-button.mjs +3 -3
  35. package/dist/components/button/index.js +46 -35
  36. package/dist/components/button/index.mjs +4 -4
  37. package/dist/components/chip/chip.js +46 -35
  38. package/dist/components/chip/chip.mjs +3 -3
  39. package/dist/components/chip/index.js +46 -35
  40. package/dist/components/chip/index.mjs +3 -3
  41. package/dist/components/dateTimePicker/calendar.js +46 -35
  42. package/dist/components/dateTimePicker/calendar.mjs +3 -3
  43. package/dist/components/dateTimePicker/dateTimePicker.js +46 -35
  44. package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
  45. package/dist/components/dateTimePicker/index.js +46 -35
  46. package/dist/components/dateTimePicker/index.mjs +9 -9
  47. package/dist/components/dateTimePicker/timePicker.js +46 -35
  48. package/dist/components/dateTimePicker/timePicker.mjs +5 -5
  49. package/dist/components/icon/Icon.d.mts +9 -5
  50. package/dist/components/icon/Icon.d.ts +9 -5
  51. package/dist/components/icon/Icon.js +46 -35
  52. package/dist/components/icon/Icon.mjs +2 -2
  53. package/dist/components/icon/index.js +46 -35
  54. package/dist/components/icon/index.mjs +2 -2
  55. package/dist/components/icon/template.d.mts +3 -2
  56. package/dist/components/icon/template.d.ts +3 -2
  57. package/dist/components/icon/template.js +46 -35
  58. package/dist/components/icon/template.mjs +1 -1
  59. package/dist/components/input/index.js +64 -53
  60. package/dist/components/input/index.mjs +3 -3
  61. package/dist/components/input/input.d.mts +44 -44
  62. package/dist/components/input/input.d.ts +44 -44
  63. package/dist/components/input/input.js +64 -53
  64. package/dist/components/input/input.mjs +3 -3
  65. package/dist/components/list/index.js +46 -35
  66. package/dist/components/list/index.mjs +4 -4
  67. package/dist/components/list/listItem.js +46 -35
  68. package/dist/components/list/listItem.mjs +4 -4
  69. package/dist/components/modal/index.js +46 -35
  70. package/dist/components/modal/index.mjs +5 -5
  71. package/dist/components/modal/modal.js +46 -35
  72. package/dist/components/modal/modal.mjs +5 -5
  73. package/dist/components/pagination/index.js +64 -53
  74. package/dist/components/pagination/index.mjs +4 -4
  75. package/dist/components/pagination/pagination.js +64 -53
  76. package/dist/components/pagination/pagination.mjs +4 -4
  77. package/dist/components/select/index.js +62 -51
  78. package/dist/components/select/index.mjs +3 -3
  79. package/dist/components/select/select.d.mts +38 -38
  80. package/dist/components/select/select.d.ts +38 -38
  81. package/dist/components/select/select.js +62 -51
  82. package/dist/components/select/select.mjs +3 -3
  83. package/dist/components/table/definition-table.d.mts +51 -0
  84. package/dist/components/table/definition-table.d.ts +51 -0
  85. package/dist/components/table/definition-table.js +351 -0
  86. package/dist/components/table/definition-table.mjs +9 -0
  87. package/dist/components/table/form-table.d.mts +1 -1
  88. package/dist/components/table/form-table.d.ts +1 -1
  89. package/dist/components/table/form-table.mjs +43 -3
  90. package/dist/components/table/index.d.mts +1 -1
  91. package/dist/components/table/index.d.ts +1 -1
  92. package/dist/components/table/index.js +86 -82
  93. package/dist/components/table/index.mjs +9 -9
  94. package/dist/components/table/table-head.js +8 -1
  95. package/dist/components/table/table-head.mjs +1 -1
  96. package/dist/components/table/table.js +72 -54
  97. package/dist/components/table/table.mjs +6 -6
  98. package/dist/components/toast/index.js +46 -35
  99. package/dist/components/toast/index.mjs +4 -4
  100. package/dist/components/toast/toast.js +46 -35
  101. package/dist/components/toast/toast.mjs +3 -3
  102. package/dist/components/toast/use-toast.js +46 -35
  103. package/dist/components/toast/use-toast.mjs +4 -4
  104. package/dist/components/tree/index.d.mts +1 -0
  105. package/dist/components/tree/index.d.ts +1 -0
  106. package/dist/components/tree/index.js +170 -84
  107. package/dist/components/tree/index.mjs +3 -3
  108. package/dist/components/tree/tree.d.mts +17 -10
  109. package/dist/components/tree/tree.d.ts +17 -10
  110. package/dist/components/tree/tree.js +175 -84
  111. package/dist/components/tree/tree.mjs +5 -3
  112. package/dist/index.d.mts +1 -1
  113. package/dist/index.d.ts +1 -1
  114. package/dist/index.js +226 -147
  115. package/dist/index.mjs +31 -31
  116. package/package.json +1 -1
  117. package/dist/chunk-ICZTNO4V.mjs +0 -49
  118. package/dist/chunk-TEQ723QO.mjs +0 -102
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ __export(index_exports, {
110
110
  CheckBox: () => checkbox_default,
111
111
  Chip: () => chip_default,
112
112
  DateTimePicker: () => dateTimePicker_default,
113
- FormTable: () => form_table_default,
113
+ DefinitionTable: () => definition_table_default,
114
114
  Icon: () => Icon_default,
115
115
  IconButton: () => icon_button_default,
116
116
  Input: () => input_default,
@@ -658,22 +658,61 @@ var template = {
658
658
  }
659
659
  );
660
660
  },
661
- // ----------------------------------- old ---------------------------------
662
- // ** Status **
663
- plus: ({ className, fill }) => {
661
+ plus: ({ className }) => {
662
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
663
+ "svg",
664
+ {
665
+ xmlns: "http://www.w3.org/2000/svg",
666
+ width: "18",
667
+ height: "18",
668
+ viewBox: "0 0 18 18",
669
+ fill: "none",
670
+ className,
671
+ children: [
672
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" }),
673
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 13.5V4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
674
+ ]
675
+ }
676
+ );
677
+ },
678
+ minus: ({ className }) => {
664
679
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
665
680
  "svg",
666
681
  {
667
- width: "24",
668
- height: "24",
669
- viewBox: "0 0 24 24",
682
+ xmlns: "http://www.w3.org/2000/svg",
683
+ width: "18",
684
+ height: "18",
685
+ viewBox: "0 0 18 18",
670
686
  fill: "none",
687
+ className,
688
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4.5 9H13.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
689
+ }
690
+ );
691
+ },
692
+ pencil: ({ className }) => {
693
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
694
+ "svg",
695
+ {
671
696
  xmlns: "http://www.w3.org/2000/svg",
697
+ width: "18",
698
+ height: "18",
699
+ viewBox: "0 0 18 18",
700
+ fill: "none",
672
701
  className,
673
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 4.5V19.5M19.5 12H4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
702
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
703
+ "path",
704
+ {
705
+ 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",
706
+ stroke: "currentColor",
707
+ strokeLinecap: "round",
708
+ strokeLinejoin: "round"
709
+ }
710
+ )
674
711
  }
675
712
  );
676
713
  },
714
+ // ----------------------------------- old ---------------------------------
715
+ // ** Status **
677
716
  check: ({ className, fill }) => {
678
717
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
679
718
  "svg",
@@ -2320,34 +2359,6 @@ var template = {
2320
2359
  }
2321
2360
  );
2322
2361
  },
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
2362
  "pencil-square": ({ className, fill }) => {
2352
2363
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2353
2364
  "svg",
@@ -5860,7 +5871,7 @@ var import_react9 = __toESM(require("react"));
5860
5871
  var import_jsx_runtime11 = require("react/jsx-runtime");
5861
5872
  var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
5862
5873
  const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
5863
- const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
5874
+ const { classNames, label, helperMessage, errorMessage, startContent, endContent, ...inputProps } = props;
5864
5875
  const inputRef = (0, import_react9.useRef)(null);
5865
5876
  const slots = (0, import_react9.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
5866
5877
  const getContentProps = (0, import_react9.useCallback)(
@@ -5903,7 +5914,7 @@ var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
5903
5914
  className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
5904
5915
  };
5905
5916
  return import_react9.default.cloneElement(endContent, mergedProps);
5906
- } else if (errorText) {
5917
+ } else if (errorMessage) {
5907
5918
  const iconProps = { ...getContentProps(), className: getContentProps().className };
5908
5919
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
5909
5920
  } else {
@@ -5957,8 +5968,8 @@ var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
5957
5968
  ]
5958
5969
  }
5959
5970
  ),
5960
- helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
5961
- errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
5971
+ helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
5972
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
5962
5973
  ] })
5963
5974
  ]
5964
5975
  }
@@ -5998,8 +6009,8 @@ var inputStyle = tv(
5998
6009
  "group-has-[:hover]/input:text-neutral-dark",
5999
6010
  "group-has-[p.error]/input:text-danger-main"
6000
6011
  ],
6001
- helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
6002
- errorText: ["text-danger-main"],
6012
+ helperMessage: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
6013
+ errorMessage: ["text-danger-main"],
6003
6014
  readonly: ["pointer-events-none", "!text-body-foreground"]
6004
6015
  },
6005
6016
  variants: {
@@ -6034,7 +6045,7 @@ var inputStyle = tv(
6034
6045
  "group-has-[:focus]/input:text-primary-main",
6035
6046
  "!group-has-[p.error]:not(input:focus):hover/input:text-primary-main"
6036
6047
  ],
6037
- helperText: [
6048
+ helperMessage: [
6038
6049
  "group-has-[:focus]/input:text-primary-main",
6039
6050
  "group-has-[:focus:hover]/input:text-primary-main",
6040
6051
  "group-has-[:focus]/input:hover:text-primary-main"
@@ -6045,7 +6056,7 @@ var inputStyle = tv(
6045
6056
  "group-has-[:focus]/input:text-secondary-main",
6046
6057
  "!group-has-[p.error]:not(input:focus):hover/input:text-secondary-main"
6047
6058
  ],
6048
- helperText: [
6059
+ helperMessage: [
6049
6060
  "group-has-[:focus]/input:text-secondary-main",
6050
6061
  "group-has-[:focus:hover]/input:text-secondary-main",
6051
6062
  "group-has-[:focus]/input:hover:text-secondary-main"
@@ -6058,32 +6069,32 @@ var inputStyle = tv(
6058
6069
  label: ["text-sm"],
6059
6070
  innerWrapper: ["gap-[4px]"],
6060
6071
  inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]", "gap-[4px]"],
6061
- helperText: ["text-sm"],
6062
- errorText: ["text-sm"]
6072
+ helperMessage: ["text-sm"],
6073
+ errorMessage: ["text-sm"]
6063
6074
  },
6064
6075
  md: {
6065
6076
  base: ["text-md", "gap-[6px]"],
6066
6077
  label: ["text-md"],
6067
6078
  innerWrapper: ["gap-[6px]"],
6068
6079
  inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]", "gap-[6px]"],
6069
- helperText: ["text-sm"],
6070
- errorText: ["text-sm"]
6080
+ helperMessage: ["text-sm"],
6081
+ errorMessage: ["text-sm"]
6071
6082
  },
6072
6083
  lg: {
6073
6084
  base: ["text-lg", "gap-[8px]"],
6074
6085
  label: ["text-lg"],
6075
6086
  innerWrapper: ["gap-[8px]"],
6076
6087
  inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]", "gap-[8px]"],
6077
- helperText: ["text-md"],
6078
- errorText: ["text-md"]
6088
+ helperMessage: ["text-md"],
6089
+ errorMessage: ["text-md"]
6079
6090
  },
6080
6091
  xl: {
6081
6092
  base: ["text-xl", "gap-[10px]"],
6082
6093
  label: ["text-xl"],
6083
6094
  innerWrapper: ["gap-[10px]"],
6084
6095
  inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]", "gap-[10px]"],
6085
- helperText: ["text-md"],
6086
- errorText: ["text-md"]
6096
+ helperMessage: ["text-md"],
6097
+ errorMessage: ["text-md"]
6087
6098
  }
6088
6099
  },
6089
6100
  direction: {
@@ -6107,8 +6118,8 @@ var inputStyle = tv(
6107
6118
  "group-has-[p.error]/input:placeholder:text-danger-light"
6108
6119
  ],
6109
6120
  content: ["text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
6110
- helperText: ["!text-neutral-light"],
6111
- errorText: ["!text-danger-light"]
6121
+ helperMessage: ["!text-neutral-light"],
6122
+ errorMessage: ["!text-danger-light"]
6112
6123
  }
6113
6124
  }
6114
6125
  },
@@ -6832,7 +6843,14 @@ var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames,
6832
6843
  },
6833
6844
  `${column.field}${index}thead`
6834
6845
  ));
6835
- const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
6846
+ const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6847
+ checkbox_default,
6848
+ {
6849
+ size,
6850
+ checked: isCheckedAll,
6851
+ onChange: (e) => onCheckAll(e.target.checked)
6852
+ }
6853
+ ) }) });
6836
6854
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
6837
6855
  renderColumnHeaders(),
6838
6856
  renderSelectAllCheckbox()
@@ -7550,41 +7568,27 @@ var tableStyle = (0, import_tailwind_variants15.tv)({
7550
7568
  }
7551
7569
  });
7552
7570
 
7553
- // src/components/table/form-table.tsx
7571
+ // src/components/table/definition-table.tsx
7554
7572
  var import_react18 = require("react");
7555
7573
  var import_jsx_runtime20 = require("react/jsx-runtime");
7556
7574
  var DEFAULT_COLUMN_CLASSES = [
7557
7575
  "w-[120px] px-[10px] py-[9.5px] font-bold text-md text-body-foreground border-r border-neutral-light",
7558
7576
  "px-[10px] py-[9.5px]"
7559
7577
  ];
7560
- var FormTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
7578
+ var DefinitionTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
7561
7579
  var _a;
7562
7580
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("td", { className: (_a = columnClasses[index]) != null ? _a : DEFAULT_COLUMN_CLASSES[index], children: col }, index);
7563
7581
  }) });
7564
- var FormTable = (0, import_react18.forwardRef)(
7565
- ({ rows, onSubmit, footer, classNames }, ref) => {
7566
- const slots = (0, import_react18.useMemo)(() => formTableStyle(), []);
7567
- const content = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
7568
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tbody", { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormTableRow, { ...row }, i)) }) }),
7569
- footer && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: footer })
7570
- ] });
7571
- if (onSubmit) {
7572
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7573
- "form",
7574
- {
7575
- ref,
7576
- onSubmit,
7577
- className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
7578
- children: content
7579
- }
7580
- );
7581
- }
7582
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: content });
7583
- }
7584
- );
7585
- FormTable.displayName = "FormTable";
7586
- var form_table_default = FormTable;
7587
- var formTableStyle = tv({
7582
+ var DefinitionTable = (0, import_react18.forwardRef)(({ rows, footer, classNames }, ref) => {
7583
+ const slots = (0, import_react18.useMemo)(() => DefinitionTableStyle(), []);
7584
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
7585
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tbody", { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DefinitionTableRow, { ...row }, i)) }) }),
7586
+ footer && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: footer })
7587
+ ] });
7588
+ });
7589
+ DefinitionTable.displayName = "DefinitionTable";
7590
+ var definition_table_default = DefinitionTable;
7591
+ var DefinitionTableStyle = tv({
7588
7592
  slots: {
7589
7593
  base: ["flex", "flex-col", "gap-[30px]"],
7590
7594
  table: ["w-full", "table-fixed", "border", "border-neutral-light"]
@@ -7601,8 +7605,8 @@ var Select = (0, import_react19.forwardRef)((originalProps, ref) => {
7601
7605
  const {
7602
7606
  label,
7603
7607
  options,
7604
- helperText,
7605
- errorText,
7608
+ helperMessage,
7609
+ errorMessage,
7606
7610
  classNames,
7607
7611
  defaultSelectedOptions = [],
7608
7612
  onChange,
@@ -7730,8 +7734,8 @@ var Select = (0, import_react19.forwardRef)((originalProps, ref) => {
7730
7734
  ]
7731
7735
  }
7732
7736
  ),
7733
- helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
7734
- errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
7737
+ helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
7738
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
7735
7739
  ] })
7736
7740
  ]
7737
7741
  }
@@ -7803,8 +7807,8 @@ var select = tv({
7803
7807
  ],
7804
7808
  optionsWrapper: ["border", "rounded", "bg-white", "shadow", "overflow-auto"],
7805
7809
  option: ["flex", "justify-between", "items-center", "cursor-pointer"],
7806
- helperText: ["text-neutral-main"],
7807
- errorText: ["text-danger-main"],
7810
+ helperMessage: ["text-neutral-main"],
7811
+ errorMessage: ["text-danger-main"],
7808
7812
  readonly: ["pointer-events-none", "!bg-trans-soft"]
7809
7813
  },
7810
7814
  variants: {
@@ -7827,8 +7831,8 @@ var select = tv({
7827
7831
  selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
7828
7832
  select: ["text-sm"],
7829
7833
  option: ["px-[4px]", "py-[3px]", "text-sm"],
7830
- helperText: ["text-sm"],
7831
- errorText: ["text-sm"]
7834
+ helperMessage: ["text-sm"],
7835
+ errorMessage: ["text-sm"]
7832
7836
  },
7833
7837
  md: {
7834
7838
  base: ["text-md", "gap-[6px]", "rounded-md"],
@@ -7837,8 +7841,8 @@ var select = tv({
7837
7841
  selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
7838
7842
  select: ["text-md"],
7839
7843
  option: ["px-[6px]", "py-[5.5px]", "text-md"],
7840
- helperText: ["text-sm"],
7841
- errorText: ["text-sm"]
7844
+ helperMessage: ["text-sm"],
7845
+ errorMessage: ["text-sm"]
7842
7846
  },
7843
7847
  lg: {
7844
7848
  base: ["text-lg", "gap-[8px]"],
@@ -7847,8 +7851,8 @@ var select = tv({
7847
7851
  selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
7848
7852
  select: ["text-lg"],
7849
7853
  option: ["px-[8px]", "py-[8px]", "text-lg"],
7850
- helperText: ["text-md"],
7851
- errorText: ["text-md"]
7854
+ helperMessage: ["text-md"],
7855
+ errorMessage: ["text-md"]
7852
7856
  },
7853
7857
  xl: {
7854
7858
  base: ["text-xl", "gap-[10px]"],
@@ -7857,8 +7861,8 @@ var select = tv({
7857
7861
  selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
7858
7862
  select: ["text-xl"],
7859
7863
  option: ["px-[10px]", "py-[11.5px]"],
7860
- helperText: ["text-md"],
7861
- errorText: ["text-md"]
7864
+ helperMessage: ["text-md"],
7865
+ errorMessage: ["text-md"]
7862
7866
  }
7863
7867
  },
7864
7868
  direction: {
@@ -7888,8 +7892,8 @@ var select = tv({
7888
7892
  "group-has-[p.error]/select:text-danger-light",
7889
7893
  "group-has-[p.error]/select:placeholder:text-danger-light"
7890
7894
  ],
7891
- helperText: ["!text-neutral-light"],
7892
- errorText: ["!text-danger-light"]
7895
+ helperMessage: ["!text-neutral-light"],
7896
+ errorMessage: ["!text-danger-light"]
7893
7897
  }
7894
7898
  },
7895
7899
  isSelected: {
@@ -10002,76 +10006,151 @@ var dateTimePickerStyle = tv({
10002
10006
  var import_react34 = require("react");
10003
10007
  var import_jsx_runtime34 = require("react/jsx-runtime");
10004
10008
  var TreeNodeItem = (0, import_react34.forwardRef)(
10005
- ({ node, depth, fileIcon, isLoading, classNames }, ref) => {
10006
- var _a;
10009
+ ({ node, depth, fileIcon, isLoading, classNames, onExpand }, ref) => {
10007
10010
  const [isOpen, setIsOpen] = (0, import_react34.useState)(false);
10011
+ const [children, setChildren] = (0, import_react34.useState)(node.children);
10012
+ const [isLoadingChildren, setIsLoadingChildren] = (0, import_react34.useState)(false);
10008
10013
  const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
10009
- const toggleOpen = (0, import_react34.useCallback)(() => {
10014
+ const hasMore = (0, import_react34.useMemo)(() => {
10015
+ if (node.isLeaf) return false;
10016
+ if (Array.isArray(children)) return children.length > 0;
10017
+ return typeof onExpand === "function";
10018
+ }, [node.isLeaf, children, onExpand]);
10019
+ const toggleOpen = (0, import_react34.useCallback)(async () => {
10020
+ if (!isOpen && !children && onExpand && !node.isLeaf) {
10021
+ setIsLoadingChildren(true);
10022
+ try {
10023
+ const result = await onExpand(node);
10024
+ setChildren(result);
10025
+ } catch (e) {
10026
+ console.error("Failed to load child nodes ", e);
10027
+ } finally {
10028
+ setIsLoadingChildren(false);
10029
+ }
10030
+ }
10010
10031
  setIsOpen((prev) => !prev);
10011
- }, []);
10032
+ }, [isOpen, children, onExpand, node]);
10033
+ const handleClick = () => {
10034
+ var _a;
10035
+ toggleOpen();
10036
+ (_a = node.onClick) == null ? void 0 : _a.call(node);
10037
+ };
10038
+ const handleRightClick = (e) => {
10039
+ var _a;
10040
+ e.preventDefault();
10041
+ (_a = node.onRightClick) == null ? void 0 : _a.call(node, e);
10042
+ };
10043
+ const marginClass = depth > 1 ? hasMore ? "ml-[30px]" : "ml-[55px]" : hasMore ? "" : "ml-[25px]";
10012
10044
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10013
10045
  "div",
10014
10046
  {
10015
10047
  ref,
10016
10048
  className: clsx(
10017
- depth > 1 ? "ml-[30px]" : "",
10049
+ marginClass,
10018
10050
  "transition-all duration-150 ease-out",
10019
10051
  isLoading ? "-translate-y-2 opacity-0" : "translate-y-0 opacity-100"
10020
10052
  ),
10021
10053
  children: [
10022
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), onClick: toggleOpen, children: [
10023
- node.children && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10024
- Icon_default,
10054
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10055
+ "div",
10056
+ {
10057
+ className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
10058
+ onClick: handleClick,
10059
+ onContextMenu: handleRightClick,
10060
+ children: [
10061
+ hasMore && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10062
+ Icon_default,
10063
+ {
10064
+ name: "right-chevron",
10065
+ className: clsx(
10066
+ "text-neutral-main cursor-pointer transition-transform duration-150",
10067
+ isOpen ? "rotate-90" : "rotate-0"
10068
+ )
10069
+ }
10070
+ ),
10071
+ fileIcon,
10072
+ node.label
10073
+ ]
10074
+ }
10075
+ ),
10076
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
10077
+ isLoadingChildren && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-neutral py-1 text-sm", children: "loading..." }),
10078
+ children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10079
+ TreeNodeItem,
10025
10080
  {
10026
- name: "right-chevron",
10027
- className: `text-neutral-main cursor-pointer transition-transform duration-150 ${isOpen ? "rotate-90" : "rotate-0"}`
10028
- }
10029
- ),
10030
- fileIcon,
10031
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), onClick: () => {
10032
- var _a2;
10033
- return (_a2 = node.onClick) == null ? void 0 : _a2.call(node);
10034
- }, children: node.label })
10035
- ] }),
10036
- isOpen && ((_a = node.children) == null ? void 0 : _a.map((child) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TreeNodeItem, { node: child, depth: depth + 1, classNames, fileIcon }, child.id)))
10081
+ node: child,
10082
+ depth: depth + 1,
10083
+ classNames,
10084
+ fileIcon,
10085
+ onExpand
10086
+ },
10087
+ child.id
10088
+ ))
10089
+ ] })
10037
10090
  ]
10038
10091
  }
10039
10092
  );
10040
10093
  }
10041
10094
  );
10042
- var Tree = (0, import_react34.forwardRef)(
10043
- ({ headerContent, group, groupIcon, fileIcon, isLoading, classNames }, ref) => {
10044
- const { label, data, onClick } = group;
10045
- const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
10046
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
10047
- headerContent && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: headerContent }),
10048
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
10049
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
10050
- groupIcon,
10051
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), onClick, children: label })
10052
- ] }),
10053
- data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10054
- TreeNodeItem,
10055
- {
10056
- node,
10057
- depth: 1,
10058
- classNames,
10059
- fileIcon,
10060
- isLoading
10061
- },
10062
- node.id
10063
- ))
10064
- ] })
10065
- ] });
10066
- }
10067
- );
10068
10095
  TreeNodeItem.displayName = "TreeNodeItem";
10096
+ var Tree = ({
10097
+ headerContent,
10098
+ group,
10099
+ groupIcon,
10100
+ fileIcon,
10101
+ isLoading = false,
10102
+ classNames,
10103
+ onExpand
10104
+ }) => {
10105
+ const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
10106
+ const [isOpen, setIsOpen] = (0, import_react34.useState)(true);
10107
+ const handleToggle = () => {
10108
+ var _a;
10109
+ setIsOpen((prev) => !prev);
10110
+ (_a = group.onClick) == null ? void 0 : _a.call(group);
10111
+ };
10112
+ const handleRightClick = (e) => {
10113
+ var _a;
10114
+ e.preventDefault();
10115
+ (_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
10116
+ };
10117
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
10118
+ headerContent && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: headerContent }),
10119
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
10120
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10121
+ "div",
10122
+ {
10123
+ className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
10124
+ onClick: handleToggle,
10125
+ onContextMenu: handleRightClick,
10126
+ children: [
10127
+ groupIcon,
10128
+ group.label
10129
+ ]
10130
+ }
10131
+ ),
10132
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10133
+ TreeNodeItem,
10134
+ {
10135
+ node,
10136
+ depth: 1,
10137
+ classNames,
10138
+ fileIcon,
10139
+ isLoading,
10140
+ onExpand
10141
+ },
10142
+ node.id
10143
+ )) })
10144
+ ] })
10145
+ ] });
10146
+ };
10069
10147
  Tree.displayName = "Tree";
10070
10148
  var tree_default = Tree;
10071
10149
  var treeStyle = tv({
10072
10150
  slots: {
10073
10151
  base: ["border", "border-neutral-light", "rounded-xl", "p-[20px]", "flex", "flex-col", "gap-[20px]", "select-none"],
10074
- wrapper: [
10152
+ wrapper: ["flex", "flex-col", "gap-[5px]"],
10153
+ group: [
10075
10154
  "flex",
10076
10155
  "items-center",
10077
10156
  "gap-[5px]",
@@ -10080,9 +10159,9 @@ var treeStyle = tv({
10080
10159
  "text-body-foreground",
10081
10160
  "hover:bg-neutral-soft",
10082
10161
  "p-[5px]",
10083
- "rounded-[5px]"
10084
- ],
10085
- label: ["cursor-pointer"]
10162
+ "rounded-[5px]",
10163
+ "cursor-pointer"
10164
+ ]
10086
10165
  }
10087
10166
  });
10088
10167
  // Annotate the CommonJS export names for ESM import in node:
@@ -10095,7 +10174,7 @@ var treeStyle = tv({
10095
10174
  CheckBox,
10096
10175
  Chip,
10097
10176
  DateTimePicker,
10098
- FormTable,
10177
+ DefinitionTable,
10099
10178
  Icon,
10100
10179
  IconButton,
10101
10180
  Input,