@wordpress/components 39.0.0 → 40.0.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 (1080) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/CONTRIBUTING.md +7 -8
  3. package/build/base-control/styles/base-control-styles.cjs +150 -45
  4. package/build/base-control/styles/base-control-styles.cjs.map +4 -4
  5. package/build/border-box-control/border-box-control/hook.cjs +88 -23
  6. package/build/border-box-control/border-box-control/hook.cjs.map +3 -3
  7. package/build/border-box-control/border-box-control-linked-button/hook.cjs +87 -8
  8. package/build/border-box-control/border-box-control-linked-button/hook.cjs.map +4 -4
  9. package/build/border-box-control/border-box-control-split-controls/hook.cjs +89 -16
  10. package/build/border-box-control/border-box-control-split-controls/hook.cjs.map +4 -4
  11. package/build/border-box-control/border-box-control-visualizer/hook.cjs +108 -8
  12. package/build/border-box-control/border-box-control-visualizer/hook.cjs.map +4 -4
  13. package/build/border-control/border-control/hook.cjs +89 -14
  14. package/build/border-control/border-control/hook.cjs.map +4 -4
  15. package/build/border-control/border-control-dropdown/component.cjs +2 -4
  16. package/build/border-control/border-control-dropdown/component.cjs.map +2 -2
  17. package/build/border-control/border-control-dropdown/hook.cjs +103 -27
  18. package/build/border-control/border-control-dropdown/hook.cjs.map +4 -4
  19. package/build/box-control/box-input-control.cjs +102 -10
  20. package/build/box-control/box-input-control.cjs.map +4 -4
  21. package/build/box-control/index.cjs +95 -5
  22. package/build/box-control/index.cjs.map +4 -4
  23. package/build/button/index.cjs +10 -3
  24. package/build/button/index.cjs.map +2 -2
  25. package/build/card/card-body/hook.cjs +4 -2
  26. package/build/card/card-body/hook.cjs.map +2 -2
  27. package/build/card/styles.cjs +31 -16
  28. package/build/card/styles.cjs.map +2 -2
  29. package/build/circular-option-picker/circular-option-picker-option.cjs +4 -5
  30. package/build/circular-option-picker/circular-option-picker-option.cjs.map +2 -2
  31. package/build/circular-option-picker/circular-option-picker.cjs +24 -6
  32. package/build/circular-option-picker/circular-option-picker.cjs.map +2 -2
  33. package/build/circular-option-picker/index.cjs +6 -2
  34. package/build/circular-option-picker/index.cjs.map +2 -2
  35. package/build/circular-option-picker/utils.cjs +38 -8
  36. package/build/circular-option-picker/utils.cjs.map +3 -3
  37. package/build/color-palette/index.cjs +103 -10
  38. package/build/color-palette/index.cjs.map +3 -3
  39. package/build/combobox-control/index.cjs +87 -2
  40. package/build/combobox-control/index.cjs.map +3 -3
  41. package/build/confirm-dialog/component.cjs +5 -1
  42. package/build/confirm-dialog/component.cjs.map +2 -2
  43. package/build/content-editable-control/index.cjs +1 -1
  44. package/build/content-editable-control/index.cjs.map +2 -2
  45. package/build/context/context-system-provider.cjs.map +2 -2
  46. package/build/custom-gradient-picker/gradient-bar/control-points.cjs +14 -2
  47. package/build/custom-gradient-picker/gradient-bar/control-points.cjs.map +2 -2
  48. package/build/custom-gradient-picker/gradient-bar/index.cjs +2 -0
  49. package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
  50. package/build/dropdown/dropdown-content-wrapper.cjs +102 -3
  51. package/build/dropdown/dropdown-content-wrapper.cjs.map +4 -4
  52. package/build/duotone-picker/custom-duotone-bar.cjs +1 -0
  53. package/build/duotone-picker/custom-duotone-bar.cjs.map +2 -2
  54. package/build/duotone-picker/duotone-picker.cjs +23 -14
  55. package/build/duotone-picker/duotone-picker.cjs.map +2 -2
  56. package/build/focal-point-picker/index.cjs +5 -3
  57. package/build/focal-point-picker/index.cjs.map +2 -2
  58. package/build/gradient-picker/index.cjs +105 -11
  59. package/build/gradient-picker/index.cjs.map +3 -3
  60. package/build/input-control/input-field.cjs +1 -0
  61. package/build/input-control/input-field.cjs.map +2 -2
  62. package/build/input-control/styles/input-control-styles.cjs +22 -22
  63. package/build/input-control/styles/input-control-styles.cjs.map +2 -2
  64. package/build/modal/index.cjs +1 -0
  65. package/build/modal/index.cjs.map +2 -2
  66. package/build/palette-edit/index.cjs +208 -33
  67. package/build/palette-edit/index.cjs.map +3 -3
  68. package/build/private-apis.cjs +1 -6
  69. package/build/private-apis.cjs.map +2 -2
  70. package/build/progress-bar/index.cjs +95 -7
  71. package/build/progress-bar/index.cjs.map +4 -4
  72. package/build/radio-control/index.cjs +1 -0
  73. package/build/radio-control/index.cjs.map +2 -2
  74. package/build/resizable-box/resize-tooltip/index.cjs +91 -4
  75. package/build/resizable-box/resize-tooltip/index.cjs.map +3 -3
  76. package/build/resizable-box/resize-tooltip/label.cjs +103 -6
  77. package/build/resizable-box/resize-tooltip/label.cjs.map +4 -4
  78. package/build/scrollable/hook.cjs +93 -6
  79. package/build/scrollable/hook.cjs.map +4 -4
  80. package/build/textarea-control/index.cjs +87 -3
  81. package/build/textarea-control/index.cjs.map +3 -3
  82. package/build/toggle-group-control/toggle-group-control/component.cjs +1 -1
  83. package/build/toggle-group-control/toggle-group-control/component.cjs.map +2 -2
  84. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs +1 -1
  85. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs.map +2 -2
  86. package/build/utils/config-values.cjs +0 -3
  87. package/build/utils/config-values.cjs.map +2 -2
  88. package/build/validated-form-controls/components/content-editable-control.cjs +3 -2
  89. package/build/validated-form-controls/components/content-editable-control.cjs.map +2 -2
  90. package/build/validated-form-controls/components/custom-select-control.cjs +3 -2
  91. package/build/validated-form-controls/components/custom-select-control.cjs.map +2 -2
  92. package/build/validated-form-controls/components/index.cjs +1 -9
  93. package/build/validated-form-controls/components/index.cjs.map +2 -2
  94. package/build/validated-form-controls/components/input-control.cjs +9 -2
  95. package/build/validated-form-controls/components/input-control.cjs.map +3 -3
  96. package/build/validated-form-controls/components/range-control.cjs +3 -2
  97. package/build/validated-form-controls/components/range-control.cjs.map +2 -2
  98. package/build/validated-form-controls/components/textarea-control.cjs +9 -2
  99. package/build/validated-form-controls/components/textarea-control.cjs.map +3 -3
  100. package/build/validated-form-controls/index.cjs +1 -3
  101. package/build/validated-form-controls/index.cjs.map +2 -2
  102. package/build/z-stack/component.cjs +105 -7
  103. package/build/z-stack/component.cjs.map +4 -4
  104. package/build-module/base-control/styles/base-control-styles.mjs +151 -46
  105. package/build-module/base-control/styles/base-control-styles.mjs.map +3 -3
  106. package/build-module/border-box-control/border-box-control/hook.mjs +89 -14
  107. package/build-module/border-box-control/border-box-control/hook.mjs.map +3 -3
  108. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs +87 -8
  109. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs.map +3 -3
  110. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs +89 -16
  111. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs.map +3 -3
  112. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs +108 -8
  113. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs.map +3 -3
  114. package/build-module/border-control/border-control/hook.mjs +90 -15
  115. package/build-module/border-control/border-control/hook.mjs.map +3 -3
  116. package/build-module/border-control/border-control-dropdown/component.mjs +2 -4
  117. package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
  118. package/build-module/border-control/border-control-dropdown/hook.mjs +103 -27
  119. package/build-module/border-control/border-control-dropdown/hook.mjs.map +3 -3
  120. package/build-module/box-control/box-input-control.mjs +102 -10
  121. package/build-module/box-control/box-input-control.mjs.map +3 -3
  122. package/build-module/box-control/index.mjs +95 -5
  123. package/build-module/box-control/index.mjs.map +3 -3
  124. package/build-module/button/index.mjs +11 -4
  125. package/build-module/button/index.mjs.map +2 -2
  126. package/build-module/card/card-body/hook.mjs +4 -2
  127. package/build-module/card/card-body/hook.mjs.map +2 -2
  128. package/build-module/card/styles.mjs +30 -16
  129. package/build-module/card/styles.mjs.map +2 -2
  130. package/build-module/circular-option-picker/circular-option-picker-option.mjs +4 -5
  131. package/build-module/circular-option-picker/circular-option-picker-option.mjs.map +2 -2
  132. package/build-module/circular-option-picker/circular-option-picker.mjs +24 -6
  133. package/build-module/circular-option-picker/circular-option-picker.mjs.map +2 -2
  134. package/build-module/circular-option-picker/index.mjs +4 -2
  135. package/build-module/circular-option-picker/index.mjs.map +2 -2
  136. package/build-module/circular-option-picker/utils.mjs +25 -7
  137. package/build-module/circular-option-picker/utils.mjs.map +2 -2
  138. package/build-module/color-palette/index.mjs +104 -11
  139. package/build-module/color-palette/index.mjs.map +3 -3
  140. package/build-module/combobox-control/index.mjs +88 -3
  141. package/build-module/combobox-control/index.mjs.map +3 -3
  142. package/build-module/confirm-dialog/component.mjs +5 -1
  143. package/build-module/confirm-dialog/component.mjs.map +2 -2
  144. package/build-module/content-editable-control/index.mjs +1 -1
  145. package/build-module/content-editable-control/index.mjs.map +2 -2
  146. package/build-module/context/context-system-provider.mjs.map +2 -2
  147. package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs +14 -2
  148. package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs.map +2 -2
  149. package/build-module/custom-gradient-picker/gradient-bar/index.mjs +2 -0
  150. package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
  151. package/build-module/dropdown/dropdown-content-wrapper.mjs +92 -3
  152. package/build-module/dropdown/dropdown-content-wrapper.mjs.map +3 -3
  153. package/build-module/duotone-picker/custom-duotone-bar.mjs +1 -0
  154. package/build-module/duotone-picker/custom-duotone-bar.mjs.map +2 -2
  155. package/build-module/duotone-picker/duotone-picker.mjs +24 -15
  156. package/build-module/duotone-picker/duotone-picker.mjs.map +2 -2
  157. package/build-module/focal-point-picker/index.mjs +5 -3
  158. package/build-module/focal-point-picker/index.mjs.map +2 -2
  159. package/build-module/gradient-picker/index.mjs +106 -12
  160. package/build-module/gradient-picker/index.mjs.map +3 -3
  161. package/build-module/input-control/input-field.mjs +1 -0
  162. package/build-module/input-control/input-field.mjs.map +2 -2
  163. package/build-module/input-control/styles/input-control-styles.mjs +22 -22
  164. package/build-module/input-control/styles/input-control-styles.mjs.map +2 -2
  165. package/build-module/modal/index.mjs +1 -0
  166. package/build-module/modal/index.mjs.map +2 -2
  167. package/build-module/palette-edit/index.mjs +209 -34
  168. package/build-module/palette-edit/index.mjs.map +2 -2
  169. package/build-module/private-apis.mjs +2 -7
  170. package/build-module/private-apis.mjs.map +2 -2
  171. package/build-module/progress-bar/index.mjs +95 -7
  172. package/build-module/progress-bar/index.mjs.map +3 -3
  173. package/build-module/radio-control/index.mjs +1 -0
  174. package/build-module/radio-control/index.mjs.map +2 -2
  175. package/build-module/resizable-box/resize-tooltip/index.mjs +91 -4
  176. package/build-module/resizable-box/resize-tooltip/index.mjs.map +3 -3
  177. package/build-module/resizable-box/resize-tooltip/label.mjs +93 -6
  178. package/build-module/resizable-box/resize-tooltip/label.mjs.map +3 -3
  179. package/build-module/scrollable/hook.mjs +93 -6
  180. package/build-module/scrollable/hook.mjs.map +4 -4
  181. package/build-module/textarea-control/index.mjs +87 -3
  182. package/build-module/textarea-control/index.mjs.map +3 -3
  183. package/build-module/toggle-group-control/toggle-group-control/component.mjs +1 -1
  184. package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +2 -2
  185. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs +1 -1
  186. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs.map +2 -2
  187. package/build-module/utils/config-values.mjs +0 -3
  188. package/build-module/utils/config-values.mjs.map +2 -2
  189. package/build-module/validated-form-controls/components/content-editable-control.mjs +2 -1
  190. package/build-module/validated-form-controls/components/content-editable-control.mjs.map +2 -2
  191. package/build-module/validated-form-controls/components/custom-select-control.mjs +2 -1
  192. package/build-module/validated-form-controls/components/custom-select-control.mjs.map +2 -2
  193. package/build-module/validated-form-controls/components/index.mjs +0 -4
  194. package/build-module/validated-form-controls/components/index.mjs.map +2 -2
  195. package/build-module/validated-form-controls/components/input-control.mjs +8 -1
  196. package/build-module/validated-form-controls/components/input-control.mjs.map +2 -2
  197. package/build-module/validated-form-controls/components/range-control.mjs +2 -1
  198. package/build-module/validated-form-controls/components/range-control.mjs.map +2 -2
  199. package/build-module/validated-form-controls/components/textarea-control.mjs +8 -1
  200. package/build-module/validated-form-controls/components/textarea-control.mjs.map +2 -2
  201. package/build-module/validated-form-controls/index.mjs +0 -1
  202. package/build-module/validated-form-controls/index.mjs.map +2 -2
  203. package/build-module/z-stack/component.mjs +95 -7
  204. package/build-module/z-stack/component.mjs.map +3 -3
  205. package/build-style/style-rtl.css +79 -134
  206. package/build-style/style.css +79 -134
  207. package/build-types/base-control/styles/base-control-styles.d.ts +21 -20
  208. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  209. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  210. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  211. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  212. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +863 -1
  213. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  214. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  215. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  216. package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -2
  217. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  218. package/build-types/box-control/box-input-control.d.ts.map +1 -1
  219. package/build-types/box-control/index.d.ts.map +1 -1
  220. package/build-types/button/index.d.ts.map +1 -1
  221. package/build-types/card/styles.d.ts +2 -1
  222. package/build-types/card/styles.d.ts.map +1 -1
  223. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  224. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  225. package/build-types/circular-option-picker/index.d.ts +1 -1
  226. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  227. package/build-types/circular-option-picker/types.d.ts +34 -26
  228. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  229. package/build-types/circular-option-picker/utils.d.ts +9 -5
  230. package/build-types/circular-option-picker/utils.d.ts.map +1 -1
  231. package/build-types/color-palette/index.d.ts.map +1 -1
  232. package/build-types/color-palette/types.d.ts +23 -3
  233. package/build-types/color-palette/types.d.ts.map +1 -1
  234. package/build-types/combobox-control/index.d.ts.map +1 -1
  235. package/build-types/combobox-control/types.d.ts +4 -2
  236. package/build-types/combobox-control/types.d.ts.map +1 -1
  237. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  238. package/build-types/confirm-dialog/types.d.ts +11 -0
  239. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  240. package/build-types/context/context-system-provider.d.ts.map +1 -1
  241. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +1 -1
  242. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  243. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  244. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  245. package/build-types/custom-gradient-picker/types.d.ts +10 -0
  246. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  247. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  248. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  249. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  250. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  251. package/build-types/duotone-picker/types.d.ts +43 -4
  252. package/build-types/duotone-picker/types.d.ts.map +1 -1
  253. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  254. package/build-types/gradient-picker/index.d.ts.map +1 -1
  255. package/build-types/gradient-picker/types.d.ts +22 -3
  256. package/build-types/gradient-picker/types.d.ts.map +1 -1
  257. package/build-types/input-control/input-field.d.ts.map +1 -1
  258. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  259. package/build-types/modal/index.d.ts.map +1 -1
  260. package/build-types/palette-edit/index.d.ts +8 -5
  261. package/build-types/palette-edit/index.d.ts.map +1 -1
  262. package/build-types/palette-edit/types.d.ts +47 -8
  263. package/build-types/palette-edit/types.d.ts.map +1 -1
  264. package/build-types/private-apis.d.ts.map +1 -1
  265. package/build-types/progress-bar/index.d.ts.map +1 -1
  266. package/build-types/radio-control/index.d.ts.map +1 -1
  267. package/build-types/radio-control/types.d.ts +6 -0
  268. package/build-types/radio-control/types.d.ts.map +1 -1
  269. package/build-types/resizable-box/resize-tooltip/index.d.ts +4 -5
  270. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  271. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  272. package/build-types/scrollable/hook.d.ts.map +1 -1
  273. package/build-types/textarea-control/index.d.ts.map +1 -1
  274. package/build-types/utils/config-values.d.ts +0 -3
  275. package/build-types/validated-form-controls/components/content-editable-control.d.ts.map +1 -1
  276. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
  277. package/build-types/validated-form-controls/components/index.d.ts +0 -4
  278. package/build-types/validated-form-controls/components/index.d.ts.map +1 -1
  279. package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
  280. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  281. package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
  282. package/build-types/validated-form-controls/index.d.ts +0 -1
  283. package/build-types/validated-form-controls/index.d.ts.map +1 -1
  284. package/build-types/z-stack/component.d.ts.map +1 -1
  285. package/package.json +30 -30
  286. package/src/animate/stories/index.story.tsx +0 -10
  287. package/src/base-control/stories/index.story.tsx +1 -1
  288. package/src/base-control/styles/base-control-styles.tsx +115 -0
  289. package/src/base-control/styles/style.module.scss +39 -0
  290. package/src/border-box-control/border-box-control/hook.ts +5 -16
  291. package/src/border-box-control/border-box-control-linked-button/hook.ts +6 -10
  292. package/src/border-box-control/border-box-control-split-controls/hook.ts +11 -20
  293. package/src/border-box-control/border-box-control-visualizer/hook.ts +37 -11
  294. package/src/border-box-control/stories/index.story.tsx +1 -1
  295. package/src/border-box-control/style.module.scss +43 -0
  296. package/src/border-control/border-control/hook.ts +10 -19
  297. package/src/border-control/border-control-dropdown/component.tsx +6 -8
  298. package/src/border-control/border-control-dropdown/hook.ts +23 -32
  299. package/src/border-control/style.module.scss +93 -0
  300. package/src/border-control/test/index.js +63 -31
  301. package/src/box-control/box-input-control.tsx +31 -16
  302. package/src/box-control/index.tsx +15 -12
  303. package/src/box-control/style.module.scss +28 -0
  304. package/src/box-control/test/index.tsx +161 -0
  305. package/src/button/index.tsx +32 -10
  306. package/src/button/test/index.tsx +51 -0
  307. package/src/card/card-body/hook.ts +2 -2
  308. package/src/card/styles.ts +11 -1
  309. package/src/card/test/__snapshots__/index.tsx.snap +27 -27
  310. package/src/circular-option-picker/README.md +8 -4
  311. package/src/circular-option-picker/circular-option-picker-option.tsx +26 -16
  312. package/src/circular-option-picker/circular-option-picker.tsx +47 -14
  313. package/src/circular-option-picker/index.tsx +5 -1
  314. package/src/circular-option-picker/stories/index.story.tsx +3 -3
  315. package/src/circular-option-picker/test/index.tsx +152 -3
  316. package/src/circular-option-picker/types.ts +38 -32
  317. package/src/circular-option-picker/utils.tsx +35 -5
  318. package/src/clipboard-button/index.tsx +1 -1
  319. package/src/color-palette/README.md +11 -7
  320. package/src/color-palette/index.tsx +28 -14
  321. package/src/color-palette/stories/index.story.tsx +5 -0
  322. package/src/color-palette/style.module.scss +12 -0
  323. package/src/color-palette/test/index.tsx +80 -5
  324. package/src/color-palette/types.ts +23 -3
  325. package/src/color-picker/stories/index.story.tsx +0 -5
  326. package/src/combobox-control/README.md +1 -1
  327. package/src/combobox-control/index.tsx +4 -4
  328. package/src/combobox-control/style.module.scss +6 -0
  329. package/src/combobox-control/style.scss +1 -1
  330. package/src/combobox-control/types.ts +4 -2
  331. package/src/composite/legacy/stories/index.story.tsx +10 -10
  332. package/src/composite/stories/index.story.tsx +0 -5
  333. package/src/confirm-dialog/README.md +16 -0
  334. package/src/confirm-dialog/component.tsx +7 -1
  335. package/src/confirm-dialog/test/index.tsx +41 -0
  336. package/src/confirm-dialog/types.ts +11 -0
  337. package/src/content-editable-control/style.module.scss +0 -1
  338. package/src/context/context-system-provider.js +0 -1
  339. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +24 -3
  340. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -0
  341. package/src/custom-gradient-picker/test/index.tsx +134 -0
  342. package/src/custom-gradient-picker/types.ts +10 -0
  343. package/src/dropdown/dropdown-content-wrapper.tsx +17 -7
  344. package/src/dropdown/stories/index.story.tsx +0 -5
  345. package/src/dropdown/style.module.scss +25 -0
  346. package/src/dropdown/test/index.tsx +51 -0
  347. package/src/duotone-picker/README.md +21 -6
  348. package/src/duotone-picker/custom-duotone-bar.tsx +1 -0
  349. package/src/duotone-picker/duotone-picker.tsx +79 -54
  350. package/src/duotone-picker/stories/duotone-picker.story.tsx +63 -15
  351. package/src/duotone-picker/test/custom-duotone-bar.tsx +114 -0
  352. package/src/duotone-picker/test/index.tsx +346 -0
  353. package/src/duotone-picker/types.ts +48 -4
  354. package/src/focal-point-picker/index.tsx +6 -2
  355. package/src/focal-point-picker/stories/index.story.tsx +15 -0
  356. package/src/focal-point-picker/test/index.tsx +31 -0
  357. package/src/form-toggle/stories/index.story.tsx +3 -0
  358. package/src/form-token-field/style.scss +7 -1
  359. package/src/gradient-picker/README.md +19 -10
  360. package/src/gradient-picker/index.tsx +43 -16
  361. package/src/gradient-picker/stories/index.story.tsx +5 -0
  362. package/src/gradient-picker/test/index.tsx +84 -0
  363. package/src/gradient-picker/types.ts +22 -3
  364. package/src/input-control/input-field.tsx +1 -0
  365. package/src/input-control/stories/index.story.tsx +3 -3
  366. package/src/input-control/stories/migration-guide.mdx +201 -0
  367. package/src/input-control/style.scss +11 -0
  368. package/src/input-control/styles/input-control-styles.tsx +30 -11
  369. package/src/input-control/test/index.js +10 -0
  370. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -2
  371. package/src/menu-group/stories/index.story.tsx +9 -6
  372. package/src/menu-item/stories/index.story.tsx +6 -3
  373. package/src/menu-items-choice/stories/index.story.tsx +14 -11
  374. package/src/modal/index.tsx +1 -0
  375. package/src/modal/test/index.tsx +19 -0
  376. package/src/navigator/stories/index.story.tsx +0 -5
  377. package/src/number-control/stories/index.story.tsx +3 -3
  378. package/src/palette-edit/index.tsx +364 -70
  379. package/src/palette-edit/stories/index.story.tsx +59 -18
  380. package/src/palette-edit/style.scss +3 -1
  381. package/src/palette-edit/test/index.tsx +375 -1
  382. package/src/palette-edit/types.ts +50 -8
  383. package/src/popover/stories/index.story.tsx +5 -1
  384. package/src/popover/stories/utils.tsx +79 -0
  385. package/src/popover/test/index.tsx +1 -1
  386. package/src/popover/test/utils/index.js +1 -0
  387. package/src/popover/test/utils/index.tsx +4 -78
  388. package/src/private-apis.ts +0 -8
  389. package/src/progress-bar/index.tsx +10 -6
  390. package/src/progress-bar/style.module.scss +62 -0
  391. package/src/progress-bar/test/index.tsx +13 -11
  392. package/src/radio-control/README.md +3 -1
  393. package/src/radio-control/index.tsx +1 -0
  394. package/src/radio-control/stories/index.story.tsx +12 -0
  395. package/src/radio-control/style.scss +1 -3
  396. package/src/radio-control/test/index.tsx +59 -0
  397. package/src/radio-control/types.ts +6 -0
  398. package/src/range-control/stories/index.story.tsx +30 -0
  399. package/src/resizable-box/resize-tooltip/index.tsx +16 -7
  400. package/src/resizable-box/resize-tooltip/label.tsx +18 -12
  401. package/src/resizable-box/resize-tooltip/style.module.scss +40 -0
  402. package/src/resizable-box/resize-tooltip/test/index.tsx +44 -0
  403. package/src/resizable-box/resize-tooltip/test/label.tsx +25 -0
  404. package/src/resizable-box/stories/index.story.tsx +11 -0
  405. package/src/sandbox/stories/index.story.tsx +2 -0
  406. package/src/scrollable/hook.ts +11 -17
  407. package/src/scrollable/stories/index.story.tsx +1 -0
  408. package/src/scrollable/style.module.scss +44 -0
  409. package/src/scrollable/test/index.tsx +120 -6
  410. package/src/snackbar/stories/index.story.tsx +5 -0
  411. package/src/snackbar/stories/list.story.tsx +3 -0
  412. package/src/spinner/stories/index.story.tsx +2 -2
  413. package/src/style.scss +1 -0
  414. package/src/text-control/stories/index.story.tsx +2 -3
  415. package/src/text-control/style.scss +0 -1
  416. package/src/textarea-control/index.tsx +6 -3
  417. package/src/textarea-control/stories/index.story.tsx +2 -3
  418. package/src/textarea-control/stories/migration-guide.mdx +79 -0
  419. package/src/textarea-control/style.module.scss +56 -0
  420. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -116
  421. package/src/toggle-group-control/toggle-group-control/style.module.scss +0 -2
  422. package/src/toggle-group-control/toggle-group-control-option-base/style.module.scss +0 -2
  423. package/src/utils/config-values.js +0 -3
  424. package/src/utils/theme-variables.scss +0 -1
  425. package/src/validated-form-controls/components/content-editable-control.tsx +2 -1
  426. package/src/validated-form-controls/components/custom-select-control.tsx +2 -1
  427. package/src/validated-form-controls/components/index.ts +0 -4
  428. package/src/validated-form-controls/components/input-control.tsx +9 -1
  429. package/src/validated-form-controls/components/range-control.tsx +2 -1
  430. package/src/validated-form-controls/components/stories/content-editable-control.story.tsx +6 -0
  431. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +6 -0
  432. package/src/validated-form-controls/components/stories/overview.mdx +4 -47
  433. package/src/validated-form-controls/components/textarea-control.tsx +9 -1
  434. package/src/validated-form-controls/index.ts +0 -1
  435. package/src/validated-form-controls/style.scss +11 -67
  436. package/src/validated-form-controls/test/input-control.tsx +12 -0
  437. package/src/validated-form-controls/test/textarea-control.tsx +17 -0
  438. package/src/z-stack/component.tsx +17 -9
  439. package/src/z-stack/style.module.scss +26 -0
  440. package/build/border-box-control/styles.cjs +0 -99
  441. package/build/border-box-control/styles.cjs.map +0 -7
  442. package/build/border-control/styles.cjs +0 -117
  443. package/build/border-control/styles.cjs.map +0 -7
  444. package/build/box-control/styles/box-control-styles.cjs +0 -131
  445. package/build/box-control/styles/box-control-styles.cjs.map +0 -7
  446. package/build/color-palette/styles.cjs +0 -49
  447. package/build/color-palette/styles.cjs.map +0 -7
  448. package/build/combobox-control/styles.cjs +0 -49
  449. package/build/combobox-control/styles.cjs.map +0 -7
  450. package/build/dropdown/styles.cjs +0 -61
  451. package/build/dropdown/styles.cjs.map +0 -7
  452. package/build/progress-bar/styles.cjs +0 -106
  453. package/build/progress-bar/styles.cjs.map +0 -7
  454. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs +0 -90
  455. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs.map +0 -7
  456. package/build/scrollable/styles.cjs +0 -96
  457. package/build/scrollable/styles.cjs.map +0 -7
  458. package/build/textarea-control/styles/textarea-control-styles.cjs +0 -54
  459. package/build/textarea-control/styles/textarea-control-styles.cjs.map +0 -7
  460. package/build/validated-form-controls/components/combobox-control.cjs +0 -75
  461. package/build/validated-form-controls/components/combobox-control.cjs.map +0 -7
  462. package/build/validated-form-controls/components/form-token-field.cjs +0 -69
  463. package/build/validated-form-controls/components/form-token-field.cjs.map +0 -7
  464. package/build/validated-form-controls/components/toggle-control.cjs +0 -67
  465. package/build/validated-form-controls/components/toggle-control.cjs.map +0 -7
  466. package/build/validated-form-controls/components/toggle-group-control.cjs +0 -71
  467. package/build/validated-form-controls/components/toggle-group-control.cjs.map +0 -7
  468. package/build/validated-form-controls/control-with-error.cjs +0 -200
  469. package/build/validated-form-controls/control-with-error.cjs.map +0 -7
  470. package/build/validated-form-controls/validity-indicator.cjs +0 -67
  471. package/build/validated-form-controls/validity-indicator.cjs.map +0 -7
  472. package/build/z-stack/styles.cjs +0 -80
  473. package/build/z-stack/styles.cjs.map +0 -7
  474. package/build-module/border-box-control/styles.mjs +0 -67
  475. package/build-module/border-box-control/styles.mjs.map +0 -7
  476. package/build-module/border-control/styles.mjs +0 -80
  477. package/build-module/border-control/styles.mjs.map +0 -7
  478. package/build-module/box-control/styles/box-control-styles.mjs +0 -91
  479. package/build-module/box-control/styles/box-control-styles.mjs.map +0 -7
  480. package/build-module/color-palette/styles.mjs +0 -14
  481. package/build-module/color-palette/styles.mjs.map +0 -7
  482. package/build-module/combobox-control/styles.mjs +0 -14
  483. package/build-module/combobox-control/styles.mjs.map +0 -7
  484. package/build-module/dropdown/styles.mjs +0 -26
  485. package/build-module/dropdown/styles.mjs.map +0 -7
  486. package/build-module/progress-bar/styles.mjs +0 -68
  487. package/build-module/progress-bar/styles.mjs.map +0 -7
  488. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs +0 -52
  489. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs.map +0 -7
  490. package/build-module/scrollable/styles.mjs +0 -65
  491. package/build-module/scrollable/styles.mjs.map +0 -7
  492. package/build-module/textarea-control/styles/textarea-control-styles.mjs +0 -19
  493. package/build-module/textarea-control/styles/textarea-control-styles.mjs.map +0 -7
  494. package/build-module/validated-form-controls/components/combobox-control.mjs +0 -40
  495. package/build-module/validated-form-controls/components/combobox-control.mjs.map +0 -7
  496. package/build-module/validated-form-controls/components/form-token-field.mjs +0 -44
  497. package/build-module/validated-form-controls/components/form-token-field.mjs.map +0 -7
  498. package/build-module/validated-form-controls/components/toggle-control.mjs +0 -32
  499. package/build-module/validated-form-controls/components/toggle-control.mjs.map +0 -7
  500. package/build-module/validated-form-controls/components/toggle-group-control.mjs +0 -46
  501. package/build-module/validated-form-controls/components/toggle-group-control.mjs.map +0 -7
  502. package/build-module/validated-form-controls/control-with-error.mjs +0 -175
  503. package/build-module/validated-form-controls/control-with-error.mjs.map +0 -7
  504. package/build-module/validated-form-controls/validity-indicator.mjs +0 -32
  505. package/build-module/validated-form-controls/validity-indicator.mjs.map +0 -7
  506. package/build-module/z-stack/styles.mjs +0 -44
  507. package/build-module/z-stack/styles.mjs.map +0 -7
  508. package/build-types/alignment-matrix-control/stories/index.story.d.ts +0 -8
  509. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +0 -1
  510. package/build-types/alignment-matrix-control/test/index.d.ts +0 -2
  511. package/build-types/alignment-matrix-control/test/index.d.ts.map +0 -1
  512. package/build-types/angle-picker-control/stories/index.story.d.ts +0 -8
  513. package/build-types/angle-picker-control/stories/index.story.d.ts.map +0 -1
  514. package/build-types/animate/stories/index.story.d.ts +0 -12
  515. package/build-types/animate/stories/index.story.d.ts.map +0 -1
  516. package/build-types/autocomplete/test/get-autocomplete-match.d.ts +0 -2
  517. package/build-types/autocomplete/test/get-autocomplete-match.d.ts.map +0 -1
  518. package/build-types/autocomplete/test/index.d.ts +0 -2
  519. package/build-types/autocomplete/test/index.d.ts.map +0 -1
  520. package/build-types/badge/stories/e2e/index.story.d.ts +0 -7
  521. package/build-types/badge/stories/e2e/index.story.d.ts.map +0 -1
  522. package/build-types/badge/stories/index.story.d.ts +0 -11
  523. package/build-types/badge/stories/index.story.d.ts.map +0 -1
  524. package/build-types/badge/test/index.d.ts +0 -2
  525. package/build-types/badge/test/index.d.ts.map +0 -1
  526. package/build-types/base-control/stories/index.story.d.ts +0 -17
  527. package/build-types/base-control/stories/index.story.d.ts.map +0 -1
  528. package/build-types/base-control/test/index.d.ts +0 -2
  529. package/build-types/base-control/test/index.d.ts.map +0 -1
  530. package/build-types/border-box-control/stories/index.story.d.ts +0 -14
  531. package/build-types/border-box-control/stories/index.story.d.ts.map +0 -1
  532. package/build-types/border-box-control/styles.d.ts +0 -10
  533. package/build-types/border-box-control/styles.d.ts.map +0 -1
  534. package/build-types/border-box-control/test/index.d.ts +0 -2
  535. package/build-types/border-box-control/test/index.d.ts.map +0 -1
  536. package/build-types/border-box-control/test/utils.d.ts +0 -2
  537. package/build-types/border-box-control/test/utils.d.ts.map +0 -1
  538. package/build-types/border-control/stories/index.story.d.ts +0 -109
  539. package/build-types/border-control/stories/index.story.d.ts.map +0 -1
  540. package/build-types/border-control/styles.d.ts +0 -17
  541. package/build-types/border-control/styles.d.ts.map +0 -1
  542. package/build-types/box-control/stories/index.story.d.ts +0 -12
  543. package/build-types/box-control/stories/index.story.d.ts.map +0 -1
  544. package/build-types/box-control/styles/box-control-styles.d.ts +0 -65
  545. package/build-types/box-control/styles/box-control-styles.d.ts.map +0 -1
  546. package/build-types/box-control/test/index.d.ts +0 -2
  547. package/build-types/box-control/test/index.d.ts.map +0 -1
  548. package/build-types/button/stories/e2e/index.story.d.ts +0 -9
  549. package/build-types/button/stories/e2e/index.story.d.ts.map +0 -1
  550. package/build-types/button/stories/index.story.d.ts +0 -31
  551. package/build-types/button/stories/index.story.d.ts.map +0 -1
  552. package/build-types/button/test/index.d.ts +0 -2
  553. package/build-types/button/test/index.d.ts.map +0 -1
  554. package/build-types/button-group/stories/index.story.d.ts +0 -12
  555. package/build-types/button-group/stories/index.story.d.ts.map +0 -1
  556. package/build-types/card/stories/index.story.d.ts +0 -20
  557. package/build-types/card/stories/index.story.d.ts.map +0 -1
  558. package/build-types/card/test/index.d.ts +0 -2
  559. package/build-types/card/test/index.d.ts.map +0 -1
  560. package/build-types/checkbox-control/stories/index.story.d.ts +0 -24
  561. package/build-types/checkbox-control/stories/index.story.d.ts.map +0 -1
  562. package/build-types/checkbox-control/test/index.d.ts +0 -2
  563. package/build-types/checkbox-control/test/index.d.ts.map +0 -1
  564. package/build-types/circular-option-picker/stories/index.story.d.ts +0 -10
  565. package/build-types/circular-option-picker/stories/index.story.d.ts.map +0 -1
  566. package/build-types/circular-option-picker/test/index.d.ts +0 -2
  567. package/build-types/circular-option-picker/test/index.d.ts.map +0 -1
  568. package/build-types/color-indicator/stories/index.story.d.ts +0 -6
  569. package/build-types/color-indicator/stories/index.story.d.ts.map +0 -1
  570. package/build-types/color-indicator/test/index.d.ts +0 -2
  571. package/build-types/color-indicator/test/index.d.ts.map +0 -1
  572. package/build-types/color-palette/stories/index.story.d.ts +0 -11
  573. package/build-types/color-palette/stories/index.story.d.ts.map +0 -1
  574. package/build-types/color-palette/styles.d.ts +0 -11
  575. package/build-types/color-palette/styles.d.ts.map +0 -1
  576. package/build-types/color-palette/test/index.d.ts +0 -2
  577. package/build-types/color-palette/test/index.d.ts.map +0 -1
  578. package/build-types/color-palette/test/utils.d.ts +0 -2
  579. package/build-types/color-palette/test/utils.d.ts.map +0 -1
  580. package/build-types/color-picker/stories/index.story.d.ts +0 -6
  581. package/build-types/color-picker/stories/index.story.d.ts.map +0 -1
  582. package/build-types/color-picker/test/index.d.ts +0 -2
  583. package/build-types/color-picker/test/index.d.ts.map +0 -1
  584. package/build-types/combobox-control/stories/index.story.d.ts +0 -93
  585. package/build-types/combobox-control/stories/index.story.d.ts.map +0 -1
  586. package/build-types/combobox-control/styles.d.ts +0 -6
  587. package/build-types/combobox-control/styles.d.ts.map +0 -1
  588. package/build-types/combobox-control/test/index.d.ts +0 -2
  589. package/build-types/combobox-control/test/index.d.ts.map +0 -1
  590. package/build-types/composite/legacy/stories/index.story.d.ts +0 -9
  591. package/build-types/composite/legacy/stories/index.story.d.ts.map +0 -1
  592. package/build-types/composite/legacy/stories/utils.d.ts +0 -27
  593. package/build-types/composite/legacy/stories/utils.d.ts.map +0 -1
  594. package/build-types/composite/legacy/test/index.d.ts +0 -2
  595. package/build-types/composite/legacy/test/index.d.ts.map +0 -1
  596. package/build-types/composite/stories/index.story.d.ts +0 -33
  597. package/build-types/composite/stories/index.story.d.ts.map +0 -1
  598. package/build-types/composite/test/index.d.ts +0 -2
  599. package/build-types/composite/test/index.d.ts.map +0 -1
  600. package/build-types/confirm-dialog/stories/index.story.d.ts +0 -7
  601. package/build-types/confirm-dialog/stories/index.story.d.ts.map +0 -1
  602. package/build-types/confirm-dialog/test/index.d.ts +0 -2
  603. package/build-types/confirm-dialog/test/index.d.ts.map +0 -1
  604. package/build-types/content-editable-control/stories/index.story.d.ts +0 -7
  605. package/build-types/content-editable-control/stories/index.story.d.ts.map +0 -1
  606. package/build-types/content-editable-control/test/index.d.ts +0 -2
  607. package/build-types/content-editable-control/test/index.d.ts.map +0 -1
  608. package/build-types/context/test/context-connect.d.ts +0 -2
  609. package/build-types/context/test/context-connect.d.ts.map +0 -1
  610. package/build-types/context/test/wordpress-component.d.ts +0 -2
  611. package/build-types/context/test/wordpress-component.d.ts.map +0 -1
  612. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts +0 -2
  613. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts.map +0 -1
  614. package/build-types/custom-gradient-picker/stories/index.story.d.ts +0 -6
  615. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +0 -1
  616. package/build-types/custom-gradient-picker/test/index.d.ts +0 -2
  617. package/build-types/custom-gradient-picker/test/index.d.ts.map +0 -1
  618. package/build-types/custom-gradient-picker/test/serializer.d.ts +0 -2
  619. package/build-types/custom-gradient-picker/test/serializer.d.ts.map +0 -1
  620. package/build-types/custom-select-control/stories/index.story.d.ts +0 -8
  621. package/build-types/custom-select-control/stories/index.story.d.ts.map +0 -1
  622. package/build-types/custom-select-control/test/index.d.ts +0 -2
  623. package/build-types/custom-select-control/test/index.d.ts.map +0 -1
  624. package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -38
  625. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
  626. package/build-types/custom-select-control-v2/test/index.d.ts +0 -2
  627. package/build-types/custom-select-control-v2/test/index.d.ts.map +0 -1
  628. package/build-types/date-time/date-picker/test/index.d.ts +0 -2
  629. package/build-types/date-time/date-picker/test/index.d.ts.map +0 -1
  630. package/build-types/date-time/date-picker/test/use-lilius.d.ts +0 -2
  631. package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +0 -1
  632. package/build-types/date-time/date-time/test/index.d.ts +0 -2
  633. package/build-types/date-time/date-time/test/index.d.ts.map +0 -1
  634. package/build-types/date-time/stories/date-time.story.d.ts +0 -8
  635. package/build-types/date-time/stories/date-time.story.d.ts.map +0 -1
  636. package/build-types/date-time/stories/date.story.d.ts +0 -8
  637. package/build-types/date-time/stories/date.story.d.ts.map +0 -1
  638. package/build-types/date-time/stories/time.story.d.ts +0 -11
  639. package/build-types/date-time/stories/time.story.d.ts.map +0 -1
  640. package/build-types/date-time/stories/utils.d.ts +0 -3
  641. package/build-types/date-time/stories/utils.d.ts.map +0 -1
  642. package/build-types/date-time/test/utils.test.d.ts +0 -2
  643. package/build-types/date-time/test/utils.test.d.ts.map +0 -1
  644. package/build-types/date-time/time-picker/test/index.d.ts +0 -2
  645. package/build-types/date-time/time-picker/test/index.d.ts.map +0 -1
  646. package/build-types/date-time/time-picker/time-input/test/index.d.ts +0 -2
  647. package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +0 -1
  648. package/build-types/disabled/stories/index.story.d.ts +0 -7
  649. package/build-types/disabled/stories/index.story.d.ts.map +0 -1
  650. package/build-types/disabled/test/index.d.ts +0 -2
  651. package/build-types/disabled/test/index.d.ts.map +0 -1
  652. package/build-types/divider/stories/index.story.d.ts +0 -8
  653. package/build-types/divider/stories/index.story.d.ts.map +0 -1
  654. package/build-types/divider/test/index.d.ts +0 -2
  655. package/build-types/divider/test/index.d.ts.map +0 -1
  656. package/build-types/draggable/stories/index.story.d.ts +0 -13
  657. package/build-types/draggable/stories/index.story.d.ts.map +0 -1
  658. package/build-types/drop-zone/stories/index.story.d.ts +0 -6
  659. package/build-types/drop-zone/stories/index.story.d.ts.map +0 -1
  660. package/build-types/dropdown/stories/index.story.d.ts +0 -18
  661. package/build-types/dropdown/stories/index.story.d.ts.map +0 -1
  662. package/build-types/dropdown/styles.d.ts +0 -6
  663. package/build-types/dropdown/styles.d.ts.map +0 -1
  664. package/build-types/dropdown/test/index.d.ts +0 -2
  665. package/build-types/dropdown/test/index.d.ts.map +0 -1
  666. package/build-types/dropdown-menu/stories/index.story.d.ts +0 -7
  667. package/build-types/dropdown-menu/stories/index.story.d.ts.map +0 -1
  668. package/build-types/dropdown-menu/test/index.d.ts +0 -2
  669. package/build-types/dropdown-menu/test/index.d.ts.map +0 -1
  670. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +0 -7
  671. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +0 -1
  672. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +0 -8
  673. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +0 -1
  674. package/build-types/elevation/stories/index.story.d.ts +0 -16
  675. package/build-types/elevation/stories/index.story.d.ts.map +0 -1
  676. package/build-types/elevation/test/index.d.ts +0 -2
  677. package/build-types/elevation/test/index.d.ts.map +0 -1
  678. package/build-types/external-link/stories/index.story.d.ts +0 -6
  679. package/build-types/external-link/stories/index.story.d.ts.map +0 -1
  680. package/build-types/external-link/test/index.d.ts +0 -2
  681. package/build-types/external-link/test/index.d.ts.map +0 -1
  682. package/build-types/flex/stories/index.story.d.ts +0 -7
  683. package/build-types/flex/stories/index.story.d.ts.map +0 -1
  684. package/build-types/flex/test/index.d.ts +0 -2
  685. package/build-types/flex/test/index.d.ts.map +0 -1
  686. package/build-types/focal-point-picker/stories/index.story.d.ts +0 -49
  687. package/build-types/focal-point-picker/stories/index.story.d.ts.map +0 -1
  688. package/build-types/focal-point-picker/test/index.d.ts +0 -2
  689. package/build-types/focal-point-picker/test/index.d.ts.map +0 -1
  690. package/build-types/focal-point-picker/test/media.d.ts +0 -2
  691. package/build-types/focal-point-picker/test/media.d.ts.map +0 -1
  692. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +0 -20
  693. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +0 -1
  694. package/build-types/font-size-picker/stories/index.story.d.ts +0 -26
  695. package/build-types/font-size-picker/stories/index.story.d.ts.map +0 -1
  696. package/build-types/font-size-picker/test/font-size-picker-select.d.ts +0 -2
  697. package/build-types/font-size-picker/test/font-size-picker-select.d.ts.map +0 -1
  698. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts +0 -2
  699. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts.map +0 -1
  700. package/build-types/font-size-picker/test/index.d.ts +0 -2
  701. package/build-types/font-size-picker/test/index.d.ts.map +0 -1
  702. package/build-types/font-size-picker/test/utils.d.ts +0 -2
  703. package/build-types/font-size-picker/test/utils.d.ts.map +0 -1
  704. package/build-types/form-file-upload/stories/index.story.d.ts +0 -17
  705. package/build-types/form-file-upload/stories/index.story.d.ts.map +0 -1
  706. package/build-types/form-file-upload/test/index.d.ts +0 -2
  707. package/build-types/form-file-upload/test/index.d.ts.map +0 -1
  708. package/build-types/form-toggle/stories/index.story.d.ts +0 -6
  709. package/build-types/form-toggle/stories/index.story.d.ts.map +0 -1
  710. package/build-types/form-toggle/test/index.d.ts +0 -2
  711. package/build-types/form-toggle/test/index.d.ts.map +0 -1
  712. package/build-types/form-token-field/stories/index.story.d.ts +0 -25
  713. package/build-types/form-token-field/stories/index.story.d.ts.map +0 -1
  714. package/build-types/form-token-field/test/index.d.ts +0 -2
  715. package/build-types/form-token-field/test/index.d.ts.map +0 -1
  716. package/build-types/gradient-picker/stories/index.story.d.ts +0 -11
  717. package/build-types/gradient-picker/stories/index.story.d.ts.map +0 -1
  718. package/build-types/gradient-picker/test/index.d.ts +0 -2
  719. package/build-types/gradient-picker/test/index.d.ts.map +0 -1
  720. package/build-types/grid/stories/index.story.d.ts +0 -6
  721. package/build-types/grid/stories/index.story.d.ts.map +0 -1
  722. package/build-types/grid/test/grid.d.ts +0 -2
  723. package/build-types/grid/test/grid.d.ts.map +0 -1
  724. package/build-types/guide/stories/index.story.d.ts +0 -6
  725. package/build-types/guide/stories/index.story.d.ts.map +0 -1
  726. package/build-types/guide/test/index.d.ts +0 -2
  727. package/build-types/guide/test/index.d.ts.map +0 -1
  728. package/build-types/h-stack/stories/e2e/index.story.d.ts +0 -6
  729. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +0 -1
  730. package/build-types/h-stack/stories/index.story.d.ts +0 -6
  731. package/build-types/h-stack/stories/index.story.d.ts.map +0 -1
  732. package/build-types/h-stack/test/index.d.ts +0 -2
  733. package/build-types/h-stack/test/index.d.ts.map +0 -1
  734. package/build-types/heading/stories/index.story.d.ts +0 -6
  735. package/build-types/heading/stories/index.story.d.ts.map +0 -1
  736. package/build-types/heading/test/index.d.ts +0 -2
  737. package/build-types/heading/test/index.d.ts.map +0 -1
  738. package/build-types/higher-order/with-fallback-styles/test/index.d.ts +0 -2
  739. package/build-types/higher-order/with-fallback-styles/test/index.d.ts.map +0 -1
  740. package/build-types/higher-order/with-filters/test/index.d.ts +0 -2
  741. package/build-types/higher-order/with-filters/test/index.d.ts.map +0 -1
  742. package/build-types/higher-order/with-focus-outside/test/index.d.ts +0 -2
  743. package/build-types/higher-order/with-focus-outside/test/index.d.ts.map +0 -1
  744. package/build-types/higher-order/with-focus-return/test/index.d.ts +0 -2
  745. package/build-types/higher-order/with-focus-return/test/index.d.ts.map +0 -1
  746. package/build-types/higher-order/with-notices/test/index.d.ts +0 -2
  747. package/build-types/higher-order/with-notices/test/index.d.ts.map +0 -1
  748. package/build-types/higher-order/with-spoken-messages/test/index.d.ts +0 -2
  749. package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +0 -1
  750. package/build-types/icon/stories/index.story.d.ts +0 -21
  751. package/build-types/icon/stories/index.story.d.ts.map +0 -1
  752. package/build-types/icon/test/index.d.ts +0 -2
  753. package/build-types/icon/test/index.d.ts.map +0 -1
  754. package/build-types/input-control/stories/index.story.d.ts +0 -31
  755. package/build-types/input-control/stories/index.story.d.ts.map +0 -1
  756. package/build-types/isolated-event-container/test/index.d.ts +0 -2
  757. package/build-types/isolated-event-container/test/index.d.ts.map +0 -1
  758. package/build-types/item-group/stories/index.story.d.ts +0 -9
  759. package/build-types/item-group/stories/index.story.d.ts.map +0 -1
  760. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +0 -6
  761. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +0 -1
  762. package/build-types/keyboard-shortcuts/test/index.d.ts +0 -2
  763. package/build-types/keyboard-shortcuts/test/index.d.ts.map +0 -1
  764. package/build-types/menu/stories/index.story.d.ts +0 -13
  765. package/build-types/menu/stories/index.story.d.ts.map +0 -1
  766. package/build-types/menu/test/index.d.ts +0 -2
  767. package/build-types/menu/test/index.d.ts.map +0 -1
  768. package/build-types/menu-group/stories/index.story.d.ts +0 -11
  769. package/build-types/menu-group/stories/index.story.d.ts.map +0 -1
  770. package/build-types/menu-group/test/index.d.ts +0 -2
  771. package/build-types/menu-group/test/index.d.ts.map +0 -1
  772. package/build-types/menu-item/stories/index.story.d.ts +0 -70
  773. package/build-types/menu-item/stories/index.story.d.ts.map +0 -1
  774. package/build-types/menu-items-choice/stories/index.story.d.ts +0 -6
  775. package/build-types/menu-items-choice/stories/index.story.d.ts.map +0 -1
  776. package/build-types/modal/stories/index.story.d.ts +0 -11
  777. package/build-types/modal/stories/index.story.d.ts.map +0 -1
  778. package/build-types/modal/test/aria-helper.d.ts +0 -2
  779. package/build-types/modal/test/aria-helper.d.ts.map +0 -1
  780. package/build-types/modal/test/index.d.ts +0 -2
  781. package/build-types/modal/test/index.d.ts.map +0 -1
  782. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +0 -6
  783. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +0 -1
  784. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +0 -6
  785. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +0 -1
  786. package/build-types/navigable-container/test/navigable-menu.d.ts +0 -2
  787. package/build-types/navigable-container/test/navigable-menu.d.ts.map +0 -1
  788. package/build-types/navigable-container/test/tababble-container.d.ts +0 -2
  789. package/build-types/navigable-container/test/tababble-container.d.ts.map +0 -1
  790. package/build-types/navigator/stories/index.story.d.ts +0 -8
  791. package/build-types/navigator/stories/index.story.d.ts.map +0 -1
  792. package/build-types/navigator/test/index.d.ts +0 -2
  793. package/build-types/navigator/test/index.d.ts.map +0 -1
  794. package/build-types/navigator/test/router.d.ts +0 -2
  795. package/build-types/navigator/test/router.d.ts.map +0 -1
  796. package/build-types/notice/stories/index.story.d.ts +0 -15
  797. package/build-types/notice/stories/index.story.d.ts.map +0 -1
  798. package/build-types/notice/test/index.d.ts +0 -2
  799. package/build-types/notice/test/index.d.ts.map +0 -1
  800. package/build-types/notice/test/list.d.ts +0 -2
  801. package/build-types/notice/test/list.d.ts.map +0 -1
  802. package/build-types/number-control/stories/index.story.d.ts +0 -19
  803. package/build-types/number-control/stories/index.story.d.ts.map +0 -1
  804. package/build-types/number-control/test/index.d.ts +0 -2
  805. package/build-types/number-control/test/index.d.ts.map +0 -1
  806. package/build-types/palette-edit/stories/index.story.d.ts +0 -7
  807. package/build-types/palette-edit/stories/index.story.d.ts.map +0 -1
  808. package/build-types/palette-edit/test/index.d.ts +0 -2
  809. package/build-types/palette-edit/test/index.d.ts.map +0 -1
  810. package/build-types/panel/stories/index.story.d.ts +0 -13
  811. package/build-types/panel/stories/index.story.d.ts.map +0 -1
  812. package/build-types/panel/test/body.d.ts +0 -2
  813. package/build-types/panel/test/body.d.ts.map +0 -1
  814. package/build-types/panel/test/header.d.ts +0 -2
  815. package/build-types/panel/test/header.d.ts.map +0 -1
  816. package/build-types/panel/test/index.d.ts +0 -2
  817. package/build-types/panel/test/index.d.ts.map +0 -1
  818. package/build-types/panel/test/row.d.ts +0 -2
  819. package/build-types/panel/test/row.d.ts.map +0 -1
  820. package/build-types/placeholder/stories/index.story.d.ts +0 -6
  821. package/build-types/placeholder/stories/index.story.d.ts.map +0 -1
  822. package/build-types/placeholder/test/index.d.ts +0 -2
  823. package/build-types/placeholder/test/index.d.ts.map +0 -1
  824. package/build-types/popover/stories/e2e/index.story.d.ts +0 -18
  825. package/build-types/popover/stories/e2e/index.story.d.ts.map +0 -1
  826. package/build-types/popover/stories/index.story.d.ts +0 -11
  827. package/build-types/popover/stories/index.story.d.ts.map +0 -1
  828. package/build-types/popover/test/index.d.ts +0 -2
  829. package/build-types/popover/test/index.d.ts.map +0 -1
  830. package/build-types/popover/test/utils/index.d.ts +0 -3
  831. package/build-types/popover/test/utils/index.d.ts.map +0 -1
  832. package/build-types/progress-bar/stories/index.story.d.ts +0 -23
  833. package/build-types/progress-bar/stories/index.story.d.ts.map +0 -1
  834. package/build-types/progress-bar/styles.d.ts +0 -16
  835. package/build-types/progress-bar/styles.d.ts.map +0 -1
  836. package/build-types/progress-bar/test/index.d.ts +0 -2
  837. package/build-types/progress-bar/test/index.d.ts.map +0 -1
  838. package/build-types/query-controls/stories/index.story.d.ts +0 -7
  839. package/build-types/query-controls/stories/index.story.d.ts.map +0 -1
  840. package/build-types/query-controls/test/terms.d.ts +0 -2
  841. package/build-types/query-controls/test/terms.d.ts.map +0 -1
  842. package/build-types/radio-control/stories/index.story.d.ts +0 -7
  843. package/build-types/radio-control/stories/index.story.d.ts.map +0 -1
  844. package/build-types/radio-control/test/index.d.ts +0 -2
  845. package/build-types/radio-control/test/index.d.ts.map +0 -1
  846. package/build-types/radio-group/stories/index.story.d.ts +0 -8
  847. package/build-types/radio-group/stories/index.story.d.ts.map +0 -1
  848. package/build-types/range-control/stories/index.story.d.ts +0 -42
  849. package/build-types/range-control/stories/index.story.d.ts.map +0 -1
  850. package/build-types/range-control/test/index.d.ts +0 -2
  851. package/build-types/range-control/test/index.d.ts.map +0 -1
  852. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +0 -18
  853. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +0 -1
  854. package/build-types/resizable-box/stories/index.story.d.ts +0 -46
  855. package/build-types/resizable-box/stories/index.story.d.ts.map +0 -1
  856. package/build-types/responsive-wrapper/stories/index.story.d.ts +0 -16
  857. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +0 -1
  858. package/build-types/sandbox/stories/index.story.d.ts +0 -7
  859. package/build-types/sandbox/stories/index.story.d.ts.map +0 -1
  860. package/build-types/sandbox/test/index.d.ts +0 -2
  861. package/build-types/sandbox/test/index.d.ts.map +0 -1
  862. package/build-types/scroll-lock/stories/index.story.d.ts +0 -6
  863. package/build-types/scroll-lock/stories/index.story.d.ts.map +0 -1
  864. package/build-types/scroll-lock/test/index.d.ts +0 -2
  865. package/build-types/scroll-lock/test/index.d.ts.map +0 -1
  866. package/build-types/scrollable/stories/index.story.d.ts +0 -6
  867. package/build-types/scrollable/stories/index.story.d.ts.map +0 -1
  868. package/build-types/scrollable/styles.d.ts +0 -8
  869. package/build-types/scrollable/styles.d.ts.map +0 -1
  870. package/build-types/scrollable/test/index.d.ts +0 -2
  871. package/build-types/scrollable/test/index.d.ts.map +0 -1
  872. package/build-types/search-control/stories/index.story.d.ts +0 -18
  873. package/build-types/search-control/stories/index.story.d.ts.map +0 -1
  874. package/build-types/search-control/test/index.d.ts +0 -2
  875. package/build-types/search-control/test/index.d.ts.map +0 -1
  876. package/build-types/select-control/stories/index.story.d.ts +0 -28
  877. package/build-types/select-control/stories/index.story.d.ts.map +0 -1
  878. package/build-types/select-control/test/select-control.d.ts +0 -2
  879. package/build-types/select-control/test/select-control.d.ts.map +0 -1
  880. package/build-types/shortcut/stories/index.story.d.ts +0 -7
  881. package/build-types/shortcut/stories/index.story.d.ts.map +0 -1
  882. package/build-types/shortcut/test/index.d.ts +0 -2
  883. package/build-types/shortcut/test/index.d.ts.map +0 -1
  884. package/build-types/slot-fill/stories/index.story.d.ts +0 -10
  885. package/build-types/slot-fill/stories/index.story.d.ts.map +0 -1
  886. package/build-types/snackbar/stories/index.story.d.ts +0 -10
  887. package/build-types/snackbar/stories/index.story.d.ts.map +0 -1
  888. package/build-types/snackbar/stories/list.story.d.ts +0 -6
  889. package/build-types/snackbar/stories/list.story.d.ts.map +0 -1
  890. package/build-types/snackbar/test/index.d.ts +0 -2
  891. package/build-types/snackbar/test/index.d.ts.map +0 -1
  892. package/build-types/snackbar/test/list.d.ts +0 -2
  893. package/build-types/snackbar/test/list.d.ts.map +0 -1
  894. package/build-types/spacer/stories/index.story.d.ts +0 -7
  895. package/build-types/spacer/stories/index.story.d.ts.map +0 -1
  896. package/build-types/spacer/test/index.d.ts +0 -2
  897. package/build-types/spacer/test/index.d.ts.map +0 -1
  898. package/build-types/spinner/stories/index.story.d.ts +0 -7
  899. package/build-types/spinner/stories/index.story.d.ts.map +0 -1
  900. package/build-types/style-provider/test/index.d.ts +0 -2
  901. package/build-types/style-provider/test/index.d.ts.map +0 -1
  902. package/build-types/surface/stories/index.story.d.ts +0 -6
  903. package/build-types/surface/stories/index.story.d.ts.map +0 -1
  904. package/build-types/surface/test/index.d.ts +0 -2
  905. package/build-types/surface/test/index.d.ts.map +0 -1
  906. package/build-types/tab-panel/stories/index.story.d.ts +0 -9
  907. package/build-types/tab-panel/stories/index.story.d.ts.map +0 -1
  908. package/build-types/tab-panel/test/index.d.ts +0 -2
  909. package/build-types/tab-panel/test/index.d.ts.map +0 -1
  910. package/build-types/tabs/stories/index.story.d.ts +0 -13
  911. package/build-types/tabs/stories/index.story.d.ts.map +0 -1
  912. package/build-types/tabs/test/index.d.ts +0 -2
  913. package/build-types/tabs/test/index.d.ts.map +0 -1
  914. package/build-types/text/stories/index.story.d.ts +0 -14
  915. package/build-types/text/stories/index.story.d.ts.map +0 -1
  916. package/build-types/text/test/index.d.ts +0 -2
  917. package/build-types/text/test/index.d.ts.map +0 -1
  918. package/build-types/text-control/stories/index.story.d.ts +0 -7
  919. package/build-types/text-control/stories/index.story.d.ts.map +0 -1
  920. package/build-types/text-control/test/text-control.d.ts +0 -2
  921. package/build-types/text-control/test/text-control.d.ts.map +0 -1
  922. package/build-types/text-highlight/stories/index.story.d.ts +0 -6
  923. package/build-types/text-highlight/stories/index.story.d.ts.map +0 -1
  924. package/build-types/text-highlight/test/index.d.ts +0 -2
  925. package/build-types/text-highlight/test/index.d.ts.map +0 -1
  926. package/build-types/textarea-control/stories/index.story.d.ts +0 -6
  927. package/build-types/textarea-control/stories/index.story.d.ts.map +0 -1
  928. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +0 -5
  929. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +0 -1
  930. package/build-types/tip/stories/index.story.d.ts +0 -6
  931. package/build-types/tip/stories/index.story.d.ts.map +0 -1
  932. package/build-types/toggle-control/stories/index.story.d.ts +0 -13
  933. package/build-types/toggle-control/stories/index.story.d.ts.map +0 -1
  934. package/build-types/toggle-control/test/index.d.ts +0 -2
  935. package/build-types/toggle-control/test/index.d.ts.map +0 -1
  936. package/build-types/toggle-group-control/stories/index.story.d.ts +0 -21
  937. package/build-types/toggle-group-control/stories/index.story.d.ts.map +0 -1
  938. package/build-types/toggle-group-control/test/index.d.ts +0 -2
  939. package/build-types/toggle-group-control/test/index.d.ts.map +0 -1
  940. package/build-types/toolbar/stories/index.story.d.ts +0 -12
  941. package/build-types/toolbar/stories/index.story.d.ts.map +0 -1
  942. package/build-types/toolbar/test/index.d.ts +0 -2
  943. package/build-types/toolbar/test/index.d.ts.map +0 -1
  944. package/build-types/toolbar/test/toolbar-group.d.ts +0 -2
  945. package/build-types/toolbar/test/toolbar-group.d.ts.map +0 -1
  946. package/build-types/tools-panel/stories/index.story.d.ts +0 -11
  947. package/build-types/tools-panel/stories/index.story.d.ts.map +0 -1
  948. package/build-types/tools-panel/test/index.d.ts +0 -2
  949. package/build-types/tools-panel/test/index.d.ts.map +0 -1
  950. package/build-types/tooltip/stories/index.story.d.ts +0 -15
  951. package/build-types/tooltip/stories/index.story.d.ts.map +0 -1
  952. package/build-types/tooltip/test/index.d.ts +0 -2
  953. package/build-types/tooltip/test/index.d.ts.map +0 -1
  954. package/build-types/tooltip/test/utils/index.d.ts +0 -7
  955. package/build-types/tooltip/test/utils/index.d.ts.map +0 -1
  956. package/build-types/tree-grid/stories/index.story.d.ts +0 -6
  957. package/build-types/tree-grid/stories/index.story.d.ts.map +0 -1
  958. package/build-types/tree-grid/test/cell.d.ts +0 -2
  959. package/build-types/tree-grid/test/cell.d.ts.map +0 -1
  960. package/build-types/tree-grid/test/index.d.ts +0 -2
  961. package/build-types/tree-grid/test/index.d.ts.map +0 -1
  962. package/build-types/tree-grid/test/roving-tab-index-item.d.ts +0 -2
  963. package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +0 -1
  964. package/build-types/tree-grid/test/roving-tab-index.d.ts +0 -2
  965. package/build-types/tree-grid/test/roving-tab-index.d.ts.map +0 -1
  966. package/build-types/tree-grid/test/row.d.ts +0 -2
  967. package/build-types/tree-grid/test/row.d.ts.map +0 -1
  968. package/build-types/tree-select/stories/index.story.d.ts +0 -6
  969. package/build-types/tree-select/stories/index.story.d.ts.map +0 -1
  970. package/build-types/truncate/stories/index.story.d.ts +0 -7
  971. package/build-types/truncate/stories/index.story.d.ts.map +0 -1
  972. package/build-types/truncate/test/index.d.ts +0 -2
  973. package/build-types/truncate/test/index.d.ts.map +0 -1
  974. package/build-types/unit-control/stories/index.story.d.ts +0 -27
  975. package/build-types/unit-control/stories/index.story.d.ts.map +0 -1
  976. package/build-types/unit-control/test/index.d.ts +0 -2
  977. package/build-types/unit-control/test/index.d.ts.map +0 -1
  978. package/build-types/unit-control/test/utils.d.ts +0 -2
  979. package/build-types/unit-control/test/utils.d.ts.map +0 -1
  980. package/build-types/utils/test/polymorphic-element.d.ts +0 -2
  981. package/build-types/utils/test/polymorphic-element.d.ts.map +0 -1
  982. package/build-types/v-stack/stories/e2e/index.story.d.ts +0 -6
  983. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +0 -1
  984. package/build-types/v-stack/stories/index.story.d.ts +0 -11
  985. package/build-types/v-stack/stories/index.story.d.ts.map +0 -1
  986. package/build-types/v-stack/test/index.d.ts +0 -2
  987. package/build-types/v-stack/test/index.d.ts.map +0 -1
  988. package/build-types/validated-form-controls/components/combobox-control.d.ts +0 -20
  989. package/build-types/validated-form-controls/components/combobox-control.d.ts.map +0 -1
  990. package/build-types/validated-form-controls/components/form-token-field.d.ts +0 -3
  991. package/build-types/validated-form-controls/components/form-token-field.d.ts.map +0 -1
  992. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +0 -6
  993. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +0 -1
  994. package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts +0 -6
  995. package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts.map +0 -1
  996. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +0 -6
  997. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +0 -1
  998. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts +0 -9
  999. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +0 -1
  1000. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +0 -12
  1001. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +0 -1
  1002. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +0 -60
  1003. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +0 -1
  1004. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +0 -6
  1005. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +0 -1
  1006. package/build-types/validated-form-controls/components/stories/story-utils.d.ts +0 -3
  1007. package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +0 -1
  1008. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +0 -6
  1009. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +0 -1
  1010. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +0 -6
  1011. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +0 -1
  1012. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +0 -6
  1013. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +0 -1
  1014. package/build-types/validated-form-controls/components/toggle-control.d.ts +0 -7
  1015. package/build-types/validated-form-controls/components/toggle-control.d.ts.map +0 -1
  1016. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +0 -15
  1017. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +0 -1
  1018. package/build-types/validated-form-controls/control-with-error.d.ts +0 -36
  1019. package/build-types/validated-form-controls/control-with-error.d.ts.map +0 -1
  1020. package/build-types/validated-form-controls/test/combobox-control.d.ts +0 -2
  1021. package/build-types/validated-form-controls/test/combobox-control.d.ts.map +0 -1
  1022. package/build-types/validated-form-controls/test/content-editable-control.d.ts +0 -2
  1023. package/build-types/validated-form-controls/test/content-editable-control.d.ts.map +0 -1
  1024. package/build-types/validated-form-controls/test/control-with-error.d.ts +0 -2
  1025. package/build-types/validated-form-controls/test/control-with-error.d.ts.map +0 -1
  1026. package/build-types/validated-form-controls/test/custom-select-control.d.ts +0 -2
  1027. package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +0 -1
  1028. package/build-types/validated-form-controls/test/form-token-field.d.ts +0 -2
  1029. package/build-types/validated-form-controls/test/form-token-field.d.ts.map +0 -1
  1030. package/build-types/validated-form-controls/test/input-control.d.ts +0 -2
  1031. package/build-types/validated-form-controls/test/input-control.d.ts.map +0 -1
  1032. package/build-types/validated-form-controls/test/range-control.d.ts +0 -2
  1033. package/build-types/validated-form-controls/test/range-control.d.ts.map +0 -1
  1034. package/build-types/validated-form-controls/test/textarea-control.d.ts +0 -2
  1035. package/build-types/validated-form-controls/test/textarea-control.d.ts.map +0 -1
  1036. package/build-types/validated-form-controls/test/toggle-control.d.ts +0 -2
  1037. package/build-types/validated-form-controls/test/toggle-control.d.ts.map +0 -1
  1038. package/build-types/validated-form-controls/test/toggle-group-control.d.ts +0 -2
  1039. package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +0 -1
  1040. package/build-types/validated-form-controls/validity-indicator.d.ts +0 -6
  1041. package/build-types/validated-form-controls/validity-indicator.d.ts.map +0 -1
  1042. package/build-types/view/stories/index.story.d.ts +0 -6
  1043. package/build-types/view/stories/index.story.d.ts.map +0 -1
  1044. package/build-types/visually-hidden/stories/index.story.d.ts +0 -8
  1045. package/build-types/visually-hidden/stories/index.story.d.ts.map +0 -1
  1046. package/build-types/z-stack/stories/index.story.d.ts +0 -6
  1047. package/build-types/z-stack/stories/index.story.d.ts.map +0 -1
  1048. package/build-types/z-stack/styles.d.ts +0 -14
  1049. package/build-types/z-stack/styles.d.ts.map +0 -1
  1050. package/src/base-control/styles/base-control-styles.ts +0 -46
  1051. package/src/border-box-control/styles.ts +0 -71
  1052. package/src/border-control/styles.ts +0 -151
  1053. package/src/box-control/styles/box-control-styles.ts +0 -34
  1054. package/src/color-palette/styles.ts +0 -13
  1055. package/src/combobox-control/styles.ts +0 -9
  1056. package/src/dropdown/styles.ts +0 -33
  1057. package/src/progress-bar/styles.ts +0 -84
  1058. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +0 -47
  1059. package/src/scrollable/styles.ts +0 -57
  1060. package/src/scrollable/test/__snapshots__/index.tsx.snap +0 -66
  1061. package/src/textarea-control/styles/textarea-control-styles.ts +0 -90
  1062. package/src/validated-form-controls/components/combobox-control.tsx +0 -56
  1063. package/src/validated-form-controls/components/form-token-field.tsx +0 -57
  1064. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +0 -56
  1065. package/src/validated-form-controls/components/stories/form-token-field.story.tsx +0 -60
  1066. package/src/validated-form-controls/components/stories/input-control.story.tsx +0 -126
  1067. package/src/validated-form-controls/components/stories/overview.story.tsx +0 -560
  1068. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +0 -50
  1069. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +0 -47
  1070. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +0 -58
  1071. package/src/validated-form-controls/components/toggle-control.tsx +0 -40
  1072. package/src/validated-form-controls/components/toggle-group-control.tsx +0 -55
  1073. package/src/validated-form-controls/control-with-error.tsx +0 -321
  1074. package/src/validated-form-controls/test/combobox-control.tsx +0 -61
  1075. package/src/validated-form-controls/test/control-with-error.tsx +0 -577
  1076. package/src/validated-form-controls/test/form-token-field.tsx +0 -52
  1077. package/src/validated-form-controls/test/toggle-control.tsx +0 -49
  1078. package/src/validated-form-controls/test/toggle-group-control.tsx +0 -28
  1079. package/src/validated-form-controls/validity-indicator.tsx +0 -40
  1080. package/src/z-stack/styles.ts +0 -35
@@ -3,7 +3,7 @@ import fastDeepEqual from "fast-deep-equal/es6/index.js";
3
3
  import { useMemo } from "@wordpress/element";
4
4
  import { __, sprintf } from "@wordpress/i18n";
5
5
  import ColorListPicker from "./color-list-picker/index.mjs";
6
- import CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from "../circular-option-picker/index.mjs";
6
+ import CircularOptionPicker, { getComputeCircularOptionPickerCommonProps, warnIfCircularOptionPickerAsButtonsIsSet } from "../circular-option-picker/index.mjs";
7
7
  import { VStack } from "../v-stack/index.mjs";
8
8
  import CustomDuotoneBar from "./custom-duotone-bar.mjs";
9
9
  import { getDefaultColors, getGradientFromCSSColors } from "./utils.mjs";
@@ -11,6 +11,7 @@ import { Spacer } from "../spacer/index.mjs";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  function DuotonePicker({
13
13
  asButtons,
14
+ presentation,
14
15
  loop,
15
16
  clearable = true,
16
17
  unsetable = true,
@@ -19,29 +20,37 @@ function DuotonePicker({
19
20
  disableCustomColors,
20
21
  disableCustomDuotone,
21
22
  value,
23
+ selectedSlug,
22
24
  onChange,
23
25
  "aria-label": ariaLabel,
24
26
  "aria-labelledby": ariaLabelledby,
25
27
  ...otherProps
26
28
  }) {
29
+ warnIfCircularOptionPickerAsButtonsIsSet("DuotonePicker", asButtons);
30
+ const {
31
+ metaProps,
32
+ labelProps,
33
+ resolvedPresentation
34
+ } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby, presentation);
27
35
  const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);
28
36
  const isUnset = value === "unset";
37
+ const isUnsetSelected = resolvedPresentation !== "command-buttons" && isUnset;
29
38
  const unsetOptionLabel = __("Unset");
30
39
  const unsetOption = /* @__PURE__ */ _jsx(CircularOptionPicker.Option, {
31
40
  value: "unset",
32
- isSelected: isUnset,
41
+ isSelected: isUnsetSelected,
33
42
  tooltipText: unsetOptionLabel,
34
43
  "aria-label": unsetOptionLabel,
35
44
  className: "components-duotone-picker__color-indicator",
36
45
  onClick: () => {
37
- onChange(isUnset ? void 0 : "unset");
46
+ onChange(isUnsetSelected ? void 0 : "unset");
38
47
  }
39
48
  }, "unset");
40
49
  const duotoneOptions = duotonePalette.map(({
41
50
  colors,
42
51
  slug,
43
52
  name
44
- }) => {
53
+ }, index) => {
45
54
  const style = {
46
55
  background: getGradientFromCSSColors(colors, "135deg"),
47
56
  color: "transparent"
@@ -56,22 +65,22 @@ function DuotonePicker({
56
65
  __("Duotone: %s"),
57
66
  name
58
67
  ) : tooltipText;
59
- const isSelected = fastDeepEqual(colors, value);
68
+ const isSelected = resolvedPresentation !== "command-buttons" && (selectedSlug ? slug === selectedSlug : fastDeepEqual(colors, value));
60
69
  return /* @__PURE__ */ _jsx(CircularOptionPicker.Option, {
61
70
  value: colors,
62
71
  isSelected,
63
72
  "aria-label": label,
64
73
  tooltipText,
65
74
  style,
66
- onClick: () => {
67
- onChange(isSelected ? void 0 : colors);
68
- }
75
+ onClick: (
76
+ // Deselecting reports no preset, matching
77
+ // `ColorPalette` and `GradientPicker`. Passing the slug
78
+ // back would leave a controlled consumer marking the
79
+ // swatch as selected after its value had been cleared.
80
+ isSelected ? () => onChange(void 0) : () => onChange(colors, index, slug)
81
+ )
69
82
  }, slug);
70
83
  });
71
- const {
72
- metaProps,
73
- labelProps
74
- } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
75
84
  const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;
76
85
  return /* @__PURE__ */ _jsx(CircularOptionPicker, {
77
86
  ...otherProps,
@@ -84,14 +93,14 @@ function DuotonePicker({
84
93
  disabled: !value,
85
94
  children: __("Clear")
86
95
  }),
87
- children: /* @__PURE__ */ _jsx(Spacer, {
96
+ children: !disableCustomDuotone && /* @__PURE__ */ _jsx(Spacer, {
88
97
  paddingTop: options.length === 0 ? 0 : 4,
89
98
  children: /* @__PURE__ */ _jsxs(VStack, {
90
99
  spacing: 3,
91
- children: [!disableCustomColors && !disableCustomDuotone && /* @__PURE__ */ _jsx(CustomDuotoneBar, {
100
+ children: [!disableCustomColors && /* @__PURE__ */ _jsx(CustomDuotoneBar, {
92
101
  value: isUnset ? void 0 : value,
93
102
  onChange
94
- }), !disableCustomDuotone && /* @__PURE__ */ _jsx(ColorListPicker, {
103
+ }), /* @__PURE__ */ _jsx(ColorListPicker, {
95
104
  labels: [__("Shadows"), __("Highlights")],
96
105
  colors: colorPalette,
97
106
  value: isUnset ? void 0 : value,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/duotone-picker/duotone-picker.tsx"],
4
- "sourcesContent": ["import fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnset,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnset ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name ?? sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n const isSelected = fastDeepEqual(colors, value);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick: () => {\n onChange(isSelected ? undefined : colors);\n }\n }, slug);\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && !disableCustomDuotone && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), !disableCustomDuotone && /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
5
- "mappings": ";AAAA,OAAO,mBAAmB;AAC1B,SAAS,eAAe;AACxB,SAAS,IAAI,eAAe;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,wBAAwB,iDAAiD;AAChF,SAAS,cAAc;AACvB,OAAO,sBAAsB;AAC7B,SAAS,kBAAkB,gCAAgC;AAC3D,SAAS,cAAc;AACvB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAkC3C,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,GAAG;AACL,GAAG;AACD,QAAM,CAAC,aAAa,YAAY,IAAI,QAAQ,MAAM,iBAAiB,YAAY,GAAG,CAAC,YAAY,CAAC;AAChG,QAAM,UAAU,UAAU;AAC1B,QAAM,mBAAmB,GAAG,OAAO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A,IACD,UAAuB,qBAAK,QAAQ;AAAA,MAClC,YAAY,QAAQ,WAAW,IAAI,IAAI;AAAA,MACvC,UAAuB,sBAAM,QAAQ;AAAA,QACnC,SAAS;AAAA,QACT,UAAU,CAAC,CAAC,uBAAuB,CAAC,wBAAqC,qBAAK,kBAAkB;AAAA,UAC9F,OAAO,UAAU,SAAY;AAAA,UAC7B;AAAA,QACF,CAAC,GAAG,CAAC,wBAAqC,qBAAK,iBAAiB;AAAA,UAC9D,QAAQ,CAAC,GAAG,SAAS,GAAG,GAAG,YAAY,CAAC;AAAA,UACxC,QAAQ;AAAA,UACR,OAAO,UAAU,SAAY;AAAA,UAC7B;AAAA,UACA,aAAa;AAAA,UACb,UAAU,eAAa;AACrB,gBAAI,CAAC,UAAU,CAAC,GAAG;AACjB,wBAAU,CAAC,IAAI;AAAA,YACjB;AACA,gBAAI,CAAC,UAAU,CAAC,GAAG;AACjB,wBAAU,CAAC,IAAI;AAAA,YACjB;AACA,kBAAM,WAAW,UAAU,UAAU,IAAI,YAAY;AAIrD,qBAAS,QAAQ;AAAA,UACnB;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["import fastDeepEqual from 'fast-deep-equal/es6/index.js';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport ColorListPicker from './color-list-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps, warnIfCircularOptionPickerAsButtonsIsSet } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport CustomDuotoneBar from './custom-duotone-bar';\nimport { getDefaultColors, getGradientFromCSSColors } from './utils';\nimport { Spacer } from '../spacer';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * ```jsx\n * import { DuotonePicker, DuotoneSwatch } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const DUOTONE_PALETTE = [\n * \t{ colors: [ '#8c00b7', '#fcff41' ], name: 'Purple and yellow', slug: 'purple-yellow' },\n * \t{ colors: [ '#000097', '#ff4747' ], name: 'Blue and red', slug: 'blue-red' },\n * ];\n *\n * const COLOR_PALETTE = [\n * \t{ color: '#ff4747', name: 'Red', slug: 'red' },\n * \t{ color: '#fcff41', name: 'Yellow', slug: 'yellow' },\n * \t{ color: '#000097', name: 'Blue', slug: 'blue' },\n * \t{ color: '#8c00b7', name: 'Purple', slug: 'purple' },\n * ];\n *\n * const Example = () => {\n * \tconst [ duotone, setDuotone ] = useState( [ '#000000', '#ffffff' ] );\n * \treturn (\n * \t\t<>\n * \t\t\t<DuotonePicker\n * \t\t\t\tduotonePalette={ DUOTONE_PALETTE }\n * \t\t\t\tcolorPalette={ COLOR_PALETTE }\n * \t\t\t\tvalue={ duotone }\n * \t\t\t\tonChange={ setDuotone }\n * \t\t\t/>\n * \t\t\t<DuotoneSwatch values={ duotone } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nfunction DuotonePicker({\n asButtons,\n presentation,\n loop,\n clearable = true,\n unsetable = true,\n colorPalette,\n duotonePalette,\n disableCustomColors,\n disableCustomDuotone,\n value,\n selectedSlug,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}) {\n warnIfCircularOptionPickerAsButtonsIsSet('DuotonePicker', asButtons);\n const {\n metaProps,\n labelProps,\n resolvedPresentation\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby, presentation);\n const [defaultDark, defaultLight] = useMemo(() => getDefaultColors(colorPalette), [colorPalette]);\n const isUnset = value === 'unset';\n const isUnsetSelected = resolvedPresentation !== 'command-buttons' && isUnset;\n const unsetOptionLabel = __('Unset');\n const unsetOption = /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: \"unset\",\n isSelected: isUnsetSelected,\n tooltipText: unsetOptionLabel,\n \"aria-label\": unsetOptionLabel,\n className: \"components-duotone-picker__color-indicator\",\n onClick: () => {\n onChange(isUnsetSelected ? undefined : 'unset');\n }\n }, \"unset\");\n const duotoneOptions = duotonePalette.map(({\n colors,\n slug,\n name\n }, index) => {\n const style = {\n background: getGradientFromCSSColors(colors, '135deg'),\n color: 'transparent'\n };\n const tooltipText = name ?? sprintf(\n // translators: %s: duotone code e.g: \"dark-grayscale\" or \"7f7f7f-ffffff\".\n __('Duotone code: %s'), slug);\n const label = name ? sprintf(\n // translators: %s: The name of the option e.g: \"Dark grayscale\".\n __('Duotone: %s'), name) : tooltipText;\n // When a non-empty selectedSlug is provided, selection is decided\n // strictly by slug, which keeps two presets holding the same\n // colors apart. Otherwise selection falls back to matching the\n // colors themselves.\n const isSelected = resolvedPresentation !== 'command-buttons' && (selectedSlug ? slug === selectedSlug : fastDeepEqual(colors, value));\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: colors,\n isSelected: isSelected,\n \"aria-label\": label,\n tooltipText: tooltipText,\n style: style,\n onClick:\n // Deselecting reports no preset, matching\n // `ColorPalette` and `GradientPicker`. Passing the slug\n // back would leave a controlled consumer marking the\n // swatch as selected after its value had been cleared.\n isSelected ? () => onChange(undefined) : () => onChange(colors, index, slug)\n }, slug);\n });\n const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions;\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...otherProps,\n ...metaProps,\n ...labelProps,\n options: options,\n actions: !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: () => onChange(undefined),\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n children: !disableCustomDuotone && /*#__PURE__*/_jsx(Spacer, {\n paddingTop: options.length === 0 ? 0 : 4,\n children: /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n children: [!disableCustomColors && /*#__PURE__*/_jsx(CustomDuotoneBar, {\n value: isUnset ? undefined : value,\n onChange: onChange\n }), /*#__PURE__*/_jsx(ColorListPicker, {\n labels: [__('Shadows'), __('Highlights')],\n colors: colorPalette,\n value: isUnset ? undefined : value,\n disableCustomColors: disableCustomColors,\n enableAlpha: true,\n onChange: newColors => {\n if (!newColors[0]) {\n newColors[0] = defaultDark;\n }\n if (!newColors[1]) {\n newColors[1] = defaultLight;\n }\n const newValue = newColors.length >= 2 ? newColors : undefined;\n // @ts-expect-error TODO: The color arrays for a DuotonePicker should be a tuple of two colors,\n // but it's currently typed as a string[].\n // See also https://github.com/WordPress/gutenberg/pull/49060#discussion_r1136951035\n onChange(newValue);\n }\n })]\n })\n })\n });\n}\nexport default DuotonePicker;"],
5
+ "mappings": ";AAAA,OAAO,mBAAmB;AAC1B,SAAS,eAAe;AACxB,SAAS,IAAI,eAAe;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,wBAAwB,2CAA2C,gDAAgD;AAC1H,SAAS,cAAc;AACvB,OAAO,sBAAsB;AAC7B,SAAS,kBAAkB,gCAAgC;AAC3D,SAAS,cAAc;AACvB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAkC3C,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,GAAG;AACL,GAAG;AACD,2CAAyC,iBAAiB,SAAS;AACnE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,0CAA0C,WAAW,MAAM,WAAW,gBAAgB,YAAY;AACtG,QAAM,CAAC,aAAa,YAAY,IAAI,QAAQ,MAAM,iBAAiB,YAAY,GAAG,CAAC,YAAY,CAAC;AAChG,QAAM,UAAU,UAAU;AAC1B,QAAM,kBAAkB,yBAAyB,qBAAqB;AACtE,QAAM,mBAAmB,GAAG,OAAO;AACnC,QAAM,cAA2B,qBAAK,qBAAqB,QAAQ;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AAQ;AAAA,MAC3D,YAAY,QAAQ,WAAW,IAAI,IAAI;AAAA,MACvC,UAAuB,sBAAM,QAAQ;AAAA,QACnC,SAAS;AAAA,QACT,UAAU,CAAC,CAAC,uBAAoC,qBAAK,kBAAkB;AAAA,UACrE,OAAO,UAAU,SAAY;AAAA,UAC7B;AAAA,QACF,CAAC,GAAgB,qBAAK,iBAAiB;AAAA,UACrC,QAAQ,CAAC,GAAG,SAAS,GAAG,GAAG,YAAY,CAAC;AAAA,UACxC,QAAQ;AAAA,UACR,OAAO,UAAU,SAAY;AAAA,UAC7B;AAAA,UACA,aAAa;AAAA,UACb,UAAU,eAAa;AACrB,gBAAI,CAAC,UAAU,CAAC,GAAG;AACjB,wBAAU,CAAC,IAAI;AAAA,YACjB;AACA,gBAAI,CAAC,UAAU,CAAC,GAAG;AACjB,wBAAU,CAAC,IAAI;AAAA,YACjB;AACA,kBAAM,WAAW,UAAU,UAAU,IAAI,YAAY;AAIrD,qBAAS,QAAQ;AAAA,UACnB;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -155,7 +155,6 @@ function FocalPointPicker({
155
155
  top: y !== void 0 ? y * bounds.height : 0.5 * bounds.height
156
156
  };
157
157
  const classes = clsx("components-focal-point-picker-control", className);
158
- const Label = hideLabelFromVision ? VisuallyHidden : StyledLabel;
159
158
  useUpdateEffect(() => {
160
159
  setShowGridOverlay(true);
161
160
  const timeout = window.setTimeout(() => {
@@ -167,10 +166,13 @@ function FocalPointPicker({
167
166
  ...restProps,
168
167
  as: "fieldset",
169
168
  className: classes,
170
- children: [!!label && /* @__PURE__ */ _jsx(Label, {
169
+ children: [!!label && (hideLabelFromVision ? /* @__PURE__ */ _jsx(VisuallyHidden, {
171
170
  as: "legend",
172
171
  children: label
173
- }), /* @__PURE__ */ _jsx(MediaWrapper, {
172
+ }) : /* @__PURE__ */ _jsx(StyledLabel, {
173
+ as: "legend",
174
+ children: label
175
+ })), /* @__PURE__ */ _jsx(MediaWrapper, {
174
176
  className: "components-focal-point-picker-wrapper",
175
177
  children: /* @__PURE__ */ _jsxs(MediaContainer, {
176
178
  className: "components-focal-point-picker",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/focal-point-picker/index.tsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __experimentalUseDragging as useDragging, useIsomorphicLayoutEffect } from '@wordpress/compose';\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport { Container, MediaWrapper, MediaContainer } from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport { StyledLabel, StyledHelp } from '../base-control/styles/base-control-styles';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * It addresses two common issues when displaying images in cropped containers. First, large\n * background images can be cropped in undesirable ways, especially on smaller viewports such as\n * mobile devices. Second, the CSS aspect-ratio property can inadvertently crop out the area of\n * highest visual interest. This component allows the selection of the point with the most\n * important visual information and returns it as a pair of numbers between 0 and 1.\n * The output value can be applied to either CSS `background-position` (for elements with\n * `background-image`) or `object-position` (for `<img>` / `<video>` elements rendered with\n * `object-fit: cover`).\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`;\n * - Corresponding CSS: `object-position: 50% 10%`;\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.1,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\twidth: '100%',\n * \t\taspectRatio: '16 / 9',\n * \t\tobjectFit: 'cover',\n * \t\tobjectPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<img src={ url } alt=\"\" style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker({\n // Prevent passing to internal component.\n __nextHasNoMarginBottom: _,\n __next40pxDefaultSize: _next40pxDefaultSize,\n autoPlay = true,\n className,\n help,\n hideLabelFromVision,\n label,\n onChange,\n onDrag,\n onDragEnd,\n onDragStart,\n resolvePoint,\n url,\n value: valueProp = {\n x: 0.5,\n y: 0.5\n },\n ...restProps\n}) {\n const [point, setPoint] = useState(valueProp);\n const [showGridOverlay, setShowGridOverlay] = useState(false);\n const {\n startDrag,\n endDrag,\n isDragging\n } = useDragging({\n onDragStart: event => {\n dragAreaRef.current?.focus();\n const value = getValueWithinDragArea(event);\n\n // `value` can technically be undefined if getValueWithinDragArea() is\n // called before dragAreaRef is set, but this shouldn't happen in reality.\n if (!value) {\n return;\n }\n onDragStart?.(value, event);\n setPoint(value);\n },\n onDragMove: event => {\n // Prevents text-selection when dragging.\n event.preventDefault();\n const value = getValueWithinDragArea(event);\n if (!value) {\n return;\n }\n onDrag?.(value, event);\n setPoint(value);\n },\n onDragEnd: () => {\n onDragEnd?.();\n onChange?.(point);\n }\n });\n\n // Uses the internal point while dragging or else the value from props.\n const {\n x,\n y\n } = isDragging ? point : valueProp;\n const dragAreaRef = useRef(null);\n const [bounds, setBounds] = useState(INITIAL_BOUNDS);\n const refUpdateBounds = useRef(() => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n clientWidth: width,\n clientHeight: height\n } = dragAreaRef.current;\n // Falls back to initial bounds if the ref has no size. Since styles\n // give the drag area dimensions even when the media has not loaded\n // this should only happen in unit tests (jsdom).\n setBounds(width > 0 && height > 0 ? {\n width,\n height\n } : {\n ...INITIAL_BOUNDS\n });\n });\n useEffect(() => {\n const updateBounds = refUpdateBounds.current;\n if (!dragAreaRef.current) {\n return;\n }\n const {\n defaultView\n } = dragAreaRef.current.ownerDocument;\n defaultView?.addEventListener('resize', updateBounds);\n return () => defaultView?.removeEventListener('resize', updateBounds);\n }, []);\n\n // Updates the bounds to cover cases of unspecified media or load failures.\n useIsomorphicLayoutEffect(() => void refUpdateBounds.current(), []);\n\n // TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n // https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n const getValueWithinDragArea = ({\n clientX,\n clientY,\n shiftKey\n }) => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n top,\n left\n } = dragAreaRef.current.getBoundingClientRect();\n let nextX = (clientX - left) / bounds.width;\n let nextY = (clientY - top) / bounds.height;\n // Enables holding shift to jump values by 10%.\n if (shiftKey) {\n nextX = Math.round(nextX / 0.1) * 0.1;\n nextY = Math.round(nextY / 0.1) * 0.1;\n }\n return getFinalValue({\n x: nextX,\n y: nextY\n });\n };\n const getFinalValue = value => {\n const resolvedValue = resolvePoint?.(value) ?? value;\n resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));\n resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));\n const roundToTwoDecimalPlaces = n => Math.round(n * 1e2) / 1e2;\n return {\n x: roundToTwoDecimalPlaces(resolvedValue.x),\n y: roundToTwoDecimalPlaces(resolvedValue.y)\n };\n };\n const arrowKeyStep = event => {\n const {\n code,\n shiftKey\n } = event;\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(code)) {\n return;\n }\n event.preventDefault();\n const value = {\n x,\n y\n };\n const step = shiftKey ? 0.1 : 0.01;\n const delta = code === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n const axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n value[axis] = value[axis] + delta;\n onChange?.(getFinalValue(value));\n };\n const focalPointPosition = {\n left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n top: y !== undefined ? y * bounds.height : 0.5 * bounds.height\n };\n const classes = clsx('components-focal-point-picker-control', className);\n const Label = hideLabelFromVision ? VisuallyHidden : StyledLabel;\n useUpdateEffect(() => {\n setShowGridOverlay(true);\n const timeout = window.setTimeout(() => {\n setShowGridOverlay(false);\n }, GRID_OVERLAY_TIMEOUT);\n return () => window.clearTimeout(timeout);\n }, [x, y]);\n return /*#__PURE__*/_jsxs(Container, {\n ...restProps,\n as: \"fieldset\",\n className: classes,\n children: [!!label && /*#__PURE__*/_jsx(Label, {\n as: \"legend\",\n children: label\n }), /*#__PURE__*/_jsx(MediaWrapper, {\n className: \"components-focal-point-picker-wrapper\",\n children: /*#__PURE__*/_jsxs(MediaContainer, {\n className: \"components-focal-point-picker\",\n onKeyDown: arrowKeyStep,\n onMouseDown: startDrag,\n onBlur: () => {\n if (isDragging) {\n endDrag();\n }\n },\n ref: dragAreaRef,\n role: \"button\",\n tabIndex: -1,\n children: [/*#__PURE__*/_jsx(Grid, {\n bounds: bounds,\n showOverlay: showGridOverlay\n }), /*#__PURE__*/_jsx(Media, {\n alt: __('Media preview'),\n autoPlay: autoPlay,\n onLoad: refUpdateBounds.current,\n src: url\n }), /*#__PURE__*/_jsx(FocalPoint, {\n ...focalPointPosition,\n isDragging: isDragging\n })]\n })\n }), /*#__PURE__*/_jsx(Controls, {\n hasHelpText: !!help,\n point: {\n x,\n y\n },\n onChange: value => {\n onChange?.(getFinalValue(value));\n }\n }), !!help && /*#__PURE__*/_jsx(StyledHelp, {\n children: help\n })]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;AACvB,WAAO,MAAM,OAAO,aAAa,OAAO;AAAA,EAC1C,GAAG,CAAC,GAAG,CAAC,CAAC;AACT,SAAoB,sBAAM,WAAW;AAAA,IACnC,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,UAAU,CAAC,CAAC,CAAC,SAAsB,qBAAK,OAAO;AAAA,MAC7C,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,GAAgB,qBAAK,cAAc;AAAA,MAClC,WAAW;AAAA,MACX,UAAuB,sBAAM,gBAAgB;AAAA,QAC3C,WAAW;AAAA,QACX,WAAW;AAAA,QACX,aAAa;AAAA,QACb,QAAQ,MAAM;AACZ,cAAI,YAAY;AACd,oBAAQ;AAAA,UACV;AAAA,QACF;AAAA,QACA,KAAK;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAc,qBAAK,MAAM;AAAA,UACjC;AAAA,UACA,aAAa;AAAA,QACf,CAAC,GAAgB,qBAAK,OAAO;AAAA,UAC3B,KAAK,GAAG,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ,gBAAgB;AAAA,UACxB,KAAK;AAAA,QACP,CAAC,GAAgB,qBAAK,YAAY;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC,GAAgB,qBAAK,UAAU;AAAA,MAC9B,aAAa,CAAC,CAAC;AAAA,MACf,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU,WAAS;AACjB,mBAAW,cAAc,KAAK,CAAC;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,CAAC,CAAC,QAAqB,qBAAK,YAAY;AAAA,MAC1C,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,6BAAQ;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __experimentalUseDragging as useDragging, useIsomorphicLayoutEffect } from '@wordpress/compose';\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport { Container, MediaWrapper, MediaContainer } from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport { StyledLabel, StyledHelp } from '../base-control/styles/base-control-styles';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * It addresses two common issues when displaying images in cropped containers. First, large\n * background images can be cropped in undesirable ways, especially on smaller viewports such as\n * mobile devices. Second, the CSS aspect-ratio property can inadvertently crop out the area of\n * highest visual interest. This component allows the selection of the point with the most\n * important visual information and returns it as a pair of numbers between 0 and 1.\n * The output value can be applied to either CSS `background-position` (for elements with\n * `background-image`) or `object-position` (for `<img>` / `<video>` elements rendered with\n * `object-fit: cover`).\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`;\n * - Corresponding CSS: `object-position: 50% 10%`;\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.1,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\twidth: '100%',\n * \t\taspectRatio: '16 / 9',\n * \t\tobjectFit: 'cover',\n * \t\tobjectPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<img src={ url } alt=\"\" style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker({\n // Prevent passing to internal component.\n __nextHasNoMarginBottom: _,\n __next40pxDefaultSize: _next40pxDefaultSize,\n autoPlay = true,\n className,\n help,\n hideLabelFromVision,\n label,\n onChange,\n onDrag,\n onDragEnd,\n onDragStart,\n resolvePoint,\n url,\n value: valueProp = {\n x: 0.5,\n y: 0.5\n },\n ...restProps\n}) {\n const [point, setPoint] = useState(valueProp);\n const [showGridOverlay, setShowGridOverlay] = useState(false);\n const {\n startDrag,\n endDrag,\n isDragging\n } = useDragging({\n onDragStart: event => {\n dragAreaRef.current?.focus();\n const value = getValueWithinDragArea(event);\n\n // `value` can technically be undefined if getValueWithinDragArea() is\n // called before dragAreaRef is set, but this shouldn't happen in reality.\n if (!value) {\n return;\n }\n onDragStart?.(value, event);\n setPoint(value);\n },\n onDragMove: event => {\n // Prevents text-selection when dragging.\n event.preventDefault();\n const value = getValueWithinDragArea(event);\n if (!value) {\n return;\n }\n onDrag?.(value, event);\n setPoint(value);\n },\n onDragEnd: () => {\n onDragEnd?.();\n onChange?.(point);\n }\n });\n\n // Uses the internal point while dragging or else the value from props.\n const {\n x,\n y\n } = isDragging ? point : valueProp;\n const dragAreaRef = useRef(null);\n const [bounds, setBounds] = useState(INITIAL_BOUNDS);\n const refUpdateBounds = useRef(() => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n clientWidth: width,\n clientHeight: height\n } = dragAreaRef.current;\n // Falls back to initial bounds if the ref has no size. Since styles\n // give the drag area dimensions even when the media has not loaded\n // this should only happen in unit tests (jsdom).\n setBounds(width > 0 && height > 0 ? {\n width,\n height\n } : {\n ...INITIAL_BOUNDS\n });\n });\n useEffect(() => {\n const updateBounds = refUpdateBounds.current;\n if (!dragAreaRef.current) {\n return;\n }\n const {\n defaultView\n } = dragAreaRef.current.ownerDocument;\n defaultView?.addEventListener('resize', updateBounds);\n return () => defaultView?.removeEventListener('resize', updateBounds);\n }, []);\n\n // Updates the bounds to cover cases of unspecified media or load failures.\n useIsomorphicLayoutEffect(() => void refUpdateBounds.current(), []);\n\n // TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n // https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n const getValueWithinDragArea = ({\n clientX,\n clientY,\n shiftKey\n }) => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n top,\n left\n } = dragAreaRef.current.getBoundingClientRect();\n let nextX = (clientX - left) / bounds.width;\n let nextY = (clientY - top) / bounds.height;\n // Enables holding shift to jump values by 10%.\n if (shiftKey) {\n nextX = Math.round(nextX / 0.1) * 0.1;\n nextY = Math.round(nextY / 0.1) * 0.1;\n }\n return getFinalValue({\n x: nextX,\n y: nextY\n });\n };\n const getFinalValue = value => {\n const resolvedValue = resolvePoint?.(value) ?? value;\n resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));\n resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));\n const roundToTwoDecimalPlaces = n => Math.round(n * 1e2) / 1e2;\n return {\n x: roundToTwoDecimalPlaces(resolvedValue.x),\n y: roundToTwoDecimalPlaces(resolvedValue.y)\n };\n };\n const arrowKeyStep = event => {\n const {\n code,\n shiftKey\n } = event;\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(code)) {\n return;\n }\n event.preventDefault();\n const value = {\n x,\n y\n };\n const step = shiftKey ? 0.1 : 0.01;\n const delta = code === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n const axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n value[axis] = value[axis] + delta;\n onChange?.(getFinalValue(value));\n };\n const focalPointPosition = {\n left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n top: y !== undefined ? y * bounds.height : 0.5 * bounds.height\n };\n const classes = clsx('components-focal-point-picker-control', className);\n useUpdateEffect(() => {\n setShowGridOverlay(true);\n const timeout = window.setTimeout(() => {\n setShowGridOverlay(false);\n }, GRID_OVERLAY_TIMEOUT);\n return () => window.clearTimeout(timeout);\n }, [x, y]);\n return /*#__PURE__*/_jsxs(Container, {\n ...restProps,\n as: \"fieldset\",\n className: classes,\n children: [!!label && (hideLabelFromVision ? /*#__PURE__*/_jsx(VisuallyHidden, {\n as: \"legend\",\n children: label\n }) : /*#__PURE__*/_jsx(StyledLabel, {\n as: \"legend\",\n children: label\n })), /*#__PURE__*/_jsx(MediaWrapper, {\n className: \"components-focal-point-picker-wrapper\",\n children: /*#__PURE__*/_jsxs(MediaContainer, {\n className: \"components-focal-point-picker\",\n onKeyDown: arrowKeyStep,\n onMouseDown: startDrag,\n onBlur: () => {\n if (isDragging) {\n endDrag();\n }\n },\n ref: dragAreaRef,\n role: \"button\",\n tabIndex: -1,\n children: [/*#__PURE__*/_jsx(Grid, {\n bounds: bounds,\n showOverlay: showGridOverlay\n }), /*#__PURE__*/_jsx(Media, {\n alt: __('Media preview'),\n autoPlay: autoPlay,\n onLoad: refUpdateBounds.current,\n src: url\n }), /*#__PURE__*/_jsx(FocalPoint, {\n ...focalPointPosition,\n isDragging: isDragging\n })]\n })\n }), /*#__PURE__*/_jsx(Controls, {\n hasHelpText: !!help,\n point: {\n x,\n y\n },\n onChange: value => {\n onChange?.(getFinalValue(value));\n }\n }), !!help && /*#__PURE__*/_jsx(StyledHelp, {\n children: help\n })]\n });\n}\nexport default FocalPointPicker;"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,UAAU;AACnB,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,6BAA6B,aAAa,iCAAiC;AACpF,OAAO,cAAc;AACrB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,WAAW,cAAc,sBAAsB;AACxD,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,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AAA,IACZ,CAAC,IAAiB,qBAAK,cAAc;AAAA,MACnC,WAAW;AAAA,MACX,UAAuB,sBAAM,gBAAgB;AAAA,QAC3C,WAAW;AAAA,QACX,WAAW;AAAA,QACX,aAAa;AAAA,QACb,QAAQ,MAAM;AACZ,cAAI,YAAY;AACd,oBAAQ;AAAA,UACV;AAAA,QACF;AAAA,QACA,KAAK;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAc,qBAAK,MAAM;AAAA,UACjC;AAAA,UACA,aAAa;AAAA,QACf,CAAC,GAAgB,qBAAK,OAAO;AAAA,UAC3B,KAAK,GAAG,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ,gBAAgB;AAAA,UACxB,KAAK;AAAA,QACP,CAAC,GAAgB,qBAAK,YAAY;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC,GAAgB,qBAAK,UAAU;AAAA,MAC9B,aAAa,CAAC,CAAC;AAAA,MACf,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU,WAAS;AACjB,mBAAW,cAAc,KAAK,CAAC;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,CAAC,CAAC,QAAqB,qBAAK,YAAY;AAAA,MAC1C,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,6BAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,10 +2,95 @@
2
2
  import { __, sprintf } from "@wordpress/i18n";
3
3
  import { useInstanceId } from "@wordpress/compose";
4
4
  import { useCallback, useMemo } from "@wordpress/element";
5
- import CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from "../circular-option-picker/index.mjs";
5
+ import CircularOptionPicker, { getComputeCircularOptionPickerCommonProps, warnIfCircularOptionPickerAsButtonsIsSet } from "../circular-option-picker/index.mjs";
6
6
  import CustomGradientPicker from "../custom-gradient-picker/index.mjs";
7
7
  import { VStack } from "../v-stack/index.mjs";
8
- import { ColorHeading } from "../color-palette/styles.mjs";
8
+ import { Heading } from "../heading/index.mjs";
9
+
10
+ // packages/style-runtime/src/index.ts
11
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
12
+ function getRuntime() {
13
+ const globalScope = globalThis;
14
+ if (globalScope.__wpStyleRuntime) {
15
+ return globalScope.__wpStyleRuntime;
16
+ }
17
+ globalScope.__wpStyleRuntime = {
18
+ documents: /* @__PURE__ */ new Map(),
19
+ styles: /* @__PURE__ */ new Map(),
20
+ injectedStyles: /* @__PURE__ */ new WeakMap()
21
+ };
22
+ if (typeof document !== "undefined") {
23
+ registerDocument(document);
24
+ }
25
+ return globalScope.__wpStyleRuntime;
26
+ }
27
+ function documentContainsStyleHash(targetDocument, hash) {
28
+ if (!targetDocument.head) {
29
+ return false;
30
+ }
31
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
32
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
33
+ return true;
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+ function injectStyle(targetDocument, hash, css) {
39
+ if (!targetDocument.head) {
40
+ return;
41
+ }
42
+ const runtime = getRuntime();
43
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
44
+ if (!injectedStyles) {
45
+ injectedStyles = /* @__PURE__ */ new Set();
46
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
47
+ }
48
+ if (injectedStyles.has(hash)) {
49
+ return;
50
+ }
51
+ if (documentContainsStyleHash(targetDocument, hash)) {
52
+ injectedStyles.add(hash);
53
+ return;
54
+ }
55
+ const style = targetDocument.createElement("style");
56
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
57
+ style.appendChild(targetDocument.createTextNode(css));
58
+ targetDocument.head.appendChild(style);
59
+ injectedStyles.add(hash);
60
+ }
61
+ function registerDocument(targetDocument) {
62
+ const runtime = getRuntime();
63
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
64
+ for (const [hash, css] of runtime.styles) {
65
+ injectStyle(targetDocument, hash, css);
66
+ }
67
+ return () => {
68
+ const count = runtime.documents.get(targetDocument);
69
+ if (count === void 0) {
70
+ return;
71
+ }
72
+ if (count <= 1) {
73
+ runtime.documents.delete(targetDocument);
74
+ return;
75
+ }
76
+ runtime.documents.set(targetDocument, count - 1);
77
+ };
78
+ }
79
+ function registerStyle(hash, css) {
80
+ const runtime = getRuntime();
81
+ runtime.styles.set(hash, css);
82
+ for (const targetDocument of runtime.documents.keys()) {
83
+ injectStyle(targetDocument, hash, css);
84
+ }
85
+ }
86
+
87
+ // packages/components/src/color-palette/style.module.scss
88
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
89
+ registerStyle("a7b05d56c7", ".cf6db1948d5273a8__color-heading{text-transform:uppercase}.cf6db1948d5273a8__color-heading.cf6db1948d5273a8__color-heading.cf6db1948d5273a8__color-heading{font-size:11px;line-height:24px;margin-bottom:0}");
90
+ }
91
+ var style_module_default = { "color-heading": "cf6db1948d5273a8__color-heading" };
92
+
93
+ // packages/components/src/gradient-picker/index.tsx
9
94
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
95
  var isMultipleOriginObject = (obj) => Array.isArray(obj.gradients) && !("gradient" in obj);
11
96
  var isMultipleOriginArray = (arr) => {
@@ -18,6 +103,7 @@ function SingleOrigin({
18
103
  onChange,
19
104
  value,
20
105
  selectedSlug,
106
+ presentation,
21
107
  ...additionalProps
22
108
  }) {
23
109
  const gradientOptions = useMemo(() => {
@@ -26,7 +112,7 @@ function SingleOrigin({
26
112
  name,
27
113
  slug
28
114
  }, index) => {
29
- const isSelected = selectedSlug ? slug === selectedSlug : value === gradient;
115
+ const isSelected = presentation !== "command-buttons" && (selectedSlug ? slug === selectedSlug : value === gradient);
30
116
  return /* @__PURE__ */ _jsx(CircularOptionPicker.Option, {
31
117
  value: gradient,
32
118
  isSelected,
@@ -46,7 +132,7 @@ function SingleOrigin({
46
132
  )
47
133
  }, slug);
48
134
  });
49
- }, [gradients, value, onChange, clearGradient, selectedSlug]);
135
+ }, [gradients, value, onChange, clearGradient, selectedSlug, presentation]);
50
136
  return /* @__PURE__ */ _jsx(CircularOptionPicker.OptionGroup, {
51
137
  className,
52
138
  options: gradientOptions,
@@ -60,7 +146,8 @@ function MultipleOrigin({
60
146
  onChange,
61
147
  value,
62
148
  selectedSlug,
63
- headingLevel
149
+ headingLevel,
150
+ presentation
64
151
  }) {
65
152
  const instanceId = useInstanceId(MultipleOrigin);
66
153
  return /* @__PURE__ */ _jsx(VStack, {
@@ -73,7 +160,8 @@ function MultipleOrigin({
73
160
  const id = `color-palette-${instanceId}-${index}`;
74
161
  return /* @__PURE__ */ _jsxs(VStack, {
75
162
  spacing: 2,
76
- children: [/* @__PURE__ */ _jsx(ColorHeading, {
163
+ children: [/* @__PURE__ */ _jsx(Heading, {
164
+ className: style_module_default["color-heading"],
77
165
  level: headingLevel,
78
166
  id,
79
167
  children: name
@@ -83,6 +171,7 @@ function MultipleOrigin({
83
171
  onChange: (gradient, _index, slug) => onChange(gradient, index, slug),
84
172
  value,
85
173
  selectedSlug,
174
+ presentation,
86
175
  "aria-labelledby": id
87
176
  })]
88
177
  }, index);
@@ -92,6 +181,7 @@ function MultipleOrigin({
92
181
  function Component(props) {
93
182
  const {
94
183
  asButtons,
184
+ presentation,
95
185
  loop,
96
186
  actions,
97
187
  headingLevel,
@@ -99,16 +189,20 @@ function Component(props) {
99
189
  "aria-labelledby": ariaLabelledby,
100
190
  ...additionalProps
101
191
  } = props;
192
+ warnIfCircularOptionPickerAsButtonsIsSet("GradientPicker", asButtons);
193
+ const {
194
+ metaProps,
195
+ labelProps,
196
+ resolvedPresentation
197
+ } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby, presentation);
102
198
  const options = isMultipleOriginArray(props.gradients) ? /* @__PURE__ */ _jsx(MultipleOrigin, {
103
199
  headingLevel,
104
- ...additionalProps
200
+ ...additionalProps,
201
+ presentation: resolvedPresentation
105
202
  }) : /* @__PURE__ */ _jsx(SingleOrigin, {
106
- ...additionalProps
203
+ ...additionalProps,
204
+ presentation: resolvedPresentation
107
205
  });
108
- const {
109
- metaProps,
110
- labelProps
111
- } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
112
206
  return /* @__PURE__ */ _jsx(CircularOptionPicker, {
113
207
  ...metaProps,
114
208
  ...labelProps,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/gradient-picker/index.tsx"],
4
- "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { VStack } from '../v-stack';\nimport { ColorHeading } from '../color-palette/styles';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// The Multiple Origin Gradients have a `gradients` property (an array of\n// gradient objects), while Single Origin ones have a `gradient` property.\nconst isMultipleOriginObject = obj => Array.isArray(obj.gradients) && !('gradient' in obj);\nconst isMultipleOriginArray = arr => {\n return arr.length > 0 && arr.every(gradientObj => isMultipleOriginObject(gradientObj));\n};\nfunction SingleOrigin({\n className,\n clearGradient,\n gradients,\n onChange,\n value,\n selectedSlug,\n ...additionalProps\n}) {\n const gradientOptions = useMemo(() => {\n return gradients.map(({\n gradient,\n name,\n slug\n }, index) => {\n // When a non-empty selectedSlug is provided, selection is decided\n // strictly by slug, which keeps two entries with the same gradient\n // value apart. Otherwise selection falls back to matching the\n // gradient value.\n const isSelected = selectedSlug ? slug === selectedSlug : value === gradient;\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: gradient,\n isSelected: isSelected,\n tooltipText: name ||\n // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n sprintf(__('Gradient code: %s'), gradient),\n style: {\n color: 'rgba( 0,0,0,0 )',\n background: gradient\n },\n onClick: isSelected ? clearGradient : () => onChange(gradient, index, slug),\n \"aria-label\": name ?\n // translators: %s: The name of the gradient e.g: \"Angular red to blue\".\n sprintf(__('Gradient: %s'), name) :\n // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n sprintf(__('Gradient code: %s'), gradient)\n }, slug);\n });\n }, [gradients, value, onChange, clearGradient, selectedSlug]);\n return /*#__PURE__*/_jsx(CircularOptionPicker.OptionGroup, {\n className: className,\n options: gradientOptions,\n ...additionalProps\n });\n}\nfunction MultipleOrigin({\n className,\n clearGradient,\n gradients,\n onChange,\n value,\n selectedSlug,\n headingLevel\n}) {\n const instanceId = useInstanceId(MultipleOrigin);\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n className: className,\n children: gradients.map(({\n name,\n gradients: gradientSet\n }, index) => {\n const id = `color-palette-${instanceId}-${index}`;\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 2,\n children: [/*#__PURE__*/_jsx(ColorHeading, {\n level: headingLevel,\n id: id,\n children: name\n }), /*#__PURE__*/_jsx(SingleOrigin, {\n clearGradient: clearGradient,\n gradients: gradientSet,\n onChange: (gradient, _index, slug) => onChange(gradient, index, slug),\n value: value,\n selectedSlug: selectedSlug,\n \"aria-labelledby\": id\n })]\n }, index);\n })\n });\n}\nfunction Component(props) {\n const {\n asButtons,\n loop,\n actions,\n headingLevel,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...additionalProps\n } = props;\n const options = isMultipleOriginArray(props.gradients) ? /*#__PURE__*/_jsx(MultipleOrigin, {\n headingLevel: headingLevel,\n ...additionalProps\n }) : /*#__PURE__*/_jsx(SingleOrigin, {\n ...additionalProps\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...metaProps,\n ...labelProps,\n actions: actions,\n options: options\n });\n}\n\n/**\n * GradientPicker is a React component that renders a color gradient picker to\n * define a multi step gradient. There's either a _linear_ or a _radial_ type\n * available.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { GradientPicker } from '@wordpress/components';\n *\n * const MyGradientPicker = () => {\n * const [ gradient, setGradient ] = useState( null );\n *\n * return (\n * <GradientPicker\n * value={ gradient }\n * onChange={ ( currentGradient ) => setGradient( currentGradient ) }\n * gradients={ [\n * {\n * name: 'JShine',\n * gradient:\n * 'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',\n * slug: 'jshine',\n * },\n * {\n * name: 'Moonlit Asteroid',\n * gradient:\n * 'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',\n * slug: 'moonlit-asteroid',\n * },\n * {\n * name: 'Rastafarie',\n * gradient:\n * 'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',\n * slug: 'rastafari',\n * },\n * ] }\n * />\n * );\n * };\n *```\n *\n */\nexport function GradientPicker({\n className,\n gradients = [],\n onChange,\n value,\n clearable = true,\n enableAlpha = true,\n disableCustomGradients = false,\n __experimentalIsRenderedInSidebar,\n headingLevel = 2,\n ...additionalProps\n}) {\n const clearGradient = useCallback(() => onChange(undefined), [onChange]);\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: gradients.length ? 4 : 0,\n children: [!disableCustomGradients && /*#__PURE__*/_jsx(CustomGradientPicker, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n enableAlpha: enableAlpha,\n value: value,\n onChange: onChange\n }), (gradients.length > 0 || clearable) && /*#__PURE__*/_jsx(Component, {\n ...additionalProps,\n className: className,\n clearGradient: clearGradient,\n gradients: gradients,\n onChange: onChange,\n value: value,\n actions: clearable && !disableCustomGradients && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: clearGradient,\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n headingLevel: headingLevel\n })]\n });\n}\nexport default GradientPicker;"],
5
- "mappings": ";AAAA,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,aAAa,eAAe;AACrC,OAAO,wBAAwB,iDAAiD;AAChF,OAAO,0BAA0B;AACjC,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,OAAO,MAAM,QAAQ,aAAa;AAG3C,IAAM,yBAAyB,SAAO,MAAM,QAAQ,IAAI,SAAS,KAAK,EAAE,cAAc;AACtF,IAAM,wBAAwB,SAAO;AACnC,SAAO,IAAI,SAAS,KAAK,IAAI,MAAM,iBAAe,uBAAuB,WAAW,CAAC;AACvF;AACA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,kBAAkB,QAAQ,MAAM;AACpC,WAAO,UAAU,IAAI,CAAC;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,IACF,GAAG,UAAU;AAKX,YAAM,aAAa,eAAe,SAAS,eAAe,UAAU;AACpE,aAAoB,qBAAK,qBAAqB,QAAQ;AAAA,QACpD,OAAO;AAAA,QACP;AAAA,QACA,aAAa;AAAA,QAEb,QAAQ,GAAG,mBAAmB,GAAG,QAAQ;AAAA,QACzC,OAAO;AAAA,UACL,OAAO;AAAA,UACP,YAAY;AAAA,QACd;AAAA,QACA,SAAS,aAAa,gBAAgB,MAAM,SAAS,UAAU,OAAO,IAAI;AAAA,QAC1E,cAAc;AAAA;AAAA,UAEd,QAAQ,GAAG,cAAc,GAAG,IAAI;AAAA;AAAA;AAAA,UAEhC,QAAQ,GAAG,mBAAmB,GAAG,QAAQ;AAAA;AAAA,MAC3C,GAAG,IAAI;AAAA,IACT,CAAC;AAAA,EACH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AA0C,WAAW,MAAM,WAAW,cAAc;AACxF,SAAoB,qBAAK,sBAAsB;AAAA,IAC7C,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACF,CAAC;AACH;AA4CO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,yBAAyB;AAAA,EACzB;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,GAAG;AACD,QAAM,gBAAgB,YAAY,MAAM,SAAS,MAAS,GAAG,CAAC,QAAQ,CAAC;AACvE,SAAoB,sBAAM,QAAQ;AAAA,IAChC,SAAS,UAAU,SAAS,IAAI;AAAA,IAChC,UAAU,CAAC,CAAC,0BAAuC,qBAAK,sBAAsB;AAAA,MAC5E;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC,IAAI,UAAU,SAAS,KAAK,cAA2B,qBAAK,WAAW;AAAA,MACtE,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,aAAa,CAAC,0BAAuC,qBAAK,qBAAqB,cAAc;AAAA,QACpG,SAAS;AAAA,QACT,wBAAwB;AAAA,QACxB,UAAU,CAAC;AAAA,QACX,UAAU,GAAG,OAAO;AAAA,MACtB,CAAC;AAAA,MACD;AAAA,IACF,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,0BAAQ;",
3
+ "sources": ["../../src/gradient-picker/index.tsx", "../../../style-runtime/src/index.ts", "../../src/color-palette/style.module.scss"],
4
+ "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps, warnIfCircularOptionPickerAsButtonsIsSet } from '../circular-option-picker';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { VStack } from '../v-stack';\nimport { Heading } from '../heading';\nimport colorPaletteStyles from '../color-palette/style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// The Multiple Origin Gradients have a `gradients` property (an array of\n// gradient objects), while Single Origin ones have a `gradient` property.\nconst isMultipleOriginObject = obj => Array.isArray(obj.gradients) && !('gradient' in obj);\nconst isMultipleOriginArray = arr => {\n return arr.length > 0 && arr.every(gradientObj => isMultipleOriginObject(gradientObj));\n};\nfunction SingleOrigin({\n className,\n clearGradient,\n gradients,\n onChange,\n value,\n selectedSlug,\n presentation,\n ...additionalProps\n}) {\n const gradientOptions = useMemo(() => {\n return gradients.map(({\n gradient,\n name,\n slug\n }, index) => {\n // When a non-empty selectedSlug is provided, selection is decided\n // strictly by slug, which keeps two entries with the same gradient\n // value apart. Otherwise selection falls back to matching the\n // gradient value.\n const isSelected = presentation !== 'command-buttons' && (selectedSlug ? slug === selectedSlug : value === gradient);\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n value: gradient,\n isSelected: isSelected,\n tooltipText: name ||\n // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n sprintf(__('Gradient code: %s'), gradient),\n style: {\n color: 'rgba( 0,0,0,0 )',\n background: gradient\n },\n onClick: isSelected ? clearGradient : () => onChange(gradient, index, slug),\n \"aria-label\": name ?\n // translators: %s: The name of the gradient e.g: \"Angular red to blue\".\n sprintf(__('Gradient: %s'), name) :\n // translators: %s: gradient code e.g: \"linear-gradient(90deg, rgba(98,16,153,1) 0%, rgba(172,110,22,1) 100%);\".\n sprintf(__('Gradient code: %s'), gradient)\n }, slug);\n });\n }, [gradients, value, onChange, clearGradient, selectedSlug, presentation]);\n return /*#__PURE__*/_jsx(CircularOptionPicker.OptionGroup, {\n className: className,\n options: gradientOptions,\n ...additionalProps\n });\n}\nfunction MultipleOrigin({\n className,\n clearGradient,\n gradients,\n onChange,\n value,\n selectedSlug,\n headingLevel,\n presentation\n}) {\n const instanceId = useInstanceId(MultipleOrigin);\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n className: className,\n children: gradients.map(({\n name,\n gradients: gradientSet\n }, index) => {\n const id = `color-palette-${instanceId}-${index}`;\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 2,\n children: [/*#__PURE__*/_jsx(Heading, {\n className: colorPaletteStyles['color-heading'],\n level: headingLevel,\n id: id,\n children: name\n }), /*#__PURE__*/_jsx(SingleOrigin, {\n clearGradient: clearGradient,\n gradients: gradientSet,\n onChange: (gradient, _index, slug) => onChange(gradient, index, slug),\n value: value,\n selectedSlug: selectedSlug,\n presentation: presentation,\n \"aria-labelledby\": id\n })]\n }, index);\n })\n });\n}\nfunction Component(props) {\n const {\n asButtons,\n presentation,\n loop,\n actions,\n headingLevel,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...additionalProps\n } = props;\n warnIfCircularOptionPickerAsButtonsIsSet('GradientPicker', asButtons);\n const {\n metaProps,\n labelProps,\n resolvedPresentation\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby, presentation);\n const options = isMultipleOriginArray(props.gradients) ? /*#__PURE__*/_jsx(MultipleOrigin, {\n headingLevel: headingLevel,\n ...additionalProps,\n presentation: resolvedPresentation\n }) : /*#__PURE__*/_jsx(SingleOrigin, {\n ...additionalProps,\n presentation: resolvedPresentation\n });\n return /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...metaProps,\n ...labelProps,\n actions: actions,\n options: options\n });\n}\n\n/**\n * GradientPicker is a React component that renders a color gradient picker to\n * define a multi step gradient. There's either a _linear_ or a _radial_ type\n * available.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { GradientPicker } from '@wordpress/components';\n *\n * const MyGradientPicker = () => {\n * const [ gradient, setGradient ] = useState( null );\n *\n * return (\n * <GradientPicker\n * value={ gradient }\n * onChange={ ( currentGradient ) => setGradient( currentGradient ) }\n * gradients={ [\n * {\n * name: 'JShine',\n * gradient:\n * 'linear-gradient(135deg,#12c2e9 0%,#c471ed 50%,#f64f59 100%)',\n * slug: 'jshine',\n * },\n * {\n * name: 'Moonlit Asteroid',\n * gradient:\n * 'linear-gradient(135deg,#0F2027 0%, #203A43 0%, #2c5364 100%)',\n * slug: 'moonlit-asteroid',\n * },\n * {\n * name: 'Rastafarie',\n * gradient:\n * 'linear-gradient(135deg,#1E9600 0%, #FFF200 0%, #FF0000 100%)',\n * slug: 'rastafari',\n * },\n * ] }\n * />\n * );\n * };\n *```\n *\n */\nexport function GradientPicker({\n className,\n gradients = [],\n onChange,\n value,\n clearable = true,\n enableAlpha = true,\n disableCustomGradients = false,\n __experimentalIsRenderedInSidebar,\n headingLevel = 2,\n ...additionalProps\n}) {\n const clearGradient = useCallback(() => onChange(undefined), [onChange]);\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: gradients.length ? 4 : 0,\n children: [!disableCustomGradients && /*#__PURE__*/_jsx(CustomGradientPicker, {\n __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,\n enableAlpha: enableAlpha,\n value: value,\n onChange: onChange\n }), (gradients.length > 0 || clearable) && /*#__PURE__*/_jsx(Component, {\n ...additionalProps,\n className: className,\n clearGradient: clearGradient,\n gradients: gradients,\n onChange: onChange,\n value: value,\n actions: clearable && !disableCustomGradients && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: clearGradient,\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n }),\n headingLevel: headingLevel\n })]\n });\n}\nexport default GradientPicker;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"a7b05d56c7\", \".cf6db1948d5273a8__color-heading{text-transform:uppercase}.cf6db1948d5273a8__color-heading.cf6db1948d5273a8__color-heading.cf6db1948d5273a8__color-heading{font-size:11px;line-height:24px;margin-bottom:0}\");\n}\nexport default {\"color-heading\":\"cf6db1948d5273a8__color-heading\"};\n"],
5
+ "mappings": ";AAAA,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,aAAa,eAAe;AACrC,OAAO,wBAAwB,2CAA2C,gDAAgD;AAC1H,OAAO,0BAA0B;AACjC,SAAS,cAAc;AACvB,SAAS,eAAe;;;ACNxB,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa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AACH;AACA,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -140,6 +140,7 @@ function InputField({
140
140
  ...props,
141
141
  ...dragProps,
142
142
  className: "components-input-control__input",
143
+ "data-empty-value": value ? void 0 : "",
143
144
  disabled,
144
145
  dragCursor,
145
146
  isDragging,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/input-control/input-field.tsx"],
4
- "sourcesContent": ["import { useDrag } from '@use-gesture/react';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { withIgnoreIMEEvents } from '@wordpress/keycodes';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction InputField({\n disabled = false,\n dragDirection = 'n',\n dragThreshold = 10,\n id,\n isDragEnabled = false,\n isPressEnterToChange = false,\n onBlur = noop,\n onChange = noop,\n onDrag = noop,\n onDragEnd = noop,\n onDragStart = noop,\n onKeyDown = noop,\n onValidate = noop,\n size = 'default',\n stateReducer = state => state,\n value: valueProp,\n type,\n ...props\n}, ref) {\n const {\n // State.\n state,\n // Actions.\n change,\n commit,\n drag,\n dragEnd,\n dragStart,\n invalidate,\n pressDown,\n pressEnter,\n pressUp,\n reset\n } = useInputControlStateReducer(stateReducer, {\n isDragEnabled,\n value: valueProp,\n isPressEnterToChange\n }, onChange);\n const {\n value,\n isDragging,\n isDirty\n } = state;\n const wasDirtyOnBlur = useRef(false);\n const dragCursor = useDragCursor(isDragging, dragDirection);\n const handleOnBlur = event => {\n onBlur(event);\n\n /**\n * If isPressEnterToChange is set, this commits the value to\n * the onChange callback.\n */\n if (isDirty || !event.target.validity.valid) {\n wasDirtyOnBlur.current = true;\n handleOnCommit(event);\n }\n };\n const handleOnChange = event => {\n const nextValue = event.target.value;\n change(nextValue, event);\n };\n const handleOnCommit = event => {\n const nextValue = event.currentTarget.value;\n try {\n onValidate(nextValue);\n commit(nextValue, event);\n } catch (err) {\n invalidate(err, event);\n }\n };\n const handleOnKeyDown = event => {\n const {\n key\n } = event;\n onKeyDown(event);\n switch (key) {\n case 'ArrowUp':\n pressUp(event);\n break;\n case 'ArrowDown':\n pressDown(event);\n break;\n case 'Enter':\n pressEnter(event);\n if (isPressEnterToChange) {\n event.preventDefault();\n handleOnCommit(event);\n }\n break;\n case 'Escape':\n if (isPressEnterToChange && isDirty) {\n event.preventDefault();\n reset(valueProp, event);\n }\n break;\n }\n };\n const dragGestureProps = useDrag(dragProps => {\n const {\n distance,\n dragging,\n event,\n target\n } = dragProps;\n\n // The `target` prop always references the `input` element while, by\n // default, the `dragProps.event.target` property would reference the real\n // event target (i.e. any DOM element that the pointer is hovering while\n // dragging). Ensuring that the `target` is always the `input` element\n // allows consumers of `InputControl` (or any higher-level control) to\n // check the input's validity by accessing `event.target.validity.valid`.\n dragProps.event = {\n ...dragProps.event,\n target\n };\n if (!distance) {\n return;\n }\n event.stopPropagation();\n\n /**\n * Quick return if no longer dragging.\n * This prevents unnecessary value calculations.\n */\n if (!dragging) {\n onDragEnd(dragProps);\n dragEnd(dragProps);\n return;\n }\n onDrag(dragProps);\n drag(dragProps);\n if (!isDragging) {\n onDragStart(dragProps);\n dragStart(dragProps);\n }\n }, {\n axis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n threshold: dragThreshold,\n enabled: isDragEnabled,\n pointer: {\n capture: false\n }\n });\n const dragProps = isDragEnabled ? dragGestureProps() : {};\n return /*#__PURE__*/_jsx(Input, {\n ...props,\n ...dragProps,\n className: \"components-input-control__input\",\n disabled: disabled,\n dragCursor: dragCursor,\n isDragging: isDragging,\n id: id,\n onBlur: handleOnBlur,\n onChange: handleOnChange,\n onKeyDown: withIgnoreIMEEvents(handleOnKeyDown),\n ref: ref,\n inputSize: size\n // Fallback to `''` to avoid \"uncontrolled to controlled\" warning.\n // See https://github.com/WordPress/gutenberg/pull/47250 for details.\n ,\n value: value ?? '',\n type: type\n });\n}\nconst ForwardedComponent = forwardRef(InputField);\nexport default ForwardedComponent;"],
5
- "mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,YAAY,cAAc;AACnC,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AACtB,SAAS,mCAAmC;AAC5C,SAAS,OAAO,YAAY;AAC5B,IAAM,OAAO,MAAM;AAAC;AACpB,SAAS,WAAW;AAAA,EAClB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB;AAAA,EACA,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe,WAAS;AAAA,EACxB,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AACN,QAAM;AAAA;AAAA,IAEJ;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,4BAA4B,cAAc;AAAA,IAC5C;AAAA,IACA,OAAO;AAAA,IACP;AAAA,EACF,GAAG,QAAQ;AACX,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,iBAAiB,OAAO,KAAK;AACnC,QAAM,aAAa,cAAc,YAAY,aAAa;AAC1D,QAAM,eAAe,WAAS;AAC5B,WAAO,KAAK;AAMZ,QAAI,WAAW,CAAC,MAAM,OAAO,SAAS,OAAO;AAC3C,qBAAe,UAAU;AACzB,qBAAe,KAAK;AAAA,IACtB;AAAA,EACF;AACA,QAAM,iBAAiB,WAAS;AAC9B,UAAM,YAAY,MAAM,OAAO;AAC/B,WAAO,WAAW,KAAK;AAAA,EACzB;AACA,Q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AAiB,IAAI,CAAC;AACxD,SAAoB,qBAAK,OAAO;AAAA,IAC9B,GAAG;AAAA,IACH,GAAG;AAAA,IACH,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW,oBAAoB,eAAe;AAAA,IAC9C;AAAA,IACA,WAAW;AAAA,IAIX,OAAO,SAAS;AAAA,IAChB;AAAA,EACF,CAAC;AACH;AACA,IAAM,qBAAqB,WAAW,UAAU;AAChD,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import { useDrag } from '@use-gesture/react';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { withIgnoreIMEEvents } from '@wordpress/keycodes';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction InputField({\n disabled = false,\n dragDirection = 'n',\n dragThreshold = 10,\n id,\n isDragEnabled = false,\n isPressEnterToChange = false,\n onBlur = noop,\n onChange = noop,\n onDrag = noop,\n onDragEnd = noop,\n onDragStart = noop,\n onKeyDown = noop,\n onValidate = noop,\n size = 'default',\n stateReducer = state => state,\n value: valueProp,\n type,\n ...props\n}, ref) {\n const {\n // State.\n state,\n // Actions.\n change,\n commit,\n drag,\n dragEnd,\n dragStart,\n invalidate,\n pressDown,\n pressEnter,\n pressUp,\n reset\n } = useInputControlStateReducer(stateReducer, {\n isDragEnabled,\n value: valueProp,\n isPressEnterToChange\n }, onChange);\n const {\n value,\n isDragging,\n isDirty\n } = state;\n const wasDirtyOnBlur = useRef(false);\n const dragCursor = useDragCursor(isDragging, dragDirection);\n const handleOnBlur = event => {\n onBlur(event);\n\n /**\n * If isPressEnterToChange is set, this commits the value to\n * the onChange callback.\n */\n if (isDirty || !event.target.validity.valid) {\n wasDirtyOnBlur.current = true;\n handleOnCommit(event);\n }\n };\n const handleOnChange = event => {\n const nextValue = event.target.value;\n change(nextValue, event);\n };\n const handleOnCommit = event => {\n const nextValue = event.currentTarget.value;\n try {\n onValidate(nextValue);\n commit(nextValue, event);\n } catch (err) {\n invalidate(err, event);\n }\n };\n const handleOnKeyDown = event => {\n const {\n key\n } = event;\n onKeyDown(event);\n switch (key) {\n case 'ArrowUp':\n pressUp(event);\n break;\n case 'ArrowDown':\n pressDown(event);\n break;\n case 'Enter':\n pressEnter(event);\n if (isPressEnterToChange) {\n event.preventDefault();\n handleOnCommit(event);\n }\n break;\n case 'Escape':\n if (isPressEnterToChange && isDirty) {\n event.preventDefault();\n reset(valueProp, event);\n }\n break;\n }\n };\n const dragGestureProps = useDrag(dragProps => {\n const {\n distance,\n dragging,\n event,\n target\n } = dragProps;\n\n // The `target` prop always references the `input` element while, by\n // default, the `dragProps.event.target` property would reference the real\n // event target (i.e. any DOM element that the pointer is hovering while\n // dragging). Ensuring that the `target` is always the `input` element\n // allows consumers of `InputControl` (or any higher-level control) to\n // check the input's validity by accessing `event.target.validity.valid`.\n dragProps.event = {\n ...dragProps.event,\n target\n };\n if (!distance) {\n return;\n }\n event.stopPropagation();\n\n /**\n * Quick return if no longer dragging.\n * This prevents unnecessary value calculations.\n */\n if (!dragging) {\n onDragEnd(dragProps);\n dragEnd(dragProps);\n return;\n }\n onDrag(dragProps);\n drag(dragProps);\n if (!isDragging) {\n onDragStart(dragProps);\n dragStart(dragProps);\n }\n }, {\n axis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n threshold: dragThreshold,\n enabled: isDragEnabled,\n pointer: {\n capture: false\n }\n });\n const dragProps = isDragEnabled ? dragGestureProps() : {};\n return /*#__PURE__*/_jsx(Input, {\n ...props,\n ...dragProps,\n className: \"components-input-control__input\",\n \"data-empty-value\": value ? undefined : '',\n disabled: disabled,\n dragCursor: dragCursor,\n isDragging: isDragging,\n id: id,\n onBlur: handleOnBlur,\n onChange: handleOnChange,\n onKeyDown: withIgnoreIMEEvents(handleOnKeyDown),\n ref: ref,\n inputSize: size\n // Fallback to `''` to avoid \"uncontrolled to controlled\" warning.\n // See https://github.com/WordPress/gutenberg/pull/47250 for details.\n ,\n value: value ?? '',\n type: type\n });\n}\nconst ForwardedComponent = forwardRef(InputField);\nexport default ForwardedComponent;"],
5
+ "mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,YAAY,cAAc;AACnC,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AACtB,SAAS,mCAAmC;AAC5C,SAAS,OAAO,YAAY;AAC5B,IAAM,OAAO,MAAM;AAAC;AACpB,SAAS,WAAW;AAAA,EAClB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB;AAAA,EACA,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe,WAAS;AAAA,EACxB,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AACN,QAAM;AAAA;AAAA,IAEJ;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,4BAA4B,cAAc;AAAA,IAC5C;AAAA,IACA,OAAO;AAAA,IACP;AAAA,EACF,GAAG,QAAQ;AACX,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,iBAAiB,OAAO,KAAK;AACnC,QAAM,aAAa,cAAc,YAAY,aAAa;AAC1D,QAAM,eAAe,WAAS;AAC5B,WAAO,KAAK;AAMZ,QAAI,WAAW,CAAC,MAAM,OAAO,SAAS,OAAO;AAC3C,qBAAe,UAAU;AACzB,qBAAe,KAAK;AAAA,IACtB;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