@deepnoid/ui 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +180 -185
- package/dist/{chunk-NNDBEMPD.mjs → chunk-2FWSRQ57.mjs} +3 -3
- package/dist/{chunk-W6H3DI2L.mjs → chunk-5QFMOWCP.mjs} +1 -1
- package/dist/{chunk-DQX2CILT.mjs → chunk-CWDGTOBA.mjs} +2 -2
- package/dist/{chunk-XUY4V6IQ.mjs → chunk-E474F74W.mjs} +3 -3
- package/dist/{chunk-LW5CNZW5.mjs → chunk-EP66I5EV.mjs} +4 -4
- package/dist/{chunk-53UVUUMJ.mjs → chunk-IBA6DLZR.mjs} +5 -5
- package/dist/{chunk-QC2XOK2E.mjs → chunk-KXTA5GBQ.mjs} +4 -6
- package/dist/{chunk-VYUH25IC.mjs → chunk-LCLEMQ5R.mjs} +4 -4
- package/dist/{chunk-ZNDWOIP4.mjs → chunk-LOME6UDA.mjs} +1 -1
- package/dist/{chunk-JDWX2LKJ.mjs → chunk-MIQMNEXX.mjs} +1 -1
- package/dist/{chunk-CR7MUSOG.mjs → chunk-NEPQ6OUU.mjs} +1 -1
- package/dist/{chunk-YNKC7SHK.mjs → chunk-NKPABTQU.mjs} +2 -2
- package/dist/{chunk-BEKIKGI3.mjs → chunk-NLDBVRJT.mjs} +1 -1
- package/dist/{chunk-B2BSN6WP.mjs → chunk-O5KY2UQT.mjs} +1 -1
- package/dist/{chunk-CY2XMA4S.mjs → chunk-SDJS7YCJ.mjs} +3 -3
- package/dist/{chunk-3I7QA57V.mjs → chunk-SQF2SUJZ.mjs} +29 -0
- package/dist/{chunk-DZ6QJCDZ.mjs → chunk-TVIVXGEN.mjs} +1 -1
- package/dist/{chunk-XIQHJBEM.mjs → chunk-XLSYGPQA.mjs} +1 -1
- package/dist/{chunk-FNBVQ77W.mjs → chunk-YLYLDWUR.mjs} +2 -2
- package/dist/{chunk-BOT5U4IL.mjs → chunk-YOE2AVC6.mjs} +1 -1
- package/dist/{chunk-ATFYXYEV.mjs → chunk-ZGPNJQZX.mjs} +3 -3
- package/dist/{chunk-SWIYZRBZ.mjs → chunk-ZJURCHUU.mjs} +1 -1
- package/dist/components/avatar/avatar.js +29 -0
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +29 -0
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +29 -0
- package/dist/components/breadcrumb/breadcrumb.mjs +8 -8
- package/dist/components/breadcrumb/index.js +29 -0
- package/dist/components/breadcrumb/index.mjs +8 -8
- package/dist/components/button/button-group.d.mts +0 -1
- package/dist/components/button/button-group.d.ts +0 -1
- package/dist/components/button/button-group.js +4 -6
- package/dist/components/button/button-group.mjs +1 -1
- package/dist/components/button/button.js +29 -0
- package/dist/components/button/button.mjs +4 -4
- package/dist/components/button/icon-button.js +29 -0
- package/dist/components/button/icon-button.mjs +4 -4
- package/dist/components/button/index.js +33 -6
- package/dist/components/button/index.mjs +11 -11
- package/dist/components/chip/chip.js +29 -0
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +29 -0
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/dateTimePicker/calendar.js +29 -0
- package/dist/components/dateTimePicker/calendar.mjs +3 -3
- package/dist/components/dateTimePicker/dateTimePicker.js +29 -0
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +29 -0
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +29 -0
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/fileUpload/fileUpload.js +29 -0
- package/dist/components/fileUpload/fileUpload.mjs +9 -9
- package/dist/components/fileUpload/index.js +29 -0
- package/dist/components/fileUpload/index.mjs +9 -9
- package/dist/components/icon/Icon.d.mts +4 -0
- package/dist/components/icon/Icon.d.ts +4 -0
- package/dist/components/icon/Icon.js +29 -0
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +29 -0
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +1 -0
- package/dist/components/icon/template.d.ts +1 -0
- package/dist/components/icon/template.js +29 -0
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +29 -0
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +29 -0
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +29 -0
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/listItem.js +29 -0
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +29 -0
- package/dist/components/modal/index.mjs +8 -8
- package/dist/components/modal/modal.js +29 -0
- package/dist/components/modal/modal.mjs +8 -8
- package/dist/components/pagination/index.js +29 -0
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +29 -0
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/select/index.js +29 -0
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.js +29 -0
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/definition-table.d.mts +13 -6
- package/dist/components/table/definition-table.d.ts +13 -6
- package/dist/components/table/definition-table.js +99 -12
- package/dist/components/table/definition-table.mjs +2 -1
- package/dist/components/table/index.d.mts +1 -2
- package/dist/components/table/index.d.ts +1 -2
- package/dist/components/table/index.js +41 -41
- package/dist/components/table/index.mjs +10 -14
- package/dist/components/table/table.js +29 -0
- package/dist/components/table/table.mjs +7 -7
- package/dist/components/toast/index.js +29 -0
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +29 -0
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +29 -0
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.js +29 -0
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.js +29 -0
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +361 -363
- package/dist/index.mjs +51 -55
- package/package.json +1 -1
- package/dist/chunk-6TIIBU7J.mjs +0 -35
- package/dist/components/table/definition-table2.d.mts +0 -58
- package/dist/components/table/definition-table2.d.ts +0 -58
- package/dist/components/table/definition-table2.js +0 -438
- package/dist/components/table/definition-table2.mjs +0 -10
- /package/dist/{chunk-DLR42ZKG.mjs → chunk-DX3KXNP6.mjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -114,7 +114,6 @@ __export(index_exports, {
|
|
|
114
114
|
CircularProgress: () => circularProgress_default,
|
|
115
115
|
DateTimePicker: () => dateTimePicker_default,
|
|
116
116
|
DefinitionTable: () => definition_table_default,
|
|
117
|
-
DefinitionTable2: () => definition_table2_default,
|
|
118
117
|
Drawer: () => drawer_default,
|
|
119
118
|
FileUpload: () => fileUpload_default,
|
|
120
119
|
Icon: () => Icon_default,
|
|
@@ -4006,6 +4005,35 @@ var template = {
|
|
|
4006
4005
|
}
|
|
4007
4006
|
);
|
|
4008
4007
|
},
|
|
4008
|
+
refresh: ({ className, fill }) => {
|
|
4009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
4010
|
+
"svg",
|
|
4011
|
+
{
|
|
4012
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4013
|
+
width: "18",
|
|
4014
|
+
height: "18",
|
|
4015
|
+
viewBox: "0 0 18 18",
|
|
4016
|
+
fill: "none",
|
|
4017
|
+
className,
|
|
4018
|
+
children: [
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
4020
|
+
"path",
|
|
4021
|
+
{
|
|
4022
|
+
d: "M3.3122 10.2136C3.32949 10.2262 3.34679 10.2388 3.36462 10.2518C3.48724 10.3411 3.6091 10.4315 3.73072 10.5223C3.83253 10.5982 3.9346 10.6738 4.03672 10.7493C4.05665 10.764 4.07659 10.7787 4.09712 10.7939C4.25049 10.9071 4.40488 11.0188 4.55959 11.1301C4.74173 11.2613 4.92242 11.3946 5.1027 11.5285C5.16947 11.578 5.23649 11.6271 5.30412 11.6754C5.46803 11.7936 5.59817 11.8889 5.6782 12.0824C5.71175 12.2883 5.69157 12.4584 5.57352 12.6316C5.48141 12.7404 5.37015 12.8057 5.2305 12.8224C4.86428 12.8364 4.62387 12.6038 4.35 12.3836C4.30059 12.3478 4.25042 12.3209 4.19568 12.2946C4.56413 12.8334 5.00449 13.3413 5.5343 13.7185C5.54949 13.7294 5.56467 13.7404 5.58032 13.7517C6.17344 14.1788 6.8345 14.5044 7.54223 14.6768C7.57299 14.6843 7.57299 14.6843 7.60437 14.692C8.95877 15.0104 10.3646 14.7999 11.5849 14.1292C11.6152 14.113 11.6455 14.0969 11.6767 14.0802C12.0797 13.8565 12.4486 13.5674 12.7755 13.2391C12.8174 13.1972 12.86 13.1561 12.9028 13.115C13.2694 12.7575 13.5738 12.3316 13.8161 11.877C13.8266 11.8574 13.8371 11.8377 13.8479 11.8175C13.8679 11.7797 13.8876 11.7418 13.9069 11.7036C13.9871 11.5506 14.0966 11.4228 14.2621 11.3636C14.4387 11.3457 14.6243 11.3317 14.7708 11.4458C14.9067 11.5851 14.9872 11.6879 15 11.889C14.9902 12.4502 14.4353 13.067 14.1015 13.472C14.0867 13.4902 14.0719 13.5084 14.0566 13.5272C13.8236 13.8129 13.5787 14.0828 13.2983 14.3209C13.2845 14.3326 13.2706 14.3444 13.2564 14.3566C12.3391 15.1343 11.2587 15.6583 10.0856 15.8816C10.0638 15.8861 10.0419 15.8905 10.0194 15.8951C9.28033 16.0406 8.41337 16.0335 7.67609 15.8816C7.6518 15.8768 7.62751 15.8719 7.60249 15.8669C6.39983 15.6218 5.27004 15.0772 4.36887 14.219C4.31401 14.1672 4.25813 14.1181 4.2007 14.0693C3.81216 13.7214 3.47789 13.2894 3.20511 12.8422C3.18026 12.9185 3.17227 12.9761 3.16683 13.0555C3.16486 13.0813 3.1629 13.1071 3.16087 13.1337C3.15694 13.1875 3.15317 13.2412 3.14957 13.295C3.12913 13.5562 3.08417 13.787 2.88384 13.9649C2.7243 14.0603 2.5773 14.0706 2.39911 14.0361C2.24143 13.9881 2.14631 13.8817 2.0539 13.7458C1.93607 13.3843 2.04318 12.8848 2.07701 12.5124C2.08223 12.4534 2.08744 12.3945 2.09264 12.3355C2.10349 12.2131 2.11451 12.0907 2.12566 11.9682C2.13989 11.8117 2.15363 11.6551 2.16723 11.4984C2.17783 11.3772 2.18872 11.2559 2.19969 11.1347C2.20488 11.0769 2.20997 11.0191 2.21496 10.9614C2.22195 10.8808 2.22934 10.8003 2.23684 10.7199C2.2388 10.6963 2.24077 10.6727 2.24279 10.6484C2.26415 10.4277 2.32711 10.2664 2.48225 10.1041C2.79568 9.9104 3.03599 10.0102 3.3122 10.2136Z",
|
|
4023
|
+
fill: "currentColor"
|
|
4024
|
+
}
|
|
4025
|
+
),
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
4027
|
+
"path",
|
|
4028
|
+
{
|
|
4029
|
+
d: "M10.3239 2.11846C10.3486 2.12344 10.3733 2.12843 10.3988 2.13356C10.7191 2.19966 11.0323 2.2835 11.3413 2.39201C11.3742 2.4034 11.4072 2.41479 11.4411 2.42652C12.2465 2.71449 13.0124 3.17493 13.6308 3.77718C13.6861 3.83095 13.7423 3.88106 13.801 3.93073C14.1891 4.27723 14.5227 4.70907 14.7949 5.15487C14.8197 5.0787 14.8277 5.02115 14.8332 4.9418C14.8351 4.91602 14.8371 4.89024 14.8391 4.86368C14.8431 4.80998 14.8468 4.75627 14.8504 4.70255C14.8709 4.4414 14.9159 4.21135 15.1162 4.03331C15.2633 3.9437 15.404 3.92763 15.5713 3.95124C15.7372 4.00166 15.8506 4.10665 15.9461 4.25215C16.0639 4.6133 15.9568 5.11234 15.923 5.48441C15.9178 5.54331 15.9126 5.60221 15.9074 5.66112C15.8965 5.78343 15.8855 5.90573 15.8743 6.02801C15.8601 6.18443 15.8464 6.34089 15.8328 6.49736C15.8222 6.61852 15.8113 6.73965 15.8003 6.86078C15.7951 6.91848 15.79 6.9762 15.785 7.03392C15.778 7.11437 15.7707 7.19477 15.7632 7.27518C15.7612 7.29874 15.7592 7.3223 15.7572 7.34658C15.7359 7.56707 15.6729 7.72816 15.5177 7.89037C15.3806 7.98276 15.2217 8.02194 15.0591 7.98782C14.9009 7.93579 14.7809 7.8596 14.6493 7.75702C14.607 7.72492 14.5647 7.69282 14.5224 7.66074C14.501 7.64435 14.4796 7.62797 14.4575 7.61109C14.3561 7.53374 14.2534 7.45818 14.1507 7.38259C14.1308 7.36788 14.1108 7.35316 14.0903 7.33799C13.9368 7.22476 13.7823 7.11311 13.6275 7.00186C13.4691 6.88789 13.3119 6.77222 13.1553 6.6558C13.0538 6.58057 12.9518 6.50638 12.8485 6.43393C12.828 6.41952 12.8076 6.40512 12.7865 6.39028C12.7481 6.36323 12.7095 6.33639 12.6707 6.30982C12.5197 6.20336 12.3941 6.08635 12.3201 5.91226C12.2895 5.70687 12.3087 5.5379 12.4265 5.36526C12.5186 5.2566 12.6299 5.19136 12.7695 5.17474C13.1357 5.16074 13.3761 5.39311 13.65 5.61308C13.6994 5.64883 13.7496 5.67572 13.8043 5.70197C13.4359 5.1637 12.9955 4.65632 12.4657 4.2795C12.4505 4.26854 12.4353 4.25757 12.4197 4.24627C11.1756 3.35145 9.67165 2.99546 8.16884 3.23916C7.06641 3.43778 6.02544 3.95488 5.22454 4.7584C5.18259 4.80028 5.13997 4.84134 5.09724 4.88238C4.73063 5.23953 4.42624 5.66503 4.18394 6.11913C4.17343 6.13877 4.16291 6.15841 4.15207 6.17864C4.13208 6.21637 4.11241 6.25428 4.09314 6.29241C4.01288 6.44521 3.9034 6.57295 3.73791 6.63204C3.56126 6.65 3.37569 6.66398 3.22924 6.54997C3.09335 6.41083 3.01275 6.30814 3 6.10716C3.01378 5.31988 3.94369 4.41615 4.46547 3.89247C5.41306 2.9629 6.63273 2.37386 7.9144 2.11846C7.93655 2.1139 7.95869 2.10934 7.98151 2.10464C8.71997 1.95962 9.58737 1.96637 10.3239 2.11846Z",
|
|
4030
|
+
fill: "currentColor"
|
|
4031
|
+
}
|
|
4032
|
+
)
|
|
4033
|
+
]
|
|
4034
|
+
}
|
|
4035
|
+
);
|
|
4036
|
+
},
|
|
4009
4037
|
reset: ({ className, fill }) => {
|
|
4010
4038
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
4011
4039
|
"svg",
|
|
@@ -5855,14 +5883,12 @@ var textButtonStyle = tv({
|
|
|
5855
5883
|
// src/components/button/button-group.tsx
|
|
5856
5884
|
var import_react7 = __toESM(require("react"));
|
|
5857
5885
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
5858
|
-
var ButtonGroup = (0, import_react7.forwardRef)(({ children, ...props }, ref) => {
|
|
5859
|
-
|
|
5860
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref, className: buttonGroup({ className: (_a = props.classNames) == null ? void 0 : _a.base }), children: import_react7.default.Children.map(children, (child) => {
|
|
5886
|
+
var ButtonGroup = (0, import_react7.forwardRef)(({ children, classNames, ...props }, ref) => {
|
|
5887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref, className: buttonGroup({ className: classNames == null ? void 0 : classNames.base }), children: import_react7.default.Children.map(children, (child) => {
|
|
5861
5888
|
return import_react7.default.cloneElement(child, {
|
|
5889
|
+
isInGroup: true,
|
|
5862
5890
|
...props,
|
|
5863
|
-
...child.props
|
|
5864
|
-
disabled: props.isDisabled,
|
|
5865
|
-
isInGroup: true
|
|
5891
|
+
...child.props
|
|
5866
5892
|
});
|
|
5867
5893
|
}) });
|
|
5868
5894
|
});
|
|
@@ -7851,33 +7877,6 @@ var tableStyle = (0, import_tailwind_variants16.tv)({
|
|
|
7851
7877
|
// src/components/table/definition-table.tsx
|
|
7852
7878
|
var import_react16 = require("react");
|
|
7853
7879
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7854
|
-
var DEFAULT_COLUMN_CLASSES = [
|
|
7855
|
-
"w-[120px] px-[10px] py-[9.5px] font-bold text-md text-body-foreground border-r border-neutral-light",
|
|
7856
|
-
"px-[10px] py-[9.5px]"
|
|
7857
|
-
];
|
|
7858
|
-
var DefinitionTableRow = ({ columns, columnClasses = [] }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: "border-neutral-light min-h-[50px] border-b", children: columns.map((col, index) => {
|
|
7859
|
-
var _a;
|
|
7860
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: (_a = columnClasses[index]) != null ? _a : DEFAULT_COLUMN_CLASSES[index], children: col }, index);
|
|
7861
|
-
}) });
|
|
7862
|
-
var DefinitionTable = (0, import_react16.forwardRef)(({ rows, footer, classNames }, ref) => {
|
|
7863
|
-
const slots = (0, import_react16.useMemo)(() => DefinitionTableStyle(), []);
|
|
7864
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
7865
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DefinitionTableRow, { ...row }, i)) }) }),
|
|
7866
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: footer })
|
|
7867
|
-
] });
|
|
7868
|
-
});
|
|
7869
|
-
DefinitionTable.displayName = "DefinitionTable";
|
|
7870
|
-
var definition_table_default = DefinitionTable;
|
|
7871
|
-
var DefinitionTableStyle = tv({
|
|
7872
|
-
slots: {
|
|
7873
|
-
base: ["flex", "flex-col", "gap-[30px]"],
|
|
7874
|
-
table: ["w-full", "table-fixed", "border", "border-neutral-light"]
|
|
7875
|
-
}
|
|
7876
|
-
});
|
|
7877
|
-
|
|
7878
|
-
// src/components/table/definition-table2.tsx
|
|
7879
|
-
var import_react17 = require("react");
|
|
7880
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7881
7880
|
var DEFAULT_CELL_CLASSES = "px-[10px] py-[9.5px] text-md border-r border-neutral-light";
|
|
7882
7881
|
var FIRST_CELL_WIDTH_CLASS = "w-[120px] font-bold text-md text-body-foreground";
|
|
7883
7882
|
var renderColGroup = (rows) => {
|
|
@@ -7903,11 +7902,11 @@ var renderColGroup = (rows) => {
|
|
|
7903
7902
|
});
|
|
7904
7903
|
const cols = [];
|
|
7905
7904
|
for (let i = 0; i < maxCols; i++) {
|
|
7906
|
-
cols.push(/* @__PURE__ */ (0,
|
|
7905
|
+
cols.push(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("col", { style: colWidths[i] ? { width: colWidths[i] } : { width: "auto" } }, `col-${i}`));
|
|
7907
7906
|
}
|
|
7908
|
-
return /* @__PURE__ */ (0,
|
|
7907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("colgroup", { children: cols });
|
|
7909
7908
|
};
|
|
7910
|
-
var
|
|
7909
|
+
var DefinitionTableRow = ({ cells, className }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: `border-neutral-light min-h-[50px] border-b ${className || ""}`, children: cells.map((cell, colIndex) => {
|
|
7911
7910
|
const isFirstCell = colIndex === 0;
|
|
7912
7911
|
const combinedClassName = [isFirstCell ? FIRST_CELL_WIDTH_CLASS : "", clsx(DEFAULT_CELL_CLASSES, cell.className)].filter(Boolean).join(" ");
|
|
7913
7912
|
let cellStyle;
|
|
@@ -7918,7 +7917,7 @@ var DefinitionTableRow2 = ({ cells, className }) => /* @__PURE__ */ (0, import_j
|
|
|
7918
7917
|
} else {
|
|
7919
7918
|
cellStyle = { width: "100%" };
|
|
7920
7919
|
}
|
|
7921
|
-
return /* @__PURE__ */ (0,
|
|
7920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7922
7921
|
"td",
|
|
7923
7922
|
{
|
|
7924
7923
|
className: combinedClassName,
|
|
@@ -7930,19 +7929,19 @@ var DefinitionTableRow2 = ({ cells, className }) => /* @__PURE__ */ (0, import_j
|
|
|
7930
7929
|
colIndex
|
|
7931
7930
|
);
|
|
7932
7931
|
}) });
|
|
7933
|
-
var DefinitionTable2 = (0,
|
|
7934
|
-
const slots = (0,
|
|
7935
|
-
return /* @__PURE__ */ (0,
|
|
7936
|
-
/* @__PURE__ */ (0,
|
|
7932
|
+
var DefinitionTable2 = (0, import_react16.forwardRef)(({ rows = [], footer, classNames }, ref) => {
|
|
7933
|
+
const slots = (0, import_react16.useMemo)(() => DefinitionTableStyle(), []);
|
|
7934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
7935
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
7937
7936
|
renderColGroup(rows),
|
|
7938
|
-
/* @__PURE__ */ (0,
|
|
7937
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DefinitionTableRow, { ...row, className: `${row.className || ""} ${i === 0 ? "first-row" : ""}` }, i)) })
|
|
7939
7938
|
] }),
|
|
7940
|
-
footer && /* @__PURE__ */ (0,
|
|
7939
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: footer })
|
|
7941
7940
|
] });
|
|
7942
7941
|
});
|
|
7943
7942
|
DefinitionTable2.displayName = "DefinitionTable2";
|
|
7944
|
-
var
|
|
7945
|
-
var
|
|
7943
|
+
var definition_table_default = DefinitionTable2;
|
|
7944
|
+
var DefinitionTableStyle = tv({
|
|
7946
7945
|
slots: {
|
|
7947
7946
|
base: ["flex", "flex-col", "gap-[30px]"],
|
|
7948
7947
|
table: ["w-full", "table-auto", "border", "border-neutral-light"]
|
|
@@ -7950,10 +7949,10 @@ var DefinitionTableStyle2 = tv({
|
|
|
7950
7949
|
});
|
|
7951
7950
|
|
|
7952
7951
|
// src/components/select/select.tsx
|
|
7953
|
-
var
|
|
7952
|
+
var import_react17 = require("react");
|
|
7954
7953
|
var import_react_dom = require("react-dom");
|
|
7955
|
-
var
|
|
7956
|
-
var Select = (0,
|
|
7954
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7955
|
+
var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
7957
7956
|
var _a, _b;
|
|
7958
7957
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
7959
7958
|
const {
|
|
@@ -7967,14 +7966,14 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
7967
7966
|
multiple,
|
|
7968
7967
|
...inputProps
|
|
7969
7968
|
} = props;
|
|
7970
|
-
const slots = (0,
|
|
7971
|
-
const [selectedOptions, setSelectedOptions] = (0,
|
|
7972
|
-
const [targetRect, setTargetRect] = (0,
|
|
7973
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0,
|
|
7974
|
-
const [isVisible, setIsVisible] = (0,
|
|
7975
|
-
const [isOpen, setIsOpen] = (0,
|
|
7976
|
-
const selectWrapperRef = (0,
|
|
7977
|
-
const optionWrapperRef = (0,
|
|
7969
|
+
const slots = (0, import_react17.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
7970
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react17.useState)(defaultSelectedOptions || []);
|
|
7971
|
+
const [targetRect, setTargetRect] = (0, import_react17.useState)(null);
|
|
7972
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react17.useState)(0);
|
|
7973
|
+
const [isVisible, setIsVisible] = (0, import_react17.useState)(false);
|
|
7974
|
+
const [isOpen, setIsOpen] = (0, import_react17.useState)(false);
|
|
7975
|
+
const selectWrapperRef = (0, import_react17.useRef)(null);
|
|
7976
|
+
const optionWrapperRef = (0, import_react17.useRef)(null);
|
|
7978
7977
|
const handleToggleSelect = () => {
|
|
7979
7978
|
if (isOpen) {
|
|
7980
7979
|
setIsOpen(false);
|
|
@@ -8012,7 +8011,7 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8012
8011
|
setSelectedOptions(nextOptions);
|
|
8013
8012
|
onChange == null ? void 0 : onChange(nextOptions);
|
|
8014
8013
|
};
|
|
8015
|
-
(0,
|
|
8014
|
+
(0, import_react17.useEffect)(() => {
|
|
8016
8015
|
const handleClickOutside = (e) => {
|
|
8017
8016
|
var _a2;
|
|
8018
8017
|
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
@@ -8023,7 +8022,7 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8023
8022
|
window.addEventListener("mousedown", handleClickOutside);
|
|
8024
8023
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
8025
8024
|
}, []);
|
|
8026
|
-
(0,
|
|
8025
|
+
(0, import_react17.useEffect)(() => {
|
|
8027
8026
|
if (optionWrapperRef.current) {
|
|
8028
8027
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
8029
8028
|
}
|
|
@@ -8037,26 +8036,26 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8037
8036
|
onClick
|
|
8038
8037
|
}) => {
|
|
8039
8038
|
const slot = select({ ...variantProps, isSelected });
|
|
8040
|
-
return /* @__PURE__ */ (0,
|
|
8039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { title: option.label, onClick, className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })), children: [
|
|
8041
8040
|
option.label,
|
|
8042
|
-
isSelected && /* @__PURE__ */ (0,
|
|
8041
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon_default, { name: "check", size: originalProps.size })
|
|
8043
8042
|
] });
|
|
8044
8043
|
};
|
|
8045
8044
|
const isControlled = originalProps.value !== void 0;
|
|
8046
|
-
(0,
|
|
8045
|
+
(0, import_react17.useEffect)(() => {
|
|
8047
8046
|
if (isControlled) {
|
|
8048
8047
|
const valueArray = Array.isArray(originalProps.value) ? originalProps.value : [originalProps.value];
|
|
8049
8048
|
const matchedOptions = options.filter((opt) => valueArray.includes(opt.value));
|
|
8050
8049
|
setSelectedOptions(matchedOptions);
|
|
8051
8050
|
}
|
|
8052
8051
|
}, [originalProps.value, options]);
|
|
8053
|
-
(0,
|
|
8052
|
+
(0, import_react17.useEffect)(() => {
|
|
8054
8053
|
if (!isControlled && defaultSelectedOptions) {
|
|
8055
8054
|
setSelectedOptions(defaultSelectedOptions);
|
|
8056
8055
|
}
|
|
8057
8056
|
}, [defaultSelectedOptions]);
|
|
8058
|
-
return /* @__PURE__ */ (0,
|
|
8059
|
-
/* @__PURE__ */ (0,
|
|
8057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
8058
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
8060
8059
|
"div",
|
|
8061
8060
|
{
|
|
8062
8061
|
className: clsx(
|
|
@@ -8064,9 +8063,9 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8064
8063
|
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
8065
8064
|
),
|
|
8066
8065
|
children: [
|
|
8067
|
-
label && /* @__PURE__ */ (0,
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8069
|
-
/* @__PURE__ */ (0,
|
|
8066
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
8067
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
8068
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
8070
8069
|
"div",
|
|
8071
8070
|
{
|
|
8072
8071
|
"data-expanded": isOpen,
|
|
@@ -8077,7 +8076,7 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8077
8076
|
ref: selectWrapperRef,
|
|
8078
8077
|
onClick: handleToggleSelect,
|
|
8079
8078
|
children: [
|
|
8080
|
-
/* @__PURE__ */ (0,
|
|
8079
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8081
8080
|
"input",
|
|
8082
8081
|
{
|
|
8083
8082
|
...inputProps,
|
|
@@ -8092,8 +8091,8 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8092
8091
|
size: 0
|
|
8093
8092
|
}
|
|
8094
8093
|
),
|
|
8095
|
-
/* @__PURE__ */ (0,
|
|
8096
|
-
/* @__PURE__ */ (0,
|
|
8094
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
|
|
8095
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8097
8096
|
Icon_default,
|
|
8098
8097
|
{
|
|
8099
8098
|
name: "brace-up",
|
|
@@ -8104,14 +8103,14 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8104
8103
|
]
|
|
8105
8104
|
}
|
|
8106
8105
|
),
|
|
8107
|
-
helperMessage && !errorMessage && /* @__PURE__ */ (0,
|
|
8108
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
8106
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
|
|
8107
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
8109
8108
|
] })
|
|
8110
8109
|
]
|
|
8111
8110
|
}
|
|
8112
8111
|
),
|
|
8113
8112
|
isVisible && (0, import_react_dom.createPortal)(
|
|
8114
|
-
/* @__PURE__ */ (0,
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8115
8114
|
"div",
|
|
8116
8115
|
{
|
|
8117
8116
|
ref: optionWrapperRef,
|
|
@@ -8128,7 +8127,7 @@ var Select = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8128
8127
|
},
|
|
8129
8128
|
children: options.map((option) => {
|
|
8130
8129
|
const isSelected = selectedOptions.some((o) => o.value === option.value);
|
|
8131
|
-
return /* @__PURE__ */ (0,
|
|
8130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8132
8131
|
Option,
|
|
8133
8132
|
{
|
|
8134
8133
|
option,
|
|
@@ -8300,16 +8299,16 @@ var select = tv({
|
|
|
8300
8299
|
});
|
|
8301
8300
|
|
|
8302
8301
|
// src/components/chip/chip.tsx
|
|
8303
|
-
var
|
|
8304
|
-
var
|
|
8305
|
-
var Chip = (0,
|
|
8302
|
+
var import_react18 = require("react");
|
|
8303
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8304
|
+
var Chip = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
8306
8305
|
var _a;
|
|
8307
8306
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
8308
8307
|
const props = { ...rawProps, ...variantProps };
|
|
8309
8308
|
const Component = props.onClick ? "button" : "div";
|
|
8310
|
-
const slots = (0,
|
|
8311
|
-
const renderIcon = (name) => name ? /* @__PURE__ */ (0,
|
|
8312
|
-
return /* @__PURE__ */ (0,
|
|
8309
|
+
const slots = (0, import_react18.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
8310
|
+
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
8311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
8313
8312
|
Component,
|
|
8314
8313
|
{
|
|
8315
8314
|
ref,
|
|
@@ -8485,13 +8484,13 @@ var chipStyle = tv({
|
|
|
8485
8484
|
});
|
|
8486
8485
|
|
|
8487
8486
|
// src/components/radio/radio.tsx
|
|
8488
|
-
var
|
|
8489
|
-
var
|
|
8490
|
-
var Radio = (0,
|
|
8487
|
+
var import_react19 = require("react");
|
|
8488
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8489
|
+
var Radio = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
8491
8490
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
8492
8491
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
8493
|
-
const slots = (0,
|
|
8494
|
-
return /* @__PURE__ */ (0,
|
|
8492
|
+
const slots = (0, import_react19.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
8493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8495
8494
|
"label",
|
|
8496
8495
|
{
|
|
8497
8496
|
className: clsx(
|
|
@@ -8499,9 +8498,9 @@ var Radio = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
|
8499
8498
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
8500
8499
|
),
|
|
8501
8500
|
children: [
|
|
8502
|
-
/* @__PURE__ */ (0,
|
|
8503
|
-
/* @__PURE__ */ (0,
|
|
8504
|
-
/* @__PURE__ */ (0,
|
|
8501
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { ...inputProps, type: "radio", ref }) }),
|
|
8502
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.outerDot({ class: classNames == null ? void 0 : classNames.outerDot }), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.innerDot({ class: classNames == null ? void 0 : classNames.innerDot }) }) }),
|
|
8503
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }), children: children && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children }) })
|
|
8505
8504
|
]
|
|
8506
8505
|
}
|
|
8507
8506
|
);
|
|
@@ -8641,18 +8640,18 @@ var radioStyle = tv({
|
|
|
8641
8640
|
});
|
|
8642
8641
|
|
|
8643
8642
|
// src/components/switch/switch.tsx
|
|
8644
|
-
var
|
|
8645
|
-
var
|
|
8646
|
-
var
|
|
8647
|
-
var Switch = (0,
|
|
8643
|
+
var import_react20 = require("react");
|
|
8644
|
+
var import_tailwind_variants21 = require("tailwind-variants");
|
|
8645
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8646
|
+
var Switch = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
8648
8647
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
8649
8648
|
const { size, color, isDisabled, disableAnimation, id, checked, onChange, classNames, ...inputProps } = {
|
|
8650
8649
|
...rawProps,
|
|
8651
8650
|
...variantProps
|
|
8652
8651
|
};
|
|
8653
|
-
const slots = (0,
|
|
8654
|
-
return /* @__PURE__ */ (0,
|
|
8655
|
-
/* @__PURE__ */ (0,
|
|
8652
|
+
const slots = (0, import_react20.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
8653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8656
8655
|
"input",
|
|
8657
8656
|
{
|
|
8658
8657
|
...inputProps,
|
|
@@ -8665,12 +8664,12 @@ var Switch = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
|
8665
8664
|
onChange
|
|
8666
8665
|
}
|
|
8667
8666
|
),
|
|
8668
|
-
/* @__PURE__ */ (0,
|
|
8667
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: slots.outerWrapper({ class: classNames == null ? void 0 : classNames.outerWrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb }) }) }) })
|
|
8669
8668
|
] });
|
|
8670
8669
|
});
|
|
8671
8670
|
Switch.displayName = "Switch";
|
|
8672
8671
|
var switch_default = Switch;
|
|
8673
|
-
var switchStyle = (0,
|
|
8672
|
+
var switchStyle = (0, import_tailwind_variants21.tv)({
|
|
8674
8673
|
slots: {
|
|
8675
8674
|
base: ["group/switch", "relative", "max-w-fit", "inline-flex", "items-center", "justify-start", "cursor-pointer"],
|
|
8676
8675
|
outerWrapper: [
|
|
@@ -8775,7 +8774,7 @@ var switchStyle = (0, import_tailwind_variants22.tv)({
|
|
|
8775
8774
|
});
|
|
8776
8775
|
|
|
8777
8776
|
// src/components/tooltip/tooltip.tsx
|
|
8778
|
-
var
|
|
8777
|
+
var import_react22 = require("react");
|
|
8779
8778
|
var import_react_dom2 = require("react-dom");
|
|
8780
8779
|
|
|
8781
8780
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -8898,11 +8897,11 @@ var getTailStyles = (placement) => {
|
|
|
8898
8897
|
};
|
|
8899
8898
|
|
|
8900
8899
|
// src/components/tooltip/useTooltip.ts
|
|
8901
|
-
var
|
|
8900
|
+
var import_react21 = require("react");
|
|
8902
8901
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
8903
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
8904
|
-
const tooltipRef = (0,
|
|
8905
|
-
(0,
|
|
8902
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react21.useState)({ x: 0, y: 0 });
|
|
8903
|
+
const tooltipRef = (0, import_react21.useRef)(null);
|
|
8904
|
+
(0, import_react21.useEffect)(() => {
|
|
8906
8905
|
if (targetRect && tooltipRef.current) {
|
|
8907
8906
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
8908
8907
|
const scrollX = window.scrollX;
|
|
@@ -8932,29 +8931,29 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
8932
8931
|
};
|
|
8933
8932
|
|
|
8934
8933
|
// src/components/tooltip/tooltip.tsx
|
|
8935
|
-
var
|
|
8936
|
-
var Tooltip = (0,
|
|
8934
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8935
|
+
var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
8937
8936
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
8938
8937
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames } = props;
|
|
8939
|
-
const slots = (0,
|
|
8940
|
-
const [targetRect, setTargetRect] = (0,
|
|
8938
|
+
const slots = (0, import_react22.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
8939
|
+
const [targetRect, setTargetRect] = (0, import_react22.useState)(null);
|
|
8941
8940
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
8942
8941
|
placement,
|
|
8943
8942
|
offset,
|
|
8944
8943
|
delay,
|
|
8945
8944
|
targetRect
|
|
8946
8945
|
});
|
|
8947
|
-
const childrenRef = (0,
|
|
8948
|
-
const delayTimeoutRef = (0,
|
|
8949
|
-
const getProps = (0,
|
|
8946
|
+
const childrenRef = (0, import_react22.useRef)(null);
|
|
8947
|
+
const delayTimeoutRef = (0, import_react22.useRef)(null);
|
|
8948
|
+
const getProps = (0, import_react22.useCallback)(
|
|
8950
8949
|
(slotKey, classNameKey) => ({
|
|
8951
8950
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
8952
8951
|
}),
|
|
8953
8952
|
[slots, classNames]
|
|
8954
8953
|
);
|
|
8955
|
-
const getBaseProps = (0,
|
|
8956
|
-
const getContentProps = (0,
|
|
8957
|
-
const showTooltip = (0,
|
|
8954
|
+
const getBaseProps = (0, import_react22.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
8955
|
+
const getContentProps = (0, import_react22.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
8956
|
+
const showTooltip = (0, import_react22.useCallback)(() => {
|
|
8958
8957
|
if (childrenRef.current) {
|
|
8959
8958
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
8960
8959
|
setTargetRect({
|
|
@@ -8967,16 +8966,16 @@ var Tooltip = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
8967
8966
|
});
|
|
8968
8967
|
}
|
|
8969
8968
|
}, []);
|
|
8970
|
-
const hideTooltip = (0,
|
|
8969
|
+
const hideTooltip = (0, import_react22.useCallback)(() => {
|
|
8971
8970
|
if (!persistent) {
|
|
8972
8971
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
8973
8972
|
}
|
|
8974
8973
|
}, [persistent, delay]);
|
|
8975
|
-
(0,
|
|
8974
|
+
(0, import_react22.useEffect)(() => {
|
|
8976
8975
|
if (persistent) showTooltip();
|
|
8977
8976
|
}, [persistent, showTooltip]);
|
|
8978
|
-
return /* @__PURE__ */ (0,
|
|
8979
|
-
/* @__PURE__ */ (0,
|
|
8977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
8978
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8980
8979
|
"div",
|
|
8981
8980
|
{
|
|
8982
8981
|
ref: (node) => {
|
|
@@ -8993,7 +8992,7 @@ var Tooltip = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
8993
8992
|
}
|
|
8994
8993
|
),
|
|
8995
8994
|
targetRect && (0, import_react_dom2.createPortal)(
|
|
8996
|
-
/* @__PURE__ */ (0,
|
|
8995
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
8997
8996
|
"div",
|
|
8998
8997
|
{
|
|
8999
8998
|
ref: tooltipRef,
|
|
@@ -9006,7 +9005,7 @@ var Tooltip = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
9006
9005
|
},
|
|
9007
9006
|
children: [
|
|
9008
9007
|
props.content,
|
|
9009
|
-
variantProps.tail && /* @__PURE__ */ (0,
|
|
9008
|
+
variantProps.tail && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9010
9009
|
"div",
|
|
9011
9010
|
{
|
|
9012
9011
|
className: `absolute h-2 w-2 rotate-45 bg-inherit ${getTailClassName(placement)}`,
|
|
@@ -9057,10 +9056,10 @@ var tooltipStyle = tv({
|
|
|
9057
9056
|
});
|
|
9058
9057
|
|
|
9059
9058
|
// src/components/modal/modal.tsx
|
|
9060
|
-
var
|
|
9059
|
+
var import_react23 = require("react");
|
|
9061
9060
|
var import_react_dom3 = require("react-dom");
|
|
9062
|
-
var
|
|
9063
|
-
var Modal = (0,
|
|
9061
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9062
|
+
var Modal = (0, import_react23.forwardRef)((props, ref) => {
|
|
9064
9063
|
const [localProps, variantProps] = mapPropsVariants(props, modal.variantKeys);
|
|
9065
9064
|
const {
|
|
9066
9065
|
classNames,
|
|
@@ -9074,8 +9073,8 @@ var Modal = (0, import_react24.forwardRef)((props, ref) => {
|
|
|
9074
9073
|
onConfirm,
|
|
9075
9074
|
onCancel
|
|
9076
9075
|
} = localProps;
|
|
9077
|
-
const slots = (0,
|
|
9078
|
-
(0,
|
|
9076
|
+
const slots = (0, import_react23.useMemo)(() => modal(variantProps), [variantProps]);
|
|
9077
|
+
(0, import_react23.useEffect)(() => {
|
|
9079
9078
|
document.body.classList.toggle("overflow-hidden", !!isOpen);
|
|
9080
9079
|
if (!isOpen || isKeyboardDismissDisabled) return;
|
|
9081
9080
|
const handleKeyDown = (e) => {
|
|
@@ -9089,10 +9088,10 @@ var Modal = (0, import_react24.forwardRef)((props, ref) => {
|
|
|
9089
9088
|
}, [isOpen, isKeyboardDismissDisabled, onCancel]);
|
|
9090
9089
|
if (!isOpen) return null;
|
|
9091
9090
|
return (0, import_react_dom3.createPortal)(
|
|
9092
|
-
/* @__PURE__ */ (0,
|
|
9093
|
-
/* @__PURE__ */ (0,
|
|
9094
|
-
/* @__PURE__ */ (0,
|
|
9095
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
9091
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
9092
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(backdrop_default, { open: true }),
|
|
9093
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }), children: [
|
|
9094
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9096
9095
|
Icon_default,
|
|
9097
9096
|
{
|
|
9098
9097
|
size: "xl",
|
|
@@ -9101,12 +9100,12 @@ var Modal = (0, import_react24.forwardRef)((props, ref) => {
|
|
|
9101
9100
|
onClick: onCancel
|
|
9102
9101
|
}
|
|
9103
9102
|
),
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9105
|
-
title && /* @__PURE__ */ (0,
|
|
9106
|
-
typeof content === "string" ? /* @__PURE__ */ (0,
|
|
9107
|
-
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0,
|
|
9108
|
-
cancelButtonText && /* @__PURE__ */ (0,
|
|
9109
|
-
confirmButtonText && /* @__PURE__ */ (0,
|
|
9103
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
9104
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
9105
|
+
typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: slots.content({ class: classNames == null ? void 0 : classNames.content }), children: content }) : content,
|
|
9106
|
+
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.footer({ class: classNames == null ? void 0 : classNames.footer }), children: [
|
|
9107
|
+
cancelButtonText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(button_default, { variant: "soft", color: "neutral", fullWidth: true, onClick: onCancel, children: cancelButtonText }),
|
|
9108
|
+
confirmButtonText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(button_default, { color: props.color, fullWidth: true, onClick: onConfirm, children: confirmButtonText })
|
|
9110
9109
|
] })
|
|
9111
9110
|
] })
|
|
9112
9111
|
] }) })
|
|
@@ -9173,18 +9172,18 @@ var modal = tv({
|
|
|
9173
9172
|
});
|
|
9174
9173
|
|
|
9175
9174
|
// src/components/drawer/drawer.tsx
|
|
9176
|
-
var
|
|
9175
|
+
var import_react24 = require("react");
|
|
9177
9176
|
var import_react_dom4 = require("react-dom");
|
|
9178
|
-
var
|
|
9179
|
-
var Drawer = (0,
|
|
9177
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9178
|
+
var Drawer = (0, import_react24.forwardRef)((props, ref) => {
|
|
9180
9179
|
const [localProps, variantProps] = mapPropsVariants(props, drawer.variantKeys);
|
|
9181
9180
|
const { classNames, isOpen, content, isKeyboardDismissDisabled = false, onClose, backdrop = true } = localProps;
|
|
9182
9181
|
const position = props.position || "right";
|
|
9183
|
-
const [shouldRender, setShouldRender] = (0,
|
|
9184
|
-
const [isAnimating, setIsAnimating] = (0,
|
|
9185
|
-
const [isContentAnimating, setIsContentAnimating] = (0,
|
|
9186
|
-
const slots = (0,
|
|
9187
|
-
(0,
|
|
9182
|
+
const [shouldRender, setShouldRender] = (0, import_react24.useState)(isOpen);
|
|
9183
|
+
const [isAnimating, setIsAnimating] = (0, import_react24.useState)(isOpen);
|
|
9184
|
+
const [isContentAnimating, setIsContentAnimating] = (0, import_react24.useState)(isOpen);
|
|
9185
|
+
const slots = (0, import_react24.useMemo)(() => drawer(variantProps), [variantProps]);
|
|
9186
|
+
(0, import_react24.useEffect)(() => {
|
|
9188
9187
|
if (isOpen) {
|
|
9189
9188
|
setShouldRender(true);
|
|
9190
9189
|
requestAnimationFrame(() => {
|
|
@@ -9202,7 +9201,7 @@ var Drawer = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
9202
9201
|
return () => clearTimeout(timer);
|
|
9203
9202
|
}
|
|
9204
9203
|
}, [isOpen]);
|
|
9205
|
-
(0,
|
|
9204
|
+
(0, import_react24.useEffect)(() => {
|
|
9206
9205
|
if (shouldRender) {
|
|
9207
9206
|
document.body.classList.add("overflow-hidden");
|
|
9208
9207
|
} else {
|
|
@@ -9237,7 +9236,7 @@ var Drawer = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
9237
9236
|
};
|
|
9238
9237
|
if (!shouldRender) return null;
|
|
9239
9238
|
return (0, import_react_dom4.createPortal)(
|
|
9240
|
-
/* @__PURE__ */ (0,
|
|
9239
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9241
9240
|
"div",
|
|
9242
9241
|
{
|
|
9243
9242
|
ref,
|
|
@@ -9252,15 +9251,15 @@ var Drawer = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
9252
9251
|
role: "dialog",
|
|
9253
9252
|
"aria-modal": "true",
|
|
9254
9253
|
children: [
|
|
9255
|
-
backdrop && /* @__PURE__ */ (0,
|
|
9256
|
-
/* @__PURE__ */ (0,
|
|
9254
|
+
backdrop && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm", onClick: onClose }),
|
|
9255
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9257
9256
|
"div",
|
|
9258
9257
|
{
|
|
9259
9258
|
className: slots.drawerWrapper({
|
|
9260
9259
|
class: clsx(classNames == null ? void 0 : classNames.drawerWrapper, getAnimationClasses())
|
|
9261
9260
|
}),
|
|
9262
9261
|
onClick: (e) => e.stopPropagation(),
|
|
9263
|
-
children: /* @__PURE__ */ (0,
|
|
9262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: content })
|
|
9264
9263
|
}
|
|
9265
9264
|
)
|
|
9266
9265
|
]
|
|
@@ -9333,15 +9332,15 @@ var drawer = tv({
|
|
|
9333
9332
|
var drawer_default = Drawer;
|
|
9334
9333
|
|
|
9335
9334
|
// src/components/list/list.tsx
|
|
9336
|
-
var
|
|
9337
|
-
var
|
|
9338
|
-
var List = (0,
|
|
9335
|
+
var import_react25 = require("react");
|
|
9336
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
9337
|
+
var List = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
9339
9338
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
9340
9339
|
const { children, classNames } = props;
|
|
9341
|
-
const slots = (0,
|
|
9342
|
-
return /* @__PURE__ */ (0,
|
|
9343
|
-
if (!(0,
|
|
9344
|
-
return (0,
|
|
9340
|
+
const slots = (0, import_react25.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
9341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react25.Children.map(children, (child) => {
|
|
9342
|
+
if (!(0, import_react25.isValidElement)(child)) return child;
|
|
9343
|
+
return (0, import_react25.cloneElement)(child, {
|
|
9345
9344
|
...variantProps,
|
|
9346
9345
|
...child.props
|
|
9347
9346
|
});
|
|
@@ -9378,9 +9377,9 @@ var listStyle = tv({
|
|
|
9378
9377
|
});
|
|
9379
9378
|
|
|
9380
9379
|
// src/components/list/listItem.tsx
|
|
9381
|
-
var
|
|
9382
|
-
var
|
|
9383
|
-
var ListItem = (0,
|
|
9380
|
+
var import_react26 = require("react");
|
|
9381
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
9382
|
+
var ListItem = (0, import_react26.forwardRef)((props, ref) => {
|
|
9384
9383
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
9385
9384
|
const {
|
|
9386
9385
|
title,
|
|
@@ -9392,19 +9391,19 @@ var ListItem = (0, import_react27.forwardRef)((props, ref) => {
|
|
|
9392
9391
|
classNames,
|
|
9393
9392
|
onClick
|
|
9394
9393
|
} = { ...rawProps, ...variantProps };
|
|
9395
|
-
const slots = (0,
|
|
9394
|
+
const slots = (0, import_react26.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
9396
9395
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
9397
9396
|
const avatarSize = iconSize;
|
|
9398
|
-
return /* @__PURE__ */ (0,
|
|
9399
|
-
/* @__PURE__ */ (0,
|
|
9400
|
-
avatar && /* @__PURE__ */ (0,
|
|
9401
|
-
startIconName && /* @__PURE__ */ (0,
|
|
9402
|
-
/* @__PURE__ */ (0,
|
|
9403
|
-
/* @__PURE__ */ (0,
|
|
9404
|
-
subTitle && /* @__PURE__ */ (0,
|
|
9397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
9399
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(avatar_default, { ...avatar, variant: "round", size: avatarSize }),
|
|
9400
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: startIconName, fill: true, size, className: slots.startIcon({ class: classNames == null ? void 0 : classNames.startIcon }) }),
|
|
9401
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper }), children: [
|
|
9402
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
9403
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle }), children: subTitle })
|
|
9405
9404
|
] })
|
|
9406
9405
|
] }),
|
|
9407
|
-
/* @__PURE__ */ (0,
|
|
9406
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "right-chevron", size: iconSize, className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) })
|
|
9408
9407
|
] });
|
|
9409
9408
|
});
|
|
9410
9409
|
ListItem.displayName = "ListItem";
|
|
@@ -9572,9 +9571,9 @@ var listItemStyle = tv({
|
|
|
9572
9571
|
});
|
|
9573
9572
|
|
|
9574
9573
|
// src/components/toast/toast.tsx
|
|
9575
|
-
var
|
|
9576
|
-
var
|
|
9577
|
-
var Toast = (0,
|
|
9574
|
+
var import_react27 = require("react");
|
|
9575
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
9576
|
+
var Toast = (0, import_react27.forwardRef)((originalProps, ref) => {
|
|
9578
9577
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
9579
9578
|
const {
|
|
9580
9579
|
title,
|
|
@@ -9588,9 +9587,9 @@ var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
|
9588
9587
|
disableAnimation,
|
|
9589
9588
|
onClose
|
|
9590
9589
|
} = { ...props, ...variantProps };
|
|
9591
|
-
const slots = (0,
|
|
9592
|
-
const toastRef = (0,
|
|
9593
|
-
(0,
|
|
9590
|
+
const slots = (0, import_react27.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
9591
|
+
const toastRef = (0, import_react27.useRef)(null);
|
|
9592
|
+
(0, import_react27.useImperativeHandle)(
|
|
9594
9593
|
ref,
|
|
9595
9594
|
() => ({
|
|
9596
9595
|
getWidth: () => {
|
|
@@ -9601,7 +9600,7 @@ var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
|
9601
9600
|
[]
|
|
9602
9601
|
);
|
|
9603
9602
|
const animationClass = (placement == null ? void 0 : placement.includes("top")) ? "animate-slideInFromTop" : "animate-slideInFromBottom";
|
|
9604
|
-
return /* @__PURE__ */ (0,
|
|
9603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
9605
9604
|
"div",
|
|
9606
9605
|
{
|
|
9607
9606
|
ref: toastRef,
|
|
@@ -9613,12 +9612,12 @@ var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
|
9613
9612
|
),
|
|
9614
9613
|
style: hasShadow ? { boxShadow: "0px 6px 18px rgba(0, 0, 0, 0.10)" } : {},
|
|
9615
9614
|
children: [
|
|
9616
|
-
/* @__PURE__ */ (0,
|
|
9617
|
-
showIcon && /* @__PURE__ */ (0,
|
|
9618
|
-
/* @__PURE__ */ (0,
|
|
9619
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
9615
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
9616
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
|
|
9617
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
9618
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon_default, { name: "close", className: "cursor-pointer", onClick: onClose })
|
|
9620
9619
|
] }),
|
|
9621
|
-
content && /* @__PURE__ */ (0,
|
|
9620
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: content })
|
|
9622
9621
|
]
|
|
9623
9622
|
}
|
|
9624
9623
|
);
|
|
@@ -9723,7 +9722,7 @@ var toast = tv({
|
|
|
9723
9722
|
});
|
|
9724
9723
|
|
|
9725
9724
|
// src/components/toast/use-toast.tsx
|
|
9726
|
-
var
|
|
9725
|
+
var import_react28 = require("react");
|
|
9727
9726
|
|
|
9728
9727
|
// src/components/toast/toast-utils.ts
|
|
9729
9728
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -9762,10 +9761,10 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
9762
9761
|
};
|
|
9763
9762
|
|
|
9764
9763
|
// src/components/toast/use-toast.tsx
|
|
9765
|
-
var
|
|
9766
|
-
var ToastContext = (0,
|
|
9764
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9765
|
+
var ToastContext = (0, import_react28.createContext)(null);
|
|
9767
9766
|
var useToast = () => {
|
|
9768
|
-
const context = (0,
|
|
9767
|
+
const context = (0, import_react28.useContext)(ToastContext);
|
|
9769
9768
|
if (!context) {
|
|
9770
9769
|
throw new Error("useToast must be used within a ToastProvider");
|
|
9771
9770
|
}
|
|
@@ -9775,10 +9774,10 @@ var ToastProvider = ({
|
|
|
9775
9774
|
globalOptions,
|
|
9776
9775
|
children
|
|
9777
9776
|
}) => {
|
|
9778
|
-
const [toasts, setToasts] = (0,
|
|
9779
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
9780
|
-
const toastRef = (0,
|
|
9781
|
-
const addToast = (0,
|
|
9777
|
+
const [toasts, setToasts] = (0, import_react28.useState)([]);
|
|
9778
|
+
const [containerStyle, setContainerStyle] = (0, import_react28.useState)({});
|
|
9779
|
+
const toastRef = (0, import_react28.useRef)(null);
|
|
9780
|
+
const addToast = (0, import_react28.useCallback)(
|
|
9782
9781
|
(title, options = {}) => {
|
|
9783
9782
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
9784
9783
|
const newToast = {
|
|
@@ -9795,11 +9794,11 @@ var ToastProvider = ({
|
|
|
9795
9794
|
},
|
|
9796
9795
|
[globalOptions]
|
|
9797
9796
|
);
|
|
9798
|
-
const removeToast = (0,
|
|
9797
|
+
const removeToast = (0, import_react28.useCallback)((id) => {
|
|
9799
9798
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
9800
9799
|
}, []);
|
|
9801
9800
|
const contextValue = addToast;
|
|
9802
|
-
(0,
|
|
9801
|
+
(0, import_react28.useEffect)(() => {
|
|
9803
9802
|
var _a;
|
|
9804
9803
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
9805
9804
|
const offset = 20;
|
|
@@ -9813,18 +9812,18 @@ var ToastProvider = ({
|
|
|
9813
9812
|
right: right !== void 0 ? `${right}px` : void 0
|
|
9814
9813
|
});
|
|
9815
9814
|
}, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
|
|
9816
|
-
return /* @__PURE__ */ (0,
|
|
9815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(ToastContext.Provider, { value: contextValue, children: [
|
|
9817
9816
|
children,
|
|
9818
|
-
/* @__PURE__ */ (0,
|
|
9817
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: "deepnoid-toast-container", className: "flex flex-col gap-[10px]", style: containerStyle, children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(toast_default, { ref: toastRef, onClose: () => removeToast(toast2.id), ...toast2 }, toast2.id)) })
|
|
9819
9818
|
] });
|
|
9820
9819
|
};
|
|
9821
9820
|
|
|
9822
9821
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
9823
|
-
var
|
|
9822
|
+
var import_react32 = __toESM(require("react"));
|
|
9824
9823
|
var import_react_dom5 = require("react-dom");
|
|
9825
9824
|
|
|
9826
9825
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
9827
|
-
var
|
|
9826
|
+
var import_react29 = require("react");
|
|
9828
9827
|
|
|
9829
9828
|
// src/components/dateTimePicker/util.ts
|
|
9830
9829
|
var formatDateToString = (date) => {
|
|
@@ -9840,17 +9839,17 @@ var formatStringToDate = (date) => {
|
|
|
9840
9839
|
|
|
9841
9840
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
9842
9841
|
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
9843
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
9842
|
+
const [selectedDate, setSelectedDate] = (0, import_react29.useState)(
|
|
9844
9843
|
initialDate ? formatDateToString(initialDate) : ""
|
|
9845
9844
|
);
|
|
9846
|
-
const [selectedTime, setSelectedTime] = (0,
|
|
9847
|
-
const [targetRect, setTargetRect] = (0,
|
|
9848
|
-
const [popupWidth, setPopupWidth] = (0,
|
|
9849
|
-
const [popupHeight, setPopupHeight] = (0,
|
|
9850
|
-
const [isFocusInput, setIsFocusInput] = (0,
|
|
9851
|
-
const dateInputRef = (0,
|
|
9852
|
-
const datePickerWrapperRef = (0,
|
|
9853
|
-
const datePickerRef = (0,
|
|
9845
|
+
const [selectedTime, setSelectedTime] = (0, import_react29.useState)(initialTime ? initialTime : "");
|
|
9846
|
+
const [targetRect, setTargetRect] = (0, import_react29.useState)(null);
|
|
9847
|
+
const [popupWidth, setPopupWidth] = (0, import_react29.useState)(0);
|
|
9848
|
+
const [popupHeight, setPopupHeight] = (0, import_react29.useState)(0);
|
|
9849
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react29.useState)(false);
|
|
9850
|
+
const dateInputRef = (0, import_react29.useRef)(null);
|
|
9851
|
+
const datePickerWrapperRef = (0, import_react29.useRef)(null);
|
|
9852
|
+
const datePickerRef = (0, import_react29.useRef)(null);
|
|
9854
9853
|
const DATE_PICKER_GAP = 4;
|
|
9855
9854
|
const calculatePositionWithScroll = (targetRect2) => {
|
|
9856
9855
|
if (targetRect2 && popupWidth && popupHeight) {
|
|
@@ -9883,7 +9882,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9883
9882
|
const handleBlueInput = () => {
|
|
9884
9883
|
setIsFocusInput(false);
|
|
9885
9884
|
};
|
|
9886
|
-
(0,
|
|
9885
|
+
(0, import_react29.useEffect)(() => {
|
|
9887
9886
|
const onClickOutside = (e) => {
|
|
9888
9887
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
9889
9888
|
setTargetRect(null);
|
|
@@ -9892,7 +9891,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9892
9891
|
window.addEventListener("mousedown", onClickOutside);
|
|
9893
9892
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
9894
9893
|
}, []);
|
|
9895
|
-
(0,
|
|
9894
|
+
(0, import_react29.useEffect)(() => {
|
|
9896
9895
|
if (datePickerWrapperRef.current) {
|
|
9897
9896
|
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
9898
9897
|
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
@@ -9917,19 +9916,19 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9917
9916
|
};
|
|
9918
9917
|
|
|
9919
9918
|
// src/components/dateTimePicker/calendar.tsx
|
|
9920
|
-
var
|
|
9921
|
-
var
|
|
9922
|
-
var Calendar = (0,
|
|
9919
|
+
var import_react30 = __toESM(require("react"));
|
|
9920
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
9921
|
+
var Calendar = (0, import_react30.forwardRef)((originalProps, ref) => {
|
|
9923
9922
|
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
9924
9923
|
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
9925
|
-
const [currentDate, setCurrentDate] = (0,
|
|
9924
|
+
const [currentDate, setCurrentDate] = (0, import_react30.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
9926
9925
|
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
9927
|
-
(0,
|
|
9926
|
+
(0, import_react30.useEffect)(() => {
|
|
9928
9927
|
if (selectedDate) {
|
|
9929
9928
|
setCurrentDate(new Date(selectedDate));
|
|
9930
9929
|
}
|
|
9931
9930
|
}, [selectedDate]);
|
|
9932
|
-
const getCalendarDates = (0,
|
|
9931
|
+
const getCalendarDates = (0, import_react30.useCallback)(() => {
|
|
9933
9932
|
const year = currentDate.getFullYear();
|
|
9934
9933
|
const month = currentDate.getMonth();
|
|
9935
9934
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -9975,17 +9974,17 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9975
9974
|
onChangeDate(formatted);
|
|
9976
9975
|
}
|
|
9977
9976
|
};
|
|
9978
|
-
(0,
|
|
9977
|
+
(0, import_react30.useImperativeHandle)(ref, () => ({
|
|
9979
9978
|
getSelectedDate: () => selectedDate
|
|
9980
9979
|
}));
|
|
9981
|
-
const slots = (0,
|
|
9982
|
-
const getBaseProps = (0,
|
|
9980
|
+
const slots = (0, import_react30.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
9981
|
+
const getBaseProps = (0, import_react30.useCallback)(
|
|
9983
9982
|
() => ({
|
|
9984
9983
|
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
9985
9984
|
}),
|
|
9986
9985
|
[slots, classNames]
|
|
9987
9986
|
);
|
|
9988
|
-
const getDateTitleProps = (0,
|
|
9987
|
+
const getDateTitleProps = (0, import_react30.useCallback)(
|
|
9989
9988
|
(index) => {
|
|
9990
9989
|
return {
|
|
9991
9990
|
className: `${slots.dateTitle({
|
|
@@ -9997,7 +9996,7 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9997
9996
|
},
|
|
9998
9997
|
[slots, classNames, highlightWeekend]
|
|
9999
9998
|
);
|
|
10000
|
-
const getDateProps = (0,
|
|
9999
|
+
const getDateProps = (0, import_react30.useCallback)(
|
|
10001
10000
|
(dateObj) => {
|
|
10002
10001
|
const today = /* @__PURE__ */ new Date();
|
|
10003
10002
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -10019,18 +10018,18 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
10019
10018
|
[slots, classNames, selectedDate, currentDate, highlightWeekend]
|
|
10020
10019
|
);
|
|
10021
10020
|
const calendarDates = getCalendarDates();
|
|
10022
|
-
return /* @__PURE__ */ (0,
|
|
10023
|
-
/* @__PURE__ */ (0,
|
|
10024
|
-
/* @__PURE__ */ (0,
|
|
10025
|
-
/* @__PURE__ */ (0,
|
|
10026
|
-
/* @__PURE__ */ (0,
|
|
10021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...getBaseProps(), children: [
|
|
10022
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "calendar-header flex justify-between items-center mb-4", children: [
|
|
10023
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { name: "brace-left", size: "md", className: "cursor-pointer", onClick: handlePrevMonth }),
|
|
10024
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-h6 font-semibold", children: currentDate.toLocaleString("default", { year: "numeric", month: "2-digit" }) }),
|
|
10025
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { name: "brace-right", size: "md", className: "cursor-pointer", onClick: handleNextMonth })
|
|
10027
10026
|
] }),
|
|
10028
|
-
/* @__PURE__ */ (0,
|
|
10029
|
-
/* @__PURE__ */ (0,
|
|
10027
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "grid grid-cols-7 gap-2 text-center", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ...getDateTitleProps(index), children: day }, `${day}-${index}`)) }),
|
|
10028
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
10030
10029
|
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
10031
10030
|
if (!hasCurrentMonthDates) return null;
|
|
10032
|
-
return /* @__PURE__ */ (0,
|
|
10033
|
-
return /* @__PURE__ */ (0,
|
|
10031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react30.default.Fragment, { children: week.map((dateObj, index) => {
|
|
10032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
10034
10033
|
}) }, weekIndex);
|
|
10035
10034
|
}) })
|
|
10036
10035
|
] }) });
|
|
@@ -10101,22 +10100,22 @@ var calendarStyle = tv({
|
|
|
10101
10100
|
});
|
|
10102
10101
|
|
|
10103
10102
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10104
|
-
var
|
|
10105
|
-
var
|
|
10103
|
+
var import_react31 = require("react");
|
|
10104
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10106
10105
|
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
10107
10106
|
const TOTAL_HOURS = 12;
|
|
10108
10107
|
const TOTAL_MINUTES = 60;
|
|
10109
10108
|
const ITEM_HEIGHT = 30;
|
|
10110
10109
|
const PERIODS = ["AM", "PM"];
|
|
10111
|
-
const [selectedHour, setSelectedHour] = (0,
|
|
10112
|
-
const [selectedMinute, setSelectedMinute] = (0,
|
|
10113
|
-
const [selectedPeriod, setSelectedPeriod] = (0,
|
|
10114
|
-
const hourRef = (0,
|
|
10115
|
-
const minuteRef = (0,
|
|
10116
|
-
const periodRef = (0,
|
|
10110
|
+
const [selectedHour, setSelectedHour] = (0, import_react31.useState)("01");
|
|
10111
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react31.useState)("00");
|
|
10112
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react31.useState)("AM");
|
|
10113
|
+
const hourRef = (0, import_react31.useRef)(null);
|
|
10114
|
+
const minuteRef = (0, import_react31.useRef)(null);
|
|
10115
|
+
const periodRef = (0, import_react31.useRef)(null);
|
|
10117
10116
|
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
10118
10117
|
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
10119
|
-
(0,
|
|
10118
|
+
(0, import_react31.useEffect)(() => {
|
|
10120
10119
|
if (selectedTime) {
|
|
10121
10120
|
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
10122
10121
|
setSelectedHour(formattedHour);
|
|
@@ -10127,7 +10126,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
10127
10126
|
scrollToSelectedTime();
|
|
10128
10127
|
}
|
|
10129
10128
|
}, [selectedTime, isFocusInput]);
|
|
10130
|
-
(0,
|
|
10129
|
+
(0, import_react31.useEffect)(() => {
|
|
10131
10130
|
scrollToSelectedTime();
|
|
10132
10131
|
}, []);
|
|
10133
10132
|
const parseAndFormatTime = (time) => {
|
|
@@ -10164,8 +10163,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
10164
10163
|
onChangeTime(formattedTime);
|
|
10165
10164
|
}
|
|
10166
10165
|
};
|
|
10167
|
-
return /* @__PURE__ */ (0,
|
|
10168
|
-
/* @__PURE__ */ (0,
|
|
10166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
|
|
10167
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10169
10168
|
listItem_default,
|
|
10170
10169
|
{
|
|
10171
10170
|
color,
|
|
@@ -10179,7 +10178,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
10179
10178
|
},
|
|
10180
10179
|
`${period}-${index}`
|
|
10181
10180
|
)) }),
|
|
10182
|
-
/* @__PURE__ */ (0,
|
|
10181
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10183
10182
|
listItem_default,
|
|
10184
10183
|
{
|
|
10185
10184
|
color,
|
|
@@ -10193,7 +10192,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
10193
10192
|
},
|
|
10194
10193
|
`${hour}-${index}`
|
|
10195
10194
|
)) }),
|
|
10196
|
-
/* @__PURE__ */ (0,
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10197
10196
|
listItem_default,
|
|
10198
10197
|
{
|
|
10199
10198
|
color,
|
|
@@ -10212,8 +10211,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
10212
10211
|
var timePicker_default = TimePicker;
|
|
10213
10212
|
|
|
10214
10213
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
10215
|
-
var
|
|
10216
|
-
var DatePicker = (0,
|
|
10214
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10215
|
+
var DatePicker = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
10217
10216
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
10218
10217
|
const {
|
|
10219
10218
|
classNames,
|
|
@@ -10227,7 +10226,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10227
10226
|
onChangeTime,
|
|
10228
10227
|
...inputProps
|
|
10229
10228
|
} = props;
|
|
10230
|
-
const slots = (0,
|
|
10229
|
+
const slots = (0, import_react32.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
10231
10230
|
const {
|
|
10232
10231
|
selectedDate,
|
|
10233
10232
|
selectedTime,
|
|
@@ -10248,32 +10247,32 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10248
10247
|
initialTime: typeof value === "string" ? value : void 0
|
|
10249
10248
|
});
|
|
10250
10249
|
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
10251
|
-
const getBaseProps = (0,
|
|
10250
|
+
const getBaseProps = (0, import_react32.useCallback)(
|
|
10252
10251
|
() => ({
|
|
10253
10252
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
10254
10253
|
}),
|
|
10255
10254
|
[slots, classNames]
|
|
10256
10255
|
);
|
|
10257
|
-
const getLabelProps = (0,
|
|
10256
|
+
const getLabelProps = (0, import_react32.useCallback)(
|
|
10258
10257
|
() => ({
|
|
10259
10258
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
10260
10259
|
}),
|
|
10261
10260
|
[slots, classNames]
|
|
10262
10261
|
);
|
|
10263
|
-
const getInnerWrapperProps = (0,
|
|
10262
|
+
const getInnerWrapperProps = (0, import_react32.useCallback)(
|
|
10264
10263
|
() => ({
|
|
10265
10264
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
10266
10265
|
}),
|
|
10267
10266
|
[slots, classNames]
|
|
10268
10267
|
);
|
|
10269
|
-
const getInputWrapperProps = (0,
|
|
10268
|
+
const getInputWrapperProps = (0, import_react32.useCallback)(
|
|
10270
10269
|
() => ({
|
|
10271
10270
|
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
10272
10271
|
ref: datePickerRef
|
|
10273
10272
|
}),
|
|
10274
10273
|
[slots, classNames]
|
|
10275
10274
|
);
|
|
10276
|
-
const getInputProps = (0,
|
|
10275
|
+
const getInputProps = (0, import_react32.useCallback)(
|
|
10277
10276
|
() => ({
|
|
10278
10277
|
...inputProps,
|
|
10279
10278
|
ref: ref || dateInputRef,
|
|
@@ -10304,33 +10303,33 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10304
10303
|
}),
|
|
10305
10304
|
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
10306
10305
|
);
|
|
10307
|
-
const getContentProps = (0,
|
|
10306
|
+
const getContentProps = (0, import_react32.useCallback)(
|
|
10308
10307
|
() => ({
|
|
10309
10308
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
10310
10309
|
size: originalProps.size
|
|
10311
10310
|
}),
|
|
10312
10311
|
[slots, classNames, originalProps.size]
|
|
10313
10312
|
);
|
|
10314
|
-
const getErrorMessageProps = (0,
|
|
10313
|
+
const getErrorMessageProps = (0, import_react32.useCallback)(
|
|
10315
10314
|
() => ({
|
|
10316
10315
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
10317
10316
|
}),
|
|
10318
10317
|
[slots, classNames]
|
|
10319
10318
|
);
|
|
10320
10319
|
const renderStartContent = () => {
|
|
10321
|
-
if (
|
|
10320
|
+
if (import_react32.default.isValidElement(startContent)) {
|
|
10322
10321
|
const existingProps = startContent.props;
|
|
10323
10322
|
const mergedProps = {
|
|
10324
10323
|
...getContentProps(),
|
|
10325
10324
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
10326
10325
|
};
|
|
10327
|
-
return
|
|
10326
|
+
return import_react32.default.cloneElement(startContent, mergedProps);
|
|
10328
10327
|
} else {
|
|
10329
10328
|
const contentProps = getContentProps();
|
|
10330
|
-
return /* @__PURE__ */ (0,
|
|
10329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ...contentProps, children: startContent });
|
|
10331
10330
|
}
|
|
10332
10331
|
};
|
|
10333
|
-
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0,
|
|
10332
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10334
10333
|
Icon_default,
|
|
10335
10334
|
{
|
|
10336
10335
|
name: type === "time" ? "clock" : "calendar",
|
|
@@ -10340,18 +10339,18 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10340
10339
|
}
|
|
10341
10340
|
) });
|
|
10342
10341
|
const renderContentWithIcon = () => {
|
|
10343
|
-
if (
|
|
10342
|
+
if (import_react32.default.isValidElement(endContent)) {
|
|
10344
10343
|
const existingProps = endContent.props;
|
|
10345
10344
|
const mergedProps = {
|
|
10346
10345
|
...getContentProps(),
|
|
10347
10346
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
10348
10347
|
};
|
|
10349
|
-
return
|
|
10348
|
+
return import_react32.default.cloneElement(endContent, mergedProps);
|
|
10350
10349
|
} else if (errorMessage) {
|
|
10351
10350
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
10352
|
-
return /* @__PURE__ */ (0,
|
|
10351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
10353
10352
|
} else {
|
|
10354
|
-
return /* @__PURE__ */ (0,
|
|
10353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, {});
|
|
10355
10354
|
}
|
|
10356
10355
|
};
|
|
10357
10356
|
const renderEndContent = () => {
|
|
@@ -10366,20 +10365,20 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10366
10365
|
return renderContentWithIcon();
|
|
10367
10366
|
}
|
|
10368
10367
|
};
|
|
10369
|
-
return /* @__PURE__ */ (0,
|
|
10370
|
-
/* @__PURE__ */ (0,
|
|
10371
|
-
label && /* @__PURE__ */ (0,
|
|
10372
|
-
/* @__PURE__ */ (0,
|
|
10373
|
-
/* @__PURE__ */ (0,
|
|
10368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...getBaseProps(), children: [
|
|
10370
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { ...getLabelProps(), children: label }),
|
|
10371
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
10372
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...getInputWrapperProps(), children: [
|
|
10374
10373
|
startContent && renderStartContent(),
|
|
10375
|
-
/* @__PURE__ */ (0,
|
|
10374
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ...getInputProps() }),
|
|
10376
10375
|
renderEndContent()
|
|
10377
10376
|
] }),
|
|
10378
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
10377
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { ...getErrorMessageProps(), children: errorMessage })
|
|
10379
10378
|
] })
|
|
10380
10379
|
] }),
|
|
10381
|
-
targetRect && /* @__PURE__ */ (0,
|
|
10382
|
-
/* @__PURE__ */ (0,
|
|
10380
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: (0, import_react_dom5.createPortal)(
|
|
10381
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
10383
10382
|
"div",
|
|
10384
10383
|
{
|
|
10385
10384
|
ref: datePickerWrapperRef,
|
|
@@ -10390,7 +10389,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10390
10389
|
zIndex: 1e3
|
|
10391
10390
|
},
|
|
10392
10391
|
children: [
|
|
10393
|
-
type === "date" && /* @__PURE__ */ (0,
|
|
10392
|
+
type === "date" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10394
10393
|
calendar_default,
|
|
10395
10394
|
{
|
|
10396
10395
|
color: originalProps.color,
|
|
@@ -10402,7 +10401,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
10402
10401
|
}
|
|
10403
10402
|
}
|
|
10404
10403
|
),
|
|
10405
|
-
type === "time" && /* @__PURE__ */ (0,
|
|
10404
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10406
10405
|
timePicker_default,
|
|
10407
10406
|
{
|
|
10408
10407
|
color: originalProps.color,
|
|
@@ -10552,20 +10551,20 @@ var dateTimePickerStyle = tv({
|
|
|
10552
10551
|
});
|
|
10553
10552
|
|
|
10554
10553
|
// src/components/tree/tree.tsx
|
|
10555
|
-
var
|
|
10556
|
-
var
|
|
10557
|
-
var TreeNodeItem = (0,
|
|
10554
|
+
var import_react33 = require("react");
|
|
10555
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10556
|
+
var TreeNodeItem = (0, import_react33.forwardRef)(
|
|
10558
10557
|
({ node, depth, fileIcon, selectedId, classNames, onExpand }, ref) => {
|
|
10559
|
-
const [isOpen, setIsOpen] = (0,
|
|
10560
|
-
const [children, setChildren] = (0,
|
|
10561
|
-
const [isLoadingChildren, setIsLoadingChildren] = (0,
|
|
10562
|
-
const slots = (0,
|
|
10563
|
-
const hasMore = (0,
|
|
10558
|
+
const [isOpen, setIsOpen] = (0, import_react33.useState)(false);
|
|
10559
|
+
const [children, setChildren] = (0, import_react33.useState)(node.children);
|
|
10560
|
+
const [isLoadingChildren, setIsLoadingChildren] = (0, import_react33.useState)(false);
|
|
10561
|
+
const slots = (0, import_react33.useMemo)(() => treeStyle(), []);
|
|
10562
|
+
const hasMore = (0, import_react33.useMemo)(() => {
|
|
10564
10563
|
if (node.isLeaf) return false;
|
|
10565
10564
|
if (Array.isArray(children)) return children.length > 0;
|
|
10566
10565
|
return typeof onExpand === "function";
|
|
10567
10566
|
}, [node.isLeaf, children, onExpand]);
|
|
10568
|
-
const toggleOpen = (0,
|
|
10567
|
+
const toggleOpen = (0, import_react33.useCallback)(async () => {
|
|
10569
10568
|
if (!isOpen && !children && onExpand && !node.isLeaf) {
|
|
10570
10569
|
setIsLoadingChildren(true);
|
|
10571
10570
|
try {
|
|
@@ -10589,7 +10588,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
|
|
|
10589
10588
|
e.preventDefault();
|
|
10590
10589
|
(_a = node.onRightClick) == null ? void 0 : _a.call(node, e);
|
|
10591
10590
|
};
|
|
10592
|
-
return /* @__PURE__ */ (0,
|
|
10591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
10593
10592
|
"div",
|
|
10594
10593
|
{
|
|
10595
10594
|
ref,
|
|
@@ -10598,7 +10597,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
|
|
|
10598
10597
|
slots.gap({ class: classNames == null ? void 0 : classNames.gap })
|
|
10599
10598
|
),
|
|
10600
10599
|
children: [
|
|
10601
|
-
/* @__PURE__ */ (0,
|
|
10600
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
10602
10601
|
"div",
|
|
10603
10602
|
{
|
|
10604
10603
|
className: clsx(
|
|
@@ -10609,7 +10608,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
|
|
|
10609
10608
|
onClick: handleClick,
|
|
10610
10609
|
onContextMenu: handleRightClick,
|
|
10611
10610
|
children: [
|
|
10612
|
-
hasMore && /* @__PURE__ */ (0,
|
|
10611
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10613
10612
|
Icon_default,
|
|
10614
10613
|
{
|
|
10615
10614
|
name: "right-chevron",
|
|
@@ -10624,9 +10623,9 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
|
|
|
10624
10623
|
]
|
|
10625
10624
|
}
|
|
10626
10625
|
),
|
|
10627
|
-
isOpen && /* @__PURE__ */ (0,
|
|
10628
|
-
isLoadingChildren && /* @__PURE__ */ (0,
|
|
10629
|
-
children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0,
|
|
10626
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: slots.gap({ class: classNames == null ? void 0 : classNames.gap }), children: [
|
|
10627
|
+
isLoadingChildren && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "text-neutral py-1 text-sm", children: "loading..." }),
|
|
10628
|
+
children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10630
10629
|
TreeNodeItem,
|
|
10631
10630
|
{
|
|
10632
10631
|
node: child,
|
|
@@ -10646,7 +10645,7 @@ var TreeNodeItem = (0, import_react34.forwardRef)(
|
|
|
10646
10645
|
);
|
|
10647
10646
|
TreeNodeItem.displayName = "TreeNodeItem";
|
|
10648
10647
|
var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedId, classNames, onExpand }) => {
|
|
10649
|
-
const slots = (0,
|
|
10648
|
+
const slots = (0, import_react33.useMemo)(() => treeStyle(), []);
|
|
10650
10649
|
const handleClick = (e) => {
|
|
10651
10650
|
var _a;
|
|
10652
10651
|
(_a = group.onClick) == null ? void 0 : _a.call(group, e);
|
|
@@ -10656,10 +10655,10 @@ var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedId, classNames,
|
|
|
10656
10655
|
e.preventDefault();
|
|
10657
10656
|
(_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
|
|
10658
10657
|
};
|
|
10659
|
-
return /* @__PURE__ */ (0,
|
|
10660
|
-
headerContent && /* @__PURE__ */ (0,
|
|
10661
|
-
/* @__PURE__ */ (0,
|
|
10662
|
-
/* @__PURE__ */ (0,
|
|
10658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
10659
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: headerContent }),
|
|
10660
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
10661
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
10663
10662
|
"div",
|
|
10664
10663
|
{
|
|
10665
10664
|
className: clsx(
|
|
@@ -10674,7 +10673,7 @@ var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedId, classNames,
|
|
|
10674
10673
|
]
|
|
10675
10674
|
}
|
|
10676
10675
|
),
|
|
10677
|
-
/* @__PURE__ */ (0,
|
|
10676
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: slots.itemWrapper({ class: classNames == null ? void 0 : classNames.itemWrapper }), children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10678
10677
|
TreeNodeItem,
|
|
10679
10678
|
{
|
|
10680
10679
|
node,
|
|
@@ -10712,9 +10711,9 @@ var treeStyle = tv({
|
|
|
10712
10711
|
});
|
|
10713
10712
|
|
|
10714
10713
|
// src/components/fileUpload/fileUpload.tsx
|
|
10715
|
-
var
|
|
10716
|
-
var
|
|
10717
|
-
var
|
|
10714
|
+
var import_react34 = require("react");
|
|
10715
|
+
var import_tailwind_variants31 = require("tailwind-variants");
|
|
10716
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10718
10717
|
function FileUpload({
|
|
10719
10718
|
buttonText,
|
|
10720
10719
|
maxSizeMB = 10,
|
|
@@ -10728,11 +10727,11 @@ function FileUpload({
|
|
|
10728
10727
|
name,
|
|
10729
10728
|
classNames
|
|
10730
10729
|
}) {
|
|
10731
|
-
const fileInputRef = (0,
|
|
10732
|
-
const uploadIntervalRef = (0,
|
|
10733
|
-
const [file, setFile] = (0,
|
|
10734
|
-
const [uploadProgress, setUploadProgress] = (0,
|
|
10735
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
10730
|
+
const fileInputRef = (0, import_react34.useRef)(null);
|
|
10731
|
+
const uploadIntervalRef = (0, import_react34.useRef)(null);
|
|
10732
|
+
const [file, setFile] = (0, import_react34.useState)(null);
|
|
10733
|
+
const [uploadProgress, setUploadProgress] = (0, import_react34.useState)(0);
|
|
10734
|
+
const [errorMessage, setErrorMessage] = (0, import_react34.useState)("");
|
|
10736
10735
|
const slots = fileUploadStyle();
|
|
10737
10736
|
const handleButtonClick = () => {
|
|
10738
10737
|
var _a;
|
|
@@ -10782,18 +10781,18 @@ function FileUpload({
|
|
|
10782
10781
|
setUploadProgress(0);
|
|
10783
10782
|
setErrorMessage("");
|
|
10784
10783
|
};
|
|
10785
|
-
(0,
|
|
10784
|
+
(0, import_react34.useEffect)(() => {
|
|
10786
10785
|
return () => {
|
|
10787
10786
|
if (uploadIntervalRef.current) {
|
|
10788
10787
|
clearInterval(uploadIntervalRef.current);
|
|
10789
10788
|
}
|
|
10790
10789
|
};
|
|
10791
10790
|
}, []);
|
|
10792
|
-
return /* @__PURE__ */ (0,
|
|
10793
|
-
/* @__PURE__ */ (0,
|
|
10794
|
-
/* @__PURE__ */ (0,
|
|
10795
|
-
/* @__PURE__ */ (0,
|
|
10796
|
-
file && /* @__PURE__ */ (0,
|
|
10791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
10792
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
|
|
10793
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: slots.inputWrapper(), children: [
|
|
10794
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(input_default, { name, readOnly: true, variant: "outline", full: true, placeholder, defaultValue: file == null ? void 0 : file.name }),
|
|
10795
|
+
file && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
10797
10796
|
icon_button_default,
|
|
10798
10797
|
{
|
|
10799
10798
|
name: "close",
|
|
@@ -10805,17 +10804,17 @@ function FileUpload({
|
|
|
10805
10804
|
}
|
|
10806
10805
|
)
|
|
10807
10806
|
] }),
|
|
10808
|
-
/* @__PURE__ */ (0,
|
|
10809
|
-
/* @__PURE__ */ (0,
|
|
10807
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, children: buttonText }),
|
|
10808
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
|
|
10810
10809
|
] }),
|
|
10811
|
-
showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0,
|
|
10812
|
-
!errorMessage && helperMessage && /* @__PURE__ */ (0,
|
|
10813
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
10810
|
+
showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: slots.progressBarContainer(), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: slots.progressBar(), style: { width: `${uploadProgress}%` } }) }),
|
|
10811
|
+
!errorMessage && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: slots.helperMessage(), children: helperMessage }),
|
|
10812
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: slots.errorMessage(), children: errorMessage })
|
|
10814
10813
|
] });
|
|
10815
10814
|
}
|
|
10816
10815
|
FileUpload.displayName = "FileUpload";
|
|
10817
10816
|
var fileUpload_default = FileUpload;
|
|
10818
|
-
var fileUploadStyle = (0,
|
|
10817
|
+
var fileUploadStyle = (0, import_tailwind_variants31.tv)({
|
|
10819
10818
|
slots: {
|
|
10820
10819
|
base: ["flex", "flex-col", "gap-[5px]"],
|
|
10821
10820
|
container: ["flex", "items-center", "gap-[10px]"],
|
|
@@ -10830,12 +10829,12 @@ var fileUploadStyle = (0, import_tailwind_variants32.tv)({
|
|
|
10830
10829
|
|
|
10831
10830
|
// src/components/charts/circularProgress.tsx
|
|
10832
10831
|
var import_recharts = require("recharts");
|
|
10833
|
-
var
|
|
10834
|
-
var
|
|
10835
|
-
var CircularProgress = (0,
|
|
10832
|
+
var import_react35 = require("react");
|
|
10833
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10834
|
+
var CircularProgress = (0, import_react35.forwardRef)((originalProps, ref) => {
|
|
10836
10835
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
10837
10836
|
const { label, size = 150, percentage, unit, classNames } = { ...props, ...variantProps };
|
|
10838
|
-
const slots = (0,
|
|
10837
|
+
const slots = (0, import_react35.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
10839
10838
|
const data = [
|
|
10840
10839
|
{
|
|
10841
10840
|
name: label,
|
|
@@ -10845,9 +10844,9 @@ var CircularProgress = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
|
10845
10844
|
const BAR_SIZE = 24;
|
|
10846
10845
|
const OUTER_RADIUS = 88;
|
|
10847
10846
|
const INNER_RADIUS = OUTER_RADIUS - BAR_SIZE;
|
|
10848
|
-
return /* @__PURE__ */ (0,
|
|
10849
|
-
/* @__PURE__ */ (0,
|
|
10850
|
-
/* @__PURE__ */ (0,
|
|
10847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
10848
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
10849
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
10851
10850
|
import_recharts.RadialBarChart,
|
|
10852
10851
|
{
|
|
10853
10852
|
width: size,
|
|
@@ -10859,7 +10858,7 @@ var CircularProgress = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
|
10859
10858
|
startAngle: 90,
|
|
10860
10859
|
endAngle: -270,
|
|
10861
10860
|
children: [
|
|
10862
|
-
/* @__PURE__ */ (0,
|
|
10861
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10863
10862
|
"circle",
|
|
10864
10863
|
{
|
|
10865
10864
|
cx: size / 2,
|
|
@@ -10869,8 +10868,8 @@ var CircularProgress = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
|
10869
10868
|
fill: "currentColor"
|
|
10870
10869
|
}
|
|
10871
10870
|
),
|
|
10872
|
-
/* @__PURE__ */ (0,
|
|
10873
|
-
/* @__PURE__ */ (0,
|
|
10871
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_recharts.PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
|
|
10872
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
10874
10873
|
import_recharts.RadialBar,
|
|
10875
10874
|
{
|
|
10876
10875
|
dataKey: "value",
|
|
@@ -10882,12 +10881,12 @@ var CircularProgress = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
|
10882
10881
|
]
|
|
10883
10882
|
}
|
|
10884
10883
|
),
|
|
10885
|
-
/* @__PURE__ */ (0,
|
|
10884
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: slots.text({ class: classNames == null ? void 0 : classNames.text }), children: [
|
|
10886
10885
|
percentage,
|
|
10887
10886
|
unit
|
|
10888
10887
|
] }) })
|
|
10889
10888
|
] }),
|
|
10890
|
-
label && /* @__PURE__ */ (0,
|
|
10889
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
10891
10890
|
] });
|
|
10892
10891
|
});
|
|
10893
10892
|
CircularProgress.displayName = "CircularProgress";
|
|
@@ -10925,26 +10924,26 @@ var circularProgressStyle = tv({
|
|
|
10925
10924
|
});
|
|
10926
10925
|
|
|
10927
10926
|
// src/components/charts/areaChart.tsx
|
|
10928
|
-
var
|
|
10927
|
+
var import_react36 = require("react");
|
|
10929
10928
|
var import_recharts2 = require("recharts");
|
|
10930
|
-
var
|
|
10931
|
-
var AreaChartComponent = (0,
|
|
10932
|
-
const uniqueId = (0,
|
|
10929
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10930
|
+
var AreaChartComponent = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
10931
|
+
const uniqueId = (0, import_react36.useId)();
|
|
10933
10932
|
const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
|
|
10934
10933
|
const { data, label, color = "primary", classNames } = { ...props, ...variantProps };
|
|
10935
|
-
const slots = (0,
|
|
10934
|
+
const slots = (0, import_react36.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
|
|
10936
10935
|
const COLOR_MAP = {
|
|
10937
10936
|
primary: "#3F9CF2",
|
|
10938
10937
|
danger: "#FF4684"
|
|
10939
10938
|
};
|
|
10940
|
-
const colorHex = (0,
|
|
10941
|
-
const [tickPositions, setTickPositions] = (0,
|
|
10942
|
-
const tickRef = (0,
|
|
10939
|
+
const colorHex = (0, import_react36.useMemo)(() => COLOR_MAP[color], [color]);
|
|
10940
|
+
const [tickPositions, setTickPositions] = (0, import_react36.useState)([]);
|
|
10941
|
+
const tickRef = (0, import_react36.useRef)([]);
|
|
10943
10942
|
const CustomTick = ({ x, y, payload }) => {
|
|
10944
10943
|
if (x !== void 0) {
|
|
10945
10944
|
tickRef.current.push(x);
|
|
10946
10945
|
}
|
|
10947
|
-
return /* @__PURE__ */ (0,
|
|
10946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10948
10947
|
"text",
|
|
10949
10948
|
{
|
|
10950
10949
|
x,
|
|
@@ -10958,7 +10957,7 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
10958
10957
|
}
|
|
10959
10958
|
);
|
|
10960
10959
|
};
|
|
10961
|
-
(0,
|
|
10960
|
+
(0, import_react36.useEffect)(() => {
|
|
10962
10961
|
const raf = requestAnimationFrame(() => {
|
|
10963
10962
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
10964
10963
|
const mids = [];
|
|
@@ -10973,19 +10972,19 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
10973
10972
|
const CustomDotWithShadow = (props2) => {
|
|
10974
10973
|
const { cx, cy, fill, stroke } = props2;
|
|
10975
10974
|
if (cx === void 0 || cy === void 0) return null;
|
|
10976
|
-
return /* @__PURE__ */ (0,
|
|
10977
|
-
/* @__PURE__ */ (0,
|
|
10978
|
-
/* @__PURE__ */ (0,
|
|
10975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
10976
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
|
|
10979
10978
|
] });
|
|
10980
10979
|
};
|
|
10981
|
-
return /* @__PURE__ */ (0,
|
|
10982
|
-
label && /* @__PURE__ */ (0,
|
|
10983
|
-
/* @__PURE__ */ (0,
|
|
10984
|
-
/* @__PURE__ */ (0,
|
|
10985
|
-
/* @__PURE__ */ (0,
|
|
10986
|
-
/* @__PURE__ */ (0,
|
|
10980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
10981
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
10982
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_recharts2.AreaChart, { data, margin: { left: -30 }, children: [
|
|
10983
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
10984
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
|
|
10985
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
|
|
10987
10986
|
] }) }),
|
|
10988
|
-
/* @__PURE__ */ (0,
|
|
10987
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10989
10988
|
import_recharts2.CartesianGrid,
|
|
10990
10989
|
{
|
|
10991
10990
|
vertical: true,
|
|
@@ -10995,7 +10994,7 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
10995
10994
|
verticalPoints: tickPositions
|
|
10996
10995
|
}
|
|
10997
10996
|
),
|
|
10998
|
-
/* @__PURE__ */ (0,
|
|
10997
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10999
10998
|
import_recharts2.XAxis,
|
|
11000
10999
|
{
|
|
11001
11000
|
dataKey: "name",
|
|
@@ -11005,7 +11004,7 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
11005
11004
|
padding: { left: 35.5, right: 35.5 }
|
|
11006
11005
|
}
|
|
11007
11006
|
),
|
|
11008
|
-
/* @__PURE__ */ (0,
|
|
11007
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11009
11008
|
import_recharts2.YAxis,
|
|
11010
11009
|
{
|
|
11011
11010
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -11021,7 +11020,7 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
11021
11020
|
domain: [-6, 110]
|
|
11022
11021
|
}
|
|
11023
11022
|
),
|
|
11024
|
-
/* @__PURE__ */ (0,
|
|
11023
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11025
11024
|
import_recharts2.Area,
|
|
11026
11025
|
{
|
|
11027
11026
|
type: "monotone",
|
|
@@ -11029,7 +11028,7 @@ var AreaChartComponent = (0, import_react37.forwardRef)((originalProps, ref) =>
|
|
|
11029
11028
|
stroke: colorHex,
|
|
11030
11029
|
strokeWidth: 2,
|
|
11031
11030
|
fill: `url(#colorGradient-${uniqueId})`,
|
|
11032
|
-
dot: /* @__PURE__ */ (0,
|
|
11031
|
+
dot: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
|
|
11033
11032
|
activeDot: { r: 7, fill: colorHex }
|
|
11034
11033
|
}
|
|
11035
11034
|
)
|
|
@@ -11061,20 +11060,20 @@ var areaChartStyle = tv({
|
|
|
11061
11060
|
});
|
|
11062
11061
|
|
|
11063
11062
|
// src/components/charts/barChart.tsx
|
|
11064
|
-
var
|
|
11063
|
+
var import_react37 = require("react");
|
|
11065
11064
|
var import_recharts3 = require("recharts");
|
|
11066
|
-
var
|
|
11067
|
-
var BarChartComponent = (0,
|
|
11065
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11066
|
+
var BarChartComponent = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
11068
11067
|
const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
|
|
11069
11068
|
const { data, label, classNames } = { ...props, ...variantProps };
|
|
11070
|
-
const slots = (0,
|
|
11069
|
+
const slots = (0, import_react37.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
|
|
11071
11070
|
const COLOR_MAP = {
|
|
11072
11071
|
primary: "#C7E5FA",
|
|
11073
11072
|
secondary: "#DEC1FA",
|
|
11074
11073
|
warning: "#F9C967"
|
|
11075
11074
|
};
|
|
11076
|
-
const [tickPositions, setTickPositions] = (0,
|
|
11077
|
-
const tickRef = (0,
|
|
11075
|
+
const [tickPositions, setTickPositions] = (0, import_react37.useState)([]);
|
|
11076
|
+
const tickRef = (0, import_react37.useRef)([]);
|
|
11078
11077
|
const CustomBarShape = (barProps) => {
|
|
11079
11078
|
const { x, y, width, height, fill } = barProps;
|
|
11080
11079
|
const radius = 5;
|
|
@@ -11082,19 +11081,19 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11082
11081
|
const adjustedHeight = height + extraHeight;
|
|
11083
11082
|
const adjustedY = y;
|
|
11084
11083
|
const bottomY = adjustedY + adjustedHeight;
|
|
11085
|
-
return height ? /* @__PURE__ */ (0,
|
|
11084
|
+
return height ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11086
11085
|
"path",
|
|
11087
11086
|
{
|
|
11088
11087
|
d: `M${x},${bottomY} L${x},${adjustedY + radius} Q${x},${adjustedY} ${x + radius},${adjustedY} L${x + width - radius},${adjustedY} Q${x + width},${adjustedY} ${x + width},${adjustedY + radius} L${x + width},${bottomY} Z`,
|
|
11089
11088
|
fill
|
|
11090
11089
|
}
|
|
11091
|
-
) : /* @__PURE__ */ (0,
|
|
11090
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("rect", { x, y, width, height: 0, fill });
|
|
11092
11091
|
};
|
|
11093
11092
|
const CustomTick = ({ x, y, payload }) => {
|
|
11094
11093
|
if (x !== void 0) {
|
|
11095
11094
|
tickRef.current.push(x);
|
|
11096
11095
|
}
|
|
11097
|
-
return /* @__PURE__ */ (0,
|
|
11096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11098
11097
|
"text",
|
|
11099
11098
|
{
|
|
11100
11099
|
x,
|
|
@@ -11108,7 +11107,7 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11108
11107
|
}
|
|
11109
11108
|
);
|
|
11110
11109
|
};
|
|
11111
|
-
(0,
|
|
11110
|
+
(0, import_react37.useEffect)(() => {
|
|
11112
11111
|
const raf = requestAnimationFrame(() => {
|
|
11113
11112
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
11114
11113
|
const mids = [];
|
|
@@ -11120,10 +11119,10 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11120
11119
|
});
|
|
11121
11120
|
return () => cancelAnimationFrame(raf);
|
|
11122
11121
|
}, [data]);
|
|
11123
|
-
return /* @__PURE__ */ (0,
|
|
11124
|
-
label && /* @__PURE__ */ (0,
|
|
11125
|
-
/* @__PURE__ */ (0,
|
|
11126
|
-
/* @__PURE__ */ (0,
|
|
11122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
11123
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
11124
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_recharts3.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_recharts3.BarChart, { data, margin: { left: -30 }, barSize: 20, barGap: 10, children: [
|
|
11125
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11127
11126
|
import_recharts3.CartesianGrid,
|
|
11128
11127
|
{
|
|
11129
11128
|
vertical: true,
|
|
@@ -11133,7 +11132,7 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11133
11132
|
verticalPoints: tickPositions
|
|
11134
11133
|
}
|
|
11135
11134
|
),
|
|
11136
|
-
/* @__PURE__ */ (0,
|
|
11135
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11137
11136
|
import_recharts3.XAxis,
|
|
11138
11137
|
{
|
|
11139
11138
|
dataKey: "name",
|
|
@@ -11143,7 +11142,7 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11143
11142
|
padding: { left: 32, right: 32 }
|
|
11144
11143
|
}
|
|
11145
11144
|
),
|
|
11146
|
-
/* @__PURE__ */ (0,
|
|
11145
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11147
11146
|
import_recharts3.YAxis,
|
|
11148
11147
|
{
|
|
11149
11148
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -11159,9 +11158,9 @@ var BarChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
|
|
|
11159
11158
|
domain: [-6, 110]
|
|
11160
11159
|
}
|
|
11161
11160
|
),
|
|
11162
|
-
/* @__PURE__ */ (0,
|
|
11163
|
-
/* @__PURE__ */ (0,
|
|
11164
|
-
/* @__PURE__ */ (0,
|
|
11161
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_recharts3.Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
|
|
11162
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_recharts3.Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
|
|
11163
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_recharts3.Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
|
|
11165
11164
|
] }) })
|
|
11166
11165
|
] });
|
|
11167
11166
|
});
|
|
@@ -11191,7 +11190,6 @@ var barChartStyle = tv({
|
|
|
11191
11190
|
CircularProgress,
|
|
11192
11191
|
DateTimePicker,
|
|
11193
11192
|
DefinitionTable,
|
|
11194
|
-
DefinitionTable2,
|
|
11195
11193
|
Drawer,
|
|
11196
11194
|
FileUpload,
|
|
11197
11195
|
Icon,
|