@deepnoid/ui 0.1.97 → 0.1.99
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 +189 -189
- package/dist/{chunk-BQTFCLWG.mjs → chunk-4PVQ6EHW.mjs} +4 -4
- package/dist/{chunk-35D6XC62.mjs → chunk-DRK7NMLJ.mjs} +7 -7
- package/dist/{chunk-45BNDZHL.mjs → chunk-DUO76TCX.mjs} +2 -2
- package/dist/{chunk-WV77476I.mjs → chunk-KNLCEVJX.mjs} +4 -4
- package/dist/{chunk-QDQBFAE2.mjs → chunk-NDZ7LM6I.mjs} +29 -14
- package/dist/{chunk-45N5ZAIJ.mjs → chunk-OQ3M3RMJ.mjs} +4 -4
- package/dist/{chunk-4GDJLALM.mjs → chunk-PEDGYELZ.mjs} +1 -1
- package/dist/{chunk-VFFLJN5N.mjs → chunk-Q44DM7T3.mjs} +33 -9
- package/dist/{chunk-VIEBF2WH.mjs → chunk-RHRYHA6L.mjs} +5 -5
- package/dist/{chunk-TBSG4HY5.mjs → chunk-VMB75PEM.mjs} +1 -1
- 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/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.js +1 -1
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.js +1 -1
- 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 +4 -4
- 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/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.mjs +6 -6
- package/dist/components/dateTimePicker/index.mjs +6 -6
- package/dist/components/dateTimePicker/timePicker.mjs +4 -4
- package/dist/components/drawer/drawer.mjs +2 -2
- package/dist/components/drawer/index.mjs +2 -2
- package/dist/components/fileUpload/fileUpload.d.mts +2 -13
- package/dist/components/fileUpload/fileUpload.d.ts +2 -13
- package/dist/components/fileUpload/fileUpload.js +217 -33
- package/dist/components/fileUpload/fileUpload.mjs +9 -6
- package/dist/components/fileUpload/index.js +217 -33
- package/dist/components/fileUpload/index.mjs +9 -6
- package/dist/components/input/index.js +30 -6
- package/dist/components/input/index.mjs +2 -2
- package/dist/components/input/input.d.mts +21 -0
- package/dist/components/input/input.d.ts +21 -0
- package/dist/components/input/input.js +30 -6
- 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/index.mjs +5 -5
- package/dist/components/modal/modal.mjs +5 -5
- package/dist/components/pagination/index.js +30 -6
- package/dist/components/pagination/index.mjs +3 -3
- package/dist/components/pagination/pagination.js +30 -6
- package/dist/components/pagination/pagination.mjs +3 -3
- package/dist/components/progress/index.mjs +3 -3
- package/dist/components/progress/progress.mjs +3 -3
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/table/index.js +30 -6
- package/dist/components/table/index.mjs +8 -8
- package/dist/components/table/table-body.js +30 -6
- package/dist/components/table/table-body.mjs +5 -5
- package/dist/components/table/table-head.js +30 -6
- package/dist/components/table/table-head.mjs +5 -5
- package/dist/components/table/table.js +30 -6
- package/dist/components/table/table.mjs +5 -5
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/textarea/index.mjs +2 -2
- package/dist/components/textarea/textarea.mjs +2 -2
- 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/index.js +272 -234
- package/dist/index.mjs +62 -62
- package/package.json +1 -1
- package/dist/{chunk-I3ADJOUT.mjs → chunk-2NKKPM4H.mjs} +3 -3
- package/dist/{chunk-3IILPVRA.mjs → chunk-2Q3V5U7K.mjs} +3 -3
- package/dist/{chunk-6Q2BXHJL.mjs → chunk-4EIGHKUO.mjs} +3 -3
- package/dist/{chunk-IW57F7WZ.mjs → chunk-4VIQED4M.mjs} +3 -3
- package/dist/{chunk-BHSZP2XF.mjs → chunk-7KVNCGIG.mjs} +3 -3
- package/dist/{chunk-WG2EL5JF.mjs → chunk-CBGWCZVX.mjs} +3 -3
- package/dist/{chunk-K7JLUER5.mjs → chunk-DR2LJSLB.mjs} +3 -3
- package/dist/{chunk-23WOW2NZ.mjs → chunk-EXQG2GHG.mjs} +3 -3
- package/dist/{chunk-JBSV7GCL.mjs → chunk-G5CNDGIE.mjs} +3 -3
- package/dist/{chunk-PZSIYVDW.mjs → chunk-HZMGNGQN.mjs} +3 -3
- package/dist/{chunk-WIZDHK4O.mjs → chunk-K6X36ITU.mjs} +3 -3
- package/dist/{chunk-GH4EPD35.mjs → chunk-M5CS7I7F.mjs} +3 -3
- package/dist/{chunk-4LP3QDAE.mjs → chunk-OBPDLL66.mjs} +3 -3
- package/dist/{chunk-GAZ472ZU.mjs → chunk-OSKY2V2A.mjs} +3 -3
- package/dist/{chunk-5FFTHFBX.mjs → chunk-T46JIGEU.mjs} +4 -4
- package/dist/{chunk-6KH2UQRM.mjs → chunk-TWSYSAE7.mjs} +3 -3
- package/dist/{chunk-S7Y7XUBL.mjs → chunk-UDVA3BUM.mjs} +3 -3
- package/dist/{chunk-XZ5DXOJQ.mjs → chunk-UELN23A4.mjs} +3 -3
- package/dist/{chunk-EKLA6ZR4.mjs → chunk-VAZKSQN6.mjs} +3 -3
- package/dist/{chunk-7VS6YXNB.mjs → chunk-ZFHBOZEE.mjs} +3 -3
package/dist/index.js
CHANGED
|
@@ -6494,7 +6494,7 @@ var iconButtonStyle = tv({
|
|
|
6494
6494
|
variant: "outline",
|
|
6495
6495
|
color: "neutral",
|
|
6496
6496
|
class: {
|
|
6497
|
-
base: ["bg-body-background", "!border-neutral-
|
|
6497
|
+
base: ["bg-body-background", "!border-neutral-light", "text-neutral-main", "hover:bg-neutral-soft"]
|
|
6498
6498
|
}
|
|
6499
6499
|
},
|
|
6500
6500
|
{
|
|
@@ -7055,12 +7055,10 @@ var inputStyle = tv(
|
|
|
7055
7055
|
errorMessage: ["text-danger-main"],
|
|
7056
7056
|
readonlyWrapper: [
|
|
7057
7057
|
"pointer-events-none",
|
|
7058
|
-
"
|
|
7059
|
-
"placeholder
|
|
7060
|
-
"
|
|
7061
|
-
"
|
|
7062
|
-
"[&>input]:!text-body-foreground",
|
|
7063
|
-
"[&>input]:placeholder:!text-body-foreground"
|
|
7058
|
+
"text-body-foreground",
|
|
7059
|
+
"placeholder:text-body-foreground",
|
|
7060
|
+
"[&>input]:text-body-foreground",
|
|
7061
|
+
"[&>input]:placeholder:text-body-foreground"
|
|
7064
7062
|
],
|
|
7065
7063
|
readonly: []
|
|
7066
7064
|
},
|
|
@@ -7169,6 +7167,16 @@ var inputStyle = tv(
|
|
|
7169
7167
|
helperMessage: ["!text-neutral-light"],
|
|
7170
7168
|
errorMessage: ["!text-danger-light"]
|
|
7171
7169
|
}
|
|
7170
|
+
},
|
|
7171
|
+
readonly: {
|
|
7172
|
+
true: {
|
|
7173
|
+
readonlyWrapper: ["pointer-events-none"],
|
|
7174
|
+
input: [
|
|
7175
|
+
"group-has-[p.error]/input:!text-danger-main",
|
|
7176
|
+
"group-has-[p.error]/input:placeholder:!text-danger-main"
|
|
7177
|
+
],
|
|
7178
|
+
content: ["group-has-[p.error]/input:!text-danger-main"]
|
|
7179
|
+
}
|
|
7172
7180
|
}
|
|
7173
7181
|
},
|
|
7174
7182
|
compoundVariants: [
|
|
@@ -7238,6 +7246,22 @@ var inputStyle = tv(
|
|
|
7238
7246
|
"group-has-[p.error]/input:placeholder:!text-danger-light"
|
|
7239
7247
|
]
|
|
7240
7248
|
}
|
|
7249
|
+
},
|
|
7250
|
+
{
|
|
7251
|
+
readonly: true,
|
|
7252
|
+
color: "primary",
|
|
7253
|
+
class: {
|
|
7254
|
+
input: ["!text-primary-main", "placeholder:!text-primary-main"],
|
|
7255
|
+
content: ["!text-primary-main"]
|
|
7256
|
+
}
|
|
7257
|
+
},
|
|
7258
|
+
{
|
|
7259
|
+
readonly: true,
|
|
7260
|
+
color: "secondary",
|
|
7261
|
+
class: {
|
|
7262
|
+
input: ["!text-secondary-main", "placeholder:!text-secondary-main"],
|
|
7263
|
+
content: ["!text-secondary-main"]
|
|
7264
|
+
}
|
|
7241
7265
|
}
|
|
7242
7266
|
],
|
|
7243
7267
|
defaultVariants: {
|
|
@@ -11686,13 +11710,164 @@ var treeStyle = tv({
|
|
|
11686
11710
|
});
|
|
11687
11711
|
|
|
11688
11712
|
// src/components/fileUpload/fileUpload.tsx
|
|
11713
|
+
var import_react38 = require("react");
|
|
11714
|
+
var import_tailwind_variants34 = require("tailwind-variants");
|
|
11715
|
+
|
|
11716
|
+
// src/components/progress/progress.tsx
|
|
11717
|
+
var import_react37 = require("react");
|
|
11718
|
+
|
|
11719
|
+
// src/hooks/useIsMounted.ts
|
|
11689
11720
|
var import_react36 = require("react");
|
|
11690
|
-
|
|
11721
|
+
function useIsMounted(props = {}) {
|
|
11722
|
+
const { rerender = false, delay = 0 } = props;
|
|
11723
|
+
const isMountedRef = (0, import_react36.useRef)(false);
|
|
11724
|
+
const [isMounted, setIsMounted] = (0, import_react36.useState)(false);
|
|
11725
|
+
(0, import_react36.useEffect)(() => {
|
|
11726
|
+
isMountedRef.current = true;
|
|
11727
|
+
let timer = null;
|
|
11728
|
+
if (rerender) {
|
|
11729
|
+
if (delay > 0) {
|
|
11730
|
+
timer = setTimeout(() => {
|
|
11731
|
+
setIsMounted(true);
|
|
11732
|
+
}, delay);
|
|
11733
|
+
} else {
|
|
11734
|
+
setIsMounted(true);
|
|
11735
|
+
}
|
|
11736
|
+
}
|
|
11737
|
+
return () => {
|
|
11738
|
+
isMountedRef.current = false;
|
|
11739
|
+
if (rerender) {
|
|
11740
|
+
setIsMounted(false);
|
|
11741
|
+
}
|
|
11742
|
+
if (timer) {
|
|
11743
|
+
clearTimeout(timer);
|
|
11744
|
+
}
|
|
11745
|
+
};
|
|
11746
|
+
}, [rerender]);
|
|
11747
|
+
return [(0, import_react36.useCallback)(() => isMountedRef.current, []), isMounted];
|
|
11748
|
+
}
|
|
11749
|
+
|
|
11750
|
+
// src/components/progress/progress.tsx
|
|
11691
11751
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11752
|
+
var Progress = (originalProps) => {
|
|
11753
|
+
const [props, variantProps] = mapPropsVariants(originalProps, progressStyle.variantKeys);
|
|
11754
|
+
const { children, classNames, value = 0, minValue = 0, maxValue = 100, ...progressProps } = props;
|
|
11755
|
+
const isIndeterminate = originalProps.isIndeterminate;
|
|
11756
|
+
const [, isMounted] = useIsMounted({
|
|
11757
|
+
rerender: true,
|
|
11758
|
+
delay: 100
|
|
11759
|
+
});
|
|
11760
|
+
const selfMounted = variantProps.disableAnimation ? true : isMounted;
|
|
11761
|
+
const percentage = (0, import_react37.useMemo)(
|
|
11762
|
+
() => isIndeterminate || !selfMounted ? void 0 : clampPercentage((value - minValue) / (maxValue - minValue) * 100),
|
|
11763
|
+
[selfMounted, isIndeterminate, value, minValue, maxValue]
|
|
11764
|
+
);
|
|
11765
|
+
const slots = (0, import_react37.useMemo)(() => progressStyle({ ...variantProps }), [variantProps]);
|
|
11766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: slots.track({ class: classNames == null ? void 0 : classNames.track }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11767
|
+
"div",
|
|
11768
|
+
{
|
|
11769
|
+
className: slots.indicator({ class: classNames == null ? void 0 : classNames.indicator }),
|
|
11770
|
+
style: {
|
|
11771
|
+
transform: `translateX(-${100 - (percentage || 0)}%)`
|
|
11772
|
+
}
|
|
11773
|
+
}
|
|
11774
|
+
) }) });
|
|
11775
|
+
};
|
|
11776
|
+
var progress_default = Progress;
|
|
11777
|
+
var progressStyle = tv({
|
|
11778
|
+
slots: {
|
|
11779
|
+
base: ["flex flex-col gap-2 w-full"],
|
|
11780
|
+
track: ["z-0", "relative", "bg-neutral-soft", "overflow-hidden", "rtl:rotate-180"],
|
|
11781
|
+
indicator: ["h-full"],
|
|
11782
|
+
value: ""
|
|
11783
|
+
},
|
|
11784
|
+
variants: {
|
|
11785
|
+
color: {
|
|
11786
|
+
primary: {
|
|
11787
|
+
indicator: ["bg-gradient-to-r from-primary-light via-primary-light to-primary-main"]
|
|
11788
|
+
},
|
|
11789
|
+
secondary: {
|
|
11790
|
+
indicator: ["bg-gradient-to-r from-secondary-light via-secondary-light to-secondary-main"]
|
|
11791
|
+
},
|
|
11792
|
+
neutral: {
|
|
11793
|
+
indicator: ["bg-gradient-to-r from-neutral-light via-neutral-light to-neutral-main"]
|
|
11794
|
+
},
|
|
11795
|
+
info: {
|
|
11796
|
+
indicator: ["bg-gradient-to-r from-info-light via-info-light to-info-main"]
|
|
11797
|
+
},
|
|
11798
|
+
success: {
|
|
11799
|
+
indicator: ["bg-gradient-to-r from-success-light via-success-light to-success-main"]
|
|
11800
|
+
},
|
|
11801
|
+
warning: {
|
|
11802
|
+
indicator: ["bg-gradient-to-r from-warning-light via-warning-light to-warning-main"]
|
|
11803
|
+
},
|
|
11804
|
+
danger: {
|
|
11805
|
+
indicator: ["bg-gradient-to-r from-danger-light via-danger-light to-danger-main"]
|
|
11806
|
+
}
|
|
11807
|
+
},
|
|
11808
|
+
size: {
|
|
11809
|
+
sm: {
|
|
11810
|
+
track: ["h-[4px]", "rounded-sm"],
|
|
11811
|
+
indicator: "rounded-sm"
|
|
11812
|
+
},
|
|
11813
|
+
md: {
|
|
11814
|
+
track: ["h-[6px]", "rounded-md"],
|
|
11815
|
+
indicator: "rounded-md"
|
|
11816
|
+
},
|
|
11817
|
+
lg: {
|
|
11818
|
+
track: ["h-[8px]", "rounded-lg"],
|
|
11819
|
+
indicator: "rounded-lg"
|
|
11820
|
+
},
|
|
11821
|
+
xl: {
|
|
11822
|
+
track: ["h-[10px]", "rounded-xl"],
|
|
11823
|
+
indicator: "rounded-xl"
|
|
11824
|
+
}
|
|
11825
|
+
},
|
|
11826
|
+
isDisabled: {
|
|
11827
|
+
true: {
|
|
11828
|
+
base: "opacity-disabled cursor-not-allowed"
|
|
11829
|
+
}
|
|
11830
|
+
},
|
|
11831
|
+
disableAnimation: {
|
|
11832
|
+
true: {},
|
|
11833
|
+
false: {
|
|
11834
|
+
indicator: "transition-transform !duration-500"
|
|
11835
|
+
}
|
|
11836
|
+
},
|
|
11837
|
+
isIndeterminate: {
|
|
11838
|
+
true: {
|
|
11839
|
+
indicator: ["absolute", "w-full", "origin-left", "animate-indeterminate-bar"]
|
|
11840
|
+
}
|
|
11841
|
+
}
|
|
11842
|
+
},
|
|
11843
|
+
defaultVariants: {
|
|
11844
|
+
color: "primary",
|
|
11845
|
+
size: "md",
|
|
11846
|
+
isDisabled: false,
|
|
11847
|
+
disableAnimation: false,
|
|
11848
|
+
isIndeterminate: false
|
|
11849
|
+
},
|
|
11850
|
+
compoundVariants: [
|
|
11851
|
+
{
|
|
11852
|
+
isIndeterminate: true,
|
|
11853
|
+
disableAnimation: false,
|
|
11854
|
+
className: {
|
|
11855
|
+
indicator: "!transition-none motion-reduce:transition-none"
|
|
11856
|
+
}
|
|
11857
|
+
}
|
|
11858
|
+
]
|
|
11859
|
+
});
|
|
11860
|
+
var clampPercentage = (value) => {
|
|
11861
|
+
return Math.min(100, Math.max(0, value));
|
|
11862
|
+
};
|
|
11863
|
+
|
|
11864
|
+
// src/components/fileUpload/fileUpload.tsx
|
|
11865
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11692
11866
|
function FileUpload({
|
|
11693
11867
|
buttonText,
|
|
11694
11868
|
maxSizeMB = 10,
|
|
11695
11869
|
placeholder,
|
|
11870
|
+
errorMessage,
|
|
11696
11871
|
accept = [],
|
|
11697
11872
|
acceptErrorMessage = "The file type is not allowed.",
|
|
11698
11873
|
sizeErrorMessage = `File is too large.`,
|
|
@@ -11702,11 +11877,11 @@ function FileUpload({
|
|
|
11702
11877
|
name,
|
|
11703
11878
|
classNames
|
|
11704
11879
|
}) {
|
|
11705
|
-
const fileInputRef = (0,
|
|
11706
|
-
const uploadIntervalRef = (0,
|
|
11707
|
-
const [file, setFile] = (0,
|
|
11708
|
-
const [uploadProgress, setUploadProgress] = (0,
|
|
11709
|
-
const [
|
|
11880
|
+
const fileInputRef = (0, import_react38.useRef)(null);
|
|
11881
|
+
const uploadIntervalRef = (0, import_react38.useRef)(null);
|
|
11882
|
+
const [file, setFile] = (0, import_react38.useState)(null);
|
|
11883
|
+
const [uploadProgress, setUploadProgress] = (0, import_react38.useState)(0);
|
|
11884
|
+
const [message, setMessage] = (0, import_react38.useState)(errorMessage);
|
|
11710
11885
|
const slots = fileUploadStyle();
|
|
11711
11886
|
const handleButtonClick = () => {
|
|
11712
11887
|
var _a;
|
|
@@ -11740,12 +11915,12 @@ function FileUpload({
|
|
|
11740
11915
|
if (!selectedFile) return;
|
|
11741
11916
|
const error = validateFile(selectedFile);
|
|
11742
11917
|
if (error) {
|
|
11743
|
-
|
|
11918
|
+
setMessage(error);
|
|
11744
11919
|
setFile(null);
|
|
11745
11920
|
return;
|
|
11746
11921
|
}
|
|
11747
11922
|
setFile(selectedFile);
|
|
11748
|
-
|
|
11923
|
+
setMessage("");
|
|
11749
11924
|
startUploadSimulation(selectedFile);
|
|
11750
11925
|
};
|
|
11751
11926
|
const handleCancelUpload = () => {
|
|
@@ -11754,20 +11929,34 @@ function FileUpload({
|
|
|
11754
11929
|
}
|
|
11755
11930
|
setFile(null);
|
|
11756
11931
|
setUploadProgress(0);
|
|
11757
|
-
|
|
11932
|
+
setMessage("");
|
|
11758
11933
|
};
|
|
11759
|
-
(0,
|
|
11934
|
+
(0, import_react38.useEffect)(() => {
|
|
11760
11935
|
return () => {
|
|
11761
11936
|
if (uploadIntervalRef.current) {
|
|
11762
11937
|
clearInterval(uploadIntervalRef.current);
|
|
11763
11938
|
}
|
|
11764
11939
|
};
|
|
11765
11940
|
}, []);
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11941
|
+
(0, import_react38.useEffect)(() => {
|
|
11942
|
+
setMessage(errorMessage);
|
|
11943
|
+
}, [setMessage, errorMessage]);
|
|
11944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
11945
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
|
|
11946
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.inputWrapper(), children: [
|
|
11947
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11948
|
+
input_default,
|
|
11949
|
+
{
|
|
11950
|
+
name,
|
|
11951
|
+
readOnly: true,
|
|
11952
|
+
variant: "outline",
|
|
11953
|
+
full: true,
|
|
11954
|
+
placeholder,
|
|
11955
|
+
defaultValue: file == null ? void 0 : file.name,
|
|
11956
|
+
errorMessage: message
|
|
11957
|
+
}
|
|
11958
|
+
),
|
|
11959
|
+
file && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11771
11960
|
icon_button_default,
|
|
11772
11961
|
{
|
|
11773
11962
|
name: "close",
|
|
@@ -11779,24 +11968,21 @@ function FileUpload({
|
|
|
11779
11968
|
}
|
|
11780
11969
|
)
|
|
11781
11970
|
] }),
|
|
11782
|
-
/* @__PURE__ */ (0,
|
|
11783
|
-
/* @__PURE__ */ (0,
|
|
11971
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, children: buttonText }),
|
|
11972
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
|
|
11784
11973
|
] }),
|
|
11785
|
-
showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0,
|
|
11786
|
-
!
|
|
11787
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: slots.errorMessage(), children: errorMessage })
|
|
11974
|
+
showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(progress_default, { value: uploadProgress }),
|
|
11975
|
+
!message && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: slots.helperMessage(), children: helperMessage })
|
|
11788
11976
|
] });
|
|
11789
11977
|
}
|
|
11790
11978
|
FileUpload.displayName = "FileUpload";
|
|
11791
11979
|
var fileUpload_default = FileUpload;
|
|
11792
|
-
var fileUploadStyle = (0,
|
|
11980
|
+
var fileUploadStyle = (0, import_tailwind_variants34.tv)({
|
|
11793
11981
|
slots: {
|
|
11794
11982
|
base: ["flex", "flex-col", "gap-[5px]"],
|
|
11795
|
-
container: ["flex", "
|
|
11983
|
+
container: ["flex", "gap-[10px]"],
|
|
11796
11984
|
inputWrapper: ["relative", "flex-1"],
|
|
11797
11985
|
cancelButton: ["absolute", "top-1/2", "right-0", "-translate-y-1/2"],
|
|
11798
|
-
progressBarContainer: ["w-full", "h-[5px]", "bg-neutral-light", "rounded-full", "overflow-hidden"],
|
|
11799
|
-
progressBar: ["h-full", "bg-primary-main", "transition-all"],
|
|
11800
11986
|
errorMessage: ["text-danger-main", "text-sm"],
|
|
11801
11987
|
helperMessage: ["text-neutral-main", "text-sm"]
|
|
11802
11988
|
}
|
|
@@ -11804,12 +11990,12 @@ var fileUploadStyle = (0, import_tailwind_variants33.tv)({
|
|
|
11804
11990
|
|
|
11805
11991
|
// src/components/charts/circularProgress.tsx
|
|
11806
11992
|
var import_recharts = require("recharts");
|
|
11807
|
-
var
|
|
11808
|
-
var
|
|
11809
|
-
var CircularProgress = (0,
|
|
11993
|
+
var import_react39 = require("react");
|
|
11994
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11995
|
+
var CircularProgress = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
11810
11996
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
11811
11997
|
const { label, size = 150, percentage, unit, classNames } = { ...props, ...variantProps };
|
|
11812
|
-
const slots = (0,
|
|
11998
|
+
const slots = (0, import_react39.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
11813
11999
|
const data = [
|
|
11814
12000
|
{
|
|
11815
12001
|
name: label,
|
|
@@ -11819,9 +12005,9 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
11819
12005
|
const BAR_SIZE = 24;
|
|
11820
12006
|
const OUTER_RADIUS = 88;
|
|
11821
12007
|
const INNER_RADIUS = OUTER_RADIUS - BAR_SIZE;
|
|
11822
|
-
return /* @__PURE__ */ (0,
|
|
11823
|
-
/* @__PURE__ */ (0,
|
|
11824
|
-
/* @__PURE__ */ (0,
|
|
12008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12009
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
12010
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
11825
12011
|
import_recharts.RadialBarChart,
|
|
11826
12012
|
{
|
|
11827
12013
|
width: size,
|
|
@@ -11833,7 +12019,7 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
11833
12019
|
startAngle: 90,
|
|
11834
12020
|
endAngle: -270,
|
|
11835
12021
|
children: [
|
|
11836
|
-
/* @__PURE__ */ (0,
|
|
12022
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11837
12023
|
"circle",
|
|
11838
12024
|
{
|
|
11839
12025
|
cx: size / 2,
|
|
@@ -11843,8 +12029,8 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
11843
12029
|
fill: "currentColor"
|
|
11844
12030
|
}
|
|
11845
12031
|
),
|
|
11846
|
-
/* @__PURE__ */ (0,
|
|
11847
|
-
/* @__PURE__ */ (0,
|
|
12032
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_recharts.PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
|
|
12033
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11848
12034
|
import_recharts.RadialBar,
|
|
11849
12035
|
{
|
|
11850
12036
|
dataKey: "value",
|
|
@@ -11856,12 +12042,12 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
|
|
|
11856
12042
|
]
|
|
11857
12043
|
}
|
|
11858
12044
|
),
|
|
11859
|
-
/* @__PURE__ */ (0,
|
|
12045
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: slots.text({ class: classNames == null ? void 0 : classNames.text }), children: [
|
|
11860
12046
|
percentage,
|
|
11861
12047
|
unit
|
|
11862
12048
|
] }) })
|
|
11863
12049
|
] }),
|
|
11864
|
-
label && /* @__PURE__ */ (0,
|
|
12050
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
|
|
11865
12051
|
] });
|
|
11866
12052
|
});
|
|
11867
12053
|
CircularProgress.displayName = "CircularProgress";
|
|
@@ -11899,26 +12085,26 @@ var circularProgressStyle = tv({
|
|
|
11899
12085
|
});
|
|
11900
12086
|
|
|
11901
12087
|
// src/components/charts/areaChart.tsx
|
|
11902
|
-
var
|
|
12088
|
+
var import_react40 = require("react");
|
|
11903
12089
|
var import_recharts2 = require("recharts");
|
|
11904
|
-
var
|
|
11905
|
-
var AreaChartComponent = (0,
|
|
11906
|
-
const uniqueId = (0,
|
|
12090
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12091
|
+
var AreaChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
|
|
12092
|
+
const uniqueId = (0, import_react40.useId)();
|
|
11907
12093
|
const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
|
|
11908
12094
|
const { data, label, color = "primary", classNames } = { ...props, ...variantProps };
|
|
11909
|
-
const slots = (0,
|
|
12095
|
+
const slots = (0, import_react40.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
|
|
11910
12096
|
const COLOR_MAP = {
|
|
11911
12097
|
primary: "#3F9CF2",
|
|
11912
12098
|
danger: "#FF4684"
|
|
11913
12099
|
};
|
|
11914
|
-
const colorHex = (0,
|
|
11915
|
-
const [tickPositions, setTickPositions] = (0,
|
|
11916
|
-
const tickRef = (0,
|
|
12100
|
+
const colorHex = (0, import_react40.useMemo)(() => COLOR_MAP[color], [color]);
|
|
12101
|
+
const [tickPositions, setTickPositions] = (0, import_react40.useState)([]);
|
|
12102
|
+
const tickRef = (0, import_react40.useRef)([]);
|
|
11917
12103
|
const CustomTick = ({ x, y, payload }) => {
|
|
11918
12104
|
if (x !== void 0) {
|
|
11919
12105
|
tickRef.current.push(x);
|
|
11920
12106
|
}
|
|
11921
|
-
return /* @__PURE__ */ (0,
|
|
12107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11922
12108
|
"text",
|
|
11923
12109
|
{
|
|
11924
12110
|
x,
|
|
@@ -11932,7 +12118,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
11932
12118
|
}
|
|
11933
12119
|
);
|
|
11934
12120
|
};
|
|
11935
|
-
(0,
|
|
12121
|
+
(0, import_react40.useEffect)(() => {
|
|
11936
12122
|
const raf = requestAnimationFrame(() => {
|
|
11937
12123
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
11938
12124
|
const mids = [];
|
|
@@ -11947,19 +12133,19 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
11947
12133
|
const CustomDotWithShadow = (props2) => {
|
|
11948
12134
|
const { cx, cy, fill, stroke } = props2;
|
|
11949
12135
|
if (cx === void 0 || cy === void 0) return null;
|
|
11950
|
-
return /* @__PURE__ */ (0,
|
|
11951
|
-
/* @__PURE__ */ (0,
|
|
11952
|
-
/* @__PURE__ */ (0,
|
|
12136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
12137
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
|
|
12138
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
|
|
11953
12139
|
] });
|
|
11954
12140
|
};
|
|
11955
|
-
return /* @__PURE__ */ (0,
|
|
11956
|
-
label && /* @__PURE__ */ (0,
|
|
11957
|
-
/* @__PURE__ */ (0,
|
|
11958
|
-
/* @__PURE__ */ (0,
|
|
11959
|
-
/* @__PURE__ */ (0,
|
|
11960
|
-
/* @__PURE__ */ (0,
|
|
12141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12142
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
12143
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_recharts2.AreaChart, { data, margin: { left: -30 }, children: [
|
|
12144
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
12145
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
|
|
12146
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
|
|
11961
12147
|
] }) }),
|
|
11962
|
-
/* @__PURE__ */ (0,
|
|
12148
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11963
12149
|
import_recharts2.CartesianGrid,
|
|
11964
12150
|
{
|
|
11965
12151
|
vertical: true,
|
|
@@ -11969,7 +12155,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
11969
12155
|
verticalPoints: tickPositions
|
|
11970
12156
|
}
|
|
11971
12157
|
),
|
|
11972
|
-
/* @__PURE__ */ (0,
|
|
12158
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11973
12159
|
import_recharts2.XAxis,
|
|
11974
12160
|
{
|
|
11975
12161
|
dataKey: "name",
|
|
@@ -11979,7 +12165,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
11979
12165
|
padding: { left: 35.5, right: 35.5 }
|
|
11980
12166
|
}
|
|
11981
12167
|
),
|
|
11982
|
-
/* @__PURE__ */ (0,
|
|
12168
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11983
12169
|
import_recharts2.YAxis,
|
|
11984
12170
|
{
|
|
11985
12171
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -11995,7 +12181,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
11995
12181
|
domain: [-6, 110]
|
|
11996
12182
|
}
|
|
11997
12183
|
),
|
|
11998
|
-
/* @__PURE__ */ (0,
|
|
12184
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
11999
12185
|
import_recharts2.Area,
|
|
12000
12186
|
{
|
|
12001
12187
|
type: "monotone",
|
|
@@ -12003,7 +12189,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
|
|
|
12003
12189
|
stroke: colorHex,
|
|
12004
12190
|
strokeWidth: 2,
|
|
12005
12191
|
fill: `url(#colorGradient-${uniqueId})`,
|
|
12006
|
-
dot: /* @__PURE__ */ (0,
|
|
12192
|
+
dot: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
|
|
12007
12193
|
activeDot: { r: 7, fill: colorHex }
|
|
12008
12194
|
}
|
|
12009
12195
|
)
|
|
@@ -12035,20 +12221,20 @@ var areaChartStyle = tv({
|
|
|
12035
12221
|
});
|
|
12036
12222
|
|
|
12037
12223
|
// src/components/charts/barChart.tsx
|
|
12038
|
-
var
|
|
12224
|
+
var import_react41 = require("react");
|
|
12039
12225
|
var import_recharts3 = require("recharts");
|
|
12040
|
-
var
|
|
12041
|
-
var BarChartComponent = (0,
|
|
12226
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12227
|
+
var BarChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
|
|
12042
12228
|
const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
|
|
12043
12229
|
const { data, label, classNames } = { ...props, ...variantProps };
|
|
12044
|
-
const slots = (0,
|
|
12230
|
+
const slots = (0, import_react41.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
|
|
12045
12231
|
const COLOR_MAP = {
|
|
12046
12232
|
primary: "#C7E5FA",
|
|
12047
12233
|
secondary: "#DEC1FA",
|
|
12048
12234
|
warning: "#F9C967"
|
|
12049
12235
|
};
|
|
12050
|
-
const [tickPositions, setTickPositions] = (0,
|
|
12051
|
-
const tickRef = (0,
|
|
12236
|
+
const [tickPositions, setTickPositions] = (0, import_react41.useState)([]);
|
|
12237
|
+
const tickRef = (0, import_react41.useRef)([]);
|
|
12052
12238
|
const CustomBarShape = (barProps) => {
|
|
12053
12239
|
const { x, y, width, height, fill } = barProps;
|
|
12054
12240
|
const radius = 5;
|
|
@@ -12056,19 +12242,19 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12056
12242
|
const adjustedHeight = height + extraHeight;
|
|
12057
12243
|
const adjustedY = y;
|
|
12058
12244
|
const bottomY = adjustedY + adjustedHeight;
|
|
12059
|
-
return height ? /* @__PURE__ */ (0,
|
|
12245
|
+
return height ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12060
12246
|
"path",
|
|
12061
12247
|
{
|
|
12062
12248
|
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`,
|
|
12063
12249
|
fill
|
|
12064
12250
|
}
|
|
12065
|
-
) : /* @__PURE__ */ (0,
|
|
12251
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("rect", { x, y, width, height: 0, fill });
|
|
12066
12252
|
};
|
|
12067
12253
|
const CustomTick = ({ x, y, payload }) => {
|
|
12068
12254
|
if (x !== void 0) {
|
|
12069
12255
|
tickRef.current.push(x);
|
|
12070
12256
|
}
|
|
12071
|
-
return /* @__PURE__ */ (0,
|
|
12257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12072
12258
|
"text",
|
|
12073
12259
|
{
|
|
12074
12260
|
x,
|
|
@@ -12082,7 +12268,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12082
12268
|
}
|
|
12083
12269
|
);
|
|
12084
12270
|
};
|
|
12085
|
-
(0,
|
|
12271
|
+
(0, import_react41.useEffect)(() => {
|
|
12086
12272
|
const raf = requestAnimationFrame(() => {
|
|
12087
12273
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
12088
12274
|
const mids = [];
|
|
@@ -12094,10 +12280,10 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12094
12280
|
});
|
|
12095
12281
|
return () => cancelAnimationFrame(raf);
|
|
12096
12282
|
}, [data]);
|
|
12097
|
-
return /* @__PURE__ */ (0,
|
|
12098
|
-
label && /* @__PURE__ */ (0,
|
|
12099
|
-
/* @__PURE__ */ (0,
|
|
12100
|
-
/* @__PURE__ */ (0,
|
|
12283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
12284
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
12285
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_recharts3.BarChart, { data, margin: { left: -30 }, barSize: 20, barGap: 10, children: [
|
|
12286
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12101
12287
|
import_recharts3.CartesianGrid,
|
|
12102
12288
|
{
|
|
12103
12289
|
vertical: true,
|
|
@@ -12107,7 +12293,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12107
12293
|
verticalPoints: tickPositions
|
|
12108
12294
|
}
|
|
12109
12295
|
),
|
|
12110
|
-
/* @__PURE__ */ (0,
|
|
12296
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12111
12297
|
import_recharts3.XAxis,
|
|
12112
12298
|
{
|
|
12113
12299
|
dataKey: "name",
|
|
@@ -12117,7 +12303,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12117
12303
|
padding: { left: 32, right: 32 }
|
|
12118
12304
|
}
|
|
12119
12305
|
),
|
|
12120
|
-
/* @__PURE__ */ (0,
|
|
12306
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12121
12307
|
import_recharts3.YAxis,
|
|
12122
12308
|
{
|
|
12123
12309
|
axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
|
|
@@ -12133,9 +12319,9 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12133
12319
|
domain: [-6, 110]
|
|
12134
12320
|
}
|
|
12135
12321
|
),
|
|
12136
|
-
/* @__PURE__ */ (0,
|
|
12137
|
-
/* @__PURE__ */ (0,
|
|
12138
|
-
/* @__PURE__ */ (0,
|
|
12322
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
|
|
12323
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
|
|
12324
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
|
|
12139
12325
|
] }) })
|
|
12140
12326
|
] });
|
|
12141
12327
|
});
|
|
@@ -12151,154 +12337,6 @@ var barChartStyle = tv({
|
|
|
12151
12337
|
color: "primary"
|
|
12152
12338
|
}
|
|
12153
12339
|
});
|
|
12154
|
-
|
|
12155
|
-
// src/components/progress/progress.tsx
|
|
12156
|
-
var import_react41 = require("react");
|
|
12157
|
-
|
|
12158
|
-
// src/hooks/useIsMounted.ts
|
|
12159
|
-
var import_react40 = require("react");
|
|
12160
|
-
function useIsMounted(props = {}) {
|
|
12161
|
-
const { rerender = false, delay = 0 } = props;
|
|
12162
|
-
const isMountedRef = (0, import_react40.useRef)(false);
|
|
12163
|
-
const [isMounted, setIsMounted] = (0, import_react40.useState)(false);
|
|
12164
|
-
(0, import_react40.useEffect)(() => {
|
|
12165
|
-
isMountedRef.current = true;
|
|
12166
|
-
let timer = null;
|
|
12167
|
-
if (rerender) {
|
|
12168
|
-
if (delay > 0) {
|
|
12169
|
-
timer = setTimeout(() => {
|
|
12170
|
-
setIsMounted(true);
|
|
12171
|
-
}, delay);
|
|
12172
|
-
} else {
|
|
12173
|
-
setIsMounted(true);
|
|
12174
|
-
}
|
|
12175
|
-
}
|
|
12176
|
-
return () => {
|
|
12177
|
-
isMountedRef.current = false;
|
|
12178
|
-
if (rerender) {
|
|
12179
|
-
setIsMounted(false);
|
|
12180
|
-
}
|
|
12181
|
-
if (timer) {
|
|
12182
|
-
clearTimeout(timer);
|
|
12183
|
-
}
|
|
12184
|
-
};
|
|
12185
|
-
}, [rerender]);
|
|
12186
|
-
return [(0, import_react40.useCallback)(() => isMountedRef.current, []), isMounted];
|
|
12187
|
-
}
|
|
12188
|
-
|
|
12189
|
-
// src/components/progress/progress.tsx
|
|
12190
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12191
|
-
var Progress = (originalProps) => {
|
|
12192
|
-
const [props, variantProps] = mapPropsVariants(originalProps, progressStyle.variantKeys);
|
|
12193
|
-
const { children, classNames, value = 0, minValue = 0, maxValue = 100, ...progressProps } = props;
|
|
12194
|
-
const isIndeterminate = originalProps.isIndeterminate;
|
|
12195
|
-
const [, isMounted] = useIsMounted({
|
|
12196
|
-
rerender: true,
|
|
12197
|
-
delay: 100
|
|
12198
|
-
});
|
|
12199
|
-
const selfMounted = variantProps.disableAnimation ? true : isMounted;
|
|
12200
|
-
const percentage = (0, import_react41.useMemo)(
|
|
12201
|
-
() => isIndeterminate || !selfMounted ? void 0 : clampPercentage((value - minValue) / (maxValue - minValue) * 100),
|
|
12202
|
-
[selfMounted, isIndeterminate, value, minValue, maxValue]
|
|
12203
|
-
);
|
|
12204
|
-
const slots = (0, import_react41.useMemo)(() => progressStyle({ ...variantProps }), [variantProps]);
|
|
12205
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: slots.track({ class: classNames == null ? void 0 : classNames.track }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
12206
|
-
"div",
|
|
12207
|
-
{
|
|
12208
|
-
className: slots.indicator({ class: classNames == null ? void 0 : classNames.indicator }),
|
|
12209
|
-
style: {
|
|
12210
|
-
transform: `translateX(-${100 - (percentage || 0)}%)`
|
|
12211
|
-
}
|
|
12212
|
-
}
|
|
12213
|
-
) }) });
|
|
12214
|
-
};
|
|
12215
|
-
var progress_default = Progress;
|
|
12216
|
-
var progressStyle = tv({
|
|
12217
|
-
slots: {
|
|
12218
|
-
base: ["flex flex-col gap-2 w-full"],
|
|
12219
|
-
track: ["z-0", "relative", "bg-neutral-soft", "overflow-hidden", "rtl:rotate-180"],
|
|
12220
|
-
indicator: ["h-full"],
|
|
12221
|
-
value: ""
|
|
12222
|
-
},
|
|
12223
|
-
variants: {
|
|
12224
|
-
color: {
|
|
12225
|
-
primary: {
|
|
12226
|
-
indicator: ["bg-gradient-to-r from-primary-light via-primary-light to-primary-main"]
|
|
12227
|
-
},
|
|
12228
|
-
secondary: {
|
|
12229
|
-
indicator: ["bg-gradient-to-r from-secondary-light via-secondary-light to-secondary-main"]
|
|
12230
|
-
},
|
|
12231
|
-
neutral: {
|
|
12232
|
-
indicator: ["bg-gradient-to-r from-neutral-light via-neutral-light to-neutral-main"]
|
|
12233
|
-
},
|
|
12234
|
-
info: {
|
|
12235
|
-
indicator: ["bg-gradient-to-r from-info-light via-info-light to-info-main"]
|
|
12236
|
-
},
|
|
12237
|
-
success: {
|
|
12238
|
-
indicator: ["bg-gradient-to-r from-success-light via-success-light to-success-main"]
|
|
12239
|
-
},
|
|
12240
|
-
warning: {
|
|
12241
|
-
indicator: ["bg-gradient-to-r from-warning-light via-warning-light to-warning-main"]
|
|
12242
|
-
},
|
|
12243
|
-
danger: {
|
|
12244
|
-
indicator: ["bg-gradient-to-r from-danger-light via-danger-light to-danger-main"]
|
|
12245
|
-
}
|
|
12246
|
-
},
|
|
12247
|
-
size: {
|
|
12248
|
-
sm: {
|
|
12249
|
-
track: ["h-[4px]", "rounded-sm"],
|
|
12250
|
-
indicator: "rounded-sm"
|
|
12251
|
-
},
|
|
12252
|
-
md: {
|
|
12253
|
-
track: ["h-[6px]", "rounded-md"],
|
|
12254
|
-
indicator: "rounded-md"
|
|
12255
|
-
},
|
|
12256
|
-
lg: {
|
|
12257
|
-
track: ["h-[8px]", "rounded-lg"],
|
|
12258
|
-
indicator: "rounded-lg"
|
|
12259
|
-
},
|
|
12260
|
-
xl: {
|
|
12261
|
-
track: ["h-[10px]", "rounded-xl"],
|
|
12262
|
-
indicator: "rounded-xl"
|
|
12263
|
-
}
|
|
12264
|
-
},
|
|
12265
|
-
isDisabled: {
|
|
12266
|
-
true: {
|
|
12267
|
-
base: "opacity-disabled cursor-not-allowed"
|
|
12268
|
-
}
|
|
12269
|
-
},
|
|
12270
|
-
disableAnimation: {
|
|
12271
|
-
true: {},
|
|
12272
|
-
false: {
|
|
12273
|
-
indicator: "transition-transform !duration-500"
|
|
12274
|
-
}
|
|
12275
|
-
},
|
|
12276
|
-
isIndeterminate: {
|
|
12277
|
-
true: {
|
|
12278
|
-
indicator: ["absolute", "w-full", "origin-left", "animate-indeterminate-bar"]
|
|
12279
|
-
}
|
|
12280
|
-
}
|
|
12281
|
-
},
|
|
12282
|
-
defaultVariants: {
|
|
12283
|
-
color: "primary",
|
|
12284
|
-
size: "md",
|
|
12285
|
-
isDisabled: false,
|
|
12286
|
-
disableAnimation: false,
|
|
12287
|
-
isIndeterminate: false
|
|
12288
|
-
},
|
|
12289
|
-
compoundVariants: [
|
|
12290
|
-
{
|
|
12291
|
-
isIndeterminate: true,
|
|
12292
|
-
disableAnimation: false,
|
|
12293
|
-
className: {
|
|
12294
|
-
indicator: "!transition-none motion-reduce:transition-none"
|
|
12295
|
-
}
|
|
12296
|
-
}
|
|
12297
|
-
]
|
|
12298
|
-
});
|
|
12299
|
-
var clampPercentage = (value) => {
|
|
12300
|
-
return Math.min(100, Math.max(0, value));
|
|
12301
|
-
};
|
|
12302
12340
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12303
12341
|
0 && (module.exports = {
|
|
12304
12342
|
Accordion,
|