@wordpress/components 36.0.1 → 37.0.1-next.v.202607070741.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 (706) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/CONTRIBUTING.md +6 -4
  3. package/build/border-box-control/border-box-control/component.cjs +4 -9
  4. package/build/border-box-control/border-box-control/component.cjs.map +2 -2
  5. package/build/border-box-control/border-box-control/hook.cjs +3 -10
  6. package/build/border-box-control/border-box-control/hook.cjs.map +2 -2
  7. package/build/border-box-control/border-box-control-linked-button/hook.cjs +2 -3
  8. package/build/border-box-control/border-box-control-linked-button/hook.cjs.map +2 -2
  9. package/build/border-box-control/border-box-control-split-controls/component.cjs +2 -6
  10. package/build/border-box-control/border-box-control-split-controls/component.cjs.map +2 -2
  11. package/build/border-box-control/border-box-control-split-controls/hook.cjs +2 -4
  12. package/build/border-box-control/border-box-control-split-controls/hook.cjs.map +2 -2
  13. package/build/border-box-control/border-box-control-visualizer/hook.cjs +2 -3
  14. package/build/border-box-control/border-box-control-visualizer/hook.cjs.map +2 -2
  15. package/build/border-box-control/styles.cjs +20 -17
  16. package/build/border-box-control/styles.cjs.map +2 -2
  17. package/build/border-control/border-control/component.cjs +3 -11
  18. package/build/border-control/border-control/component.cjs.map +2 -2
  19. package/build/border-control/border-control/hook.cjs +11 -21
  20. package/build/border-control/border-control/hook.cjs.map +3 -3
  21. package/build/border-control/border-control-dropdown/component.cjs +1 -2
  22. package/build/border-control/border-control-dropdown/component.cjs.map +2 -2
  23. package/build/border-control/border-control-dropdown/hook.cjs +2 -4
  24. package/build/border-control/border-control-dropdown/hook.cjs.map +2 -2
  25. package/build/border-control/border-control-style-picker/component.cjs +0 -1
  26. package/build/border-control/border-control-style-picker/component.cjs.map +2 -2
  27. package/build/border-control/styles.cjs +27 -15
  28. package/build/border-control/styles.cjs.map +2 -2
  29. package/build/box-control/box-input-control.cjs +0 -5
  30. package/build/box-control/box-input-control.cjs.map +2 -2
  31. package/build/card/card/hook.cjs +4 -1
  32. package/build/card/card/hook.cjs.map +2 -2
  33. package/build/card/card-footer/hook.cjs +12 -12
  34. package/build/card/card-footer/hook.cjs.map +2 -2
  35. package/build/card/card-header/hook.cjs +12 -12
  36. package/build/card/card-header/hook.cjs.map +2 -2
  37. package/build/card/styles.cjs +43 -13
  38. package/build/card/styles.cjs.map +2 -2
  39. package/build/color-picker/component.cjs.map +2 -2
  40. package/build/color-picker/input-with-slider.cjs +0 -1
  41. package/build/color-picker/input-with-slider.cjs.map +2 -2
  42. package/build/combobox-control/index.cjs +1 -10
  43. package/build/combobox-control/index.cjs.map +2 -2
  44. package/build/combobox-control/styles.cjs +1 -5
  45. package/build/combobox-control/styles.cjs.map +2 -2
  46. package/build/custom-gradient-picker/index.cjs +0 -1
  47. package/build/custom-gradient-picker/index.cjs.map +2 -2
  48. package/build/custom-select-control/index.cjs +4 -19
  49. package/build/custom-select-control/index.cjs.map +2 -2
  50. package/build/date-time/time-picker/index.cjs +0 -1
  51. package/build/date-time/time-picker/index.cjs.map +2 -2
  52. package/build/date-time/time-picker/time-input/index.cjs +0 -1
  53. package/build/date-time/time-picker/time-input/index.cjs.map +2 -2
  54. package/build/divider/component.cjs +1 -1
  55. package/build/divider/component.cjs.map +2 -2
  56. package/build/elevation/hook.cjs +6 -5
  57. package/build/elevation/hook.cjs.map +2 -2
  58. package/build/external-link/index.cjs +0 -3
  59. package/build/external-link/index.cjs.map +2 -2
  60. package/build/flex/flex/hook.cjs +97 -18
  61. package/build/flex/flex/hook.cjs.map +4 -4
  62. package/build/flex/flex-item/hook.cjs +94 -10
  63. package/build/flex/flex-item/hook.cjs.map +4 -4
  64. package/build/focal-point-picker/controls.cjs +0 -1
  65. package/build/focal-point-picker/controls.cjs.map +2 -2
  66. package/build/focal-point-picker/index.cjs +1 -0
  67. package/build/focal-point-picker/index.cjs.map +2 -2
  68. package/build/font-size-picker/font-size-picker-select.cjs +1 -6
  69. package/build/font-size-picker/font-size-picker-select.cjs.map +2 -2
  70. package/build/font-size-picker/font-size-picker-toggle-group.cjs +0 -5
  71. package/build/font-size-picker/font-size-picker-toggle-group.cjs.map +2 -2
  72. package/build/font-size-picker/index.cjs +1 -18
  73. package/build/font-size-picker/index.cjs.map +2 -2
  74. package/build/form-file-upload/index.cjs +7 -18
  75. package/build/form-file-upload/index.cjs.map +2 -2
  76. package/build/form-token-field/index.cjs +1 -11
  77. package/build/form-token-field/index.cjs.map +2 -2
  78. package/build/form-token-field/styles.cjs +1 -7
  79. package/build/form-token-field/styles.cjs.map +2 -2
  80. package/build/number-control/index.cjs.map +2 -2
  81. package/build/query-controls/author-select.cjs +1 -3
  82. package/build/query-controls/author-select.cjs.map +2 -2
  83. package/build/query-controls/category-select.cjs +1 -3
  84. package/build/query-controls/category-select.cjs.map +2 -2
  85. package/build/query-controls/index.cjs +0 -5
  86. package/build/query-controls/index.cjs.map +2 -2
  87. package/build/radio-group/radio.cjs +6 -14
  88. package/build/radio-group/radio.cjs.map +2 -2
  89. package/build/range-control/index.cjs +6 -15
  90. package/build/range-control/index.cjs.map +2 -2
  91. package/build/range-control/styles/range-control-styles.cjs +32 -30
  92. package/build/range-control/styles/range-control-styles.cjs.map +2 -2
  93. package/build/resizable-box/index.cjs.map +2 -2
  94. package/build/search-control/index.cjs +2 -1
  95. package/build/search-control/index.cjs.map +2 -2
  96. package/build/select-control/index.cjs +7 -15
  97. package/build/select-control/index.cjs.map +2 -2
  98. package/build/select-control/styles/select-control-styles.cjs +8 -16
  99. package/build/select-control/styles/select-control-styles.cjs.map +2 -2
  100. package/build/slot-fill/index.cjs.map +2 -2
  101. package/build/spacer/hook.cjs +4 -3
  102. package/build/spacer/hook.cjs.map +2 -2
  103. package/build/surface/hook.cjs +103 -16
  104. package/build/surface/hook.cjs.map +4 -4
  105. package/build/text/hook.cjs +11 -11
  106. package/build/text/hook.cjs.map +2 -2
  107. package/build/theme/index.cjs +119 -7
  108. package/build/theme/index.cjs.map +4 -4
  109. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs +1 -3
  110. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs.map +2 -2
  111. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs +1 -3
  112. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs.map +2 -2
  113. package/build/toggle-group-control/toggle-group-control/component.cjs +6 -16
  114. package/build/toggle-group-control/toggle-group-control/component.cjs.map +2 -2
  115. package/build/toggle-group-control/toggle-group-control/styles.cjs +11 -37
  116. package/build/toggle-group-control/toggle-group-control/styles.cjs.map +2 -2
  117. package/build/toggle-group-control/toggle-group-control-option/component.cjs.map +2 -2
  118. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs +3 -5
  119. package/build/toggle-group-control/toggle-group-control-option-base/component.cjs.map +2 -2
  120. package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs +14 -18
  121. package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs.map +2 -2
  122. package/build/toggle-group-control/toggle-group-control-option-icon/component.cjs.map +1 -1
  123. package/build/tools-panel/styles.cjs +24 -15
  124. package/build/tools-panel/styles.cjs.map +2 -2
  125. package/build/tools-panel/tools-panel/component.cjs.map +2 -2
  126. package/build/tools-panel/tools-panel/hook.cjs +5 -3
  127. package/build/tools-panel/tools-panel/hook.cjs.map +2 -2
  128. package/build/tree-select/index.cjs +9 -20
  129. package/build/tree-select/index.cjs.map +2 -2
  130. package/build/truncate/hook.cjs +95 -9
  131. package/build/truncate/hook.cjs.map +4 -4
  132. package/build/unit-control/index.cjs +3 -12
  133. package/build/unit-control/index.cjs.map +2 -2
  134. package/build/utils/config-values.cjs +0 -6
  135. package/build/utils/config-values.cjs.map +2 -2
  136. package/build/utils/hooks/use-cx.cjs.map +2 -2
  137. package/build/utils/polymorphic-element.cjs +123 -0
  138. package/build/utils/polymorphic-element.cjs.map +7 -0
  139. package/build/validated-form-controls/components/combobox-control.cjs +0 -1
  140. package/build/validated-form-controls/components/combobox-control.cjs.map +2 -2
  141. package/build/validated-form-controls/components/custom-select-control.cjs +0 -1
  142. package/build/validated-form-controls/components/custom-select-control.cjs.map +2 -2
  143. package/build/validated-form-controls/components/form-token-field.cjs +0 -1
  144. package/build/validated-form-controls/components/form-token-field.cjs.map +2 -2
  145. package/build/validated-form-controls/components/range-control.cjs +0 -1
  146. package/build/validated-form-controls/components/range-control.cjs.map +2 -2
  147. package/build/validated-form-controls/components/select-control.cjs +0 -1
  148. package/build/validated-form-controls/components/select-control.cjs.map +2 -2
  149. package/build/validated-form-controls/components/toggle-group-control.cjs +0 -1
  150. package/build/validated-form-controls/components/toggle-group-control.cjs.map +2 -2
  151. package/build/view/component.cjs +4 -20
  152. package/build/view/component.cjs.map +3 -3
  153. package/build-module/border-box-control/border-box-control/component.mjs +4 -9
  154. package/build-module/border-box-control/border-box-control/component.mjs.map +2 -2
  155. package/build-module/border-box-control/border-box-control/hook.mjs +3 -10
  156. package/build-module/border-box-control/border-box-control/hook.mjs.map +2 -2
  157. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs +2 -3
  158. package/build-module/border-box-control/border-box-control-linked-button/hook.mjs.map +2 -2
  159. package/build-module/border-box-control/border-box-control-split-controls/component.mjs +2 -6
  160. package/build-module/border-box-control/border-box-control-split-controls/component.mjs.map +2 -2
  161. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs +2 -4
  162. package/build-module/border-box-control/border-box-control-split-controls/hook.mjs.map +2 -2
  163. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs +2 -3
  164. package/build-module/border-box-control/border-box-control-visualizer/hook.mjs.map +2 -2
  165. package/build-module/border-box-control/styles.mjs +20 -17
  166. package/build-module/border-box-control/styles.mjs.map +2 -2
  167. package/build-module/border-control/border-control/component.mjs +3 -11
  168. package/build-module/border-control/border-control/component.mjs.map +2 -2
  169. package/build-module/border-control/border-control/hook.mjs +11 -21
  170. package/build-module/border-control/border-control/hook.mjs.map +3 -3
  171. package/build-module/border-control/border-control-dropdown/component.mjs +1 -2
  172. package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
  173. package/build-module/border-control/border-control-dropdown/hook.mjs +2 -4
  174. package/build-module/border-control/border-control-dropdown/hook.mjs.map +2 -2
  175. package/build-module/border-control/border-control-style-picker/component.mjs +0 -1
  176. package/build-module/border-control/border-control-style-picker/component.mjs.map +2 -2
  177. package/build-module/border-control/styles.mjs +26 -15
  178. package/build-module/border-control/styles.mjs.map +2 -2
  179. package/build-module/box-control/box-input-control.mjs +0 -5
  180. package/build-module/box-control/box-input-control.mjs.map +2 -2
  181. package/build-module/card/card/hook.mjs +4 -1
  182. package/build-module/card/card/hook.mjs.map +2 -2
  183. package/build-module/card/card-footer/hook.mjs +12 -12
  184. package/build-module/card/card-footer/hook.mjs.map +2 -2
  185. package/build-module/card/card-header/hook.mjs +12 -12
  186. package/build-module/card/card-header/hook.mjs.map +2 -2
  187. package/build-module/card/styles.mjs +40 -13
  188. package/build-module/card/styles.mjs.map +2 -2
  189. package/build-module/color-picker/component.mjs.map +2 -2
  190. package/build-module/color-picker/input-with-slider.mjs +0 -1
  191. package/build-module/color-picker/input-with-slider.mjs.map +2 -2
  192. package/build-module/combobox-control/index.mjs +1 -10
  193. package/build-module/combobox-control/index.mjs.map +2 -2
  194. package/build-module/combobox-control/styles.mjs +1 -5
  195. package/build-module/combobox-control/styles.mjs.map +2 -2
  196. package/build-module/custom-gradient-picker/index.mjs +0 -1
  197. package/build-module/custom-gradient-picker/index.mjs.map +2 -2
  198. package/build-module/custom-select-control/index.mjs +4 -19
  199. package/build-module/custom-select-control/index.mjs.map +2 -2
  200. package/build-module/date-time/time-picker/index.mjs +0 -1
  201. package/build-module/date-time/time-picker/index.mjs.map +2 -2
  202. package/build-module/date-time/time-picker/time-input/index.mjs +0 -1
  203. package/build-module/date-time/time-picker/time-input/index.mjs.map +2 -2
  204. package/build-module/divider/component.mjs +1 -1
  205. package/build-module/divider/component.mjs.map +2 -2
  206. package/build-module/elevation/hook.mjs +6 -5
  207. package/build-module/elevation/hook.mjs.map +2 -2
  208. package/build-module/external-link/index.mjs +0 -3
  209. package/build-module/external-link/index.mjs.map +2 -2
  210. package/build-module/flex/flex/hook.mjs +97 -18
  211. package/build-module/flex/flex/hook.mjs.map +3 -3
  212. package/build-module/flex/flex-item/hook.mjs +94 -10
  213. package/build-module/flex/flex-item/hook.mjs.map +3 -3
  214. package/build-module/focal-point-picker/controls.mjs +0 -1
  215. package/build-module/focal-point-picker/controls.mjs.map +2 -2
  216. package/build-module/focal-point-picker/index.mjs +1 -0
  217. package/build-module/focal-point-picker/index.mjs.map +2 -2
  218. package/build-module/font-size-picker/font-size-picker-select.mjs +1 -6
  219. package/build-module/font-size-picker/font-size-picker-select.mjs.map +2 -2
  220. package/build-module/font-size-picker/font-size-picker-toggle-group.mjs +0 -5
  221. package/build-module/font-size-picker/font-size-picker-toggle-group.mjs.map +2 -2
  222. package/build-module/font-size-picker/index.mjs +1 -18
  223. package/build-module/font-size-picker/index.mjs.map +2 -2
  224. package/build-module/form-file-upload/index.mjs +7 -18
  225. package/build-module/form-file-upload/index.mjs.map +2 -2
  226. package/build-module/form-token-field/index.mjs +1 -11
  227. package/build-module/form-token-field/index.mjs.map +2 -2
  228. package/build-module/form-token-field/styles.mjs +1 -7
  229. package/build-module/form-token-field/styles.mjs.map +2 -2
  230. package/build-module/number-control/index.mjs.map +2 -2
  231. package/build-module/query-controls/author-select.mjs +1 -3
  232. package/build-module/query-controls/author-select.mjs.map +2 -2
  233. package/build-module/query-controls/category-select.mjs +1 -3
  234. package/build-module/query-controls/category-select.mjs.map +2 -2
  235. package/build-module/query-controls/index.mjs +0 -5
  236. package/build-module/query-controls/index.mjs.map +2 -2
  237. package/build-module/radio-group/radio.mjs +6 -14
  238. package/build-module/radio-group/radio.mjs.map +2 -2
  239. package/build-module/range-control/index.mjs +6 -15
  240. package/build-module/range-control/index.mjs.map +2 -2
  241. package/build-module/range-control/styles/range-control-styles.mjs +32 -30
  242. package/build-module/range-control/styles/range-control-styles.mjs.map +2 -2
  243. package/build-module/resizable-box/index.mjs.map +2 -2
  244. package/build-module/search-control/index.mjs +2 -1
  245. package/build-module/search-control/index.mjs.map +2 -2
  246. package/build-module/select-control/index.mjs +7 -15
  247. package/build-module/select-control/index.mjs.map +2 -2
  248. package/build-module/select-control/styles/select-control-styles.mjs +8 -16
  249. package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
  250. package/build-module/slot-fill/index.mjs.map +2 -2
  251. package/build-module/spacer/hook.mjs +4 -3
  252. package/build-module/spacer/hook.mjs.map +2 -2
  253. package/build-module/surface/hook.mjs +103 -16
  254. package/build-module/surface/hook.mjs.map +3 -3
  255. package/build-module/text/hook.mjs +11 -11
  256. package/build-module/text/hook.mjs.map +2 -2
  257. package/build-module/theme/index.mjs +109 -7
  258. package/build-module/theme/index.mjs.map +3 -3
  259. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs +1 -3
  260. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs.map +2 -2
  261. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs +1 -3
  262. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs.map +2 -2
  263. package/build-module/toggle-group-control/toggle-group-control/component.mjs +6 -16
  264. package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +2 -2
  265. package/build-module/toggle-group-control/toggle-group-control/styles.mjs +10 -35
  266. package/build-module/toggle-group-control/toggle-group-control/styles.mjs.map +2 -2
  267. package/build-module/toggle-group-control/toggle-group-control-option/component.mjs.map +2 -2
  268. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs +3 -5
  269. package/build-module/toggle-group-control/toggle-group-control-option-base/component.mjs.map +2 -2
  270. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs +14 -18
  271. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs.map +2 -2
  272. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.mjs.map +1 -1
  273. package/build-module/tools-panel/styles.mjs +22 -14
  274. package/build-module/tools-panel/styles.mjs.map +2 -2
  275. package/build-module/tools-panel/tools-panel/component.mjs.map +2 -2
  276. package/build-module/tools-panel/tools-panel/hook.mjs +5 -3
  277. package/build-module/tools-panel/tools-panel/hook.mjs.map +2 -2
  278. package/build-module/tree-select/index.mjs +9 -20
  279. package/build-module/tree-select/index.mjs.map +2 -2
  280. package/build-module/truncate/hook.mjs +95 -9
  281. package/build-module/truncate/hook.mjs.map +3 -3
  282. package/build-module/unit-control/index.mjs +3 -12
  283. package/build-module/unit-control/index.mjs.map +2 -2
  284. package/build-module/utils/config-values.mjs +0 -6
  285. package/build-module/utils/config-values.mjs.map +2 -2
  286. package/build-module/utils/hooks/use-cx.mjs.map +2 -2
  287. package/build-module/utils/polymorphic-element.mjs +98 -0
  288. package/build-module/utils/polymorphic-element.mjs.map +7 -0
  289. package/build-module/validated-form-controls/components/combobox-control.mjs +0 -1
  290. package/build-module/validated-form-controls/components/combobox-control.mjs.map +2 -2
  291. package/build-module/validated-form-controls/components/custom-select-control.mjs +0 -1
  292. package/build-module/validated-form-controls/components/custom-select-control.mjs.map +2 -2
  293. package/build-module/validated-form-controls/components/form-token-field.mjs +0 -1
  294. package/build-module/validated-form-controls/components/form-token-field.mjs.map +2 -2
  295. package/build-module/validated-form-controls/components/range-control.mjs +0 -1
  296. package/build-module/validated-form-controls/components/range-control.mjs.map +2 -2
  297. package/build-module/validated-form-controls/components/select-control.mjs +0 -1
  298. package/build-module/validated-form-controls/components/select-control.mjs.map +2 -2
  299. package/build-module/validated-form-controls/components/toggle-group-control.mjs +0 -1
  300. package/build-module/validated-form-controls/components/toggle-group-control.mjs.map +2 -2
  301. package/build-module/view/component.mjs +4 -10
  302. package/build-module/view/component.mjs.map +2 -2
  303. package/build-style/style-rtl.css +31 -48
  304. package/build-style/style.css +31 -48
  305. package/build-types/border-box-control/border-box-control/component.d.ts +2 -2
  306. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  307. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  308. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  309. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +2 -4
  310. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  311. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  312. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
  313. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  314. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
  315. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  316. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +2 -3
  317. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  318. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  319. package/build-types/border-box-control/stories/index.story.d.ts +2 -1
  320. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  321. package/build-types/border-box-control/styles.d.ts +3 -3
  322. package/build-types/border-box-control/styles.d.ts.map +1 -1
  323. package/build-types/border-box-control/types.d.ts +13 -5
  324. package/build-types/border-box-control/types.d.ts.map +1 -1
  325. package/build-types/border-control/border-control/component.d.ts +0 -2
  326. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  327. package/build-types/border-control/border-control/hook.d.ts +0 -2
  328. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  329. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -1
  330. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  331. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  332. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  333. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  334. package/build-types/border-control/stories/index.story.d.ts +5 -10
  335. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  336. package/build-types/border-control/styles.d.ts +5 -2
  337. package/build-types/border-control/styles.d.ts.map +1 -1
  338. package/build-types/border-control/types.d.ts +5 -10
  339. package/build-types/border-control/types.d.ts.map +1 -1
  340. package/build-types/box-control/box-input-control.d.ts.map +1 -1
  341. package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
  342. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  343. package/build-types/card/card/hook.d.ts +1 -1
  344. package/build-types/card/card/hook.d.ts.map +1 -1
  345. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  346. package/build-types/card/card-header/hook.d.ts.map +1 -1
  347. package/build-types/card/styles.d.ts +4 -0
  348. package/build-types/card/styles.d.ts.map +1 -1
  349. package/build-types/color-picker/component.d.ts +4 -0
  350. package/build-types/color-picker/component.d.ts.map +1 -1
  351. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  352. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  353. package/build-types/combobox-control/index.d.ts +0 -1
  354. package/build-types/combobox-control/index.d.ts.map +1 -1
  355. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  356. package/build-types/combobox-control/styles.d.ts +1 -2
  357. package/build-types/combobox-control/styles.d.ts.map +1 -1
  358. package/build-types/combobox-control/types.d.ts +2 -1
  359. package/build-types/combobox-control/types.d.ts.map +1 -1
  360. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  361. package/build-types/custom-select-control/index.d.ts +5 -0
  362. package/build-types/custom-select-control/index.d.ts.map +1 -1
  363. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  364. package/build-types/custom-select-control/types.d.ts +2 -1
  365. package/build-types/custom-select-control/types.d.ts.map +1 -1
  366. package/build-types/date-time/time-picker/index.d.ts.map +1 -1
  367. package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -1
  368. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  369. package/build-types/elevation/hook.d.ts.map +1 -1
  370. package/build-types/external-link/index.d.ts.map +1 -1
  371. package/build-types/flex/flex/hook.d.ts +864 -4
  372. package/build-types/flex/flex/hook.d.ts.map +1 -1
  373. package/build-types/flex/flex-block/hook.d.ts +860 -1
  374. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  375. package/build-types/flex/flex-item/hook.d.ts +860 -4
  376. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  377. package/build-types/focal-point-picker/index.d.ts +1 -1
  378. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  379. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +252 -1
  380. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  381. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  382. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  383. package/build-types/font-size-picker/index.d.ts.map +1 -1
  384. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  385. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  386. package/build-types/font-size-picker/types.d.ts +6 -5
  387. package/build-types/font-size-picker/types.d.ts.map +1 -1
  388. package/build-types/form-file-upload/index.d.ts +1 -2
  389. package/build-types/form-file-upload/index.d.ts.map +1 -1
  390. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  391. package/build-types/form-file-upload/types.d.ts +2 -2
  392. package/build-types/form-file-upload/types.d.ts.map +1 -1
  393. package/build-types/form-token-field/index.d.ts.map +1 -1
  394. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  395. package/build-types/form-token-field/styles.d.ts +1 -6
  396. package/build-types/form-token-field/styles.d.ts.map +1 -1
  397. package/build-types/form-token-field/types.d.ts +2 -1
  398. package/build-types/form-token-field/types.d.ts.map +1 -1
  399. package/build-types/h-stack/hook.d.ts +864 -1
  400. package/build-types/h-stack/hook.d.ts.map +1 -1
  401. package/build-types/heading/hook.d.ts +1 -1
  402. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  403. package/build-types/number-control/index.d.ts +4 -0
  404. package/build-types/number-control/index.d.ts.map +1 -1
  405. package/build-types/palette-edit/styles.d.ts +750 -0
  406. package/build-types/palette-edit/styles.d.ts.map +1 -1
  407. package/build-types/query-controls/author-select.d.ts +1 -1
  408. package/build-types/query-controls/author-select.d.ts.map +1 -1
  409. package/build-types/query-controls/category-select.d.ts +1 -1
  410. package/build-types/query-controls/category-select.d.ts.map +1 -1
  411. package/build-types/query-controls/index.d.ts.map +1 -1
  412. package/build-types/query-controls/types.d.ts +0 -2
  413. package/build-types/query-controls/types.d.ts.map +1 -1
  414. package/build-types/radio-group/radio.d.ts +2 -4
  415. package/build-types/radio-group/radio.d.ts.map +1 -1
  416. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  417. package/build-types/radio-group/types.d.ts +8 -5
  418. package/build-types/radio-group/types.d.ts.map +1 -1
  419. package/build-types/range-control/index.d.ts +0 -1
  420. package/build-types/range-control/index.d.ts.map +1 -1
  421. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  422. package/build-types/range-control/styles/range-control-styles.d.ts +2 -4
  423. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  424. package/build-types/range-control/types.d.ts +3 -1
  425. package/build-types/range-control/types.d.ts.map +1 -1
  426. package/build-types/resizable-box/index.d.ts +4 -0
  427. package/build-types/resizable-box/index.d.ts.map +1 -1
  428. package/build-types/search-control/index.d.ts.map +1 -1
  429. package/build-types/select-control/index.d.ts +0 -1
  430. package/build-types/select-control/index.d.ts.map +1 -1
  431. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  432. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  433. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  434. package/build-types/select-control/types.d.ts +8 -1
  435. package/build-types/select-control/types.d.ts.map +1 -1
  436. package/build-types/slot-fill/index.d.ts +5 -0
  437. package/build-types/slot-fill/index.d.ts.map +1 -1
  438. package/build-types/spacer/hook.d.ts.map +1 -1
  439. package/build-types/surface/hook.d.ts +1 -1
  440. package/build-types/surface/hook.d.ts.map +1 -1
  441. package/build-types/text/hook.d.ts +2 -2
  442. package/build-types/text/hook.d.ts.map +1 -1
  443. package/build-types/theme/index.d.ts +1 -4
  444. package/build-types/theme/index.d.ts.map +1 -1
  445. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  446. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  447. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  448. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  449. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  450. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +0 -1
  451. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  452. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -4
  453. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  454. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +0 -1
  455. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  456. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  457. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +1 -1
  458. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  459. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  460. package/build-types/toggle-group-control/types.d.ts +5 -4
  461. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  462. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  463. package/build-types/tools-panel/styles.d.ts +5 -0
  464. package/build-types/tools-panel/styles.d.ts.map +1 -1
  465. package/build-types/tools-panel/tools-panel/component.d.ts +0 -2
  466. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  467. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  468. package/build-types/tree-select/index.d.ts +0 -1
  469. package/build-types/tree-select/index.d.ts.map +1 -1
  470. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  471. package/build-types/tree-select/types.d.ts +8 -1
  472. package/build-types/tree-select/types.d.ts.map +1 -1
  473. package/build-types/truncate/hook.d.ts +1 -1
  474. package/build-types/truncate/hook.d.ts.map +1 -1
  475. package/build-types/unit-control/index.d.ts +3 -2
  476. package/build-types/unit-control/index.d.ts.map +1 -1
  477. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  478. package/build-types/unit-control/types.d.ts +8 -1
  479. package/build-types/unit-control/types.d.ts.map +1 -1
  480. package/build-types/utils/config-values.d.ts +0 -6
  481. package/build-types/utils/hooks/use-cx.d.ts +4 -0
  482. package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
  483. package/build-types/utils/polymorphic-element.d.ts +17 -0
  484. package/build-types/utils/polymorphic-element.d.ts.map +1 -0
  485. package/build-types/utils/test/polymorphic-element.d.ts +2 -0
  486. package/build-types/utils/test/polymorphic-element.d.ts.map +1 -0
  487. package/build-types/v-stack/hook.d.ts +864 -1
  488. package/build-types/v-stack/hook.d.ts.map +1 -1
  489. package/build-types/validated-form-controls/components/combobox-control.d.ts +1 -1
  490. package/build-types/validated-form-controls/components/custom-select-control.d.ts +1 -1
  491. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
  492. package/build-types/validated-form-controls/components/form-token-field.d.ts +1 -1
  493. package/build-types/validated-form-controls/components/form-token-field.d.ts.map +1 -1
  494. package/build-types/validated-form-controls/components/range-control.d.ts +2 -2
  495. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  496. package/build-types/validated-form-controls/components/select-control.d.ts +1 -1
  497. package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -1
  498. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +2 -2
  499. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
  500. package/build-types/view/component.d.ts +1125 -0
  501. package/build-types/view/component.d.ts.map +1 -1
  502. package/package.json +24 -24
  503. package/src/border-box-control/border-box-control/README.md +0 -16
  504. package/src/border-box-control/border-box-control/component.tsx +1 -9
  505. package/src/border-box-control/border-box-control/hook.ts +3 -13
  506. package/src/border-box-control/border-box-control-linked-button/hook.ts +6 -7
  507. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -12
  508. package/src/border-box-control/border-box-control-split-controls/hook.ts +2 -4
  509. package/src/border-box-control/border-box-control-visualizer/hook.ts +6 -11
  510. package/src/border-box-control/stories/index.story.tsx +0 -2
  511. package/src/border-box-control/styles.ts +22 -34
  512. package/src/border-box-control/test/index.tsx +1 -3
  513. package/src/border-box-control/types.ts +13 -5
  514. package/src/border-control/border-control/README.md +0 -15
  515. package/src/border-control/border-control/component.tsx +0 -9
  516. package/src/border-control/border-control/hook.ts +10 -22
  517. package/src/border-control/border-control-dropdown/component.tsx +1 -2
  518. package/src/border-control/border-control-dropdown/hook.ts +2 -4
  519. package/src/border-control/border-control-style-picker/component.tsx +0 -1
  520. package/src/border-control/stories/index.story.tsx +0 -2
  521. package/src/border-control/styles.ts +11 -12
  522. package/src/border-control/test/index.js +32 -1
  523. package/src/border-control/types.ts +5 -10
  524. package/src/box-control/box-input-control.tsx +0 -5
  525. package/src/button/style.scss +25 -71
  526. package/src/card/card/hook.ts +4 -3
  527. package/src/card/card-footer/hook.ts +12 -16
  528. package/src/card/card-header/hook.ts +12 -16
  529. package/src/card/styles.ts +49 -0
  530. package/src/card/test/__snapshots__/index.tsx.snap +94 -139
  531. package/src/card/test/index.tsx +97 -0
  532. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +1 -1
  533. package/src/circular-option-picker/style.scss +0 -1
  534. package/src/color-picker/component.tsx +4 -0
  535. package/src/color-picker/input-with-slider.tsx +0 -1
  536. package/src/color-picker/stories/index.story.tsx +5 -0
  537. package/src/combobox-control/README.md +0 -9
  538. package/src/combobox-control/index.tsx +2 -14
  539. package/src/combobox-control/stories/index.story.tsx +0 -2
  540. package/src/combobox-control/styles.ts +0 -21
  541. package/src/combobox-control/test/index.tsx +1 -1
  542. package/src/combobox-control/types.ts +2 -1
  543. package/src/context/stories/ComponentsProvider.stories.jsx +3 -3
  544. package/src/custom-gradient-picker/index.tsx +0 -1
  545. package/src/custom-select-control/README.md +0 -9
  546. package/src/custom-select-control/index.tsx +9 -24
  547. package/src/custom-select-control/stories/index.story.tsx +0 -2
  548. package/src/custom-select-control/test/index.tsx +1 -1
  549. package/src/custom-select-control/types.ts +2 -1
  550. package/src/date-time/time-picker/index.tsx +0 -1
  551. package/src/date-time/time-picker/time-input/index.tsx +0 -1
  552. package/src/disabled/stories/index.story.tsx +0 -1
  553. package/src/divider/style.module.scss +4 -2
  554. package/src/elevation/hook.ts +4 -3
  555. package/src/elevation/test/__snapshots__/index.tsx.snap +6 -6
  556. package/src/elevation/test/index.tsx +21 -0
  557. package/src/external-link/index.tsx +1 -7
  558. package/src/flex/flex/hook.ts +24 -43
  559. package/src/flex/flex-item/hook.ts +10 -27
  560. package/src/flex/style.module.scss +40 -0
  561. package/src/flex/test/__snapshots__/index.tsx.snap +6 -156
  562. package/src/flex/test/index.tsx +80 -49
  563. package/src/focal-point-picker/controls.tsx +0 -1
  564. package/src/focal-point-picker/index.tsx +1 -0
  565. package/src/font-size-picker/README.md +0 -15
  566. package/src/font-size-picker/font-size-picker-select.tsx +1 -11
  567. package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -11
  568. package/src/font-size-picker/index.tsx +1 -26
  569. package/src/font-size-picker/stories/e2e/index.story.tsx +0 -2
  570. package/src/font-size-picker/stories/index.story.tsx +0 -2
  571. package/src/font-size-picker/test/font-size-picker-select.tsx +0 -16
  572. package/src/font-size-picker/test/font-size-picker-toggle-group.tsx +0 -22
  573. package/src/font-size-picker/test/index.tsx +2 -16
  574. package/src/font-size-picker/types.ts +6 -5
  575. package/src/form-file-upload/README.md +0 -10
  576. package/src/form-file-upload/index.tsx +2 -14
  577. package/src/form-file-upload/stories/index.story.tsx +1 -2
  578. package/src/form-file-upload/test/index.tsx +1 -16
  579. package/src/form-file-upload/types.ts +2 -2
  580. package/src/form-token-field/README.md +0 -2
  581. package/src/form-token-field/index.tsx +1 -12
  582. package/src/form-token-field/stories/index.story.tsx +0 -4
  583. package/src/form-token-field/styles.ts +0 -19
  584. package/src/form-token-field/test/index.tsx +1 -5
  585. package/src/form-token-field/types.ts +2 -1
  586. package/src/h-stack/test/__snapshots__/index.tsx.snap +12 -91
  587. package/src/heading/test/__snapshots__/index.tsx.snap +1 -1
  588. package/src/item-group/test/__snapshots__/index.js.snap +27 -21
  589. package/src/navigator/stories/index.story.tsx +5 -0
  590. package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
  591. package/src/number-control/index.tsx +4 -0
  592. package/src/query-controls/README.md +0 -7
  593. package/src/query-controls/author-select.tsx +0 -2
  594. package/src/query-controls/category-select.tsx +0 -2
  595. package/src/query-controls/index.tsx +0 -5
  596. package/src/query-controls/types.ts +0 -2
  597. package/src/radio-group/README.md +8 -8
  598. package/src/radio-group/radio.tsx +2 -9
  599. package/src/radio-group/stories/index.story.tsx +3 -9
  600. package/src/radio-group/types.ts +8 -6
  601. package/src/range-control/README.md +0 -8
  602. package/src/range-control/index.tsx +7 -26
  603. package/src/range-control/stories/index.story.tsx +0 -11
  604. package/src/range-control/styles/range-control-styles.ts +1 -10
  605. package/src/range-control/test/index.tsx +1 -14
  606. package/src/range-control/types.ts +3 -1
  607. package/src/resizable-box/index.tsx +4 -0
  608. package/src/scrollable/test/__snapshots__/index.tsx.snap +16 -11
  609. package/src/search-control/index.tsx +3 -1
  610. package/src/select-control/README.md +0 -11
  611. package/src/select-control/index.tsx +7 -16
  612. package/src/select-control/stories/index.story.tsx +0 -4
  613. package/src/select-control/styles/select-control-styles.ts +3 -22
  614. package/src/select-control/test/select-control.tsx +6 -12
  615. package/src/select-control/types.ts +7 -1
  616. package/src/slot-fill/index.tsx +5 -0
  617. package/src/slot-fill/test/__snapshots__/slot.js.snap +4 -12
  618. package/src/spacer/hook.ts +4 -3
  619. package/src/spacer/test/__snapshots__/index.tsx.snap +1 -1
  620. package/src/spacer/test/index.tsx +28 -0
  621. package/src/surface/hook.ts +30 -36
  622. package/src/surface/style.module.scss +53 -0
  623. package/src/surface/test/index.tsx +22 -29
  624. package/src/text/README.md +1 -1
  625. package/src/text/hook.ts +11 -12
  626. package/src/text/test/__snapshots__/index.tsx.snap +2 -2
  627. package/src/text/test/index.tsx +19 -4
  628. package/src/theme/index.tsx +43 -18
  629. package/src/theme/style.module.scss +4 -0
  630. package/src/theme/test/index.tsx +23 -6
  631. package/src/toggle-group-control/stories/index.story.tsx +0 -1
  632. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +76 -76
  633. package/src/toggle-group-control/test/index.tsx +20 -4
  634. package/src/toggle-group-control/toggle-group-control/README.md +0 -8
  635. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +0 -3
  636. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -3
  637. package/src/toggle-group-control/toggle-group-control/component.tsx +6 -20
  638. package/src/toggle-group-control/toggle-group-control/styles.ts +8 -25
  639. package/src/toggle-group-control/toggle-group-control-option/README.md +0 -1
  640. package/src/toggle-group-control/toggle-group-control-option/component.tsx +0 -1
  641. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -7
  642. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +8 -18
  643. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  644. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  645. package/src/toggle-group-control/types.ts +5 -4
  646. package/src/tools-panel/stories/index.story.tsx +0 -15
  647. package/src/tools-panel/styles.ts +16 -0
  648. package/src/tools-panel/test/index.tsx +39 -0
  649. package/src/tools-panel/tools-panel/component.tsx +0 -2
  650. package/src/tools-panel/tools-panel/hook.ts +5 -9
  651. package/src/tree-select/README.md +0 -9
  652. package/src/tree-select/index.tsx +4 -14
  653. package/src/tree-select/stories/index.story.tsx +0 -2
  654. package/src/tree-select/types.ts +8 -1
  655. package/src/truncate/hook.ts +23 -28
  656. package/src/truncate/style.module.scss +21 -0
  657. package/src/unit-control/README.md +3 -9
  658. package/src/unit-control/index.tsx +4 -17
  659. package/src/unit-control/stories/index.story.tsx +0 -3
  660. package/src/unit-control/test/index.tsx +1 -5
  661. package/src/unit-control/types.ts +11 -1
  662. package/src/utils/config-values.js +0 -6
  663. package/src/utils/hooks/use-cx.ts +4 -0
  664. package/src/utils/polymorphic-element.tsx +152 -0
  665. package/src/utils/test/polymorphic-element.tsx +231 -0
  666. package/src/v-stack/test/__snapshots__/index.tsx.snap +12 -90
  667. package/src/validated-form-controls/components/combobox-control.tsx +1 -1
  668. package/src/validated-form-controls/components/custom-select-control.tsx +1 -5
  669. package/src/validated-form-controls/components/form-token-field.tsx +2 -6
  670. package/src/validated-form-controls/components/range-control.tsx +2 -10
  671. package/src/validated-form-controls/components/select-control.tsx +2 -6
  672. package/src/validated-form-controls/components/toggle-group-control.tsx +2 -9
  673. package/src/view/README.md +0 -6
  674. package/src/view/component.tsx +17 -8
  675. package/src/view/test/__snapshots__/index.js.snap +24 -16
  676. package/src/view/test/index.js +60 -4
  677. package/build/flex/styles.cjs +0 -82
  678. package/build/flex/styles.cjs.map +0 -7
  679. package/build/surface/styles.cjs +0 -97
  680. package/build/surface/styles.cjs.map +0 -7
  681. package/build/theme/styles.cjs +0 -66
  682. package/build/theme/styles.cjs.map +0 -7
  683. package/build/truncate/styles.cjs +0 -42
  684. package/build/truncate/styles.cjs.map +0 -7
  685. package/build-module/flex/styles.mjs +0 -53
  686. package/build-module/flex/styles.mjs.map +0 -7
  687. package/build-module/surface/styles.mjs +0 -64
  688. package/build-module/surface/styles.mjs.map +0 -7
  689. package/build-module/theme/styles.mjs +0 -30
  690. package/build-module/theme/styles.mjs.map +0 -7
  691. package/build-module/truncate/styles.mjs +0 -17
  692. package/build-module/truncate/styles.mjs.map +0 -7
  693. package/build-types/flex/styles.d.ts +0 -17
  694. package/build-types/flex/styles.d.ts.map +0 -1
  695. package/build-types/surface/styles.d.ts +0 -11
  696. package/build-types/surface/styles.d.ts.map +0 -1
  697. package/build-types/theme/styles.d.ts +0 -10
  698. package/build-types/theme/styles.d.ts.map +0 -1
  699. package/build-types/truncate/styles.d.ts +0 -2
  700. package/build-types/truncate/styles.d.ts.map +0 -1
  701. package/src/flex/styles.ts +0 -44
  702. package/src/focal-point-picker/style.scss +0 -58
  703. package/src/surface/styles.ts +0 -139
  704. package/src/surface/test/__snapshots__/index.tsx.snap +0 -104
  705. package/src/theme/styles.ts +0 -35
  706. package/src/truncate/styles.ts +0 -11
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tree-select/index.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getSelectOptions(tree, level = 0) {\n return tree.flatMap(treeNode => [{\n value: treeNode.id,\n label: '\\u00A0'.repeat(level * 3) + decodeEntities(treeNode.name)\n }, ...getSelectOptions(treeNode.children || [], level + 1)]);\n}\n\n/**\n * Generates a hierarchical select input.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { TreeSelect } from '@wordpress/components';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\t__next40pxDefaultSize\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function TreeSelect(props) {\n const {\n __nextHasNoMarginBottom: _,\n // Prevent passing to internal component\n label,\n noOptionLabel,\n onChange,\n selectedId,\n tree = [],\n ...restProps\n } = useDeprecated36pxDefaultSizeProp(props);\n const options = useMemo(() => {\n return [noOptionLabel && {\n value: '',\n label: noOptionLabel\n }, ...getSelectOptions(tree)].filter(option => !!option);\n }, [noOptionLabel, tree]);\n maybeWarnDeprecated36pxSize({\n componentName: 'TreeSelect',\n size: restProps.size,\n __next40pxDefaultSize: restProps.__next40pxDefaultSize\n });\n return (\n /*#__PURE__*/\n // Disable reason: the parent component already takes case of the `__next40pxDefaultSize` prop.\n // eslint-disable-next-line @wordpress/components-no-missing-40px-size-prop\n _jsx(SelectControl, {\n __shouldNotWarnDeprecated36pxSize: true,\n label,\n options,\n onChange,\n value: selectedId,\n ...restProps\n })\n );\n}\nexport default TreeSelect;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwB;AACxB,2BAA+B;AAK/B,4BAA8B;AAC9B,kCAAiD;AACjD,kCAA4C;AAC5C,yBAA4B;AAC5B,SAAS,iBAAiB,MAAM,QAAQ,GAAG;AACzC,SAAO,KAAK,QAAQ,cAAY,CAAC;AAAA,IAC/B,OAAO,SAAS;AAAA,IAChB,OAAO,IAAS,OAAO,QAAQ,CAAC,QAAI,qCAAe,SAAS,IAAI;AAAA,EAClE,GAAG,GAAG,iBAAiB,SAAS,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC7D;AAkDO,SAAS,WAAW,OAAO;AAChC,QAAM;AAAA,IACJ,yBAAyB;AAAA;AAAA,IAEzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,CAAC;AAAA,IACR,GAAG;AAAA,EACL,QAAI,8DAAiC,KAAK;AAC1C,QAAM,cAAU,wBAAQ,MAAM;AAC5B,WAAO,CAAC,iBAAiB;AAAA,MACvB,OAAO;AAAA,MACP,OAAO;AAAA,IACT,GAAG,GAAG,iBAAiB,IAAI,CAAC,EAAE,OAAO,YAAU,CAAC,CAAC,MAAM;AAAA,EACzD,GAAG,CAAC,eAAe,IAAI,CAAC;AACxB,+DAA4B;AAAA,IAC1B,eAAe;AAAA,IACf,MAAM,UAAU;AAAA,IAChB,uBAAuB,UAAU;AAAA,EACnC,CAAC;AACD;AAAA;AAAA;AAAA,IAIE,uCAAAA,KAAK,qCAAe;AAAA,MAClB,mCAAmC;AAAA,MACnC;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,GAAG;AAAA,IACL,CAAC;AAAA;AAEL;AACA,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getSelectOptions(tree, level = 0) {\n return tree.flatMap(treeNode => [{\n value: treeNode.id,\n label: '\\u00A0'.repeat(level * 3) + decodeEntities(treeNode.name)\n }, ...getSelectOptions(treeNode.children || [], level + 1)]);\n}\n\n/**\n * Generates a hierarchical select input.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { TreeSelect } from '@wordpress/components';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function TreeSelect(props) {\n const {\n // Prevent passing legacy props to internal component.\n __nextHasNoMarginBottom: _,\n __next40pxDefaultSize: _next40pxDefaultSize,\n label,\n noOptionLabel,\n onChange,\n selectedId,\n tree = [],\n ...restProps\n } = props;\n const options = useMemo(() => {\n return [noOptionLabel && {\n value: '',\n label: noOptionLabel\n }, ...getSelectOptions(tree)].filter(option => !!option);\n }, [noOptionLabel, tree]);\n return /*#__PURE__*/_jsx(SelectControl, {\n label,\n options,\n onChange,\n value: selectedId,\n ...restProps\n });\n}\nexport default TreeSelect;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwB;AACxB,2BAA+B;AAK/B,4BAA8B;AAC9B,yBAA4B;AAC5B,SAAS,iBAAiB,MAAM,QAAQ,GAAG;AACzC,SAAO,KAAK,QAAQ,cAAY,CAAC;AAAA,IAC/B,OAAO,SAAS;AAAA,IAChB,OAAO,IAAS,OAAO,QAAQ,CAAC,QAAI,qCAAe,SAAS,IAAI;AAAA,EAClE,GAAG,GAAG,iBAAiB,SAAS,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC7D;AAiDO,SAAS,WAAW,OAAO;AAChC,QAAM;AAAA;AAAA,IAEJ,yBAAyB;AAAA,IACzB,uBAAuB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,CAAC;AAAA,IACR,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,cAAU,wBAAQ,MAAM;AAC5B,WAAO,CAAC,iBAAiB;AAAA,MACvB,OAAO;AAAA,MACP,OAAO;AAAA,IACT,GAAG,GAAG,iBAAiB,IAAI,CAAC,EAAE,OAAO,YAAU,CAAC,CAAC,MAAM;AAAA,EACzD,GAAG,CAAC,eAAe,IAAI,CAAC;AACxB,SAAoB,uCAAAA,KAAK,qCAAe;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,GAAG;AAAA,EACL,CAAC;AACH;AACA,IAAO,sBAAQ;",
6
6
  "names": ["_jsx"]
7
7
  }
@@ -33,12 +33,94 @@ __export(hook_exports, {
33
33
  default: () => useTruncate
34
34
  });
35
35
  module.exports = __toCommonJS(hook_exports);
36
- var import_react = require("@emotion/react");
37
- var import_element = require("@wordpress/element");
36
+ var import_clsx = __toESM(require("clsx"));
38
37
  var import_context = require("../context/index.cjs");
39
- var styles = __toESM(require("./styles.cjs"));
40
38
  var import_utils = require("./utils.cjs");
41
- var import_use_cx = require("../utils/hooks/use-cx.cjs");
39
+
40
+ // packages/style-runtime/src/index.ts
41
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
42
+ function getRuntime() {
43
+ const globalScope = globalThis;
44
+ if (globalScope.__wpStyleRuntime) {
45
+ return globalScope.__wpStyleRuntime;
46
+ }
47
+ globalScope.__wpStyleRuntime = {
48
+ documents: /* @__PURE__ */ new Map(),
49
+ styles: /* @__PURE__ */ new Map(),
50
+ injectedStyles: /* @__PURE__ */ new WeakMap()
51
+ };
52
+ if (typeof document !== "undefined") {
53
+ registerDocument(document);
54
+ }
55
+ return globalScope.__wpStyleRuntime;
56
+ }
57
+ function documentContainsStyleHash(targetDocument, hash) {
58
+ if (!targetDocument.head) {
59
+ return false;
60
+ }
61
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {
62
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
63
+ return true;
64
+ }
65
+ }
66
+ return false;
67
+ }
68
+ function injectStyle(targetDocument, hash, css) {
69
+ if (!targetDocument.head) {
70
+ return;
71
+ }
72
+ const runtime = getRuntime();
73
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
74
+ if (!injectedStyles) {
75
+ injectedStyles = /* @__PURE__ */ new Set();
76
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
77
+ }
78
+ if (injectedStyles.has(hash)) {
79
+ return;
80
+ }
81
+ if (documentContainsStyleHash(targetDocument, hash)) {
82
+ injectedStyles.add(hash);
83
+ return;
84
+ }
85
+ const style = targetDocument.createElement("style");
86
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
87
+ style.appendChild(targetDocument.createTextNode(css));
88
+ targetDocument.head.appendChild(style);
89
+ injectedStyles.add(hash);
90
+ }
91
+ function registerDocument(targetDocument) {
92
+ const runtime = getRuntime();
93
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
94
+ for (const [hash, css] of runtime.styles) {
95
+ injectStyle(targetDocument, hash, css);
96
+ }
97
+ return () => {
98
+ const count = runtime.documents.get(targetDocument);
99
+ if (count === void 0) {
100
+ return;
101
+ }
102
+ if (count <= 1) {
103
+ runtime.documents.delete(targetDocument);
104
+ return;
105
+ }
106
+ runtime.documents.set(targetDocument, count - 1);
107
+ };
108
+ }
109
+ function registerStyle(hash, css) {
110
+ const runtime = getRuntime();
111
+ runtime.styles.set(hash, css);
112
+ for (const targetDocument of runtime.documents.keys()) {
113
+ injectStyle(targetDocument, hash, css);
114
+ }
115
+ }
116
+
117
+ // packages/components/src/truncate/style.module.scss
118
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
119
+ registerStyle("beeae56da8", "._51f2afb77f24a721__truncate{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.d232bf8e2132288d__is-line-clamp{-webkit-box-orient:vertical;-webkit-line-clamp:var(--wp-components-truncate-lines);display:-webkit-box;overflow:hidden}.d232bf8e2132288d__is-line-clamp._95bf20b727db236f__is-single-line{word-break:break-all}");
120
+ }
121
+ var style_module_default = { "truncate": "_51f2afb77f24a721__truncate", "is-line-clamp": "d232bf8e2132288d__is-line-clamp", "is-single-line": "_95bf20b727db236f__is-single-line" };
122
+
123
+ // packages/components/src/truncate/hook.ts
42
124
  function useTruncate(props) {
43
125
  const {
44
126
  className,
@@ -47,9 +129,9 @@ function useTruncate(props) {
47
129
  ellipsizeMode = import_utils.TRUNCATE_TYPE.auto,
48
130
  limit = 0,
49
131
  numberOfLines = 0,
132
+ style,
50
133
  ...otherProps
51
134
  } = (0, import_context.useContextSystem)(props, "Truncate");
52
- const cx = (0, import_use_cx.useCx)();
53
135
  let childrenAsText;
54
136
  if (typeof children === "string") {
55
137
  childrenAsText = children;
@@ -63,13 +145,17 @@ function useTruncate(props) {
63
145
  numberOfLines
64
146
  }) : children;
65
147
  const shouldTruncate = !!childrenAsText && ellipsizeMode === import_utils.TRUNCATE_TYPE.auto;
66
- const classes = (0, import_element.useMemo)(() => {
67
- const truncateLines = /* @__PURE__ */ (0, import_react.css)(numberOfLines === 1 ? "word-break: break-all;" : "", " -webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + (process.env.NODE_ENV === "production" ? "" : ";label:truncateLines;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEQyQiIsImZpbGUiOiJob29rLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB0eXBlIHsgV29yZFByZXNzQ29tcG9uZW50UHJvcHMgfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZUNvbnRleHRTeXN0ZW0gfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCAqIGFzIHN0eWxlcyBmcm9tICcuL3N0eWxlcyc7XG5pbXBvcnQgeyBUUlVOQ0FURV9FTExJUFNJUywgVFJVTkNBVEVfVFlQRSwgdHJ1bmNhdGVDb250ZW50IH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQge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blx0fSwgWyBjbGFzc05hbWUsIGN4LCBudW1iZXJPZkxpbmVzLCBzaG91bGRUcnVuY2F0ZSBdICk7XG5cblx0cmV0dXJuIHsgLi4ub3RoZXJQcm9wcywgY2xhc3NOYW1lOiBjbGFzc2VzLCBjaGlsZHJlbjogdHJ1bmNhdGVkQ29udGVudCB9O1xufVxuIl19 */");
68
- return cx(shouldTruncate && !numberOfLines && styles.Truncate, shouldTruncate && !!numberOfLines && truncateLines, className);
69
- }, [className, cx, numberOfLines, shouldTruncate]);
148
+ const shouldClampLines = shouldTruncate && !!numberOfLines;
149
+ const shouldClampSingleLine = shouldClampLines && numberOfLines === 1;
150
+ const classes = (0, import_clsx.default)(shouldTruncate && !numberOfLines && style_module_default.truncate, shouldClampLines && style_module_default["is-line-clamp"], shouldClampSingleLine && style_module_default["is-single-line"], className);
151
+ const truncateStyle = shouldClampLines ? {
152
+ ...style,
153
+ "--wp-components-truncate-lines": numberOfLines
154
+ } : style;
70
155
  return {
71
156
  ...otherProps,
72
157
  className: classes,
158
+ style: truncateStyle,
73
159
  children: truncatedContent
74
160
  };
75
161
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/truncate/hook.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { useContextSystem } from '../context';\nimport * as styles from './styles';\nimport { TRUNCATE_ELLIPSIS, TRUNCATE_TYPE, truncateContent } from './utils';\nimport { useCx } from '../utils/hooks/use-cx';\nexport default function useTruncate(props) {\n const {\n className,\n children,\n ellipsis = TRUNCATE_ELLIPSIS,\n ellipsizeMode = TRUNCATE_TYPE.auto,\n limit = 0,\n numberOfLines = 0,\n ...otherProps\n } = useContextSystem(props, 'Truncate');\n const cx = useCx();\n let childrenAsText;\n if (typeof children === 'string') {\n childrenAsText = children;\n } else if (typeof children === 'number') {\n childrenAsText = children.toString();\n }\n const truncatedContent = childrenAsText ? truncateContent(childrenAsText, {\n ellipsis,\n ellipsizeMode,\n limit,\n numberOfLines\n }) : children;\n const shouldTruncate = !!childrenAsText && ellipsizeMode === TRUNCATE_TYPE.auto;\n const classes = useMemo(() => {\n // The `word-break: break-all` property first makes sure a text line\n // breaks even when it contains 'unbreakable' content such as long URLs.\n // See https://github.com/WordPress/gutenberg/issues/60860.\n const truncateLines = /*#__PURE__*/css(numberOfLines === 1 ? 'word-break: break-all;' : '', \" -webkit-box-orient:vertical;-webkit-line-clamp:\", numberOfLines, \";display:-webkit-box;overflow:hidden;\" + (process.env.NODE_ENV === \"production\" ? \"\" : \";label:truncateLines;\"), process.env.NODE_ENV === \"production\" ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEQyQiIsImZpbGUiOiJob29rLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB0eXBlIHsgV29yZFByZXNzQ29tcG9uZW50UHJvcHMgfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZUNvbnRleHRTeXN0ZW0gfSBmcm9tICcuLi9jb250ZXh0JztcbmltcG9ydCAqIGFzIHN0eWxlcyBmcm9tICcuL3N0eWxlcyc7XG5pbXBvcnQgeyBUUlVOQ0FURV9FTExJUFNJUyw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YmVyT2ZMaW5lcyAmJiB0cnVuY2F0ZUxpbmVzLFxuXHRcdFx0Y2xhc3NOYW1lXG5cdFx0KTtcblx0fSwgWyBjbGFzc05hbWUsIGN4LCBudW1iZXJPZkxpbmVzLCBzaG91bGRUcnVuY2F0ZSBdICk7XG5cblx0cmV0dXJuIHsgLi4ub3RoZXJQcm9wcywgY2xhc3NOYW1lOiBjbGFzc2VzLCBjaGlsZHJlbjogdHJ1bmNhdGVkQ29udGVudCB9O1xufVxuIl19 */\");\n return cx(shouldTruncate && !numberOfLines && styles.Truncate, shouldTruncate && !!numberOfLines && truncateLines, className);\n }, [className, cx, numberOfLines, shouldTruncate]);\n return {\n ...otherProps,\n className: classes,\n children: truncatedContent\n };\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAoB;AAKpB,qBAAwB;AAMxB,qBAAiC;AACjC,aAAwB;AACxB,mBAAkE;AAClE,oBAAsB;AACP,SAAR,YAA6B,OAAO;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,gBAAgB,2BAAc;AAAA,IAC9B,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,GAAG;AAAA,EACL,QAAI,iCAAiB,OAAO,UAAU;AACtC,QAAM,SAAK,qBAAM;AACjB,MAAI;AACJ,MAAI,OAAO,aAAa,UAAU;AAChC,qBAAiB;AAAA,EACnB,WAAW,OAAO,aAAa,UAAU;AACvC,qBAAiB,SAAS,SAAS;AAAA,EACrC;AACA,QAAM,mBAAmB,qBAAiB,8BAAgB,gBAAgB;AAAA,IACxE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,IAAI;AACL,QAAM,iBAAiB,CAAC,CAAC,kBAAkB,kBAAkB,2BAAc;AAC3E,QAAM,cAAU,wBAAQ,MAAM;AAI5B,UAAM,gBAA6B,sCAAI,kBAAkB,IAAI,2BAA2B,IAAI,oDAAoD,eAAe,2CAA2C,QAAQ,IAAI,aAAa,eAAe,KAAK,0BAA0B,QAAQ,IAAI,aAAa,eAAe,KAAK,ygGAAygG;AACv0G,WAAO,GAAG,kBAAkB,CAAC,iBAAwB,iBAAU,kBAAkB,CAAC,CAAC,iBAAiB,eAAe,SAAS;AAAA,EAC9H,GAAG,CAAC,WAAW,IAAI,eAAe,cAAc,CAAC;AACjD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX,UAAU;AAAA,EACZ;AACF;",
6
- "names": []
3
+ "sources": ["../../src/truncate/hook.ts", "../../../style-runtime/src/index.ts", "../../src/truncate/style.module.scss"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\n\nimport { useContextSystem } from '../context';\nimport { TRUNCATE_ELLIPSIS, TRUNCATE_TYPE, truncateContent } from './utils';\nimport styles from './style.module.scss';\nexport default function useTruncate(props) {\n const {\n className,\n children,\n ellipsis = TRUNCATE_ELLIPSIS,\n ellipsizeMode = TRUNCATE_TYPE.auto,\n limit = 0,\n numberOfLines = 0,\n style,\n ...otherProps\n } = useContextSystem(props, 'Truncate');\n let childrenAsText;\n if (typeof children === 'string') {\n childrenAsText = children;\n } else if (typeof children === 'number') {\n childrenAsText = children.toString();\n }\n const truncatedContent = childrenAsText ? truncateContent(childrenAsText, {\n ellipsis,\n ellipsizeMode,\n limit,\n numberOfLines\n }) : children;\n const shouldTruncate = !!childrenAsText && ellipsizeMode === TRUNCATE_TYPE.auto;\n const shouldClampLines = shouldTruncate && !!numberOfLines;\n const shouldClampSingleLine = shouldClampLines && numberOfLines === 1;\n const classes = clsx(shouldTruncate && !numberOfLines && styles.truncate, shouldClampLines && styles['is-line-clamp'], shouldClampSingleLine && styles['is-single-line'], className);\n const truncateStyle = shouldClampLines ? {\n ...style,\n '--wp-components-truncate-lines': numberOfLines\n } : style;\n return {\n ...otherProps,\n className: classes,\n style: truncateStyle,\n children: truncatedContent\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(\"beeae56da8\", \"._51f2afb77f24a721__truncate{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.d232bf8e2132288d__is-line-clamp{-webkit-box-orient:vertical;-webkit-line-clamp:var(--wp-components-truncate-lines);display:-webkit-box;overflow:hidden}.d232bf8e2132288d__is-line-clamp._95bf20b727db236f__is-single-line{word-break:break-all}\");\n}\nexport default {\"truncate\":\"_51f2afb77f24a721__truncate\",\"is-line-clamp\":\"d232bf8e2132288d__is-line-clamp\",\"is-single-line\":\"_95bf20b727db236f__is-single-line\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,IAAI;AACL,QAAM,iBAAiB,CAAC,CAAC,kBAAkB,kBAAkB,2BAAc;AAC3E,QAAM,mBAAmB,kBAAkB,CAAC,CAAC;AAC7C,QAAM,wBAAwB,oBAAoB,kBAAkB;AACpE,QAAM,cAAU,YAAAA,SAAK,kBAAkB,CAAC,iBAAiB,qBAAO,UAAU,oBAAoB,qBAAO,eAAe,GAAG,yBAAyB,qBAAO,gBAAgB,GAAG,SAAS;AACnL,QAAM,gBAAgB,mBAAmB;AAAA,IACvC,GAAG;AAAA,IACH,kCAAkC;AAAA,EACpC,IAAI;AACJ,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AACF;",
6
+ "names": ["clsx"]
7
7
  }
@@ -45,8 +45,6 @@ var import_unit_select_control = __toESM(require("./unit-select-control.cjs"));
45
45
  var import_utils = require("./utils.cjs");
46
46
  var import_hooks = require("../utils/hooks/index.cjs");
47
47
  var import_strings = require("../utils/strings.cjs");
48
- var import_use_deprecated_props = require("../utils/use-deprecated-props.cjs");
49
- var import_deprecated_36px_size = require("../utils/deprecated-36px-size.cjs");
50
48
  var import_jsx_runtime = require("react/jsx-runtime");
51
49
  var import_utils2 = require("./utils.cjs");
52
50
  function UnforwardedUnitControl(unitControlProps, forwardedRef) {
@@ -69,15 +67,8 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
69
67
  units: unitsProp = import_utils.CSS_UNITS,
70
68
  value: valueProp,
71
69
  onFocus: onFocusProp,
72
- __shouldNotWarnDeprecated36pxSize,
73
70
  ...props
74
- } = (0, import_use_deprecated_props.useDeprecated36pxDefaultSizeProp)(unitControlProps);
75
- (0, import_deprecated_36px_size.maybeWarnDeprecated36pxSize)({
76
- componentName: "UnitControl",
77
- __next40pxDefaultSize: props.__next40pxDefaultSize,
78
- size,
79
- __shouldNotWarnDeprecated36pxSize
80
- });
71
+ } = unitControlProps;
81
72
  if ("unit" in unitControlProps) {
82
73
  (0, import_deprecated.default)("UnitControl unit prop", {
83
74
  since: "5.6",
@@ -152,7 +143,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
152
143
  disabled,
153
144
  isUnitSelectTabbable,
154
145
  onChange: handleOnUnitChange,
155
- size: ["small", "compact"].includes(size) || size === "default" && !props.__next40pxDefaultSize ? "small" : "default",
146
+ size: ["small", "compact"].includes(size) ? "small" : "default",
156
147
  unit,
157
148
  units,
158
149
  onFocus: onFocusProp,
@@ -165,7 +156,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
165
156
  }
166
157
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_unit_control_styles.ValueInput, {
167
158
  ...props,
168
- __shouldNotWarnDeprecated36pxSize: true,
159
+ __next40pxDefaultSize: true,
169
160
  autoComplete,
170
161
  className: classes,
171
162
  disabled,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/unit-control/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport { CSS_UNITS, getParsedQuantityAndUnit, getUnitsWithCurrentUnit, getValidParsedQuantityAndUnit } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedUnitControl(unitControlProps, forwardedRef) {\n const {\n __unstableStateReducer,\n autoComplete = 'off',\n // @ts-expect-error Ensure that children is omitted from restProps\n children,\n className,\n disabled = false,\n disableUnits = false,\n isPressEnterToChange = false,\n isResetValueOnUnitChange = false,\n isUnitSelectTabbable = true,\n label,\n onChange: onChangeProp,\n onUnitChange,\n size = 'default',\n unit: unitProp,\n units: unitsProp = CSS_UNITS,\n value: valueProp,\n onFocus: onFocusProp,\n __shouldNotWarnDeprecated36pxSize,\n ...props\n } = useDeprecated36pxDefaultSizeProp(unitControlProps);\n maybeWarnDeprecated36pxSize({\n componentName: 'UnitControl',\n __next40pxDefaultSize: props.__next40pxDefaultSize,\n size,\n __shouldNotWarnDeprecated36pxSize\n });\n if ('unit' in unitControlProps) {\n deprecated('UnitControl unit prop', {\n since: '5.6',\n hint: 'The unit should be provided within the `value` prop.',\n version: '6.2'\n });\n }\n\n // The `value` prop, in theory, should not be `null`, but the following line\n // ensures it fallback to `undefined` in case a consumer of `UnitControl`\n // still passes `null` as a `value`.\n const nonNullValueProp = valueProp ?? undefined;\n const [units, reFirstCharacterOfUnits] = useMemo(() => {\n const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);\n const [{\n value: firstUnitValue = ''\n } = {}, ...rest] = list;\n const firstCharacters = rest.reduce((carry, {\n value\n }) => {\n const first = escapeRegExp(value?.substring(0, 1) || '');\n return carry.includes(first) ? carry : `${carry}|${first}`;\n }, escapeRegExp(firstUnitValue.substring(0, 1)));\n return [list, new RegExp(`^(?:${firstCharacters})$`, 'i')];\n }, [nonNullValueProp, unitProp, unitsProp]);\n const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);\n const [unit, setUnit] = useControlledState(units.length === 1 ? units[0].value : unitProp, {\n initial: parsedUnit,\n fallback: ''\n });\n useEffect(() => {\n if (parsedUnit !== undefined) {\n setUnit(parsedUnit);\n }\n }, [parsedUnit, setUnit]);\n const classes = clsx('components-unit-control',\n // This class is added for legacy purposes to maintain it on the outer\n // wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n 'components-unit-control-wrapper', className);\n const handleOnQuantityChange = (nextQuantityValue, changeProps) => {\n if (nextQuantityValue === '' || typeof nextQuantityValue === 'undefined' || nextQuantityValue === null) {\n onChangeProp?.('', changeProps);\n return;\n }\n\n /*\n * Customizing the onChange callback.\n * This allows as to broadcast a combined value+unit to onChange.\n */\n const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join('');\n onChangeProp?.(onChangeValue, changeProps);\n };\n const handleOnUnitChange = (nextUnitValue, changeProps) => {\n const {\n data\n } = changeProps;\n let nextValue = `${parsedQuantity ?? ''}${nextUnitValue}`;\n if (isResetValueOnUnitChange && data?.default !== undefined) {\n nextValue = `${data.default}${nextUnitValue}`;\n }\n onChangeProp?.(nextValue, changeProps);\n onUnitChange?.(nextUnitValue, changeProps);\n setUnit(nextUnitValue);\n };\n let handleOnKeyDown;\n if (!disableUnits && isUnitSelectTabbable && units.length) {\n handleOnKeyDown = event => {\n props.onKeyDown?.(event);\n // Unless the meta or ctrl key was pressed (to avoid interfering with\n // shortcuts, e.g. pastes), move focus to the unit select if a key\n // matches the first character of a unit.\n if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {\n refInputSuffix.current?.focus();\n }\n };\n }\n const refInputSuffix = useRef(null);\n const inputSuffix = !disableUnits ? /*#__PURE__*/_jsx(UnitSelectControl, {\n ref: refInputSuffix,\n \"aria-label\": __('Select unit'),\n disabled: disabled,\n isUnitSelectTabbable: isUnitSelectTabbable,\n onChange: handleOnUnitChange,\n size: ['small', 'compact'].includes(size) || size === 'default' && !props.__next40pxDefaultSize ? 'small' : 'default',\n unit: unit,\n units: units,\n onFocus: onFocusProp,\n onBlur: unitControlProps.onBlur\n }) : null;\n let step = props.step;\n\n /*\n * If no step prop has been passed, lookup the active unit and\n * try to get step from `units`, or default to a value of `1`\n */\n if (!step && units) {\n const activeUnit = units.find(option => option.value === unit);\n step = activeUnit?.step ?? 1;\n }\n return /*#__PURE__*/_jsx(ValueInput, {\n ...props,\n __shouldNotWarnDeprecated36pxSize: true,\n autoComplete: autoComplete,\n className: classes,\n disabled: disabled,\n spinControls: \"none\",\n isPressEnterToChange: isPressEnterToChange,\n label: label,\n onKeyDown: handleOnKeyDown,\n onChange: handleOnQuantityChange,\n ref: forwardedRef,\n size: size,\n suffix: inputSuffix,\n type: isPressEnterToChange ? 'text' : 'number',\n value: parsedQuantity ?? '',\n step: step,\n onFocus: onFocusProp,\n __unstableStateReducer: __unstableStateReducer\n });\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl __next40pxDefaultSize onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef(UnforwardedUnitControl);\nUnitControl.displayName = 'UnitControl';\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAiB;AAKjB,wBAAuB;AACvB,qBAAuD;AACvD,kBAAmB;AAMnB,iCAA2B;AAC3B,iCAA8B;AAC9B,mBAA4G;AAC5G,mBAAmC;AACnC,qBAA6B;AAC7B,kCAAiD;AACjD,kCAA4C;AAC5C,yBAA4B;AAwK5B,IAAAA,gBAAiE;AAvKjE,SAAS,uBAAuB,kBAAkB,cAAc;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA;AAAA,IAEf;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,uBAAuB;AAAA,IACvB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,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AAC,MAAM,wBAAwB,UAAU;AAAA,IAC5G;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,QAAQ,iBAAiB;AAAA,EAC3B,CAAC,IAAI;AACL,MAAI,OAAO,MAAM;AAMjB,MAAI,CAAC,QAAQ,OAAO;AAClB,UAAM,aAAa,MAAM,KAAK,YAAU,OAAO,UAAU,IAAI;AAC7D,WAAO,YAAY,QAAQ;AAAA,EAC7B;AACA,SAAoB,uCAAAD,KAAK,uCAAY;AAAA,IACnC,GAAG;AAAA,IACH,mCAAmC;AAAA,IACnC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,IACR,MAAM,uBAAuB,SAAS;AAAA,IACtC,OAAO,kBAAkB;AAAA,IACzB;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF,CAAC;AACH;AAiBO,IAAM,kBAAc,2BAAW,sBAAsB;AAC5D,YAAY,cAAc;AAE1B,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\n\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport { CSS_UNITS, getParsedQuantityAndUnit, getUnitsWithCurrentUnit, getValidParsedQuantityAndUnit } from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedUnitControl(unitControlProps, forwardedRef) {\n const {\n __unstableStateReducer,\n autoComplete = 'off',\n // @ts-expect-error Ensure that children is omitted from restProps\n children,\n className,\n disabled = false,\n disableUnits = false,\n isPressEnterToChange = false,\n isResetValueOnUnitChange = false,\n isUnitSelectTabbable = true,\n label,\n onChange: onChangeProp,\n onUnitChange,\n size = 'default',\n unit: unitProp,\n units: unitsProp = CSS_UNITS,\n value: valueProp,\n onFocus: onFocusProp,\n ...props\n } = unitControlProps;\n if ('unit' in unitControlProps) {\n deprecated('UnitControl unit prop', {\n since: '5.6',\n hint: 'The unit should be provided within the `value` prop.',\n version: '6.2'\n });\n }\n\n // The `value` prop, in theory, should not be `null`, but the following line\n // ensures it fallback to `undefined` in case a consumer of `UnitControl`\n // still passes `null` as a `value`.\n const nonNullValueProp = valueProp ?? undefined;\n const [units, reFirstCharacterOfUnits] = useMemo(() => {\n const list = getUnitsWithCurrentUnit(nonNullValueProp, unitProp, unitsProp);\n const [{\n value: firstUnitValue = ''\n } = {}, ...rest] = list;\n const firstCharacters = rest.reduce((carry, {\n value\n }) => {\n const first = escapeRegExp(value?.substring(0, 1) || '');\n return carry.includes(first) ? carry : `${carry}|${first}`;\n }, escapeRegExp(firstUnitValue.substring(0, 1)));\n return [list, new RegExp(`^(?:${firstCharacters})$`, 'i')];\n }, [nonNullValueProp, unitProp, unitsProp]);\n const [parsedQuantity, parsedUnit] = getParsedQuantityAndUnit(nonNullValueProp, unitProp, units);\n const [unit, setUnit] = useControlledState(units.length === 1 ? units[0].value : unitProp, {\n initial: parsedUnit,\n fallback: ''\n });\n useEffect(() => {\n if (parsedUnit !== undefined) {\n setUnit(parsedUnit);\n }\n }, [parsedUnit, setUnit]);\n const classes = clsx('components-unit-control',\n // This class is added for legacy purposes to maintain it on the outer\n // wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n 'components-unit-control-wrapper', className);\n const handleOnQuantityChange = (nextQuantityValue, changeProps) => {\n if (nextQuantityValue === '' || typeof nextQuantityValue === 'undefined' || nextQuantityValue === null) {\n onChangeProp?.('', changeProps);\n return;\n }\n\n /*\n * Customizing the onChange callback.\n * This allows as to broadcast a combined value+unit to onChange.\n */\n const onChangeValue = getValidParsedQuantityAndUnit(nextQuantityValue, units, parsedQuantity, unit).join('');\n onChangeProp?.(onChangeValue, changeProps);\n };\n const handleOnUnitChange = (nextUnitValue, changeProps) => {\n const {\n data\n } = changeProps;\n let nextValue = `${parsedQuantity ?? ''}${nextUnitValue}`;\n if (isResetValueOnUnitChange && data?.default !== undefined) {\n nextValue = `${data.default}${nextUnitValue}`;\n }\n onChangeProp?.(nextValue, changeProps);\n onUnitChange?.(nextUnitValue, changeProps);\n setUnit(nextUnitValue);\n };\n let handleOnKeyDown;\n if (!disableUnits && isUnitSelectTabbable && units.length) {\n handleOnKeyDown = event => {\n props.onKeyDown?.(event);\n // Unless the meta or ctrl key was pressed (to avoid interfering with\n // shortcuts, e.g. pastes), move focus to the unit select if a key\n // matches the first character of a unit.\n if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {\n refInputSuffix.current?.focus();\n }\n };\n }\n const refInputSuffix = useRef(null);\n const inputSuffix = !disableUnits ? /*#__PURE__*/_jsx(UnitSelectControl, {\n ref: refInputSuffix,\n \"aria-label\": __('Select unit'),\n disabled: disabled,\n isUnitSelectTabbable: isUnitSelectTabbable,\n onChange: handleOnUnitChange,\n size: ['small', 'compact'].includes(size) ? 'small' : 'default',\n unit: unit,\n units: units,\n onFocus: onFocusProp,\n onBlur: unitControlProps.onBlur\n }) : null;\n let step = props.step;\n\n /*\n * If no step prop has been passed, lookup the active unit and\n * try to get step from `units`, or default to a value of `1`\n */\n if (!step && units) {\n const activeUnit = units.find(option => option.value === unit);\n step = activeUnit?.step ?? 1;\n }\n return /*#__PURE__*/_jsx(ValueInput, {\n ...props,\n __next40pxDefaultSize: true,\n autoComplete: autoComplete,\n className: classes,\n disabled: disabled,\n spinControls: \"none\",\n isPressEnterToChange: isPressEnterToChange,\n label: label,\n onKeyDown: handleOnKeyDown,\n onChange: handleOnQuantityChange,\n ref: forwardedRef,\n size: size,\n suffix: inputSuffix,\n type: isPressEnterToChange ? 'text' : 'number',\n value: parsedQuantity ?? '',\n step: step,\n onFocus: onFocusProp,\n __unstableStateReducer: __unstableStateReducer\n });\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef(UnforwardedUnitControl);\nUnitControl.displayName = 'UnitControl';\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAiB;AAKjB,wBAAuB;AACvB,qBAAuD;AACvD,kBAAmB;AAMnB,iCAA2B;AAC3B,iCAA8B;AAC9B,mBAA4G;AAC5G,mBAAmC;AACnC,qBAA6B;AAC7B,yBAA4B;AAiK5B,IAAAA,gBAAiE;AAhKjE,SAAS,uBAAuB,kBAAkB,cAAc;AAC9D,QAAM;AAAA,IACJ;AAAA,IACA,eAAe;AAAA;AAAA,IAEf;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,uBAAuB;AAAA,IACvB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO,YAAY;AAAA,IACnB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,GAAG;AAAA,EACL,IAAI;AACJ,MAAI,UAAU,kBAAkB;AAC9B,0BAAAC,SAAW,yBAAyB;AAAA,MAClC,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAKA,QAAM,mBAAmB,aAAa;AACtC,QAAM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AA,IACX,UAAU;AAAA,IACV,KAAK;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,IACR,MAAM,uBAAuB,SAAS;AAAA,IACtC,OAAO,kBAAkB;AAAA,IACzB;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF,CAAC;AACH;AAiBO,IAAM,kBAAc,2BAAW,sBAAsB;AAC5D,YAAY,cAAc;AAE1B,IAAO,uBAAQ;",
6
6
  "names": ["import_utils", "deprecated", "clsx", "_jsx", "UnitSelectControl"]
7
7
  }
@@ -75,13 +75,7 @@ var config_values_default = Object.assign({}, CONTROL_PROPS, {
75
75
  elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,
76
76
  elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,
77
77
  elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,
78
- surfaceBackgroundColor: import_colors_values.COLORS.white,
79
- surfaceBackgroundSubtleColor: "#F3F3F3",
80
- surfaceBackgroundTintColor: "#F5F5F5",
81
78
  surfaceBorderColor: "rgba(0, 0, 0, 0.1)",
82
- surfaceBorderBoldColor: "rgba(0, 0, 0, 0.15)",
83
- surfaceBorderSubtleColor: "rgba(0, 0, 0, 0.05)",
84
- surfaceBackgroundTertiaryColor: import_colors_values.COLORS.white,
85
79
  surfaceColor: import_colors_values.COLORS.white,
86
80
  // Modal exit animation: `use-modal-exit-animation` parses this for the
87
81
  // `animationend` timeout race; keep the numeric duration equal to the WPDS
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/config-values.js"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { COLORS } from './colors-values';\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PROPS = {\n // These values should be shared with TextControl.\n controlPaddingX: 12,\n controlPaddingXSmall: 8,\n controlPaddingXLarge: 12 * 1.3334,\n // TODO: Deprecate\n\n controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,\n controlHeight: CONTROL_HEIGHT,\n controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,\n controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,\n controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,\n controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign({}, CONTROL_PROPS, {\n colorDivider: 'rgba(0, 0, 0, 0.1)',\n colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n elevationIntensity: 1,\n radiusXSmall: '1px',\n radiusSmall: '2px',\n radiusMedium: '4px',\n radiusLarge: '8px',\n radiusFull: '9999px',\n radiusRound: '50%',\n borderWidth: '1px',\n borderWidthFocus: '1.5px',\n borderWidthTab: '4px',\n spinnerSize: 16,\n fontSize: '13px',\n fontSizeH1: 'calc(2.44 * 13px)',\n fontSizeH2: 'calc(1.95 * 13px)',\n fontSizeH3: 'calc(1.56 * 13px)',\n fontSizeH4: 'calc(1.25 * 13px)',\n fontSizeH5: '13px',\n fontSizeH6: 'calc(0.8 * 13px)',\n fontSizeInputMobile: '16px',\n fontSizeMobile: '15px',\n fontSizeSmall: 'calc(0.92 * 13px)',\n fontSizeXSmall: 'calc(0.75 * 13px)',\n fontLineHeightBase: '1.4',\n fontWeight: 'normal',\n fontWeightMedium: '499',\n // ensures fallback to 400 (instead of 600)\n fontWeightHeading: '600',\n gridBase: '4px',\n elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,\n elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,\n elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,\n elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,\n surfaceBackgroundColor: COLORS.white,\n surfaceBackgroundSubtleColor: '#F3F3F3',\n surfaceBackgroundTintColor: '#F5F5F5',\n surfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n surfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n surfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n surfaceBackgroundTertiaryColor: COLORS.white,\n surfaceColor: COLORS.white,\n // Modal exit animation: `use-modal-exit-animation` parses this for the\n // `animationend` timeout race; keep the numeric duration equal to the WPDS\n // `motion-duration-md` token on `.components-modal__frame` in modal/style.scss.\n transitionDuration: '200ms',\n transitionDurationFast: '160ms',\n transitionDurationFaster: '120ms',\n transitionDurationFastest: '100ms',\n transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)'\n});"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAAuB;AACvB,IAAM,iBAAiB;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,EAIrB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,0BAA0B;AAAA,EAC1B,iCAAiC;AACnC,CAAC;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { COLORS } from './colors-values';\nconst CONTROL_HEIGHT = '36px';\nconst CONTROL_PROPS = {\n // These values should be shared with TextControl.\n controlPaddingX: 12,\n controlPaddingXSmall: 8,\n controlPaddingXLarge: 12 * 1.3334,\n // TODO: Deprecate\n\n controlBoxShadowFocus: `0 0 0 0.5px ${COLORS.theme.accent}`,\n controlHeight: CONTROL_HEIGHT,\n controlHeightXSmall: `calc( ${CONTROL_HEIGHT} * 0.6 )`,\n controlHeightSmall: `calc( ${CONTROL_HEIGHT} * 0.8 )`,\n controlHeightLarge: `calc( ${CONTROL_HEIGHT} * 1.2 )`,\n controlHeightXLarge: `calc( ${CONTROL_HEIGHT} * 1.4 )`\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign({}, CONTROL_PROPS, {\n colorDivider: 'rgba(0, 0, 0, 0.1)',\n colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n colorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n elevationIntensity: 1,\n radiusXSmall: '1px',\n radiusSmall: '2px',\n radiusMedium: '4px',\n radiusLarge: '8px',\n radiusFull: '9999px',\n radiusRound: '50%',\n borderWidth: '1px',\n borderWidthFocus: '1.5px',\n borderWidthTab: '4px',\n spinnerSize: 16,\n fontSize: '13px',\n fontSizeH1: 'calc(2.44 * 13px)',\n fontSizeH2: 'calc(1.95 * 13px)',\n fontSizeH3: 'calc(1.56 * 13px)',\n fontSizeH4: 'calc(1.25 * 13px)',\n fontSizeH5: '13px',\n fontSizeH6: 'calc(0.8 * 13px)',\n fontSizeInputMobile: '16px',\n fontSizeMobile: '15px',\n fontSizeSmall: 'calc(0.92 * 13px)',\n fontSizeXSmall: 'calc(0.75 * 13px)',\n fontLineHeightBase: '1.4',\n fontWeight: 'normal',\n fontWeightMedium: '499',\n // ensures fallback to 400 (instead of 600)\n fontWeightHeading: '600',\n gridBase: '4px',\n elevationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,\n elevationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,\n elevationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,\n elevationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,\n surfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n surfaceColor: COLORS.white,\n // Modal exit animation: `use-modal-exit-animation` parses this for the\n // `animationend` timeout race; keep the numeric duration equal to the WPDS\n // `motion-duration-md` token on `.components-modal__frame` in modal/style.scss.\n transitionDuration: '200ms',\n transitionDurationFast: '160ms',\n transitionDurationFaster: '120ms',\n transitionDurationFastest: '100ms',\n transitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n transitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)'\n});"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAAuB;AACvB,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AAAA;AAAA,EAEpB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,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hooks/use-cx.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nconst isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name', 'styles'].every(p => typeof o[p] !== 'undefined');\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n * ```jsx\n * import { css } from '@emotion/react';\n *\n * const styles = css`\n * \tcolor: red\n * `;\n *\n * function RedText( { className, ...props } ) {\n * \tconst cx = useCx();\n *\n * \tconst classes = cx(styles, className);\n *\n * \treturn <span className={classes} {...props} />;\n * }\n * ```\n */\nexport const useCx = () => {\n const cache = useEmotionCache();\n const cx = useCallback((...classNames) => {\n if (cache === null) {\n throw new Error('The `useCx` hook should be only used within a valid Emotion Cache Context');\n }\n return innerCx(...classNames.map(arg => {\n if (isSerializedStyles(arg)) {\n insertStyles(cache, arg, false);\n return `${cache.key}-${arg.name}`;\n }\n return arg;\n }));\n }, [cache]);\n return cx;\n};"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA4D;AAC5D,mBAA6B;AAE7B,iBAA8B;AAK9B,qBAA4B;AAC5B,IAAM,qBAAqB,OAAK,OAAO,MAAM,eAAe,MAAM,QAAQ,CAAC,QAAQ,QAAQ,EAAE,MAAM,OAAK,OAAO,EAAE,CAAC,MAAM,WAAW;AAwB5H,IAAM,QAAQ,MAAM;AACzB,QAAM,YAAQ,aAAAA,0BAAgB;AAC9B,QAAM,SAAK,4BAAY,IAAI,eAAe;AACxC,QAAI,UAAU,MAAM;AAClB,YAAM,IAAI,MAAM,2EAA2E;AAAA,IAC7F;AACA,eAAO,WAAAC,IAAQ,GAAG,WAAW,IAAI,SAAO;AACtC,UAAI,mBAAmB,GAAG,GAAG;AAC3B,uCAAa,OAAO,KAAK,KAAK;AAC9B,eAAO,GAAG,MAAM,GAAG,IAAI,IAAI,IAAI;AAAA,MACjC;AACA,aAAO;AAAA,IACT,CAAC,CAAC;AAAA,EACJ,GAAG,CAAC,KAAK,CAAC;AACV,SAAO;AACT;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nconst isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name', 'styles'].every(p => typeof o[p] !== 'undefined');\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n * Passing multiple `SerializedStyles` arguments emits multiple classes. When\n * fragments rely on source-order overrides, compose them in a single `css()`\n * call before passing them to `cx`.\n *\n * ```jsx\n * import { css } from '@emotion/react';\n *\n * const styles = css`\n * \tcolor: red\n * `;\n *\n * function RedText( { className, ...props } ) {\n * \tconst cx = useCx();\n *\n * \tconst classes = cx(styles, className);\n *\n * \treturn <span className={classes} {...props} />;\n * }\n * ```\n */\nexport const useCx = () => {\n const cache = useEmotionCache();\n const cx = useCallback((...classNames) => {\n if (cache === null) {\n throw new Error('The `useCx` hook should be only used within a valid Emotion Cache Context');\n }\n return innerCx(...classNames.map(arg => {\n if (isSerializedStyles(arg)) {\n insertStyles(cache, arg, false);\n return `${cache.key}-${arg.name}`;\n }\n return arg;\n }));\n }, [cache]);\n return cx;\n};"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA4D;AAC5D,mBAA6B;AAE7B,iBAA8B;AAK9B,qBAA4B;AAC5B,IAAM,qBAAqB,OAAK,OAAO,MAAM,eAAe,MAAM,QAAQ,CAAC,QAAQ,QAAQ,EAAE,MAAM,OAAK,OAAO,EAAE,CAAC,MAAM,WAAW;AA4B5H,IAAM,QAAQ,MAAM;AACzB,QAAM,YAAQ,aAAAA,0BAAgB;AAC9B,QAAM,SAAK,4BAAY,IAAI,eAAe;AACxC,QAAI,UAAU,MAAM;AAClB,YAAM,IAAI,MAAM,2EAA2E;AAAA,IAC7F;AACA,eAAO,WAAAC,IAAQ,GAAG,WAAW,IAAI,SAAO;AACtC,UAAI,mBAAmB,GAAG,GAAG;AAC3B,uCAAa,OAAO,KAAK,KAAK;AAC9B,eAAO,GAAG,MAAM,GAAG,IAAI,IAAI,IAAI;AAAA,MACjC;AACA,aAAO;AAAA,IACT,CAAC,CAAC;AAAA,EACJ,GAAG,CAAC,KAAK,CAAC;AACV,SAAO;AACT;",
6
6
  "names": ["useEmotionCache", "innerCx"]
7
7
  }
@@ -0,0 +1,123 @@
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/utils/polymorphic-element.tsx
21
+ var polymorphic_element_exports = {};
22
+ __export(polymorphic_element_exports, {
23
+ PolymorphicElement: () => PolymorphicElement
24
+ });
25
+ module.exports = __toCommonJS(polymorphic_element_exports);
26
+ var import_element = require("@wordpress/element");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ var customAttributeRegExp = /^(data|aria|x)-/i;
29
+ var eventHandlerRegExp = /^on[A-Z]/;
30
+ var svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse
31
+ feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix
32
+ feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood
33
+ feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode
34
+ feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile
35
+ feTurbulence filter foreignObject g image line linearGradient marker mask
36
+ metadata mpath path pattern polygon polyline radialGradient rect set stop svg
37
+ switch symbol text textPath tspan use view`.split(/\s+/));
38
+ var baseElementProps = new Set(`children dangerouslySetInnerHTML key autoFocus defaultValue defaultChecked
39
+ innerHTML suppressContentEditableWarning suppressHydrationWarning valueLink
40
+ abbr accept acceptCharset accessKey action allow allowUserMedia
41
+ allowPaymentRequest allowFullScreen allowTransparency alt async autoComplete
42
+ autoPlay capture cellPadding cellSpacing challenge charSet checked cite classID
43
+ className cols colSpan content contentEditable contextMenu controls controlsList
44
+ coords crossOrigin data dateTime decoding default defer dir disabled
45
+ disablePictureInPicture disableRemotePlayback download draggable encType
46
+ enterKeyHint fetchpriority fetchPriority form formAction formEncType formMethod
47
+ formNoValidate formTarget frameBorder headers height hidden high href hrefLang
48
+ htmlFor httpEquiv id inputMode integrity is keyParams keyType kind label lang
49
+ list loading loop low marginHeight marginWidth max maxLength media mediaGroup
50
+ method min minLength multiple muted name nonce noValidate open optimum pattern
51
+ placeholder playsInline popover popoverTarget popoverTargetAction poster
52
+ preload profile radioGroup readOnly referrerPolicy rel required reversed role
53
+ rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes
54
+ slot span spellCheck src srcDoc srcLang srcSet start step style summary
55
+ tabIndex target title translate type useMap value width wmode wrap about
56
+ datatype inlist prefix property resource typeof vocab autoCapitalize
57
+ autoCorrect autoSave color incremental fallback inert itemProp itemScope
58
+ itemType itemID itemRef on option results security unselectable`.split(/\s+/));
59
+ var svgElementProps = new Set(`accentHeight accumulate additive alignmentBaseline allowReorder alphabetic
60
+ amplitude arabicForm ascent attributeName attributeType autoReverse azimuth
61
+ baseFrequency baselineShift baseProfile bbox begin bias by calcMode capHeight
62
+ clip clipPathUnits clipPath clipRule colorInterpolation
63
+ colorInterpolationFilters colorProfile colorRendering contentScriptType
64
+ contentStyleType cursor cx cy d decelerate descent diffuseConstant direction
65
+ display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground
66
+ end exponent externalResourcesRequired fill fillOpacity fillRule filter
67
+ filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize
68
+ fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fr fx
69
+ fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical
70
+ glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX
71
+ ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix
72
+ kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust
73
+ letterSpacing lightingColor limitingConeAngle local markerEnd markerMid
74
+ markerStart markerHeight markerUnits markerWidth mask maskContentUnits
75
+ maskUnits mathematical mode numOctaves offset opacity operator order orient
76
+ orientation origin overflow overlinePosition overlineThickness panose1
77
+ paintOrder pathLength patternContentUnits patternTransform patternUnits
78
+ pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha
79
+ preserveAspectRatio primitiveUnits r radius refX refY renderingIntent
80
+ repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate
81
+ rx ry scale seed shapeRendering slope spacing specularConstant
82
+ specularExponent speed spreadMethod startOffset stdDeviation stemh stemv
83
+ stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness
84
+ string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin
85
+ strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage
86
+ tableValues targetX targetY textAnchor textDecoration textRendering textLength
87
+ to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi
88
+ unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values
89
+ vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget
90
+ visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector
91
+ xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType
92
+ xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z
93
+ zoomAndPan`.split(/\s+/));
94
+ var compatElementProps = /* @__PURE__ */ new Set(["autofocus", "class", "for"]);
95
+ function isValidIntrinsicElementProp(prop, element) {
96
+ if (customAttributeRegExp.test(prop) || eventHandlerRegExp.test(prop)) {
97
+ return true;
98
+ }
99
+ if (baseElementProps.has(prop) || compatElementProps.has(prop)) {
100
+ return true;
101
+ }
102
+ return svgElementNames.has(element) && svgElementProps.has(prop);
103
+ }
104
+ function filterIntrinsicElementProps(props, element) {
105
+ return Object.fromEntries(Object.entries(props).filter(([prop]) => isValidIntrinsicElementProp(prop, element)));
106
+ }
107
+ function UnforwardedPolymorphicElement({
108
+ as,
109
+ ...props
110
+ }, ref) {
111
+ const Element = as || "div";
112
+ const forwardedProps = typeof Element === "string" ? filterIntrinsicElementProps(props, Element) : props;
113
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Element, {
114
+ ref,
115
+ ...forwardedProps
116
+ });
117
+ }
118
+ var PolymorphicElement = (0, import_element.forwardRef)(UnforwardedPolymorphicElement);
119
+ // Annotate the CommonJS export names for ESM import in node:
120
+ 0 && (module.exports = {
121
+ PolymorphicElement
122
+ });
123
+ //# sourceMappingURL=polymorphic-element.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/polymorphic-element.tsx"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst customAttributeRegExp = /^(data|aria|x)-/i;\nconst eventHandlerRegExp = /^on[A-Z]/;\n\n// Derived from @emotion/is-prop-valid's React prop allowlist, but split by\n// element type so SVG-only props are intentionally filtered from HTML elements.\n// The event-handler check is also deliberately stricter than Emotion's\n// charCode-based `on*` fallback.\nconst svgElementNames = new Set(`animate animateMotion animateTransform circle clipPath defs desc ellipse\n\tfeBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix\n\tfeDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood\n\tfeFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode\n\tfeMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile\n\tfeTurbulence filter foreignObject g image line linearGradient marker mask\n\tmetadata mpath path pattern polygon polyline radialGradient rect set stop svg\n\tswitch symbol text textPath tspan use view`.split(/\\s+/));\nconst baseElementProps = new Set(`children dangerouslySetInnerHTML key autoFocus defaultValue defaultChecked\n\tinnerHTML suppressContentEditableWarning suppressHydrationWarning valueLink\n\tabbr accept acceptCharset accessKey action allow allowUserMedia\n\tallowPaymentRequest allowFullScreen allowTransparency alt async autoComplete\n\tautoPlay capture cellPadding cellSpacing challenge charSet checked cite classID\n\tclassName cols colSpan content contentEditable contextMenu controls controlsList\n\tcoords crossOrigin data dateTime decoding default defer dir disabled\n\tdisablePictureInPicture disableRemotePlayback download draggable encType\n\tenterKeyHint fetchpriority fetchPriority form formAction formEncType formMethod\n\tformNoValidate formTarget frameBorder headers height hidden high href hrefLang\n\thtmlFor httpEquiv id inputMode integrity is keyParams keyType kind label lang\n\tlist loading loop low marginHeight marginWidth max maxLength media mediaGroup\n\tmethod min minLength multiple muted name nonce noValidate open optimum pattern\n\tplaceholder playsInline popover popoverTarget popoverTargetAction poster\n\tpreload profile radioGroup readOnly referrerPolicy rel required reversed role\n\trows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes\n\tslot span spellCheck src srcDoc srcLang srcSet start step style summary\n\ttabIndex target title translate type useMap value width wmode wrap about\n\tdatatype inlist prefix property resource typeof vocab autoCapitalize\n\tautoCorrect autoSave color incremental fallback inert itemProp itemScope\n\titemType itemID itemRef on option results security unselectable`.split(/\\s+/));\nconst svgElementProps = new Set(`accentHeight accumulate additive alignmentBaseline allowReorder alphabetic\n\tamplitude arabicForm ascent attributeName attributeType autoReverse azimuth\n\tbaseFrequency baselineShift baseProfile bbox begin bias by calcMode capHeight\n\tclip clipPathUnits clipPath clipRule colorInterpolation\n\tcolorInterpolationFilters colorProfile colorRendering contentScriptType\n\tcontentStyleType cursor cx cy d decelerate descent diffuseConstant direction\n\tdisplay divisor dominantBaseline dur dx dy edgeMode elevation enableBackground\n\tend exponent externalResourcesRequired fill fillOpacity fillRule filter\n\tfilterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize\n\tfontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fr fx\n\tfy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical\n\tglyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX\n\tideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix\n\tkernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust\n\tletterSpacing lightingColor limitingConeAngle local markerEnd markerMid\n\tmarkerStart markerHeight markerUnits markerWidth mask maskContentUnits\n\tmaskUnits mathematical mode numOctaves offset opacity operator order orient\n\torientation origin overflow overlinePosition overlineThickness panose1\n\tpaintOrder pathLength patternContentUnits patternTransform patternUnits\n\tpointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha\n\tpreserveAspectRatio primitiveUnits r radius refX refY renderingIntent\n\trepeatCount repeatDur requiredExtensions requiredFeatures restart result rotate\n\trx ry scale seed shapeRendering slope spacing specularConstant\n\tspecularExponent speed spreadMethod startOffset stdDeviation stemh stemv\n\tstitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness\n\tstring stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin\n\tstrokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage\n\ttableValues targetX targetY textAnchor textDecoration textRendering textLength\n\tto transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi\n\tunicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values\n\tvectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget\n\tvisibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector\n\txlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType\n\txmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z\n\tzoomAndPan`.split(/\\s+/));\nconst compatElementProps = new Set(['autofocus', 'class', 'for']);\nfunction isValidIntrinsicElementProp(prop, element) {\n if (customAttributeRegExp.test(prop) || eventHandlerRegExp.test(prop)) {\n return true;\n }\n if (baseElementProps.has(prop) || compatElementProps.has(prop)) {\n return true;\n }\n return svgElementNames.has(element) && svgElementProps.has(prop);\n}\nfunction filterIntrinsicElementProps(props, element) {\n return Object.fromEntries(Object.entries(props).filter(([prop]) => isValidIntrinsicElementProp(prop, element)));\n}\nfunction UnforwardedPolymorphicElement({\n as,\n ...props\n}, ref) {\n const Element = as || 'div';\n const forwardedProps = typeof Element === 'string' ? filterIntrinsicElementProps(props, Element) : props;\n return /*#__PURE__*/_jsx(Element, {\n ref: ref,\n ...forwardedProps\n });\n}\n\n/**\n * Internal utility for components that need Emotion-compatible `as` behavior\n * while rendering with plain React elements.\n */\nexport const PolymorphicElement = forwardRef(UnforwardedPolymorphicElement);"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,qBAA2B;AAC3B,yBAA4B;AAC5B,IAAM,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AA,KAAK,SAAS;AAAA,IAChC;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;AAMO,IAAM,yBAAqB,2BAAW,6BAA6B;",
6
+ "names": ["_jsx"]
7
+ }
@@ -61,7 +61,6 @@ var UnforwardedValidatedComboboxControl = ({
61
61
  customValidity,
62
62
  getValidityTarget: () => validityTargetRef.current?.querySelector('input[role="combobox"]'),
63
63
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_combobox_control.default, {
64
- __next40pxDefaultSize: true,
65
64
  ...restProps
66
65
  })
67
66
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validated-form-controls/components/combobox-control.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport ComboboxControl from '../../combobox-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedComboboxControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n\n // TODO: Upstream limitation - The `required` attribute is not passed down to the input,\n // so we need to set it manually.\n useEffect(() => {\n const input = validityTargetRef.current?.querySelector('input[role=\"combobox\"]');\n if (input) {\n input.required = required ?? false;\n }\n }, [required]);\n return (\n /*#__PURE__*/\n // TODO: Bug - Missing value error is not cleared immediately on change, waits for blur.\n _jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n ref: mergedRefs,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current?.querySelector('input[role=\"combobox\"]'),\n children: /*#__PURE__*/_jsx(ComboboxControl, {\n __next40pxDefaultSize: true,\n ...restProps\n })\n })\n );\n};\nexport const ValidatedComboboxControl = forwardRef(UnforwardedValidatedComboboxControl);\nValidatedComboboxControl.displayName = 'ValidatedComboboxControl';"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA6B;AAC7B,qBAA8C;AAK9C,gCAAiC;AACjC,8BAA4B;AAC5B,yBAA4B;AAC5B,IAAM,sCAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,wBAAoB,uBAAO,IAAI;AACrC,QAAM,iBAAa,6BAAa,CAAC,cAAc,iBAAiB,CAAC;AAIjE,gCAAU,MAAM;AACd,UAAM,QAAQ,kBAAkB,SAAS,cAAc,wBAAwB;AAC/E,QAAI,OAAO;AACT,YAAM,WAAW,YAAY;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AACb;AAAA;AAAA,IAGE,uCAAAA,KAAK,4CAAkB;AAAA,MACrB;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA,mBAAmB,MAAM,kBAAkB,SAAS,cAAc,wBAAwB;AAAA,MAC1F,UAAuB,uCAAAA,KAAK,wBAAAC,SAAiB;AAAA,QAC3C,uBAAuB;AAAA,QACvB,GAAG;AAAA,MACL,CAAC;AAAA,IACH,CAAC;AAAA;AAEL;AACO,IAAM,+BAA2B,2BAAW,mCAAmC;AACtF,yBAAyB,cAAc;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport ComboboxControl from '../../combobox-control';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst UnforwardedValidatedComboboxControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);\n\n // TODO: Upstream limitation - The `required` attribute is not passed down to the input,\n // so we need to set it manually.\n useEffect(() => {\n const input = validityTargetRef.current?.querySelector('input[role=\"combobox\"]');\n if (input) {\n input.required = required ?? false;\n }\n }, [required]);\n return (\n /*#__PURE__*/\n // TODO: Bug - Missing value error is not cleared immediately on change, waits for blur.\n _jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n ref: mergedRefs,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current?.querySelector('input[role=\"combobox\"]'),\n children: /*#__PURE__*/_jsx(ComboboxControl, {\n ...restProps\n })\n })\n );\n};\nexport const ValidatedComboboxControl = forwardRef(UnforwardedValidatedComboboxControl);\nValidatedComboboxControl.displayName = 'ValidatedComboboxControl';"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA6B;AAC7B,qBAA8C;AAK9C,gCAAiC;AACjC,8BAA4B;AAC5B,yBAA4B;AAC5B,IAAM,sCAAsC,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,wBAAoB,uBAAO,IAAI;AACrC,QAAM,iBAAa,6BAAa,CAAC,cAAc,iBAAiB,CAAC;AAIjE,gCAAU,MAAM;AACd,UAAM,QAAQ,kBAAkB,SAAS,cAAc,wBAAwB;AAC/E,QAAI,OAAO;AACT,YAAM,WAAW,YAAY;AAAA,IAC/B;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AACb;AAAA;AAAA,IAGE,uCAAAA,KAAK,4CAAkB;AAAA,MACrB;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA,mBAAmB,MAAM,kBAAkB,SAAS,cAAc,wBAAwB;AAAA,MAC1F,UAAuB,uCAAAA,KAAK,wBAAAC,SAAiB;AAAA,QAC3C,GAAG;AAAA,MACL,CAAC;AAAA,IACH,CAAC;AAAA;AAEL;AACO,IAAM,+BAA2B,2BAAW,mCAAmC;AACtF,yBAAyB,cAAc;",
6
6
  "names": ["_jsx", "ComboboxControl"]
7
7
  }
@@ -55,7 +55,6 @@ var UnforwardedValidatedCustomSelectControl = ({
55
55
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
56
  import_custom_select_control.default,
57
57
  {
58
- __next40pxDefaultSize: true,
59
58
  ...restProps
60
59
  }
61
60
  )
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/validated-form-controls/components/custom-select-control.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport CustomSelectControl from '../../custom-select-control';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst UnforwardedValidatedCustomSelectControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-validated-control__wrapper-with-error-delegate\",\n ref: forwardedRef,\n children: [/*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(CustomSelectControl\n // TODO: Upstream limitation - Required isn't passed down correctly,\n // so it needs to be set on a delegate element.\n , {\n __next40pxDefaultSize: true,\n ...restProps\n })\n }), /*#__PURE__*/_jsxs(\"select\", {\n className: \"components-validated-control__error-delegate\",\n ref: validityTargetRef,\n required: required,\n tabIndex: -1,\n value: restProps.value?.key ? 'hasvalue' : '',\n onChange: () => {},\n onFocus: e => {\n e.target.previousElementSibling?.querySelector('[role=\"combobox\"]')?.focus();\n },\n children: [/*#__PURE__*/_jsx(\"option\", {\n value: \"\",\n children: \"No selection\"\n }), /*#__PURE__*/_jsx(\"option\", {\n value: \"hasvalue\",\n children: \"Has selection\"\n })]\n })]\n });\n};\nexport const ValidatedCustomSelectControl = forwardRef(UnforwardedValidatedCustomSelectControl);\nValidatedCustomSelectControl.displayName = 'ValidatedCustomSelectControl';"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AAKnC,gCAAiC;AACjC,mCAAgC;AAChC,yBAA2C;AAC3C,IAAM,0CAA0C,CAAC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,wBAAoB,uBAAO,IAAI;AACrC,SAAoB,uCAAAA,MAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX,KAAK;AAAA,IACL,UAAU,CAAc,uCAAAC,KAAK,4CAAkB;AAAA,MAC7C;AAAA,MACA;AAAA,MACA;AAAA,MACA,mBAAmB,MAAM,kBAAkB;AAAA,MAC3C,UAAuB,uCAAAA;AAAA,QAAK,6BAAAC;AAAA,QAG1B;AAAA,UACA,uBAAuB;AAAA,UACvB,GAAG;AAAA,QACL;AAAA,MAAC;AAAA,IACH,CAAC,GAAgB,uCAAAF,MAAM,UAAU;AAAA,MAC/B,WAAW;AAAA,MACX,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,OAAO,UAAU,OAAO,MAAM,aAAa;AAAA,MAC3C,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,SAAS,OAAK;AACZ,UAAE,OAAO,wBAAwB,cAAc,mBAAmB,GAAG,MAAM;AAAA,MAC7E;AAAA,MACA,UAAU,CAAc,uCAAAC,KAAK,UAAU;AAAA,QACrC,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,UAAU;AAAA,QAC9B,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACO,IAAM,mCAA+B,2BAAW,uCAAuC;AAC9F,6BAA6B,cAAc;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport CustomSelectControl from '../../custom-select-control';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst UnforwardedValidatedCustomSelectControl = ({\n required,\n customValidity,\n markWhenOptional,\n ...restProps\n}, forwardedRef) => {\n const validityTargetRef = useRef(null);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-validated-control__wrapper-with-error-delegate\",\n ref: forwardedRef,\n children: [/*#__PURE__*/_jsx(ControlWithError, {\n required: required,\n markWhenOptional: markWhenOptional,\n customValidity: customValidity,\n getValidityTarget: () => validityTargetRef.current,\n children: /*#__PURE__*/_jsx(CustomSelectControl\n // TODO: Upstream limitation - Required isn't passed down correctly,\n // so it needs to be set on a delegate element.\n , {\n ...restProps\n })\n }), /*#__PURE__*/_jsxs(\"select\", {\n className: \"components-validated-control__error-delegate\",\n ref: validityTargetRef,\n required: required,\n tabIndex: -1,\n value: restProps.value?.key ? 'hasvalue' : '',\n onChange: () => {},\n onFocus: e => {\n e.target.previousElementSibling?.querySelector('[role=\"combobox\"]')?.focus();\n },\n children: [/*#__PURE__*/_jsx(\"option\", {\n value: \"\",\n children: \"No selection\"\n }), /*#__PURE__*/_jsx(\"option\", {\n value: \"hasvalue\",\n children: \"Has selection\"\n })]\n })]\n });\n};\nexport const ValidatedCustomSelectControl = forwardRef(UnforwardedValidatedCustomSelectControl);\nValidatedCustomSelectControl.displayName = 'ValidatedCustomSelectControl';"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmC;AAKnC,gCAAiC;AACjC,mCAAgC;AAChC,yBAA2C;AAC3C,IAAM,0CAA0C,CAAC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,iBAAiB;AAClB,QAAM,wBAAoB,uBAAO,IAAI;AACrC,SAAoB,uCAAAA,MAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX,KAAK;AAAA,IACL,UAAU,CAAc,uCAAAC,KAAK,4CAAkB;AAAA,MAC7C;AAAA,MACA;AAAA,MACA;AAAA,MACA,mBAAmB,MAAM,kBAAkB;AAAA,MAC3C,UAAuB,uCAAAA;AAAA,QAAK,6BAAAC;AAAA,QAG1B;AAAA,UACA,GAAG;AAAA,QACL;AAAA,MAAC;AAAA,IACH,CAAC,GAAgB,uCAAAF,MAAM,UAAU;AAAA,MAC/B,WAAW;AAAA,MACX,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV,OAAO,UAAU,OAAO,MAAM,aAAa;AAAA,MAC3C,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,SAAS,OAAK;AACZ,UAAE,OAAO,wBAAwB,cAAc,mBAAmB,GAAG,MAAM;AAAA,MAC7E;AAAA,MACA,UAAU,CAAc,uCAAAC,KAAK,UAAU;AAAA,QACrC,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,UAAU;AAAA,QAC9B,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACO,IAAM,mCAA+B,2BAAW,uCAAuC;AAC9F,6BAA6B,cAAc;",
6
6
  "names": ["_jsxs", "_jsx", "CustomSelectControl"]
7
7
  }
@@ -43,7 +43,6 @@ var UnforwardedValidatedFormTokenField = ({
43
43
  customValidity,
44
44
  getValidityTarget: () => validityTargetRef.current,
45
45
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_token_field.FormTokenField, {
46
- __next40pxDefaultSize: true,
47
46
  ...restProps
48
47
  })
49
48
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {