@pk-design/react-tailwind 1.7.2 → 1.8.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.
Files changed (61) hide show
  1. package/dist/cjs/components/Button/Button.js +46 -28
  2. package/dist/cjs/components/Button/Button.js.map +1 -1
  3. package/dist/cjs/components/Checkbox/Checkbox.js +10 -4
  4. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  5. package/dist/cjs/components/CheckboxGroup/CheckboxGroup.js +19 -13
  6. package/dist/cjs/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  7. package/dist/cjs/components/DataList/DataList.js +2 -2
  8. package/dist/cjs/components/DataList/DataList.js.map +1 -1
  9. package/dist/cjs/components/DataTable/DataTable.js +72 -40
  10. package/dist/cjs/components/DataTable/DataTable.js.map +1 -1
  11. package/dist/cjs/components/DataTable/DataTable.utils.js +2 -1
  12. package/dist/cjs/components/DataTable/DataTable.utils.js.map +1 -1
  13. package/dist/cjs/components/Input/Input.js +11 -8
  14. package/dist/cjs/components/Input/Input.js.map +1 -1
  15. package/dist/cjs/components/Pagination/Pagination.js +27 -15
  16. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  17. package/dist/cjs/components/Radio/Radio.js +9 -5
  18. package/dist/cjs/components/Radio/Radio.js.map +1 -1
  19. package/dist/cjs/components/RadioGroup/RadioGroup.js +8 -3
  20. package/dist/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  21. package/dist/cjs/components/SelectBox/SelectBox.js +24 -25
  22. package/dist/cjs/components/SelectBox/SelectBox.js.map +1 -1
  23. package/dist/cjs/components/Textarea/Textarea.js +8 -5
  24. package/dist/cjs/components/Textarea/Textarea.js.map +1 -1
  25. package/dist/es/components/Button/Button.js +46 -28
  26. package/dist/es/components/Button/Button.js.map +1 -1
  27. package/dist/es/components/Checkbox/Checkbox.js +10 -4
  28. package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
  29. package/dist/es/components/CheckboxGroup/CheckboxGroup.js +20 -14
  30. package/dist/es/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  31. package/dist/es/components/DataList/DataList.js +2 -2
  32. package/dist/es/components/DataList/DataList.js.map +1 -1
  33. package/dist/es/components/DataTable/DataTable.js +74 -42
  34. package/dist/es/components/DataTable/DataTable.js.map +1 -1
  35. package/dist/es/components/DataTable/DataTable.utils.js +2 -1
  36. package/dist/es/components/DataTable/DataTable.utils.js.map +1 -1
  37. package/dist/es/components/Input/Input.js +12 -9
  38. package/dist/es/components/Input/Input.js.map +1 -1
  39. package/dist/es/components/Pagination/Pagination.js +27 -15
  40. package/dist/es/components/Pagination/Pagination.js.map +1 -1
  41. package/dist/es/components/Radio/Radio.js +9 -5
  42. package/dist/es/components/Radio/Radio.js.map +1 -1
  43. package/dist/es/components/RadioGroup/RadioGroup.js +9 -4
  44. package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
  45. package/dist/es/components/SelectBox/SelectBox.js +24 -25
  46. package/dist/es/components/SelectBox/SelectBox.js.map +1 -1
  47. package/dist/es/components/Textarea/Textarea.js +9 -6
  48. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  49. package/dist/react-tailwind.cjs.js +264 -177
  50. package/dist/react-tailwind.cjs.js.map +1 -1
  51. package/dist/react-tailwind.es.js +264 -177
  52. package/dist/react-tailwind.es.js.map +1 -1
  53. package/dist/types/components/Button/Button.types.d.ts +5 -0
  54. package/dist/types/components/CheckboxGroup/CheckboxGroup.types.d.ts +9 -1
  55. package/dist/types/components/DataList/DataList.d.ts +1 -1
  56. package/dist/types/components/DataList/DataList.types.d.ts +8 -0
  57. package/dist/types/components/DataTable/DataTable.d.ts +1 -1
  58. package/dist/types/components/DataTable/DataTable.types.d.ts +46 -0
  59. package/dist/types/components/Pagination/Pagination.types.d.ts +21 -24
  60. package/dist/types/components/RadioGroup/RadioGroup.types.d.ts +8 -0
  61. package/package.json +1 -1
@@ -99,6 +99,11 @@ export interface ButtonBaseProps {
99
99
  * @default false
100
100
  */
101
101
  noOutlineOnFocus?: boolean;
102
+ /**
103
+ * Indicates active toggle state (applies aria-pressed).
104
+ * @default false
105
+ */
106
+ active?: boolean;
102
107
  /**
103
108
  * Additional classNames merged with the computed classes.
104
109
  */
@@ -101,7 +101,15 @@ export interface CheckboxGroupProps<T = any> {
101
101
  */
102
102
  helperText?: ReactNode;
103
103
  /**
104
- * Disable all checkboxes in the group.
104
+ * Disables all checkboxes in the group
105
105
  */
106
106
  disabled?: boolean;
107
+ /**
108
+ * Marks the field as required.
109
+ */
110
+ required?: boolean;
111
+ /**
112
+ * Custom aria-describedby attribute.
113
+ */
114
+ 'aria-describedby'?: string;
107
115
  }
@@ -1,5 +1,5 @@
1
1
  import type { DataListProps } from './DataList.types';
2
- export declare function DataList<T extends Record<string, any> = Record<string, any>>({ items, columns, renderItem, searchable, searchQuery: externalSearchQuery, onSearchChange, searchFields, filterFields, selectedFilters: externalFilters, onFilterChange, sorting: externalSorting, onSortChange, swipeableActions, rowKey, selectable, selectedKeys, onSelectionChange, onItemClick, loading, emptyMessage, pagination, setPagination, containerClass, itemClass, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export declare function DataList<T extends Record<string, any> = Record<string, any>>({ items, columns, renderItem, searchable, searchQuery: externalSearchQuery, onSearchChange, searchFields, filterFields, selectedFilters: externalFilters, onFilterChange, sorting: externalSorting, onSortChange, swipeableActions, rowKey, selectable, selectedKeys, onSelectionChange, onItemClick, loading, emptyMessage, pagination, setPagination, paginationClass, paginationContainerClass, paginationProps, renderPagination, containerClass, itemClass, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace DataList {
4
4
  var displayName: string;
5
5
  }
@@ -74,6 +74,14 @@ export interface DataListProps<T = any> {
74
74
  pagination?: TPagination;
75
75
  /** Pagination setter */
76
76
  setPagination?: (pagination: Partial<TPagination>) => void;
77
+ /** Extra CSS classes for the pagination container wrapper */
78
+ paginationClass?: string;
79
+ /** Extra CSS classes for the pagination container wrapper (alias for paginationClass) */
80
+ paginationContainerClass?: string;
81
+ /** Additional props passed directly to the internal Pagination component */
82
+ paginationProps?: Record<string, any>;
83
+ /** Custom renderer function for pagination */
84
+ renderPagination?: (pagination: TPagination, setPagination?: (pagination: Partial<TPagination>) => void) => ReactNode;
77
85
  /** Outer container class */
78
86
  containerClass?: string;
79
87
  /** Item card wrapper class */
@@ -1,5 +1,5 @@
1
1
  import type { DataTableProps } from './DataTable.types';
2
- export declare function DataTable<T extends Record<string, any> = Record<string, any>>({ items, columns, sorting, onSort, loading, pagination, setPagination, emptyMessage, containerClass, wrapperClass, tableClass, headClass, footerRow, rowKey, onRowClick, rowClass, density, striped, layout, selectable, selectedRowKeys, defaultSelectedRowKeys, onSelectionChange, isRowSelectable, stickyHeader, stickyPagination, paginationContainerClass, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export declare function DataTable<T extends Record<string, any> = Record<string, any>>({ items, columns, sorting, onSort, loading, pagination, setPagination, emptyMessage, containerClass, wrapperClass, tableClass, headClass, footerRow, rowKey, onRowClick, rowClass, density, striped, layout, selectable, selectedRowKeys, defaultSelectedRowKeys, onSelectionChange, isRowSelectable, stickyHeader, stickyPagination, rowHoverActions, renderRowHoverActions, rowHoverActionHeader, rowHoverActionMode, rowHoverActionClass, paginationClass, paginationContainerClass, paginationProps, renderPagination, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace DataTable {
4
4
  var displayName: string;
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { TPagination } from '../Pagination';
3
+ import type { ButtonTheme, ButtonVariant } from '../Button';
3
4
  /**
4
5
  * Allowed column value data types.
5
6
  * Used only to influence sorting logic.
@@ -17,6 +18,29 @@ export type SortQuery = Record<string, Sorting>;
17
18
  * @default 'default'
18
19
  */
19
20
  export type DataTableDensity = 'compact' | 'default' | 'spacious';
21
+ /**
22
+ * Single row hover action item definition.
23
+ */
24
+ export interface DataTableRowAction<T = any> {
25
+ /** Unique action identifier */
26
+ id: string;
27
+ /** Display text or React node */
28
+ label?: ReactNode;
29
+ /** Icon rendered inside or before action button */
30
+ icon?: ReactNode;
31
+ /** Button color theme palette (@default "secondary") */
32
+ theme?: ButtonTheme;
33
+ /** Button visual variant style (@default "plain") */
34
+ variant?: ButtonVariant;
35
+ /** Action click callback handler */
36
+ onClick: (item: T, index: number, event: React.MouseEvent) => void;
37
+ /** Disables the action button */
38
+ disabled?: boolean | ((item: T) => boolean);
39
+ /** Tooltip or title text attribute */
40
+ title?: string;
41
+ /** Custom CSS classes for the action button */
42
+ className?: string;
43
+ }
20
44
  /**
21
45
  * Column definition for DataTable.
22
46
  * @template T Shape of each data row
@@ -138,5 +162,27 @@ export interface DataTableProps<T = any> {
138
162
  * disabled and they're excluded from "select all".
139
163
  */
140
164
  isRowSelectable?: (item: T) => boolean;
165
+ /** Action definitions rendered on row hover */
166
+ rowHoverActions?: (item: T, index: number) => DataTableRowAction<T>[];
167
+ /** Custom renderer function for row hover actions */
168
+ renderRowHoverActions?: (item: T, index: number) => ReactNode;
169
+ /** Optional header title label for the row hover actions column (when rowHoverActionMode="inline") */
170
+ rowHoverActionHeader?: ReactNode;
171
+ /**
172
+ * Rendering mode for row hover actions.
173
+ * - **overlay** (default): Floating overlay positioned over the right side of the row on hover without adding extra table columns.
174
+ * - **inline**: Renders as a dedicated rightmost table column.
175
+ * @default "overlay"
176
+ */
177
+ rowHoverActionMode?: 'overlay' | 'inline';
178
+ /** Extra CSS classes applied to the row hover action container element */
179
+ rowHoverActionClass?: string;
180
+ /** Extra CSS classes applied to the pagination container wrapper */
181
+ paginationClass?: string;
182
+ /** Extra CSS classes applied to the pagination container wrapper (alias for paginationClass) */
141
183
  paginationContainerClass?: string;
184
+ /** Additional props passed directly to internal Pagination component */
185
+ paginationProps?: Record<string, any>;
186
+ /** Custom renderer function for pagination */
187
+ renderPagination?: (pagination: TPagination, setPagination?: (pagination: Partial<TPagination>) => void) => ReactNode;
142
188
  }
@@ -1,33 +1,30 @@
1
1
  export interface TPagination {
2
- /**
3
- * Defines current page number
4
- */
5
- page: number;
6
- /**
7
- * Defines page limit
8
- */
9
- limit: number;
10
- /**
11
- * Defines totol items in the list to be paginated.
12
- */
2
+ /** Defines current page number */
3
+ page?: number;
4
+ /** Alias for page */
5
+ current?: number;
6
+ /** Defines page limit / page size */
7
+ limit?: number;
8
+ /** Alias for limit */
9
+ pageSize?: number;
10
+ /** Defines total items in the list to be paginated */
13
11
  total: number;
14
12
  }
15
- export type PaginationProps = TPagination & {
16
- /**
17
- * Pagination component classname
18
- */
13
+ export type PaginationProps = Partial<TPagination> & {
14
+ /** Total number of items */
15
+ total: number;
16
+ /** Pagination component classname */
19
17
  className?: string;
20
- /**
21
- * Handler for page change
22
- * @param pagination Partial<TPagination>
23
- * @returns void
24
- */
18
+ /** Handler for page change */
25
19
  onChange: (pagination: Partial<TPagination>) => void;
26
- /**
27
- * Whether to show ellipsis for large page numbers
28
- * @default true
29
- */
20
+ /** Whether to show ellipsis for large page numbers (@default true) */
30
21
  ellipsis?: boolean;
22
+ /** Whether to force mobile UX layout (`Previous` `Page X of Y` `Next`) regardless of screen size */
23
+ isMobile?: boolean;
24
+ /** Whether to show summary text ("Showing X to Y of Z results") (@default true) */
25
+ showSummary?: boolean;
26
+ /** Whether to show page number navigation buttons (@default true) */
27
+ showPageNumbers?: boolean;
31
28
  };
32
29
  export type UsePaginationProps = {
33
30
  totalPages: number;
@@ -88,6 +88,14 @@ export interface RadioGroupProps {
88
88
  * Change handler called when selected value changes.
89
89
  */
90
90
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
91
+ /**
92
+ * Marks the field as required.
93
+ */
94
+ required?: boolean;
95
+ /**
96
+ * Custom aria-describedby attribute.
97
+ */
98
+ 'aria-describedby'?: string;
91
99
  error?: string | null;
92
100
  showErrorMessage?: boolean;
93
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pk-design/react-tailwind",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "main": "dist/react-tailwind.cjs.js",
5
5
  "module": "dist/react-tailwind.es.js",
6
6
  "types": "dist/types/index.d.ts",