@indico-data/design-system 2.17.2 → 2.19.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 (49) hide show
  1. package/lib/index.css +616 -184
  2. package/lib/index.d.ts +17 -21
  3. package/lib/index.esm.css +616 -184
  4. package/lib/index.esm.js +36 -462
  5. package/lib/index.esm.js.map +1 -1
  6. package/lib/index.js +37 -463
  7. package/lib/index.js.map +1 -1
  8. package/lib/src/components/button/Button.stories.d.ts +1 -0
  9. package/lib/src/components/forms/input/Input.d.ts +5 -7
  10. package/lib/src/components/forms/passwordInput/PasswordInput.d.ts +5 -7
  11. package/lib/src/components/forms/subcomponents/Label.d.ts +6 -3
  12. package/lib/src/components/forms/textarea/Textarea.d.ts +5 -7
  13. package/lib/src/legacy/components/modals/ModalBase/ModalBase.d.ts +0 -1
  14. package/lib/src/storybook/labelArgTypes.d.ts +3 -0
  15. package/package.json +1 -1
  16. package/src/components/button/Button.mdx +6 -3
  17. package/src/components/button/Button.stories.tsx +8 -0
  18. package/src/components/button/Button.tsx +14 -6
  19. package/src/components/button/__tests__/Button.test.tsx +38 -0
  20. package/src/components/button/styles/Button.scss +14 -22
  21. package/src/components/button/styles/_variables.scss +77 -4
  22. package/src/components/forms/checkbox/styles/Checkbox.scss +3 -3
  23. package/src/components/forms/input/Input.mdx +15 -2
  24. package/src/components/forms/input/Input.stories.tsx +10 -45
  25. package/src/components/forms/input/Input.tsx +22 -15
  26. package/src/components/forms/input/styles/Input.scss +2 -15
  27. package/src/components/forms/passwordInput/PasswordInput.mdx +10 -8
  28. package/src/components/forms/passwordInput/PasswordInput.stories.tsx +3 -44
  29. package/src/components/forms/passwordInput/PasswordInput.tsx +20 -15
  30. package/src/components/forms/passwordInput/styles/PasswordInput.scss +2 -15
  31. package/src/components/forms/radio/styles/Radio.scss +3 -3
  32. package/src/components/forms/select/styles/Select.scss +21 -4
  33. package/src/components/forms/subcomponents/Label.tsx +29 -6
  34. package/src/components/forms/subcomponents/__tests__/Label.test.tsx +63 -15
  35. package/src/components/forms/textarea/Textarea.mdx +12 -2
  36. package/src/components/forms/textarea/Textarea.stories.tsx +4 -46
  37. package/src/components/forms/textarea/Textarea.tsx +15 -13
  38. package/src/components/forms/textarea/styles/Textarea.scss +2 -14
  39. package/src/components/forms/toggle/styles/Toggle.scss +2 -2
  40. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss +441 -0
  41. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +3 -4
  42. package/src/legacy/components/modals/ModalBase/ModalBase.tsx +5 -1
  43. package/src/storybook/labelArgTypes.ts +50 -0
  44. package/src/styles/globals.scss +11 -0
  45. package/src/styles/index.scss +2 -2
  46. package/src/styles/variables/themes/dark.scss +8 -7
  47. package/src/styles/variables/themes/light.scss +1 -0
  48. package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -1
  49. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.ts +0 -449
@@ -0,0 +1,50 @@
1
+ // Common argTypes for form components that include a label
2
+ import { ArgTypes } from '@storybook/react';
3
+
4
+ const labelArgTypes: ArgTypes = {
5
+ label: {
6
+ control: 'text',
7
+ description: 'The text to display as the label for the form component',
8
+ table: {
9
+ category: 'Props',
10
+ type: {
11
+ summary: 'string',
12
+ },
13
+ },
14
+ },
15
+ isRequired: {
16
+ control: 'boolean',
17
+ description: 'Toggles the required asterisk on the label',
18
+ table: {
19
+ category: 'Props',
20
+ type: {
21
+ summary: 'boolean',
22
+ },
23
+ },
24
+ defaultValue: { summary: 'false' },
25
+ },
26
+ hasHiddenLabel: {
27
+ control: 'boolean',
28
+ description:
29
+ 'Determines whether the label should be displayed or not. Included as aria-label if true',
30
+ table: {
31
+ category: 'Props',
32
+ type: {
33
+ summary: 'boolean',
34
+ },
35
+ },
36
+ defaultValue: { summary: 'false' },
37
+ },
38
+ name: {
39
+ control: 'text',
40
+ description: 'The name attribute for the form component, used for identifying the field',
41
+ table: {
42
+ category: 'Props',
43
+ type: {
44
+ summary: 'string',
45
+ },
46
+ },
47
+ },
48
+ };
49
+
50
+ export default labelArgTypes;
@@ -0,0 +1,11 @@
1
+ // Common Variables
2
+ :root,
3
+ :root [data-theme='light'],
4
+ :root [data-theme='dark'] {
5
+ --pf-form-input-border-color: var(--pf-gray-color-700);
6
+ }
7
+
8
+ // Dark Theme Specific Variables
9
+ :root [data-theme='dark'] {
10
+ --pf-form-input-border-color: var(--pf-primary-color-200);
11
+ }
@@ -1,6 +1,6 @@
1
1
  // Variables
2
2
  @import 'variables/index.scss';
3
-
3
+ @import './globals.scss';
4
4
  // Components
5
5
  @import '../components/button/styles/Button.scss';
6
6
  @import '../components/icons/styles/Icon.scss';
@@ -16,7 +16,7 @@
16
16
  @import '../components/forms/toggle/styles/Toggle.scss';
17
17
  @import '../components/skeleton/styles/Skeleton.scss';
18
18
  @import '../components/card/styles/Card.scss';
19
-
19
+ @import '../legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss';
20
20
  @import 'typography';
21
21
  @import 'colors';
22
22
  @import 'borders';
@@ -7,10 +7,11 @@
7
7
  --pf-primary-color-300: #3b455e;
8
8
  --pf-primary-color-400: #323a4d;
9
9
  --pf-primary-color-500: #262c3a;
10
- --pf-primary-color-600: #1f2431;
11
- --pf-primary-color-700: #1c2632;
10
+ --pf-primary-color-600: #182432;
11
+ --pf-primary-color-700: #101a26;
12
12
  --pf-primary-color-800: #1b202c;
13
13
  --pf-primary-color-900: #141b24;
14
+ --pf-primary-color-1000: #271153;
14
15
 
15
16
  // Secondary Color
16
17
  --pf-secondary-color: #0070f5;
@@ -19,11 +20,11 @@
19
20
  --pf-secondary-color-200: #b3d4fc;
20
21
  --pf-secondary-color-300: #7ab5fa;
21
22
  --pf-secondary-color-400: #4797f5;
22
- --pf-secondary-color-500: #0070f5;
23
- --pf-secondary-color-600: #0067e1;
24
- --pf-secondary-color-700: #005ac4;
25
- --pf-secondary-color-800: #004eac;
26
- --pf-secondary-color-900: #004393;
23
+ --pf-secondary-color-500: #2482f5;
24
+ --pf-secondary-color-600: #2070d1;
25
+ --pf-secondary-color-700: #178ee0;
26
+ --pf-secondary-color-800: #3d5a7d;
27
+ --pf-secondary-color-900: #0b2647;
27
28
 
28
29
  // Gray Color
29
30
  --pf-gray-color: #bfc1c3;
@@ -12,6 +12,7 @@
12
12
  --pf-primary-color-700: #5329a6;
13
13
  --pf-primary-color-800: #492492;
14
14
  --pf-primary-color-900: #3e1f7d;
15
+ --pf-primary-color-1000: #271153;
15
16
 
16
17
  // Secondary Color
17
18
  --pf-secondary-color: #0070f5;
@@ -1 +0,0 @@
1
- export declare const StyledNoInputDatePicker: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,449 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- export const StyledNoInputDatePicker = styled.div`
4
- /************************************
5
- * Default react-day-picker styling - this needed to be added because we were unable to import styling as specified by the docs (most likely because we are not using webpack)
6
- *************************************/
7
-
8
- .rdp {
9
- --rdp-cell-size: 40px;
10
- --rdp-accent-color: #6833d0;
11
- --rdp-background-color: #ffffff;
12
- --rdp-accent-color-dark: #3003e1;
13
- --rdp-background-color-dark: #180270;
14
- --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */
15
- --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */
16
-
17
- margin: 1em;
18
- }
19
-
20
- /* Hide elements for devices that are not screen readers */
21
- .rdp-vhidden {
22
- box-sizing: border-box;
23
- padding: 0;
24
- margin: 0;
25
- background: transparent;
26
- border: 0;
27
- -moz-appearance: none;
28
- -webkit-appearance: none;
29
- appearance: none;
30
- position: absolute !important;
31
- top: 0;
32
- width: 1px !important;
33
- height: 1px !important;
34
- padding: 0 !important;
35
- overflow: hidden !important;
36
- clip: rect(1px, 1px, 1px, 1px) !important;
37
- border: 0 !important;
38
- }
39
-
40
- /* Buttons */
41
- .rdp-button_reset {
42
- appearance: none;
43
- position: relative;
44
- margin: 0;
45
- padding: 0;
46
- cursor: default;
47
- color: inherit;
48
- background: none;
49
- font: inherit;
50
-
51
- -moz-appearance: none;
52
- -webkit-appearance: none;
53
- }
54
-
55
- .rdp-button_reset:focus-visible {
56
- /* Make sure to reset outline only when :focus-visible is supported */
57
- outline: none;
58
- }
59
-
60
- .rdp-button {
61
- border: 2px solid transparent;
62
- }
63
-
64
- .rdp-button[disabled]:not(.rdp-day_selected) {
65
- opacity: 0.25;
66
- }
67
-
68
- .rdp-button:not([disabled]) {
69
- cursor: pointer;
70
- }
71
-
72
- .rdp-button:focus-visible:not([disabled]) {
73
- color: inherit;
74
- background-color: var(--rdp-background-color);
75
- border: var(--rdp-outline);
76
- }
77
-
78
- .rdp-months {
79
- display: flex;
80
- }
81
-
82
- .rdp-month {
83
- margin: 0 1em;
84
- }
85
-
86
- .rdp-month:first-child {
87
- margin-left: 0;
88
- }
89
-
90
- .rdp-month:last-child {
91
- margin-right: 0;
92
- }
93
-
94
- .rdp-table {
95
- margin: 0;
96
- max-width: calc(var(--rdp-cell-size) * 7);
97
- border-collapse: collapse;
98
- }
99
-
100
- .rdp-with_weeknumber .rdp-table {
101
- max-width: calc(var(--rdp-cell-size) * 8);
102
- border-collapse: collapse;
103
- }
104
-
105
- .rdp-caption {
106
- display: flex;
107
- align-items: center;
108
- justify-content: space-between;
109
- padding: 0;
110
- text-align: left;
111
- }
112
-
113
- .rdp-multiple_months .rdp-caption {
114
- position: relative;
115
- display: block;
116
- text-align: center;
117
- }
118
-
119
- .rdp-caption_dropdowns {
120
- position: relative;
121
- display: inline-flex;
122
- }
123
-
124
- .rdp-caption_label {
125
- position: relative;
126
- z-index: 1;
127
- display: inline-flex;
128
- align-items: center;
129
- margin: 0;
130
- padding: 0 0.25em;
131
- white-space: nowrap;
132
- color: currentColor;
133
- border: 0;
134
- border: 2px solid transparent;
135
- font-family: inherit;
136
- font-size: 140%;
137
- font-weight: bold;
138
- }
139
-
140
- .rdp-nav {
141
- white-space: nowrap;
142
- }
143
-
144
- .rdp-multiple_months .rdp-caption_start .rdp-nav {
145
- position: absolute;
146
- top: 50%;
147
- left: 0;
148
- transform: translateY(-50%);
149
- }
150
-
151
- .rdp-multiple_months .rdp-caption_end .rdp-nav {
152
- position: absolute;
153
- top: 50%;
154
- right: 0;
155
- transform: translateY(-50%);
156
- }
157
-
158
- .rdp-nav_button {
159
- display: inline-flex;
160
- align-items: center;
161
- justify-content: center;
162
- width: var(--rdp-cell-size);
163
- height: var(--rdp-cell-size);
164
- padding: 0.25em;
165
- border-radius: 100%;
166
- }
167
-
168
- /* ---------- */
169
- /* Dropdowns */
170
- /* ---------- */
171
-
172
- .rdp-dropdown_year,
173
- .rdp-dropdown_month {
174
- position: relative;
175
- display: inline-flex;
176
- align-items: center;
177
- }
178
-
179
- .rdp-dropdown {
180
- appearance: none;
181
- position: absolute;
182
- z-index: 2;
183
- top: 0;
184
- bottom: 0;
185
- left: 0;
186
- width: 100%;
187
- margin: 0;
188
- padding: 0;
189
- cursor: inherit;
190
- opacity: 0;
191
- border: none;
192
- background-color: transparent;
193
- font-family: inherit;
194
- font-size: inherit;
195
- line-height: inherit;
196
- }
197
-
198
- .rdp-dropdown[disabled] {
199
- opacity: unset;
200
- color: unset;
201
- }
202
-
203
- .rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {
204
- background-color: var(--rdp-background-color);
205
- border: var(--rdp-outline);
206
- border-radius: 6px;
207
- }
208
-
209
- .rdp-dropdown_icon {
210
- margin: 0 0 0 5px;
211
- }
212
-
213
- .rdp-head {
214
- border: 0;
215
- }
216
-
217
- .rdp-head_row,
218
- .rdp-row {
219
- height: 100%;
220
- }
221
-
222
- .rdp-head_cell {
223
- vertical-align: middle;
224
- font-size: 0.75em;
225
- font-weight: 700;
226
- text-align: center;
227
- height: 100%;
228
- height: var(--rdp-cell-size);
229
- padding: 0;
230
- }
231
-
232
- .rdp-tbody {
233
- border: 0;
234
- }
235
-
236
- .rdp-tfoot {
237
- margin: 0.5em;
238
- }
239
-
240
- .rdp-cell {
241
- width: var(--rdp-cell-size);
242
- height: 100%;
243
- height: var(--rdp-cell-size);
244
- padding: 0;
245
- text-align: center;
246
- }
247
-
248
- .rdp-weeknumber {
249
- font-size: 0.75em;
250
- }
251
-
252
- .rdp-weeknumber,
253
- .rdp-day {
254
- display: flex;
255
- overflow: hidden;
256
- align-items: center;
257
- justify-content: center;
258
- box-sizing: border-box;
259
- width: var(--rdp-cell-size);
260
- max-width: var(--rdp-cell-size);
261
- height: var(--rdp-cell-size);
262
- margin: 0;
263
- border: 2px solid transparent;
264
- border-radius: 100%;
265
- }
266
-
267
- .rdp-day_today:not(.rdp-day_outside) {
268
- font-weight: bold;
269
- }
270
-
271
- .rdp-day_selected,
272
- .rdp-day_selected:focus-visible,
273
- .rdp-day_selected:hover {
274
- color: white;
275
- opacity: 1;
276
- background-color: var(--rdp-accent-color);
277
- }
278
-
279
- .rdp-day_outside {
280
- opacity: 0.5;
281
- }
282
-
283
- .rdp-day_selected:focus-visible {
284
- /* Since the background is the same use again the outline */
285
- outline: var(--rdp-outline);
286
- outline-offset: 2px;
287
- z-index: 1;
288
- }
289
-
290
- .rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {
291
- border-top-right-radius: 0;
292
- border-bottom-right-radius: 0;
293
- }
294
-
295
- .rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {
296
- border-top-left-radius: 0;
297
- border-bottom-left-radius: 0;
298
- }
299
-
300
- .rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {
301
- border-top-left-radius: 0;
302
- border-bottom-left-radius: 0;
303
- }
304
-
305
- .rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {
306
- border-top-right-radius: 0;
307
- border-bottom-right-radius: 0;
308
- }
309
-
310
- .rdp-day_range_end.rdp-day_range_start {
311
- border-radius: 100%;
312
- }
313
-
314
- .rdp-day_range_middle {
315
- border-radius: 0;
316
- }
317
-
318
- /*# sourceMappingURL=style.css.map */
319
-
320
- /******************************
321
- * Indico Custom Styling For Insights
322
- *******************************/
323
- .rdp-button:hover:not([disabled]):not(.rdp-day_selected) {
324
- background-color: #976cec;
325
- }
326
- .rdp-button,
327
- .rdp-day {
328
- box-shadow: none;
329
- color: #000000;
330
- &:hover {
331
- background-color: #6833d0;
332
- color: white;
333
- }
334
- }
335
-
336
- .rdp-head_cell,
337
- .rdp-cell {
338
- border: none;
339
- }
340
-
341
- .DayPickerInput-Overlay {
342
- border-radius: 4px;
343
- z-index: 999;
344
- .rdp {
345
- background: white;
346
- z-index: 999;
347
- border: solid 1px #000000;
348
- border-radius: 4px;
349
- box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.4);
350
- }
351
- }
352
-
353
- .rdp-caption_label {
354
- font-weight: 400;
355
- font-size: 14px;
356
- color: #000000;
357
- }
358
-
359
- .rdp-day_today {
360
- background-color: #dbd5e6;
361
- color: #ffffff;
362
- font-weight: 400;
363
- }
364
-
365
- .rdp-button_reset {
366
- &.rdp-button {
367
- &.rdp-day {
368
- &.rdp-day_selected {
369
- background-color: #6833d0;
370
- color: white;
371
-
372
- &:focus {
373
- color: white;
374
- }
375
- &:active {
376
- color: white;
377
- }
378
- }
379
- }
380
- }
381
- }
382
-
383
- .rdp-head_cell {
384
- color: #6833d0;
385
- font-weight: 400;
386
- }
387
-
388
- .date__picker__trigger {
389
- color: #000000;
390
- cursor: pointer;
391
- }
392
-
393
- .custom__caption {
394
- display: flex;
395
- justify-content: space-between;
396
- align-items: center;
397
- padding: 15px 5px 15px 5px;
398
-
399
- .custom__caption__text {
400
- font-size: 14px;
401
- color: #000000;
402
- margin: 0;
403
- }
404
-
405
- .custom__caption__action__button {
406
- background: none;
407
- border: none;
408
- cursor: pointer;
409
- box-shadow: none;
410
- padding: 0 5px 0 5px;
411
-
412
- border-radius: 60px;
413
- color: #6833d0;
414
- height: 20px;
415
- width: 20px;
416
-
417
- &:hover {
418
- background-color: #6833d0;
419
- color: #ffffff;
420
- border-radius: 20px;
421
-
422
- .rdp-nav_icon {
423
- color: #ffffff;
424
- }
425
- }
426
-
427
- .rdp-nav_icon {
428
- color: #6833d0;
429
- }
430
- }
431
- }
432
-
433
- .visually-hidden,
434
- .visually-hidden-focusable:not(:focus):not(:focus-within) {
435
- border: 0 !important;
436
- clip: rect(0, 0, 0, 0) !important;
437
- height: 1px !important;
438
- margin: -1px !important;
439
- overflow: hidden !important;
440
- padding: 0 !important;
441
- white-space: nowrap !important;
442
- width: 1px !important;
443
- }
444
-
445
- .visually-hidden:not(caption),
446
- .visually-hidden-focusable:not(:focus):not(:focus-within):not(caption) {
447
- position: absolute !important;
448
- }
449
- `;