@indico-data/design-system 3.0.10 → 3.2.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.
- package/.storybook/main.ts +3 -0
- package/lib/components/badge/types.d.ts +4 -0
- package/lib/components/button/types.d.ts +52 -2
- package/lib/components/card/Card.d.ts +5 -0
- package/lib/components/floatUI/types.d.ts +7 -0
- package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
- package/lib/components/forms/date/datePicker/types.d.ts +10 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -0
- package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
- package/lib/components/forms/radio/Radio.d.ts +6 -0
- package/lib/components/forms/select/Select.d.ts +10 -0
- package/lib/components/forms/textarea/Textarea.d.ts +7 -0
- package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.d.ts +7 -0
- package/lib/components/icons/types.d.ts +5 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
- package/lib/components/menu/Menu.d.ts +1 -0
- package/lib/components/modal/types.d.ts +22 -0
- package/lib/components/pagination/types.d.ts +4 -0
- package/lib/components/pill/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +2 -1
- package/lib/components/pill/types.d.ts +8 -2
- package/lib/components/skeleton/Skeleton.d.ts +5 -0
- package/lib/components/stepper/types.d.ts +9 -0
- package/lib/components/table/types.d.ts +9 -0
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
- package/lib/components/tooltip/Tooltip.d.ts +6 -0
- package/lib/components/truncate/types.d.ts +4 -0
- package/lib/index.css +4977 -5020
- package/lib/index.d.ts +268 -5
- package/lib/index.esm.css +4977 -5020
- package/lib/index.esm.js +3 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -1
- package/package.json +2 -1
- package/src/components/badge/Badge.stories.tsx +0 -4
- package/src/components/badge/types.ts +4 -0
- package/src/components/button/Button.stories.tsx +5 -18
- package/src/components/button/types.ts +52 -2
- package/src/components/card/Card.stories.tsx +0 -5
- package/src/components/card/Card.tsx +5 -0
- package/src/components/floatUI/FloatUI.stories.tsx +0 -11
- package/src/components/floatUI/types.ts +7 -0
- package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
- package/src/components/forms/checkbox/Checkbox.tsx +7 -0
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
- package/src/components/forms/date/datePicker/types.ts +10 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
- package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
- package/src/components/forms/numberInput/NumberInput.tsx +4 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
- package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
- package/src/components/forms/radio/Radio.stories.tsx +0 -6
- package/src/components/forms/radio/Radio.tsx +6 -0
- package/src/components/forms/select/Select.stories.tsx +1 -14
- package/src/components/forms/select/Select.tsx +10 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
- package/src/components/forms/textarea/Textarea.tsx +7 -0
- package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
- package/src/components/forms/timePicker/TimePicker.tsx +5 -0
- package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
- package/src/components/forms/toggle/Toggle.tsx +7 -0
- package/src/components/icons/Icon.stories.tsx +0 -7
- package/src/components/icons/types.ts +5 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
- package/src/components/menu/Menu.stories.tsx +0 -3
- package/src/components/menu/Menu.tsx +1 -0
- package/src/components/modal/Modal.stories.tsx +1 -25
- package/src/components/modal/types.ts +22 -0
- package/src/components/pagination/Pagination.stories.tsx +0 -4
- package/src/components/pagination/types.ts +4 -0
- package/src/components/pill/Pill.mdx +6 -2
- package/src/components/pill/Pill.stories.tsx +50 -61
- package/src/components/pill/Pill.tsx +4 -2
- package/src/components/pill/__tests__/Pill.test.tsx +28 -10
- package/src/components/pill/styles/Pill.scss +12 -129
- package/src/components/pill/types.ts +8 -2
- package/src/components/skeleton/Skeleton.stories.tsx +0 -7
- package/src/components/skeleton/Skeleton.tsx +5 -0
- package/src/components/stepper/Stepper.stories.tsx +0 -19
- package/src/components/stepper/types.ts +9 -0
- package/src/components/table/Table.stories.tsx +0 -35
- package/src/components/table/types.ts +9 -0
- package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
- package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
- package/src/components/tooltip/Tooltip.stories.tsx +0 -8
- package/src/components/tooltip/Tooltip.tsx +6 -0
- package/src/components/truncate/Truncate.stories.tsx +0 -8
- package/src/components/truncate/types.ts +4 -0
- package/src/styles/_colors.scss +9 -0
- package/src/styles/globals.scss +22 -0
- package/src/styles/index.scss +11 -10
- package/src/styles/variables/_colors.scss +269 -2
- package/src/types.ts +12 -8
- package/src/styles/variables/themes/dark.scss +0 -267
- package/src/styles/variables/themes/light.scss +0 -266
|
@@ -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
|
|
|
@@ -9,8 +9,6 @@ const meta: Meta = {
|
|
|
9
9
|
argTypes: {
|
|
10
10
|
id: {
|
|
11
11
|
control: false,
|
|
12
|
-
description:
|
|
13
|
-
"The id of the tooltip. This needs to match the element that holds it's data attribute",
|
|
14
12
|
table: {
|
|
15
13
|
category: 'Props',
|
|
16
14
|
type: {
|
|
@@ -20,7 +18,6 @@ const meta: Meta = {
|
|
|
20
18
|
},
|
|
21
19
|
place: {
|
|
22
20
|
control: 'select',
|
|
23
|
-
description: 'The placement of the tooltip',
|
|
24
21
|
options: ['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom'],
|
|
25
22
|
table: {
|
|
26
23
|
category: 'Props',
|
|
@@ -31,7 +28,6 @@ const meta: Meta = {
|
|
|
31
28
|
},
|
|
32
29
|
clickToShow: {
|
|
33
30
|
control: 'boolean',
|
|
34
|
-
description: 'Whether the tooltip should be shown on click',
|
|
35
31
|
table: {
|
|
36
32
|
category: 'Props',
|
|
37
33
|
type: {
|
|
@@ -41,7 +37,6 @@ const meta: Meta = {
|
|
|
41
37
|
},
|
|
42
38
|
delayShow: {
|
|
43
39
|
control: 'number',
|
|
44
|
-
description: 'The delay in milliseconds before the tooltip is shown',
|
|
45
40
|
table: {
|
|
46
41
|
category: 'Props',
|
|
47
42
|
type: {
|
|
@@ -51,7 +46,6 @@ const meta: Meta = {
|
|
|
51
46
|
},
|
|
52
47
|
delayHide: {
|
|
53
48
|
control: 'number',
|
|
54
|
-
description: 'The delay in milliseconds before the tooltip is hidden',
|
|
55
49
|
table: {
|
|
56
50
|
category: 'Props',
|
|
57
51
|
type: {
|
|
@@ -61,7 +55,6 @@ const meta: Meta = {
|
|
|
61
55
|
},
|
|
62
56
|
zIndex: {
|
|
63
57
|
control: 'number',
|
|
64
|
-
description: 'This is an override for the z-index of the tooltip',
|
|
65
58
|
table: {
|
|
66
59
|
category: 'Props',
|
|
67
60
|
type: {
|
|
@@ -71,7 +64,6 @@ const meta: Meta = {
|
|
|
71
64
|
},
|
|
72
65
|
children: {
|
|
73
66
|
control: false,
|
|
74
|
-
description: 'The content of the tooltip',
|
|
75
67
|
table: {
|
|
76
68
|
category: 'Props',
|
|
77
69
|
type: {
|
|
@@ -2,12 +2,18 @@ import { PlacesType, Tooltip as ReactTooltip } from 'react-tooltip';
|
|
|
2
2
|
|
|
3
3
|
interface TooltipProps {
|
|
4
4
|
id: string;
|
|
5
|
+
/** Whether the tooltip should be shown on click */
|
|
5
6
|
clickToShow?: boolean;
|
|
7
|
+
/** The delay in milliseconds before the tooltip is shown */
|
|
6
8
|
delayShow?: number;
|
|
9
|
+
/** The delay in milliseconds before the tooltip is hidden */
|
|
7
10
|
delayHide?: number;
|
|
8
11
|
children: React.ReactNode;
|
|
12
|
+
/** This is an override for the z-index of the tooltip */
|
|
9
13
|
zIndex?: number;
|
|
14
|
+
/** The placement of the tooltip */
|
|
10
15
|
place?: PlacesType;
|
|
16
|
+
/** The content of the tooltip */
|
|
11
17
|
[key: string]: any;
|
|
12
18
|
}
|
|
13
19
|
|
|
@@ -16,8 +16,6 @@ const meta: Meta<typeof Truncate> = {
|
|
|
16
16
|
truncateString: {
|
|
17
17
|
required: true,
|
|
18
18
|
control: 'text',
|
|
19
|
-
description:
|
|
20
|
-
'The string to truncate. This value will also be displayed in the tooltip when the text is truncated.',
|
|
21
19
|
table: {
|
|
22
20
|
category: 'Props',
|
|
23
21
|
},
|
|
@@ -25,16 +23,12 @@ const meta: Meta<typeof Truncate> = {
|
|
|
25
23
|
lineClamp: {
|
|
26
24
|
control: 'number',
|
|
27
25
|
defaultValue: 0,
|
|
28
|
-
description:
|
|
29
|
-
'The number of lines to truncate the text to. If left blank, it will default to 1 line.',
|
|
30
26
|
table: {
|
|
31
27
|
category: 'Props',
|
|
32
28
|
},
|
|
33
29
|
},
|
|
34
30
|
tooltipId: {
|
|
35
31
|
control: 'text',
|
|
36
|
-
description:
|
|
37
|
-
'The id of the tooltip. If an ID is not provided, it will generate one from uuid',
|
|
38
32
|
table: {
|
|
39
33
|
category: 'Props',
|
|
40
34
|
},
|
|
@@ -42,8 +36,6 @@ const meta: Meta<typeof Truncate> = {
|
|
|
42
36
|
hasTooltip: {
|
|
43
37
|
control: 'boolean',
|
|
44
38
|
defaultValue: true,
|
|
45
|
-
description:
|
|
46
|
-
'Whether to show the tooltip. If left blank, it will default to true. If set to false, the tooltip will not be shown.',
|
|
47
39
|
table: {
|
|
48
40
|
category: 'Props',
|
|
49
41
|
},
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export interface TruncateProps {
|
|
2
|
+
/** The number of lines to truncate the text to. If left blank, it will default to 1 line. */
|
|
2
3
|
lineClamp?: number;
|
|
4
|
+
/** The string to truncate. This value will also be displayed in the tooltip when the text is truncated. */
|
|
3
5
|
truncateString: string;
|
|
6
|
+
/** Whether to show the tooltip. If left blank, it will default to true. If set to false, the tooltip will not be shown. */
|
|
4
7
|
hasTooltip?: boolean;
|
|
8
|
+
/** The id of the tooltip. If an ID is not provided, it will generate one from uuid */
|
|
5
9
|
tooltipId?: string;
|
|
6
10
|
[key: string]: any;
|
|
7
11
|
}
|
package/src/styles/_colors.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
$color-names: 'primary', 'secondary', 'tertiary', 'gray', 'red', 'orange', 'yellow', 'green',
|
|
2
2
|
'purple', 'pink', 'teal', 'brand';
|
|
3
|
+
$chromatic-color-names: 'blue', 'purple', 'red', 'yellow', 'gray', 'green', 'pink', 'orange', 'teal';
|
|
3
4
|
$color-grades: ();
|
|
4
5
|
@for $i from 1 through 20 {
|
|
5
6
|
$color-grades: append($color-grades, #{$i * 50}, comma);
|
|
@@ -42,3 +43,11 @@ $utility-color-names: 'success', 'info', 'neutral', 'warning', 'error', 'brand';
|
|
|
42
43
|
.active-link-color {
|
|
43
44
|
color: var(--pf-active-link-color);
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
$item-shades-to-color-number: (
|
|
48
|
+
1: 450,
|
|
49
|
+
2: 500,
|
|
50
|
+
3: 550,
|
|
51
|
+
4: 600,
|
|
52
|
+
5: 700,
|
|
53
|
+
);
|