@wordpress/components 39.0.0 → 40.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1468) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/CONTRIBUTING.md +9 -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/component.cjs +37 -5
  6. package/build/border-box-control/border-box-control/component.cjs.map +3 -3
  7. package/build/border-box-control/border-box-control/hook.cjs +99 -13
  8. package/build/border-box-control/border-box-control/hook.cjs.map +4 -4
  9. package/build/border-box-control/border-box-control-linked-button/hook.cjs +87 -8
  10. package/build/border-box-control/border-box-control-linked-button/hook.cjs.map +4 -4
  11. package/build/border-box-control/border-box-control-split-controls/hook.cjs +89 -16
  12. package/build/border-box-control/border-box-control-split-controls/hook.cjs.map +4 -4
  13. package/build/border-box-control/border-box-control-visualizer/hook.cjs +108 -8
  14. package/build/border-box-control/border-box-control-visualizer/hook.cjs.map +4 -4
  15. package/build/border-control/border-control/hook.cjs +89 -14
  16. package/build/border-control/border-control/hook.cjs.map +4 -4
  17. package/build/border-control/border-control-dropdown/component.cjs +2 -4
  18. package/build/border-control/border-control-dropdown/component.cjs.map +2 -2
  19. package/build/border-control/border-control-dropdown/hook.cjs +103 -27
  20. package/build/border-control/border-control-dropdown/hook.cjs.map +4 -4
  21. package/build/box-control/box-input-control.cjs +102 -10
  22. package/build/box-control/box-input-control.cjs.map +4 -4
  23. package/build/box-control/index.cjs +95 -5
  24. package/build/box-control/index.cjs.map +4 -4
  25. package/build/button/index.cjs +10 -3
  26. package/build/button/index.cjs.map +2 -2
  27. package/build/card/card-body/hook.cjs +4 -2
  28. package/build/card/card-body/hook.cjs.map +2 -2
  29. package/build/card/styles.cjs +31 -16
  30. package/build/card/styles.cjs.map +2 -2
  31. package/build/circular-option-picker/circular-option-picker-option.cjs +4 -5
  32. package/build/circular-option-picker/circular-option-picker-option.cjs.map +2 -2
  33. package/build/circular-option-picker/circular-option-picker.cjs +24 -6
  34. package/build/circular-option-picker/circular-option-picker.cjs.map +2 -2
  35. package/build/circular-option-picker/index.cjs +6 -2
  36. package/build/circular-option-picker/index.cjs.map +2 -2
  37. package/build/circular-option-picker/utils.cjs +38 -8
  38. package/build/circular-option-picker/utils.cjs.map +3 -3
  39. package/build/color-palette/index.cjs +104 -11
  40. package/build/color-palette/index.cjs.map +3 -3
  41. package/build/combobox-control/index.cjs +87 -2
  42. package/build/combobox-control/index.cjs.map +3 -3
  43. package/build/composite/context.cjs +9 -2
  44. package/build/composite/context.cjs.map +2 -2
  45. package/build/composite/group-label.cjs +4 -0
  46. package/build/composite/group-label.cjs.map +2 -2
  47. package/build/composite/group.cjs +10 -2
  48. package/build/composite/group.cjs.map +2 -2
  49. package/build/composite/item.cjs +4 -0
  50. package/build/composite/item.cjs.map +3 -3
  51. package/build/confirm-dialog/component.cjs +5 -1
  52. package/build/confirm-dialog/component.cjs.map +2 -2
  53. package/build/content-editable-control/index.cjs +1 -1
  54. package/build/content-editable-control/index.cjs.map +2 -2
  55. package/build/context/context-system-provider.cjs +2 -5
  56. package/build/context/context-system-provider.cjs.map +3 -3
  57. package/build/context/use-context-system.cjs +7 -2
  58. package/build/context/use-context-system.cjs.map +2 -2
  59. package/build/custom-gradient-picker/gradient-bar/control-points.cjs +14 -2
  60. package/build/custom-gradient-picker/gradient-bar/control-points.cjs.map +2 -2
  61. package/build/custom-gradient-picker/gradient-bar/index.cjs +2 -0
  62. package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
  63. package/build/disabled/index.cjs +1 -1
  64. package/build/disabled/index.cjs.map +2 -2
  65. package/build/draggable/index.cjs.map +1 -1
  66. package/build/dropdown/dropdown-content-wrapper.cjs +102 -3
  67. package/build/dropdown/dropdown-content-wrapper.cjs.map +4 -4
  68. package/build/duotone-picker/custom-duotone-bar.cjs +1 -0
  69. package/build/duotone-picker/custom-duotone-bar.cjs.map +2 -2
  70. package/build/duotone-picker/duotone-picker.cjs +23 -14
  71. package/build/duotone-picker/duotone-picker.cjs.map +2 -2
  72. package/build/focal-point-picker/index.cjs +5 -3
  73. package/build/focal-point-picker/index.cjs.map +2 -2
  74. package/build/form-token-field/index.cjs +1 -1
  75. package/build/form-token-field/index.cjs.map +2 -2
  76. package/build/gradient-picker/index.cjs +105 -11
  77. package/build/gradient-picker/index.cjs.map +3 -3
  78. package/build/icon/index.cjs +30 -12
  79. package/build/icon/index.cjs.map +2 -2
  80. package/build/input-control/input-field.cjs +1 -0
  81. package/build/input-control/input-field.cjs.map +2 -2
  82. package/build/input-control/styles/input-control-styles.cjs +42 -27
  83. package/build/input-control/styles/input-control-styles.cjs.map +2 -2
  84. package/build/item-group/context.cjs +1 -0
  85. package/build/item-group/context.cjs.map +2 -2
  86. package/build/item-group/item/component.cjs +12 -0
  87. package/build/item-group/item/component.cjs.map +3 -3
  88. package/build/item-group/item/hook.cjs +7 -6
  89. package/build/item-group/item/hook.cjs.map +2 -2
  90. package/build/item-group/item-group/component.cjs +1 -0
  91. package/build/item-group/item-group/component.cjs.map +2 -2
  92. package/build/item-group/item-group/hook.cjs +1 -1
  93. package/build/item-group/item-group/hook.cjs.map +2 -2
  94. package/build/modal/index.cjs +1 -0
  95. package/build/modal/index.cjs.map +2 -2
  96. package/build/palette-edit/index.cjs +208 -33
  97. package/build/palette-edit/index.cjs.map +3 -3
  98. package/build/private-apis.cjs +1 -6
  99. package/build/private-apis.cjs.map +2 -2
  100. package/build/progress-bar/index.cjs +95 -7
  101. package/build/progress-bar/index.cjs.map +4 -4
  102. package/build/radio-control/index.cjs +1 -0
  103. package/build/radio-control/index.cjs.map +2 -2
  104. package/build/resizable-box/index.cjs.map +1 -1
  105. package/build/resizable-box/resize-tooltip/index.cjs +91 -4
  106. package/build/resizable-box/resize-tooltip/index.cjs.map +3 -3
  107. package/build/resizable-box/resize-tooltip/label.cjs +103 -6
  108. package/build/resizable-box/resize-tooltip/label.cjs.map +4 -4
  109. package/build/scrollable/hook.cjs +93 -6
  110. package/build/scrollable/hook.cjs.map +4 -4
  111. package/build/snackbar/index.cjs +8 -5
  112. package/build/snackbar/index.cjs.map +2 -2
  113. package/build/textarea-control/index.cjs +87 -3
  114. package/build/textarea-control/index.cjs.map +3 -3
  115. package/build/toggle-group-control/context.cjs +8 -2
  116. package/build/toggle-group-control/context.cjs.map +2 -2
  117. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs +5 -2
  118. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs.map +2 -2
  119. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs +5 -2
  120. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs.map +2 -2
  121. package/build/toggle-group-control/toggle-group-control/component.cjs +3 -1
  122. package/build/toggle-group-control/toggle-group-control/component.cjs.map +2 -2
  123. package/build/toggle-group-control/toggle-group-control-option/component.cjs +2 -0
  124. package/build/toggle-group-control/toggle-group-control-option/component.cjs.map +2 -2
  125. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs +3 -2
  126. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs.map +2 -2
  127. package/build/toggle-group-control/toggle-group-control-option-icon/component.cjs +2 -0
  128. package/build/toggle-group-control/toggle-group-control-option-icon/component.cjs.map +2 -2
  129. package/build/tools-panel/tools-panel/hook.cjs +102 -106
  130. package/build/tools-panel/tools-panel/hook.cjs.map +2 -2
  131. package/build/tools-panel/tools-panel-item/hook.cjs +33 -33
  132. package/build/tools-panel/tools-panel-item/hook.cjs.map +2 -2
  133. package/build/tree-grid/cell.cjs +4 -0
  134. package/build/tree-grid/cell.cjs.map +2 -2
  135. package/build/tree-grid/roving-tab-index-item.cjs +5 -1
  136. package/build/tree-grid/roving-tab-index-item.cjs.map +2 -2
  137. package/build/tree-grid/row.cjs +6 -1
  138. package/build/tree-grid/row.cjs.map +2 -2
  139. package/build/tree-grid/use-validate-tree-grid-structure.cjs +81 -0
  140. package/build/tree-grid/use-validate-tree-grid-structure.cjs.map +7 -0
  141. package/build/utils/colors-values.cjs +3 -2
  142. package/build/utils/colors-values.cjs.map +2 -2
  143. package/build/utils/config-values.cjs +0 -3
  144. package/build/utils/config-values.cjs.map +2 -2
  145. package/build/validated-form-controls/components/content-editable-control.cjs +3 -2
  146. package/build/validated-form-controls/components/content-editable-control.cjs.map +2 -2
  147. package/build/validated-form-controls/components/custom-select-control.cjs +3 -2
  148. package/build/validated-form-controls/components/custom-select-control.cjs.map +2 -2
  149. package/build/validated-form-controls/components/index.cjs +1 -9
  150. package/build/validated-form-controls/components/index.cjs.map +2 -2
  151. package/build/validated-form-controls/components/input-control.cjs +9 -2
  152. package/build/validated-form-controls/components/input-control.cjs.map +3 -3
  153. package/build/validated-form-controls/components/range-control.cjs +3 -2
  154. package/build/validated-form-controls/components/range-control.cjs.map +2 -2
  155. package/build/validated-form-controls/components/textarea-control.cjs +9 -2
  156. package/build/validated-form-controls/components/textarea-control.cjs.map +3 -3
  157. package/build/validated-form-controls/index.cjs +1 -3
  158. package/build/validated-form-controls/index.cjs.map +2 -2
  159. package/build/z-stack/component.cjs +105 -7
  160. package/build/z-stack/component.cjs.map +4 -4
  161. package/build-module/base-control/styles/base-control-styles.mjs +151 -46
  162. package/build-module/base-control/styles/base-control-styles.mjs.map +3 -3
  163. package/build-module/border-box-control/border-box-control/component.mjs +38 -6
  164. package/build-module/border-box-control/border-box-control/component.mjs.map +2 -2
  165. package/build-module/border-box-control/border-box-control/hook.mjs +100 -14
  166. package/build-module/border-box-control/border-box-control/hook.mjs.map +3 -3
  167. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs +87 -8
  168. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs.map +3 -3
  169. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs +89 -16
  170. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs.map +3 -3
  171. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs +108 -8
  172. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs.map +3 -3
  173. package/build-module/border-control/border-control/hook.mjs +90 -15
  174. package/build-module/border-control/border-control/hook.mjs.map +3 -3
  175. package/build-module/border-control/border-control-dropdown/component.mjs +2 -4
  176. package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
  177. package/build-module/border-control/border-control-dropdown/hook.mjs +103 -27
  178. package/build-module/border-control/border-control-dropdown/hook.mjs.map +3 -3
  179. package/build-module/box-control/box-input-control.mjs +102 -10
  180. package/build-module/box-control/box-input-control.mjs.map +3 -3
  181. package/build-module/box-control/index.mjs +95 -5
  182. package/build-module/box-control/index.mjs.map +3 -3
  183. package/build-module/button/index.mjs +11 -4
  184. package/build-module/button/index.mjs.map +2 -2
  185. package/build-module/card/card-body/hook.mjs +4 -2
  186. package/build-module/card/card-body/hook.mjs.map +2 -2
  187. package/build-module/card/styles.mjs +30 -16
  188. package/build-module/card/styles.mjs.map +2 -2
  189. package/build-module/circular-option-picker/circular-option-picker-option.mjs +4 -5
  190. package/build-module/circular-option-picker/circular-option-picker-option.mjs.map +2 -2
  191. package/build-module/circular-option-picker/circular-option-picker.mjs +24 -6
  192. package/build-module/circular-option-picker/circular-option-picker.mjs.map +2 -2
  193. package/build-module/circular-option-picker/index.mjs +4 -2
  194. package/build-module/circular-option-picker/index.mjs.map +2 -2
  195. package/build-module/circular-option-picker/utils.mjs +25 -7
  196. package/build-module/circular-option-picker/utils.mjs.map +2 -2
  197. package/build-module/color-palette/index.mjs +105 -12
  198. package/build-module/color-palette/index.mjs.map +3 -3
  199. package/build-module/combobox-control/index.mjs +88 -3
  200. package/build-module/combobox-control/index.mjs.map +3 -3
  201. package/build-module/composite/context.mjs +6 -1
  202. package/build-module/composite/context.mjs.map +2 -2
  203. package/build-module/composite/group-label.mjs +5 -1
  204. package/build-module/composite/group-label.mjs.map +2 -2
  205. package/build-module/composite/group.mjs +11 -3
  206. package/build-module/composite/group.mjs.map +2 -2
  207. package/build-module/composite/item.mjs +4 -0
  208. package/build-module/composite/item.mjs.map +2 -2
  209. package/build-module/confirm-dialog/component.mjs +5 -1
  210. package/build-module/confirm-dialog/component.mjs.map +2 -2
  211. package/build-module/content-editable-control/index.mjs +1 -1
  212. package/build-module/content-editable-control/index.mjs.map +2 -2
  213. package/build-module/context/context-system-provider.mjs +2 -5
  214. package/build-module/context/context-system-provider.mjs.map +3 -3
  215. package/build-module/context/use-context-system.mjs +7 -2
  216. package/build-module/context/use-context-system.mjs.map +2 -2
  217. package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs +14 -2
  218. package/build-module/custom-gradient-picker/gradient-bar/control-points.mjs.map +2 -2
  219. package/build-module/custom-gradient-picker/gradient-bar/index.mjs +2 -0
  220. package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
  221. package/build-module/disabled/index.mjs +1 -1
  222. package/build-module/disabled/index.mjs.map +2 -2
  223. package/build-module/draggable/index.mjs.map +1 -1
  224. package/build-module/dropdown/dropdown-content-wrapper.mjs +92 -3
  225. package/build-module/dropdown/dropdown-content-wrapper.mjs.map +3 -3
  226. package/build-module/duotone-picker/custom-duotone-bar.mjs +1 -0
  227. package/build-module/duotone-picker/custom-duotone-bar.mjs.map +2 -2
  228. package/build-module/duotone-picker/duotone-picker.mjs +24 -15
  229. package/build-module/duotone-picker/duotone-picker.mjs.map +2 -2
  230. package/build-module/focal-point-picker/index.mjs +5 -3
  231. package/build-module/focal-point-picker/index.mjs.map +2 -2
  232. package/build-module/form-token-field/index.mjs +1 -1
  233. package/build-module/form-token-field/index.mjs.map +2 -2
  234. package/build-module/gradient-picker/index.mjs +106 -12
  235. package/build-module/gradient-picker/index.mjs.map +3 -3
  236. package/build-module/icon/index.mjs +30 -12
  237. package/build-module/icon/index.mjs.map +2 -2
  238. package/build-module/input-control/input-field.mjs +1 -0
  239. package/build-module/input-control/input-field.mjs.map +2 -2
  240. package/build-module/input-control/styles/input-control-styles.mjs +42 -27
  241. package/build-module/input-control/styles/input-control-styles.mjs.map +2 -2
  242. package/build-module/item-group/context.mjs +1 -0
  243. package/build-module/item-group/context.mjs.map +2 -2
  244. package/build-module/item-group/item/component.mjs +12 -0
  245. package/build-module/item-group/item/component.mjs.map +2 -2
  246. package/build-module/item-group/item/hook.mjs +7 -6
  247. package/build-module/item-group/item/hook.mjs.map +2 -2
  248. package/build-module/item-group/item-group/component.mjs +1 -0
  249. package/build-module/item-group/item-group/component.mjs.map +2 -2
  250. package/build-module/item-group/item-group/hook.mjs +1 -1
  251. package/build-module/item-group/item-group/hook.mjs.map +2 -2
  252. package/build-module/modal/index.mjs +1 -0
  253. package/build-module/modal/index.mjs.map +2 -2
  254. package/build-module/palette-edit/index.mjs +209 -34
  255. package/build-module/palette-edit/index.mjs.map +2 -2
  256. package/build-module/private-apis.mjs +2 -7
  257. package/build-module/private-apis.mjs.map +2 -2
  258. package/build-module/progress-bar/index.mjs +95 -7
  259. package/build-module/progress-bar/index.mjs.map +3 -3
  260. package/build-module/radio-control/index.mjs +1 -0
  261. package/build-module/radio-control/index.mjs.map +2 -2
  262. package/build-module/resizable-box/index.mjs.map +1 -1
  263. package/build-module/resizable-box/resize-tooltip/index.mjs +91 -4
  264. package/build-module/resizable-box/resize-tooltip/index.mjs.map +3 -3
  265. package/build-module/resizable-box/resize-tooltip/label.mjs +93 -6
  266. package/build-module/resizable-box/resize-tooltip/label.mjs.map +3 -3
  267. package/build-module/scrollable/hook.mjs +93 -6
  268. package/build-module/scrollable/hook.mjs.map +4 -4
  269. package/build-module/snackbar/index.mjs +8 -5
  270. package/build-module/snackbar/index.mjs.map +2 -2
  271. package/build-module/textarea-control/index.mjs +87 -3
  272. package/build-module/textarea-control/index.mjs.map +3 -3
  273. package/build-module/toggle-group-control/context.mjs +8 -2
  274. package/build-module/toggle-group-control/context.mjs.map +2 -2
  275. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs +5 -2
  276. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs.map +2 -2
  277. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs +5 -2
  278. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs.map +2 -2
  279. package/build-module/toggle-group-control/toggle-group-control/component.mjs +3 -1
  280. package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +2 -2
  281. package/build-module/toggle-group-control/toggle-group-control-option/component.mjs +2 -0
  282. package/build-module/toggle-group-control/toggle-group-control-option/component.mjs.map +2 -2
  283. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs +3 -2
  284. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs.map +2 -2
  285. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.mjs +2 -0
  286. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.mjs.map +2 -2
  287. package/build-module/tools-panel/tools-panel/hook.mjs +103 -107
  288. package/build-module/tools-panel/tools-panel/hook.mjs.map +2 -2
  289. package/build-module/tools-panel/tools-panel-item/hook.mjs +35 -35
  290. package/build-module/tools-panel/tools-panel-item/hook.mjs.map +2 -2
  291. package/build-module/tree-grid/cell.mjs +5 -1
  292. package/build-module/tree-grid/cell.mjs.map +2 -2
  293. package/build-module/tree-grid/roving-tab-index-item.mjs +5 -1
  294. package/build-module/tree-grid/roving-tab-index-item.mjs.map +2 -2
  295. package/build-module/tree-grid/row.mjs +7 -2
  296. package/build-module/tree-grid/row.mjs.map +2 -2
  297. package/build-module/tree-grid/use-validate-tree-grid-structure.mjs +56 -0
  298. package/build-module/tree-grid/use-validate-tree-grid-structure.mjs.map +7 -0
  299. package/build-module/utils/colors-values.mjs +3 -2
  300. package/build-module/utils/colors-values.mjs.map +2 -2
  301. package/build-module/utils/config-values.mjs +0 -3
  302. package/build-module/utils/config-values.mjs.map +2 -2
  303. package/build-module/validated-form-controls/components/content-editable-control.mjs +2 -1
  304. package/build-module/validated-form-controls/components/content-editable-control.mjs.map +2 -2
  305. package/build-module/validated-form-controls/components/custom-select-control.mjs +2 -1
  306. package/build-module/validated-form-controls/components/custom-select-control.mjs.map +2 -2
  307. package/build-module/validated-form-controls/components/index.mjs +0 -4
  308. package/build-module/validated-form-controls/components/index.mjs.map +2 -2
  309. package/build-module/validated-form-controls/components/input-control.mjs +8 -1
  310. package/build-module/validated-form-controls/components/input-control.mjs.map +2 -2
  311. package/build-module/validated-form-controls/components/range-control.mjs +2 -1
  312. package/build-module/validated-form-controls/components/range-control.mjs.map +2 -2
  313. package/build-module/validated-form-controls/components/textarea-control.mjs +8 -1
  314. package/build-module/validated-form-controls/components/textarea-control.mjs.map +2 -2
  315. package/build-module/validated-form-controls/index.mjs +0 -1
  316. package/build-module/validated-form-controls/index.mjs.map +2 -2
  317. package/build-module/z-stack/component.mjs +95 -7
  318. package/build-module/z-stack/component.mjs.map +3 -3
  319. package/build-style/style-rtl.css +104 -217
  320. package/build-style/style.css +104 -217
  321. package/build-types/base-control/styles/base-control-styles.d.ts +21 -20
  322. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  323. package/build-types/border-box-control/border-box-control/component.d.ts +4 -0
  324. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  325. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -2
  326. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  327. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  328. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  329. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +863 -1
  330. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  331. package/build-types/border-box-control/types.d.ts +6 -2
  332. package/build-types/border-box-control/types.d.ts.map +1 -1
  333. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  334. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  335. package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -2
  336. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  337. package/build-types/box-control/box-input-control.d.ts.map +1 -1
  338. package/build-types/box-control/index.d.ts.map +1 -1
  339. package/build-types/button/index.d.ts.map +1 -1
  340. package/build-types/card/styles.d.ts +2 -1
  341. package/build-types/card/styles.d.ts.map +1 -1
  342. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  343. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  344. package/build-types/circular-option-picker/index.d.ts +1 -1
  345. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  346. package/build-types/circular-option-picker/types.d.ts +34 -26
  347. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  348. package/build-types/circular-option-picker/utils.d.ts +9 -5
  349. package/build-types/circular-option-picker/utils.d.ts.map +1 -1
  350. package/build-types/color-palette/index.d.ts.map +1 -1
  351. package/build-types/color-palette/types.d.ts +23 -3
  352. package/build-types/color-palette/types.d.ts.map +1 -1
  353. package/build-types/combobox-control/index.d.ts.map +1 -1
  354. package/build-types/combobox-control/types.d.ts +4 -2
  355. package/build-types/combobox-control/types.d.ts.map +1 -1
  356. package/build-types/composite/context.d.ts +2 -0
  357. package/build-types/composite/context.d.ts.map +1 -1
  358. package/build-types/composite/group-label.d.ts.map +1 -1
  359. package/build-types/composite/group.d.ts.map +1 -1
  360. package/build-types/composite/item.d.ts.map +1 -1
  361. package/build-types/composite/types.d.ts +1 -1
  362. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  363. package/build-types/confirm-dialog/types.d.ts +11 -0
  364. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  365. package/build-types/context/context-system-provider.d.ts +8 -6
  366. package/build-types/context/context-system-provider.d.ts.map +1 -1
  367. package/build-types/context/use-context-system.d.ts.map +1 -1
  368. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +1 -1
  369. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  370. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  371. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  372. package/build-types/custom-gradient-picker/types.d.ts +10 -0
  373. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  374. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  375. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  376. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  377. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  378. package/build-types/duotone-picker/types.d.ts +43 -4
  379. package/build-types/duotone-picker/types.d.ts.map +1 -1
  380. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  381. package/build-types/gradient-picker/index.d.ts.map +1 -1
  382. package/build-types/gradient-picker/types.d.ts +22 -3
  383. package/build-types/gradient-picker/types.d.ts.map +1 -1
  384. package/build-types/icon/index.d.ts.map +1 -1
  385. package/build-types/input-control/input-field.d.ts.map +1 -1
  386. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  387. package/build-types/item-group/context.d.ts.map +1 -1
  388. package/build-types/item-group/item/component.d.ts.map +1 -1
  389. package/build-types/item-group/item/hook.d.ts +1 -1
  390. package/build-types/item-group/item/hook.d.ts.map +1 -1
  391. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  392. package/build-types/item-group/types.d.ts +4 -0
  393. package/build-types/item-group/types.d.ts.map +1 -1
  394. package/build-types/modal/index.d.ts.map +1 -1
  395. package/build-types/palette-edit/index.d.ts +8 -5
  396. package/build-types/palette-edit/index.d.ts.map +1 -1
  397. package/build-types/palette-edit/types.d.ts +47 -8
  398. package/build-types/palette-edit/types.d.ts.map +1 -1
  399. package/build-types/popover/types.d.ts +6 -2
  400. package/build-types/popover/types.d.ts.map +1 -1
  401. package/build-types/private-apis.d.ts.map +1 -1
  402. package/build-types/progress-bar/index.d.ts.map +1 -1
  403. package/build-types/radio-control/index.d.ts.map +1 -1
  404. package/build-types/radio-control/types.d.ts +6 -0
  405. package/build-types/radio-control/types.d.ts.map +1 -1
  406. package/build-types/resizable-box/resize-tooltip/index.d.ts +4 -5
  407. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  408. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  409. package/build-types/scrollable/hook.d.ts.map +1 -1
  410. package/build-types/snackbar/index.d.ts.map +1 -1
  411. package/build-types/textarea-control/index.d.ts.map +1 -1
  412. package/build-types/toggle-group-control/context.d.ts +2 -2
  413. package/build-types/toggle-group-control/context.d.ts.map +1 -1
  414. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  415. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  416. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  417. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  418. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  419. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +2 -2
  420. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  421. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  422. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +2 -2
  423. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  424. package/build-types/toggle-group-control/types.d.ts +12 -3
  425. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  426. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  427. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  428. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  429. package/build-types/tools-panel/types.d.ts +52 -9
  430. package/build-types/tools-panel/types.d.ts.map +1 -1
  431. package/build-types/tree-grid/cell.d.ts.map +1 -1
  432. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  433. package/build-types/tree-grid/row.d.ts.map +1 -1
  434. package/build-types/tree-grid/use-validate-tree-grid-structure.d.ts +2 -0
  435. package/build-types/tree-grid/use-validate-tree-grid-structure.d.ts.map +1 -0
  436. package/build-types/utils/colors-values.d.ts.map +1 -1
  437. package/build-types/utils/config-values.d.ts +0 -3
  438. package/build-types/validated-form-controls/components/content-editable-control.d.ts.map +1 -1
  439. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
  440. package/build-types/validated-form-controls/components/index.d.ts +0 -4
  441. package/build-types/validated-form-controls/components/index.d.ts.map +1 -1
  442. package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
  443. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  444. package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
  445. package/build-types/validated-form-controls/index.d.ts +0 -1
  446. package/build-types/validated-form-controls/index.d.ts.map +1 -1
  447. package/build-types/z-stack/component.d.ts.map +1 -1
  448. package/emotion-to-scss-modules.md +149 -0
  449. package/package.json +34 -33
  450. package/src/alignment-matrix-control/test/{index.tsx → index.jsdom.test.tsx} +5 -4
  451. package/src/angle-picker-control/style.module.scss +1 -1
  452. package/src/animate/stories/index.story.tsx +0 -10
  453. package/src/autocomplete/test/get-autocomplete-match.ts +2 -1
  454. package/src/autocomplete/test/{index.tsx → index.jsdom.test.tsx} +2 -1
  455. package/src/badge/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  456. package/src/base-control/stories/index.story.tsx +2 -2
  457. package/src/base-control/styles/base-control-styles.tsx +115 -0
  458. package/src/base-control/styles/style.module.scss +39 -0
  459. package/src/base-control/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  460. package/src/border-box-control/border-box-control/README.md +5 -3
  461. package/src/border-box-control/border-box-control/component.tsx +83 -15
  462. package/src/border-box-control/border-box-control/hook.ts +23 -16
  463. package/src/border-box-control/border-box-control-linked-button/hook.ts +6 -10
  464. package/src/border-box-control/border-box-control-split-controls/hook.ts +11 -20
  465. package/src/border-box-control/border-box-control-visualizer/hook.ts +37 -11
  466. package/src/border-box-control/stories/index.story.tsx +11 -1
  467. package/src/border-box-control/style.module.scss +74 -0
  468. package/src/border-box-control/test/{index.tsx → index.jsdom.test.tsx} +138 -2
  469. package/src/border-box-control/test/utils.ts +11 -0
  470. package/src/border-box-control/types.ts +6 -2
  471. package/src/border-control/border-control/hook.ts +10 -19
  472. package/src/border-control/border-control-dropdown/component.tsx +6 -8
  473. package/src/border-control/border-control-dropdown/hook.ts +23 -32
  474. package/src/border-control/style.module.scss +93 -0
  475. package/src/border-control/test/{index.js → index.jsdom.test.tsx} +95 -43
  476. package/src/box-control/box-input-control.tsx +31 -16
  477. package/src/box-control/index.tsx +15 -12
  478. package/src/box-control/style.module.scss +28 -0
  479. package/src/box-control/test/{index.tsx → index.jsdom.test.tsx} +167 -3
  480. package/src/button/index.tsx +32 -10
  481. package/src/button/style.scss +0 -6
  482. package/src/button/test/{index.tsx → index.jsdom.test.tsx} +57 -2
  483. package/src/card/card-body/hook.ts +2 -2
  484. package/src/card/styles.ts +11 -1
  485. package/src/card/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +27 -27
  486. package/src/checkbox-control/stories/index.story.tsx +1 -1
  487. package/src/checkbox-control/style.scss +2 -2
  488. package/src/checkbox-control/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +10 -7
  489. package/src/checkbox-control/test/{index.tsx → index.jsdom.test.tsx} +4 -1
  490. package/src/circular-option-picker/README.md +8 -4
  491. package/src/circular-option-picker/circular-option-picker-option.tsx +26 -16
  492. package/src/circular-option-picker/circular-option-picker.tsx +47 -14
  493. package/src/circular-option-picker/index.tsx +5 -1
  494. package/src/circular-option-picker/stories/index.story.tsx +3 -3
  495. package/src/circular-option-picker/test/index.jsdom.test.tsx +263 -0
  496. package/src/circular-option-picker/types.ts +38 -32
  497. package/src/circular-option-picker/utils.tsx +35 -5
  498. package/src/clipboard-button/index.tsx +1 -1
  499. package/src/color-indicator/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +2 -2
  500. package/src/color-indicator/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  501. package/src/color-palette/README.md +11 -7
  502. package/src/color-palette/index.tsx +29 -15
  503. package/src/color-palette/stories/index.story.tsx +5 -0
  504. package/src/color-palette/style.module.scss +12 -0
  505. package/src/color-palette/test/{index.tsx → index.jsdom.test.tsx} +102 -24
  506. package/src/color-palette/test/{utils.ts → utils.jsdom.test.ts} +1 -0
  507. package/src/color-palette/types.ts +23 -3
  508. package/src/color-picker/stories/index.story.tsx +0 -5
  509. package/src/combobox-control/README.md +1 -1
  510. package/src/combobox-control/index.tsx +4 -4
  511. package/src/combobox-control/style.module.scss +6 -0
  512. package/src/combobox-control/style.scss +1 -1
  513. package/src/combobox-control/test/{index.tsx → index.jsdom.test.tsx} +12 -7
  514. package/src/combobox-control/types.ts +4 -2
  515. package/src/composite/README.md +1 -1
  516. package/src/composite/context.tsx +6 -0
  517. package/src/composite/group-label.tsx +8 -1
  518. package/src/composite/group.tsx +9 -2
  519. package/src/composite/item.tsx +6 -0
  520. package/src/composite/legacy/stories/index.story.tsx +10 -10
  521. package/src/composite/legacy/test/{index.tsx → index.jsdom.test.tsx} +6 -13
  522. package/src/composite/stories/index.story.tsx +0 -5
  523. package/src/composite/test/{index.tsx → index.jsdom.test.tsx} +60 -17
  524. package/src/composite/types.ts +1 -1
  525. package/src/confirm-dialog/README.md +16 -0
  526. package/src/confirm-dialog/component.tsx +7 -1
  527. package/src/confirm-dialog/test/{index.tsx → index.jsdom.test.tsx} +57 -14
  528. package/src/confirm-dialog/types.ts +11 -0
  529. package/src/content-editable-control/style.module.scss +0 -1
  530. package/src/content-editable-control/test/{index.tsx → index.jsdom.test.tsx} +4 -3
  531. package/src/context/{context-system-provider.js → context-system-provider.tsx} +19 -6
  532. package/src/context/stories/{ComponentsProvider.stories.jsx → ComponentsProvider.stories.tsx} +2 -2
  533. package/src/context/test/context-connect.tsx +1 -2
  534. package/src/context/test/{context-system-provider.js → context-system-provider.jsdom.test.tsx} +93 -51
  535. package/src/context/test/wordpress-component.tsx +1 -2
  536. package/src/context/use-context-system.js +13 -4
  537. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +24 -3
  538. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -0
  539. package/src/custom-gradient-picker/gradient-bar/test/{utils.ts → utils.jsdom.test.ts} +6 -5
  540. package/src/custom-gradient-picker/test/{index.tsx → index.jsdom.test.tsx} +134 -0
  541. package/src/custom-gradient-picker/test/serializer.ts +1 -0
  542. package/src/custom-gradient-picker/types.ts +10 -0
  543. package/src/custom-select-control-v2/test/{index.tsx → index.jsdom.test.tsx} +4 -1
  544. package/src/date-time/date-picker/test/{index.tsx → index.jsdom.test.tsx} +6 -3
  545. package/src/date-time/date-picker/test/{use-lilius.ts → use-lilius.jsdom.test.ts} +1 -0
  546. package/src/date-time/date-time/test/{index.tsx → index.jsdom.test.tsx} +20 -11
  547. package/src/date-time/test/utils.test.ts +9 -0
  548. package/src/date-time/time-picker/test/{index.tsx → index.jsdom.test.tsx} +37 -27
  549. package/src/date-time/time-picker/time-input/test/{index.tsx → index.jsdom.test.tsx} +8 -3
  550. package/src/disabled/index.tsx +7 -7
  551. package/src/disabled/test/{index.tsx → index.jsdom.test.tsx} +26 -0
  552. package/src/draggable/index.tsx +1 -1
  553. package/src/draggable/style.module.scss +1 -1
  554. package/src/dropdown/dropdown-content-wrapper.tsx +17 -7
  555. package/src/dropdown/stories/index.story.tsx +0 -5
  556. package/src/dropdown/style.module.scss +25 -0
  557. package/src/dropdown/test/{index.tsx → index.jsdom.test.tsx} +52 -0
  558. package/src/dropdown-menu/test/{index.tsx → index.jsdom.test.tsx} +5 -4
  559. package/src/duotone-picker/README.md +21 -6
  560. package/src/duotone-picker/custom-duotone-bar.tsx +1 -0
  561. package/src/duotone-picker/duotone-picker.tsx +79 -54
  562. package/src/duotone-picker/stories/duotone-picker.story.tsx +63 -15
  563. package/src/duotone-picker/test/custom-duotone-bar.jsdom.test.tsx +117 -0
  564. package/src/duotone-picker/test/index.jsdom.test.tsx +347 -0
  565. package/src/duotone-picker/types.ts +48 -4
  566. package/src/external-link/test/{index.tsx → index.jsdom.test.tsx} +5 -4
  567. package/src/focal-point-picker/index.tsx +6 -2
  568. package/src/focal-point-picker/stories/index.story.tsx +15 -0
  569. package/src/focal-point-picker/test/{index.tsx → index.jsdom.test.tsx} +43 -9
  570. package/src/focal-point-picker/test/{media.tsx → media.jsdom.test.tsx} +1 -0
  571. package/src/font-size-picker/test/{font-size-picker-select.tsx → font-size-picker-select.jsdom.test.tsx} +19 -16
  572. package/src/font-size-picker/test/{font-size-picker-toggle-group.tsx → font-size-picker-toggle-group.jsdom.test.tsx} +13 -11
  573. package/src/font-size-picker/test/{index.tsx → index.jsdom.test.tsx} +19 -14
  574. package/src/font-size-picker/test/utils.ts +1 -0
  575. package/src/form-toggle/stories/index.story.tsx +3 -0
  576. package/src/form-toggle/style.scss +1 -1
  577. package/src/form-toggle/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +4 -4
  578. package/src/form-toggle/test/{index.tsx → index.jsdom.test.tsx} +2 -1
  579. package/src/form-token-field/index.tsx +1 -1
  580. package/src/form-token-field/style.scss +7 -1
  581. package/src/form-token-field/test/{index.tsx → index.jsdom.test.tsx} +86 -44
  582. package/src/gradient-picker/README.md +19 -10
  583. package/src/gradient-picker/index.tsx +43 -16
  584. package/src/gradient-picker/stories/index.story.tsx +5 -0
  585. package/src/gradient-picker/test/{index.tsx → index.jsdom.test.tsx} +93 -6
  586. package/src/gradient-picker/types.ts +22 -3
  587. package/src/guide/test/{index.tsx → index.jsdom.test.tsx} +4 -2
  588. package/src/h-stack/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +4 -4
  589. package/src/h-stack/test/{index.tsx → index.jsdom.test.tsx} +3 -0
  590. package/src/higher-order/with-fallback-styles/test/{index.tsx → index.jsdom.test.tsx} +3 -2
  591. package/src/higher-order/with-filters/test/__snapshots__/index.jsdom.test.tsx.snap +87 -0
  592. package/src/higher-order/with-filters/test/{index.tsx → index.jsdom.test.tsx} +6 -5
  593. package/src/higher-order/with-focus-outside/test/{index.tsx → index.jsdom.test.tsx} +2 -1
  594. package/src/higher-order/with-focus-return/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  595. package/src/higher-order/with-notices/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  596. package/src/higher-order/with-spoken-messages/test/{index.tsx → index.jsdom.test.tsx} +3 -2
  597. package/src/icon/index.tsx +28 -12
  598. package/src/icon/test/{index.tsx → index.jsdom.test.tsx} +66 -0
  599. package/src/input-control/input-field.tsx +1 -0
  600. package/src/input-control/stories/index.story.tsx +3 -3
  601. package/src/input-control/stories/migration-guide.mdx +201 -0
  602. package/src/input-control/style.scss +11 -0
  603. package/src/input-control/styles/input-control-styles.tsx +68 -18
  604. package/src/input-control/test/{index.js → index.jsdom.test.tsx} +26 -10
  605. package/src/isolated-event-container/test/{index.tsx → index.jsdom.test.tsx} +4 -3
  606. package/src/item-group/context.ts +1 -0
  607. package/src/item-group/item/component.tsx +19 -1
  608. package/src/item-group/item/hook.ts +2 -3
  609. package/src/item-group/item-group/component.tsx +1 -0
  610. package/src/item-group/style.module.scss +1 -2
  611. package/src/item-group/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +9 -9
  612. package/src/item-group/test/{index.js → index.jsdom.test.tsx} +99 -2
  613. package/src/item-group/types.ts +4 -0
  614. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -2
  615. package/src/keyboard-shortcuts/test/{index.tsx → index.jsdom.test.tsx} +5 -4
  616. package/src/menu/test/{index.tsx → index.jsdom.test.tsx} +67 -23
  617. package/src/menu-group/stories/index.story.tsx +9 -6
  618. package/src/menu-group/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  619. package/src/menu-item/stories/index.story.tsx +6 -3
  620. package/src/menu-item/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +5 -5
  621. package/src/menu-item/test/{index.js → index.jsdom.test.tsx} +1 -0
  622. package/src/menu-items-choice/stories/index.story.tsx +14 -11
  623. package/src/modal/index.tsx +1 -0
  624. package/src/modal/test/{aria-helper.ts → aria-helper.jsdom.test.ts} +1 -0
  625. package/src/modal/test/{index.tsx → index.jsdom.test.tsx} +27 -4
  626. package/src/navigable-container/test/{navigable-menu.tsx → navigable-menu.jsdom.test.tsx} +7 -5
  627. package/src/navigable-container/test/{tababble-container.tsx → tababble-container.jsdom.test.tsx} +5 -3
  628. package/src/navigator/stories/index.story.tsx +0 -5
  629. package/src/navigator/test/{index.tsx → index.jsdom.test.tsx} +5 -2
  630. package/src/navigator/test/router.ts +1 -0
  631. package/src/notice/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +7 -4
  632. package/src/notice/test/{index.tsx → index.jsdom.test.tsx} +8 -4
  633. package/src/notice/test/{list.tsx → list.jsdom.test.tsx} +1 -0
  634. package/src/number-control/stories/index.story.tsx +3 -3
  635. package/src/number-control/test/{index.tsx → index.jsdom.test.tsx} +9 -6
  636. package/src/palette-edit/index.tsx +364 -70
  637. package/src/palette-edit/stories/index.story.tsx +59 -18
  638. package/src/palette-edit/style.scss +3 -1
  639. package/src/palette-edit/test/index.jsdom.test.tsx +841 -0
  640. package/src/palette-edit/types.ts +50 -8
  641. package/src/panel/test/__snapshots__/body.jsdom.test.tsx.snap +9 -0
  642. package/src/panel/test/__snapshots__/header.jsdom.test.tsx.snap +9 -0
  643. package/src/panel/test/__snapshots__/index.jsdom.test.tsx.snap +17 -0
  644. package/src/panel/test/__snapshots__/row.jsdom.test.tsx.snap +17 -0
  645. package/src/panel/test/{body.tsx → body.jsdom.test.tsx} +2 -1
  646. package/src/panel/test/{header.tsx → header.jsdom.test.tsx} +1 -0
  647. package/src/panel/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  648. package/src/panel/test/{row.tsx → row.jsdom.test.tsx} +1 -0
  649. package/src/placeholder/style.scss +0 -5
  650. package/src/placeholder/test/{index.tsx → index.jsdom.test.tsx} +19 -14
  651. package/src/popover/README.md +2 -2
  652. package/src/popover/stories/index.story.tsx +5 -1
  653. package/src/popover/stories/utils.tsx +79 -0
  654. package/src/popover/test/{index.tsx → index.jsdom.test.tsx} +24 -1
  655. package/src/popover/test/utils/index.js +1 -0
  656. package/src/popover/test/utils/index.tsx +4 -78
  657. package/src/popover/types.ts +9 -3
  658. package/src/private-apis.ts +0 -8
  659. package/src/progress-bar/index.tsx +10 -6
  660. package/src/progress-bar/style.module.scss +70 -0
  661. package/src/progress-bar/test/{index.tsx → index.jsdom.test.tsx} +13 -11
  662. package/src/query-controls/test/terms.ts +1 -0
  663. package/src/radio-control/README.md +3 -1
  664. package/src/radio-control/index.tsx +1 -0
  665. package/src/radio-control/stories/index.story.tsx +12 -0
  666. package/src/radio-control/style.scss +1 -3
  667. package/src/radio-control/test/{index.tsx → index.jsdom.test.tsx} +72 -10
  668. package/src/radio-control/types.ts +6 -0
  669. package/src/range-control/stories/index.story.tsx +30 -0
  670. package/src/range-control/test/{index.tsx → index.jsdom.test.tsx} +10 -7
  671. package/src/resizable-box/index.tsx +1 -1
  672. package/src/resizable-box/resize-tooltip/index.tsx +16 -7
  673. package/src/resizable-box/resize-tooltip/label.tsx +18 -12
  674. package/src/resizable-box/resize-tooltip/style.module.scss +40 -0
  675. package/src/resizable-box/resize-tooltip/test/index.jsdom.test.tsx +44 -0
  676. package/src/resizable-box/resize-tooltip/test/label.jsdom.test.tsx +25 -0
  677. package/src/resizable-box/stories/index.story.tsx +11 -0
  678. package/src/sandbox/stories/index.story.tsx +2 -0
  679. package/src/sandbox/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  680. package/src/scroll-lock/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  681. package/src/scrollable/hook.ts +11 -17
  682. package/src/scrollable/stories/index.story.tsx +1 -0
  683. package/src/scrollable/style.module.scss +44 -0
  684. package/src/scrollable/test/index.jsdom.test.tsx +145 -0
  685. package/src/shortcut/test/__snapshots__/index.jsdom.test.tsx.snap +15 -0
  686. package/src/shortcut/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  687. package/src/slot-fill/test/{index.js → index.jsdom.test.tsx} +4 -3
  688. package/src/slot-fill/test/{slot.js → slot.jsdom.test.tsx} +17 -9
  689. package/src/snackbar/index.tsx +10 -6
  690. package/src/snackbar/stories/index.story.tsx +5 -0
  691. package/src/snackbar/stories/list.story.tsx +3 -0
  692. package/src/snackbar/test/{index.tsx → index.jsdom.test.tsx} +41 -11
  693. package/src/snackbar/test/list.jsdom.test.tsx +100 -0
  694. package/src/spinner/stories/index.story.tsx +2 -2
  695. package/src/style-provider/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  696. package/src/style.scss +1 -0
  697. package/src/surface/style.module.scss +2 -2
  698. package/src/surface/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  699. package/src/tab-panel/style.scss +4 -23
  700. package/src/tab-panel/test/{index.tsx → index.jsdom.test.tsx} +22 -21
  701. package/src/tabs/test/{index.tsx → index.jsdom.test.tsx} +21 -19
  702. package/src/text-control/stories/index.story.tsx +2 -3
  703. package/src/text-control/style.scss +0 -1
  704. package/src/text-control/test/{text-control.tsx → text-control.jsdom.test.tsx} +1 -0
  705. package/src/text-highlight/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  706. package/src/textarea-control/index.tsx +6 -3
  707. package/src/textarea-control/stories/index.story.tsx +2 -3
  708. package/src/textarea-control/stories/migration-guide.mdx +79 -0
  709. package/src/textarea-control/style.module.scss +61 -0
  710. package/src/tip/style.scss +1 -1
  711. package/src/toggle-control/test/{index.tsx → index.jsdom.test.tsx} +4 -1
  712. package/src/toggle-group-control/context.ts +14 -5
  713. package/src/toggle-group-control/stories/index.story.tsx +15 -2
  714. package/src/toggle-group-control/test/{index.tsx → index.jsdom.test.tsx} +283 -9
  715. package/src/toggle-group-control/toggle-group-control/README.md +8 -5
  716. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +4 -0
  717. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +4 -0
  718. package/src/toggle-group-control/toggle-group-control/component.tsx +2 -0
  719. package/src/toggle-group-control/toggle-group-control/style.module.scss +8 -4
  720. package/src/toggle-group-control/toggle-group-control-option/README.md +8 -5
  721. package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -0
  722. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +4 -1
  723. package/src/toggle-group-control/toggle-group-control-option-base/style.module.scss +0 -2
  724. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +7 -0
  725. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +2 -0
  726. package/src/toggle-group-control/types.ts +12 -3
  727. package/src/toolbar/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  728. package/src/toolbar/test/{toolbar-group.tsx → toolbar-group.jsdom.test.tsx} +2 -1
  729. package/src/tools-panel/test/{index.tsx → index.jsdom.test.tsx} +595 -47
  730. package/src/tools-panel/tools-panel/hook.ts +195 -180
  731. package/src/tools-panel/tools-panel-item/README.md +42 -1
  732. package/src/tools-panel/tools-panel-item/hook.ts +97 -69
  733. package/src/tools-panel/types.ts +54 -9
  734. package/src/tooltip/test/{index.tsx → index.jsdom.test.tsx} +5 -3
  735. package/src/tree-grid/cell.tsx +6 -2
  736. package/src/tree-grid/roving-tab-index-item.tsx +7 -3
  737. package/src/tree-grid/row.tsx +8 -2
  738. package/src/tree-grid/test/__snapshots__/{cell.tsx.snap → cell.jsdom.test.tsx.snap} +2 -2
  739. package/src/tree-grid/test/__snapshots__/index.jsdom.test.tsx.snap +3 -0
  740. package/src/tree-grid/test/__snapshots__/roving-tab-index-item.jsdom.test.tsx.snap +27 -0
  741. package/src/tree-grid/test/__snapshots__/roving-tab-index.jsdom.test.tsx.snap +9 -0
  742. package/src/tree-grid/test/__snapshots__/{row.tsx.snap → row.jsdom.test.tsx.snap} +9 -5
  743. package/src/tree-grid/test/cell.jsdom.test.tsx +149 -0
  744. package/src/tree-grid/test/{index.tsx → index.jsdom.test.tsx} +9 -7
  745. package/src/tree-grid/test/{roving-tab-index-item.tsx → roving-tab-index-item.jsdom.test.tsx} +4 -1
  746. package/src/tree-grid/test/{roving-tab-index.tsx → roving-tab-index.jsdom.test.tsx} +1 -0
  747. package/src/tree-grid/test/row.jsdom.test.tsx +132 -0
  748. package/src/tree-grid/use-validate-tree-grid-structure.ts +104 -0
  749. package/src/truncate/style.module.scss +0 -1
  750. package/src/truncate/test/{index.tsx → index.jsdom.test.tsx} +1 -0
  751. package/src/unit-control/test/{index.tsx → index.jsdom.test.tsx} +22 -19
  752. package/src/unit-control/test/utils.ts +1 -0
  753. package/src/utils/colors-values.js +5 -4
  754. package/src/utils/config-values.js +0 -3
  755. package/src/utils/hooks/test/{use-controlled-state.js → use-controlled-state.jsdom.test.tsx} +22 -7
  756. package/src/utils/hooks/test/{use-controlled-value.js → use-controlled-value.jsdom.test.tsx} +6 -3
  757. package/src/utils/hooks/test/{use-cx.js → use-cx.jsdom.test.tsx} +8 -5
  758. package/src/utils/test/colors.js +1 -0
  759. package/src/utils/test/{get-node-text.js → get-node-text.tsx} +1 -0
  760. package/src/utils/test/math.js +1 -0
  761. package/src/utils/test/rtl.js +1 -0
  762. package/src/utils/test/space.js +1 -0
  763. package/src/utils/test/strings.js +1 -0
  764. package/src/utils/test/unit-values.js +1 -0
  765. package/src/utils/theme-variables.scss +0 -1
  766. package/src/v-stack/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +4 -4
  767. package/src/v-stack/test/{index.tsx → index.jsdom.test.tsx} +3 -0
  768. package/src/validated-form-controls/components/content-editable-control.tsx +2 -1
  769. package/src/validated-form-controls/components/custom-select-control.tsx +2 -1
  770. package/src/validated-form-controls/components/index.ts +0 -4
  771. package/src/validated-form-controls/components/input-control.tsx +9 -1
  772. package/src/validated-form-controls/components/range-control.tsx +2 -1
  773. package/src/validated-form-controls/components/stories/content-editable-control.story.tsx +6 -0
  774. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +6 -0
  775. package/src/validated-form-controls/components/stories/overview.mdx +4 -47
  776. package/src/validated-form-controls/components/textarea-control.tsx +9 -1
  777. package/src/validated-form-controls/index.ts +0 -1
  778. package/src/validated-form-controls/style.scss +13 -73
  779. package/src/validated-form-controls/test/{content-editable-control.tsx → content-editable-control.jsdom.test.tsx} +1 -1
  780. package/src/validated-form-controls/test/{custom-select-control.tsx → custom-select-control.jsdom.test.tsx} +3 -0
  781. package/src/validated-form-controls/test/{input-control.tsx → input-control.jsdom.test.tsx} +15 -0
  782. package/src/validated-form-controls/test/{range-control.tsx → range-control.jsdom.test.tsx} +3 -0
  783. package/src/validated-form-controls/test/{textarea-control.tsx → textarea-control.jsdom.test.tsx} +18 -0
  784. package/src/view/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +7 -7
  785. package/src/view/test/{index.js → index.jsdom.test.tsx} +7 -2
  786. package/src/z-stack/component.tsx +17 -9
  787. package/src/z-stack/style.module.scss +26 -0
  788. package/build/border-box-control/styles.cjs +0 -99
  789. package/build/border-box-control/styles.cjs.map +0 -7
  790. package/build/border-control/styles.cjs +0 -117
  791. package/build/border-control/styles.cjs.map +0 -7
  792. package/build/box-control/styles/box-control-styles.cjs +0 -131
  793. package/build/box-control/styles/box-control-styles.cjs.map +0 -7
  794. package/build/color-palette/styles.cjs +0 -49
  795. package/build/color-palette/styles.cjs.map +0 -7
  796. package/build/combobox-control/styles.cjs +0 -49
  797. package/build/combobox-control/styles.cjs.map +0 -7
  798. package/build/dropdown/styles.cjs +0 -61
  799. package/build/dropdown/styles.cjs.map +0 -7
  800. package/build/progress-bar/styles.cjs +0 -106
  801. package/build/progress-bar/styles.cjs.map +0 -7
  802. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs +0 -90
  803. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.cjs.map +0 -7
  804. package/build/scrollable/styles.cjs +0 -96
  805. package/build/scrollable/styles.cjs.map +0 -7
  806. package/build/textarea-control/styles/textarea-control-styles.cjs +0 -54
  807. package/build/textarea-control/styles/textarea-control-styles.cjs.map +0 -7
  808. package/build/validated-form-controls/components/combobox-control.cjs +0 -75
  809. package/build/validated-form-controls/components/combobox-control.cjs.map +0 -7
  810. package/build/validated-form-controls/components/form-token-field.cjs +0 -69
  811. package/build/validated-form-controls/components/form-token-field.cjs.map +0 -7
  812. package/build/validated-form-controls/components/toggle-control.cjs +0 -67
  813. package/build/validated-form-controls/components/toggle-control.cjs.map +0 -7
  814. package/build/validated-form-controls/components/toggle-group-control.cjs +0 -71
  815. package/build/validated-form-controls/components/toggle-group-control.cjs.map +0 -7
  816. package/build/validated-form-controls/control-with-error.cjs +0 -200
  817. package/build/validated-form-controls/control-with-error.cjs.map +0 -7
  818. package/build/validated-form-controls/validity-indicator.cjs +0 -67
  819. package/build/validated-form-controls/validity-indicator.cjs.map +0 -7
  820. package/build/z-stack/styles.cjs +0 -80
  821. package/build/z-stack/styles.cjs.map +0 -7
  822. package/build-module/border-box-control/styles.mjs +0 -67
  823. package/build-module/border-box-control/styles.mjs.map +0 -7
  824. package/build-module/border-control/styles.mjs +0 -80
  825. package/build-module/border-control/styles.mjs.map +0 -7
  826. package/build-module/box-control/styles/box-control-styles.mjs +0 -91
  827. package/build-module/box-control/styles/box-control-styles.mjs.map +0 -7
  828. package/build-module/color-palette/styles.mjs +0 -14
  829. package/build-module/color-palette/styles.mjs.map +0 -7
  830. package/build-module/combobox-control/styles.mjs +0 -14
  831. package/build-module/combobox-control/styles.mjs.map +0 -7
  832. package/build-module/dropdown/styles.mjs +0 -26
  833. package/build-module/dropdown/styles.mjs.map +0 -7
  834. package/build-module/progress-bar/styles.mjs +0 -68
  835. package/build-module/progress-bar/styles.mjs.map +0 -7
  836. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs +0 -52
  837. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.mjs.map +0 -7
  838. package/build-module/scrollable/styles.mjs +0 -65
  839. package/build-module/scrollable/styles.mjs.map +0 -7
  840. package/build-module/textarea-control/styles/textarea-control-styles.mjs +0 -19
  841. package/build-module/textarea-control/styles/textarea-control-styles.mjs.map +0 -7
  842. package/build-module/validated-form-controls/components/combobox-control.mjs +0 -40
  843. package/build-module/validated-form-controls/components/combobox-control.mjs.map +0 -7
  844. package/build-module/validated-form-controls/components/form-token-field.mjs +0 -44
  845. package/build-module/validated-form-controls/components/form-token-field.mjs.map +0 -7
  846. package/build-module/validated-form-controls/components/toggle-control.mjs +0 -32
  847. package/build-module/validated-form-controls/components/toggle-control.mjs.map +0 -7
  848. package/build-module/validated-form-controls/components/toggle-group-control.mjs +0 -46
  849. package/build-module/validated-form-controls/components/toggle-group-control.mjs.map +0 -7
  850. package/build-module/validated-form-controls/control-with-error.mjs +0 -175
  851. package/build-module/validated-form-controls/control-with-error.mjs.map +0 -7
  852. package/build-module/validated-form-controls/validity-indicator.mjs +0 -32
  853. package/build-module/validated-form-controls/validity-indicator.mjs.map +0 -7
  854. package/build-module/z-stack/styles.mjs +0 -44
  855. package/build-module/z-stack/styles.mjs.map +0 -7
  856. package/build-types/alignment-matrix-control/stories/index.story.d.ts +0 -8
  857. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +0 -1
  858. package/build-types/alignment-matrix-control/test/index.d.ts +0 -2
  859. package/build-types/alignment-matrix-control/test/index.d.ts.map +0 -1
  860. package/build-types/angle-picker-control/stories/index.story.d.ts +0 -8
  861. package/build-types/angle-picker-control/stories/index.story.d.ts.map +0 -1
  862. package/build-types/animate/stories/index.story.d.ts +0 -12
  863. package/build-types/animate/stories/index.story.d.ts.map +0 -1
  864. package/build-types/autocomplete/test/get-autocomplete-match.d.ts +0 -2
  865. package/build-types/autocomplete/test/get-autocomplete-match.d.ts.map +0 -1
  866. package/build-types/autocomplete/test/index.d.ts +0 -2
  867. package/build-types/autocomplete/test/index.d.ts.map +0 -1
  868. package/build-types/badge/stories/e2e/index.story.d.ts +0 -7
  869. package/build-types/badge/stories/e2e/index.story.d.ts.map +0 -1
  870. package/build-types/badge/stories/index.story.d.ts +0 -11
  871. package/build-types/badge/stories/index.story.d.ts.map +0 -1
  872. package/build-types/badge/test/index.d.ts +0 -2
  873. package/build-types/badge/test/index.d.ts.map +0 -1
  874. package/build-types/base-control/stories/index.story.d.ts +0 -17
  875. package/build-types/base-control/stories/index.story.d.ts.map +0 -1
  876. package/build-types/base-control/test/index.d.ts +0 -2
  877. package/build-types/base-control/test/index.d.ts.map +0 -1
  878. package/build-types/border-box-control/stories/index.story.d.ts +0 -14
  879. package/build-types/border-box-control/stories/index.story.d.ts.map +0 -1
  880. package/build-types/border-box-control/styles.d.ts +0 -10
  881. package/build-types/border-box-control/styles.d.ts.map +0 -1
  882. package/build-types/border-box-control/test/index.d.ts +0 -2
  883. package/build-types/border-box-control/test/index.d.ts.map +0 -1
  884. package/build-types/border-box-control/test/utils.d.ts +0 -2
  885. package/build-types/border-box-control/test/utils.d.ts.map +0 -1
  886. package/build-types/border-control/stories/index.story.d.ts +0 -109
  887. package/build-types/border-control/stories/index.story.d.ts.map +0 -1
  888. package/build-types/border-control/styles.d.ts +0 -17
  889. package/build-types/border-control/styles.d.ts.map +0 -1
  890. package/build-types/box-control/stories/index.story.d.ts +0 -12
  891. package/build-types/box-control/stories/index.story.d.ts.map +0 -1
  892. package/build-types/box-control/styles/box-control-styles.d.ts +0 -65
  893. package/build-types/box-control/styles/box-control-styles.d.ts.map +0 -1
  894. package/build-types/box-control/test/index.d.ts +0 -2
  895. package/build-types/box-control/test/index.d.ts.map +0 -1
  896. package/build-types/button/stories/e2e/index.story.d.ts +0 -9
  897. package/build-types/button/stories/e2e/index.story.d.ts.map +0 -1
  898. package/build-types/button/stories/index.story.d.ts +0 -31
  899. package/build-types/button/stories/index.story.d.ts.map +0 -1
  900. package/build-types/button/test/index.d.ts +0 -2
  901. package/build-types/button/test/index.d.ts.map +0 -1
  902. package/build-types/button-group/stories/index.story.d.ts +0 -12
  903. package/build-types/button-group/stories/index.story.d.ts.map +0 -1
  904. package/build-types/card/stories/index.story.d.ts +0 -20
  905. package/build-types/card/stories/index.story.d.ts.map +0 -1
  906. package/build-types/card/test/index.d.ts +0 -2
  907. package/build-types/card/test/index.d.ts.map +0 -1
  908. package/build-types/checkbox-control/stories/index.story.d.ts +0 -24
  909. package/build-types/checkbox-control/stories/index.story.d.ts.map +0 -1
  910. package/build-types/checkbox-control/test/index.d.ts +0 -2
  911. package/build-types/checkbox-control/test/index.d.ts.map +0 -1
  912. package/build-types/circular-option-picker/stories/index.story.d.ts +0 -10
  913. package/build-types/circular-option-picker/stories/index.story.d.ts.map +0 -1
  914. package/build-types/circular-option-picker/test/index.d.ts +0 -2
  915. package/build-types/circular-option-picker/test/index.d.ts.map +0 -1
  916. package/build-types/color-indicator/stories/index.story.d.ts +0 -6
  917. package/build-types/color-indicator/stories/index.story.d.ts.map +0 -1
  918. package/build-types/color-indicator/test/index.d.ts +0 -2
  919. package/build-types/color-indicator/test/index.d.ts.map +0 -1
  920. package/build-types/color-palette/stories/index.story.d.ts +0 -11
  921. package/build-types/color-palette/stories/index.story.d.ts.map +0 -1
  922. package/build-types/color-palette/styles.d.ts +0 -11
  923. package/build-types/color-palette/styles.d.ts.map +0 -1
  924. package/build-types/color-palette/test/index.d.ts +0 -2
  925. package/build-types/color-palette/test/index.d.ts.map +0 -1
  926. package/build-types/color-palette/test/utils.d.ts +0 -2
  927. package/build-types/color-palette/test/utils.d.ts.map +0 -1
  928. package/build-types/color-picker/stories/index.story.d.ts +0 -6
  929. package/build-types/color-picker/stories/index.story.d.ts.map +0 -1
  930. package/build-types/color-picker/test/index.d.ts +0 -2
  931. package/build-types/color-picker/test/index.d.ts.map +0 -1
  932. package/build-types/combobox-control/stories/index.story.d.ts +0 -93
  933. package/build-types/combobox-control/stories/index.story.d.ts.map +0 -1
  934. package/build-types/combobox-control/styles.d.ts +0 -6
  935. package/build-types/combobox-control/styles.d.ts.map +0 -1
  936. package/build-types/combobox-control/test/index.d.ts +0 -2
  937. package/build-types/combobox-control/test/index.d.ts.map +0 -1
  938. package/build-types/composite/legacy/stories/index.story.d.ts +0 -9
  939. package/build-types/composite/legacy/stories/index.story.d.ts.map +0 -1
  940. package/build-types/composite/legacy/stories/utils.d.ts +0 -27
  941. package/build-types/composite/legacy/stories/utils.d.ts.map +0 -1
  942. package/build-types/composite/legacy/test/index.d.ts +0 -2
  943. package/build-types/composite/legacy/test/index.d.ts.map +0 -1
  944. package/build-types/composite/stories/index.story.d.ts +0 -33
  945. package/build-types/composite/stories/index.story.d.ts.map +0 -1
  946. package/build-types/composite/test/index.d.ts +0 -2
  947. package/build-types/composite/test/index.d.ts.map +0 -1
  948. package/build-types/confirm-dialog/stories/index.story.d.ts +0 -7
  949. package/build-types/confirm-dialog/stories/index.story.d.ts.map +0 -1
  950. package/build-types/confirm-dialog/test/index.d.ts +0 -2
  951. package/build-types/confirm-dialog/test/index.d.ts.map +0 -1
  952. package/build-types/content-editable-control/stories/index.story.d.ts +0 -7
  953. package/build-types/content-editable-control/stories/index.story.d.ts.map +0 -1
  954. package/build-types/content-editable-control/test/index.d.ts +0 -2
  955. package/build-types/content-editable-control/test/index.d.ts.map +0 -1
  956. package/build-types/context/test/context-connect.d.ts +0 -2
  957. package/build-types/context/test/context-connect.d.ts.map +0 -1
  958. package/build-types/context/test/wordpress-component.d.ts +0 -2
  959. package/build-types/context/test/wordpress-component.d.ts.map +0 -1
  960. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts +0 -2
  961. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts.map +0 -1
  962. package/build-types/custom-gradient-picker/stories/index.story.d.ts +0 -6
  963. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +0 -1
  964. package/build-types/custom-gradient-picker/test/index.d.ts +0 -2
  965. package/build-types/custom-gradient-picker/test/index.d.ts.map +0 -1
  966. package/build-types/custom-gradient-picker/test/serializer.d.ts +0 -2
  967. package/build-types/custom-gradient-picker/test/serializer.d.ts.map +0 -1
  968. package/build-types/custom-select-control/stories/index.story.d.ts +0 -8
  969. package/build-types/custom-select-control/stories/index.story.d.ts.map +0 -1
  970. package/build-types/custom-select-control/test/index.d.ts +0 -2
  971. package/build-types/custom-select-control/test/index.d.ts.map +0 -1
  972. package/build-types/custom-select-control-v2/stories/index.story.d.ts +0 -38
  973. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +0 -1
  974. package/build-types/custom-select-control-v2/test/index.d.ts +0 -2
  975. package/build-types/custom-select-control-v2/test/index.d.ts.map +0 -1
  976. package/build-types/date-time/date-picker/test/index.d.ts +0 -2
  977. package/build-types/date-time/date-picker/test/index.d.ts.map +0 -1
  978. package/build-types/date-time/date-picker/test/use-lilius.d.ts +0 -2
  979. package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +0 -1
  980. package/build-types/date-time/date-time/test/index.d.ts +0 -2
  981. package/build-types/date-time/date-time/test/index.d.ts.map +0 -1
  982. package/build-types/date-time/stories/date-time.story.d.ts +0 -8
  983. package/build-types/date-time/stories/date-time.story.d.ts.map +0 -1
  984. package/build-types/date-time/stories/date.story.d.ts +0 -8
  985. package/build-types/date-time/stories/date.story.d.ts.map +0 -1
  986. package/build-types/date-time/stories/time.story.d.ts +0 -11
  987. package/build-types/date-time/stories/time.story.d.ts.map +0 -1
  988. package/build-types/date-time/stories/utils.d.ts +0 -3
  989. package/build-types/date-time/stories/utils.d.ts.map +0 -1
  990. package/build-types/date-time/test/utils.test.d.ts +0 -2
  991. package/build-types/date-time/test/utils.test.d.ts.map +0 -1
  992. package/build-types/date-time/time-picker/test/index.d.ts +0 -2
  993. package/build-types/date-time/time-picker/test/index.d.ts.map +0 -1
  994. package/build-types/date-time/time-picker/time-input/test/index.d.ts +0 -2
  995. package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +0 -1
  996. package/build-types/disabled/stories/index.story.d.ts +0 -7
  997. package/build-types/disabled/stories/index.story.d.ts.map +0 -1
  998. package/build-types/disabled/test/index.d.ts +0 -2
  999. package/build-types/disabled/test/index.d.ts.map +0 -1
  1000. package/build-types/divider/stories/index.story.d.ts +0 -8
  1001. package/build-types/divider/stories/index.story.d.ts.map +0 -1
  1002. package/build-types/divider/test/index.d.ts +0 -2
  1003. package/build-types/divider/test/index.d.ts.map +0 -1
  1004. package/build-types/draggable/stories/index.story.d.ts +0 -13
  1005. package/build-types/draggable/stories/index.story.d.ts.map +0 -1
  1006. package/build-types/drop-zone/stories/index.story.d.ts +0 -6
  1007. package/build-types/drop-zone/stories/index.story.d.ts.map +0 -1
  1008. package/build-types/dropdown/stories/index.story.d.ts +0 -18
  1009. package/build-types/dropdown/stories/index.story.d.ts.map +0 -1
  1010. package/build-types/dropdown/styles.d.ts +0 -6
  1011. package/build-types/dropdown/styles.d.ts.map +0 -1
  1012. package/build-types/dropdown/test/index.d.ts +0 -2
  1013. package/build-types/dropdown/test/index.d.ts.map +0 -1
  1014. package/build-types/dropdown-menu/stories/index.story.d.ts +0 -7
  1015. package/build-types/dropdown-menu/stories/index.story.d.ts.map +0 -1
  1016. package/build-types/dropdown-menu/test/index.d.ts +0 -2
  1017. package/build-types/dropdown-menu/test/index.d.ts.map +0 -1
  1018. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +0 -7
  1019. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +0 -1
  1020. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +0 -8
  1021. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +0 -1
  1022. package/build-types/elevation/stories/index.story.d.ts +0 -16
  1023. package/build-types/elevation/stories/index.story.d.ts.map +0 -1
  1024. package/build-types/elevation/test/index.d.ts +0 -2
  1025. package/build-types/elevation/test/index.d.ts.map +0 -1
  1026. package/build-types/external-link/stories/index.story.d.ts +0 -6
  1027. package/build-types/external-link/stories/index.story.d.ts.map +0 -1
  1028. package/build-types/external-link/test/index.d.ts +0 -2
  1029. package/build-types/external-link/test/index.d.ts.map +0 -1
  1030. package/build-types/flex/stories/index.story.d.ts +0 -7
  1031. package/build-types/flex/stories/index.story.d.ts.map +0 -1
  1032. package/build-types/flex/test/index.d.ts +0 -2
  1033. package/build-types/flex/test/index.d.ts.map +0 -1
  1034. package/build-types/focal-point-picker/stories/index.story.d.ts +0 -49
  1035. package/build-types/focal-point-picker/stories/index.story.d.ts.map +0 -1
  1036. package/build-types/focal-point-picker/test/index.d.ts +0 -2
  1037. package/build-types/focal-point-picker/test/index.d.ts.map +0 -1
  1038. package/build-types/focal-point-picker/test/media.d.ts +0 -2
  1039. package/build-types/focal-point-picker/test/media.d.ts.map +0 -1
  1040. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +0 -20
  1041. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +0 -1
  1042. package/build-types/font-size-picker/stories/index.story.d.ts +0 -26
  1043. package/build-types/font-size-picker/stories/index.story.d.ts.map +0 -1
  1044. package/build-types/font-size-picker/test/font-size-picker-select.d.ts +0 -2
  1045. package/build-types/font-size-picker/test/font-size-picker-select.d.ts.map +0 -1
  1046. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts +0 -2
  1047. package/build-types/font-size-picker/test/font-size-picker-toggle-group.d.ts.map +0 -1
  1048. package/build-types/font-size-picker/test/index.d.ts +0 -2
  1049. package/build-types/font-size-picker/test/index.d.ts.map +0 -1
  1050. package/build-types/font-size-picker/test/utils.d.ts +0 -2
  1051. package/build-types/font-size-picker/test/utils.d.ts.map +0 -1
  1052. package/build-types/form-file-upload/stories/index.story.d.ts +0 -17
  1053. package/build-types/form-file-upload/stories/index.story.d.ts.map +0 -1
  1054. package/build-types/form-file-upload/test/index.d.ts +0 -2
  1055. package/build-types/form-file-upload/test/index.d.ts.map +0 -1
  1056. package/build-types/form-toggle/stories/index.story.d.ts +0 -6
  1057. package/build-types/form-toggle/stories/index.story.d.ts.map +0 -1
  1058. package/build-types/form-toggle/test/index.d.ts +0 -2
  1059. package/build-types/form-toggle/test/index.d.ts.map +0 -1
  1060. package/build-types/form-token-field/stories/index.story.d.ts +0 -25
  1061. package/build-types/form-token-field/stories/index.story.d.ts.map +0 -1
  1062. package/build-types/form-token-field/test/index.d.ts +0 -2
  1063. package/build-types/form-token-field/test/index.d.ts.map +0 -1
  1064. package/build-types/gradient-picker/stories/index.story.d.ts +0 -11
  1065. package/build-types/gradient-picker/stories/index.story.d.ts.map +0 -1
  1066. package/build-types/gradient-picker/test/index.d.ts +0 -2
  1067. package/build-types/gradient-picker/test/index.d.ts.map +0 -1
  1068. package/build-types/grid/stories/index.story.d.ts +0 -6
  1069. package/build-types/grid/stories/index.story.d.ts.map +0 -1
  1070. package/build-types/grid/test/grid.d.ts +0 -2
  1071. package/build-types/grid/test/grid.d.ts.map +0 -1
  1072. package/build-types/guide/stories/index.story.d.ts +0 -6
  1073. package/build-types/guide/stories/index.story.d.ts.map +0 -1
  1074. package/build-types/guide/test/index.d.ts +0 -2
  1075. package/build-types/guide/test/index.d.ts.map +0 -1
  1076. package/build-types/h-stack/stories/e2e/index.story.d.ts +0 -6
  1077. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +0 -1
  1078. package/build-types/h-stack/stories/index.story.d.ts +0 -6
  1079. package/build-types/h-stack/stories/index.story.d.ts.map +0 -1
  1080. package/build-types/h-stack/test/index.d.ts +0 -2
  1081. package/build-types/h-stack/test/index.d.ts.map +0 -1
  1082. package/build-types/heading/stories/index.story.d.ts +0 -6
  1083. package/build-types/heading/stories/index.story.d.ts.map +0 -1
  1084. package/build-types/heading/test/index.d.ts +0 -2
  1085. package/build-types/heading/test/index.d.ts.map +0 -1
  1086. package/build-types/higher-order/with-fallback-styles/test/index.d.ts +0 -2
  1087. package/build-types/higher-order/with-fallback-styles/test/index.d.ts.map +0 -1
  1088. package/build-types/higher-order/with-filters/test/index.d.ts +0 -2
  1089. package/build-types/higher-order/with-filters/test/index.d.ts.map +0 -1
  1090. package/build-types/higher-order/with-focus-outside/test/index.d.ts +0 -2
  1091. package/build-types/higher-order/with-focus-outside/test/index.d.ts.map +0 -1
  1092. package/build-types/higher-order/with-focus-return/test/index.d.ts +0 -2
  1093. package/build-types/higher-order/with-focus-return/test/index.d.ts.map +0 -1
  1094. package/build-types/higher-order/with-notices/test/index.d.ts +0 -2
  1095. package/build-types/higher-order/with-notices/test/index.d.ts.map +0 -1
  1096. package/build-types/higher-order/with-spoken-messages/test/index.d.ts +0 -2
  1097. package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +0 -1
  1098. package/build-types/icon/stories/index.story.d.ts +0 -21
  1099. package/build-types/icon/stories/index.story.d.ts.map +0 -1
  1100. package/build-types/icon/test/index.d.ts +0 -2
  1101. package/build-types/icon/test/index.d.ts.map +0 -1
  1102. package/build-types/input-control/stories/index.story.d.ts +0 -31
  1103. package/build-types/input-control/stories/index.story.d.ts.map +0 -1
  1104. package/build-types/isolated-event-container/test/index.d.ts +0 -2
  1105. package/build-types/isolated-event-container/test/index.d.ts.map +0 -1
  1106. package/build-types/item-group/stories/index.story.d.ts +0 -9
  1107. package/build-types/item-group/stories/index.story.d.ts.map +0 -1
  1108. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +0 -6
  1109. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +0 -1
  1110. package/build-types/keyboard-shortcuts/test/index.d.ts +0 -2
  1111. package/build-types/keyboard-shortcuts/test/index.d.ts.map +0 -1
  1112. package/build-types/menu/stories/index.story.d.ts +0 -13
  1113. package/build-types/menu/stories/index.story.d.ts.map +0 -1
  1114. package/build-types/menu/test/index.d.ts +0 -2
  1115. package/build-types/menu/test/index.d.ts.map +0 -1
  1116. package/build-types/menu-group/stories/index.story.d.ts +0 -11
  1117. package/build-types/menu-group/stories/index.story.d.ts.map +0 -1
  1118. package/build-types/menu-group/test/index.d.ts +0 -2
  1119. package/build-types/menu-group/test/index.d.ts.map +0 -1
  1120. package/build-types/menu-item/stories/index.story.d.ts +0 -70
  1121. package/build-types/menu-item/stories/index.story.d.ts.map +0 -1
  1122. package/build-types/menu-items-choice/stories/index.story.d.ts +0 -6
  1123. package/build-types/menu-items-choice/stories/index.story.d.ts.map +0 -1
  1124. package/build-types/modal/stories/index.story.d.ts +0 -11
  1125. package/build-types/modal/stories/index.story.d.ts.map +0 -1
  1126. package/build-types/modal/test/aria-helper.d.ts +0 -2
  1127. package/build-types/modal/test/aria-helper.d.ts.map +0 -1
  1128. package/build-types/modal/test/index.d.ts +0 -2
  1129. package/build-types/modal/test/index.d.ts.map +0 -1
  1130. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +0 -6
  1131. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +0 -1
  1132. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +0 -6
  1133. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +0 -1
  1134. package/build-types/navigable-container/test/navigable-menu.d.ts +0 -2
  1135. package/build-types/navigable-container/test/navigable-menu.d.ts.map +0 -1
  1136. package/build-types/navigable-container/test/tababble-container.d.ts +0 -2
  1137. package/build-types/navigable-container/test/tababble-container.d.ts.map +0 -1
  1138. package/build-types/navigator/stories/index.story.d.ts +0 -8
  1139. package/build-types/navigator/stories/index.story.d.ts.map +0 -1
  1140. package/build-types/navigator/test/index.d.ts +0 -2
  1141. package/build-types/navigator/test/index.d.ts.map +0 -1
  1142. package/build-types/navigator/test/router.d.ts +0 -2
  1143. package/build-types/navigator/test/router.d.ts.map +0 -1
  1144. package/build-types/notice/stories/index.story.d.ts +0 -15
  1145. package/build-types/notice/stories/index.story.d.ts.map +0 -1
  1146. package/build-types/notice/test/index.d.ts +0 -2
  1147. package/build-types/notice/test/index.d.ts.map +0 -1
  1148. package/build-types/notice/test/list.d.ts +0 -2
  1149. package/build-types/notice/test/list.d.ts.map +0 -1
  1150. package/build-types/number-control/stories/index.story.d.ts +0 -19
  1151. package/build-types/number-control/stories/index.story.d.ts.map +0 -1
  1152. package/build-types/number-control/test/index.d.ts +0 -2
  1153. package/build-types/number-control/test/index.d.ts.map +0 -1
  1154. package/build-types/palette-edit/stories/index.story.d.ts +0 -7
  1155. package/build-types/palette-edit/stories/index.story.d.ts.map +0 -1
  1156. package/build-types/palette-edit/test/index.d.ts +0 -2
  1157. package/build-types/palette-edit/test/index.d.ts.map +0 -1
  1158. package/build-types/panel/stories/index.story.d.ts +0 -13
  1159. package/build-types/panel/stories/index.story.d.ts.map +0 -1
  1160. package/build-types/panel/test/body.d.ts +0 -2
  1161. package/build-types/panel/test/body.d.ts.map +0 -1
  1162. package/build-types/panel/test/header.d.ts +0 -2
  1163. package/build-types/panel/test/header.d.ts.map +0 -1
  1164. package/build-types/panel/test/index.d.ts +0 -2
  1165. package/build-types/panel/test/index.d.ts.map +0 -1
  1166. package/build-types/panel/test/row.d.ts +0 -2
  1167. package/build-types/panel/test/row.d.ts.map +0 -1
  1168. package/build-types/placeholder/stories/index.story.d.ts +0 -6
  1169. package/build-types/placeholder/stories/index.story.d.ts.map +0 -1
  1170. package/build-types/placeholder/test/index.d.ts +0 -2
  1171. package/build-types/placeholder/test/index.d.ts.map +0 -1
  1172. package/build-types/popover/stories/e2e/index.story.d.ts +0 -18
  1173. package/build-types/popover/stories/e2e/index.story.d.ts.map +0 -1
  1174. package/build-types/popover/stories/index.story.d.ts +0 -11
  1175. package/build-types/popover/stories/index.story.d.ts.map +0 -1
  1176. package/build-types/popover/test/index.d.ts +0 -2
  1177. package/build-types/popover/test/index.d.ts.map +0 -1
  1178. package/build-types/popover/test/utils/index.d.ts +0 -3
  1179. package/build-types/popover/test/utils/index.d.ts.map +0 -1
  1180. package/build-types/progress-bar/stories/index.story.d.ts +0 -23
  1181. package/build-types/progress-bar/stories/index.story.d.ts.map +0 -1
  1182. package/build-types/progress-bar/styles.d.ts +0 -16
  1183. package/build-types/progress-bar/styles.d.ts.map +0 -1
  1184. package/build-types/progress-bar/test/index.d.ts +0 -2
  1185. package/build-types/progress-bar/test/index.d.ts.map +0 -1
  1186. package/build-types/query-controls/stories/index.story.d.ts +0 -7
  1187. package/build-types/query-controls/stories/index.story.d.ts.map +0 -1
  1188. package/build-types/query-controls/test/terms.d.ts +0 -2
  1189. package/build-types/query-controls/test/terms.d.ts.map +0 -1
  1190. package/build-types/radio-control/stories/index.story.d.ts +0 -7
  1191. package/build-types/radio-control/stories/index.story.d.ts.map +0 -1
  1192. package/build-types/radio-control/test/index.d.ts +0 -2
  1193. package/build-types/radio-control/test/index.d.ts.map +0 -1
  1194. package/build-types/radio-group/stories/index.story.d.ts +0 -8
  1195. package/build-types/radio-group/stories/index.story.d.ts.map +0 -1
  1196. package/build-types/range-control/stories/index.story.d.ts +0 -42
  1197. package/build-types/range-control/stories/index.story.d.ts.map +0 -1
  1198. package/build-types/range-control/test/index.d.ts +0 -2
  1199. package/build-types/range-control/test/index.d.ts.map +0 -1
  1200. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +0 -18
  1201. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +0 -1
  1202. package/build-types/resizable-box/stories/index.story.d.ts +0 -46
  1203. package/build-types/resizable-box/stories/index.story.d.ts.map +0 -1
  1204. package/build-types/responsive-wrapper/stories/index.story.d.ts +0 -16
  1205. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +0 -1
  1206. package/build-types/sandbox/stories/index.story.d.ts +0 -7
  1207. package/build-types/sandbox/stories/index.story.d.ts.map +0 -1
  1208. package/build-types/sandbox/test/index.d.ts +0 -2
  1209. package/build-types/sandbox/test/index.d.ts.map +0 -1
  1210. package/build-types/scroll-lock/stories/index.story.d.ts +0 -6
  1211. package/build-types/scroll-lock/stories/index.story.d.ts.map +0 -1
  1212. package/build-types/scroll-lock/test/index.d.ts +0 -2
  1213. package/build-types/scroll-lock/test/index.d.ts.map +0 -1
  1214. package/build-types/scrollable/stories/index.story.d.ts +0 -6
  1215. package/build-types/scrollable/stories/index.story.d.ts.map +0 -1
  1216. package/build-types/scrollable/styles.d.ts +0 -8
  1217. package/build-types/scrollable/styles.d.ts.map +0 -1
  1218. package/build-types/scrollable/test/index.d.ts +0 -2
  1219. package/build-types/scrollable/test/index.d.ts.map +0 -1
  1220. package/build-types/search-control/stories/index.story.d.ts +0 -18
  1221. package/build-types/search-control/stories/index.story.d.ts.map +0 -1
  1222. package/build-types/search-control/test/index.d.ts +0 -2
  1223. package/build-types/search-control/test/index.d.ts.map +0 -1
  1224. package/build-types/select-control/stories/index.story.d.ts +0 -28
  1225. package/build-types/select-control/stories/index.story.d.ts.map +0 -1
  1226. package/build-types/select-control/test/select-control.d.ts +0 -2
  1227. package/build-types/select-control/test/select-control.d.ts.map +0 -1
  1228. package/build-types/shortcut/stories/index.story.d.ts +0 -7
  1229. package/build-types/shortcut/stories/index.story.d.ts.map +0 -1
  1230. package/build-types/shortcut/test/index.d.ts +0 -2
  1231. package/build-types/shortcut/test/index.d.ts.map +0 -1
  1232. package/build-types/slot-fill/stories/index.story.d.ts +0 -10
  1233. package/build-types/slot-fill/stories/index.story.d.ts.map +0 -1
  1234. package/build-types/snackbar/stories/index.story.d.ts +0 -10
  1235. package/build-types/snackbar/stories/index.story.d.ts.map +0 -1
  1236. package/build-types/snackbar/stories/list.story.d.ts +0 -6
  1237. package/build-types/snackbar/stories/list.story.d.ts.map +0 -1
  1238. package/build-types/snackbar/test/index.d.ts +0 -2
  1239. package/build-types/snackbar/test/index.d.ts.map +0 -1
  1240. package/build-types/snackbar/test/list.d.ts +0 -2
  1241. package/build-types/snackbar/test/list.d.ts.map +0 -1
  1242. package/build-types/spacer/stories/index.story.d.ts +0 -7
  1243. package/build-types/spacer/stories/index.story.d.ts.map +0 -1
  1244. package/build-types/spacer/test/index.d.ts +0 -2
  1245. package/build-types/spacer/test/index.d.ts.map +0 -1
  1246. package/build-types/spinner/stories/index.story.d.ts +0 -7
  1247. package/build-types/spinner/stories/index.story.d.ts.map +0 -1
  1248. package/build-types/style-provider/test/index.d.ts +0 -2
  1249. package/build-types/style-provider/test/index.d.ts.map +0 -1
  1250. package/build-types/surface/stories/index.story.d.ts +0 -6
  1251. package/build-types/surface/stories/index.story.d.ts.map +0 -1
  1252. package/build-types/surface/test/index.d.ts +0 -2
  1253. package/build-types/surface/test/index.d.ts.map +0 -1
  1254. package/build-types/tab-panel/stories/index.story.d.ts +0 -9
  1255. package/build-types/tab-panel/stories/index.story.d.ts.map +0 -1
  1256. package/build-types/tab-panel/test/index.d.ts +0 -2
  1257. package/build-types/tab-panel/test/index.d.ts.map +0 -1
  1258. package/build-types/tabs/stories/index.story.d.ts +0 -13
  1259. package/build-types/tabs/stories/index.story.d.ts.map +0 -1
  1260. package/build-types/tabs/test/index.d.ts +0 -2
  1261. package/build-types/tabs/test/index.d.ts.map +0 -1
  1262. package/build-types/text/stories/index.story.d.ts +0 -14
  1263. package/build-types/text/stories/index.story.d.ts.map +0 -1
  1264. package/build-types/text/test/index.d.ts +0 -2
  1265. package/build-types/text/test/index.d.ts.map +0 -1
  1266. package/build-types/text-control/stories/index.story.d.ts +0 -7
  1267. package/build-types/text-control/stories/index.story.d.ts.map +0 -1
  1268. package/build-types/text-control/test/text-control.d.ts +0 -2
  1269. package/build-types/text-control/test/text-control.d.ts.map +0 -1
  1270. package/build-types/text-highlight/stories/index.story.d.ts +0 -6
  1271. package/build-types/text-highlight/stories/index.story.d.ts.map +0 -1
  1272. package/build-types/text-highlight/test/index.d.ts +0 -2
  1273. package/build-types/text-highlight/test/index.d.ts.map +0 -1
  1274. package/build-types/textarea-control/stories/index.story.d.ts +0 -6
  1275. package/build-types/textarea-control/stories/index.story.d.ts.map +0 -1
  1276. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +0 -5
  1277. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +0 -1
  1278. package/build-types/tip/stories/index.story.d.ts +0 -6
  1279. package/build-types/tip/stories/index.story.d.ts.map +0 -1
  1280. package/build-types/toggle-control/stories/index.story.d.ts +0 -13
  1281. package/build-types/toggle-control/stories/index.story.d.ts.map +0 -1
  1282. package/build-types/toggle-control/test/index.d.ts +0 -2
  1283. package/build-types/toggle-control/test/index.d.ts.map +0 -1
  1284. package/build-types/toggle-group-control/stories/index.story.d.ts +0 -21
  1285. package/build-types/toggle-group-control/stories/index.story.d.ts.map +0 -1
  1286. package/build-types/toggle-group-control/test/index.d.ts +0 -2
  1287. package/build-types/toggle-group-control/test/index.d.ts.map +0 -1
  1288. package/build-types/toolbar/stories/index.story.d.ts +0 -12
  1289. package/build-types/toolbar/stories/index.story.d.ts.map +0 -1
  1290. package/build-types/toolbar/test/index.d.ts +0 -2
  1291. package/build-types/toolbar/test/index.d.ts.map +0 -1
  1292. package/build-types/toolbar/test/toolbar-group.d.ts +0 -2
  1293. package/build-types/toolbar/test/toolbar-group.d.ts.map +0 -1
  1294. package/build-types/tools-panel/stories/index.story.d.ts +0 -11
  1295. package/build-types/tools-panel/stories/index.story.d.ts.map +0 -1
  1296. package/build-types/tools-panel/test/index.d.ts +0 -2
  1297. package/build-types/tools-panel/test/index.d.ts.map +0 -1
  1298. package/build-types/tooltip/stories/index.story.d.ts +0 -15
  1299. package/build-types/tooltip/stories/index.story.d.ts.map +0 -1
  1300. package/build-types/tooltip/test/index.d.ts +0 -2
  1301. package/build-types/tooltip/test/index.d.ts.map +0 -1
  1302. package/build-types/tooltip/test/utils/index.d.ts +0 -7
  1303. package/build-types/tooltip/test/utils/index.d.ts.map +0 -1
  1304. package/build-types/tree-grid/stories/index.story.d.ts +0 -6
  1305. package/build-types/tree-grid/stories/index.story.d.ts.map +0 -1
  1306. package/build-types/tree-grid/test/cell.d.ts +0 -2
  1307. package/build-types/tree-grid/test/cell.d.ts.map +0 -1
  1308. package/build-types/tree-grid/test/index.d.ts +0 -2
  1309. package/build-types/tree-grid/test/index.d.ts.map +0 -1
  1310. package/build-types/tree-grid/test/roving-tab-index-item.d.ts +0 -2
  1311. package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +0 -1
  1312. package/build-types/tree-grid/test/roving-tab-index.d.ts +0 -2
  1313. package/build-types/tree-grid/test/roving-tab-index.d.ts.map +0 -1
  1314. package/build-types/tree-grid/test/row.d.ts +0 -2
  1315. package/build-types/tree-grid/test/row.d.ts.map +0 -1
  1316. package/build-types/tree-select/stories/index.story.d.ts +0 -6
  1317. package/build-types/tree-select/stories/index.story.d.ts.map +0 -1
  1318. package/build-types/truncate/stories/index.story.d.ts +0 -7
  1319. package/build-types/truncate/stories/index.story.d.ts.map +0 -1
  1320. package/build-types/truncate/test/index.d.ts +0 -2
  1321. package/build-types/truncate/test/index.d.ts.map +0 -1
  1322. package/build-types/unit-control/stories/index.story.d.ts +0 -27
  1323. package/build-types/unit-control/stories/index.story.d.ts.map +0 -1
  1324. package/build-types/unit-control/test/index.d.ts +0 -2
  1325. package/build-types/unit-control/test/index.d.ts.map +0 -1
  1326. package/build-types/unit-control/test/utils.d.ts +0 -2
  1327. package/build-types/unit-control/test/utils.d.ts.map +0 -1
  1328. package/build-types/utils/test/polymorphic-element.d.ts +0 -2
  1329. package/build-types/utils/test/polymorphic-element.d.ts.map +0 -1
  1330. package/build-types/v-stack/stories/e2e/index.story.d.ts +0 -6
  1331. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +0 -1
  1332. package/build-types/v-stack/stories/index.story.d.ts +0 -11
  1333. package/build-types/v-stack/stories/index.story.d.ts.map +0 -1
  1334. package/build-types/v-stack/test/index.d.ts +0 -2
  1335. package/build-types/v-stack/test/index.d.ts.map +0 -1
  1336. package/build-types/validated-form-controls/components/combobox-control.d.ts +0 -20
  1337. package/build-types/validated-form-controls/components/combobox-control.d.ts.map +0 -1
  1338. package/build-types/validated-form-controls/components/form-token-field.d.ts +0 -3
  1339. package/build-types/validated-form-controls/components/form-token-field.d.ts.map +0 -1
  1340. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +0 -6
  1341. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +0 -1
  1342. package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts +0 -6
  1343. package/build-types/validated-form-controls/components/stories/content-editable-control.story.d.ts.map +0 -1
  1344. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +0 -6
  1345. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +0 -1
  1346. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts +0 -9
  1347. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +0 -1
  1348. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +0 -12
  1349. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +0 -1
  1350. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +0 -60
  1351. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +0 -1
  1352. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +0 -6
  1353. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +0 -1
  1354. package/build-types/validated-form-controls/components/stories/story-utils.d.ts +0 -3
  1355. package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +0 -1
  1356. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +0 -6
  1357. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +0 -1
  1358. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +0 -6
  1359. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +0 -1
  1360. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +0 -6
  1361. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +0 -1
  1362. package/build-types/validated-form-controls/components/toggle-control.d.ts +0 -7
  1363. package/build-types/validated-form-controls/components/toggle-control.d.ts.map +0 -1
  1364. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +0 -15
  1365. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +0 -1
  1366. package/build-types/validated-form-controls/control-with-error.d.ts +0 -36
  1367. package/build-types/validated-form-controls/control-with-error.d.ts.map +0 -1
  1368. package/build-types/validated-form-controls/test/combobox-control.d.ts +0 -2
  1369. package/build-types/validated-form-controls/test/combobox-control.d.ts.map +0 -1
  1370. package/build-types/validated-form-controls/test/content-editable-control.d.ts +0 -2
  1371. package/build-types/validated-form-controls/test/content-editable-control.d.ts.map +0 -1
  1372. package/build-types/validated-form-controls/test/control-with-error.d.ts +0 -2
  1373. package/build-types/validated-form-controls/test/control-with-error.d.ts.map +0 -1
  1374. package/build-types/validated-form-controls/test/custom-select-control.d.ts +0 -2
  1375. package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +0 -1
  1376. package/build-types/validated-form-controls/test/form-token-field.d.ts +0 -2
  1377. package/build-types/validated-form-controls/test/form-token-field.d.ts.map +0 -1
  1378. package/build-types/validated-form-controls/test/input-control.d.ts +0 -2
  1379. package/build-types/validated-form-controls/test/input-control.d.ts.map +0 -1
  1380. package/build-types/validated-form-controls/test/range-control.d.ts +0 -2
  1381. package/build-types/validated-form-controls/test/range-control.d.ts.map +0 -1
  1382. package/build-types/validated-form-controls/test/textarea-control.d.ts +0 -2
  1383. package/build-types/validated-form-controls/test/textarea-control.d.ts.map +0 -1
  1384. package/build-types/validated-form-controls/test/toggle-control.d.ts +0 -2
  1385. package/build-types/validated-form-controls/test/toggle-control.d.ts.map +0 -1
  1386. package/build-types/validated-form-controls/test/toggle-group-control.d.ts +0 -2
  1387. package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +0 -1
  1388. package/build-types/validated-form-controls/validity-indicator.d.ts +0 -6
  1389. package/build-types/validated-form-controls/validity-indicator.d.ts.map +0 -1
  1390. package/build-types/view/stories/index.story.d.ts +0 -6
  1391. package/build-types/view/stories/index.story.d.ts.map +0 -1
  1392. package/build-types/visually-hidden/stories/index.story.d.ts +0 -8
  1393. package/build-types/visually-hidden/stories/index.story.d.ts.map +0 -1
  1394. package/build-types/z-stack/stories/index.story.d.ts +0 -6
  1395. package/build-types/z-stack/stories/index.story.d.ts.map +0 -1
  1396. package/build-types/z-stack/styles.d.ts +0 -14
  1397. package/build-types/z-stack/styles.d.ts.map +0 -1
  1398. package/src/base-control/styles/base-control-styles.ts +0 -46
  1399. package/src/border-box-control/styles.ts +0 -71
  1400. package/src/border-control/styles.ts +0 -151
  1401. package/src/box-control/styles/box-control-styles.ts +0 -34
  1402. package/src/circular-option-picker/test/index.tsx +0 -113
  1403. package/src/color-palette/styles.ts +0 -13
  1404. package/src/combobox-control/styles.ts +0 -9
  1405. package/src/context/test/__snapshots__/context-system-provider.js.snap +0 -35
  1406. package/src/dropdown/styles.ts +0 -33
  1407. package/src/higher-order/with-filters/test/__snapshots__/index.tsx.snap +0 -87
  1408. package/src/palette-edit/test/index.tsx +0 -464
  1409. package/src/panel/test/__snapshots__/body.tsx.snap +0 -9
  1410. package/src/panel/test/__snapshots__/header.tsx.snap +0 -9
  1411. package/src/panel/test/__snapshots__/index.tsx.snap +0 -17
  1412. package/src/panel/test/__snapshots__/row.tsx.snap +0 -17
  1413. package/src/progress-bar/styles.ts +0 -84
  1414. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +0 -47
  1415. package/src/scrollable/styles.ts +0 -57
  1416. package/src/scrollable/test/__snapshots__/index.tsx.snap +0 -66
  1417. package/src/scrollable/test/index.tsx +0 -31
  1418. package/src/shortcut/test/__snapshots__/index.tsx.snap +0 -15
  1419. package/src/snackbar/test/list.tsx +0 -39
  1420. package/src/textarea-control/styles/textarea-control-styles.ts +0 -90
  1421. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +0 -463
  1422. package/src/tree-grid/test/__snapshots__/index.tsx.snap +0 -3
  1423. package/src/tree-grid/test/__snapshots__/roving-tab-index-item.tsx.snap +0 -27
  1424. package/src/tree-grid/test/__snapshots__/roving-tab-index.tsx.snap +0 -9
  1425. package/src/tree-grid/test/cell.tsx +0 -46
  1426. package/src/tree-grid/test/row.tsx +0 -37
  1427. package/src/validated-form-controls/components/combobox-control.tsx +0 -56
  1428. package/src/validated-form-controls/components/form-token-field.tsx +0 -57
  1429. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +0 -56
  1430. package/src/validated-form-controls/components/stories/form-token-field.story.tsx +0 -60
  1431. package/src/validated-form-controls/components/stories/input-control.story.tsx +0 -126
  1432. package/src/validated-form-controls/components/stories/overview.story.tsx +0 -560
  1433. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +0 -50
  1434. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +0 -47
  1435. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +0 -58
  1436. package/src/validated-form-controls/components/toggle-control.tsx +0 -40
  1437. package/src/validated-form-controls/components/toggle-group-control.tsx +0 -55
  1438. package/src/validated-form-controls/control-with-error.tsx +0 -321
  1439. package/src/validated-form-controls/test/combobox-control.tsx +0 -61
  1440. package/src/validated-form-controls/test/control-with-error.tsx +0 -577
  1441. package/src/validated-form-controls/test/form-token-field.tsx +0 -52
  1442. package/src/validated-form-controls/test/toggle-control.tsx +0 -49
  1443. package/src/validated-form-controls/test/toggle-group-control.tsx +0 -28
  1444. package/src/validated-form-controls/validity-indicator.tsx +0 -40
  1445. package/src/z-stack/styles.ts +0 -35
  1446. /package/src/card/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1447. /package/src/color-picker/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1448. /package/src/custom-select-control/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1449. /package/src/custom-select-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1450. /package/src/divider/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1451. /package/src/elevation/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1452. /package/src/elevation/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1453. /package/src/flex/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1454. /package/src/flex/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1455. /package/src/form-file-upload/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1456. /package/src/grid/test/{grid.tsx → grid.jsdom.test.tsx} +0 -0
  1457. /package/src/heading/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1458. /package/src/heading/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1459. /package/src/input-control/test/__snapshots__/{index.js.snap → index.jsdom.test.tsx.snap} +0 -0
  1460. /package/src/search-control/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1461. /package/src/select-control/test/__snapshots__/{select-control.tsx.snap → select-control.jsdom.test.tsx.snap} +0 -0
  1462. /package/src/select-control/test/{select-control.tsx → select-control.jsdom.test.tsx} +0 -0
  1463. /package/src/slot-fill/test/__snapshots__/{slot.js.snap → slot.jsdom.test.tsx.snap} +0 -0
  1464. /package/src/spacer/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1465. /package/src/spacer/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1466. /package/src/text/test/__snapshots__/{index.tsx.snap → index.jsdom.test.tsx.snap} +0 -0
  1467. /package/src/text/test/{index.tsx → index.jsdom.test.tsx} +0 -0
  1468. /package/src/utils/test/{polymorphic-element.tsx → polymorphic-element.jsdom.test.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/disabled/index.tsx", "../../../style-runtime/src/index.ts", "../../src/disabled/style.module.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport Context from './context';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst {\n Consumer,\n Provider\n} = Context;\n\n/**\n * `Disabled` is a component which disables descendant tabbable elements and\n * prevents pointer interaction.\n *\n * _Note: this component may not behave as expected in browsers that don't\n * support the `inert` HTML attribute. We recommend adding the official WICG\n * polyfill when using this component in your project._\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n *\n * ```jsx\n * import { Button, Disabled, TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDisabled = () => {\n * \tconst [ isDisabled, setIsDisabled ] = useState( true );\n *\n *\tlet input = (\n *\t\t<TextControl\n *\t\t\tlabel=\"Input\"\n *\t\t\tonChange={ () => {} }\n *\t\t/>\n *\t);\n * \tif ( isDisabled ) {\n * \t\tinput = <Disabled>{ input }</Disabled>;\n * \t}\n *\n * \tconst toggleDisabled = () => {\n * \t\tsetIsDisabled( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t{ input }\n * \t\t\t<Button variant=\"primary\" onClick={ toggleDisabled }>\n * \t\t\t\tToggle Disabled\n * \t\t\t</Button>\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nfunction Disabled({\n className,\n children,\n isDisabled = true,\n ...props\n}) {\n return /*#__PURE__*/_jsx(Provider, {\n value: isDisabled,\n children: /*#__PURE__*/_jsx(\"div\", {\n // @ts-expect-error `inert` is not declared in React 18's HTML attribute types.\n inert: isDisabled ? 'true' : undefined,\n className: isDisabled ? clsx(styles.disabled, className, 'components-disabled') : undefined,\n ...props,\n children: children\n })\n });\n}\nDisabled.Context = Context;\nDisabled.Consumer = Consumer;\nexport default Disabled;", "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(\"bacc423d2b\", \"._556ae8be2a7ddc8e__disabled{pointer-events:none;position:relative}._556ae8be2a7ddc8e__disabled:after{content:\\\"\\\";inset:0;position:absolute}._556ae8be2a7ddc8e__disabled *{pointer-events:none}\");\n}\nexport default {\"disabled\":\"_556ae8be2a7ddc8e__disabled\"};\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AACjB,OAAO,aAAa;;;ACDpB,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,aAAa;AACnC,qBAAiB,QAAQ;AAAA,EAC3B;AACA,SAAO,YAAY;AACrB;AAUA,SAAS,0BAA0B,gBAAgB,MAAM;AACvD,MAAI,CAAC,eAAe,MAAM;AACxB,WAAO;AAAA,EACT;AACA,aAAW,SAAS,eAAe,KAAK,iBAAiB,SAAS,oBAAoB,GAAG,GAAG;AAC1F,QAAI,MAAM,aAAa,oBAAoB,MAAM,MAAM;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAUA,SAAS,YAAY,gBAAgB,MAAM,KAAK;AAC9C,MAAI,CAAC,eAAe,MAAM;AACxB;AAAA,EACF;AACA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAI,cAAc;AAC9D,MAAI,CAAC,gBAAgB;AACnB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAI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AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,GAAG;AACL,GAAG;AACD,SAAoB,qBAAK,UAAU;AAAA,IACjC,OAAO;AAAA,IACP,UAAuB,qBAAK,OAAO;AAAA;AAAA,MAEjC,OAAO,aAAa,SAAS;AAAA,MAC7B,WAAW,aAAa,KAAK,qBAAO,UAAU,WAAW,qBAAqB,IAAI;AAAA,MAClF,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AACA,SAAS,UAAU;AACnB,SAAS,WAAW;AACpB,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport Context from './context';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst {\n Consumer,\n Provider\n} = Context;\n\n/**\n * `Disabled` is a component which disables descendant tabbable elements and\n * prevents pointer interaction.\n *\n * _Note: this component may not behave as expected in browsers that don't\n * support the `inert` HTML attribute. We recommend adding the official WICG\n * polyfill when using this component in your project._\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n *\n * ```jsx\n * import { Button, Disabled, TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDisabled = () => {\n * \tconst [ isDisabled, setIsDisabled ] = useState( true );\n *\n *\tlet input = (\n *\t\t<TextControl\n *\t\t\tlabel=\"Input\"\n *\t\t\tonChange={ () => {} }\n *\t\t/>\n *\t);\n * \tif ( isDisabled ) {\n * \t\tinput = <Disabled>{ input }</Disabled>;\n * \t}\n *\n * \tconst toggleDisabled = () => {\n * \t\tsetIsDisabled( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t{ input }\n * \t\t\t<Button variant=\"primary\" onClick={ toggleDisabled }>\n * \t\t\t\tToggle Disabled\n * \t\t\t</Button>\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nfunction Disabled({\n className,\n children,\n isDisabled = true,\n ...props\n}) {\n return /*#__PURE__*/_jsx(Provider, {\n value: isDisabled,\n children: /*#__PURE__*/_jsx(\"div\", {\n // @ts-expect-error `inert` is not declared in React 18's HTML attribute types.\n inert: isDisabled ? 'true' : undefined\n // Only the disabled styling is conditional. The consumer's own\n // className has to stick around so the wrapper stays targetable\n // whether or not it is currently disabled.\n ,\n className: clsx(className, isDisabled && [styles.disabled, 'components-disabled']) || undefined,\n ...props,\n children: children\n })\n });\n}\nDisabled.Context = Context;\nDisabled.Consumer = Consumer;\nexport default Disabled;", "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(\"bacc423d2b\", \"._556ae8be2a7ddc8e__disabled{pointer-events:none;position:relative}._556ae8be2a7ddc8e__disabled:after{content:\\\"\\\";inset:0;position:absolute}._556ae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IACF,CAAC;AAAA,EACH,CAAC;AACH;AACA,SAAS,UAAU;AACnB,SAAS,WAAW;AACpB,IAAO,mBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/draggable/index.tsx", "../../../style-runtime/src/index.ts", "../../src/draggable/style.module.scss"],
4
- "sourcesContent": ["import { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { getWpCompatOverlaySlot } from '@wordpress/ui';\nimport styles from './style.module.scss';\n\n// Legacy class names preserved alongside the CSS-module hashed ones for\n// backwards compatibility. `filter(Boolean)` strips `undefined` from Jest's\n// CSS-module mock.\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst dragImageClasses = [styles['invisible-drag-image'], 'components-draggable__invisible-drag-image'].filter(Boolean);\nconst cloneWrapperClasses = [styles.clone, 'components-draggable__clone'].filter(Boolean);\n// Global class — shared with external code (e.g. block-editor keyboard drag).\nconst bodyClass = 'is-dragging-components-draggable';\nconst clonePadding = 0;\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable({\n children,\n onDragStart,\n onDragOver,\n onDragEnd,\n appendToOwnerDocument = false,\n cloneClassname,\n elementId,\n transferData,\n __experimentalTransferDataType: transferDataType = 'text',\n __experimentalDragComponent: dragComponent\n}) {\n const dragComponentRef = useRef(null);\n const cleanupRef = useRef(() => {});\n\n /**\n * Removes the element clone, resets cursor, and removes drag listener.\n *\n * @param event The non-custom DragEvent.\n */\n function end(event) {\n event.preventDefault();\n cleanupRef.current();\n if (onDragEnd) {\n onDragEnd(event);\n }\n }\n\n /**\n * This method does a couple of things:\n *\n * - Clones the current element and spawns clone over original element.\n * - Adds a fake temporary drag image to avoid browser defaults.\n * - Sets transfer data.\n * - Adds dragover listener.\n *\n * @param event The non-custom DragEvent.\n */\n function start(event) {\n const {\n ownerDocument\n } = event.target;\n // Only use the slot when it lives in the same document as the\n // dragged element, so coordinate resolution stays in one space.\n const slot = getWpCompatOverlaySlot();\n const compatSlot = slot?.ownerDocument === ownerDocument ? slot : null;\n event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));\n const cloneWrapper = ownerDocument.createElement('div');\n // Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n cloneWrapper.style.top = '0';\n cloneWrapper.style.left = '0';\n const dragImage = ownerDocument.createElement('div');\n\n // Set a fake drag image to avoid browser defaults. Remove from DOM\n // right after. event.dataTransfer.setDragImage is not supported yet in\n // IE, we need to check for its existence first.\n if ('function' === typeof event.dataTransfer.setDragImage) {\n dragImage.classList.add(...dragImageClasses);\n // Invisible — stays at the document body, no slot needed.\n ownerDocument.body.appendChild(dragImage);\n event.dataTransfer.setDragImage(dragImage, 0, 0);\n }\n cloneWrapper.classList.add(...cloneWrapperClasses);\n const inSlotClass = styles['is-in-compat-slot'];\n if (compatSlot && inSlotClass) {\n cloneWrapper.classList.add(inSlotClass);\n }\n if (cloneClassname) {\n cloneWrapper.classList.add(cloneClassname);\n }\n let x = 0;\n let y = 0;\n // If a dragComponent is defined, the following logic will clone the\n // HTML node and inject it into the cloneWrapper.\n if (dragComponentRef.current) {\n // Position dragComponent at the same position as the cursor.\n x = event.clientX;\n y = event.clientY;\n cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;\n const clonedDragComponent = ownerDocument.createElement('div');\n clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n cloneWrapper.appendChild(clonedDragComponent);\n (compatSlot ?? ownerDocument.body).appendChild(cloneWrapper);\n } else {\n const element = ownerDocument.getElementById(elementId);\n\n // Prepare element clone and append to element wrapper.\n const elementRect = element.getBoundingClientRect();\n const elementWrapper = element.parentNode;\n const elementTopOffset = elementRect.top;\n const elementLeftOffset = elementRect.left;\n cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;\n const clone = element.cloneNode(true);\n clone.id = `clone-${elementId}`;\n\n // Position clone right over the original element (20px padding).\n x = elementLeftOffset - clonePadding;\n y = elementTopOffset - clonePadding;\n cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;\n\n // Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n Array.from(clone.querySelectorAll('iframe')).forEach(child => child.parentNode?.removeChild(child));\n cloneWrapper.appendChild(clone);\n if (compatSlot) {\n compatSlot.appendChild(cloneWrapper);\n } else if (appendToOwnerDocument) {\n ownerDocument.body.appendChild(cloneWrapper);\n } else {\n elementWrapper?.appendChild(cloneWrapper);\n }\n }\n\n // Mark the current cursor coordinates.\n let cursorLeft = event.clientX;\n let cursorTop = event.clientY;\n function over(e) {\n // Skip doing any work if mouse has not moved.\n if (cursorLeft === e.clientX && cursorTop === e.clientY) {\n return;\n }\n const nextX = x + e.clientX - cursorLeft;\n const nextY = y + e.clientY - cursorTop;\n cloneWrapper.style.transform = `translate( ${nextX}px, ${nextY}px )`;\n cursorLeft = e.clientX;\n cursorTop = e.clientY;\n x = nextX;\n y = nextY;\n if (onDragOver) {\n onDragOver(e);\n }\n }\n\n // Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n // note that browsers may throttle raf below 60fps in certain conditions.\n // @ts-expect-error `throttle` expects a `(...args: unknown[]) => unknown` callback.\n const throttledDragOver = throttle(over, 16);\n ownerDocument.addEventListener('dragover', throttledDragOver);\n\n // Update cursor to 'grabbing', document wide.\n ownerDocument.body.classList.add(bodyClass);\n if (onDragStart) {\n onDragStart(event);\n }\n cleanupRef.current = () => {\n // Remove drag clone.\n if (cloneWrapper && cloneWrapper.parentNode) {\n cloneWrapper.parentNode.removeChild(cloneWrapper);\n }\n if (dragImage && dragImage.parentNode) {\n dragImage.parentNode.removeChild(dragImage);\n }\n\n // Reset cursor.\n ownerDocument.body.classList.remove(bodyClass);\n ownerDocument.removeEventListener('dragover', throttledDragOver);\n };\n }\n useEffect(() => () => {\n cleanupRef.current();\n }, []);\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [children({\n onDraggableStart: start,\n onDraggableEnd: end\n }), dragComponent && /*#__PURE__*/_jsx(\"div\", {\n className: \"components-draggable-drag-component-root\",\n style: {\n display: 'none'\n },\n ref: dragComponentRef,\n children: dragComponent\n })]\n });\n}\nexport default Draggable;", "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(\"e7e88c1781\", \"._3476c2e530687f96__invisible-drag-image{height:50px;left:-1000px;position:fixed;width:50px}._6f00e51ab7574306__clone{background:transparent;padding:0;pointer-events:none;position:fixed}._6f00e51ab7574306__clone:not(._664ecd37377558df__is-in-compat-slot){z-index:1000000000}body.is-dragging-components-draggable{cursor:move;cursor:grabbing!important}\");\n}\nexport default {\"invisible-drag-image\":\"_3476c2e530687f96__invisible-drag-image\",\"clone\":\"_6f00e51ab7574306__clone\",\"is-in-compat-slot\":\"_664ecd37377558df__is-in-compat-slot\"};\n"],
4
+ "sourcesContent": ["import { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { getWpCompatOverlaySlot } from '@wordpress/ui';\nimport styles from './style.module.scss';\n\n// Legacy class names preserved alongside the CSS-module hashed ones for\n// backwards compatibility. `filter(Boolean)` strips `undefined` from the\n// CSS-module mock.\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst dragImageClasses = [styles['invisible-drag-image'], 'components-draggable__invisible-drag-image'].filter(Boolean);\nconst cloneWrapperClasses = [styles.clone, 'components-draggable__clone'].filter(Boolean);\n// Global class — shared with external code (e.g. block-editor keyboard drag).\nconst bodyClass = 'is-dragging-components-draggable';\nconst clonePadding = 0;\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable({\n children,\n onDragStart,\n onDragOver,\n onDragEnd,\n appendToOwnerDocument = false,\n cloneClassname,\n elementId,\n transferData,\n __experimentalTransferDataType: transferDataType = 'text',\n __experimentalDragComponent: dragComponent\n}) {\n const dragComponentRef = useRef(null);\n const cleanupRef = useRef(() => {});\n\n /**\n * Removes the element clone, resets cursor, and removes drag listener.\n *\n * @param event The non-custom DragEvent.\n */\n function end(event) {\n event.preventDefault();\n cleanupRef.current();\n if (onDragEnd) {\n onDragEnd(event);\n }\n }\n\n /**\n * This method does a couple of things:\n *\n * - Clones the current element and spawns clone over original element.\n * - Adds a fake temporary drag image to avoid browser defaults.\n * - Sets transfer data.\n * - Adds dragover listener.\n *\n * @param event The non-custom DragEvent.\n */\n function start(event) {\n const {\n ownerDocument\n } = event.target;\n // Only use the slot when it lives in the same document as the\n // dragged element, so coordinate resolution stays in one space.\n const slot = getWpCompatOverlaySlot();\n const compatSlot = slot?.ownerDocument === ownerDocument ? slot : null;\n event.dataTransfer.setData(transferDataType, JSON.stringify(transferData));\n const cloneWrapper = ownerDocument.createElement('div');\n // Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n cloneWrapper.style.top = '0';\n cloneWrapper.style.left = '0';\n const dragImage = ownerDocument.createElement('div');\n\n // Set a fake drag image to avoid browser defaults. Remove from DOM\n // right after. event.dataTransfer.setDragImage is not supported yet in\n // IE, we need to check for its existence first.\n if ('function' === typeof event.dataTransfer.setDragImage) {\n dragImage.classList.add(...dragImageClasses);\n // Invisible — stays at the document body, no slot needed.\n ownerDocument.body.appendChild(dragImage);\n event.dataTransfer.setDragImage(dragImage, 0, 0);\n }\n cloneWrapper.classList.add(...cloneWrapperClasses);\n const inSlotClass = styles['is-in-compat-slot'];\n if (compatSlot && inSlotClass) {\n cloneWrapper.classList.add(inSlotClass);\n }\n if (cloneClassname) {\n cloneWrapper.classList.add(cloneClassname);\n }\n let x = 0;\n let y = 0;\n // If a dragComponent is defined, the following logic will clone the\n // HTML node and inject it into the cloneWrapper.\n if (dragComponentRef.current) {\n // Position dragComponent at the same position as the cursor.\n x = event.clientX;\n y = event.clientY;\n cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;\n const clonedDragComponent = ownerDocument.createElement('div');\n clonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n cloneWrapper.appendChild(clonedDragComponent);\n (compatSlot ?? ownerDocument.body).appendChild(cloneWrapper);\n } else {\n const element = ownerDocument.getElementById(elementId);\n\n // Prepare element clone and append to element wrapper.\n const elementRect = element.getBoundingClientRect();\n const elementWrapper = element.parentNode;\n const elementTopOffset = elementRect.top;\n const elementLeftOffset = elementRect.left;\n cloneWrapper.style.width = `${elementRect.width + clonePadding * 2}px`;\n const clone = element.cloneNode(true);\n clone.id = `clone-${elementId}`;\n\n // Position clone right over the original element (20px padding).\n x = elementLeftOffset - clonePadding;\n y = elementTopOffset - clonePadding;\n cloneWrapper.style.transform = `translate( ${x}px, ${y}px )`;\n\n // Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n Array.from(clone.querySelectorAll('iframe')).forEach(child => child.parentNode?.removeChild(child));\n cloneWrapper.appendChild(clone);\n if (compatSlot) {\n compatSlot.appendChild(cloneWrapper);\n } else if (appendToOwnerDocument) {\n ownerDocument.body.appendChild(cloneWrapper);\n } else {\n elementWrapper?.appendChild(cloneWrapper);\n }\n }\n\n // Mark the current cursor coordinates.\n let cursorLeft = event.clientX;\n let cursorTop = event.clientY;\n function over(e) {\n // Skip doing any work if mouse has not moved.\n if (cursorLeft === e.clientX && cursorTop === e.clientY) {\n return;\n }\n const nextX = x + e.clientX - cursorLeft;\n const nextY = y + e.clientY - cursorTop;\n cloneWrapper.style.transform = `translate( ${nextX}px, ${nextY}px )`;\n cursorLeft = e.clientX;\n cursorTop = e.clientY;\n x = nextX;\n y = nextY;\n if (onDragOver) {\n onDragOver(e);\n }\n }\n\n // Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n // note that browsers may throttle raf below 60fps in certain conditions.\n // @ts-expect-error `throttle` expects a `(...args: unknown[]) => unknown` callback.\n const throttledDragOver = throttle(over, 16);\n ownerDocument.addEventListener('dragover', throttledDragOver);\n\n // Update cursor to 'grabbing', document wide.\n ownerDocument.body.classList.add(bodyClass);\n if (onDragStart) {\n onDragStart(event);\n }\n cleanupRef.current = () => {\n // Remove drag clone.\n if (cloneWrapper && cloneWrapper.parentNode) {\n cloneWrapper.parentNode.removeChild(cloneWrapper);\n }\n if (dragImage && dragImage.parentNode) {\n dragImage.parentNode.removeChild(dragImage);\n }\n\n // Reset cursor.\n ownerDocument.body.classList.remove(bodyClass);\n ownerDocument.removeEventListener('dragover', throttledDragOver);\n };\n }\n useEffect(() => () => {\n cleanupRef.current();\n }, []);\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [children({\n onDraggableStart: start,\n onDraggableEnd: end\n }), dragComponent && /*#__PURE__*/_jsx(\"div\", {\n className: \"components-draggable-drag-component-root\",\n style: {\n display: 'none'\n },\n ref: dragComponentRef,\n children: dragComponent\n })]\n });\n}\nexport default Draggable;", "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(\"e7e88c1781\", \"._3476c2e530687f96__invisible-drag-image{height:50px;left:-1000px;position:fixed;width:50px}._6f00e51ab7574306__clone{background:transparent;padding:0;pointer-events:none;position:fixed}._6f00e51ab7574306__clone:not(._664ecd37377558df__is-in-compat-slot){z-index:1000000000}body.is-dragging-components-draggable{cursor:move;cursor:grabbing!important}\");\n}\nexport default {\"invisible-drag-image\":\"_3476c2e530687f96__invisible-dr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,QAAI,aAAa;AACf,kBAAY,KAAK;AAAA,IACnB;AACA,eAAW,UAAU,MAAM;AAEzB,UAAI,gBAAgB,aAAa,YAAY;AAC3C,qBAAa,WAAW,YAAY,YAAY;AAAA,MAClD;AACA,UAAI,aAAa,UAAU,YAAY;AACrC,kBAAU,WAAW,YAAY,SAAS;AAAA,MAC5C;AAGA,oBAAc,KAAK,UAAU,OAAO,SAAS;AAC7C,oBAAc,oBAAoB,YAAY,iBAAiB;AAAA,IACjE;AAAA,EACF;AACA,YAAU,MAAM,MAAM;AACpB,eAAW,QAAQ;AAAA,EACrB,GAAG,CAAC,CAAC;AACL,SAAoB,sBAAM,WAAW;AAAA,IACnC,UAAU,CAAC,SAAS;AAAA,MAClB,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB,CAAC,GAAG,iBAA8B,qBAAK,OAAO;AAAA,MAC5C,WAAW;AAAA,MACX,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,KAAK;AAAA,MACL,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,oBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,104 @@
1
1
  // packages/components/src/dropdown/dropdown-content-wrapper.tsx
2
+ import clsx from "clsx";
2
3
  import { contextConnect, useContextSystem } from "../context/index.mjs";
3
- import { DropdownContentWrapperDiv } from "./styles.mjs";
4
+
5
+ // packages/style-runtime/src/index.ts
6
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
7
+ function getRuntime() {
8
+ const globalScope = globalThis;
9
+ if (globalScope.__wpStyleRuntime) {
10
+ return globalScope.__wpStyleRuntime;
11
+ }
12
+ globalScope.__wpStyleRuntime = {
13
+ documents: /* @__PURE__ */ new Map(),
14
+ styles: /* @__PURE__ */ new Map(),
15
+ injectedStyles: /* @__PURE__ */ new WeakMap()
16
+ };
17
+ if (typeof document !== "undefined") {
18
+ registerDocument(document);
19
+ }
20
+ return globalScope.__wpStyleRuntime;
21
+ }
22
+ function documentContainsStyleHash(targetDocument, hash) {
23
+ if (!targetDocument.head) {
24
+ return false;
25
+ }
26
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
27
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
28
+ return true;
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+ function injectStyle(targetDocument, hash, css) {
34
+ if (!targetDocument.head) {
35
+ return;
36
+ }
37
+ const runtime = getRuntime();
38
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
39
+ if (!injectedStyles) {
40
+ injectedStyles = /* @__PURE__ */ new Set();
41
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
42
+ }
43
+ if (injectedStyles.has(hash)) {
44
+ return;
45
+ }
46
+ if (documentContainsStyleHash(targetDocument, hash)) {
47
+ injectedStyles.add(hash);
48
+ return;
49
+ }
50
+ const style = targetDocument.createElement("style");
51
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
52
+ style.appendChild(targetDocument.createTextNode(css));
53
+ targetDocument.head.appendChild(style);
54
+ injectedStyles.add(hash);
55
+ }
56
+ function registerDocument(targetDocument) {
57
+ const runtime = getRuntime();
58
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
59
+ for (const [hash, css] of runtime.styles) {
60
+ injectStyle(targetDocument, hash, css);
61
+ }
62
+ return () => {
63
+ const count = runtime.documents.get(targetDocument);
64
+ if (count === void 0) {
65
+ return;
66
+ }
67
+ if (count <= 1) {
68
+ runtime.documents.delete(targetDocument);
69
+ return;
70
+ }
71
+ runtime.documents.set(targetDocument, count - 1);
72
+ };
73
+ }
74
+ function registerStyle(hash, css) {
75
+ const runtime = getRuntime();
76
+ runtime.styles.set(hash, css);
77
+ for (const targetDocument of runtime.documents.keys()) {
78
+ injectStyle(targetDocument, hash, css);
79
+ }
80
+ }
81
+
82
+ // packages/components/src/dropdown/style.module.scss
83
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
84
+ registerStyle("7f9bfd3385", ".ab61d20c737fa550__content-wrapper{margin-left:-8px;margin-right:-8px}.ab61d20c737fa550__content-wrapper:first-of-type{margin-top:-8px}.ab61d20c737fa550__content-wrapper:last-of-type{margin-bottom:-8px}.f0a033fae417d720__padding-small{padding:8px}.d83816967399484e__padding-medium{padding:16px}");
85
+ }
86
+ var style_module_default = { "content-wrapper": "ab61d20c737fa550__content-wrapper", "padding-small": "f0a033fae417d720__padding-small", "padding-medium": "d83816967399484e__padding-medium" };
87
+
88
+ // packages/components/src/dropdown/dropdown-content-wrapper.tsx
4
89
  import { jsx as _jsx } from "react/jsx-runtime";
5
90
  function UnconnectedDropdownContentWrapper(props, forwardedRef) {
6
91
  const {
7
92
  paddingSize = "small",
93
+ className,
8
94
  ...derivedProps
9
95
  } = useContextSystem(props, "DropdownContentWrapper");
10
- return /* @__PURE__ */ _jsx(DropdownContentWrapperDiv, {
96
+ return /* @__PURE__ */ _jsx("div", {
11
97
  ...derivedProps,
12
- paddingSize,
98
+ className: clsx(style_module_default["content-wrapper"], {
99
+ [style_module_default["padding-small"]]: paddingSize !== "none" && paddingSize !== "medium",
100
+ [style_module_default["padding-medium"]]: paddingSize === "medium"
101
+ }, className),
13
102
  ref: forwardedRef
14
103
  });
15
104
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/dropdown/dropdown-content-wrapper.tsx"],
4
- "sourcesContent": ["import { contextConnect, useContextSystem } from '../context';\nimport { DropdownContentWrapperDiv } from './styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnconnectedDropdownContentWrapper(props, forwardedRef) {\n const {\n paddingSize = 'small',\n ...derivedProps\n } = useContextSystem(props, 'DropdownContentWrapper');\n return /*#__PURE__*/_jsx(DropdownContentWrapperDiv, {\n ...derivedProps,\n paddingSize: paddingSize,\n ref: forwardedRef\n });\n}\n\n/**\n * A convenience wrapper for the `renderContent` when you want to apply\n * different padding. (Default is `paddingSize=\"small\"`).\n *\n * ```jsx\n * import {\n * Dropdown,\n * __experimentalDropdownContentWrapper as DropdownContentWrapper,\n * } from '@wordpress/components';\n *\n * <Dropdown\n * renderContent={ () => (\n * <DropdownContentWrapper paddingSize=\"medium\">\n * My dropdown content\n * </DropdownContentWrapper>\n * ) }\n * />\n * ```\n */\nexport const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, 'DropdownContentWrapper');\nexport default DropdownContentWrapper;"],
5
- "mappings": ";AAAA,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,iCAAiC;AAC1C,SAAS,OAAO,YAAY;AAC5B,SAAS,kCAAkC,OAAO,cAAc;AAC9D,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,GAAG;AAAA,EACL,IAAI,iBAAiB,OAAO,wBAAwB;AACpD,SAAoB,qBAAK,2BAA2B;AAAA,IAClD,GAAG;AAAA,IACH;AAAA,IACA,KAAK;AAAA,EACP,CAAC;AACH;AAqBO,IAAM,yBAAyB,eAAe,mCAAmC,wBAAwB;AAChH,IAAO,mCAAQ;",
3
+ "sources": ["../../src/dropdown/dropdown-content-wrapper.tsx", "../../../style-runtime/src/index.ts", "../../src/dropdown/style.module.scss"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { contextConnect, useContextSystem } from '../context';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnconnectedDropdownContentWrapper(props, forwardedRef) {\n const {\n paddingSize = 'small',\n className,\n ...derivedProps\n } = useContextSystem(props, 'DropdownContentWrapper');\n return /*#__PURE__*/_jsx(\"div\", {\n ...derivedProps,\n className: clsx(styles['content-wrapper'], {\n [styles['padding-small']]: paddingSize !== 'none' && paddingSize !== 'medium',\n [styles['padding-medium']]: paddingSize === 'medium'\n }, className),\n ref: forwardedRef\n });\n}\n\n/**\n * A convenience wrapper for the `renderContent` when you want to apply\n * different padding. (Default is `paddingSize=\"small\"`).\n *\n * ```jsx\n * import {\n * Dropdown,\n * __experimentalDropdownContentWrapper as DropdownContentWrapper,\n * } from '@wordpress/components';\n *\n * <Dropdown\n * renderContent={ () => (\n * <DropdownContentWrapper paddingSize=\"medium\">\n * My dropdown content\n * </DropdownContentWrapper>\n * ) }\n * />\n * ```\n */\nexport const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, 'DropdownContentWrapper');\nexport default DropdownContentWrapper;", "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(\"7f9bfd3385\", \".ab61d20c737fa550__content-wrapper{margin-left:-8px;margin-right:-8px}.ab61d20c737fa550__content-wrapper:first-of-type{margin-top:-8px}.ab61d20c737fa550__content-wrapper:last-of-type{margin-bottom:-8px}.f0a033fae417d720__padding-small{padding:8px}.d83816967399484e__padding-medium{padding:16px}\");\n}\nexport default {\"content-wrapper\":\"ab61d20c737fa550__content-wrapper\",\"padding-small\":\"f0a033fae417d720__padding-small\",\"padding-medium\":\"d83816967399484e__padding-medium\"};\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,gBAAgB,wBAAwB;;;ACDjD,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,aAAa;AACnC,qBAAiB,QAAQ;AAAA,EAC3B;AACA,SAAO,YAAY;AACrB;AAUA,SAAS,0BAA0B,gBAAgB,MAAM;AACvD,MAAI,CAAC,eAAe,MAAM;AACxB,WAAO;AAAA,EACT;AACA,aAAW,SAAS,eAAe,KAAK,iBAAiB,SAAS,oBAAoB,GAAG,GAAG;AAC1F,QAAI,MAAM,aAAa,oBAAoB,MAAM,MAAM;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAUA,SAAS,YAAY,gBAAgB,MAAM,KAAK;AAC9C,MAAI,CAAC,eAAe,MAAM;AACxB;AAAA,EACF;AACA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAI,cAAc;AAC9D,MAAI,CAAC,gBAAgB;AACnB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAI,gBAAgB,cAAc;AAAA,EAC3D;AACA,MAAI,eAAe,IAAI,IAAI,GAAG;AAC5B;AAAA,EACF;AAKA,MAAI,0BAA0B,gBAAgB,IAAI,GAAG;AACnD,mBAAe,IAAI,IAAI;AACvB;AAAA,EACF;AACA,QAAM,QAAQ,eA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ACzC,CAAC,qBAAO,eAAe,CAAC,GAAG,gBAAgB,UAAU,gBAAgB;AAAA,MACrE,CAAC,qBAAO,gBAAgB,CAAC,GAAG,gBAAgB;AAAA,IAC9C,GAAG,SAAS;AAAA,IACZ,KAAK;AAAA,EACP,CAAC;AACH;AAqBO,IAAM,yBAAyB,eAAe,mCAAmC,wBAAwB;AAChH,IAAO,mCAAQ;",
6
6
  "names": []
7
7
  }
@@ -13,6 +13,7 @@ function CustomDuotoneBar({
13
13
  const controlPoints = getColorStopsFromColors(values);
14
14
  return /* @__PURE__ */ _jsx(CustomGradientBar, {
15
15
  disableInserter: true,
16
+ disablePositioning: true,
16
17
  background,
17
18
  hasGradient,
18
19
  value: controlPoints,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/duotone-picker/custom-duotone-bar.tsx"],
4
- "sourcesContent": ["import CustomGradientBar from '../custom-gradient-picker/gradient-bar';\nimport { getColorStopsFromColors, getGradientFromCSSColors, getColorsFromColorStops } from './utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PLACEHOLDER_VALUES = ['#333', '#CCC'];\nexport default function CustomDuotoneBar({\n value,\n onChange\n}) {\n const hasGradient = !!value;\n const values = hasGradient ? value : PLACEHOLDER_VALUES;\n const background = getGradientFromCSSColors(values);\n const controlPoints = getColorStopsFromColors(values);\n return /*#__PURE__*/_jsx(CustomGradientBar, {\n disableInserter: true,\n background: background,\n hasGradient: hasGradient,\n value: controlPoints,\n onChange: newColorStops => {\n const newValue = getColorsFromColorStops(newColorStops);\n onChange(newValue);\n }\n });\n}"],
5
- "mappings": ";AAAA,OAAO,uBAAuB;AAC9B,SAAS,yBAAyB,0BAA0B,+BAA+B;AAC3F,SAAS,OAAO,YAAY;AAC5B,IAAM,qBAAqB,CAAC,QAAQ,MAAM;AAC3B,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,CAAC,CAAC;AACtB,QAAM,SAAS,cAAc,QAAQ;AACrC,QAAM,aAAa,yBAAyB,MAAM;AAClD,QAAM,gBAAgB,wBAAwB,MAAM;AACpD,SAAoB,qBAAK,mBAAmB;AAAA,IAC1C,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU,mBAAiB;AACzB,YAAM,WAAW,wBAAwB,aAAa;AACtD,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,CAAC;AACH;",
4
+ "sourcesContent": ["import CustomGradientBar from '../custom-gradient-picker/gradient-bar';\nimport { getColorStopsFromColors, getGradientFromCSSColors, getColorsFromColorStops } from './utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PLACEHOLDER_VALUES = ['#333', '#CCC'];\nexport default function CustomDuotoneBar({\n value,\n onChange\n}) {\n const hasGradient = !!value;\n const values = hasGradient ? value : PLACEHOLDER_VALUES;\n const background = getGradientFromCSSColors(values);\n const controlPoints = getColorStopsFromColors(values);\n return /*#__PURE__*/_jsx(CustomGradientBar, {\n disableInserter: true,\n disablePositioning: true,\n background: background,\n hasGradient: hasGradient,\n value: controlPoints,\n onChange: newColorStops => {\n const newValue = getColorsFromColorStops(newColorStops);\n onChange(newValue);\n }\n });\n}"],
5
+ "mappings": ";AAAA,OAAO,uBAAuB;AAC9B,SAAS,yBAAyB,0BAA0B,+BAA+B;AAC3F,SAAS,OAAO,YAAY;AAC5B,IAAM,qBAAqB,CAAC,QAAQ,MAAM;AAC3B,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,CAAC,CAAC;AACtB,QAAM,SAAS,cAAc,QAAQ;AACrC,QAAM,aAAa,yBAAyB,MAAM;AAClD,QAAM,gBAAgB,wBAAwB,MAAM;AACpD,SAAoB,qBAAK,mBAAmB;AAAA,IAC1C,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU,mBAAiB;AACzB,YAAM,WAAW,wBAAwB,aAAa;AACtD,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -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;A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,WAAW,cAAc;AACxF,QAAM,UAAU,YAAY,CAAC,aAAa,GAAG,cAAc,IAAI;AAC/D,SAAoB,qBAAK,sBAAsB;AAAA,IAC7C,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA,SAAS,CAAC,CAAC,aAA0B,qBAAK,qBAAqB,cAAc;AAAA,MAC3E,SAAS,MAAM,SAAS,MAAS;AAAA,MACjC,wBAAwB;AAAA,MACxB,UAAU,CAAC;AAAA,MACX,UAAU,GAAG,OAAO;AAAA,IACtB,CAAC;AAAA,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,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,CAAC,aAAa,GAAG,cAAc,IAAI;AAC/D,SAAoB,qBAAK,sBAAsB;AAAA,IAC7C,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA,SAAS,CAAC,CAAC,aAA0B,qBAAK,qBAAqB,cAAc;AAAA,MAC3E,SAAS,MAAM,SAAS,MAAS;AAAA,MACjC,wBAAwB;AAAA,MACxB,UAAU,CAAC;AAAA,MACX,UAAU,GAAG,OAAO;AAAA,IACtB,CAAC;AAAA,IACD,UAAU,CAAC,wBAAqC,qBAAK,QAAQ;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 })]\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,SAAS,aAAa,kBAAkB;AACxC,SAAS,sBAAsB;AAC/B,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,uBAAuB;AAoDtB,SAAS,iBAAiB;AAAA;AAAA,EAE/B,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO,YAAY;AAAA,IACjB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,SAAS;AAC5C,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAS,KAAK;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,YAAY;AAAA,IACd,aA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,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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O,6BAAQ;",
6
6
  "names": []
7
7
  }
@@ -360,7 +360,7 @@ function FormTokenField(props) {
360
360
  }
361
361
  function handleUpArrowKey() {
362
362
  setSelectedSuggestionIndex((index) => {
363
- return (index === 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;
363
+ return (index <= 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;
364
364
  });
365
365
  setSelectedSuggestionScroll(true);
366
366
  return true;