@hyddenlabs/hydn-ui 0.3.0-alpha.187 → 0.3.0-alpha.189
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.cjs +366 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +367 -226
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1595,6 +1595,14 @@ type ButtonProps = {
|
|
|
1595
1595
|
children?: React__default.ReactNode;
|
|
1596
1596
|
/** Click event handler */
|
|
1597
1597
|
onClick?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1598
|
+
/** Mouse enter event handler */
|
|
1599
|
+
onMouseEnter?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1600
|
+
/** Mouse leave event handler */
|
|
1601
|
+
onMouseLeave?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1602
|
+
/** Mouse down event handler */
|
|
1603
|
+
onMouseDown?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1604
|
+
/** Blur event handler */
|
|
1605
|
+
onBlur?: (e: React__default.FocusEvent<HTMLButtonElement>) => void;
|
|
1598
1606
|
/** Accessible label for icon-only buttons (required when no children) */
|
|
1599
1607
|
ariaLabel?: string;
|
|
1600
1608
|
/** Disables button interaction and applies disabled styling */
|
|
@@ -2584,6 +2592,8 @@ type DataTableAction<T> = {
|
|
|
2584
2592
|
iconColor?: StatusColorProp;
|
|
2585
2593
|
/** Accessible label for the action (shown in tooltip or screen readers) */
|
|
2586
2594
|
label: string;
|
|
2595
|
+
/** Tooltip text to display on hover. If not provided, label will be used for aria-label only. */
|
|
2596
|
+
tooltip?: string;
|
|
2587
2597
|
/** Callback when the action is clicked */
|
|
2588
2598
|
onClick: (row: T, index: number) => void;
|
|
2589
2599
|
/** Visual variant for the action button */
|
|
@@ -2650,6 +2660,14 @@ type DataTableProps<T> = {
|
|
|
2650
2660
|
pageSize?: number;
|
|
2651
2661
|
/** Whether to show checkboxes for row selection */
|
|
2652
2662
|
selectable?: boolean;
|
|
2663
|
+
/** Whether to enable search/filter functionality */
|
|
2664
|
+
searchable?: boolean;
|
|
2665
|
+
/** Specific keys to search within. If not provided, searches all fields. */
|
|
2666
|
+
searchKeys?: (keyof T)[];
|
|
2667
|
+
/** Placeholder text for the search input */
|
|
2668
|
+
searchPlaceholder?: string;
|
|
2669
|
+
/** Callback when search query changes */
|
|
2670
|
+
onSearchChange?: (query: string) => void;
|
|
2653
2671
|
/** Action buttons, function returning actions based on row data, or custom render function for the actions column */
|
|
2654
2672
|
actions?: DataTableActionItem<T>[] | ((row: T, index: number) => DataTableActionItem<T>[] | ReactNode);
|
|
2655
2673
|
/** Label for the actions column header */
|
|
@@ -2766,7 +2784,7 @@ type HeaderAction = {
|
|
|
2766
2784
|
* />
|
|
2767
2785
|
* ```
|
|
2768
2786
|
*/
|
|
2769
|
-
declare function DataTable<T>({ data, columns, className, striped, bordered, hoverable, compact, stickyHeader, sortable, paginated, pageSize, selectable, actions, actionsLabel, actionsWidth, onRowClick, onSelectionChange, emptyMessage, emptyIcon, headerActions, title, initialSort }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
2787
|
+
declare function DataTable<T>({ data, columns, className, striped, bordered, hoverable, compact, stickyHeader, sortable, paginated, pageSize, selectable, searchable, searchKeys, searchPlaceholder, onSearchChange, actions, actionsLabel, actionsWidth, onRowClick, onSelectionChange, emptyMessage, emptyIcon, headerActions, title, initialSort }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
2770
2788
|
declare namespace DataTable {
|
|
2771
2789
|
var displayName: string;
|
|
2772
2790
|
}
|
|
@@ -2783,10 +2801,13 @@ type UseTableOptions<T> = {
|
|
|
2783
2801
|
direction: 'asc' | 'desc';
|
|
2784
2802
|
};
|
|
2785
2803
|
pageSize?: number;
|
|
2804
|
+
searchQuery?: string;
|
|
2805
|
+
searchKeys?: (keyof T)[];
|
|
2786
2806
|
};
|
|
2787
2807
|
type UseTableReturn<T> = {
|
|
2788
2808
|
currentData: T[];
|
|
2789
2809
|
sortedData: T[];
|
|
2810
|
+
filteredData: T[];
|
|
2790
2811
|
sortConfig: SortConfig<T>;
|
|
2791
2812
|
handleSort: (key: keyof T) => void;
|
|
2792
2813
|
currentPage: number;
|
|
@@ -2805,9 +2826,9 @@ type UseTableReturn<T> = {
|
|
|
2805
2826
|
};
|
|
2806
2827
|
/**
|
|
2807
2828
|
* useTable Hook - Client-side table state management
|
|
2808
|
-
* Handles sorting, pagination, and selection
|
|
2829
|
+
* Handles filtering, sorting, pagination, and selection
|
|
2809
2830
|
*/
|
|
2810
|
-
declare function useTable<T>({ data, initialSort, pageSize }: UseTableOptions<T>): UseTableReturn<T>;
|
|
2831
|
+
declare function useTable<T>({ data, initialSort, pageSize, searchQuery, searchKeys }: UseTableOptions<T>): UseTableReturn<T>;
|
|
2811
2832
|
|
|
2812
2833
|
type EmptyStateProps = {
|
|
2813
2834
|
/** Main heading text for the empty state */
|
|
@@ -3379,6 +3400,8 @@ interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'style' | 'children
|
|
|
3379
3400
|
iconSize?: IconSize;
|
|
3380
3401
|
iconColor?: StatusColorProp | 'currentColor';
|
|
3381
3402
|
buttonStyle?: ButtonProps['style'];
|
|
3403
|
+
/** Icon to display on hover (if not provided, hover will keep the same icon) */
|
|
3404
|
+
hoverIcon?: string;
|
|
3382
3405
|
children?: never;
|
|
3383
3406
|
}
|
|
3384
3407
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1595,6 +1595,14 @@ type ButtonProps = {
|
|
|
1595
1595
|
children?: React__default.ReactNode;
|
|
1596
1596
|
/** Click event handler */
|
|
1597
1597
|
onClick?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1598
|
+
/** Mouse enter event handler */
|
|
1599
|
+
onMouseEnter?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1600
|
+
/** Mouse leave event handler */
|
|
1601
|
+
onMouseLeave?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1602
|
+
/** Mouse down event handler */
|
|
1603
|
+
onMouseDown?: (e: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
1604
|
+
/** Blur event handler */
|
|
1605
|
+
onBlur?: (e: React__default.FocusEvent<HTMLButtonElement>) => void;
|
|
1598
1606
|
/** Accessible label for icon-only buttons (required when no children) */
|
|
1599
1607
|
ariaLabel?: string;
|
|
1600
1608
|
/** Disables button interaction and applies disabled styling */
|
|
@@ -2584,6 +2592,8 @@ type DataTableAction<T> = {
|
|
|
2584
2592
|
iconColor?: StatusColorProp;
|
|
2585
2593
|
/** Accessible label for the action (shown in tooltip or screen readers) */
|
|
2586
2594
|
label: string;
|
|
2595
|
+
/** Tooltip text to display on hover. If not provided, label will be used for aria-label only. */
|
|
2596
|
+
tooltip?: string;
|
|
2587
2597
|
/** Callback when the action is clicked */
|
|
2588
2598
|
onClick: (row: T, index: number) => void;
|
|
2589
2599
|
/** Visual variant for the action button */
|
|
@@ -2650,6 +2660,14 @@ type DataTableProps<T> = {
|
|
|
2650
2660
|
pageSize?: number;
|
|
2651
2661
|
/** Whether to show checkboxes for row selection */
|
|
2652
2662
|
selectable?: boolean;
|
|
2663
|
+
/** Whether to enable search/filter functionality */
|
|
2664
|
+
searchable?: boolean;
|
|
2665
|
+
/** Specific keys to search within. If not provided, searches all fields. */
|
|
2666
|
+
searchKeys?: (keyof T)[];
|
|
2667
|
+
/** Placeholder text for the search input */
|
|
2668
|
+
searchPlaceholder?: string;
|
|
2669
|
+
/** Callback when search query changes */
|
|
2670
|
+
onSearchChange?: (query: string) => void;
|
|
2653
2671
|
/** Action buttons, function returning actions based on row data, or custom render function for the actions column */
|
|
2654
2672
|
actions?: DataTableActionItem<T>[] | ((row: T, index: number) => DataTableActionItem<T>[] | ReactNode);
|
|
2655
2673
|
/** Label for the actions column header */
|
|
@@ -2766,7 +2784,7 @@ type HeaderAction = {
|
|
|
2766
2784
|
* />
|
|
2767
2785
|
* ```
|
|
2768
2786
|
*/
|
|
2769
|
-
declare function DataTable<T>({ data, columns, className, striped, bordered, hoverable, compact, stickyHeader, sortable, paginated, pageSize, selectable, actions, actionsLabel, actionsWidth, onRowClick, onSelectionChange, emptyMessage, emptyIcon, headerActions, title, initialSort }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
2787
|
+
declare function DataTable<T>({ data, columns, className, striped, bordered, hoverable, compact, stickyHeader, sortable, paginated, pageSize, selectable, searchable, searchKeys, searchPlaceholder, onSearchChange, actions, actionsLabel, actionsWidth, onRowClick, onSelectionChange, emptyMessage, emptyIcon, headerActions, title, initialSort }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
2770
2788
|
declare namespace DataTable {
|
|
2771
2789
|
var displayName: string;
|
|
2772
2790
|
}
|
|
@@ -2783,10 +2801,13 @@ type UseTableOptions<T> = {
|
|
|
2783
2801
|
direction: 'asc' | 'desc';
|
|
2784
2802
|
};
|
|
2785
2803
|
pageSize?: number;
|
|
2804
|
+
searchQuery?: string;
|
|
2805
|
+
searchKeys?: (keyof T)[];
|
|
2786
2806
|
};
|
|
2787
2807
|
type UseTableReturn<T> = {
|
|
2788
2808
|
currentData: T[];
|
|
2789
2809
|
sortedData: T[];
|
|
2810
|
+
filteredData: T[];
|
|
2790
2811
|
sortConfig: SortConfig<T>;
|
|
2791
2812
|
handleSort: (key: keyof T) => void;
|
|
2792
2813
|
currentPage: number;
|
|
@@ -2805,9 +2826,9 @@ type UseTableReturn<T> = {
|
|
|
2805
2826
|
};
|
|
2806
2827
|
/**
|
|
2807
2828
|
* useTable Hook - Client-side table state management
|
|
2808
|
-
* Handles sorting, pagination, and selection
|
|
2829
|
+
* Handles filtering, sorting, pagination, and selection
|
|
2809
2830
|
*/
|
|
2810
|
-
declare function useTable<T>({ data, initialSort, pageSize }: UseTableOptions<T>): UseTableReturn<T>;
|
|
2831
|
+
declare function useTable<T>({ data, initialSort, pageSize, searchQuery, searchKeys }: UseTableOptions<T>): UseTableReturn<T>;
|
|
2811
2832
|
|
|
2812
2833
|
type EmptyStateProps = {
|
|
2813
2834
|
/** Main heading text for the empty state */
|
|
@@ -3379,6 +3400,8 @@ interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'style' | 'children
|
|
|
3379
3400
|
iconSize?: IconSize;
|
|
3380
3401
|
iconColor?: StatusColorProp | 'currentColor';
|
|
3381
3402
|
buttonStyle?: ButtonProps['style'];
|
|
3403
|
+
/** Icon to display on hover (if not provided, hover will keep the same icon) */
|
|
3404
|
+
hoverIcon?: string;
|
|
3382
3405
|
children?: never;
|
|
3383
3406
|
}
|
|
3384
3407
|
/**
|