@optigrit/optigrit-ui 0.0.11 → 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),
@@ -112,17 +112,36 @@ declare function TabPanel(props: TabPanelProps): react_jsx_runtime.JSX.Element;
112
112
 
113
113
  interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
114
114
  stickyHeader?: boolean;
115
- size?: "small" | "medium";
115
+ loading?: boolean;
116
116
  }
117
117
  declare const Table: React$1.ForwardRefExoticComponent<TableProps & React$1.RefAttributes<HTMLTableElement>>;
118
118
 
119
+ interface Column<T> {
120
+ key: string;
121
+ title: ReactNode;
122
+ render?: (item: T) => ReactNode;
123
+ }
124
+ interface TablePaginationConfig {
125
+ page: number;
126
+ totalPages: number;
127
+ onChange: (page: number) => void;
128
+ }
129
+ interface DataTableProps<T> {
130
+ data: T[];
131
+ columns: Column<T>[];
132
+ loading?: boolean;
133
+ pagination?: TablePaginationConfig;
134
+ }
135
+ declare function DataTable<T extends {
136
+ id: string | number;
137
+ }>({ data, columns, loading, pagination, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
138
+
119
139
  interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
120
140
  }
121
141
  declare const TableBody: React$1.ForwardRefExoticComponent<TableBodyProps & React$1.RefAttributes<HTMLTableSectionElement>>;
122
142
 
123
143
  interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
124
144
  align?: "left" | "center" | "right" | "justify" | "inherit";
125
- padding?: "normal" | "none" | "checkbox";
126
145
  variant?: "head" | "body" | "footer";
127
146
  component?: "td" | "th";
128
147
  }
@@ -232,6 +251,14 @@ type DrawerFooterProps = {
232
251
  };
233
252
  declare function DrawerFooter({ children, className, style }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
234
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
+
235
262
  interface CardProps extends React__default.HTMLAttributes<HTMLDivElement> {
236
263
  }
237
264
  declare const Card: React__default.ForwardRefExoticComponent<CardProps & React__default.RefAttributes<HTMLDivElement>>;
@@ -254,4 +281,4 @@ interface CardFooterProps extends React__default.HTMLAttributes<HTMLDivElement>
254
281
  }
255
282
  declare const CardFooter: React__default.ForwardRefExoticComponent<CardFooterProps & React__default.RefAttributes<HTMLDivElement>>;
256
283
 
257
- 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, 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 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
@@ -125,7 +125,7 @@ var Button = forwardRef(
125
125
  "aria-busy": loading || void 0,
126
126
  onClick: handleClick,
127
127
  className: cn(
128
- "relative overflow-hidden inline-flex items-center justify-center font-medium transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
128
+ "relative overflow-hidden inline-flex items-center justify-center font-medium transition-all duration-150 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
129
129
  isDisabled && "pointer-events-none opacity-50",
130
130
  getVariantClasses(variant, color),
131
131
  sizeClasses[size],
@@ -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,
@@ -896,23 +952,22 @@ import { forwardRef as forwardRef3, useMemo } from "react";
896
952
  // src/components/DataDisplay/Table/TableContext.tsx
897
953
  import { createContext, useContext } from "react";
898
954
  var TableContext = createContext({
899
- size: "medium",
900
955
  stickyHeader: false
901
956
  });
902
957
  var useTableContext = () => useContext(TableContext);
903
958
 
904
959
  // src/components/DataDisplay/Table/Table.tsx
905
- import { jsx as jsx13 } from "react/jsx-runtime";
960
+ import { jsx as jsx19 } from "react/jsx-runtime";
906
961
  var Table = forwardRef3(
907
- ({ className = "", children, stickyHeader = false, size = "medium", ...props }, ref) => {
908
- const value = useMemo(() => ({ size, stickyHeader }), [size, stickyHeader]);
909
- return /* @__PURE__ */ jsx13(TableContext.Provider, { value, children: /* @__PURE__ */ jsx13(
962
+ ({ className = "", children, stickyHeader = false, loading = false, ...props }, ref) => {
963
+ const value = useMemo(() => ({ stickyHeader }), [stickyHeader]);
964
+ return /* @__PURE__ */ jsx19(TableContext.Provider, { value, children: /* @__PURE__ */ jsx19(
910
965
  "table",
911
966
  {
912
967
  ref,
913
- className: `w-full caption-bottom text-sm border-collapse text-text ${stickyHeader ? "relative" : ""} ${className}`,
968
+ className: `w-full caption-bottom text-sm border-collapse ${stickyHeader ? "relative" : ""} ${className}`,
914
969
  ...props,
915
- 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
916
971
  }
917
972
  ) });
918
973
  }
@@ -920,139 +975,196 @@ var Table = forwardRef3(
920
975
  Table.displayName = "Table";
921
976
  var Table_default = Table;
922
977
 
923
- // src/components/DataDisplay/Table/TableBody.tsx
978
+ // src/components/DataDisplay/Table/TableContainer.tsx
924
979
  import { forwardRef as forwardRef4 } from "react";
925
- import { jsx as jsx14 } from "react/jsx-runtime";
926
- var TableBody = forwardRef4(
980
+ import { jsx as jsx20 } from "react/jsx-runtime";
981
+ var TableContainer = forwardRef4(
927
982
  ({ className = "", children, ...props }, ref) => {
928
- return /* @__PURE__ */ jsx14(
929
- "tbody",
983
+ return /* @__PURE__ */ jsx20(
984
+ "div",
930
985
  {
931
986
  ref,
932
- className: `[&_tr:last-child]:border-0 [&_tr]:border-border ${className}`,
987
+ className: `w-full overflow-auto rounded-lg border bg-white shadow-sm ${className}`,
933
988
  ...props,
934
989
  children
935
990
  }
936
991
  );
937
992
  }
938
993
  );
939
- TableBody.displayName = "TableBody";
940
- var TableBody_default = TableBody;
994
+ TableContainer.displayName = "TableContainer";
995
+ var TableContainer_default = TableContainer;
941
996
 
942
- // src/components/DataDisplay/Table/TableCell.tsx
997
+ // src/components/DataDisplay/Table/TableHead.tsx
943
998
  import { forwardRef as forwardRef5 } from "react";
944
- import { jsx as jsx15 } from "react/jsx-runtime";
945
- var TableCell = forwardRef5(
946
- ({ className = "", align = "left", padding, variant, component, children, ...props }, ref) => {
947
- const { size, stickyHeader } = useTableContext();
948
- const isHead = variant === "head";
949
- const Component = component || (isHead ? "th" : "td");
950
- const alignClasses = {
951
- left: "text-left",
952
- center: "text-center",
953
- right: "text-right",
954
- justify: "text-justify",
955
- inherit: "text-inherit"
956
- };
957
- const paddingClasses = {
958
- normal: size === "small" ? "p-2" : "p-4",
959
- none: "p-0",
960
- checkbox: "p-0 w-[48px] text-center"
961
- };
962
- const effectivePadding = padding || "normal";
963
- return /* @__PURE__ */ jsx15(
964
- Component,
999
+ import { jsx as jsx21 } from "react/jsx-runtime";
1000
+ var TableHead = forwardRef5(
1001
+ ({ className = "", children, ...props }, ref) => {
1002
+ return /* @__PURE__ */ jsx21(
1003
+ "thead",
965
1004
  {
966
1005
  ref,
967
- className: `align-middle transition-colors [&:has([role=checkbox])]:pr-0 ${isHead ? "font-semibold text-text bg-bg-secondary" : "text-text-secondary"} ${stickyHeader && isHead ? "sticky top-0 z-10 shadow-[inset_0_-1px_0_var(--border)]" : ""} ${alignClasses[align]} ${paddingClasses[effectivePadding]} ${className}`,
1006
+ className: `[&_tr]:border-b bg-bg ${className}`,
968
1007
  ...props,
969
1008
  children
970
1009
  }
971
1010
  );
972
1011
  }
973
1012
  );
974
- TableCell.displayName = "TableCell";
975
- var TableCell_default = TableCell;
1013
+ TableHead.displayName = "TableHead";
1014
+ var TableHead_default = TableHead;
976
1015
 
977
- // src/components/DataDisplay/Table/TableContainer.tsx
1016
+ // src/components/DataDisplay/Table/TableBody.tsx
978
1017
  import { forwardRef as forwardRef6 } from "react";
979
- import { jsx as jsx16 } from "react/jsx-runtime";
980
- var TableContainer = forwardRef6(
1018
+ import { jsx as jsx22 } from "react/jsx-runtime";
1019
+ var TableBody = forwardRef6(
981
1020
  ({ className = "", children, ...props }, ref) => {
982
- return /* @__PURE__ */ jsx16(
983
- "div",
1021
+ return /* @__PURE__ */ jsx22(
1022
+ "tbody",
984
1023
  {
985
1024
  ref,
986
- className: `w-full overflow-auto rounded-lg border border-border bg-bg-secondary shadow-sm ${className}`,
1025
+ className: `[&_tr:last-child]:border-0 ${className}`,
987
1026
  ...props,
988
1027
  children
989
1028
  }
990
1029
  );
991
1030
  }
992
1031
  );
993
- TableContainer.displayName = "TableContainer";
994
- var TableContainer_default = TableContainer;
1032
+ TableBody.displayName = "TableBody";
1033
+ var TableBody_default = TableBody;
995
1034
 
996
- // src/components/DataDisplay/Table/TableFooter.tsx
1035
+ // src/components/DataDisplay/Table/TableRow.tsx
997
1036
  import { forwardRef as forwardRef7 } from "react";
998
- import { jsx as jsx17 } from "react/jsx-runtime";
999
- var TableFooter = forwardRef7(
1000
- ({ className = "", children, ...props }, ref) => {
1001
- return /* @__PURE__ */ jsx17(
1002
- "tfoot",
1037
+ import { jsx as jsx23 } from "react/jsx-runtime";
1038
+ var TableRow = forwardRef7(
1039
+ ({ className = "", children, hover = false, selected = false, ...props }, ref) => {
1040
+ return /* @__PURE__ */ jsx23(
1041
+ "tr",
1003
1042
  {
1004
1043
  ref,
1005
- className: `border-t border-border bg-bg-secondary/50 font-medium [&>tr]:last:border-b-0 ${className}`,
1044
+ className: `border-b transition-colors ${hover ? "hover:bg-bg/50" : ""} ${selected ? "bg-bg/80" : ""} ${className}`,
1006
1045
  ...props,
1007
1046
  children
1008
1047
  }
1009
1048
  );
1010
1049
  }
1011
1050
  );
1012
- TableFooter.displayName = "TableFooter";
1013
- var TableFooter_default = TableFooter;
1051
+ TableRow.displayName = "TableRow";
1052
+ var TableRow_default = TableRow;
1014
1053
 
1015
- // src/components/DataDisplay/Table/TableHead.tsx
1054
+ // src/components/DataDisplay/Table/TableCell.tsx
1016
1055
  import { forwardRef as forwardRef8 } from "react";
1017
- import { jsx as jsx18 } from "react/jsx-runtime";
1018
- var TableHead = forwardRef8(
1019
- ({ className = "", children, ...props }, ref) => {
1020
- return /* @__PURE__ */ jsx18(
1021
- "thead",
1056
+ import { jsx as jsx24 } from "react/jsx-runtime";
1057
+ var TableCell = forwardRef8(
1058
+ ({ className = "", align = "left", variant, component, children, ...props }, ref) => {
1059
+ const { stickyHeader } = useTableContext();
1060
+ const isHead = variant === "head";
1061
+ const Component = component || (isHead ? "th" : "td");
1062
+ const alignClasses = {
1063
+ left: "text-left",
1064
+ center: "text-center",
1065
+ right: "text-right",
1066
+ justify: "text-justify",
1067
+ inherit: "text-inherit"
1068
+ };
1069
+ return /* @__PURE__ */ jsx24(
1070
+ Component,
1022
1071
  {
1023
1072
  ref,
1024
- className: `[&_tr]:border-b [&_tr]:border-border bg-bg-secondary/50 ${className}`,
1073
+ className: `align-middle transition-colors px-3 py-2 ${isHead ? "text-xs font-bold uppercase tracking-wider text-gray-500 bg-transparent" : "text-text-secondary font-medium"} ${stickyHeader && isHead ? "sticky top-0 z-10 shadow-[inset_0_-1px_0_var(--bg)]" : ""} ${alignClasses[align]} ${className}`,
1025
1074
  ...props,
1026
1075
  children
1027
1076
  }
1028
1077
  );
1029
1078
  }
1030
1079
  );
1031
- TableHead.displayName = "TableHead";
1032
- var TableHead_default = TableHead;
1080
+ TableCell.displayName = "TableCell";
1081
+ var TableCell_default = TableCell;
1033
1082
 
1034
- // src/components/DataDisplay/Table/TableRow.tsx
1083
+ // src/components/DataDisplay/Table/DataTable.tsx
1084
+ import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
1085
+ function DataTable({
1086
+ data,
1087
+ columns,
1088
+ loading,
1089
+ pagination
1090
+ }) {
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)) })
1095
+ ] }),
1096
+ pagination && (() => {
1097
+ const getVisiblePages = (current, total) => {
1098
+ if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
1099
+ if (current <= 4) return [1, 2, 3, 4, 5, "...", total];
1100
+ if (current >= total - 3) return [1, "...", total - 4, total - 3, total - 2, total - 1, total];
1101
+ return [1, "...", current - 1, current, current + 1, "...", total];
1102
+ };
1103
+ const visiblePages = getVisiblePages(pagination.page, pagination.totalPages);
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(
1106
+ Button_default,
1107
+ {
1108
+ variant: "outlined",
1109
+ color: "secondary",
1110
+ size: "sm",
1111
+ onClick: () => pagination.onChange(pagination.page - 1),
1112
+ disabled: pagination.page <= 1 || loading,
1113
+ children: "Previous"
1114
+ }
1115
+ ),
1116
+ visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */ jsx25("span", { className: "px-2", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx25(
1117
+ Button_default,
1118
+ {
1119
+ variant: p === pagination.page ? "soft" : "outlined",
1120
+ color: p == pagination.page ? "primary" : "secondary",
1121
+ size: "sm",
1122
+ className: "min-w-[32px] px-2",
1123
+ onClick: () => pagination.onChange(p),
1124
+ disabled: loading,
1125
+ children: p
1126
+ },
1127
+ p
1128
+ )),
1129
+ /* @__PURE__ */ jsx25(
1130
+ Button_default,
1131
+ {
1132
+ variant: "outlined",
1133
+ color: "secondary",
1134
+ size: "sm",
1135
+ onClick: () => pagination.onChange(pagination.page + 1),
1136
+ disabled: pagination.page >= pagination.totalPages || loading,
1137
+ children: "Next"
1138
+ }
1139
+ )
1140
+ ] }) });
1141
+ })()
1142
+ ] });
1143
+ }
1144
+ var DataTable_default = DataTable;
1145
+
1146
+ // src/components/DataDisplay/Table/TableFooter.tsx
1035
1147
  import { forwardRef as forwardRef9 } from "react";
1036
- import { jsx as jsx19 } from "react/jsx-runtime";
1037
- var TableRow = forwardRef9(
1038
- ({ className = "", children, hover = false, selected = false, ...props }, ref) => {
1039
- return /* @__PURE__ */ jsx19(
1040
- "tr",
1148
+ import { jsx as jsx26 } from "react/jsx-runtime";
1149
+ var TableFooter = forwardRef9(
1150
+ ({ className = "", children, ...props }, ref) => {
1151
+ return /* @__PURE__ */ jsx26(
1152
+ "tfoot",
1041
1153
  {
1042
1154
  ref,
1043
- className: `border-b border-border transition-colors ${hover ? "hover:bg-bg/50" : ""} ${selected ? "bg-bg/80" : ""} ${className}`,
1155
+ className: `border-t border-border bg-bg-secondary/50 font-medium [&>tr]:last:border-b-0 ${className}`,
1044
1156
  ...props,
1045
1157
  children
1046
1158
  }
1047
1159
  );
1048
1160
  }
1049
1161
  );
1050
- TableRow.displayName = "TableRow";
1051
- var TableRow_default = TableRow;
1162
+ TableFooter.displayName = "TableFooter";
1163
+ var TableFooter_default = TableFooter;
1052
1164
 
1053
1165
  // src/components/DataDisplay/Carousel/Carousel.tsx
1054
1166
  import { useState as useState6, useEffect as useEffect3, useCallback as useCallback3, forwardRef as forwardRef10 } from "react";
1055
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
1167
+ import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
1056
1168
  var Carousel = forwardRef10(
1057
1169
  ({
1058
1170
  items,
@@ -1083,7 +1195,7 @@ var Carousel = forwardRef10(
1083
1195
  if (!items || items.length === 0) {
1084
1196
  return null;
1085
1197
  }
1086
- return /* @__PURE__ */ jsxs10(
1198
+ return /* @__PURE__ */ jsxs16(
1087
1199
  "div",
1088
1200
  {
1089
1201
  ref,
@@ -1093,13 +1205,13 @@ var Carousel = forwardRef10(
1093
1205
  onMouseLeave: () => setIsHovered(false),
1094
1206
  ...props,
1095
1207
  children: [
1096
- /* @__PURE__ */ jsx20(
1208
+ /* @__PURE__ */ jsx27(
1097
1209
  "div",
1098
1210
  {
1099
1211
  className: "flex transition-transform duration-500 ease-in-out h-full w-full flex-1",
1100
1212
  style: { transform: `translateX(-${currentIndex * 100}%)` },
1101
- children: items.map((item) => /* @__PURE__ */ jsxs10("div", { className: "w-full h-full relative shrink-0", style: { flex: "0 0 100%" }, children: [
1102
- /* @__PURE__ */ jsx20(
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(
1103
1215
  "img",
1104
1216
  {
1105
1217
  src: item.imageUrl,
@@ -1107,15 +1219,15 @@ var Carousel = forwardRef10(
1107
1219
  className: "w-full h-full object-cover"
1108
1220
  }
1109
1221
  ),
1110
- (item.title || item.description) && /* @__PURE__ */ jsxs10("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: [
1111
- item.title && /* @__PURE__ */ jsx20("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 }),
1112
- item.description && /* @__PURE__ */ jsx20("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 })
1113
1225
  ] })
1114
1226
  ] }, item.id))
1115
1227
  }
1116
1228
  ),
1117
- showArrows && items.length > 1 && /* @__PURE__ */ jsxs10(Fragment4, { children: [
1118
- /* @__PURE__ */ jsx20(
1229
+ showArrows && items.length > 1 && /* @__PURE__ */ jsxs16(Fragment4, { children: [
1230
+ /* @__PURE__ */ jsx27(
1119
1231
  IconButton_default,
1120
1232
  {
1121
1233
  onClick: goToPrevious,
@@ -1123,7 +1235,7 @@ var Carousel = forwardRef10(
1123
1235
  color: "secondary",
1124
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",
1125
1237
  "aria-label": "Previous slide",
1126
- children: /* @__PURE__ */ jsx20(
1238
+ children: /* @__PURE__ */ jsx27(
1127
1239
  "svg",
1128
1240
  {
1129
1241
  xmlns: "http://www.w3.org/2000/svg",
@@ -1132,12 +1244,12 @@ var Carousel = forwardRef10(
1132
1244
  strokeWidth: 2,
1133
1245
  stroke: "currentColor",
1134
1246
  className: "w-5 h-5",
1135
- children: /* @__PURE__ */ jsx20("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" })
1136
1248
  }
1137
1249
  )
1138
1250
  }
1139
1251
  ),
1140
- /* @__PURE__ */ jsx20(
1252
+ /* @__PURE__ */ jsx27(
1141
1253
  IconButton_default,
1142
1254
  {
1143
1255
  onClick: goToNext,
@@ -1145,7 +1257,7 @@ var Carousel = forwardRef10(
1145
1257
  color: "secondary",
1146
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",
1147
1259
  "aria-label": "Next slide",
1148
- children: /* @__PURE__ */ jsx20(
1260
+ children: /* @__PURE__ */ jsx27(
1149
1261
  "svg",
1150
1262
  {
1151
1263
  xmlns: "http://www.w3.org/2000/svg",
@@ -1154,13 +1266,13 @@ var Carousel = forwardRef10(
1154
1266
  strokeWidth: 2,
1155
1267
  stroke: "currentColor",
1156
1268
  className: "w-5 h-5",
1157
- children: /* @__PURE__ */ jsx20("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" })
1158
1270
  }
1159
1271
  )
1160
1272
  }
1161
1273
  )
1162
1274
  ] }),
1163
- showIndicators && items.length > 1 && /* @__PURE__ */ jsx20("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2 z-20", children: items.map((_, index) => /* @__PURE__ */ jsx20(
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(
1164
1276
  "button",
1165
1277
  {
1166
1278
  onClick: () => goToIndex(index),
@@ -1181,10 +1293,10 @@ Carousel.displayName = "Carousel";
1181
1293
 
1182
1294
  // src/components/DataDisplay/Separator/Separator.tsx
1183
1295
  import React3 from "react";
1184
- import { jsx as jsx21 } from "react/jsx-runtime";
1296
+ import { jsx as jsx28 } from "react/jsx-runtime";
1185
1297
  var Separator = React3.forwardRef(
1186
1298
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
1187
- return /* @__PURE__ */ jsx21(
1299
+ return /* @__PURE__ */ jsx28(
1188
1300
  "div",
1189
1301
  {
1190
1302
  ref,
@@ -1204,7 +1316,7 @@ Separator.displayName = "Separator";
1204
1316
 
1205
1317
  // src/components/Overlay/Dialog/Dialog.tsx
1206
1318
  import { createPortal } from "react-dom";
1207
- import { jsx as jsx22 } from "react/jsx-runtime";
1319
+ import { jsx as jsx29 } from "react/jsx-runtime";
1208
1320
  function Dialog(props) {
1209
1321
  const {
1210
1322
  open,
@@ -1236,7 +1348,7 @@ function Dialog(props) {
1236
1348
  ]);
1237
1349
  if (typeof window === "undefined") return null;
1238
1350
  return createPortal(
1239
- /* @__PURE__ */ jsx22(
1351
+ /* @__PURE__ */ jsx29(
1240
1352
  ShowWithAnimation,
1241
1353
  {
1242
1354
  when: open,
@@ -1264,7 +1376,7 @@ function Dialog(props) {
1264
1376
  onClose?.();
1265
1377
  }
1266
1378
  },
1267
- children: /* @__PURE__ */ jsx22(
1379
+ children: /* @__PURE__ */ jsx29(
1268
1380
  ShowWithAnimation,
1269
1381
  {
1270
1382
  when: open,
@@ -1289,19 +1401,19 @@ function Dialog(props) {
1289
1401
  }
1290
1402
 
1291
1403
  // src/components/Overlay/Dialog/DialogHeader.tsx
1292
- import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1404
+ import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
1293
1405
  function DialogHeader(props) {
1294
1406
  const { title, children, ...rest } = props;
1295
- return /* @__PURE__ */ jsxs11("div", { ...rest, className: cn("p-4 sticky top-0 z-[20] backdrop-blur-sm", props.className), children: [
1296
- /* @__PURE__ */ jsx23(Show, { when: !!title, children: /* @__PURE__ */ jsx23("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 }) }),
1297
1409
  children
1298
1410
  ] });
1299
1411
  }
1300
1412
 
1301
1413
  // src/components/Overlay/Dialog/DialogFooter.tsx
1302
- import { jsx as jsx24 } from "react/jsx-runtime";
1414
+ import { jsx as jsx31 } from "react/jsx-runtime";
1303
1415
  function DialogFooter(props) {
1304
- return /* @__PURE__ */ jsx24(
1416
+ return /* @__PURE__ */ jsx31(
1305
1417
  "div",
1306
1418
  {
1307
1419
  ...props,
@@ -1311,9 +1423,9 @@ function DialogFooter(props) {
1311
1423
  }
1312
1424
 
1313
1425
  // src/components/Overlay/Dialog/DialogContent.tsx
1314
- import { jsx as jsx25 } from "react/jsx-runtime";
1426
+ import { jsx as jsx32 } from "react/jsx-runtime";
1315
1427
  function DialogContent(props) {
1316
- return /* @__PURE__ */ jsx25(
1428
+ return /* @__PURE__ */ jsx32(
1317
1429
  "div",
1318
1430
  {
1319
1431
  ...props,
@@ -1324,7 +1436,7 @@ function DialogContent(props) {
1324
1436
 
1325
1437
  // src/components/Overlay/Drawer/Drawer.tsx
1326
1438
  import { createPortal as createPortal2 } from "react-dom";
1327
- import { jsx as jsx26 } from "react/jsx-runtime";
1439
+ import { jsx as jsx33 } from "react/jsx-runtime";
1328
1440
  function Drawer(props) {
1329
1441
  const {
1330
1442
  open,
@@ -1359,7 +1471,7 @@ function Drawer(props) {
1359
1471
  }[_size] + (isHorizontal ? "vw" : "vh");
1360
1472
  })();
1361
1473
  return createPortal2(
1362
- /* @__PURE__ */ jsx26(
1474
+ /* @__PURE__ */ jsx33(
1363
1475
  ShowWithAnimation,
1364
1476
  {
1365
1477
  when: open,
@@ -1389,7 +1501,7 @@ function Drawer(props) {
1389
1501
  onClose?.();
1390
1502
  }
1391
1503
  },
1392
- children: /* @__PURE__ */ jsx26(
1504
+ children: /* @__PURE__ */ jsx33(
1393
1505
  ShowWithAnimation,
1394
1506
  {
1395
1507
  when: open,
@@ -1436,9 +1548,9 @@ function Drawer(props) {
1436
1548
  }
1437
1549
 
1438
1550
  // src/components/Overlay/Drawer/DrawerContent.tsx
1439
- import { jsx as jsx27 } from "react/jsx-runtime";
1551
+ import { jsx as jsx34 } from "react/jsx-runtime";
1440
1552
  function DrawerContent({ children, className, style }) {
1441
- return /* @__PURE__ */ jsx27(
1553
+ return /* @__PURE__ */ jsx34(
1442
1554
  "div",
1443
1555
  {
1444
1556
  className: cn("overflow-auto flex-1 p-4 relative hide-scrollbar", className),
@@ -1449,9 +1561,9 @@ function DrawerContent({ children, className, style }) {
1449
1561
  }
1450
1562
 
1451
1563
  // src/components/Overlay/Drawer/DrawerHeader.tsx
1452
- import { jsx as jsx28 } from "react/jsx-runtime";
1564
+ import { jsx as jsx35 } from "react/jsx-runtime";
1453
1565
  function DrawerHeader({ children, className, style }) {
1454
- return /* @__PURE__ */ jsx28(
1566
+ return /* @__PURE__ */ jsx35(
1455
1567
  "div",
1456
1568
  {
1457
1569
  className: cn("sticky top-0 z-20 backdrop-blur-sm bg-white/60 px-4 py-3 border-b border-border", className),
@@ -1462,9 +1574,9 @@ function DrawerHeader({ children, className, style }) {
1462
1574
  }
1463
1575
 
1464
1576
  // src/components/Overlay/Drawer/DrawerFooter.tsx
1465
- import { jsx as jsx29 } from "react/jsx-runtime";
1577
+ import { jsx as jsx36 } from "react/jsx-runtime";
1466
1578
  function DrawerFooter({ children, className, style }) {
1467
- return /* @__PURE__ */ jsx29(
1579
+ return /* @__PURE__ */ jsx36(
1468
1580
  "div",
1469
1581
  {
1470
1582
  className: cn("sticky bottom-0 z-20 backdrop-blur-sm bg-white/60 px-4 py-3 border-t border-border", className),
@@ -1474,12 +1586,267 @@ function DrawerFooter({ children, className, style }) {
1474
1586
  );
1475
1587
  }
1476
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
+
1477
1844
  // src/components/Surfaces/Card/Card.tsx
1478
- import React4 from "react";
1479
- import { jsx as jsx30 } from "react/jsx-runtime";
1480
- var Card = React4.forwardRef(
1845
+ import React5 from "react";
1846
+ import { jsx as jsx39 } from "react/jsx-runtime";
1847
+ var Card = React5.forwardRef(
1481
1848
  ({ className, children, ...props }, ref) => {
1482
- return /* @__PURE__ */ jsx30(
1849
+ return /* @__PURE__ */ jsx39(
1483
1850
  "div",
1484
1851
  {
1485
1852
  ref,
@@ -1496,23 +1863,23 @@ var Card = React4.forwardRef(
1496
1863
  Card.displayName = "Card";
1497
1864
 
1498
1865
  // src/components/Surfaces/Card/CardHeader.tsx
1499
- import React5 from "react";
1500
- import { jsx as jsx31, jsxs as jsxs12 } from "react/jsx-runtime";
1501
- 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(
1502
1869
  ({ className, avatar, action, title, subheader, ...props }, ref) => {
1503
- return /* @__PURE__ */ jsxs12(
1870
+ return /* @__PURE__ */ jsxs19(
1504
1871
  "div",
1505
1872
  {
1506
1873
  ref,
1507
1874
  className: cn("flex items-center p-6", className),
1508
1875
  ...props,
1509
1876
  children: [
1510
- avatar && /* @__PURE__ */ jsx31("div", { className: "mr-4 flex-shrink-0", children: avatar }),
1511
- /* @__PURE__ */ jsxs12("div", { className: "flex-1 flex flex-col gap-1", children: [
1512
- title && /* @__PURE__ */ jsx31("div", { className: "font-semibold leading-none tracking-tight", children: title }),
1513
- subheader && /* @__PURE__ */ jsx31("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 })
1514
1881
  ] }),
1515
- action && /* @__PURE__ */ jsx31("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 })
1516
1883
  ]
1517
1884
  }
1518
1885
  );
@@ -1521,11 +1888,11 @@ var CardHeader = React5.forwardRef(
1521
1888
  CardHeader.displayName = "CardHeader";
1522
1889
 
1523
1890
  // src/components/Surfaces/Card/CardContent.tsx
1524
- import React6 from "react";
1525
- import { jsx as jsx32 } from "react/jsx-runtime";
1526
- var CardContent = React6.forwardRef(
1891
+ import React7 from "react";
1892
+ import { jsx as jsx41 } from "react/jsx-runtime";
1893
+ var CardContent = React7.forwardRef(
1527
1894
  ({ className, ...props }, ref) => {
1528
- return /* @__PURE__ */ jsx32(
1895
+ return /* @__PURE__ */ jsx41(
1529
1896
  "div",
1530
1897
  {
1531
1898
  ref,
@@ -1538,11 +1905,11 @@ var CardContent = React6.forwardRef(
1538
1905
  CardContent.displayName = "CardContent";
1539
1906
 
1540
1907
  // src/components/Surfaces/Card/CardFooter.tsx
1541
- import React7 from "react";
1542
- import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
1543
- 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(
1544
1911
  ({ className, text, action, children }, ref) => {
1545
- return /* @__PURE__ */ jsx33(
1912
+ return /* @__PURE__ */ jsx42(
1546
1913
  "div",
1547
1914
  {
1548
1915
  ref,
@@ -1550,9 +1917,9 @@ var CardFooter = React7.forwardRef(
1550
1917
  "flex items-center justify-between p-6 bg-white dark:bg-gray-900 rounded-b-xl",
1551
1918
  className
1552
1919
  ),
1553
- children: children || /* @__PURE__ */ jsxs13(Fragment5, { children: [
1554
- text && /* @__PURE__ */ jsx33("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: text }),
1555
- action && /* @__PURE__ */ jsx33("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 })
1556
1923
  ] })
1557
1924
  }
1558
1925
  );
@@ -1566,6 +1933,7 @@ export {
1566
1933
  CardFooter,
1567
1934
  CardHeader,
1568
1935
  Carousel,
1936
+ DataTable_default as DataTable,
1569
1937
  Dialog,
1570
1938
  DialogContent,
1571
1939
  DialogFooter,
@@ -1589,5 +1957,6 @@ export {
1589
1957
  TableFooter_default as TableFooter,
1590
1958
  TableHead_default as TableHead,
1591
1959
  TableRow_default as TableRow,
1592
- Tooltip
1960
+ Tooltip,
1961
+ handleAlert
1593
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.11",
3
+ "version": "0.0.13",
4
4
  "description": "UI components library for optigrit apps",
5
5
  "license": "ISC",
6
6
  "author": "",