@deepnoid/ui 0.1.98 → 0.1.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.turbo/turbo-build.log +163 -163
  2. package/dist/{chunk-C5FUPNE4.mjs → chunk-AATFH6PB.mjs} +29 -12
  3. package/dist/{chunk-VFFLJN5N.mjs → chunk-FESRJFPF.mjs} +30 -6
  4. package/dist/{chunk-45N5ZAIJ.mjs → chunk-JN6ELUAT.mjs} +1 -1
  5. package/dist/{chunk-VIEBF2WH.mjs → chunk-ZAHEKJIU.mjs} +1 -1
  6. package/dist/components/fileUpload/fileUpload.d.mts +3 -13
  7. package/dist/components/fileUpload/fileUpload.d.ts +3 -13
  8. package/dist/components/fileUpload/fileUpload.js +218 -32
  9. package/dist/components/fileUpload/fileUpload.mjs +5 -2
  10. package/dist/components/fileUpload/index.js +218 -32
  11. package/dist/components/fileUpload/index.mjs +5 -2
  12. package/dist/components/input/index.js +30 -6
  13. package/dist/components/input/index.mjs +1 -1
  14. package/dist/components/input/input.d.mts +21 -0
  15. package/dist/components/input/input.d.ts +21 -0
  16. package/dist/components/input/input.js +30 -6
  17. package/dist/components/input/input.mjs +1 -1
  18. package/dist/components/pagination/index.js +30 -6
  19. package/dist/components/pagination/index.mjs +2 -2
  20. package/dist/components/pagination/pagination.js +30 -6
  21. package/dist/components/pagination/pagination.mjs +2 -2
  22. package/dist/components/table/index.js +30 -6
  23. package/dist/components/table/index.mjs +3 -3
  24. package/dist/components/table/table-body.js +30 -6
  25. package/dist/components/table/table-body.mjs +3 -3
  26. package/dist/components/table/table-head.js +30 -6
  27. package/dist/components/table/table-head.mjs +3 -3
  28. package/dist/components/table/table.js +30 -6
  29. package/dist/components/table/table.mjs +3 -3
  30. package/dist/index.js +273 -233
  31. package/dist/index.mjs +27 -27
  32. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7055,12 +7055,10 @@ var inputStyle = tv(
7055
7055
  errorMessage: ["text-danger-main"],
7056
7056
  readonlyWrapper: [
7057
7057
  "pointer-events-none",
7058
- "!text-body-foreground",
7059
- "placeholder:!text-body-foreground",
7060
- "group-has-[p.error]/input:!text-danger-main",
7061
- "group-has-[p.error]/input:placeholder:!text-danger-main",
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,27 +11710,179 @@ 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
- var import_tailwind_variants33 = require("tailwind-variants");
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.`,
11699
11874
  onFileUpload,
11875
+ onCancelUpload,
11700
11876
  helperMessage,
11701
11877
  showProgress,
11702
11878
  name,
11703
11879
  classNames
11704
11880
  }) {
11705
- const fileInputRef = (0, import_react36.useRef)(null);
11706
- const uploadIntervalRef = (0, import_react36.useRef)(null);
11707
- const [file, setFile] = (0, import_react36.useState)(null);
11708
- const [uploadProgress, setUploadProgress] = (0, import_react36.useState)(0);
11709
- const [errorMessage, setErrorMessage] = (0, import_react36.useState)("");
11881
+ const fileInputRef = (0, import_react38.useRef)(null);
11882
+ const uploadIntervalRef = (0, import_react38.useRef)(null);
11883
+ const [file, setFile] = (0, import_react38.useState)(null);
11884
+ const [uploadProgress, setUploadProgress] = (0, import_react38.useState)(0);
11885
+ const [message, setMessage] = (0, import_react38.useState)(errorMessage);
11710
11886
  const slots = fileUploadStyle();
11711
11887
  const handleButtonClick = () => {
11712
11888
  var _a;
@@ -11740,12 +11916,12 @@ function FileUpload({
11740
11916
  if (!selectedFile) return;
11741
11917
  const error = validateFile(selectedFile);
11742
11918
  if (error) {
11743
- setErrorMessage(error);
11919
+ setMessage(error);
11744
11920
  setFile(null);
11745
11921
  return;
11746
11922
  }
11747
11923
  setFile(selectedFile);
11748
- setErrorMessage("");
11924
+ setMessage("");
11749
11925
  startUploadSimulation(selectedFile);
11750
11926
  };
11751
11927
  const handleCancelUpload = () => {
@@ -11754,20 +11930,35 @@ function FileUpload({
11754
11930
  }
11755
11931
  setFile(null);
11756
11932
  setUploadProgress(0);
11757
- setErrorMessage("");
11933
+ setMessage("");
11934
+ if (onCancelUpload) onCancelUpload();
11758
11935
  };
11759
- (0, import_react36.useEffect)(() => {
11936
+ (0, import_react38.useEffect)(() => {
11760
11937
  return () => {
11761
11938
  if (uploadIntervalRef.current) {
11762
11939
  clearInterval(uploadIntervalRef.current);
11763
11940
  }
11764
11941
  };
11765
11942
  }, []);
11766
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
11767
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
11768
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: slots.inputWrapper(), children: [
11769
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(input_default, { name, readOnly: true, variant: "outline", full: true, placeholder, defaultValue: file == null ? void 0 : file.name }),
11770
- file && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11943
+ (0, import_react38.useEffect)(() => {
11944
+ setMessage(errorMessage);
11945
+ }, [setMessage, errorMessage]);
11946
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
11947
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
11948
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: slots.inputWrapper(), children: [
11949
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11950
+ input_default,
11951
+ {
11952
+ name,
11953
+ readOnly: true,
11954
+ variant: "outline",
11955
+ full: true,
11956
+ placeholder,
11957
+ defaultValue: file == null ? void 0 : file.name,
11958
+ errorMessage: message
11959
+ }
11960
+ ),
11961
+ file && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11771
11962
  icon_button_default,
11772
11963
  {
11773
11964
  name: "close",
@@ -11779,24 +11970,21 @@ function FileUpload({
11779
11970
  }
11780
11971
  )
11781
11972
  ] }),
11782
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, children: buttonText }),
11783
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
11973
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, children: buttonText }),
11974
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
11784
11975
  ] }),
11785
- showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: slots.progressBarContainer(), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: slots.progressBar(), style: { width: `${uploadProgress}%` } }) }),
11786
- !errorMessage && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: slots.helperMessage(), children: helperMessage }),
11787
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: slots.errorMessage(), children: errorMessage })
11976
+ showProgress && file && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(progress_default, { value: uploadProgress }),
11977
+ !message && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: slots.helperMessage(), children: helperMessage })
11788
11978
  ] });
11789
11979
  }
11790
11980
  FileUpload.displayName = "FileUpload";
11791
11981
  var fileUpload_default = FileUpload;
11792
- var fileUploadStyle = (0, import_tailwind_variants33.tv)({
11982
+ var fileUploadStyle = (0, import_tailwind_variants34.tv)({
11793
11983
  slots: {
11794
11984
  base: ["flex", "flex-col", "gap-[5px]"],
11795
- container: ["flex", "items-center", "gap-[10px]"],
11985
+ container: ["flex", "gap-[10px]"],
11796
11986
  inputWrapper: ["relative", "flex-1"],
11797
11987
  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
11988
  errorMessage: ["text-danger-main", "text-sm"],
11801
11989
  helperMessage: ["text-neutral-main", "text-sm"]
11802
11990
  }
@@ -11804,12 +11992,12 @@ var fileUploadStyle = (0, import_tailwind_variants33.tv)({
11804
11992
 
11805
11993
  // src/components/charts/circularProgress.tsx
11806
11994
  var import_recharts = require("recharts");
11807
- var import_react37 = require("react");
11808
- var import_jsx_runtime40 = require("react/jsx-runtime");
11809
- var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
11995
+ var import_react39 = require("react");
11996
+ var import_jsx_runtime41 = require("react/jsx-runtime");
11997
+ var CircularProgress = (0, import_react39.forwardRef)((originalProps, ref) => {
11810
11998
  const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
11811
11999
  const { label, size = 150, percentage, unit, classNames } = { ...props, ...variantProps };
11812
- const slots = (0, import_react37.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
12000
+ const slots = (0, import_react39.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
11813
12001
  const data = [
11814
12002
  {
11815
12003
  name: label,
@@ -11819,9 +12007,9 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
11819
12007
  const BAR_SIZE = 24;
11820
12008
  const OUTER_RADIUS = 88;
11821
12009
  const INNER_RADIUS = OUTER_RADIUS - BAR_SIZE;
11822
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
11823
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
11824
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
12010
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12011
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", style: { width: size, height: size }, children: [
12012
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
11825
12013
  import_recharts.RadialBarChart,
11826
12014
  {
11827
12015
  width: size,
@@ -11833,7 +12021,7 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
11833
12021
  startAngle: 90,
11834
12022
  endAngle: -270,
11835
12023
  children: [
11836
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
12024
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11837
12025
  "circle",
11838
12026
  {
11839
12027
  cx: size / 2,
@@ -11843,8 +12031,8 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
11843
12031
  fill: "currentColor"
11844
12032
  }
11845
12033
  ),
11846
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_recharts.PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
11847
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
12034
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_recharts.PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
12035
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11848
12036
  import_recharts.RadialBar,
11849
12037
  {
11850
12038
  dataKey: "value",
@@ -11856,12 +12044,12 @@ var CircularProgress = (0, import_react37.forwardRef)((originalProps, ref) => {
11856
12044
  ]
11857
12045
  }
11858
12046
  ),
11859
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: slots.text({ class: classNames == null ? void 0 : classNames.text }), children: [
12047
+ /* @__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
12048
  percentage,
11861
12049
  unit
11862
12050
  ] }) })
11863
12051
  ] }),
11864
- label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
12052
+ label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
11865
12053
  ] });
11866
12054
  });
11867
12055
  CircularProgress.displayName = "CircularProgress";
@@ -11899,26 +12087,26 @@ var circularProgressStyle = tv({
11899
12087
  });
11900
12088
 
11901
12089
  // src/components/charts/areaChart.tsx
11902
- var import_react38 = require("react");
12090
+ var import_react40 = require("react");
11903
12091
  var import_recharts2 = require("recharts");
11904
- var import_jsx_runtime41 = require("react/jsx-runtime");
11905
- var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) => {
11906
- const uniqueId = (0, import_react38.useId)();
12092
+ var import_jsx_runtime42 = require("react/jsx-runtime");
12093
+ var AreaChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12094
+ const uniqueId = (0, import_react40.useId)();
11907
12095
  const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
11908
12096
  const { data, label, color = "primary", classNames } = { ...props, ...variantProps };
11909
- const slots = (0, import_react38.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
12097
+ const slots = (0, import_react40.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
11910
12098
  const COLOR_MAP = {
11911
12099
  primary: "#3F9CF2",
11912
12100
  danger: "#FF4684"
11913
12101
  };
11914
- const colorHex = (0, import_react38.useMemo)(() => COLOR_MAP[color], [color]);
11915
- const [tickPositions, setTickPositions] = (0, import_react38.useState)([]);
11916
- const tickRef = (0, import_react38.useRef)([]);
12102
+ const colorHex = (0, import_react40.useMemo)(() => COLOR_MAP[color], [color]);
12103
+ const [tickPositions, setTickPositions] = (0, import_react40.useState)([]);
12104
+ const tickRef = (0, import_react40.useRef)([]);
11917
12105
  const CustomTick = ({ x, y, payload }) => {
11918
12106
  if (x !== void 0) {
11919
12107
  tickRef.current.push(x);
11920
12108
  }
11921
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12109
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11922
12110
  "text",
11923
12111
  {
11924
12112
  x,
@@ -11932,7 +12120,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
11932
12120
  }
11933
12121
  );
11934
12122
  };
11935
- (0, import_react38.useEffect)(() => {
12123
+ (0, import_react40.useEffect)(() => {
11936
12124
  const raf = requestAnimationFrame(() => {
11937
12125
  const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
11938
12126
  const mids = [];
@@ -11947,19 +12135,19 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
11947
12135
  const CustomDotWithShadow = (props2) => {
11948
12136
  const { cx, cy, fill, stroke } = props2;
11949
12137
  if (cx === void 0 || cy === void 0) return null;
11950
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
11951
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
11952
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
12138
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
12139
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
12140
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
11953
12141
  ] });
11954
12142
  };
11955
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
11956
- label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
11957
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_recharts2.AreaChart, { data, margin: { left: -30 }, children: [
11958
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
11959
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
11960
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
12143
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12144
+ label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
12145
+ /* @__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: [
12146
+ /* @__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: [
12147
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
12148
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
11961
12149
  ] }) }),
11962
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12150
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11963
12151
  import_recharts2.CartesianGrid,
11964
12152
  {
11965
12153
  vertical: true,
@@ -11969,7 +12157,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
11969
12157
  verticalPoints: tickPositions
11970
12158
  }
11971
12159
  ),
11972
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12160
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11973
12161
  import_recharts2.XAxis,
11974
12162
  {
11975
12163
  dataKey: "name",
@@ -11979,7 +12167,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
11979
12167
  padding: { left: 35.5, right: 35.5 }
11980
12168
  }
11981
12169
  ),
11982
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12170
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11983
12171
  import_recharts2.YAxis,
11984
12172
  {
11985
12173
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
@@ -11995,7 +12183,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
11995
12183
  domain: [-6, 110]
11996
12184
  }
11997
12185
  ),
11998
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12186
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11999
12187
  import_recharts2.Area,
12000
12188
  {
12001
12189
  type: "monotone",
@@ -12003,7 +12191,7 @@ var AreaChartComponent = (0, import_react38.forwardRef)((originalProps, ref) =>
12003
12191
  stroke: colorHex,
12004
12192
  strokeWidth: 2,
12005
12193
  fill: `url(#colorGradient-${uniqueId})`,
12006
- dot: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
12194
+ dot: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
12007
12195
  activeDot: { r: 7, fill: colorHex }
12008
12196
  }
12009
12197
  )
@@ -12035,20 +12223,20 @@ var areaChartStyle = tv({
12035
12223
  });
12036
12224
 
12037
12225
  // src/components/charts/barChart.tsx
12038
- var import_react39 = require("react");
12226
+ var import_react41 = require("react");
12039
12227
  var import_recharts3 = require("recharts");
12040
- var import_jsx_runtime42 = require("react/jsx-runtime");
12041
- var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12228
+ var import_jsx_runtime43 = require("react/jsx-runtime");
12229
+ var BarChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
12042
12230
  const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
12043
12231
  const { data, label, classNames } = { ...props, ...variantProps };
12044
- const slots = (0, import_react39.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
12232
+ const slots = (0, import_react41.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
12045
12233
  const COLOR_MAP = {
12046
12234
  primary: "#C7E5FA",
12047
12235
  secondary: "#DEC1FA",
12048
12236
  warning: "#F9C967"
12049
12237
  };
12050
- const [tickPositions, setTickPositions] = (0, import_react39.useState)([]);
12051
- const tickRef = (0, import_react39.useRef)([]);
12238
+ const [tickPositions, setTickPositions] = (0, import_react41.useState)([]);
12239
+ const tickRef = (0, import_react41.useRef)([]);
12052
12240
  const CustomBarShape = (barProps) => {
12053
12241
  const { x, y, width, height, fill } = barProps;
12054
12242
  const radius = 5;
@@ -12056,19 +12244,19 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12056
12244
  const adjustedHeight = height + extraHeight;
12057
12245
  const adjustedY = y;
12058
12246
  const bottomY = adjustedY + adjustedHeight;
12059
- return height ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12247
+ return height ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12060
12248
  "path",
12061
12249
  {
12062
12250
  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
12251
  fill
12064
12252
  }
12065
- ) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("rect", { x, y, width, height: 0, fill });
12253
+ ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("rect", { x, y, width, height: 0, fill });
12066
12254
  };
12067
12255
  const CustomTick = ({ x, y, payload }) => {
12068
12256
  if (x !== void 0) {
12069
12257
  tickRef.current.push(x);
12070
12258
  }
12071
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12259
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12072
12260
  "text",
12073
12261
  {
12074
12262
  x,
@@ -12082,7 +12270,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12082
12270
  }
12083
12271
  );
12084
12272
  };
12085
- (0, import_react39.useEffect)(() => {
12273
+ (0, import_react41.useEffect)(() => {
12086
12274
  const raf = requestAnimationFrame(() => {
12087
12275
  const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
12088
12276
  const mids = [];
@@ -12094,10 +12282,10 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12094
12282
  });
12095
12283
  return () => cancelAnimationFrame(raf);
12096
12284
  }, [data]);
12097
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12098
- label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
12099
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts3.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_recharts3.BarChart, { data, margin: { left: -30 }, barSize: 20, barGap: 10, children: [
12100
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12285
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12286
+ label && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
12287
+ /* @__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: [
12288
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12101
12289
  import_recharts3.CartesianGrid,
12102
12290
  {
12103
12291
  vertical: true,
@@ -12107,7 +12295,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12107
12295
  verticalPoints: tickPositions
12108
12296
  }
12109
12297
  ),
12110
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12298
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12111
12299
  import_recharts3.XAxis,
12112
12300
  {
12113
12301
  dataKey: "name",
@@ -12117,7 +12305,7 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12117
12305
  padding: { left: 32, right: 32 }
12118
12306
  }
12119
12307
  ),
12120
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12308
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12121
12309
  import_recharts3.YAxis,
12122
12310
  {
12123
12311
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
@@ -12133,9 +12321,9 @@ var BarChartComponent = (0, import_react39.forwardRef)((originalProps, ref) => {
12133
12321
  domain: [-6, 110]
12134
12322
  }
12135
12323
  ),
12136
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts3.Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
12137
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts3.Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
12138
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts3.Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
12324
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
12325
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
12326
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
12139
12327
  ] }) })
12140
12328
  ] });
12141
12329
  });
@@ -12151,154 +12339,6 @@ var barChartStyle = tv({
12151
12339
  color: "primary"
12152
12340
  }
12153
12341
  });
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
12342
  // Annotate the CommonJS export names for ESM import in node:
12303
12343
  0 && (module.exports = {
12304
12344
  Accordion,