@charcoal-ui/react 3.3.0 → 3.5.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 (68) hide show
  1. package/dist/_lib/useForwardedRef.d.ts +3 -0
  2. package/dist/_lib/useForwardedRef.d.ts.map +1 -0
  3. package/dist/components/Clickable/index.d.ts.map +1 -1
  4. package/dist/components/DropdownSelector/DropdownPopover.d.ts.map +1 -1
  5. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  6. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts +2 -0
  7. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts.map +1 -0
  8. package/dist/components/DropdownSelector/index.story.d.ts +1 -0
  9. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  10. package/dist/components/Icon/index.story.d.ts +1 -1
  11. package/dist/components/Modal/Dialog/index.d.ts +26 -0
  12. package/dist/components/Modal/Dialog/index.d.ts.map +1 -0
  13. package/dist/components/Modal/ModalBackgroundContext.d.ts +6 -0
  14. package/dist/components/Modal/ModalBackgroundContext.d.ts.map +1 -0
  15. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  16. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts +4 -0
  17. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts.map +1 -0
  18. package/dist/components/Modal/index.d.ts +12 -2
  19. package/dist/components/Modal/index.d.ts.map +1 -1
  20. package/dist/components/Modal/index.story.d.ts +3 -2
  21. package/dist/components/Modal/index.story.d.ts.map +1 -1
  22. package/dist/components/TextArea/index.d.ts.map +1 -1
  23. package/dist/components/TextField/index.d.ts +4 -0
  24. package/dist/components/TextField/index.d.ts.map +1 -1
  25. package/dist/components/TextField/useFocusWithClick.d.ts +3 -0
  26. package/dist/components/TextField/useFocusWithClick.d.ts.map +1 -0
  27. package/dist/index.cjs.js +532 -426
  28. package/dist/index.cjs.js.map +1 -1
  29. package/dist/index.esm.js +482 -377
  30. package/dist/index.esm.js.map +1 -1
  31. package/package.json +6 -6
  32. package/src/_lib/useForwardedRef.tsx +16 -0
  33. package/src/components/Button/__snapshots__/index.story.storyshot +1971 -0
  34. package/src/components/Checkbox/__snapshots__/index.story.storyshot +390 -0
  35. package/src/components/Clickable/__snapshots__/index.story.storyshot +100 -0
  36. package/src/components/Clickable/index.tsx +17 -35
  37. package/src/components/DropdownSelector/DropdownPopover.tsx +0 -1
  38. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +245 -0
  39. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +555 -0
  40. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +174 -0
  41. package/src/components/DropdownSelector/Popover/index.tsx +17 -2
  42. package/src/components/DropdownSelector/Popover/usePreventScroll.tsx +18 -0
  43. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +1241 -0
  44. package/src/components/DropdownSelector/index.story.tsx +69 -13
  45. package/src/components/Icon/__snapshots__/index.story.storyshot +12 -0
  46. package/src/components/{Button/__snapshots__/index.test.tsx.snap → IconButton/__snapshots__/index.story.storyshot} +94 -91
  47. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +81 -0
  48. package/src/components/Modal/Dialog/index.tsx +82 -0
  49. package/src/components/Modal/ModalBackgroundContext.tsx +8 -0
  50. package/src/components/Modal/ModalPlumbing.tsx +16 -4
  51. package/src/components/Modal/__snapshots__/index.story.storyshot +533 -0
  52. package/src/components/Modal/__stories__/InternalScrollStory.tsx +75 -0
  53. package/src/components/Modal/index.story.tsx +57 -38
  54. package/src/components/Modal/index.tsx +63 -94
  55. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +511 -0
  56. package/src/components/Radio/__snapshots__/index.story.storyshot +319 -0
  57. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +483 -0
  58. package/src/components/Switch/__snapshots__/index.story.storyshot +454 -0
  59. package/src/components/TagItem/__snapshots__/index.story.storyshot +1181 -0
  60. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +1114 -0
  61. package/src/components/TextArea/index.tsx +38 -43
  62. package/src/components/TextField/TextField.story.tsx +2 -3
  63. package/src/components/TextField/__snapshots__/TextField.story.storyshot +1603 -0
  64. package/src/components/TextField/index.tsx +86 -84
  65. package/src/components/TextField/useFocusWithClick.tsx +22 -0
  66. package/dist/components/Button/index.test.d.ts +0 -4
  67. package/dist/components/Button/index.test.d.ts.map +0 -1
  68. package/src/components/Button/index.test.tsx +0 -24
@@ -0,0 +1,555 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Storyshots DropdownSelector/MenuList Basic 1`] = `
4
+ .c1 {
5
+ list-style: none;
6
+ }
7
+
8
+ .c2 {
9
+ display: -webkit-box;
10
+ display: -webkit-flex;
11
+ display: -ms-flexbox;
12
+ display: flex;
13
+ -webkit-align-items: center;
14
+ -webkit-box-align: center;
15
+ -ms-flex-align: center;
16
+ align-items: center;
17
+ min-height: 40px;
18
+ cursor: pointer;
19
+ outline: none;
20
+ padding-right: 16px;
21
+ padding-left: 16px;
22
+ }
23
+
24
+ .c2:disabled,
25
+ .c2[aria-disabled]:not([aria-disabled=false]) {
26
+ opacity: 0.32;
27
+ }
28
+
29
+ .c2[aria-disabled="true"] {
30
+ cursor: default;
31
+ }
32
+
33
+ .c2:hover,
34
+ .c2:focus,
35
+ .c2:focus-within {
36
+ background-color: var(--charcoal-surface3);
37
+ }
38
+
39
+ .c0 {
40
+ padding: 0;
41
+ margin: 0;
42
+ }
43
+
44
+ <div
45
+ data-dark={false}
46
+ >
47
+ <ul
48
+ className="c0"
49
+ >
50
+ <li
51
+ className="c1"
52
+ role="option"
53
+ >
54
+ <div
55
+ className="c2"
56
+ data-key="0"
57
+ onClick={[Function]}
58
+ onKeyDown={[Function]}
59
+ tabIndex={-1}
60
+ value="0"
61
+ >
62
+ Menu
63
+ 0
64
+ </div>
65
+ </li>
66
+ <li
67
+ className="c1"
68
+ role="option"
69
+ >
70
+ <div
71
+ className="c2"
72
+ data-key="1"
73
+ onClick={[Function]}
74
+ onKeyDown={[Function]}
75
+ tabIndex={-1}
76
+ value="1"
77
+ >
78
+ Menu
79
+ 1
80
+ </div>
81
+ </li>
82
+ <li
83
+ className="c1"
84
+ role="option"
85
+ >
86
+ <div
87
+ className="c2"
88
+ data-key="2"
89
+ onClick={[Function]}
90
+ onKeyDown={[Function]}
91
+ tabIndex={-1}
92
+ value="2"
93
+ >
94
+ Menu
95
+ 2
96
+ </div>
97
+ </li>
98
+ <li
99
+ className="c1"
100
+ role="option"
101
+ >
102
+ <div
103
+ className="c2"
104
+ data-key="3"
105
+ onClick={[Function]}
106
+ onKeyDown={[Function]}
107
+ tabIndex={-1}
108
+ value="3"
109
+ >
110
+ Menu
111
+ 3
112
+ </div>
113
+ </li>
114
+ <li
115
+ className="c1"
116
+ role="option"
117
+ >
118
+ <div
119
+ className="c2"
120
+ data-key="4"
121
+ onClick={[Function]}
122
+ onKeyDown={[Function]}
123
+ tabIndex={-1}
124
+ value="4"
125
+ >
126
+ Menu
127
+ 4
128
+ </div>
129
+ </li>
130
+ <li
131
+ className="c1"
132
+ role="option"
133
+ >
134
+ <div
135
+ className="c2"
136
+ data-key="5"
137
+ onClick={[Function]}
138
+ onKeyDown={[Function]}
139
+ tabIndex={-1}
140
+ value="5"
141
+ >
142
+ Menu
143
+ 5
144
+ </div>
145
+ </li>
146
+ <li
147
+ className="c1"
148
+ role="option"
149
+ >
150
+ <div
151
+ className="c2"
152
+ data-key="6"
153
+ onClick={[Function]}
154
+ onKeyDown={[Function]}
155
+ tabIndex={-1}
156
+ value="6"
157
+ >
158
+ Menu
159
+ 6
160
+ </div>
161
+ </li>
162
+ <li
163
+ className="c1"
164
+ role="option"
165
+ >
166
+ <div
167
+ className="c2"
168
+ data-key="7"
169
+ onClick={[Function]}
170
+ onKeyDown={[Function]}
171
+ tabIndex={-1}
172
+ value="7"
173
+ >
174
+ Menu
175
+ 7
176
+ </div>
177
+ </li>
178
+ <li
179
+ className="c1"
180
+ role="option"
181
+ >
182
+ <div
183
+ className="c2"
184
+ data-key="8"
185
+ onClick={[Function]}
186
+ onKeyDown={[Function]}
187
+ tabIndex={-1}
188
+ value="8"
189
+ >
190
+ Menu
191
+ 8
192
+ </div>
193
+ </li>
194
+ <li
195
+ className="c1"
196
+ role="option"
197
+ >
198
+ <div
199
+ className="c2"
200
+ data-key="9"
201
+ onClick={[Function]}
202
+ onKeyDown={[Function]}
203
+ tabIndex={-1}
204
+ value="9"
205
+ >
206
+ Menu
207
+ 9
208
+ </div>
209
+ </li>
210
+ </ul>
211
+ </div>
212
+ `;
213
+
214
+ exports[`Storyshots DropdownSelector/MenuList Disabled 1`] = `
215
+ .c1 {
216
+ list-style: none;
217
+ }
218
+
219
+ .c2 {
220
+ display: -webkit-box;
221
+ display: -webkit-flex;
222
+ display: -ms-flexbox;
223
+ display: flex;
224
+ -webkit-align-items: center;
225
+ -webkit-box-align: center;
226
+ -ms-flex-align: center;
227
+ align-items: center;
228
+ min-height: 40px;
229
+ cursor: pointer;
230
+ outline: none;
231
+ padding-right: 16px;
232
+ padding-left: 16px;
233
+ }
234
+
235
+ .c2:disabled,
236
+ .c2[aria-disabled]:not([aria-disabled=false]) {
237
+ opacity: 0.32;
238
+ }
239
+
240
+ .c2[aria-disabled="true"] {
241
+ cursor: default;
242
+ }
243
+
244
+ .c2:hover,
245
+ .c2:focus,
246
+ .c2:focus-within {
247
+ background-color: var(--charcoal-surface3);
248
+ }
249
+
250
+ .c0 {
251
+ padding: 0;
252
+ margin: 0;
253
+ }
254
+
255
+ <div
256
+ data-dark={false}
257
+ >
258
+ <ul
259
+ className="c0"
260
+ >
261
+ <li
262
+ className="c1"
263
+ role="option"
264
+ >
265
+ <div
266
+ className="c2"
267
+ data-key="1"
268
+ onClick={[Function]}
269
+ onKeyDown={[Function]}
270
+ tabIndex={-1}
271
+ value="1"
272
+ >
273
+ MenuItem
274
+ </div>
275
+ </li>
276
+ <li
277
+ className="c1"
278
+ role="option"
279
+ >
280
+ <div
281
+ aria-disabled={true}
282
+ className="c2"
283
+ data-key="2"
284
+ disabled={true}
285
+ onKeyDown={[Function]}
286
+ tabIndex={-1}
287
+ value="2"
288
+ >
289
+ Disabled MenuItem
290
+ </div>
291
+ </li>
292
+ </ul>
293
+ </div>
294
+ `;
295
+
296
+ exports[`Storyshots DropdownSelector/MenuList Group 1`] = `
297
+ .c4 {
298
+ list-style: none;
299
+ }
300
+
301
+ .c5 {
302
+ display: -webkit-box;
303
+ display: -webkit-flex;
304
+ display: -ms-flexbox;
305
+ display: flex;
306
+ -webkit-align-items: center;
307
+ -webkit-box-align: center;
308
+ -ms-flex-align: center;
309
+ align-items: center;
310
+ min-height: 40px;
311
+ cursor: pointer;
312
+ outline: none;
313
+ padding-right: 16px;
314
+ padding-left: 16px;
315
+ }
316
+
317
+ .c5:disabled,
318
+ .c5[aria-disabled]:not([aria-disabled=false]) {
319
+ opacity: 0.32;
320
+ }
321
+
322
+ .c5[aria-disabled="true"] {
323
+ cursor: default;
324
+ }
325
+
326
+ .c5:hover,
327
+ .c5:focus,
328
+ .c5:focus-within {
329
+ background-color: var(--charcoal-surface3);
330
+ }
331
+
332
+ .c0 {
333
+ padding: 0;
334
+ margin: 0;
335
+ }
336
+
337
+ .c2 {
338
+ display: block;
339
+ color: #858585;
340
+ font-size: 12px;
341
+ font-weight: bold;
342
+ padding: 12px 0 8px 16px;
343
+ }
344
+
345
+ .c3 {
346
+ padding-left: 0;
347
+ margin: 0;
348
+ box-sizing: border-box;
349
+ list-style: none;
350
+ overflow: hidden;
351
+ }
352
+
353
+ .c1 {
354
+ display: block;
355
+ }
356
+
357
+ <div
358
+ data-dark={false}
359
+ >
360
+ <ul
361
+ className="c0"
362
+ >
363
+ <li
364
+ className="c1"
365
+ role="presentation"
366
+ >
367
+ <span
368
+ className="c2"
369
+ >
370
+ Section1
371
+ </span>
372
+ <ul
373
+ className="c3"
374
+ role="group"
375
+ >
376
+ <li
377
+ className="c4"
378
+ role="option"
379
+ >
380
+ <div
381
+ className="c5"
382
+ data-key="0"
383
+ onClick={[Function]}
384
+ onKeyDown={[Function]}
385
+ tabIndex={-1}
386
+ value="0"
387
+ >
388
+ Menu
389
+ 0
390
+ </div>
391
+ </li>
392
+ <li
393
+ className="c4"
394
+ role="option"
395
+ >
396
+ <div
397
+ className="c5"
398
+ data-key="1"
399
+ onClick={[Function]}
400
+ onKeyDown={[Function]}
401
+ tabIndex={-1}
402
+ value="1"
403
+ >
404
+ Menu
405
+ 1
406
+ </div>
407
+ </li>
408
+ <li
409
+ className="c4"
410
+ role="option"
411
+ >
412
+ <div
413
+ className="c5"
414
+ data-key="2"
415
+ onClick={[Function]}
416
+ onKeyDown={[Function]}
417
+ tabIndex={-1}
418
+ value="2"
419
+ >
420
+ Menu
421
+ 2
422
+ </div>
423
+ </li>
424
+ <li
425
+ className="c4"
426
+ role="option"
427
+ >
428
+ <div
429
+ className="c5"
430
+ data-key="3"
431
+ onClick={[Function]}
432
+ onKeyDown={[Function]}
433
+ tabIndex={-1}
434
+ value="3"
435
+ >
436
+ Menu
437
+ 3
438
+ </div>
439
+ </li>
440
+ <li
441
+ className="c4"
442
+ role="option"
443
+ >
444
+ <div
445
+ className="c5"
446
+ data-key="4"
447
+ onClick={[Function]}
448
+ onKeyDown={[Function]}
449
+ tabIndex={-1}
450
+ value="4"
451
+ >
452
+ Menu
453
+ 4
454
+ </div>
455
+ </li>
456
+ </ul>
457
+ </li>
458
+ <li
459
+ className="c1"
460
+ role="presentation"
461
+ >
462
+ <span
463
+ className="c2"
464
+ >
465
+ Section2
466
+ </span>
467
+ <ul
468
+ className="c3"
469
+ role="group"
470
+ >
471
+ <li
472
+ className="c4"
473
+ role="option"
474
+ >
475
+ <div
476
+ className="c5"
477
+ data-key="5"
478
+ onClick={[Function]}
479
+ onKeyDown={[Function]}
480
+ tabIndex={-1}
481
+ value="5"
482
+ >
483
+ Menu
484
+ 5
485
+ </div>
486
+ </li>
487
+ <li
488
+ className="c4"
489
+ role="option"
490
+ >
491
+ <div
492
+ className="c5"
493
+ data-key="6"
494
+ onClick={[Function]}
495
+ onKeyDown={[Function]}
496
+ tabIndex={-1}
497
+ value="6"
498
+ >
499
+ Menu
500
+ 6
501
+ </div>
502
+ </li>
503
+ <li
504
+ className="c4"
505
+ role="option"
506
+ >
507
+ <div
508
+ className="c5"
509
+ data-key="7"
510
+ onClick={[Function]}
511
+ onKeyDown={[Function]}
512
+ tabIndex={-1}
513
+ value="7"
514
+ >
515
+ Menu
516
+ 7
517
+ </div>
518
+ </li>
519
+ <li
520
+ className="c4"
521
+ role="option"
522
+ >
523
+ <div
524
+ className="c5"
525
+ data-key="8"
526
+ onClick={[Function]}
527
+ onKeyDown={[Function]}
528
+ tabIndex={-1}
529
+ value="8"
530
+ >
531
+ Menu
532
+ 8
533
+ </div>
534
+ </li>
535
+ <li
536
+ className="c4"
537
+ role="option"
538
+ >
539
+ <div
540
+ className="c5"
541
+ data-key="9"
542
+ onClick={[Function]}
543
+ onKeyDown={[Function]}
544
+ tabIndex={-1}
545
+ value="9"
546
+ >
547
+ Menu
548
+ 9
549
+ </div>
550
+ </li>
551
+ </ul>
552
+ </li>
553
+ </ul>
554
+ </div>
555
+ `;
@@ -0,0 +1,174 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Storyshots DropdownSelector/Popover Basic 1`] = `
4
+ .c0 {
5
+ cursor: pointer;
6
+ -webkit-appearance: none;
7
+ -moz-appearance: none;
8
+ appearance: none;
9
+ background: transparent;
10
+ padding: 0;
11
+ border-style: none;
12
+ outline: none;
13
+ color: inherit;
14
+ text-rendering: inherit;
15
+ -webkit-letter-spacing: inherit;
16
+ -moz-letter-spacing: inherit;
17
+ -ms-letter-spacing: inherit;
18
+ letter-spacing: inherit;
19
+ word-spacing: inherit;
20
+ font: inherit;
21
+ margin: 0;
22
+ overflow: visible;
23
+ text-transform: none;
24
+ }
25
+
26
+ .c0:disabled,
27
+ .c0[aria-disabled]:not([aria-disabled=false]) {
28
+ cursor: default;
29
+ }
30
+
31
+ .c0:focus {
32
+ outline: none;
33
+ }
34
+
35
+ .c0::-moz-focus-inner {
36
+ border-style: none;
37
+ padding: 0;
38
+ }
39
+
40
+ .c1 {
41
+ width: -webkit-min-content;
42
+ width: -moz-min-content;
43
+ width: min-content;
44
+ display: inline-grid;
45
+ -webkit-align-items: center;
46
+ -webkit-box-align: center;
47
+ -ms-flex-align: center;
48
+ align-items: center;
49
+ -webkit-box-pack: center;
50
+ -webkit-justify-content: center;
51
+ -ms-flex-pack: center;
52
+ justify-content: center;
53
+ cursor: pointer;
54
+ -webkit-user-select: none;
55
+ -moz-user-select: none;
56
+ -ms-user-select: none;
57
+ user-select: none;
58
+ white-space: nowrap;
59
+ color: var(--charcoal-text2);
60
+ background-color: var(--charcoal-surface3);
61
+ font-size: 14px;
62
+ line-height: 22px;
63
+ font-weight: bold;
64
+ padding-right: 24px;
65
+ padding-left: 24px;
66
+ border-radius: 999999px;
67
+ -webkit-transition: 0.2s color,0.2s background-color,0.2s box-shadow;
68
+ transition: 0.2s color,0.2s background-color,0.2s box-shadow;
69
+ height: 40px;
70
+ }
71
+
72
+ .c1:hover:not(:disabled):not([aria-disabled]),
73
+ .c1:hover[aria-disabled=false] {
74
+ color: var(--charcoal-text2-hover);
75
+ }
76
+
77
+ .c1:active:not(:disabled):not([aria-disabled]),
78
+ .c1:active[aria-disabled=false] {
79
+ color: var(--charcoal-text2-press);
80
+ }
81
+
82
+ .c1:hover:not(:disabled):not([aria-disabled]),
83
+ .c1:hover[aria-disabled=false] {
84
+ background-color: var(--charcoal-surface3-hover);
85
+ }
86
+
87
+ .c1:active:not(:disabled):not([aria-disabled]),
88
+ .c1:active[aria-disabled=false] {
89
+ background-color: var(--charcoal-surface3-press);
90
+ }
91
+
92
+ .c1:disabled,
93
+ .c1[aria-disabled]:not([aria-disabled=false]) {
94
+ opacity: 0.32;
95
+ }
96
+
97
+ .c1:not(:disabled):not([aria-disabled]):focus,
98
+ .c1[aria-disabled=false]:focus,
99
+ .c1:not(:disabled):not([aria-disabled]):active,
100
+ .c1[aria-disabled=false]:active {
101
+ outline: none;
102
+ box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
103
+ }
104
+
105
+ .c1:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
106
+ .c1[aria-disabled=false]:focus:not(:focus-visible),
107
+ .c1:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
108
+ .c1[aria-disabled=false]:active:not(:focus-visible) {
109
+ outline: none;
110
+ }
111
+
112
+ .c1:not(:disabled):not([aria-disabled]):focus-visible,
113
+ .c1[aria-disabled=false]:focus-visible {
114
+ outline: none;
115
+ box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
116
+ }
117
+
118
+ <div
119
+ data-dark={false}
120
+ >
121
+ <button
122
+ className="c0 c1"
123
+ disabled={false}
124
+ onClick={[Function]}
125
+ style={
126
+ Object {
127
+ "position": "absolute",
128
+ }
129
+ }
130
+ >
131
+ button
132
+ </button>
133
+ <button
134
+ className="c0 c1"
135
+ disabled={false}
136
+ onClick={[Function]}
137
+ style={
138
+ Object {
139
+ "position": "absolute",
140
+ "right": 8,
141
+ }
142
+ }
143
+ >
144
+ button
145
+ </button>
146
+ <button
147
+ className="c0 c1"
148
+ disabled={false}
149
+ onClick={[Function]}
150
+ style={
151
+ Object {
152
+ "bottom": 8,
153
+ "position": "absolute",
154
+ }
155
+ }
156
+ >
157
+ button
158
+ </button>
159
+ <button
160
+ className="c0 c1"
161
+ disabled={false}
162
+ onClick={[Function]}
163
+ style={
164
+ Object {
165
+ "bottom": 8,
166
+ "position": "absolute",
167
+ "right": 8,
168
+ }
169
+ }
170
+ >
171
+ button
172
+ </button>
173
+ </div>
174
+ `;