@indico-data/design-system 2.57.0 → 2.58.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indico-data/design-system",
3
- "version": "2.57.0",
3
+ "version": "2.58.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "lib/index.js",
@@ -55,6 +55,7 @@
55
55
  "react-modal": "^3.16.1",
56
56
  "react-popper": "^2.3.0",
57
57
  "react-stately": "^3.31.0",
58
+ "react-toastify": "^11.0.5",
58
59
  "react-tooltip": "5.28.0",
59
60
  "svgo": "^3.2.2",
60
61
  "ts-jest": "^29.3.1",
@@ -26,3 +26,4 @@ export { Tooltip } from './tooltip';
26
26
  export { BarSpinner } from './loading-indicators/BarSpinner/BarSpinner';
27
27
  export { CirclePulse } from './loading-indicators/CirclePulse/CirclePulse';
28
28
  export { Truncate } from './truncate';
29
+ export { toast, ToastContainer } from 'react-toastify';
@@ -0,0 +1,14 @@
1
+ import { Canvas, Meta, Controls, Story } from '@storybook/blocks';
2
+ import * as Toast from './Toast.stories';
3
+
4
+ <Meta title="Components/Toast" of={Toast} />
5
+
6
+ # Toast
7
+
8
+ The Toast component is used to display a toast message. A Toast message is a notification that appears at the top of the screen to provide feedback to the user. This is a wrapper around the `react-toastify` library. To view their documentation, please visit [react-toastify](https://fkhadra.github.io/react-toastify/introduction).
9
+
10
+ <Canvas of={Toast.Default} />
11
+
12
+ ### The following props are available for the Toast component, but not limited to:
13
+
14
+ <Controls of={Toast.Default} />
@@ -0,0 +1,55 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { toast, ToastContainer } from './index';
3
+ import { Button } from '../button';
4
+
5
+ const meta: Meta<typeof ToastContainer> = {
6
+ title: 'Components/Toast',
7
+ component: ToastContainer,
8
+ argTypes: {
9
+ position: {
10
+ control: 'select',
11
+ options: [
12
+ 'top-right',
13
+ 'top-center',
14
+ 'top-left',
15
+ 'bottom-right',
16
+ 'bottom-center',
17
+ 'bottom-left',
18
+ ],
19
+ },
20
+ theme: {
21
+ control: 'select',
22
+ options: ['light', 'dark'],
23
+ },
24
+ autoClose: {
25
+ control: 'number',
26
+ },
27
+ },
28
+ decorators: [
29
+ (Story) => (
30
+ <div style={{ height: '400px' }}>
31
+ <Story />
32
+ </div>
33
+ ),
34
+ ],
35
+ };
36
+
37
+ export default meta;
38
+
39
+ type Story = StoryObj<typeof ToastContainer>;
40
+
41
+ export const Default: Story = {
42
+ args: {
43
+ position: 'top-right',
44
+ theme: 'dark',
45
+ autoClose: 3000,
46
+ },
47
+ render: (args) => (
48
+ <div>
49
+ <Button ariaLabel="Click me" onClick={() => toast('Hello World')}>
50
+ Fire a toast
51
+ </Button>
52
+ <ToastContainer {...args} />
53
+ </div>
54
+ ),
55
+ };
@@ -0,0 +1 @@
1
+ export { toast, ToastContainer } from 'react-toastify';
@@ -0,0 +1,17 @@
1
+ // Common Variables
2
+ :root,
3
+ :root [data-theme='light'],
4
+ :root [data-theme='dark'] {
5
+ --toastify-color-dark: var(--pf-background-color-light);
6
+ --toastify-color-progress-dark: var(--pf-primary-color-400);
7
+ --toastify-icon-color-success: var(--pf-success-color);
8
+ --toastify-color-progress-bgo: 0.2;
9
+ }
10
+
11
+ // Dark Theme Specific Variables
12
+ :root [data-theme='dark'] {
13
+ --toastify-color-dark: var(--pf-background-color-light);
14
+ --toastify-color-progress-dark: var(--pf-primary-color-400);
15
+ --toastify-icon-color-success: var(--pf-success-color);
16
+ --toastify-color-progress-bgo: 0.2;
17
+ }
package/src/index.ts CHANGED
@@ -35,10 +35,12 @@ export { BarSpinner } from './components/loading-indicators/BarSpinner/BarSpinne
35
35
  export { Truncate } from './components/truncate';
36
36
  // Utilities
37
37
  export { registerFontAwesomeIcons } from './setup/setupIcons';
38
+ export { toast, ToastContainer } from './components/toast';
38
39
 
39
40
  // Types
40
41
  export type {
41
42
  ColumnDef,
43
+ Column as TanstackTableColumnType,
42
44
  Row as TanstackTableRowType,
43
45
  Table as TanstackTableType,
44
46
  } from '@tanstack/react-table';
@@ -30,6 +30,7 @@
30
30
  @import '../components/loading-indicators/BarSpinner/styles/BarSpinner.scss';
31
31
  @import '../components/loading-indicators/CirclePulse/CirclePulse.scss';
32
32
  @import '../components/truncate/styles/Truncate.scss';
33
+ @import '../components/toast/styles/Toast.scss';
33
34
  @import 'sheets'; // Port to an sheets component when we build it
34
35
  @import 'typography';
35
36
  @import 'colors';
@@ -12,125 +12,150 @@ export const colorList = [
12
12
  export const utilityColorList = ['success', 'info', 'neutral', 'warning', 'error', 'brand'];
13
13
  export const lightThemeColors = {
14
14
  primary: {
15
- base: '#6833D0',
16
- 100: '#F0EBFA',
17
- 200: '#D5C6F2',
18
- 300: '#BAA1E9',
19
- 400: '#8C64DB',
20
- 500: '#6833D0',
21
- 600: '#5E2EBB',
22
- 700: '#5329A6',
23
- 800: '#492492',
24
- 900: '#3E1F7D',
15
+ base: '#b4cadf',
16
+ 50: '#5b8ab7',
17
+ 100: '#6d96c3',
18
+ 200: '#7b9fc5',
19
+ 300: '#90adc8',
20
+ 400: '#a3bdd4',
21
+ 500: '#b4cadf',
22
+ 600: '#c4d8eb',
23
+ 700: '#d2e1f0',
24
+ 800: '#dfeaf3',
25
+ 900: '#eef4fa',
26
+ 950: '#f6f9fc',
25
27
  },
26
28
  secondary: {
27
- base: '#0070F5',
28
- 100: '#DCEAFD',
29
- 200: '#B3D4FC',
30
- 300: '#7AB5FA',
31
- 400: '#4797F5',
32
- 500: '#0070F5',
33
- 600: '#0067E1',
34
- 700: '#005AC4',
35
- 800: '#004EAC',
36
- 900: '#004393',
29
+ base: '#3892f3',
30
+ 50: '#002b66',
31
+ 100: '#003b8c',
32
+ 200: '#004cb0',
33
+ 300: '#0060d6',
34
+ 400: '#0070f5',
35
+ 500: '#3892f3',
36
+ 550: '#66adff',
37
+ 600: '#91c5ff',
38
+ 700: '#b8dbff',
39
+ 800: '#d4eaff',
40
+ 900: '#e0f2ff',
41
+ 950: '#eaf4ff',
37
42
  },
38
43
  tertiary: {
39
- base: '#0070F5',
40
- 100: '#DCEAFD',
41
- 200: '#B3D4FC',
42
- 300: '#7AB5FA',
43
- 400: '#4797F5',
44
- 500: '#0070F5',
45
- 600: '#0067E1',
46
- 700: '#005AC4',
47
- 800: '#004EAC',
48
- 900: '#004393',
44
+ base: '#8394a9',
45
+ 50: '#142838',
46
+ 100: '#203148',
47
+ 200: '#2e4563',
48
+ 300: '#3e587a',
49
+ 400: '#55677f',
50
+ 450: '#6d8097',
51
+ 500: '#8394a9',
52
+ 600: '#93a3bb',
53
+ 700: '#a5b4c6',
54
+ 800: '#b2bfd0',
55
+ 900: '#c4ccd7',
56
+ 950: '#d6dde5',
49
57
  },
50
58
  gray: {
51
- base: '#444444',
52
- 100: '#EEEEEE',
53
- 200: '#D0D0D0',
54
- 300: '#A9A9A9',
55
- 400: '#737373',
56
- 500: '#444444',
57
- 600: '#373737',
58
- 700: '#2C2C2C',
59
- 800: '#1F1F1F',
60
- 900: '#141414',
59
+ base: '#525252',
60
+ 50: '#0a0a0a',
61
+ 100: '#171717',
62
+ 200: '#262626',
63
+ 300: '#404040',
64
+ 400: '#525252',
65
+ 450: '#737373',
66
+ 500: '#737373',
67
+ 600: '#989898',
68
+ 700: '#bdbdbd',
69
+ 800: '#dcdcdc',
70
+ 900: '#efefef',
71
+ 950: '#f6f6f6',
61
72
  },
62
73
  red: {
63
- base: '#E72326',
64
- 100: '#FFD6D6',
65
- 200: '#F49EA0',
66
- 300: '#EF696B',
67
- 400: '#EB4649',
68
- 500: '#E72326',
69
- 600: '#D52023',
70
- 700: '#C21D20',
71
- 800: '#B01B1D',
72
- 900: '#9D181A',
74
+ base: '#f4a5ae',
75
+ 50: '#5b0d16',
76
+ 100: '#761821',
77
+ 200: '#8f252f',
78
+ 300: '#ad303d',
79
+ 350: '#b8424c',
80
+ 400: '#c84a57',
81
+ 450: '#dc5a66',
82
+ 500: '#f4a5ae',
83
+ 600: '#ebb6b8',
84
+ 700: '#f9d5dc',
85
+ 800: '#f4d7d8',
86
+ 850: '#fae9e9',
87
+ 900: '#fcebeb',
88
+ 950: '#fcf5f4',
73
89
  },
74
90
  orange: {
75
- base: '#FFA424',
76
- 100: '#FFDFB2',
77
- 200: '#FFD292',
78
- 300: '#FFC471',
79
- 400: '#FFB650',
80
- 500: '#FFA424',
81
- 600: '#F29C22',
82
- 700: '#E69420',
83
- 800: '#CC831D',
84
- 900: '#B37319',
91
+ base: '#ff873f',
92
+ 50: '#721e01',
93
+ 100: '#992702',
94
+ 200: '#b33403',
95
+ 300: '#d94b04',
96
+ 400: '#f25c05',
97
+ 500: '#ff873f',
98
+ 600: '#ffa26d',
99
+ 700: '#ffc9aa',
100
+ 800: '#ffe3d1',
101
+ 900: '#fff3ec',
102
+ 950: '#fffaf7',
85
103
  },
86
104
  yellow: {
87
- base: '#F29C22',
88
- 100: '#FFF9D6',
89
- 200: '#FFEDAC',
90
- 300: '#FFE182',
91
- 400: '#FFD558',
92
- 500: '#F29C22',
93
- 600: '#E69420',
94
- 700: '#CC831D',
95
- 800: '#B37319',
96
- 900: '#9D6616',
105
+ base: '#ffa400',
106
+ 50: '#312602',
107
+ 100: '#664200',
108
+ 200: '#895c00',
109
+ 300: '#b37300',
110
+ 400: '#e08e00',
111
+ 500: '#ffa400',
112
+ 600: '#ffb621',
113
+ 700: '#ffc344',
114
+ 800: '#ffd369',
115
+ 900: '#ffeaa1',
116
+ 950: '#fff4d0',
97
117
  },
98
118
  green: {
99
- base: '#008A00',
100
- 100: '#D6ECD6',
101
- 200: '#99D099',
102
- 300: '#66B966',
103
- 400: '#33A133',
104
- 500: '#008A00',
105
- 600: '#007C00',
106
- 700: '#006E00',
107
- 800: '#006100',
108
- 900: '#005300',
119
+ base: '#39c29d',
120
+ 50: '#003325',
121
+ 100: '#075f48',
122
+ 200: '#0a906c',
123
+ 300: '#03aaaa',
124
+ 400: '#26b890',
125
+ 500: '#39c29d',
126
+ 600: '#52ccae',
127
+ 700: '#6cd6ba',
128
+ 800: '#83e2c7',
129
+ 900: '#c1f1e2',
130
+ 950: '#83e2c7',
109
131
  },
110
132
  purple: {
111
- base: '#8B60C7',
112
- 100: '#ECE2FA',
113
- 200: '#D5C4F5',
114
- 300: '#BAA1E9',
115
- 400: '#8C64DB',
116
- 500: '#6833D0',
117
- 600: '#5E2EBB',
118
- 700: '#5329A6',
119
- 800: '#492492',
120
- 900: '#3E1F7D',
133
+ base: '#9776d3',
134
+ 50: '#291a40',
135
+ 100: '#55377b',
136
+ 200: '#664196',
137
+ 300: '#7a4eb3',
138
+ 400: '#8b60c7',
139
+ 500: '#9776d3',
140
+ 600: '#b6a3e2',
141
+ 700: '#cfc4ee',
142
+ 800: '#e4dff5',
143
+ 900: '#f1edfa',
144
+ 950: '#f7f6fc',
121
145
  },
122
146
  utility: {
123
- success: '#168116',
124
- info: '#2070D1',
125
- neutral: '#BFC1C3',
126
- warning: '#C7892F',
127
- error: '#D52023',
128
- brand: '#0070F5',
147
+ success: '#39c29d',
148
+ info: '#004cb0',
149
+ neutral: '#171717',
150
+ warning: '#b37300',
151
+ error: '#f4a5ae',
152
+ brand: '#0070f5',
129
153
  },
130
154
  } as Record<string, any>;
131
155
 
132
156
  export const darkThemeColors = {
133
157
  primary: {
158
+ base: '#394c6b',
134
159
  50: '#bcc7da',
135
160
  100: '#7989b5',
136
161
  200: '#8593b3',
@@ -144,19 +169,22 @@ export const darkThemeColors = {
144
169
  950: '#0c141d',
145
170
  },
146
171
  secondary: {
172
+ base: '#198bdc',
147
173
  50: '#bddffa',
148
174
  100: '#83c5f6',
149
175
  200: '#68afee',
150
176
  300: '#66a2d5',
151
177
  400: '#36a1ea',
152
178
  500: '#198bdc',
153
- 600: '#0070f5',
179
+ 550: '#0070f5',
180
+ 600: '#2f6a98',
154
181
  700: '#0c6ebd',
155
182
  800: '#0b5899',
156
183
  900: '#002c4e',
157
184
  950: '#112341',
158
185
  },
159
186
  tertiary: {
187
+ base: '#40464e',
160
188
  50: '#dae3eb',
161
189
  100: '#c2d4df',
162
190
  200: '#a3b2c9',
@@ -171,6 +199,7 @@ export const darkThemeColors = {
171
199
  950: '#283243',
172
200
  },
173
201
  gray: {
202
+ base: '#525252',
174
203
  50: '#f6f6f6',
175
204
  100: '#efefef',
176
205
  200: '#dcdcdc',
@@ -182,21 +211,27 @@ export const darkThemeColors = {
182
211
  700: '#262626',
183
212
  800: '#171717',
184
213
  900: '#0a0a0a',
214
+ 950: '#000000',
185
215
  },
186
216
  red: {
217
+ base: '#ce6068',
187
218
  50: '#fcf5f4',
188
219
  100: '#fae9e9',
189
220
  200: '#f4d7d8',
190
221
  300: '#ebb6b8',
191
- 400: '#df8d91',
222
+ 350: '#f39bb9',
223
+ 400: '#ef76a0',
224
+ 450: '#df8d91',
192
225
  500: '#ce6068',
193
226
  600: '#b94553',
194
227
  700: '#9b3544',
195
228
  800: '#822f3e',
196
- 900: '#702b39',
229
+ 850: '#702b39',
230
+ 900: '#510e2b',
197
231
  950: '#3e131b',
198
232
  },
199
233
  orange: {
234
+ base: '#f46325',
200
235
  50: '#fff5ed',
201
236
  100: '#fee9d6',
202
237
  200: '#fcceac',
@@ -210,6 +245,7 @@ export const darkThemeColors = {
210
245
  950: '#420f08',
211
246
  },
212
247
  yellow: {
248
+ base: '#f29c22',
213
249
  50: '#fbf7eb',
214
250
  100: '#f5edcc',
215
251
  200: '#ecd99c',
@@ -223,6 +259,7 @@ export const darkThemeColors = {
223
259
  950: '#312602',
224
260
  },
225
261
  green: {
262
+ base: '#15b77d',
226
263
  50: '#a9f1ce',
227
264
  100: '#71e4b3',
228
265
  200: '#14b8a6',
@@ -236,6 +273,7 @@ export const darkThemeColors = {
236
273
  950: '#032b20',
237
274
  },
238
275
  purple: {
276
+ base: '#9776d3',
239
277
  50: '#f7f6fc',
240
278
  100: '#f1edfa',
241
279
  200: '#e4dff5',
@@ -246,7 +284,7 @@ export const darkThemeColors = {
246
284
  700: '#7a4eb3',
247
285
  800: '#664196',
248
286
  900: '#55377b',
249
- 950: '#352253',
287
+ 950: '#291a40',
250
288
  },
251
289
  utility: {
252
290
  success: '#15b77d',