@indico-data/design-system 3.0.10 → 3.1.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 (98) hide show
  1. package/.storybook/main.ts +3 -0
  2. package/lib/components/badge/types.d.ts +4 -0
  3. package/lib/components/button/types.d.ts +52 -2
  4. package/lib/components/card/Card.d.ts +5 -0
  5. package/lib/components/floatUI/types.d.ts +7 -0
  6. package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
  7. package/lib/components/forms/date/datePicker/types.d.ts +10 -0
  8. package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
  9. package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
  10. package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
  11. package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -0
  12. package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
  13. package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
  14. package/lib/components/forms/radio/Radio.d.ts +6 -0
  15. package/lib/components/forms/select/Select.d.ts +10 -0
  16. package/lib/components/forms/textarea/Textarea.d.ts +7 -0
  17. package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
  18. package/lib/components/forms/toggle/Toggle.d.ts +7 -0
  19. package/lib/components/icons/types.d.ts +5 -0
  20. package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
  21. package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
  22. package/lib/components/menu/Menu.d.ts +1 -0
  23. package/lib/components/modal/types.d.ts +22 -0
  24. package/lib/components/pagination/types.d.ts +4 -0
  25. package/lib/components/pill/types.d.ts +3 -0
  26. package/lib/components/skeleton/Skeleton.d.ts +5 -0
  27. package/lib/components/stepper/types.d.ts +9 -0
  28. package/lib/components/table/types.d.ts +9 -0
  29. package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
  30. package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
  31. package/lib/components/tooltip/Tooltip.d.ts +6 -0
  32. package/lib/components/truncate/types.d.ts +4 -0
  33. package/lib/index.d.ts +262 -2
  34. package/lib/index.esm.js.map +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/package.json +2 -1
  37. package/src/components/badge/Badge.stories.tsx +0 -4
  38. package/src/components/badge/types.ts +4 -0
  39. package/src/components/button/Button.stories.tsx +5 -18
  40. package/src/components/button/types.ts +52 -2
  41. package/src/components/card/Card.stories.tsx +0 -5
  42. package/src/components/card/Card.tsx +5 -0
  43. package/src/components/floatUI/FloatUI.stories.tsx +0 -11
  44. package/src/components/floatUI/types.ts +7 -0
  45. package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
  46. package/src/components/forms/checkbox/Checkbox.tsx +7 -0
  47. package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
  48. package/src/components/forms/date/datePicker/types.ts +10 -0
  49. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
  50. package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
  51. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
  52. package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
  53. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
  54. package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
  55. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
  56. package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
  57. package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
  58. package/src/components/forms/numberInput/NumberInput.tsx +4 -0
  59. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
  60. package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
  61. package/src/components/forms/radio/Radio.stories.tsx +0 -6
  62. package/src/components/forms/radio/Radio.tsx +6 -0
  63. package/src/components/forms/select/Select.stories.tsx +1 -14
  64. package/src/components/forms/select/Select.tsx +10 -0
  65. package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
  66. package/src/components/forms/textarea/Textarea.tsx +7 -0
  67. package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
  68. package/src/components/forms/timePicker/TimePicker.tsx +5 -0
  69. package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
  70. package/src/components/forms/toggle/Toggle.tsx +7 -0
  71. package/src/components/icons/Icon.stories.tsx +0 -7
  72. package/src/components/icons/types.ts +5 -0
  73. package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
  74. package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
  75. package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
  76. package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
  77. package/src/components/menu/Menu.stories.tsx +0 -3
  78. package/src/components/menu/Menu.tsx +1 -0
  79. package/src/components/modal/Modal.stories.tsx +1 -25
  80. package/src/components/modal/types.ts +22 -0
  81. package/src/components/pagination/Pagination.stories.tsx +0 -4
  82. package/src/components/pagination/types.ts +4 -0
  83. package/src/components/pill/Pill.stories.tsx +0 -3
  84. package/src/components/pill/types.ts +3 -0
  85. package/src/components/skeleton/Skeleton.stories.tsx +0 -7
  86. package/src/components/skeleton/Skeleton.tsx +5 -0
  87. package/src/components/stepper/Stepper.stories.tsx +0 -19
  88. package/src/components/stepper/types.ts +9 -0
  89. package/src/components/table/Table.stories.tsx +0 -35
  90. package/src/components/table/types.ts +9 -0
  91. package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
  92. package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
  93. package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
  94. package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
  95. package/src/components/tooltip/Tooltip.stories.tsx +0 -8
  96. package/src/components/tooltip/Tooltip.tsx +6 -0
  97. package/src/components/truncate/Truncate.stories.tsx +0 -8
  98. package/src/components/truncate/types.ts +4 -0
@@ -17,7 +17,6 @@ const meta: Meta = {
17
17
  argTypes: {
18
18
  legendHeader: {
19
19
  control: false,
20
- description: 'The header content for the legend.',
21
20
  table: {
22
21
  category: 'Props',
23
22
  type: {
@@ -27,7 +26,6 @@ const meta: Meta = {
27
26
  },
28
27
  legendFooter: {
29
28
  control: false,
30
- description: 'The footer content for the legend.',
31
29
  table: {
32
30
  category: 'Props',
33
31
  type: {
@@ -37,7 +35,6 @@ const meta: Meta = {
37
35
  },
38
36
  steps: {
39
37
  control: false,
40
- description: 'An array of step objects that define the stepper navigation.',
41
38
  table: {
42
39
  category: 'Props',
43
40
  type: {
@@ -46,7 +43,6 @@ const meta: Meta = {
46
43
  },
47
44
  },
48
45
  label: {
49
- description: 'Display text for the step in the sidebar/legend',
50
46
  table: {
51
47
  category: 'Step Properties',
52
48
  type: {
@@ -56,8 +52,6 @@ const meta: Meta = {
56
52
  control: false,
57
53
  },
58
54
  isCompleted: {
59
- description:
60
- 'Indicates whether this step has been completed. Used to track progress and determine whether to enable subsequent steps.',
61
55
  table: {
62
56
  category: 'Step Properties',
63
57
  type: {
@@ -68,8 +62,6 @@ const meta: Meta = {
68
62
  control: false,
69
63
  },
70
64
  isNextDisabled: {
71
- description:
72
- 'When true, the Next button will be disabled for this step. Set to true for steps that require completion before proceeding.',
73
65
  table: {
74
66
  category: 'Step Properties',
75
67
  type: {
@@ -80,8 +72,6 @@ const meta: Meta = {
80
72
  control: false,
81
73
  },
82
74
  isOptional: {
83
- description:
84
- 'When true, the step can be skipped (the Next button remains enabled). Used for optional information or steps that are not required to complete the flow.',
85
75
  table: {
86
76
  category: 'Step Properties',
87
77
  type: {
@@ -92,8 +82,6 @@ const meta: Meta = {
92
82
  control: false,
93
83
  },
94
84
  isSidebarEnabled: {
95
- description:
96
- 'When true, the step is clickable in the sidebar. Used for restricting navigation until previous steps are completed.',
97
85
  table: {
98
86
  category: 'Step Properties',
99
87
  type: {
@@ -105,8 +93,6 @@ const meta: Meta = {
105
93
  },
106
94
  currentStep: {
107
95
  control: false,
108
- description:
109
- 'The current step of the stepper. This value should be an index of the steps array.',
110
96
  table: {
111
97
  category: 'Props',
112
98
  type: {
@@ -117,7 +103,6 @@ const meta: Meta = {
117
103
  },
118
104
  onBackClick: {
119
105
  control: false,
120
- description: 'The function to call when the back button is clicked.',
121
106
  table: {
122
107
  category: 'Callbacks',
123
108
  type: {
@@ -127,7 +112,6 @@ const meta: Meta = {
127
112
  },
128
113
  onFinishClick: {
129
114
  control: false,
130
- description: 'The function to call when the finish button is clicked.',
131
115
  table: {
132
116
  category: 'Callbacks',
133
117
  type: {
@@ -137,7 +121,6 @@ const meta: Meta = {
137
121
  },
138
122
  onStepClick: {
139
123
  control: false,
140
- description: 'The function to call when a step is clicked ont he legend.',
141
124
  table: {
142
125
  category: 'Callbacks',
143
126
  type: {
@@ -147,7 +130,6 @@ const meta: Meta = {
147
130
  },
148
131
  onNextClick: {
149
132
  control: false,
150
- description: 'The function to call when the next button is clicked.',
151
133
  table: {
152
134
  category: 'Callbacks',
153
135
  type: {
@@ -157,7 +139,6 @@ const meta: Meta = {
157
139
  },
158
140
  children: {
159
141
  control: false,
160
- description: 'Any item passed to this component as a child will be rendered as a step.',
161
142
  table: {
162
143
  category: 'Props',
163
144
  type: {
@@ -1,14 +1,22 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
3
  export interface StepperProps {
4
+ /** An array of step objects that define the stepper navigation. */
4
5
  steps: Step[];
5
6
  currentStep?: number;
7
+ /** The header content for the legend. */
6
8
  legendHeader?: ReactNode;
9
+ /** The footer content for the legend. */
7
10
  legendFooter?: ReactNode;
11
+ /** The function to call when the back button is clicked. */
8
12
  onBackClick: () => void;
13
+ /** The function to call when the next button is clicked. */
9
14
  onNextClick: () => void;
15
+ /** The function to call when the finish button is clicked. */
10
16
  onFinishClick: () => void;
17
+ /** Any item passed to this component as a child will be rendered as a step. */
11
18
  children: React.ReactNode;
19
+ /** The function to call when a step is clicked ont he legend. */
12
20
  onStepClick: (step: number) => void;
13
21
  }
14
22
 
@@ -19,6 +27,7 @@ export interface StepperLegendProps {
19
27
  }
20
28
 
21
29
  export interface Step {
30
+ /** Display text for the step in the sidebar/legend */
22
31
  label: string;
23
32
  isCompleted?: boolean;
24
33
  isNextDisabled?: boolean;
@@ -13,8 +13,6 @@ const meta: Meta = {
13
13
  argTypes: {
14
14
  columns: {
15
15
  control: false,
16
- description:
17
- 'The columns to display in the table. All columns require a unique id property. For pinned columns, please see the pinned example below.',
18
16
  table: {
19
17
  category: 'Data',
20
18
  type: { summary: 'array' },
@@ -23,7 +21,6 @@ const meta: Meta = {
23
21
  },
24
22
  isFullHeight: {
25
23
  control: 'boolean',
26
- description: 'Enables height to be set to the full height of the container',
27
24
  table: {
28
25
  category: 'Styling',
29
26
  type: { summary: 'boolean' },
@@ -32,8 +29,6 @@ const meta: Meta = {
32
29
  },
33
30
  data: {
34
31
  control: false,
35
- description:
36
- 'Its highly recommended that your data have a unique identifier (keyField). The default keyField is id. If you need to override this value then use the keyField proeprty below',
37
32
  table: {
38
33
  category: 'Data',
39
34
  type: { summary: 'array' },
@@ -42,7 +37,6 @@ const meta: Meta = {
42
37
  },
43
38
  isDisabled: {
44
39
  control: 'boolean',
45
- description: 'Disables the Table section',
46
40
  table: {
47
41
  category: 'Styling',
48
42
  type: {
@@ -53,7 +47,6 @@ const meta: Meta = {
53
47
  },
54
48
  isLoading: {
55
49
  control: 'boolean',
56
- description: 'It sets the loading of the table',
57
50
  table: {
58
51
  category: 'Styling',
59
52
  type: {
@@ -65,8 +58,6 @@ const meta: Meta = {
65
58
  direction: {
66
59
  control: 'select',
67
60
  options: ['auto', 'ltr', 'rtl'],
68
- description:
69
- 'Accepts: ltr, rtl, or auto. When set to auto (default), RDT will attempt to detect direction by checking the HTML and DIV tags. For cases where you need to force rtl, or ltr just set this option manually (i.e. SSR).',
70
61
  table: {
71
62
  category: 'Accessibility',
72
63
  defaultValue: { summary: 'auto' },
@@ -75,8 +66,6 @@ const meta: Meta = {
75
66
 
76
67
  title: {
77
68
  control: 'text',
78
- description:
79
- 'The title displayed in the Table Header. If you do not provide the title property the Table Header will not be rendered',
80
69
  table: {
81
70
  category: 'Styling',
82
71
  type: {
@@ -87,7 +76,6 @@ const meta: Meta = {
87
76
  },
88
77
  responsive: {
89
78
  control: 'boolean',
90
- description: 'Makes the table horizontally scrollable on smaller screen widths',
91
79
  table: {
92
80
  category: 'Accessibility',
93
81
  type: {
@@ -98,8 +86,6 @@ const meta: Meta = {
98
86
  },
99
87
  dense: {
100
88
  control: 'boolean',
101
- description:
102
- 'Compacts the row height. can be overridden via theming rows.denseHeight. Note: If any custom elements exceed the dense height then the row will only compact to the tallest element any of your cells',
103
89
  table: {
104
90
  category: 'Accessibility',
105
91
  type: {
@@ -110,8 +96,6 @@ const meta: Meta = {
110
96
  },
111
97
  noHeader: {
112
98
  control: 'boolean',
113
- description:
114
- 'Removes the table header. title, contextTitle and contextActions will be ignored',
115
99
  table: {
116
100
  category: 'Styling',
117
101
  type: {
@@ -122,7 +106,6 @@ const meta: Meta = {
122
106
  },
123
107
  noTableHead: {
124
108
  control: 'boolean',
125
- description: 'Hides the the sort columns and titles (TableHead)',
126
109
  table: {
127
110
  category: 'Styling',
128
111
  type: {
@@ -133,7 +116,6 @@ const meta: Meta = {
133
116
  },
134
117
  onSort: {
135
118
  control: false,
136
- description: 'Callback to access the sort state when a column is clicked. Returns',
137
119
  table: {
138
120
  category: 'Callbacks',
139
121
  type: {
@@ -144,7 +126,6 @@ const meta: Meta = {
144
126
  },
145
127
  subHeader: {
146
128
  control: 'boolean',
147
- description: 'Show a sub header between the table and table header',
148
129
  table: {
149
130
  category: 'Styling',
150
131
  type: {
@@ -155,7 +136,6 @@ const meta: Meta = {
155
136
  },
156
137
  subHeaderComponent: {
157
138
  control: false,
158
- description: 'A component you want to render',
159
139
  table: {
160
140
  category: 'Components',
161
141
  type: {
@@ -166,7 +146,6 @@ const meta: Meta = {
166
146
  },
167
147
  paginationPerPage: {
168
148
  control: 'number',
169
- description: 'The default rows per page to use when the table initially loads',
170
149
  table: {
171
150
  category: 'Add-Ons',
172
151
  type: {
@@ -177,7 +156,6 @@ const meta: Meta = {
177
156
  },
178
157
  noDataComponent: {
179
158
  control: false,
180
- description: 'A custom component to display when there are no records to display',
181
159
  table: {
182
160
  category: 'Components',
183
161
  type: {
@@ -188,8 +166,6 @@ const meta: Meta = {
188
166
  },
189
167
  expandableRows: {
190
168
  control: 'boolean',
191
- description:
192
- 'Whether to make a row expandable, if true it requires an expandableRowsComponent. It is highly recommended your data set have a unique identifier defined as the keyField for row expansion to work properly.',
193
169
  table: {
194
170
  category: 'Add-Ons',
195
171
  type: {
@@ -200,8 +176,6 @@ const meta: Meta = {
200
176
  },
201
177
  clearSelectedRows: {
202
178
  control: 'boolean',
203
- description:
204
- 'Toggling this property clears the selectedRows. If you use redux or react state you need to make sure that you pass a toggled value or the component will not update',
205
179
  table: {
206
180
  category: 'Styling',
207
181
  type: {
@@ -212,8 +186,6 @@ const meta: Meta = {
212
186
  },
213
187
  pagination: {
214
188
  control: 'boolean',
215
- description:
216
- 'Enable pagination with defaults. by default the total record set will be sliced depending on the page, rows per page. if you wish to use server side pagination then use the paginationServer property',
217
189
  table: {
218
190
  category: 'Add-Ons',
219
191
  type: {
@@ -224,7 +196,6 @@ const meta: Meta = {
224
196
  },
225
197
  selectableRows: {
226
198
  control: 'boolean',
227
- description: 'Whether to show selectable checkboxes',
228
199
  table: {
229
200
  category: 'Add-Ons',
230
201
  type: {
@@ -236,7 +207,6 @@ const meta: Meta = {
236
207
 
237
208
  striped: {
238
209
  control: 'boolean',
239
- description: 'Stripe/band color the odd rows',
240
210
  table: {
241
211
  category: 'Accessibility',
242
212
  type: {
@@ -247,23 +217,18 @@ const meta: Meta = {
247
217
  },
248
218
  totalEntriesText: {
249
219
  control: 'text',
250
- description:
251
- 'The text to display in the total entries section. This is hidden if 1. No pagination exists, 2. No string is passed.',
252
220
  table: {
253
221
  category: 'Styling',
254
222
  },
255
223
  },
256
224
  canPinColumns: {
257
225
  control: 'boolean',
258
- description:
259
- 'Allows the pinning of columns to the left hand side. This is required when using the column pin API',
260
226
  table: {
261
227
  category: 'Add-Ons',
262
228
  },
263
229
  },
264
230
  onPinnedColumnsChange: {
265
231
  control: false,
266
- description: 'Callback that receives the IDs of the pinned columns when they change.',
267
232
  table: {
268
233
  category: 'Add-Ons',
269
234
  },
@@ -21,13 +21,22 @@ export type TableColumn<T> = PinnableColumn<T>;
21
21
 
22
22
  export interface TableProps<T>
23
23
  extends Omit<IDataTableProps<T>, 'paginationComponent' | 'direction' | 'subHeaderAlign'> {
24
+ /** The columns to display in the table. All columns require a unique id property. For pinned columns, please see the pinned example below. */
24
25
  columns: TableColumn<T>[];
26
+ /** Disables the Table section */
25
27
  isDisabled?: boolean;
28
+ /** It sets the loading of the table */
26
29
  isLoading?: boolean;
30
+ /** Accepts: ltr, rtl, or auto. When set to auto (default), RDT will attempt to detect direction by checking the HTML and DIV tags. For cases where you need to force rtl, or ltr just set this option manually (i.e. SSR). */
27
31
  direction?: Direction;
32
+ /** Show a sub header between the table and table header */
28
33
  subHeaderAlign?: 'left' | 'right' | 'center';
34
+ /** Enables height to be set to the full height of the container */
29
35
  isFullHeight?: boolean;
36
+ /** The text to display in the total entries section. This is hidden if 1. No pagination exists, 2. No string is passed. */
30
37
  totalEntriesText?: string;
38
+ /** Allows the pinning of columns to the left hand side. This is required when using the column pin API */
31
39
  canPinColumns?: boolean;
40
+ /** Callback that receives the IDs of the pinned columns when they change. */
32
41
  onPinnedColumnsChange?: (pinnedColumnIds: any[]) => void;
33
42
  }
@@ -1,10 +1,15 @@
1
1
  import { Row, ColumnDef, SortingState } from '@tanstack/react-table';
2
2
 
3
3
  export type WithPaginationProps = {
4
+ /** Number of rows to display per pagination page. */
4
5
  rowsPerPage: number;
6
+ /** Total number of rows in the table. */
5
7
  rowCount: number;
8
+ /** Callback when the page changes. */
6
9
  onChangePage: (page: number) => void;
10
+ /** Current page number. */
7
11
  currentPage: number;
12
+ /** Text to display for the total number of entries. */
8
13
  totalEntriesText?: string;
9
14
  showPagination: true;
10
15
  };
@@ -21,27 +26,47 @@ export type WithoutPaginationProps = {
21
26
  export type PaginationProps = WithPaginationProps | WithoutPaginationProps;
22
27
 
23
28
  export type Props<T extends object> = {
29
+ /** Array of data items. These are the items that will be displayed in the table cell. */
24
30
  data: T[];
31
+ /** Striped rows */
25
32
  isStriped?: boolean;
33
+ /** Column definitions including an `id` field. This is how you define your table structure. */
26
34
  columns: ColumnDef<T & { id: string }>[];
35
+ /** Additional option for class names. */
27
36
  className?: string;
37
+ /** class name for styling the action bar. */
28
38
  actionBarClassName?: string;
39
+ /** Component for table actions with selected items. */
29
40
  TableActions?: React.ComponentType<{ selectedItems: Row<any>[]; unselectRows: () => void }>;
41
+ /** Error state of the table. */
30
42
  error?: {
31
43
  hasError: boolean;
32
44
  errorMessage?: string;
33
45
  };
46
+ /** Enables row selection or defines selection conditions. */
34
47
  enableRowSelection?: boolean | ((row: Row<T>) => boolean);
48
+ /** Function to clear applied filters. */
35
49
  clearFilters?: () => void;
50
+ /** Indicates if filters are applied. */
36
51
  hasFilters?: boolean;
52
+ /** When this is true, the table is considered to be in a loading state. */
37
53
  isLoading?: boolean;
54
+ /** Message to display when the table is loading. */
38
55
  isLoadingMessage?: string;
56
+ /** Columns that are pinned by default. */
39
57
  defaultPinnedColumns?: string[];
58
+ /** Callback when a row is clicked. */
40
59
  onClickRow?: ((row: Row<T>) => void) | null;
60
+ /** Callback when a row is clicked. */
41
61
  onRowClick?: (row: T) => void;
62
+ /** Array of active rows. */
42
63
  activeRows?: string[];
64
+ /** Row selection state. */
43
65
  rowSelection?: Record<string, boolean>;
66
+ /** Callback when a row is selected. */
44
67
  onRowSelectionChange?: (updater: Record<string, boolean>) => void;
68
+ /** Callback when all rows are selected. */
45
69
  onSelectAllChange?: (isSelected: boolean) => void;
70
+ /** You may pass a default sorting state to the table. This will be used to sort the table by default. This is useful if you want to sort the table by a column by default. */
46
71
  defaultSorting?: SortingState;
47
72
  } & PaginationProps;
@@ -27,8 +27,6 @@ const meta: Meta = {
27
27
  },
28
28
  argTypes: {
29
29
  defaultSorting: {
30
- description:
31
- 'You may pass a default sorting state to the table. This will be used to sort the table by default. This is useful if you want to sort the table by a column by default.',
32
30
  control: false,
33
31
  table: {
34
32
  category: 'Props',
@@ -36,7 +34,6 @@ const meta: Meta = {
36
34
  },
37
35
  },
38
36
  isStriped: {
39
- description: 'Striped rows',
40
37
  defaultValue: { summary: 'true' },
41
38
  control: { type: 'boolean' },
42
39
  table: {
@@ -45,8 +42,6 @@ const meta: Meta = {
45
42
  },
46
43
  },
47
44
  data: {
48
- description:
49
- 'Array of data items. These are the items that will be displayed in the table cell.',
50
45
  control: false,
51
46
  table: {
52
47
  category: 'Props',
@@ -54,8 +49,6 @@ const meta: Meta = {
54
49
  },
55
50
  },
56
51
  columns: {
57
- description:
58
- 'Column definitions including an `id` field. This is how you define your table structure.',
59
52
  control: false,
60
53
  table: {
61
54
  category: 'Props',
@@ -63,7 +56,6 @@ const meta: Meta = {
63
56
  },
64
57
  },
65
58
  className: {
66
- description: 'Additional option for class names.',
67
59
  control: false,
68
60
  table: {
69
61
  category: 'Props',
@@ -71,7 +63,6 @@ const meta: Meta = {
71
63
  },
72
64
  },
73
65
  actionBarClassName: {
74
- description: 'class name for styling the action bar.',
75
66
  control: false,
76
67
  table: {
77
68
  category: 'Props',
@@ -79,7 +70,6 @@ const meta: Meta = {
79
70
  },
80
71
  },
81
72
  TableActions: {
82
- description: 'Component for table actions with selected items.',
83
73
  control: false,
84
74
  table: {
85
75
  category: 'Props',
@@ -89,7 +79,6 @@ const meta: Meta = {
89
79
  },
90
80
  },
91
81
  error: {
92
- description: 'Error state of the table.',
93
82
  control: false,
94
83
  table: {
95
84
  category: 'Props',
@@ -97,7 +86,6 @@ const meta: Meta = {
97
86
  },
98
87
  },
99
88
  enableRowSelection: {
100
- description: 'Enables row selection or defines selection conditions.',
101
89
  control: { type: 'boolean' },
102
90
  table: {
103
91
  category: 'Props',
@@ -105,7 +93,6 @@ const meta: Meta = {
105
93
  },
106
94
  },
107
95
  clearFilters: {
108
- description: 'Function to clear applied filters.',
109
96
  action: 'clearFilters',
110
97
  control: false,
111
98
  table: {
@@ -114,7 +101,6 @@ const meta: Meta = {
114
101
  },
115
102
  },
116
103
  hasFilters: {
117
- description: 'Indicates if filters are applied.',
118
104
  control: { type: 'boolean' },
119
105
  table: {
120
106
  category: 'Props',
@@ -123,7 +109,6 @@ const meta: Meta = {
123
109
  },
124
110
  },
125
111
  isLoading: {
126
- description: 'When this is true, the table is considered to be in a loading state.',
127
112
  control: { type: 'boolean' },
128
113
  table: {
129
114
  category: 'Props',
@@ -132,7 +117,6 @@ const meta: Meta = {
132
117
  },
133
118
  },
134
119
  isLoadingMessage: {
135
- description: 'Message to display when the table is loading.',
136
120
  control: { type: 'text' },
137
121
  table: {
138
122
  category: 'Props',
@@ -141,7 +125,6 @@ const meta: Meta = {
141
125
  },
142
126
  },
143
127
  defaultPinnedColumns: {
144
- description: 'Columns that are pinned by default.',
145
128
  control: false,
146
129
  table: {
147
130
  category: 'Props',
@@ -149,7 +132,6 @@ const meta: Meta = {
149
132
  },
150
133
  },
151
134
  onClickRow: {
152
- description: 'Callback when a row is clicked.',
153
135
  action: 'onClickRow',
154
136
  control: false,
155
137
  table: {
@@ -158,7 +140,6 @@ const meta: Meta = {
158
140
  },
159
141
  },
160
142
  showPagination: {
161
- description: 'Toggles pagination display.',
162
143
  control: { type: 'boolean' },
163
144
  table: {
164
145
  category: 'Props',
@@ -167,7 +148,6 @@ const meta: Meta = {
167
148
  },
168
149
  },
169
150
  rowsPerPage: {
170
- description: 'Number of rows to display per pagination page.',
171
151
  control: { type: 'number' },
172
152
  table: {
173
153
  category: 'Props',
@@ -176,7 +156,6 @@ const meta: Meta = {
176
156
  },
177
157
  },
178
158
  rowCount: {
179
- description: 'Total number of rows in the table.',
180
159
  control: { type: 'number' },
181
160
  table: {
182
161
  category: 'Props',
@@ -185,7 +164,6 @@ const meta: Meta = {
185
164
  },
186
165
  },
187
166
  onChangePage: {
188
- description: 'Callback when the page changes.',
189
167
  action: 'onChangePage',
190
168
  control: false,
191
169
  table: {
@@ -194,7 +172,6 @@ const meta: Meta = {
194
172
  },
195
173
  },
196
174
  currentPage: {
197
- description: 'Current page number.',
198
175
  control: { type: 'number' },
199
176
  table: {
200
177
  category: 'Props',
@@ -203,7 +180,6 @@ const meta: Meta = {
203
180
  },
204
181
  },
205
182
  totalEntriesText: {
206
- description: 'Text to display for the total number of entries.',
207
183
  control: false,
208
184
  table: {
209
185
  category: 'Props',
@@ -212,7 +188,6 @@ const meta: Meta = {
212
188
  },
213
189
 
214
190
  onRowClick: {
215
- description: 'Callback when a row is clicked.',
216
191
  action: 'onRowClick',
217
192
  control: false,
218
193
  table: {
@@ -221,7 +196,6 @@ const meta: Meta = {
221
196
  },
222
197
  },
223
198
  activeRows: {
224
- description: 'Array of active rows.',
225
199
  control: false,
226
200
  table: {
227
201
  category: 'Props',
@@ -229,7 +203,6 @@ const meta: Meta = {
229
203
  },
230
204
  },
231
205
  onSelectAllChange: {
232
- description: 'Callback when all rows are selected.',
233
206
  action: 'onSelectAllChange',
234
207
  control: false,
235
208
  table: {
@@ -238,7 +211,6 @@ const meta: Meta = {
238
211
  },
239
212
  },
240
213
  onRowSelectionChange: {
241
- description: 'Callback when a row is selected.',
242
214
  action: 'onRowSelectionChange',
243
215
  control: false,
244
216
  table: {
@@ -247,7 +219,6 @@ const meta: Meta = {
247
219
  },
248
220
  },
249
221
  rowSelection: {
250
- description: 'Row selection state.',
251
222
  control: false,
252
223
  table: {
253
224
  category: 'Props',
@@ -36,7 +36,6 @@ const meta: Meta = {
36
36
  },
37
37
  argTypes: {
38
38
  table: {
39
- description: 'Table instance.',
40
39
  control: false,
41
40
  table: {
42
41
  category: 'Props',
@@ -44,7 +43,6 @@ const meta: Meta = {
44
43
  },
45
44
  },
46
45
  className: {
47
- description: 'class name for styling.',
48
46
  control: false,
49
47
  table: {
50
48
  category: 'Props',
@@ -52,7 +50,6 @@ const meta: Meta = {
52
50
  },
53
51
  },
54
52
  children: {
55
- description: 'React node to display in the action bar.',
56
53
  control: false,
57
54
  table: {
58
55
  category: 'Props',
@@ -60,7 +57,6 @@ const meta: Meta = {
60
57
  },
61
58
  },
62
59
  TableActions: {
63
- description: 'Component for table actions with selected items.',
64
60
  control: false,
65
61
  table: {
66
62
  category: 'Props',
@@ -4,12 +4,16 @@ import { Card } from '@/components/card';
4
4
  import classNames from 'classnames';
5
5
 
6
6
  type Props<T extends object> = {
7
+ /** Table instance. */
7
8
  table: Table<T & { id: string }>;
9
+ /** Component for table actions with selected items. */
8
10
  TableActions?: React.ComponentType<{
9
11
  selectedItems: Row<T & { id: string }>[];
10
12
  unselectRows: () => void;
11
13
  }>;
14
+ /** class name for styling. */
12
15
  className?: string;
16
+ /** React node to display in the action bar. */
13
17
  children?: React.ReactNode;
14
18
  };
15
19