@wordpress/components 19.0.0 → 19.0.1

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 (213) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/CONTRIBUTING.md +12 -12
  3. package/build/angle-picker-control/index.js +3 -1
  4. package/build/angle-picker-control/index.js.map +1 -1
  5. package/build/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  6. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  7. package/build/base-control/index.js +1 -1
  8. package/build/base-control/index.js.map +1 -1
  9. package/build/color-edit/index.js +180 -199
  10. package/build/color-edit/index.js.map +1 -1
  11. package/build/color-edit/styles.js +112 -0
  12. package/build/color-edit/styles.js.map +1 -0
  13. package/build/color-list-picker/index.js +6 -1
  14. package/build/color-list-picker/index.js.map +1 -1
  15. package/build/color-palette/index.js +86 -21
  16. package/build/color-palette/index.js.map +1 -1
  17. package/build/color-palette/styles.js +31 -0
  18. package/build/color-palette/styles.js.map +1 -0
  19. package/build/color-picker/component.js +7 -18
  20. package/build/color-picker/component.js.map +1 -1
  21. package/build/color-picker/picker.js +3 -3
  22. package/build/color-picker/picker.js.map +1 -1
  23. package/build/duotone-picker/custom-duotone-bar.js +0 -1
  24. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  25. package/build/duotone-picker/duotone-picker.js +1 -0
  26. package/build/duotone-picker/duotone-picker.js.map +1 -1
  27. package/build/gradient-picker/index.js +69 -9
  28. package/build/gradient-picker/index.js.map +1 -1
  29. package/build/index.native.js +9 -0
  30. package/build/index.native.js.map +1 -1
  31. package/build/mobile/bottom-sheet/cell.native.js +4 -2
  32. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  33. package/build/mobile/bottom-sheet/link-cell.native.js +3 -2
  34. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  35. package/build/mobile/link-settings/image-link-destinations-screen.native.js +140 -0
  36. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -0
  37. package/build/mobile/link-settings/index.native.js +3 -2
  38. package/build/mobile/link-settings/index.native.js.map +1 -1
  39. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -0
  40. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  41. package/build/mobile/link-settings/link-settings-screen.native.js +11 -5
  42. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  43. package/build/mobile/picker/index.android.js +4 -2
  44. package/build/mobile/picker/index.android.js.map +1 -1
  45. package/build/modal/index.js +10 -3
  46. package/build/modal/index.js.map +1 -1
  47. package/build/navigation/group/index.js +1 -2
  48. package/build/navigation/group/index.js.map +1 -1
  49. package/build/navigation/menu/menu-title-search.js +8 -27
  50. package/build/navigation/menu/menu-title-search.js.map +1 -1
  51. package/build/navigation/menu/menu-title.js +2 -2
  52. package/build/navigation/menu/menu-title.js.map +1 -1
  53. package/build/navigation/styles/navigation-styles.js +34 -29
  54. package/build/navigation/styles/navigation-styles.js.map +1 -1
  55. package/build/popover/index.js +4 -2
  56. package/build/popover/index.js.map +1 -1
  57. package/build/range-control/styles/range-control-styles.js +33 -29
  58. package/build/range-control/styles/range-control-styles.js.map +1 -1
  59. package/build/search-control/index.js +37 -14
  60. package/build/search-control/index.js.map +1 -1
  61. package/build/text/styles.js +7 -7
  62. package/build/text/styles.js.map +1 -1
  63. package/build/tools-panel/styles.js +18 -23
  64. package/build/tools-panel/styles.js.map +1 -1
  65. package/build/tools-panel/tools-panel/component.js +10 -7
  66. package/build/tools-panel/tools-panel/component.js.map +1 -1
  67. package/build/tools-panel/tools-panel/hook.js +3 -1
  68. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  69. package/build/tools-panel/tools-panel-header/component.js +3 -0
  70. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  71. package/build/utils/hooks/index.js +8 -0
  72. package/build/utils/hooks/index.js.map +1 -1
  73. package/build/utils/hooks/use-combined-ref.js +28 -0
  74. package/build/utils/hooks/use-combined-ref.js.map +1 -0
  75. package/build-module/angle-picker-control/index.js +3 -1
  76. package/build-module/angle-picker-control/index.js.map +1 -1
  77. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  78. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  79. package/build-module/base-control/index.js +1 -1
  80. package/build-module/base-control/index.js.map +1 -1
  81. package/build-module/color-edit/index.js +175 -201
  82. package/build-module/color-edit/index.js.map +1 -1
  83. package/build-module/color-edit/styles.js +90 -0
  84. package/build-module/color-edit/styles.js.map +1 -0
  85. package/build-module/color-list-picker/index.js +6 -1
  86. package/build-module/color-list-picker/index.js.map +1 -1
  87. package/build-module/color-palette/index.js +85 -22
  88. package/build-module/color-palette/index.js.map +1 -1
  89. package/build-module/color-palette/styles.js +27 -0
  90. package/build-module/color-palette/styles.js.map +1 -0
  91. package/build-module/color-picker/component.js +7 -16
  92. package/build-module/color-picker/component.js.map +1 -1
  93. package/build-module/color-picker/picker.js +4 -4
  94. package/build-module/color-picker/picker.js.map +1 -1
  95. package/build-module/duotone-picker/custom-duotone-bar.js +0 -1
  96. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  97. package/build-module/duotone-picker/duotone-picker.js +1 -0
  98. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  99. package/build-module/gradient-picker/index.js +67 -9
  100. package/build-module/gradient-picker/index.js.map +1 -1
  101. package/build-module/index.native.js +1 -0
  102. package/build-module/index.native.js.map +1 -1
  103. package/build-module/mobile/bottom-sheet/cell.native.js +4 -2
  104. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  105. package/build-module/mobile/bottom-sheet/link-cell.native.js +3 -2
  106. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  107. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +121 -0
  108. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -0
  109. package/build-module/mobile/link-settings/index.native.js +3 -2
  110. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  111. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -0
  112. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  113. package/build-module/mobile/link-settings/link-settings-screen.native.js +11 -5
  114. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  115. package/build-module/mobile/picker/index.android.js +4 -2
  116. package/build-module/mobile/picker/index.android.js.map +1 -1
  117. package/build-module/modal/index.js +10 -4
  118. package/build-module/modal/index.js.map +1 -1
  119. package/build-module/navigation/group/index.js +1 -2
  120. package/build-module/navigation/group/index.js.map +1 -1
  121. package/build-module/navigation/menu/menu-title-search.js +8 -24
  122. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  123. package/build-module/navigation/menu/menu-title.js +3 -3
  124. package/build-module/navigation/menu/menu-title.js.map +1 -1
  125. package/build-module/navigation/styles/navigation-styles.js +31 -27
  126. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  127. package/build-module/popover/index.js +4 -2
  128. package/build-module/popover/index.js.map +1 -1
  129. package/build-module/range-control/styles/range-control-styles.js +33 -29
  130. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  131. package/build-module/search-control/index.js +36 -15
  132. package/build-module/search-control/index.js.map +1 -1
  133. package/build-module/text/styles.js +7 -7
  134. package/build-module/text/styles.js.map +1 -1
  135. package/build-module/tools-panel/styles.js +16 -23
  136. package/build-module/tools-panel/styles.js.map +1 -1
  137. package/build-module/tools-panel/tools-panel/component.js +10 -6
  138. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  139. package/build-module/tools-panel/tools-panel/hook.js +2 -1
  140. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  141. package/build-module/tools-panel/tools-panel-header/component.js +3 -0
  142. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  143. package/build-module/utils/hooks/index.js +1 -0
  144. package/build-module/utils/hooks/index.js.map +1 -1
  145. package/build-module/utils/hooks/use-combined-ref.js +25 -0
  146. package/build-module/utils/hooks/use-combined-ref.js.map +1 -0
  147. package/build-style/style-rtl.css +39 -51
  148. package/build-style/style.css +39 -51
  149. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  150. package/build-types/tools-panel/styles.d.ts +1 -1
  151. package/build-types/tools-panel/styles.d.ts.map +1 -1
  152. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  153. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  154. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  155. package/build-types/utils/hooks/index.d.ts +1 -0
  156. package/build-types/utils/hooks/use-combined-ref.d.ts +8 -0
  157. package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -0
  158. package/package.json +6 -6
  159. package/src/angle-picker-control/index.js +3 -1
  160. package/src/angle-picker-control/styles/angle-picker-control-styles.js +2 -2
  161. package/src/base-control/index.js +1 -1
  162. package/src/circular-option-picker/style.scss +3 -5
  163. package/src/color-edit/index.js +248 -274
  164. package/src/color-edit/style.scss +4 -45
  165. package/src/color-edit/styles.js +97 -0
  166. package/src/color-list-picker/index.js +5 -0
  167. package/src/color-list-picker/style.scss +4 -0
  168. package/src/color-palette/index.js +90 -26
  169. package/src/color-palette/style.scss +18 -0
  170. package/src/color-palette/styles.js +19 -0
  171. package/src/color-palette/test/__snapshots__/index.js.snap +448 -414
  172. package/src/color-picker/component.tsx +6 -17
  173. package/src/color-picker/picker.tsx +6 -4
  174. package/src/color-picker/test/index.js +0 -15
  175. package/src/duotone-picker/custom-duotone-bar.js +0 -1
  176. package/src/duotone-picker/duotone-picker.js +1 -0
  177. package/src/gradient-picker/index.js +79 -11
  178. package/src/heading/test/__snapshots__/index.js.snap +1 -1
  179. package/src/index.native.js +1 -0
  180. package/src/mobile/bottom-sheet/cell.native.js +7 -2
  181. package/src/mobile/bottom-sheet/cellStyles.android.scss +5 -1
  182. package/src/mobile/bottom-sheet/cellStyles.ios.scss +5 -1
  183. package/src/mobile/bottom-sheet/link-cell.native.js +10 -3
  184. package/src/mobile/link-settings/image-link-destinations-screen.native.js +148 -0
  185. package/src/mobile/link-settings/index.native.js +3 -2
  186. package/src/mobile/link-settings/link-settings-navigation.native.js +1 -0
  187. package/src/mobile/link-settings/link-settings-screen.native.js +6 -2
  188. package/src/mobile/link-settings/style.native.scss +17 -0
  189. package/src/mobile/picker/index.android.js +2 -1
  190. package/src/modal/README.md +8 -0
  191. package/src/modal/index.js +60 -45
  192. package/src/modal/style.scss +5 -0
  193. package/src/navigation/group/index.js +1 -2
  194. package/src/navigation/menu/menu-title-search.js +11 -26
  195. package/src/navigation/menu/menu-title.js +4 -4
  196. package/src/navigation/styles/navigation-styles.js +29 -52
  197. package/src/popover/index.js +2 -2
  198. package/src/range-control/styles/range-control-styles.js +4 -1
  199. package/src/resizable-box/style.scss +5 -0
  200. package/src/search-control/index.js +47 -23
  201. package/src/style.scss +1 -0
  202. package/src/text/styles.js +1 -1
  203. package/src/text/test/__snapshots__/index.js.snap +2 -2
  204. package/src/tools-panel/stories/index.js +21 -19
  205. package/src/tools-panel/styles.ts +18 -26
  206. package/src/tools-panel/tools-panel/component.tsx +7 -4
  207. package/src/tools-panel/tools-panel/hook.ts +4 -1
  208. package/src/tools-panel/tools-panel-header/component.tsx +1 -0
  209. package/src/ui/control-label/test/__snapshots__/index.js.snap +3 -3
  210. package/src/ui/form-group/test/__snapshots__/index.js.snap +2 -2
  211. package/src/utils/hooks/index.js +1 -0
  212. package/src/utils/hooks/use-combined-ref.ts +29 -0
  213. package/tsconfig.tsbuildinfo +1 -1
@@ -8,117 +8,140 @@ exports[`ColorPalette Dropdown .renderContent should render dropdown content 1`]
8
8
  `;
9
9
 
10
10
  exports[`ColorPalette Dropdown .renderToggle should render dropdown content 1`] = `
11
- <Fragment>
12
- <button
13
- aria-describedby={null}
14
- aria-expanded={true}
15
- aria-haspopup="true"
16
- aria-label="Custom color picker"
17
- className="components-button is-link"
18
- onClick={[MockFunction]}
19
- type="button"
20
- >
21
- Custom color
22
- </button>
23
- </Fragment>
11
+ <button
12
+ aria-expanded={true}
13
+ aria-haspopup="true"
14
+ aria-label="Custom color picker"
15
+ className="components-color-palette__custom-color"
16
+ onClick={[MockFunction]}
17
+ style={
18
+ Object {
19
+ "background": "#f00",
20
+ }
21
+ }
22
+ >
23
+ #f00
24
+ </button>
24
25
  `;
25
26
 
26
27
  exports[`ColorPalette Dropdown should render it correctly 1`] = `
27
28
  <Dropdown
28
- className="components-circular-option-picker__dropdown-link-action"
29
- contentClassName="components-color-palette__picker"
29
+ key=".0"
30
30
  renderContent={[Function]}
31
31
  renderToggle={[Function]}
32
32
  >
33
33
  <div
34
- className="components-dropdown components-circular-option-picker__dropdown-link-action"
34
+ className="components-dropdown"
35
35
  tabIndex="-1"
36
36
  >
37
- <ForwardRef(Button)
37
+ <button
38
38
  aria-expanded={false}
39
39
  aria-haspopup="true"
40
40
  aria-label="Custom color picker"
41
+ className="components-color-palette__custom-color"
41
42
  onClick={[Function]}
42
- variant="link"
43
+ style={
44
+ Object {
45
+ "background": "#f00",
46
+ }
47
+ }
43
48
  >
44
- <button
45
- aria-describedby={null}
46
- aria-expanded={false}
47
- aria-haspopup="true"
48
- aria-label="Custom color picker"
49
- className="components-button is-link"
50
- onClick={[Function]}
51
- type="button"
52
- >
53
- Custom color
54
- </button>
55
- </ForwardRef(Button)>
49
+ #f00
50
+ </button>
56
51
  </div>
57
52
  </Dropdown>
58
53
  `;
59
54
 
60
55
  exports[`ColorPalette should allow disabling custom color picker 1`] = `
61
- <CircularOptionPicker
62
- actions={
63
- <React.Fragment>
56
+ <VStack
57
+ spacing={3}
58
+ >
59
+ <SinglePalette
60
+ actions={
64
61
  <ButtonAction
65
62
  onClick={[Function]}
66
63
  >
67
64
  Clear
68
65
  </ButtonAction>
69
- </React.Fragment>
70
- }
71
- options={
72
- Array [
73
- <Option
74
- aria-label="Color: red"
75
- isSelected={true}
76
- onClick={[Function]}
77
- selectedIconProps={
78
- Object {
79
- "fill": "#000",
80
- }
81
- }
82
- style={
83
- Object {
84
- "backgroundColor": "#f00",
85
- "color": "#f00",
86
- }
87
- }
88
- tooltipText="red"
89
- />,
90
- <Option
91
- aria-label="Color: white"
92
- isSelected={false}
93
- onClick={[Function]}
94
- selectedIconProps={Object {}}
95
- style={
96
- Object {
97
- "backgroundColor": "#fff",
98
- "color": "#fff",
99
- }
100
- }
101
- tooltipText="white"
102
- />,
103
- <Option
104
- aria-label="Color: blue"
105
- isSelected={false}
106
- onClick={[Function]}
107
- selectedIconProps={Object {}}
108
- style={
109
- Object {
110
- "backgroundColor": "#00f",
111
- "color": "#00f",
112
- }
113
- }
114
- tooltipText="blue"
115
- />,
116
- ]
117
- }
118
- />
66
+ }
67
+ clearColor={[Function]}
68
+ clearable={true}
69
+ colors={
70
+ Array [
71
+ Object {
72
+ "color": "#f00",
73
+ "name": "red",
74
+ },
75
+ Object {
76
+ "color": "#fff",
77
+ "name": "white",
78
+ },
79
+ Object {
80
+ "color": "#00f",
81
+ "name": "blue",
82
+ },
83
+ ]
84
+ }
85
+ onChange={[MockFunction]}
86
+ value="#f00"
87
+ />
88
+ </VStack>
119
89
  `;
120
90
 
121
91
  exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
92
+ .emotion-0 {
93
+ display: -webkit-box;
94
+ display: -webkit-flex;
95
+ display: -ms-flexbox;
96
+ display: flex;
97
+ }
98
+
99
+ .emotion-1 {
100
+ -webkit-align-items: normal;
101
+ -webkit-box-align: normal;
102
+ -ms-flex-align: normal;
103
+ align-items: normal;
104
+ -webkit-flex-direction: column;
105
+ -ms-flex-direction: column;
106
+ flex-direction: column;
107
+ -webkit-box-pack: justify;
108
+ -webkit-justify-content: space-between;
109
+ justify-content: space-between;
110
+ }
111
+
112
+ .emotion-2>*+*:not( marquee ) {
113
+ margin-top: calc(4px * 3);
114
+ }
115
+
116
+ .emotion-3>* {
117
+ min-height: 0;
118
+ }
119
+
120
+ .emotion-4 {
121
+ display: -webkit-box;
122
+ display: -webkit-flex;
123
+ display: -ms-flexbox;
124
+ display: flex;
125
+ -webkit-align-items: normal;
126
+ -webkit-box-align: normal;
127
+ -ms-flex-align: normal;
128
+ align-items: normal;
129
+ -webkit-flex-direction: column;
130
+ -ms-flex-direction: column;
131
+ flex-direction: column;
132
+ -webkit-box-pack: justify;
133
+ -webkit-justify-content: space-between;
134
+ justify-content: space-between;
135
+ }
136
+
137
+ .emotion-4>*+*:not( marquee ) {
138
+ margin-top: calc(4px * 3);
139
+ }
140
+
141
+ .emotion-4>* {
142
+ min-height: 0;
143
+ }
144
+
122
145
  <ColorPalette
123
146
  colors={
124
147
  Array [
@@ -139,379 +162,390 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
139
162
  onChange={[MockFunction]}
140
163
  value="#f00"
141
164
  >
142
- <CircularOptionPicker
143
- actions={
144
- <React.Fragment>
145
- <DropdownLinkAction
146
- buttonProps={
147
- Object {
148
- "aria-label": "Custom color picker",
149
- }
150
- }
151
- dropdownProps={
152
- Object {
153
- "contentClassName": "components-color-palette__picker",
154
- "renderContent": [Function],
155
- }
156
- }
157
- linkText="Custom color"
158
- />
159
- <ButtonAction
160
- onClick={[Function]}
161
- >
162
- Clear
163
- </ButtonAction>
164
- </React.Fragment>
165
- }
166
- options={
167
- Array [
168
- <Option
169
- aria-label="Color: red"
170
- isSelected={true}
171
- onClick={[Function]}
172
- selectedIconProps={
173
- Object {
174
- "fill": "#000",
175
- }
176
- }
177
- style={
178
- Object {
179
- "backgroundColor": "#f00",
180
- "color": "#f00",
181
- }
182
- }
183
- tooltipText="red"
184
- />,
185
- <Option
186
- aria-label="Color: white"
187
- isSelected={false}
188
- onClick={[Function]}
189
- selectedIconProps={Object {}}
190
- style={
191
- Object {
192
- "backgroundColor": "#fff",
193
- "color": "#fff",
194
- }
195
- }
196
- tooltipText="white"
197
- />,
198
- <Option
199
- aria-label="Color: blue"
200
- isSelected={false}
201
- onClick={[Function]}
202
- selectedIconProps={Object {}}
203
- style={
204
- Object {
205
- "backgroundColor": "#00f",
206
- "color": "#00f",
207
- }
208
- }
209
- tooltipText="blue"
210
- />,
211
- ]
212
- }
165
+ <VStack
166
+ spacing={3}
213
167
  >
214
- <div
215
- className="components-circular-option-picker"
168
+ <View
169
+ className="emotion-0 emotion-1 emotion-2 emotion-3 components-flex components-h-stack components-v-stack"
170
+ data-wp-c16t={true}
171
+ data-wp-component="VStack"
172
+ isColumn={true}
216
173
  >
217
174
  <div
218
- className="components-circular-option-picker__swatches"
175
+ className="components-flex components-h-stack components-v-stack emotion-4 emotion-5"
176
+ data-wp-c16t={true}
177
+ data-wp-component="VStack"
219
178
  >
220
- <Option
221
- aria-label="Color: red"
222
- isSelected={true}
223
- key="#f00"
224
- onClick={[Function]}
225
- selectedIconProps={
226
- Object {
227
- "fill": "#000",
228
- }
229
- }
230
- style={
231
- Object {
232
- "backgroundColor": "#f00",
233
- "color": "#f00",
234
- }
235
- }
236
- tooltipText="red"
179
+ <Dropdown
180
+ key=".0"
181
+ renderContent={[Function]}
182
+ renderToggle={[Function]}
237
183
  >
238
184
  <div
239
- className="components-circular-option-picker__option-wrapper"
185
+ className="components-dropdown"
186
+ tabIndex="-1"
240
187
  >
241
- <Tooltip
242
- text="red"
188
+ <button
189
+ aria-expanded={false}
190
+ aria-haspopup="true"
191
+ aria-label="Custom color picker"
192
+ className="components-color-palette__custom-color"
193
+ onClick={[Function]}
194
+ style={
195
+ Object {
196
+ "background": "#f00",
197
+ }
198
+ }
199
+ >
200
+ #f00
201
+ </button>
202
+ </div>
203
+ </Dropdown>
204
+ <SinglePalette
205
+ actions={
206
+ <ButtonAction
207
+ onClick={[Function]}
243
208
  >
244
- <ForwardRef(Button)
245
- aria-label="Color: red"
246
- className="components-circular-option-picker__option"
247
- isPressed={true}
248
- onBlur={[Function]}
209
+ Clear
210
+ </ButtonAction>
211
+ }
212
+ clearColor={[Function]}
213
+ clearable={true}
214
+ colors={
215
+ Array [
216
+ Object {
217
+ "color": "#f00",
218
+ "name": "red",
219
+ },
220
+ Object {
221
+ "color": "#fff",
222
+ "name": "white",
223
+ },
224
+ Object {
225
+ "color": "#00f",
226
+ "name": "blue",
227
+ },
228
+ ]
229
+ }
230
+ key=".1"
231
+ onChange={[MockFunction]}
232
+ value="#f00"
233
+ >
234
+ <CircularOptionPicker
235
+ actions={
236
+ <ButtonAction
249
237
  onClick={[Function]}
250
- onFocus={[Function]}
251
- onMouseDown={[Function]}
252
- onMouseEnter={[Function]}
253
- onMouseLeave={[Function]}
254
- style={
255
- Object {
256
- "backgroundColor": "#f00",
257
- "color": "#f00",
258
- }
259
- }
260
238
  >
261
- <button
262
- aria-describedby={null}
239
+ Clear
240
+ </ButtonAction>
241
+ }
242
+ options={
243
+ Array [
244
+ <Option
263
245
  aria-label="Color: red"
264
- aria-pressed={true}
265
- className="components-button components-circular-option-picker__option is-pressed"
266
- onBlur={[Function]}
246
+ isSelected={true}
267
247
  onClick={[Function]}
268
- onFocus={[Function]}
269
- onMouseDown={[Function]}
270
- onMouseEnter={[Function]}
271
- onMouseLeave={[Function]}
248
+ selectedIconProps={
249
+ Object {
250
+ "fill": "#000",
251
+ }
252
+ }
272
253
  style={
273
254
  Object {
274
255
  "backgroundColor": "#f00",
275
256
  "color": "#f00",
276
257
  }
277
258
  }
278
- type="button"
279
- />
280
- </ForwardRef(Button)>
281
- </Tooltip>
282
- <Icon
283
- fill="#000"
284
- icon={
285
- <SVG
286
- viewBox="0 0 24 24"
287
- xmlns="http://www.w3.org/2000/svg"
288
- >
289
- <Path
290
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
291
- />
292
- </SVG>
293
- }
294
- >
295
- <SVG
296
- fill="#000"
297
- height={24}
298
- viewBox="0 0 24 24"
299
- width={24}
300
- xmlns="http://www.w3.org/2000/svg"
301
- >
302
- <svg
303
- aria-hidden={true}
304
- fill="#000"
305
- focusable={false}
306
- height={24}
307
- role="img"
308
- viewBox="0 0 24 24"
309
- width={24}
310
- xmlns="http://www.w3.org/2000/svg"
311
- >
312
- <Path
313
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
314
- >
315
- <path
316
- d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
317
- />
318
- </Path>
319
- </svg>
320
- </SVG>
321
- </Icon>
322
- </div>
323
- </Option>
324
- <Option
325
- aria-label="Color: white"
326
- isSelected={false}
327
- key="#fff"
328
- onClick={[Function]}
329
- selectedIconProps={Object {}}
330
- style={
331
- Object {
332
- "backgroundColor": "#fff",
333
- "color": "#fff",
334
- }
335
- }
336
- tooltipText="white"
337
- >
338
- <div
339
- className="components-circular-option-picker__option-wrapper"
340
- >
341
- <Tooltip
342
- text="white"
343
- >
344
- <ForwardRef(Button)
345
- aria-label="Color: white"
346
- className="components-circular-option-picker__option"
347
- isPressed={false}
348
- onBlur={[Function]}
349
- onClick={[Function]}
350
- onFocus={[Function]}
351
- onMouseDown={[Function]}
352
- onMouseEnter={[Function]}
353
- onMouseLeave={[Function]}
354
- style={
355
- Object {
356
- "backgroundColor": "#fff",
357
- "color": "#fff",
358
- }
359
- }
360
- >
361
- <button
362
- aria-describedby={null}
259
+ tooltipText="red"
260
+ />,
261
+ <Option
363
262
  aria-label="Color: white"
364
- aria-pressed={false}
365
- className="components-button components-circular-option-picker__option"
366
- onBlur={[Function]}
263
+ isSelected={false}
367
264
  onClick={[Function]}
368
- onFocus={[Function]}
369
- onMouseDown={[Function]}
370
- onMouseEnter={[Function]}
371
- onMouseLeave={[Function]}
265
+ selectedIconProps={Object {}}
372
266
  style={
373
267
  Object {
374
268
  "backgroundColor": "#fff",
375
269
  "color": "#fff",
376
270
  }
377
271
  }
378
- type="button"
379
- />
380
- </ForwardRef(Button)>
381
- </Tooltip>
382
- </div>
383
- </Option>
384
- <Option
385
- aria-label="Color: blue"
386
- isSelected={false}
387
- key="#00f"
388
- onClick={[Function]}
389
- selectedIconProps={Object {}}
390
- style={
391
- Object {
392
- "backgroundColor": "#00f",
393
- "color": "#00f",
394
- }
395
- }
396
- tooltipText="blue"
397
- >
398
- <div
399
- className="components-circular-option-picker__option-wrapper"
400
- >
401
- <Tooltip
402
- text="blue"
403
- >
404
- <ForwardRef(Button)
405
- aria-label="Color: blue"
406
- className="components-circular-option-picker__option"
407
- isPressed={false}
408
- onBlur={[Function]}
409
- onClick={[Function]}
410
- onFocus={[Function]}
411
- onMouseDown={[Function]}
412
- onMouseEnter={[Function]}
413
- onMouseLeave={[Function]}
414
- style={
415
- Object {
416
- "backgroundColor": "#00f",
417
- "color": "#00f",
418
- }
419
- }
420
- >
421
- <button
422
- aria-describedby={null}
272
+ tooltipText="white"
273
+ />,
274
+ <Option
423
275
  aria-label="Color: blue"
424
- aria-pressed={false}
425
- className="components-button components-circular-option-picker__option"
426
- onBlur={[Function]}
276
+ isSelected={false}
427
277
  onClick={[Function]}
428
- onFocus={[Function]}
429
- onMouseDown={[Function]}
430
- onMouseEnter={[Function]}
431
- onMouseLeave={[Function]}
278
+ selectedIconProps={Object {}}
432
279
  style={
433
280
  Object {
434
281
  "backgroundColor": "#00f",
435
282
  "color": "#00f",
436
283
  }
437
284
  }
438
- type="button"
439
- />
440
- </ForwardRef(Button)>
441
- </Tooltip>
442
- </div>
443
- </Option>
444
- </div>
445
- <div
446
- className="components-circular-option-picker__custom-clear-wrapper"
447
- >
448
- <DropdownLinkAction
449
- buttonProps={
450
- Object {
451
- "aria-label": "Custom color picker",
285
+ tooltipText="blue"
286
+ />,
287
+ ]
452
288
  }
453
- }
454
- dropdownProps={
455
- Object {
456
- "contentClassName": "components-color-palette__picker",
457
- "renderContent": [Function],
458
- }
459
- }
460
- linkText="Custom color"
461
- >
462
- <Dropdown
463
- className="components-circular-option-picker__dropdown-link-action"
464
- contentClassName="components-color-palette__picker"
465
- renderContent={[Function]}
466
- renderToggle={[Function]}
467
289
  >
468
290
  <div
469
- className="components-dropdown components-circular-option-picker__dropdown-link-action"
470
- tabIndex="-1"
291
+ className="components-circular-option-picker"
471
292
  >
472
- <ForwardRef(Button)
473
- aria-expanded={false}
474
- aria-haspopup="true"
475
- aria-label="Custom color picker"
476
- onClick={[Function]}
477
- variant="link"
293
+ <div
294
+ className="components-circular-option-picker__swatches"
478
295
  >
479
- <button
480
- aria-describedby={null}
481
- aria-expanded={false}
482
- aria-haspopup="true"
483
- aria-label="Custom color picker"
484
- className="components-button is-link"
296
+ <Option
297
+ aria-label="Color: red"
298
+ isSelected={true}
299
+ key="#f00"
485
300
  onClick={[Function]}
486
- type="button"
301
+ selectedIconProps={
302
+ Object {
303
+ "fill": "#000",
304
+ }
305
+ }
306
+ style={
307
+ Object {
308
+ "backgroundColor": "#f00",
309
+ "color": "#f00",
310
+ }
311
+ }
312
+ tooltipText="red"
313
+ >
314
+ <div
315
+ className="components-circular-option-picker__option-wrapper"
316
+ >
317
+ <Tooltip
318
+ text="red"
319
+ >
320
+ <ForwardRef(Button)
321
+ aria-label="Color: red"
322
+ className="components-circular-option-picker__option"
323
+ isPressed={true}
324
+ onBlur={[Function]}
325
+ onClick={[Function]}
326
+ onFocus={[Function]}
327
+ onMouseDown={[Function]}
328
+ onMouseEnter={[Function]}
329
+ onMouseLeave={[Function]}
330
+ style={
331
+ Object {
332
+ "backgroundColor": "#f00",
333
+ "color": "#f00",
334
+ }
335
+ }
336
+ >
337
+ <button
338
+ aria-describedby={null}
339
+ aria-label="Color: red"
340
+ aria-pressed={true}
341
+ className="components-button components-circular-option-picker__option is-pressed"
342
+ onBlur={[Function]}
343
+ onClick={[Function]}
344
+ onFocus={[Function]}
345
+ onMouseDown={[Function]}
346
+ onMouseEnter={[Function]}
347
+ onMouseLeave={[Function]}
348
+ style={
349
+ Object {
350
+ "backgroundColor": "#f00",
351
+ "color": "#f00",
352
+ }
353
+ }
354
+ type="button"
355
+ />
356
+ </ForwardRef(Button)>
357
+ </Tooltip>
358
+ <Icon
359
+ fill="#000"
360
+ icon={
361
+ <SVG
362
+ viewBox="0 0 24 24"
363
+ xmlns="http://www.w3.org/2000/svg"
364
+ >
365
+ <Path
366
+ d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
367
+ />
368
+ </SVG>
369
+ }
370
+ >
371
+ <SVG
372
+ fill="#000"
373
+ height={24}
374
+ viewBox="0 0 24 24"
375
+ width={24}
376
+ xmlns="http://www.w3.org/2000/svg"
377
+ >
378
+ <svg
379
+ aria-hidden={true}
380
+ fill="#000"
381
+ focusable={false}
382
+ height={24}
383
+ role="img"
384
+ viewBox="0 0 24 24"
385
+ width={24}
386
+ xmlns="http://www.w3.org/2000/svg"
387
+ >
388
+ <Path
389
+ d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
390
+ >
391
+ <path
392
+ d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"
393
+ />
394
+ </Path>
395
+ </svg>
396
+ </SVG>
397
+ </Icon>
398
+ </div>
399
+ </Option>
400
+ <Option
401
+ aria-label="Color: white"
402
+ isSelected={false}
403
+ key="#fff"
404
+ onClick={[Function]}
405
+ selectedIconProps={Object {}}
406
+ style={
407
+ Object {
408
+ "backgroundColor": "#fff",
409
+ "color": "#fff",
410
+ }
411
+ }
412
+ tooltipText="white"
413
+ >
414
+ <div
415
+ className="components-circular-option-picker__option-wrapper"
416
+ >
417
+ <Tooltip
418
+ text="white"
419
+ >
420
+ <ForwardRef(Button)
421
+ aria-label="Color: white"
422
+ className="components-circular-option-picker__option"
423
+ isPressed={false}
424
+ onBlur={[Function]}
425
+ onClick={[Function]}
426
+ onFocus={[Function]}
427
+ onMouseDown={[Function]}
428
+ onMouseEnter={[Function]}
429
+ onMouseLeave={[Function]}
430
+ style={
431
+ Object {
432
+ "backgroundColor": "#fff",
433
+ "color": "#fff",
434
+ }
435
+ }
436
+ >
437
+ <button
438
+ aria-describedby={null}
439
+ aria-label="Color: white"
440
+ aria-pressed={false}
441
+ className="components-button components-circular-option-picker__option"
442
+ onBlur={[Function]}
443
+ onClick={[Function]}
444
+ onFocus={[Function]}
445
+ onMouseDown={[Function]}
446
+ onMouseEnter={[Function]}
447
+ onMouseLeave={[Function]}
448
+ style={
449
+ Object {
450
+ "backgroundColor": "#fff",
451
+ "color": "#fff",
452
+ }
453
+ }
454
+ type="button"
455
+ />
456
+ </ForwardRef(Button)>
457
+ </Tooltip>
458
+ </div>
459
+ </Option>
460
+ <Option
461
+ aria-label="Color: blue"
462
+ isSelected={false}
463
+ key="#00f"
464
+ onClick={[Function]}
465
+ selectedIconProps={Object {}}
466
+ style={
467
+ Object {
468
+ "backgroundColor": "#00f",
469
+ "color": "#00f",
470
+ }
471
+ }
472
+ tooltipText="blue"
487
473
  >
488
- Custom color
489
- </button>
490
- </ForwardRef(Button)>
474
+ <div
475
+ className="components-circular-option-picker__option-wrapper"
476
+ >
477
+ <Tooltip
478
+ text="blue"
479
+ >
480
+ <ForwardRef(Button)
481
+ aria-label="Color: blue"
482
+ className="components-circular-option-picker__option"
483
+ isPressed={false}
484
+ onBlur={[Function]}
485
+ onClick={[Function]}
486
+ onFocus={[Function]}
487
+ onMouseDown={[Function]}
488
+ onMouseEnter={[Function]}
489
+ onMouseLeave={[Function]}
490
+ style={
491
+ Object {
492
+ "backgroundColor": "#00f",
493
+ "color": "#00f",
494
+ }
495
+ }
496
+ >
497
+ <button
498
+ aria-describedby={null}
499
+ aria-label="Color: blue"
500
+ aria-pressed={false}
501
+ className="components-button components-circular-option-picker__option"
502
+ onBlur={[Function]}
503
+ onClick={[Function]}
504
+ onFocus={[Function]}
505
+ onMouseDown={[Function]}
506
+ onMouseEnter={[Function]}
507
+ onMouseLeave={[Function]}
508
+ style={
509
+ Object {
510
+ "backgroundColor": "#00f",
511
+ "color": "#00f",
512
+ }
513
+ }
514
+ type="button"
515
+ />
516
+ </ForwardRef(Button)>
517
+ </Tooltip>
518
+ </div>
519
+ </Option>
520
+ </div>
521
+ <div
522
+ className="components-circular-option-picker__custom-clear-wrapper"
523
+ >
524
+ <ButtonAction
525
+ onClick={[Function]}
526
+ >
527
+ <ForwardRef(Button)
528
+ className="components-circular-option-picker__clear"
529
+ isSmall={true}
530
+ onClick={[Function]}
531
+ variant="secondary"
532
+ >
533
+ <button
534
+ aria-describedby={null}
535
+ className="components-button components-circular-option-picker__clear is-secondary is-small"
536
+ onClick={[Function]}
537
+ type="button"
538
+ >
539
+ Clear
540
+ </button>
541
+ </ForwardRef(Button)>
542
+ </ButtonAction>
543
+ </div>
491
544
  </div>
492
- </Dropdown>
493
- </DropdownLinkAction>
494
- <ButtonAction
495
- onClick={[Function]}
496
- >
497
- <ForwardRef(Button)
498
- className="components-circular-option-picker__clear"
499
- isSmall={true}
500
- onClick={[Function]}
501
- variant="secondary"
502
- >
503
- <button
504
- aria-describedby={null}
505
- className="components-button components-circular-option-picker__clear is-secondary is-small"
506
- onClick={[Function]}
507
- type="button"
508
- >
509
- Clear
510
- </button>
511
- </ForwardRef(Button)>
512
- </ButtonAction>
545
+ </CircularOptionPicker>
546
+ </SinglePalette>
513
547
  </div>
514
- </div>
515
- </CircularOptionPicker>
548
+ </View>
549
+ </VStack>
516
550
  </ColorPalette>
517
551
  `;