@hyddenlabs/hydn-ui 0.3.0-alpha.188 → 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.d.cts CHANGED
@@ -2660,6 +2660,14 @@ type DataTableProps<T> = {
2660
2660
  pageSize?: number;
2661
2661
  /** Whether to show checkboxes for row selection */
2662
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;
2663
2671
  /** Action buttons, function returning actions based on row data, or custom render function for the actions column */
2664
2672
  actions?: DataTableActionItem<T>[] | ((row: T, index: number) => DataTableActionItem<T>[] | ReactNode);
2665
2673
  /** Label for the actions column header */
@@ -2776,7 +2784,7 @@ type HeaderAction = {
2776
2784
  * />
2777
2785
  * ```
2778
2786
  */
2779
- 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;
2780
2788
  declare namespace DataTable {
2781
2789
  var displayName: string;
2782
2790
  }
@@ -2793,10 +2801,13 @@ type UseTableOptions<T> = {
2793
2801
  direction: 'asc' | 'desc';
2794
2802
  };
2795
2803
  pageSize?: number;
2804
+ searchQuery?: string;
2805
+ searchKeys?: (keyof T)[];
2796
2806
  };
2797
2807
  type UseTableReturn<T> = {
2798
2808
  currentData: T[];
2799
2809
  sortedData: T[];
2810
+ filteredData: T[];
2800
2811
  sortConfig: SortConfig<T>;
2801
2812
  handleSort: (key: keyof T) => void;
2802
2813
  currentPage: number;
@@ -2815,9 +2826,9 @@ type UseTableReturn<T> = {
2815
2826
  };
2816
2827
  /**
2817
2828
  * useTable Hook - Client-side table state management
2818
- * Handles sorting, pagination, and selection
2829
+ * Handles filtering, sorting, pagination, and selection
2819
2830
  */
2820
- 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>;
2821
2832
 
2822
2833
  type EmptyStateProps = {
2823
2834
  /** Main heading text for the empty state */
package/dist/index.d.ts CHANGED
@@ -2660,6 +2660,14 @@ type DataTableProps<T> = {
2660
2660
  pageSize?: number;
2661
2661
  /** Whether to show checkboxes for row selection */
2662
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;
2663
2671
  /** Action buttons, function returning actions based on row data, or custom render function for the actions column */
2664
2672
  actions?: DataTableActionItem<T>[] | ((row: T, index: number) => DataTableActionItem<T>[] | ReactNode);
2665
2673
  /** Label for the actions column header */
@@ -2776,7 +2784,7 @@ type HeaderAction = {
2776
2784
  * />
2777
2785
  * ```
2778
2786
  */
2779
- 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;
2780
2788
  declare namespace DataTable {
2781
2789
  var displayName: string;
2782
2790
  }
@@ -2793,10 +2801,13 @@ type UseTableOptions<T> = {
2793
2801
  direction: 'asc' | 'desc';
2794
2802
  };
2795
2803
  pageSize?: number;
2804
+ searchQuery?: string;
2805
+ searchKeys?: (keyof T)[];
2796
2806
  };
2797
2807
  type UseTableReturn<T> = {
2798
2808
  currentData: T[];
2799
2809
  sortedData: T[];
2810
+ filteredData: T[];
2800
2811
  sortConfig: SortConfig<T>;
2801
2812
  handleSort: (key: keyof T) => void;
2802
2813
  currentPage: number;
@@ -2815,9 +2826,9 @@ type UseTableReturn<T> = {
2815
2826
  };
2816
2827
  /**
2817
2828
  * useTable Hook - Client-side table state management
2818
- * Handles sorting, pagination, and selection
2829
+ * Handles filtering, sorting, pagination, and selection
2819
2830
  */
2820
- 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>;
2821
2832
 
2822
2833
  type EmptyStateProps = {
2823
2834
  /** Main heading text for the empty state */