@indico-data/design-system 2.17.2 → 2.18.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 (32) hide show
  1. package/lib/index.css +616 -151
  2. package/lib/index.d.ts +0 -1
  3. package/lib/index.esm.css +616 -151
  4. package/lib/index.esm.js +5 -453
  5. package/lib/index.esm.js.map +1 -1
  6. package/lib/index.js +5 -453
  7. package/lib/index.js.map +1 -1
  8. package/lib/src/components/button/Button.stories.d.ts +1 -0
  9. package/lib/src/legacy/components/modals/ModalBase/ModalBase.d.ts +0 -1
  10. package/package.json +1 -1
  11. package/src/components/button/Button.mdx +6 -3
  12. package/src/components/button/Button.stories.tsx +8 -0
  13. package/src/components/button/Button.tsx +14 -6
  14. package/src/components/button/__tests__/Button.test.tsx +38 -0
  15. package/src/components/button/styles/Button.scss +14 -22
  16. package/src/components/button/styles/_variables.scss +77 -4
  17. package/src/components/forms/checkbox/styles/Checkbox.scss +3 -3
  18. package/src/components/forms/input/styles/Input.scss +2 -4
  19. package/src/components/forms/passwordInput/styles/PasswordInput.scss +2 -4
  20. package/src/components/forms/radio/styles/Radio.scss +3 -3
  21. package/src/components/forms/select/styles/Select.scss +21 -4
  22. package/src/components/forms/textarea/styles/Textarea.scss +2 -3
  23. package/src/components/forms/toggle/styles/Toggle.scss +2 -2
  24. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss +441 -0
  25. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.tsx +3 -4
  26. package/src/legacy/components/modals/ModalBase/ModalBase.tsx +5 -1
  27. package/src/styles/globals.scss +11 -0
  28. package/src/styles/index.scss +2 -2
  29. package/src/styles/variables/themes/dark.scss +8 -7
  30. package/src/styles/variables/themes/light.scss +1 -0
  31. package/lib/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.d.ts +0 -1
  32. package/src/legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.styles.ts +0 -449
@@ -0,0 +1,441 @@
1
+ .rdp {
2
+ --rdp-cell-size: 40px;
3
+ --rdp-accent-color: #6833d0;
4
+ --rdp-background-color: #ffffff;
5
+ --rdp-accent-color-dark: #3003e1;
6
+ --rdp-background-color-dark: #180270;
7
+ --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */
8
+ --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */
9
+
10
+ margin: 1em;
11
+ }
12
+
13
+ /* Hide elements for devices that are not screen readers */
14
+ .rdp-vhidden {
15
+ box-sizing: border-box;
16
+ padding: 0;
17
+ margin: 0;
18
+ background: transparent;
19
+ border: 0;
20
+ -moz-appearance: none;
21
+ -webkit-appearance: none;
22
+ appearance: none;
23
+ position: absolute !important;
24
+ top: 0;
25
+ width: 1px !important;
26
+ height: 1px !important;
27
+ padding: 0 !important;
28
+ overflow: hidden !important;
29
+ clip: rect(1px, 1px, 1px, 1px) !important;
30
+ border: 0 !important;
31
+ }
32
+
33
+ /* Buttons */
34
+ .rdp-button_reset {
35
+ appearance: none;
36
+ position: relative;
37
+ margin: 0;
38
+ padding: 0;
39
+ cursor: default;
40
+ color: inherit;
41
+ background: none;
42
+ font: inherit;
43
+
44
+ -moz-appearance: none;
45
+ -webkit-appearance: none;
46
+ }
47
+
48
+ .rdp-button_reset:focus-visible {
49
+ /* Make sure to reset outline only when :focus-visible is supported */
50
+ outline: none;
51
+ }
52
+
53
+ .rdp-button {
54
+ border: 2px solid transparent;
55
+ }
56
+
57
+ .rdp-button[disabled]:not(.rdp-day_selected) {
58
+ opacity: 0.25;
59
+ }
60
+
61
+ .rdp-button:not([disabled]) {
62
+ cursor: pointer;
63
+ }
64
+
65
+ .rdp-button:focus-visible:not([disabled]) {
66
+ color: inherit;
67
+ background-color: var(--rdp-background-color);
68
+ border: var(--rdp-outline);
69
+ }
70
+
71
+ .rdp-months {
72
+ display: flex;
73
+ }
74
+
75
+ .rdp-month {
76
+ margin: 0 1em;
77
+ }
78
+
79
+ .rdp-month:first-child {
80
+ margin-left: 0;
81
+ }
82
+
83
+ .rdp-month:last-child {
84
+ margin-right: 0;
85
+ }
86
+
87
+ .rdp-table {
88
+ margin: 0;
89
+ max-width: calc(var(--rdp-cell-size) * 7);
90
+ border-collapse: collapse;
91
+ }
92
+
93
+ .rdp-with_weeknumber .rdp-table {
94
+ max-width: calc(var(--rdp-cell-size) * 8);
95
+ border-collapse: collapse;
96
+ }
97
+
98
+ .rdp-caption {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: space-between;
102
+ padding: 0;
103
+ text-align: left;
104
+ }
105
+
106
+ .rdp-multiple_months .rdp-caption {
107
+ position: relative;
108
+ display: block;
109
+ text-align: center;
110
+ }
111
+
112
+ .rdp-caption_dropdowns {
113
+ position: relative;
114
+ display: inline-flex;
115
+ }
116
+
117
+ .rdp-caption_label {
118
+ position: relative;
119
+ z-index: 1;
120
+ display: inline-flex;
121
+ align-items: center;
122
+ margin: 0;
123
+ padding: 0 0.25em;
124
+ white-space: nowrap;
125
+ color: currentColor;
126
+ border: 0;
127
+ border: 2px solid transparent;
128
+ font-family: inherit;
129
+ font-size: 140%;
130
+ font-weight: bold;
131
+ }
132
+
133
+ .rdp-nav {
134
+ white-space: nowrap;
135
+ }
136
+
137
+ .rdp-multiple_months .rdp-caption_start .rdp-nav {
138
+ position: absolute;
139
+ top: 50%;
140
+ left: 0;
141
+ transform: translateY(-50%);
142
+ }
143
+
144
+ .rdp-multiple_months .rdp-caption_end .rdp-nav {
145
+ position: absolute;
146
+ top: 50%;
147
+ right: 0;
148
+ transform: translateY(-50%);
149
+ }
150
+
151
+ .rdp-nav_button {
152
+ display: inline-flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ width: var(--rdp-cell-size);
156
+ height: var(--rdp-cell-size);
157
+ padding: 0.25em;
158
+ border-radius: 100%;
159
+ }
160
+
161
+ /* ---------- */
162
+ /* Dropdowns */
163
+ /* ---------- */
164
+
165
+ .rdp-dropdown_year,
166
+ .rdp-dropdown_month {
167
+ position: relative;
168
+ display: inline-flex;
169
+ align-items: center;
170
+ }
171
+
172
+ .rdp-dropdown {
173
+ appearance: none;
174
+ position: absolute;
175
+ z-index: 2;
176
+ top: 0;
177
+ bottom: 0;
178
+ left: 0;
179
+ width: 100%;
180
+ margin: 0;
181
+ padding: 0;
182
+ cursor: inherit;
183
+ opacity: 0;
184
+ border: none;
185
+ background-color: transparent;
186
+ font-family: inherit;
187
+ font-size: inherit;
188
+ line-height: inherit;
189
+ }
190
+
191
+ .rdp-dropdown[disabled] {
192
+ opacity: unset;
193
+ color: unset;
194
+ }
195
+
196
+ .rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {
197
+ background-color: var(--rdp-background-color);
198
+ border: var(--rdp-outline);
199
+ border-radius: 6px;
200
+ }
201
+
202
+ .rdp-dropdown_icon {
203
+ margin: 0 0 0 5px;
204
+ }
205
+
206
+ .rdp-head {
207
+ border: 0;
208
+ }
209
+
210
+ .rdp-head_row,
211
+ .rdp-row {
212
+ height: 100%;
213
+ }
214
+
215
+ .rdp-head_cell {
216
+ vertical-align: middle;
217
+ font-size: 0.75em;
218
+ font-weight: 700;
219
+ text-align: center;
220
+ height: 100%;
221
+ height: var(--rdp-cell-size);
222
+ padding: 0;
223
+ }
224
+
225
+ .rdp-tbody {
226
+ border: 0;
227
+ }
228
+
229
+ .rdp-tfoot {
230
+ margin: 0.5em;
231
+ }
232
+
233
+ .rdp-cell {
234
+ width: var(--rdp-cell-size);
235
+ height: 100%;
236
+ height: var(--rdp-cell-size);
237
+ padding: 0;
238
+ text-align: center;
239
+ }
240
+
241
+ .rdp-weeknumber {
242
+ font-size: 0.75em;
243
+ }
244
+
245
+ .rdp-weeknumber,
246
+ .rdp-day {
247
+ display: flex;
248
+ overflow: hidden;
249
+ align-items: center;
250
+ justify-content: center;
251
+ box-sizing: border-box;
252
+ width: var(--rdp-cell-size);
253
+ max-width: var(--rdp-cell-size);
254
+ height: var(--rdp-cell-size);
255
+ margin: 0;
256
+ border: 2px solid transparent;
257
+ border-radius: 100%;
258
+ }
259
+
260
+ .rdp-day_today:not(.rdp-day_outside) {
261
+ font-weight: bold;
262
+ }
263
+
264
+ .rdp-day_selected,
265
+ .rdp-day_selected:focus-visible,
266
+ .rdp-day_selected:hover {
267
+ color: white;
268
+ opacity: 1;
269
+ background-color: var(--rdp-accent-color);
270
+ }
271
+
272
+ .rdp-day_outside {
273
+ opacity: 0.5;
274
+ }
275
+
276
+ .rdp-day_selected:focus-visible {
277
+ /* Since the background is the same use again the outline */
278
+ outline: var(--rdp-outline);
279
+ outline-offset: 2px;
280
+ z-index: 1;
281
+ }
282
+
283
+ .rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {
284
+ border-top-right-radius: 0;
285
+ border-bottom-right-radius: 0;
286
+ }
287
+
288
+ .rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {
289
+ border-top-left-radius: 0;
290
+ border-bottom-left-radius: 0;
291
+ }
292
+
293
+ .rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {
294
+ border-top-left-radius: 0;
295
+ border-bottom-left-radius: 0;
296
+ }
297
+
298
+ .rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {
299
+ border-top-right-radius: 0;
300
+ border-bottom-right-radius: 0;
301
+ }
302
+
303
+ .rdp-day_range_end.rdp-day_range_start {
304
+ border-radius: 100%;
305
+ }
306
+
307
+ .rdp-day_range_middle {
308
+ border-radius: 0;
309
+ }
310
+
311
+ /*# sourceMappingURL=style.css.map */
312
+
313
+ /******************************
314
+ * Indico Custom Styling For Insights
315
+ *******************************/
316
+ .rdp-button:hover:not([disabled]):not(.rdp-day_selected) {
317
+ background-color: #976cec;
318
+ }
319
+ .rdp-button,
320
+ .rdp-day {
321
+ box-shadow: none;
322
+ color: #000000;
323
+ &:hover {
324
+ background-color: #6833d0;
325
+ color: white;
326
+ }
327
+ }
328
+
329
+ .rdp-head_cell,
330
+ .rdp-cell {
331
+ border: none;
332
+ }
333
+
334
+ .DayPickerInput-Overlay {
335
+ border-radius: 4px;
336
+ z-index: 999;
337
+ .rdp {
338
+ background: white;
339
+ z-index: 999;
340
+ border: solid 1px #000000;
341
+ border-radius: 4px;
342
+ box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.4);
343
+ }
344
+ }
345
+
346
+ .rdp-caption_label {
347
+ font-weight: 400;
348
+ font-size: 14px;
349
+ color: #000000;
350
+ }
351
+
352
+ .rdp-day_today {
353
+ background-color: #dbd5e6;
354
+ color: #ffffff;
355
+ font-weight: 400;
356
+ }
357
+
358
+ .rdp-button_reset {
359
+ &.rdp-button {
360
+ &.rdp-day {
361
+ &.rdp-day_selected {
362
+ background-color: #6833d0;
363
+ color: white;
364
+
365
+ &:focus {
366
+ color: white;
367
+ }
368
+ &:active {
369
+ color: white;
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+
376
+ .rdp-head_cell {
377
+ color: #6833d0;
378
+ font-weight: 400;
379
+ }
380
+
381
+ .date__picker__trigger {
382
+ color: #000000;
383
+ cursor: pointer;
384
+ }
385
+
386
+ .custom__caption {
387
+ display: flex;
388
+ justify-content: space-between;
389
+ align-items: center;
390
+ padding: 15px 5px 15px 5px;
391
+
392
+ .custom__caption__text {
393
+ font-size: 14px;
394
+ color: #000000;
395
+ margin: 0;
396
+ }
397
+
398
+ .custom__caption__action__button {
399
+ background: none;
400
+ border: none;
401
+ cursor: pointer;
402
+ box-shadow: none;
403
+ padding: 0 5px 0 5px;
404
+
405
+ border-radius: 60px;
406
+ color: #6833d0;
407
+ height: 20px;
408
+ width: 20px;
409
+
410
+ &:hover {
411
+ background-color: #6833d0;
412
+ color: #ffffff;
413
+ border-radius: 20px;
414
+
415
+ .rdp-nav_icon {
416
+ color: #ffffff;
417
+ }
418
+ }
419
+
420
+ .rdp-nav_icon {
421
+ color: #6833d0;
422
+ }
423
+ }
424
+ }
425
+
426
+ .visually-hidden,
427
+ .visually-hidden-focusable:not(:focus):not(:focus-within) {
428
+ border: 0 !important;
429
+ clip: rect(0, 0, 0, 0) !important;
430
+ height: 1px !important;
431
+ margin: -1px !important;
432
+ overflow: hidden !important;
433
+ padding: 0 !important;
434
+ white-space: nowrap !important;
435
+ width: 1px !important;
436
+ }
437
+
438
+ .visually-hidden:not(caption),
439
+ .visually-hidden-focusable:not(:focus):not(:focus-within):not(caption) {
440
+ position: absolute !important;
441
+ }
@@ -14,8 +14,6 @@ import { usePopper } from 'react-popper';
14
14
  import { IconName, IconSizes, PermafrostComponent } from '@/types';
15
15
  import { Icon } from '@/components';
16
16
 
17
- import { StyledNoInputDatePicker } from './NoInputDatePicker.styles';
18
-
19
17
  type Props = PermafrostComponent & {
20
18
  ariaLabel?: string;
21
19
  disableBeforeDate?: Date;
@@ -163,8 +161,9 @@ export const NoInputDatePicker = (props: Props) => {
163
161
  onChange(range);
164
162
  }
165
163
  };
164
+
166
165
  return (
167
- <StyledNoInputDatePicker
166
+ <div
168
167
  className={className}
169
168
  aria-label={ariaLabel || 'date select'}
170
169
  aria-describedby={`picker-label--${id}`}
@@ -241,6 +240,6 @@ export const NoInputDatePicker = (props: Props) => {
241
240
  </div>
242
241
  </FocusTrap>
243
242
  )}
244
- </StyledNoInputDatePicker>
243
+ </div>
245
244
  );
246
245
  };
@@ -10,7 +10,6 @@ export type ModalBaseProps = PermafrostComponent & {
10
10
  children: React.ReactNode | React.ReactNode[];
11
11
  clickToDismiss?(): void;
12
12
  describedBy?: string;
13
- /** a selector representing the desired parent; defaults to `#root` */
14
13
  node?: string;
15
14
  open: boolean;
16
15
  preventEscDismiss?: boolean;
@@ -51,6 +50,10 @@ export function ModalBase(props: ModalBaseProps) {
51
50
  ariaProps['describedby'] = describedBy;
52
51
  }
53
52
 
53
+ // Try to render modal within the theme-root, otherwise attach to the root
54
+ const parentSelector = () =>
55
+ document.getElementById('theme-root') || document.getElementById('root');
56
+
54
57
  return (
55
58
  <StyledModalBase
56
59
  ariaHideApp={false}
@@ -62,6 +65,7 @@ export function ModalBase(props: ModalBaseProps) {
62
65
  isOpen={open}
63
66
  node={node}
64
67
  onRequestClose={clickToDismiss}
68
+ parentSelector={parentSelector}
65
69
  shouldCloseOnEsc={!preventEscDismiss}
66
70
  shouldReturnFocusAfterClose={!preventReturnFocus}
67
71
  maxWidth={maxWidth}
@@ -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;