@wordpress/components 21.0.1 → 21.1.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 (103) hide show
  1. package/CHANGELOG.md +16 -7
  2. package/build/autocomplete/get-default-use-items.js +3 -3
  3. package/build/autocomplete/get-default-use-items.js.map +1 -1
  4. package/build/box-control/unit-control.js +0 -1
  5. package/build/box-control/unit-control.js.map +1 -1
  6. package/build/button/index.js +5 -1
  7. package/build/button/index.js.map +1 -1
  8. package/build/drop-zone/index.js +7 -1
  9. package/build/drop-zone/index.js.map +1 -1
  10. package/build/higher-order/with-filters/index.js +1 -1
  11. package/build/higher-order/with-filters/index.js.map +1 -1
  12. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -3
  13. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  14. package/build/mobile/link-picker/link-picker-results.native.js +3 -3
  15. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  16. package/build/range-control/input-range.js +1 -15
  17. package/build/range-control/input-range.js.map +1 -1
  18. package/build/range-control/tooltip.js +1 -1
  19. package/build/range-control/tooltip.js.map +1 -1
  20. package/build/range-control/utils.js +2 -58
  21. package/build/range-control/utils.js.map +1 -1
  22. package/build/tree-grid/index.js +13 -8
  23. package/build/tree-grid/index.js.map +1 -1
  24. package/build/unit-control/index.js +2 -2
  25. package/build/unit-control/index.js.map +1 -1
  26. package/build/unit-control/index.native.js +10 -2
  27. package/build/unit-control/index.native.js.map +1 -1
  28. package/build/unit-control/styles/unit-control-styles.js +21 -32
  29. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  30. package/build/utils/hooks/use-controlled-state.js +2 -3
  31. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  32. package/build-module/autocomplete/get-default-use-items.js +1 -1
  33. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  34. package/build-module/box-control/unit-control.js +0 -1
  35. package/build-module/box-control/unit-control.js.map +1 -1
  36. package/build-module/button/index.js +5 -1
  37. package/build-module/button/index.js.map +1 -1
  38. package/build-module/drop-zone/index.js +7 -1
  39. package/build-module/drop-zone/index.js.map +1 -1
  40. package/build-module/higher-order/with-filters/index.js +2 -2
  41. package/build-module/higher-order/with-filters/index.js.map +1 -1
  42. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  43. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  44. package/build-module/mobile/link-picker/link-picker-results.native.js +1 -1
  45. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  46. package/build-module/range-control/input-range.js +1 -14
  47. package/build-module/range-control/input-range.js.map +1 -1
  48. package/build-module/range-control/tooltip.js +1 -1
  49. package/build-module/range-control/tooltip.js.map +1 -1
  50. package/build-module/range-control/utils.js +2 -57
  51. package/build-module/range-control/utils.js.map +1 -1
  52. package/build-module/tree-grid/index.js +13 -8
  53. package/build-module/tree-grid/index.js.map +1 -1
  54. package/build-module/unit-control/index.js +2 -2
  55. package/build-module/unit-control/index.js.map +1 -1
  56. package/build-module/unit-control/index.native.js +10 -2
  57. package/build-module/unit-control/index.native.js.map +1 -1
  58. package/build-module/unit-control/styles/unit-control-styles.js +20 -31
  59. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  60. package/build-module/utils/hooks/use-controlled-state.js +3 -4
  61. package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
  62. package/build-types/button/index.d.ts.map +1 -1
  63. package/build-types/drop-zone/index.d.ts.map +1 -1
  64. package/build-types/popover/stories/e2e/index.d.ts +8 -0
  65. package/build-types/popover/stories/e2e/index.d.ts.map +1 -0
  66. package/build-types/range-control/input-range.d.ts.map +1 -1
  67. package/build-types/range-control/stories/index.d.ts.map +1 -1
  68. package/build-types/range-control/types.d.ts +0 -2
  69. package/build-types/range-control/types.d.ts.map +1 -1
  70. package/build-types/range-control/utils.d.ts +1 -12
  71. package/build-types/range-control/utils.d.ts.map +1 -1
  72. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -4
  73. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  74. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  75. package/package.json +17 -17
  76. package/src/autocomplete/get-default-use-items.js +1 -1
  77. package/src/box-control/unit-control.js +0 -1
  78. package/src/button/index.js +7 -1
  79. package/src/button/test/index.js +36 -0
  80. package/src/color-palette/test/__snapshots__/index.js.snap +169 -1106
  81. package/src/color-palette/test/index.js +107 -61
  82. package/src/drop-zone/index.tsx +4 -1
  83. package/src/font-size-picker/stories/e2e/index.js +47 -0
  84. package/src/higher-order/with-filters/index.js +2 -2
  85. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
  86. package/src/mobile/link-picker/link-picker-results.native.js +1 -1
  87. package/src/popover/stories/e2e/index.tsx +25 -0
  88. package/src/range-control/README.md +6 -7
  89. package/src/range-control/input-range.tsx +1 -21
  90. package/src/range-control/stories/index.tsx +2 -1
  91. package/src/range-control/tooltip.tsx +1 -1
  92. package/src/range-control/types.ts +0 -2
  93. package/src/range-control/utils.ts +3 -75
  94. package/src/tree-grid/index.js +23 -14
  95. package/src/tree-grid/test/__snapshots__/cell.js.snap +21 -17
  96. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -1
  97. package/src/unit-control/index.native.js +8 -0
  98. package/src/unit-control/index.tsx +2 -2
  99. package/src/unit-control/styles/unit-control-styles.ts +0 -20
  100. package/src/unit-control/test/index.tsx +6 -3
  101. package/src/utils/hooks/use-controlled-state.js +9 -6
  102. package/tsconfig.tsbuildinfo +1 -1
  103. package/src/unit-control/test/__snapshots__/index.tsx.snap +0 -31
@@ -1,533 +1,100 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
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`] = `
3
+ exports[`ColorPalette should allow disabling custom color picker 1`] = `
18
4
  .emotion-0 {
19
5
  display: -webkit-box;
20
6
  display: -webkit-flex;
21
7
  display: -ms-flexbox;
22
8
  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);
9
+ -webkit-align-items: normal;
10
+ -webkit-box-align: normal;
11
+ -ms-flex-align: normal;
12
+ align-items: normal;
13
+ -webkit-flex-direction: column;
14
+ -ms-flex-direction: column;
15
+ flex-direction: column;
16
+ gap: calc(4px * 3);
57
17
  -webkit-box-pack: justify;
58
18
  -webkit-justify-content: space-between;
59
19
  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
20
  }
80
21
 
81
- .emotion-8 {
82
- display: block;
83
- max-height: 100%;
84
- max-width: 100%;
22
+ .emotion-0>* {
85
23
  min-height: 0;
86
- min-width: 0;
87
- -webkit-flex: 1;
88
- -ms-flex: 1;
89
- flex: 1;
90
24
  }
91
25
 
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
- }
26
+ <div>
27
+ <div
28
+ class="components-flex components-h-stack components-v-stack emotion-0 emotion-1"
29
+ data-wp-c16t="true"
30
+ data-wp-component="VStack"
153
31
  >
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
- }
32
+ <div
33
+ class="components-circular-option-picker"
169
34
  >
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}
35
+ <div
36
+ class="components-circular-option-picker__swatches"
183
37
  >
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"
38
+ <div
39
+ class="components-circular-option-picker__option-wrapper"
198
40
  >
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"
41
+ <button
42
+ aria-label="Color: red"
43
+ aria-pressed="true"
44
+ class="components-button components-circular-option-picker__option is-pressed"
45
+ style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
46
+ type="button"
47
+ />
48
+ <svg
49
+ aria-hidden="true"
50
+ fill="#000"
51
+ focusable="false"
52
+ height="24"
53
+ viewBox="0 0 24 24"
54
+ width="24"
55
+ xmlns="http://www.w3.org/2000/svg"
204
56
  >
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"
57
+ <path
58
+ d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
59
+ />
60
+ </svg>
61
+ </div>
62
+ <div
63
+ class="components-circular-option-picker__option-wrapper"
232
64
  >
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
- }
65
+ <button
66
+ aria-label="Color: white"
67
+ aria-pressed="false"
68
+ class="components-button components-circular-option-picker__option"
69
+ style="background-color: rgb(255, 255, 255); color: rgb(255, 255, 255);"
70
+ type="button"
71
+ />
72
+ </div>
73
+ <div
74
+ class="components-circular-option-picker__option-wrapper"
75
+ >
76
+ <button
77
+ aria-label="Color: blue"
78
+ aria-pressed="false"
79
+ class="components-button components-circular-option-picker__option"
80
+ style="background-color: rgb(0, 0, 255); color: rgb(0, 0, 255);"
81
+ type="button"
82
+ />
83
+ </div>
84
+ </div>
85
+ <div
86
+ class="components-circular-option-picker__custom-clear-wrapper"
400
87
  >
401
- <Noop />
402
88
  <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
- }
89
+ class="components-button components-circular-option-picker__clear is-tertiary"
90
+ type="button"
416
91
  >
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>
92
+ Clear
490
93
  </button>
491
- </View>
492
- </Flex>
94
+ </div>
95
+ </div>
493
96
  </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>
97
+ </div>
531
98
  `;
532
99
 
533
100
  exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
@@ -536,9 +103,6 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
536
103
  display: -webkit-flex;
537
104
  display: -ms-flexbox;
538
105
  display: flex;
539
- }
540
-
541
- .emotion-1 {
542
106
  -webkit-align-items: normal;
543
107
  -webkit-box-align: normal;
544
108
  -ms-flex-align: normal;
@@ -552,52 +116,11 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
552
116
  justify-content: space-between;
553
117
  }
554
118
 
555
- .emotion-2>* {
119
+ .emotion-0>* {
556
120
  min-height: 0;
557
121
  }
558
122
 
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 {
123
+ .emotion-2 {
601
124
  display: -webkit-box;
602
125
  display: -webkit-flex;
603
126
  display: -ms-flexbox;
@@ -616,43 +139,11 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
616
139
  width: 100%;
617
140
  }
618
141
 
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;
142
+ .emotion-2>* {
642
143
  min-width: 0;
643
- -webkit-flex: 1;
644
- -ms-flex: 1;
645
- flex: 1;
646
144
  }
647
145
 
648
- .emotion-15 {
649
- display: block;
650
- overflow: hidden;
651
- text-overflow: ellipsis;
652
- white-space: nowrap;
653
- }
654
-
655
- .emotion-19 {
146
+ .emotion-5 {
656
147
  display: block;
657
148
  overflow: hidden;
658
149
  text-overflow: ellipsis;
@@ -667,7 +158,7 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
667
158
  flex: 1;
668
159
  }
669
160
 
670
- .emotion-23 {
161
+ .emotion-7 {
671
162
  display: block;
672
163
  max-height: 100%;
673
164
  max-width: 100%;
@@ -675,533 +166,105 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
675
166
  min-width: 0;
676
167
  }
677
168
 
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}
169
+ <div>
170
+ <div
171
+ class="components-flex components-h-stack components-v-stack emotion-0 emotion-1"
172
+ data-wp-c16t="true"
173
+ data-wp-component="VStack"
700
174
  >
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}
175
+ <div
176
+ class="components-dropdown"
177
+ tabindex="-1"
178
+ >
179
+ <button
180
+ aria-expanded="false"
181
+ aria-haspopup="true"
182
+ aria-label="Custom color picker. The currently selected color is called \\"red\\" and has a value of \\"f00\\"."
183
+ class="components-flex components-color-palette__custom-color emotion-2 emotion-1"
184
+ data-wp-c16t="true"
185
+ data-wp-component="Flex"
186
+ style="background: rgb(255, 0, 0); color: rgb(0, 0, 0);"
187
+ >
188
+ <span
189
+ class="components-truncate components-flex-item components-color-palette__custom-color-name emotion-1 emotion-5 emotion-1"
190
+ data-wp-c16t="true"
191
+ data-wp-component="FlexItem"
192
+ >
193
+ red
194
+ </span>
195
+ <span
196
+ class="components-flex-item components-color-palette__custom-color-value emotion-7 emotion-1"
197
+ data-wp-c16t="true"
198
+ data-wp-component="FlexItem"
199
+ >
200
+ f00
201
+ </span>
202
+ </button>
203
+ </div>
204
+ <div
205
+ class="components-circular-option-picker"
706
206
  >
707
- <Noop />
708
207
  <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"
208
+ class="components-circular-option-picker__swatches"
712
209
  >
713
- <CustomColorPickerDropdown
714
- isRenderedInSidebar={false}
715
- key=".0"
716
- renderContent={[Function]}
717
- renderToggle={[Function]}
210
+ <div
211
+ class="components-circular-option-picker__option-wrapper"
718
212
  >
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]}
213
+ <button
214
+ aria-label="Color: red"
215
+ aria-pressed="true"
216
+ class="components-button components-circular-option-picker__option is-pressed"
217
+ style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
218
+ type="button"
219
+ />
220
+ <svg
221
+ aria-hidden="true"
222
+ fill="#000"
223
+ focusable="false"
224
+ height="24"
225
+ viewBox="0 0 24 24"
226
+ width="24"
227
+ xmlns="http://www.w3.org/2000/svg"
730
228
  >
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"
229
+ <path
230
+ d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
231
+ />
232
+ </svg>
233
+ </div>
234
+ <div
235
+ class="components-circular-option-picker__option-wrapper"
891
236
  >
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>
237
+ <button
238
+ aria-label="Color: white"
239
+ aria-pressed="false"
240
+ class="components-button components-circular-option-picker__option"
241
+ style="background-color: rgb(255, 255, 255); color: rgb(255, 255, 255);"
242
+ type="button"
243
+ />
244
+ </div>
245
+ <div
246
+ class="components-circular-option-picker__option-wrapper"
247
+ >
248
+ <button
249
+ aria-label="Color: blue"
250
+ aria-pressed="false"
251
+ class="components-button components-circular-option-picker__option"
252
+ style="background-color: rgb(0, 0, 255); color: rgb(0, 0, 255);"
253
+ type="button"
254
+ />
255
+ </div>
1203
256
  </div>
1204
- </View>
1205
- </VStack>
1206
- </ColorPalette>
257
+ <div
258
+ class="components-circular-option-picker__custom-clear-wrapper"
259
+ >
260
+ <button
261
+ class="components-button components-circular-option-picker__clear is-tertiary"
262
+ type="button"
263
+ >
264
+ Clear
265
+ </button>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </div>
1207
270
  `;