@sustaina/shared-ui 1.4.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -143,11 +143,14 @@ type DataTableColumnGrouping = {
143
143
  customAggregationFns?: GroupingOptions["aggregationFns"];
144
144
  onGroupingChange?: OnChangeFn<GroupingState>;
145
145
  };
146
+ type RowClickType = "single" | "double";
146
147
  type DataTableRowClickHandler<TData extends RowData$1> = (rowData: TData, info: {
147
148
  event: React.MouseEvent<HTMLTableRowElement>;
148
149
  row: Row<TData>;
149
150
  table: Table$1<TData>;
151
+ clickType: RowClickType;
150
152
  }) => void;
153
+ type DataTableRowClickMode = "native" | "timeout";
151
154
  type DataTableRowIdKeyHandler<TData extends RowData$1> = (originalRow: TData, index: number, parent?: Row<TData>) => string;
152
155
  type DataTableHeaderCell<TData extends RowData$1> = {
153
156
  id: string;
@@ -366,22 +369,29 @@ interface AdvanceSearchProps {
366
369
 
367
370
  declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
368
371
 
369
- type ConfirmDialogProps = {
370
- dialogData: {
371
- state: boolean;
372
- title?: string;
373
- description?: string;
374
- btn?: string;
375
- variantBtn?: string;
376
- btnState?: boolean;
377
- onClickBtn?: () => void;
378
- variant?: "default" | "success" | "error";
379
- showCloseBtn?: boolean;
380
- };
381
- setDialog: (data: any) => void;
382
- onClose?: () => void;
372
+ type DialogVariant = "default" | "success" | "error" | "warning";
373
+ interface DialogAlertProps {
374
+ open: boolean;
375
+ onOpenChange: (state: boolean) => void;
376
+ title?: string;
377
+ description?: string;
378
+ variant?: DialogVariant;
379
+ confirmText?: string;
380
+ cancelText?: string;
381
+ onConfirm?: () => void;
382
+ onCancel?: () => void;
383
+ showCancel?: boolean;
384
+ align?: "start" | "center" | "end";
385
+ outlet?: React__default.ReactNode | null;
386
+ }
387
+ declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet }: DialogAlertProps): react_jsx_runtime.JSX.Element;
388
+
389
+ declare function isDefined(value: any): boolean;
390
+ declare function isEmptyObject(value: any): boolean;
391
+
392
+ declare function stripNullishObject<T extends Record<string, any>>(value: Partial<T>): {
393
+ [k: string]: any;
383
394
  };
384
- declare function ConfirmDialog({ dialogData, setDialog, onClose }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
385
395
 
386
396
  /**
387
397
  * Utility function to intelligently combine class names using `clsx`
@@ -486,4 +496,4 @@ type Breakpoints = {
486
496
  };
487
497
  declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
488
498
 
489
- export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
499
+ export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowClickMode, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DialogAlert, type DialogAlertProps, type DialogVariant, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type RowClickType, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, isDefined, isEmptyObject, renderContentSlot, selectValueToBoolean, stripNullishObject, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
package/dist/index.d.ts CHANGED
@@ -143,11 +143,14 @@ type DataTableColumnGrouping = {
143
143
  customAggregationFns?: GroupingOptions["aggregationFns"];
144
144
  onGroupingChange?: OnChangeFn<GroupingState>;
145
145
  };
146
+ type RowClickType = "single" | "double";
146
147
  type DataTableRowClickHandler<TData extends RowData$1> = (rowData: TData, info: {
147
148
  event: React.MouseEvent<HTMLTableRowElement>;
148
149
  row: Row<TData>;
149
150
  table: Table$1<TData>;
151
+ clickType: RowClickType;
150
152
  }) => void;
153
+ type DataTableRowClickMode = "native" | "timeout";
151
154
  type DataTableRowIdKeyHandler<TData extends RowData$1> = (originalRow: TData, index: number, parent?: Row<TData>) => string;
152
155
  type DataTableHeaderCell<TData extends RowData$1> = {
153
156
  id: string;
@@ -366,22 +369,29 @@ interface AdvanceSearchProps {
366
369
 
367
370
  declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
368
371
 
369
- type ConfirmDialogProps = {
370
- dialogData: {
371
- state: boolean;
372
- title?: string;
373
- description?: string;
374
- btn?: string;
375
- variantBtn?: string;
376
- btnState?: boolean;
377
- onClickBtn?: () => void;
378
- variant?: "default" | "success" | "error";
379
- showCloseBtn?: boolean;
380
- };
381
- setDialog: (data: any) => void;
382
- onClose?: () => void;
372
+ type DialogVariant = "default" | "success" | "error" | "warning";
373
+ interface DialogAlertProps {
374
+ open: boolean;
375
+ onOpenChange: (state: boolean) => void;
376
+ title?: string;
377
+ description?: string;
378
+ variant?: DialogVariant;
379
+ confirmText?: string;
380
+ cancelText?: string;
381
+ onConfirm?: () => void;
382
+ onCancel?: () => void;
383
+ showCancel?: boolean;
384
+ align?: "start" | "center" | "end";
385
+ outlet?: React__default.ReactNode | null;
386
+ }
387
+ declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet }: DialogAlertProps): react_jsx_runtime.JSX.Element;
388
+
389
+ declare function isDefined(value: any): boolean;
390
+ declare function isEmptyObject(value: any): boolean;
391
+
392
+ declare function stripNullishObject<T extends Record<string, any>>(value: Partial<T>): {
393
+ [k: string]: any;
383
394
  };
384
- declare function ConfirmDialog({ dialogData, setDialog, onClose }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
385
395
 
386
396
  /**
387
397
  * Utility function to intelligently combine class names using `clsx`
@@ -486,4 +496,4 @@ type Breakpoints = {
486
496
  };
487
497
  declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
488
498
 
489
- export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
499
+ export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowClickMode, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DialogAlert, type DialogAlertProps, type DialogVariant, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type RowClickType, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, isDefined, isEmptyObject, renderContentSlot, selectValueToBoolean, stripNullishObject, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
package/dist/index.js CHANGED
@@ -152,6 +152,26 @@ function FormLabel({ children, className, errorClassName, required, ...props })
152
152
  );
153
153
  }
154
154
 
155
+ // src/utils/common.ts
156
+ function isDefined(value) {
157
+ return value !== null && value !== void 0;
158
+ }
159
+ function isEmptyObject(value) {
160
+ return !!value && Object.keys(value).length === 0 && value.constructor === Object;
161
+ }
162
+
163
+ // src/utils/filters.ts
164
+ function stripNullishObject(value) {
165
+ if (!isDefined(value)) {
166
+ return {};
167
+ }
168
+ try {
169
+ return Object.fromEntries(Object.entries(value).filter(([, propValue]) => isDefined(propValue)));
170
+ } catch {
171
+ return {};
172
+ }
173
+ }
174
+
155
175
  // src/utils/getColumnIdFromTable.ts
156
176
  function getColumnIdFromTable(table) {
157
177
  const allColumns = table.getAllColumns();
@@ -365,23 +385,6 @@ var useScreenSize = (breakpoints) => {
365
385
  return { isMobile, isTablet, isDesktop };
366
386
  };
367
387
  var useScreenSize_default = useScreenSize;
368
-
369
- // src/utils/common.ts
370
- function isDefined(value) {
371
- return value !== null && value !== void 0;
372
- }
373
-
374
- // src/utils/filters.ts
375
- function stripNullishObject(value) {
376
- if (!isDefined(value)) {
377
- return {};
378
- }
379
- try {
380
- return Object.fromEntries(Object.entries(value).filter(([, propValue]) => isDefined(propValue)));
381
- } catch {
382
- return {};
383
- }
384
- }
385
388
  var HeaderCell = ({ rootClassName, labelClassName, context, label, sorterProps }) => {
386
389
  const { ref, hovering } = useHover_default();
387
390
  const showSorter = sorterProps?.show ?? context.column.getCanSort();
@@ -713,6 +716,15 @@ function getColumnPinningStyles(column) {
713
716
  };
714
717
  return { classes, style };
715
718
  }
719
+ function getRowClickHandlers(handler, { rowData, row, table }) {
720
+ const handleRowClick = (event, clickType) => {
721
+ handler(rowData, { event, row, table, clickType });
722
+ };
723
+ return {
724
+ onClick: (event) => handleRowClick(event, "single"),
725
+ onDoubleClick: (event) => handleRowClick(event, "double")
726
+ };
727
+ }
716
728
  var fallbackData = [];
717
729
  var DataTable = ({
718
730
  tableRef,
@@ -952,11 +964,12 @@ var DataTable = ({
952
964
  key: row.id,
953
965
  className: cn("group", tableDataRowProps?.className),
954
966
  "data-state": row.getIsSelected() ? "selected" : "non-selected",
955
- onClick: (event) => {
956
- if (typeof onRowClick === "function") {
957
- onRowClick(row.original, { event, row, table });
958
- }
959
- }
967
+ ...getRowClickHandlers(onRowClick ?? (() => {
968
+ }), {
969
+ rowData: row.original,
970
+ row,
971
+ table
972
+ })
960
973
  },
961
974
  row.getVisibleCells().map((cell) => {
962
975
  const { classes, style } = getColumnPinningStyles(cell.column);
@@ -4935,7 +4948,7 @@ function DialogContent2({
4935
4948
  {
4936
4949
  "data-slot": "dialog-content",
4937
4950
  className: cn3(
4938
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
4951
+ "bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
4939
4952
  className
4940
4953
  ),
4941
4954
  ...props,
@@ -4995,13 +5008,15 @@ var buttonVariants4 = classVarianceAuthority.cva(
4995
5008
  {
4996
5009
  variants: {
4997
5010
  variant: {
4998
- default: "bg-sus-primary-1 text-primary-foreground shadow-xs hover:bg-sus-primary/90",
4999
- cancel: "border bg-[#8B8B8B] text-white shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:hover:bg-input/50",
5000
- outlineLeave: "border border-[#BB0B0E] bg-background shadow-xs hover:bg-accent hover:text-accent-foreground text-[#BB0B0E]"
5011
+ default: "border bg-[#8B8B8B] text-white shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:hover:bg-input/50",
5012
+ success: "bg-sus-primary-1 text-primary-foreground shadow-xs hover:bg-sus-primary/90",
5013
+ error: "border border-[#BB0B0E] bg-background shadow-xs hover:bg-accent hover:text-accent-foreground text-[#BB0B0E]",
5014
+ warning: "bg-yellow-500 text-black shadow-xs hover:bg-yellow-600 dark:hover:bg-yellow-400",
5015
+ cancel: "border bg-[#8B8B8B] text-white shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:hover:bg-input/50"
5001
5016
  },
5002
5017
  size: {
5003
- default: "h-9 px-4 has-[>svg]:px-3",
5004
- option: "py-5 h-9 px-4 has-[>svg]:px-3",
5018
+ default: "h-9 px-4 has-[>svg]:px-3",
5019
+ option: "py-5 h-9 px-4 has-[>svg]:px-3",
5005
5020
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
5006
5021
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
5007
5022
  icon: "size-9",
@@ -5011,7 +5026,7 @@ var buttonVariants4 = classVarianceAuthority.cva(
5011
5026
  "icon-lg": "size-10"
5012
5027
  },
5013
5028
  active: {
5014
- true: "bg-sus-primary-1 text-white",
5029
+ true: "opacity-90 ring-2 ring-offset-1 ring-ring",
5015
5030
  false: ""
5016
5031
  }
5017
5032
  },
@@ -5034,46 +5049,62 @@ function Button4({
5034
5049
  Comp,
5035
5050
  {
5036
5051
  "data-slot": "button",
5037
- className: cn3(buttonVariants4({ variant, size, className, active })),
5052
+ className: cn3(buttonVariants4({ variant, size, active, className })),
5038
5053
  ...props
5039
5054
  }
5040
5055
  );
5041
5056
  }
5042
- function ConfirmDialog({ dialogData, setDialog, onClose }) {
5043
- const handleClose = () => {
5044
- setDialog({ state: false });
5045
- onClose?.();
5046
- };
5047
- const titleColor = {
5048
- default: "text-[#000000]",
5049
- success: "text-[#3f9e33]",
5050
- error: "text-[#c63638]"
5051
- };
5052
- const showCloseBtn = dialogData.showCloseBtn ?? true;
5053
- return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open: dialogData.state, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent2, { children: [
5057
+ function DialogAlert({
5058
+ open,
5059
+ onOpenChange,
5060
+ title,
5061
+ description,
5062
+ variant = "default",
5063
+ confirmText,
5064
+ cancelText = "Cancel",
5065
+ onConfirm,
5066
+ onCancel,
5067
+ showCancel = true,
5068
+ align = "center",
5069
+ outlet
5070
+ }) {
5071
+ const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
5072
+ const handleCancel = React4.useCallback(() => {
5073
+ onCancel?.();
5074
+ onOpenChange(false);
5075
+ }, [onCancel, onOpenChange]);
5076
+ const handleConfirm = React4.useCallback(() => {
5077
+ onConfirm?.();
5078
+ }, [onConfirm]);
5079
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent2, { className: "max-w-md", children: [
5054
5080
  /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader2, { children: [
5055
- /* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className: cn3(titleColor[dialogData.variant || "default"], "font-bold"), children: dialogData.title || "" }),
5056
- /* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children: dialogData.description || "" })
5081
+ title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className: variantClass(variant), children: title }),
5082
+ description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children: description })
5057
5083
  ] }),
5058
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex justify-center py-5 gap-5", children: [
5059
- showCloseBtn && /* @__PURE__ */ jsxRuntime.jsx(Button4, { variant: "cancel", onClick: handleClose, children: "Close" }),
5060
- dialogData.btn && /* @__PURE__ */ jsxRuntime.jsx(
5061
- Button4,
5062
- {
5063
- variant: dialogData.variantBtn || "default",
5064
- disabled: dialogData.btnState === false,
5065
- onClick: dialogData.onClickBtn,
5066
- children: dialogData.btn
5067
- }
5068
- )
5084
+ outlet && outlet,
5085
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex gap-3 mt-3 ${alignClass}`, children: [
5086
+ showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button4, { variant: "cancel", onClick: handleCancel, children: cancelText }),
5087
+ confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button4, { variant, onClick: handleConfirm, children: confirmText })
5069
5088
  ] })
5070
5089
  ] }) });
5071
5090
  }
5091
+ function variantClass(variant) {
5092
+ switch (variant) {
5093
+ case "success":
5094
+ return "text-green-600";
5095
+ case "error":
5096
+ return "text-red-600";
5097
+ case "warning":
5098
+ return "text-yellow-600";
5099
+ default:
5100
+ return "";
5101
+ }
5102
+ }
5072
5103
 
5073
5104
  exports.AdvanceSearch = AdvanceSearch_default;
5074
5105
  exports.Button = Button;
5075
5106
  exports.DataTable = DataTable_default;
5076
- exports.Dialog = ConfirmDialog;
5107
+ exports.DialogAlert = DialogAlert;
5077
5108
  exports.FormErrorMessage = FormErrorMessage;
5078
5109
  exports.FormField = FormField;
5079
5110
  exports.FormFieldContext = FormFieldContext;
@@ -5091,8 +5122,11 @@ exports.buttonVariants = buttonVariants;
5091
5122
  exports.cn = cn;
5092
5123
  exports.compareAlphanumeric = compareAlphanumeric;
5093
5124
  exports.getColumnIdFromTable = getColumnIdFromTable;
5125
+ exports.isDefined = isDefined;
5126
+ exports.isEmptyObject = isEmptyObject;
5094
5127
  exports.renderContentSlot = renderContentSlot;
5095
5128
  exports.selectValueToBoolean = selectValueToBoolean;
5129
+ exports.stripNullishObject = stripNullishObject;
5096
5130
  exports.useFormField = useFormField;
5097
5131
  exports.useGridSettingsStore = useGridSettingsStore;
5098
5132
  exports.useHover = useHover_default;