tcce-design-system 0.3.25 → 0.3.27

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.
@@ -13,6 +13,7 @@ import { CSSProperties } from 'react';
13
13
  import { DetailedHTMLProps } from 'react';
14
14
  import { Dispatch } from 'react';
15
15
  import { FastOmit } from 'styled-components';
16
+ import { FormikValues } from 'formik';
16
17
  import { ForwardRefComponent } from 'motion/react';
17
18
  import { ForwardRefExoticComponent } from 'react';
18
19
  import { Header as Header_2 } from '@tanstack/react-table';
@@ -72,6 +73,7 @@ export declare type AllowedInputType = (typeof ALLOWED_INPUT_TYPES)[number];
72
73
 
73
74
  /**
74
75
  * Sidebar container.
76
+ * On desktop it sits below the header; on mobile it covers the full height as a drawer.
75
77
  * @param $collapsed - Whether the sidebar is collapsed.
76
78
  * @param $open - Whether the sidebar is open (mobile).
77
79
  */
@@ -424,6 +426,28 @@ export declare interface ColumnMeta {
424
426
  pinned?: 'left' | 'right' | false;
425
427
  }
426
428
 
429
+ /**
430
+ * ConfirmDeleteDialog displays a destructive action confirmation modal.
431
+ * It asks users to confirm deletion and supports a loading state while the action is in progress.
432
+ */
433
+ export declare const ConfirmDeleteDialog: ({ isOpen, onClose, onConfirm, isLoading, itemLabel, }: ConfirmDeleteDialogProps) => JSX.Element;
434
+
435
+ /**
436
+ * Props for the ConfirmDeleteDialog component.
437
+ * @param isOpen - Controls whether the dialog is visible.
438
+ * @param onClose - Callback invoked when the dialog is dismissed.
439
+ * @param onConfirm - Callback invoked when the delete action is confirmed.
440
+ * @param isLoading - Shows loading state and disables actions while confirmation is processing. Default is false.
441
+ * @param itemLabel - Label of the entity shown in the confirmation message. Default is 'this item'.
442
+ */
443
+ export declare interface ConfirmDeleteDialogProps {
444
+ isOpen: boolean;
445
+ onClose: () => void;
446
+ onConfirm: () => void;
447
+ isLoading?: boolean;
448
+ itemLabel?: string;
449
+ }
450
+
427
451
  /**
428
452
  * Creates URLSearchParams for backend pagination with sorting
429
453
  * Compatible with Laravel PaginateHelper
@@ -1142,7 +1166,7 @@ export declare const Layout: (props: LayoutProps) => JSX.Element;
1142
1166
  * Provides the main content area with responsive spacing and scrolling.
1143
1167
  */
1144
1168
  export declare const LayoutMainContent: {
1145
- ({ children, className }: LayoutMainContentProps): JSX.Element;
1169
+ ({ children, className, id, inert, "aria-hidden": ariaHidden, }: LayoutMainContentProps): JSX.Element;
1146
1170
  displayName: string;
1147
1171
  };
1148
1172
 
@@ -1152,6 +1176,9 @@ export declare const LayoutMainContent: {
1152
1176
  export declare interface LayoutMainContentProps {
1153
1177
  children: ReactNode;
1154
1178
  className?: string;
1179
+ id?: string;
1180
+ inert?: boolean;
1181
+ 'aria-hidden'?: boolean;
1155
1182
  }
1156
1183
 
1157
1184
  /**
@@ -1257,6 +1284,7 @@ export declare function mergeFilters(...filterStates: ColumnFiltersState[]): Col
1257
1284
 
1258
1285
  /**
1259
1286
  * Button to open sidebar on mobile devices.
1287
+ * Sits above the header so it is always tappable.
1260
1288
  * @param $hidden - Whether the button is hidden.
1261
1289
  */
1262
1290
  export declare const MobileOpenBtn: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
@@ -1568,7 +1596,7 @@ export declare type SetDigits = Dispatch<SetStateAction<string[]>>;
1568
1596
  * @param logoImgCollapsed - Logo when sidebar is collapsed.
1569
1597
  */
1570
1598
  export declare const Sidebar: {
1571
- ({ navigationConfig, activePath, logoImgExpanded, logoImgCollapsed, onNavigate, userPermissions, }: SidebarProps): JSX.Element;
1599
+ ({ navigationConfig, activePath, logoImgExpanded, logoImgCollapsed, onNavigate, userPermissions, hideLogo, }: SidebarProps): JSX.Element;
1572
1600
  displayName: string;
1573
1601
  };
1574
1602
 
@@ -1591,9 +1619,11 @@ export declare interface SidebarContextValue {
1591
1619
  /**
1592
1620
  * Sidebar header container.
1593
1621
  * @param $collapsed - Whether the sidebar is collapsed.
1622
+ * @param $hideLogo - Whether the logo is hidden (centers the toggle button).
1594
1623
  */
1595
1624
  export declare const SidebarHeader: IStyledComponentBase<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
1596
1625
  $collapsed: boolean;
1626
+ $hideLogo: boolean;
1597
1627
  }>> & string;
1598
1628
 
1599
1629
  /**
@@ -1605,6 +1635,7 @@ $collapsed: boolean;
1605
1635
  * @property logoImgExpanded - Optional React node for the logo when sidebar is expanded.
1606
1636
  * @property logoImgCollapsed - Optional React node for the logo when sidebar is collapsed.
1607
1637
  * @property onNavigate - Optional callback function for handling navigation events.
1638
+ * @property hideLogo - When true, hides the logo inside the sidebar (useful when the logo lives in the Header instead).
1608
1639
  */
1609
1640
  export declare interface SidebarProps {
1610
1641
  navigationConfig: NavigationItem[];
@@ -1613,6 +1644,7 @@ export declare interface SidebarProps {
1613
1644
  logoImgExpanded?: ReactNode;
1614
1645
  logoImgCollapsed?: ReactNode;
1615
1646
  onNavigate?: (href: string) => void;
1647
+ hideLogo?: boolean;
1616
1648
  }
1617
1649
 
1618
1650
  export declare const SidebarProvider: ({ children }: PropsWithChildren) => JSX.Element;
@@ -1869,6 +1901,58 @@ export declare interface StepperProps {
1869
1901
  */
1870
1902
  export declare type StepperSize = 'sm' | 'md' | 'lg';
1871
1903
 
1904
+ /**
1905
+ * StoreDialog renders a reusable create/edit form inside a modal dialog.
1906
+ * It uses Formik for form state management and maps configured form inputs to FormField components.
1907
+ */
1908
+ export declare const StoreDialog: <T extends {
1909
+ id?: number | string;
1910
+ }>({ isOpen, setOpen, handleCreate, handleEdit, item, initialValues, formInputs, option, title, buttonText, }: StoreDialogProps<T>) => JSX.Element;
1911
+
1912
+ /**
1913
+ * Label set used for create and edit mode text.
1914
+ * @param create - Label displayed when the dialog is in create mode.
1915
+ * @param edit - Label displayed when the dialog is in edit mode.
1916
+ */
1917
+ export declare interface StoreDialogLabels {
1918
+ create: string;
1919
+ edit: string;
1920
+ }
1921
+
1922
+ /**
1923
+ * Operation mode for the StoreDialog component.
1924
+ * - create: Submits form values through `handleCreate`.
1925
+ * - edit: Submits form values through `handleEdit` with the selected item id.
1926
+ */
1927
+ export declare type StoreDialogOption = 'create' | 'edit';
1928
+
1929
+ /**
1930
+ * Props for the StoreDialog component.
1931
+ * This interface is generic and expects an item shape with an optional `id` field.
1932
+ * @param isOpen - Controls whether the dialog is visible.
1933
+ * @param setOpen - Callback used to open or close the dialog.
1934
+ * @param handleCreate - Callback executed on submit when `option` is `create`.
1935
+ * @param handleEdit - Optional callback executed on submit when `option` is `edit` and `item.id` is available.
1936
+ * @param item - Optional selected item used for edit mode.
1937
+ * @param initialValues - Initial Formik values used by the form.
1938
+ * @param formInputs - Field configuration array rendered as form fields.
1939
+ * @param option - Defines whether the dialog works in create or edit mode.
1940
+ * @param title - Optional heading labels for each mode.
1941
+ * @param buttonText - Optional submit button labels for each mode.
1942
+ */
1943
+ export declare interface StoreDialogProps<T = any> {
1944
+ isOpen: boolean;
1945
+ setOpen: (open: boolean) => void;
1946
+ handleCreate: (values: any) => void;
1947
+ handleEdit?: (id: number | string, values: any) => void;
1948
+ item?: T | null;
1949
+ initialValues: FormikValues;
1950
+ formInputs: FormFieldComponentProps[];
1951
+ option: StoreDialogOption;
1952
+ title?: StoreDialogLabels;
1953
+ buttonText?: StoreDialogLabels;
1954
+ }
1955
+
1872
1956
  /**
1873
1957
  * Submenu expand/collapse animation (top-down).
1874
1958
  * Smooth height auto + fade + slight upward offset for a natural reveal.