@eztrak/shared 0.15.1 → 0.16.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.
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, InputHTMLAttributes, HTMLAttributes, CSSProperties } from 'react';
2
+ import react__default, { ReactNode, InputHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ComponentType, CSSProperties } from 'react';
3
3
  import { Props, StylesConfig } from 'react-select';
4
4
  import { PlacesType } from 'react-tooltip';
5
5
  import { IconType } from 'react-icons';
@@ -194,6 +194,102 @@ interface LoaderProps {
194
194
 
195
195
  declare const Loader: react__default.FC<LoaderProps>;
196
196
 
197
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
198
+ variant?: string;
199
+ size?: string;
200
+ }
201
+
202
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
203
+
204
+ interface CardProps {
205
+ title: string;
206
+ content?: string | null;
207
+ icon: ReactNode;
208
+ onClick?: () => void;
209
+ containerClassName?: string;
210
+ iconClassName?: string;
211
+ titleClassName?: string;
212
+ contentClassName?: string;
213
+ cardBodyClassName?: string;
214
+ }
215
+
216
+ declare function Card({ title, content, icon, onClick, containerClassName, iconClassName, titleClassName, contentClassName, cardBodyClassName, }: CardProps): react.JSX.Element;
217
+
218
+ interface HeaderProps {
219
+ title?: string;
220
+ children?: ReactNode;
221
+ breadcrumbs?: ReactNode;
222
+ className?: string;
223
+ containerClass?: string;
224
+ titleStyle?: string;
225
+ breadcrumbsStyle?: string;
226
+ }
227
+
228
+ declare function Header({ title, className, containerClass, breadcrumbs, titleStyle, breadcrumbsStyle, children, }: HeaderProps): react.JSX.Element;
229
+
230
+ interface BreadcrumbRoute {
231
+ path: string;
232
+ title?: string;
233
+ children?: BreadcrumbRoute[];
234
+ }
235
+ interface BreadcrumbsProps {
236
+ routes?: BreadcrumbRoute[];
237
+ containerClassName?: string;
238
+ linkClassName?: string;
239
+ separatorClassName?: string;
240
+ separator?: ReactNode;
241
+ activeClassName?: string;
242
+ customTitles?: Record<string, string> | string;
243
+ customIcons?: Record<string, ReactNode>;
244
+ prefix?: ReactNode;
245
+ suffix?: ReactNode;
246
+ nonClickablePaths?: string[];
247
+ }
248
+
249
+ declare function Breadcrumbs({ routes, containerClassName, linkClassName, separatorClassName, separator, activeClassName, customTitles, customIcons, prefix, suffix, nonClickablePaths, }: BreadcrumbsProps): react.JSX.Element;
250
+
251
+ interface SidebarItem {
252
+ name: string;
253
+ link?: string;
254
+ icon?: ReactNode;
255
+ subItems?: SidebarItem[];
256
+ component?: ComponentType;
257
+ tooltip?: string;
258
+ tooltipPlacement?: "top" | "right" | "bottom" | "left";
259
+ itemClassName?: string;
260
+ }
261
+ interface SidebarProps extends HTMLAttributes<HTMLDivElement> {
262
+ header?: ReactNode;
263
+ children?: ReactNode;
264
+ footer?: ReactNode;
265
+ items?: SidebarItem[];
266
+ logoUrl?: string;
267
+ logoAltText?: string;
268
+ collapseButtonText?: ReactNode;
269
+ expandButtonText?: ReactNode;
270
+ sideCollapseWidth?: string;
271
+ sidebarWidth?: string;
272
+ location?: {
273
+ pathname?: string;
274
+ };
275
+ classNames?: {
276
+ logoSection?: string;
277
+ navSection?: string;
278
+ groupItem?: string;
279
+ subItem?: string;
280
+ collapseButton?: string;
281
+ navItemText?: string;
282
+ footer?: string;
283
+ navItem?: string;
284
+ itemDropdown?: string;
285
+ };
286
+ itemDropdownIcon?: ReactNode;
287
+ onCollapseChange?: (collapsed: boolean) => void;
288
+ isCollapsed?: boolean;
289
+ }
290
+
291
+ declare function Sidebar({ className, sideCollapseWidth, sidebarWidth, header, children, footer, items, logoUrl, logoAltText, collapseButtonText, expandButtonText, location: _location, classNames, onCollapseChange, isCollapsed, itemDropdownIcon, ...rest }: SidebarProps): react.JSX.Element;
292
+
197
293
  type CardSkeletonVariant = "profile" | "image" | "content";
198
294
  interface CardSkeletonProps extends HTMLAttributes<HTMLDivElement> {
199
295
  variant?: CardSkeletonVariant;
@@ -319,6 +415,11 @@ interface PopupCellRendererProps<TRow = unknown> {
319
415
  placement?: TippyProps["placement"];
320
416
  /** Default `"Row actions"`. */
321
417
  ariaLabel?: string;
418
+ /**
419
+ * When true, the menu opens on hover and closes on leave.
420
+ * Default `false` (click to open).
421
+ */
422
+ openOnHover?: boolean;
322
423
  tippyProps?: Omit<Partial<TippyProps>, "children" | "content" | "visible" | "placement">;
323
424
  }
324
425
 
@@ -329,7 +430,7 @@ interface PopupCellRendererProps<TRow = unknown> {
329
430
  * `import "tippy.js/dist/tippy.css"`
330
431
  * `import "tippy.js/themes/light.css"`
331
432
  */
332
- declare function PopupCellRenderer<TRow = unknown>({ dropDownContent, actionIcon: ActionIcon, title, className, hideTitle, params, onAction, placement, tippyProps, ariaLabel, }: PopupCellRendererProps<TRow>): react.JSX.Element;
433
+ declare function PopupCellRenderer<TRow = unknown>({ dropDownContent, actionIcon: ActionIcon, title, className, hideTitle, params, onAction, placement, tippyProps, ariaLabel, openOnHover, }: PopupCellRendererProps<TRow>): react.JSX.Element;
333
434
 
334
435
  type RowActionPresetName = "edit" | "delete" | "view" | "notes" | "history" | "download" | "archive" | "resolve";
335
436
  type RowActionsMode = "menu" | "inline";
@@ -405,6 +506,11 @@ interface RowActionsProps<TRow = unknown> {
405
506
  triggerAriaLabel?: string;
406
507
  hasPermission?: (permission: string) => boolean;
407
508
  placement?: TippyProps["placement"];
509
+ /**
510
+ * When true, the menu opens on hover and closes on leave.
511
+ * Default `false` (click to open).
512
+ */
513
+ openOnHover?: boolean;
408
514
  tippyProps?: PopupCellRendererProps<TRow>["tippyProps"];
409
515
  /** Override default `Fa*` preset icons/labels for this instance. */
410
516
  presets?: Partial<Record<RowActionPresetName, Partial<RowActionPreset>>>;
@@ -469,7 +575,7 @@ interface RowActionPreset {
469
575
  iconClassName?: string;
470
576
  }
471
577
 
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;
578
+ declare function RowActions<TRow = unknown>({ actions, data, mode, actionIcon, className, menuClassName, itemClassName, itemIconClassName, itemLabelClassName, iconSize, triggerTooltip, triggerAriaLabel, hasPermission, placement, openOnHover, tippyProps, presets, confirmFn, tooltipPlacement, tooltipDelayShow, tooltipDelayHide, tooltipClassName, tooltipStyle, renderItem, renderMenu, renderTrigger, }: RowActionsProps<TRow>): react.JSX.Element | null;
473
579
 
474
580
  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;
475
581
 
@@ -496,4 +602,4 @@ type TableErrorBoundaryProps = {
496
602
 
497
603
  declare const TableErrorBoundary: react__default.FC<TableErrorBoundaryProps>;
498
604
 
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 };
605
+ export { ActionMenuItem, type ActionMenuItemProps, type BreadcrumbRoute, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Card, type CardProps, 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, Header, type HeaderProps, 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, Sidebar, type SidebarItem, type SidebarProps, TableErrorBoundary, type TableErrorBoundaryProps, TableLayoutToolbarControls, type TableLayoutToolbarControlsProps, ToolTip, type ToolTipProps, TooltipText, type TooltipTextProps, dropdownStyles, resolveActions };