@deepnoid/ui 0.1.214 → 0.1.215
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 +242 -232
- package/dist/{chunk-TP2EMUPN.mjs → chunk-5UCNLY2A.mjs} +1 -1
- package/dist/{chunk-5U2LLMGN.mjs → chunk-74MC7B4K.mjs} +5 -5
- package/dist/{chunk-37QJ33U2.mjs → chunk-APQE3TRN.mjs} +4 -4
- package/dist/chunk-CJM47P6P.mjs +43 -0
- package/dist/{chunk-QEGCZ3CT.mjs → chunk-FZYZSMSS.mjs} +1 -1
- package/dist/{chunk-3264O6JH.mjs → chunk-LUJC5WLE.mjs} +3 -3
- package/dist/chunk-OS7SROYP.mjs +18 -0
- package/dist/{chunk-HIAN3OBR.mjs → chunk-QECR6VMW.mjs} +3 -3
- package/dist/{chunk-OTIDMEP3.mjs → chunk-RO44KYXO.mjs} +9 -9
- package/dist/{chunk-HZ7LMGRS.mjs → chunk-SC2YK6GR.mjs} +4 -4
- package/dist/{chunk-UUHAKMGJ.mjs → chunk-UT4SXNWB.mjs} +6 -6
- package/dist/{chunk-BS2SDEG2.mjs → chunk-VSVBYQF4.mjs} +4 -4
- package/dist/components/accordion/accordion.mjs +2 -2
- package/dist/components/accordion/accordionItem.mjs +2 -2
- package/dist/components/accordion/index.mjs +3 -3
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +5 -5
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.mjs +6 -6
- package/dist/components/button/text-button.mjs +2 -2
- package/dist/components/charts/areaChart.mjs +2 -2
- package/dist/components/charts/barChart.mjs +2 -2
- package/dist/components/charts/circularProgress.mjs +2 -2
- package/dist/components/charts/index.mjs +8 -8
- package/dist/components/charts/radarChart.mjs +2 -2
- package/dist/components/charts/simpleBarChart.mjs +2 -2
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/drawer/drawer.mjs +2 -2
- package/dist/components/drawer/index.mjs +2 -2
- package/dist/components/fileUpload/fileUpload.mjs +8 -8
- package/dist/components/fileUpload/index.mjs +8 -8
- package/dist/components/input/index.mjs +2 -2
- package/dist/components/input/input.mjs +2 -2
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/GlobalModalProvider.d.mts +17 -0
- package/dist/components/modal/GlobalModalProvider.d.ts +17 -0
- package/dist/components/modal/GlobalModalProvider.js +5962 -0
- package/dist/components/modal/GlobalModalProvider.mjs +28 -0
- package/dist/components/modal/index.d.mts +3 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/index.js +52 -2
- package/dist/components/modal/index.mjs +19 -9
- package/dist/components/modal/modal.mjs +7 -7
- package/dist/components/modal/useGlobalModal.d.mts +10 -0
- package/dist/components/modal/useGlobalModal.d.ts +10 -0
- package/dist/components/modal/useGlobalModal.js +46 -0
- package/dist/components/modal/useGlobalModal.mjs +27 -0
- package/dist/components/pagination/index.mjs +3 -3
- package/dist/components/pagination/pagination.mjs +3 -3
- package/dist/components/picker/datePicker.mjs +7 -7
- package/dist/components/picker/day.mjs +2 -2
- package/dist/components/picker/index.mjs +9 -9
- package/dist/components/picker/timePicker/Panel.mjs +5 -5
- package/dist/components/picker/timePicker/index.mjs +7 -7
- package/dist/components/progress/index.mjs +2 -2
- package/dist/components/progress/progress.mjs +2 -2
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.mjs +5 -5
- package/dist/components/select/select.mjs +5 -5
- package/dist/components/starRating/index.mjs +2 -2
- package/dist/components/starRating/starRating.mjs +2 -2
- package/dist/components/table/definition-table.mjs +2 -2
- package/dist/components/table/index.mjs +7 -7
- package/dist/components/table/table-body.mjs +6 -6
- package/dist/components/table/table-head.mjs +6 -6
- package/dist/components/table/table.mjs +6 -6
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/timePicker/calendar.mjs +3 -3
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.mjs +2 -2
- package/dist/components/tree/tree.mjs +2 -2
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +404 -356
- package/dist/index.mjs +91 -83
- package/package.json +1 -1
- package/dist/{chunk-GZCS62ZQ.mjs → chunk-3DCUMRYP.mjs} +3 -3
- package/dist/{chunk-SOY4EHD7.mjs → chunk-3HANNN76.mjs} +3 -3
- package/dist/{chunk-DWGS3KXX.mjs → chunk-4MTXDUV3.mjs} +3 -3
- package/dist/{chunk-IH3BJRTV.mjs → chunk-4X35QQTI.mjs} +3 -3
- package/dist/{chunk-TBERIJPX.mjs → chunk-5KC3IFNR.mjs} +3 -3
- package/dist/{chunk-VB56ZYN4.mjs → chunk-6WD32ERF.mjs} +3 -3
- package/dist/{chunk-ZIH433FF.mjs → chunk-ACZ3DQVT.mjs} +3 -3
- package/dist/{chunk-HQCRZAZ7.mjs → chunk-AZYWRRZY.mjs} +3 -3
- package/dist/{chunk-DS5CGU2X.mjs → chunk-BH3I4LIZ.mjs} +3 -3
- package/dist/{chunk-EJZB335B.mjs → chunk-DW3BX4M2.mjs} +3 -3
- package/dist/{chunk-PP76VNOE.mjs → chunk-G4G6YXZH.mjs} +3 -3
- package/dist/{chunk-AFNMMCHX.mjs → chunk-H6ZQDMYU.mjs} +3 -3
- package/dist/{chunk-PMFS3EBL.mjs → chunk-JGG3ZUNG.mjs} +3 -3
- package/dist/{chunk-CITFY2LG.mjs → chunk-JI3WAAZV.mjs} +3 -3
- package/dist/{chunk-JRHIGGG7.mjs → chunk-LH6Z7SDZ.mjs} +3 -3
- package/dist/{chunk-DI6UNIDA.mjs → chunk-NDNIAALB.mjs} +3 -3
- package/dist/{chunk-BFFFDEPN.mjs → chunk-NGRGAY42.mjs} +3 -3
- package/dist/{chunk-DJOG6Z35.mjs → chunk-NNVGYR5T.mjs} +0 -0
- package/dist/{chunk-3CDZAW24.mjs → chunk-NTNF5T5I.mjs} +3 -3
- package/dist/{chunk-XZBRS2XZ.mjs → chunk-PLR4DZBN.mjs} +3 -3
- package/dist/{chunk-PDFTWZD4.mjs → chunk-U52FBRJ3.mjs} +3 -3
- package/dist/{chunk-45NUW43V.mjs → chunk-U7SYKG2C.mjs} +3 -3
- package/dist/{chunk-Q6WHL6BQ.mjs → chunk-US5NY7UP.mjs} +3 -3
- package/dist/{chunk-IYCV2EGX.mjs → chunk-WA7CSZQ3.mjs} +3 -3
- package/dist/{chunk-LZ3KI3FZ.mjs → chunk-XZYQFBCT.mjs} +3 -3
- package/dist/{chunk-TXN7UGNI.mjs → chunk-Z2O4QVZO.mjs} +3 -3
- package/dist/{chunk-QYJSOH4Z.mjs → chunk-ZFC5O2V3.mjs} +3 -3
package/dist/index.js
CHANGED
|
@@ -120,6 +120,7 @@ __export(index_exports, {
|
|
|
120
120
|
DefinitionTable: () => definition_table_default,
|
|
121
121
|
Drawer: () => drawer_default,
|
|
122
122
|
FileUpload: () => fileUpload_default,
|
|
123
|
+
GlobalModalProvider: () => GlobalModalProvider,
|
|
123
124
|
Icon: () => Icon_default,
|
|
124
125
|
IconButton: () => icon_button_default,
|
|
125
126
|
Input: () => input_default,
|
|
@@ -148,6 +149,7 @@ __export(index_exports, {
|
|
|
148
149
|
deepnoidUi: () => deepnoidUi,
|
|
149
150
|
iconTemplate: () => iconTemplate,
|
|
150
151
|
tv: () => tv,
|
|
152
|
+
useGlobalModal: () => useGlobalModal,
|
|
151
153
|
useToast: () => useToast
|
|
152
154
|
});
|
|
153
155
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -10754,19 +10756,63 @@ var modal = tv({
|
|
|
10754
10756
|
}
|
|
10755
10757
|
});
|
|
10756
10758
|
|
|
10757
|
-
// src/components/
|
|
10759
|
+
// src/components/modal/GlobalModalProvider.tsx
|
|
10758
10760
|
var import_react28 = require("react");
|
|
10759
|
-
var import_react_dom4 = require("react-dom");
|
|
10760
10761
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10761
|
-
var
|
|
10762
|
+
var GlobalModalContext = (0, import_react28.createContext)(void 0);
|
|
10763
|
+
function GlobalModalProvider({ children }) {
|
|
10764
|
+
var _a;
|
|
10765
|
+
const [modalConfig, setModalConfig] = (0, import_react28.useState)(null);
|
|
10766
|
+
const open = (0, import_react28.useCallback)((config) => {
|
|
10767
|
+
setModalConfig(config);
|
|
10768
|
+
}, []);
|
|
10769
|
+
const close = (0, import_react28.useCallback)(() => {
|
|
10770
|
+
setModalConfig(null);
|
|
10771
|
+
}, []);
|
|
10772
|
+
const value = (0, import_react28.useMemo)(() => ({ open, close }), [open, close]);
|
|
10773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GlobalModalContext.Provider, { value, children: [
|
|
10774
|
+
children,
|
|
10775
|
+
modalConfig && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
10776
|
+
modal_default,
|
|
10777
|
+
{
|
|
10778
|
+
isOpen: true,
|
|
10779
|
+
title: modalConfig.title,
|
|
10780
|
+
content: modalConfig.content,
|
|
10781
|
+
confirmButtonText: modalConfig.confirmButtonText,
|
|
10782
|
+
cancelButtonText: modalConfig.cancelButtonText,
|
|
10783
|
+
color: modalConfig.color || "primary",
|
|
10784
|
+
showCloseButton: (_a = modalConfig.showCloseButton) != null ? _a : true,
|
|
10785
|
+
onCancel: modalConfig.onCancel || close,
|
|
10786
|
+
onConfirm: modalConfig.onConfirm,
|
|
10787
|
+
classNames: modalConfig.classNames
|
|
10788
|
+
}
|
|
10789
|
+
)
|
|
10790
|
+
] });
|
|
10791
|
+
}
|
|
10792
|
+
|
|
10793
|
+
// src/components/modal/useGlobalModal.tsx
|
|
10794
|
+
var import_react29 = require("react");
|
|
10795
|
+
var useGlobalModal = () => {
|
|
10796
|
+
const context = (0, import_react29.useContext)(GlobalModalContext);
|
|
10797
|
+
if (context === void 0) {
|
|
10798
|
+
throw new Error("useGlobalModal must be used within a GlobalModalProvider");
|
|
10799
|
+
}
|
|
10800
|
+
return context;
|
|
10801
|
+
};
|
|
10802
|
+
|
|
10803
|
+
// src/components/drawer/drawer.tsx
|
|
10804
|
+
var import_react30 = require("react");
|
|
10805
|
+
var import_react_dom4 = require("react-dom");
|
|
10806
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10807
|
+
var Drawer = (0, import_react30.forwardRef)((props, ref) => {
|
|
10762
10808
|
const [localProps, variantProps] = mapPropsVariants(props, drawer.variantKeys);
|
|
10763
10809
|
const { classNames, isOpen, content, isKeyboardDismissDisabled = false, onClose, backdrop = true } = localProps;
|
|
10764
10810
|
const position = props.position || "right";
|
|
10765
|
-
const [shouldRender, setShouldRender] = (0,
|
|
10766
|
-
const [isAnimating, setIsAnimating] = (0,
|
|
10767
|
-
const [isContentAnimating, setIsContentAnimating] = (0,
|
|
10768
|
-
const slots = (0,
|
|
10769
|
-
(0,
|
|
10811
|
+
const [shouldRender, setShouldRender] = (0, import_react30.useState)(isOpen);
|
|
10812
|
+
const [isAnimating, setIsAnimating] = (0, import_react30.useState)(isOpen);
|
|
10813
|
+
const [isContentAnimating, setIsContentAnimating] = (0, import_react30.useState)(isOpen);
|
|
10814
|
+
const slots = (0, import_react30.useMemo)(() => drawer(variantProps), [variantProps]);
|
|
10815
|
+
(0, import_react30.useEffect)(() => {
|
|
10770
10816
|
if (isOpen) {
|
|
10771
10817
|
setShouldRender(true);
|
|
10772
10818
|
requestAnimationFrame(() => {
|
|
@@ -10784,7 +10830,7 @@ var Drawer = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
10784
10830
|
return () => clearTimeout(timer);
|
|
10785
10831
|
}
|
|
10786
10832
|
}, [isOpen]);
|
|
10787
|
-
(0,
|
|
10833
|
+
(0, import_react30.useEffect)(() => {
|
|
10788
10834
|
if (shouldRender) {
|
|
10789
10835
|
document.body.classList.add("overflow-hidden");
|
|
10790
10836
|
} else {
|
|
@@ -10819,7 +10865,7 @@ var Drawer = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
10819
10865
|
};
|
|
10820
10866
|
if (!shouldRender) return null;
|
|
10821
10867
|
return (0, import_react_dom4.createPortal)(
|
|
10822
|
-
/* @__PURE__ */ (0,
|
|
10868
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
10823
10869
|
"div",
|
|
10824
10870
|
{
|
|
10825
10871
|
ref,
|
|
@@ -10834,15 +10880,15 @@ var Drawer = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
10834
10880
|
role: "dialog",
|
|
10835
10881
|
"aria-modal": "true",
|
|
10836
10882
|
children: [
|
|
10837
|
-
backdrop && /* @__PURE__ */ (0,
|
|
10838
|
-
/* @__PURE__ */ (0,
|
|
10883
|
+
backdrop && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm", onClick: onClose }),
|
|
10884
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
10839
10885
|
"div",
|
|
10840
10886
|
{
|
|
10841
10887
|
className: slots.drawerWrapper({
|
|
10842
10888
|
class: clsx(classNames == null ? void 0 : classNames.drawerWrapper, getAnimationClasses())
|
|
10843
10889
|
}),
|
|
10844
10890
|
onClick: (e) => e.stopPropagation(),
|
|
10845
|
-
children: /* @__PURE__ */ (0,
|
|
10891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: content })
|
|
10846
10892
|
}
|
|
10847
10893
|
)
|
|
10848
10894
|
]
|
|
@@ -10915,15 +10961,15 @@ var drawer = tv({
|
|
|
10915
10961
|
var drawer_default = Drawer;
|
|
10916
10962
|
|
|
10917
10963
|
// src/components/list/list.tsx
|
|
10918
|
-
var
|
|
10919
|
-
var
|
|
10920
|
-
var List = (0,
|
|
10964
|
+
var import_react31 = require("react");
|
|
10965
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10966
|
+
var List = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
10921
10967
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
10922
10968
|
const { children, classNames } = props;
|
|
10923
|
-
const slots = (0,
|
|
10924
|
-
return /* @__PURE__ */ (0,
|
|
10925
|
-
if (!(0,
|
|
10926
|
-
return (0,
|
|
10969
|
+
const slots = (0, import_react31.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
10970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react31.Children.map(children, (child) => {
|
|
10971
|
+
if (!(0, import_react31.isValidElement)(child)) return child;
|
|
10972
|
+
return (0, import_react31.cloneElement)(child, {
|
|
10927
10973
|
...variantProps,
|
|
10928
10974
|
...child.props
|
|
10929
10975
|
});
|
|
@@ -10960,9 +11006,9 @@ var listStyle = tv({
|
|
|
10960
11006
|
});
|
|
10961
11007
|
|
|
10962
11008
|
// src/components/list/listItem.tsx
|
|
10963
|
-
var
|
|
10964
|
-
var
|
|
10965
|
-
var ListItem = (0,
|
|
11009
|
+
var import_react32 = require("react");
|
|
11010
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
11011
|
+
var ListItem = (0, import_react32.forwardRef)((props, ref) => {
|
|
10966
11012
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
10967
11013
|
const {
|
|
10968
11014
|
title,
|
|
@@ -10974,19 +11020,19 @@ var ListItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
|
10974
11020
|
classNames,
|
|
10975
11021
|
onClick
|
|
10976
11022
|
} = { ...rawProps, ...variantProps };
|
|
10977
|
-
const slots = (0,
|
|
11023
|
+
const slots = (0, import_react32.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
10978
11024
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
10979
11025
|
const avatarSize = iconSize;
|
|
10980
|
-
return /* @__PURE__ */ (0,
|
|
10981
|
-
/* @__PURE__ */ (0,
|
|
10982
|
-
avatar && /* @__PURE__ */ (0,
|
|
10983
|
-
startIconName && /* @__PURE__ */ (0,
|
|
10984
|
-
/* @__PURE__ */ (0,
|
|
10985
|
-
/* @__PURE__ */ (0,
|
|
10986
|
-
subTitle && /* @__PURE__ */ (0,
|
|
11026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
11027
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
11028
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(avatar_default, { ...avatar, variant: "round", size: avatarSize }),
|
|
11029
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon_default, { name: startIconName, fill: true, size, className: slots.startIcon({ class: classNames == null ? void 0 : classNames.startIcon }) }),
|
|
11030
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper }), children: [
|
|
11031
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
11032
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle }), children: subTitle })
|
|
10987
11033
|
] })
|
|
10988
11034
|
] }),
|
|
10989
|
-
/* @__PURE__ */ (0,
|
|
11035
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon_default, { name: "right-chevron", size: iconSize, className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) })
|
|
10990
11036
|
] });
|
|
10991
11037
|
});
|
|
10992
11038
|
ListItem.displayName = "ListItem";
|
|
@@ -11154,9 +11200,9 @@ var listItemStyle = tv({
|
|
|
11154
11200
|
});
|
|
11155
11201
|
|
|
11156
11202
|
// src/components/toast/toast.tsx
|
|
11157
|
-
var
|
|
11158
|
-
var
|
|
11159
|
-
var Toast = (0,
|
|
11203
|
+
var import_react33 = require("react");
|
|
11204
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
11205
|
+
var Toast = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
11160
11206
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
11161
11207
|
const {
|
|
11162
11208
|
title,
|
|
@@ -11170,9 +11216,9 @@ var Toast = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
11170
11216
|
disableAnimation,
|
|
11171
11217
|
onClose
|
|
11172
11218
|
} = { ...props, ...variantProps };
|
|
11173
|
-
const slots = (0,
|
|
11174
|
-
const toastRef = (0,
|
|
11175
|
-
(0,
|
|
11219
|
+
const slots = (0, import_react33.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
11220
|
+
const toastRef = (0, import_react33.useRef)(null);
|
|
11221
|
+
(0, import_react33.useImperativeHandle)(
|
|
11176
11222
|
ref,
|
|
11177
11223
|
() => ({
|
|
11178
11224
|
getWidth: () => {
|
|
@@ -11183,7 +11229,7 @@ var Toast = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
11183
11229
|
[]
|
|
11184
11230
|
);
|
|
11185
11231
|
const animationClass = (placement == null ? void 0 : placement.includes("top")) ? "animate-slideInFromTop" : "animate-slideInFromBottom";
|
|
11186
|
-
return /* @__PURE__ */ (0,
|
|
11232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
11187
11233
|
"div",
|
|
11188
11234
|
{
|
|
11189
11235
|
ref: toastRef,
|
|
@@ -11195,12 +11241,12 @@ var Toast = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
11195
11241
|
),
|
|
11196
11242
|
style: hasShadow ? { boxShadow: "0px 6px 18px rgba(0, 0, 0, 0.10)" } : {},
|
|
11197
11243
|
children: [
|
|
11198
|
-
/* @__PURE__ */ (0,
|
|
11199
|
-
showIcon && /* @__PURE__ */ (0,
|
|
11200
|
-
/* @__PURE__ */ (0,
|
|
11201
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
11244
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
11245
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
|
|
11246
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
11247
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { name: "close", className: "cursor-pointer", onClick: onClose })
|
|
11202
11248
|
] }),
|
|
11203
|
-
content && /* @__PURE__ */ (0,
|
|
11249
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: content })
|
|
11204
11250
|
]
|
|
11205
11251
|
}
|
|
11206
11252
|
);
|
|
@@ -11305,7 +11351,7 @@ var toast = tv({
|
|
|
11305
11351
|
});
|
|
11306
11352
|
|
|
11307
11353
|
// src/components/toast/use-toast.tsx
|
|
11308
|
-
var
|
|
11354
|
+
var import_react34 = require("react");
|
|
11309
11355
|
|
|
11310
11356
|
// src/components/toast/toast-utils.ts
|
|
11311
11357
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -11344,10 +11390,10 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
11344
11390
|
};
|
|
11345
11391
|
|
|
11346
11392
|
// src/components/toast/use-toast.tsx
|
|
11347
|
-
var
|
|
11348
|
-
var ToastContext = (0,
|
|
11393
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11394
|
+
var ToastContext = (0, import_react34.createContext)(null);
|
|
11349
11395
|
var useToast = () => {
|
|
11350
|
-
const context = (0,
|
|
11396
|
+
const context = (0, import_react34.useContext)(ToastContext);
|
|
11351
11397
|
if (!context) {
|
|
11352
11398
|
throw new Error("useToast must be used within a ToastProvider");
|
|
11353
11399
|
}
|
|
@@ -11357,10 +11403,10 @@ var ToastProvider = ({
|
|
|
11357
11403
|
globalOptions,
|
|
11358
11404
|
children
|
|
11359
11405
|
}) => {
|
|
11360
|
-
const [toasts, setToasts] = (0,
|
|
11361
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
11362
|
-
const toastRef = (0,
|
|
11363
|
-
const addToast = (0,
|
|
11406
|
+
const [toasts, setToasts] = (0, import_react34.useState)([]);
|
|
11407
|
+
const [containerStyle, setContainerStyle] = (0, import_react34.useState)({});
|
|
11408
|
+
const toastRef = (0, import_react34.useRef)(null);
|
|
11409
|
+
const addToast = (0, import_react34.useCallback)(
|
|
11364
11410
|
(title, options = {}) => {
|
|
11365
11411
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
11366
11412
|
const newToast = {
|
|
@@ -11377,11 +11423,11 @@ var ToastProvider = ({
|
|
|
11377
11423
|
},
|
|
11378
11424
|
[globalOptions]
|
|
11379
11425
|
);
|
|
11380
|
-
const removeToast = (0,
|
|
11426
|
+
const removeToast = (0, import_react34.useCallback)((id) => {
|
|
11381
11427
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
11382
11428
|
}, []);
|
|
11383
11429
|
const contextValue = addToast;
|
|
11384
|
-
(0,
|
|
11430
|
+
(0, import_react34.useEffect)(() => {
|
|
11385
11431
|
var _a;
|
|
11386
11432
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
11387
11433
|
const offset = 20;
|
|
@@ -11395,20 +11441,20 @@ var ToastProvider = ({
|
|
|
11395
11441
|
right: right !== void 0 ? `${right}px` : void 0
|
|
11396
11442
|
});
|
|
11397
11443
|
}, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
|
|
11398
|
-
return /* @__PURE__ */ (0,
|
|
11444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ToastContext.Provider, { value: contextValue, children: [
|
|
11399
11445
|
children,
|
|
11400
|
-
/* @__PURE__ */ (0,
|
|
11446
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { id: "deepnoid-toast-container", className: "flex flex-col gap-[10px]", style: containerStyle, children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(toast_default, { ref: toastRef, onClose: () => removeToast(toast2.id), ...toast2 }, toast2.id)) })
|
|
11401
11447
|
] });
|
|
11402
11448
|
};
|
|
11403
11449
|
|
|
11404
11450
|
// src/components/picker/day.tsx
|
|
11405
|
-
var
|
|
11406
|
-
var
|
|
11407
|
-
var Day = (0,
|
|
11451
|
+
var import_react35 = require("react");
|
|
11452
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11453
|
+
var Day = (0, import_react35.forwardRef)((originalProps, ref) => {
|
|
11408
11454
|
const [props, variantProps] = mapPropsVariants(originalProps, dayStyle.variantKeys);
|
|
11409
11455
|
const { classNames, children, ...divProps } = props;
|
|
11410
|
-
const slots = (0,
|
|
11411
|
-
return /* @__PURE__ */ (0,
|
|
11456
|
+
const slots = (0, import_react35.useMemo)(() => dayStyle({ ...variantProps }), [variantProps]);
|
|
11457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), ...divProps, children });
|
|
11412
11458
|
});
|
|
11413
11459
|
Day.displayName = "Day";
|
|
11414
11460
|
var day_default = Day;
|
|
@@ -11444,7 +11490,7 @@ var dayStyle = tv({
|
|
|
11444
11490
|
});
|
|
11445
11491
|
|
|
11446
11492
|
// src/components/picker/datePicker.tsx
|
|
11447
|
-
var
|
|
11493
|
+
var import_react36 = require("react");
|
|
11448
11494
|
var import_react_dom5 = require("react-dom");
|
|
11449
11495
|
|
|
11450
11496
|
// src/components/picker/utils.ts
|
|
@@ -11482,8 +11528,8 @@ var getCurrent12Hour = () => {
|
|
|
11482
11528
|
};
|
|
11483
11529
|
|
|
11484
11530
|
// src/components/picker/datePicker.tsx
|
|
11485
|
-
var
|
|
11486
|
-
var DatePicker = (0,
|
|
11531
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11532
|
+
var DatePicker = (0, import_react36.forwardRef)((originalProps, ref) => {
|
|
11487
11533
|
const [props, variantProps] = mapPropsVariants(originalProps, datePickerStyle.variantKeys);
|
|
11488
11534
|
const {
|
|
11489
11535
|
classNames,
|
|
@@ -11513,30 +11559,30 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11513
11559
|
enabledDates,
|
|
11514
11560
|
...inputProps
|
|
11515
11561
|
} = { ...props, ...variantProps };
|
|
11516
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
11517
|
-
const [selectedRange, setSelectedRange] = (0,
|
|
11562
|
+
const [selectedDate, setSelectedDate] = (0, import_react36.useState)(range ? "" : typeof value === "string" ? value || "" : "");
|
|
11563
|
+
const [selectedRange, setSelectedRange] = (0, import_react36.useState)({
|
|
11518
11564
|
startDate: range && typeof value === "object" ? (value == null ? void 0 : value.startDate) || "" : "",
|
|
11519
11565
|
endDate: range && typeof value === "object" ? (value == null ? void 0 : value.endDate) || "" : ""
|
|
11520
11566
|
});
|
|
11521
|
-
const [tempSelectedDate, setTempSelectedDate] = (0,
|
|
11522
|
-
const [tempSelectedRange, setTempSelectedRange] = (0,
|
|
11523
|
-
const [rangeSelection, setRangeSelection] = (0,
|
|
11524
|
-
const [isPanelOpen, setIsPanelOpen] = (0,
|
|
11525
|
-
const [leftCurrentDate, setLeftCurrentDate] = (0,
|
|
11567
|
+
const [tempSelectedDate, setTempSelectedDate] = (0, import_react36.useState)(selectedDate);
|
|
11568
|
+
const [tempSelectedRange, setTempSelectedRange] = (0, import_react36.useState)(selectedRange);
|
|
11569
|
+
const [rangeSelection, setRangeSelection] = (0, import_react36.useState)("start");
|
|
11570
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react36.useState)(false);
|
|
11571
|
+
const [leftCurrentDate, setLeftCurrentDate] = (0, import_react36.useState)(
|
|
11526
11572
|
range && tempSelectedRange.startDate ? new Date(tempSelectedRange.startDate) : tempSelectedDate ? new Date(tempSelectedDate) : /* @__PURE__ */ new Date()
|
|
11527
11573
|
);
|
|
11528
|
-
const [rightCurrentDate, setRightCurrentDate] = (0,
|
|
11574
|
+
const [rightCurrentDate, setRightCurrentDate] = (0, import_react36.useState)(
|
|
11529
11575
|
dualCalendar ? new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1) : /* @__PURE__ */ new Date()
|
|
11530
11576
|
);
|
|
11531
|
-
const inputWrapperRef = (0,
|
|
11532
|
-
const calendarWrapperRef = (0,
|
|
11533
|
-
const [panelPos, setPanelPos] = (0,
|
|
11577
|
+
const inputWrapperRef = (0, import_react36.useRef)(null);
|
|
11578
|
+
const calendarWrapperRef = (0, import_react36.useRef)(null);
|
|
11579
|
+
const [panelPos, setPanelPos] = (0, import_react36.useState)({
|
|
11534
11580
|
top: -9999,
|
|
11535
11581
|
left: -9999,
|
|
11536
11582
|
right: -9999
|
|
11537
11583
|
});
|
|
11538
|
-
const blurTimeoutRef = (0,
|
|
11539
|
-
const isConfirmDisabled = (0,
|
|
11584
|
+
const blurTimeoutRef = (0, import_react36.useRef)(null);
|
|
11585
|
+
const isConfirmDisabled = (0, import_react36.useMemo)(() => {
|
|
11540
11586
|
if (range) {
|
|
11541
11587
|
const hasStart = !!tempSelectedRange.startDate;
|
|
11542
11588
|
const hasEnd = !!tempSelectedRange.endDate;
|
|
@@ -11556,7 +11602,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11556
11602
|
return dateString;
|
|
11557
11603
|
}
|
|
11558
11604
|
};
|
|
11559
|
-
const displayValue = (0,
|
|
11605
|
+
const displayValue = (0, import_react36.useMemo)(() => {
|
|
11560
11606
|
if (range) {
|
|
11561
11607
|
const start = formatDate(selectedRange.startDate);
|
|
11562
11608
|
const end = formatDate(selectedRange.endDate);
|
|
@@ -11566,7 +11612,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11566
11612
|
}
|
|
11567
11613
|
return formatDate(selectedDate);
|
|
11568
11614
|
}, [selectedDate, selectedRange, format, range]);
|
|
11569
|
-
const calculatePosition = (0,
|
|
11615
|
+
const calculatePosition = (0, import_react36.useCallback)(() => {
|
|
11570
11616
|
if (inputWrapperRef.current) {
|
|
11571
11617
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
11572
11618
|
if (position === "left-start") {
|
|
@@ -11617,7 +11663,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11617
11663
|
e.preventDefault();
|
|
11618
11664
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
11619
11665
|
};
|
|
11620
|
-
const getCalendarDates = (0,
|
|
11666
|
+
const getCalendarDates = (0, import_react36.useCallback)((currentDate) => {
|
|
11621
11667
|
const year = currentDate.getFullYear();
|
|
11622
11668
|
const month = currentDate.getMonth();
|
|
11623
11669
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -11632,7 +11678,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11632
11678
|
for (let i = 0; i < dates.length; i += 7) weeks.push(dates.slice(i, i + 7));
|
|
11633
11679
|
return weeks;
|
|
11634
11680
|
}, []);
|
|
11635
|
-
const isDateDisabled = (0,
|
|
11681
|
+
const isDateDisabled = (0, import_react36.useCallback)(
|
|
11636
11682
|
(date) => {
|
|
11637
11683
|
if (enabledDates) return !enabledDates(date);
|
|
11638
11684
|
if (disabledDates) return disabledDates(date);
|
|
@@ -11709,7 +11755,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11709
11755
|
}
|
|
11710
11756
|
setIsPanelOpen(false);
|
|
11711
11757
|
};
|
|
11712
|
-
const getDayProps = (0,
|
|
11758
|
+
const getDayProps = (0, import_react36.useCallback)(
|
|
11713
11759
|
(dateObj, currentDate) => {
|
|
11714
11760
|
const date = new Date(currentDate.getFullYear(), currentDate.getMonth(), dateObj.date);
|
|
11715
11761
|
if (isDateDisabled(date)) return "disabled";
|
|
@@ -11734,7 +11780,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11734
11780
|
[tempSelectedDate, tempSelectedRange, range, isDateDisabled]
|
|
11735
11781
|
);
|
|
11736
11782
|
const getPlaceholderText = () => placeholder;
|
|
11737
|
-
(0,
|
|
11783
|
+
(0, import_react36.useEffect)(() => {
|
|
11738
11784
|
if (range && typeof value === "object") {
|
|
11739
11785
|
setSelectedRange(value || { startDate: "", endDate: "" });
|
|
11740
11786
|
setTempSelectedRange(value || { startDate: "", endDate: "" });
|
|
@@ -11745,16 +11791,16 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11745
11791
|
if (value) setLeftCurrentDate(new Date(value));
|
|
11746
11792
|
}
|
|
11747
11793
|
}, [value, range]);
|
|
11748
|
-
(0,
|
|
11794
|
+
(0, import_react36.useEffect)(() => {
|
|
11749
11795
|
if (dualCalendar) {
|
|
11750
11796
|
setRightCurrentDate(new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1));
|
|
11751
11797
|
}
|
|
11752
11798
|
}, [leftCurrentDate, dualCalendar]);
|
|
11753
|
-
const slots = (0,
|
|
11754
|
-
const endContent = /* @__PURE__ */ (0,
|
|
11755
|
-
const renderCalendar = (currentDate, isLeft) => /* @__PURE__ */ (0,
|
|
11756
|
-
/* @__PURE__ */ (0,
|
|
11757
|
-
/* @__PURE__ */ (0,
|
|
11799
|
+
const slots = (0, import_react36.useMemo)(() => datePickerStyle({ ...variantProps, dualCalendar }), [variantProps, dualCalendar]);
|
|
11800
|
+
const endContent = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon_default, { name: "calendar", size, className: "cursor-pointer", fill: true, onClick: handleCalendarIconClick });
|
|
11801
|
+
const renderCalendar = (currentDate, isLeft) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col gap-[5px]", children: [
|
|
11802
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: slots.calendarHead({ class: classNames == null ? void 0 : classNames.calendarHead }), children: dualCalendar ? isLeft ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
11803
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11758
11804
|
icon_button_default,
|
|
11759
11805
|
{
|
|
11760
11806
|
name: "left",
|
|
@@ -11767,12 +11813,12 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11767
11813
|
}
|
|
11768
11814
|
}
|
|
11769
11815
|
),
|
|
11770
|
-
/* @__PURE__ */ (0,
|
|
11771
|
-
/* @__PURE__ */ (0,
|
|
11772
|
-
] }) : /* @__PURE__ */ (0,
|
|
11773
|
-
/* @__PURE__ */ (0,
|
|
11774
|
-
/* @__PURE__ */ (0,
|
|
11775
|
-
/* @__PURE__ */ (0,
|
|
11816
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11817
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-8" })
|
|
11818
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
11819
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-8" }),
|
|
11820
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11821
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11776
11822
|
icon_button_default,
|
|
11777
11823
|
{
|
|
11778
11824
|
name: "right",
|
|
@@ -11785,8 +11831,8 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11785
11831
|
}
|
|
11786
11832
|
}
|
|
11787
11833
|
)
|
|
11788
|
-
] }) : /* @__PURE__ */ (0,
|
|
11789
|
-
/* @__PURE__ */ (0,
|
|
11834
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
11835
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11790
11836
|
icon_button_default,
|
|
11791
11837
|
{
|
|
11792
11838
|
name: "left",
|
|
@@ -11798,8 +11844,8 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11798
11844
|
}
|
|
11799
11845
|
}
|
|
11800
11846
|
),
|
|
11801
|
-
/* @__PURE__ */ (0,
|
|
11802
|
-
/* @__PURE__ */ (0,
|
|
11847
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl font-extrabold", children: monthYearFormat(currentDate.getFullYear(), currentDate.getMonth()) }),
|
|
11848
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11803
11849
|
icon_button_default,
|
|
11804
11850
|
{
|
|
11805
11851
|
name: "right",
|
|
@@ -11812,10 +11858,10 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11812
11858
|
}
|
|
11813
11859
|
)
|
|
11814
11860
|
] }) }),
|
|
11815
|
-
/* @__PURE__ */ (0,
|
|
11816
|
-
/* @__PURE__ */ (0,
|
|
11861
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "grid grid-cols-7", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(day_default, { variant: "text", children: day }, `${day}-${index}`)) }),
|
|
11862
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "grid grid-cols-7 gap-y-[5px] text-center", children: getCalendarDates(currentDate).map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react36.Fragment, { children: week.map((dateObj, index) => {
|
|
11817
11863
|
const dayVariant = getDayProps(dateObj, currentDate);
|
|
11818
|
-
return /* @__PURE__ */ (0,
|
|
11864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11819
11865
|
day_default,
|
|
11820
11866
|
{
|
|
11821
11867
|
variant: dayVariant,
|
|
@@ -11826,8 +11872,8 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11826
11872
|
);
|
|
11827
11873
|
}) }, weekIndex)) })
|
|
11828
11874
|
] });
|
|
11829
|
-
return /* @__PURE__ */ (0,
|
|
11830
|
-
/* @__PURE__ */ (0,
|
|
11875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
11876
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: inputWrapperRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onClick: handleFocusInput, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11831
11877
|
input_default,
|
|
11832
11878
|
{
|
|
11833
11879
|
...inputProps,
|
|
@@ -11860,7 +11906,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11860
11906
|
}
|
|
11861
11907
|
) }),
|
|
11862
11908
|
isPanelOpen && (0, import_react_dom5.createPortal)(
|
|
11863
|
-
/* @__PURE__ */ (0,
|
|
11909
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
11864
11910
|
"div",
|
|
11865
11911
|
{
|
|
11866
11912
|
ref: calendarWrapperRef,
|
|
@@ -11874,13 +11920,13 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11874
11920
|
},
|
|
11875
11921
|
onMouseDown: handleCalendarMouseDown,
|
|
11876
11922
|
children: [
|
|
11877
|
-
/* @__PURE__ */ (0,
|
|
11923
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: dualCalendar ? "flex gap-[10px]" : "flex", children: [
|
|
11878
11924
|
renderCalendar(leftCurrentDate, true),
|
|
11879
|
-
dualCalendar && range && /* @__PURE__ */ (0,
|
|
11925
|
+
dualCalendar && range && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-neutral-soft w-px self-stretch" }),
|
|
11880
11926
|
dualCalendar && renderCalendar(rightCurrentDate, false)
|
|
11881
11927
|
] }),
|
|
11882
|
-
/* @__PURE__ */ (0,
|
|
11883
|
-
/* @__PURE__ */ (0,
|
|
11928
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex h-[30px] justify-between px-[10px]", children: [
|
|
11929
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11884
11930
|
text_button_default,
|
|
11885
11931
|
{
|
|
11886
11932
|
variant: "underline",
|
|
@@ -11891,10 +11937,10 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11891
11937
|
children: resetTitle
|
|
11892
11938
|
}
|
|
11893
11939
|
),
|
|
11894
|
-
/* @__PURE__ */ (0,
|
|
11940
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(text_button_default, { variant: "underline", size: "sm", classNames: { base: "font-bold" }, onClick: handleSetToday, children: todayTitle })
|
|
11895
11941
|
] }),
|
|
11896
|
-
/* @__PURE__ */ (0,
|
|
11897
|
-
/* @__PURE__ */ (0,
|
|
11942
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
11943
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11898
11944
|
button_default,
|
|
11899
11945
|
{
|
|
11900
11946
|
variant: "soft",
|
|
@@ -11905,7 +11951,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11905
11951
|
children: cancelTitle
|
|
11906
11952
|
}
|
|
11907
11953
|
),
|
|
11908
|
-
/* @__PURE__ */ (0,
|
|
11954
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11909
11955
|
button_default,
|
|
11910
11956
|
{
|
|
11911
11957
|
size: "sm",
|
|
@@ -11967,26 +12013,26 @@ var datePickerStyle = tv({
|
|
|
11967
12013
|
});
|
|
11968
12014
|
|
|
11969
12015
|
// src/components/picker/timePicker/index.tsx
|
|
11970
|
-
var
|
|
12016
|
+
var import_react39 = require("react");
|
|
11971
12017
|
var import_react_dom6 = require("react-dom");
|
|
11972
12018
|
|
|
11973
12019
|
// src/components/picker/timePicker/Panel.tsx
|
|
11974
|
-
var
|
|
12020
|
+
var import_react38 = require("react");
|
|
11975
12021
|
|
|
11976
12022
|
// src/components/picker/timePicker/WheelColumn.tsx
|
|
11977
|
-
var
|
|
11978
|
-
var
|
|
12023
|
+
var import_react37 = require("react");
|
|
12024
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11979
12025
|
var ITEM_HEIGHT = 30;
|
|
11980
12026
|
var ACTIVE_HEIGHT = 34;
|
|
11981
12027
|
function WheelColumn({ list, value, onChange }) {
|
|
11982
|
-
const ref = (0,
|
|
12028
|
+
const ref = (0, import_react37.useRef)(null);
|
|
11983
12029
|
const idx = list.indexOf(value);
|
|
11984
12030
|
const finalizeScroll = (index) => {
|
|
11985
12031
|
const v = list[index];
|
|
11986
12032
|
if (v) onChange(v);
|
|
11987
12033
|
};
|
|
11988
12034
|
const handleClick = (index) => finalizeScroll(index);
|
|
11989
|
-
(0,
|
|
12035
|
+
(0, import_react37.useEffect)(() => {
|
|
11990
12036
|
const el = ref.current;
|
|
11991
12037
|
if (!el || idx < 0) return;
|
|
11992
12038
|
const handleWheel = (e) => {
|
|
@@ -12002,18 +12048,18 @@ function WheelColumn({ list, value, onChange }) {
|
|
|
12002
12048
|
el.addEventListener("wheel", handleWheel, { passive: false });
|
|
12003
12049
|
return () => el.removeEventListener("wheel", handleWheel);
|
|
12004
12050
|
}, [idx, list, onChange]);
|
|
12005
|
-
(0,
|
|
12051
|
+
(0, import_react37.useEffect)(() => {
|
|
12006
12052
|
const el = ref.current;
|
|
12007
12053
|
if (!el || idx < 0) return;
|
|
12008
12054
|
el.scrollTo({ top: idx * ITEM_HEIGHT });
|
|
12009
12055
|
}, [idx]);
|
|
12010
|
-
return /* @__PURE__ */ (0,
|
|
12011
|
-
/* @__PURE__ */ (0,
|
|
12012
|
-
/* @__PURE__ */ (0,
|
|
12013
|
-
/* @__PURE__ */ (0,
|
|
12056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative h-[94px] w-[40px]", children: [
|
|
12057
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "pointer-events-none absolute left-1/2 top-[30px] h-[34px] w-[40px] -translate-x-1/2 rounded-[10px] shadow-[inset_0_0_0_1.5px_var(--dn-primary-light)]" }),
|
|
12058
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref, className: "scrollbar-none relative h-full select-none overflow-y-scroll py-[0]", children: [
|
|
12059
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { height: ITEM_HEIGHT } }),
|
|
12014
12060
|
list.map((v, i) => {
|
|
12015
12061
|
const highlight = i === idx;
|
|
12016
|
-
return /* @__PURE__ */ (0,
|
|
12062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12017
12063
|
"div",
|
|
12018
12064
|
{
|
|
12019
12065
|
onClick: () => handleClick(i),
|
|
@@ -12024,19 +12070,19 @@ function WheelColumn({ list, value, onChange }) {
|
|
|
12024
12070
|
i
|
|
12025
12071
|
);
|
|
12026
12072
|
}),
|
|
12027
|
-
/* @__PURE__ */ (0,
|
|
12073
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { height: ITEM_HEIGHT + 4 } })
|
|
12028
12074
|
] })
|
|
12029
12075
|
] });
|
|
12030
12076
|
}
|
|
12031
12077
|
|
|
12032
12078
|
// src/components/picker/timePicker/Panel.tsx
|
|
12033
|
-
var
|
|
12079
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
12034
12080
|
var hours = [...Array(12)].map((_, i) => String(i + 1).padStart(2, "0"));
|
|
12035
12081
|
var minutes = [...Array(60)].map((_, i) => String(i).padStart(2, "0"));
|
|
12036
12082
|
var meridiemList = ["AM", "PM"];
|
|
12037
|
-
var TimePickerPanel = (0,
|
|
12083
|
+
var TimePickerPanel = (0, import_react38.forwardRef)(
|
|
12038
12084
|
({ value, onChange, nowTitle, confirmTitle }, ref) => {
|
|
12039
|
-
const [time, setTime] = (0,
|
|
12085
|
+
const [time, setTime] = (0, import_react38.useState)({ hour: "", minute: "", meridiem: "" });
|
|
12040
12086
|
const handleNow = () => {
|
|
12041
12087
|
setTime(getCurrent12Hour());
|
|
12042
12088
|
};
|
|
@@ -12053,20 +12099,20 @@ var TimePickerPanel = (0, import_react36.forwardRef)(
|
|
|
12053
12099
|
const SS = "00";
|
|
12054
12100
|
onChange(`${HH}:${MM}:${SS}`);
|
|
12055
12101
|
};
|
|
12056
|
-
(0,
|
|
12102
|
+
(0, import_react38.useEffect)(() => {
|
|
12057
12103
|
setTime(value ? convert24To12(value) : getCurrent12Hour());
|
|
12058
12104
|
}, [value]);
|
|
12059
|
-
return /* @__PURE__ */ (0,
|
|
12060
|
-
/* @__PURE__ */ (0,
|
|
12061
|
-
/* @__PURE__ */ (0,
|
|
12062
|
-
/* @__PURE__ */ (0,
|
|
12063
|
-
/* @__PURE__ */ (0,
|
|
12064
|
-
/* @__PURE__ */ (0,
|
|
12105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
12106
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: "flex gap-[10px]", children: [
|
|
12107
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-center gap-[5px]", children: [
|
|
12108
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WheelColumn, { list: hours, value: time.hour, onChange: (v) => setTime({ ...time, hour: v }) }),
|
|
12109
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "w-[5px] text-sm font-bold", children: ":" }),
|
|
12110
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WheelColumn, { list: minutes, value: time.minute, onChange: (v) => setTime({ ...time, minute: v }) })
|
|
12065
12111
|
] }),
|
|
12066
|
-
/* @__PURE__ */ (0,
|
|
12112
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WheelColumn, { list: meridiemList, value: time.meridiem, onChange: (v) => setTime({ ...time, meridiem: v }) })
|
|
12067
12113
|
] }),
|
|
12068
|
-
/* @__PURE__ */ (0,
|
|
12069
|
-
/* @__PURE__ */ (0,
|
|
12114
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex justify-between px-1 text-sm", children: [
|
|
12115
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12070
12116
|
text_button_default,
|
|
12071
12117
|
{
|
|
12072
12118
|
variant: "underline",
|
|
@@ -12077,7 +12123,7 @@ var TimePickerPanel = (0, import_react36.forwardRef)(
|
|
|
12077
12123
|
children: nowTitle
|
|
12078
12124
|
}
|
|
12079
12125
|
),
|
|
12080
|
-
/* @__PURE__ */ (0,
|
|
12126
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12081
12127
|
text_button_default,
|
|
12082
12128
|
{
|
|
12083
12129
|
variant: "underline",
|
|
@@ -12094,8 +12140,8 @@ var TimePickerPanel = (0, import_react36.forwardRef)(
|
|
|
12094
12140
|
var Panel_default = TimePickerPanel;
|
|
12095
12141
|
|
|
12096
12142
|
// src/components/picker/timePicker/index.tsx
|
|
12097
|
-
var
|
|
12098
|
-
var TimePicker = (0,
|
|
12143
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
12144
|
+
var TimePicker = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
12099
12145
|
const [props, variantProps] = mapPropsVariants(originalProps, timePickerStyle.variantKeys);
|
|
12100
12146
|
const {
|
|
12101
12147
|
classNames,
|
|
@@ -12112,20 +12158,20 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12112
12158
|
confirmTitle,
|
|
12113
12159
|
...inputProps
|
|
12114
12160
|
} = { ...props, ...variantProps };
|
|
12115
|
-
const slots = (0,
|
|
12116
|
-
const [isPanelOpen, setIsPanelOpen] = (0,
|
|
12117
|
-
const inputWrapperRef = (0,
|
|
12118
|
-
const panelWrapperRef = (0,
|
|
12119
|
-
const [panelPos, setPanelPos] = (0,
|
|
12161
|
+
const slots = (0, import_react39.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
12162
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react39.useState)(false);
|
|
12163
|
+
const inputWrapperRef = (0, import_react39.useRef)(null);
|
|
12164
|
+
const panelWrapperRef = (0, import_react39.useRef)(null);
|
|
12165
|
+
const [panelPos, setPanelPos] = (0, import_react39.useState)({
|
|
12120
12166
|
top: -9999,
|
|
12121
12167
|
left: -9999
|
|
12122
12168
|
});
|
|
12123
|
-
const displayValue = (0,
|
|
12169
|
+
const displayValue = (0, import_react39.useMemo)(() => {
|
|
12124
12170
|
if (!value) return "";
|
|
12125
12171
|
const { hour, minute, meridiem } = convert24To12(value);
|
|
12126
12172
|
return `${hour}:${minute} ${meridiem}`;
|
|
12127
12173
|
}, [value]);
|
|
12128
|
-
const calculatePosition = (0,
|
|
12174
|
+
const calculatePosition = (0, import_react39.useCallback)(() => {
|
|
12129
12175
|
if (inputWrapperRef.current) {
|
|
12130
12176
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
12131
12177
|
setPanelPos({
|
|
@@ -12152,7 +12198,7 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12152
12198
|
onChange == null ? void 0 : onChange(time);
|
|
12153
12199
|
setIsPanelOpen(false);
|
|
12154
12200
|
};
|
|
12155
|
-
(0,
|
|
12201
|
+
(0, import_react39.useEffect)(() => {
|
|
12156
12202
|
const handleClickOutside = (e) => {
|
|
12157
12203
|
var _a, _b;
|
|
12158
12204
|
const target = e.target;
|
|
@@ -12163,8 +12209,8 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12163
12209
|
document.addEventListener("mousedown", handleClickOutside);
|
|
12164
12210
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
12165
12211
|
}, []);
|
|
12166
|
-
return /* @__PURE__ */ (0,
|
|
12167
|
-
/* @__PURE__ */ (0,
|
|
12212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
12213
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref: inputWrapperRef, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onClick: openPanel, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
12168
12214
|
input_default,
|
|
12169
12215
|
{
|
|
12170
12216
|
...inputProps,
|
|
@@ -12178,7 +12224,7 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12178
12224
|
variant,
|
|
12179
12225
|
full,
|
|
12180
12226
|
disabled,
|
|
12181
|
-
endContent: /* @__PURE__ */ (0,
|
|
12227
|
+
endContent: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon_default, { name: "clock", size, className: "cursor-pointer" }),
|
|
12182
12228
|
onFocus: handleInputFocus,
|
|
12183
12229
|
onKeyDown: handleInputKeyDown,
|
|
12184
12230
|
onChange: () => {
|
|
@@ -12192,7 +12238,7 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12192
12238
|
}
|
|
12193
12239
|
) }),
|
|
12194
12240
|
isPanelOpen && (0, import_react_dom6.createPortal)(
|
|
12195
|
-
/* @__PURE__ */ (0,
|
|
12241
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
12196
12242
|
"div",
|
|
12197
12243
|
{
|
|
12198
12244
|
ref: panelWrapperRef,
|
|
@@ -12204,7 +12250,7 @@ var TimePicker = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
12204
12250
|
left: panelPos.left,
|
|
12205
12251
|
zIndex: 1e3
|
|
12206
12252
|
},
|
|
12207
|
-
children: /* @__PURE__ */ (0,
|
|
12253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Panel_default, { nowTitle, confirmTitle, value, onChange: handleChange })
|
|
12208
12254
|
}
|
|
12209
12255
|
),
|
|
12210
12256
|
document.body
|
|
@@ -12354,30 +12400,30 @@ var timePickerStyle = tv({
|
|
|
12354
12400
|
});
|
|
12355
12401
|
|
|
12356
12402
|
// src/components/tree/tree.tsx
|
|
12357
|
-
var
|
|
12358
|
-
var
|
|
12359
|
-
var TreeNodeItemBase = (0,
|
|
12403
|
+
var import_react40 = require("react");
|
|
12404
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
12405
|
+
var TreeNodeItemBase = (0, import_react40.forwardRef)(
|
|
12360
12406
|
({ node, depth, fileIcon, selectedName, classNames, onExpand }, ref) => {
|
|
12361
|
-
const slots = (0,
|
|
12362
|
-
const hasSelectedInChildren = (0,
|
|
12407
|
+
const slots = (0, import_react40.useMemo)(() => treeStyle(), []);
|
|
12408
|
+
const hasSelectedInChildren = (0, import_react40.useCallback)(
|
|
12363
12409
|
(children2) => {
|
|
12364
12410
|
if (!children2 || !selectedName) return false;
|
|
12365
12411
|
return children2.some((child) => child.selectedName === selectedName || hasSelectedInChildren(child.children));
|
|
12366
12412
|
},
|
|
12367
12413
|
[selectedName]
|
|
12368
12414
|
);
|
|
12369
|
-
const [children, setChildren] = (0,
|
|
12370
|
-
const [isOpen, setIsOpen] = (0,
|
|
12415
|
+
const [children, setChildren] = (0, import_react40.useState)(node.children);
|
|
12416
|
+
const [isOpen, setIsOpen] = (0, import_react40.useState)(() => {
|
|
12371
12417
|
if (!selectedName) return false;
|
|
12372
12418
|
return hasSelectedInChildren(node.children);
|
|
12373
12419
|
});
|
|
12374
|
-
const hasOpenedInitially = (0,
|
|
12375
|
-
const hasMore = (0,
|
|
12420
|
+
const hasOpenedInitially = (0, import_react40.useRef)(false);
|
|
12421
|
+
const hasMore = (0, import_react40.useMemo)(() => {
|
|
12376
12422
|
if (node.isLeaf) return false;
|
|
12377
12423
|
if (Array.isArray(children)) return children.length > 0;
|
|
12378
12424
|
return typeof onExpand === "function";
|
|
12379
12425
|
}, [node.isLeaf, children, onExpand]);
|
|
12380
|
-
const toggleOpen = (0,
|
|
12426
|
+
const toggleOpen = (0, import_react40.useCallback)(async () => {
|
|
12381
12427
|
if (!isOpen && !children && onExpand && !node.isLeaf) {
|
|
12382
12428
|
try {
|
|
12383
12429
|
const result = await onExpand(node);
|
|
@@ -12398,7 +12444,7 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12398
12444
|
e.preventDefault();
|
|
12399
12445
|
(_a = node.onRightClick) == null ? void 0 : _a.call(node, e);
|
|
12400
12446
|
};
|
|
12401
|
-
(0,
|
|
12447
|
+
(0, import_react40.useEffect)(() => {
|
|
12402
12448
|
if (!selectedName) return;
|
|
12403
12449
|
if (!hasOpenedInitially.current) {
|
|
12404
12450
|
const shouldOpen = hasSelectedInChildren(children);
|
|
@@ -12406,7 +12452,7 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12406
12452
|
hasOpenedInitially.current = true;
|
|
12407
12453
|
}
|
|
12408
12454
|
}, [selectedName, children, hasSelectedInChildren]);
|
|
12409
|
-
return /* @__PURE__ */ (0,
|
|
12455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
12410
12456
|
"div",
|
|
12411
12457
|
{
|
|
12412
12458
|
ref,
|
|
@@ -12415,7 +12461,7 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12415
12461
|
slots.gap({ class: classNames == null ? void 0 : classNames.gap })
|
|
12416
12462
|
),
|
|
12417
12463
|
children: [
|
|
12418
|
-
/* @__PURE__ */ (0,
|
|
12464
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
12419
12465
|
"div",
|
|
12420
12466
|
{
|
|
12421
12467
|
className: clsx(
|
|
@@ -12426,7 +12472,7 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12426
12472
|
onClick: handleClick,
|
|
12427
12473
|
onContextMenu: handleRightClick,
|
|
12428
12474
|
children: [
|
|
12429
|
-
hasMore && /* @__PURE__ */ (0,
|
|
12475
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12430
12476
|
Icon_default,
|
|
12431
12477
|
{
|
|
12432
12478
|
name: "right-chevron",
|
|
@@ -12441,7 +12487,7 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12441
12487
|
]
|
|
12442
12488
|
}
|
|
12443
12489
|
),
|
|
12444
|
-
isOpen && hasMore && /* @__PURE__ */ (0,
|
|
12490
|
+
isOpen && hasMore && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: slots.gap({ class: classNames == null ? void 0 : classNames.gap }), children: children == null ? void 0 : children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12445
12491
|
TreeNodeItem,
|
|
12446
12492
|
{
|
|
12447
12493
|
node: child,
|
|
@@ -12459,9 +12505,9 @@ var TreeNodeItemBase = (0, import_react38.forwardRef)(
|
|
|
12459
12505
|
}
|
|
12460
12506
|
);
|
|
12461
12507
|
TreeNodeItemBase.displayName = "TreeNodeItem";
|
|
12462
|
-
var TreeNodeItem = (0,
|
|
12508
|
+
var TreeNodeItem = (0, import_react40.memo)(TreeNodeItemBase);
|
|
12463
12509
|
var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedName, classNames, onExpand }) => {
|
|
12464
|
-
const slots = (0,
|
|
12510
|
+
const slots = (0, import_react40.useMemo)(() => treeStyle(), []);
|
|
12465
12511
|
const handleClick = (e) => {
|
|
12466
12512
|
var _a;
|
|
12467
12513
|
(_a = group.onClick) == null ? void 0 : _a.call(group, e);
|
|
@@ -12471,10 +12517,10 @@ var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedName, className
|
|
|
12471
12517
|
e.preventDefault();
|
|
12472
12518
|
(_a = group.onRightClick) == null ? void 0 : _a.call(group, e);
|
|
12473
12519
|
};
|
|
12474
|
-
return /* @__PURE__ */ (0,
|
|
12475
|
-
headerContent && /* @__PURE__ */ (0,
|
|
12476
|
-
/* @__PURE__ */ (0,
|
|
12477
|
-
group.content && /* @__PURE__ */ (0,
|
|
12520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12521
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: headerContent }),
|
|
12522
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
12523
|
+
group.content && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
12478
12524
|
"div",
|
|
12479
12525
|
{
|
|
12480
12526
|
className: clsx(
|
|
@@ -12490,7 +12536,7 @@ var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedName, className
|
|
|
12490
12536
|
]
|
|
12491
12537
|
}
|
|
12492
12538
|
),
|
|
12493
|
-
group.data.length > 0 && /* @__PURE__ */ (0,
|
|
12539
|
+
group.data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: slots.itemWrapper({ class: classNames == null ? void 0 : classNames.itemWrapper }), children: group.data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12494
12540
|
TreeNodeItem,
|
|
12495
12541
|
{
|
|
12496
12542
|
node,
|
|
@@ -12529,19 +12575,19 @@ var treeStyle = tv({
|
|
|
12529
12575
|
});
|
|
12530
12576
|
|
|
12531
12577
|
// src/components/fileUpload/fileUpload.tsx
|
|
12532
|
-
var
|
|
12578
|
+
var import_react43 = require("react");
|
|
12533
12579
|
var import_tailwind_variants34 = require("tailwind-variants");
|
|
12534
12580
|
|
|
12535
12581
|
// src/components/progress/progress.tsx
|
|
12536
|
-
var
|
|
12582
|
+
var import_react42 = require("react");
|
|
12537
12583
|
|
|
12538
12584
|
// src/hooks/useIsMounted.ts
|
|
12539
|
-
var
|
|
12585
|
+
var import_react41 = require("react");
|
|
12540
12586
|
function useIsMounted(props = {}) {
|
|
12541
12587
|
const { rerender = false, delay = 0 } = props;
|
|
12542
|
-
const isMountedRef = (0,
|
|
12543
|
-
const [isMounted, setIsMounted] = (0,
|
|
12544
|
-
(0,
|
|
12588
|
+
const isMountedRef = (0, import_react41.useRef)(false);
|
|
12589
|
+
const [isMounted, setIsMounted] = (0, import_react41.useState)(false);
|
|
12590
|
+
(0, import_react41.useEffect)(() => {
|
|
12545
12591
|
isMountedRef.current = true;
|
|
12546
12592
|
let timer = null;
|
|
12547
12593
|
if (rerender) {
|
|
@@ -12563,11 +12609,11 @@ function useIsMounted(props = {}) {
|
|
|
12563
12609
|
}
|
|
12564
12610
|
};
|
|
12565
12611
|
}, [rerender]);
|
|
12566
|
-
return [(0,
|
|
12612
|
+
return [(0, import_react41.useCallback)(() => isMountedRef.current, []), isMounted];
|
|
12567
12613
|
}
|
|
12568
12614
|
|
|
12569
12615
|
// src/components/progress/progress.tsx
|
|
12570
|
-
var
|
|
12616
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12571
12617
|
var Progress = (originalProps) => {
|
|
12572
12618
|
const [props, variantProps] = mapPropsVariants(originalProps, progressStyle.variantKeys);
|
|
12573
12619
|
const { children, classNames, value = 0, minValue = 0, maxValue = 100, ...progressProps } = props;
|
|
@@ -12577,12 +12623,12 @@ var Progress = (originalProps) => {
|
|
|
12577
12623
|
delay: 100
|
|
12578
12624
|
});
|
|
12579
12625
|
const selfMounted = variantProps.disableAnimation ? true : isMounted;
|
|
12580
|
-
const percentage = (0,
|
|
12626
|
+
const percentage = (0, import_react42.useMemo)(
|
|
12581
12627
|
() => isIndeterminate || !selfMounted ? void 0 : clampPercentage((value - minValue) / (maxValue - minValue) * 100),
|
|
12582
12628
|
[selfMounted, isIndeterminate, value, minValue, maxValue]
|
|
12583
12629
|
);
|
|
12584
|
-
const slots = (0,
|
|
12585
|
-
return /* @__PURE__ */ (0,
|
|
12630
|
+
const slots = (0, import_react42.useMemo)(() => progressStyle({ ...variantProps }), [variantProps]);
|
|
12631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: slots.track({ class: classNames == null ? void 0 : classNames.track }), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
12586
12632
|
"div",
|
|
12587
12633
|
{
|
|
12588
12634
|
className: slots.indicator({ class: classNames == null ? void 0 : classNames.indicator }),
|
|
@@ -12681,7 +12727,7 @@ var clampPercentage = (value) => {
|
|
|
12681
12727
|
};
|
|
12682
12728
|
|
|
12683
12729
|
// src/components/fileUpload/fileUpload.tsx
|
|
12684
|
-
var
|
|
12730
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12685
12731
|
function FileUpload({
|
|
12686
12732
|
buttonText,
|
|
12687
12733
|
cancelText,
|
|
@@ -12700,16 +12746,16 @@ function FileUpload({
|
|
|
12700
12746
|
classNames,
|
|
12701
12747
|
defaultFile
|
|
12702
12748
|
}) {
|
|
12703
|
-
const fileInputRef = (0,
|
|
12704
|
-
const uploadIntervalRef = (0,
|
|
12705
|
-
const [currentFile, setCurrentFile] = (0,
|
|
12706
|
-
const [uploadProgress, setUploadProgress] = (0,
|
|
12707
|
-
const [message, setMessage] = (0,
|
|
12708
|
-
const [displayFileName, setDisplayFileName] = (0,
|
|
12709
|
-
const [hasUploadedFile, setHasUploadedFile] = (0,
|
|
12710
|
-
const [isUploading, setIsUploading] = (0,
|
|
12749
|
+
const fileInputRef = (0, import_react43.useRef)(null);
|
|
12750
|
+
const uploadIntervalRef = (0, import_react43.useRef)(null);
|
|
12751
|
+
const [currentFile, setCurrentFile] = (0, import_react43.useState)(null);
|
|
12752
|
+
const [uploadProgress, setUploadProgress] = (0, import_react43.useState)(0);
|
|
12753
|
+
const [message, setMessage] = (0, import_react43.useState)(errorMessage);
|
|
12754
|
+
const [displayFileName, setDisplayFileName] = (0, import_react43.useState)("");
|
|
12755
|
+
const [hasUploadedFile, setHasUploadedFile] = (0, import_react43.useState)(false);
|
|
12756
|
+
const [isUploading, setIsUploading] = (0, import_react43.useState)(false);
|
|
12711
12757
|
const slots = fileUploadStyle();
|
|
12712
|
-
(0,
|
|
12758
|
+
(0, import_react43.useEffect)(() => {
|
|
12713
12759
|
if (defaultFile == null ? void 0 : defaultFile.name) {
|
|
12714
12760
|
setDisplayFileName(defaultFile.name);
|
|
12715
12761
|
setHasUploadedFile(true);
|
|
@@ -12783,21 +12829,21 @@ function FileUpload({
|
|
|
12783
12829
|
}
|
|
12784
12830
|
if (onCancelUpload) onCancelUpload();
|
|
12785
12831
|
};
|
|
12786
|
-
(0,
|
|
12832
|
+
(0, import_react43.useEffect)(() => {
|
|
12787
12833
|
return () => {
|
|
12788
12834
|
if (uploadIntervalRef.current) {
|
|
12789
12835
|
clearInterval(uploadIntervalRef.current);
|
|
12790
12836
|
}
|
|
12791
12837
|
};
|
|
12792
12838
|
}, []);
|
|
12793
|
-
(0,
|
|
12839
|
+
(0, import_react43.useEffect)(() => {
|
|
12794
12840
|
if (errorMessage !== void 0) {
|
|
12795
12841
|
setMessage(errorMessage);
|
|
12796
12842
|
}
|
|
12797
12843
|
}, [errorMessage]);
|
|
12798
|
-
return /* @__PURE__ */ (0,
|
|
12799
|
-
/* @__PURE__ */ (0,
|
|
12800
|
-
/* @__PURE__ */ (0,
|
|
12844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12845
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
|
|
12846
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: slots.inputWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12801
12847
|
input_default,
|
|
12802
12848
|
{
|
|
12803
12849
|
name,
|
|
@@ -12809,14 +12855,14 @@ function FileUpload({
|
|
|
12809
12855
|
errorMessage: message && (message == null ? void 0 : message.length) > 0 ? message : void 0
|
|
12810
12856
|
}
|
|
12811
12857
|
) }),
|
|
12812
|
-
/* @__PURE__ */ (0,
|
|
12813
|
-
/* @__PURE__ */ (0,
|
|
12814
|
-
cancelText && (hasUploadedFile || displayFileName) && !isUploading && /* @__PURE__ */ (0,
|
|
12858
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
12859
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, isLoading: isUploading, children: buttonText }),
|
|
12860
|
+
cancelText && (hasUploadedFile || displayFileName) && !isUploading && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(button_default, { type: "button", variant: "soft", color: "danger", onClick: handleCancelUpload, children: cancelText })
|
|
12815
12861
|
] }),
|
|
12816
|
-
/* @__PURE__ */ (0,
|
|
12862
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
|
|
12817
12863
|
] }),
|
|
12818
|
-
showProgress && currentFile && hasUploadedFile && uploadProgress < 100 && /* @__PURE__ */ (0,
|
|
12819
|
-
!message && helperMessage && /* @__PURE__ */ (0,
|
|
12864
|
+
showProgress && currentFile && hasUploadedFile && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(progress_default, { value: uploadProgress }),
|
|
12865
|
+
!message && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: slots.helperMessage(), children: helperMessage })
|
|
12820
12866
|
] });
|
|
12821
12867
|
}
|
|
12822
12868
|
FileUpload.displayName = "FileUpload";
|
|
@@ -12834,7 +12880,7 @@ var fileUploadStyle = (0, import_tailwind_variants34.tv)({
|
|
|
12834
12880
|
|
|
12835
12881
|
// src/components/skeleton/skeleton.tsx
|
|
12836
12882
|
var import_tailwind_variants35 = require("tailwind-variants");
|
|
12837
|
-
var
|
|
12883
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12838
12884
|
var Skeleton = ({ color = "primary", className, speed = "normal", rounded = "md" }) => {
|
|
12839
12885
|
const speedMap = {
|
|
12840
12886
|
fast: "0.7s",
|
|
@@ -12842,14 +12888,14 @@ var Skeleton = ({ color = "primary", className, speed = "normal", rounded = "md"
|
|
|
12842
12888
|
slow: "2s"
|
|
12843
12889
|
};
|
|
12844
12890
|
const slots = skeletonStyle();
|
|
12845
|
-
return /* @__PURE__ */ (0,
|
|
12891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12846
12892
|
"div",
|
|
12847
12893
|
{
|
|
12848
12894
|
className: clsx(slots.base({ color, rounded }), className),
|
|
12849
12895
|
style: {
|
|
12850
12896
|
"--shimmer-duration": speedMap[speed]
|
|
12851
12897
|
},
|
|
12852
|
-
children: /* @__PURE__ */ (0,
|
|
12898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("style", { children: `@keyframes shimmer {
|
|
12853
12899
|
100% {
|
|
12854
12900
|
transform: translateX(100%);
|
|
12855
12901
|
}
|
|
@@ -12903,12 +12949,12 @@ var skeletonStyle = (0, import_tailwind_variants35.tv)({
|
|
|
12903
12949
|
|
|
12904
12950
|
// src/components/charts/circularProgress.tsx
|
|
12905
12951
|
var import_recharts = require("recharts");
|
|
12906
|
-
var
|
|
12907
|
-
var
|
|
12908
|
-
var CircularProgress = (0,
|
|
12952
|
+
var import_react44 = require("react");
|
|
12953
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
12954
|
+
var CircularProgress = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
12909
12955
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
12910
12956
|
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
12911
|
-
const slots = (0,
|
|
12957
|
+
const slots = (0, import_react44.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
12912
12958
|
const data = [
|
|
12913
12959
|
{
|
|
12914
12960
|
name: label,
|
|
@@ -12940,12 +12986,12 @@ var CircularProgress = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
|
12940
12986
|
const colorValue = originalProps.color;
|
|
12941
12987
|
const colorKey = colorValue || "blue";
|
|
12942
12988
|
const currentGradient = gradientColors[colorKey];
|
|
12943
|
-
const wrappedInnerContent = (0,
|
|
12989
|
+
const wrappedInnerContent = (0, import_react44.useMemo)(() => {
|
|
12944
12990
|
return wrapSpanWithClass(innerContent);
|
|
12945
12991
|
}, [innerContent]);
|
|
12946
|
-
return /* @__PURE__ */ (0,
|
|
12947
|
-
/* @__PURE__ */ (0,
|
|
12948
|
-
/* @__PURE__ */ (0,
|
|
12992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12993
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
12994
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
12949
12995
|
import_recharts.RadialBarChart,
|
|
12950
12996
|
{
|
|
12951
12997
|
width: size,
|
|
@@ -12957,11 +13003,11 @@ var CircularProgress = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
|
12957
13003
|
startAngle: 90,
|
|
12958
13004
|
endAngle: -270,
|
|
12959
13005
|
children: [
|
|
12960
|
-
/* @__PURE__ */ (0,
|
|
12961
|
-
/* @__PURE__ */ (0,
|
|
12962
|
-
/* @__PURE__ */ (0,
|
|
13006
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("stop", { offset: "0%", stopColor: currentGradient.start }),
|
|
13008
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("stop", { offset: "100%", stopColor: currentGradient.end })
|
|
12963
13009
|
] }) }),
|
|
12964
|
-
/* @__PURE__ */ (0,
|
|
13010
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12965
13011
|
"circle",
|
|
12966
13012
|
{
|
|
12967
13013
|
cx: size / 2,
|
|
@@ -12972,7 +13018,7 @@ var CircularProgress = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
|
12972
13018
|
strokeWidth: "1"
|
|
12973
13019
|
}
|
|
12974
13020
|
),
|
|
12975
|
-
/* @__PURE__ */ (0,
|
|
13021
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12976
13022
|
"circle",
|
|
12977
13023
|
{
|
|
12978
13024
|
cx: size / 2,
|
|
@@ -12983,14 +13029,14 @@ var CircularProgress = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
|
12983
13029
|
strokeWidth: BAR_SIZE
|
|
12984
13030
|
}
|
|
12985
13031
|
),
|
|
12986
|
-
/* @__PURE__ */ (0,
|
|
12987
|
-
/* @__PURE__ */ (0,
|
|
13032
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts.PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
|
|
13033
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts.RadialBar, { dataKey: "value", cornerRadius: 12, animationDuration: 1e3, fill: `url(#${gradientId})` })
|
|
12988
13034
|
]
|
|
12989
13035
|
}
|
|
12990
13036
|
),
|
|
12991
|
-
innerContent && /* @__PURE__ */ (0,
|
|
13037
|
+
innerContent && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: slots.inner({ class: classNames == null ? void 0 : classNames.inner }), children: wrappedInnerContent })
|
|
12992
13038
|
] }),
|
|
12993
|
-
label && /* @__PURE__ */ (0,
|
|
13039
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
12994
13040
|
] });
|
|
12995
13041
|
});
|
|
12996
13042
|
CircularProgress.displayName = "CircularProgress";
|
|
@@ -13034,16 +13080,16 @@ function wrapSpanWithClass(node) {
|
|
|
13034
13080
|
if (Array.isArray(node)) {
|
|
13035
13081
|
return node.map(wrapSpanWithClass);
|
|
13036
13082
|
}
|
|
13037
|
-
if ((0,
|
|
13083
|
+
if ((0, import_react44.isValidElement)(node)) {
|
|
13038
13084
|
const element = node;
|
|
13039
13085
|
if (element.type === "span") {
|
|
13040
13086
|
const existing = (_a = element.props.className) != null ? _a : "";
|
|
13041
|
-
return (0,
|
|
13087
|
+
return (0, import_react44.cloneElement)(element, {
|
|
13042
13088
|
className: `text-xl font-bold ${existing}`.trim()
|
|
13043
13089
|
});
|
|
13044
13090
|
}
|
|
13045
13091
|
if (element.props.children) {
|
|
13046
|
-
return (0,
|
|
13092
|
+
return (0, import_react44.cloneElement)(element, {
|
|
13047
13093
|
children: wrapSpanWithClass(element.props.children)
|
|
13048
13094
|
});
|
|
13049
13095
|
}
|
|
@@ -13053,11 +13099,11 @@ function wrapSpanWithClass(node) {
|
|
|
13053
13099
|
}
|
|
13054
13100
|
|
|
13055
13101
|
// src/components/charts/areaChart.tsx
|
|
13056
|
-
var
|
|
13102
|
+
var import_react45 = require("react");
|
|
13057
13103
|
var import_recharts2 = require("recharts");
|
|
13058
|
-
var
|
|
13059
|
-
var AreaChartComponent = (0,
|
|
13060
|
-
const uniqueId = (0,
|
|
13104
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
13105
|
+
var AreaChartComponent = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
13106
|
+
const uniqueId = (0, import_react45.useId)();
|
|
13061
13107
|
const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
|
|
13062
13108
|
const {
|
|
13063
13109
|
data,
|
|
@@ -13069,34 +13115,34 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13069
13115
|
chartHeight = 240,
|
|
13070
13116
|
classNames
|
|
13071
13117
|
} = { ...props, ...variantProps };
|
|
13072
|
-
const slots = (0,
|
|
13118
|
+
const slots = (0, import_react45.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
|
|
13073
13119
|
const COLOR_MAP = {
|
|
13074
13120
|
primary: "#3F9CF2",
|
|
13075
13121
|
danger: "#FF4684"
|
|
13076
13122
|
};
|
|
13077
|
-
const colorHex = (0,
|
|
13078
|
-
const totalChartWidth = (0,
|
|
13123
|
+
const colorHex = (0, import_react45.useMemo)(() => COLOR_MAP[color], [color]);
|
|
13124
|
+
const totalChartWidth = (0, import_react45.useMemo)(() => {
|
|
13079
13125
|
if (!data || !itemWidth) return void 0;
|
|
13080
13126
|
const dataLength = startFromZero ? data.length + 1 : data.length;
|
|
13081
13127
|
return dataLength * itemWidth;
|
|
13082
13128
|
}, [data, itemWidth, startFromZero]);
|
|
13083
|
-
const needsScroll = (0,
|
|
13129
|
+
const needsScroll = (0, import_react45.useMemo)(() => {
|
|
13084
13130
|
return totalChartWidth;
|
|
13085
13131
|
}, [totalChartWidth]);
|
|
13086
|
-
const processedData = (0,
|
|
13132
|
+
const processedData = (0, import_react45.useMemo)(() => {
|
|
13087
13133
|
if (!data) return [];
|
|
13088
13134
|
return data;
|
|
13089
13135
|
}, [data, startFromZero]);
|
|
13090
|
-
const [tickPositions, setTickPositions] = (0,
|
|
13091
|
-
const tickRef = (0,
|
|
13136
|
+
const [tickPositions, setTickPositions] = (0, import_react45.useState)([]);
|
|
13137
|
+
const tickRef = (0, import_react45.useRef)([]);
|
|
13092
13138
|
const CustomTick = ({ x, y, payload }) => {
|
|
13093
13139
|
if (x !== void 0) {
|
|
13094
13140
|
tickRef.current.push(x);
|
|
13095
13141
|
}
|
|
13096
13142
|
if (startFromZero && payload.value === "") {
|
|
13097
|
-
return /* @__PURE__ */ (0,
|
|
13143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("g", {});
|
|
13098
13144
|
}
|
|
13099
|
-
return /* @__PURE__ */ (0,
|
|
13145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13100
13146
|
"text",
|
|
13101
13147
|
{
|
|
13102
13148
|
x,
|
|
@@ -13110,7 +13156,7 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13110
13156
|
}
|
|
13111
13157
|
);
|
|
13112
13158
|
};
|
|
13113
|
-
(0,
|
|
13159
|
+
(0, import_react45.useEffect)(() => {
|
|
13114
13160
|
const raf = requestAnimationFrame(() => {
|
|
13115
13161
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
13116
13162
|
const mids = [];
|
|
@@ -13128,19 +13174,19 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13128
13174
|
if (startFromZero && (payload == null ? void 0 : payload.name) === "") {
|
|
13129
13175
|
return null;
|
|
13130
13176
|
}
|
|
13131
|
-
return /* @__PURE__ */ (0,
|
|
13132
|
-
/* @__PURE__ */ (0,
|
|
13133
|
-
/* @__PURE__ */ (0,
|
|
13177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
13178
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
|
|
13179
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
|
|
13134
13180
|
] });
|
|
13135
13181
|
};
|
|
13136
|
-
const chartContent = /* @__PURE__ */ (0,
|
|
13182
|
+
const chartContent = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13137
13183
|
"div",
|
|
13138
13184
|
{
|
|
13139
13185
|
style: {
|
|
13140
13186
|
width: totalChartWidth || "100%",
|
|
13141
13187
|
minWidth: totalChartWidth || "100%"
|
|
13142
13188
|
},
|
|
13143
|
-
children: /* @__PURE__ */ (0,
|
|
13189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
13144
13190
|
import_recharts2.AreaChart,
|
|
13145
13191
|
{
|
|
13146
13192
|
width: totalChartWidth || 400,
|
|
@@ -13149,11 +13195,11 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13149
13195
|
margin: { left: -30 },
|
|
13150
13196
|
className: "bg-body-background [&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
13151
13197
|
children: [
|
|
13152
|
-
/* @__PURE__ */ (0,
|
|
13153
|
-
/* @__PURE__ */ (0,
|
|
13154
|
-
/* @__PURE__ */ (0,
|
|
13198
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
13199
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
|
|
13200
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
|
|
13155
13201
|
] }) }),
|
|
13156
|
-
/* @__PURE__ */ (0,
|
|
13202
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13157
13203
|
import_recharts2.CartesianGrid,
|
|
13158
13204
|
{
|
|
13159
13205
|
vertical: true,
|
|
@@ -13163,7 +13209,7 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13163
13209
|
verticalPoints: tickPositions
|
|
13164
13210
|
}
|
|
13165
13211
|
),
|
|
13166
|
-
/* @__PURE__ */ (0,
|
|
13212
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13167
13213
|
import_recharts2.XAxis,
|
|
13168
13214
|
{
|
|
13169
13215
|
dataKey: "name",
|
|
@@ -13173,7 +13219,7 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13173
13219
|
padding: { left: 35.5, right: 35.5 }
|
|
13174
13220
|
}
|
|
13175
13221
|
),
|
|
13176
|
-
/* @__PURE__ */ (0,
|
|
13222
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13177
13223
|
import_recharts2.YAxis,
|
|
13178
13224
|
{
|
|
13179
13225
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -13189,7 +13235,7 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13189
13235
|
domain: [-6, 110]
|
|
13190
13236
|
}
|
|
13191
13237
|
),
|
|
13192
|
-
/* @__PURE__ */ (0,
|
|
13238
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
13193
13239
|
import_recharts2.Area,
|
|
13194
13240
|
{
|
|
13195
13241
|
type: "monotone",
|
|
@@ -13197,7 +13243,7 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13197
13243
|
stroke: colorHex,
|
|
13198
13244
|
strokeWidth: 2,
|
|
13199
13245
|
fill: `url(#colorGradient-${uniqueId})`,
|
|
13200
|
-
dot: /* @__PURE__ */ (0,
|
|
13246
|
+
dot: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
|
|
13201
13247
|
activeDot: false
|
|
13202
13248
|
}
|
|
13203
13249
|
)
|
|
@@ -13206,10 +13252,10 @@ var AreaChartComponent = (0, import_react43.forwardRef)((originalProps, ref) =>
|
|
|
13206
13252
|
)
|
|
13207
13253
|
}
|
|
13208
13254
|
);
|
|
13209
|
-
return /* @__PURE__ */ (0,
|
|
13210
|
-
label && /* @__PURE__ */ (0,
|
|
13255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
13256
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
13211
13257
|
headerContent,
|
|
13212
|
-
needsScroll ? /* @__PURE__ */ (0,
|
|
13258
|
+
needsScroll ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(scrollArea_default, { direction: "x", size: "sm", children: chartContent }) : chartContent
|
|
13213
13259
|
] });
|
|
13214
13260
|
});
|
|
13215
13261
|
AreaChartComponent.displayName = "AreaChart";
|
|
@@ -13237,10 +13283,10 @@ var areaChartStyle = tv({
|
|
|
13237
13283
|
});
|
|
13238
13284
|
|
|
13239
13285
|
// src/components/charts/barChart.tsx
|
|
13240
|
-
var
|
|
13286
|
+
var import_react46 = require("react");
|
|
13241
13287
|
var import_recharts3 = require("recharts");
|
|
13242
|
-
var
|
|
13243
|
-
var BarChartComponent = (0,
|
|
13288
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
13289
|
+
var BarChartComponent = (0, import_react46.forwardRef)((originalProps, ref) => {
|
|
13244
13290
|
const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
|
|
13245
13291
|
const {
|
|
13246
13292
|
data = [],
|
|
@@ -13252,13 +13298,13 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13252
13298
|
barGap = 20,
|
|
13253
13299
|
tooltipFormatter
|
|
13254
13300
|
} = { ...props, ...variantProps };
|
|
13255
|
-
const slots = (0,
|
|
13256
|
-
const chartRef = (0,
|
|
13257
|
-
const tooltipRef = (0,
|
|
13258
|
-
const [tooltipLeft, setTooltipLeft] = (0,
|
|
13259
|
-
const [tickPositions, setTickPositions] = (0,
|
|
13260
|
-
const tickRef = (0,
|
|
13261
|
-
const [tooltipState, setTooltipState] = (0,
|
|
13301
|
+
const slots = (0, import_react46.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
|
|
13302
|
+
const chartRef = (0, import_react46.useRef)(null);
|
|
13303
|
+
const tooltipRef = (0, import_react46.useRef)(null);
|
|
13304
|
+
const [tooltipLeft, setTooltipLeft] = (0, import_react46.useState)(0);
|
|
13305
|
+
const [tickPositions, setTickPositions] = (0, import_react46.useState)([]);
|
|
13306
|
+
const tickRef = (0, import_react46.useRef)([]);
|
|
13307
|
+
const [tooltipState, setTooltipState] = (0, import_react46.useState)(null);
|
|
13262
13308
|
const handleMouseEnter = (e, dataKey) => {
|
|
13263
13309
|
if (!tooltipFormatter || !chartRef.current) return;
|
|
13264
13310
|
const { payload, x, y } = e;
|
|
@@ -13287,17 +13333,17 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13287
13333
|
const adjustedHeight = height + extraHeight;
|
|
13288
13334
|
const adjustedY = y;
|
|
13289
13335
|
const bottomY = adjustedY + adjustedHeight;
|
|
13290
|
-
return height ? /* @__PURE__ */ (0,
|
|
13336
|
+
return height ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13291
13337
|
"path",
|
|
13292
13338
|
{
|
|
13293
13339
|
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`,
|
|
13294
13340
|
fill
|
|
13295
13341
|
}
|
|
13296
|
-
) : /* @__PURE__ */ (0,
|
|
13342
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("rect", { x, y, width, height: 0, fill });
|
|
13297
13343
|
};
|
|
13298
13344
|
const CustomTick = ({ x, y, payload }) => {
|
|
13299
13345
|
if (x !== void 0) tickRef.current.push(x);
|
|
13300
|
-
return /* @__PURE__ */ (0,
|
|
13346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13301
13347
|
"text",
|
|
13302
13348
|
{
|
|
13303
13349
|
x,
|
|
@@ -13311,7 +13357,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13311
13357
|
}
|
|
13312
13358
|
);
|
|
13313
13359
|
};
|
|
13314
|
-
const CustomYAxisTick = ({ x, y, payload }) => /* @__PURE__ */ (0,
|
|
13360
|
+
const CustomYAxisTick = ({ x, y, payload }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13315
13361
|
"text",
|
|
13316
13362
|
{
|
|
13317
13363
|
x: x - 10,
|
|
@@ -13325,7 +13371,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13325
13371
|
children: yAxisTickFormatter(payload.value)
|
|
13326
13372
|
}
|
|
13327
13373
|
);
|
|
13328
|
-
(0,
|
|
13374
|
+
(0, import_react46.useEffect)(() => {
|
|
13329
13375
|
const raf = requestAnimationFrame(() => {
|
|
13330
13376
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
13331
13377
|
const mids = [];
|
|
@@ -13337,7 +13383,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13337
13383
|
});
|
|
13338
13384
|
return () => cancelAnimationFrame(raf);
|
|
13339
13385
|
}, [data]);
|
|
13340
|
-
(0,
|
|
13386
|
+
(0, import_react46.useLayoutEffect)(() => {
|
|
13341
13387
|
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
13342
13388
|
const chartRect = chartRef.current.getBoundingClientRect();
|
|
13343
13389
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
@@ -13352,7 +13398,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13352
13398
|
}
|
|
13353
13399
|
setTooltipLeft(left);
|
|
13354
13400
|
}, [tooltipState]);
|
|
13355
|
-
return /* @__PURE__ */ (0,
|
|
13401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13356
13402
|
"div",
|
|
13357
13403
|
{
|
|
13358
13404
|
ref: chartRef,
|
|
@@ -13365,8 +13411,8 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13365
13411
|
}
|
|
13366
13412
|
},
|
|
13367
13413
|
children: [
|
|
13368
|
-
label && /* @__PURE__ */ (0,
|
|
13369
|
-
/* @__PURE__ */ (0,
|
|
13414
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
13415
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_recharts3.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
13370
13416
|
import_recharts3.BarChart,
|
|
13371
13417
|
{
|
|
13372
13418
|
data,
|
|
@@ -13375,21 +13421,21 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13375
13421
|
barGap,
|
|
13376
13422
|
className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
13377
13423
|
children: [
|
|
13378
|
-
/* @__PURE__ */ (0,
|
|
13379
|
-
/* @__PURE__ */ (0,
|
|
13380
|
-
/* @__PURE__ */ (0,
|
|
13381
|
-
/* @__PURE__ */ (0,
|
|
13424
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("defs", { children: [
|
|
13425
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("linearGradient", { id: "blueGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
13426
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "0%", stopColor: "#DEC1FA" }),
|
|
13427
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "100%", stopColor: "#3F9CF2" })
|
|
13382
13428
|
] }),
|
|
13383
|
-
/* @__PURE__ */ (0,
|
|
13384
|
-
/* @__PURE__ */ (0,
|
|
13385
|
-
/* @__PURE__ */ (0,
|
|
13429
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("linearGradient", { id: "greenGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
13430
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "0%", stopColor: "#C2E59C" }),
|
|
13431
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "100%", stopColor: "#64B3F4" })
|
|
13386
13432
|
] }),
|
|
13387
|
-
/* @__PURE__ */ (0,
|
|
13388
|
-
/* @__PURE__ */ (0,
|
|
13389
|
-
/* @__PURE__ */ (0,
|
|
13433
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("linearGradient", { id: "pinkGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
13434
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "0%", stopColor: "#DDD6F3" }),
|
|
13435
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "100%", stopColor: "#FAACA8" })
|
|
13390
13436
|
] })
|
|
13391
13437
|
] }),
|
|
13392
|
-
/* @__PURE__ */ (0,
|
|
13438
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13393
13439
|
import_recharts3.CartesianGrid,
|
|
13394
13440
|
{
|
|
13395
13441
|
vertical: true,
|
|
@@ -13399,7 +13445,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13399
13445
|
verticalPoints: tickPositions
|
|
13400
13446
|
}
|
|
13401
13447
|
),
|
|
13402
|
-
/* @__PURE__ */ (0,
|
|
13448
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13403
13449
|
import_recharts3.XAxis,
|
|
13404
13450
|
{
|
|
13405
13451
|
dataKey: "title",
|
|
@@ -13409,7 +13455,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13409
13455
|
padding: { left: 0, right: 0 }
|
|
13410
13456
|
}
|
|
13411
13457
|
),
|
|
13412
|
-
/* @__PURE__ */ (0,
|
|
13458
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13413
13459
|
import_recharts3.YAxis,
|
|
13414
13460
|
{
|
|
13415
13461
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -13419,7 +13465,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13419
13465
|
domain: yAxisDomain
|
|
13420
13466
|
}
|
|
13421
13467
|
),
|
|
13422
|
-
/* @__PURE__ */ (0,
|
|
13468
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13423
13469
|
import_recharts3.Bar,
|
|
13424
13470
|
{
|
|
13425
13471
|
dataKey: "blue",
|
|
@@ -13429,7 +13475,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13429
13475
|
onMouseLeave: handleMouseLeave
|
|
13430
13476
|
}
|
|
13431
13477
|
),
|
|
13432
|
-
/* @__PURE__ */ (0,
|
|
13478
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13433
13479
|
import_recharts3.Bar,
|
|
13434
13480
|
{
|
|
13435
13481
|
dataKey: "green",
|
|
@@ -13439,7 +13485,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13439
13485
|
onMouseLeave: handleMouseLeave
|
|
13440
13486
|
}
|
|
13441
13487
|
),
|
|
13442
|
-
/* @__PURE__ */ (0,
|
|
13488
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13443
13489
|
import_recharts3.Bar,
|
|
13444
13490
|
{
|
|
13445
13491
|
dataKey: "pink",
|
|
@@ -13452,7 +13498,7 @@ var BarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13452
13498
|
]
|
|
13453
13499
|
}
|
|
13454
13500
|
) }),
|
|
13455
|
-
tooltipFormatter && /* @__PURE__ */ (0,
|
|
13501
|
+
tooltipFormatter && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13456
13502
|
"div",
|
|
13457
13503
|
{
|
|
13458
13504
|
ref: tooltipRef,
|
|
@@ -13486,7 +13532,7 @@ var barChartStyle = tv({
|
|
|
13486
13532
|
defaultVariants: {}
|
|
13487
13533
|
});
|
|
13488
13534
|
function BarChartTooltip({ className = "", children }) {
|
|
13489
|
-
return /* @__PURE__ */ (0,
|
|
13535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
13490
13536
|
"div",
|
|
13491
13537
|
{
|
|
13492
13538
|
className: `text-md text-common-white bg-common-black flex max-w-[160px] whitespace-nowrap rounded-[5px] px-[10px] py-[6px] text-center font-bold ${className}`,
|
|
@@ -13497,13 +13543,13 @@ function BarChartTooltip({ className = "", children }) {
|
|
|
13497
13543
|
|
|
13498
13544
|
// src/components/charts/radarChart.tsx
|
|
13499
13545
|
var import_recharts4 = require("recharts");
|
|
13500
|
-
var
|
|
13501
|
-
var
|
|
13502
|
-
var RadarChart = (0,
|
|
13546
|
+
var import_react47 = require("react");
|
|
13547
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
13548
|
+
var RadarChart = (0, import_react47.forwardRef)((originalProps, ref) => {
|
|
13503
13549
|
const [props, variantProps] = mapPropsVariants(originalProps, radarChartStyle.variantKeys);
|
|
13504
13550
|
const { data, label, classNames, tooltipFormatter } = { ...props, ...variantProps };
|
|
13505
|
-
const slots = (0,
|
|
13506
|
-
const normalizedData = (0,
|
|
13551
|
+
const slots = (0, import_react47.useMemo)(() => radarChartStyle({ ...variantProps }), [variantProps]);
|
|
13552
|
+
const normalizedData = (0, import_react47.useMemo)(() => {
|
|
13507
13553
|
if (!data || data.length === 0) return [];
|
|
13508
13554
|
return data.map((item) => ({
|
|
13509
13555
|
...item,
|
|
@@ -13512,25 +13558,25 @@ var RadarChart = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
|
13512
13558
|
originalFullMark: item.fullMark || 100
|
|
13513
13559
|
}));
|
|
13514
13560
|
}, [data]);
|
|
13515
|
-
const containerHeight = (0,
|
|
13561
|
+
const containerHeight = (0, import_react47.useMemo)(() => {
|
|
13516
13562
|
if (!data || data.length === 0) return 250;
|
|
13517
13563
|
return data.length === 3 ? 245 : 306;
|
|
13518
13564
|
}, [data]);
|
|
13519
|
-
const chartMargin = (0,
|
|
13565
|
+
const chartMargin = (0, import_react47.useMemo)(() => {
|
|
13520
13566
|
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
13521
13567
|
}, [data]);
|
|
13522
|
-
const outerRadius = (0,
|
|
13568
|
+
const outerRadius = (0, import_react47.useMemo)(() => {
|
|
13523
13569
|
if (!data || data.length === 0) return 125;
|
|
13524
13570
|
return data.length === 3 ? 135 : 125;
|
|
13525
13571
|
}, [data]);
|
|
13526
|
-
const chartCenter = (0,
|
|
13572
|
+
const chartCenter = (0, import_react47.useMemo)(() => {
|
|
13527
13573
|
if (!data || data.length === 0) return {};
|
|
13528
13574
|
if (data.length === 3) return { cx: "50%", cy: "65%" };
|
|
13529
13575
|
return {};
|
|
13530
13576
|
}, [data]);
|
|
13531
|
-
return /* @__PURE__ */ (0,
|
|
13532
|
-
label && /* @__PURE__ */ (0,
|
|
13533
|
-
/* @__PURE__ */ (0,
|
|
13577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
13578
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
13579
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_recharts4.ResponsiveContainer, { width: "100%", height: containerHeight, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
13534
13580
|
import_recharts4.RadarChart,
|
|
13535
13581
|
{
|
|
13536
13582
|
data: normalizedData,
|
|
@@ -13539,8 +13585,8 @@ var RadarChart = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
|
13539
13585
|
...chartCenter,
|
|
13540
13586
|
className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
13541
13587
|
children: [
|
|
13542
|
-
/* @__PURE__ */ (0,
|
|
13543
|
-
/* @__PURE__ */ (0,
|
|
13588
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_recharts4.PolarGrid, { stroke: "#DFE2E7", strokeWidth: 1.75 }),
|
|
13589
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13544
13590
|
import_recharts4.PolarAngleAxis,
|
|
13545
13591
|
{
|
|
13546
13592
|
dataKey: "name",
|
|
@@ -13549,8 +13595,8 @@ var RadarChart = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
|
13549
13595
|
tickSize: 15
|
|
13550
13596
|
}
|
|
13551
13597
|
),
|
|
13552
|
-
/* @__PURE__ */ (0,
|
|
13553
|
-
/* @__PURE__ */ (0,
|
|
13598
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_recharts4.PolarRadiusAxis, { domain: [0, 100], tick: false, tickCount: 6, axisLine: false }),
|
|
13599
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13554
13600
|
import_recharts4.Radar,
|
|
13555
13601
|
{
|
|
13556
13602
|
name: label,
|
|
@@ -13562,7 +13608,7 @@ var RadarChart = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
|
13562
13608
|
activeDot: false
|
|
13563
13609
|
}
|
|
13564
13610
|
),
|
|
13565
|
-
tooltipFormatter && /* @__PURE__ */ (0,
|
|
13611
|
+
tooltipFormatter && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
13566
13612
|
import_recharts4.Tooltip,
|
|
13567
13613
|
{
|
|
13568
13614
|
content: ({ active, payload, label: tooltipLabel }) => {
|
|
@@ -13570,7 +13616,7 @@ var RadarChart = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
|
13570
13616
|
const currentData = data == null ? void 0 : data.find((item) => item.name === tooltipLabel);
|
|
13571
13617
|
const shouldShowTooltip = active && payload && payload.length > 0 && tooltipLabel && currentData && ((_b = (_a = payload[0]) == null ? void 0 : _a.payload) == null ? void 0 : _b.value) !== void 0;
|
|
13572
13618
|
if (!shouldShowTooltip) return null;
|
|
13573
|
-
return /* @__PURE__ */ (0,
|
|
13619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { children: tooltipFormatter({
|
|
13574
13620
|
label: String(tooltipLabel),
|
|
13575
13621
|
data: currentData
|
|
13576
13622
|
}) });
|
|
@@ -13600,10 +13646,10 @@ var radarChartStyle = tv({
|
|
|
13600
13646
|
});
|
|
13601
13647
|
|
|
13602
13648
|
// src/components/charts/simpleBarChart.tsx
|
|
13603
|
-
var
|
|
13649
|
+
var import_react48 = require("react");
|
|
13604
13650
|
var import_recharts5 = require("recharts");
|
|
13605
|
-
var
|
|
13606
|
-
var SimpleBarChartComponent = (0,
|
|
13651
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
13652
|
+
var SimpleBarChartComponent = (0, import_react48.forwardRef)((originalProps, ref) => {
|
|
13607
13653
|
const [props, variantProps] = mapPropsVariants(originalProps, simpleBarChartStyle.variantKeys);
|
|
13608
13654
|
const {
|
|
13609
13655
|
data = [],
|
|
@@ -13614,13 +13660,13 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13614
13660
|
barGap = 20,
|
|
13615
13661
|
tooltipFormatter
|
|
13616
13662
|
} = { ...props, ...variantProps };
|
|
13617
|
-
const slots = (0,
|
|
13618
|
-
const chartRef = (0,
|
|
13619
|
-
const tooltipRef = (0,
|
|
13620
|
-
const [tooltipLeft, setTooltipLeft] = (0,
|
|
13621
|
-
const [tickPositions, setTickPositions] = (0,
|
|
13622
|
-
const [tooltipState, setTooltipState] = (0,
|
|
13623
|
-
(0,
|
|
13663
|
+
const slots = (0, import_react48.useMemo)(() => simpleBarChartStyle({ ...variantProps }), [variantProps]);
|
|
13664
|
+
const chartRef = (0, import_react48.useRef)(null);
|
|
13665
|
+
const tooltipRef = (0, import_react48.useRef)(null);
|
|
13666
|
+
const [tooltipLeft, setTooltipLeft] = (0, import_react48.useState)(0);
|
|
13667
|
+
const [tickPositions, setTickPositions] = (0, import_react48.useState)([]);
|
|
13668
|
+
const [tooltipState, setTooltipState] = (0, import_react48.useState)(null);
|
|
13669
|
+
(0, import_react48.useEffect)(() => {
|
|
13624
13670
|
if (!chartRef.current || !data.length) return;
|
|
13625
13671
|
const updateDimensions = () => {
|
|
13626
13672
|
if (!chartRef.current) return;
|
|
@@ -13671,16 +13717,16 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13671
13717
|
const adjustedHeight = height + extraHeight;
|
|
13672
13718
|
const adjustedY = y - extraHeight;
|
|
13673
13719
|
const bottomY = adjustedY + adjustedHeight;
|
|
13674
|
-
return height > 0 ? /* @__PURE__ */ (0,
|
|
13720
|
+
return height > 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13675
13721
|
"path",
|
|
13676
13722
|
{
|
|
13677
13723
|
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`,
|
|
13678
13724
|
fill
|
|
13679
13725
|
}
|
|
13680
|
-
) : /* @__PURE__ */ (0,
|
|
13726
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("rect", { x, y, width, height: 0, fill });
|
|
13681
13727
|
};
|
|
13682
13728
|
const CustomTick = ({ x, y, payload }) => {
|
|
13683
|
-
return /* @__PURE__ */ (0,
|
|
13729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13684
13730
|
"text",
|
|
13685
13731
|
{
|
|
13686
13732
|
x,
|
|
@@ -13694,7 +13740,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13694
13740
|
}
|
|
13695
13741
|
);
|
|
13696
13742
|
};
|
|
13697
|
-
(0,
|
|
13743
|
+
(0, import_react48.useLayoutEffect)(() => {
|
|
13698
13744
|
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
13699
13745
|
const chartRect = chartRef.current.getBoundingClientRect();
|
|
13700
13746
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
@@ -13709,7 +13755,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13709
13755
|
}
|
|
13710
13756
|
setTooltipLeft(left);
|
|
13711
13757
|
}, [tooltipState]);
|
|
13712
|
-
return /* @__PURE__ */ (0,
|
|
13758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
13713
13759
|
"div",
|
|
13714
13760
|
{
|
|
13715
13761
|
ref: chartRef,
|
|
@@ -13722,8 +13768,8 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13722
13768
|
}
|
|
13723
13769
|
},
|
|
13724
13770
|
children: [
|
|
13725
|
-
label && /* @__PURE__ */ (0,
|
|
13726
|
-
/* @__PURE__ */ (0,
|
|
13771
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
13772
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_recharts5.ResponsiveContainer, { width: "100%", height: 140, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
13727
13773
|
import_recharts5.BarChart,
|
|
13728
13774
|
{
|
|
13729
13775
|
data,
|
|
@@ -13732,7 +13778,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13732
13778
|
barGap,
|
|
13733
13779
|
className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
|
|
13734
13780
|
children: [
|
|
13735
|
-
/* @__PURE__ */ (0,
|
|
13781
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13736
13782
|
import_recharts5.CartesianGrid,
|
|
13737
13783
|
{
|
|
13738
13784
|
vertical: true,
|
|
@@ -13742,7 +13788,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13742
13788
|
verticalPoints: tickPositions
|
|
13743
13789
|
}
|
|
13744
13790
|
),
|
|
13745
|
-
/* @__PURE__ */ (0,
|
|
13791
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13746
13792
|
import_recharts5.CartesianGrid,
|
|
13747
13793
|
{
|
|
13748
13794
|
vertical: true,
|
|
@@ -13753,7 +13799,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13753
13799
|
verticalPoints: [0]
|
|
13754
13800
|
}
|
|
13755
13801
|
),
|
|
13756
|
-
/* @__PURE__ */ (0,
|
|
13802
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13757
13803
|
import_recharts5.XAxis,
|
|
13758
13804
|
{
|
|
13759
13805
|
dataKey: "title",
|
|
@@ -13763,8 +13809,8 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13763
13809
|
padding: { left: 0, right: 0 }
|
|
13764
13810
|
}
|
|
13765
13811
|
),
|
|
13766
|
-
/* @__PURE__ */ (0,
|
|
13767
|
-
/* @__PURE__ */ (0,
|
|
13812
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_recharts5.YAxis, { hide: true, ticks: yAxisTicks, domain: yAxisDomain }),
|
|
13813
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13768
13814
|
import_recharts5.Bar,
|
|
13769
13815
|
{
|
|
13770
13816
|
dataKey: "value",
|
|
@@ -13777,7 +13823,7 @@ var SimpleBarChartComponent = (0, import_react46.forwardRef)((originalProps, ref
|
|
|
13777
13823
|
]
|
|
13778
13824
|
}
|
|
13779
13825
|
) }),
|
|
13780
|
-
tooltipFormatter && /* @__PURE__ */ (0,
|
|
13826
|
+
tooltipFormatter && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13781
13827
|
"div",
|
|
13782
13828
|
{
|
|
13783
13829
|
ref: tooltipRef,
|
|
@@ -13812,9 +13858,9 @@ var simpleBarChartStyle = tv({
|
|
|
13812
13858
|
});
|
|
13813
13859
|
|
|
13814
13860
|
// src/components/starRating/starRating.tsx
|
|
13815
|
-
var
|
|
13816
|
-
var
|
|
13817
|
-
var StarRating = (0,
|
|
13861
|
+
var import_react49 = require("react");
|
|
13862
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
13863
|
+
var StarRating = (0, import_react49.forwardRef)((originalProps, ref) => {
|
|
13818
13864
|
const [props, variantProps] = mapPropsVariants(originalProps, starRatingStyle.variantKeys);
|
|
13819
13865
|
const {
|
|
13820
13866
|
stars,
|
|
@@ -13827,8 +13873,8 @@ var StarRating = (0, import_react47.forwardRef)((originalProps, ref) => {
|
|
|
13827
13873
|
filledColor = "text-primary-main",
|
|
13828
13874
|
emptyColor = "text-neutral-soft"
|
|
13829
13875
|
} = { ...props, ...variantProps };
|
|
13830
|
-
const slots = (0,
|
|
13831
|
-
const [hoverRating, setHoverRating] = (0,
|
|
13876
|
+
const slots = (0, import_react49.useMemo)(() => starRatingStyle({ ...variantProps }), [variantProps]);
|
|
13877
|
+
const [hoverRating, setHoverRating] = (0, import_react49.useState)(0);
|
|
13832
13878
|
const handleStarClick = (starIndex, isHalf = false) => {
|
|
13833
13879
|
if (readOnly || !onChange) return;
|
|
13834
13880
|
let newRating;
|
|
@@ -13862,9 +13908,9 @@ var StarRating = (0, import_react47.forwardRef)((originalProps, ref) => {
|
|
|
13862
13908
|
const isEmpty = currentRating < starIndex - 1;
|
|
13863
13909
|
const isPartial = !isFull && !isEmpty;
|
|
13864
13910
|
const fillPercentage = isPartial ? (currentRating - (starIndex - 1)) * 100 : 0;
|
|
13865
|
-
return /* @__PURE__ */ (0,
|
|
13866
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
13867
|
-
/* @__PURE__ */ (0,
|
|
13911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: slots.starWrapper({ class: classNames == null ? void 0 : classNames.starWrapper }), children: [
|
|
13912
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
13913
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13868
13914
|
"div",
|
|
13869
13915
|
{
|
|
13870
13916
|
className: slots.star({ class: classNames == null ? void 0 : classNames.star }),
|
|
@@ -13872,7 +13918,7 @@ var StarRating = (0, import_react47.forwardRef)((originalProps, ref) => {
|
|
|
13872
13918
|
onMouseEnter: () => handleStarHover(starIndex)
|
|
13873
13919
|
}
|
|
13874
13920
|
),
|
|
13875
|
-
allowHalf && /* @__PURE__ */ (0,
|
|
13921
|
+
allowHalf && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13876
13922
|
"div",
|
|
13877
13923
|
{
|
|
13878
13924
|
className: slots.starHalf({ class: classNames == null ? void 0 : classNames.starHalf }),
|
|
@@ -13881,25 +13927,25 @@ var StarRating = (0, import_react47.forwardRef)((originalProps, ref) => {
|
|
|
13881
13927
|
}
|
|
13882
13928
|
)
|
|
13883
13929
|
] }),
|
|
13884
|
-
/* @__PURE__ */ (0,
|
|
13885
|
-
(isFull || isPartial) && /* @__PURE__ */ (0,
|
|
13886
|
-
/* @__PURE__ */ (0,
|
|
13887
|
-
/* @__PURE__ */ (0,
|
|
13930
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "relative", children: [
|
|
13931
|
+
(isFull || isPartial) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
13932
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon_default, { name: "star", fill: true, className: emptyColor, size }),
|
|
13933
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
13888
13934
|
"div",
|
|
13889
13935
|
{
|
|
13890
13936
|
className: "absolute left-0 top-0 overflow-hidden",
|
|
13891
13937
|
style: {
|
|
13892
13938
|
width: isFull ? "100%" : `${fillPercentage}%`
|
|
13893
13939
|
},
|
|
13894
|
-
children: /* @__PURE__ */ (0,
|
|
13940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon_default, { name: "star", fill: true, className: filledColor, size })
|
|
13895
13941
|
}
|
|
13896
13942
|
)
|
|
13897
13943
|
] }),
|
|
13898
|
-
isEmpty && /* @__PURE__ */ (0,
|
|
13944
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon_default, { name: "star", fill: true, className: emptyColor, size })
|
|
13899
13945
|
] })
|
|
13900
13946
|
] }, starIndex);
|
|
13901
13947
|
};
|
|
13902
|
-
return /* @__PURE__ */ (0,
|
|
13948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), onMouseLeave: handleMouseLeave, children: createRange(stars).map(renderStar) });
|
|
13903
13949
|
});
|
|
13904
13950
|
StarRating.displayName = "StarRating";
|
|
13905
13951
|
var starRating_default = StarRating;
|
|
@@ -13942,6 +13988,7 @@ var starRatingStyle = tv({
|
|
|
13942
13988
|
DefinitionTable,
|
|
13943
13989
|
Drawer,
|
|
13944
13990
|
FileUpload,
|
|
13991
|
+
GlobalModalProvider,
|
|
13945
13992
|
Icon,
|
|
13946
13993
|
IconButton,
|
|
13947
13994
|
Input,
|
|
@@ -13970,5 +14017,6 @@ var starRatingStyle = tv({
|
|
|
13970
14017
|
deepnoidUi,
|
|
13971
14018
|
iconTemplate,
|
|
13972
14019
|
tv,
|
|
14020
|
+
useGlobalModal,
|
|
13973
14021
|
useToast
|
|
13974
14022
|
});
|