@optigrit/optigrit-ui 0.0.12 → 0.0.13

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.
@@ -228,7 +228,7 @@ var Input = forwardRef((props, ref) => {
228
228
  style: {
229
229
  "--bg-color": bgColor,
230
230
  "--text-color": textColor,
231
- "--placeholder-color": colorMix(textColor, 80),
231
+ "--placeholder-color": colorMix("var(--text-secondary, gray)", 80),
232
232
  "--border-color": colorMix(borderColor, 10),
233
233
  "--border-color-hover": colorMix(primaryColor, 40),
234
234
  "--light-primary-color": colorMix(primaryColor, 50),
@@ -251,6 +251,14 @@ type DrawerFooterProps = {
251
251
  };
252
252
  declare function DrawerFooter({ children, className, style }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
253
253
 
254
+ type AlertType = 'success' | 'error' | 'warning' | 'info';
255
+ type AlertOptions = {
256
+ content?: React__default.ReactNode;
257
+ duration?: number;
258
+ };
259
+
260
+ declare const handleAlert: (title: React__default.ReactNode, type?: AlertType, options?: AlertOptions) => void;
261
+
254
262
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
255
263
  }
256
264
  declare const Card: React__default.ForwardRefExoticComponent<CardProps & React__default.RefAttributes<HTMLDivElement>>;
@@ -273,4 +281,4 @@ interface CardFooterProps extends React__default.HTMLAttributes<HTMLDivElement>
273
281
  }
274
282
  declare const CardFooter: React__default.ForwardRefExoticComponent<CardFooterProps & React__default.RefAttributes<HTMLDivElement>>;
275
283
 
276
- export { Button, type ButtonColor, type ButtonProps, type ButtonRoundness, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Carousel, type CarouselItem, type CarouselProps, type Column, DataTable, type DataTableProps, Dialog, DialogContent, DialogFooter, DialogHeader, type DialogProps, Drawer, DrawerContent, DrawerFooter, DrawerHeader, type DrawerProps, IconButton, type IconButtonProps, InputField, type InputFieldProps, MultiSelect, type MultiSelectProps, SearchBar, type SearchBarProps, Select, type SelectProps, Separator, type SeparatorProps, TabList, type TabListProps, TabPanel, type TabPanelProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TablePaginationConfig, type TableProps, TableRow, type TableRowProps, Tooltip, type TooltipProps };
284
+ export { Button, type ButtonColor, type ButtonProps, type ButtonRoundness, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Carousel, type CarouselItem, type CarouselProps, type Column, DataTable, type DataTableProps, Dialog, DialogContent, DialogFooter, DialogHeader, type DialogProps, Drawer, DrawerContent, DrawerFooter, DrawerHeader, type DrawerProps, IconButton, type IconButtonProps, InputField, type InputFieldProps, MultiSelect, type MultiSelectProps, SearchBar, type SearchBarProps, Select, type SelectProps, Separator, type SeparatorProps, TabList, type TabListProps, TabPanel, type TabPanelProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TablePaginationConfig, type TableProps, TableRow, type TableRowProps, Tooltip, type TooltipProps, handleAlert };
@@ -6,7 +6,7 @@ import {
6
6
  ShowWithAnimation,
7
7
  Spinner,
8
8
  cn
9
- } from "../chunk-CGY2R33R.js";
9
+ } from "../chunk-OPUJUU32.js";
10
10
  import "../chunk-MCQS3QNN.js";
11
11
  import {
12
12
  useKeyboardShortcuts
@@ -336,7 +336,16 @@ function InputField(props) {
336
336
  }, [props.value]);
337
337
  return /* @__PURE__ */ jsxs4("div", { ...containerProps, children: [
338
338
  /* @__PURE__ */ jsxs4("label", { children: [
339
- /* @__PURE__ */ jsx4(Show, { when: labelBehavior === "fixed", children: /* @__PURE__ */ jsx4("span", { className: "text-[10px] text-text-secondary/60 uppercase font-medium", children: props.label }) }),
339
+ /* @__PURE__ */ jsx4(Show, { when: labelBehavior === "fixed", children: /* @__PURE__ */ jsx4(
340
+ "span",
341
+ {
342
+ className: cn(
343
+ "text-[10px] uppercase font-medium",
344
+ error ? "text-error" : "text-text-secondary/60"
345
+ ),
346
+ children: props.label
347
+ }
348
+ ) }),
340
349
  /* @__PURE__ */ jsx4(
341
350
  Input,
342
351
  {
@@ -345,6 +354,11 @@ function InputField(props) {
345
354
  textColor: error ? errorColor : inputProps.textColor,
346
355
  borderColor: error ? errorColor : inputProps.borderColor,
347
356
  primaryColor: error ? errorColor : inputProps.primaryColor,
357
+ inputContainerProps: {
358
+ style: error ? {
359
+ "--border-color": "var(--error)"
360
+ } : void 0
361
+ },
348
362
  onChange: handleOnChange,
349
363
  onFocus: handleOnFocus,
350
364
  onBlur: handleOnBlur
@@ -461,7 +475,7 @@ function Select(props) {
461
475
  "div",
462
476
  {
463
477
  ref: optionsContainer,
464
- className: "w-full max-h-[200px] overflow-y-scroll scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden bg-bg-secondary shadow-md border-2 border-border text-text p-1 rounded-md flex flex-col gap-1",
478
+ className: "w-full max-h-[200px] overflow-y-scroll scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden bg-bg-secondary shadow-md border-2 border-border/10 text-text p-1 rounded-xl flex flex-col gap-1",
465
479
  onMouseDown: (event) => {
466
480
  event.preventDefault();
467
481
  },
@@ -471,7 +485,7 @@ function Select(props) {
471
485
  id: option.value,
472
486
  onClick: () => handleOnChange(option),
473
487
  className: cn(
474
- "p-2 hover:bg-bg rounded cursor-pointer w-full",
488
+ "p-2 hover:bg-bg rounded-lg cursor-pointer w-full",
475
489
  activeOption === option.value ? "border-2 border-primary" : "",
476
490
  option.value === props.value ? "bg-bg" : ""
477
491
  ),
@@ -602,7 +616,7 @@ function MultiSelect(props) {
602
616
  "div",
603
617
  {
604
618
  ref: optionsContainer,
605
- className: "w-full max-h-[200px] overflow-y-scroll scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden bg-bg-secondary p-1 rounded-md flex flex-col gap-1 border-border border-2",
619
+ className: "w-full max-h-[200px] overflow-y-scroll scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden bg-bg-secondary shadow-md p-1 rounded-xl flex flex-col gap-1 border-border/10 border-2",
606
620
  onMouseDown: (event) => {
607
621
  event.preventDefault();
608
622
  },
@@ -612,7 +626,7 @@ function MultiSelect(props) {
612
626
  id: option.value,
613
627
  onClick: () => handleOnChange(option),
614
628
  className: cn(
615
- "p-2 hover:bg-bg rounded cursor-pointer w-full",
629
+ "p-2 hover:bg-bg rounded-lg cursor-pointer w-full",
616
630
  activeOption === option.value ? "border-2 border-primary" : "",
617
631
  props.value?.includes(option.value) ? "bg-bg" : ""
618
632
  ),
@@ -674,8 +688,50 @@ var CrossIcon = (props) => /* @__PURE__ */ jsxs8(
674
688
  }
675
689
  );
676
690
 
691
+ // src/shared/Icons/SuccessIcon.tsx
692
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
693
+ var SuccessIcon = (props) => /* @__PURE__ */ jsxs9("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
694
+ /* @__PURE__ */ jsx9("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
695
+ /* @__PURE__ */ jsx9("polyline", { points: "22 4 12 14.01 9 11.01" })
696
+ ] });
697
+
698
+ // src/shared/Icons/ErrorIcon.tsx
699
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
700
+ var ErrorIcon = (props) => /* @__PURE__ */ jsxs10("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
701
+ /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "10" }),
702
+ /* @__PURE__ */ jsx10("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
703
+ /* @__PURE__ */ jsx10("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
704
+ ] });
705
+
706
+ // src/shared/Icons/WarningIcon.tsx
707
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
708
+ var WarningIcon = (props) => /* @__PURE__ */ jsxs11("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
709
+ /* @__PURE__ */ jsx11("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
710
+ /* @__PURE__ */ jsx11("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
711
+ /* @__PURE__ */ jsx11("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
712
+ ] });
713
+
714
+ // src/shared/Icons/InfoIcon.tsx
715
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
716
+ var InfoIcon = (props) => /* @__PURE__ */ jsxs12("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
717
+ /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "10" }),
718
+ /* @__PURE__ */ jsx12("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
719
+ /* @__PURE__ */ jsx12("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
720
+ ] });
721
+
722
+ // src/shared/Icons/CloseIcon.tsx
723
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
724
+ var CloseIcon = (props) => /* @__PURE__ */ jsxs13("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: [
725
+ /* @__PURE__ */ jsx13("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
726
+ /* @__PURE__ */ jsx13("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
727
+ ] });
728
+
729
+ // src/shared/Icons/ChevronDownIcon.tsx
730
+ import { jsx as jsx14 } from "react/jsx-runtime";
731
+ var ChevronDownIcon = (props) => /* @__PURE__ */ jsx14("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx14("path", { d: "M19 9l-7 7-7-7" }) });
732
+
677
733
  // src/components/Forms/SearchBar/SearchBar.tsx
678
- import { jsx as jsx9 } from "react/jsx-runtime";
734
+ import { jsx as jsx15 } from "react/jsx-runtime";
679
735
  var SearchBar = React.forwardRef(
680
736
  ({
681
737
  value,
@@ -747,26 +803,26 @@ var SearchBar = React.forwardRef(
747
803
  handleClear();
748
804
  }
749
805
  };
750
- const defaultSearchIcon = /* @__PURE__ */ jsx9(SearchIcon, { className: "text-gray-400 ml-2" });
806
+ const defaultSearchIcon = /* @__PURE__ */ jsx15(SearchIcon, { className: "text-gray-400 ml-2" });
751
807
  const renderEndIcon = () => {
752
808
  if (loading) {
753
- return /* @__PURE__ */ jsx9("div", { className: "flex items-center justify-center pr-3", children: /* @__PURE__ */ jsx9(Spinner, { size: 16, color: "primary" }) });
809
+ return /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center pr-3", children: /* @__PURE__ */ jsx15(Spinner, { size: 16, color: "primary" }) });
754
810
  }
755
811
  if (currentValue) {
756
- return /* @__PURE__ */ jsx9(
812
+ return /* @__PURE__ */ jsx15(
757
813
  "button",
758
814
  {
759
815
  type: "button",
760
816
  onClick: handleClear,
761
817
  className: "flex items-center justify-center p-1 mr-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer focus:outline-none focus:ring-1 focus:ring-gray-300",
762
818
  "aria-label": "Clear search",
763
- children: /* @__PURE__ */ jsx9(CrossIcon, {})
819
+ children: /* @__PURE__ */ jsx15(CrossIcon, {})
764
820
  }
765
821
  );
766
822
  }
767
823
  return endIcon;
768
824
  };
769
- return /* @__PURE__ */ jsx9(
825
+ return /* @__PURE__ */ jsx15(
770
826
  Input,
771
827
  {
772
828
  ref,
@@ -784,7 +840,7 @@ SearchBar.displayName = "SearchBar";
784
840
 
785
841
  // src/components/Navigation/Tab/TabList/index.tsx
786
842
  import { useEffect as useEffect2, useRef as useRef8 } from "react";
787
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
843
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
788
844
  function TabList(props) {
789
845
  const {
790
846
  tabs,
@@ -813,14 +869,14 @@ function TabList(props) {
813
869
  tabsContainer.current?.removeEventListener("scroll", handleValueChange);
814
870
  };
815
871
  }, [activeTabValue]);
816
- return /* @__PURE__ */ jsxs9(
872
+ return /* @__PURE__ */ jsxs14(
817
873
  "div",
818
874
  {
819
875
  ...rest,
820
876
  className: cn("bg-bg-secondary w-full p-1 rounded-xl relative", rest.className),
821
877
  children: [
822
- /* @__PURE__ */ jsx10("div", { ref: activeIndicator, className: "absolute rounded-lg bg-primary transition-all duration-200" }),
823
- /* @__PURE__ */ jsx10("div", { ref: tabsContainer, className: "flex items-center gap-1 w-full overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx10(
878
+ /* @__PURE__ */ jsx16("div", { ref: activeIndicator, className: "absolute rounded-lg bg-primary transition-all duration-200" }),
879
+ /* @__PURE__ */ jsx16("div", { ref: tabsContainer, className: "flex items-center gap-1 w-full overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx16(
824
880
  "div",
825
881
  {
826
882
  id: tab.value,
@@ -840,7 +896,7 @@ function TabList(props) {
840
896
 
841
897
  // src/components/Navigation/Tab/TabPanel/RenderPanel.tsx
842
898
  import { memo } from "react";
843
- import { jsx as jsx11 } from "react/jsx-runtime";
899
+ import { jsx as jsx17 } from "react/jsx-runtime";
844
900
  var RenderPanel = memo((props) => {
845
901
  const {
846
902
  activePanelValue,
@@ -849,14 +905,14 @@ var RenderPanel = memo((props) => {
849
905
  panelRemoveOnHide
850
906
  } = props;
851
907
  if (panels.length === 0) return null;
852
- return /* @__PURE__ */ jsx11(
908
+ return /* @__PURE__ */ jsx17(
853
909
  ShowWithAnimation,
854
910
  {
855
911
  when: panels[0].value === activePanelValue,
856
912
  containerProps: { className: "w-full h-full" },
857
913
  className: "w-full h-full",
858
914
  removeOnHide: panelRemoveOnHide,
859
- otherwise: /* @__PURE__ */ jsx11(RenderPanel, { ...props, panels: panels.slice(1) }),
915
+ otherwise: /* @__PURE__ */ jsx17(RenderPanel, { ...props, panels: panels.slice(1) }),
860
916
  animationStyle: animationStyle ?? {
861
917
  children: {
862
918
  from: { scale: 0.9, opacity: 0 },
@@ -870,7 +926,7 @@ var RenderPanel = memo((props) => {
870
926
  });
871
927
 
872
928
  // src/components/Navigation/Tab/TabPanel/index.tsx
873
- import { jsx as jsx12 } from "react/jsx-runtime";
929
+ import { jsx as jsx18 } from "react/jsx-runtime";
874
930
  function TabPanel(props) {
875
931
  const {
876
932
  activePanelValue,
@@ -879,7 +935,7 @@ function TabPanel(props) {
879
935
  panelRemoveOnHide,
880
936
  ...rest
881
937
  } = props;
882
- return /* @__PURE__ */ jsx12("div", { ...rest, children: /* @__PURE__ */ jsx12(
938
+ return /* @__PURE__ */ jsx18("div", { ...rest, children: /* @__PURE__ */ jsx18(
883
939
  RenderPanel,
884
940
  {
885
941
  activePanelValue,
@@ -901,17 +957,17 @@ var TableContext = createContext({
901
957
  var useTableContext = () => useContext(TableContext);
902
958
 
903
959
  // src/components/DataDisplay/Table/Table.tsx
904
- import { jsx as jsx13 } from "react/jsx-runtime";
960
+ import { jsx as jsx19 } from "react/jsx-runtime";
905
961
  var Table = forwardRef3(
906
962
  ({ className = "", children, stickyHeader = false, loading = false, ...props }, ref) => {
907
963
  const value = useMemo(() => ({ stickyHeader }), [stickyHeader]);
908
- return /* @__PURE__ */ jsx13(TableContext.Provider, { value, children: /* @__PURE__ */ jsx13(
964
+ return /* @__PURE__ */ jsx19(TableContext.Provider, { value, children: /* @__PURE__ */ jsx19(
909
965
  "table",
910
966
  {
911
967
  ref,
912
968
  className: `w-full caption-bottom text-sm border-collapse ${stickyHeader ? "relative" : ""} ${className}`,
913
969
  ...props,
914
- children: loading ? /* @__PURE__ */ jsx13("tbody", { className: "h-48", children: /* @__PURE__ */ jsx13("tr", { children: /* @__PURE__ */ jsx13("td", { colSpan: 100, className: "text-center align-middle h-full", children: /* @__PURE__ */ jsx13("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ jsx13(Spinner, { size: 32 }) }) }) }) }) : children
970
+ children: loading ? /* @__PURE__ */ jsx19("tbody", { className: "h-48", children: /* @__PURE__ */ jsx19("tr", { children: /* @__PURE__ */ jsx19("td", { colSpan: 100, className: "text-center align-middle h-full", children: /* @__PURE__ */ jsx19("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ jsx19(Spinner, { size: 32 }) }) }) }) }) : children
915
971
  }
916
972
  ) });
917
973
  }
@@ -921,10 +977,10 @@ var Table_default = Table;
921
977
 
922
978
  // src/components/DataDisplay/Table/TableContainer.tsx
923
979
  import { forwardRef as forwardRef4 } from "react";
924
- import { jsx as jsx14 } from "react/jsx-runtime";
980
+ import { jsx as jsx20 } from "react/jsx-runtime";
925
981
  var TableContainer = forwardRef4(
926
982
  ({ className = "", children, ...props }, ref) => {
927
- return /* @__PURE__ */ jsx14(
983
+ return /* @__PURE__ */ jsx20(
928
984
  "div",
929
985
  {
930
986
  ref,
@@ -940,10 +996,10 @@ var TableContainer_default = TableContainer;
940
996
 
941
997
  // src/components/DataDisplay/Table/TableHead.tsx
942
998
  import { forwardRef as forwardRef5 } from "react";
943
- import { jsx as jsx15 } from "react/jsx-runtime";
999
+ import { jsx as jsx21 } from "react/jsx-runtime";
944
1000
  var TableHead = forwardRef5(
945
1001
  ({ className = "", children, ...props }, ref) => {
946
- return /* @__PURE__ */ jsx15(
1002
+ return /* @__PURE__ */ jsx21(
947
1003
  "thead",
948
1004
  {
949
1005
  ref,
@@ -959,10 +1015,10 @@ var TableHead_default = TableHead;
959
1015
 
960
1016
  // src/components/DataDisplay/Table/TableBody.tsx
961
1017
  import { forwardRef as forwardRef6 } from "react";
962
- import { jsx as jsx16 } from "react/jsx-runtime";
1018
+ import { jsx as jsx22 } from "react/jsx-runtime";
963
1019
  var TableBody = forwardRef6(
964
1020
  ({ className = "", children, ...props }, ref) => {
965
- return /* @__PURE__ */ jsx16(
1021
+ return /* @__PURE__ */ jsx22(
966
1022
  "tbody",
967
1023
  {
968
1024
  ref,
@@ -978,10 +1034,10 @@ var TableBody_default = TableBody;
978
1034
 
979
1035
  // src/components/DataDisplay/Table/TableRow.tsx
980
1036
  import { forwardRef as forwardRef7 } from "react";
981
- import { jsx as jsx17 } from "react/jsx-runtime";
1037
+ import { jsx as jsx23 } from "react/jsx-runtime";
982
1038
  var TableRow = forwardRef7(
983
1039
  ({ className = "", children, hover = false, selected = false, ...props }, ref) => {
984
- return /* @__PURE__ */ jsx17(
1040
+ return /* @__PURE__ */ jsx23(
985
1041
  "tr",
986
1042
  {
987
1043
  ref,
@@ -997,7 +1053,7 @@ var TableRow_default = TableRow;
997
1053
 
998
1054
  // src/components/DataDisplay/Table/TableCell.tsx
999
1055
  import { forwardRef as forwardRef8 } from "react";
1000
- import { jsx as jsx18 } from "react/jsx-runtime";
1056
+ import { jsx as jsx24 } from "react/jsx-runtime";
1001
1057
  var TableCell = forwardRef8(
1002
1058
  ({ className = "", align = "left", variant, component, children, ...props }, ref) => {
1003
1059
  const { stickyHeader } = useTableContext();
@@ -1010,7 +1066,7 @@ var TableCell = forwardRef8(
1010
1066
  justify: "text-justify",
1011
1067
  inherit: "text-inherit"
1012
1068
  };
1013
- return /* @__PURE__ */ jsx18(
1069
+ return /* @__PURE__ */ jsx24(
1014
1070
  Component,
1015
1071
  {
1016
1072
  ref,
@@ -1025,17 +1081,17 @@ TableCell.displayName = "TableCell";
1025
1081
  var TableCell_default = TableCell;
1026
1082
 
1027
1083
  // src/components/DataDisplay/Table/DataTable.tsx
1028
- import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1084
+ import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
1029
1085
  function DataTable({
1030
1086
  data,
1031
1087
  columns,
1032
1088
  loading,
1033
1089
  pagination
1034
1090
  }) {
1035
- return /* @__PURE__ */ jsxs10(TableContainer_default, { children: [
1036
- /* @__PURE__ */ jsxs10(Table_default, { loading, children: [
1037
- /* @__PURE__ */ jsx19(TableHead_default, { children: /* @__PURE__ */ jsx19(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx19(TableCell_default, { variant: "head", children: col.title }, col.key)) }) }),
1038
- /* @__PURE__ */ jsx19(TableBody_default, { children: data.map((row) => /* @__PURE__ */ jsx19(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx19(TableCell_default, { children: col.render ? col.render(row) : row[col.key] }, col.key)) }, row.id)) })
1091
+ return /* @__PURE__ */ jsxs15(TableContainer_default, { children: [
1092
+ /* @__PURE__ */ jsxs15(Table_default, { loading, children: [
1093
+ /* @__PURE__ */ jsx25(TableHead_default, { children: /* @__PURE__ */ jsx25(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx25(TableCell_default, { variant: "head", children: col.title }, col.key)) }) }),
1094
+ /* @__PURE__ */ jsx25(TableBody_default, { children: data.map((row) => /* @__PURE__ */ jsx25(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx25(TableCell_default, { children: col.render ? col.render(row) : row[col.key] }, col.key)) }, row.id)) })
1039
1095
  ] }),
1040
1096
  pagination && (() => {
1041
1097
  const getVisiblePages = (current, total) => {
@@ -1045,8 +1101,8 @@ function DataTable({
1045
1101
  return [1, "...", current - 1, current, current + 1, "...", total];
1046
1102
  };
1047
1103
  const visiblePages = getVisiblePages(pagination.page, pagination.totalPages);
1048
- return /* @__PURE__ */ jsx19("div", { className: "flex justify-end items-center px-3 py-2 border-t bg-transparent text-sm text-text-secondary", children: /* @__PURE__ */ jsxs10("div", { className: "flex justify-end gap-2 items-center", children: [
1049
- /* @__PURE__ */ jsx19(
1104
+ return /* @__PURE__ */ jsx25("div", { className: "flex justify-end items-center px-3 py-2 border-t bg-transparent text-sm text-text-secondary", children: /* @__PURE__ */ jsxs15("div", { className: "flex justify-end gap-2 items-center", children: [
1105
+ /* @__PURE__ */ jsx25(
1050
1106
  Button_default,
1051
1107
  {
1052
1108
  variant: "outlined",
@@ -1057,7 +1113,7 @@ function DataTable({
1057
1113
  children: "Previous"
1058
1114
  }
1059
1115
  ),
1060
- visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */ jsx19("span", { className: "px-2", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx19(
1116
+ visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */ jsx25("span", { className: "px-2", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx25(
1061
1117
  Button_default,
1062
1118
  {
1063
1119
  variant: p === pagination.page ? "soft" : "outlined",
@@ -1070,7 +1126,7 @@ function DataTable({
1070
1126
  },
1071
1127
  p
1072
1128
  )),
1073
- /* @__PURE__ */ jsx19(
1129
+ /* @__PURE__ */ jsx25(
1074
1130
  Button_default,
1075
1131
  {
1076
1132
  variant: "outlined",
@@ -1089,10 +1145,10 @@ var DataTable_default = DataTable;
1089
1145
 
1090
1146
  // src/components/DataDisplay/Table/TableFooter.tsx
1091
1147
  import { forwardRef as forwardRef9 } from "react";
1092
- import { jsx as jsx20 } from "react/jsx-runtime";
1148
+ import { jsx as jsx26 } from "react/jsx-runtime";
1093
1149
  var TableFooter = forwardRef9(
1094
1150
  ({ className = "", children, ...props }, ref) => {
1095
- return /* @__PURE__ */ jsx20(
1151
+ return /* @__PURE__ */ jsx26(
1096
1152
  "tfoot",
1097
1153
  {
1098
1154
  ref,
@@ -1108,7 +1164,7 @@ var TableFooter_default = TableFooter;
1108
1164
 
1109
1165
  // src/components/DataDisplay/Carousel/Carousel.tsx
1110
1166
  import { useState as useState6, useEffect as useEffect3, useCallback as useCallback3, forwardRef as forwardRef10 } from "react";
1111
- import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
1167
+ import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
1112
1168
  var Carousel = forwardRef10(
1113
1169
  ({
1114
1170
  items,
@@ -1139,7 +1195,7 @@ var Carousel = forwardRef10(
1139
1195
  if (!items || items.length === 0) {
1140
1196
  return null;
1141
1197
  }
1142
- return /* @__PURE__ */ jsxs11(
1198
+ return /* @__PURE__ */ jsxs16(
1143
1199
  "div",
1144
1200
  {
1145
1201
  ref,
@@ -1149,13 +1205,13 @@ var Carousel = forwardRef10(
1149
1205
  onMouseLeave: () => setIsHovered(false),
1150
1206
  ...props,
1151
1207
  children: [
1152
- /* @__PURE__ */ jsx21(
1208
+ /* @__PURE__ */ jsx27(
1153
1209
  "div",
1154
1210
  {
1155
1211
  className: "flex transition-transform duration-500 ease-in-out h-full w-full flex-1",
1156
1212
  style: { transform: `translateX(-${currentIndex * 100}%)` },
1157
- children: items.map((item) => /* @__PURE__ */ jsxs11("div", { className: "w-full h-full relative shrink-0", style: { flex: "0 0 100%" }, children: [
1158
- /* @__PURE__ */ jsx21(
1213
+ children: items.map((item) => /* @__PURE__ */ jsxs16("div", { className: "w-full h-full relative shrink-0", style: { flex: "0 0 100%" }, children: [
1214
+ /* @__PURE__ */ jsx27(
1159
1215
  "img",
1160
1216
  {
1161
1217
  src: item.imageUrl,
@@ -1163,15 +1219,15 @@ var Carousel = forwardRef10(
1163
1219
  className: "w-full h-full object-cover"
1164
1220
  }
1165
1221
  ),
1166
- (item.title || item.description) && /* @__PURE__ */ jsxs11("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent flex flex-col justify-end p-6 md:p-8", children: [
1167
- item.title && /* @__PURE__ */ jsx21("h3", { className: "text-white text-xl md:text-3xl font-semibold mb-2 transform transition-all duration-500 translate-y-0 opacity-100", children: item.title }),
1168
- item.description && /* @__PURE__ */ jsx21("p", { className: "text-white/80 text-sm md:text-base max-w-2xl transform transition-all duration-500 delay-100 translate-y-0 opacity-100", children: item.description })
1222
+ (item.title || item.description) && /* @__PURE__ */ jsxs16("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent flex flex-col justify-end p-6 md:p-8", children: [
1223
+ item.title && /* @__PURE__ */ jsx27("h3", { className: "text-white text-xl md:text-3xl font-semibold mb-2 transform transition-all duration-500 translate-y-0 opacity-100", children: item.title }),
1224
+ item.description && /* @__PURE__ */ jsx27("p", { className: "text-white/80 text-sm md:text-base max-w-2xl transform transition-all duration-500 delay-100 translate-y-0 opacity-100", children: item.description })
1169
1225
  ] })
1170
1226
  ] }, item.id))
1171
1227
  }
1172
1228
  ),
1173
- showArrows && items.length > 1 && /* @__PURE__ */ jsxs11(Fragment4, { children: [
1174
- /* @__PURE__ */ jsx21(
1229
+ showArrows && items.length > 1 && /* @__PURE__ */ jsxs16(Fragment4, { children: [
1230
+ /* @__PURE__ */ jsx27(
1175
1231
  IconButton_default,
1176
1232
  {
1177
1233
  onClick: goToPrevious,
@@ -1179,7 +1235,7 @@ var Carousel = forwardRef10(
1179
1235
  color: "secondary",
1180
1236
  className: "absolute left-4 top-1/2 -translate-y-1/2 !bg-black/30 hover:!bg-black/50 text-white backdrop-blur-sm transition-all opacity-0 group-hover:opacity-100 disabled:opacity-0 z-10",
1181
1237
  "aria-label": "Previous slide",
1182
- children: /* @__PURE__ */ jsx21(
1238
+ children: /* @__PURE__ */ jsx27(
1183
1239
  "svg",
1184
1240
  {
1185
1241
  xmlns: "http://www.w3.org/2000/svg",
@@ -1188,12 +1244,12 @@ var Carousel = forwardRef10(
1188
1244
  strokeWidth: 2,
1189
1245
  stroke: "currentColor",
1190
1246
  className: "w-5 h-5",
1191
- children: /* @__PURE__ */ jsx21("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" })
1247
+ children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" })
1192
1248
  }
1193
1249
  )
1194
1250
  }
1195
1251
  ),
1196
- /* @__PURE__ */ jsx21(
1252
+ /* @__PURE__ */ jsx27(
1197
1253
  IconButton_default,
1198
1254
  {
1199
1255
  onClick: goToNext,
@@ -1201,7 +1257,7 @@ var Carousel = forwardRef10(
1201
1257
  color: "secondary",
1202
1258
  className: "absolute right-4 top-1/2 -translate-y-1/2 !bg-black/30 hover:!bg-black/50 text-white backdrop-blur-sm transition-all opacity-0 group-hover:opacity-100 disabled:opacity-0 z-10",
1203
1259
  "aria-label": "Next slide",
1204
- children: /* @__PURE__ */ jsx21(
1260
+ children: /* @__PURE__ */ jsx27(
1205
1261
  "svg",
1206
1262
  {
1207
1263
  xmlns: "http://www.w3.org/2000/svg",
@@ -1210,13 +1266,13 @@ var Carousel = forwardRef10(
1210
1266
  strokeWidth: 2,
1211
1267
  stroke: "currentColor",
1212
1268
  className: "w-5 h-5",
1213
- children: /* @__PURE__ */ jsx21("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" })
1269
+ children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" })
1214
1270
  }
1215
1271
  )
1216
1272
  }
1217
1273
  )
1218
1274
  ] }),
1219
- showIndicators && items.length > 1 && /* @__PURE__ */ jsx21("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2 z-20", children: items.map((_, index) => /* @__PURE__ */ jsx21(
1275
+ showIndicators && items.length > 1 && /* @__PURE__ */ jsx27("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2 z-20", children: items.map((_, index) => /* @__PURE__ */ jsx27(
1220
1276
  "button",
1221
1277
  {
1222
1278
  onClick: () => goToIndex(index),
@@ -1237,10 +1293,10 @@ Carousel.displayName = "Carousel";
1237
1293
 
1238
1294
  // src/components/DataDisplay/Separator/Separator.tsx
1239
1295
  import React3 from "react";
1240
- import { jsx as jsx22 } from "react/jsx-runtime";
1296
+ import { jsx as jsx28 } from "react/jsx-runtime";
1241
1297
  var Separator = React3.forwardRef(
1242
1298
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
1243
- return /* @__PURE__ */ jsx22(
1299
+ return /* @__PURE__ */ jsx28(
1244
1300
  "div",
1245
1301
  {
1246
1302
  ref,
@@ -1260,7 +1316,7 @@ Separator.displayName = "Separator";
1260
1316
 
1261
1317
  // src/components/Overlay/Dialog/Dialog.tsx
1262
1318
  import { createPortal } from "react-dom";
1263
- import { jsx as jsx23 } from "react/jsx-runtime";
1319
+ import { jsx as jsx29 } from "react/jsx-runtime";
1264
1320
  function Dialog(props) {
1265
1321
  const {
1266
1322
  open,
@@ -1292,7 +1348,7 @@ function Dialog(props) {
1292
1348
  ]);
1293
1349
  if (typeof window === "undefined") return null;
1294
1350
  return createPortal(
1295
- /* @__PURE__ */ jsx23(
1351
+ /* @__PURE__ */ jsx29(
1296
1352
  ShowWithAnimation,
1297
1353
  {
1298
1354
  when: open,
@@ -1320,7 +1376,7 @@ function Dialog(props) {
1320
1376
  onClose?.();
1321
1377
  }
1322
1378
  },
1323
- children: /* @__PURE__ */ jsx23(
1379
+ children: /* @__PURE__ */ jsx29(
1324
1380
  ShowWithAnimation,
1325
1381
  {
1326
1382
  when: open,
@@ -1345,19 +1401,19 @@ function Dialog(props) {
1345
1401
  }
1346
1402
 
1347
1403
  // src/components/Overlay/Dialog/DialogHeader.tsx
1348
- import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
1404
+ import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
1349
1405
  function DialogHeader(props) {
1350
1406
  const { title, children, ...rest } = props;
1351
- return /* @__PURE__ */ jsxs12("div", { ...rest, className: cn("p-4 sticky top-0 z-[20] backdrop-blur-sm", props.className), children: [
1352
- /* @__PURE__ */ jsx24(Show, { when: !!title, children: /* @__PURE__ */ jsx24("h1", { className: "text-lg font-bold", children: title }) }),
1407
+ return /* @__PURE__ */ jsxs17("div", { ...rest, className: cn("p-4 sticky top-0 z-[20] backdrop-blur-sm", props.className), children: [
1408
+ /* @__PURE__ */ jsx30(Show, { when: !!title, children: /* @__PURE__ */ jsx30("h1", { className: "text-lg font-bold", children: title }) }),
1353
1409
  children
1354
1410
  ] });
1355
1411
  }
1356
1412
 
1357
1413
  // src/components/Overlay/Dialog/DialogFooter.tsx
1358
- import { jsx as jsx25 } from "react/jsx-runtime";
1414
+ import { jsx as jsx31 } from "react/jsx-runtime";
1359
1415
  function DialogFooter(props) {
1360
- return /* @__PURE__ */ jsx25(
1416
+ return /* @__PURE__ */ jsx31(
1361
1417
  "div",
1362
1418
  {
1363
1419
  ...props,
@@ -1367,9 +1423,9 @@ function DialogFooter(props) {
1367
1423
  }
1368
1424
 
1369
1425
  // src/components/Overlay/Dialog/DialogContent.tsx
1370
- import { jsx as jsx26 } from "react/jsx-runtime";
1426
+ import { jsx as jsx32 } from "react/jsx-runtime";
1371
1427
  function DialogContent(props) {
1372
- return /* @__PURE__ */ jsx26(
1428
+ return /* @__PURE__ */ jsx32(
1373
1429
  "div",
1374
1430
  {
1375
1431
  ...props,
@@ -1380,7 +1436,7 @@ function DialogContent(props) {
1380
1436
 
1381
1437
  // src/components/Overlay/Drawer/Drawer.tsx
1382
1438
  import { createPortal as createPortal2 } from "react-dom";
1383
- import { jsx as jsx27 } from "react/jsx-runtime";
1439
+ import { jsx as jsx33 } from "react/jsx-runtime";
1384
1440
  function Drawer(props) {
1385
1441
  const {
1386
1442
  open,
@@ -1415,7 +1471,7 @@ function Drawer(props) {
1415
1471
  }[_size] + (isHorizontal ? "vw" : "vh");
1416
1472
  })();
1417
1473
  return createPortal2(
1418
- /* @__PURE__ */ jsx27(
1474
+ /* @__PURE__ */ jsx33(
1419
1475
  ShowWithAnimation,
1420
1476
  {
1421
1477
  when: open,
@@ -1445,7 +1501,7 @@ function Drawer(props) {
1445
1501
  onClose?.();
1446
1502
  }
1447
1503
  },
1448
- children: /* @__PURE__ */ jsx27(
1504
+ children: /* @__PURE__ */ jsx33(
1449
1505
  ShowWithAnimation,
1450
1506
  {
1451
1507
  when: open,
@@ -1492,9 +1548,9 @@ function Drawer(props) {
1492
1548
  }
1493
1549
 
1494
1550
  // src/components/Overlay/Drawer/DrawerContent.tsx
1495
- import { jsx as jsx28 } from "react/jsx-runtime";
1551
+ import { jsx as jsx34 } from "react/jsx-runtime";
1496
1552
  function DrawerContent({ children, className, style }) {
1497
- return /* @__PURE__ */ jsx28(
1553
+ return /* @__PURE__ */ jsx34(
1498
1554
  "div",
1499
1555
  {
1500
1556
  className: cn("overflow-auto flex-1 p-4 relative hide-scrollbar", className),
@@ -1505,9 +1561,9 @@ function DrawerContent({ children, className, style }) {
1505
1561
  }
1506
1562
 
1507
1563
  // src/components/Overlay/Drawer/DrawerHeader.tsx
1508
- import { jsx as jsx29 } from "react/jsx-runtime";
1564
+ import { jsx as jsx35 } from "react/jsx-runtime";
1509
1565
  function DrawerHeader({ children, className, style }) {
1510
- return /* @__PURE__ */ jsx29(
1566
+ return /* @__PURE__ */ jsx35(
1511
1567
  "div",
1512
1568
  {
1513
1569
  className: cn("sticky top-0 z-20 backdrop-blur-sm bg-white/60 px-4 py-3 border-b border-border", className),
@@ -1518,9 +1574,9 @@ function DrawerHeader({ children, className, style }) {
1518
1574
  }
1519
1575
 
1520
1576
  // src/components/Overlay/Drawer/DrawerFooter.tsx
1521
- import { jsx as jsx30 } from "react/jsx-runtime";
1577
+ import { jsx as jsx36 } from "react/jsx-runtime";
1522
1578
  function DrawerFooter({ children, className, style }) {
1523
- return /* @__PURE__ */ jsx30(
1579
+ return /* @__PURE__ */ jsx36(
1524
1580
  "div",
1525
1581
  {
1526
1582
  className: cn("sticky bottom-0 z-20 backdrop-blur-sm bg-white/60 px-4 py-3 border-t border-border", className),
@@ -1530,12 +1586,267 @@ function DrawerFooter({ children, className, style }) {
1530
1586
  );
1531
1587
  }
1532
1588
 
1589
+ // src/components/Overlay/Alert/renderAlert.tsx
1590
+ import { createRoot } from "react-dom/client";
1591
+ import { createPortal as createPortal3 } from "react-dom";
1592
+
1593
+ // src/components/Overlay/Alert/Alert.tsx
1594
+ import { useEffect as useEffect4, useState as useState7, useRef as useRef9, useCallback as useCallback4 } from "react";
1595
+ import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
1596
+ var icons = {
1597
+ success: /* @__PURE__ */ jsx37(SuccessIcon, {}),
1598
+ error: /* @__PURE__ */ jsx37(ErrorIcon, {}),
1599
+ warning: /* @__PURE__ */ jsx37(WarningIcon, {}),
1600
+ info: /* @__PURE__ */ jsx37(InfoIcon, {})
1601
+ };
1602
+ function AlertComponent({ open, title, type, options, onClose }) {
1603
+ if (typeof window === "undefined") return null;
1604
+ const [progress, setProgress] = useState7(100);
1605
+ const [showContent, setShowContent] = useState7(false);
1606
+ const timerRef = useRef9(null);
1607
+ const animFrameRef = useRef9(null);
1608
+ const startTimeRef = useRef9(0);
1609
+ const remainingRef = useRef9(0);
1610
+ const onCloseRef = useRef9(onClose);
1611
+ useEffect4(() => {
1612
+ onCloseRef.current = onClose;
1613
+ }, [onClose]);
1614
+ const clearTimers = useCallback4(() => {
1615
+ if (timerRef.current) {
1616
+ clearTimeout(timerRef.current);
1617
+ timerRef.current = null;
1618
+ }
1619
+ if (animFrameRef.current) {
1620
+ cancelAnimationFrame(animFrameRef.current);
1621
+ animFrameRef.current = null;
1622
+ }
1623
+ }, []);
1624
+ const startProgressAnimation = useCallback4((duration) => {
1625
+ startTimeRef.current = performance.now();
1626
+ remainingRef.current = duration;
1627
+ const animate = () => {
1628
+ const elapsed = performance.now() - startTimeRef.current;
1629
+ const remaining = Math.max(0, duration - elapsed);
1630
+ const percent = remaining / (options?.duration || duration) * 100;
1631
+ setProgress(percent);
1632
+ if (remaining > 0) {
1633
+ animFrameRef.current = requestAnimationFrame(animate);
1634
+ }
1635
+ };
1636
+ animFrameRef.current = requestAnimationFrame(animate);
1637
+ timerRef.current = setTimeout(() => onCloseRef.current(), duration);
1638
+ }, [options?.duration]);
1639
+ useEffect4(() => {
1640
+ if (open && options?.duration) {
1641
+ setProgress(100);
1642
+ const paintTimer = setTimeout(() => {
1643
+ startProgressAnimation(options.duration);
1644
+ }, 50);
1645
+ return () => {
1646
+ clearTimeout(paintTimer);
1647
+ clearTimers();
1648
+ };
1649
+ } else if (!open) {
1650
+ clearTimers();
1651
+ setProgress(100);
1652
+ }
1653
+ }, [open, options?.duration]);
1654
+ const handleMouseEnter = useCallback4(() => {
1655
+ if (!options?.duration) return;
1656
+ const elapsed = performance.now() - startTimeRef.current;
1657
+ remainingRef.current = Math.max(0, remainingRef.current - elapsed);
1658
+ clearTimers();
1659
+ }, [options?.duration, clearTimers]);
1660
+ const handleMouseLeave = useCallback4(() => {
1661
+ if (!options?.duration || remainingRef.current <= 0) return;
1662
+ startProgressAnimation(remainingRef.current);
1663
+ }, [options?.duration, startProgressAnimation]);
1664
+ const alertStyles = {
1665
+ success: "bg-green-50 border-green-200 text-green-800 dark:bg-green-950 dark:border-green-800 dark:text-green-300",
1666
+ error: "bg-red-50 border-red-200 text-red-800 dark:bg-red-950 dark:border-red-800 dark:text-red-300",
1667
+ warning: "bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-800 dark:text-yellow-300",
1668
+ info: "bg-blue-50 border-blue-200 text-blue-800 dark:bg-blue-950 dark:border-blue-800 dark:text-blue-300"
1669
+ };
1670
+ const iconStyles = {
1671
+ success: "text-green-600 dark:text-green-400",
1672
+ error: "text-red-600 dark:text-red-400",
1673
+ warning: "text-yellow-600 dark:text-yellow-400",
1674
+ info: "text-blue-600 dark:text-blue-400"
1675
+ };
1676
+ const progressColors = {
1677
+ success: "bg-green-500",
1678
+ error: "bg-red-500",
1679
+ warning: "bg-yellow-500",
1680
+ info: "bg-blue-500"
1681
+ };
1682
+ return /* @__PURE__ */ jsx37(
1683
+ ShowWithAnimation,
1684
+ {
1685
+ when: open,
1686
+ removeOnHide: true,
1687
+ animationDuration: 300,
1688
+ animationStyle: {
1689
+ children: {
1690
+ from: {
1691
+ opacity: 0,
1692
+ transform: "translateY(-20px) scale(0.95)"
1693
+ },
1694
+ active: {
1695
+ opacity: 1,
1696
+ transform: "translateY(0) scale(1)"
1697
+ }
1698
+ }
1699
+ },
1700
+ className: "pointer-events-auto flex justify-center",
1701
+ children: /* @__PURE__ */ jsxs18(
1702
+ "div",
1703
+ {
1704
+ className: cn(
1705
+ "flex flex-col border rounded-xl shadow-xl overflow-hidden max-w-sm w-full relative",
1706
+ alertStyles[type]
1707
+ ),
1708
+ onMouseEnter: handleMouseEnter,
1709
+ onMouseLeave: handleMouseLeave,
1710
+ children: [
1711
+ /* @__PURE__ */ jsxs18("div", { className: cn("flex gap-3 items-center px-4 pt-4", options?.content ? "pb-2" : "pb-4"), children: [
1712
+ /* @__PURE__ */ jsx37("div", { className: cn("flex-shrink-0", iconStyles[type]), children: icons[type] }),
1713
+ /* @__PURE__ */ jsx37("h3", { className: "flex-1 text-sm font-semibold", children: title }),
1714
+ /* @__PURE__ */ jsx37(
1715
+ "button",
1716
+ {
1717
+ onClick: onClose,
1718
+ className: "flex-shrink-0 opacity-50 hover:opacity-100 transition-opacity rounded-md",
1719
+ "aria-label": "Close Alert",
1720
+ children: /* @__PURE__ */ jsx37(CloseIcon, {})
1721
+ }
1722
+ )
1723
+ ] }),
1724
+ options?.content && /* @__PURE__ */ jsxs18("div", { className: "px-4 pb-4", children: [
1725
+ /* @__PURE__ */ jsxs18(
1726
+ "button",
1727
+ {
1728
+ onClick: () => setShowContent(!showContent),
1729
+ className: "text-xs font-medium underline opacity-80 hover:opacity-100 transition-opacity flex items-center gap-1",
1730
+ children: [
1731
+ showContent ? "Less Info" : "More Info",
1732
+ /* @__PURE__ */ jsx37(ChevronDownIcon, { className: cn("w-3 h-3 transition-transform duration-200", showContent ? "rotate-180" : "rotate-0") })
1733
+ ]
1734
+ }
1735
+ ),
1736
+ /* @__PURE__ */ jsx37("div", { className: cn(
1737
+ "grid transition-all duration-300 ease-in-out",
1738
+ showContent ? "grid-rows-[1fr] opacity-100 mt-2" : "grid-rows-[0fr] opacity-0 mt-0"
1739
+ ), children: /* @__PURE__ */ jsx37("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx37("div", { className: "text-sm opacity-90 leading-relaxed pb-1", children: options.content }) }) })
1740
+ ] }),
1741
+ options?.duration && /* @__PURE__ */ jsx37("div", { className: "w-full h-1 bg-black/5 dark:bg-white/5 absolute bottom-0 left-0", children: /* @__PURE__ */ jsx37(
1742
+ "div",
1743
+ {
1744
+ className: cn("h-full transition-none", progressColors[type]),
1745
+ style: {
1746
+ width: `${progress}%`
1747
+ }
1748
+ }
1749
+ ) })
1750
+ ]
1751
+ }
1752
+ )
1753
+ }
1754
+ );
1755
+ }
1756
+
1757
+ // src/components/Overlay/Alert/renderAlert.tsx
1758
+ import { jsx as jsx38 } from "react/jsx-runtime";
1759
+ var alertRoot = null;
1760
+ var alertContainer = null;
1761
+ var alertStack = [];
1762
+ var nextId = 0;
1763
+ function AlertStackContainer({ alerts, onClose }) {
1764
+ return createPortal3(
1765
+ /* @__PURE__ */ jsx38(
1766
+ "div",
1767
+ {
1768
+ style: { position: "fixed", top: 0, left: 0, right: 0, zIndex: 9999, pointerEvents: "none" },
1769
+ className: "flex flex-col items-center gap-2 p-4 sm:p-6",
1770
+ children: alerts.map((alert) => /* @__PURE__ */ jsx38(
1771
+ AlertComponent,
1772
+ {
1773
+ open: alert.open,
1774
+ title: alert.title,
1775
+ type: alert.type,
1776
+ options: alert.options,
1777
+ onClose: () => onClose(alert.id)
1778
+ },
1779
+ alert.id
1780
+ ))
1781
+ }
1782
+ ),
1783
+ document.body
1784
+ );
1785
+ }
1786
+ var renderStack = () => {
1787
+ if (!alertRoot) return;
1788
+ const handleClose = (id) => {
1789
+ alertStack = alertStack.map(
1790
+ (a) => a.id === id ? { ...a, open: false } : a
1791
+ );
1792
+ renderStack();
1793
+ setTimeout(() => {
1794
+ alertStack = alertStack.filter((a) => a.id !== id);
1795
+ renderStack();
1796
+ if (alertStack.length === 0) {
1797
+ if (alertRoot) {
1798
+ alertRoot.unmount();
1799
+ alertRoot = null;
1800
+ }
1801
+ alertContainer = null;
1802
+ }
1803
+ }, 300);
1804
+ };
1805
+ alertRoot.render(
1806
+ /* @__PURE__ */ jsx38(AlertStackContainer, { alerts: [...alertStack], onClose: handleClose })
1807
+ );
1808
+ };
1809
+ var renderAlert = (props) => {
1810
+ if (typeof window === "undefined") return;
1811
+ if (!alertContainer) {
1812
+ alertContainer = document.createElement("div");
1813
+ }
1814
+ if (!alertRoot) {
1815
+ alertRoot = createRoot(alertContainer);
1816
+ }
1817
+ if (props.open) {
1818
+ const isDuplicate = alertStack.some(
1819
+ (a) => a.open && a.title === props.title && a.type === props.type && a.options?.content === props.options?.content
1820
+ );
1821
+ if (isDuplicate) return;
1822
+ const entry = {
1823
+ id: nextId++,
1824
+ open: true,
1825
+ title: props.title,
1826
+ type: props.type,
1827
+ options: props.options
1828
+ };
1829
+ alertStack.push(entry);
1830
+ }
1831
+ renderStack();
1832
+ };
1833
+
1834
+ // src/components/Overlay/Alert/handleAlert.ts
1835
+ var handleAlert = (title, type = "info", options) => {
1836
+ renderAlert({
1837
+ open: true,
1838
+ title,
1839
+ type,
1840
+ options: { duration: 5e3, ...options }
1841
+ });
1842
+ };
1843
+
1533
1844
  // src/components/Surfaces/Card/Card.tsx
1534
- import React4 from "react";
1535
- import { jsx as jsx31 } from "react/jsx-runtime";
1536
- var Card = React4.forwardRef(
1845
+ import React5 from "react";
1846
+ import { jsx as jsx39 } from "react/jsx-runtime";
1847
+ var Card = React5.forwardRef(
1537
1848
  ({ className, children, ...props }, ref) => {
1538
- return /* @__PURE__ */ jsx31(
1849
+ return /* @__PURE__ */ jsx39(
1539
1850
  "div",
1540
1851
  {
1541
1852
  ref,
@@ -1552,23 +1863,23 @@ var Card = React4.forwardRef(
1552
1863
  Card.displayName = "Card";
1553
1864
 
1554
1865
  // src/components/Surfaces/Card/CardHeader.tsx
1555
- import React5 from "react";
1556
- import { jsx as jsx32, jsxs as jsxs13 } from "react/jsx-runtime";
1557
- var CardHeader = React5.forwardRef(
1866
+ import React6 from "react";
1867
+ import { jsx as jsx40, jsxs as jsxs19 } from "react/jsx-runtime";
1868
+ var CardHeader = React6.forwardRef(
1558
1869
  ({ className, avatar, action, title, subheader, ...props }, ref) => {
1559
- return /* @__PURE__ */ jsxs13(
1870
+ return /* @__PURE__ */ jsxs19(
1560
1871
  "div",
1561
1872
  {
1562
1873
  ref,
1563
1874
  className: cn("flex items-center p-6", className),
1564
1875
  ...props,
1565
1876
  children: [
1566
- avatar && /* @__PURE__ */ jsx32("div", { className: "mr-4 flex-shrink-0", children: avatar }),
1567
- /* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col gap-1", children: [
1568
- title && /* @__PURE__ */ jsx32("div", { className: "font-semibold leading-none tracking-tight", children: title }),
1569
- subheader && /* @__PURE__ */ jsx32("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: subheader })
1877
+ avatar && /* @__PURE__ */ jsx40("div", { className: "mr-4 flex-shrink-0", children: avatar }),
1878
+ /* @__PURE__ */ jsxs19("div", { className: "flex-1 flex flex-col gap-1", children: [
1879
+ title && /* @__PURE__ */ jsx40("div", { className: "font-semibold leading-none tracking-tight", children: title }),
1880
+ subheader && /* @__PURE__ */ jsx40("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: subheader })
1570
1881
  ] }),
1571
- action && /* @__PURE__ */ jsx32("div", { className: "ml-4 flex-shrink-0 self-start", children: action })
1882
+ action && /* @__PURE__ */ jsx40("div", { className: "ml-4 flex-shrink-0 self-start", children: action })
1572
1883
  ]
1573
1884
  }
1574
1885
  );
@@ -1577,11 +1888,11 @@ var CardHeader = React5.forwardRef(
1577
1888
  CardHeader.displayName = "CardHeader";
1578
1889
 
1579
1890
  // src/components/Surfaces/Card/CardContent.tsx
1580
- import React6 from "react";
1581
- import { jsx as jsx33 } from "react/jsx-runtime";
1582
- var CardContent = React6.forwardRef(
1891
+ import React7 from "react";
1892
+ import { jsx as jsx41 } from "react/jsx-runtime";
1893
+ var CardContent = React7.forwardRef(
1583
1894
  ({ className, ...props }, ref) => {
1584
- return /* @__PURE__ */ jsx33(
1895
+ return /* @__PURE__ */ jsx41(
1585
1896
  "div",
1586
1897
  {
1587
1898
  ref,
@@ -1594,11 +1905,11 @@ var CardContent = React6.forwardRef(
1594
1905
  CardContent.displayName = "CardContent";
1595
1906
 
1596
1907
  // src/components/Surfaces/Card/CardFooter.tsx
1597
- import React7 from "react";
1598
- import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
1599
- var CardFooter = React7.forwardRef(
1908
+ import React8 from "react";
1909
+ import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs20 } from "react/jsx-runtime";
1910
+ var CardFooter = React8.forwardRef(
1600
1911
  ({ className, text, action, children }, ref) => {
1601
- return /* @__PURE__ */ jsx34(
1912
+ return /* @__PURE__ */ jsx42(
1602
1913
  "div",
1603
1914
  {
1604
1915
  ref,
@@ -1606,9 +1917,9 @@ var CardFooter = React7.forwardRef(
1606
1917
  "flex items-center justify-between p-6 bg-white dark:bg-gray-900 rounded-b-xl",
1607
1918
  className
1608
1919
  ),
1609
- children: children || /* @__PURE__ */ jsxs14(Fragment5, { children: [
1610
- text && /* @__PURE__ */ jsx34("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: text }),
1611
- action && /* @__PURE__ */ jsx34("div", { className: "ml-auto flex items-center gap-2", children: action })
1920
+ children: children || /* @__PURE__ */ jsxs20(Fragment5, { children: [
1921
+ text && /* @__PURE__ */ jsx42("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: text }),
1922
+ action && /* @__PURE__ */ jsx42("div", { className: "ml-auto flex items-center gap-2", children: action })
1612
1923
  ] })
1613
1924
  }
1614
1925
  );
@@ -1646,5 +1957,6 @@ export {
1646
1957
  TableFooter_default as TableFooter,
1647
1958
  TableHead_default as TableHead,
1648
1959
  TableRow_default as TableRow,
1649
- Tooltip
1960
+ Tooltip,
1961
+ handleAlert
1650
1962
  };
@@ -5,7 +5,7 @@ import {
5
5
  Show,
6
6
  ShowWithAnimation,
7
7
  Spinner
8
- } from "../chunk-CGY2R33R.js";
8
+ } from "../chunk-OPUJUU32.js";
9
9
  import "../chunk-MCQS3QNN.js";
10
10
  import "../chunk-U65NGM6F.js";
11
11
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optigrit/optigrit-ui",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "UI components library for optigrit apps",
5
5
  "license": "ISC",
6
6
  "author": "",