@wordpress/components 21.0.5 → 21.0.7

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 (87) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/autocomplete/index.js +11 -9
  3. package/build/autocomplete/index.js.map +1 -1
  4. package/build/circular-option-picker/index.js +14 -14
  5. package/build/circular-option-picker/index.js.map +1 -1
  6. package/build/color-palette/index.js +83 -30
  7. package/build/color-palette/index.js.map +1 -1
  8. package/build/color-palette/styles.js +3 -3
  9. package/build/color-palette/styles.js.map +1 -1
  10. package/build/color-palette/types.js +6 -0
  11. package/build/color-palette/types.js.map +1 -0
  12. package/build/font-size-picker/index.js +1 -1
  13. package/build/font-size-picker/index.js.map +1 -1
  14. package/build/form-token-field/index.js +12 -10
  15. package/build/form-token-field/index.js.map +1 -1
  16. package/build/navigator/navigator-provider/component.js +5 -3
  17. package/build/navigator/navigator-provider/component.js.map +1 -1
  18. package/build/navigator/navigator-screen/component.js +5 -3
  19. package/build/navigator/navigator-screen/component.js.map +1 -1
  20. package/build/popover/index.js +1 -26
  21. package/build/popover/index.js.map +1 -1
  22. package/build-module/autocomplete/index.js +10 -9
  23. package/build-module/autocomplete/index.js.map +1 -1
  24. package/build-module/circular-option-picker/index.js +14 -14
  25. package/build-module/circular-option-picker/index.js.map +1 -1
  26. package/build-module/color-palette/index.js +81 -28
  27. package/build-module/color-palette/index.js.map +1 -1
  28. package/build-module/color-palette/styles.js +3 -3
  29. package/build-module/color-palette/styles.js.map +1 -1
  30. package/build-module/color-palette/types.js +2 -0
  31. package/build-module/color-palette/types.js.map +1 -0
  32. package/build-module/font-size-picker/index.js +1 -1
  33. package/build-module/font-size-picker/index.js.map +1 -1
  34. package/build-module/form-token-field/index.js +11 -10
  35. package/build-module/form-token-field/index.js.map +1 -1
  36. package/build-module/navigator/navigator-provider/component.js +5 -3
  37. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  38. package/build-module/navigator/navigator-screen/component.js +5 -3
  39. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  40. package/build-module/popover/index.js +1 -26
  41. package/build-module/popover/index.js.map +1 -1
  42. package/build-types/border-control/types.d.ts +1 -1
  43. package/build-types/border-control/types.d.ts.map +1 -1
  44. package/build-types/circular-option-picker/index.d.ts +4 -24
  45. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  46. package/build-types/color-palette/index.d.ts +33 -18
  47. package/build-types/color-palette/index.d.ts.map +1 -1
  48. package/build-types/color-palette/stories/index.d.ts +21 -0
  49. package/build-types/color-palette/stories/index.d.ts.map +1 -0
  50. package/build-types/color-palette/styles.d.ts +2 -1
  51. package/build-types/color-palette/styles.d.ts.map +1 -1
  52. package/build-types/color-palette/test/index.d.ts +2 -0
  53. package/build-types/color-palette/test/index.d.ts.map +1 -0
  54. package/build-types/color-palette/types.d.ts +86 -0
  55. package/build-types/color-palette/types.d.ts.map +1 -0
  56. package/build-types/confirm-dialog/component.d.ts +4 -4
  57. package/build-types/form-token-field/index.d.ts.map +1 -1
  58. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  59. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  60. package/build-types/navigator/types.d.ts +1 -0
  61. package/build-types/navigator/types.d.ts.map +1 -1
  62. package/build-types/popover/index.d.ts.map +1 -1
  63. package/build-types/popover/types.d.ts +0 -14
  64. package/build-types/popover/types.d.ts.map +1 -1
  65. package/package.json +2 -2
  66. package/src/autocomplete/index.js +18 -9
  67. package/src/border-control/types.ts +1 -1
  68. package/src/circular-option-picker/index.js +14 -20
  69. package/src/color-palette/README.md +51 -49
  70. package/src/color-palette/{index.js → index.tsx} +132 -51
  71. package/src/color-palette/stories/{index.js → index.tsx} +38 -27
  72. package/src/color-palette/{styles.js → styles.ts} +0 -0
  73. package/src/color-palette/test/__snapshots__/index.tsx.snap +270 -0
  74. package/src/color-palette/test/index.tsx +164 -0
  75. package/src/color-palette/types.ts +93 -0
  76. package/src/font-size-picker/index.js +1 -1
  77. package/src/form-token-field/index.tsx +21 -10
  78. package/src/form-token-field/test/index.tsx +167 -73
  79. package/src/navigator/navigator-provider/component.tsx +2 -0
  80. package/src/navigator/navigator-screen/component.tsx +9 -1
  81. package/src/navigator/types.ts +1 -0
  82. package/src/popover/README.md +3 -9
  83. package/src/popover/index.tsx +1 -25
  84. package/src/popover/types.ts +0 -14
  85. package/tsconfig.tsbuildinfo +1 -1
  86. package/src/color-palette/test/__snapshots__/index.js.snap +0 -1207
  87. package/src/color-palette/test/index.js +0 -118
@@ -1,1207 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`ColorPalette Dropdown .renderContent should render dropdown content 1`] = `
4
- <DropdownContentWrapperDiv
5
- className="components-dropdown-content-wrapper"
6
- data-wp-c16t={true}
7
- data-wp-component="DropdownContentWrapper"
8
- paddingSize="none"
9
- >
10
- <LegacyAdapter
11
- color="#f00"
12
- onChange={[Function]}
13
- />
14
- </DropdownContentWrapperDiv>
15
- `;
16
-
17
- exports[`ColorPalette Dropdown .renderToggle should render dropdown content 1`] = `
18
- .emotion-0 {
19
- display: -webkit-box;
20
- display: -webkit-flex;
21
- display: -ms-flexbox;
22
- display: flex;
23
- }
24
-
25
- .emotion-1 {
26
- -webkit-align-items: flex-start;
27
- -webkit-box-align: flex-start;
28
- -ms-flex-align: flex-start;
29
- align-items: flex-start;
30
- -webkit-flex-direction: row;
31
- -ms-flex-direction: row;
32
- flex-direction: row;
33
- gap: calc(4px * 2);
34
- -webkit-box-pack: justify;
35
- -webkit-justify-content: space-between;
36
- justify-content: space-between;
37
- width: 100%;
38
- }
39
-
40
- .emotion-2>* {
41
- min-width: 0;
42
- }
43
-
44
- .emotion-3 {
45
- display: -webkit-box;
46
- display: -webkit-flex;
47
- display: -ms-flexbox;
48
- display: flex;
49
- -webkit-align-items: flex-start;
50
- -webkit-box-align: flex-start;
51
- -ms-flex-align: flex-start;
52
- align-items: flex-start;
53
- -webkit-flex-direction: row;
54
- -ms-flex-direction: row;
55
- flex-direction: row;
56
- gap: calc(4px * 2);
57
- -webkit-box-pack: justify;
58
- -webkit-justify-content: space-between;
59
- justify-content: space-between;
60
- width: 100%;
61
- }
62
-
63
- .emotion-3>* {
64
- min-width: 0;
65
- }
66
-
67
- .emotion-5 {
68
- display: block;
69
- max-height: 100%;
70
- max-width: 100%;
71
- min-height: 0;
72
- min-width: 0;
73
- }
74
-
75
- .emotion-7 {
76
- -webkit-flex: 1;
77
- -ms-flex: 1;
78
- flex: 1;
79
- }
80
-
81
- .emotion-8 {
82
- display: block;
83
- max-height: 100%;
84
- max-width: 100%;
85
- min-height: 0;
86
- min-width: 0;
87
- -webkit-flex: 1;
88
- -ms-flex: 1;
89
- flex: 1;
90
- }
91
-
92
- .emotion-10 {
93
- display: block;
94
- overflow: hidden;
95
- text-overflow: ellipsis;
96
- white-space: nowrap;
97
- }
98
-
99
- .emotion-14 {
100
- display: block;
101
- overflow: hidden;
102
- text-overflow: ellipsis;
103
- white-space: nowrap;
104
- display: block;
105
- max-height: 100%;
106
- max-width: 100%;
107
- min-height: 0;
108
- min-width: 0;
109
- -webkit-flex: 1;
110
- -ms-flex: 1;
111
- flex: 1;
112
- }
113
-
114
- .emotion-18 {
115
- display: block;
116
- max-height: 100%;
117
- max-width: 100%;
118
- min-height: 0;
119
- min-width: 0;
120
- }
121
-
122
- <Flex
123
- align="flex-start"
124
- aria-expanded={true}
125
- aria-haspopup="true"
126
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
127
- as="button"
128
- className="components-color-palette__custom-color"
129
- justify="space-between"
130
- onClick={[MockFunction]}
131
- style={
132
- Object {
133
- "background": "#f00",
134
- "color": "#000",
135
- }
136
- }
137
- >
138
- <View
139
- aria-expanded={true}
140
- aria-haspopup="true"
141
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
142
- as="button"
143
- className="emotion-0 emotion-1 emotion-2 components-flex components-color-palette__custom-color"
144
- data-wp-c16t={true}
145
- data-wp-component="Flex"
146
- onClick={[MockFunction]}
147
- style={
148
- Object {
149
- "background": "#f00",
150
- "color": "#000",
151
- }
152
- }
153
- >
154
- <Noop />
155
- <button
156
- aria-expanded={true}
157
- aria-haspopup="true"
158
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
159
- className="components-flex components-color-palette__custom-color emotion-3 emotion-4"
160
- data-wp-c16t={true}
161
- data-wp-component="Flex"
162
- onClick={[MockFunction]}
163
- style={
164
- Object {
165
- "background": "#f00",
166
- "color": "#000",
167
- }
168
- }
169
- >
170
- <FlexItem
171
- as={
172
- Object {
173
- "$$typeof": Symbol(react.forward_ref),
174
- "__contextSystemKey__": Array [
175
- "Truncate",
176
- ],
177
- "render": [Function],
178
- "selector": ".components-truncate",
179
- }
180
- }
181
- className="components-color-palette__custom-color-name"
182
- isBlock={true}
183
- >
184
- <View
185
- as={
186
- Object {
187
- "$$typeof": Symbol(react.forward_ref),
188
- "__contextSystemKey__": Array [
189
- "Truncate",
190
- ],
191
- "render": [Function],
192
- "selector": ".components-truncate",
193
- }
194
- }
195
- className="emotion-5 emotion-6 emotion-7 components-flex-item components-color-palette__custom-color-name"
196
- data-wp-c16t={true}
197
- data-wp-component="FlexItem"
198
- >
199
- <Noop />
200
- <Truncate
201
- className="components-flex-item components-color-palette__custom-color-name emotion-8 emotion-4"
202
- data-wp-c16t={true}
203
- data-wp-component="FlexItem"
204
- >
205
- <View
206
- as="span"
207
- className="emotion-10 components-truncate components-flex-item components-color-palette__custom-color-name emotion-8 emotion-4"
208
- data-wp-c16t={true}
209
- data-wp-component="FlexItem"
210
- >
211
- <Noop />
212
- <span
213
- className="components-truncate components-flex-item components-color-palette__custom-color-name emotion-4 emotion-14 emotion-4"
214
- data-wp-c16t={true}
215
- data-wp-component="FlexItem"
216
- >
217
- red
218
- </span>
219
- </View>
220
- </Truncate>
221
- </View>
222
- </FlexItem>
223
- <FlexItem
224
- as="span"
225
- className="components-color-palette__custom-color-value"
226
- >
227
- <View
228
- as="span"
229
- className="emotion-5 emotion-6 components-flex-item components-color-palette__custom-color-value"
230
- data-wp-c16t={true}
231
- data-wp-component="FlexItem"
232
- >
233
- <Noop />
234
- <span
235
- className="components-flex-item components-color-palette__custom-color-value emotion-18 emotion-4"
236
- data-wp-c16t={true}
237
- data-wp-component="FlexItem"
238
- >
239
- f00
240
- </span>
241
- </View>
242
- </FlexItem>
243
- </button>
244
- </View>
245
- </Flex>
246
- `;
247
-
248
- exports[`ColorPalette Dropdown should render it correctly 1`] = `
249
- .emotion-0 {
250
- display: -webkit-box;
251
- display: -webkit-flex;
252
- display: -ms-flexbox;
253
- display: flex;
254
- }
255
-
256
- .emotion-1 {
257
- -webkit-align-items: flex-start;
258
- -webkit-box-align: flex-start;
259
- -ms-flex-align: flex-start;
260
- align-items: flex-start;
261
- -webkit-flex-direction: row;
262
- -ms-flex-direction: row;
263
- flex-direction: row;
264
- gap: calc(4px * 2);
265
- -webkit-box-pack: justify;
266
- -webkit-justify-content: space-between;
267
- justify-content: space-between;
268
- width: 100%;
269
- }
270
-
271
- .emotion-2>* {
272
- min-width: 0;
273
- }
274
-
275
- .emotion-3 {
276
- display: -webkit-box;
277
- display: -webkit-flex;
278
- display: -ms-flexbox;
279
- display: flex;
280
- -webkit-align-items: flex-start;
281
- -webkit-box-align: flex-start;
282
- -ms-flex-align: flex-start;
283
- align-items: flex-start;
284
- -webkit-flex-direction: row;
285
- -ms-flex-direction: row;
286
- flex-direction: row;
287
- gap: calc(4px * 2);
288
- -webkit-box-pack: justify;
289
- -webkit-justify-content: space-between;
290
- justify-content: space-between;
291
- width: 100%;
292
- }
293
-
294
- .emotion-3>* {
295
- min-width: 0;
296
- }
297
-
298
- .emotion-5 {
299
- display: block;
300
- max-height: 100%;
301
- max-width: 100%;
302
- min-height: 0;
303
- min-width: 0;
304
- }
305
-
306
- .emotion-7 {
307
- -webkit-flex: 1;
308
- -ms-flex: 1;
309
- flex: 1;
310
- }
311
-
312
- .emotion-8 {
313
- display: block;
314
- max-height: 100%;
315
- max-width: 100%;
316
- min-height: 0;
317
- min-width: 0;
318
- -webkit-flex: 1;
319
- -ms-flex: 1;
320
- flex: 1;
321
- }
322
-
323
- .emotion-10 {
324
- display: block;
325
- overflow: hidden;
326
- text-overflow: ellipsis;
327
- white-space: nowrap;
328
- }
329
-
330
- .emotion-14 {
331
- display: block;
332
- overflow: hidden;
333
- text-overflow: ellipsis;
334
- white-space: nowrap;
335
- display: block;
336
- max-height: 100%;
337
- max-width: 100%;
338
- min-height: 0;
339
- min-width: 0;
340
- -webkit-flex: 1;
341
- -ms-flex: 1;
342
- flex: 1;
343
- }
344
-
345
- .emotion-18 {
346
- display: block;
347
- max-height: 100%;
348
- max-width: 100%;
349
- min-height: 0;
350
- min-width: 0;
351
- }
352
-
353
- <Dropdown
354
- contentClassName="components-color-palette__custom-color-dropdown-content"
355
- popoverProps={
356
- Object {
357
- "offset": 8,
358
- "placement": "bottom",
359
- "shift": true,
360
- }
361
- }
362
- renderContent={[Function]}
363
- renderToggle={[Function]}
364
- >
365
- <div
366
- className="components-dropdown"
367
- tabIndex="-1"
368
- >
369
- <Flex
370
- align="flex-start"
371
- aria-expanded={false}
372
- aria-haspopup="true"
373
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
374
- as="button"
375
- className="components-color-palette__custom-color"
376
- justify="space-between"
377
- onClick={[Function]}
378
- style={
379
- Object {
380
- "background": "#f00",
381
- "color": "#000",
382
- }
383
- }
384
- >
385
- <View
386
- aria-expanded={false}
387
- aria-haspopup="true"
388
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
389
- as="button"
390
- className="emotion-0 emotion-1 emotion-2 components-flex components-color-palette__custom-color"
391
- data-wp-c16t={true}
392
- data-wp-component="Flex"
393
- onClick={[Function]}
394
- style={
395
- Object {
396
- "background": "#f00",
397
- "color": "#000",
398
- }
399
- }
400
- >
401
- <Noop />
402
- <button
403
- aria-expanded={false}
404
- aria-haspopup="true"
405
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
406
- className="components-flex components-color-palette__custom-color emotion-3 emotion-4"
407
- data-wp-c16t={true}
408
- data-wp-component="Flex"
409
- onClick={[Function]}
410
- style={
411
- Object {
412
- "background": "#f00",
413
- "color": "#000",
414
- }
415
- }
416
- >
417
- <FlexItem
418
- as={
419
- Object {
420
- "$$typeof": Symbol(react.forward_ref),
421
- "__contextSystemKey__": Array [
422
- "Truncate",
423
- ],
424
- "render": [Function],
425
- "selector": ".components-truncate",
426
- }
427
- }
428
- className="components-color-palette__custom-color-name"
429
- isBlock={true}
430
- >
431
- <View
432
- as={
433
- Object {
434
- "$$typeof": Symbol(react.forward_ref),
435
- "__contextSystemKey__": Array [
436
- "Truncate",
437
- ],
438
- "render": [Function],
439
- "selector": ".components-truncate",
440
- }
441
- }
442
- className="emotion-5 emotion-6 emotion-7 components-flex-item components-color-palette__custom-color-name"
443
- data-wp-c16t={true}
444
- data-wp-component="FlexItem"
445
- >
446
- <Noop />
447
- <Truncate
448
- className="components-flex-item components-color-palette__custom-color-name emotion-8 emotion-4"
449
- data-wp-c16t={true}
450
- data-wp-component="FlexItem"
451
- >
452
- <View
453
- as="span"
454
- className="emotion-10 components-truncate components-flex-item components-color-palette__custom-color-name emotion-8 emotion-4"
455
- data-wp-c16t={true}
456
- data-wp-component="FlexItem"
457
- >
458
- <Noop />
459
- <span
460
- className="components-truncate components-flex-item components-color-palette__custom-color-name emotion-4 emotion-14 emotion-4"
461
- data-wp-c16t={true}
462
- data-wp-component="FlexItem"
463
- >
464
- red
465
- </span>
466
- </View>
467
- </Truncate>
468
- </View>
469
- </FlexItem>
470
- <FlexItem
471
- as="span"
472
- className="components-color-palette__custom-color-value"
473
- >
474
- <View
475
- as="span"
476
- className="emotion-5 emotion-6 components-flex-item components-color-palette__custom-color-value"
477
- data-wp-c16t={true}
478
- data-wp-component="FlexItem"
479
- >
480
- <Noop />
481
- <span
482
- className="components-flex-item components-color-palette__custom-color-value emotion-18 emotion-4"
483
- data-wp-c16t={true}
484
- data-wp-component="FlexItem"
485
- >
486
- f00
487
- </span>
488
- </View>
489
- </FlexItem>
490
- </button>
491
- </View>
492
- </Flex>
493
- </div>
494
- </Dropdown>
495
- `;
496
-
497
- exports[`ColorPalette should allow disabling custom color picker 1`] = `
498
- <VStack
499
- spacing={3}
500
- >
501
- <SinglePalette
502
- actions={
503
- <ButtonAction
504
- onClick={[Function]}
505
- >
506
- Clear
507
- </ButtonAction>
508
- }
509
- clearColor={[Function]}
510
- clearable={true}
511
- colors={
512
- Array [
513
- Object {
514
- "color": "#f00",
515
- "name": "red",
516
- },
517
- Object {
518
- "color": "#fff",
519
- "name": "white",
520
- },
521
- Object {
522
- "color": "#00f",
523
- "name": "blue",
524
- },
525
- ]
526
- }
527
- onChange={[MockFunction]}
528
- value="#f00"
529
- />
530
- </VStack>
531
- `;
532
-
533
- exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
534
- .emotion-0 {
535
- display: -webkit-box;
536
- display: -webkit-flex;
537
- display: -ms-flexbox;
538
- display: flex;
539
- }
540
-
541
- .emotion-1 {
542
- -webkit-align-items: normal;
543
- -webkit-box-align: normal;
544
- -ms-flex-align: normal;
545
- align-items: normal;
546
- -webkit-flex-direction: column;
547
- -ms-flex-direction: column;
548
- flex-direction: column;
549
- gap: calc(4px * 3);
550
- -webkit-box-pack: justify;
551
- -webkit-justify-content: space-between;
552
- justify-content: space-between;
553
- }
554
-
555
- .emotion-2>* {
556
- min-height: 0;
557
- }
558
-
559
- .emotion-3 {
560
- display: -webkit-box;
561
- display: -webkit-flex;
562
- display: -ms-flexbox;
563
- display: flex;
564
- -webkit-align-items: normal;
565
- -webkit-box-align: normal;
566
- -ms-flex-align: normal;
567
- align-items: normal;
568
- -webkit-flex-direction: column;
569
- -ms-flex-direction: column;
570
- flex-direction: column;
571
- gap: calc(4px * 3);
572
- -webkit-box-pack: justify;
573
- -webkit-justify-content: space-between;
574
- justify-content: space-between;
575
- }
576
-
577
- .emotion-3>* {
578
- min-height: 0;
579
- }
580
-
581
- .emotion-6 {
582
- -webkit-align-items: flex-start;
583
- -webkit-box-align: flex-start;
584
- -ms-flex-align: flex-start;
585
- align-items: flex-start;
586
- -webkit-flex-direction: row;
587
- -ms-flex-direction: row;
588
- flex-direction: row;
589
- gap: calc(4px * 2);
590
- -webkit-box-pack: justify;
591
- -webkit-justify-content: space-between;
592
- justify-content: space-between;
593
- width: 100%;
594
- }
595
-
596
- .emotion-7>* {
597
- min-width: 0;
598
- }
599
-
600
- .emotion-8 {
601
- display: -webkit-box;
602
- display: -webkit-flex;
603
- display: -ms-flexbox;
604
- display: flex;
605
- -webkit-align-items: flex-start;
606
- -webkit-box-align: flex-start;
607
- -ms-flex-align: flex-start;
608
- align-items: flex-start;
609
- -webkit-flex-direction: row;
610
- -ms-flex-direction: row;
611
- flex-direction: row;
612
- gap: calc(4px * 2);
613
- -webkit-box-pack: justify;
614
- -webkit-justify-content: space-between;
615
- justify-content: space-between;
616
- width: 100%;
617
- }
618
-
619
- .emotion-8>* {
620
- min-width: 0;
621
- }
622
-
623
- .emotion-10 {
624
- display: block;
625
- max-height: 100%;
626
- max-width: 100%;
627
- min-height: 0;
628
- min-width: 0;
629
- }
630
-
631
- .emotion-12 {
632
- -webkit-flex: 1;
633
- -ms-flex: 1;
634
- flex: 1;
635
- }
636
-
637
- .emotion-13 {
638
- display: block;
639
- max-height: 100%;
640
- max-width: 100%;
641
- min-height: 0;
642
- min-width: 0;
643
- -webkit-flex: 1;
644
- -ms-flex: 1;
645
- flex: 1;
646
- }
647
-
648
- .emotion-15 {
649
- display: block;
650
- overflow: hidden;
651
- text-overflow: ellipsis;
652
- white-space: nowrap;
653
- }
654
-
655
- .emotion-19 {
656
- display: block;
657
- overflow: hidden;
658
- text-overflow: ellipsis;
659
- white-space: nowrap;
660
- display: block;
661
- max-height: 100%;
662
- max-width: 100%;
663
- min-height: 0;
664
- min-width: 0;
665
- -webkit-flex: 1;
666
- -ms-flex: 1;
667
- flex: 1;
668
- }
669
-
670
- .emotion-23 {
671
- display: block;
672
- max-height: 100%;
673
- max-width: 100%;
674
- min-height: 0;
675
- min-width: 0;
676
- }
677
-
678
- <ColorPalette
679
- colors={
680
- Array [
681
- Object {
682
- "color": "#f00",
683
- "name": "red",
684
- },
685
- Object {
686
- "color": "#fff",
687
- "name": "white",
688
- },
689
- Object {
690
- "color": "#00f",
691
- "name": "blue",
692
- },
693
- ]
694
- }
695
- onChange={[MockFunction]}
696
- value="#f00"
697
- >
698
- <VStack
699
- spacing={3}
700
- >
701
- <View
702
- className="emotion-0 emotion-1 emotion-2 components-flex components-h-stack components-v-stack"
703
- data-wp-c16t={true}
704
- data-wp-component="VStack"
705
- isColumn={true}
706
- >
707
- <Noop />
708
- <div
709
- className="components-flex components-h-stack components-v-stack emotion-3 emotion-4"
710
- data-wp-c16t={true}
711
- data-wp-component="VStack"
712
- >
713
- <CustomColorPickerDropdown
714
- isRenderedInSidebar={false}
715
- key=".0"
716
- renderContent={[Function]}
717
- renderToggle={[Function]}
718
- >
719
- <Dropdown
720
- contentClassName="components-color-palette__custom-color-dropdown-content"
721
- popoverProps={
722
- Object {
723
- "offset": 8,
724
- "placement": "bottom",
725
- "shift": true,
726
- }
727
- }
728
- renderContent={[Function]}
729
- renderToggle={[Function]}
730
- >
731
- <div
732
- className="components-dropdown"
733
- tabIndex="-1"
734
- >
735
- <Flex
736
- align="flex-start"
737
- aria-expanded={false}
738
- aria-haspopup="true"
739
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
740
- as="button"
741
- className="components-color-palette__custom-color"
742
- justify="space-between"
743
- onClick={[Function]}
744
- style={
745
- Object {
746
- "background": "#f00",
747
- "color": "#000",
748
- }
749
- }
750
- >
751
- <View
752
- aria-expanded={false}
753
- aria-haspopup="true"
754
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
755
- as="button"
756
- className="emotion-0 emotion-6 emotion-7 components-flex components-color-palette__custom-color"
757
- data-wp-c16t={true}
758
- data-wp-component="Flex"
759
- onClick={[Function]}
760
- style={
761
- Object {
762
- "background": "#f00",
763
- "color": "#000",
764
- }
765
- }
766
- >
767
- <Noop />
768
- <button
769
- aria-expanded={false}
770
- aria-haspopup="true"
771
- aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
772
- className="components-flex components-color-palette__custom-color emotion-8 emotion-4"
773
- data-wp-c16t={true}
774
- data-wp-component="Flex"
775
- onClick={[Function]}
776
- style={
777
- Object {
778
- "background": "#f00",
779
- "color": "#000",
780
- }
781
- }
782
- >
783
- <FlexItem
784
- as={
785
- Object {
786
- "$$typeof": Symbol(react.forward_ref),
787
- "__contextSystemKey__": Array [
788
- "Truncate",
789
- ],
790
- "render": [Function],
791
- "selector": ".components-truncate",
792
- }
793
- }
794
- className="components-color-palette__custom-color-name"
795
- isBlock={true}
796
- >
797
- <View
798
- as={
799
- Object {
800
- "$$typeof": Symbol(react.forward_ref),
801
- "__contextSystemKey__": Array [
802
- "Truncate",
803
- ],
804
- "render": [Function],
805
- "selector": ".components-truncate",
806
- }
807
- }
808
- className="emotion-10 emotion-11 emotion-12 components-flex-item components-color-palette__custom-color-name"
809
- data-wp-c16t={true}
810
- data-wp-component="FlexItem"
811
- >
812
- <Noop />
813
- <Truncate
814
- className="components-flex-item components-color-palette__custom-color-name emotion-13 emotion-4"
815
- data-wp-c16t={true}
816
- data-wp-component="FlexItem"
817
- >
818
- <View
819
- as="span"
820
- className="emotion-15 components-truncate components-flex-item components-color-palette__custom-color-name emotion-13 emotion-4"
821
- data-wp-c16t={true}
822
- data-wp-component="FlexItem"
823
- >
824
- <Noop />
825
- <span
826
- className="components-truncate components-flex-item components-color-palette__custom-color-name emotion-4 emotion-19 emotion-4"
827
- data-wp-c16t={true}
828
- data-wp-component="FlexItem"
829
- >
830
- red
831
- </span>
832
- </View>
833
- </Truncate>
834
- </View>
835
- </FlexItem>
836
- <FlexItem
837
- as="span"
838
- className="components-color-palette__custom-color-value"
839
- >
840
- <View
841
- as="span"
842
- className="emotion-10 emotion-11 components-flex-item components-color-palette__custom-color-value"
843
- data-wp-c16t={true}
844
- data-wp-component="FlexItem"
845
- >
846
- <Noop />
847
- <span
848
- className="components-flex-item components-color-palette__custom-color-value emotion-23 emotion-4"
849
- data-wp-c16t={true}
850
- data-wp-component="FlexItem"
851
- >
852
- f00
853
- </span>
854
- </View>
855
- </FlexItem>
856
- </button>
857
- </View>
858
- </Flex>
859
- </div>
860
- </Dropdown>
861
- </CustomColorPickerDropdown>
862
- <SinglePalette
863
- actions={
864
- <ButtonAction
865
- onClick={[Function]}
866
- >
867
- Clear
868
- </ButtonAction>
869
- }
870
- clearColor={[Function]}
871
- clearable={true}
872
- colors={
873
- Array [
874
- Object {
875
- "color": "#f00",
876
- "name": "red",
877
- },
878
- Object {
879
- "color": "#fff",
880
- "name": "white",
881
- },
882
- Object {
883
- "color": "#00f",
884
- "name": "blue",
885
- },
886
- ]
887
- }
888
- key=".1"
889
- onChange={[MockFunction]}
890
- value="#f00"
891
- >
892
- <CircularOptionPicker
893
- actions={
894
- <ButtonAction
895
- onClick={[Function]}
896
- >
897
- Clear
898
- </ButtonAction>
899
- }
900
- options={
901
- Array [
902
- <Option
903
- aria-label="Color: red"
904
- isSelected={true}
905
- onClick={[Function]}
906
- selectedIconProps={
907
- Object {
908
- "fill": "#000",
909
- }
910
- }
911
- style={
912
- Object {
913
- "backgroundColor": "#f00",
914
- "color": "#f00",
915
- }
916
- }
917
- tooltipText="red"
918
- />,
919
- <Option
920
- aria-label="Color: white"
921
- isSelected={false}
922
- onClick={[Function]}
923
- selectedIconProps={Object {}}
924
- style={
925
- Object {
926
- "backgroundColor": "#fff",
927
- "color": "#fff",
928
- }
929
- }
930
- tooltipText="white"
931
- />,
932
- <Option
933
- aria-label="Color: blue"
934
- isSelected={false}
935
- onClick={[Function]}
936
- selectedIconProps={Object {}}
937
- style={
938
- Object {
939
- "backgroundColor": "#00f",
940
- "color": "#00f",
941
- }
942
- }
943
- tooltipText="blue"
944
- />,
945
- ]
946
- }
947
- >
948
- <div
949
- className="components-circular-option-picker"
950
- >
951
- <div
952
- className="components-circular-option-picker__swatches"
953
- >
954
- <Option
955
- aria-label="Color: red"
956
- isSelected={true}
957
- key="#f00-0"
958
- onClick={[Function]}
959
- selectedIconProps={
960
- Object {
961
- "fill": "#000",
962
- }
963
- }
964
- style={
965
- Object {
966
- "backgroundColor": "#f00",
967
- "color": "#f00",
968
- }
969
- }
970
- tooltipText="red"
971
- >
972
- <div
973
- className="components-circular-option-picker__option-wrapper"
974
- >
975
- <Tooltip
976
- text="red"
977
- >
978
- <ForwardRef(Button)
979
- aria-label="Color: red"
980
- className="components-circular-option-picker__option"
981
- isPressed={true}
982
- onBlur={[Function]}
983
- onClick={[Function]}
984
- onFocus={[Function]}
985
- onMouseDown={[Function]}
986
- onMouseEnter={[Function]}
987
- onMouseLeave={[Function]}
988
- style={
989
- Object {
990
- "backgroundColor": "#f00",
991
- "color": "#f00",
992
- }
993
- }
994
- >
995
- <button
996
- aria-describedby={null}
997
- aria-label="Color: red"
998
- aria-pressed={true}
999
- className="components-button components-circular-option-picker__option is-pressed"
1000
- onBlur={[Function]}
1001
- onClick={[Function]}
1002
- onFocus={[Function]}
1003
- onMouseDown={[Function]}
1004
- onMouseEnter={[Function]}
1005
- onMouseLeave={[Function]}
1006
- style={
1007
- Object {
1008
- "backgroundColor": "#f00",
1009
- "color": "#f00",
1010
- }
1011
- }
1012
- type="button"
1013
- />
1014
- </ForwardRef(Button)>
1015
- </Tooltip>
1016
- <Icon
1017
- fill="#000"
1018
- icon={
1019
- <SVG
1020
- viewBox="0 0 24 24"
1021
- xmlns="http://www.w3.org/2000/svg"
1022
- >
1023
- <Path
1024
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
1025
- />
1026
- </SVG>
1027
- }
1028
- >
1029
- <SVG
1030
- fill="#000"
1031
- height={24}
1032
- viewBox="0 0 24 24"
1033
- width={24}
1034
- xmlns="http://www.w3.org/2000/svg"
1035
- >
1036
- <svg
1037
- aria-hidden={true}
1038
- fill="#000"
1039
- focusable={false}
1040
- height={24}
1041
- viewBox="0 0 24 24"
1042
- width={24}
1043
- xmlns="http://www.w3.org/2000/svg"
1044
- >
1045
- <Path
1046
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
1047
- >
1048
- <path
1049
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
1050
- />
1051
- </Path>
1052
- </svg>
1053
- </SVG>
1054
- </Icon>
1055
- </div>
1056
- </Option>
1057
- <Option
1058
- aria-label="Color: white"
1059
- isSelected={false}
1060
- key="#fff-1"
1061
- onClick={[Function]}
1062
- selectedIconProps={Object {}}
1063
- style={
1064
- Object {
1065
- "backgroundColor": "#fff",
1066
- "color": "#fff",
1067
- }
1068
- }
1069
- tooltipText="white"
1070
- >
1071
- <div
1072
- className="components-circular-option-picker__option-wrapper"
1073
- >
1074
- <Tooltip
1075
- text="white"
1076
- >
1077
- <ForwardRef(Button)
1078
- aria-label="Color: white"
1079
- className="components-circular-option-picker__option"
1080
- isPressed={false}
1081
- onBlur={[Function]}
1082
- onClick={[Function]}
1083
- onFocus={[Function]}
1084
- onMouseDown={[Function]}
1085
- onMouseEnter={[Function]}
1086
- onMouseLeave={[Function]}
1087
- style={
1088
- Object {
1089
- "backgroundColor": "#fff",
1090
- "color": "#fff",
1091
- }
1092
- }
1093
- >
1094
- <button
1095
- aria-describedby={null}
1096
- aria-label="Color: white"
1097
- aria-pressed={false}
1098
- className="components-button components-circular-option-picker__option"
1099
- onBlur={[Function]}
1100
- onClick={[Function]}
1101
- onFocus={[Function]}
1102
- onMouseDown={[Function]}
1103
- onMouseEnter={[Function]}
1104
- onMouseLeave={[Function]}
1105
- style={
1106
- Object {
1107
- "backgroundColor": "#fff",
1108
- "color": "#fff",
1109
- }
1110
- }
1111
- type="button"
1112
- />
1113
- </ForwardRef(Button)>
1114
- </Tooltip>
1115
- </div>
1116
- </Option>
1117
- <Option
1118
- aria-label="Color: blue"
1119
- isSelected={false}
1120
- key="#00f-2"
1121
- onClick={[Function]}
1122
- selectedIconProps={Object {}}
1123
- style={
1124
- Object {
1125
- "backgroundColor": "#00f",
1126
- "color": "#00f",
1127
- }
1128
- }
1129
- tooltipText="blue"
1130
- >
1131
- <div
1132
- className="components-circular-option-picker__option-wrapper"
1133
- >
1134
- <Tooltip
1135
- text="blue"
1136
- >
1137
- <ForwardRef(Button)
1138
- aria-label="Color: blue"
1139
- className="components-circular-option-picker__option"
1140
- isPressed={false}
1141
- onBlur={[Function]}
1142
- onClick={[Function]}
1143
- onFocus={[Function]}
1144
- onMouseDown={[Function]}
1145
- onMouseEnter={[Function]}
1146
- onMouseLeave={[Function]}
1147
- style={
1148
- Object {
1149
- "backgroundColor": "#00f",
1150
- "color": "#00f",
1151
- }
1152
- }
1153
- >
1154
- <button
1155
- aria-describedby={null}
1156
- aria-label="Color: blue"
1157
- aria-pressed={false}
1158
- className="components-button components-circular-option-picker__option"
1159
- onBlur={[Function]}
1160
- onClick={[Function]}
1161
- onFocus={[Function]}
1162
- onMouseDown={[Function]}
1163
- onMouseEnter={[Function]}
1164
- onMouseLeave={[Function]}
1165
- style={
1166
- Object {
1167
- "backgroundColor": "#00f",
1168
- "color": "#00f",
1169
- }
1170
- }
1171
- type="button"
1172
- />
1173
- </ForwardRef(Button)>
1174
- </Tooltip>
1175
- </div>
1176
- </Option>
1177
- </div>
1178
- <div
1179
- className="components-circular-option-picker__custom-clear-wrapper"
1180
- >
1181
- <ButtonAction
1182
- onClick={[Function]}
1183
- >
1184
- <ForwardRef(Button)
1185
- className="components-circular-option-picker__clear"
1186
- onClick={[Function]}
1187
- variant="tertiary"
1188
- >
1189
- <button
1190
- aria-describedby={null}
1191
- className="components-button components-circular-option-picker__clear is-tertiary"
1192
- onClick={[Function]}
1193
- type="button"
1194
- >
1195
- Clear
1196
- </button>
1197
- </ForwardRef(Button)>
1198
- </ButtonAction>
1199
- </div>
1200
- </div>
1201
- </CircularOptionPicker>
1202
- </SinglePalette>
1203
- </div>
1204
- </View>
1205
- </VStack>
1206
- </ColorPalette>
1207
- `;