@wordpress/components 27.4.0 → 27.5.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 (474) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/build/alignment-matrix-control/index.js +3 -1
  3. package/build/alignment-matrix-control/index.js.map +1 -1
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  6. package/build/alignment-matrix-control/utils.js +6 -2
  7. package/build/alignment-matrix-control/utils.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.js +3 -1
  9. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  10. package/build/autocomplete/index.js +21 -7
  11. package/build/autocomplete/index.js.map +1 -1
  12. package/build/checkbox-control/index.js +9 -2
  13. package/build/checkbox-control/index.js.map +1 -1
  14. package/build/color-picker/hex-input.js +3 -1
  15. package/build/color-picker/hex-input.js.map +1 -1
  16. package/build/color-picker/hue-picker.native.js +6 -2
  17. package/build/color-picker/hue-picker.native.js.map +1 -1
  18. package/build/color-picker/index.native.js +9 -3
  19. package/build/color-picker/index.native.js.map +1 -1
  20. package/build/color-picker/saturation-picker.native.js +6 -2
  21. package/build/color-picker/saturation-picker.native.js.map +1 -1
  22. package/build/color-picker/use-deprecated-props.js +9 -3
  23. package/build/color-picker/use-deprecated-props.js.map +1 -1
  24. package/build/context/context-connect.js +6 -2
  25. package/build/context/context-connect.js.map +1 -1
  26. package/build/custom-select-control-v2/legacy-component/index.js +3 -1
  27. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  28. package/build/drop-zone/index.js +72 -64
  29. package/build/drop-zone/index.js.map +1 -1
  30. package/build/dropdown/styles.js +5 -3
  31. package/build/dropdown/styles.js.map +1 -1
  32. package/build/duotone-picker/utils.js +3 -1
  33. package/build/duotone-picker/utils.js.map +1 -1
  34. package/build/elevation/hook.js +5 -6
  35. package/build/elevation/hook.js.map +1 -1
  36. package/build/focal-point-picker/controls.js +3 -1
  37. package/build/focal-point-picker/controls.js.map +1 -1
  38. package/build/focal-point-picker/index.js +21 -7
  39. package/build/focal-point-picker/index.js.map +1 -1
  40. package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
  41. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  42. package/build/focal-point-picker/tooltip/index.native.js +3 -8
  43. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  44. package/build/focal-point-picker/utils.js +3 -1
  45. package/build/focal-point-picker/utils.js.map +1 -1
  46. package/build/font-size-picker/index.js +3 -2
  47. package/build/font-size-picker/index.js.map +1 -1
  48. package/build/font-size-picker/types.js.map +1 -1
  49. package/build/input-control/input-field.js +3 -1
  50. package/build/input-control/input-field.js.map +1 -1
  51. package/build/input-control/label.js +3 -1
  52. package/build/input-control/label.js.map +1 -1
  53. package/build/input-control/styles/input-control-styles.js +31 -23
  54. package/build/input-control/styles/input-control-styles.js.map +1 -1
  55. package/build/input-control/utils.js +8 -4
  56. package/build/input-control/utils.js.map +1 -1
  57. package/build/item-group/item/hook.js +0 -4
  58. package/build/item-group/item/hook.js.map +1 -1
  59. package/build/mobile/gradient/index.native.js +3 -1
  60. package/build/mobile/gradient/index.native.js.map +1 -1
  61. package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  62. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  63. package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
  64. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  65. package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
  66. package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  67. package/build/modal/aria-helper.js +9 -3
  68. package/build/modal/aria-helper.js.map +1 -1
  69. package/build/modal/index.js +6 -2
  70. package/build/modal/index.js.map +1 -1
  71. package/build/navigation/styles/navigation-styles.js +12 -12
  72. package/build/navigation/styles/navigation-styles.js.map +1 -1
  73. package/build/panel/body.js +3 -1
  74. package/build/panel/body.js.map +1 -1
  75. package/build/popover/index.js +3 -1
  76. package/build/popover/index.js.map +1 -1
  77. package/build/popover/overlay-middlewares.js +3 -1
  78. package/build/popover/overlay-middlewares.js.map +1 -1
  79. package/build/query-controls/author-select.js +3 -1
  80. package/build/query-controls/author-select.js.map +1 -1
  81. package/build/range-control/rail.js +1 -1
  82. package/build/range-control/rail.js.map +1 -1
  83. package/build/range-control/styles/range-control-styles.js +29 -29
  84. package/build/range-control/styles/range-control-styles.js.map +1 -1
  85. package/build/resizable-box/resize-tooltip/index.js +3 -1
  86. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  87. package/build/resizable-box/resize-tooltip/label.js +3 -1
  88. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  89. package/build/resizable-box/resize-tooltip/utils.js +12 -4
  90. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  91. package/build/select-control/index.js +3 -1
  92. package/build/select-control/index.js.map +1 -1
  93. package/build/select-control/styles/select-control-styles.js +8 -6
  94. package/build/select-control/styles/select-control-styles.js.map +1 -1
  95. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
  96. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  97. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
  98. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  99. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
  100. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  101. package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
  102. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  103. package/build/slot-fill/types.js.map +1 -1
  104. package/build/text/get-line-height.js +6 -2
  105. package/build/text/get-line-height.js.map +1 -1
  106. package/build/text/utils.js +6 -2
  107. package/build/text/utils.js.map +1 -1
  108. package/build/theme/color-algorithms.js +6 -2
  109. package/build/theme/color-algorithms.js.map +1 -1
  110. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  111. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  112. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  113. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  114. package/build/tree-grid/roving-tab-index-item.js +3 -1
  115. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  116. package/build/unit-control/index.js +3 -1
  117. package/build/unit-control/index.js.map +1 -1
  118. package/build/utils/colors.js +21 -7
  119. package/build/utils/colors.js.map +1 -1
  120. package/build/utils/font-size.js +3 -1
  121. package/build/utils/font-size.js.map +1 -1
  122. package/build/utils/get-valid-children.js +3 -1
  123. package/build/utils/get-valid-children.js.map +1 -1
  124. package/build/utils/input/base.js +2 -3
  125. package/build/utils/input/base.js.map +1 -1
  126. package/build/utils/strings.js +11 -57
  127. package/build/utils/strings.js.map +1 -1
  128. package/build/utils/use-responsive-value.js +3 -1
  129. package/build/utils/use-responsive-value.js.map +1 -1
  130. package/build/view/component.js +26 -8
  131. package/build/view/component.js.map +1 -1
  132. package/build-module/alignment-matrix-control/index.js +3 -1
  133. package/build-module/alignment-matrix-control/index.js.map +1 -1
  134. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  135. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  136. package/build-module/alignment-matrix-control/utils.js +6 -2
  137. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  138. package/build-module/autocomplete/autocompleter-ui.js +3 -1
  139. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  140. package/build-module/autocomplete/index.js +21 -7
  141. package/build-module/autocomplete/index.js.map +1 -1
  142. package/build-module/checkbox-control/index.js +9 -2
  143. package/build-module/checkbox-control/index.js.map +1 -1
  144. package/build-module/color-picker/hex-input.js +3 -1
  145. package/build-module/color-picker/hex-input.js.map +1 -1
  146. package/build-module/color-picker/hue-picker.native.js +6 -2
  147. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  148. package/build-module/color-picker/index.native.js +9 -3
  149. package/build-module/color-picker/index.native.js.map +1 -1
  150. package/build-module/color-picker/saturation-picker.native.js +6 -2
  151. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  152. package/build-module/color-picker/use-deprecated-props.js +9 -3
  153. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  154. package/build-module/context/context-connect.js +6 -2
  155. package/build-module/context/context-connect.js.map +1 -1
  156. package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
  157. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  158. package/build-module/drop-zone/index.js +72 -64
  159. package/build-module/drop-zone/index.js.map +1 -1
  160. package/build-module/dropdown/styles.js +5 -3
  161. package/build-module/dropdown/styles.js.map +1 -1
  162. package/build-module/duotone-picker/utils.js +3 -1
  163. package/build-module/duotone-picker/utils.js.map +1 -1
  164. package/build-module/elevation/hook.js +6 -7
  165. package/build-module/elevation/hook.js.map +1 -1
  166. package/build-module/focal-point-picker/controls.js +3 -1
  167. package/build-module/focal-point-picker/controls.js.map +1 -1
  168. package/build-module/focal-point-picker/index.js +21 -7
  169. package/build-module/focal-point-picker/index.js.map +1 -1
  170. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
  171. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  172. package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
  173. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  174. package/build-module/focal-point-picker/utils.js +3 -1
  175. package/build-module/focal-point-picker/utils.js.map +1 -1
  176. package/build-module/font-size-picker/index.js +3 -2
  177. package/build-module/font-size-picker/index.js.map +1 -1
  178. package/build-module/font-size-picker/types.js.map +1 -1
  179. package/build-module/input-control/input-field.js +3 -1
  180. package/build-module/input-control/input-field.js.map +1 -1
  181. package/build-module/input-control/label.js +3 -1
  182. package/build-module/input-control/label.js.map +1 -1
  183. package/build-module/input-control/styles/input-control-styles.js +31 -23
  184. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  185. package/build-module/input-control/utils.js +8 -4
  186. package/build-module/input-control/utils.js.map +1 -1
  187. package/build-module/item-group/item/hook.js +0 -4
  188. package/build-module/item-group/item/hook.js.map +1 -1
  189. package/build-module/mobile/gradient/index.native.js +3 -1
  190. package/build-module/mobile/gradient/index.native.js.map +1 -1
  191. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  192. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  193. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
  194. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  195. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
  196. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  197. package/build-module/modal/aria-helper.js +9 -3
  198. package/build-module/modal/aria-helper.js.map +1 -1
  199. package/build-module/modal/index.js +6 -2
  200. package/build-module/modal/index.js.map +1 -1
  201. package/build-module/navigation/styles/navigation-styles.js +13 -13
  202. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  203. package/build-module/panel/body.js +3 -1
  204. package/build-module/panel/body.js.map +1 -1
  205. package/build-module/popover/index.js +3 -1
  206. package/build-module/popover/index.js.map +1 -1
  207. package/build-module/popover/overlay-middlewares.js +3 -1
  208. package/build-module/popover/overlay-middlewares.js.map +1 -1
  209. package/build-module/query-controls/author-select.js +3 -1
  210. package/build-module/query-controls/author-select.js.map +1 -1
  211. package/build-module/range-control/rail.js +1 -1
  212. package/build-module/range-control/rail.js.map +1 -1
  213. package/build-module/range-control/styles/range-control-styles.js +30 -30
  214. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  215. package/build-module/resizable-box/resize-tooltip/index.js +3 -1
  216. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  217. package/build-module/resizable-box/resize-tooltip/label.js +3 -1
  218. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  219. package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
  220. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  221. package/build-module/select-control/index.js +3 -1
  222. package/build-module/select-control/index.js.map +1 -1
  223. package/build-module/select-control/styles/select-control-styles.js +8 -6
  224. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  225. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
  226. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  227. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  228. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  229. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  230. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  231. package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
  232. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  233. package/build-module/slot-fill/types.js.map +1 -1
  234. package/build-module/text/get-line-height.js +6 -2
  235. package/build-module/text/get-line-height.js.map +1 -1
  236. package/build-module/text/utils.js +6 -2
  237. package/build-module/text/utils.js.map +1 -1
  238. package/build-module/theme/color-algorithms.js +6 -2
  239. package/build-module/theme/color-algorithms.js.map +1 -1
  240. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  241. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  242. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
  243. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  244. package/build-module/tree-grid/roving-tab-index-item.js +3 -1
  245. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  246. package/build-module/unit-control/index.js +3 -1
  247. package/build-module/unit-control/index.js.map +1 -1
  248. package/build-module/utils/colors.js +21 -7
  249. package/build-module/utils/colors.js.map +1 -1
  250. package/build-module/utils/font-size.js +3 -1
  251. package/build-module/utils/font-size.js.map +1 -1
  252. package/build-module/utils/get-valid-children.js +3 -1
  253. package/build-module/utils/get-valid-children.js.map +1 -1
  254. package/build-module/utils/input/base.js +2 -3
  255. package/build-module/utils/input/base.js.map +1 -1
  256. package/build-module/utils/strings.js +12 -57
  257. package/build-module/utils/strings.js.map +1 -1
  258. package/build-module/utils/use-responsive-value.js +3 -1
  259. package/build-module/utils/use-responsive-value.js.map +1 -1
  260. package/build-module/view/component.js +26 -8
  261. package/build-module/view/component.js.map +1 -1
  262. package/build-style/style-rtl.css +39 -36
  263. package/build-style/style.css +39 -36
  264. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  265. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
  266. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
  267. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  268. package/build-types/autocomplete/index.d.ts.map +1 -1
  269. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
  270. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +4 -4
  271. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
  272. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
  273. package/build-types/border-control/border-control/hook.d.ts +4 -4
  274. package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -4
  275. package/build-types/box-control/stories/index.story.d.ts +24 -24
  276. package/build-types/card/card/hook.d.ts +4 -4
  277. package/build-types/card/card-body/hook.d.ts +4 -4
  278. package/build-types/card/card-divider/hook.d.ts +4 -4
  279. package/build-types/card/card-footer/hook.d.ts +4 -4
  280. package/build-types/card/card-header/hook.d.ts +4 -4
  281. package/build-types/card/card-media/hook.d.ts +4 -4
  282. package/build-types/checkbox-control/index.d.ts.map +1 -1
  283. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  284. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  285. package/build-types/context/context-connect.d.ts.map +1 -1
  286. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  287. package/build-types/drop-zone/index.d.ts.map +1 -1
  288. package/build-types/dropdown/styles.d.ts.map +1 -1
  289. package/build-types/duotone-picker/utils.d.ts.map +1 -1
  290. package/build-types/elevation/hook.d.ts +4 -4
  291. package/build-types/elevation/hook.d.ts.map +1 -1
  292. package/build-types/flex/flex/hook.d.ts +4 -4
  293. package/build-types/flex/flex-block/hook.d.ts +4 -4
  294. package/build-types/flex/flex-item/hook.d.ts +4 -4
  295. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  296. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  297. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  298. package/build-types/focal-point-picker/utils.d.ts.map +1 -1
  299. package/build-types/font-size-picker/index.d.ts.map +1 -1
  300. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  301. package/build-types/font-size-picker/types.d.ts +2 -0
  302. package/build-types/font-size-picker/types.d.ts.map +1 -1
  303. package/build-types/grid/hook.d.ts +4 -4
  304. package/build-types/h-stack/hook.d.ts +4 -4
  305. package/build-types/heading/hook.d.ts +4 -4
  306. package/build-types/input-control/input-field.d.ts.map +1 -1
  307. package/build-types/input-control/label.d.ts.map +1 -1
  308. package/build-types/input-control/stories/index.story.d.ts +2 -1
  309. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  310. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  311. package/build-types/input-control/utils.d.ts.map +1 -1
  312. package/build-types/item-group/item/hook.d.ts +5 -5
  313. package/build-types/item-group/item/hook.d.ts.map +1 -1
  314. package/build-types/item-group/item-group/hook.d.ts +4 -4
  315. package/build-types/modal/aria-helper.d.ts.map +1 -1
  316. package/build-types/modal/index.d.ts.map +1 -1
  317. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  318. package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
  319. package/build-types/navigator/navigator-button/hook.d.ts +4 -4
  320. package/build-types/palette-edit/styles.d.ts +749 -10
  321. package/build-types/palette-edit/styles.d.ts.map +1 -1
  322. package/build-types/panel/body.d.ts.map +1 -1
  323. package/build-types/popover/index.d.ts.map +1 -1
  324. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  325. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  326. package/build-types/query-controls/author-select.d.ts.map +1 -1
  327. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  328. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  329. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  330. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  331. package/build-types/scrollable/hook.d.ts +4 -4
  332. package/build-types/select-control/index.d.ts.map +1 -1
  333. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  334. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  335. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  336. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  337. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  338. package/build-types/slot-fill/types.d.ts +2 -2
  339. package/build-types/slot-fill/types.d.ts.map +1 -1
  340. package/build-types/spacer/hook.d.ts +4 -4
  341. package/build-types/surface/hook.d.ts +4 -4
  342. package/build-types/text/get-line-height.d.ts.map +1 -1
  343. package/build-types/text/hook.d.ts +4 -4
  344. package/build-types/text/utils.d.ts.map +1 -1
  345. package/build-types/text-control/index.d.ts +1 -1
  346. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  347. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  348. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  349. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  350. package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
  351. package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
  352. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  353. package/build-types/truncate/hook.d.ts +4 -4
  354. package/build-types/unit-control/index.d.ts.map +1 -1
  355. package/build-types/utils/colors.d.ts.map +1 -1
  356. package/build-types/utils/font-size.d.ts.map +1 -1
  357. package/build-types/utils/get-valid-children.d.ts.map +1 -1
  358. package/build-types/utils/input/base.d.ts.map +1 -1
  359. package/build-types/utils/strings.d.ts.map +1 -1
  360. package/build-types/utils/use-responsive-value.d.ts.map +1 -1
  361. package/build-types/v-stack/hook.d.ts +4 -4
  362. package/build-types/view/component.d.ts +253 -7
  363. package/build-types/view/component.d.ts.map +1 -1
  364. package/package.json +19 -19
  365. package/src/alignment-matrix-control/index.tsx +3 -1
  366. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
  367. package/src/alignment-matrix-control/utils.tsx +6 -2
  368. package/src/autocomplete/autocompleter-ui.tsx +3 -1
  369. package/src/autocomplete/index.tsx +21 -7
  370. package/src/autocomplete/style.scss +10 -4
  371. package/src/box-control/test/index.tsx +22 -0
  372. package/src/card/test/__snapshots__/index.tsx.snap +44 -47
  373. package/src/checkbox-control/index.tsx +44 -35
  374. package/src/checkbox-control/style.scss +12 -1
  375. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
  376. package/src/checkbox-control/test/index.tsx +5 -0
  377. package/src/color-picker/hex-input.tsx +3 -1
  378. package/src/color-picker/hue-picker.native.js +6 -2
  379. package/src/color-picker/index.native.js +9 -3
  380. package/src/color-picker/saturation-picker.native.js +6 -2
  381. package/src/color-picker/use-deprecated-props.ts +9 -3
  382. package/src/context/context-connect.ts +6 -2
  383. package/src/custom-select-control-v2/README.md +0 -4
  384. package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
  385. package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
  386. package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
  387. package/src/drop-zone/index.tsx +66 -66
  388. package/src/dropdown/styles.ts +3 -1
  389. package/src/duotone-picker/utils.ts +3 -1
  390. package/src/elevation/hook.ts +6 -3
  391. package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
  392. package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
  393. package/src/focal-point-picker/controls.tsx +3 -1
  394. package/src/focal-point-picker/index.tsx +20 -7
  395. package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
  396. package/src/focal-point-picker/tooltip/index.native.js +1 -7
  397. package/src/focal-point-picker/utils.ts +3 -1
  398. package/src/font-size-picker/README.md +1 -0
  399. package/src/font-size-picker/index.tsx +4 -2
  400. package/src/font-size-picker/stories/index.story.tsx +0 -1
  401. package/src/font-size-picker/types.ts +2 -0
  402. package/src/higher-order/navigate-regions/style.scss +3 -3
  403. package/src/input-control/input-field.tsx +3 -1
  404. package/src/input-control/label.tsx +3 -1
  405. package/src/input-control/stories/index.story.tsx +31 -1
  406. package/src/input-control/styles/input-control-styles.tsx +12 -4
  407. package/src/input-control/test/index.js +8 -4
  408. package/src/input-control/utils.ts +3 -2
  409. package/src/item-group/item/hook.ts +1 -10
  410. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  411. package/src/mobile/gradient/index.native.js +3 -1
  412. package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
  413. package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
  414. package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
  415. package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
  416. package/src/modal/aria-helper.ts +8 -3
  417. package/src/modal/index.tsx +6 -2
  418. package/src/modal/test/index.tsx +11 -4
  419. package/src/navigation/styles/navigation-styles.tsx +4 -3
  420. package/src/panel/body.tsx +3 -1
  421. package/src/panel/style.scss +1 -0
  422. package/src/placeholder/style.scss +12 -34
  423. package/src/popover/index.tsx +2 -1
  424. package/src/popover/overlay-middlewares.tsx +3 -1
  425. package/src/popover/stories/index.story.tsx +0 -2
  426. package/src/query-controls/author-select.tsx +3 -1
  427. package/src/range-control/rail.tsx +1 -1
  428. package/src/range-control/styles/range-control-styles.ts +5 -3
  429. package/src/resizable-box/resize-tooltip/index.tsx +3 -1
  430. package/src/resizable-box/resize-tooltip/label.tsx +3 -1
  431. package/src/resizable-box/resize-tooltip/utils.ts +12 -4
  432. package/src/select-control/index.tsx +3 -1
  433. package/src/select-control/styles/select-control-styles.ts +3 -1
  434. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
  435. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
  436. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  437. package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
  438. package/src/slot-fill/types.ts +2 -2
  439. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  440. package/src/text/get-line-height.ts +6 -2
  441. package/src/text/utils.ts +6 -2
  442. package/src/theme/color-algorithms.ts +6 -2
  443. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -24
  444. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
  445. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
  446. package/src/toolbar/toolbar/style.scss +2 -2
  447. package/src/tree-grid/roving-tab-index-item.tsx +3 -1
  448. package/src/unit-control/index.tsx +5 -1
  449. package/src/utils/colors.js +21 -7
  450. package/src/utils/font-size.ts +3 -1
  451. package/src/utils/get-valid-children.ts +3 -1
  452. package/src/utils/input/base.js +4 -3
  453. package/src/utils/strings.ts +11 -59
  454. package/src/utils/test/strings.js +62 -0
  455. package/src/utils/use-responsive-value.ts +2 -1
  456. package/src/view/component.tsx +18 -11
  457. package/tsconfig.json +1 -2
  458. package/tsconfig.tsbuildinfo +1 -1
  459. package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
  460. package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  461. package/build/view/types.js +0 -6
  462. package/build/view/types.js.map +0 -1
  463. package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
  464. package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  465. package/build-module/view/types.js +0 -2
  466. package/build-module/view/types.js.map +0 -1
  467. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
  468. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
  469. package/build-types/view/types.d.ts +0 -8
  470. package/build-types/view/types.d.ts.map +0 -1
  471. package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
  472. package/src/slot-fill/test/observable-map.js +0 -83
  473. package/src/utils/hooks/stories/use-cx.js +0 -157
  474. package/src/view/types.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","createElement","className","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","__experimentalIsFocusable","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\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{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\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\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"],"mappings":";AAAA;AACA;AACA;;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W;IACnBvD,qBAAqB;IACrBK,IAAI,EACHA,IAAI,KAAK,kBAAkB,IAC3BP,KAAK,CAACE,qBAAqB,GACxB,SAAS,GACT;EACH,GAEC3B,EAAE,CAAE,OAAQ,CACP,CACC,CAEN,CAEH,CACK,CAAC;AAEd,CAAC;AAED,OAAO,MAAMmF,cAAc,GAAG/E,UAAU,CAAEoB,yBAA0B,CAAC;AAErE,eAAe2D,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","DEFAULT_UNITS","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","createElement","className","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","__experimentalIsFocusable","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst DEFAULT_UNITS = [ 'px', 'em', 'rem' ];\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp = DEFAULT_UNITS,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp,\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\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{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\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\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAo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,GAEC5B,EAAE,CAAE,OAAQ,CACP,CACC,CAEN,CAEH,CACK,CAAC;AAEd,CAAC;AAED,OAAO,MAAMoF,cAAc,GAAGhF,UAAU,CAAEqB,yBAA0B,CAAC;AAErE,eAAe2D,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/font-size-picker/types.ts"],"sourcesContent":["export type FontSizePickerProps = {\n\t/**\n\t * If `true`, it will not be possible to choose a custom fontSize. The user\n\t * will be forced to pick one of the pre-defined sizes passed in fontSizes.\n\t *\n\t * @default false\n\t */\n\tdisableCustomFontSizes?: boolean;\n\t/**\n\t * If no value exists, this prop defines the starting position for the font\n\t * size picker slider. Only relevant if `withSlider` is `true`.\n\t */\n\tfallbackFontSize?: number;\n\t/**\n\t * An array of font size objects. The object should contain properties size,\n\t * name, and slug.\n\t */\n\tfontSizes?: FontSize[];\n\t/**\n\t * A function that receives the new font size value.\n\t * If onChange is called without any parameter, it should reset the value,\n\t * attending to what reset means in that context, e.g., set the font size to\n\t * undefined or set the font size a starting value.\n\t */\n\tonChange?: (\n\t\tvalue: number | string | undefined,\n\t\tselectedItem?: FontSize\n\t) => void;\n\t/**\n\t * Available units for custom font size selection.\n\t */\n\tunits?: string[];\n\t/**\n\t * The current font size value.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * If `true`, the UI will contain a slider, instead of a numeric text input\n\t * field. If `false`, no slider will be present.\n\t *\n\t * @default false\n\t */\n\twithSlider?: boolean;\n\t/**\n\t * If `true`, a reset button will be displayed alongside the input field\n\t * when a custom font size is active. Has no effect when\n\t * `disableCustomFontSizes` or `withSlider` is `true`.\n\t *\n\t * @default true\n\t */\n\twithReset?: boolean;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default\n\t * in a future version, currently scheduled to be WordPress 6.4. (The prop\n\t * can be safely removed once this happens.)\n\t *\n\t * @default false\n\t * @deprecated Default behavior since WP 6.5. Prop can be safely removed.\n\t * @ignore\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n};\n\nexport type FontSize = {\n\t/**\n\t * The property `size` contains a number with the font size value, in `px` or\n\t * a string specifying the font size CSS property that should be used eg:\n\t * \"13px\", \"1em\", or \"clamp(12px, 5vw, 100px)\".\n\t */\n\tsize: number | string;\n\t/**\n\t * The `name` property includes a label for that font size e.g.: `Small`.\n\t */\n\tname?: string;\n\t/**\n\t * The `slug` property is a string with a unique identifier for the font\n\t * size. Used for the class generation process.\n\t */\n\tslug: string;\n};\n\nexport type FontSizePickerSelectProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tdisableCustomFontSizes: NonNullable<\n\t\tFontSizePickerProps[ 'disableCustomFontSizes' ]\n\t>;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n\tonSelectCustom: () => void;\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type FontSizePickerSelectOption = {\n\tkey: string;\n\tname: string;\n\tvalue?: FontSize[ 'size' ];\n\t__experimentalHint?: string;\n};\n\nexport type FontSizePickerToggleGroupProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size' | '__next40pxDefaultSize'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/font-size-picker/types.ts"],"sourcesContent":["export type FontSizePickerProps = {\n\t/**\n\t * If `true`, it will not be possible to choose a custom fontSize. The user\n\t * will be forced to pick one of the pre-defined sizes passed in fontSizes.\n\t *\n\t * @default false\n\t */\n\tdisableCustomFontSizes?: boolean;\n\t/**\n\t * If no value exists, this prop defines the starting position for the font\n\t * size picker slider. Only relevant if `withSlider` is `true`.\n\t */\n\tfallbackFontSize?: number;\n\t/**\n\t * An array of font size objects. The object should contain properties size,\n\t * name, and slug.\n\t */\n\tfontSizes?: FontSize[];\n\t/**\n\t * A function that receives the new font size value.\n\t * If onChange is called without any parameter, it should reset the value,\n\t * attending to what reset means in that context, e.g., set the font size to\n\t * undefined or set the font size a starting value.\n\t */\n\tonChange?: (\n\t\tvalue: number | string | undefined,\n\t\tselectedItem?: FontSize\n\t) => void;\n\t/**\n\t * Available units for custom font size selection.\n\t *\n\t * @default `[ 'px', 'em', 'rem' ]`\n\t */\n\tunits?: string[];\n\t/**\n\t * The current font size value.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * If `true`, the UI will contain a slider, instead of a numeric text input\n\t * field. If `false`, no slider will be present.\n\t *\n\t * @default false\n\t */\n\twithSlider?: boolean;\n\t/**\n\t * If `true`, a reset button will be displayed alongside the input field\n\t * when a custom font size is active. Has no effect when\n\t * `disableCustomFontSizes` or `withSlider` is `true`.\n\t *\n\t * @default true\n\t */\n\twithReset?: boolean;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default\n\t * in a future version, currently scheduled to be WordPress 6.4. (The prop\n\t * can be safely removed once this happens.)\n\t *\n\t * @default false\n\t * @deprecated Default behavior since WP 6.5. Prop can be safely removed.\n\t * @ignore\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n};\n\nexport type FontSize = {\n\t/**\n\t * The property `size` contains a number with the font size value, in `px` or\n\t * a string specifying the font size CSS property that should be used eg:\n\t * \"13px\", \"1em\", or \"clamp(12px, 5vw, 100px)\".\n\t */\n\tsize: number | string;\n\t/**\n\t * The `name` property includes a label for that font size e.g.: `Small`.\n\t */\n\tname?: string;\n\t/**\n\t * The `slug` property is a string with a unique identifier for the font\n\t * size. Used for the class generation process.\n\t */\n\tslug: string;\n};\n\nexport type FontSizePickerSelectProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tdisableCustomFontSizes: NonNullable<\n\t\tFontSizePickerProps[ 'disableCustomFontSizes' ]\n\t>;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n\tonSelectCustom: () => void;\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type FontSizePickerSelectOption = {\n\tkey: string;\n\tname: string;\n\tvalue?: FontSize[ 'size' ];\n\t__experimentalHint?: string;\n};\n\nexport type FontSizePickerToggleGroupProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size' | '__next40pxDefaultSize'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n};\n"],"mappings":"","ignoreList":[]}
@@ -132,7 +132,9 @@ function InputField({
132
132
  ...dragProps.event,
133
133
  target
134
134
  };
135
- if (!distance) return;
135
+ if (!distance) {
136
+ return;
137
+ }
136
138
  event.stopPropagation();
137
139
 
138
140
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["useDrag","forwardRef","useRef","useDragCursor","Input","useInputControlStateReducer","withIgnoreIMEEvents","noop","InputField","disabled","dragDirection","dragThreshold","id","isDragEnabled","isPressEnterToChange","onBlur","onChange","onDrag","onDragEnd","onDragStart","onKeyDown","onValidate","size","stateReducer","state","value","valueProp","type","props","ref","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","isDragging","isDirty","wasDirtyOnBlur","dragCursor","handleOnBlur","event","target","validity","valid","current","handleOnCommit","handleOnChange","nextValue","currentTarget","err","handleOnKeyDown","key","preventDefault","dragGestureProps","dragProps","distance","dragging","stopPropagation","axis","threshold","enabled","pointer","capture","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","createElement","className","inputSize","ForwardedComponent"],"sources":["@wordpress/components/src/input-control/input-field.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useDrag } from '@use-gesture/react';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tForwardedRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport type { InputFieldProps } from './types';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst noop = () => {};\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t// State.\n\t\tstate,\n\t\t// Actions.\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t} = useInputControlStateReducer(\n\t\tstateReducer,\n\t\t{\n\t\t\tisDragEnabled,\n\t\t\tvalue: valueProp,\n\t\t\tisPressEnterToChange,\n\t\t},\n\t\tonChange\n\t);\n\n\tconst { value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isDirty || ! event.target.validity.valid ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\thandleOnCommit( event );\n\t\t}\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( key ) {\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'Escape':\n\t\t\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treset( valueProp, event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event, target } = dragProps;\n\n\t\t\t// The `target` prop always references the `input` element while, by\n\t\t\t// default, the `dragProps.event.target` property would reference the real\n\t\t\t// event target (i.e. any DOM element that the pointer is hovering while\n\t\t\t// dragging). Ensuring that the `target` is always the `input` element\n\t\t\t// allows consumers of `InputControl` (or any higher-level control) to\n\t\t\t// check the input's validity by accessing `event.target.validity.valid`.\n\t\t\tdragProps.event = {\n\t\t\t\t...dragProps.event,\n\t\t\t\ttarget,\n\t\t\t};\n\n\t\t\tif ( ! distance ) return;\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\taxis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t\tpointer: { capture: false },\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( handleOnKeyDown ) }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\t// Fallback to `''` to avoid \"uncontrolled to controlled\" warning.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/47250 for details.\n\t\t\tvalue={ value ?? '' }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAW5C;AACA;AACA;AACA,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD;AACA;AACA;;AAEA,SAASC,aAAa,QAAQ,SAAS;AACvC,SAASC,KAAK,QAAQ,+BAA+B;AACrD,SAASC,2BAA2B,QAAQ,mBAAmB;AAE/D,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,UAAUA,CAClB;EACCC,QAAQ,GAAG,KAAK;EAChBC,aAAa,GAAG,GAAG;EACnBC,aAAa,GAAG,EAAE;EAClBC,EAAE;EACFC,aAAa,GAAG,KAAK;EACrBC,oBAAoB,GAAG,KAAK;EAC5BC,MAAM,GAAGR,IAAI;EACbS,QAAQ,GAAGT,IAAI;EACfU,MAAM,GAAGV,IAAI;EACbW,SAAS,GAAGX,IAAI;EAChBY,WAAW,GAAGZ,IAAI;EAClBa,SAAS,GAAGb,IAAI;EAChBc,UAAU,GAAGd,IAAI;EACjBe,IAAI,GAAG,SAAS;EAChBC,YAAY,GAAKC,KAAU,IAAM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,UAAW,CAAC;AAEnD,eAAeoE,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["useDrag","forwardRef","useRef","useDragCursor","Input","useInputControlStateReducer","withIgnoreIMEEvents","noop","InputField","disabled","dragDirection","dragThreshold","id","isDragEnabled","isPressEnterToChange","onBlur","onChange","onDrag","onDragEnd","onDragStart","onKeyDown","onValidate","size","stateReducer","state","value","valueProp","type","props","ref","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","isDragging","isDirty","wasDirtyOnBlur","dragCursor","handleOnBlur","event","target","validity","valid","current","handleOnCommit","handleOnChange","nextValue","currentTarget","err","handleOnKeyDown","key","preventDefault","dragGestureProps","dragProps","distance","dragging","stopPropagation","axis","threshold","enabled","pointer","capture","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","createElement","className","inputSize","ForwardedComponent"],"sources":["@wordpress/components/src/input-control/input-field.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useDrag } from '@use-gesture/react';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tForwardedRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport type { InputFieldProps } from './types';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst noop = () => {};\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t// State.\n\t\tstate,\n\t\t// Actions.\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t} = useInputControlStateReducer(\n\t\tstateReducer,\n\t\t{\n\t\t\tisDragEnabled,\n\t\t\tvalue: valueProp,\n\t\t\tisPressEnterToChange,\n\t\t},\n\t\tonChange\n\t);\n\n\tconst { value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isDirty || ! event.target.validity.valid ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\thandleOnCommit( event );\n\t\t}\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( key ) {\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'Escape':\n\t\t\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treset( valueProp, event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event, target } = dragProps;\n\n\t\t\t// The `target` prop always references the `input` element while, by\n\t\t\t// default, the `dragProps.event.target` property would reference the real\n\t\t\t// event target (i.e. any DOM element that the pointer is hovering while\n\t\t\t// dragging). Ensuring that the `target` is always the `input` element\n\t\t\t// allows consumers of `InputControl` (or any higher-level control) to\n\t\t\t// check the input's validity by accessing `event.target.validity.valid`.\n\t\t\tdragProps.event = {\n\t\t\t\t...dragProps.event,\n\t\t\t\ttarget,\n\t\t\t};\n\n\t\t\tif ( ! distance ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\taxis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t\tpointer: { capture: false },\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( handleOnKeyDown ) }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\t// Fallback to `''` to avoid \"uncontrolled to controlled\" warning.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/47250 for details.\n\t\t\tvalue={ value ?? '' }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAW5C;AACA;AACA;AACA,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD;AACA;AACA;;AAEA,SAASC,aAAa,QAAQ,SAAS;AACvC,SAASC,KAAK,QAAQ,+BAA+B;AACrD,SAASC,2BAA2B,QAAQ,mBAAmB;AAE/D,SAASC,mBAAmB,QA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EAAC,iCAAiC;IAC3CjE,QAAQ,EAAGA,QAAU;IACrBkC,UAAU,EAAGA,UAAY;IACzBH,UAAU,EAAGA,UAAY;IACzB5B,EAAE,EAAGA,EAAI;IACTG,MAAM,EAAG6B,YAAc;IACvB5B,QAAQ,EAAGmC,cAAgB;IAC3B/B,SAAS,EAAGd,mBAAmB,CAAEiD,eAAgB,CAAG;IACpDc,WAAW,EAAGD,iBAAmB;IACjCvC,GAAG,EAAGA,GAAK;IACX8C,SAAS,EAAGrD;IACZ;IACA;IAAA;IACAG,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAI;IACrBE,IAAI,EAAGA;EAAM,CACb,CAAC;AAEJ;AAEA,MAAMiD,kBAAkB,GAAG3E,UAAU,CAAEO,UAAW,CAAC;AAEnD,eAAeoE,kBAAkB","ignoreList":[]}
@@ -10,7 +10,9 @@ export default function Label({
10
10
  htmlFor,
11
11
  ...props
12
12
  }) {
13
- if (!children) return null;
13
+ if (!children) {
14
+ return null;
15
+ }
14
16
  if (hideLabelFromVision) {
15
17
  return createElement(VisuallyHidden, {
16
18
  as: "label",
@@ -1 +1 @@
1
- {"version":3,"names":["VisuallyHidden","Label","BaseLabel","LabelWrapper","children","hideLabelFromVision","htmlFor","props","createElement","as"],"sources":["@wordpress/components/src/input-control/label.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport {\n\tLabel as BaseLabel,\n\tLabelWrapper,\n} from './styles/input-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport type { InputControlLabelProps } from './types';\n\nexport default function Label( {\n\tchildren,\n\thideLabelFromVision,\n\thtmlFor,\n\t...props\n}: WordPressComponentProps< InputControlLabelProps, 'label', false > ) {\n\tif ( ! children ) return null;\n\n\tif ( hideLabelFromVision ) {\n\t\treturn (\n\t\t\t<VisuallyHidden as=\"label\" htmlFor={ htmlFor }>\n\t\t\t\t{ children }\n\t\t\t</VisuallyHidden>\n\t\t);\n\t}\n\n\treturn (\n\t\t<LabelWrapper>\n\t\t\t<BaseLabel htmlFor={ htmlFor } { ...props }>\n\t\t\t\t{ children }\n\t\t\t</BaseLabel>\n\t\t</LabelWrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SACCC,KAAK,IAAIC,SAAS,EAClBC,YAAY,QACN,+BAA+B;AAItC,eAAe,SAASF,KAAKA,CAAE;EAC9BG,QAAQ;EACRC,mBAAmB;EACnBC,OAAO;EACP,GAAGC;AAC+D,CAAC,EAAG;EACtE,IAAK,CAAEH,QAAQ,EAAG,OAAO,IAAI;EAE7B,IAAKC,mBAAmB,EAAG;IAC1B,OACCG,aAAA,CAACR,cAAc;MAACS,EAAE,EAAC,OAAO;MAACH,OAAO,EAAGA;IAAS,GAC3CF,QACa,CAAC;EAEnB;EAEA,OACCI,aAAA,CAACL,YAAY,QACZK,aAAA,CAACN,SAAS;IAACI,OAAO,EAAGA,OAAS;IAAA,GAAMC;EAAK,GACtCH,QACQ,CACE,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["VisuallyHidden","Label","BaseLabel","LabelWrapper","children","hideLabelFromVision","htmlFor","props","createElement","as"],"sources":["@wordpress/components/src/input-control/label.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport {\n\tLabel as BaseLabel,\n\tLabelWrapper,\n} from './styles/input-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport type { InputControlLabelProps } from './types';\n\nexport default function Label( {\n\tchildren,\n\thideLabelFromVision,\n\thtmlFor,\n\t...props\n}: WordPressComponentProps< InputControlLabelProps, 'label', false > ) {\n\tif ( ! children ) {\n\t\treturn null;\n\t}\n\n\tif ( hideLabelFromVision ) {\n\t\treturn (\n\t\t\t<VisuallyHidden as=\"label\" htmlFor={ htmlFor }>\n\t\t\t\t{ children }\n\t\t\t</VisuallyHidden>\n\t\t);\n\t}\n\n\treturn (\n\t\t<LabelWrapper>\n\t\t\t<BaseLabel htmlFor={ htmlFor } { ...props }>\n\t\t\t\t{ children }\n\t\t\t</BaseLabel>\n\t\t</LabelWrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SACCC,KAAK,IAAIC,SAAS,EAClBC,YAAY,QACN,+BAA+B;AAItC,eAAe,SAASF,KAAKA,CAAE;EAC9BG,QAAQ;EACRC,mBAAmB;EACnBC,OAAO;EACP,GAAGC;AAC+D,CAAC,EAAG;EACtE,IAAK,CAAEH,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,IAAKC,mBAAmB,EAAG;IAC1B,OACCG,aAAA,CAACR,cAAc;MAACS,EAAE,EAAC,OAAO;MAACH,OAAO,EAAGA;IAAS,GAC3CF,QACa,CAAC;EAEnB;EAEA,OACCI,aAAA,CAACL,YAAY,QACZK,aAAA,CAACN,SAAS;IAACI,OAAO,EAAGA,OAAS;IAAA,GAAMC;EAAK,GACtCH,QACQ,CACE,CAAC;AAEjB","ignoreList":[]}