@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/tools-panel/tools-panel/hook.ts", "../../../../style-runtime/src/index.ts", "../../../src/tools-panel/style.module.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { useCallback, useEffect, useMemo, useReducer, useRef } from '@wordpress/element';\nimport styles from '../style.module.scss';\nimport { useContextSystem } from '../../context';\nfunction emptyMenuItems() {\n return {\n default: {},\n optional: {}\n };\n}\nfunction emptyState() {\n return {\n panelItems: [],\n menuItemOrder: [],\n menuItems: emptyMenuItems()\n };\n}\nconst generateMenuItems = ({\n panelItems,\n shouldReset,\n currentMenuItems,\n menuItemOrder\n}) => {\n const newMenuItems = emptyMenuItems();\n const menuItems = emptyMenuItems();\n panelItems.forEach(({\n hasValue,\n isShownByDefault,\n label\n }) => {\n const group = isShownByDefault ? 'default' : 'optional';\n\n // If a menu item for this label has already been flagged as customized\n // (for default controls), or toggled on (for optional controls), do not\n // overwrite its value as those controls would lose that state.\n const existingItemValue = currentMenuItems?.[group]?.[label];\n const value = existingItemValue ? existingItemValue : hasValue();\n newMenuItems[group][label] = shouldReset ? false : value;\n });\n\n // Loop the known, previously registered items first to maintain menu order.\n menuItemOrder.forEach(key => {\n if (newMenuItems.default.hasOwnProperty(key)) {\n menuItems.default[key] = newMenuItems.default[key];\n }\n if (newMenuItems.optional.hasOwnProperty(key)) {\n menuItems.optional[key] = newMenuItems.optional[key];\n }\n });\n\n // Loop newMenuItems object adding any that aren't in the known items order.\n Object.keys(newMenuItems.default).forEach(key => {\n if (!menuItems.default.hasOwnProperty(key)) {\n menuItems.default[key] = newMenuItems.default[key];\n }\n });\n Object.keys(newMenuItems.optional).forEach(key => {\n if (!menuItems.optional.hasOwnProperty(key)) {\n menuItems.optional[key] = newMenuItems.optional[key];\n }\n });\n return menuItems;\n};\nfunction panelItemsReducer(panelItems, action) {\n switch (action.type) {\n case 'REGISTER_PANEL':\n {\n const newItems = [...panelItems];\n // If an item with this label has already been registered, remove it\n // first. This can happen when an item is moved between the default\n // and optional groups.\n const existingIndex = newItems.findIndex(oldItem => oldItem.label === action.item.label);\n if (existingIndex !== -1) {\n newItems.splice(existingIndex, 1);\n }\n newItems.push(action.item);\n return newItems;\n }\n case 'UNREGISTER_PANEL':\n {\n const index = panelItems.findIndex(item => item.label === action.label);\n if (index !== -1) {\n const newItems = [...panelItems];\n newItems.splice(index, 1);\n return newItems;\n }\n return panelItems;\n }\n default:\n return panelItems;\n }\n}\nfunction menuItemOrderReducer(menuItemOrder, action) {\n switch (action.type) {\n case 'REGISTER_PANEL':\n {\n // Track the initial order of item registration. This is used for\n // maintaining menu item order later.\n if (menuItemOrder.includes(action.item.label)) {\n return menuItemOrder;\n }\n return [...menuItemOrder, action.item.label];\n }\n default:\n return menuItemOrder;\n }\n}\nfunction menuItemsReducer(state, action) {\n switch (action.type) {\n case 'REGISTER_PANEL':\n case 'UNREGISTER_PANEL':\n // generate new menu items from original `menuItems` and updated `panelItems` and `menuItemOrder`\n return generateMenuItems({\n currentMenuItems: state.menuItems,\n panelItems: state.panelItems,\n menuItemOrder: state.menuItemOrder,\n shouldReset: false\n });\n case 'RESET_ALL':\n return generateMenuItems({\n panelItems: state.panelItems,\n menuItemOrder: state.menuItemOrder,\n shouldReset: true\n });\n case 'UPDATE_VALUE':\n {\n const oldValue = state.menuItems[action.group][action.label];\n if (action.value === oldValue) {\n return state.menuItems;\n }\n return {\n ...state.menuItems,\n [action.group]: {\n ...state.menuItems[action.group],\n [action.label]: action.value\n }\n };\n }\n case 'TOGGLE_VALUE':\n {\n const currentItem = state.panelItems.find(item => item.label === action.label);\n if (!currentItem) {\n return state.menuItems;\n }\n const menuGroup = currentItem.isShownByDefault ? 'default' : 'optional';\n const newMenuItems = {\n ...state.menuItems,\n [menuGroup]: {\n ...state.menuItems[menuGroup],\n [action.label]: !state.menuItems[menuGroup][action.label]\n }\n };\n return newMenuItems;\n }\n default:\n return state.menuItems;\n }\n}\nfunction panelReducer(state, action) {\n const panelItems = panelItemsReducer(state.panelItems, action);\n const menuItemOrder = menuItemOrderReducer(state.menuItemOrder, action);\n // `menuItemsReducer` is a bit unusual because it generates new state from original `menuItems`\n // and the updated `panelItems` and `menuItemOrder`.\n const menuItems = menuItemsReducer({\n panelItems,\n menuItemOrder,\n menuItems: state.menuItems\n }, action);\n return {\n panelItems,\n menuItemOrder,\n menuItems\n };\n}\nfunction resetAllFiltersReducer(filters, action) {\n switch (action.type) {\n case 'REGISTER':\n return [...filters, action.filter];\n case 'UNREGISTER':\n return filters.filter(f => f !== action.filter);\n default:\n return filters;\n }\n}\nconst isMenuItemTypeEmpty = obj => Object.keys(obj).length === 0;\nexport function useToolsPanel(props) {\n const {\n className,\n headingLevel = 2,\n resetAll,\n panelId,\n hasInnerWrapper = false,\n shouldRenderPlaceholderItems = false,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanel');\n const isResettingRef = useRef(false);\n const wasResetting = isResettingRef.current;\n\n // `isResettingRef` is cleared via this hook to effectively batch together\n // the resetAll task. Without this, the flag is cleared after the first\n // control updates and forces a rerender with subsequent controls then\n // believing they need to reset, unfortunately using stale data.\n useEffect(() => {\n if (wasResetting) {\n isResettingRef.current = false;\n }\n }, [wasResetting]);\n\n // Allow panel items to register themselves.\n const [{\n panelItems,\n menuItems\n }, panelDispatch] = useReducer(panelReducer, undefined, emptyState);\n const [resetAllFilters, dispatchResetAllFilters] = useReducer(resetAllFiltersReducer, []);\n const registerPanelItem = useCallback(item => {\n // Add item to panel items.\n panelDispatch({\n type: 'REGISTER_PANEL',\n item\n });\n }, []);\n\n // Panels need to deregister on unmount to avoid orphans in menu state.\n // This is an issue when panel items are being injected via SlotFills.\n const deregisterPanelItem = useCallback(label => {\n // When switching selections between components injecting matching\n // controls, e.g. both panels have a \"padding\" control, the\n // deregistration of the first panel doesn't occur until after the\n // registration of the next.\n panelDispatch({\n type: 'UNREGISTER_PANEL',\n label\n });\n }, []);\n const registerResetAllFilter = useCallback(filter => {\n dispatchResetAllFilters({\n type: 'REGISTER',\n filter\n });\n }, []);\n const deregisterResetAllFilter = useCallback(filter => {\n dispatchResetAllFilters({\n type: 'UNREGISTER',\n filter\n });\n }, []);\n\n // Updates the status of the panel’s menu items. For default items the\n // value represents whether it differs from the default and for optional\n // items whether the item is shown.\n const flagItemCustomization = useCallback((value, label, group = 'default') => {\n panelDispatch({\n type: 'UPDATE_VALUE',\n group,\n label,\n value\n });\n }, []);\n\n // Whether all optional menu items are hidden or not must be tracked\n // in order to later determine if the panel display is empty and handle\n // conditional display of a plus icon to indicate the presence of further\n // menu items.\n const areAllOptionalControlsHidden = useMemo(() => {\n return isMenuItemTypeEmpty(menuItems.default) && !isMenuItemTypeEmpty(menuItems.optional) && Object.values(menuItems.optional).every(isSelected => !isSelected);\n }, [menuItems]);\n const classes = clsx(styles['tools-panel'], hasInnerWrapper && styles['tools-panel-with-inner-wrapper'], areAllOptionalControlsHidden && styles['tools-panel-hidden-inner-wrapper'], className);\n\n // Toggle the checked state of a menu item which is then used to determine\n // display of the item within the panel.\n const toggleItem = useCallback(label => {\n panelDispatch({\n type: 'TOGGLE_VALUE',\n label\n });\n }, []);\n\n // Resets display of children and executes resetAll callback if available.\n const resetAllItems = useCallback(() => {\n if (typeof resetAll === 'function') {\n isResettingRef.current = true;\n resetAll(resetAllFilters);\n }\n\n // Turn off display of all non-default items.\n panelDispatch({\n type: 'RESET_ALL'\n });\n }, [resetAllFilters, resetAll]);\n\n // Assist ItemGroup styling when there are potentially hidden placeholder\n // items by identifying first & last items that are toggled on for display.\n const getFirstVisibleItemLabel = items => {\n const optionalItems = menuItems.optional || {};\n const firstItem = items.find(item => item.isShownByDefault || optionalItems[item.label]);\n return firstItem?.label;\n };\n const firstDisplayedItem = getFirstVisibleItemLabel(panelItems);\n const lastDisplayedItem = getFirstVisibleItemLabel([...panelItems].reverse());\n const hasMenuItems = panelItems.length > 0;\n const panelContext = useMemo(() => ({\n areAllOptionalControlsHidden,\n deregisterPanelItem,\n deregisterResetAllFilter,\n firstDisplayedItem,\n flagItemCustomization,\n hasMenuItems,\n isResetting: isResettingRef.current,\n lastDisplayedItem,\n menuItems,\n panelId,\n registerPanelItem,\n registerResetAllFilter,\n shouldRenderPlaceholderItems,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n }), [areAllOptionalControlsHidden, deregisterPanelItem, deregisterResetAllFilter, firstDisplayedItem, flagItemCustomization, lastDisplayedItem, menuItems, panelId, hasMenuItems, registerResetAllFilter, registerPanelItem, shouldRenderPlaceholderItems, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass]);\n return {\n ...otherProps,\n headingLevel,\n panelContext,\n resetAllItems,\n toggleItem,\n className: classes\n };\n}", "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(\"29b739f451\", \"._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}\");\n}\nexport default {\"tools-panel\":\"_62d714739f4dc308__tools-panel\",\"tools-panel-with-inner-wrapper\":\"_40db7f4f897b683d__tools-panel-with-inner-wrapper\",\"tools-panel-hidden-inner-wrapper\":\"_95a15674966f30a3__tools-panel-hidden-inner-wrapper\",\"tools-panel-header\":\"_322a049b9b7d8674__tools-panel-header\",\"tools-panel-heading\":\"b92a382d3b30104d__tools-panel-heading\",\"tools-panel-item\":\"_8005d68fffa9db91__tools-panel-item\",\"tools-panel-item-placeholder\":\"_4f55e1a6e373746e__tools-panel-item-placeholder\",\"dropdown-menu\":\"d40032517bff9e12__dropdown-menu\",\"reset-label\":\"f135b96aa96ca6bb__reset-label\",\"default-controls-item\":\"_69b138dfa5570d9c__default-controls-item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, useReducer, useState } from '@wordpress/element';\nimport styles from '../style.module.scss';\nimport { useContextSystem } from '../../context';\nfunction emptyState() {\n return {\n panelItems: [],\n menuItemOrder: [],\n menuItemValues: {}\n };\n}\n\n// An item is always shown while it has a value. `defaultShown` only opts an\n// optional item in when it has none.\nconst getSeedValue = item => item.hasValue() || !item.isShownByDefault && !!item.defaultShown;\nconst getMenuGroup = item => item.isShownByDefault ? 'default' : 'optional';\nfunction panelItemsReducer(panelItems, action) {\n switch (action.type) {\n case 'REGISTER_PANEL':\n {\n // An existing registration is replaced rather than appended, so\n // that an item moving between the default and optional groups\n // doesn't end up in the list twice.\n const existingIndex = panelItems.findIndex(item => item.label === action.item.label);\n const newItems = [...panelItems];\n if (existingIndex !== -1) {\n newItems.splice(existingIndex, 1);\n }\n newItems.push(action.item);\n return newItems;\n }\n case 'UNREGISTER_PANEL':\n {\n const index = panelItems.findIndex(item => item.label === action.label);\n if (index === -1) {\n return panelItems;\n }\n // A replacement may already hold this label, in which case this is\n // a late cleanup for a registration that is no longer current.\n if (action.item && panelItems[index] !== action.item) {\n return panelItems;\n }\n const newItems = [...panelItems];\n newItems.splice(index, 1);\n return newItems;\n }\n default:\n return panelItems;\n }\n}\nfunction menuItemOrderReducer(menuItemOrder, action) {\n switch (action.type) {\n case 'REGISTER_PANEL':\n {\n // Append-only: an item that unregisters and comes back keeps its\n // original place in the menu.\n if (menuItemOrder.includes(action.item.label)) {\n return menuItemOrder;\n }\n return [...menuItemOrder, action.item.label];\n }\n default:\n return menuItemOrder;\n }\n}\nfunction menuItemValuesReducer(state, action) {\n const values = state.menuItemValues;\n switch (action.type) {\n case 'REGISTER_PANEL':\n {\n // A new registration starts from its own value rather than\n // inheriting what an item it replaces recorded under the same\n // label. Clearing here rather than on deregistration covers both\n // orderings, since the two are not guaranteed to arrive in one.\n // Relies on re-registering also re-reporting the value.\n if (!values.hasOwnProperty(action.item.label)) {\n return values;\n }\n const {\n [action.item.label]: unusedValue,\n ...rest\n } = values;\n return rest;\n }\n case 'UPDATE_VALUE':\n {\n if (values[action.label] === action.value) {\n return values;\n }\n return {\n ...values,\n [action.label]: action.value\n };\n }\n case 'TOGGLE_VALUE':\n {\n const item = state.panelItems.find(({\n label\n }) => label === action.label);\n if (!item) {\n return values;\n }\n const current = values[action.label] ?? getSeedValue(item);\n return {\n ...values,\n [action.label]: !current\n };\n }\n case 'RESET_ALL':\n {\n // Optional items are set to false so they hide right away.\n // Default items are left alone: a reset can leave a value in\n // place, since `onDeselect` and `resetAllFilter` are optional and\n // `resetAll` need not cover every attribute. Each item reports its\n // value again if the reset changed it.\n const hidden = state.panelItems.filter(item => !item.isShownByDefault && values[item.label] !== false);\n if (!hidden.length) {\n return values;\n }\n const next = {\n ...values\n };\n hidden.forEach(({\n label\n }) => {\n next[label] = false;\n });\n return next;\n }\n default:\n return values;\n }\n}\nfunction panelReducer(state, action) {\n const panelItems = panelItemsReducer(state.panelItems, action);\n const menuItemOrder = menuItemOrderReducer(state.menuItemOrder, action);\n const menuItemValues = menuItemValuesReducer({\n ...state,\n panelItems\n }, action);\n\n // Items dispatch far more often than they change anything. Holding onto\n // the existing state lets React skip the render.\n if (panelItems === state.panelItems && menuItemOrder === state.menuItemOrder && menuItemValues === state.menuItemValues) {\n return state;\n }\n return {\n panelItems,\n menuItemOrder,\n menuItemValues\n };\n}\nfunction resetAllFiltersReducer(filters, action) {\n switch (action.type) {\n case 'REGISTER':\n return [...filters, action.filter];\n case 'UNREGISTER':\n return filters.filter(f => f !== action.filter);\n default:\n return filters;\n }\n}\nconst isMenuItemTypeEmpty = obj => Object.keys(obj).length === 0;\nexport function useToolsPanel(props) {\n const {\n className,\n headingLevel = 2,\n resetAll,\n panelId,\n hasInnerWrapper = false,\n shouldRenderPlaceholderItems = false,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanel');\n\n // Marks the render that follows a reset so items can tell a reset apart\n // from the user switching them off. Clearing it from an effect rather than\n // as each control updates keeps the whole reset within one pass; otherwise\n // later controls see it already cleared and reset themselves again from\n // stale data.\n const [isResetting, setIsResetting] = useState(false);\n useEffect(() => {\n if (isResetting) {\n setIsResetting(false);\n }\n }, [isResetting]);\n const [{\n panelItems,\n menuItemOrder,\n menuItemValues\n }, panelDispatch] = useReducer(panelReducer, undefined, emptyState);\n\n // Reset all filters registered against the context directly, by consumers\n // that aren't themselves a panel item. Items supply theirs when they\n // register.\n const [externalResetAllFilters, dispatchResetAllFilters] = useReducer(resetAllFiltersReducer, []);\n const registerPanelItem = useCallback(item => {\n panelDispatch({\n type: 'REGISTER_PANEL',\n item\n });\n }, []);\n const deregisterPanelItem = useCallback((label, item) => {\n panelDispatch({\n type: 'UNREGISTER_PANEL',\n label,\n item\n });\n }, []);\n const registerResetAllFilter = useCallback(filter => {\n dispatchResetAllFilters({\n type: 'REGISTER',\n filter\n });\n }, []);\n const deregisterResetAllFilter = useCallback(filter => {\n dispatchResetAllFilters({\n type: 'UNREGISTER',\n filter\n });\n }, []);\n\n // Argument order is unchanged from before this hook derived the menu; only\n // the group argument is gone, since it follows from `isShownByDefault`.\n const flagItemCustomization = useCallback((value, label) => {\n panelDispatch({\n type: 'UPDATE_VALUE',\n label,\n value\n });\n }, []);\n\n // Derived during render so the panel can never paint a half-built menu.\n // See: https://github.com/WordPress/gutenberg/pull/65564\n const menuItems = useMemo(() => {\n const result = {\n default: {},\n optional: {}\n };\n const byLabel = new Map(panelItems.map(item => [item.label, item]));\n\n // `menuItemOrder` holds every registered label, so it alone drives\n // the menu.\n menuItemOrder.forEach(label => {\n const item = byLabel.get(label);\n if (!item) {\n return;\n }\n result[getMenuGroup(item)][label] = menuItemValues[label] ?? getSeedValue(item);\n });\n return result;\n }, [panelItems, menuItemOrder, menuItemValues]);\n\n // Drives the plus icon and the empty panel styling.\n const areAllOptionalControlsHidden = useMemo(() => {\n return isMenuItemTypeEmpty(menuItems.default) && !isMenuItemTypeEmpty(menuItems.optional) && Object.values(menuItems.optional).every(isSelected => !isSelected);\n }, [menuItems]);\n const classes = clsx(styles['tools-panel'], hasInnerWrapper && styles['tools-panel-with-inner-wrapper'], areAllOptionalControlsHidden && styles['tools-panel-hidden-inner-wrapper'], className);\n\n // `onShownChange` is invoked from here rather than in response to the\n // resulting state change, so that it only ever reports an explicit menu\n // action by the user.\n const toggleItem = useCallback(label => {\n const currentItem = panelItems.find(item => item.label === label);\n if (!currentItem) {\n return;\n }\n panelDispatch({\n type: 'TOGGLE_VALUE',\n label\n });\n\n // Default items stay visible when toggled off, which resets them\n // instead of hiding them. Only optional items have a show or hide\n // transition to report.\n if (currentItem.isShownByDefault) {\n return;\n }\n currentItem.onShownChange?.(!menuItems.optional[label]);\n }, [menuItems, panelItems]);\n const resetAllFilters = useMemo(() => {\n const itemFilters = panelItems.map(item => item.resetAllFilter).filter(filter => !!filter);\n return [...itemFilters, ...externalResetAllFilters];\n }, [panelItems, externalResetAllFilters]);\n const resetAllItems = useCallback(() => {\n if (typeof resetAll === 'function') {\n setIsResetting(true);\n resetAll(resetAllFilters);\n }\n panelDispatch({\n type: 'RESET_ALL'\n });\n }, [resetAllFilters, resetAll]);\n\n // Lets `ItemGroup` style the visible ends of the panel when hidden\n // placeholder items sit among the children.\n const getFirstVisibleItemLabel = items => {\n const optionalItems = menuItems.optional || {};\n const firstItem = items.find(item => item.isShownByDefault || optionalItems[item.label]);\n return firstItem?.label;\n };\n const firstDisplayedItem = getFirstVisibleItemLabel(panelItems);\n const lastDisplayedItem = getFirstVisibleItemLabel([...panelItems].reverse());\n const hasMenuItems = panelItems.length > 0;\n const panelContext = useMemo(() => ({\n areAllOptionalControlsHidden,\n deregisterPanelItem,\n deregisterResetAllFilter,\n firstDisplayedItem,\n flagItemCustomization,\n hasMenuItems,\n isResetting,\n lastDisplayedItem,\n menuItems,\n panelId,\n registerPanelItem,\n registerResetAllFilter,\n shouldRenderPlaceholderItems,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n }), [areAllOptionalControlsHidden, deregisterPanelItem, deregisterResetAllFilter, firstDisplayedItem, flagItemCustomization, isResetting, lastDisplayedItem, menuItems, panelId, hasMenuItems, registerResetAllFilter, registerPanelItem, shouldRenderPlaceholderItems, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass]);\n return {\n ...otherProps,\n headingLevel,\n panelContext,\n resetAllItems,\n toggleItem,\n className: classes\n };\n}", "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(\"29b739f451\", \"._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}\");\n}\nexport default {\"tools-panel\":\"_62d714739f4dc308__tools-panel\",\"tools-panel-with-inner-wrapper\":\"_40db7f4f897b683d__tools-panel-with-inner-wrapper\",\"tools-panel-hidden-inner-wrapper\":\"_95a15674966f30a3__tools-panel-hidden-inner-wrapper\",\"tools-panel-header\":\"_322a049b9b7d8674__tools-panel-header\",\"tools-panel-heading\":\"b92a382d3b30104d__tools-panel-heading\",\"tools-panel-item\":\"_8005d68fffa9db91__tools-panel-item\",\"tools-panel-item-placeholder\":\"_4f55e1a6e373746e__tools-panel-item-placeholder\",\"dropdown-menu\":\"d40032517bff9e12__dropdown-menu\",\"reset-label\":\"f135b96aa96ca6bb__reset-label\",\"default-controls-item\":\"_69b138dfa5570d9c__default-controls-item\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAsE;;;ACDtE,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,QAA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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,CAAC,8BAA8B,qBAAqB,0BAA0B,oBAAoB,uBAAuB,aAAa,mBAAmB,WAAW,SAAS,cAAc,wBAAwB,mBAAmB,8BAA8B,qCAAqC,kCAAkC,CAAC;AAChV,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,EACb;AACF;",
6
6
  "names": ["clsx"]
7
7
  }
@@ -128,6 +128,7 @@ var noop = () => {
128
128
  function useToolsPanelItem(props) {
129
129
  const {
130
130
  className,
131
+ defaultShown,
131
132
  hasValue,
132
133
  isShownByDefault = false,
133
134
  label,
@@ -135,13 +136,12 @@ function useToolsPanelItem(props) {
135
136
  resetAllFilter = noop,
136
137
  onDeselect,
137
138
  onSelect,
139
+ onShownChange,
138
140
  ...otherProps
139
141
  } = (0, import_context2.useContextSystem)(props, "ToolsPanelItem");
140
142
  const {
141
143
  panelId: currentPanelId,
142
144
  menuItems,
143
- registerResetAllFilter,
144
- deregisterResetAllFilter,
145
145
  registerPanelItem,
146
146
  deregisterPanelItem,
147
147
  flagItemCustomization,
@@ -153,47 +153,47 @@ function useToolsPanelItem(props) {
153
153
  __experimentalLastVisibleItemClass
154
154
  } = (0, import_context.useToolsPanelContext)();
155
155
  const hasValueCallback = (0, import_element.useCallback)(hasValue, [panelId]);
156
- const resetAllFilterCallback = (0, import_element.useCallback)(resetAllFilter, [panelId]);
157
- const previousPanelId = (0, import_compose.usePrevious)(currentPanelId);
156
+ const resetAllFilterCallback = (0, import_compose.useEvent)(resetAllFilter);
157
+ const defaultShownRef = (0, import_element.useRef)(defaultShown);
158
+ (0, import_element.useLayoutEffect)(() => {
159
+ defaultShownRef.current = defaultShown;
160
+ });
161
+ const onShownChangeCallback = (0, import_compose.useEvent)(onShownChange);
158
162
  const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;
159
163
  (0, import_element.useLayoutEffect)(() => {
160
- if (hasMatchingPanel && previousPanelId !== null) {
161
- registerPanelItem({
162
- hasValue: hasValueCallback,
163
- isShownByDefault,
164
- label,
165
- panelId
166
- });
164
+ if (!hasMatchingPanel) {
165
+ return;
167
166
  }
168
- return () => {
169
- if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {
170
- deregisterPanelItem(label);
171
- }
167
+ const item = {
168
+ defaultShown: defaultShownRef.current,
169
+ hasValue: hasValueCallback,
170
+ isShownByDefault,
171
+ label,
172
+ onShownChange: onShownChangeCallback,
173
+ panelId,
174
+ resetAllFilter: resetAllFilterCallback
172
175
  };
173
- }, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);
174
- (0, import_element.useEffect)(() => {
175
- if (hasMatchingPanel) {
176
- registerResetAllFilter(resetAllFilterCallback);
177
- }
176
+ registerPanelItem(item);
178
177
  return () => {
179
- if (hasMatchingPanel) {
180
- deregisterResetAllFilter(resetAllFilterCallback);
181
- }
178
+ deregisterPanelItem(label, item);
182
179
  };
183
- }, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);
180
+ }, [deregisterPanelItem, hasMatchingPanel, hasValueCallback, isShownByDefault, label, onShownChangeCallback, panelId, registerPanelItem, resetAllFilterCallback]);
184
181
  const menuGroup = isShownByDefault ? "default" : "optional";
185
182
  const isMenuItemChecked = menuItems?.[menuGroup]?.[label];
186
- const wasMenuItemChecked = (0, import_compose.usePrevious)(isMenuItemChecked);
187
- const isRegistered = menuItems?.[menuGroup]?.[label] !== void 0;
183
+ const isRegistered = isMenuItemChecked !== void 0;
184
+ const wasMenuItemCheckedRef = (0, import_element.useRef)(void 0);
188
185
  const isValueSet = hasValue();
189
- (0, import_element.useEffect)(() => {
190
- if (!isShownByDefault && !isValueSet) {
186
+ (0, import_element.useLayoutEffect)(() => {
187
+ if (!hasMatchingPanel || !isShownByDefault && !isValueSet) {
191
188
  return;
192
189
  }
193
- flagItemCustomization(isValueSet, label, menuGroup);
194
- }, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);
190
+ flagItemCustomization(isValueSet, label);
191
+ }, [hasMatchingPanel, isValueSet, label, flagItemCustomization, isShownByDefault]);
195
192
  (0, import_element.useEffect)(() => {
196
- if (!isRegistered || isResetting || !hasMatchingPanel) {
193
+ const wasMenuItemChecked = wasMenuItemCheckedRef.current;
194
+ wasMenuItemCheckedRef.current = isMenuItemChecked;
195
+ const wasRegistered = wasMenuItemChecked !== void 0;
196
+ if (!isRegistered || !wasRegistered || isResetting || !hasMatchingPanel) {
197
197
  return;
198
198
  }
199
199
  if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {
@@ -202,8 +202,8 @@ function useToolsPanelItem(props) {
202
202
  if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {
203
203
  onDeselect?.();
204
204
  }
205
- }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);
206
- const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== void 0 : isMenuItemChecked;
205
+ }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, onSelect, onDeselect]);
206
+ const isShown = isShownByDefault ? isRegistered : isMenuItemChecked;
207
207
  const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;
208
208
  const classes = (0, import_clsx.default)(style_module_default["tools-panel-item"], shouldApplyPlaceholderStyles && style_module_default["tools-panel-item-placeholder"], !shouldApplyPlaceholderStyles && className, firstDisplayedItem === label && __experimentalFirstVisibleItemClass, lastDisplayedItem === label && __experimentalLastVisibleItemClass);
209
209
  return {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools-panel/tools-panel-item/hook.ts", "../../../../style-runtime/src/index.ts", "../../../src/tools-panel/style.module.scss"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { usePrevious } from '@wordpress/compose';\nimport { useCallback, useEffect, useLayoutEffect } from '@wordpress/element';\nimport styles from '../style.module.scss';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem } from '../../context';\nconst noop = () => {};\nexport function useToolsPanelItem(props) {\n const {\n className,\n hasValue,\n isShownByDefault = false,\n label,\n panelId,\n resetAllFilter = noop,\n onDeselect,\n onSelect,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanelItem');\n const {\n panelId: currentPanelId,\n menuItems,\n registerResetAllFilter,\n deregisterResetAllFilter,\n registerPanelItem,\n deregisterPanelItem,\n flagItemCustomization,\n isResetting,\n shouldRenderPlaceholderItems: shouldRenderPlaceholder,\n firstDisplayedItem,\n lastDisplayedItem,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n } = useToolsPanelContext();\n\n // hasValue is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const hasValueCallback = useCallback(hasValue, [panelId]);\n // resetAllFilter is a new function on every render, so do not add it as a\n // dependency to the useCallback hook! If needed, we should use a ref.\n const resetAllFilterCallback = useCallback(resetAllFilter, [panelId]);\n const previousPanelId = usePrevious(currentPanelId);\n const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;\n\n // Registering the panel item allows the panel to include it in its\n // automatically generated menu and determine its initial checked status.\n //\n // This is performed in a layout effect to ensure that the panel item\n // is registered before it is rendered preventing a rendering glitch.\n // See: https://github.com/WordPress/gutenberg/issues/56470\n useLayoutEffect(() => {\n if (hasMatchingPanel && previousPanelId !== null) {\n registerPanelItem({\n hasValue: hasValueCallback,\n isShownByDefault,\n label,\n panelId\n });\n }\n return () => {\n if (previousPanelId === null && !!currentPanelId || currentPanelId === panelId) {\n deregisterPanelItem(label);\n }\n };\n }, [currentPanelId, hasMatchingPanel, isShownByDefault, label, hasValueCallback, panelId, previousPanelId, registerPanelItem, deregisterPanelItem]);\n useEffect(() => {\n if (hasMatchingPanel) {\n registerResetAllFilter(resetAllFilterCallback);\n }\n return () => {\n if (hasMatchingPanel) {\n deregisterResetAllFilter(resetAllFilterCallback);\n }\n };\n }, [registerResetAllFilter, deregisterResetAllFilter, resetAllFilterCallback, hasMatchingPanel]);\n\n // Note: `label` is used as a key when building menu item state in\n // `ToolsPanel`.\n const menuGroup = isShownByDefault ? 'default' : 'optional';\n const isMenuItemChecked = menuItems?.[menuGroup]?.[label];\n const wasMenuItemChecked = usePrevious(isMenuItemChecked);\n const isRegistered = menuItems?.[menuGroup]?.[label] !== undefined;\n const isValueSet = hasValue();\n // Notify the panel when an item's value has changed except for optional\n // items without value because the item should not cause itself to hide.\n useEffect(() => {\n if (!isShownByDefault && !isValueSet) {\n return;\n }\n flagItemCustomization(isValueSet, label, menuGroup);\n }, [isValueSet, menuGroup, label, flagItemCustomization, isShownByDefault]);\n\n // Determine if the panel item's corresponding menu is being toggled and\n // trigger appropriate callback if it is.\n useEffect(() => {\n // We check whether this item is currently registered as items rendered\n // via fills can persist through the parent panel being remounted.\n // See: https://github.com/WordPress/gutenberg/pull/45673\n if (!isRegistered || isResetting || !hasMatchingPanel) {\n return;\n }\n if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {\n onSelect?.();\n }\n if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {\n onDeselect?.();\n }\n }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, wasMenuItemChecked, onSelect, onDeselect]);\n\n // The item is shown if it is a default control regardless of whether it\n // has a value. Optional items are shown when they are checked or have\n // a value.\n const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== undefined : isMenuItemChecked;\n const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;\n const classes = clsx(styles['tools-panel-item'], shouldApplyPlaceholderStyles && styles['tools-panel-item-placeholder'], !shouldApplyPlaceholderStyles && className, firstDisplayedItem === label && __experimentalFirstVisibleItemClass, lastDisplayedItem === label && __experimentalLastVisibleItemClass);\n return {\n ...otherProps,\n isShown,\n shouldRenderPlaceholder,\n className: classes\n };\n}", "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(\"29b739f451\", \"._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}\");\n}\nexport default {\"tools-panel\":\"_62d714739f4dc308__tools-panel\",\"tools-panel-with-inner-wrapper\":\"_40db7f4f897b683d__tools-panel-with-inner-wrapper\",\"tools-panel-hidden-inner-wrapper\":\"_95a15674966f30a3__tools-panel-hidden-inner-wrapper\",\"tools-panel-header\":\"_322a049b9b7d8674__tools-panel-header\",\"tools-panel-heading\":\"b92a382d3b30104d__tools-panel-heading\",\"tools-panel-item\":\"_8005d68fffa9db91__tools-panel-item\",\"tools-panel-item-placeholder\":\"_4f55e1a6e373746e__tools-panel-item-placeholder\",\"dropdown-menu\":\"d40032517bff9e12__dropdown-menu\",\"reset-label\":\"f135b96aa96ca6bb__reset-label\",\"default-controls-item\":\"_69b138dfa5570d9c__default-controls-item\"};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAA4B;AAC5B,qBAAwD;;;ACFxD,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;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BAA0B,wBAAwB,gBAAgB,CAAC;AAI/F,QAAM,YAAY,mBAAmB,YAAY;AACjD,QAAM,oBAAoB,YAAY,SAAS,IAAI,KAAK;AACxD,QAAM,yBAAqB,4BAAY,iBAAiB;AACxD,QAAM,eAAe,YAAY,SAAS,IAAI,KAAK,MAAM;AACzD,QAAM,aAAa,SAAS;AAG5B,gCAAU,MAAM;AACd,QAAI,CAAC,oBAAoB,CAAC,YAAY;AACpC;AAAA,IACF;AACA,0BAAsB,YAAY,OAAO,SAAS;AAAA,EACpD,GAAG,CAAC,YAAY,WAAW,OAAO,uBAAuB,gBAAgB,CAAC;AAI1E,gCAAU,MAAM;AAId,QAAI,CAAC,gBAAgB,eAAe,CAAC,kBAAkB;AACrD;AAAA,IACF;AACA,QAAI,qBAAqB,CAAC,cAAc,CAAC,oBAAoB;AAC3D,iBAAW;AAAA,IACb;AACA,QAAI,CAAC,qBAAqB,cAAc,oBAAoB;AAC1D,mBAAa;AAAA,IACf;AAAA,EACF,GAAG,CAAC,kBAAkB,mBAAmB,cAAc,aAAa,YAAY,oBAAoB,UAAU,UAAU,CAAC;AAKzH,QAAM,UAAU,mBAAmB,YAAY,SAAS,IAAI,KAAK,MAAM,SAAY;AACnF,QAAM,+BAA+B,2BAA2B,CAAC;AACjE,QAAM,cAAU,YAAAC,SAAK,qBAAO,kBAAkB,GAAG,gCAAgC,qBAAO,8BAA8B,GAAG,CAAC,gCAAgC,WAAW,uBAAuB,SAAS,qCAAqC,sBAAsB,SAAS,kCAAkC;AAC3S,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA,WAAW;AAAA,EACb;AACF;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { useEvent } from '@wordpress/compose';\nimport { useCallback, useEffect, useLayoutEffect, useRef } from '@wordpress/element';\nimport styles from '../style.module.scss';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem } from '../../context';\nconst noop = () => {};\nexport function useToolsPanelItem(props) {\n const {\n className,\n defaultShown,\n hasValue,\n isShownByDefault = false,\n label,\n panelId,\n resetAllFilter = noop,\n onDeselect,\n onSelect,\n onShownChange,\n ...otherProps\n } = useContextSystem(props, 'ToolsPanelItem');\n const {\n panelId: currentPanelId,\n menuItems,\n registerPanelItem,\n deregisterPanelItem,\n flagItemCustomization,\n isResetting,\n shouldRenderPlaceholderItems: shouldRenderPlaceholder,\n firstDisplayedItem,\n lastDisplayedItem,\n __experimentalFirstVisibleItemClass,\n __experimentalLastVisibleItemClass\n } = useToolsPanelContext();\n\n // `hasValue` is a new function every render. It can't use `useEvent`\n // because the panel calls it while deriving the menu during render, which\n // `useEvent` forbids, so it stays keyed on the panel it was captured for.\n const hasValueCallback = useCallback(hasValue, [panelId]);\n // `resetAllFilter` only runs from the reset handler, so a stable identity\n // that always sees the latest props is both safe and more correct than\n // freezing it per panel.\n const resetAllFilterCallback = useEvent(resetAllFilter);\n\n // `defaultShown` seeds an item's visibility when it registers, and is\n // deliberately not reactive. Holding it in a ref keeps it out of the\n // registration effect below, so a change on its own cannot deregister and\n // re-register the item, which would discard the visibility the user chose\n // from the menu.\n //\n // The ref still tracks the latest value, so that a re-registration caused\n // by something else, such as `panelId` changing, seeds from the current\n // preference rather than a stale one.\n const defaultShownRef = useRef(defaultShown);\n // Declared before the registration effect below so that it has already\n // run by the time that effect reads the ref in the same commit.\n useLayoutEffect(() => {\n defaultShownRef.current = defaultShown;\n });\n\n // `onShownChange` is a new function every render. `useEvent` gives the item\n // a stable callback to register, while the panel still invokes the latest.\n const onShownChangeCallback = useEvent(onShownChange);\n\n // A panel spanning a multi-selection has no id of its own, so every item\n // belongs to it.\n const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null;\n\n // A layout effect so the item is registered before it renders, avoiding a\n // glitch, and so a whole panel's worth of registrations land in one commit\n // for React to batch.\n // See: https://github.com/WordPress/gutenberg/issues/56470\n useLayoutEffect(() => {\n if (!hasMatchingPanel) {\n return;\n }\n const item = {\n defaultShown: defaultShownRef.current,\n hasValue: hasValueCallback,\n isShownByDefault,\n label,\n onShownChange: onShownChangeCallback,\n panelId,\n resetAllFilter: resetAllFilterCallback\n };\n registerPanelItem(item);\n\n // Passing the registration back lets the panel ignore this cleanup if\n // a replacement has already claimed the label, which happens when a\n // panel switches while its items arrive through a Slot.\n return () => {\n deregisterPanelItem(label, item);\n };\n }, [deregisterPanelItem, hasMatchingPanel, hasValueCallback, isShownByDefault, label, onShownChangeCallback, panelId, registerPanelItem, resetAllFilterCallback]);\n const menuGroup = isShownByDefault ? 'default' : 'optional';\n const isMenuItemChecked = menuItems?.[menuGroup]?.[label];\n const isRegistered = isMenuItemChecked !== undefined;\n // Tracks the effect below rather than the render, so renders that leave\n // the checked state alone can't desync it.\n const wasMenuItemCheckedRef = useRef(undefined);\n const isValueSet = hasValue();\n\n // An optional item losing its value must not hide itself, so only default\n // items report a value going away. Items belonging to another panel stay\n // silent or they would leave an orphaned entry in this panel's menu.\n //\n // Shares the layout phase with registration above so it runs against an\n // already registered item and batches with it.\n useLayoutEffect(() => {\n if (!hasMatchingPanel || !isShownByDefault && !isValueSet) {\n return;\n }\n flagItemCustomization(isValueSet, label);\n }, [hasMatchingPanel, isValueSet, label, flagItemCustomization, isShownByDefault]);\n\n // Passive so consumer callbacks don't run before the browser has painted.\n useEffect(() => {\n const wasMenuItemChecked = wasMenuItemCheckedRef.current;\n wasMenuItemCheckedRef.current = isMenuItemChecked;\n\n // An item has no menu entry until it registers, so the first time\n // through there is no previous checked state. Items that register\n // already shown, because they have a value or `defaultShown` was set,\n // must not look as though the user just selected them.\n const wasRegistered = wasMenuItemChecked !== undefined;\n\n // Items rendered via fills can outlive a remount of the panel they\n // belong to, leaving them unregistered.\n // See: https://github.com/WordPress/gutenberg/pull/45673\n if (!isRegistered || !wasRegistered || isResetting || !hasMatchingPanel) {\n return;\n }\n if (isMenuItemChecked && !isValueSet && !wasMenuItemChecked) {\n onSelect?.();\n }\n if (!isMenuItemChecked && isValueSet && wasMenuItemChecked) {\n onDeselect?.();\n }\n }, [hasMatchingPanel, isMenuItemChecked, isRegistered, isResetting, isValueSet, onSelect, onDeselect]);\n\n // A default control shows whether or not it has a value; an optional one\n // shows once checked.\n const isShown = isShownByDefault ? isRegistered : isMenuItemChecked;\n const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown;\n const classes = clsx(styles['tools-panel-item'], shouldApplyPlaceholderStyles && styles['tools-panel-item-placeholder'], !shouldApplyPlaceholderStyles && className, firstDisplayedItem === label && __experimentalFirstVisibleItemClass, lastDisplayedItem === label && __experimentalLastVisibleItemClass);\n return {\n ...otherProps,\n isShown,\n shouldRenderPlaceholder,\n className: classes\n };\n}", "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(\"29b739f451\", \"._62d714739f4dc308__tools-panel{border-top:1px solid #ddd;margin-top:-1px;padding:16px}._40db7f4f897b683d__tools-panel-with-inner-wrapper>div:not(:first-of-type){column-gap:16px;display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));row-gap:16px}._95a15674966f30a3__tools-panel-hidden-inner-wrapper>div:not(:first-of-type){display:none}._322a049b9b7d8674__tools-panel-header{gap:8px;grid-column:1/-1}._322a049b9b7d8674__tools-panel-header .components-dropdown-menu{line-height:0;margin:-4px 0}._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header._322a049b9b7d8674__tools-panel-header .components-dropdown-menu__toggle{min-width:24px;padding:0}.b92a382d3b30104d__tools-panel-heading.b92a382d3b30104d__tools-panel-heading{font-size:inherit;line-height:normal;margin:0}._8005d68fffa9db91__tools-panel-item{grid-column:1/-1}._8005d68fffa9db91__tools-panel-item>div,._8005d68fffa9db91__tools-panel-item>fieldset{margin-bottom:0;max-width:100%;padding-bottom:0}._8005d68fffa9db91__tools-panel-item .components-base-control__help,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control,._8005d68fffa9db91__tools-panel-item._8005d68fffa9db91__tools-panel-item .components-base-control .components-base-control__field:last-child{margin-bottom:0}._4f55e1a6e373746e__tools-panel-item-placeholder{display:none}.d40032517bff9e12__dropdown-menu{min-width:200px}.f135b96aa96ca6bb__reset-label{color:var(--wp-components-color-accent-darker-10,var(--wp-admin-theme-color-darker-10,#2145e6));font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.4;margin-inline-start:12px;text-transform:uppercase}._69b138dfa5570d9c__default-controls-item{color:#1e1e1e}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]{color:#757575;opacity:1}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true]:hover{color:#757575}._69b138dfa5570d9c__default-controls-item._69b138dfa5570d9c__default-controls-item[aria-disabled=true] .f135b96aa96ca6bb__reset-label{opacity:.3}\");\n}\nexport default {\"tools-panel\":\"_62d714739f4dc308__tools-panel\",\"tools-panel-with-inner-wrapper\":\"_40db7f4f897b683d__tools-panel-with-inner-wrapper\",\"tools-panel-hidden-inner-wrapper\":\"_95a15674966f30a3__tools-panel-hidden-inner-wrapper\",\"tools-panel-header\":\"_322a049b9b7d8674__tools-panel-header\",\"tools-panel-heading\":\"b92a382d3b30104d__tools-panel-heading\",\"tools-panel-item\":\"_8005d68fffa9db91__tools-panel-item\",\"tools-panel-item-placeholder\":\"_4f55e1a6e373746e__tools-panel-item-placeholder\",\"dropdown-menu\":\"d40032517bff9e12__dropdown-menu\",\"reset-label\":\"f135b96aa96ca6bb__reset-label\",\"default-controls-item\":\"_69b138dfa5570d9c__default-controls-item\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAyB;AACzB,qBAAgE;;;ACFhE,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;A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AAAA,EACb;AACF;",
6
6
  "names": ["import_context", "clsx"]
7
7
  }
@@ -36,13 +36,17 @@ __export(cell_exports, {
36
36
  module.exports = __toCommonJS(cell_exports);
37
37
  var import_element = require("@wordpress/element");
38
38
  var import_item = __toESM(require("./item.cjs"));
39
+ var import_use_validate_tree_grid_structure = require("./use-validate-tree-grid-structure.cjs");
39
40
  var import_jsx_runtime = require("react/jsx-runtime");
40
41
  function UnforwardedTreeGridCell({
41
42
  children,
42
43
  withoutGridItem = false,
43
44
  ...props
44
45
  }, ref) {
46
+ const cellRef = (0, import_element.useRef)(null);
47
+ (0, import_use_validate_tree_grid_structure.useValidateTreeGridStructure)("TreeGridCell", cellRef);
45
48
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
49
+ ref: cellRef,
46
50
  ...props,
47
51
  role: "gridcell",
48
52
  children: withoutGridItem ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tree-grid/cell.tsx"],
4
- "sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport TreeGridItem from './item';\nimport { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedTreeGridCell({\n children,\n withoutGridItem = false,\n ...props\n}, ref) {\n return /*#__PURE__*/_jsx(\"td\", {\n ...props,\n role: \"gridcell\",\n children: withoutGridItem ? /*#__PURE__*/_jsx(_Fragment, {\n children: typeof children === 'function' ? children({\n ...props,\n ref\n }) : children\n }) : /*#__PURE__*/_jsx(TreeGridItem, {\n ref: ref,\n children: children\n })\n });\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef(UnforwardedTreeGridCell);\nTreeGridCell.displayName = 'TreeGridCell';\nexport default TreeGridCell;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,kBAAyB;AACzB,yBAAmD;AACnD,SAAS,wBAAwB;AAAA,EAC/B;AAAA,EACA,kBAAkB;AAAA,EAClB,GAAG;AACL,GAAG,KAAK;AACN,SAAoB,uCAAAA,KAAK,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH,MAAM;AAAA,IACN,UAAU,kBAA+B,uCAAAA,KAAK,mBAAAC,UAAW;AAAA,MACvD,UAAU,OAAO,aAAa,aAAa,SAAS;AAAA,QAClD,GAAG;AAAA,QACH;AAAA,MACF,CAAC,IAAI;AAAA,IACP,CAAC,IAAiB,uCAAAD,KAAK,YAAAE,SAAc;AAAA,MACnC;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AASO,IAAM,mBAAe,2BAAW,uBAAuB;AAC9D,aAAa,cAAc;AAC3B,IAAO,eAAQ;",
4
+ "sourcesContent": ["import { forwardRef, useRef } from '@wordpress/element';\nimport TreeGridItem from './item';\nimport { useValidateTreeGridStructure } from './use-validate-tree-grid-structure';\nimport { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedTreeGridCell({\n children,\n withoutGridItem = false,\n ...props\n}, ref) {\n const cellRef = useRef(null);\n useValidateTreeGridStructure('TreeGridCell', cellRef);\n return /*#__PURE__*/_jsx(\"td\", {\n ref: cellRef,\n ...props,\n role: \"gridcell\",\n children: withoutGridItem ? /*#__PURE__*/_jsx(_Fragment, {\n children: typeof children === 'function' ? children({\n ...props,\n ref\n }) : children\n }) : /*#__PURE__*/_jsx(TreeGridItem, {\n ref: ref,\n children: children\n })\n });\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef(UnforwardedTreeGridCell);\nTreeGridCell.displayName = 'TreeGridCell';\nexport default TreeGridCell;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,kBAAyB;AACzB,8CAA6C;AAC7C,yBAAmD;AACnD,SAAS,wBAAwB;AAAA,EAC/B;AAAA,EACA,kBAAkB;AAAA,EAClB,GAAG;AACL,GAAG,KAAK;AACN,QAAM,cAAU,uBAAO,IAAI;AAC3B,4EAA6B,gBAAgB,OAAO;AACpD,SAAoB,uCAAAA,KAAK,MAAM;AAAA,IAC7B,KAAK;AAAA,IACL,GAAG;AAAA,IACH,MAAM;AAAA,IACN,UAAU,kBAA+B,uCAAAA,KAAK,mBAAAC,UAAW;AAAA,MACvD,UAAU,OAAO,aAAa,aAAa,SAAS;AAAA,QAClD,GAAG;AAAA,QACH;AAAA,MACF,CAAC,IAAI;AAAA,IACP,CAAC,IAAiB,uCAAAD,KAAK,YAAAE,SAAc;AAAA,MACnC;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AASO,IAAM,mBAAe,2BAAW,uBAAuB;AAC9D,aAAa,cAAc;AAC3B,IAAO,eAAQ;",
6
6
  "names": ["_jsx", "_Fragment", "TreeGridItem"]
7
7
  }
@@ -34,10 +34,14 @@ var RovingTabIndexItem = (0, import_element.forwardRef)(function UnforwardedRovi
34
34
  }, forwardedRef) {
35
35
  const localRef = (0, import_element.useRef)(null);
36
36
  const ref = forwardedRef || localRef;
37
+ const context = (0, import_roving_tab_index_context.useRovingTabIndexContext)();
38
+ if (!context) {
39
+ throw new Error("TreeGridItem can only be rendered inside a TreeGrid component.");
40
+ }
37
41
  const {
38
42
  lastFocusedElement,
39
43
  setLastFocusedElement
40
- } = (0, import_roving_tab_index_context.useRovingTabIndexContext)();
44
+ } = context;
41
45
  let tabIndex;
42
46
  if (lastFocusedElement) {
43
47
  tabIndex = lastFocusedElement === // TODO: The original implementation simply used `ref.current` here, assuming
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tree-grid/roving-tab-index-item.tsx"],
4
- "sourcesContent": ["import { useRef, forwardRef } from '@wordpress/element';\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const RovingTabIndexItem = forwardRef(function UnforwardedRovingTabIndexItem({\n children,\n as: Component,\n ...props\n}, forwardedRef) {\n const localRef = useRef(null);\n const ref = forwardedRef || localRef;\n // @ts-expect-error - We actually want to throw an error if this is undefined.\n const {\n lastFocusedElement,\n setLastFocusedElement\n } = useRovingTabIndexContext();\n let tabIndex;\n if (lastFocusedElement) {\n tabIndex = lastFocusedElement === (\n // TODO: The original implementation simply used `ref.current` here, assuming\n // that a forwarded ref would always be an object, which is not necessarily true.\n // This workaround maintains the original runtime behavior in a type-safe way,\n // but should be revisited.\n 'current' in ref ? ref.current : undefined) ? 0 : -1;\n }\n const onFocus = event => setLastFocusedElement?.(event.target);\n const allProps = {\n ref,\n tabIndex,\n onFocus,\n ...props\n };\n if (typeof children === 'function') {\n return children(allProps);\n }\n if (!Component) {\n return null;\n }\n return /*#__PURE__*/_jsx(Component, {\n ...allProps,\n children: children\n });\n});\nRovingTabIndexItem.displayName = 'RovingTabIndexItem';\nexport default RovingTabIndexItem;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,sCAAyC;AACzC,yBAA4B;AACrB,IAAM,yBAAqB,2BAAW,SAAS,8BAA8B;AAAA,EAClF;AAAA,EACA,IAAI;AAAA,EACJ,GAAG;AACL,GAAG,cAAc;AACf,QAAM,eAAW,uBAAO,IAAI;AAC5B,QAAM,MAAM,gBAAgB;AAE5B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,QAAI,0DAAyB;AAC7B,MAAI;AACJ,MAAI,oBAAoB;AACtB,eAAW;AAAA;AAAA;AAAA;AAAA,KAKX,aAAa,MAAM,IAAI,UAAU,UAAa,IAAI;AAAA,EACpD;AACA,QAAM,UAAU,WAAS,wBAAwB,MAAM,MAAM;AAC7D,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACA,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO,SAAS,QAAQ;AAAA,EAC1B;AACA,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT;AACA,SAAoB,uCAAAA,KAAK,WAAW;AAAA,IAClC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,IAAO,gCAAQ;",
4
+ "sourcesContent": ["import { useRef, forwardRef } from '@wordpress/element';\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const RovingTabIndexItem = forwardRef(function UnforwardedRovingTabIndexItem({\n children,\n as: Component,\n ...props\n}, forwardedRef) {\n const localRef = useRef(null);\n const ref = forwardedRef || localRef;\n const context = useRovingTabIndexContext();\n if (!context) {\n throw new Error('TreeGridItem can only be rendered inside a TreeGrid component.');\n }\n const {\n lastFocusedElement,\n setLastFocusedElement\n } = context;\n let tabIndex;\n if (lastFocusedElement) {\n tabIndex = lastFocusedElement === (\n // TODO: The original implementation simply used `ref.current` here, assuming\n // that a forwarded ref would always be an object, which is not necessarily true.\n // This workaround maintains the original runtime behavior in a type-safe way,\n // but should be revisited.\n 'current' in ref ? ref.current : undefined) ? 0 : -1;\n }\n const onFocus = event => setLastFocusedElement?.(event.target);\n const allProps = {\n ref,\n tabIndex,\n onFocus,\n ...props\n };\n if (typeof children === 'function') {\n return children(allProps);\n }\n if (!Component) {\n return null;\n }\n return /*#__PURE__*/_jsx(Component, {\n ...allProps,\n children: children\n });\n});\nRovingTabIndexItem.displayName = 'RovingTabIndexItem';\nexport default RovingTabIndexItem;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,sCAAyC;AACzC,yBAA4B;AACrB,IAAM,yBAAqB,2BAAW,SAAS,8BAA8B;AAAA,EAClF;AAAA,EACA,IAAI;AAAA,EACJ,GAAG;AACL,GAAG,cAAc;AACf,QAAM,eAAW,uBAAO,IAAI;AAC5B,QAAM,MAAM,gBAAgB;AAC5B,QAAM,cAAU,0DAAyB;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,gEAAgE;AAAA,EAClF;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI;AACJ,MAAI;AACJ,MAAI,oBAAoB;AACtB,eAAW;AAAA;AAAA;AAAA;AAAA,KAKX,aAAa,MAAM,IAAI,UAAU,UAAa,IAAI;AAAA,EACpD;AACA,QAAM,UAAU,WAAS,wBAAwB,MAAM,MAAM;AAC7D,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACA,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO,SAAS,QAAQ;AAAA,EAC1B;AACA,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT;AACA,SAAoB,uCAAAA,KAAK,WAAW;AAAA,IAClC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;AACD,mBAAmB,cAAc;AACjC,IAAO,gCAAQ;",
6
6
  "names": ["_jsx"]
7
7
  }
@@ -24,7 +24,9 @@ __export(row_exports, {
24
24
  default: () => row_default
25
25
  });
26
26
  module.exports = __toCommonJS(row_exports);
27
+ var import_compose = require("@wordpress/compose");
27
28
  var import_element = require("@wordpress/element");
29
+ var import_use_validate_tree_grid_structure = require("./use-validate-tree-grid-structure.cjs");
28
30
  var import_jsx_runtime = require("react/jsx-runtime");
29
31
  function UnforwardedTreeGridRow({
30
32
  children,
@@ -34,9 +36,12 @@ function UnforwardedTreeGridRow({
34
36
  isExpanded,
35
37
  ...props
36
38
  }, ref) {
39
+ const rowRef = (0, import_element.useRef)(null);
40
+ const refs = (0, import_compose.useMergeRefs)([rowRef, ref]);
41
+ (0, import_use_validate_tree_grid_structure.useValidateTreeGridStructure)("TreeGridRow", rowRef);
37
42
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", {
38
43
  ...props,
39
- ref,
44
+ ref: refs,
40
45
  role: "row",
41
46
  "aria-level": level,
42
47
  "aria-posinset": positionInSet,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tree-grid/row.tsx"],
4
- "sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedTreeGridRow({\n children,\n level,\n positionInSet,\n setSize,\n isExpanded,\n ...props\n}, ref) {\n return /*#__PURE__*/_jsx(\"tr\", {\n ...props,\n ref: ref,\n role: \"row\",\n \"aria-level\": level,\n \"aria-posinset\": positionInSet,\n \"aria-setsize\": setSize,\n \"aria-expanded\": isExpanded,\n children: children\n });\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef(UnforwardedTreeGridRow);\nTreeGridRow.displayName = 'TreeGridRow';\nexport default TreeGridRow;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,yBAA4B;AAC5B,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AACN,SAAoB,uCAAAA,KAAK,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,IACA,MAAM;AAAA,IACN,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB;AAAA,EACF,CAAC;AACH;AASO,IAAM,kBAAc,2BAAW,sBAAsB;AAC5D,YAAY,cAAc;AAC1B,IAAO,cAAQ;",
4
+ "sourcesContent": ["import { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useValidateTreeGridStructure } from './use-validate-tree-grid-structure';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedTreeGridRow({\n children,\n level,\n positionInSet,\n setSize,\n isExpanded,\n ...props\n}, ref) {\n const rowRef = useRef(null);\n const refs = useMergeRefs([rowRef, ref]);\n useValidateTreeGridStructure('TreeGridRow', rowRef);\n return /*#__PURE__*/_jsx(\"tr\", {\n ...props,\n ref: refs,\n role: \"row\",\n \"aria-level\": level,\n \"aria-posinset\": positionInSet,\n \"aria-setsize\": setSize,\n \"aria-expanded\": isExpanded,\n children: children\n });\n}\n\n/**\n * `TreeGridRow` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridRow = forwardRef(UnforwardedTreeGridRow);\nTreeGridRow.displayName = 'TreeGridRow';\nexport default TreeGridRow;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA6B;AAC7B,qBAAmC;AACnC,8CAA6C;AAC7C,yBAA4B;AAC5B,SAAS,uBAAuB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,KAAK;AACN,QAAM,aAAS,uBAAO,IAAI;AAC1B,QAAM,WAAO,6BAAa,CAAC,QAAQ,GAAG,CAAC;AACvC,4EAA6B,eAAe,MAAM;AAClD,SAAoB,uCAAAA,KAAK,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH,KAAK;AAAA,IACL,MAAM;AAAA,IACN,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB;AAAA,EACF,CAAC;AACH;AASO,IAAM,kBAAc,2BAAW,sBAAsB;AAC5D,YAAY,cAAc;AAC1B,IAAO,cAAQ;",
6
6
  "names": ["_jsx"]
7
7
  }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/components/src/tree-grid/use-validate-tree-grid-structure.ts
21
+ var use_validate_tree_grid_structure_exports = {};
22
+ __export(use_validate_tree_grid_structure_exports, {
23
+ useValidateTreeGridStructure: () => useValidateTreeGridStructure
24
+ });
25
+ module.exports = __toCommonJS(use_validate_tree_grid_structure_exports);
26
+ var import_element = require("@wordpress/element");
27
+ var ROW_SELECTOR = 'tr:not([role]), [role="row"]';
28
+ var TREE_GRID_SELECTOR = '[role="treegrid"]';
29
+ function getAriaOwners(element) {
30
+ if (!element.id) {
31
+ return [];
32
+ }
33
+ const escapedId = element.id.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
34
+ return Array.from(element.ownerDocument.querySelectorAll(`[aria-owns~="${escapedId}"]`));
35
+ }
36
+ function isContainedInOrOwnedBy(element, selector, visited = /* @__PURE__ */ new Set()) {
37
+ if (visited.has(element)) {
38
+ return false;
39
+ }
40
+ visited.add(element);
41
+ if (element.parentElement?.closest(selector)) {
42
+ return true;
43
+ }
44
+ const hasValidOwner = getAriaOwners(element).some((owner) => owner.matches(selector) || isContainedInOrOwnedBy(owner, selector, visited));
45
+ if (hasValidOwner) {
46
+ return true;
47
+ }
48
+ return element.parentElement ? isContainedInOrOwnedBy(element.parentElement, selector, visited) : false;
49
+ }
50
+ function isOwnedByRowInTreeGrid(element, visited = /* @__PURE__ */ new Set()) {
51
+ if (visited.has(element)) {
52
+ return false;
53
+ }
54
+ visited.add(element);
55
+ const hasValidOwner = getAriaOwners(element).some((owner) => {
56
+ const row = owner.matches(ROW_SELECTOR) ? owner : owner.closest(ROW_SELECTOR);
57
+ return row ? isContainedInOrOwnedBy(row, TREE_GRID_SELECTOR) : isOwnedByRowInTreeGrid(owner, visited);
58
+ });
59
+ if (hasValidOwner) {
60
+ return true;
61
+ }
62
+ return element.parentElement ? isOwnedByRowInTreeGrid(element.parentElement, visited) : false;
63
+ }
64
+ function useValidateTreeGridStructure(componentName, elementRef) {
65
+ (0, import_element.useEffect)(() => {
66
+ const element = elementRef.current;
67
+ if (!element) {
68
+ return;
69
+ }
70
+ const row = element.parentElement?.closest(ROW_SELECTOR);
71
+ const hasValidStructure = componentName === "TreeGridRow" ? isContainedInOrOwnedBy(element, TREE_GRID_SELECTOR) : row && isContainedInOrOwnedBy(row, TREE_GRID_SELECTOR) || isOwnedByRowInTreeGrid(element);
72
+ if (!hasValidStructure) {
73
+ throw new Error(componentName === "TreeGridRow" ? 'TreeGridRow must be rendered inside an element with role="treegrid".' : 'TreeGridCell must be rendered as a cell in a row that belongs to an element with role="treegrid".');
74
+ }
75
+ }, [componentName, elementRef]);
76
+ }
77
+ // Annotate the CommonJS export names for ESM import in node:
78
+ 0 && (module.exports = {
79
+ useValidateTreeGridStructure
80
+ });
81
+ //# sourceMappingURL=use-validate-tree-grid-structure.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/tree-grid/use-validate-tree-grid-structure.ts"],
4
+ "sourcesContent": ["import { useEffect } from '@wordpress/element';\nconst ROW_SELECTOR = 'tr:not([role]), [role=\"row\"]';\nconst TREE_GRID_SELECTOR = '[role=\"treegrid\"]';\nfunction getAriaOwners(element) {\n if (!element.id) {\n return [];\n }\n const escapedId = element.id.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"');\n return Array.from(element.ownerDocument.querySelectorAll(`[aria-owns~=\"${escapedId}\"]`));\n}\nfunction isContainedInOrOwnedBy(element, selector, visited = new Set()) {\n if (visited.has(element)) {\n return false;\n }\n visited.add(element);\n if (element.parentElement?.closest(selector)) {\n return true;\n }\n const hasValidOwner = getAriaOwners(element).some(owner => owner.matches(selector) || isContainedInOrOwnedBy(owner, selector, visited));\n if (hasValidOwner) {\n return true;\n }\n return element.parentElement ? isContainedInOrOwnedBy(element.parentElement, selector, visited) : false;\n}\nfunction isOwnedByRowInTreeGrid(element, visited = new Set()) {\n if (visited.has(element)) {\n return false;\n }\n visited.add(element);\n const hasValidOwner = getAriaOwners(element).some(owner => {\n const row = owner.matches(ROW_SELECTOR) ? owner : owner.closest(ROW_SELECTOR);\n return row ? isContainedInOrOwnedBy(row, TREE_GRID_SELECTOR) : isOwnedByRowInTreeGrid(owner, visited);\n });\n if (hasValidOwner) {\n return true;\n }\n return element.parentElement ? isOwnedByRowInTreeGrid(element.parentElement, visited) : false;\n}\nexport function useValidateTreeGridStructure(componentName, elementRef) {\n useEffect(() => {\n const element = elementRef.current;\n if (!element) {\n return;\n }\n const row = element.parentElement?.closest(ROW_SELECTOR);\n const hasValidStructure = componentName === 'TreeGridRow' ? isContainedInOrOwnedBy(element, TREE_GRID_SELECTOR) : row && isContainedInOrOwnedBy(row, TREE_GRID_SELECTOR) || isOwnedByRowInTreeGrid(element);\n if (!hasValidStructure) {\n throw new Error(componentName === 'TreeGridRow' ? 'TreeGridRow must be rendered inside an element with role=\"treegrid\".' : 'TreeGridCell must be rendered as a cell in a row that belongs to an element with role=\"treegrid\".');\n }\n }, [componentName, elementRef]);\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,IAAM,eAAe;AACrB,IAAM,qBAAqB;AAC3B,SAAS,cAAc,SAAS;AAC9B,MAAI,CAAC,QAAQ,IAAI;AACf,WAAO,CAAC;AAAA,EACV;AACA,QAAM,YAAY,QAAQ,GAAG,WAAW,MAAM,MAAM,EAAE,WAAW,KAAK,KAAK;AAC3E,SAAO,MAAM,KAAK,QAAQ,cAAc,iBAAiB,gBAAgB,SAAS,IAAI,CAAC;AACzF;AACA,SAAS,uBAAuB,SAAS,UAAU,UAAU,oBAAI,IAAI,GAAG;AACtE,MAAI,QAAQ,IAAI,OAAO,GAAG;AACxB,WAAO;AAAA,EACT;AACA,UAAQ,IAAI,OAAO;AACnB,MAAI,QAAQ,eAAe,QAAQ,QAAQ,GAAG;AAC5C,WAAO;AAAA,EACT;AACA,QAAM,gBAAgB,cAAc,OAAO,EAAE,KAAK,WAAS,MAAM,QAAQ,QAAQ,KAAK,uBAAuB,OAAO,UAAU,OAAO,CAAC;AACtI,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,gBAAgB,uBAAuB,QAAQ,eAAe,UAAU,OAAO,IAAI;AACpG;AACA,SAAS,uBAAuB,SAAS,UAAU,oBAAI,IAAI,GAAG;AAC5D,MAAI,QAAQ,IAAI,OAAO,GAAG;AACxB,WAAO;AAAA,EACT;AACA,UAAQ,IAAI,OAAO;AACnB,QAAM,gBAAgB,cAAc,OAAO,EAAE,KAAK,WAAS;AACzD,UAAM,MAAM,MAAM,QAAQ,YAAY,IAAI,QAAQ,MAAM,QAAQ,YAAY;AAC5E,WAAO,MAAM,uBAAuB,KAAK,kBAAkB,IAAI,uBAAuB,OAAO,OAAO;AAAA,EACtG,CAAC;AACD,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,gBAAgB,uBAAuB,QAAQ,eAAe,OAAO,IAAI;AAC1F;AACO,SAAS,6BAA6B,eAAe,YAAY;AACtE,gCAAU,MAAM;AACd,UAAM,UAAU,WAAW;AAC3B,QAAI,CAAC,SAAS;AACZ;AAAA,IACF;AACA,UAAM,MAAM,QAAQ,eAAe,QAAQ,YAAY;AACvD,UAAM,oBAAoB,kBAAkB,gBAAgB,uBAAuB,SAAS,kBAAkB,IAAI,OAAO,uBAAuB,KAAK,kBAAkB,KAAK,uBAAuB,OAAO;AAC1M,QAAI,CAAC,mBAAmB;AACtB,YAAM,IAAI,MAAM,kBAAkB,gBAAgB,yEAAyE,mGAAmG;AAAA,IAChO;AAAA,EACF,GAAG,CAAC,eAAe,UAAU,CAAC;AAChC;",
6
+ "names": []
7
+ }
@@ -73,8 +73,9 @@ var UI = {
73
73
  border: THEME.gray[600],
74
74
  borderHover: THEME.gray[700],
75
75
  borderFocus: THEME.accent,
76
- borderDisabled: THEME.gray[400],
77
- textDisabled: THEME.gray[600],
76
+ // The gray ramp above has no disabled step to map these through.
77
+ borderDisabled: `var(--wpds-color-stroke-interactive-neutral-disabled, #dbdbdb)`,
78
+ textDisabled: `var(--wpds-color-foreground-interactive-neutral-disabled, #8d8d8d)`,
78
79
  // Matches @wordpress/base-styles
79
80
  darkGrayPlaceholder: `color-mix(in srgb, ${THEME.foreground}, transparent 38%)`,
80
81
  lightGrayPlaceholder: `color-mix(in srgb, ${THEME.background}, transparent 35%)`