@wordpress/components 19.12.0 → 19.15.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 (1409) hide show
  1. package/CHANGELOG.md +116 -3
  2. package/CONTRIBUTING.md +94 -12
  3. package/build/alignment-matrix-control/index.js +3 -3
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/alignment-matrix-control/utils.js +1 -7
  6. package/build/alignment-matrix-control/utils.js.map +1 -1
  7. package/build/angle-picker-control/index.js +2 -2
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/autocomplete/autocompleter-ui.js +4 -2
  10. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  11. package/build/autocomplete/autocompleter-ui.native.js +9 -3
  12. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  13. package/build/autocomplete/get-default-use-items.js +5 -1
  14. package/build/autocomplete/get-default-use-items.js.map +1 -1
  15. package/build/autocomplete/index.js +9 -3
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/border-box-control/border-box-control/component.js +2 -1
  18. package/build/border-box-control/border-box-control/component.js.map +1 -1
  19. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  20. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  21. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  22. package/build/border-box-control/utils.js.map +1 -1
  23. package/build/border-control/border-control/component.js +40 -4
  24. package/build/border-control/border-control/component.js.map +1 -1
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/box-control/all-input-control.js +6 -10
  27. package/build/box-control/all-input-control.js.map +1 -1
  28. package/build/box-control/axial-input-controls.js.map +1 -1
  29. package/build/box-control/index.js +4 -8
  30. package/build/box-control/index.js.map +1 -1
  31. package/build/box-control/input-controls.js +6 -10
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/box-control/unit-control.js +4 -4
  34. package/build/box-control/unit-control.js.map +1 -1
  35. package/build/box-control/utils.js +3 -3
  36. package/build/box-control/utils.js.map +1 -1
  37. package/build/button/index.native.js +1 -3
  38. package/build/button/index.native.js.map +1 -1
  39. package/build/checkbox-control/index.js.map +1 -1
  40. package/build/color-indicator/index.js +27 -10
  41. package/build/color-indicator/index.js.map +1 -1
  42. package/build/color-indicator/types.js +6 -0
  43. package/build/color-indicator/types.js.map +1 -0
  44. package/build/color-palette/index.js +2 -1
  45. package/build/color-palette/index.js.map +1 -1
  46. package/build/color-picker/component.js +6 -9
  47. package/build/color-picker/component.js.map +1 -1
  48. package/build/color-picker/hex-input.js +5 -4
  49. package/build/color-picker/hex-input.js.map +1 -1
  50. package/build/color-picker/index.native.js +35 -34
  51. package/build/color-picker/index.native.js.map +1 -1
  52. package/build/color-picker/input-with-slider.js +4 -3
  53. package/build/color-picker/input-with-slider.js.map +1 -1
  54. package/build/color-picker/styles.js +42 -36
  55. package/build/color-picker/styles.js.map +1 -1
  56. package/build/color-picker/use-deprecated-props.js +22 -31
  57. package/build/color-picker/use-deprecated-props.js.map +1 -1
  58. package/build/combobox-control/index.js +18 -8
  59. package/build/combobox-control/index.js.map +1 -1
  60. package/build/combobox-control/styles.js +39 -0
  61. package/build/combobox-control/styles.js.map +1 -0
  62. package/build/confirm-dialog/component.js.map +1 -1
  63. package/build/custom-gradient-bar/constants.js +1 -3
  64. package/build/custom-gradient-bar/constants.js.map +1 -1
  65. package/build/custom-gradient-bar/control-points.js +15 -8
  66. package/build/custom-gradient-bar/control-points.js.map +1 -1
  67. package/build/custom-gradient-bar/index.js +5 -5
  68. package/build/custom-gradient-bar/index.js.map +1 -1
  69. package/build/custom-gradient-bar/utils.js +5 -7
  70. package/build/custom-gradient-bar/utils.js.map +1 -1
  71. package/build/custom-gradient-picker/index.js +8 -8
  72. package/build/custom-gradient-picker/index.js.map +1 -1
  73. package/build/custom-gradient-picker/index.native.js +8 -9
  74. package/build/custom-gradient-picker/index.native.js.map +1 -1
  75. package/build/custom-gradient-picker/serializer.js +4 -7
  76. package/build/custom-gradient-picker/serializer.js.map +1 -1
  77. package/build/custom-gradient-picker/utils.js.map +1 -1
  78. package/build/custom-select-control/index.js.map +1 -1
  79. package/build/date-time/date/index.js +7 -5
  80. package/build/date-time/date/index.js.map +1 -1
  81. package/build/date-time/date-time/index.js +6 -4
  82. package/build/date-time/date-time/index.js.map +1 -1
  83. package/build/dimension-control/index.js +1 -3
  84. package/build/dimension-control/index.js.map +1 -1
  85. package/build/divider/styles.js +5 -5
  86. package/build/divider/styles.js.map +1 -1
  87. package/build/draggable/index.js.map +1 -1
  88. package/build/draggable/index.native.js +6 -1
  89. package/build/draggable/index.native.js.map +1 -1
  90. package/build/drop-zone/provider.js.map +1 -1
  91. package/build/dropdown/index.js +2 -2
  92. package/build/dropdown/index.js.map +1 -1
  93. package/build/dropdown-menu/index.js +16 -5
  94. package/build/dropdown-menu/index.js.map +1 -1
  95. package/build/dropdown-menu/index.native.js +17 -6
  96. package/build/dropdown-menu/index.native.js.map +1 -1
  97. package/build/duotone-picker/duotone-picker.js +42 -29
  98. package/build/duotone-picker/duotone-picker.js.map +1 -1
  99. package/build/elevation/hook.js +14 -14
  100. package/build/elevation/hook.js.map +1 -1
  101. package/build/external-link/index.js +20 -10
  102. package/build/external-link/index.js.map +1 -1
  103. package/build/external-link/styles/external-link-styles.js +3 -3
  104. package/build/external-link/styles/external-link-styles.js.map +1 -1
  105. package/build/external-link/types.js +6 -0
  106. package/build/external-link/types.js.map +1 -0
  107. package/build/flex/flex/hook.js +9 -5
  108. package/build/flex/flex/hook.js.map +1 -1
  109. package/build/focal-point-picker/controls.js +3 -7
  110. package/build/focal-point-picker/controls.js.map +1 -1
  111. package/build/focal-point-picker/grid.js +2 -7
  112. package/build/focal-point-picker/grid.js.map +1 -1
  113. package/build/focal-point-picker/index.js.map +1 -1
  114. package/build/focal-point-picker/index.native.js +12 -12
  115. package/build/focal-point-picker/index.native.js.map +1 -1
  116. package/build/focal-point-picker/media.js +4 -8
  117. package/build/focal-point-picker/media.js.map +1 -1
  118. package/build/focal-point-picker/tooltip/index.native.js +11 -12
  119. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  120. package/build/font-size-picker/index.js +1 -1
  121. package/build/font-size-picker/index.js.map +1 -1
  122. package/build/form-toggle/index.js +34 -9
  123. package/build/form-toggle/index.js.map +1 -1
  124. package/build/form-toggle/types.js +6 -0
  125. package/build/form-toggle/types.js.map +1 -0
  126. package/build/form-token-field/index.js +344 -360
  127. package/build/form-token-field/index.js.map +1 -1
  128. package/build/form-token-field/styles.js +40 -0
  129. package/build/form-token-field/styles.js.map +1 -0
  130. package/build/form-token-field/suggestions-list.js +22 -21
  131. package/build/form-token-field/suggestions-list.js.map +1 -1
  132. package/build/form-token-field/token-input.js +39 -53
  133. package/build/form-token-field/token-input.js.map +1 -1
  134. package/build/form-token-field/token.js +3 -3
  135. package/build/form-token-field/token.js.map +1 -1
  136. package/build/form-token-field/types.js +6 -0
  137. package/build/form-token-field/types.js.map +1 -0
  138. package/build/gradient-picker/index.js.map +1 -1
  139. package/build/grid/component.js +7 -8
  140. package/build/grid/component.js.map +1 -1
  141. package/build/grid/hook.js +1 -5
  142. package/build/grid/hook.js.map +1 -1
  143. package/build/grid/index.js.map +1 -1
  144. package/build/grid/utils.js +4 -7
  145. package/build/grid/utils.js.map +1 -1
  146. package/build/h-stack/component.js +5 -9
  147. package/build/h-stack/component.js.map +1 -1
  148. package/build/h-stack/hook.js +8 -10
  149. package/build/h-stack/hook.js.map +1 -1
  150. package/build/h-stack/index.js.map +1 -1
  151. package/build/h-stack/utils.js +8 -19
  152. package/build/h-stack/utils.js.map +1 -1
  153. package/build/heading/component.js +0 -1
  154. package/build/heading/component.js.map +1 -1
  155. package/build/heading/hook.js.map +1 -1
  156. package/build/heading/types.js +6 -0
  157. package/build/heading/types.js.map +1 -0
  158. package/build/higher-order/navigate-regions/index.js.map +1 -1
  159. package/build/higher-order/with-focus-return/index.js.map +1 -1
  160. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  161. package/build/icon/index.js.map +1 -1
  162. package/build/input-control/index.js +5 -5
  163. package/build/input-control/index.js.map +1 -1
  164. package/build/input-control/input-field.js +10 -10
  165. package/build/input-control/input-field.js.map +1 -1
  166. package/build/input-control/reducer/reducer.js.map +1 -1
  167. package/build/input-control/utils.js +1 -1
  168. package/build/input-control/utils.js.map +1 -1
  169. package/build/menu-item/index.js +1 -3
  170. package/build/menu-item/index.js.map +1 -1
  171. package/build/menu-items-choice/index.js +3 -7
  172. package/build/menu-items-choice/index.js.map +1 -1
  173. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  174. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  175. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
  176. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  177. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  178. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  179. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  180. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  181. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  182. package/build/mobile/color-settings/index.native.js.map +1 -1
  183. package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
  184. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  185. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  186. package/build/mobile/gradient/index.native.js.map +1 -1
  187. package/build/mobile/html-text-input/index.native.js.map +1 -1
  188. package/build/mobile/image/index.native.js +4 -2
  189. package/build/mobile/image/index.native.js.map +1 -1
  190. package/build/mobile/inserter-button/index.native.js.map +1 -1
  191. package/build/mobile/link-picker/index.native.js +4 -4
  192. package/build/mobile/link-picker/index.native.js.map +1 -1
  193. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  194. package/build/mobile/media-edit/index.native.js.map +1 -1
  195. package/build/mobile/segmented-control/index.native.js +3 -5
  196. package/build/mobile/segmented-control/index.native.js.map +1 -1
  197. package/build/modal/index.js +18 -4
  198. package/build/modal/index.js.map +1 -1
  199. package/build/navigable-container/container.js +4 -2
  200. package/build/navigable-container/container.js.map +1 -1
  201. package/build/navigation/context.js +12 -16
  202. package/build/navigation/context.js.map +1 -1
  203. package/build/navigation/group/index.js +4 -7
  204. package/build/navigation/group/index.js.map +1 -1
  205. package/build/navigation/index.js +7 -4
  206. package/build/navigation/index.js.map +1 -1
  207. package/build/navigation/item/base.js +6 -3
  208. package/build/navigation/item/base.js.map +1 -1
  209. package/build/navigation/item/index.js +3 -3
  210. package/build/navigation/item/index.js.map +1 -1
  211. package/build/navigation/item/use-navigation-tree-item.js +2 -1
  212. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  213. package/build/navigation/menu/menu-title-search.js +1 -7
  214. package/build/navigation/menu/menu-title-search.js.map +1 -1
  215. package/build/navigation/menu/search-no-results-found.js +1 -7
  216. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  217. package/build/navigation/use-navigation-tree-nodes.js +18 -10
  218. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  219. package/build/navigation/utils.js +4 -2
  220. package/build/navigation/utils.js.map +1 -1
  221. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  222. package/build/navigator/navigator-button/hook.js.map +1 -1
  223. package/build/navigator/navigator-provider/component.js +1 -1
  224. package/build/navigator/navigator-provider/component.js.map +1 -1
  225. package/build/navigator/navigator-screen/component.js +1 -1
  226. package/build/navigator/navigator-screen/component.js.map +1 -1
  227. package/build/notice/index.js +5 -5
  228. package/build/notice/index.js.map +1 -1
  229. package/build/notice/list.js +4 -2
  230. package/build/notice/list.js.map +1 -1
  231. package/build/panel/body.js +3 -3
  232. package/build/panel/body.js.map +1 -1
  233. package/build/placeholder/index.js +26 -12
  234. package/build/placeholder/index.js.map +1 -1
  235. package/build/popover/index.js +4 -4
  236. package/build/popover/index.js.map +1 -1
  237. package/build/radio-control/index.js +43 -7
  238. package/build/radio-control/index.js.map +1 -1
  239. package/build/radio-control/types.js +6 -0
  240. package/build/radio-control/types.js.map +1 -0
  241. package/build/range-control/index.js +63 -47
  242. package/build/range-control/index.js.map +1 -1
  243. package/build/range-control/input-range.js +11 -17
  244. package/build/range-control/input-range.js.map +1 -1
  245. package/build/range-control/mark.js +5 -7
  246. package/build/range-control/mark.js.map +1 -1
  247. package/build/range-control/rail.js +10 -16
  248. package/build/range-control/rail.js.map +1 -1
  249. package/build/range-control/styles/range-control-styles.js +62 -62
  250. package/build/range-control/styles/range-control-styles.js.map +1 -1
  251. package/build/range-control/tooltip.js +5 -7
  252. package/build/range-control/tooltip.js.map +1 -1
  253. package/build/range-control/types.js +6 -0
  254. package/build/range-control/types.js.map +1 -0
  255. package/build/range-control/utils.js +27 -36
  256. package/build/range-control/utils.js.map +1 -1
  257. package/build/resizable-box/resize-tooltip/index.js +3 -3
  258. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  259. package/build/resizable-box/resize-tooltip/utils.js +5 -13
  260. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  261. package/build/responsive-wrapper/index.js.map +1 -1
  262. package/build/scrollable/component.js +7 -8
  263. package/build/scrollable/component.js.map +1 -1
  264. package/build/scrollable/hook.js +0 -8
  265. package/build/scrollable/hook.js.map +1 -1
  266. package/build/scrollable/index.js.map +1 -1
  267. package/build/scrollable/styles.js +7 -7
  268. package/build/scrollable/styles.js.map +1 -1
  269. package/build/select-control/index.js +5 -3
  270. package/build/select-control/index.js.map +1 -1
  271. package/build/shortcut/index.js +2 -8
  272. package/build/shortcut/index.js.map +1 -1
  273. package/build/slot-fill/fill.js +1 -7
  274. package/build/slot-fill/fill.js.map +1 -1
  275. package/build/slot-fill/index.native.js +6 -8
  276. package/build/slot-fill/index.native.js.map +1 -1
  277. package/build/slot-fill/provider.js +4 -8
  278. package/build/slot-fill/provider.js.map +1 -1
  279. package/build/slot-fill/slot.js +17 -10
  280. package/build/slot-fill/slot.js.map +1 -1
  281. package/build/snackbar/index.js +7 -7
  282. package/build/snackbar/index.js.map +1 -1
  283. package/build/snackbar/list.js +3 -1
  284. package/build/snackbar/list.js.map +1 -1
  285. package/build/spacer/component.js +5 -5
  286. package/build/spacer/component.js.map +1 -1
  287. package/build/spacer/hook.js +2 -2
  288. package/build/spacer/hook.js.map +1 -1
  289. package/build/spacer/index.js.map +1 -1
  290. package/build/spinner/index.js +26 -13
  291. package/build/spinner/index.js.map +1 -1
  292. package/build/spinner/styles.js +10 -10
  293. package/build/spinner/styles.js.map +1 -1
  294. package/build/tab-panel/index.js +3 -1
  295. package/build/tab-panel/index.js.map +1 -1
  296. package/build/text/hook.js +4 -4
  297. package/build/text/hook.js.map +1 -1
  298. package/build/text/utils.js.map +1 -1
  299. package/build/text-highlight/index.js +22 -5
  300. package/build/text-highlight/index.js.map +1 -1
  301. package/build/text-highlight/types.js +6 -0
  302. package/build/text-highlight/types.js.map +1 -0
  303. package/build/tip/index.js +5 -11
  304. package/build/tip/index.js.map +1 -1
  305. package/build/tip/types.js +6 -0
  306. package/build/tip/types.js.map +1 -0
  307. package/build/toggle-control/index.js +1 -3
  308. package/build/toggle-control/index.js.map +1 -1
  309. package/build/toggle-control/index.native.js +1 -7
  310. package/build/toggle-control/index.native.js.map +1 -1
  311. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  312. package/build/toolbar/index.js.map +1 -1
  313. package/build/toolbar-group/index.js +3 -3
  314. package/build/toolbar-group/index.js.map +1 -1
  315. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  316. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  317. package/build/tooltip/index.js +2 -1
  318. package/build/tooltip/index.js.map +1 -1
  319. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  320. package/build/tree-select/index.js +59 -6
  321. package/build/tree-select/index.js.map +1 -1
  322. package/build/tree-select/types.js +6 -0
  323. package/build/tree-select/types.js.map +1 -0
  324. package/build/truncate/component.js +7 -8
  325. package/build/truncate/component.js.map +1 -1
  326. package/build/truncate/hook.js +3 -10
  327. package/build/truncate/hook.js.map +1 -1
  328. package/build/truncate/index.js.map +1 -1
  329. package/build/truncate/styles.js +1 -1
  330. package/build/truncate/styles.js.map +1 -1
  331. package/build/truncate/utils.js +3 -16
  332. package/build/truncate/utils.js.map +1 -1
  333. package/build/ui/form-group/form-group-content.js.map +1 -1
  334. package/build/ui/utils/get-valid-children.js.map +1 -1
  335. package/build/unit-control/index.js.map +1 -1
  336. package/build/utils/math.js +17 -7
  337. package/build/utils/math.js.map +1 -1
  338. package/build/utils/unit-values.js.map +1 -1
  339. package/build/utils/values.js.map +1 -1
  340. package/build/v-stack/component.js +9 -9
  341. package/build/v-stack/component.js.map +1 -1
  342. package/build/v-stack/hook.js +0 -5
  343. package/build/v-stack/hook.js.map +1 -1
  344. package/build/v-stack/index.js.map +1 -1
  345. package/build/visually-hidden/component.js +12 -13
  346. package/build/visually-hidden/component.js.map +1 -1
  347. package/build/visually-hidden/index.js.map +1 -1
  348. package/build/visually-hidden/styles.js +3 -1
  349. package/build/visually-hidden/styles.js.map +1 -1
  350. package/build/visually-hidden/types.js +6 -0
  351. package/build/visually-hidden/types.js.map +1 -0
  352. package/build/z-stack/component.js +22 -3
  353. package/build/z-stack/component.js.map +1 -1
  354. package/build/z-stack/types.js +6 -0
  355. package/build/z-stack/types.js.map +1 -0
  356. package/build-module/alignment-matrix-control/index.js +2 -1
  357. package/build-module/alignment-matrix-control/index.js.map +1 -1
  358. package/build-module/alignment-matrix-control/utils.js +1 -6
  359. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  360. package/build-module/angle-picker-control/index.js +1 -1
  361. package/build-module/angle-picker-control/index.js.map +1 -1
  362. package/build-module/autocomplete/autocompleter-ui.js +4 -2
  363. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  364. package/build-module/autocomplete/autocompleter-ui.native.js +9 -3
  365. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  366. package/build-module/autocomplete/get-default-use-items.js +3 -2
  367. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  368. package/build-module/autocomplete/index.js +7 -4
  369. package/build-module/autocomplete/index.js.map +1 -1
  370. package/build-module/border-box-control/border-box-control/component.js +2 -1
  371. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  372. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  373. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  374. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  375. package/build-module/border-box-control/utils.js.map +1 -1
  376. package/build-module/border-control/border-control/component.js +38 -3
  377. package/build-module/border-control/border-control/component.js.map +1 -1
  378. package/build-module/border-control/border-control/hook.js.map +1 -1
  379. package/build-module/box-control/all-input-control.js +3 -5
  380. package/build-module/box-control/all-input-control.js.map +1 -1
  381. package/build-module/box-control/axial-input-controls.js.map +1 -1
  382. package/build-module/box-control/index.js +3 -6
  383. package/build-module/box-control/index.js.map +1 -1
  384. package/build-module/box-control/input-controls.js +3 -5
  385. package/build-module/box-control/input-controls.js.map +1 -1
  386. package/build-module/box-control/unit-control.js +3 -1
  387. package/build-module/box-control/unit-control.js.map +1 -1
  388. package/build-module/box-control/utils.js +4 -4
  389. package/build-module/box-control/utils.js.map +1 -1
  390. package/build-module/button/index.native.js +1 -2
  391. package/build-module/button/index.native.js.map +1 -1
  392. package/build-module/checkbox-control/index.js.map +1 -1
  393. package/build-module/color-indicator/index.js +29 -8
  394. package/build-module/color-indicator/index.js.map +1 -1
  395. package/build-module/color-indicator/types.js +2 -0
  396. package/build-module/color-indicator/types.js.map +1 -0
  397. package/build-module/color-palette/index.js +2 -1
  398. package/build-module/color-palette/index.js.map +1 -1
  399. package/build-module/color-picker/component.js +7 -8
  400. package/build-module/color-picker/component.js.map +1 -1
  401. package/build-module/color-picker/hex-input.js +4 -3
  402. package/build-module/color-picker/hex-input.js.map +1 -1
  403. package/build-module/color-picker/index.native.js +36 -35
  404. package/build-module/color-picker/index.native.js.map +1 -1
  405. package/build-module/color-picker/input-with-slider.js +4 -3
  406. package/build-module/color-picker/input-with-slider.js.map +1 -1
  407. package/build-module/color-picker/styles.js +28 -31
  408. package/build-module/color-picker/styles.js.map +1 -1
  409. package/build-module/color-picker/use-deprecated-props.js +22 -31
  410. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  411. package/build-module/combobox-control/index.js +18 -8
  412. package/build-module/combobox-control/index.js.map +1 -1
  413. package/build-module/combobox-control/styles.js +27 -0
  414. package/build-module/combobox-control/styles.js.map +1 -0
  415. package/build-module/confirm-dialog/component.js.map +1 -1
  416. package/build-module/custom-gradient-bar/constants.js +0 -1
  417. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  418. package/build-module/custom-gradient-bar/control-points.js +16 -9
  419. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  420. package/build-module/custom-gradient-bar/index.js +6 -6
  421. package/build-module/custom-gradient-bar/index.js.map +1 -1
  422. package/build-module/custom-gradient-bar/utils.js +6 -8
  423. package/build-module/custom-gradient-bar/utils.js.map +1 -1
  424. package/build-module/custom-gradient-picker/index.js +8 -7
  425. package/build-module/custom-gradient-picker/index.js.map +1 -1
  426. package/build-module/custom-gradient-picker/index.native.js +8 -8
  427. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  428. package/build-module/custom-gradient-picker/serializer.js +4 -6
  429. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  430. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  431. package/build-module/custom-select-control/index.js.map +1 -1
  432. package/build-module/date-time/date/index.js +7 -4
  433. package/build-module/date-time/date/index.js.map +1 -1
  434. package/build-module/date-time/date-time/index.js +5 -2
  435. package/build-module/date-time/date-time/index.js.map +1 -1
  436. package/build-module/dimension-control/index.js +1 -2
  437. package/build-module/dimension-control/index.js.map +1 -1
  438. package/build-module/divider/styles.js +5 -5
  439. package/build-module/divider/styles.js.map +1 -1
  440. package/build-module/draggable/index.js.map +1 -1
  441. package/build-module/draggable/index.native.js +6 -1
  442. package/build-module/draggable/index.native.js.map +1 -1
  443. package/build-module/drop-zone/provider.js.map +1 -1
  444. package/build-module/dropdown/index.js +2 -2
  445. package/build-module/dropdown/index.js.map +1 -1
  446. package/build-module/dropdown-menu/index.js +16 -4
  447. package/build-module/dropdown-menu/index.js.map +1 -1
  448. package/build-module/dropdown-menu/index.native.js +16 -4
  449. package/build-module/dropdown-menu/index.native.js.map +1 -1
  450. package/build-module/duotone-picker/duotone-picker.js +42 -29
  451. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  452. package/build-module/elevation/hook.js +13 -13
  453. package/build-module/elevation/hook.js.map +1 -1
  454. package/build-module/external-link/index.js +22 -8
  455. package/build-module/external-link/index.js.map +1 -1
  456. package/build-module/external-link/styles/external-link-styles.js +3 -3
  457. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  458. package/build-module/external-link/types.js +2 -0
  459. package/build-module/external-link/types.js.map +1 -0
  460. package/build-module/flex/flex/hook.js +7 -5
  461. package/build-module/flex/flex/hook.js.map +1 -1
  462. package/build-module/focal-point-picker/controls.js +3 -5
  463. package/build-module/focal-point-picker/controls.js.map +1 -1
  464. package/build-module/focal-point-picker/grid.js +2 -6
  465. package/build-module/focal-point-picker/grid.js.map +1 -1
  466. package/build-module/focal-point-picker/index.js.map +1 -1
  467. package/build-module/focal-point-picker/index.native.js +9 -9
  468. package/build-module/focal-point-picker/index.native.js.map +1 -1
  469. package/build-module/focal-point-picker/media.js +3 -5
  470. package/build-module/focal-point-picker/media.js.map +1 -1
  471. package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
  472. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  473. package/build-module/font-size-picker/index.js +1 -1
  474. package/build-module/font-size-picker/index.js.map +1 -1
  475. package/build-module/form-toggle/index.js +31 -7
  476. package/build-module/form-toggle/index.js.map +1 -1
  477. package/build-module/form-toggle/types.js +2 -0
  478. package/build-module/form-toggle/types.js.map +1 -0
  479. package/build-module/form-token-field/index.js +345 -363
  480. package/build-module/form-token-field/index.js.map +1 -1
  481. package/build-module/form-token-field/styles.js +28 -0
  482. package/build-module/form-token-field/styles.js.map +1 -0
  483. package/build-module/form-token-field/suggestions-list.js +27 -23
  484. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  485. package/build-module/form-token-field/token-input.js +43 -58
  486. package/build-module/form-token-field/token-input.js.map +1 -1
  487. package/build-module/form-token-field/token.js +3 -1
  488. package/build-module/form-token-field/token.js.map +1 -1
  489. package/build-module/form-token-field/types.js +2 -0
  490. package/build-module/form-token-field/types.js.map +1 -0
  491. package/build-module/gradient-picker/index.js.map +1 -1
  492. package/build-module/grid/component.js +7 -8
  493. package/build-module/grid/component.js.map +1 -1
  494. package/build-module/grid/hook.js +1 -5
  495. package/build-module/grid/hook.js.map +1 -1
  496. package/build-module/grid/index.js.map +1 -1
  497. package/build-module/grid/utils.js +3 -8
  498. package/build-module/grid/utils.js.map +1 -1
  499. package/build-module/h-stack/component.js +3 -7
  500. package/build-module/h-stack/component.js.map +1 -1
  501. package/build-module/h-stack/hook.js +10 -12
  502. package/build-module/h-stack/hook.js.map +1 -1
  503. package/build-module/h-stack/index.js.map +1 -1
  504. package/build-module/h-stack/utils.js +8 -20
  505. package/build-module/h-stack/utils.js.map +1 -1
  506. package/build-module/heading/component.js +0 -1
  507. package/build-module/heading/component.js.map +1 -1
  508. package/build-module/heading/hook.js.map +1 -1
  509. package/build-module/heading/types.js +2 -0
  510. package/build-module/heading/types.js.map +1 -0
  511. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  512. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  513. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  514. package/build-module/icon/index.js.map +1 -1
  515. package/build-module/input-control/index.js +2 -1
  516. package/build-module/input-control/index.js.map +1 -1
  517. package/build-module/input-control/input-field.js +2 -1
  518. package/build-module/input-control/input-field.js.map +1 -1
  519. package/build-module/input-control/reducer/reducer.js.map +1 -1
  520. package/build-module/input-control/utils.js +1 -1
  521. package/build-module/input-control/utils.js.map +1 -1
  522. package/build-module/menu-item/index.js +1 -2
  523. package/build-module/menu-item/index.js.map +1 -1
  524. package/build-module/menu-items-choice/index.js +3 -5
  525. package/build-module/menu-items-choice/index.js.map +1 -1
  526. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  528. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
  529. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  530. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  532. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  534. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  535. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  536. package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
  537. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  538. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  539. package/build-module/mobile/gradient/index.native.js.map +1 -1
  540. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  541. package/build-module/mobile/image/index.native.js +3 -2
  542. package/build-module/mobile/image/index.native.js.map +1 -1
  543. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  544. package/build-module/mobile/link-picker/index.native.js +4 -3
  545. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  546. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  547. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  548. package/build-module/mobile/segmented-control/index.native.js +3 -4
  549. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  550. package/build-module/modal/index.js +20 -6
  551. package/build-module/modal/index.js.map +1 -1
  552. package/build-module/navigable-container/container.js +5 -2
  553. package/build-module/navigable-container/container.js.map +1 -1
  554. package/build-module/navigation/context.js +3 -5
  555. package/build-module/navigation/context.js.map +1 -1
  556. package/build-module/navigation/group/index.js +3 -6
  557. package/build-module/navigation/group/index.js.map +1 -1
  558. package/build-module/navigation/index.js +7 -2
  559. package/build-module/navigation/index.js.map +1 -1
  560. package/build-module/navigation/item/base.js +5 -2
  561. package/build-module/navigation/item/base.js.map +1 -1
  562. package/build-module/navigation/item/index.js +3 -1
  563. package/build-module/navigation/item/index.js.map +1 -1
  564. package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
  565. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  566. package/build-module/navigation/menu/menu-title-search.js +1 -6
  567. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  568. package/build-module/navigation/menu/search-no-results-found.js +1 -6
  569. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  570. package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
  571. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  572. package/build-module/navigation/utils.js +2 -2
  573. package/build-module/navigation/utils.js.map +1 -1
  574. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  575. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  576. package/build-module/navigator/navigator-provider/component.js +1 -1
  577. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  578. package/build-module/navigator/navigator-screen/component.js +1 -1
  579. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  580. package/build-module/notice/index.js +2 -1
  581. package/build-module/notice/index.js.map +1 -1
  582. package/build-module/notice/list.js +4 -1
  583. package/build-module/notice/list.js.map +1 -1
  584. package/build-module/panel/body.js +3 -1
  585. package/build-module/panel/body.js.map +1 -1
  586. package/build-module/placeholder/index.js +24 -11
  587. package/build-module/placeholder/index.js.map +1 -1
  588. package/build-module/popover/index.js +4 -4
  589. package/build-module/popover/index.js.map +1 -1
  590. package/build-module/radio-control/index.js +40 -7
  591. package/build-module/radio-control/index.js.map +1 -1
  592. package/build-module/radio-control/types.js +2 -0
  593. package/build-module/radio-control/types.js.map +1 -0
  594. package/build-module/range-control/index.js +57 -41
  595. package/build-module/range-control/index.js.map +1 -1
  596. package/build-module/range-control/input-range.js +7 -11
  597. package/build-module/range-control/input-range.js.map +1 -1
  598. package/build-module/range-control/mark.js +5 -6
  599. package/build-module/range-control/mark.js.map +1 -1
  600. package/build-module/range-control/rail.js +10 -15
  601. package/build-module/range-control/rail.js.map +1 -1
  602. package/build-module/range-control/styles/range-control-styles.js +62 -64
  603. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  604. package/build-module/range-control/tooltip.js +5 -6
  605. package/build-module/range-control/tooltip.js.map +1 -1
  606. package/build-module/range-control/types.js +2 -0
  607. package/build-module/range-control/types.js.map +1 -0
  608. package/build-module/range-control/utils.js +24 -32
  609. package/build-module/range-control/utils.js.map +1 -1
  610. package/build-module/resizable-box/resize-tooltip/index.js +2 -1
  611. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  612. package/build-module/resizable-box/resize-tooltip/utils.js +5 -11
  613. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  614. package/build-module/responsive-wrapper/index.js.map +1 -1
  615. package/build-module/scrollable/component.js +7 -8
  616. package/build-module/scrollable/component.js.map +1 -1
  617. package/build-module/scrollable/hook.js +0 -8
  618. package/build-module/scrollable/hook.js.map +1 -1
  619. package/build-module/scrollable/index.js.map +1 -1
  620. package/build-module/scrollable/styles.js +7 -7
  621. package/build-module/scrollable/styles.js.map +1 -1
  622. package/build-module/select-control/index.js +3 -1
  623. package/build-module/select-control/index.js.map +1 -1
  624. package/build-module/shortcut/index.js +2 -7
  625. package/build-module/shortcut/index.js.map +1 -1
  626. package/build-module/slot-fill/fill.js +1 -6
  627. package/build-module/slot-fill/fill.js.map +1 -1
  628. package/build-module/slot-fill/index.native.js +6 -7
  629. package/build-module/slot-fill/index.native.js.map +1 -1
  630. package/build-module/slot-fill/provider.js +4 -7
  631. package/build-module/slot-fill/provider.js.map +1 -1
  632. package/build-module/slot-fill/slot.js +15 -8
  633. package/build-module/slot-fill/slot.js.map +1 -1
  634. package/build-module/snackbar/index.js +3 -1
  635. package/build-module/snackbar/index.js.map +1 -1
  636. package/build-module/snackbar/list.js +4 -1
  637. package/build-module/snackbar/list.js.map +1 -1
  638. package/build-module/spacer/component.js +3 -4
  639. package/build-module/spacer/component.js.map +1 -1
  640. package/build-module/spacer/hook.js +2 -2
  641. package/build-module/spacer/hook.js.map +1 -1
  642. package/build-module/spacer/index.js.map +1 -1
  643. package/build-module/spinner/index.js +22 -13
  644. package/build-module/spinner/index.js.map +1 -1
  645. package/build-module/spinner/styles.js +10 -10
  646. package/build-module/spinner/styles.js.map +1 -1
  647. package/build-module/tab-panel/index.js +3 -1
  648. package/build-module/tab-panel/index.js.map +1 -1
  649. package/build-module/text/hook.js +4 -4
  650. package/build-module/text/hook.js.map +1 -1
  651. package/build-module/text/utils.js.map +1 -1
  652. package/build-module/text-highlight/index.js +23 -6
  653. package/build-module/text-highlight/index.js.map +1 -1
  654. package/build-module/text-highlight/types.js +2 -0
  655. package/build-module/text-highlight/types.js.map +1 -0
  656. package/build-module/tip/index.js +6 -10
  657. package/build-module/tip/index.js.map +1 -1
  658. package/build-module/tip/types.js +2 -0
  659. package/build-module/tip/types.js.map +1 -0
  660. package/build-module/toggle-control/index.js +1 -2
  661. package/build-module/toggle-control/index.js.map +1 -1
  662. package/build-module/toggle-control/index.native.js +1 -6
  663. package/build-module/toggle-control/index.native.js.map +1 -1
  664. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  665. package/build-module/toolbar/index.js.map +1 -1
  666. package/build-module/toolbar-group/index.js +3 -2
  667. package/build-module/toolbar-group/index.js.map +1 -1
  668. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  669. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  670. package/build-module/tooltip/index.js +2 -1
  671. package/build-module/tooltip/index.js.map +1 -1
  672. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  673. package/build-module/tree-select/index.js +56 -6
  674. package/build-module/tree-select/index.js.map +1 -1
  675. package/build-module/tree-select/types.js +2 -0
  676. package/build-module/tree-select/types.js.map +1 -0
  677. package/build-module/truncate/component.js +7 -8
  678. package/build-module/truncate/component.js.map +1 -1
  679. package/build-module/truncate/hook.js +3 -10
  680. package/build-module/truncate/hook.js.map +1 -1
  681. package/build-module/truncate/index.js.map +1 -1
  682. package/build-module/truncate/styles.js +1 -1
  683. package/build-module/truncate/styles.js.map +1 -1
  684. package/build-module/truncate/utils.js +3 -16
  685. package/build-module/truncate/utils.js.map +1 -1
  686. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  687. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  688. package/build-module/unit-control/index.js.map +1 -1
  689. package/build-module/utils/math.js +15 -6
  690. package/build-module/utils/math.js.map +1 -1
  691. package/build-module/utils/unit-values.js.map +1 -1
  692. package/build-module/utils/values.js.map +1 -1
  693. package/build-module/v-stack/component.js +9 -9
  694. package/build-module/v-stack/component.js.map +1 -1
  695. package/build-module/v-stack/hook.js +0 -5
  696. package/build-module/v-stack/hook.js.map +1 -1
  697. package/build-module/v-stack/index.js.map +1 -1
  698. package/build-module/visually-hidden/component.js +12 -13
  699. package/build-module/visually-hidden/component.js.map +1 -1
  700. package/build-module/visually-hidden/index.js.map +1 -1
  701. package/build-module/visually-hidden/styles.js +3 -1
  702. package/build-module/visually-hidden/styles.js.map +1 -1
  703. package/build-module/visually-hidden/types.js +2 -0
  704. package/build-module/visually-hidden/types.js.map +1 -0
  705. package/build-module/z-stack/component.js +21 -2
  706. package/build-module/z-stack/component.js.map +1 -1
  707. package/build-module/z-stack/types.js +2 -0
  708. package/build-module/z-stack/types.js.map +1 -0
  709. package/build-style/style-rtl.css +61 -22
  710. package/build-style/style.css +61 -23
  711. package/build-types/base-control/stories/index.d.ts.map +1 -1
  712. package/build-types/base-field/hook.d.ts +0 -1
  713. package/build-types/base-field/hook.d.ts.map +1 -1
  714. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  715. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  716. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  717. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  718. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
  719. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  720. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  721. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
  722. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  723. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
  724. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  725. package/build-types/border-box-control/utils.d.ts.map +1 -1
  726. package/build-types/border-control/border-control/component.d.ts +36 -2
  727. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  728. package/build-types/border-control/border-control/hook.d.ts +1 -2
  729. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  730. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  731. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  732. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
  733. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  734. package/build-types/border-control/stories/index.d.ts +33 -0
  735. package/build-types/border-control/stories/index.d.ts.map +1 -0
  736. package/build-types/button-group/index.d.ts +1 -1
  737. package/build-types/button-group/index.d.ts.map +1 -1
  738. package/build-types/card/card/hook.d.ts +0 -1
  739. package/build-types/card/card/hook.d.ts.map +1 -1
  740. package/build-types/card/card-body/hook.d.ts +0 -1
  741. package/build-types/card/card-body/hook.d.ts.map +1 -1
  742. package/build-types/card/card-divider/hook.d.ts +0 -1
  743. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  744. package/build-types/card/card-footer/hook.d.ts +0 -1
  745. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  746. package/build-types/card/card-header/hook.d.ts +0 -1
  747. package/build-types/card/card-header/hook.d.ts.map +1 -1
  748. package/build-types/card/card-media/hook.d.ts +0 -1
  749. package/build-types/card/card-media/hook.d.ts.map +1 -1
  750. package/build-types/checkbox-control/index.d.ts.map +1 -1
  751. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  752. package/build-types/color-indicator/index.d.ts +16 -5
  753. package/build-types/color-indicator/index.d.ts.map +1 -1
  754. package/build-types/color-indicator/stories/index.d.ts +12 -0
  755. package/build-types/color-indicator/stories/index.d.ts.map +1 -0
  756. package/build-types/color-indicator/test/index.d.ts +2 -0
  757. package/build-types/color-indicator/test/index.d.ts.map +1 -0
  758. package/build-types/color-indicator/types.d.ts +12 -0
  759. package/build-types/color-indicator/types.d.ts.map +1 -0
  760. package/build-types/color-palette/index.d.ts.map +1 -1
  761. package/build-types/color-palette/styles.d.ts +4 -2
  762. package/build-types/color-palette/styles.d.ts.map +1 -1
  763. package/build-types/color-picker/component.d.ts.map +1 -1
  764. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  765. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  766. package/build-types/color-picker/styles.d.ts +48 -32
  767. package/build-types/color-picker/styles.d.ts.map +1 -1
  768. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  769. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  770. package/build-types/date-time/date/index.d.ts +1 -1
  771. package/build-types/date-time/date/index.d.ts.map +1 -1
  772. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  773. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  774. package/build-types/date-time/stories/date.d.ts.map +1 -1
  775. package/build-types/date-time/time/styles.d.ts +1 -1
  776. package/build-types/date-time/types.d.ts +6 -0
  777. package/build-types/date-time/types.d.ts.map +1 -1
  778. package/build-types/divider/styles.d.ts.map +1 -1
  779. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  780. package/build-types/elevation/hook.d.ts +0 -1
  781. package/build-types/elevation/hook.d.ts.map +1 -1
  782. package/build-types/external-link/index.d.ts +17 -0
  783. package/build-types/external-link/index.d.ts.map +1 -0
  784. package/build-types/external-link/stories/index.d.ts +12 -0
  785. package/build-types/external-link/stories/index.d.ts.map +1 -0
  786. package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
  787. package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
  788. package/build-types/external-link/types.d.ts +15 -0
  789. package/build-types/external-link/types.d.ts.map +1 -0
  790. package/build-types/flex/flex/hook.d.ts +0 -1
  791. package/build-types/flex/flex/hook.d.ts.map +1 -1
  792. package/build-types/flex/flex-block/hook.d.ts +0 -1
  793. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  794. package/build-types/flex/flex-item/hook.d.ts +0 -1
  795. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  796. package/build-types/form-toggle/index.d.ts +29 -0
  797. package/build-types/form-toggle/index.d.ts.map +1 -0
  798. package/build-types/form-toggle/stories/index.d.ts +12 -0
  799. package/build-types/form-toggle/stories/index.d.ts.map +1 -0
  800. package/build-types/form-toggle/test/index.d.ts +2 -0
  801. package/build-types/form-toggle/test/index.d.ts.map +1 -0
  802. package/build-types/form-toggle/types.d.ts +22 -0
  803. package/build-types/form-toggle/types.d.ts.map +1 -0
  804. package/build-types/form-token-field/index.d.ts +15 -0
  805. package/build-types/form-token-field/index.d.ts.map +1 -0
  806. package/build-types/form-token-field/stories/index.d.ts +13 -0
  807. package/build-types/form-token-field/stories/index.d.ts.map +1 -0
  808. package/build-types/form-token-field/styles.d.ts +14 -0
  809. package/build-types/form-token-field/styles.d.ts.map +1 -0
  810. package/build-types/form-token-field/suggestions-list.d.ts +10 -0
  811. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
  812. package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
  813. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
  814. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
  815. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
  816. package/build-types/form-token-field/token-input.d.ts +12 -0
  817. package/build-types/form-token-field/token-input.d.ts.map +1 -0
  818. package/build-types/form-token-field/token.d.ts +4 -0
  819. package/build-types/form-token-field/token.d.ts.map +1 -0
  820. package/build-types/form-token-field/types.d.ts +183 -0
  821. package/build-types/form-token-field/types.d.ts.map +1 -0
  822. package/build-types/grid/component.d.ts +3 -3
  823. package/build-types/grid/component.d.ts.map +1 -1
  824. package/build-types/grid/hook.d.ts +5 -3
  825. package/build-types/grid/hook.d.ts.map +1 -1
  826. package/build-types/grid/index.d.ts +2 -2
  827. package/build-types/grid/index.d.ts.map +1 -1
  828. package/build-types/grid/stories/index.d.ts +9 -0
  829. package/build-types/grid/stories/index.d.ts.map +1 -0
  830. package/build-types/grid/test/grid.d.ts +2 -0
  831. package/build-types/grid/test/grid.d.ts.map +1 -0
  832. package/build-types/grid/types.d.ts +16 -15
  833. package/build-types/grid/types.d.ts.map +1 -1
  834. package/build-types/grid/utils.d.ts +50 -69
  835. package/build-types/grid/utils.d.ts.map +1 -1
  836. package/build-types/h-stack/component.d.ts +3 -2
  837. package/build-types/h-stack/component.d.ts.map +1 -1
  838. package/build-types/h-stack/hook.d.ts +5 -4
  839. package/build-types/h-stack/hook.d.ts.map +1 -1
  840. package/build-types/h-stack/index.d.ts +2 -2
  841. package/build-types/h-stack/index.d.ts.map +1 -1
  842. package/build-types/h-stack/stories/index.d.ts +9 -0
  843. package/build-types/h-stack/stories/index.d.ts.map +1 -0
  844. package/build-types/h-stack/test/index.d.ts +2 -0
  845. package/build-types/h-stack/test/index.d.ts.map +1 -0
  846. package/build-types/h-stack/utils.d.ts +8 -4
  847. package/build-types/h-stack/utils.d.ts.map +1 -1
  848. package/build-types/heading/component.d.ts +1 -2
  849. package/build-types/heading/component.d.ts.map +1 -1
  850. package/build-types/heading/hook.d.ts +1 -29
  851. package/build-types/heading/hook.d.ts.map +1 -1
  852. package/build-types/heading/stories/index.d.ts.map +1 -1
  853. package/build-types/heading/test/index.d.ts +2 -0
  854. package/build-types/heading/test/index.d.ts.map +1 -0
  855. package/build-types/heading/types.d.ts +16 -0
  856. package/build-types/heading/types.d.ts.map +1 -0
  857. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  858. package/build-types/icon/index.d.ts +1 -1
  859. package/build-types/icon/index.d.ts.map +1 -1
  860. package/build-types/input-control/index.d.ts +1 -1
  861. package/build-types/input-control/index.d.ts.map +1 -1
  862. package/build-types/input-control/input-field.d.ts +1 -1
  863. package/build-types/input-control/input-field.d.ts.map +1 -1
  864. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  865. package/build-types/input-control/stories/index.d.ts +5 -5
  866. package/build-types/input-control/stories/index.d.ts.map +1 -1
  867. package/build-types/item-group/item/hook.d.ts +0 -1
  868. package/build-types/item-group/item/hook.d.ts.map +1 -1
  869. package/build-types/item-group/item-group/hook.d.ts +0 -1
  870. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  871. package/build-types/menu-item/index.d.ts.map +1 -1
  872. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
  873. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  874. package/build-types/navigator/navigator-button/hook.d.ts +0 -1
  875. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  876. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  877. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  878. package/build-types/popover/index.d.ts.map +1 -1
  879. package/build-types/radio-control/index.d.ts +31 -0
  880. package/build-types/radio-control/index.d.ts.map +1 -0
  881. package/build-types/radio-control/stories/index.d.ts +12 -0
  882. package/build-types/radio-control/stories/index.d.ts.map +1 -0
  883. package/build-types/radio-control/types.d.ts +29 -0
  884. package/build-types/radio-control/types.d.ts.map +1 -0
  885. package/build-types/range-control/index.d.ts +54 -29
  886. package/build-types/range-control/index.d.ts.map +1 -1
  887. package/build-types/range-control/input-range.d.ts +7 -10
  888. package/build-types/range-control/input-range.d.ts.map +1 -1
  889. package/build-types/range-control/mark.d.ts +4 -7
  890. package/build-types/range-control/mark.d.ts.map +1 -1
  891. package/build-types/range-control/rail.d.ts +4 -9
  892. package/build-types/range-control/rail.d.ts.map +1 -1
  893. package/build-types/range-control/stories/index.d.ts +48 -0
  894. package/build-types/range-control/stories/index.d.ts.map +1 -0
  895. package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
  896. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  897. package/build-types/range-control/test/index.d.ts +2 -0
  898. package/build-types/range-control/test/index.d.ts.map +1 -0
  899. package/build-types/range-control/tooltip.d.ts +4 -11
  900. package/build-types/range-control/tooltip.d.ts.map +1 -1
  901. package/build-types/range-control/types.d.ts +302 -0
  902. package/build-types/range-control/types.d.ts.map +1 -0
  903. package/build-types/range-control/utils.d.ts +15 -33
  904. package/build-types/range-control/utils.d.ts.map +1 -1
  905. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  906. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  907. package/build-types/scrollable/component.d.ts +3 -3
  908. package/build-types/scrollable/component.d.ts.map +1 -1
  909. package/build-types/scrollable/hook.d.ts +5 -3
  910. package/build-types/scrollable/hook.d.ts.map +1 -1
  911. package/build-types/scrollable/index.d.ts +2 -2
  912. package/build-types/scrollable/index.d.ts.map +1 -1
  913. package/build-types/scrollable/stories/index.d.ts +9 -0
  914. package/build-types/scrollable/stories/index.d.ts.map +1 -0
  915. package/build-types/scrollable/styles.d.ts +7 -7
  916. package/build-types/scrollable/styles.d.ts.map +1 -1
  917. package/build-types/scrollable/test/index.d.ts +2 -0
  918. package/build-types/scrollable/test/index.d.ts.map +1 -0
  919. package/build-types/scrollable/types.d.ts +9 -6
  920. package/build-types/scrollable/types.d.ts.map +1 -1
  921. package/build-types/select-control/index.d.ts +1 -1
  922. package/build-types/select-control/index.d.ts.map +1 -1
  923. package/build-types/select-control/stories/index.d.ts +3 -3
  924. package/build-types/select-control/stories/index.d.ts.map +1 -1
  925. package/build-types/shortcut/index.d.ts.map +1 -1
  926. package/build-types/slot-fill/fill.d.ts.map +1 -1
  927. package/build-types/slot-fill/provider.d.ts.map +1 -1
  928. package/build-types/slot-fill/slot.d.ts.map +1 -1
  929. package/build-types/spacer/component.d.ts +3 -4
  930. package/build-types/spacer/component.d.ts.map +1 -1
  931. package/build-types/spacer/hook.d.ts +2 -3
  932. package/build-types/spacer/hook.d.ts.map +1 -1
  933. package/build-types/spacer/index.d.ts +1 -1
  934. package/build-types/spacer/index.d.ts.map +1 -1
  935. package/build-types/spacer/stories/index.d.ts +12 -0
  936. package/build-types/spacer/stories/index.d.ts.map +1 -0
  937. package/build-types/spacer/test/index.d.ts +2 -0
  938. package/build-types/spacer/test/index.d.ts.map +1 -0
  939. package/build-types/spacer/types.d.ts +41 -29
  940. package/build-types/spacer/types.d.ts.map +1 -1
  941. package/build-types/spinner/index.d.ts +16 -15
  942. package/build-types/spinner/index.d.ts.map +1 -1
  943. package/build-types/spinner/stories/index.d.ts +13 -0
  944. package/build-types/spinner/stories/index.d.ts.map +1 -0
  945. package/build-types/spinner/styles.d.ts +4 -3
  946. package/build-types/spinner/styles.d.ts.map +1 -1
  947. package/build-types/surface/hook.d.ts +0 -1
  948. package/build-types/surface/hook.d.ts.map +1 -1
  949. package/build-types/text/hook.d.ts +0 -1
  950. package/build-types/text/hook.d.ts.map +1 -1
  951. package/build-types/text/types.d.ts +1 -1
  952. package/build-types/text/types.d.ts.map +1 -1
  953. package/build-types/text/utils.d.ts.map +1 -1
  954. package/build-types/text-control/index.d.ts +1 -1
  955. package/build-types/text-control/index.d.ts.map +1 -1
  956. package/build-types/text-control/stories/index.d.ts.map +1 -1
  957. package/build-types/text-highlight/index.d.ts +23 -0
  958. package/build-types/text-highlight/index.d.ts.map +1 -0
  959. package/build-types/text-highlight/stories/index.d.ts +12 -0
  960. package/build-types/text-highlight/stories/index.d.ts.map +1 -0
  961. package/build-types/text-highlight/test/index.d.ts +2 -0
  962. package/build-types/text-highlight/test/index.d.ts.map +1 -0
  963. package/build-types/text-highlight/types.d.ts +17 -0
  964. package/build-types/text-highlight/types.d.ts.map +1 -0
  965. package/build-types/tip/index.d.ts +5 -14
  966. package/build-types/tip/index.d.ts.map +1 -1
  967. package/build-types/tip/stories/index.d.ts +12 -0
  968. package/build-types/tip/stories/index.d.ts.map +1 -0
  969. package/build-types/tip/types.d.ts +11 -0
  970. package/build-types/tip/types.d.ts.map +1 -0
  971. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  972. package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
  973. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  974. package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
  975. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  976. package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
  977. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  978. package/build-types/tooltip/index.d.ts.map +1 -1
  979. package/build-types/tree-select/index.d.ts +53 -0
  980. package/build-types/tree-select/index.d.ts.map +1 -0
  981. package/build-types/tree-select/stories/index.d.ts +12 -0
  982. package/build-types/tree-select/stories/index.d.ts.map +1 -0
  983. package/build-types/tree-select/types.d.ts +30 -0
  984. package/build-types/tree-select/types.d.ts.map +1 -0
  985. package/build-types/truncate/component.d.ts +3 -3
  986. package/build-types/truncate/component.d.ts.map +1 -1
  987. package/build-types/truncate/hook.d.ts +5 -3
  988. package/build-types/truncate/hook.d.ts.map +1 -1
  989. package/build-types/truncate/index.d.ts +2 -2
  990. package/build-types/truncate/index.d.ts.map +1 -1
  991. package/build-types/truncate/stories/index.d.ts +13 -0
  992. package/build-types/truncate/stories/index.d.ts.map +1 -0
  993. package/build-types/truncate/styles.d.ts +1 -1
  994. package/build-types/truncate/styles.d.ts.map +1 -1
  995. package/build-types/truncate/test/index.d.ts +2 -0
  996. package/build-types/truncate/test/index.d.ts.map +1 -0
  997. package/build-types/truncate/types.d.ts +22 -11
  998. package/build-types/truncate/types.d.ts.map +1 -1
  999. package/build-types/truncate/utils.d.ts +17 -28
  1000. package/build-types/truncate/utils.d.ts.map +1 -1
  1001. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  1002. package/build-types/ui/control-group/hook.d.ts +0 -1
  1003. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  1004. package/build-types/ui/control-label/hook.d.ts +0 -1
  1005. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  1006. package/build-types/ui/form-group/form-group.d.ts +1 -1
  1007. package/build-types/ui/form-group/types.d.ts +1 -1
  1008. package/build-types/ui/form-group/types.d.ts.map +1 -1
  1009. package/build-types/ui/form-group/use-form-group.d.ts +5 -7
  1010. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  1011. package/build-types/ui/utils/get-valid-children.d.ts +2 -2
  1012. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  1013. package/build-types/unit-control/index.d.ts +1 -1
  1014. package/build-types/unit-control/index.d.ts.map +1 -1
  1015. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  1016. package/build-types/utils/math.d.ts +10 -0
  1017. package/build-types/utils/math.d.ts.map +1 -1
  1018. package/build-types/utils/unit-values.d.ts.map +1 -1
  1019. package/build-types/utils/values.d.ts.map +1 -1
  1020. package/build-types/v-stack/component.d.ts +5 -4
  1021. package/build-types/v-stack/component.d.ts.map +1 -1
  1022. package/build-types/v-stack/hook.d.ts +5 -4
  1023. package/build-types/v-stack/hook.d.ts.map +1 -1
  1024. package/build-types/v-stack/index.d.ts +2 -2
  1025. package/build-types/v-stack/index.d.ts.map +1 -1
  1026. package/build-types/v-stack/stories/index.d.ts +9 -0
  1027. package/build-types/v-stack/stories/index.d.ts.map +1 -0
  1028. package/build-types/v-stack/test/index.d.ts +2 -0
  1029. package/build-types/v-stack/test/index.d.ts.map +1 -0
  1030. package/build-types/v-stack/types.d.ts +21 -1
  1031. package/build-types/v-stack/types.d.ts.map +1 -1
  1032. package/build-types/visually-hidden/component.d.ts +8 -10
  1033. package/build-types/visually-hidden/component.d.ts.map +1 -1
  1034. package/build-types/visually-hidden/index.d.ts +1 -1
  1035. package/build-types/visually-hidden/index.d.ts.map +1 -1
  1036. package/build-types/visually-hidden/stories/index.d.ts +14 -0
  1037. package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
  1038. package/build-types/visually-hidden/styles.d.ts +5 -2
  1039. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  1040. package/build-types/visually-hidden/test/index.d.ts +2 -0
  1041. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  1042. package/build-types/visually-hidden/types.d.ts +11 -0
  1043. package/build-types/visually-hidden/types.d.ts.map +1 -0
  1044. package/build-types/z-stack/component.d.ts +18 -28
  1045. package/build-types/z-stack/component.d.ts.map +1 -1
  1046. package/build-types/z-stack/stories/index.d.ts +6 -0
  1047. package/build-types/z-stack/stories/index.d.ts.map +1 -0
  1048. package/build-types/z-stack/types.d.ts +33 -0
  1049. package/build-types/z-stack/types.d.ts.map +1 -0
  1050. package/package.json +18 -17
  1051. package/src/alignment-matrix-control/index.js +2 -1
  1052. package/src/alignment-matrix-control/utils.js +1 -6
  1053. package/src/angle-picker-control/index.js +1 -1
  1054. package/src/autocomplete/autocompleter-ui.js +4 -1
  1055. package/src/autocomplete/autocompleter-ui.native.js +8 -2
  1056. package/src/autocomplete/get-default-use-items.js +3 -2
  1057. package/src/autocomplete/index.js +7 -10
  1058. package/src/base-control/stories/index.tsx +2 -3
  1059. package/src/border-box-control/border-box-control/component.tsx +1 -0
  1060. package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
  1061. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  1062. package/src/border-box-control/utils.ts +5 -2
  1063. package/src/border-control/border-control/component.tsx +41 -4
  1064. package/src/border-control/border-control/hook.ts +3 -4
  1065. package/src/border-control/stories/index.tsx +150 -0
  1066. package/src/box-control/all-input-control.js +2 -4
  1067. package/src/box-control/axial-input-controls.js +4 -6
  1068. package/src/box-control/index.js +3 -6
  1069. package/src/box-control/input-controls.js +33 -36
  1070. package/src/box-control/unit-control.js +2 -1
  1071. package/src/box-control/utils.js +4 -4
  1072. package/src/button/README.md +1 -1
  1073. package/src/button/index.native.js +1 -2
  1074. package/src/card/stories/index.js +10 -5
  1075. package/src/checkbox-control/index.tsx +2 -3
  1076. package/src/checkbox-control/stories/index.tsx +2 -3
  1077. package/src/checkbox-control/test/index.tsx +2 -1
  1078. package/src/color-indicator/README.md +7 -9
  1079. package/src/color-indicator/index.tsx +47 -0
  1080. package/src/color-indicator/stories/index.tsx +37 -0
  1081. package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
  1082. package/src/color-indicator/test/{index.js → index.tsx} +4 -4
  1083. package/src/color-indicator/types.ts +12 -0
  1084. package/src/color-palette/index.js +5 -1
  1085. package/src/color-picker/component.tsx +12 -11
  1086. package/src/color-picker/hex-input.tsx +3 -2
  1087. package/src/color-picker/index.native.js +27 -31
  1088. package/src/color-picker/input-with-slider.tsx +4 -2
  1089. package/src/color-picker/styles.ts +20 -6
  1090. package/src/color-picker/use-deprecated-props.ts +24 -43
  1091. package/src/combobox-control/index.js +18 -8
  1092. package/src/combobox-control/stories/index.js +3 -2
  1093. package/src/combobox-control/style.scss +1 -1
  1094. package/src/combobox-control/styles.ts +27 -0
  1095. package/src/confirm-dialog/component.tsx +7 -8
  1096. package/src/custom-gradient-bar/constants.js +2 -2
  1097. package/src/custom-gradient-bar/control-points.js +20 -16
  1098. package/src/custom-gradient-bar/index.js +11 -11
  1099. package/src/custom-gradient-bar/test/utils.js +79 -0
  1100. package/src/custom-gradient-bar/utils.js +6 -18
  1101. package/src/custom-gradient-picker/index.js +4 -11
  1102. package/src/custom-gradient-picker/index.native.js +3 -11
  1103. package/src/custom-gradient-picker/serializer.js +5 -11
  1104. package/src/custom-gradient-picker/style.scss +1 -3
  1105. package/src/custom-gradient-picker/utils.js +4 -3
  1106. package/src/custom-select-control/index.js +2 -1
  1107. package/src/custom-select-control/stories/index.js +1 -2
  1108. package/src/date-time/README.md +7 -0
  1109. package/src/date-time/date/index.tsx +4 -2
  1110. package/src/date-time/date/style.scss +10 -0
  1111. package/src/date-time/date/test/index.tsx +1 -1
  1112. package/src/date-time/date-time/index.tsx +8 -8
  1113. package/src/date-time/stories/date-time.tsx +4 -6
  1114. package/src/date-time/stories/date.tsx +2 -3
  1115. package/src/date-time/time/test/index.tsx +12 -12
  1116. package/src/date-time/types.ts +7 -0
  1117. package/src/dimension-control/README.md +5 -2
  1118. package/src/dimension-control/index.js +1 -2
  1119. package/src/dimension-control/test/index.test.js +7 -7
  1120. package/src/divider/styles.ts +2 -3
  1121. package/src/draggable/index.js +3 -3
  1122. package/src/draggable/index.native.js +12 -4
  1123. package/src/drop-zone/provider.js +1 -2
  1124. package/src/dropdown/index.js +2 -2
  1125. package/src/dropdown-menu/index.js +13 -4
  1126. package/src/dropdown-menu/index.native.js +13 -5
  1127. package/src/duotone-picker/duotone-picker.js +58 -37
  1128. package/src/duotone-picker/style.scss +19 -0
  1129. package/src/elevation/hook.js +11 -11
  1130. package/src/external-link/README.md +18 -0
  1131. package/src/external-link/{index.js → index.tsx} +35 -9
  1132. package/src/external-link/stories/index.tsx +36 -0
  1133. package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
  1134. package/src/external-link/types.ts +15 -0
  1135. package/src/flex/flex/README.md +5 -10
  1136. package/src/flex/flex/hook.js +4 -1
  1137. package/src/flex/flex-item/README.md +1 -1
  1138. package/src/focal-point-picker/controls.js +1 -5
  1139. package/src/focal-point-picker/grid.js +2 -5
  1140. package/src/focal-point-picker/index.js +2 -8
  1141. package/src/focal-point-picker/index.native.js +9 -9
  1142. package/src/focal-point-picker/media.js +2 -5
  1143. package/src/focal-point-picker/tooltip/index.native.js +10 -11
  1144. package/src/font-size-picker/index.js +3 -1
  1145. package/src/form-toggle/README.md +10 -11
  1146. package/src/form-toggle/index.tsx +71 -0
  1147. package/src/form-toggle/stories/index.tsx +52 -0
  1148. package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
  1149. package/src/form-toggle/test/index.tsx +102 -0
  1150. package/src/form-toggle/types.ts +22 -0
  1151. package/src/form-token-field/index.tsx +715 -0
  1152. package/src/form-token-field/stories/index.tsx +103 -0
  1153. package/src/form-token-field/style.scss +4 -8
  1154. package/src/form-token-field/styles.ts +32 -0
  1155. package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +43 -29
  1156. package/src/form-token-field/test/index.js +70 -40
  1157. package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
  1158. package/src/form-token-field/token-input.tsx +76 -0
  1159. package/src/form-token-field/{token.js → token.tsx} +4 -2
  1160. package/src/form-token-field/types.ts +185 -0
  1161. package/src/gradient-picker/index.js +4 -3
  1162. package/src/grid/README.md +33 -19
  1163. package/src/grid/{component.js → component.tsx} +13 -9
  1164. package/src/grid/{hook.js → hook.ts} +5 -5
  1165. package/src/grid/{index.js → index.ts} +0 -0
  1166. package/src/grid/stories/index.tsx +72 -0
  1167. package/src/grid/test/{grid.js → grid.tsx} +4 -4
  1168. package/src/grid/types.ts +16 -17
  1169. package/src/grid/{utils.js → utils.ts} +9 -7
  1170. package/src/guide/style.scss +1 -0
  1171. package/src/h-stack/{component.js → component.tsx} +8 -8
  1172. package/src/h-stack/{hook.js → hook.tsx} +21 -16
  1173. package/src/h-stack/{index.js → index.ts} +0 -0
  1174. package/src/h-stack/stories/index.tsx +92 -0
  1175. package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1176. package/src/h-stack/test/{index.js → index.tsx} +0 -0
  1177. package/src/h-stack/{utils.js → utils.ts} +16 -16
  1178. package/src/heading/README.md +4 -3
  1179. package/src/heading/component.tsx +2 -2
  1180. package/src/heading/hook.ts +6 -46
  1181. package/src/heading/stories/index.tsx +5 -1
  1182. package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1183. package/src/heading/test/index.tsx +68 -0
  1184. package/src/heading/types.ts +29 -0
  1185. package/src/higher-order/navigate-regions/README.md +4 -1
  1186. package/src/higher-order/navigate-regions/index.js +7 -5
  1187. package/src/higher-order/with-filters/test/index.js +43 -36
  1188. package/src/higher-order/with-focus-return/index.js +14 -13
  1189. package/src/higher-order/with-spoken-messages/index.js +8 -7
  1190. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  1191. package/src/icon/index.tsx +3 -3
  1192. package/src/input-control/index.tsx +2 -1
  1193. package/src/input-control/input-field.tsx +2 -1
  1194. package/src/input-control/reducer/reducer.ts +23 -21
  1195. package/src/input-control/test/index.js +106 -31
  1196. package/src/input-control/utils.ts +1 -1
  1197. package/src/item-group/stories/index.js +2 -1
  1198. package/src/menu-item/index.js +1 -2
  1199. package/src/menu-item/test/index.js +2 -1
  1200. package/src/menu-items-choice/index.js +2 -5
  1201. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
  1202. package/src/mobile/bottom-sheet/cell.native.js +2 -3
  1203. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
  1204. package/src/mobile/bottom-sheet/index.native.js +14 -17
  1205. package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
  1206. package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
  1207. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
  1208. package/src/mobile/color-settings/index.native.js +2 -4
  1209. package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
  1210. package/src/mobile/global-styles-context/index.native.js +8 -7
  1211. package/src/mobile/gradient/index.native.js +12 -9
  1212. package/src/mobile/gradient/test/index.native.js +1 -3
  1213. package/src/mobile/html-text-input/index.native.js +2 -3
  1214. package/src/mobile/image/index.native.js +3 -2
  1215. package/src/mobile/inserter-button/index.native.js +2 -6
  1216. package/src/mobile/link-picker/index.native.js +2 -3
  1217. package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
  1218. package/src/mobile/media-edit/index.native.js +2 -3
  1219. package/src/mobile/segmented-control/index.native.js +9 -9
  1220. package/src/mobile/utils/test/index.native.js +3 -12
  1221. package/src/modal/index.js +22 -3
  1222. package/src/modal/stories/index.js +17 -1
  1223. package/src/modal/style.scss +9 -18
  1224. package/src/navigable-container/container.js +3 -2
  1225. package/src/navigable-container/test/menu.js +1 -2
  1226. package/src/navigable-container/test/tabbable.js +1 -2
  1227. package/src/navigation/context.js +2 -5
  1228. package/src/navigation/group/index.js +8 -3
  1229. package/src/navigation/index.js +5 -1
  1230. package/src/navigation/item/base.js +5 -3
  1231. package/src/navigation/item/index.js +2 -1
  1232. package/src/navigation/item/use-navigation-tree-item.js +2 -0
  1233. package/src/navigation/menu/menu-title-search.js +3 -6
  1234. package/src/navigation/menu/search-no-results-found.js +3 -6
  1235. package/src/navigation/stories/controlled-state.js +1 -1
  1236. package/src/navigation/stories/more-examples.js +2 -3
  1237. package/src/navigation/test/index.js +252 -52
  1238. package/src/navigation/use-navigation-tree-nodes.js +11 -10
  1239. package/src/navigation/utils.js +2 -2
  1240. package/src/navigator/navigator-back-button/hook.ts +14 -12
  1241. package/src/navigator/navigator-button/hook.ts +14 -13
  1242. package/src/navigator/navigator-provider/component.tsx +2 -6
  1243. package/src/navigator/navigator-screen/component.tsx +3 -3
  1244. package/src/notice/index.js +2 -1
  1245. package/src/notice/list.js +3 -1
  1246. package/src/number-control/stories/index.js +24 -24
  1247. package/src/panel/body.js +2 -1
  1248. package/src/placeholder/README.md +7 -6
  1249. package/src/placeholder/index.js +27 -10
  1250. package/src/placeholder/style.scss +23 -0
  1251. package/src/popover/README.md +2 -2
  1252. package/src/popover/index.js +7 -4
  1253. package/src/radio-control/README.md +17 -23
  1254. package/src/radio-control/index.tsx +107 -0
  1255. package/src/radio-control/stories/index.tsx +72 -0
  1256. package/src/radio-control/types.ts +32 -0
  1257. package/src/range-control/README.md +107 -79
  1258. package/src/range-control/{index.js → index.tsx} +81 -49
  1259. package/src/range-control/{input-range.js → input-range.tsx} +13 -12
  1260. package/src/range-control/{mark.js → mark.tsx} +15 -9
  1261. package/src/range-control/{rail.js → rail.tsx} +40 -23
  1262. package/src/range-control/stories/index.tsx +244 -0
  1263. package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
  1264. package/src/range-control/test/index.tsx +311 -0
  1265. package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
  1266. package/src/range-control/types.ts +326 -0
  1267. package/src/range-control/utils.ts +132 -0
  1268. package/src/resizable-box/resize-tooltip/index.tsx +2 -1
  1269. package/src/resizable-box/resize-tooltip/utils.ts +3 -8
  1270. package/src/responsive-wrapper/index.js +2 -4
  1271. package/src/sandbox/test/index.js +4 -6
  1272. package/src/scrollable/README.md +14 -8
  1273. package/src/scrollable/{component.js → component.tsx} +13 -10
  1274. package/src/scrollable/{hook.js → hook.ts} +5 -7
  1275. package/src/scrollable/{index.js → index.ts} +0 -0
  1276. package/src/scrollable/stories/{index.js → index.tsx} +29 -34
  1277. package/src/scrollable/{styles.js → styles.ts} +0 -0
  1278. package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1279. package/src/scrollable/test/index.tsx +34 -0
  1280. package/src/scrollable/types.ts +10 -5
  1281. package/src/select-control/index.tsx +3 -1
  1282. package/src/select-control/stories/index.tsx +3 -4
  1283. package/src/select-control/test/select-control.tsx +22 -15
  1284. package/src/shortcut/index.js +2 -7
  1285. package/src/slot-fill/fill.js +1 -5
  1286. package/src/slot-fill/index.native.js +2 -7
  1287. package/src/slot-fill/provider.js +3 -7
  1288. package/src/slot-fill/slot.js +31 -24
  1289. package/src/slot-fill/test/slot.js +2 -3
  1290. package/src/snackbar/index.js +1 -1
  1291. package/src/snackbar/list.js +2 -1
  1292. package/src/spacer/README.md +43 -37
  1293. package/src/spacer/component.tsx +5 -6
  1294. package/src/spacer/hook.ts +4 -2
  1295. package/src/spacer/index.ts +1 -1
  1296. package/src/spacer/stories/index.tsx +70 -0
  1297. package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1298. package/src/spacer/test/index.tsx +149 -0
  1299. package/src/spacer/types.ts +41 -29
  1300. package/src/spinner/{index.js → index.tsx} +23 -9
  1301. package/src/spinner/stories/index.tsx +32 -0
  1302. package/src/spinner/{styles.js → styles.ts} +0 -0
  1303. package/src/style.scss +1 -0
  1304. package/src/tab-panel/README.md +1 -1
  1305. package/src/tab-panel/index.js +3 -1
  1306. package/src/text/hook.js +4 -1
  1307. package/src/text/types.ts +1 -1
  1308. package/src/text/utils.js +2 -3
  1309. package/src/text-control/stories/index.tsx +4 -6
  1310. package/src/text-highlight/README.md +6 -6
  1311. package/src/text-highlight/index.tsx +49 -0
  1312. package/src/text-highlight/stories/index.tsx +33 -0
  1313. package/src/text-highlight/test/index.tsx +93 -0
  1314. package/src/text-highlight/types.ts +16 -0
  1315. package/src/tip/index.tsx +22 -0
  1316. package/src/tip/stories/index.tsx +33 -0
  1317. package/src/tip/types.ts +11 -0
  1318. package/src/toggle-control/index.js +1 -2
  1319. package/src/toggle-control/index.native.js +2 -6
  1320. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
  1321. package/src/toolbar/index.js +1 -2
  1322. package/src/toolbar-group/index.js +1 -2
  1323. package/src/tools-panel/tools-panel/hook.ts +2 -4
  1324. package/src/tools-panel/tools-panel-header/hook.ts +2 -5
  1325. package/src/tooltip/index.js +1 -0
  1326. package/src/tree-grid/roving-tab-index-item.js +2 -4
  1327. package/src/tree-grid/test/index.js +2 -3
  1328. package/src/tree-select/README.md +2 -2
  1329. package/src/tree-select/index.tsx +99 -0
  1330. package/src/tree-select/stories/index.tsx +80 -0
  1331. package/src/tree-select/types.ts +35 -0
  1332. package/src/truncate/README.md +16 -12
  1333. package/src/truncate/{component.js → component.tsx} +13 -9
  1334. package/src/truncate/{hook.js → hook.ts} +8 -10
  1335. package/src/truncate/{index.js → index.ts} +0 -0
  1336. package/src/truncate/stories/index.tsx +49 -0
  1337. package/src/truncate/{styles.js → styles.ts} +0 -0
  1338. package/src/truncate/test/{index.js → index.tsx} +4 -4
  1339. package/src/truncate/types.ts +28 -10
  1340. package/src/truncate/{utils.js → utils.ts} +19 -19
  1341. package/src/ui/context/wordpress-component.ts +4 -5
  1342. package/src/ui/form-group/form-group-content.js +4 -4
  1343. package/src/ui/form-group/types.ts +1 -1
  1344. package/src/ui/utils/get-valid-children.ts +4 -2
  1345. package/src/unit-control/index.tsx +7 -9
  1346. package/src/unit-control/stories/index.tsx +8 -12
  1347. package/src/unit-control/test/index.tsx +4 -7
  1348. package/src/utils/hooks/stories/use-cx.js +8 -7
  1349. package/src/utils/hooks/test/use-controlled-state.js +2 -1
  1350. package/src/utils/math.js +14 -5
  1351. package/src/utils/test/math.js +22 -1
  1352. package/src/utils/unit-values.ts +2 -1
  1353. package/src/utils/values.js +2 -3
  1354. package/src/v-stack/README.md +6 -18
  1355. package/src/v-stack/{component.js → component.tsx} +15 -10
  1356. package/src/v-stack/{hook.js → hook.ts} +5 -6
  1357. package/src/v-stack/{index.js → index.ts} +0 -0
  1358. package/src/v-stack/stories/index.tsx +41 -0
  1359. package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1360. package/src/v-stack/test/{index.js → index.tsx} +0 -0
  1361. package/src/v-stack/types.ts +21 -1
  1362. package/src/visually-hidden/{component.js → component.tsx} +23 -15
  1363. package/src/visually-hidden/{index.js → index.ts} +0 -0
  1364. package/src/visually-hidden/stories/index.tsx +66 -0
  1365. package/src/visually-hidden/{styles.js → styles.ts} +6 -2
  1366. package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1367. package/src/visually-hidden/test/index.tsx +17 -0
  1368. package/src/visually-hidden/types.ts +11 -0
  1369. package/src/z-stack/README.md +14 -3
  1370. package/src/z-stack/component.tsx +24 -29
  1371. package/src/z-stack/stories/index.tsx +76 -0
  1372. package/src/z-stack/types.ts +33 -0
  1373. package/tsconfig.json +7 -0
  1374. package/tsconfig.tsbuildinfo +1 -1
  1375. package/src/border-control/stories/index.js +0 -119
  1376. package/src/color-indicator/index.js +0 -16
  1377. package/src/color-indicator/stories/index.js +0 -22
  1378. package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
  1379. package/src/external-link/stories/index.js +0 -23
  1380. package/src/form-toggle/index.js +0 -37
  1381. package/src/form-toggle/stories/index.js +0 -28
  1382. package/src/form-toggle/test/index.js +0 -75
  1383. package/src/form-token-field/index.js +0 -725
  1384. package/src/form-token-field/stories/index.js +0 -102
  1385. package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
  1386. package/src/form-token-field/token-input.js +0 -81
  1387. package/src/grid/stories/index.js +0 -49
  1388. package/src/h-stack/stories/index.js +0 -22
  1389. package/src/heading/test/index.js +0 -67
  1390. package/src/radio-control/index.js +0 -69
  1391. package/src/radio-control/stories/index.js +0 -41
  1392. package/src/range-control/stories/index.js +0 -180
  1393. package/src/range-control/test/index.js +0 -320
  1394. package/src/range-control/utils.js +0 -132
  1395. package/src/scrollable/test/index.js +0 -31
  1396. package/src/spacer/stories/index.js +0 -59
  1397. package/src/spacer/test/index.js +0 -146
  1398. package/src/spinner/stories/index.js +0 -43
  1399. package/src/text-highlight/index.js +0 -28
  1400. package/src/text-highlight/stories/index.js +0 -28
  1401. package/src/text-highlight/test/index.js +0 -120
  1402. package/src/tip/index.js +0 -24
  1403. package/src/tip/stories/index.js +0 -26
  1404. package/src/tree-select/index.js +0 -48
  1405. package/src/tree-select/stories/index.js +0 -80
  1406. package/src/truncate/stories/index.js +0 -38
  1407. package/src/visually-hidden/stories/index.js +0 -42
  1408. package/src/visually-hidden/test/index.js +0 -19
  1409. package/src/z-stack/stories/index.js +0 -70
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel/hook.ts"],"names":["DEFAULT_COLUMNS","generateMenuItems","panelItems","shouldReset","currentMenuItems","menuItems","default","optional","forEach","hasValue","isShownByDefault","label","group","existingItemValue","value","undefined","isMenuItemTypeEmpty","obj","Object","keys","length","useToolsPanel","props","className","resetAll","panelId","hasInnerWrapper","shouldRenderPlaceholderItems","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","otherProps","isResetting","wasResetting","current","setPanelItems","registerPanelItem","item","items","newItems","existingIndex","findIndex","oldItem","splice","deregisterPanelItem","index","setMenuItems","prevState","flagItemCustomization","newState","areAllOptionalControlsHidden","setAreAllOptionalControlsHidden","allControlsHidden","entries","some","isSelected","cx","classes","wrapperStyle","styles","ToolsPanelWithInnerWrapper","emptyStyle","ToolsPanelHiddenInnerWrapper","ToolsPanel","toggleItem","currentItem","find","menuGroup","newMenuItems","resetAllItems","filters","resetAllFilter","push","resetMenuItems","getFirstVisibleItemLabel","optionalItems","firstItem","firstDisplayedItem","lastDisplayedItem","reverse","panelContext","hasMenuItems"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;;;;;AAhBA;AACA;AACA;;AASA;AACA;AACA;AAYA,MAAMA,eAAe,GAAG,CAAxB;;AAEA,MAAMC,iBAAiB,GAAG,QAIQ;AAAA,MAJN;AAC3BC,IAAAA,UAD2B;AAE3BC,IAAAA,WAF2B;AAG3BC,IAAAA;AAH2B,GAIM;AACjC,QAAMC,SAA8B,GAAG;AAAEC,IAAAA,OAAO,EAAE,EAAX;AAAeC,IAAAA,QAAQ,EAAE;AAAzB,GAAvC;AAEAL,EAAAA,UAAU,CAACM,OAAX,CAAoB,SAA6C;AAAA;;AAAA,QAA3C;AAAEC,MAAAA,QAAF;AAAYC,MAAAA,gBAAZ;AAA8BC,MAAAA;AAA9B,KAA2C;AAChE,UAAMC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IAAAA,iBAPO;AAQPxE,IAAAA,SARO;AASPoB,IAAAA,OATO;AAUPU,IAAAA,iBAVO;AAWPR,IAAAA,4BAXO;AAYPC,IAAAA,mCAZO;AAaPC,IAAAA;AAbO,GAAR,CADoB,EAgBpB,CACCoB,4BADD,EAECN,mBAFD,EAGCiC,kBAHD,EAIC7B,qBAJD,EAKChB,WAAW,CAACE,OALb,EAMC4C,iBAND,EAOCxE,SAPD,EAQCoB,OARD,EASCvB,UATD,EAUCiC,iBAVD,EAWCR,4BAXD,EAYCC,mCAZD,EAaCC,kCAbD,CAhBoB,CAArB;AAiCA,SAAO,EACN,GAAGC,UADG;AAENiD,IAAAA,YAFM;AAGNX,IAAAA,aAHM;AAINL,IAAAA,UAJM;AAKNxC,IAAAA,SAAS,EAAEiC;AALL,GAAP;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type {\n\tToolsPanelItem,\n\tToolsPanelMenuItemKey,\n\tToolsPanelMenuItems,\n\tToolsPanelMenuItemsConfig,\n\tToolsPanelProps,\n} from '../types';\n\nconst DEFAULT_COLUMNS = 2;\n\nconst generateMenuItems = ( {\n\tpanelItems,\n\tshouldReset,\n\tcurrentMenuItems,\n}: ToolsPanelMenuItemsConfig ) => {\n\tconst menuItems: ToolsPanelMenuItems = { default: {}, optional: {} };\n\n\tpanelItems.forEach( ( { hasValue, isShownByDefault, label } ) => {\n\t\tconst group = isShownByDefault ? 'default' : 'optional';\n\n\t\t// If a menu item for this label already exists, do not overwrite its value.\n\t\t// This can cause default controls that have been flagged as customized to\n\t\t// lose their value.\n\t\tconst existingItemValue = currentMenuItems?.[ group ]?.[ label ];\n\t\tconst value =\n\t\t\texistingItemValue !== undefined ? existingItemValue : hasValue();\n\n\t\tmenuItems[ group ][ label ] = shouldReset ? false : value;\n\t} );\n\n\treturn menuItems;\n};\n\nconst isMenuItemTypeEmpty = (\n\tobj?: ToolsPanelMenuItems[ ToolsPanelMenuItemKey ]\n) => obj && Object.keys( obj ).length === 0;\n\nexport function useToolsPanel(\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tresetAll,\n\t\tpanelId,\n\t\thasInnerWrapper,\n\t\tshouldRenderPlaceholderItems,\n\t\t__experimentalFirstVisibleItemClass,\n\t\t__experimentalLastVisibleItemClass,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ToolsPanel' );\n\n\tconst isResetting = useRef( false );\n\tconst wasResetting = isResetting.current;\n\n\t// `isResetting` is cleared via this hook to effectively batch together\n\t// the resetAll task. Without this, the flag is cleared after the first\n\t// control updates and forces a rerender with subsequent controls then\n\t// believing they need to reset, unfortunately using stale data.\n\tuseEffect( () => {\n\t\tif ( wasResetting ) {\n\t\t\tisResetting.current = false;\n\t\t}\n\t}, [ wasResetting ] );\n\n\t// Allow panel items to register themselves.\n\tconst [ panelItems, setPanelItems ] = useState< ToolsPanelItem[] >( [] );\n\n\tconst registerPanelItem = useCallback(\n\t\t( item: ToolsPanelItem ) => {\n\t\t\tsetPanelItems( ( items ) => {\n\t\t\t\tconst newItems = [ ...items ];\n\t\t\t\t// If an item with this label has already been registered, remove it\n\t\t\t\t// first. This can happen when an item is moved between the default\n\t\t\t\t// and optional groups.\n\t\t\t\tconst existingIndex = newItems.findIndex(\n\t\t\t\t\t( oldItem ) => oldItem.label === item.label\n\t\t\t\t);\n\t\t\t\tif ( existingIndex !== -1 ) {\n\t\t\t\t\tnewItems.splice( existingIndex, 1 );\n\t\t\t\t}\n\t\t\t\treturn [ ...newItems, item ];\n\t\t\t} );\n\t\t},\n\t\t[ setPanelItems ]\n\t);\n\n\t// Panels need to deregister on unmount to avoid orphans in menu state.\n\t// This is an issue when panel items are being injected via SlotFills.\n\tconst deregisterPanelItem = useCallback(\n\t\t( label: string ) => {\n\t\t\t// When switching selections between components injecting matching\n\t\t\t// controls, e.g. both panels have a \"padding\" control, the\n\t\t\t// deregistration of the first panel doesn't occur until after the\n\t\t\t// registration of the next.\n\t\t\tsetPanelItems( ( items ) => {\n\t\t\t\tconst newItems = [ ...items ];\n\t\t\t\tconst index = newItems.findIndex(\n\t\t\t\t\t( item ) => item.label === label\n\t\t\t\t);\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\tnewItems.splice( index, 1 );\n\t\t\t\t}\n\t\t\t\treturn newItems;\n\t\t\t} );\n\t\t},\n\t\t[ setPanelItems ]\n\t);\n\n\t// Manage and share display state of menu items representing child controls.\n\tconst [ menuItems, setMenuItems ] = useState< ToolsPanelMenuItems >( {\n\t\tdefault: {},\n\t\toptional: {},\n\t} );\n\n\t// Setup menuItems state as panel items register themselves.\n\tuseEffect( () => {\n\t\tsetMenuItems( ( prevState ) => {\n\t\t\tconst items = generateMenuItems( {\n\t\t\t\tpanelItems,\n\t\t\t\tshouldReset: false,\n\t\t\t\tcurrentMenuItems: prevState,\n\t\t\t} );\n\t\t\treturn items;\n\t\t} );\n\t}, [ generateMenuItems, panelItems, setMenuItems ] );\n\n\t// Force a menu item to be checked.\n\t// This is intended for use with default panel items. They are displayed\n\t// separately to optional items and have different display states,\n\t// we need to update that when their value is customized.\n\tconst flagItemCustomization = useCallback(\n\t\t( label: string, group: ToolsPanelMenuItemKey = 'default' ) => {\n\t\t\tsetMenuItems( ( items ) => {\n\t\t\t\tconst newState = {\n\t\t\t\t\t...items,\n\t\t\t\t\t[ group ]: {\n\t\t\t\t\t\t...items[ group ],\n\t\t\t\t\t\t[ label ]: true,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn newState;\n\t\t\t} );\n\t\t},\n\t\t[ setMenuItems ]\n\t);\n\n\t// Whether all optional menu items are hidden or not must be tracked\n\t// in order to later determine if the panel display is empty and handle\n\t// conditional display of a plus icon to indicate the presence of further\n\t// menu items.\n\tconst [\n\t\tareAllOptionalControlsHidden,\n\t\tsetAreAllOptionalControlsHidden,\n\t] = useState( false );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\tisMenuItemTypeEmpty( menuItems?.default ) &&\n\t\t\t! isMenuItemTypeEmpty( menuItems?.optional )\n\t\t) {\n\t\t\tconst allControlsHidden = ! Object.entries(\n\t\t\t\tmenuItems.optional\n\t\t\t).some( ( [ , isSelected ] ) => isSelected );\n\t\t\tsetAreAllOptionalControlsHidden( allControlsHidden );\n\t\t}\n\t}, [ menuItems, setAreAllOptionalControlsHidden ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\tconst wrapperStyle =\n\t\t\thasInnerWrapper &&\n\t\t\tstyles.ToolsPanelWithInnerWrapper( DEFAULT_COLUMNS );\n\t\tconst emptyStyle =\n\t\t\tisMenuItemTypeEmpty( menuItems?.default ) &&\n\t\t\tareAllOptionalControlsHidden &&\n\t\t\tstyles.ToolsPanelHiddenInnerWrapper;\n\n\t\treturn cx( styles.ToolsPanel, wrapperStyle, emptyStyle, className );\n\t}, [\n\t\tareAllOptionalControlsHidden,\n\t\tclassName,\n\t\tcx,\n\t\thasInnerWrapper,\n\t\tmenuItems,\n\t] );\n\n\t// Toggle the checked state of a menu item which is then used to determine\n\t// display of the item within the panel.\n\tconst toggleItem = useCallback(\n\t\t( label: string ) => {\n\t\t\tconst currentItem = panelItems.find(\n\t\t\t\t( item ) => item.label === label\n\t\t\t);\n\n\t\t\tif ( ! currentItem ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst menuGroup = currentItem.isShownByDefault\n\t\t\t\t? 'default'\n\t\t\t\t: 'optional';\n\n\t\t\tconst newMenuItems = {\n\t\t\t\t...menuItems,\n\t\t\t\t[ menuGroup ]: {\n\t\t\t\t\t...menuItems[ menuGroup ],\n\t\t\t\t\t[ label ]: ! menuItems[ menuGroup ][ label ],\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tsetMenuItems( newMenuItems );\n\t\t},\n\t\t[ menuItems, panelItems, setMenuItems ]\n\t);\n\n\t// Resets display of children and executes resetAll callback if available.\n\tconst resetAllItems = useCallback( () => {\n\t\tif ( typeof resetAll === 'function' ) {\n\t\t\tisResetting.current = true;\n\n\t\t\t// Collect available reset filters from panel items.\n\t\t\tconst filters: Array< () => void > = [];\n\t\t\tpanelItems.forEach( ( item ) => {\n\t\t\t\tif ( item.resetAllFilter ) {\n\t\t\t\t\tfilters.push( item.resetAllFilter );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tresetAll( filters );\n\t\t}\n\n\t\t// Turn off display of all non-default items.\n\t\tconst resetMenuItems = generateMenuItems( {\n\t\t\tpanelItems,\n\t\t\tshouldReset: true,\n\t\t} );\n\t\tsetMenuItems( resetMenuItems );\n\t}, [\n\t\tgenerateMenuItems,\n\t\tisResetting.current,\n\t\tpanelItems,\n\t\tresetAll,\n\t\tsetMenuItems,\n\t] );\n\n\t// Assist ItemGroup styling when there are potentially hidden placeholder\n\t// items by identifying first & last items that are toggled on for display.\n\tconst getFirstVisibleItemLabel = ( items: ToolsPanelItem[] ) => {\n\t\tconst optionalItems = menuItems.optional || {};\n\t\tconst firstItem = items.find(\n\t\t\t( item ) => item.isShownByDefault || !! optionalItems[ item.label ]\n\t\t);\n\n\t\treturn firstItem?.label;\n\t};\n\n\tconst firstDisplayedItem = getFirstVisibleItemLabel( panelItems );\n\tconst lastDisplayedItem = getFirstVisibleItemLabel(\n\t\t[ ...panelItems ].reverse()\n\t);\n\n\tconst panelContext = useMemo(\n\t\t() => ( {\n\t\t\tareAllOptionalControlsHidden,\n\t\t\tderegisterPanelItem,\n\t\t\tfirstDisplayedItem,\n\t\t\tflagItemCustomization,\n\t\t\thasMenuItems: !! panelItems.length,\n\t\t\tisResetting: isResetting.current,\n\t\t\tlastDisplayedItem,\n\t\t\tmenuItems,\n\t\t\tpanelId,\n\t\t\tregisterPanelItem,\n\t\t\tshouldRenderPlaceholderItems,\n\t\t\t__experimentalFirstVisibleItemClass,\n\t\t\t__experimentalLastVisibleItemClass,\n\t\t} ),\n\t\t[\n\t\t\tareAllOptionalControlsHidden,\n\t\t\tderegisterPanelItem,\n\t\t\tfirstDisplayedItem,\n\t\t\tflagItemCustomization,\n\t\t\tisResetting.current,\n\t\t\tlastDisplayedItem,\n\t\t\tmenuItems,\n\t\t\tpanelId,\n\t\t\tpanelItems,\n\t\t\tregisterPanelItem,\n\t\t\tshouldRenderPlaceholderItems,\n\t\t\t__experimentalFirstVisibleItemClass,\n\t\t\t__experimentalLastVisibleItemClass,\n\t\t]\n\t);\n\n\treturn {\n\t\t...otherProps,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\tclassName: classes,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel/hook.ts"],"names":["DEFAULT_COLUMNS","generateMenuItems","panelItems","shouldReset","currentMenuItems","menuItems","default","optional","forEach","hasValue","isShownByDefault","label","group","existingItemValue","value","undefined","isMenuItemTypeEmpty","obj","Object","keys","length","useToolsPanel","props","className","resetAll","panelId","hasInnerWrapper","shouldRenderPlaceholderItems","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","otherProps","isResetting","wasResetting","current","setPanelItems","registerPanelItem","item","items","newItems","existingIndex","findIndex","oldItem","splice","deregisterPanelItem","index","setMenuItems","prevState","flagItemCustomization","newState","areAllOptionalControlsHidden","setAreAllOptionalControlsHidden","allControlsHidden","entries","some","isSelected","cx","classes","wrapperStyle","styles","ToolsPanelWithInnerWrapper","emptyStyle","ToolsPanelHiddenInnerWrapper","ToolsPanel","toggleItem","currentItem","find","menuGroup","newMenuItems","resetAllItems","filters","resetAllFilter","push","resetMenuItems","getFirstVisibleItemLabel","optionalItems","firstItem","firstDisplayedItem","lastDisplayedItem","reverse","panelContext","hasMenuItems"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;;;;;AAh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P,uBAAOA,SAAS,CAAEhE,KAAlB;AACA,GAPD;;AASA,QAAMiE,kBAAkB,GAAGH,wBAAwB,CAAEvE,UAAF,CAAnD;AACA,QAAM2E,iBAAiB,GAAGJ,wBAAwB,CACjD,CAAE,GAAGvE,UAAL,EAAkB4E,OAAlB,EADiD,CAAlD;AAIA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AACP9B,IAAAA,4BADO;AAEPN,IAAAA,mBAFO;AAGPiC,IAAAA,kBAHO;AAIP7B,IAAAA,qBAJO;AAKPiC,IAAAA,YAAY,EAAE,CAAC,CAAE9E,UAAU,CAACkB,MALrB;AAMPW,IAAAA,WAAW,EAAEA,WAAW,CAACE,OANlB;AAOP4C,IAAAA,iBAPO;AAQPxE,IAAAA,SARO;AASPoB,IAAAA,OATO;AAUPU,IAAAA,iBAVO;AAWPR,IAAAA,4BAXO;AAYPC,IAAAA,mCAZO;AAaPC,IAAAA;AAbO,GAAR,CADoB,EAgBpB,CACCoB,4BADD,EAECN,mBAFD,EAGCiC,kBAHD,EAIC7B,qBAJD,EAKChB,WAAW,CAACE,OALb,EAMC4C,iBAND,EAOCxE,SAPD,EAQCoB,OARD,EASCvB,UATD,EAUCiC,iBAVD,EAWCR,4BAXD,EAYCC,mCAZD,EAaCC,kCAbD,CAhBoB,CAArB;AAiCA,SAAO,EACN,GAAGC,UADG;AAENiD,IAAAA,YAFM;AAGNX,IAAAA,aAHM;AAINL,IAAAA,UAJM;AAKNxC,IAAAA,SAAS,EAAEiC;AALL,GAAP;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type {\n\tToolsPanelItem,\n\tToolsPanelMenuItemKey,\n\tToolsPanelMenuItems,\n\tToolsPanelMenuItemsConfig,\n\tToolsPanelProps,\n} from '../types';\n\nconst DEFAULT_COLUMNS = 2;\n\nconst generateMenuItems = ( {\n\tpanelItems,\n\tshouldReset,\n\tcurrentMenuItems,\n}: ToolsPanelMenuItemsConfig ) => {\n\tconst menuItems: ToolsPanelMenuItems = { default: {}, optional: {} };\n\n\tpanelItems.forEach( ( { hasValue, isShownByDefault, label } ) => {\n\t\tconst group = isShownByDefault ? 'default' : 'optional';\n\n\t\t// If a menu item for this label already exists, do not overwrite its value.\n\t\t// This can cause default controls that have been flagged as customized to\n\t\t// lose their value.\n\t\tconst existingItemValue = currentMenuItems?.[ group ]?.[ label ];\n\t\tconst value =\n\t\t\texistingItemValue !== undefined ? existingItemValue : hasValue();\n\n\t\tmenuItems[ group ][ label ] = shouldReset ? false : value;\n\t} );\n\n\treturn menuItems;\n};\n\nconst isMenuItemTypeEmpty = (\n\tobj?: ToolsPanelMenuItems[ ToolsPanelMenuItemKey ]\n) => obj && Object.keys( obj ).length === 0;\n\nexport function useToolsPanel(\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tresetAll,\n\t\tpanelId,\n\t\thasInnerWrapper,\n\t\tshouldRenderPlaceholderItems,\n\t\t__experimentalFirstVisibleItemClass,\n\t\t__experimentalLastVisibleItemClass,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ToolsPanel' );\n\n\tconst isResetting = useRef( false );\n\tconst wasResetting = isResetting.current;\n\n\t// `isResetting` is cleared via this hook to effectively batch together\n\t// the resetAll task. Without this, the flag is cleared after the first\n\t// control updates and forces a rerender with subsequent controls then\n\t// believing they need to reset, unfortunately using stale data.\n\tuseEffect( () => {\n\t\tif ( wasResetting ) {\n\t\t\tisResetting.current = false;\n\t\t}\n\t}, [ wasResetting ] );\n\n\t// Allow panel items to register themselves.\n\tconst [ panelItems, setPanelItems ] = useState< ToolsPanelItem[] >( [] );\n\n\tconst registerPanelItem = useCallback(\n\t\t( item: ToolsPanelItem ) => {\n\t\t\tsetPanelItems( ( items ) => {\n\t\t\t\tconst newItems = [ ...items ];\n\t\t\t\t// If an item with this label has already been registered, remove it\n\t\t\t\t// first. This can happen when an item is moved between the default\n\t\t\t\t// and optional groups.\n\t\t\t\tconst existingIndex = newItems.findIndex(\n\t\t\t\t\t( oldItem ) => oldItem.label === item.label\n\t\t\t\t);\n\t\t\t\tif ( existingIndex !== -1 ) {\n\t\t\t\t\tnewItems.splice( existingIndex, 1 );\n\t\t\t\t}\n\t\t\t\treturn [ ...newItems, item ];\n\t\t\t} );\n\t\t},\n\t\t[ setPanelItems ]\n\t);\n\n\t// Panels need to deregister on unmount to avoid orphans in menu state.\n\t// This is an issue when panel items are being injected via SlotFills.\n\tconst deregisterPanelItem = useCallback(\n\t\t( label: string ) => {\n\t\t\t// When switching selections between components injecting matching\n\t\t\t// controls, e.g. both panels have a \"padding\" control, the\n\t\t\t// deregistration of the first panel doesn't occur until after the\n\t\t\t// registration of the next.\n\t\t\tsetPanelItems( ( items ) => {\n\t\t\t\tconst newItems = [ ...items ];\n\t\t\t\tconst index = newItems.findIndex(\n\t\t\t\t\t( item ) => item.label === label\n\t\t\t\t);\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\tnewItems.splice( index, 1 );\n\t\t\t\t}\n\t\t\t\treturn newItems;\n\t\t\t} );\n\t\t},\n\t\t[ setPanelItems ]\n\t);\n\n\t// Manage and share display state of menu items representing child controls.\n\tconst [ menuItems, setMenuItems ] = useState< ToolsPanelMenuItems >( {\n\t\tdefault: {},\n\t\toptional: {},\n\t} );\n\n\t// Setup menuItems state as panel items register themselves.\n\tuseEffect( () => {\n\t\tsetMenuItems( ( prevState ) => {\n\t\t\tconst items = generateMenuItems( {\n\t\t\t\tpanelItems,\n\t\t\t\tshouldReset: false,\n\t\t\t\tcurrentMenuItems: prevState,\n\t\t\t} );\n\t\t\treturn items;\n\t\t} );\n\t}, [ generateMenuItems, panelItems, setMenuItems ] );\n\n\t// Force a menu item to be checked.\n\t// This is intended for use with default panel items. They are displayed\n\t// separately to optional items and have different display states,\n\t// we need to update that when their value is customized.\n\tconst flagItemCustomization = useCallback(\n\t\t( label: string, group: ToolsPanelMenuItemKey = 'default' ) => {\n\t\t\tsetMenuItems( ( items ) => {\n\t\t\t\tconst newState = {\n\t\t\t\t\t...items,\n\t\t\t\t\t[ group ]: {\n\t\t\t\t\t\t...items[ group ],\n\t\t\t\t\t\t[ label ]: true,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn newState;\n\t\t\t} );\n\t\t},\n\t\t[ setMenuItems ]\n\t);\n\n\t// Whether all optional menu items are hidden or not must be tracked\n\t// in order to later determine if the panel display is empty and handle\n\t// conditional display of a plus icon to indicate the presence of further\n\t// menu items.\n\tconst [ areAllOptionalControlsHidden, setAreAllOptionalControlsHidden ] =\n\t\tuseState( false );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\tisMenuItemTypeEmpty( menuItems?.default ) &&\n\t\t\t! isMenuItemTypeEmpty( menuItems?.optional )\n\t\t) {\n\t\t\tconst allControlsHidden = ! Object.entries(\n\t\t\t\tmenuItems.optional\n\t\t\t).some( ( [ , isSelected ] ) => isSelected );\n\t\t\tsetAreAllOptionalControlsHidden( allControlsHidden );\n\t\t}\n\t}, [ menuItems, setAreAllOptionalControlsHidden ] );\n\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\tconst wrapperStyle =\n\t\t\thasInnerWrapper &&\n\t\t\tstyles.ToolsPanelWithInnerWrapper( DEFAULT_COLUMNS );\n\t\tconst emptyStyle =\n\t\t\tisMenuItemTypeEmpty( menuItems?.default ) &&\n\t\t\tareAllOptionalControlsHidden &&\n\t\t\tstyles.ToolsPanelHiddenInnerWrapper;\n\n\t\treturn cx( styles.ToolsPanel, wrapperStyle, emptyStyle, className );\n\t}, [\n\t\tareAllOptionalControlsHidden,\n\t\tclassName,\n\t\tcx,\n\t\thasInnerWrapper,\n\t\tmenuItems,\n\t] );\n\n\t// Toggle the checked state of a menu item which is then used to determine\n\t// display of the item within the panel.\n\tconst toggleItem = useCallback(\n\t\t( label: string ) => {\n\t\t\tconst currentItem = panelItems.find(\n\t\t\t\t( item ) => item.label === label\n\t\t\t);\n\n\t\t\tif ( ! currentItem ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst menuGroup = currentItem.isShownByDefault\n\t\t\t\t? 'default'\n\t\t\t\t: 'optional';\n\n\t\t\tconst newMenuItems = {\n\t\t\t\t...menuItems,\n\t\t\t\t[ menuGroup ]: {\n\t\t\t\t\t...menuItems[ menuGroup ],\n\t\t\t\t\t[ label ]: ! menuItems[ menuGroup ][ label ],\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tsetMenuItems( newMenuItems );\n\t\t},\n\t\t[ menuItems, panelItems, setMenuItems ]\n\t);\n\n\t// Resets display of children and executes resetAll callback if available.\n\tconst resetAllItems = useCallback( () => {\n\t\tif ( typeof resetAll === 'function' ) {\n\t\t\tisResetting.current = true;\n\n\t\t\t// Collect available reset filters from panel items.\n\t\t\tconst filters: Array< () => void > = [];\n\t\t\tpanelItems.forEach( ( item ) => {\n\t\t\t\tif ( item.resetAllFilter ) {\n\t\t\t\t\tfilters.push( item.resetAllFilter );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tresetAll( filters );\n\t\t}\n\n\t\t// Turn off display of all non-default items.\n\t\tconst resetMenuItems = generateMenuItems( {\n\t\t\tpanelItems,\n\t\t\tshouldReset: true,\n\t\t} );\n\t\tsetMenuItems( resetMenuItems );\n\t}, [\n\t\tgenerateMenuItems,\n\t\tisResetting.current,\n\t\tpanelItems,\n\t\tresetAll,\n\t\tsetMenuItems,\n\t] );\n\n\t// Assist ItemGroup styling when there are potentially hidden placeholder\n\t// items by identifying first & last items that are toggled on for display.\n\tconst getFirstVisibleItemLabel = ( items: ToolsPanelItem[] ) => {\n\t\tconst optionalItems = menuItems.optional || {};\n\t\tconst firstItem = items.find(\n\t\t\t( item ) => item.isShownByDefault || !! optionalItems[ item.label ]\n\t\t);\n\n\t\treturn firstItem?.label;\n\t};\n\n\tconst firstDisplayedItem = getFirstVisibleItemLabel( panelItems );\n\tconst lastDisplayedItem = getFirstVisibleItemLabel(\n\t\t[ ...panelItems ].reverse()\n\t);\n\n\tconst panelContext = useMemo(\n\t\t() => ( {\n\t\t\tareAllOptionalControlsHidden,\n\t\t\tderegisterPanelItem,\n\t\t\tfirstDisplayedItem,\n\t\t\tflagItemCustomization,\n\t\t\thasMenuItems: !! panelItems.length,\n\t\t\tisResetting: isResetting.current,\n\t\t\tlastDisplayedItem,\n\t\t\tmenuItems,\n\t\t\tpanelId,\n\t\t\tregisterPanelItem,\n\t\t\tshouldRenderPlaceholderItems,\n\t\t\t__experimentalFirstVisibleItemClass,\n\t\t\t__experimentalLastVisibleItemClass,\n\t\t} ),\n\t\t[\n\t\t\tareAllOptionalControlsHidden,\n\t\t\tderegisterPanelItem,\n\t\t\tfirstDisplayedItem,\n\t\t\tflagItemCustomization,\n\t\t\tisResetting.current,\n\t\t\tlastDisplayedItem,\n\t\t\tmenuItems,\n\t\t\tpanelId,\n\t\t\tpanelItems,\n\t\t\tregisterPanelItem,\n\t\t\tshouldRenderPlaceholderItems,\n\t\t\t__experimentalFirstVisibleItemClass,\n\t\t\t__experimentalLastVisibleItemClass,\n\t\t]\n\t);\n\n\treturn {\n\t\t...otherProps,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\tclassName: classes,\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-header/hook.ts"],"names":["useToolsPanelHeader","props","className","otherProps","cx","classes","styles","ToolsPanelHeader","dropdownMenuClassName","DropdownMenu","headingClassName","ToolsPanelHeading","menuItems","hasMenuItems","areAllOptionalControlsHidden"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAOO,SAASA,mBAAT,CACNC,KADM,EAEL;AACD,QAAM;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,MAA+B,gCACpCF,KADoC,EAEpC,kBAFoC,CAArC;AAKA,QAAMG,EAAE,GAAG,mBAAX;AACA,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAOD,EAAE,CAAEE,MAAM,CAACC,gBAAT,EAA2BL,SAA3B,CAAT;AACA,GAFe,EAEb,CAAEA,SAAF,EAAaE,EAAb,CAFa,CAAhB;AAIA,QAAMI,qBAAqB,GAAG,sBAAS,MAAM;AAC5C,WAAOJ,EAAE,CAAEE,MAAM,CAACG,YAAT,CAAT;AACA,GAF6B,EAE3B,CAAEL,EAAF,CAF2B,CAA9B;AAIA,QAAMM,gBAAgB,GAAG,sBAAS,MAAM;AACvC,WAAON,EAAE,CAAEE,MAAM,CAACK,iBAAT,CAAT;AACA,GAFwB,EAEtB,CAAEP,EAAF,CAFsB,CAAzB;AAIA,QAAM;AACLQ,IAAAA,SADK;AAELC,IAAAA,YAFK;AAGLC,IAAAA;AAHK,MAIF,oCAJJ;AAMA,SAAO,EACN,GAAGX,UADG;AAENW,IAAAA,4BAFM;AAGNN,IAAAA,qBAHM;AAINK,IAAAA,YAJM;AAKNH,IAAAA,gBALM;AAMNE,IAAAA,SANM;AAONV,IAAAA,SAAS,EAAEG;AAPL,GAAP;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { ToolsPanelHeaderProps } from '../types';\n\nexport function useToolsPanelHeader(\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >\n) {\n\tconst { className, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'ToolsPanelHeader'\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.ToolsPanelHeader, className );\n\t}, [ className, cx ] );\n\n\tconst dropdownMenuClassName = useMemo( () => {\n\t\treturn cx( styles.DropdownMenu );\n\t}, [ cx ] );\n\n\tconst headingClassName = useMemo( () => {\n\t\treturn cx( styles.ToolsPanelHeading );\n\t}, [ cx ] );\n\n\tconst {\n\t\tmenuItems,\n\t\thasMenuItems,\n\t\tareAllOptionalControlsHidden,\n\t} = useToolsPanelContext();\n\n\treturn {\n\t\t...otherProps,\n\t\tareAllOptionalControlsHidden,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\tmenuItems,\n\t\tclassName: classes,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tools-panel/tools-panel-header/hook.ts"],"names":["useToolsPanelHeader","props","className","otherProps","cx","classes","styles","ToolsPanelHeader","dropdownMenuClassName","DropdownMenu","headingClassName","ToolsPanelHeading","menuItems","hasMenuItems","areAllOptionalControlsHidden"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAOO,SAASA,mBAAT,CACNC,KADM,EAEL;AACD,QAAM;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,MAA+B,gCACpCF,KADoC,EAEpC,kBAFoC,CAArC;AAKA,QAAMG,EAAE,GAAG,mBAAX;AACA,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAOD,EAAE,CAAEE,MAAM,CAACC,gBAAT,EAA2BL,SAA3B,CAAT;AACA,GAFe,EAEb,CAAEA,SAAF,EAAaE,EAAb,CAFa,CAAhB;AAIA,QAAMI,qBAAqB,GAAG,sBAAS,MAAM;AAC5C,WAAOJ,EAAE,CAAEE,MAAM,CAACG,YAAT,CAAT;AACA,GAF6B,EAE3B,CAAEL,EAAF,CAF2B,CAA9B;AAIA,QAAMM,gBAAgB,GAAG,sBAAS,MAAM;AACvC,WAAON,EAAE,CAAEE,MAAM,CAACK,iBAAT,CAAT;AACA,GAFwB,EAEtB,CAAEP,EAAF,CAFsB,CAAzB;AAIA,QAAM;AAAEQ,IAAAA,SAAF;AAAaC,IAAAA,YAAb;AAA2BC,IAAAA;AAA3B,MACL,oCADD;AAGA,SAAO,EACN,GAAGX,UADG;AAENW,IAAAA,4BAFM;AAGNN,IAAAA,qBAHM;AAINK,IAAAA,YAJM;AAKNH,IAAAA,gBALM;AAMNE,IAAAA,SANM;AAONV,IAAAA,SAAS,EAAEG;AAPL,GAAP;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { useToolsPanelContext } from '../context';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { ToolsPanelHeaderProps } from '../types';\n\nexport function useToolsPanelHeader(\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >\n) {\n\tconst { className, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'ToolsPanelHeader'\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.ToolsPanelHeader, className );\n\t}, [ className, cx ] );\n\n\tconst dropdownMenuClassName = useMemo( () => {\n\t\treturn cx( styles.DropdownMenu );\n\t}, [ cx ] );\n\n\tconst headingClassName = useMemo( () => {\n\t\treturn cx( styles.ToolsPanelHeading );\n\t}, [ cx ] );\n\n\tconst { menuItems, hasMenuItems, areAllOptionalControlsHidden } =\n\t\tuseToolsPanelContext();\n\n\treturn {\n\t\t...otherProps,\n\t\tareAllOptionalControlsHidden,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\tmenuItems,\n\t\tclassName: classes,\n\t};\n}\n"]}
@@ -80,7 +80,8 @@ const addPopoverToGrandchildren = _ref3 => {
80
80
  className: "components-tooltip",
81
81
  "aria-hidden": "true",
82
82
  animate: false,
83
- offset: 12
83
+ offset: 12,
84
+ __unstableShift: true
84
85
  }, text, (0, _element.createElement)(_shortcut.default, {
85
86
  className: "components-tooltip__shortcut",
86
87
  shortcut: shortcut
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","children","getRegularElement","addPopoverToGrandchildren","grandchildren","isOver","position","text","shortcut","emitToChild","eventName","event","Children","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","createMouseDown","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";;;;;;;;;AASA;;AALA;;AAYA;;AAKA;;AACA;;AAtBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAG,GAAtB;;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG;AAAA,MAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA,KAAjB;AAAwBC,IAAAA;AAAxB,GAAF;AAAA,SAC1B,2BACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,2BAAcJ,YAAd,EAA4BE,aAA5B,CADH,EAEG,2BAAcC,KAAd,EAAqB;AACtBE,IAAAA,QAAQ,EAAED;AADY,GAArB,CAFH,CADD,EAOCF,aAPD,CAD0B;AAAA,CAA3B;;AAWA,MAAMI,iBAAiB,GAAG;AAAA,MAAE;AAAEH,IAAAA,KAAF;AAASD,IAAAA,aAAT;AAAwBE,IAAAA;AAAxB,GAAF;AAAA,SACzB,2BAAcD,KA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ANR,GAAtB;;AASA,QAAM9B,KAAK,GAAGa,kBAASE,IAAT,CAAeb,QAAf,CAAd;;AACA,QAAM;AAAEA,IAAAA,QAAQ,EAAEG,aAAZ;AAA2BY,IAAAA;AAA3B,MAAwCjB,KAAK,CAACgB,KAApD;AACA,QAAMiC,qBAAqB,GAAGhC,QAAQ,GACnCnB,kBADmC,GAEnCK,iBAFH;AAIA,QAAM+C,WAAW,GAAG;AACnB5C,IAAAA,MADmB;AAEnBC,IAAAA,QAFmB;AAGnBC,IAAAA,IAHmB;AAInBC,IAAAA;AAJmB,GAApB;AAMA,QAAMR,mBAAmB,GAAGG,yBAAyB,CAAE;AACtDC,IAAAA,aADsD;AAEtD,OAAG6C;AAFmD,GAAF,CAArD;AAKA,SAAOD,qBAAqB,CAAE;AAC7BjD,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA;AAH6B,GAAF,CAA5B;AAKA;;eAEciB,O","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( { eventHandlers, child, childrenWithPopover } ) =>\n\tcloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t} ) }\n\t\t</span>,\n\t\teventHandlers\n\t);\n\nconst getRegularElement = ( { child, eventHandlers, childrenWithPopover } ) =>\n\tcloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t} );\n\nconst addPopoverToGrandchildren = ( {\n\tgrandchildren,\n\tisOver,\n\tposition,\n\ttext,\n\tshortcut,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ 12 }\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = includes( [ 'focus', 'mouseenter' ], event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tisOver,\n\t\tposition,\n\t\ttext,\n\t\tshortcut,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t} );\n}\n\nexport default Tooltip;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","children","getRegularElement","addPopoverToGrandchildren","grandchildren","isOver","position","text","shortcut","emitToChild","eventName","event","Children","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","createMouseDown","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";;;;;;;;;AASA;;AALA;;AAYA;;AAKA;;AACA;;AAtBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAG,GAAtB;;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG;AAAA,MAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA,KAAjB;AAAwBC,IAAAA;AAAxB,GAAF;AAAA,SAC1B,2BACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,2BAAcJ,YAAd,EAA4BE,aAA5B,CADH,EAEG,2BAAcC,KAAd,EAAqB;AACtBE,IAAAA,QAAQ,EAAED;AADY,GAArB,CAFH,CADD,EAOCF,aAPD,CAD0B;AAAA,CAA3B;;AAWA,MAAMI,iBAAiB,GAAG;AAAA,MAAE;AAAEH,IAAAA,KAAF;AAASD,IAAAA,aAAT;AAAwBE,IAAAA;AAAxB,GAAF;AAAA,SACzB,2BAAcD,KAAd,EAAqB,EACpB,GAAGD,aADiB;AAEpBG,IAAAA,QAAQ,EAAED;AAFU,GAArB,CADyB;AAAA,CAA1B;;AAMA,MAAMG,yBAAyB,GAAG;AAAA,MAAE;AACnCC,IAAAA,aADmC;AAEnCC,IAAAA,MAFmC;AAGnCC,IAAAA,QAHmC;AAInCC,IAAAA,IAJmC;AAKnCC,IAAAA;AALmC,GAAF;AAAA,SAOjC,6BACCJ,aADD,EAECC,MAAM,IACL,4BAAC,gBAAD;AACC,IAAA,YAAY,EAAG,KADhB;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,SAAS,EAAC,oBAHX;AAIC,mBAAY,MAJb;AAKC,IAAA,OAAO,EAAG,KAL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,aADsD;AAEtD,OAAG6C;AAFmD,GAAF,CAArD;AAKA,SAAOD,qBAAqB,CAAE;AAC7BjD,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA;AAH6B,GAAF,CAA5B;AAKA;;eAEciB,O","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( { eventHandlers, child, childrenWithPopover } ) =>\n\tcloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t} ) }\n\t\t</span>,\n\t\teventHandlers\n\t);\n\nconst getRegularElement = ( { child, eventHandlers, childrenWithPopover } ) =>\n\tcloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t} );\n\nconst addPopoverToGrandchildren = ( {\n\tgrandchildren,\n\tisOver,\n\tposition,\n\ttext,\n\tshortcut,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ 12 }\n\t\t\t\t__unstableShift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = includes( [ 'focus', 'mouseenter' ], event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tisOver,\n\t\tposition,\n\t\ttext,\n\t\tshortcut,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t} );\n}\n\nexport default Tooltip;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.js"],"names":["RovingTabIndexItem","forwardedRef","children","as","Component","props","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;eAGe,yBAAY,SAASA,kBAAT,OAE1BC,YAF0B,EAGzB;AAAA,MAFD;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,EAAE,EAAEC,SAAhB;AAA2B,OAAGC;AAA9B,GAEC;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGN,YAAY,IAAIK,QAA5B;AACA,QAAM;AACLE,IAAAA,kBADK;AAELC,IAAAA;AAFK,MAGF,sDAHJ;AAIA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GAAGF,kBAAkB,KAAKD,GAAG,CAACI,OAA3B,GAAqC,CAArC,GAAyC,CAAC,CAArD;AACA;;AAED,QAAMC,OAAO,GAAKC,KAAF,IAAaJ,qBAAqB,CAAEI,KAAK,CAACC,MAAR,CAAlD;;AACA,QAAMC,QAAQ,GAAG;AAAER,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBE,IAAAA,OAAjB;AAA0B,OAAGP;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEa,QAAF,CAAf;AACA;;AAED,SAAO,4BAAC,SAAD,EAAgBA,QAAhB,EAA6Bb,QAA7B,CAAP;AACA,CAxBc,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\n\nexport default forwardRef( function RovingTabIndexItem(\n\t{ children, as: Component, ...props },\n\tforwardedRef\n) {\n\tconst localRef = useRef();\n\tconst ref = forwardedRef || localRef;\n\tconst {\n\t\tlastFocusedElement,\n\t\tsetLastFocusedElement,\n\t} = useRovingTabIndexContext();\n\tlet tabIndex;\n\n\tif ( lastFocusedElement ) {\n\t\ttabIndex = lastFocusedElement === ref.current ? 0 : -1;\n\t}\n\n\tconst onFocus = ( event ) => setLastFocusedElement( event.target );\n\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\tif ( typeof children === 'function' ) {\n\t\treturn children( allProps );\n\t}\n\n\treturn <Component { ...allProps }>{ children }</Component>;\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/roving-tab-index-item.js"],"names":["RovingTabIndexItem","forwardedRef","children","as","Component","props","localRef","ref","lastFocusedElement","setLastFocusedElement","tabIndex","current","onFocus","event","target","allProps"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;eAGe,yBAAY,SAASA,kBAAT,OAE1BC,YAF0B,EAGzB;AAAA,MAFD;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,EAAE,EAAEC,SAAhB;AAA2B,OAAGC;AAA9B,GAEC;AACD,QAAMC,QAAQ,GAAG,sBAAjB;AACA,QAAMC,GAAG,GAAGN,YAAY,IAAIK,QAA5B;AACA,QAAM;AAAEE,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,sDADD;AAEA,MAAIC,QAAJ;;AAEA,MAAKF,kBAAL,EAA0B;AACzBE,IAAAA,QAAQ,GAAGF,kBAAkB,KAAKD,GAAG,CAACI,OAA3B,GAAqC,CAArC,GAAyC,CAAC,CAArD;AACA;;AAED,QAAMC,OAAO,GAAKC,KAAF,IAAaJ,qBAAqB,CAAEI,KAAK,CAACC,MAAR,CAAlD;;AACA,QAAMC,QAAQ,GAAG;AAAER,IAAAA,GAAF;AAAOG,IAAAA,QAAP;AAAiBE,IAAAA,OAAjB;AAA0B,OAAGP;AAA7B,GAAjB;;AAEA,MAAK,OAAOH,QAAP,KAAoB,UAAzB,EAAsC;AACrC,WAAOA,QAAQ,CAAEa,QAAF,CAAf;AACA;;AAED,SAAO,4BAAC,SAAD,EAAgBA,QAAhB,EAA6Bb,QAA7B,CAAP;AACA,CAtBc,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useRovingTabIndexContext } from './roving-tab-index-context';\n\nexport default forwardRef( function RovingTabIndexItem(\n\t{ children, as: Component, ...props },\n\tforwardedRef\n) {\n\tconst localRef = useRef();\n\tconst ref = forwardedRef || localRef;\n\tconst { lastFocusedElement, setLastFocusedElement } =\n\t\tuseRovingTabIndexContext();\n\tlet tabIndex;\n\n\tif ( lastFocusedElement ) {\n\t\ttabIndex = lastFocusedElement === ref.current ? 0 : -1;\n\t}\n\n\tconst onFocus = ( event ) => setLastFocusedElement( event.target );\n\tconst allProps = { ref, tabIndex, onFocus, ...props };\n\n\tif ( typeof children === 'function' ) {\n\t\treturn children( allProps );\n\t}\n\n\treturn <Component { ...allProps }>{ children }</Component>;\n} );\n"]}
@@ -5,7 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = TreeSelect;
8
+ exports.TreeSelect = TreeSelect;
9
+ exports.default = void 0;
9
10
 
10
11
  var _element = require("@wordpress/element");
11
12
 
@@ -13,7 +14,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
14
 
14
15
  var _lodash = require("lodash");
15
16
 
16
- var _ = require("../");
17
+ var _selectControl = require("../select-control");
17
18
 
18
19
  /**
19
20
  * External dependencies
@@ -28,11 +29,60 @@ var _ = require("../");
28
29
  */
29
30
  function getSelectOptions(tree) {
30
31
  let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
31
- return (0, _lodash.flatMap)(tree, treeNode => [{
32
+ return tree.flatMap(treeNode => [{
32
33
  value: treeNode.id,
33
- label: (0, _lodash.repeat)('\u00A0', level * 3) + (0, _lodash.unescape)(treeNode.name)
34
+ label: '\u00A0'.repeat(level * 3) + (0, _lodash.unescape)(treeNode.name)
34
35
  }, ...getSelectOptions(treeNode.children || [], level + 1)]);
35
36
  }
37
+ /**
38
+ * TreeSelect component is used to generate select input fields.
39
+ *
40
+ * @example
41
+ * ```jsx
42
+ * import { TreeSelect } from '@wordpress/components';
43
+ * import { useState } from '@wordpress/element';
44
+ *
45
+ * const MyTreeSelect = () => {
46
+ * const [ page, setPage ] = useState( 'p21' );
47
+ *
48
+ * return (
49
+ * <TreeSelect
50
+ * label="Parent page"
51
+ * noOptionLabel="No parent page"
52
+ * onChange={ ( newPage ) => setPage( newPage ) }
53
+ * selectedId={ page }
54
+ * tree={ [
55
+ * {
56
+ * name: 'Page 1',
57
+ * id: 'p1',
58
+ * children: [
59
+ * { name: 'Descend 1 of page 1', id: 'p11' },
60
+ * { name: 'Descend 2 of page 1', id: 'p12' },
61
+ * ],
62
+ * },
63
+ * {
64
+ * name: 'Page 2',
65
+ * id: 'p2',
66
+ * children: [
67
+ * {
68
+ * name: 'Descend 1 of page 2',
69
+ * id: 'p21',
70
+ * children: [
71
+ * {
72
+ * name: 'Descend 1 of Descend 1 of page 2',
73
+ * id: 'p211',
74
+ * },
75
+ * ],
76
+ * },
77
+ * ],
78
+ * },
79
+ * ] }
80
+ * />
81
+ * );
82
+ * }
83
+ * ```
84
+ */
85
+
36
86
 
37
87
  function TreeSelect(_ref) {
38
88
  let {
@@ -40,7 +90,7 @@ function TreeSelect(_ref) {
40
90
  noOptionLabel,
41
91
  onChange,
42
92
  selectedId,
43
- tree,
93
+ tree = [],
44
94
  ...props
45
95
  } = _ref;
46
96
  const options = (0, _element.useMemo)(() => {
@@ -49,11 +99,14 @@ function TreeSelect(_ref) {
49
99
  label: noOptionLabel
50
100
  }, ...getSelectOptions(tree)]);
51
101
  }, [noOptionLabel, tree]);
52
- return (0, _element.createElement)(_.SelectControl, (0, _extends2.default)({
102
+ return (0, _element.createElement)(_selectControl.SelectControl, (0, _extends2.default)({
53
103
  label,
54
104
  options,
55
105
  onChange,
56
106
  value: selectedId
57
107
  }, props));
58
108
  }
109
+
110
+ var _default = TreeSelect;
111
+ exports.default = _default;
59
112
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-select/index.js"],"names":["getSelectOptions","tree","level","treeNode","value","id","label","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AASA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAGA,SAASA,gBAAT,CAA2BC,IAA3B,EAA6C;AAAA,MAAZC,KAAY,uEAAJ,CAAI;AAC5C,SAAO,qBAASD,IAAT,EAAiBE,QAAF,IAAgB,CACrC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,oBAAQ,QAAR,EAAkBJ,KAAK,GAAG,CAA1B,IAAgC,sBAAgBC,QAAQ,CAACI,IAAzB;AAHlC,GADqC,EAMrC,GAAGP,gBAAgB,CAAEG,QAAQ,CAACK,QAAT,IAAqB,EAAvB,EAA2BN,KAAK,GAAG,CAAnC,CANkB,CAA/B,CAAP;AAQA;;AAEc,SAASO,UAAT,OAOX;AAAA,MAPgC;AACnCH,IAAAA,KADmC;AAEnCI,IAAAA,aAFmC;AAGnCC,IAAAA,QAHmC;AAInCC,IAAAA,UAJmC;AAKnCX,IAAAA,IALmC;AAMnC,OAAGY;AANgC,GAOhC;AACH,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO,qBAAS,CACfJ,aAAa,IAAI;AAAEN,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEI;AAApB,KADF,EAEf,GAAGV,gBAAgB,CAAEC,IAAF,CAFJ,CAAT,CAAP;AAIA,GALe,EAKb,CAAES,aAAF,EAAiBT,IAAjB,CALa,CAAhB;AAOA,SACC,4BAAC,eAAD;AACQK,IAAAA,KADR;AACeQ,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA","sourcesContent":["/**\n * External dependencies\n */\nimport { unescape as unescapeString, repeat, flatMap, compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../';\n\nfunction getSelectOptions( tree, level = 0 ) {\n\treturn flatMap( tree, ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\trepeat( '\\u00A0', level * 3 ) + unescapeString( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\nexport default function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree,\n\t...props\n} ) {\n\tconst options = useMemo( () => {\n\t\treturn compact( [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t] );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AASA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAIA,SAASA,gBAAT,CAA2BC,IAA3B,EAAoE;AAAA,MAA3BC,KAA2B,uEAAnB,CAAmB;AACnE,SAAOD,IAAI,CAACE,OAAL,CAAgBC,QAAF,IAAgB,CACpC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,SAASC,MAAT,CAAiBN,KAAK,GAAG,CAAzB,IAA+B,sBAAgBE,QAAQ,CAACK,IAAzB;AAHjC,GADoC,EAMpC,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAT,IAAqB,EAAvB,EAA2BR,KAAK,GAAG,CAAnC,CANiB,CAA9B,CAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASS,UAAT,OAOc;AAAA,MAPO;AAC3BJ,IAAAA,KAD2B;AAE3BK,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,UAJ2B;AAK3Bb,IAAAA,IAAI,GAAG,EALoB;AAM3B,OAAGc;AANwB,GAOP;AACpB,QAAMC,OAAO,GAAG,sBAAS,MAAM;AAC9B,WAAO,qBAAS,CACfJ,aAAa,IAAI;AAAEP,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEK;AAApB,KADF,EAEf,GAAGZ,gBAAgB,CAAEC,IAAF,CAFJ,CAAT,CAAP;AAIA,GALe,EAKb,CAAEW,aAAF,EAAiBX,IAAjB,CALa,CAAhB;AAOA,SACC,4BAAC,4BAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA;;eAEcJ,U","sourcesContent":["/**\n * External dependencies\n */\nimport { unescape as unescapeString, compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, SelectOptions } from './types';\n\nfunction getSelectOptions( tree: Tree[], level = 0 ): SelectOptions {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + unescapeString( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\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( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn compact( [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t] );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.Truncate = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -18,14 +18,13 @@ var _view = require("../view");
18
18
  var _hook = _interopRequireDefault(require("./hook"));
19
19
 
20
20
  /**
21
- * Internal dependencies
21
+ * External dependencies
22
22
  */
23
23
 
24
24
  /**
25
- * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props
26
- * @param {import('react').ForwardedRef<any>} forwardedRef
25
+ * Internal dependencies
27
26
  */
28
- function Truncate(props, forwardedRef) {
27
+ function UnconnectedTruncate(props, forwardedRef) {
29
28
  const truncateProps = (0, _hook.default)(props);
30
29
  return (0, _element.createElement)(_view.View, (0, _extends2.default)({
31
30
  as: "span"
@@ -39,7 +38,6 @@ function Truncate(props, forwardedRef) {
39
38
  * `Subheading` is used to render text content. However,`Truncate` is
40
39
  * available for custom implementations.
41
40
  *
42
- * @example
43
41
  * ```jsx
44
42
  * import { __experimentalTruncate as Truncate } from `@wordpress/components`;
45
43
  *
@@ -56,7 +54,8 @@ function Truncate(props, forwardedRef) {
56
54
  */
57
55
 
58
56
 
59
- const ConnectedTruncate = (0, _context.contextConnect)(Truncate, 'Truncate');
60
- var _default = ConnectedTruncate;
57
+ const Truncate = (0, _context.contextConnect)(UnconnectedTruncate, 'Truncate');
58
+ exports.Truncate = Truncate;
59
+ var _default = Truncate;
61
60
  exports.default = _default;
62
61
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/component.js"],"names":["Truncate","props","forwardedRef","truncateProps","ConnectedTruncate"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAyC;AACxC,QAAMC,aAAa,GAAG,mBAAaF,KAAb,CAAtB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,aAArB;AAAqC,IAAA,GAAG,EAAGD;AAA3C,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,iBAAiB,GAAG,6BAAgBJ,QAAhB,EAA0B,UAA1B,CAA1B;eAEeI,iB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../ui/context';\nimport { View } from '../view';\nimport useTruncate from './hook';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Truncate( props, forwardedRef ) {\n\tconst truncateProps = useTruncate( props );\n\n\treturn <View as=\"span\" { ...truncateProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Truncate` is a typography primitive that trims text content.\n * For almost all cases, it is recommended that `Text`, `Heading`, or\n * `Subheading` is used to render text content. However,`Truncate` is\n * available for custom implementations.\n *\n * @example\n * ```jsx\n * import { __experimentalTruncate as Truncate } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<Truncate>\n * \t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex\n * \t\t\tneque, vulputate a diam et, luctus convallis lacus. Vestibulum ac\n * \t\t\tmollis mi. Morbi id elementum massa.\n * \t\t</Truncate>\n * \t);\n * }\n * ```\n */\nconst ConnectedTruncate = contextConnect( Truncate, 'Truncate' );\n\nexport default ConnectedTruncate;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/component.tsx"],"names":["UnconnectedTruncate","props","forwardedRef","truncateProps","Truncate"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,mBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAMC,aAAa,GAAG,mBAAaF,KAAb,CAAtB;AAEA,SAAO,4BAAC,UAAD;AAAM,IAAA,EAAE,EAAC;AAAT,KAAqBE,aAArB;AAAqC,IAAA,GAAG,EAAGD;AAA3C,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,QAAQ,GAAG,6BAAgBJ,mBAAhB,EAAqC,UAArC,CAAjB;;eAEQI,Q","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../ui/context';\nimport { View } from '../view';\nimport useTruncate from './hook';\nimport type { TruncateProps } from './types';\n\nfunction UnconnectedTruncate(\n\tprops: WordPressComponentProps< TruncateProps, 'span' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst truncateProps = useTruncate( props );\n\n\treturn <View as=\"span\" { ...truncateProps } ref={ forwardedRef } />;\n}\n\n/**\n * `Truncate` is a typography primitive that trims text content.\n * For almost all cases, it is recommended that `Text`, `Heading`, or\n * `Subheading` is used to render text content. However,`Truncate` is\n * available for custom implementations.\n *\n * ```jsx\n * import { __experimentalTruncate as Truncate } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<Truncate>\n * \t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex\n * \t\t\tneque, vulputate a diam et, luctus convallis lacus. Vestibulum ac\n * \t\t\tmollis mi. Morbi id elementum massa.\n * \t\t</Truncate>\n * \t);\n * }\n * ```\n */\nexport const Truncate = contextConnect( UnconnectedTruncate, 'Truncate' );\n\nexport default Truncate;\n"]}
@@ -32,10 +32,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
32
32
  /**
33
33
  * Internal dependencies
34
34
  */
35
-
36
- /**
37
- * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props
38
- */
39
35
  function useTruncate(props) {
40
36
  const {
41
37
  className,
@@ -47,9 +43,7 @@ function useTruncate(props) {
47
43
  ...otherProps
48
44
  } = (0, _context.useContextSystem)(props, 'Truncate');
49
45
  const cx = (0, _useCx.useCx)();
50
- const truncatedContent = (0, _utils.truncateContent)(typeof children === 'string' ?
51
- /** @type {string} */
52
- children : '', {
46
+ const truncatedContent = (0, _utils.truncateContent)(typeof children === 'string' ? children : '', {
53
47
  ellipsis,
54
48
  ellipsizeMode,
55
49
  limit,
@@ -57,9 +51,8 @@ function useTruncate(props) {
57
51
  });
58
52
  const shouldTruncate = ellipsizeMode === _utils.TRUNCATE_TYPE.auto;
59
53
  const classes = (0, _element.useMemo)(() => {
60
- const sx = {};
61
- sx.numberOfLines = /*#__PURE__*/(0, _react.css)("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + (process.env.NODE_ENV === "production" ? "" : ";label:sx-numberOfLines;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpRHdCIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvaG9vay5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHVzZU1lbW8gfSBmcm9tICdAd29yZHByZXNzL2VsZW1lbnQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyB1c2VDb250ZXh0U3lzdGVtIH0gZnJvbSAnLi4vdWkvY29udGV4dCc7XG5pbXBvcnQg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RydW5jYXRlID0gZWxsaXBzaXplTW9kZSA9PT0gVFJVTkNBVEVfVFlQRS5hdXRvO1xuXG5cdGNvbnN0IGNsYXNzZXMgPSB1c2VNZW1vKCAoKSA9PiB7XG5cdFx0Y29uc3Qgc3ggPSB7fTtcblxuXHRcdHN4Lm51bWJlck9mTGluZXMgPSBjc3NgXG5cdFx0XHQtd2Via2l0LWJveC1vcmllbnQ6IHZlcnRpY2FsO1xuXHRcdFx0LXdlYmtpdC1saW5lLWNsYW1wOiAkeyBudW1iZXJPZkxpbmVzIH07XG5cdFx0XHRkaXNwbGF5OiAtd2Via2l0LWJveDtcblx0XHRcdG92ZXJmbG93OiBoaWRkZW47XG5cdFx0YDtcblxuXHRcdHJldHVybiBjeChcblx0XHRcdHNob3VsZFRydW5jYXRlICYmICEgbnVtYmVyT2ZMaW5lcyAmJiBzdHlsZXMuVHJ1bmNhdGUsXG5cdFx0XHRzaG91bGRUcnVuY2F0ZSAmJiAhISBudW1iZXJPZkxpbmVzICYmIHN4Lm51bWJlck9mTGluZXMsXG5cdFx0XHRjbGFzc05hbWVcblx0XHQpO1xuXHR9LCBbIGNsYXNzTmFtZSwgY3gsIG51bWJlck9mTGluZXMsIHNob3VsZFRydW5jYXRlIF0gKTtcblxuXHRyZXR1cm4geyAuLi5vdGhlclByb3BzLCBjbGFzc05hbWU6IGNsYXNzZXMsIGNoaWxkcmVuOiB0cnVuY2F0ZWRDb250ZW50IH07XG59XG4iXX0= */");
62
- return cx(shouldTruncate && !numberOfLines && styles.Truncate, shouldTruncate && !!numberOfLines && sx.numberOfLines, className);
54
+ const truncateLines = /*#__PURE__*/(0, _react.css)("-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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3Jk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0Y2xhc3NOYW1lXG5cdFx0KTtcblx0fSwgWyBjbGFzc05hbWUsIGN4LCBudW1iZXJPZkxpbmVzLCBzaG91bGRUcnVuY2F0ZSBdICk7XG5cblx0cmV0dXJuIHsgLi4ub3RoZXJQcm9wcywgY2xhc3NOYW1lOiBjbGFzc2VzLCBjaGlsZHJlbjogdHJ1bmNhdGVkQ29udGVudCB9O1xufVxuIl19 */");
55
+ return cx(shouldTruncate && !numberOfLines && styles.Truncate, shouldTruncate && !!numberOfLines && truncateLines, className);
63
56
  }, [className, cx, numberOfLines, shouldTruncate]);
64
57
  return { ...otherProps,
65
58
  className: classes,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/hook.js"],"names":["useTruncate","props","className","children","ellipsis","TRUNCATE_ELLIPSIS","ellipsizeMode","TRUNCATE_TYPE","auto","limit","numberOfLines","otherProps","cx","truncatedContent","shouldTruncate","classes","sx","css","styles","Truncate"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,KAAtB,EAA8B;AAC5C,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,QAAQ,GAAGC,wBAHN;AAILC,IAAAA,aAAa,GAAGC,qBAAcC,IAJzB;AAKLC,IAAAA,KAAK,GAAG,CALH;AAMLC,IAAAA,aAAa,GAAG,CANX;AAOL,OAAGC;AAPE,MAQF,+BAAkBV,KAAlB,EAAyB,UAAzB,CARJ;AAUA,QAAMW,EAAE,GAAG,mBAAX;AAEA,QAAMC,gBAAgB,GAAG,4BACxB,OAAOV,QAAP,KAAoB,QAApB;AAA+B;AAAwBA,EAAAA,QAAvD,GAAoE,EAD5C,EAExB;AACCC,IAAAA,QADD;AAECE,IAAAA,aAFD;AAGCG,IAAAA,KAHD;AAICC,IAAAA;AAJD,GAFwB,CAAzB;AAUA,QAAMI,cAAc,GAAGR,aAAa,KAAKC,qBAAcC,IAAvD;AAEA,QAAMO,OAAO,GAAG,sBAAS,MAAM;AAC9B,UAAMC,EAAE,GAAG,EAAX;AAEAA,IAAAA,EAAE,CAACN,aAAH,oBAAmBO,UAAnB,qDAEwBP,aAFxB;AAOA,WAAOE,EAAE,CACRE,cAAc,IAAI,CAAEJ,aAApB,IAAqCQ,MAAM,CAACC,QADpC,EAERL,cAAc,IAAI,CAAC,CAAEJ,aAArB,IAAsCM,EAAE,CAACN,aAFjC,EAGRR,SAHQ,CAAT;AAKA,GAfe,EAeb,CAAEA,SAAF,EAAaU,EAAb,EAAiBF,aAAjB,EAAgCI,cAAhC,CAfa,CAAhB;AAiBA,SAAO,EAAE,GAAGH,UAAL;AAAiBT,IAAAA,SAAS,EAAEa,OAA5B;AAAqCZ,IAAAA,QAAQ,EAAEU;AAA/C,GAAP;AACA","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 */\nimport { useContextSystem } from '../ui/context';\nimport * as styles from './styles';\nimport { TRUNCATE_ELLIPSIS, TRUNCATE_TYPE, truncateContent } from './utils';\nimport { useCx } from '../utils/hooks/use-cx';\n\n/**\n * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props\n */\nexport default function useTruncate( props ) {\n\tconst {\n\t\tclassName,\n\t\tchildren,\n\t\tellipsis = TRUNCATE_ELLIPSIS,\n\t\tellipsizeMode = TRUNCATE_TYPE.auto,\n\t\tlimit = 0,\n\t\tnumberOfLines = 0,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Truncate' );\n\n\tconst cx = useCx();\n\n\tconst truncatedContent = truncateContent(\n\t\ttypeof children === 'string' ? /** @type {string} */ ( children ) : '',\n\t\t{\n\t\t\tellipsis,\n\t\t\tellipsizeMode,\n\t\t\tlimit,\n\t\t\tnumberOfLines,\n\t\t}\n\t);\n\n\tconst shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto;\n\n\tconst classes = useMemo( () => {\n\t\tconst sx = {};\n\n\t\tsx.numberOfLines = css`\n\t\t\t-webkit-box-orient: vertical;\n\t\t\t-webkit-line-clamp: ${ numberOfLines };\n\t\t\tdisplay: -webkit-box;\n\t\t\toverflow: hidden;\n\t\t`;\n\n\t\treturn cx(\n\t\t\tshouldTruncate && ! numberOfLines && styles.Truncate,\n\t\t\tshouldTruncate && !! numberOfLines && sx.numberOfLines,\n\t\t\tclassName\n\t\t);\n\t}, [ className, cx, numberOfLines, shouldTruncate ] );\n\n\treturn { ...otherProps, className: classes, children: truncatedContent };\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/hook.ts"],"names":["useTruncate","props","className","children","ellipsis","TRUNCATE_ELLIPSIS","ellipsizeMode","TRUNCATE_TYPE","auto","limit","numberOfLines","otherProps","cx","truncatedContent","shouldTruncate","classes","truncateLines","css","styles","Truncate"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAOe,SAASA,WAAT,CACdC,KADc,EAEb;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,QAAQ,GAAGC,wBAHN;AAILC,IAAAA,aAAa,GAAGC,qBAAcC,IAJzB;AAKLC,IAAAA,KAAK,GAAG,CALH;AAMLC,IAAAA,aAAa,GAAG,CANX;AAOL,OAAGC;AAPE,MAQF,+BAAkBV,KAAlB,EAAyB,UAAzB,CARJ;AAUA,QAAMW,EAAE,GAAG,mBAAX;AAEA,QAAMC,gBAAgB,GAAG,4BACxB,OAAOV,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,EADlB,EAExB;AACCC,IAAAA,QADD;AAECE,IAAAA,aAFD;AAGCG,IAAAA,KAHD;AAICC,IAAAA;AAJD,GAFwB,CAAzB;AAUA,QAAMI,cAAc,GAAGR,aAAa,KAAKC,qBAAcC,IAAvD;AAEA,QAAMO,OAAO,GAAG,sBAAS,MAAM;AAC9B,UAAMC,aAAa,oBAAGC,UAAH,qDAEKP,aAFL,2jFAAnB;AAOA,WAAOE,EAAE,CACRE,cAAc,IAAI,CAAEJ,aAApB,IAAqCQ,MAAM,CAACC,QADpC,EAERL,cAAc,IAAI,CAAC,CAAEJ,aAArB,IAAsCM,aAF9B,EAGRd,SAHQ,CAAT;AAKA,GAbe,EAab,CAAEA,SAAF,EAAaU,EAAb,EAAiBF,aAAjB,EAAgCI,cAAhC,CAba,CAAhB;AAeA,SAAO,EAAE,GAAGH,UAAL;AAAiBT,IAAAA,SAAS,EAAEa,OAA5B;AAAqCZ,IAAAA,QAAQ,EAAEU;AAA/C,GAAP;AACA","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 */\nimport { useContextSystem, WordPressComponentProps } from '../ui/context';\nimport * as styles from './styles';\nimport { TRUNCATE_ELLIPSIS, TRUNCATE_TYPE, truncateContent } from './utils';\nimport { useCx } from '../utils/hooks/use-cx';\nimport type { TruncateProps } from './types';\n\nexport default function useTruncate(\n\tprops: WordPressComponentProps< TruncateProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tchildren,\n\t\tellipsis = TRUNCATE_ELLIPSIS,\n\t\tellipsizeMode = TRUNCATE_TYPE.auto,\n\t\tlimit = 0,\n\t\tnumberOfLines = 0,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Truncate' );\n\n\tconst cx = useCx();\n\n\tconst truncatedContent = truncateContent(\n\t\ttypeof children === 'string' ? children : '',\n\t\t{\n\t\t\tellipsis,\n\t\t\tellipsizeMode,\n\t\t\tlimit,\n\t\t\tnumberOfLines,\n\t\t}\n\t);\n\n\tconst shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto;\n\n\tconst classes = useMemo( () => {\n\t\tconst truncateLines = css`\n\t\t\t-webkit-box-orient: vertical;\n\t\t\t-webkit-line-clamp: ${ numberOfLines };\n\t\t\tdisplay: -webkit-box;\n\t\t\toverflow: hidden;\n\t\t`;\n\n\t\treturn cx(\n\t\t\tshouldTruncate && ! numberOfLines && styles.Truncate,\n\t\t\tshouldTruncate && !! numberOfLines && truncateLines,\n\t\t\tclassName\n\t\t);\n\t}, [ className, cx, numberOfLines, shouldTruncate ] );\n\n\treturn { ...otherProps, className: classes, children: truncatedContent };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default as Truncate } from './component';\nexport { default as useTruncate } from './hook';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default as Truncate } from './component';\nexport { default as useTruncate } from './hook';\n"]}
@@ -15,7 +15,7 @@ const Truncate = process.env.NODE_ENV === "production" ? {
15
15
  } : {
16
16
  name: "abxxyf-Truncate",
17
17
  styles: "display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;label:Truncate;",
18
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUsyQiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RydW5jYXRlL3N0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IFRydW5jYXRlID0gY3NzYFxuXHRkaXNwbGF5OiBibG9jaztcblx0b3ZlcmZsb3c6IGhpZGRlbjtcblx0dGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5cdHdoaXRlLXNwYWNlOiBub3dyYXA7XG5gO1xuIl19 */",
18
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdHJ1bmNhdGUvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUsyQiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RydW5jYXRlL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuZXhwb3J0IGNvbnN0IFRydW5jYXRlID0gY3NzYFxuXHRkaXNwbGF5OiBibG9jaztcblx0b3ZlcmZsb3c6IGhpZGRlbjtcblx0dGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG5cdHdoaXRlLXNwYWNlOiBub3dyYXA7XG5gO1xuIl19 */",
19
19
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
20
  };
21
21
  exports.Truncate = Truncate;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/styles.js"],"names":["Truncate"],"mappings":";;;;;;;AAGA;;;;AAEO,MAAMA,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAd","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\nexport const Truncate = css`\n\tdisplay: block;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/styles.ts"],"names":["Truncate"],"mappings":";;;;;;;AAGA;;;;AAEO,MAAMA,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAd","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\nexport const Truncate = css`\n\tdisplay: block;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n"]}
@@ -7,10 +7,10 @@ exports.TRUNCATE_TYPE = exports.TRUNCATE_ELLIPSIS = exports.TRUNCATE_DEFAULT_PRO
7
7
  exports.truncateContent = truncateContent;
8
8
  exports.truncateMiddle = truncateMiddle;
9
9
 
10
- var _lodash = require("lodash");
10
+ var _values = require("../utils/values");
11
11
 
12
12
  /**
13
- * External dependencies
13
+ * Internal dependencies
14
14
  */
15
15
  const TRUNCATE_ELLIPSIS = '…';
16
16
  exports.TRUNCATE_ELLIPSIS = TRUNCATE_ELLIPSIS;
@@ -30,13 +30,6 @@ const TRUNCATE_DEFAULT_PROPS = {
30
30
  }; // Source
31
31
  // https://github.com/kahwee/truncate-middle
32
32
 
33
- /**
34
- * @param {string} word
35
- * @param {number} headLength
36
- * @param {number} tailLength
37
- * @param {string} ellipsis
38
- */
39
-
40
33
  exports.TRUNCATE_DEFAULT_PROPS = TRUNCATE_DEFAULT_PROPS;
41
34
 
42
35
  function truncateMiddle(word, headLength, tailLength, ellipsis) {
@@ -53,7 +46,7 @@ function truncateMiddle(word, headLength, tailLength, ellipsis) {
53
46
  const backLength = ~~tailLength;
54
47
  /* istanbul ignore next */
55
48
 
56
- const truncateStr = !(0, _lodash.isNil)(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS;
49
+ const truncateStr = (0, _values.isValueDefined)(ellipsis) ? ellipsis : TRUNCATE_ELLIPSIS;
57
50
 
58
51
  if (frontLength === 0 && backLength === 0 || frontLength >= wordLength || backLength >= wordLength || frontLength + backLength >= wordLength) {
59
52
  return word;
@@ -63,12 +56,6 @@ function truncateMiddle(word, headLength, tailLength, ellipsis) {
63
56
 
64
57
  return word.slice(0, frontLength) + truncateStr + word.slice(wordLength - backLength);
65
58
  }
66
- /**
67
- *
68
- * @param {string} words
69
- * @param {typeof TRUNCATE_DEFAULT_PROPS} props
70
- */
71
-
72
59
 
73
60
  function truncateContent() {
74
61
  let words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/truncate/utils.js"],"names":["TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","truncatedContent"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,iBAAiB,GAAG,GAA1B;;AACA,MAAMC,aAAa,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MADsB;AAE5BC,EAAAA,IAAI,EAAE,MAFsB;AAG5BC,EAAAA,MAAM,EAAE,QAHoB;AAI5BC,EAAAA,IAAI,EAAE,MAJsB;AAK5BC,EAAAA,IAAI,EAAE;AALsB,CAAtB;;AAQA,MAAMC,sBAAsB,GAAG;AACrCC,EAAAA,QAAQ,EAAER,iBAD2B;AAErCS,EAAAA,aAAa,EAAER,aAAa,CAACC,IAFQ;AAGrCQ,EAAAA,KAAK,EAAE,CAH8B;AAIrCC,EAAAA,aAAa,EAAE;AAJsB,CAA/B,C,CAOP;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,SAASC,cAAT,CAAyBC,IAAzB,EAA+BC,UAA/B,EAA2CC,UAA3C,EAAuDP,QAAvD,EAAkE;AACxE,MAAK,OAAOK,IAAP,KAAgB,QAArB,EAAgC;AAC/B,WAAO,EAAP;AACA;;AACD,QAAMG,UAAU,GAAGH,IAAI,CAACI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,YAAY,GAAGE,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACAiB,MAAAA,YAAY,GAAGC,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACA;;AACD;AACCgB,MAAAA,YAAY,GAAGhB,KAAf;AACAiB,MAAAA,YAAY,GAAG,CAAf;AAXF;;AAcA,QAAMG,gBAAgB,GACrBrB,aAAa,KAAKR,aAAa,CAACC,IAAhC,GACGU,cAAc,CAAEW,KAAF,EAASG,YAAT,EAAuBC,YAAvB,EAAqCnB,QAArC,CADjB,GAEGe,KAHJ;AAKA,SAAOO,gBAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isNil } from 'lodash';\n\nexport const TRUNCATE_ELLIPSIS = '…';\nexport const TRUNCATE_TYPE = {\n\tauto: 'auto',\n\thead: 'head',\n\tmiddle: 'middle',\n\ttail: 'tail',\n\tnone: 'none',\n};\n\nexport const TRUNCATE_DEFAULT_PROPS = {\n\tellipsis: TRUNCATE_ELLIPSIS,\n\tellipsizeMode: TRUNCATE_TYPE.auto,\n\tlimit: 0,\n\tnumberOfLines: 0,\n};\n\n// Source\n// https://github.com/kahwee/truncate-middle\n/**\n * @param {string} word\n * @param {number} headLength\n * @param {number} tailLength\n * @param {string} ellipsis\n */\nexport function truncateMiddle( word, headLength, tailLength, ellipsis ) {\n\tif ( typeof word !== 'string' ) {\n\t\treturn '';\n\t}\n\tconst wordLength = word.length;\n\t// Setting default values\n\t// eslint-disable-next-line no-bitwise\n\tconst frontLength = ~~headLength; // Will cast to integer\n\t// eslint-disable-next-line no-bitwise\n\tconst backLength = ~~tailLength;\n\t/* istanbul ignore next */\n\tconst truncateStr = ! isNil( ellipsis ) ? ellipsis : TRUNCATE_ELLIPSIS;\n\n\tif (\n\t\t( frontLength === 0 && backLength === 0 ) ||\n\t\tfrontLength >= wordLength ||\n\t\tbackLength >= wordLength ||\n\t\tfrontLength + backLength >= wordLength\n\t) {\n\t\treturn word;\n\t} else if ( backLength === 0 ) {\n\t\treturn word.slice( 0, frontLength ) + truncateStr;\n\t}\n\treturn (\n\t\tword.slice( 0, frontLength ) +\n\t\ttruncateStr +\n\t\tword.slice( wordLength - backLength )\n\t);\n}\n\n/**\n *\n * @param {string} words\n * @param {typeof TRUNCATE_DEFAULT_PROPS} props\n */\nexport function truncateContent( words = '', props ) {\n\tconst mergedProps = { ...TRUNCATE_DEFAULT_PROPS, ...props };\n\tconst { ellipsis, ellipsizeMode, limit } = mergedProps;\n\n\tif ( ellipsizeMode === TRUNCATE_TYPE.none ) {\n\t\treturn words;\n\t}\n\n\tlet truncateHead;\n\tlet truncateTail;\n\n\tswitch ( ellipsizeMode ) {\n\t\tcase TRUNCATE_TYPE.head:\n\t\t\ttruncateHead = 0;\n\t\t\ttruncateTail = limit;\n\t\t\tbreak;\n\t\tcase TRUNCATE_TYPE.middle:\n\t\t\ttruncateHead = Math.floor( limit / 2 );\n\t\t\ttruncateTail = Math.floor( limit / 2 );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttruncateHead = limit;\n\t\t\ttruncateTail = 0;\n\t}\n\n\tconst truncatedContent =\n\t\tellipsizeMode !== TRUNCATE_TYPE.auto\n\t\t\t? truncateMiddle( words, truncateHead, truncateTail, ellipsis )\n\t\t\t: words;\n\n\treturn truncatedContent;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/truncate/utils.ts"],"names":["TRUNCATE_ELLIPSIS","TRUNCATE_TYPE","auto","head","middle","tail","none","TRUNCATE_DEFAULT_PROPS","ellipsis","ellipsizeMode","limit","numberOfLines","truncateMiddle","word","headLength","tailLength","wordLength","length","frontLength","backLength","truncateStr","slice","truncateContent","words","props","mergedProps","truncateHead","truncateTail","Math","floor","truncatedContent"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAIO,MAAMA,iBAAiB,GAAG,GAA1B;;AACA,MAAMC,aAAa,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MADsB;AAE5BC,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AAAA,MADDC,KACC;AACD,QAAMC,WAAW,GAAG,EAAE,GAAGlB,sBAAL;AAA6B,OAAGiB;AAAhC,GAApB;AACA,QAAM;AAAEhB,IAAAA,QAAF;AAAYC,IAAAA,aAAZ;AAA2BC,IAAAA;AAA3B,MAAqCe,WAA3C;;AAEA,MAAKhB,aAAa,KAAKR,aAAa,CAACK,IAArC,EAA4C;AAC3C,WAAOiB,KAAP;AACA;;AAED,MAAIG,YAAJ;AACA,MAAIC,YAAJ;;AAEA,UAASlB,aAAT;AACC,SAAKR,aAAa,CAACE,IAAnB;AACCuB,MAAAA,YAAY,GAAG,CAAf;AACAC,MAAAA,YAAY,GAAGjB,KAAf;AACA;;AACD,SAAKT,aAAa,CAACG,MAAnB;AACCsB,MAAAA,YAAY,GAAGE,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACAiB,MAAAA,YAAY,GAAGC,IAAI,CAACC,KAAL,CAAYnB,KAAK,GAAG,CAApB,CAAf;AACA;;AACD;AACCgB,MAAAA,YAAY,GAAGhB,KAAf;AACAiB,MAAAA,YAAY,GAAG,CAAf;AAXF;;AAcA,QAAMG,gBAAgB,GACrBrB,aAAa,KAAKR,aAAa,CAACC,IAAhC,GACGU,cAAc,CAAEW,KAAF,EAASG,YAAT,EAAuBC,YAAvB,EAAqCnB,QAArC,CADjB,GAEGe,KAHJ;AAKA,SAAOO,gBAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { isValueDefined } from '../utils/values';\nimport type { TruncateProps } from './types';\n\nexport const TRUNCATE_ELLIPSIS = '…';\nexport const TRUNCATE_TYPE = {\n\tauto: 'auto',\n\thead: 'head',\n\tmiddle: 'middle',\n\ttail: 'tail',\n\tnone: 'none',\n} as const;\n\nexport const TRUNCATE_DEFAULT_PROPS = {\n\tellipsis: TRUNCATE_ELLIPSIS,\n\tellipsizeMode: TRUNCATE_TYPE.auto,\n\tlimit: 0,\n\tnumberOfLines: 0,\n};\n\n// Source\n// https://github.com/kahwee/truncate-middle\nexport function truncateMiddle(\n\tword: string,\n\theadLength: number,\n\ttailLength: number,\n\tellipsis: string\n) {\n\tif ( typeof word !== 'string' ) {\n\t\treturn '';\n\t}\n\tconst wordLength = word.length;\n\t// Setting default values\n\t// eslint-disable-next-line no-bitwise\n\tconst frontLength = ~~headLength; // Will cast to integer\n\t// eslint-disable-next-line no-bitwise\n\tconst backLength = ~~tailLength;\n\t/* istanbul ignore next */\n\tconst truncateStr = isValueDefined( ellipsis )\n\t\t? ellipsis\n\t\t: TRUNCATE_ELLIPSIS;\n\n\tif (\n\t\t( frontLength === 0 && backLength === 0 ) ||\n\t\tfrontLength >= wordLength ||\n\t\tbackLength >= wordLength ||\n\t\tfrontLength + backLength >= wordLength\n\t) {\n\t\treturn word;\n\t} else if ( backLength === 0 ) {\n\t\treturn word.slice( 0, frontLength ) + truncateStr;\n\t}\n\treturn (\n\t\tword.slice( 0, frontLength ) +\n\t\ttruncateStr +\n\t\tword.slice( wordLength - backLength )\n\t);\n}\n\nexport function truncateContent(\n\twords: string = '',\n\tprops: Omit< TruncateProps, 'children' >\n) {\n\tconst mergedProps = { ...TRUNCATE_DEFAULT_PROPS, ...props };\n\tconst { ellipsis, ellipsizeMode, limit } = mergedProps;\n\n\tif ( ellipsizeMode === TRUNCATE_TYPE.none ) {\n\t\treturn words;\n\t}\n\n\tlet truncateHead: number;\n\tlet truncateTail: number;\n\n\tswitch ( ellipsizeMode ) {\n\t\tcase TRUNCATE_TYPE.head:\n\t\t\ttruncateHead = 0;\n\t\t\ttruncateTail = limit;\n\t\t\tbreak;\n\t\tcase TRUNCATE_TYPE.middle:\n\t\t\ttruncateHead = Math.floor( limit / 2 );\n\t\t\ttruncateTail = Math.floor( limit / 2 );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttruncateHead = limit;\n\t\t\ttruncateTail = 0;\n\t}\n\n\tconst truncatedContent =\n\t\tellipsizeMode !== TRUNCATE_TYPE.auto\n\t\t\t? truncateMiddle( words, truncateHead, truncateTail, ellipsis )\n\t\t\t: words;\n\n\treturn truncatedContent;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/form-group/form-group-content.js"],"names":["FormGroupContent","alignLabel","children","help","horizontal","id","label","labelHidden","spacing","truncate","props","contextProps","content"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA,SAASA,gBAAT,OAWI;AAAA,MAXuB;AAC1BC,IAAAA,UAD0B;AAE1BC,IAAAA,QAF0B;AAG1BC,IAAAA,IAH0B;AAI1BC,IAAAA,UAAU,GAAG,KAJa;AAK1BC,IAAAA,EAL0B;AAM1BC,IAAAA,KAN0B;AAO1BC,IAAAA,WAP0B;AAQ1BC,IAAAA,OAAO,GAAG,CARgB;AAS1BC,IAAAA,QAT0B;AAU1B,OAAGC;AAVuB,GAWvB;AACH,QAAMC,YAAY,GAAG,sBAAS,OAAQ;AAAEN,IAAAA,EAAF;AAAMD,IAAAA;AAAN,GAAR,CAAT,EAAuC,CAC3DC,EAD2D,EAE3DD,UAF2D,CAAvC,CAArB;AAKA,QAAMQ,OAAO,GAAGT,IAAI,GACnB,4BAAC,cAAD;AAAQ,IAAA,QAAQ,EAAG,KAAnB;AAA2B,IAAA,OAAO,EAAGK;AAArC,KACGN,QADH,EAEC,4BAAC,sBAAD,QAAiBC,IAAjB,CAFD,CADmB,GAMnBD,QAND;AASA,SACC,4BAAC,kCAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGS;AAAnC,KACC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAGV,UADT;AAEC,IAAA,EAAE,EAAGI,EAFN;AAGC,IAAA,WAAW,EAAGE,WAHf;AAIC,IAAA,QAAQ,EAAGE;AAJZ,KAKMC,KALN,GAOGJ,KAPH,CADD,EAUGM,OAVH,CADD;AAcA;;eAEc,mBAAMZ,gBAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, memo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VStack } from '../../v-stack';\nimport { FormGroupContext } from './form-group-context';\nimport FormGroupHelp from './form-group-help';\nimport FormGroupLabel from './form-group-label';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').FormGroupContentProps, 'label', false>} props\n */\nfunction FormGroupContent( {\n\talignLabel,\n\tchildren,\n\thelp,\n\thorizontal = false,\n\tid,\n\tlabel,\n\tlabelHidden,\n\tspacing = 2,\n\ttruncate,\n\t...props\n} ) {\n\tconst contextProps = useMemo( () => ( { id, horizontal } ), [\n\t\tid,\n\t\thorizontal,\n\t] );\n\n\tconst content = help ? (\n\t\t<VStack expanded={ false } spacing={ spacing }>\n\t\t\t{ children }\n\t\t\t<FormGroupHelp>{ help }</FormGroupHelp>\n\t\t</VStack>\n\t) : (\n\t\tchildren\n\t);\n\n\treturn (\n\t\t<FormGroupContext.Provider value={ contextProps }>\n\t\t\t<FormGroupLabel\n\t\t\t\talign={ alignLabel }\n\t\t\t\tid={ id }\n\t\t\t\tlabelHidden={ labelHidden }\n\t\t\t\ttruncate={ truncate }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</FormGroupLabel>\n\t\t\t{ content }\n\t\t</FormGroupContext.Provider>\n\t);\n}\n\nexport default memo( FormGroupContent );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/form-group/form-group-content.js"],"names":["FormGroupContent","alignLabel","children","help","horizontal","id","label","labelHidden","spacing","truncate","props","contextProps","content"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA,SAASA,gBAAT,OAWI;AAAA,MAXuB;AAC1BC,IAAAA,UAD0B;AAE1BC,IAAAA,QAF0B;AAG1BC,IAAAA,IAH0B;AAI1BC,IAAAA,UAAU,GAAG,KAJa;AAK1BC,IAAAA,EAL0B;AAM1BC,IAAAA,KAN0B;AAO1BC,IAAAA,WAP0B;AAQ1BC,IAAAA,OAAO,GAAG,CARgB;AAS1BC,IAAAA,QAT0B;AAU1B,OAAGC;AAVuB,GAWvB;AACH,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEN,IAAAA,EAAF;AAAMD,IAAAA;AAAN,GAAR,CADoB,EAEpB,CAAEC,EAAF,EAAMD,UAAN,CAFoB,CAArB;AAKA,QAAMQ,OAAO,GAAGT,IAAI,GACnB,4BAAC,cAAD;AAAQ,IAAA,QAAQ,EAAG,KAAnB;AAA2B,IAAA,OAAO,EAAGK;AAArC,KACGN,QADH,EAEC,4BAAC,sBAAD,QAAiBC,IAAjB,CAFD,CADmB,GAMnBD,QAND;AASA,SACC,4BAAC,kCAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGS;AAAnC,KACC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAGV,UADT;AAEC,IAAA,EAAE,EAAGI,EAFN;AAGC,IAAA,WAAW,EAAGE,WAHf;AAIC,IAAA,QAAQ,EAAGE;AAJZ,KAKMC,KALN,GAOGJ,KAPH,CADD,EAUGM,OAVH,CADD;AAcA;;eAEc,mBAAMZ,gBAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, memo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { VStack } from '../../v-stack';\nimport { FormGroupContext } from './form-group-context';\nimport FormGroupHelp from './form-group-help';\nimport FormGroupLabel from './form-group-label';\n\n/**\n * @param {import('../context').WordPressComponentProps<import('./types').FormGroupContentProps, 'label', false>} props\n */\nfunction FormGroupContent( {\n\talignLabel,\n\tchildren,\n\thelp,\n\thorizontal = false,\n\tid,\n\tlabel,\n\tlabelHidden,\n\tspacing = 2,\n\ttruncate,\n\t...props\n} ) {\n\tconst contextProps = useMemo(\n\t\t() => ( { id, horizontal } ),\n\t\t[ id, horizontal ]\n\t);\n\n\tconst content = help ? (\n\t\t<VStack expanded={ false } spacing={ spacing }>\n\t\t\t{ children }\n\t\t\t<FormGroupHelp>{ help }</FormGroupHelp>\n\t\t</VStack>\n\t) : (\n\t\tchildren\n\t);\n\n\treturn (\n\t\t<FormGroupContext.Provider value={ contextProps }>\n\t\t\t<FormGroupLabel\n\t\t\t\talign={ alignLabel }\n\t\t\t\tid={ id }\n\t\t\t\tlabelHidden={ labelHidden }\n\t\t\t\ttruncate={ truncate }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</FormGroupLabel>\n\t\t\t{ content }\n\t\t</FormGroupContext.Provider>\n\t);\n}\n\nexport default memo( FormGroupContent );\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/utils/get-valid-children.ts"],"names":["getValidChildren","children","Children","toArray","filter","child"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CAA2BC,QAA3B,EAAiE;AACvE,MAAK,OAAOA,QAAP,KAAoB,QAAzB,EAAoC,OAAO,CAAEA,QAAF,CAAP;AAEpC,SAAOC,kBAASC,OAAT,CAAkBF,QAAlB,EAA6BG,MAA7B,CAAuCC,KAAF,IAC3C,6BAAgBA,KAAhB,CADM,CAAP;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, ReactNodeArray } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Children, isValidElement } from '@wordpress/element';\n\n/**\n * Gets a collection of available children elements from a React component's children prop.\n *\n * @param children\n *\n * @return An array of available children.\n */\nexport function getValidChildren( children: ReactNode ): ReactNodeArray {\n\tif ( typeof children === 'string' ) return [ children ];\n\n\treturn Children.toArray( children ).filter( ( child ) =>\n\t\tisValidElement( child )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/utils/get-valid-children.ts"],"names":["getValidChildren","children","Children","toArray","filter","child"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,CACNC,QADM,EAE8C;AACpD,MAAK,OAAOA,QAAP,KAAoB,QAAzB,EAAoC,OAAO,CAAEA,QAAF,CAAP;AAEpC,SAAOC,kBAASC,OAAT,CAAkBF,QAAlB,EAA6BG,MAA7B,CAAuCC,KAAF,IAC3C,6BAAgBA,KAAhB,CADM,CAAP;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, ReactChild, ReactFragment, ReactPortal } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Children, isValidElement } from '@wordpress/element';\n\n/**\n * Gets a collection of available children elements from a React component's children prop.\n *\n * @param children\n *\n * @return An array of available children.\n */\nexport function getValidChildren(\n\tchildren: ReactNode\n): Array< ReactChild | ReactFragment | ReactPortal > {\n\tif ( typeof children === 'string' ) return [ children ];\n\n\treturn Children.toArray( children ).filter( ( child ) =>\n\t\tisValidElement( child )\n\t);\n}\n"]}