@eztrak/shared 0.15.0 → 0.15.1

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.
@@ -363,6 +363,10 @@ type RowAction<TRow = unknown> = {
363
363
  closeOnClick?: boolean;
364
364
  /** Extra classes on this item (merged after defaults; can override hover). */
365
365
  className?: string;
366
+ /** Extra classes on this item’s icon (overrides preset, e.g. `"text-red-500"`). */
367
+ iconClassName?: string;
368
+ /** Extra classes on this item’s label. */
369
+ labelClassName?: string;
366
370
  };
367
371
  type RowActionsList<TRow = unknown> = RowAction<TRow>[] | ((data: TRow | undefined) => RowAction<TRow>[]);
368
372
  interface RowActionsRenderContext<TRow = unknown> {
@@ -392,6 +396,8 @@ interface RowActionsProps<TRow = unknown> {
392
396
  */
393
397
  itemClassName?: string;
394
398
  itemIconClassName?: string;
399
+ /** Extra classes on every item label. */
400
+ itemLabelClassName?: string;
395
401
  /** Default `16`. */
396
402
  iconSize?: number;
397
403
  /** Default `"Actions"`. Pass `false` to hide. */
@@ -434,6 +440,7 @@ interface ActionMenuItemProps {
434
440
  highlight?: boolean;
435
441
  showLabel?: boolean;
436
442
  className?: string;
443
+ labelClassName?: string;
437
444
  onClick: () => void;
438
445
  }
439
446
  interface ResolvedRowAction<TRow = unknown> {
@@ -452,19 +459,24 @@ interface ResolvedRowAction<TRow = unknown> {
452
459
  confirm?: ConfirmationAlertOptions;
453
460
  closeOnClick: boolean;
454
461
  className?: string;
462
+ iconClassName?: string;
463
+ labelClassName?: string;
455
464
  }
456
465
  interface RowActionPreset {
457
466
  label: string;
458
467
  icon: IconType;
459
468
  danger?: boolean;
469
+ iconClassName?: string;
460
470
  }
461
471
 
462
- declare function RowActions<TRow = unknown>({ actions, data, mode, actionIcon, className, menuClassName, itemClassName, itemIconClassName, iconSize, triggerTooltip, triggerAriaLabel, hasPermission, placement, tippyProps, presets, confirmFn, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, renderItem, renderMenu, renderTrigger, }: RowActionsProps<TRow>): react.JSX.Element | null;
472
+ declare function RowActions<TRow = unknown>({ actions, data, mode, actionIcon, className, menuClassName, itemClassName, itemIconClassName, itemLabelClassName, iconSize, triggerTooltip, triggerAriaLabel, hasPermission, placement, tippyProps, presets, confirmFn, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, renderItem, renderMenu, renderTrigger, }: RowActionsProps<TRow>): react.JSX.Element | null;
463
473
 
464
- declare function ActionMenuItem({ label, icon: Icon, iconSize, iconClassName, tooltip, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, disabled, danger, highlight, showLabel, className, onClick, }: ActionMenuItemProps): react.JSX.Element;
474
+ declare function ActionMenuItem({ label, icon: Icon, iconSize, iconClassName, labelClassName, tooltip, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, disabled, danger, highlight, showLabel, className, onClick, }: ActionMenuItemProps): react.JSX.Element;
465
475
 
466
476
  /** Settings-app hover: peach bg `#FFF1EB` + orange text (`primary-50` / `primary-150`). */
467
477
  declare const ROW_ACTION_ITEM_HOVER_CLASS = "hover:bg-primary-50 hover:text-primary-150";
478
+ /** Settings/Department rest color (`#6C757D`). */
479
+ declare const ROW_ACTION_ITEM_TEXT_CLASS = "text-secondary";
468
480
  declare const ROW_ACTION_DEFAULT_ICON_SIZE = 16;
469
481
  declare const ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE: CSSProperties;
470
482
  declare const ROW_ACTION_PRESETS: Record<RowActionPresetName, RowActionPreset>;
@@ -484,4 +496,4 @@ type TableErrorBoundaryProps = {
484
496
 
485
497
  declare const TableErrorBoundary: react__default.FC<TableErrorBoundaryProps>;
486
498
 
487
- export { ActionMenuItem, type ActionMenuItemProps, CardSkeleton, type CardSkeletonProps, type CardSkeletonVariant, type CellEditPayload, type CellEditorInputType, CustomCellEditor, type CustomCellEditorProps, type CustomCellEditorRef, CustomPagination, type CustomPaginationClassNames, type CustomPaginationProps, DropdownFilter, type DropdownFilterProps, type DropdownOption, type EztrakTab, EztrakTabs, type EztrakTabsClassNames, type EztrakTabsProps, type LayoutStatus, Loader, type LoaderProps, Modal, type ModalProps, type PaginationData, type PopupActionHandler, PopupCellRenderer, type PopupCellRendererParams, type PopupCellRendererProps, type PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, type ResetColumnsButtonProps, ResetFiltersButton, type ResetFiltersButtonProps, type ResetFiltersButtonVariant, type ResolvedRowAction, type RowAction, type RowActionConfirmFn, type RowActionFlag, type RowActionItemRenderContext, type RowActionItemType, type RowActionPreset, type RowActionPresetName, RowActions, type RowActionsList, type RowActionsMode, type RowActionsProps, type RowActionsRenderContext, SearchInput, type SearchInputProps, TableErrorBoundary, type TableErrorBoundaryProps, TableLayoutToolbarControls, type TableLayoutToolbarControlsProps, ToolTip, type ToolTipProps, TooltipText, type TooltipTextProps, dropdownStyles, resolveActions };
499
+ export { ActionMenuItem, type ActionMenuItemProps, CardSkeleton, type CardSkeletonProps, type CardSkeletonVariant, type CellEditPayload, type CellEditorInputType, CustomCellEditor, type CustomCellEditorProps, type CustomCellEditorRef, CustomPagination, type CustomPaginationClassNames, type CustomPaginationProps, DropdownFilter, type DropdownFilterProps, type DropdownOption, type EztrakTab, EztrakTabs, type EztrakTabsClassNames, type EztrakTabsProps, type LayoutStatus, Loader, type LoaderProps, Modal, type ModalProps, type PaginationData, type PopupActionHandler, PopupCellRenderer, type PopupCellRendererParams, type PopupCellRendererProps, type PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_ITEM_TEXT_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, type ResetColumnsButtonProps, ResetFiltersButton, type ResetFiltersButtonProps, type ResetFiltersButtonVariant, type ResolvedRowAction, type RowAction, type RowActionConfirmFn, type RowActionFlag, type RowActionItemRenderContext, type RowActionItemType, type RowActionPreset, type RowActionPresetName, RowActions, type RowActionsList, type RowActionsMode, type RowActionsProps, type RowActionsRenderContext, SearchInput, type SearchInputProps, TableErrorBoundary, type TableErrorBoundaryProps, TableLayoutToolbarControls, type TableLayoutToolbarControlsProps, ToolTip, type ToolTipProps, TooltipText, type TooltipTextProps, dropdownStyles, resolveActions };
@@ -363,6 +363,10 @@ type RowAction<TRow = unknown> = {
363
363
  closeOnClick?: boolean;
364
364
  /** Extra classes on this item (merged after defaults; can override hover). */
365
365
  className?: string;
366
+ /** Extra classes on this item’s icon (overrides preset, e.g. `"text-red-500"`). */
367
+ iconClassName?: string;
368
+ /** Extra classes on this item’s label. */
369
+ labelClassName?: string;
366
370
  };
367
371
  type RowActionsList<TRow = unknown> = RowAction<TRow>[] | ((data: TRow | undefined) => RowAction<TRow>[]);
368
372
  interface RowActionsRenderContext<TRow = unknown> {
@@ -392,6 +396,8 @@ interface RowActionsProps<TRow = unknown> {
392
396
  */
393
397
  itemClassName?: string;
394
398
  itemIconClassName?: string;
399
+ /** Extra classes on every item label. */
400
+ itemLabelClassName?: string;
395
401
  /** Default `16`. */
396
402
  iconSize?: number;
397
403
  /** Default `"Actions"`. Pass `false` to hide. */
@@ -434,6 +440,7 @@ interface ActionMenuItemProps {
434
440
  highlight?: boolean;
435
441
  showLabel?: boolean;
436
442
  className?: string;
443
+ labelClassName?: string;
437
444
  onClick: () => void;
438
445
  }
439
446
  interface ResolvedRowAction<TRow = unknown> {
@@ -452,19 +459,24 @@ interface ResolvedRowAction<TRow = unknown> {
452
459
  confirm?: ConfirmationAlertOptions;
453
460
  closeOnClick: boolean;
454
461
  className?: string;
462
+ iconClassName?: string;
463
+ labelClassName?: string;
455
464
  }
456
465
  interface RowActionPreset {
457
466
  label: string;
458
467
  icon: IconType;
459
468
  danger?: boolean;
469
+ iconClassName?: string;
460
470
  }
461
471
 
462
- declare function RowActions<TRow = unknown>({ actions, data, mode, actionIcon, className, menuClassName, itemClassName, itemIconClassName, iconSize, triggerTooltip, triggerAriaLabel, hasPermission, placement, tippyProps, presets, confirmFn, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, renderItem, renderMenu, renderTrigger, }: RowActionsProps<TRow>): react.JSX.Element | null;
472
+ declare function RowActions<TRow = unknown>({ actions, data, mode, actionIcon, className, menuClassName, itemClassName, itemIconClassName, itemLabelClassName, iconSize, triggerTooltip, triggerAriaLabel, hasPermission, placement, tippyProps, presets, confirmFn, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, renderItem, renderMenu, renderTrigger, }: RowActionsProps<TRow>): react.JSX.Element | null;
463
473
 
464
- declare function ActionMenuItem({ label, icon: Icon, iconSize, iconClassName, tooltip, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, disabled, danger, highlight, showLabel, className, onClick, }: ActionMenuItemProps): react.JSX.Element;
474
+ declare function ActionMenuItem({ label, icon: Icon, iconSize, iconClassName, labelClassName, tooltip, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, disabled, danger, highlight, showLabel, className, onClick, }: ActionMenuItemProps): react.JSX.Element;
465
475
 
466
476
  /** Settings-app hover: peach bg `#FFF1EB` + orange text (`primary-50` / `primary-150`). */
467
477
  declare const ROW_ACTION_ITEM_HOVER_CLASS = "hover:bg-primary-50 hover:text-primary-150";
478
+ /** Settings/Department rest color (`#6C757D`). */
479
+ declare const ROW_ACTION_ITEM_TEXT_CLASS = "text-secondary";
468
480
  declare const ROW_ACTION_DEFAULT_ICON_SIZE = 16;
469
481
  declare const ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE: CSSProperties;
470
482
  declare const ROW_ACTION_PRESETS: Record<RowActionPresetName, RowActionPreset>;
@@ -484,4 +496,4 @@ type TableErrorBoundaryProps = {
484
496
 
485
497
  declare const TableErrorBoundary: react__default.FC<TableErrorBoundaryProps>;
486
498
 
487
- export { ActionMenuItem, type ActionMenuItemProps, CardSkeleton, type CardSkeletonProps, type CardSkeletonVariant, type CellEditPayload, type CellEditorInputType, CustomCellEditor, type CustomCellEditorProps, type CustomCellEditorRef, CustomPagination, type CustomPaginationClassNames, type CustomPaginationProps, DropdownFilter, type DropdownFilterProps, type DropdownOption, type EztrakTab, EztrakTabs, type EztrakTabsClassNames, type EztrakTabsProps, type LayoutStatus, Loader, type LoaderProps, Modal, type ModalProps, type PaginationData, type PopupActionHandler, PopupCellRenderer, type PopupCellRendererParams, type PopupCellRendererProps, type PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, type ResetColumnsButtonProps, ResetFiltersButton, type ResetFiltersButtonProps, type ResetFiltersButtonVariant, type ResolvedRowAction, type RowAction, type RowActionConfirmFn, type RowActionFlag, type RowActionItemRenderContext, type RowActionItemType, type RowActionPreset, type RowActionPresetName, RowActions, type RowActionsList, type RowActionsMode, type RowActionsProps, type RowActionsRenderContext, SearchInput, type SearchInputProps, TableErrorBoundary, type TableErrorBoundaryProps, TableLayoutToolbarControls, type TableLayoutToolbarControlsProps, ToolTip, type ToolTipProps, TooltipText, type TooltipTextProps, dropdownStyles, resolveActions };
499
+ export { ActionMenuItem, type ActionMenuItemProps, CardSkeleton, type CardSkeletonProps, type CardSkeletonVariant, type CellEditPayload, type CellEditorInputType, CustomCellEditor, type CustomCellEditorProps, type CustomCellEditorRef, CustomPagination, type CustomPaginationClassNames, type CustomPaginationProps, DropdownFilter, type DropdownFilterProps, type DropdownOption, type EztrakTab, EztrakTabs, type EztrakTabsClassNames, type EztrakTabsProps, type LayoutStatus, Loader, type LoaderProps, Modal, type ModalProps, type PaginationData, type PopupActionHandler, PopupCellRenderer, type PopupCellRendererParams, type PopupCellRendererProps, type PopupDropDownContent, ROW_ACTION_DEFAULT_ICON_SIZE, ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE, ROW_ACTION_ITEM_HOVER_CLASS, ROW_ACTION_ITEM_TEXT_CLASS, ROW_ACTION_PRESETS, ResetColumnsButton, type ResetColumnsButtonProps, ResetFiltersButton, type ResetFiltersButtonProps, type ResetFiltersButtonVariant, type ResolvedRowAction, type RowAction, type RowActionConfirmFn, type RowActionFlag, type RowActionItemRenderContext, type RowActionItemType, type RowActionPreset, type RowActionPresetName, RowActions, type RowActionsList, type RowActionsMode, type RowActionsProps, type RowActionsRenderContext, SearchInput, type SearchInputProps, TableErrorBoundary, type TableErrorBoundaryProps, TableLayoutToolbarControls, type TableLayoutToolbarControlsProps, ToolTip, type ToolTipProps, TooltipText, type TooltipTextProps, dropdownStyles, resolveActions };
@@ -42,6 +42,7 @@ __export(components_exports, {
42
42
  ROW_ACTION_DEFAULT_ICON_SIZE: () => ROW_ACTION_DEFAULT_ICON_SIZE,
43
43
  ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE: () => ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE,
44
44
  ROW_ACTION_ITEM_HOVER_CLASS: () => ROW_ACTION_ITEM_HOVER_CLASS,
45
+ ROW_ACTION_ITEM_TEXT_CLASS: () => ROW_ACTION_ITEM_TEXT_CLASS,
45
46
  ROW_ACTION_PRESETS: () => ROW_ACTION_PRESETS,
46
47
  ResetColumnsButton: () => ResetColumnsButton,
47
48
  ResetFiltersButton: () => ResetFiltersButton,
@@ -1807,13 +1808,14 @@ function PopupCellRenderer({
1807
1808
  // src/components/row-actions/presets.ts
1808
1809
  var import_fa2 = require("react-icons/fa");
1809
1810
  var ROW_ACTION_ITEM_HOVER_CLASS = "hover:bg-primary-50 hover:text-primary-150";
1811
+ var ROW_ACTION_ITEM_TEXT_CLASS = "text-secondary";
1810
1812
  var ROW_ACTION_DEFAULT_ICON_SIZE = 16;
1811
1813
  var ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE = {
1812
1814
  zIndex: 1e4
1813
1815
  };
1814
1816
  var ROW_ACTION_PRESETS = {
1815
1817
  edit: { label: "Edit", icon: import_fa2.FaEdit },
1816
- delete: { label: "Delete", icon: import_fa2.FaTrashAlt, danger: true },
1818
+ delete: { label: "Delete", icon: import_fa2.FaTrashAlt, danger: true, iconClassName: "text-red-500" },
1817
1819
  view: { label: "View", icon: import_fa2.FaEye },
1818
1820
  notes: { label: "Notes", icon: import_fa2.FaFileAlt },
1819
1821
  history: { label: "History", icon: import_fa2.FaHistory },
@@ -1829,6 +1831,7 @@ function ActionMenuItem({
1829
1831
  icon: Icon,
1830
1832
  iconSize = ROW_ACTION_DEFAULT_ICON_SIZE,
1831
1833
  iconClassName,
1834
+ labelClassName,
1832
1835
  tooltip,
1833
1836
  tooltipPlacement = "top",
1834
1837
  tooltipDelayShow,
@@ -1867,9 +1870,9 @@ function ActionMenuItem({
1867
1870
  },
1868
1871
  className: cn(
1869
1872
  "flex items-center gap-2 text-sm transition-colors duration-150",
1873
+ ROW_ACTION_ITEM_TEXT_CLASS,
1870
1874
  showLabel ? "w-full rounded-xl px-3 py-2 text-left" : "justify-center rounded-md p-1",
1871
1875
  disabled ? "cursor-not-allowed opacity-50" : ROW_ACTION_ITEM_HOVER_CLASS,
1872
- danger && "text-red-500",
1873
1876
  highlight && !danger && "text-primary-150",
1874
1877
  className
1875
1878
  ),
@@ -1882,7 +1885,7 @@ function ActionMenuItem({
1882
1885
  size: iconSize
1883
1886
  }
1884
1887
  ) : null,
1885
- showLabel ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: label }) : null
1888
+ showLabel ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: labelClassName, children: label }) : null
1886
1889
  ]
1887
1890
  }
1888
1891
  )
@@ -1931,7 +1934,9 @@ function resolveActions(actions, data, hasPermission, presets) {
1931
1934
  tooltipPlacement: action.tooltipPlacement,
1932
1935
  confirm: action.confirm,
1933
1936
  closeOnClick: action.closeOnClick !== false,
1934
- className: action.className
1937
+ className: action.className,
1938
+ iconClassName: cn(preset?.iconClassName, action.iconClassName) || void 0,
1939
+ labelClassName: action.labelClassName
1935
1940
  };
1936
1941
  return [resolved];
1937
1942
  });
@@ -1963,6 +1968,7 @@ function RowActions({
1963
1968
  menuClassName,
1964
1969
  itemClassName,
1965
1970
  itemIconClassName,
1971
+ itemLabelClassName,
1966
1972
  iconSize = ROW_ACTION_DEFAULT_ICON_SIZE,
1967
1973
  triggerTooltip = "Actions",
1968
1974
  triggerAriaLabel = "Row actions",
@@ -2008,7 +2014,8 @@ function RowActions({
2008
2014
  label: action.label,
2009
2015
  icon: action.icon,
2010
2016
  iconSize: action.iconSize ?? iconSize,
2011
- iconClassName: itemIconClassName,
2017
+ iconClassName: cn(itemIconClassName, action.iconClassName),
2018
+ labelClassName: cn(itemLabelClassName, action.labelClassName),
2012
2019
  tooltip: action.tooltip,
2013
2020
  tooltipPlacement: action.tooltipPlacement ?? tooltipPlacement,
2014
2021
  tooltipDelayShow,
@@ -2182,6 +2189,7 @@ var TableErrorBoundary = ({
2182
2189
  ROW_ACTION_DEFAULT_ICON_SIZE,
2183
2190
  ROW_ACTION_DEFAULT_MENU_TOOLTIP_STYLE,
2184
2191
  ROW_ACTION_ITEM_HOVER_CLASS,
2192
+ ROW_ACTION_ITEM_TEXT_CLASS,
2185
2193
  ROW_ACTION_PRESETS,
2186
2194
  ResetColumnsButton,
2187
2195
  ResetFiltersButton,