@wordpress/components 28.8.6 → 28.10.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 (894) hide show
  1. package/CHANGELOG.md +44 -5
  2. package/build/alignment-matrix-control/icon.js.map +1 -1
  3. package/build/alignment-matrix-control/types.js.map +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/autocomplete/autocompleter-ui.js +3 -3
  7. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  8. package/build/autocomplete/get-default-use-items.js.map +1 -1
  9. package/build/autocomplete/index.js +5 -1
  10. package/build/autocomplete/index.js.map +1 -1
  11. package/build/base-control/hooks.js.map +1 -1
  12. package/build/base-control/index.js.map +1 -1
  13. package/build/border-box-control/border-box-control/component.js +3 -14
  14. package/build/border-box-control/border-box-control/component.js.map +1 -1
  15. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  16. package/build/border-box-control/styles.js.map +1 -1
  17. package/build/border-box-control/utils.js.map +1 -1
  18. package/build/border-control/border-control/component.js +1 -2
  19. package/build/border-control/border-control/component.js.map +1 -1
  20. package/build/border-control/border-control/hook.js.map +1 -1
  21. package/build/border-control/border-control-dropdown/component.js +2 -14
  22. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  23. package/build/border-control/styles.js +13 -13
  24. package/build/border-control/styles.js.map +1 -1
  25. package/build/border-control/types.js.map +1 -1
  26. package/build/box-control/axial-input-controls.js.map +1 -1
  27. package/build/box-control/icon.js.map +1 -1
  28. package/build/box-control/index.js +4 -4
  29. package/build/box-control/index.js.map +1 -1
  30. package/build/box-control/input-controls.js.map +1 -1
  31. package/build/box-control/types.js.map +1 -1
  32. package/build/button/index.native.js +1 -1
  33. package/build/button/index.native.js.map +1 -1
  34. package/build/card/card/component.js +1 -1
  35. package/build/card/card/component.js.map +1 -1
  36. package/build/card/styles.js.map +1 -1
  37. package/build/color-palette/index.js.map +1 -1
  38. package/build/color-palette/index.native.js +2 -1
  39. package/build/color-palette/index.native.js.map +1 -1
  40. package/build/color-picker/styles.js.map +1 -1
  41. package/build/combobox-control/index.js +1 -1
  42. package/build/combobox-control/index.js.map +1 -1
  43. package/build/composite/legacy/index.js.map +1 -1
  44. package/build/context/context-connect.js +1 -0
  45. package/build/context/context-connect.js.map +1 -1
  46. package/build/context/context-system-provider.js +1 -1
  47. package/build/context/context-system-provider.js.map +1 -1
  48. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  49. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  50. package/build/custom-gradient-picker/index.js.map +1 -1
  51. package/build/custom-gradient-picker/serializer.js.map +1 -1
  52. package/build/custom-gradient-picker/utils.js.map +1 -1
  53. package/build/custom-select-control-v2/styles.js.map +1 -1
  54. package/build/dashicon/index.js.map +1 -1
  55. package/build/date-time/date/styles.js.map +1 -1
  56. package/build/date-time/time/timezone.js.map +1 -1
  57. package/build/draggable/index.js.map +1 -1
  58. package/build/drop-zone/index.js.map +1 -1
  59. package/build/dropdown-menu-v2/styles.js.map +1 -1
  60. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  61. package/build/duotone-picker/utils.js.map +1 -1
  62. package/build/elevation/hook.js.map +1 -1
  63. package/build/external-link/index.js +20 -23
  64. package/build/external-link/index.js.map +1 -1
  65. package/build/focal-point-picker/index.js.map +1 -1
  66. package/build/focal-point-picker/index.native.js.map +1 -1
  67. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  68. package/build/font-size-picker/index.js.map +1 -1
  69. package/build/form-token-field/index.js +2 -1
  70. package/build/form-token-field/index.js.map +1 -1
  71. package/build/form-token-field/suggestions-list.js.map +1 -1
  72. package/build/form-token-field/token-input.js.map +1 -1
  73. package/build/form-token-field/token.js +1 -1
  74. package/build/form-token-field/token.js.map +1 -1
  75. package/build/gradient-picker/index.js.map +1 -1
  76. package/build/grid/hook.js.map +1 -1
  77. package/build/guide/page-control.js +1 -1
  78. package/build/guide/page-control.js.map +1 -1
  79. package/build/h-stack/hook.js.map +1 -1
  80. package/build/heading/hook.js.map +1 -1
  81. package/build/index.js +36 -5
  82. package/build/index.js.map +1 -1
  83. package/build/input-control/index.js.map +1 -1
  84. package/build/input-control/input-base.js.map +1 -1
  85. package/build/input-control/styles/input-control-styles.js.map +1 -1
  86. package/build/item-group/styles.js.map +1 -1
  87. package/build/menu-group/index.js.map +1 -1
  88. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  89. package/build/mobile/bottom-sheet/cell.native.js +4 -4
  90. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  91. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  92. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  93. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  94. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  95. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  96. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  97. package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
  98. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  99. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  100. package/build/mobile/gradient/index.native.js.map +1 -1
  101. package/build/mobile/image/index.native.js.map +1 -1
  102. package/build/mobile/link-picker/index.native.js +1 -1
  103. package/build/mobile/link-picker/index.native.js.map +1 -1
  104. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  105. package/build/mobile/picker/index.android.js.map +1 -1
  106. package/build/mobile/segmented-control/index.native.js.map +1 -1
  107. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  108. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  109. package/build/modal/aria-helper.js +2 -1
  110. package/build/modal/aria-helper.js.map +1 -1
  111. package/build/modal/index.js +2 -1
  112. package/build/modal/index.js.map +1 -1
  113. package/build/modal/use-modal-exit-animation.js.map +1 -1
  114. package/build/navigation/group/index.js.map +1 -1
  115. package/build/navigation/item/base.js.map +1 -1
  116. package/build/navigation/menu/index.js.map +1 -1
  117. package/build/navigation/menu/menu-title-search.js +2 -2
  118. package/build/navigation/menu/menu-title-search.js.map +1 -1
  119. package/build/navigation/menu/menu-title.js.map +1 -1
  120. package/build/navigation/styles/navigation-styles.js.map +1 -1
  121. package/build/navigator/index.js +128 -32
  122. package/build/navigator/index.js.map +1 -1
  123. package/build/navigator/legacy.js +179 -0
  124. package/build/navigator/legacy.js.map +1 -0
  125. package/build/navigator/{navigator-provider → navigator}/component.js +5 -40
  126. package/build/navigator/navigator/component.js.map +1 -0
  127. package/build/navigator/navigator-back-button/component.js +2 -38
  128. package/build/navigator/navigator-back-button/component.js.map +1 -1
  129. package/build/navigator/navigator-back-button/hook.js +1 -1
  130. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  131. package/build/navigator/navigator-button/component.js +2 -37
  132. package/build/navigator/navigator-button/component.js.map +1 -1
  133. package/build/navigator/navigator-button/hook.js +1 -1
  134. package/build/navigator/navigator-button/hook.js.map +1 -1
  135. package/build/navigator/navigator-screen/component.js +40 -62
  136. package/build/navigator/navigator-screen/component.js.map +1 -1
  137. package/build/navigator/navigator-screen/use-screen-animate-presence.js +114 -0
  138. package/build/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
  139. package/build/navigator/navigator-to-parent-button/component.js +3 -7
  140. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  141. package/build/navigator/styles.js +78 -35
  142. package/build/navigator/styles.js.map +1 -1
  143. package/build/navigator/types.js.map +1 -1
  144. package/build/navigator/use-navigator.js +4 -1
  145. package/build/navigator/use-navigator.js.map +1 -1
  146. package/build/number-control/styles/number-control-styles.js.map +1 -1
  147. package/build/palette-edit/index.js +1 -1
  148. package/build/palette-edit/index.js.map +1 -1
  149. package/build/popover/index.js +1 -1
  150. package/build/popover/index.js.map +1 -1
  151. package/build/popover/overlay-middlewares.js.map +1 -1
  152. package/build/popover/utils.js.map +1 -1
  153. package/build/progress-bar/index.js.map +1 -1
  154. package/build/progress-bar/styles.js.map +1 -1
  155. package/build/query-controls/index.js.map +1 -1
  156. package/build/query-controls/index.native.js.map +1 -1
  157. package/build/radio-control/index.js.map +1 -1
  158. package/build/radio-control/index.native.js.map +1 -1
  159. package/build/range-control/index.js.map +1 -1
  160. package/build/range-control/index.native.js.map +1 -1
  161. package/build/range-control/rail.js.map +1 -1
  162. package/build/range-control/styles/range-control-styles.js +32 -32
  163. package/build/range-control/styles/range-control-styles.js.map +1 -1
  164. package/build/range-control/tooltip.js +1 -1
  165. package/build/range-control/tooltip.js.map +1 -1
  166. package/build/range-control/utils.js.map +1 -1
  167. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  168. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  169. package/build/responsive-wrapper/index.js.map +1 -1
  170. package/build/sandbox/index.js.map +1 -1
  171. package/build/sandbox/index.native.js.map +1 -1
  172. package/build/search-control/index.js +11 -2
  173. package/build/search-control/index.js.map +1 -1
  174. package/build/search-control/index.native.js.map +1 -1
  175. package/build/search-control/types.js.map +1 -1
  176. package/build/select-control/index.js.map +1 -1
  177. package/build/select-control/index.native.js.map +1 -1
  178. package/build/slot-fill/index.js.map +1 -1
  179. package/build/spinner/styles.js.map +1 -1
  180. package/build/style-provider/index.js +1 -0
  181. package/build/style-provider/index.js.map +1 -1
  182. package/build/surface/hook.js.map +1 -1
  183. package/build/surface/styles.js.map +1 -1
  184. package/build/tab-panel/index.js.map +1 -1
  185. package/build/tabs/index.js.map +1 -1
  186. package/build/tabs/styles.js +30 -12
  187. package/build/tabs/styles.js.map +1 -1
  188. package/build/tabs/tab.js +7 -2
  189. package/build/tabs/tab.js.map +1 -1
  190. package/build/tabs/tablist.js +71 -39
  191. package/build/tabs/tablist.js.map +1 -1
  192. package/build/tabs/tabpanel.js.map +1 -1
  193. package/build/tabs/use-track-overflow.js +73 -0
  194. package/build/tabs/use-track-overflow.js.map +1 -0
  195. package/build/text/get-line-height.js.map +1 -1
  196. package/build/text/styles/text-mixins.native.js.map +1 -1
  197. package/build/text/utils.js.map +1 -1
  198. package/build/text-control/index.native.js.map +1 -1
  199. package/build/text-highlight/index.js.map +1 -1
  200. package/build/textarea-control/index.js.map +1 -1
  201. package/build/theme/color-algorithms.js.map +1 -1
  202. package/build/theme/styles.js.map +1 -1
  203. package/build/toggle-control/index.js.map +1 -1
  204. package/build/toggle-control/index.native.js.map +1 -1
  205. package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
  206. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  207. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +13 -2
  208. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  209. package/build/toggle-group-control/toggle-group-control/component.js +15 -8
  210. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  211. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  212. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  213. package/build/toggle-group-control/toggle-group-control-option-base/component.js +13 -20
  214. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  215. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -9
  216. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  217. package/build/toggle-group-control/types.js.map +1 -1
  218. package/build/toolbar/toolbar/index.js.map +1 -1
  219. package/build/tools-panel/styles.js.map +1 -1
  220. package/build/unit-control/index.js.map +1 -1
  221. package/build/unit-control/utils.js.map +1 -1
  222. package/build/utils/breakpoint.js.map +1 -1
  223. package/build/utils/colors-values.js.map +1 -1
  224. package/build/utils/config-values.js.map +1 -1
  225. package/build/utils/element-rect.js +22 -13
  226. package/build/utils/element-rect.js.map +1 -1
  227. package/build/utils/font-size.js.map +1 -1
  228. package/build/utils/hooks/use-animated-offset-rect.js +80 -0
  229. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
  230. package/build/utils/hooks/use-cx.js.map +1 -1
  231. package/build/utils/hooks/use-on-value-update.js +3 -7
  232. package/build/utils/hooks/use-on-value-update.js.map +1 -1
  233. package/build/utils/math.js +2 -2
  234. package/build/utils/math.js.map +1 -1
  235. package/build/utils/space.js.map +1 -1
  236. package/build/utils/unit-values.js.map +1 -1
  237. package/build/utils/use-responsive-value.js.map +1 -1
  238. package/build-module/alignment-matrix-control/cell.js +1 -2
  239. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  240. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  241. package/build-module/alignment-matrix-control/types.js.map +1 -1
  242. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  243. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  244. package/build-module/angle-picker-control/index.js +1 -2
  245. package/build-module/angle-picker-control/index.js.map +1 -1
  246. package/build-module/autocomplete/autocompleter-ui.js +4 -6
  247. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  248. package/build-module/autocomplete/autocompleter-ui.native.js +1 -2
  249. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  250. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  251. package/build-module/autocomplete/index.js +6 -4
  252. package/build-module/autocomplete/index.js.map +1 -1
  253. package/build-module/base-control/hooks.js.map +1 -1
  254. package/build-module/base-control/index.js +1 -2
  255. package/build-module/base-control/index.js.map +1 -1
  256. package/build-module/base-control/index.native.js +1 -2
  257. package/build-module/base-control/index.native.js.map +1 -1
  258. package/build-module/border-box-control/border-box-control/component.js +4 -16
  259. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  260. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  261. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
  262. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  263. package/build-module/border-box-control/styles.js.map +1 -1
  264. package/build-module/border-box-control/utils.js.map +1 -1
  265. package/build-module/border-control/border-control/component.js +2 -4
  266. package/build-module/border-control/border-control/component.js.map +1 -1
  267. package/build-module/border-control/border-control/hook.js.map +1 -1
  268. package/build-module/border-control/border-control-dropdown/component.js +3 -17
  269. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  270. package/build-module/border-control/styles.js +13 -13
  271. package/build-module/border-control/styles.js.map +1 -1
  272. package/build-module/border-control/types.js.map +1 -1
  273. package/build-module/box-control/all-input-control.js +1 -3
  274. package/build-module/box-control/all-input-control.js.map +1 -1
  275. package/build-module/box-control/axial-input-controls.js +1 -3
  276. package/build-module/box-control/axial-input-controls.js.map +1 -1
  277. package/build-module/box-control/icon.js +1 -2
  278. package/build-module/box-control/icon.js.map +1 -1
  279. package/build-module/box-control/index.js +5 -6
  280. package/build-module/box-control/index.js.map +1 -1
  281. package/build-module/box-control/input-controls.js +1 -3
  282. package/build-module/box-control/input-controls.js.map +1 -1
  283. package/build-module/box-control/types.js.map +1 -1
  284. package/build-module/button/index.js +1 -3
  285. package/build-module/button/index.js.map +1 -1
  286. package/build-module/button/index.native.js +2 -3
  287. package/build-module/button/index.native.js.map +1 -1
  288. package/build-module/card/card/component.js +2 -3
  289. package/build-module/card/card/component.js.map +1 -1
  290. package/build-module/card/styles.js.map +1 -1
  291. package/build-module/checkbox-control/index.js +1 -2
  292. package/build-module/checkbox-control/index.js.map +1 -1
  293. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
  294. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  295. package/build-module/circular-option-picker/circular-option-picker.js +1 -2
  296. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  297. package/build-module/color-indicator/index.native.js +1 -2
  298. package/build-module/color-indicator/index.native.js.map +1 -1
  299. package/build-module/color-palette/index.js +1 -2
  300. package/build-module/color-palette/index.js.map +1 -1
  301. package/build-module/color-palette/index.native.js +3 -4
  302. package/build-module/color-palette/index.native.js.map +1 -1
  303. package/build-module/color-picker/component.js +1 -2
  304. package/build-module/color-picker/component.js.map +1 -1
  305. package/build-module/color-picker/hsl-input.js +1 -3
  306. package/build-module/color-picker/hsl-input.js.map +1 -1
  307. package/build-module/color-picker/hsv-color-picker.native.js +1 -2
  308. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
  309. package/build-module/color-picker/hue-picker.native.js +1 -2
  310. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  311. package/build-module/color-picker/index.native.js +1 -3
  312. package/build-module/color-picker/index.native.js.map +1 -1
  313. package/build-module/color-picker/input-with-slider.js +1 -2
  314. package/build-module/color-picker/input-with-slider.js.map +1 -1
  315. package/build-module/color-picker/rgb-input.js +1 -3
  316. package/build-module/color-picker/rgb-input.js.map +1 -1
  317. package/build-module/color-picker/saturation-picker.native.js +1 -2
  318. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  319. package/build-module/color-picker/styles.js.map +1 -1
  320. package/build-module/combobox-control/index.js +2 -3
  321. package/build-module/combobox-control/index.js.map +1 -1
  322. package/build-module/composite/legacy/index.js.map +1 -1
  323. package/build-module/confirm-dialog/component.js +1 -3
  324. package/build-module/confirm-dialog/component.js.map +1 -1
  325. package/build-module/context/context-connect.js +1 -0
  326. package/build-module/context/context-connect.js.map +1 -1
  327. package/build-module/context/context-system-provider.js +1 -1
  328. package/build-module/context/context-system-provider.js.map +1 -1
  329. package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
  330. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -3
  331. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  332. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  333. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  334. package/build-module/custom-gradient-picker/index.js +1 -2
  335. package/build-module/custom-gradient-picker/index.js.map +1 -1
  336. package/build-module/custom-gradient-picker/index.native.js +1 -3
  337. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  338. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  339. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  340. package/build-module/custom-select-control/index.js +1 -3
  341. package/build-module/custom-select-control/index.js.map +1 -1
  342. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  343. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  344. package/build-module/custom-select-control-v2/item.js +1 -2
  345. package/build-module/custom-select-control-v2/item.js.map +1 -1
  346. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  347. package/build-module/dashicon/index.js.map +1 -1
  348. package/build-module/date-time/date/index.js +1 -2
  349. package/build-module/date-time/date/index.js.map +1 -1
  350. package/build-module/date-time/date/styles.js.map +1 -1
  351. package/build-module/date-time/date-time/index.js +1 -3
  352. package/build-module/date-time/date-time/index.js.map +1 -1
  353. package/build-module/date-time/time/index.js +1 -2
  354. package/build-module/date-time/time/index.js.map +1 -1
  355. package/build-module/date-time/time/time-input/index.js +1 -2
  356. package/build-module/date-time/time/time-input/index.js.map +1 -1
  357. package/build-module/date-time/time/timezone.js.map +1 -1
  358. package/build-module/dimension-control/index.js +1 -3
  359. package/build-module/dimension-control/index.js.map +1 -1
  360. package/build-module/draggable/index.js +1 -3
  361. package/build-module/draggable/index.js.map +1 -1
  362. package/build-module/drop-zone/index.js +1 -2
  363. package/build-module/drop-zone/index.js.map +1 -1
  364. package/build-module/dropdown/index.js +1 -2
  365. package/build-module/dropdown/index.js.map +1 -1
  366. package/build-module/dropdown/index.native.js +1 -2
  367. package/build-module/dropdown/index.native.js.map +1 -1
  368. package/build-module/dropdown-menu/index.js +1 -2
  369. package/build-module/dropdown-menu/index.js.map +1 -1
  370. package/build-module/dropdown-menu/index.native.js +1 -2
  371. package/build-module/dropdown-menu/index.native.js.map +1 -1
  372. package/build-module/dropdown-menu-v2/checkbox-item.js +1 -2
  373. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -1
  374. package/build-module/dropdown-menu-v2/index.js +1 -3
  375. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  376. package/build-module/dropdown-menu-v2/item.js +1 -2
  377. package/build-module/dropdown-menu-v2/item.js.map +1 -1
  378. package/build-module/dropdown-menu-v2/radio-item.js +1 -2
  379. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -1
  380. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  381. package/build-module/duotone-picker/color-list-picker/index.js +1 -3
  382. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  383. package/build-module/duotone-picker/duotone-picker.js +1 -2
  384. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  385. package/build-module/duotone-picker/utils.js.map +1 -1
  386. package/build-module/elevation/hook.js.map +1 -1
  387. package/build-module/external-link/index.js +21 -25
  388. package/build-module/external-link/index.js.map +1 -1
  389. package/build-module/external-link/index.native.js +1 -2
  390. package/build-module/external-link/index.native.js.map +1 -1
  391. package/build-module/focal-point-picker/controls.js +1 -2
  392. package/build-module/focal-point-picker/controls.js.map +1 -1
  393. package/build-module/focal-point-picker/focal-point.native.js +1 -2
  394. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  395. package/build-module/focal-point-picker/grid.js +1 -2
  396. package/build-module/focal-point-picker/grid.js.map +1 -1
  397. package/build-module/focal-point-picker/index.js +1 -2
  398. package/build-module/focal-point-picker/index.js.map +1 -1
  399. package/build-module/focal-point-picker/index.native.js +1 -2
  400. package/build-module/focal-point-picker/index.native.js.map +1 -1
  401. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  402. package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
  403. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  404. package/build-module/font-size-picker/index.js +1 -2
  405. package/build-module/font-size-picker/index.js.map +1 -1
  406. package/build-module/font-size-picker/index.native.js +1 -3
  407. package/build-module/font-size-picker/index.native.js.map +1 -1
  408. package/build-module/form-file-upload/index.js +1 -2
  409. package/build-module/form-file-upload/index.js.map +1 -1
  410. package/build-module/form-toggle/index.js +1 -2
  411. package/build-module/form-toggle/index.js.map +1 -1
  412. package/build-module/form-token-field/index.js +3 -3
  413. package/build-module/form-token-field/index.js.map +1 -1
  414. package/build-module/form-token-field/suggestions-list.js +1 -2
  415. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  416. package/build-module/form-token-field/token-input.js.map +1 -1
  417. package/build-module/form-token-field/token.js +2 -3
  418. package/build-module/form-token-field/token.js.map +1 -1
  419. package/build-module/gradient-picker/index.js +1 -2
  420. package/build-module/gradient-picker/index.js.map +1 -1
  421. package/build-module/grid/hook.js.map +1 -1
  422. package/build-module/guide/index.js +1 -2
  423. package/build-module/guide/index.js.map +1 -1
  424. package/build-module/guide/page-control.js +1 -1
  425. package/build-module/guide/page-control.js.map +1 -1
  426. package/build-module/h-stack/hook.js.map +1 -1
  427. package/build-module/heading/hook.js.map +1 -1
  428. package/build-module/higher-order/with-fallback-styles/index.js +3 -4
  429. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  430. package/build-module/index.js +14 -4
  431. package/build-module/index.js.map +1 -1
  432. package/build-module/input-control/index.js.map +1 -1
  433. package/build-module/input-control/input-base.js +1 -2
  434. package/build-module/input-control/input-base.js.map +1 -1
  435. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  436. package/build-module/item-group/styles.js.map +1 -1
  437. package/build-module/keyboard-shortcuts/index.js +1 -3
  438. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  439. package/build-module/menu-group/index.js +1 -2
  440. package/build-module/menu-group/index.js.map +1 -1
  441. package/build-module/menu-item/index.js +1 -2
  442. package/build-module/menu-item/index.js.map +1 -1
  443. package/build-module/menu-items-choice/index.js +1 -2
  444. package/build-module/menu-items-choice/index.js.map +1 -1
  445. package/build-module/mobile/badge/index.native.js +1 -3
  446. package/build-module/mobile/badge/index.native.js.map +1 -1
  447. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
  448. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  449. package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
  450. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  451. package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
  452. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  453. package/build-module/mobile/bottom-sheet/index.native.js +1 -3
  454. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  455. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  456. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  457. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  458. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  459. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  460. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  461. package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
  462. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  463. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
  464. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  465. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  466. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  467. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  468. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  469. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  470. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  471. package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
  472. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  473. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -3
  474. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  475. package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
  476. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  477. package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  478. package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  479. package/build-module/mobile/color-settings/index.native.js +1 -2
  480. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  481. package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
  482. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  483. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  484. package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
  485. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  486. package/build-module/mobile/gradient/index.native.js +1 -2
  487. package/build-module/mobile/gradient/index.native.js.map +1 -1
  488. package/build-module/mobile/html-text-input/index.native.js +1 -2
  489. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  490. package/build-module/mobile/image/icon-retry.native.js +1 -2
  491. package/build-module/mobile/image/icon-retry.native.js.map +1 -1
  492. package/build-module/mobile/image/image-editing-button.native.js +1 -2
  493. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  494. package/build-module/mobile/image/index.native.js +1 -3
  495. package/build-module/mobile/image/index.native.js.map +1 -1
  496. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -2
  497. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  498. package/build-module/mobile/link-picker/index.native.js +2 -3
  499. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  500. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  501. package/build-module/mobile/link-settings/index.native.js +1 -3
  502. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  503. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
  504. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  505. package/build-module/mobile/picker/index.android.js +1 -2
  506. package/build-module/mobile/picker/index.android.js.map +1 -1
  507. package/build-module/mobile/segmented-control/index.native.js +1 -2
  508. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  509. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  510. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  511. package/build-module/modal/aria-helper.js +2 -1
  512. package/build-module/modal/aria-helper.js.map +1 -1
  513. package/build-module/modal/index.js +3 -4
  514. package/build-module/modal/index.js.map +1 -1
  515. package/build-module/modal/use-modal-exit-animation.js.map +1 -1
  516. package/build-module/navigation/back-button/index.js +1 -2
  517. package/build-module/navigation/back-button/index.js.map +1 -1
  518. package/build-module/navigation/group/index.js +1 -2
  519. package/build-module/navigation/group/index.js.map +1 -1
  520. package/build-module/navigation/item/base-content.js +1 -3
  521. package/build-module/navigation/item/base-content.js.map +1 -1
  522. package/build-module/navigation/item/base.js.map +1 -1
  523. package/build-module/navigation/item/index.js +1 -2
  524. package/build-module/navigation/item/index.js.map +1 -1
  525. package/build-module/navigation/menu/index.js +1 -2
  526. package/build-module/navigation/menu/index.js.map +1 -1
  527. package/build-module/navigation/menu/menu-title-search.js +2 -2
  528. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  529. package/build-module/navigation/menu/menu-title.js +1 -2
  530. package/build-module/navigation/menu/menu-title.js.map +1 -1
  531. package/build-module/navigation/menu/search-no-results-found.js +1 -2
  532. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  533. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  534. package/build-module/navigator/index.js +130 -5
  535. package/build-module/navigator/index.js.map +1 -1
  536. package/build-module/navigator/legacy.js +167 -0
  537. package/build-module/navigator/legacy.js.map +1 -0
  538. package/build-module/navigator/{navigator-provider → navigator}/component.js +4 -39
  539. package/build-module/navigator/navigator/component.js.map +1 -0
  540. package/build-module/navigator/navigator-back-button/component.js +1 -37
  541. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  542. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  543. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  544. package/build-module/navigator/navigator-button/component.js +1 -36
  545. package/build-module/navigator/navigator-button/component.js.map +1 -1
  546. package/build-module/navigator/navigator-button/hook.js +1 -1
  547. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  548. package/build-module/navigator/navigator-screen/component.js +39 -61
  549. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  550. package/build-module/navigator/navigator-screen/use-screen-animate-presence.js +106 -0
  551. package/build-module/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
  552. package/build-module/navigator/navigator-to-parent-button/component.js +2 -6
  553. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  554. package/build-module/navigator/styles.js +77 -33
  555. package/build-module/navigator/styles.js.map +1 -1
  556. package/build-module/navigator/types.js.map +1 -1
  557. package/build-module/navigator/use-navigator.js +4 -1
  558. package/build-module/navigator/use-navigator.js.map +1 -1
  559. package/build-module/notice/index.js +1 -2
  560. package/build-module/notice/index.js.map +1 -1
  561. package/build-module/notice/index.native.js +1 -3
  562. package/build-module/notice/index.native.js.map +1 -1
  563. package/build-module/number-control/index.js +1 -3
  564. package/build-module/number-control/index.js.map +1 -1
  565. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  566. package/build-module/palette-edit/index.js +2 -4
  567. package/build-module/palette-edit/index.js.map +1 -1
  568. package/build-module/panel/actions.native.js +1 -2
  569. package/build-module/panel/actions.native.js.map +1 -1
  570. package/build-module/panel/body.js +1 -2
  571. package/build-module/panel/body.js.map +1 -1
  572. package/build-module/panel/body.native.js +1 -2
  573. package/build-module/panel/body.native.js.map +1 -1
  574. package/build-module/panel/header.js +1 -2
  575. package/build-module/panel/header.js.map +1 -1
  576. package/build-module/panel/index.js +1 -2
  577. package/build-module/panel/index.js.map +1 -1
  578. package/build-module/placeholder/index.js +1 -2
  579. package/build-module/placeholder/index.js.map +1 -1
  580. package/build-module/popover/index.js +2 -4
  581. package/build-module/popover/index.js.map +1 -1
  582. package/build-module/popover/overlay-middlewares.js.map +1 -1
  583. package/build-module/popover/utils.js.map +1 -1
  584. package/build-module/progress-bar/index.js +1 -2
  585. package/build-module/progress-bar/index.js.map +1 -1
  586. package/build-module/progress-bar/styles.js.map +1 -1
  587. package/build-module/query-controls/index.js.map +1 -1
  588. package/build-module/query-controls/index.native.js +1 -3
  589. package/build-module/query-controls/index.native.js.map +1 -1
  590. package/build-module/radio-control/index.js +1 -2
  591. package/build-module/radio-control/index.js.map +1 -1
  592. package/build-module/radio-control/index.native.js +1 -2
  593. package/build-module/radio-control/index.native.js.map +1 -1
  594. package/build-module/range-control/index.js +1 -2
  595. package/build-module/range-control/index.js.map +1 -1
  596. package/build-module/range-control/index.native.js.map +1 -1
  597. package/build-module/range-control/mark.js +1 -3
  598. package/build-module/range-control/mark.js.map +1 -1
  599. package/build-module/range-control/rail.js +1 -3
  600. package/build-module/range-control/rail.js.map +1 -1
  601. package/build-module/range-control/styles/range-control-styles.js +32 -32
  602. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  603. package/build-module/range-control/tooltip.js +1 -1
  604. package/build-module/range-control/tooltip.js.map +1 -1
  605. package/build-module/range-control/utils.js.map +1 -1
  606. package/build-module/resizable-box/index.js +1 -2
  607. package/build-module/resizable-box/index.js.map +1 -1
  608. package/build-module/resizable-box/resize-tooltip/index.js +1 -2
  609. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  610. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  611. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  612. package/build-module/responsive-wrapper/index.js.map +1 -1
  613. package/build-module/sandbox/index.js +1 -2
  614. package/build-module/sandbox/index.js.map +1 -1
  615. package/build-module/sandbox/index.native.js +1 -2
  616. package/build-module/sandbox/index.native.js.map +1 -1
  617. package/build-module/search-control/index.js +11 -2
  618. package/build-module/search-control/index.js.map +1 -1
  619. package/build-module/search-control/index.native.js +1 -2
  620. package/build-module/search-control/index.native.js.map +1 -1
  621. package/build-module/search-control/types.js.map +1 -1
  622. package/build-module/select-control/index.js.map +1 -1
  623. package/build-module/select-control/index.native.js.map +1 -1
  624. package/build-module/slot-fill/index.js +1 -3
  625. package/build-module/slot-fill/index.js.map +1 -1
  626. package/build-module/slot-fill/slot.js +1 -2
  627. package/build-module/slot-fill/slot.js.map +1 -1
  628. package/build-module/snackbar/index.js +1 -2
  629. package/build-module/snackbar/index.js.map +1 -1
  630. package/build-module/snackbar/list.js +1 -2
  631. package/build-module/snackbar/list.js.map +1 -1
  632. package/build-module/spinner/index.js +1 -2
  633. package/build-module/spinner/index.js.map +1 -1
  634. package/build-module/spinner/styles.js.map +1 -1
  635. package/build-module/style-provider/index.js +1 -0
  636. package/build-module/style-provider/index.js.map +1 -1
  637. package/build-module/surface/hook.js.map +1 -1
  638. package/build-module/surface/styles.js.map +1 -1
  639. package/build-module/tab-panel/index.js +1 -2
  640. package/build-module/tab-panel/index.js.map +1 -1
  641. package/build-module/tabs/index.js.map +1 -1
  642. package/build-module/tabs/styles.js +28 -6
  643. package/build-module/tabs/styles.js.map +1 -1
  644. package/build-module/tabs/tab.js +9 -4
  645. package/build-module/tabs/tab.js.map +1 -1
  646. package/build-module/tabs/tablist.js +72 -40
  647. package/build-module/tabs/tablist.js.map +1 -1
  648. package/build-module/tabs/tabpanel.js.map +1 -1
  649. package/build-module/tabs/use-track-overflow.js +67 -0
  650. package/build-module/tabs/use-track-overflow.js.map +1 -0
  651. package/build-module/text/get-line-height.js.map +1 -1
  652. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  653. package/build-module/text/utils.js.map +1 -1
  654. package/build-module/text-control/index.native.js.map +1 -1
  655. package/build-module/text-highlight/index.js +1 -2
  656. package/build-module/text-highlight/index.js.map +1 -1
  657. package/build-module/textarea-control/index.js.map +1 -1
  658. package/build-module/theme/color-algorithms.js.map +1 -1
  659. package/build-module/theme/styles.js.map +1 -1
  660. package/build-module/tip/index.js +1 -2
  661. package/build-module/tip/index.js.map +1 -1
  662. package/build-module/toggle-control/index.js +1 -2
  663. package/build-module/toggle-control/index.js.map +1 -1
  664. package/build-module/toggle-control/index.native.js.map +1 -1
  665. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
  666. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  667. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +14 -3
  668. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  669. package/build-module/toggle-group-control/toggle-group-control/component.js +17 -12
  670. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  671. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  672. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  673. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +16 -25
  674. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  675. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +7 -8
  676. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  677. package/build-module/toggle-group-control/types.js.map +1 -1
  678. package/build-module/toolbar/toolbar/index.js.map +1 -1
  679. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
  680. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
  681. package/build-module/toolbar/toolbar-group/index.js +1 -2
  682. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  683. package/build-module/tools-panel/styles.js.map +1 -1
  684. package/build-module/tools-panel/tools-panel/component.js +1 -2
  685. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  686. package/build-module/tools-panel/tools-panel-header/component.js +1 -3
  687. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  688. package/build-module/tooltip/index.js +1 -2
  689. package/build-module/tooltip/index.js.map +1 -1
  690. package/build-module/tooltip/index.native.js +1 -3
  691. package/build-module/tooltip/index.native.js.map +1 -1
  692. package/build-module/tree-grid/cell.js +1 -2
  693. package/build-module/tree-grid/cell.js.map +1 -1
  694. package/build-module/unit-control/index.js.map +1 -1
  695. package/build-module/unit-control/index.native.js +1 -3
  696. package/build-module/unit-control/index.native.js.map +1 -1
  697. package/build-module/unit-control/utils.js.map +1 -1
  698. package/build-module/utils/breakpoint.js.map +1 -1
  699. package/build-module/utils/colors-values.js.map +1 -1
  700. package/build-module/utils/config-values.js.map +1 -1
  701. package/build-module/utils/element-rect.js +22 -12
  702. package/build-module/utils/element-rect.js.map +1 -1
  703. package/build-module/utils/font-size.js.map +1 -1
  704. package/build-module/utils/hooks/use-animated-offset-rect.js +74 -0
  705. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
  706. package/build-module/utils/hooks/use-cx.js.map +1 -1
  707. package/build-module/utils/hooks/use-on-value-update.js +3 -6
  708. package/build-module/utils/hooks/use-on-value-update.js.map +1 -1
  709. package/build-module/utils/math.js +2 -2
  710. package/build-module/utils/math.js.map +1 -1
  711. package/build-module/utils/space.js.map +1 -1
  712. package/build-module/utils/unit-values.js.map +1 -1
  713. package/build-module/utils/use-responsive-value.js.map +1 -1
  714. package/build-style/style-rtl.css +30 -14
  715. package/build-style/style.css +30 -14
  716. package/build-types/alignment-matrix-control/types.d.ts +2 -0
  717. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  718. package/build-types/autocomplete/index.d.ts.map +1 -1
  719. package/build-types/border-box-control/border-box-control/component.d.ts +5 -15
  720. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  721. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +2 -1
  722. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  723. package/build-types/border-box-control/stories/index.story.d.ts +3 -2
  724. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  725. package/build-types/border-control/border-control/component.d.ts +3 -2
  726. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  727. package/build-types/border-control/border-control-dropdown/component.d.ts +2 -1
  728. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  729. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  730. package/build-types/border-control/stories/index.story.d.ts +15 -30
  731. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  732. package/build-types/border-control/styles.d.ts.map +1 -1
  733. package/build-types/border-control/types.d.ts +12 -7
  734. package/build-types/border-control/types.d.ts.map +1 -1
  735. package/build-types/box-control/index.d.ts +4 -4
  736. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  737. package/build-types/box-control/types.d.ts +3 -3
  738. package/build-types/composite/stories/index.story.d.ts +22 -0
  739. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  740. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  741. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  742. package/build-types/index.d.ts +23 -4
  743. package/build-types/index.d.ts.map +1 -1
  744. package/build-types/modal/aria-helper.d.ts.map +1 -1
  745. package/build-types/navigator/index.d.ts +171 -5
  746. package/build-types/navigator/index.d.ts.map +1 -1
  747. package/build-types/navigator/legacy.d.ts +226 -0
  748. package/build-types/navigator/legacy.d.ts.map +1 -0
  749. package/build-types/navigator/navigator/component.d.ts +3 -0
  750. package/build-types/navigator/navigator/component.d.ts.map +1 -0
  751. package/build-types/navigator/navigator-back-button/component.d.ts +0 -35
  752. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  753. package/build-types/navigator/navigator-button/component.d.ts +0 -34
  754. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  755. package/build-types/navigator/navigator-screen/component.d.ts +0 -35
  756. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  757. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +16 -0
  758. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -0
  759. package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -4
  760. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  761. package/build-types/navigator/stories/index.story.d.ts +5 -5
  762. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  763. package/build-types/navigator/styles.d.ts +20 -7
  764. package/build-types/navigator/styles.d.ts.map +1 -1
  765. package/build-types/navigator/types.d.ts +19 -1
  766. package/build-types/navigator/types.d.ts.map +1 -1
  767. package/build-types/navigator/use-navigator.d.ts +4 -1
  768. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  769. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  770. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  771. package/build-types/search-control/index.d.ts.map +1 -1
  772. package/build-types/search-control/stories/index.story.d.ts +0 -8
  773. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  774. package/build-types/search-control/types.d.ts +3 -0
  775. package/build-types/search-control/types.d.ts.map +1 -1
  776. package/build-types/select-control/stories/index.story.d.ts +7 -0
  777. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  778. package/build-types/tabs/stories/index.story.d.ts +2 -1
  779. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  780. package/build-types/tabs/styles.d.ts +7 -0
  781. package/build-types/tabs/styles.d.ts.map +1 -1
  782. package/build-types/tabs/tab.d.ts.map +1 -1
  783. package/build-types/tabs/tablist.d.ts.map +1 -1
  784. package/build-types/tabs/use-track-overflow.d.ts +17 -0
  785. package/build-types/tabs/use-track-overflow.d.ts.map +1 -0
  786. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
  787. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  788. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
  789. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  790. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  791. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  792. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  793. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +0 -1
  794. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  795. package/build-types/toggle-group-control/types.d.ts +2 -1
  796. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  797. package/build-types/utils/element-rect.d.ts +8 -0
  798. package/build-types/utils/element-rect.d.ts.map +1 -1
  799. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +62 -0
  800. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
  801. package/build-types/utils/hooks/use-on-value-update.d.ts.map +1 -1
  802. package/package.json +20 -20
  803. package/schemas/docs-manifest.json +38 -0
  804. package/src/alignment-matrix-control/README.md +46 -36
  805. package/src/alignment-matrix-control/docs-manifest.json +12 -0
  806. package/src/alignment-matrix-control/types.ts +2 -0
  807. package/src/angle-picker-control/README.md +36 -23
  808. package/src/angle-picker-control/docs-manifest.json +5 -0
  809. package/src/autocomplete/index.tsx +4 -1
  810. package/src/border-box-control/border-box-control/README.md +22 -26
  811. package/src/border-box-control/border-box-control/component.tsx +3 -14
  812. package/src/border-box-control/stories/index.story.tsx +2 -1
  813. package/src/border-control/border-control/README.md +26 -36
  814. package/src/border-control/border-control/component.tsx +1 -2
  815. package/src/border-control/border-control-dropdown/component.tsx +1 -15
  816. package/src/border-control/stories/index.story.tsx +4 -10
  817. package/src/border-control/styles.ts +0 -1
  818. package/src/border-control/test/index.js +2 -15
  819. package/src/border-control/types.ts +12 -7
  820. package/src/box-control/README.md +9 -12
  821. package/src/box-control/index.tsx +4 -4
  822. package/src/box-control/stories/index.story.tsx +1 -1
  823. package/src/box-control/types.ts +3 -3
  824. package/src/button/style.scss +5 -1
  825. package/src/composite/legacy/test/index.tsx +22 -21
  826. package/src/composite/stories/index.story.tsx +42 -0
  827. package/src/composite/test/index.tsx +629 -38
  828. package/src/dropdown/stories/index.story.tsx +1 -0
  829. package/src/dropdown/style.scss +10 -13
  830. package/src/dropdown-menu/stories/index.story.tsx +3 -0
  831. package/src/index.ts +19 -1
  832. package/src/menu-group/style.scss +4 -1
  833. package/src/menu-items-choice/style.scss +2 -0
  834. package/src/modal/aria-helper.ts +1 -0
  835. package/src/navigator/README.md +176 -0
  836. package/src/navigator/index.tsx +131 -0
  837. package/src/navigator/legacy.ts +169 -0
  838. package/src/navigator/{navigator-provider → navigator}/component.tsx +6 -44
  839. package/src/navigator/navigator-back-button/component.tsx +1 -37
  840. package/src/navigator/navigator-back-button/hook.ts +1 -1
  841. package/src/navigator/navigator-button/component.tsx +1 -36
  842. package/src/navigator/navigator-button/hook.ts +1 -1
  843. package/src/navigator/navigator-screen/component.tsx +48 -76
  844. package/src/navigator/navigator-screen/use-screen-animate-presence.ts +177 -0
  845. package/src/navigator/navigator-to-parent-button/component.tsx +2 -7
  846. package/src/navigator/stories/index.story.tsx +55 -54
  847. package/src/navigator/styles.ts +112 -41
  848. package/src/navigator/test/index.tsx +47 -47
  849. package/src/navigator/types.ts +19 -1
  850. package/src/navigator/use-navigator.ts +4 -1
  851. package/src/range-control/styles/range-control-styles.ts +19 -10
  852. package/src/range-control/tooltip.tsx +1 -1
  853. package/src/search-control/README.md +2 -0
  854. package/src/search-control/index.tsx +9 -2
  855. package/src/search-control/stories/index.story.tsx +0 -15
  856. package/src/search-control/test/index.tsx +4 -1
  857. package/src/search-control/types.ts +3 -0
  858. package/src/select-control/stories/index.story.tsx +14 -1
  859. package/src/tabs/stories/index.story.tsx +106 -0
  860. package/src/tabs/styles.ts +161 -58
  861. package/src/tabs/tab.tsx +8 -2
  862. package/src/tabs/tablist.tsx +72 -39
  863. package/src/tabs/use-track-overflow.ts +76 -0
  864. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +208 -44
  865. package/src/toggle-group-control/test/index.tsx +26 -0
  866. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +18 -10
  867. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +30 -12
  868. package/src/toggle-group-control/toggle-group-control/component.tsx +19 -6
  869. package/src/toggle-group-control/toggle-group-control/styles.ts +41 -0
  870. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -28
  871. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -11
  872. package/src/toggle-group-control/types.ts +3 -1
  873. package/src/tools-panel/tools-panel/README.md +10 -10
  874. package/src/utils/element-rect.ts +32 -15
  875. package/src/utils/hooks/use-animated-offset-rect.ts +107 -0
  876. package/src/utils/hooks/use-on-value-update.ts +3 -6
  877. package/tsconfig.tsbuildinfo +1 -1
  878. package/build/navigator/navigator-provider/component.js.map +0 -1
  879. package/build/utils/hooks/use-event.js +0 -41
  880. package/build/utils/hooks/use-event.js.map +0 -1
  881. package/build-module/navigator/navigator-provider/component.js.map +0 -1
  882. package/build-module/utils/hooks/use-event.js +0 -35
  883. package/build-module/utils/hooks/use-event.js.map +0 -1
  884. package/build-types/navigator/navigator-provider/component.d.ts +0 -37
  885. package/build-types/navigator/navigator-provider/component.d.ts.map +0 -1
  886. package/build-types/utils/hooks/use-event.d.ts +0 -20
  887. package/build-types/utils/hooks/use-event.d.ts.map +0 -1
  888. package/src/navigator/index.ts +0 -6
  889. package/src/navigator/navigator-back-button/README.md +0 -15
  890. package/src/navigator/navigator-button/README.md +0 -38
  891. package/src/navigator/navigator-provider/README.md +0 -94
  892. package/src/navigator/navigator-screen/README.md +0 -33
  893. package/src/navigator/navigator-to-parent-button/README.md +0 -17
  894. package/src/utils/hooks/use-event.ts +0 -38
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useStoreState","warning","forwardRef","useState","useTabsContext","TabListWrapper","clsx","useTrackElementOffsetRect","useOnValueUpdate","jsx","_jsx","TabList","children","otherProps","ref","context","tabStoreState","store","selectedId","indicatorPosition","item","element","animationEnabled","setAnimationEnabled","previousValue","globalThis","SCRIPT_DEBUG","activeId","selectOnMove","setActiveId","onBlur","render","onTransitionEnd","event","pseudoElement","style","top","right","left","width","height","className"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport { useTabsContext } from './context';\nimport { TabListWrapper } from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport clsx from 'clsx';\nimport { useTrackElementOffsetRect } from '../utils/element-rect';\nimport { useOnValueUpdate } from '../utils/hooks/use-on-value-update';\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst context = useTabsContext();\n\n\tconst tabStoreState = useStoreState( context?.store );\n\tconst selectedId = tabStoreState?.selectedId;\n\tconst indicatorPosition = useTrackElementOffsetRect(\n\t\tcontext?.store.item( selectedId )?.element\n\t);\n\n\tconst [ animationEnabled, setAnimationEnabled ] = useState( false );\n\tuseOnValueUpdate(\n\t\tselectedId,\n\t\t( { previousValue } ) => previousValue && setAnimationEnabled( true )\n\t);\n\n\tif ( ! context || ! tabStoreState ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\tconst { store } = context;\n\tconst { activeId, selectOnMove } = tabStoreState;\n\tconst { setActiveId } = store;\n\n\tconst onBlur = () => {\n\t\tif ( ! selectOnMove ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When automatic tab selection is on, make sure that the active tab is up\n\t\t// to date with the selected tab when leaving the tablist. This makes sure\n\t\t// that the selected tab will receive keyboard focus when tabbing back into\n\t\t// the tablist.\n\t\tif ( selectedId !== activeId ) {\n\t\t\tsetActiveId( selectedId );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Ariakit.TabList\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\trender={\n\t\t\t\t<TabListWrapper\n\t\t\t\t\tonTransitionEnd={ ( event ) => {\n\t\t\t\t\t\tif ( event.pseudoElement === '::after' ) {\n\t\t\t\t\t\t\tsetAnimationEnabled( false );\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\tonBlur={ onBlur }\n\t\t\t{ ...otherProps }\n\t\t\tstyle={ {\n\t\t\t\t'--indicator-top': indicatorPosition.top,\n\t\t\t\t'--indicator-right': indicatorPosition.right,\n\t\t\t\t'--indicator-left': indicatorPosition.left,\n\t\t\t\t'--indicator-width': indicatorPosition.width,\n\t\t\t\t'--indicator-height': indicatorPosition.height,\n\t\t\t\t...otherProps.style,\n\t\t\t} }\n\t\t\tclassName={ clsx(\n\t\t\t\tanimationEnabled ? 'is-animation-enabled' : '',\n\t\t\t\totherProps.className\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.TabList>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEzD;AACA;AACA;;AAEA,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,cAAc,QAAQ,UAAU;AAEzC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtE,OAAO,MAAMC,OAAO,GAAGT,UAAU,CAG9B,SAASS,OAAOA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EACvD,MAAMC,OAAO,GAAGX,cAAc,CAAC,CAAC;EAEhC,MAAMY,aAAa,GAAGhB,aAAa,CAAEe,OAAO,EAAEE,KAAM,CAAC;EACrD,MAAMC,UAAU,GAAGF,aAAa,EAAEE,UAAU;EAC5C,MAAMC,iBAAiB,G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AI;MAC1C,mBAAmB,EAAEnB,iBAAiB,CAACoB,KAAK;MAC5C,oBAAoB,EAAEpB,iBAAiB,CAACqB,MAAM;MAC9C,GAAG3B,UAAU,CAACsB;IACf,CAAG;IACHM,SAAS,EAAGnC,IAAI,CACfgB,gBAAgB,GAAG,sBAAsB,GAAG,EAAE,EAC9CT,UAAU,CAAC4B,SACZ,CAAG;IAAA7B,QAAA,EAEDA;EAAQ,CACM,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","useStoreState","warning","forwardRef","useLayoutEffect","useState","useMergeRefs","useTabsContext","TabListWrapper","clsx","useTrackElementOffsetRect","useTrackOverflow","useAnimatedOffsetRect","jsx","_jsx","DEFAULT_SCROLL_MARGIN","useScrollRectIntoView","parent","rect","margin","scrollLeft","parentScroll","parentWidth","getBoundingClientRect","width","left","childLeft","childWidth","parentRightEdge","childRightEdge","rightOverflow","leftOverflow","TabList","children","otherProps","ref","_useTabsContext","store","selectedId","activeId","selectOnMove","items","setParent","refs","selectedRect","item","element","overflow","first","at","last","prefix","dataAttribute","transitionEndFilter","event","pseudoElement","onBlur","setActiveId","globalThis","SCRIPT_DEBUG","render","tabIndex","className"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef, useLayoutEffect, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport { useTabsContext } from './context';\nimport { TabListWrapper } from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport clsx from 'clsx';\nimport type { ElementOffsetRect } from '../utils/element-rect';\nimport { useTrackElementOffsetRect } from '../utils/element-rect';\nimport { useTrackOverflow } from './use-track-overflow';\nimport { useAnimatedOffsetRect } from '../utils/hooks/use-animated-offset-rect';\n\nconst DEFAULT_SCROLL_MARGIN = 24;\n\n/**\n * Scrolls a given parent element so that a given rect is visible.\n *\n * The scroll is updated initially and whenever the rect changes.\n */\nfunction useScrollRectIntoView(\n\tparent: HTMLElement | undefined,\n\trect: ElementOffsetRect,\n\t{ margin = DEFAULT_SCROLL_MARGIN } = {}\n) {\n\tuseLayoutEffect( () => {\n\t\tif ( ! parent || ! rect ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scrollLeft: parentScroll } = parent;\n\t\tconst parentWidth = parent.getBoundingClientRect().width;\n\t\tconst { left: childLeft, width: childWidth } = rect;\n\n\t\tconst parentRightEdge = parentScroll + parentWidth;\n\t\tconst childRightEdge = childLeft + childWidth;\n\t\tconst rightOverflow = childRightEdge + margin - parentRightEdge;\n\t\tconst leftOverflow = parentScroll - ( childLeft - margin );\n\t\tif ( leftOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll - leftOverflow;\n\t\t} else if ( rightOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll + rightOverflow;\n\t\t}\n\t}, [ margin, parent, rect ] );\n}\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst { store } = useTabsContext() ?? {};\n\n\tconst selectedId = useStoreState( store, 'selectedId' );\n\tconst activeId = useStoreState( store, 'activeId' );\n\tconst selectOnMove = useStoreState( store, 'selectOnMove' );\n\tconst items = useStoreState( store, 'items' );\n\tconst [ parent, setParent ] = useState< HTMLElement >();\n\tconst refs = useMergeRefs( [ ref, setParent ] );\n\tconst selectedRect = useTrackElementOffsetRect(\n\t\tstore?.item( selectedId )?.element\n\t);\n\n\t// Track overflow to show scroll hints.\n\tconst overflow = useTrackOverflow( parent, {\n\t\tfirst: items?.at( 0 )?.element,\n\t\tlast: items?.at( -1 )?.element,\n\t} );\n\n\t// Size, position, and animate the indicator.\n\tuseAnimatedOffsetRect( parent, selectedRect, {\n\t\tprefix: 'selected',\n\t\tdataAttribute: 'indicator-animated',\n\t\ttransitionEndFilter: ( event ) => event.pseudoElement === '::before',\n\t} );\n\n\t// Make sure selected tab is scrolled into view.\n\tuseScrollRectIntoView( parent, selectedRect );\n\n\tconst onBlur = () => {\n\t\tif ( ! selectOnMove ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When automatic tab selection is on, make sure that the active tab is up\n\t\t// to date with the selected tab when leaving the tablist. This makes sure\n\t\t// that the selected tab will receive keyboard focus when tabbing back into\n\t\t// the tablist.\n\t\tif ( selectedId !== activeId ) {\n\t\t\tstore?.setActiveId( selectedId );\n\t\t}\n\t};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Ariakit.TabList\n\t\t\tref={ refs }\n\t\t\tstore={ store }\n\t\t\trender={ <TabListWrapper /> }\n\t\t\tonBlur={ onBlur }\n\t\t\ttabIndex={ -1 }\n\t\t\tdata-select-on-move={ selectOnMove ? 'true' : 'false' }\n\t\t\t{ ...otherProps }\n\t\t\tclassName={ clsx(\n\t\t\t\toverflow.first && 'is-overflowing-first',\n\t\t\t\toverflow.last && 'is-overflowing-last',\n\t\t\t\totherProps.className\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.TabList>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,oBAAoB;AAC1E,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;;AAEA,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,cAAc,QAAQ,UAAU;AAEzC,OAAOC,IAAI,MAAM,MAAM;AAEv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AEA;IACA;IACA;IACA;IACA,IAAKF,UAAU,KAAKC,QAAQ,EAAG;MAC9BF,KAAK,EAAEoB,WAAW,CAAEnB,UAAW,CAAC;IACjC;EACD,CAAC;EAED,IAAK,CAAED,KAAK,EAAG;IACdqB,UAAA,CAAAC,YAAA,YAAAzD,OAAO,CAAE,uDAAwD,CAAC;IAClE,OAAO,IAAI;EACZ;EAEA,oBACCY,IAAA,CAACd,OAAO,CAACgC,OAAO;IACfG,GAAG,EAAGQ,IAAM;IACZN,KAAK,EAAGA,KAAO;IACfuB,MAAM,eAAG9C,IAAA,CAACN,cAAc,IAAE,CAAG;IAC7BgD,MAAM,EAAGA,MAAQ;IACjBK,QAAQ,EAAG,CAAC,CAAG;IACf,uBAAsBrB,YAAY,GAAG,MAAM,GAAG,OAAS;IAAA,GAClDN,UAAU;IACf4B,SAAS,EAAGrD,IAAI,CACfsC,QAAQ,CAACC,KAAK,IAAI,sBAAsB,EACxCD,QAAQ,CAACG,IAAI,IAAI,qBAAqB,EACtChB,UAAU,CAAC4B,SACZ,CAAG;IAAA7B,QAAA,EAEDA;EAAQ,CACM,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useStoreState","forwardRef","TabPanel","StyledTabPanel","warning","useTabsContext","jsx","_jsx","children","tabId","focusable","otherProps","ref","context","selectedId","store","globalThis","SCRIPT_DEBUG","instanceId","instancedTabId","id"],"sources":["@wordpress/components/src/tabs/tabpanel.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabPanelProps } from './types';\nimport { TabPanel as StyledTabPanel } from './styles';\n\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport type { WordPressComponentProps } from '../context';\n\nexport const TabPanel = forwardRef<\n\tHTMLDivElement,\n\tOmit< WordPressComponentProps< TabPanelProps, 'div', false >, 'id' >\n>( function TabPanel(\n\t{ children, tabId, focusable = true, ...otherProps },\n\tref\n) {\n\tconst context = useTabsContext();\n\tconst selectedId = useStoreState( context?.store, 'selectedId' );\n\tif ( ! context ) {\n\t\twarning( '`Tabs.TabPanel` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\tconst { store, instanceId } = context;\n\tconst instancedTabId = `${ instanceId }-${ tabId }`;\n\n\treturn (\n\t\t<StyledTabPanel\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\t// For TabPanel, the id passed here is the id attribute of the DOM\n\t\t\t// element.\n\t\t\t// `tabId` is the id of the tab that controls this panel.\n\t\t\tid={ `${ instancedTabId }-view` }\n\t\t\ttabId={ instancedTabId }\n\t\t\tfocusable={ focusable }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ selectedId === instancedTabId && children }\n\t\t</StyledTabPanel>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,QAAQ,IAAIC,cAAc,QAAQ,UAAU;AAErD,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,cAAc,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3C,OAAO,MAAML,QAAQ,GAAGD,UAAU,CAG/B,SAASC,QAAQA,CACnB;EAAEM,QAAQ;EAAEC,KAAK;EAAEC,SAAS,GAAG,IAAI;EAAE,GAAGC;AAAW,CAAC,EACpDC,GAAG,EACF;EACD,MAAMC,OAAO,GAAGR,cAAc,CAAC,CAAC;EAChC,MAAMS,UAAU,GAAGd,aAAa,CAAEa,OAAO,EAAEE,KAAK,EAAE,YAAa,CAAC;EAChE,IAAK,CAAEF,OAAO,EAAG;IAChBG,UAAA,CAAAC,YAAA,YAAAb,OAAO,CAAE,wDAAyD,CAAC;IACnE,OAAO,IAAI;EACZ;EACA,MAAM;IAAEW,KAAK;IAAEG;EAAW,CAAC,GAAGL,OAAO;EACrC,MAAMM,cAAc,GAAI,GAAGD,UAAY,IAAIT,KAAO,EAAC;EAEnD,oBACCF,IAAA,CAACJ,cAAc;IACdS,GAAG,EAAGA,GAAK;IACXG,KAAK,EAAGA;IACR;IACA;IACA;IAAA;IACAK,EAAE,EAAI,GAAGD,cAAgB,OAAQ;IACjCV,KAAK,EAAGU,cAAgB;IACxBT,SAAS,EAAGA,SAAW;IAAA,GAClBC,UAAU;IAAAH,QAAA,EAEbM,UAAU,KAAKK,cAAc,IAAIX;EAAQ,CAC5B,CAAC;AAEnB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useStoreState","forwardRef","TabPanel","StyledTabPanel","warning","useTabsContext","jsx","_jsx","children","tabId","focusable","otherProps","ref","context","selectedId","store","globalThis","SCRIPT_DEBUG","instanceId","instancedTabId","id"],"sources":["@wordpress/components/src/tabs/tabpanel.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabPanelProps } from './types';\nimport { TabPanel as StyledTabPanel } from './styles';\n\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport type { WordPressComponentProps } from '../context';\n\nexport const TabPanel = forwardRef<\n\tHTMLDivElement,\n\tOmit< WordPressComponentProps< TabPanelProps, 'div', false >, 'id' >\n>( function TabPanel(\n\t{ children, tabId, focusable = true, ...otherProps },\n\tref\n) {\n\tconst context = useTabsContext();\n\tconst selectedId = useStoreState( context?.store, 'selectedId' );\n\tif ( ! context ) {\n\t\twarning( '`Tabs.TabPanel` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\tconst { store, instanceId } = context;\n\tconst instancedTabId = `${ instanceId }-${ tabId }`;\n\n\treturn (\n\t\t<StyledTabPanel\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\t// For TabPanel, the id passed here is the id attribute of the DOM\n\t\t\t// element.\n\t\t\t// `tabId` is the id of the tab that controls this panel.\n\t\t\tid={ `${ instancedTabId }-view` }\n\t\t\ttabId={ instancedTabId }\n\t\t\tfocusable={ focusable }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ selectedId === instancedTabId && children }\n\t\t</StyledTabPanel>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,QAAQ,IAAIC,cAAc,QAAQ,UAAU;AAErD,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,cAAc,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3C,OAAO,MAAML,QAAQ,GAAGD,UAAU,CAG/B,SAASC,QAAQA,CACnB;EAAEM,QAAQ;EAAEC,KAAK;EAAEC,SAAS,GAAG,IAAI;EAAE,GAAGC;AAAW,CAAC,EACpDC,GAAG,EACF;EACD,MAAMC,OAAO,GAAGR,cAAc,CAAC,CAAC;EAChC,MAAMS,UAAU,GAAGd,aAAa,CAAEa,OAAO,EAAEE,KAAK,EAAE,YAAa,CAAC;EAChE,IAAK,CAAEF,OAAO,EAAG;IAChBG,UAAA,CAAAC,YAAA,YAAAb,OAAO,CAAE,wDAAyD,CAAC;IACnE,OAAO,IAAI;EACZ;EACA,MAAM;IAAEW,KAAK;IAAEG;EAAW,CAAC,GAAGL,OAAO;EACrC,MAAMM,cAAc,GAAG,GAAID,UAAU,IAAMT,KAAK,EAAG;EAEnD,oBACCF,IAAA,CAACJ,cAAc;IACdS,GAAG,EAAGA,GAAK;IACXG,KAAK,EAAGA;IACR;IACA;IACA;IAAA;IACAK,EAAE,EAAG,GAAID,cAAc,OAAU;IACjCV,KAAK,EAAGU,cAAgB;IACxBT,SAAS,EAAGA,SAAW;IAAA,GAClBC,UAAU;IAAAH,QAAA,EAEbM,UAAU,KAAKK,cAAc,IAAIX;EAAQ,CAC5B,CAAC;AAEnB,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ /* eslint-disable jsdoc/require-param */
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { useState, useEffect } from '@wordpress/element';
6
+ import { useEvent } from '@wordpress/compose';
7
+
8
+ /**
9
+ * Tracks if an element contains overflow and on which end by tracking the
10
+ * first and last child elements with an `IntersectionObserver` in relation
11
+ * to the parent element.
12
+ *
13
+ * Note that the returned value will only indicate whether the first or last
14
+ * element is currently "going out of bounds" but not whether it happens on
15
+ * the X or Y axis.
16
+ */
17
+ export function useTrackOverflow(parent, children) {
18
+ const [first, setFirst] = useState(false);
19
+ const [last, setLast] = useState(false);
20
+ const [observer, setObserver] = useState();
21
+ const callback = useEvent(entries => {
22
+ for (const entry of entries) {
23
+ if (entry.target === children.first) {
24
+ setFirst(!entry.isIntersecting);
25
+ }
26
+ if (entry.target === children.last) {
27
+ setLast(!entry.isIntersecting);
28
+ }
29
+ }
30
+ });
31
+ useEffect(() => {
32
+ if (!parent || !window.IntersectionObserver) {
33
+ return;
34
+ }
35
+ const newObserver = new IntersectionObserver(callback, {
36
+ root: parent,
37
+ threshold: 0.9
38
+ });
39
+ setObserver(newObserver);
40
+ return () => newObserver.disconnect();
41
+ }, [callback, parent]);
42
+ useEffect(() => {
43
+ if (!observer) {
44
+ return;
45
+ }
46
+ if (children.first) {
47
+ observer.observe(children.first);
48
+ }
49
+ if (children.last) {
50
+ observer.observe(children.last);
51
+ }
52
+ return () => {
53
+ if (children.first) {
54
+ observer.unobserve(children.first);
55
+ }
56
+ if (children.last) {
57
+ observer.unobserve(children.last);
58
+ }
59
+ };
60
+ }, [children.first, children.last, observer]);
61
+ return {
62
+ first,
63
+ last
64
+ };
65
+ }
66
+ /* eslint-enable jsdoc/require-param */
67
+ //# sourceMappingURL=use-track-overflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useState","useEffect","useEvent","useTrackOverflow","parent","children","first","setFirst","last","setLast","observer","setObserver","callback","entries","entry","target","isIntersecting","window","IntersectionObserver","newObserver","root","threshold","disconnect","observe","unobserve"],"sources":["@wordpress/components/src/tabs/use-track-overflow.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-param */\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { useEvent } from '@wordpress/compose';\n\n/**\n * Tracks if an element contains overflow and on which end by tracking the\n * first and last child elements with an `IntersectionObserver` in relation\n * to the parent element.\n *\n * Note that the returned value will only indicate whether the first or last\n * element is currently \"going out of bounds\" but not whether it happens on\n * the X or Y axis.\n */\nexport function useTrackOverflow(\n\tparent: HTMLElement | undefined | null,\n\tchildren: {\n\t\tfirst: HTMLElement | undefined | null;\n\t\tlast: HTMLElement | undefined | null;\n\t}\n) {\n\tconst [ first, setFirst ] = useState( false );\n\tconst [ last, setLast ] = useState( false );\n\tconst [ observer, setObserver ] = useState< IntersectionObserver >();\n\n\tconst callback: IntersectionObserverCallback = useEvent( ( entries ) => {\n\t\tfor ( const entry of entries ) {\n\t\t\tif ( entry.target === children.first ) {\n\t\t\t\tsetFirst( ! entry.isIntersecting );\n\t\t\t}\n\t\t\tif ( entry.target === children.last ) {\n\t\t\t\tsetLast( ! entry.isIntersecting );\n\t\t\t}\n\t\t}\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! parent || ! window.IntersectionObserver ) {\n\t\t\treturn;\n\t\t}\n\t\tconst newObserver = new IntersectionObserver( callback, {\n\t\t\troot: parent,\n\t\t\tthreshold: 0.9,\n\t\t} );\n\t\tsetObserver( newObserver );\n\n\t\treturn () => newObserver.disconnect();\n\t}, [ callback, parent ] );\n\n\tuseEffect( () => {\n\t\tif ( ! observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( children.first ) {\n\t\t\tobserver.observe( children.first );\n\t\t}\n\t\tif ( children.last ) {\n\t\t\tobserver.observe( children.last );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( children.first ) {\n\t\t\t\tobserver.unobserve( children.first );\n\t\t\t}\n\t\t\tif ( children.last ) {\n\t\t\t\tobserver.unobserve( children.last );\n\t\t\t}\n\t\t};\n\t}, [ children.first, children.last, observer ] );\n\n\treturn { first, last };\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC/BC,MAAsC,EACtCC,QAGC,EACA;EACD,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAGP,QAAQ,CAAE,KAAM,CAAC;EAC7C,MAAM,CAAEQ,IAAI,EAAEC,OAAO,CAAE,GAAGT,QAAQ,CAAE,KAAM,CAAC;EAC3C,MAAM,CAAEU,QAAQ,EAAEC,WAAW,CAAE,GAAGX,QAAQ,CAAyB,CAAC;EAEpE,MAAMY,QAAsC,GAAGV,QAAQ,CAAIW,OAAO,IAAM;IACvE,KAAM,MAAMC,KAAK,IAAID,OAAO,EAAG;MAC9B,IAAKC,KAAK,CAACC,MAAM,KAAKV,QAAQ,CAACC,KAAK,EAAG;QACtCC,QAAQ,CAAE,CAAEO,KAAK,CAACE,cAAe,CAAC;MACnC;MACA,IAAKF,KAAK,CAACC,MAAM,KAAKV,QAAQ,CAACG,IAAI,EAAG;QACrCC,OAAO,CAAE,CAAEK,KAAK,CAACE,cAAe,CAAC;MAClC;IACD;EACD,CAAE,CAAC;EAEHf,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEG,MAAM,IAAI,CAAEa,MAAM,CAACC,oBAAoB,EAAG;MAChD;IACD;IACA,MAAMC,WAAW,GAAG,IAAID,oBAAoB,CAAEN,QAAQ,EAAE;MACvDQ,IAAI,EAAEhB,MAAM;MACZiB,SAAS,EAAE;IACZ,CAAE,CAAC;IACHV,WAAW,CAAEQ,WAAY,CAAC;IAE1B,OAAO,MAAMA,WAAW,CAACG,UAAU,CAAC,CAAC;EACtC,CAAC,EAAE,CAAEV,QAAQ,EAAER,MAAM,CAAG,CAAC;EAEzBH,SAAS,CAAE,MAAM;IAChB,IAAK,CAAES,QAAQ,EAAG;MACjB;IACD;IAEA,IAAKL,QAAQ,CAACC,KAAK,EAAG;MACrBI,QAAQ,CAACa,OAAO,CAAElB,QAAQ,CAACC,KAAM,CAAC;IACnC;IACA,IAAKD,QAAQ,CAACG,IAAI,EAAG;MACpBE,QAAQ,CAACa,OAAO,CAAElB,QAAQ,CAACG,IAAK,CAAC;IAClC;IAEA,OAAO,MAAM;MACZ,IAAKH,QAAQ,CAACC,KAAK,EAAG;QACrBI,QAAQ,CAACc,SAAS,CAAEnB,QAAQ,CAACC,KAAM,CAAC;MACrC;MACA,IAAKD,QAAQ,CAACG,IAAI,EAAG;QACpBE,QAAQ,CAACc,SAAS,CAAEnB,QAAQ,CAACG,IAAK,CAAC;MACpC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAACC,KAAK,EAAED,QAAQ,CAACG,IAAI,EAAEE,QAAQ,CAAG,CAAC;EAEhD,OAAO;IAAEJ,KAAK;IAAEE;EAAK,CAAC;AACvB;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["space","CONFIG","getLineHeight","adjustLineHeightForInnerControls","lineHeight","value","controlHeight","controlHeightLarge","controlHeightSmall","controlHeightXSmall"],"sources":["@wordpress/components/src/text/get-line-height.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props } from './types';\nimport { space } from '../utils/space';\nimport { CONFIG } from '../utils';\n\nexport function getLineHeight(\n\tadjustLineHeightForInnerControls: Props[ 'adjustLineHeightForInnerControls' ],\n\tlineHeight: CSSProperties[ 'lineHeight' ]\n) {\n\tif ( lineHeight ) {\n\t\treturn lineHeight;\n\t}\n\n\tif ( ! adjustLineHeightForInnerControls ) {\n\t\treturn;\n\t}\n\n\tlet value = `calc(${ CONFIG.controlHeight } + ${ space( 2 ) })`;\n\n\tswitch ( adjustLineHeightForInnerControls ) {\n\t\tcase 'large':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightLarge } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tcase 'small':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightSmall } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tcase 'xSmall':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightXSmall } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn value;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,gBAAgB;AACtC,SAASC,MAAM,QAAQ,UAAU;AAEjC,OAAO,SAASC,aAAaA,CAC5BC,gCAA6E,EAC7EC,UAAyC,EACxC;EACD,IAAKA,UAAU,EAAG;IACjB,OAAOA,UAAU;EAClB;EAEA,IAAK,CAAED,gCAAgC,EAAG;IACzC;EACD;EAEA,IAAIE,KAAK,GAAI,QAAQJ,MAAM,CAACK,aAAe,MAAMN,KAAK,CAAE,CAAE,CAAG,GAAE;EAE/D,QAASG,gCAAgC;IACxC,KAAK,OAAO;MACXE,KAAK,GAAI,QAAQJ,MAAM,CAACM,kBAAoB,MAAMP,KAAK,CAAE,CAAE,CAAG,GAAE;MAChE;IACD,KAAK,OAAO;MACXK,KAAK,GAAI,QAAQJ,MAAM,CAACO,kBAAoB,MAAMR,KAAK,CAAE,CAAE,CAAG,GAAE;MAChE;IACD,KAAK,QAAQ;MACZK,KAAK,GAAI,QAAQJ,MAAM,CAACQ,mBAAqB,MAAMT,KAAK,CAAE,CAAE,CAAG,GAAE;MACjE;IACD;MACC;EACF;EAEA,OAAOK,KAAK;AACb","ignoreList":[]}
1
+ {"version":3,"names":["space","CONFIG","getLineHeight","adjustLineHeightForInnerControls","lineHeight","value","controlHeight","controlHeightLarge","controlHeightSmall","controlHeightXSmall"],"sources":["@wordpress/components/src/text/get-line-height.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props } from './types';\nimport { space } from '../utils/space';\nimport { CONFIG } from '../utils';\n\nexport function getLineHeight(\n\tadjustLineHeightForInnerControls: Props[ 'adjustLineHeightForInnerControls' ],\n\tlineHeight: CSSProperties[ 'lineHeight' ]\n) {\n\tif ( lineHeight ) {\n\t\treturn lineHeight;\n\t}\n\n\tif ( ! adjustLineHeightForInnerControls ) {\n\t\treturn;\n\t}\n\n\tlet value = `calc(${ CONFIG.controlHeight } + ${ space( 2 ) })`;\n\n\tswitch ( adjustLineHeightForInnerControls ) {\n\t\tcase 'large':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightLarge } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tcase 'small':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightSmall } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tcase 'xSmall':\n\t\t\tvalue = `calc(${ CONFIG.controlHeightXSmall } + ${ space( 2 ) })`;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn value;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,gBAAgB;AACtC,SAASC,MAAM,QAAQ,UAAU;AAEjC,OAAO,SAASC,aAAaA,CAC5BC,gCAA6E,EAC7EC,UAAyC,EACxC;EACD,IAAKA,UAAU,EAAG;IACjB,OAAOA,UAAU;EAClB;EAEA,IAAK,CAAED,gCAAgC,EAAG;IACzC;EACD;EAEA,IAAIE,KAAK,GAAG,QAASJ,MAAM,CAACK,aAAa,MAAQN,KAAK,CAAE,CAAE,CAAC,GAAI;EAE/D,QAASG,gCAAgC;IACxC,KAAK,OAAO;MACXE,KAAK,GAAG,QAASJ,MAAM,CAACM,kBAAkB,MAAQP,KAAK,CAAE,CAAE,CAAC,GAAI;MAChE;IACD,KAAK,OAAO;MACXK,KAAK,GAAG,QAASJ,MAAM,CAACO,kBAAkB,MAAQR,KAAK,CAAE,CAAE,CAAC,GAAI;MAChE;IACD,KAAK,QAAQ;MACZK,KAAK,GAAG,QAASJ,MAAM,CAACQ,mBAAmB,MAAQT,KAAK,CAAE,CAAE,CAAC,GAAI;MACjE;IACD;MACC;EACF;EAEA,OAAOK,KAAK;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["fontFamily","css","COLORS","fontWeightNormal","fontWeightMedium","fontWeightSemibold","title","titleLarge","titleMedium","titleSmall","subtitle","subtitleLarge","subtitleSmall","body","bodyLarge","bodySmall","button","caption","label","sectionHeading","gray","variant","variantName","text","props"],"sources":["@wordpress/components/src/text/styles/text-mixins.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { fontFamily } from './font-family';\nimport css from './emotion-css';\nimport { COLORS } from '../../utils/colors-values';\n\nconst fontWeightNormal = `font-weight: 400;`;\nconst fontWeightMedium = `font-weight: 500;`;\nconst fontWeightSemibold = `font-weight: 600;`;\n\nconst title = `\n ${ fontWeightNormal }\n`;\n\nconst titleLarge = `\n\tfont-size: 32px;\n\tline-height: 40px;\n`;\n\nconst titleMedium = `\n\tfont-size: 24px;\n\tline-height: 32px;\n`;\n\nconst titleSmall = `\n\tfont-size: 20px;\n\tline-height: 28px;\n`;\n\nconst subtitle = `\n\t${ fontWeightSemibold }\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst subtitleLarge = `\n\tfont-size: 16px;\n\tline-height: 24px;\n`;\n\nconst subtitleSmall = `\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst body = `\n\t${ fontWeightNormal }\n`;\n\nconst bodyLarge = `\n\tfont-size: 16px;\n\tline-height: 24px;\n`;\n\nconst bodySmall = `\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst button = `\n ${ fontWeightSemibold }\n font-size: 14px;\n line-height: 20px;\n`;\n\nconst caption = `\n\t${ fontWeightNormal }\n\tfont-size: 12px;\n\tline-height: 16px;\n`;\n\nconst label = `\n\t${ fontWeightSemibold }\n\tfont-size: 12px;\n\tline-height: 16px;\n`;\n\nconst sectionHeading = `\n\t${ fontWeightMedium }\n\tfont-size: 11px;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tcolor: ${ COLORS.gray[ 700 ] }\n`;\n\n/**\n * @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'|'sectionheading'} TextVariant\n */\n\n/**\n * @param {TextVariant} variantName\n */\nconst variant = ( variantName = 'body' ) => {\n\tswitch ( variantName ) {\n\t\tcase 'title.large':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleLarge }\n\t\t\t`;\n\t\tcase 'title.medium':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleMedium }\n\t\t\t`;\n\t\tcase 'title.small':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleSmall }\n\t\t\t`;\n\n\t\tcase 'subtitle':\n\t\t\treturn css`\n\t\t\t\t${ subtitle }\n\t\t\t\t${ subtitleLarge }\n\t\t\t`;\n\t\tcase 'subtitle.small':\n\t\t\treturn css`\n\t\t\t\t${ subtitle }\n\t\t\t\t${ subtitleSmall }\n\t\t\t`;\n\n\t\tcase 'body':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t`;\n\t\tcase 'body.large':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t\t${ bodyLarge }\n\t\t\t`;\n\t\tcase 'body.small':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t\t${ bodySmall }\n\t\t\t`;\n\n\t\tcase 'button':\n\t\t\treturn button;\n\n\t\tcase 'caption':\n\t\t\treturn caption;\n\n\t\tcase 'label':\n\t\t\treturn label;\n\n\t\tcase 'sectionheading':\n\t\t\treturn sectionHeading;\n\t}\n};\n\n/**\n * @typedef {Object} TextProps\n * @property {TextVariant} variant one of TextVariant to be used\n */\n\n/**\n * @param {TextProps} props\n */\nexport const text = ( props ) => css`\n\t${ fontFamily }\n\t${ variant( props.variant ) }\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,eAAe;AAC1C,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,gBAAgB,GAAI,mBAAkB;AAC5C,MAAMC,gBAAgB,GAAI,mBAAkB;AAC5C,MAAMC,kBAAkB,GAAI,mBAAkB;AAE9C,MAAMC,KAAK,GAAI;AACf,IAAKH,gBAAkB;AACvB,CAAC;AAED,MAAMI,UAAU,GAAI;AACpB;AACA;AACA,CAAC;AAED,MAAMC,WAAW,GAAI;AACrB;AACA;AACA,CAAC;AAED,MAAMC,UAAU,GAAI;AACpB;AACA;AACA,CAAC;AAED,MAAMC,QAAQ,GAAI;AAClB,GAAIL,kBAAoB;AACxB;AACA;AACA,CAAC;AAED,MAAMM,aAAa,GAAI;AACvB;AACA;AACA,CAAC;AAED,MAAMC,aAAa,GAAI;AACvB;AACA;AACA,CAAC;AAED,MAAMC,IAAI,GAAI;AACd,GAAIV,gBAAkB;AACtB,CAAC;AAED,MAAMW,SAAS,GAAI;AACnB;AACA;AACA,CAAC;AAED,MAAMC,SAAS,GAAI;AACnB;AACA;AACA,CAAC;AAED,MAAMC,MAAM,GAAI;AAChB,IAAKX,kBAAoB;AACzB;AACA;AACA,CAAC;AAED,MAAMY,OAAO,GAAI;AACjB,GAAId,gBAAkB;AACtB;AACA;AACA,CAAC;AAED,MAAMe,KAAK,GAAI;AACf,GAAIb,kBAAoB;AACxB;AACA;AACA,CAAC;AAED,MAAMc,cAAc,GAAI;A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,"names":["fontFamily","css","COLORS","fontWeightNormal","fontWeightMedium","fontWeightSemibold","title","titleLarge","titleMedium","titleSmall","subtitle","subtitleLarge","subtitleSmall","body","bodyLarge","bodySmall","button","caption","label","sectionHeading","gray","variant","variantName","text","props"],"sources":["@wordpress/components/src/text/styles/text-mixins.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { fontFamily } from './font-family';\nimport css from './emotion-css';\nimport { COLORS } from '../../utils/colors-values';\n\nconst fontWeightNormal = `font-weight: 400;`;\nconst fontWeightMedium = `font-weight: 500;`;\nconst fontWeightSemibold = `font-weight: 600;`;\n\nconst title = `\n ${ fontWeightNormal }\n`;\n\nconst titleLarge = `\n\tfont-size: 32px;\n\tline-height: 40px;\n`;\n\nconst titleMedium = `\n\tfont-size: 24px;\n\tline-height: 32px;\n`;\n\nconst titleSmall = `\n\tfont-size: 20px;\n\tline-height: 28px;\n`;\n\nconst subtitle = `\n\t${ fontWeightSemibold }\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst subtitleLarge = `\n\tfont-size: 16px;\n\tline-height: 24px;\n`;\n\nconst subtitleSmall = `\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst body = `\n\t${ fontWeightNormal }\n`;\n\nconst bodyLarge = `\n\tfont-size: 16px;\n\tline-height: 24px;\n`;\n\nconst bodySmall = `\n\tfont-size: 14px;\n\tline-height: 20px;\n`;\n\nconst button = `\n ${ fontWeightSemibold }\n font-size: 14px;\n line-height: 20px;\n`;\n\nconst caption = `\n\t${ fontWeightNormal }\n\tfont-size: 12px;\n\tline-height: 16px;\n`;\n\nconst label = `\n\t${ fontWeightSemibold }\n\tfont-size: 12px;\n\tline-height: 16px;\n`;\n\nconst sectionHeading = `\n\t${ fontWeightMedium }\n\tfont-size: 11px;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tcolor: ${ COLORS.gray[ 700 ] }\n`;\n\n/**\n * @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'|'sectionheading'} TextVariant\n */\n\n/**\n * @param {TextVariant} variantName\n */\nconst variant = ( variantName = 'body' ) => {\n\tswitch ( variantName ) {\n\t\tcase 'title.large':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleLarge }\n\t\t\t`;\n\t\tcase 'title.medium':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleMedium }\n\t\t\t`;\n\t\tcase 'title.small':\n\t\t\treturn css`\n\t\t\t\t${ title }\n\t\t\t\t${ titleSmall }\n\t\t\t`;\n\n\t\tcase 'subtitle':\n\t\t\treturn css`\n\t\t\t\t${ subtitle }\n\t\t\t\t${ subtitleLarge }\n\t\t\t`;\n\t\tcase 'subtitle.small':\n\t\t\treturn css`\n\t\t\t\t${ subtitle }\n\t\t\t\t${ subtitleSmall }\n\t\t\t`;\n\n\t\tcase 'body':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t`;\n\t\tcase 'body.large':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t\t${ bodyLarge }\n\t\t\t`;\n\t\tcase 'body.small':\n\t\t\treturn css`\n\t\t\t\t${ body }\n\t\t\t\t${ bodySmall }\n\t\t\t`;\n\n\t\tcase 'button':\n\t\t\treturn button;\n\n\t\tcase 'caption':\n\t\t\treturn caption;\n\n\t\tcase 'label':\n\t\t\treturn label;\n\n\t\tcase 'sectionheading':\n\t\t\treturn sectionHeading;\n\t}\n};\n\n/**\n * @typedef {Object} TextProps\n * @property {TextVariant} variant one of TextVariant to be used\n */\n\n/**\n * @param {TextProps} props\n */\nexport const text = ( props ) => css`\n\t${ fontFamily }\n\t${ variant( props.variant ) }\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,eAAe;AAC1C,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,gBAAgB,GAAG,mBAA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,KAAK;AACZ,MAAOG,UAAU;AACjB,IAAI;IAEF,KAAK,UAAU;MACd,OAAOR,GAAG;AACb,MAAOS,QAAQ;AACf,MAAOC,aAAa;AACpB,IAAI;IACF,KAAK,gBAAgB;MACpB,OAAOV,GAAG;AACb,MAAOS,QAAQ;AACf,MAAOE,aAAa;AACpB,IAAI;IAEF,KAAK,MAAM;MACV,OAAOX,GAAG;AACb,MAAOY,IAAI;AACX,IAAI;IACF,KAAK,YAAY;MAChB,OAAOZ,GAAG;AACb,MAAOY,IAAI;AACX,MAAOC,SAAS;AAChB,IAAI;IACF,KAAK,YAAY;MAChB,OAAOb,GAAG;AACb,MAAOY,IAAI;AACX,MAAOE,SAAS;AAChB,IAAI;IAEF,KAAK,QAAQ;MACZ,OAAOC,MAAM;IAEd,KAAK,SAAS;MACb,OAAOC,OAAO;IAEf,KAAK,OAAO;MACX,OAAOC,KAAK;IAEb,KAAK,gBAAgB;MACpB,OAAOC,cAAc;EACvB;AACD,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMI,IAAI,GAAKC,KAAK,IAAMvB,GAAG;AACpC,GAAID,UAAU;AACd,GAAIqB,OAAO,CAAEG,KAAK,CAACH,OAAQ,CAAC;AAC5B,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["memoize","findAll","createElement","lowercaseProps","object","mapped","key","toLowerCase","memoizedLowercaseProps","createHighlighterText","activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","children","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","unhighlightClassName","unhighlightStyle","textToHighlight","chunks","HighlightTag","highlightIndex","highlightClassNames","highlightStyles","textContent","map","chunk","index","text","substr","start","end","highlight","highlightClass","isActive","Object","assign","props","className","style"],"sources":["@wordpress/components/src/text/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport type { FindAllArgs } from 'highlight-words-core';\nimport { findAll } from 'highlight-words-core';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/**\n * Source:\n * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js\n */\n\n/**\n * @typedef Options\n * @property {string} [activeClassName=''] Classname for active highlighted areas.\n * @property {number} [activeIndex=-1] The index of the active highlighted area.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area.\n * @property {boolean} [autoEscape] Whether to automatically escape text.\n * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner.\n * @property {string} children Children to highlight.\n * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`.\n * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.\n * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.\n * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.\n * @property {string[]} [searchWords=[]] Words to search for and highlight.\n * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.\n */\n\ninterface Options {\n\tactiveClassName?: string;\n\tactiveIndex?: number;\n\tactiveStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\tautoEscape?: boolean;\n\tcaseSensitive?: boolean;\n\tchildren: string;\n\tfindChunks?: FindAllArgs[ 'findChunks' ];\n\thighlightClassName?: string | Record< string, unknown >;\n\thighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\thighlightTag?: keyof JSX.IntrinsicElements;\n\tsanitize?: FindAllArgs[ 'sanitize' ];\n\tsearchWords?: string[];\n\tunhighlightClassName?: string;\n\tunhighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n}\n\n/**\n * Maps props to lowercase names.\n *\n * @param object Props to map.\n * @return The mapped props.\n */\nconst lowercaseProps = < T extends Record< string, unknown > >( object: T ) => {\n\tconst mapped: Record< string, unknown > = {};\n\tfor ( const key in object ) {\n\t\tmapped[ key.toLowerCase() ] = object[ key ];\n\t}\n\treturn mapped as { [ K in keyof T as Lowercase< string & K > ]: T[ K ] };\n};\n\nconst memoizedLowercaseProps = memoize( lowercaseProps );\n\n/**\n * @param options\n * @param options.activeClassName\n * @param options.activeIndex\n * @param options.activeStyle\n * @param options.autoEscape\n * @param options.caseSensitive\n * @param options.children\n * @param options.findChunks\n * @param options.highlightClassName\n * @param options.highlightStyle\n * @param options.highlightTag\n * @param options.sanitize\n * @param options.searchWords\n * @param options.unhighlightClassName\n * @param options.unhighlightStyle\n */\nexport function createHighlighterText( {\n\tactiveClassName = '',\n\tactiveIndex = -1,\n\tactiveStyle,\n\tautoEscape,\n\tcaseSensitive = false,\n\tchildren,\n\tfindChunks,\n\thighlightClassName = '',\n\thighlightStyle = {},\n\thighlightTag = 'mark',\n\tsanitize,\n\tsearchWords = [],\n\tunhighlightClassName = '',\n\tunhighlightStyle,\n}: Options ) {\n\tif ( ! children ) {\n\t\treturn null;\n\t}\n\tif ( typeof children !== 'string' ) {\n\t\treturn children;\n\t}\n\n\tconst textToHighlight = children;\n\n\tconst chunks = findAll( {\n\t\tautoEscape,\n\t\tcaseSensitive,\n\t\tfindChunks,\n\t\tsanitize,\n\t\tsearchWords,\n\t\ttextToHighlight,\n\t} );\n\tconst HighlightTag = highlightTag;\n\tlet highlightIndex = -1;\n\tlet highlightClassNames = '';\n\tlet highlightStyles;\n\n\tconst textContent = chunks.map( ( chunk, index ) => {\n\t\tconst text = textToHighlight.substr(\n\t\t\tchunk.start,\n\t\t\tchunk.end - chunk.start\n\t\t);\n\n\t\tif ( chunk.highlight ) {\n\t\t\thighlightIndex++;\n\n\t\t\tlet highlightClass;\n\t\t\tif ( typeof highlightClassName === 'object' ) {\n\t\t\t\tif ( ! caseSensitive ) {\n\t\t\t\t\thighlightClassName =\n\t\t\t\t\t\tmemoizedLowercaseProps( highlightClassName );\n\t\t\t\t\thighlightClass = highlightClassName[ text.toLowerCase() ];\n\t\t\t\t} else {\n\t\t\t\t\thighlightClass = highlightClassName[ text ];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thighlightClass = highlightClassName;\n\t\t\t}\n\n\t\t\tconst isActive = highlightIndex === +activeIndex;\n\n\t\t\thighlightClassNames = `${ highlightClass } ${\n\t\t\t\tisActive ? activeClassName : ''\n\t\t\t}`;\n\t\t\thighlightStyles =\n\t\t\t\tisActive === true && activeStyle !== null\n\t\t\t\t\t? Object.assign( {}, highlightStyle, activeStyle )\n\t\t\t\t\t: highlightStyle;\n\n\t\t\tconst props: Record< string, unknown > = {\n\t\t\t\tchildren: text,\n\t\t\t\tclassName: highlightClassNames,\n\t\t\t\tkey: index,\n\t\t\t\tstyle: highlightStyles,\n\t\t\t};\n\n\t\t\t// Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)\n\t\t\t// Only pass through the highlightIndex attribute for custom components.\n\t\t\tif ( typeof HighlightTag !== 'string' ) {\n\t\t\t\tprops.highlightIndex = highlightIndex;\n\t\t\t}\n\n\t\t\treturn createElement( HighlightTag, props );\n\t\t}\n\t\treturn createElement( 'span', {\n\t\t\tchildren: text,\n\t\t\tclassName: unhighlightClassName,\n\t\t\tkey: index,\n\t\t\tstyle: unhighlightStyle,\n\t\t} );\n\t} );\n\n\treturn textContent;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,QAAQ;AAE5B,SAASC,OAAO,QAAQ,sBAAsB;;AAE9C;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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Ba,QAAQ,EAAEmB,IAAI;MACdU,SAAS,EAAEtB,oBAAoB;MAC/BhB,GAAG,EAAE2B,KAAK;MACVY,KAAK,EAAEtB;IACR,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAOO,WAAW;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["memoize","findAll","createElement","lowercaseProps","object","mapped","key","toLowerCase","memoizedLowercaseProps","createHighlighterText","activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","children","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","unhighlightClassName","unhighlightStyle","textToHighlight","chunks","HighlightTag","highlightIndex","highlightClassNames","highlightStyles","textContent","map","chunk","index","text","substr","start","end","highlight","highlightClass","isActive","Object","assign","props","className","style"],"sources":["@wordpress/components/src/text/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport type { FindAllArgs } from 'highlight-words-core';\nimport { findAll } from 'highlight-words-core';\n\n/**\n * WordPress dependencies\n */\nimport { createElement } from '@wordpress/element';\n\n/**\n * Source:\n * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js\n */\n\n/**\n * @typedef Options\n * @property {string} [activeClassName=''] Classname for active highlighted areas.\n * @property {number} [activeIndex=-1] The index of the active highlighted area.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [activeStyle] Styles to apply to the active highlighted area.\n * @property {boolean} [autoEscape] Whether to automatically escape text.\n * @property {boolean} [caseSensitive=false] Whether to highlight in a case-sensitive manner.\n * @property {string} children Children to highlight.\n * @property {import('highlight-words-core').FindAllArgs['findChunks']} [findChunks] Custom `findChunks` function to pass to `highlight-words-core`.\n * @property {string | Record<string, unknown>} [highlightClassName=''] Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [highlightStyle={}] Styles to apply to highlighted text.\n * @property {keyof JSX.IntrinsicElements} [highlightTag='mark'] Tag to use for the highlighted text.\n * @property {import('highlight-words-core').FindAllArgs['sanitize']} [sanitize] Custom `santize` function to pass to `highlight-words-core`.\n * @property {string[]} [searchWords=[]] Words to search for and highlight.\n * @property {string} [unhighlightClassName=''] Classname to apply to unhighlighted text.\n * @property {import('react').AllHTMLAttributes<HTMLDivElement>['style']} [unhighlightStyle] Style to apply to unhighlighted text.\n */\n\ninterface Options {\n\tactiveClassName?: string;\n\tactiveIndex?: number;\n\tactiveStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\tautoEscape?: boolean;\n\tcaseSensitive?: boolean;\n\tchildren: string;\n\tfindChunks?: FindAllArgs[ 'findChunks' ];\n\thighlightClassName?: string | Record< string, unknown >;\n\thighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n\thighlightTag?: keyof JSX.IntrinsicElements;\n\tsanitize?: FindAllArgs[ 'sanitize' ];\n\tsearchWords?: string[];\n\tunhighlightClassName?: string;\n\tunhighlightStyle?: React.AllHTMLAttributes< HTMLDivElement >[ 'style' ];\n}\n\n/**\n * Maps props to lowercase names.\n *\n * @param object Props to map.\n * @return The mapped props.\n */\nconst lowercaseProps = < T extends Record< string, unknown > >( object: T ) => {\n\tconst mapped: Record< string, unknown > = {};\n\tfor ( const key in object ) {\n\t\tmapped[ key.toLowerCase() ] = object[ key ];\n\t}\n\treturn mapped as { [ K in keyof T as Lowercase< string & K > ]: T[ K ] };\n};\n\nconst memoizedLowercaseProps = memoize( lowercaseProps );\n\n/**\n * @param options\n * @param options.activeClassName\n * @param options.activeIndex\n * @param options.activeStyle\n * @param options.autoEscape\n * @param options.caseSensitive\n * @param options.children\n * @param options.findChunks\n * @param options.highlightClassName\n * @param options.highlightStyle\n * @param options.highlightTag\n * @param options.sanitize\n * @param options.searchWords\n * @param options.unhighlightClassName\n * @param options.unhighlightStyle\n */\nexport function createHighlighterText( {\n\tactiveClassName = '',\n\tactiveIndex = -1,\n\tactiveStyle,\n\tautoEscape,\n\tcaseSensitive = false,\n\tchildren,\n\tfindChunks,\n\thighlightClassName = '',\n\thighlightStyle = {},\n\thighlightTag = 'mark',\n\tsanitize,\n\tsearchWords = [],\n\tunhighlightClassName = '',\n\tunhighlightStyle,\n}: Options ) {\n\tif ( ! children ) {\n\t\treturn null;\n\t}\n\tif ( typeof children !== 'string' ) {\n\t\treturn children;\n\t}\n\n\tconst textToHighlight = children;\n\n\tconst chunks = findAll( {\n\t\tautoEscape,\n\t\tcaseSensitive,\n\t\tfindChunks,\n\t\tsanitize,\n\t\tsearchWords,\n\t\ttextToHighlight,\n\t} );\n\tconst HighlightTag = highlightTag;\n\tlet highlightIndex = -1;\n\tlet highlightClassNames = '';\n\tlet highlightStyles;\n\n\tconst textContent = chunks.map( ( chunk, index ) => {\n\t\tconst text = textToHighlight.substr(\n\t\t\tchunk.start,\n\t\t\tchunk.end - chunk.start\n\t\t);\n\n\t\tif ( chunk.highlight ) {\n\t\t\thighlightIndex++;\n\n\t\t\tlet highlightClass;\n\t\t\tif ( typeof highlightClassName === 'object' ) {\n\t\t\t\tif ( ! caseSensitive ) {\n\t\t\t\t\thighlightClassName =\n\t\t\t\t\t\tmemoizedLowercaseProps( highlightClassName );\n\t\t\t\t\thighlightClass = highlightClassName[ text.toLowerCase() ];\n\t\t\t\t} else {\n\t\t\t\t\thighlightClass = highlightClassName[ text ];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thighlightClass = highlightClassName;\n\t\t\t}\n\n\t\t\tconst isActive = highlightIndex === +activeIndex;\n\n\t\t\thighlightClassNames = `${ highlightClass } ${\n\t\t\t\tisActive ? activeClassName : ''\n\t\t\t}`;\n\t\t\thighlightStyles =\n\t\t\t\tisActive === true && activeStyle !== null\n\t\t\t\t\t? Object.assign( {}, highlightStyle, activeStyle )\n\t\t\t\t\t: highlightStyle;\n\n\t\t\tconst props: Record< string, unknown > = {\n\t\t\t\tchildren: text,\n\t\t\t\tclassName: highlightClassNames,\n\t\t\t\tkey: index,\n\t\t\t\tstyle: highlightStyles,\n\t\t\t};\n\n\t\t\t// Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)\n\t\t\t// Only pass through the highlightIndex attribute for custom components.\n\t\t\tif ( typeof HighlightTag !== 'string' ) {\n\t\t\t\tprops.highlightIndex = highlightIndex;\n\t\t\t}\n\n\t\t\treturn createElement( HighlightTag, props );\n\t\t}\n\t\treturn createElement( 'span', {\n\t\t\tchildren: text,\n\t\t\tclassName: unhighlightClassName,\n\t\t\tkey: index,\n\t\t\tstyle: unhighlightStyle,\n\t\t} );\n\t} );\n\n\treturn textContent;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAO,MAAM,QAAQ;AAE5B,SAASC,OAAO,QAAQ,sBAAsB;;AAE9C;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAA4CC,MAAS,IAAM;EAC9E,MAAMC,MAAiC,GAAG,CAAC,CAAC;EAC5C,KAAM,MAAMC,GAAG,IAAIF,MAAM,EAAG;IAC3BC,MAAM,CAAEC,GAAG,CAACC,WAAW,CAAC,CAAC,CAAE,GAAGH,MAAM,CAAEE,GAAG,CAAE;EAC5C;EACA,OAAOD,MAAM;AACd,CAAC;AAED,MAAMG,sBAAsB,GAAGR,OAAO,CAAEG,cAAe,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,qBAAqBA,CAAE;EACtCC,eAAe,GAAG,EAAE;EACpBC,WAAW,GAAG,CAAC,CAAC;EAChBC,WAAW;EACXC,UAAU;EACVC,aAAa,GAAG,KAAK;EACrBC,QAAQ;EACRC,UAAU;EACVC,kBAAkB,GAAG,EAAE;EACv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AW;MAEhDiB,mBAAmB,GAAG,GAAIW,cAAc,IACvCC,QAAQ,GAAG9B,eAAe,GAAG,EAAE,EAC9B;MACFmB,eAAe,GACdW,QAAQ,KAAK,IAAI,IAAI5B,WAAW,KAAK,IAAI,GACtC6B,MAAM,CAACC,MAAM,CAAE,CAAC,CAAC,EAAExB,cAAc,EAAEN,WAAY,CAAC,GAChDM,cAAc;MAElB,MAAMyB,KAAgC,GAAG;QACxC5B,QAAQ,EAAEmB,IAAI;QACdU,SAAS,EAAEhB,mBAAmB;QAC9BtB,GAAG,EAAE2B,KAAK;QACVY,KAAK,EAAEhB;MACR,CAAC;;MAED;MACA;MACA,IAAK,OAAOH,YAAY,KAAK,QAAQ,EAAG;QACvCiB,KAAK,CAAChB,cAAc,GAAGA,cAAc;MACtC;MAEA,OAAOzB,aAAa,CAAEwB,YAAY,EAAEiB,KAAM,CAAC;IAC5C;IACA,OAAOzC,aAAa,CAAE,MAAM,EAAE;MAC7Ba,QAAQ,EAAEmB,IAAI;MACdU,SAAS,EAAEtB,oBAAoB;MAC/BhB,GAAG,EAAE2B,KAAK;MACVY,KAAK,EAAEtB;IACR,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAOO,WAAW;AACnB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["memo","Cell","jsx","_jsx","TextControl","label","hideLabelFromVision","value","help","className","instanceId","onChange","type","placeholder","props","id","onChangeValue","undefined","valuePlaceholder"],"sources":["@wordpress/components/src/text-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport Cell from '../mobile/bottom-sheet/cell';\n\nfunction TextControl( {\n\tlabel,\n\thideLabelFromVision,\n\tvalue,\n\thelp,\n\tclassName,\n\tinstanceId,\n\tonChange,\n\ttype = 'text',\n\tplaceholder,\n\t...props\n} ) {\n\tconst id = `inspector-text-control-${ instanceId }`;\n\n\treturn (\n\t\t<Cell\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t\ttype={ type }\n\t\t\tvalue={ value }\n\t\t\tonChangeValue={ onChange }\n\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\tvaluePlaceholder={ placeholder }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default memo( TextControl );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,IAAI,MAAM,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,SAASC,WAAWA,CAAE;EACrBC,KAAK;EACLC,mBAAmB;EACnBC,KAAK;EACLC,IAAI;EACJC,SAAS;EACTC,UAAU;EACVC,QAAQ;EACRC,IAAI,GAAG,MAAM;EACbC,WAAW;EACX,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,EAAE,GAAI,0BAA0BL,UAAY,EAAC;EAEnD,oBACCP,IAAA,CAACF,IAAI;IACJI,KAAK,EAAGA,KAAO;IACfC,mBAAmB,EAAGA,mBAAqB;IAC3CS,EAAE,EAAGA,EAAI;IACTP,IAAI,EAAGA,IAAM;IACbC,SAAS,EAAGA,SAAW;IACvBG,IAAI,EAAGA,IAAM;IACbL,KAAK,EAAGA,KAAO;IACfS,aAAa,EAAGL,QAAU;IAC1B,oBAAmB,CAAC,CAAEH,IAAI,GAAGO,EAAE,GAAG,QAAQ,GAAGE,SAAW;IACxDC,gBAAgB,EAAGL,WAAa;IAAA,GAC3BC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAed,IAAI,CAAEI,WAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["memo","Cell","jsx","_jsx","TextControl","label","hideLabelFromVision","value","help","className","instanceId","onChange","type","placeholder","props","id","onChangeValue","undefined","valuePlaceholder"],"sources":["@wordpress/components/src/text-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport Cell from '../mobile/bottom-sheet/cell';\n\nfunction TextControl( {\n\tlabel,\n\thideLabelFromVision,\n\tvalue,\n\thelp,\n\tclassName,\n\tinstanceId,\n\tonChange,\n\ttype = 'text',\n\tplaceholder,\n\t...props\n} ) {\n\tconst id = `inspector-text-control-${ instanceId }`;\n\n\treturn (\n\t\t<Cell\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t\ttype={ type }\n\t\t\tvalue={ value }\n\t\t\tonChangeValue={ onChange }\n\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\tvaluePlaceholder={ placeholder }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default memo( TextControl );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,IAAI,MAAM,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,SAASC,WAAWA,CAAE;EACrBC,KAAK;EACLC,mBAAmB;EACnBC,KAAK;EACLC,IAAI;EACJC,SAAS;EACTC,UAAU;EACVC,QAAQ;EACRC,IAAI,GAAG,MAAM;EACbC,WAAW;EACX,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,EAAE,GAAG,0BAA2BL,UAAU,EAAG;EAEnD,oBACCP,IAAA,CAACF,IAAI;IACJI,KAAK,EAAGA,KAAO;IACfC,mBAAmB,EAAGA,mBAAqB;IAC3CS,EAAE,EAAGA,EAAI;IACTP,IAAI,EAAGA,IAAM;IACbC,SAAS,EAAGA,SAAW;IACvBG,IAAI,EAAGA,IAAM;IACbL,KAAK,EAAGA,KAAO;IACfS,aAAa,EAAGL,QAAU;IAC1B,oBAAmB,CAAC,CAAEH,IAAI,GAAGO,EAAE,GAAG,QAAQ,GAAGE,SAAW;IACxDC,gBAAgB,EAAGL,WAAa;IAAA,GAC3BC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAed,IAAI,CAAEI,WAAY,CAAC","ignoreList":[]}
@@ -7,8 +7,7 @@ import { createInterpolateElement } from '@wordpress/element';
7
7
  * Internal dependencies
8
8
  */
9
9
  import { escapeRegExp } from '../utils/strings';
10
- import { Fragment as _Fragment } from "react/jsx-runtime";
11
- import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
12
11
  /**
13
12
  * Highlights occurrences of a given string within another string of text. Wraps
14
13
  * each match with a `<mark>` tag which provides browser default styling.
@@ -1 +1 @@
1
- {"version":3,"names":["createInterpolateElement","escapeRegExp","Fragment","_Fragment","jsx","_jsx","TextHighlight","props","text","highlight","trimmedHighlightText","trim","children","regex","RegExp","replace","mark"],"sources":["@wordpress/components/src/text-highlight/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { escapeRegExp } from '../utils/strings';\nimport type { TextHighlightProps } from './types';\n\n/**\n * Highlights occurrences of a given string within another string of text. Wraps\n * each match with a `<mark>` tag which provides browser default styling.\n *\n * ```jsx\n * import { TextHighlight } from '@wordpress/components';\n *\n * const MyTextHighlight = () => (\n * <TextHighlight\n * text=\"Why do we like Gutenberg? Because Gutenberg is the best!\"\n * highlight=\"Gutenberg\"\n * />\n * );\n * ```\n */\nexport const TextHighlight = ( props: TextHighlightProps ) => {\n\tconst { text = '', highlight = '' } = props;\n\tconst trimmedHighlightText = highlight.trim();\n\n\tif ( ! trimmedHighlightText ) {\n\t\treturn <>{ text }</>;\n\t}\n\n\tconst regex = new RegExp(\n\t\t`(${ escapeRegExp( trimmedHighlightText ) })`,\n\t\t'gi'\n\t);\n\n\treturn createInterpolateElement( text.replace( regex, '<mark>$&</mark>' ), {\n\t\tmark: <mark />,\n\t} );\n};\n\nexport default TextHighlight;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,YAAY,QAAQ,kBAAkB;AAAC,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAKC,KAAyB,IAAM;EAC7D,MAAM;IAAEC,IAAI,GAAG,EAAE;IAAEC,SAAS,GAAG;EAAG,CAAC,GAAGF,KAAK;EAC3C,MAAMG,oBAAoB,GAAGD,SAAS,CAACE,IAAI,CAAC,CAAC;EAE7C,IAAK,CAAED,oBAAoB,EAAG;IAC7B,oBAAOL,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAIJ;IAAI,CAAI,CAAC;EACrB;EAEA,MAAMK,KAAK,GAAG,IAAIC,MAAM,CACtB,IAAIb,YAAY,CAAES,oBAAqB,CAAG,GAAE,EAC7C,IACD,CAAC;EAED,OAAOV,wBAAwB,CAAEQ,IAAI,CAACO,OAAO,CAAEF,KAAK,EAAE,iBAAkB,CAAC,EAAE;IAC1EG,IAAI,eAAEX,IAAA,WAAO;EACd,CAAE,CAAC;AACJ,CAAC;AAED,eAAeC,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["createInterpolateElement","escapeRegExp","Fragment","_Fragment","jsx","_jsx","TextHighlight","props","text","highlight","trimmedHighlightText","trim","children","regex","RegExp","replace","mark"],"sources":["@wordpress/components/src/text-highlight/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { escapeRegExp } from '../utils/strings';\nimport type { TextHighlightProps } from './types';\n\n/**\n * Highlights occurrences of a given string within another string of text. Wraps\n * each match with a `<mark>` tag which provides browser default styling.\n *\n * ```jsx\n * import { TextHighlight } from '@wordpress/components';\n *\n * const MyTextHighlight = () => (\n * <TextHighlight\n * text=\"Why do we like Gutenberg? Because Gutenberg is the best!\"\n * highlight=\"Gutenberg\"\n * />\n * );\n * ```\n */\nexport const TextHighlight = ( props: TextHighlightProps ) => {\n\tconst { text = '', highlight = '' } = props;\n\tconst trimmedHighlightText = highlight.trim();\n\n\tif ( ! trimmedHighlightText ) {\n\t\treturn <>{ text }</>;\n\t}\n\n\tconst regex = new RegExp(\n\t\t`(${ escapeRegExp( trimmedHighlightText ) })`,\n\t\t'gi'\n\t);\n\n\treturn createInterpolateElement( text.replace( regex, '<mark>$&</mark>' ), {\n\t\tmark: <mark />,\n\t} );\n};\n\nexport default TextHighlight;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,YAAY,QAAQ,kBAAkB;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAGhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAKC,KAAyB,IAAM;EAC7D,MAAM;IAAEC,IAAI,GAAG,EAAE;IAAEC,SAAS,GAAG;EAAG,CAAC,GAAGF,KAAK;EAC3C,MAAMG,oBAAoB,GAAGD,SAAS,CAACE,IAAI,CAAC,CAAC;EAE7C,IAAK,CAAED,oBAAoB,EAAG;IAC7B,oBAAOL,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAIJ;IAAI,CAAI,CAAC;EACrB;EAEA,MAAMK,KAAK,GAAG,IAAIC,MAAM,CACvB,IAAKb,YAAY,CAAES,oBAAqB,CAAC,GAAI,EAC7C,IACD,CAAC;EAED,OAAOV,wBAAwB,CAAEQ,IAAI,CAACO,OAAO,CAAEF,KAAK,EAAE,iBAAkB,CAAC,EAAE;IAC1EG,IAAI,eAAEX,IAAA,WAAO;EACd,CAAE,CAAC;AACJ,CAAC;AAED,eAAeC,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","forwardRef","BaseControl","StyledTextarea","jsx","_jsx","UnforwardedTextareaControl","props","ref","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","TextareaControl","id","onChangeValue","event","target","__associatedWPComponentName","children","undefined"],"sources":["@wordpress/components/src/textarea-control/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { StyledTextarea } from './styles/textarea-control-styles';\nimport type { TextareaControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedTextareaControl(\n\tprops: WordPressComponentProps< TextareaControlProps, 'textarea', false >,\n\tref: React.ForwardedRef< HTMLTextAreaElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tonChange,\n\t\trows = 4,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextareaControl );\n\tconst id = `inspector-textarea-control-${ instanceId }`;\n\tconst onChangeValue = ( event: React.ChangeEvent< HTMLTextAreaElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"TextareaControl\"\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<StyledTextarea\n\t\t\t\tclassName=\"components-textarea-control__input\"\n\t\t\t\tid={ id }\n\t\t\t\trows={ rows }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tvalue={ value }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextareaControls are TextControls that allow for multiple lines of text, and\n * wrap overflow text onto a new line. They are a fixed height and scroll\n * vertically when the cursor reaches the bottom of the field.\n *\n * ```jsx\n * import { TextareaControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextareaControl = () => {\n * const [ text, setText ] = useState( '' );\n *\n * return (\n * <TextareaControl\n * __nextHasNoMarginBottom\n * label=\"Text\"\n * help=\"Enter some text\"\n * value={ text }\n * onChange={ ( value ) => setText( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextareaControl = forwardRef( UnforwardedTextareaControl );\n\nexport default TextareaControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,cAAc,QAAQ,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIlE,SAASC,0BAA0BA,CAClCC,KAAyE,EACzEC,GAA8C,EAC7C;EACD,MAAM;IACLC,uBAAuB;IACvBC,KAAK;IACLC,mBAAmB;IACnBC,KAAK;IACLC,IAAI;IACJC,QAAQ;IACRC,IAAI,GAAG,CAAC;IACRC,SAAS;IACT,GAAGC;EACJ,CAAC,GAAGV,KAAK;EACT,MAAMW,UAAU,GAAGlB,aAAa,CAAEmB,eAAgB,CAAC;EACnD,MAAMC,EAAE,GAAI,8BAA8BF,UAAY,EAAC;EACvD,MAAMG,aAAa,GAAKC,KAA+C,IACtER,QAAQ,CAAEQ,KAAK,CAACC,MAAM,CAACX,KAAM,CAAC;EAE/B,oBACCP,IAAA,CAACH,WAAW;IACXO,uBAAuB,EAAGA,uBAAyB;IACnDe,2BAA2B,EAAC,iBAAiB;IAC7Cd,KAAK,EAAGA,KAAO;IACfC,mBAAmB,EAAGA,mBAAqB;IAC3CS,EAAE,EAAGA,EAAI;IACTP,IAAI,EAAGA,IAAM;IACbG,SAAS,EAAGA,SAAW;IAAAS,QAAA,eAEvBpB,IAAA,CAACF,cAAc;MACda,SAAS,EAAC,oCAAoC;MAC9CI,EAAE,EAAGA,EAAI;MACTL,IAAI,EAAGA,IAAM;MACbD,QAAQ,EAAGO,aAAe;MAC1B,oBAAmB,CAAC,CAAER,IAAI,GAAGO,EAAE,GAAG,QAAQ,GAAGM,SAAW;MACxDd,KAAK,EAAGA,KAAO;MACfJ,GAAG,EAAGA,GAAK;MAAA,GACNS;IAAe,CACpB;EAAC,CACU,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,eAAe,GAAGlB,UAAU,CAAEK,0BAA2B,CAAC;AAEvE,eAAea,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","forwardRef","BaseControl","StyledTextarea","jsx","_jsx","UnforwardedTextareaControl","props","ref","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","TextareaControl","id","onChangeValue","event","target","__associatedWPComponentName","children","undefined"],"sources":["@wordpress/components/src/textarea-control/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { StyledTextarea } from './styles/textarea-control-styles';\nimport type { TextareaControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedTextareaControl(\n\tprops: WordPressComponentProps< TextareaControlProps, 'textarea', false >,\n\tref: React.ForwardedRef< HTMLTextAreaElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tonChange,\n\t\trows = 4,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextareaControl );\n\tconst id = `inspector-textarea-control-${ instanceId }`;\n\tconst onChangeValue = ( event: React.ChangeEvent< HTMLTextAreaElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"TextareaControl\"\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<StyledTextarea\n\t\t\t\tclassName=\"components-textarea-control__input\"\n\t\t\t\tid={ id }\n\t\t\t\trows={ rows }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tvalue={ value }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextareaControls are TextControls that allow for multiple lines of text, and\n * wrap overflow text onto a new line. They are a fixed height and scroll\n * vertically when the cursor reaches the bottom of the field.\n *\n * ```jsx\n * import { TextareaControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextareaControl = () => {\n * const [ text, setText ] = useState( '' );\n *\n * return (\n * <TextareaControl\n * __nextHasNoMarginBottom\n * label=\"Text\"\n * help=\"Enter some text\"\n * value={ text }\n * onChange={ ( value ) => setText( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextareaControl = forwardRef( UnforwardedTextareaControl );\n\nexport default TextareaControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,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-1 +1 @@
1
- {"version":3,"names":["colord","extend","a11yPlugin","namesPlugin","warning","COLORS","generateThemeVariables","inputs","validateInputs","generatedColors","generateAccentDependentColors","accent","generateBackgroundDependentColors","background","warnContrastIssues","checkContrasts","colors","key","value","Object","entries","isValid","globalThis","SCRIPT_DEBUG","outputs","white","foreground","gray","isReadable","undefined","grays","contrast","issues","error","values","accentDarker10","darken","toHex","accentDarker20","accentInverted","getForegroundForColor","foregroundInverted","generateShades","color","isDark","SHADES","limit","direction","range","Math","abs","toHsl","l","result","forEach","parseInt"],"sources":["@wordpress/components/src/theme/color-algorithms.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeInputValues, ThemeOutputValues } from './types';\nimport { COLORS } from '../utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nexport function generateThemeVariables(\n\tinputs: ThemeInputValues\n): ThemeOutputValues {\n\tvalidateInputs( inputs );\n\n\tconst generatedColors = {\n\t\t...generateAccentDependentColors( inputs.accent ),\n\t\t...generateBackgroundDependentColors( inputs.background ),\n\t};\n\n\twarnContrastIssues( checkContrasts( inputs, generatedColors ) );\n\n\treturn { colors: generatedColors };\n}\n\nfunction validateInputs( inputs: ThemeInputValues ) {\n\tfor ( const [ key, value ] of Object.entries( inputs ) ) {\n\t\tif ( typeof value !== 'undefined' && ! colord( value ).isValid() ) {\n\t\t\twarning(\n\t\t\t\t`wp.components.Theme: \"${ value }\" is not a valid color value for the '${ key }' prop.`\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function checkContrasts(\n\tinputs: ThemeInputValues,\n\toutputs: ThemeOutputValues[ 'colors' ]\n) {\n\tconst background = inputs.background || COLORS.white;\n\tconst accent = inputs.accent || '#3858e9';\n\tconst foreground = outputs.foreground || COLORS.gray[ 900 ];\n\tconst gray = outputs.gray || COLORS.gray;\n\n\treturn {\n\t\taccent: colord( background ).isReadable( accent )\n\t\t\t? undefined\n\t\t\t: `The background color (\"${ background }\") does not have sufficient contrast against the accent color (\"${ accent }\").`,\n\t\tforeground: colord( background ).isReadable( foreground )\n\t\t\t? undefined\n\t\t\t: `The background color provided (\"${ background }\") does not have sufficient contrast against the standard foreground colors.`,\n\t\tgrays:\n\t\t\tcolord( background ).contrast( gray[ 600 ] ) >= 3 &&\n\t\t\tcolord( background ).contrast( gray[ 700 ] ) >= 4.5\n\t\t\t\t? undefined\n\t\t\t\t: `The background color provided (\"${ background }\") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`,\n\t};\n}\n\nfunction warnContrastIssues( issues: ReturnType< typeof checkContrasts > ) {\n\tfor ( const error of Object.values( issues ) ) {\n\t\tif ( error ) {\n\t\t\twarning( 'wp.components.Theme: ' + error );\n\t\t}\n\t}\n}\n\nfunction generateAccentDependentColors( accent?: string ) {\n\tif ( ! accent ) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\taccent,\n\t\taccentDarker10: colord( accent ).darken( 0.1 ).toHex(),\n\t\taccentDarker20: colord( accent ).darken( 0.2 ).toHex(),\n\t\taccentInverted: getForegroundForColor( accent ),\n\t};\n}\n\nfunction generateBackgroundDependentColors( background?: string ) {\n\tif ( ! background ) {\n\t\treturn {};\n\t}\n\n\tconst foreground = getForegroundForColor( background );\n\n\treturn {\n\t\tbackground,\n\t\tforeground,\n\t\tforegroundInverted: getForegroundForColor( foreground ),\n\t\tgray: generateShades( background, foreground ),\n\t};\n}\n\nfunction getForegroundForColor( color: string ) {\n\treturn colord( color ).isDark() ? COLORS.white : COLORS.gray[ 900 ];\n}\n\nexport function generateShades( background: string, foreground: string ) {\n\t// How much darkness you need to add to #fff to get the COLORS.gray[n] color\n\tconst SHADES = {\n\t\t100: 0.06,\n\t\t200: 0.121,\n\t\t300: 0.132,\n\t\t400: 0.2,\n\t\t600: 0.42,\n\t\t700: 0.543,\n\t\t800: 0.821,\n\t};\n\n\t// Darkness of COLORS.gray[ 900 ], relative to #fff\n\tconst limit = 0.884;\n\n\tconst direction = colord( background ).isDark() ? 'lighten' : 'darken';\n\n\t// Lightness delta between the background and foreground colors\n\tconst range =\n\t\tMath.abs(\n\t\t\tcolord( background ).toHsl().l - colord( foreground ).toHsl().l\n\t\t) / 100;\n\n\tconst result: Record< number, string > = {};\n\n\tObject.entries( SHADES ).forEach( ( [ key, value ] ) => {\n\t\tresult[ parseInt( key ) ] = colord( background )\n\t\t\t[ direction ]( ( value / limit ) * range )\n\t\t\t.toHex();\n\t} );\n\n\treturn result as NonNullable< ThemeOutputValues[ 'colors' ][ 'gray' ] >;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,WAAW,MAAM,sBAAsB;;AAE9C;AACA;AACA;AACA,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;;AAEA,SAASC,MAAM,QAAQ,UAAU;AAEjCJ,MAAM,CAAE,CAAEE,WAAW,EAAED,UAAU,CAAG,CAAC;AAErC,OAAO,SAASI,sBAAsBA,CACrCC,MAAwB,EACJ;EACpBC,cAAc,CAAED,MAAO,CAAC;EAExB,MAAME,eAAe,GAAG;IACvB,GAAGC,6BAA6B,CAAEH,MAAM,CAACI,MAAO,CAAC;IACjD,GAAGC,iCAAiC,CAAEL,MAAM,CAACM,UAAW;EACzD,CAAC;EAEDC,kBAAkB,CAAEC,cAAc,CAAER,MAAM,EAAEE,eAAgB,CAAE,CAAC;EAE/D,OAAO;IAAEO,MAAM,EAAEP;EAAgB,CAAC;AACnC;AAEA,SAASD,cAAcA,CAAED,MAAwB,EAAG;EACnD,KAAM,MAAM,CAAEU,GAAG,EAAEC,KAAK,CAAE,IAAIC,MAAM,CAACC,OAAO,CAAEb,MAAO,CAAC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ACV,GAAG,EAAE;EACN,CAAC;;EAED;EACA,MAAMC,KAAK,GAAG,KAAK;EAEnB,MAAMC,SAAS,GAAG/C,MAAM,CAAEa,UAAW,CAAC,CAAC+B,MAAM,CAAC,CAAC,GAAG,SAAS,GAAG,QAAQ;;EAEtE;EACA,MAAMI,KAAK,GACVC,IAAI,CAACC,GAAG,CACPlD,MAAM,CAAEa,UAAW,CAAC,CAACsC,KAAK,CAAC,CAAC,CAACC,CAAC,GAAGpD,MAAM,CAAE0B,UAAW,CAAC,CAACyB,KAAK,CAAC,CAAC,CAACC,CAC/D,CAAC,GAAG,GAAG;EAER,MAAMC,MAAgC,GAAG,CAAC,CAAC;EAE3ClC,MAAM,CAACC,OAAO,CAAEyB,MAAO,CAAC,CAACS,OAAO,CAAE,CAAE,CAAErC,GAAG,EAAEC,KAAK,CAAE,KAAM;IACvDmC,MAAM,CAAEE,QAAQ,CAAEtC,GAAI,CAAC,CAAE,GAAGjB,MAAM,CAAEa,UAAW,CAAC,CAC7CkC,SAAS,CAAE,CAAI7B,KAAK,GAAG4B,KAAK,GAAKE,KAAM,CAAC,CACzCX,KAAK,CAAC,CAAC;EACV,CAAE,CAAC;EAEH,OAAOgB,MAAM;AACd","ignoreList":[]}
1
+ {"version":3,"names":["colord","extend","a11yPlugin","namesPlugin","warning","COLORS","generateThemeVariables","inputs","validateInputs","generatedColors","generateAccentDependentColors","accent","generateBackgroundDependentColors","background","warnContrastIssues","checkContrasts","colors","key","value","Object","entries","isValid","globalThis","SCRIPT_DEBUG","outputs","white","foreground","gray","isReadable","undefined","grays","contrast","issues","error","values","accentDarker10","darken","toHex","accentDarker20","accentInverted","getForegroundForColor","foregroundInverted","generateShades","color","isDark","SHADES","limit","direction","range","Math","abs","toHsl","l","result","forEach","parseInt"],"sources":["@wordpress/components/src/theme/color-algorithms.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport namesPlugin from 'colord/plugins/names';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeInputValues, ThemeOutputValues } from './types';\nimport { COLORS } from '../utils';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\nexport function generateThemeVariables(\n\tinputs: ThemeInputValues\n): ThemeOutputValues {\n\tvalidateInputs( inputs );\n\n\tconst generatedColors = {\n\t\t...generateAccentDependentColors( inputs.accent ),\n\t\t...generateBackgroundDependentColors( inputs.background ),\n\t};\n\n\twarnContrastIssues( checkContrasts( inputs, generatedColors ) );\n\n\treturn { colors: generatedColors };\n}\n\nfunction validateInputs( inputs: ThemeInputValues ) {\n\tfor ( const [ key, value ] of Object.entries( inputs ) ) {\n\t\tif ( typeof value !== 'undefined' && ! colord( value ).isValid() ) {\n\t\t\twarning(\n\t\t\t\t`wp.components.Theme: \"${ value }\" is not a valid color value for the '${ key }' prop.`\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function checkContrasts(\n\tinputs: ThemeInputValues,\n\toutputs: ThemeOutputValues[ 'colors' ]\n) {\n\tconst background = inputs.background || COLORS.white;\n\tconst accent = inputs.accent || '#3858e9';\n\tconst foreground = outputs.foreground || COLORS.gray[ 900 ];\n\tconst gray = outputs.gray || COLORS.gray;\n\n\treturn {\n\t\taccent: colord( background ).isReadable( accent )\n\t\t\t? undefined\n\t\t\t: `The background color (\"${ background }\") does not have sufficient contrast against the accent color (\"${ accent }\").`,\n\t\tforeground: colord( background ).isReadable( foreground )\n\t\t\t? undefined\n\t\t\t: `The background color provided (\"${ background }\") does not have sufficient contrast against the standard foreground colors.`,\n\t\tgrays:\n\t\t\tcolord( background ).contrast( gray[ 600 ] ) >= 3 &&\n\t\t\tcolord( background ).contrast( gray[ 700 ] ) >= 4.5\n\t\t\t\t? undefined\n\t\t\t\t: `The background color provided (\"${ background }\") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`,\n\t};\n}\n\nfunction warnContrastIssues( issues: ReturnType< typeof checkContrasts > ) {\n\tfor ( const error of Object.values( issues ) ) {\n\t\tif ( error ) {\n\t\t\twarning( 'wp.components.Theme: ' + error );\n\t\t}\n\t}\n}\n\nfunction generateAccentDependentColors( accent?: string ) {\n\tif ( ! accent ) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\taccent,\n\t\taccentDarker10: colord( accent ).darken( 0.1 ).toHex(),\n\t\taccentDarker20: colord( accent ).darken( 0.2 ).toHex(),\n\t\taccentInverted: getForegroundForColor( accent ),\n\t};\n}\n\nfunction generateBackgroundDependentColors( background?: string ) {\n\tif ( ! background ) {\n\t\treturn {};\n\t}\n\n\tconst foreground = getForegroundForColor( background );\n\n\treturn {\n\t\tbackground,\n\t\tforeground,\n\t\tforegroundInverted: getForegroundForColor( foreground ),\n\t\tgray: generateShades( background, foreground ),\n\t};\n}\n\nfunction getForegroundForColor( color: string ) {\n\treturn colord( color ).isDark() ? COLORS.white : COLORS.gray[ 900 ];\n}\n\nexport function generateShades( background: string, foreground: string ) {\n\t// How much darkness you need to add to #fff to get the COLORS.gray[n] color\n\tconst SHADES = {\n\t\t100: 0.06,\n\t\t200: 0.121,\n\t\t300: 0.132,\n\t\t400: 0.2,\n\t\t600: 0.42,\n\t\t700: 0.543,\n\t\t800: 0.821,\n\t};\n\n\t// Darkness of COLORS.gray[ 900 ], relative to #fff\n\tconst limit = 0.884;\n\n\tconst direction = colord( background ).isDark() ? 'lighten' : 'darken';\n\n\t// Lightness delta between the background and foreground colors\n\tconst range =\n\t\tMath.abs(\n\t\t\tcolord( background ).toHsl().l - colord( foreground ).toHsl().l\n\t\t) / 100;\n\n\tconst result: Record< number, string > = {};\n\n\tObject.entries( SHADES ).forEach( ( [ key, value ] ) => {\n\t\tresult[ parseInt( key ) ] = colord( background )\n\t\t\t[ direction ]( ( value / limit ) * range )\n\t\t\t.toHex();\n\t} );\n\n\treturn result as NonNullable< ThemeOutputValues[ 'colors' ][ 'gray' ] >;\n}\n"],"mappings":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AO,CAAE,CAAE,CAAErC,GAAG,EAAEC,KAAK,CAAE,KAAM;IACvDmC,MAAM,CAAEE,QAAQ,CAAEtC,GAAI,CAAC,CAAE,GAAGjB,MAAM,CAAEa,UAAW,CAAC,CAC7CkC,SAAS,CAAE,CAAI7B,KAAK,GAAG4B,KAAK,GAAKE,KAAM,CAAC,CACzCX,KAAK,CAAC,CAAC;EACV,CAAE,CAAC;EAEH,OAAOgB,MAAM;AACd","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["css","colorVariables","colors","shades","Object","entries","gray","map","k","v","join","accent","accentDarker10","accentDarker20","accentInverted","background","foreground","foregroundInverted","process","env","NODE_ENV","Wrapper","_styled","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["@wordpress/components/src/theme/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeOutputValues } from './types';\n\nexport const colorVariables = ( { colors }: ThemeOutputValues ) => {\n\tconst shades = Object.entries( colors.gray || {} )\n\t\t.map( ( [ k, v ] ) => `--wp-components-color-gray-${ k }: ${ v };` )\n\t\t.join( '' );\n\n\treturn [\n\t\tcss`\n\t\t\t--wp-components-color-accent: ${ colors.accent };\n\t\t\t--wp-components-color-accent-darker-10: ${ colors.accentDarker10 };\n\t\t\t--wp-components-color-accent-darker-20: ${ colors.accentDarker20 };\n\t\t\t--wp-components-color-accent-inverted: ${ colors.accentInverted };\n\n\t\t\t--wp-components-color-background: ${ colors.background };\n\t\t\t--wp-components-color-foreground: ${ colors.foreground };\n\t\t\t--wp-components-color-foreground-inverted: ${ colors.foregroundInverted };\n\n\t\t\t${ shades }\n\t\t`,\n\t];\n};\n\nexport const Wrapper = styled.div`\n\tcolor: var( --wp-components-color-foreground, currentColor );\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAA0B,CAAC,KAAM;EAClE,MAAMC,MAAM,GAAGC,MAAM,CAACC,OAAO,CAAEH,MAAM,CAACI,IAAI,IAAI,CAAC,CAAE,CAAC,CAChDC,GAAG,CAAE,CAAE,CAAEC,CAAC,EAAEC,CAAC,CAAE,KAAO,8BAA8BD,CAAG,KAAKC,CAAG,GAAG,CAAC,CACnEC,IAAI,CAAE,EAAG,CAAC;EAEZ,OAAO,cACNV,GAAG,kCAC+BE,MAAM,CAACS,MAAM,8CACHT,MAAM,CAACU,cAAc,8CACrBV,MAAM,CAACW,cAAc,6CACtBX,MAAM,CAACY,cAAc,wCAE1BZ,MAAM,CAACa,UAAU,wCACjBb,MAAM,CAACc,UAAU,iDACRd,MAAM,CAACe,kBAAkB,OAEpEd,MAAM,SAAAe,OAAA,CAAAC,GAAA,CAAAC,QAAA,oDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,gvDAEV;AACF,CAAC;AAED,OAAO,MAAMC,OAAO,gBAAAC,OAAA,QAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAN,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAK,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAnB,GAAA;EAAAoB,QAAA,EAAAC;AAAA,EAEnB","ignoreList":[]}
1
+ {"version":3,"names":["css","colorVariables","colors","shades","Object","entries","gray","map","k","v","join","accent","accentDarker10","accentDarker20","accentInverted","background","foreground","foregroundInverted","process","env","NODE_ENV","Wrapper","_styled","target","label","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__"],"sources":["@wordpress/components/src/theme/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport type { ThemeOutputValues } from './types';\n\nexport const colorVariables = ( { colors }: ThemeOutputValues ) => {\n\tconst shades = Object.entries( colors.gray || {} )\n\t\t.map( ( [ k, v ] ) => `--wp-components-color-gray-${ k }: ${ v };` )\n\t\t.join( '' );\n\n\treturn [\n\t\tcss`\n\t\t\t--wp-components-color-accent: ${ colors.accent };\n\t\t\t--wp-components-color-accent-darker-10: ${ colors.accentDarker10 };\n\t\t\t--wp-components-color-accent-darker-20: ${ colors.accentDarker20 };\n\t\t\t--wp-components-color-accent-inverted: ${ colors.accentInverted };\n\n\t\t\t--wp-components-color-background: ${ colors.background };\n\t\t\t--wp-components-color-foreground: ${ colors.foreground };\n\t\t\t--wp-components-color-foreground-inverted: ${ colors.foregroundInverted };\n\n\t\t\t${ shades }\n\t\t`,\n\t];\n};\n\nexport const Wrapper = styled.div`\n\tcolor: var( --wp-components-color-foreground, currentColor );\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAA0B,CAAC,KAAM;EAClE,MAAMC,MAAM,GAAGC,MAAM,CAACC,OAAO,CAAEH,MAAM,CAACI,IAAI,IAAI,CAAC,CAAE,CAAC,CAChDC,GAAG,CAAE,CAAE,CAAEC,CAAC,EAAEC,CAAC,CAAE,KAAM,8BAA+BD,CAAC,KAAOC,CAAC,GAAK,CAAC,CACnEC,IAAI,CAAE,EAAG,CAAC;EAEZ,OAAO,cACNV,GAAG,kCAC+BE,MAAM,CAACS,MAAM,8CACHT,MAAM,CAACU,cAAc,8CACrBV,MAAM,CAACW,cAAc,6CACtBX,MAAM,CAACY,cAAc,wCAE1BZ,MAAM,CAACa,UAAU,wCACjBb,MAAM,CAACc,UAAU,iDACRd,MAAM,CAACe,kBAAkB,OAEpEd,MAAM,SAAAe,OAAA,CAAAC,GAAA,CAAAC,QAAA,oDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,gvDAEV;AACF,CAAC;AAED,OAAO,MAAMC,OAAO,gBAAAC,OAAA,QAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAN,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAK,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAnB,GAAA;EAAAoB,QAAA,EAAAC;AAAA,EAEnB","ignoreList":[]}
@@ -6,8 +6,7 @@ import { Icon, tip } from '@wordpress/icons';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
10
  export function Tip(props) {
12
11
  const {
13
12
  children
@@ -1 +1 @@
1
- {"version":3,"names":["Icon","tip","jsx","_jsx","jsxs","_jsxs","Tip","props","children","className","icon"],"sources":["@wordpress/components/src/tip/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, tip } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { TipProps } from './types';\n\nexport function Tip( props: TipProps ) {\n\tconst { children } = props;\n\n\treturn (\n\t\t<div className=\"components-tip\">\n\t\t\t<Icon icon={ tip } />\n\t\t\t<p>{ children }</p>\n\t\t</div>\n\t);\n}\n\nexport default Tip;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,GAAG,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAKA,OAAO,SAASC,GAAGA,CAAEC,KAAe,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAE1B,oBACCF,KAAA;IAAKI,SAAS,EAAC,gBAAgB;IAAAD,QAAA,gBAC9BL,IAAA,CAACH,IAAI;MAACU,IAAI,EAAGT;IAAK,CAAE,CAAC,eACrBE,IAAA;MAAAK,QAAA,EAAKA;IAAQ,CAAK,CAAC;EAAA,CACf,CAAC;AAER;AAEA,eAAeF,GAAG","ignoreList":[]}
1
+ {"version":3,"names":["Icon","tip","jsx","_jsx","jsxs","_jsxs","Tip","props","children","className","icon"],"sources":["@wordpress/components/src/tip/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, tip } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { TipProps } from './types';\n\nexport function Tip( props: TipProps ) {\n\tconst { children } = props;\n\n\treturn (\n\t\t<div className=\"components-tip\">\n\t\t\t<Icon icon={ tip } />\n\t\t\t<p>{ children }</p>\n\t\t</div>\n\t);\n}\n\nexport default Tip;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,GAAG,QAAQ,kBAAkB;;AAE5C;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,OAAO,SAASC,GAAGA,CAAEC,KAAe,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAGD,KAAK;EAE1B,oBACCF,KAAA;IAAKI,SAAS,EAAC,gBAAgB;IAAAD,QAAA,gBAC9BL,IAAA,CAACH,IAAI;MAACU,IAAI,EAAGT;IAAK,CAAE,CAAC,eACrBE,IAAA;MAAAK,QAAA,EAAKA;IAAQ,CAAK,CAAC;EAAA,CACf,CAAC;AAER;AAEA,eAAeF,GAAG","ignoreList":[]}
@@ -21,8 +21,7 @@ import BaseControl from '../base-control';
21
21
  import { HStack } from '../h-stack';
22
22
  import { useCx } from '../utils';
23
23
  import { space } from '../utils/space';
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  function UnforwardedToggleControl({
27
26
  __nextHasNoMarginBottom,
28
27
  label,
@@ -1 +1 @@
1
- {"version":3,"names":["css","clsx","forwardRef","useInstanceId","deprecated","FlexBlock","FormToggle","BaseControl","HStack","useCx","space","jsx","_jsx","jsxs","_jsxs","UnforwardedToggleControl","__nextHasNoMarginBottom","label","checked","help","className","onChange","disabled","ref","onChangeToggle","event","target","instanceId","ToggleControl","id","cx","classes","marginBottom","process","env","NODE_ENV","since","version","hint","describedBy","helpLabel","undefined","children","justify","spacing","as","htmlFor"],"sources":["@wordpress/components/src/toggle-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\nimport { css } from '@emotion/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { FlexBlock } from '../flex';\nimport FormToggle from '../form-toggle';\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { ToggleControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { useCx } from '../utils';\nimport { space } from '../utils/space';\n\nfunction UnforwardedToggleControl(\n\t{\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\tchecked,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\tdisabled,\n\t}: WordPressComponentProps< ToggleControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tfunction onChangeToggle( event: ChangeEvent< HTMLInputElement > ) {\n\t\tonChange( event.target.checked );\n\t}\n\tconst instanceId = useInstanceId( ToggleControl );\n\tconst id = `inspector-toggle-control-${ instanceId }`;\n\n\tconst cx = useCx();\n\tconst classes = cx(\n\t\t'components-toggle-control',\n\t\tclassName,\n\t\t! __nextHasNoMarginBottom && css( { marginBottom: space( 3 ) } )\n\t);\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated( 'Bottom margin styles for wp.components.ToggleControl', {\n\t\t\tsince: '6.7',\n\t\t\tversion: '7.0',\n\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t} );\n\t}\n\n\tlet describedBy, helpLabel;\n\tif ( help ) {\n\t\tif ( typeof help === 'function' ) {\n\t\t\t// `help` as a function works only for controlled components where\n\t\t\t// `checked` is passed down from parent component. Uncontrolled\n\t\t\t// component can show only a static help label.\n\t\t\tif ( checked !== undefined ) {\n\t\t\t\thelpLabel = help( checked );\n\t\t\t}\n\t\t} else {\n\t\t\thelpLabel = help;\n\t\t}\n\t\tif ( helpLabel ) {\n\t\t\tdescribedBy = id + '__help';\n\t\t}\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\tid={ id }\n\t\t\thelp={\n\t\t\t\thelpLabel && (\n\t\t\t\t\t<span className=\"components-toggle-control__help\">\n\t\t\t\t\t\t{ helpLabel }\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t}\n\t\t\tclassName={ classes }\n\t\t\t__nextHasNoMarginBottom\n\t\t>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 }>\n\t\t\t\t<FormToggle\n\t\t\t\t\tid={ id }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\tonChange={ onChangeToggle }\n\t\t\t\t\taria-describedby={ describedBy }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t<FlexBlock\n\t\t\t\t\tas=\"label\"\n\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\tclassName={ clsx( 'components-toggle-control__label', {\n\t\t\t\t\t\t'is-disabled': disabled,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</FlexBlock>\n\t\t\t</HStack>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * ToggleControl is used to generate a toggle user interface.\n *\n * ```jsx\n * import { ToggleControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyToggleControl = () => {\n * const [ value, setValue ] = useState( false );\n *\n * return (\n * <ToggleControl\n * __nextHasNoMarginBottom\n * label=\"Fixed Background\"\n * checked={ value }\n * onChange={ () => setValue( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport const ToggleControl = forwardRef( UnforwardedToggleControl );\n\nexport default ToggleControl;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,SAAS,QAAQ,SAAS;AACnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,WAAW,MAAM,iBAAiB;AAGzC,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,KAAK,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEvC,SAASC,wBAAwBA,CAChC;EACCC,uBAAuB;EACvBC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,QAAQ;EACRC;AAC8D,CAAC,EAChEC,GAAqC,EACpC;EACD,SAASC,cAAcA,CAAEC,KAAsC,EAAG;IACjEJ,QAAQ,CAAEI,KAAK,CAACC,MAAM,CAACR,OAAQ,CAAC;EACjC;EACA,MAAMS,UAAU,GAAGxB,aAAa,CAAEyB,aAAc,CAAC;EACjD,MAAMC,EAAE,GAAI,4BAA4BF,UAAY,EAAC;EAErD,MAAMG,EAAE,GAAGrB,KAAK,CAAC,CAAC;EAClB,MAAMsB,OAAO,GAAGD,EAAE,CACjB,2BAA2B,EAC3BV,SAAS,EACT,CAAEJ,uBAAuB,iBAAIhB,GAAG,CAAE;IAAEgC,YAAY,E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SAAS,EAAGnB,IAAI,CAAE,kCAAkC,EAAE;UACrD,aAAa,EAAEqB;QAChB,CAAE,CAAG;QAAAoB,QAAA,EAEHzB;MAAK,CACG,CAAC;IAAA,CACL;EAAC,CACG,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,aAAa,GAAG1B,UAAU,CAAEa,wBAAyB,CAAC;AAEnE,eAAea,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["css","clsx","forwardRef","useInstanceId","deprecated","FlexBlock","FormToggle","BaseControl","HStack","useCx","space","jsx","_jsx","jsxs","_jsxs","UnforwardedToggleControl","__nextHasNoMarginBottom","label","checked","help","className","onChange","disabled","ref","onChangeToggle","event","target","instanceId","ToggleControl","id","cx","classes","marginBottom","process","env","NODE_ENV","since","version","hint","describedBy","helpLabel","undefined","children","justify","spacing","as","htmlFor"],"sources":["@wordpress/components/src/toggle-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\nimport { css } from '@emotion/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { FlexBlock } from '../flex';\nimport FormToggle from '../form-toggle';\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { ToggleControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { useCx } from '../utils';\nimport { space } from '../utils/space';\n\nfunction UnforwardedToggleControl(\n\t{\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\tchecked,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\tdisabled,\n\t}: WordPressComponentProps< ToggleControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tfunction onChangeToggle( event: ChangeEvent< HTMLInputElement > ) {\n\t\tonChange( event.target.checked );\n\t}\n\tconst instanceId = useInstanceId( ToggleControl );\n\tconst id = `inspector-toggle-control-${ instanceId }`;\n\n\tconst cx = useCx();\n\tconst classes = cx(\n\t\t'components-toggle-control',\n\t\tclassName,\n\t\t! __nextHasNoMarginBottom && css( { marginBottom: space( 3 ) } )\n\t);\n\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\tdeprecated( 'Bottom margin styles for wp.components.ToggleControl', {\n\t\t\tsince: '6.7',\n\t\t\tversion: '7.0',\n\t\t\thint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',\n\t\t} );\n\t}\n\n\tlet describedBy, helpLabel;\n\tif ( help ) {\n\t\tif ( typeof help === 'function' ) {\n\t\t\t// `help` as a function works only for controlled components where\n\t\t\t// `checked` is passed down from parent component. Uncontrolled\n\t\t\t// component can show only a static help label.\n\t\t\tif ( checked !== undefined ) {\n\t\t\t\thelpLabel = help( checked );\n\t\t\t}\n\t\t} else {\n\t\t\thelpLabel = help;\n\t\t}\n\t\tif ( helpLabel ) {\n\t\t\tdescribedBy = id + '__help';\n\t\t}\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\tid={ id }\n\t\t\thelp={\n\t\t\t\thelpLabel && (\n\t\t\t\t\t<span className=\"components-toggle-control__help\">\n\t\t\t\t\t\t{ helpLabel }\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t}\n\t\t\tclassName={ classes }\n\t\t\t__nextHasNoMarginBottom\n\t\t>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 }>\n\t\t\t\t<FormToggle\n\t\t\t\t\tid={ id }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\tonChange={ onChangeToggle }\n\t\t\t\t\taria-describedby={ describedBy }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t<FlexBlock\n\t\t\t\t\tas=\"label\"\n\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\tclassName={ clsx( 'components-toggle-control__label', {\n\t\t\t\t\t\t'is-disabled': disabled,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</FlexBlock>\n\t\t\t</HStack>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * ToggleControl is used to generate a toggle user interface.\n *\n * ```jsx\n * import { ToggleControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyToggleControl = () => {\n * const [ value, setValue ] = useState( false );\n *\n * return (\n * <ToggleControl\n * __nextHasNoMarginBottom\n * label=\"Fixed Background\"\n * checked={ value }\n * onChange={ () => setValue( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport const ToggleControl = forwardRef( UnforwardedToggleControl );\n\nexport default ToggleControl;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,SAAS,QAAQ,SAAS;AACnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,WAAW,MAAM,iBAAiB;AAGzC,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,KAAK,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvC,SAASC,wBAAwBA,CAChC;EACCC,uBAAuB;EACvBC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,QAAQ;EACRC;AAC8D,CAAC,EAChEC,GAAqC,EACpC;EACD,SAASC,cAAcA,CAAEC,KAAsC,EAAG;IACjE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EAAC,YAAY;MAACC,OAAO,EAAG,CAAG;MAAAF,QAAA,gBACzC9B,IAAA,CAACN,UAAU;QACVuB,EAAE,EAAGA,EAAI;QACTX,OAAO,EAAGA,OAAS;QACnBG,QAAQ,EAAGG,cAAgB;QAC3B,oBAAmBe,WAAa;QAChCjB,QAAQ,EAAGA,QAAU;QACrBC,GAAG,EAAGA;MAAK,CACX,CAAC,eACFX,IAAA,CAACP,SAAS;QACTwC,EAAE,EAAC,OAAO;QACVC,OAAO,EAAGjB,EAAI;QACdT,SAAS,EAAGnB,IAAI,CAAE,kCAAkC,EAAE;UACrD,aAAa,EAAEqB;QAChB,CAAE,CAAG;QAAAoB,QAAA,EAEHzB;MAAK,CACG,CAAC;IAAA,CACL;EAAC,CACG,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,aAAa,GAAG1B,UAAU,CAAEa,wBAAyB,CAAC;AAEnE,eAAea,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["memo","SwitchCell","jsx","_jsx","ToggleControl","label","checked","help","instanceId","className","onChange","props","id","helpLabel","value","onValueChange"],"sources":["@wordpress/components/src/toggle-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport SwitchCell from '../mobile/bottom-sheet/switch-cell';\n\nconst ToggleControl = memo(\n\t( { label, checked, help, instanceId, className, onChange, ...props } ) => {\n\t\tconst id = `inspector-toggle-control-${ instanceId }`;\n\n\t\tconst helpLabel =\n\t\t\thelp && typeof help === 'function' ? help( checked ) : help;\n\n\t\treturn (\n\t\t\t<SwitchCell\n\t\t\t\tlabel={ label }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ helpLabel }\n\t\t\t\tclassName={ className }\n\t\t\t\tvalue={ checked }\n\t\t\t\tonValueChange={ onChange }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default ToggleControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,MAAMC,aAAa,GAAGJ,IAAI,CACzB,CAAE;EAAEK,KAAK;EAAEC,OAAO;EAAEC,IAAI;EAAEC,UAAU;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC1E,MAAMC,EAAE,GAAI,4BAA4BJ,UAAY,EAAC;EAErD,MAAMK,SAAS,GACdN,IAAI,IAAI,OAAOA,IAAI,KAAK,UAAU,GAAGA,IAAI,CAAED,OAAQ,CAAC,GAAGC,IAAI;EAE5D,oBACCJ,IAAA,CAACF,UAAU;IACVI,KAAK,EAAGA,KAAO;IACfO,EAAE,EAAGA,EAAI;IACTL,IAAI,EAAGM,SAAW;IAClBJ,SAAS,EAAGA,SAAW;IACvBK,KAAK,EAAGR,OAAS;IACjBS,aAAa,EAAGL,QAAU;IAAA,GACrBC;EAAK,CACV,CAAC;AAEJ,CACD,CAAC;AAED,eAAeP,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["memo","SwitchCell","jsx","_jsx","ToggleControl","label","checked","help","instanceId","className","onChange","props","id","helpLabel","value","onValueChange"],"sources":["@wordpress/components/src/toggle-control/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport SwitchCell from '../mobile/bottom-sheet/switch-cell';\n\nconst ToggleControl = memo(\n\t( { label, checked, help, instanceId, className, onChange, ...props } ) => {\n\t\tconst id = `inspector-toggle-control-${ instanceId }`;\n\n\t\tconst helpLabel =\n\t\t\thelp && typeof help === 'function' ? help( checked ) : help;\n\n\t\treturn (\n\t\t\t<SwitchCell\n\t\t\t\tlabel={ label }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ helpLabel }\n\t\t\t\tclassName={ className }\n\t\t\t\tvalue={ checked }\n\t\t\t\tonValueChange={ onChange }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default ToggleControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,oBAAoB;AACzC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,oCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,MAAMC,aAAa,GAAGJ,IAAI,CACzB,CAAE;EAAEK,KAAK;EAAEC,OAAO;EAAEC,IAAI;EAAEC,UAAU;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC1E,MAAMC,EAAE,GAAG,4BAA6BJ,UAAU,EAAG;EAErD,MAAMK,SAAS,GACdN,IAAI,IAAI,OAAOA,IAAI,KAAK,UAAU,GAAGA,IAAI,CAAED,OAAQ,CAAC,GAAGC,IAAI;EAE5D,oBACCJ,IAAA,CAACF,UAAU;IACVI,KAAK,EAAGA,KAAO;IACfO,EAAE,EAAGA,EAAI;IACTL,IAAI,EAAGM,SAAW;IAClBJ,SAAS,EAAGA,SAAW;IACvBK,KAAK,EAAGR,OAAS;IACjBS,aAAa,EAAGL,QAAU;IAAA,GACrBC;EAAK,CACV,CAAC;AAEJ,CACD,CAAC;AAED,eAAeP,aAAa","ignoreList":[]}
@@ -20,6 +20,7 @@ function UnforwardedToggleGroupControlAsButtonGroup({
20
20
  size,
21
21
  value: valueProp,
22
22
  id: idProp,
23
+ setSelectedElement,
23
24
  ...otherProps
24
25
  }, forwardedRef) {
25
26
  const generatedId = useInstanceId(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group');
@@ -44,8 +45,9 @@ function UnforwardedToggleGroupControlAsButtonGroup({
44
45
  setValue: setSelectedValue,
45
46
  isBlock: !isAdaptiveWidth,
46
47
  isDeselectable: true,
47
- size
48
- }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size]);
48
+ size,
49
+ setSelectedElement
50
+ }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size, setSelectedElement]);
49
51
  return /*#__PURE__*/_jsx(ToggleGroupControlContext.Provider, {
50
52
  value: groupContextValue,
51
53
  children: /*#__PURE__*/_jsx(View, {
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","forwardRef","useMemo","View","useControlledValue","ToggleGroupControlContext","useComputeControlledOrUncontrolledValue","jsx","_jsx","UnforwardedToggleGroupControlAsButtonGroup","children","isAdaptiveWidth","label","onChange","size","value","valueProp","id","idProp","otherProps","forwardedRef","generatedId","ToggleGroupControlAsButtonGroup","baseId","defaultValue","selectedValue","setSelectedValue","groupContextValue","setValue","isBlock","isDeselectable","Provider","ref","role"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/as-button-group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport { useControlledValue } from '../../utils';\nimport type { WordPressComponentProps } from '../../context';\nimport ToggleGroupControlContext from '../context';\nimport { useComputeControlledOrUncontrolledValue } from './utils';\nimport type {\n\tToggleGroupControlMainControlProps,\n\tToggleGroupControlContextProps,\n} from '../types';\n\nfunction UnforwardedToggleGroupControlAsButtonGroup(\n\t{\n\t\tchildren,\n\t\tisAdaptiveWidth,\n\t\tlabel,\n\t\tonChange,\n\t\tsize,\n\t\tvalue: valueProp,\n\t\tid: idProp,\n\t\t...otherProps\n\t}: WordPressComponentProps<\n\t\tToggleGroupControlMainControlProps,\n\t\t'div',\n\t\tfalse\n\t>,\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst generatedId = useInstanceId(\n\t\tToggleGroupControlAsButtonGroup,\n\t\t'toggle-group-control-as-button-group'\n\t);\n\tconst baseId = idProp || generatedId;\n\n\t// Use a heuristic to understand if the component is being used in controlled\n\t// or uncontrolled mode, and consequently:\n\t// - when controlled, convert `undefined` values to `''` (ie. \"no value\")\n\t// - use the `value` prop as the `defaultValue` when uncontrolled\n\tconst { value, defaultValue } =\n\t\tuseComputeControlledOrUncontrolledValue( valueProp );\n\n\tconst [ selectedValue, setSelectedValue ] = useControlledValue( {\n\t\tdefaultValue,\n\t\tvalue,\n\t\tonChange,\n\t} );\n\n\tconst groupContextValue = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tbaseId,\n\t\t\t\tvalue: selectedValue,\n\t\t\t\tsetValue: setSelectedValue,\n\t\t\t\tisBlock: ! isAdaptiveWidth,\n\t\t\t\tisDeselectable: true,\n\t\t\t\tsize,\n\t\t\t} ) as ToggleGroupControlContextProps,\n\t\t[ baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size ]\n\t);\n\n\treturn (\n\t\t<ToggleGroupControlContext.Provider value={ groupContextValue }>\n\t\t\t<View\n\t\t\t\taria-label={ label }\n\t\t\t\t{ ...otherProps }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\trole=\"group\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t</ToggleGroupControlContext.Provider>\n\t);\n}\n\nexport const ToggleGroupControlAsButtonGroup = forwardRef(\n\tUnforwardedToggleGroupControlAsButtonGroup\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,kBAAkB,QAAQ,aAAa;AAEhD,OAAOC,yBAAyB,MAAM,YAAY;AAClD,SAASC,uCAAuC,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlE,SAASC,0CAA0CA,CAClD;EACCC,QAAQ;EACRC,eAAe;EACfC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK,EAAEC,SAAS;EAChBC,EAAE,EAAEC,MAAM;EACV,GAAGC;AAKJ,CAAC,EACDC,YAAkD,EACjD;EACD,MAAMC,WAAW,GAAGrB,aAAa,CAChCsB,+BAA+B,EAC/B,sCACD,CAAC;EACD,MAAMC,MAAM,GAAGL,MAAM,IAAIG,WAAW;;EAEpC;EACA;EACA;EACA;EACA,MAAM;IAAEN,KAAK;IAAES;EAAa,CAAC,GAC5BlB,uCAAuC,CAAEU,SAAU,CAAC;EAErD,MAAM,CAAES,aAAa,EAAEC,gBAAgB,CAAE,GAAGtB,kBAAkB,CAAE;IAC/DoB,YAAY;IACZT,KAAK;IACLF;EACD,CAAE,CAAC;EAEH,MAAMc,iBAAiB,GAAGzB,OAAO,CAChC,OACG;IACDqB,MAAM;IACNR,KAAK,EAAEU,aAAa;IACpBG,QAAQ,EAAEF,gBAAgB;IAC1BG,OAAO,EAAE,CAAElB,eAAe;IAC1BmB,cAAc,EAAE,IAAI;IACpBhB;EACD,CAAC,CAAoC,EACtC,CAAES,MAAM,EAAEE,aAAa,EAAEC,gBAAgB,EAAEf,eAAe,EAAEG,IAAI,CACjE,CAAC;EAED,oBACCN,IAAA,CAACH,yBAAyB,CAAC0B,QAAQ;IAAChB,KAAK,EAAGY,iBAAmB;IAAAjB,QAAA,eAC9DF,IAAA,CAACL,IAAI;MACJ,cAAaS,KAAO;MAAA,GACfO,UAAU;MACfa,GAAG,EAAGZ,YAAc;MACpBa,IAAI,EAAC,OAAO;MAAAvB,QAAA,EAEVA;IAAQ,CACL;EAAC,CAC4B,CAAC;AAEvC;AAEA,OAAO,MAAMY,+BAA+B,GAAGrB,UAAU,CACxDQ,0CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","forwardRef","useMemo","View","useControlledValue","ToggleGroupControlContext","useComputeControlledOrUncontrolledValue","jsx","_jsx","UnforwardedToggleGroupControlAsButtonGroup","children","isAdaptiveWidth","label","onChange","size","value","valueProp","id","idProp","setSelectedElement","otherProps","forwardedRef","generatedId","ToggleGroupControlAsButtonGroup","baseId","defaultValue","selectedValue","setSelectedValue","groupContextValue","setValue","isBlock","isDeselectable","Provider","ref","role"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/as-button-group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport { useControlledValue } from '../../utils';\nimport type { WordPressComponentProps } from '../../context';\nimport ToggleGroupControlContext from '../context';\nimport { useComputeControlledOrUncontrolledValue } from './utils';\nimport type {\n\tToggleGroupControlMainControlProps,\n\tToggleGroupControlContextProps,\n} from '../types';\n\nfunction UnforwardedToggleGroupControlAsButtonGroup(\n\t{\n\t\tchildren,\n\t\tisAdaptiveWidth,\n\t\tlabel,\n\t\tonChange,\n\t\tsize,\n\t\tvalue: valueProp,\n\t\tid: idProp,\n\t\tsetSelectedElement,\n\t\t...otherProps\n\t}: WordPressComponentProps<\n\t\tToggleGroupControlMainControlProps,\n\t\t'div',\n\t\tfalse\n\t>,\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst generatedId = useInstanceId(\n\t\tToggleGroupControlAsButtonGroup,\n\t\t'toggle-group-control-as-button-group'\n\t);\n\tconst baseId = idProp || generatedId;\n\n\t// Use a heuristic to understand if the component is being used in controlled\n\t// or uncontrolled mode, and consequently:\n\t// - when controlled, convert `undefined` values to `''` (ie. \"no value\")\n\t// - use the `value` prop as the `defaultValue` when uncontrolled\n\tconst { value, defaultValue } =\n\t\tuseComputeControlledOrUncontrolledValue( valueProp );\n\n\tconst [ selectedValue, setSelectedValue ] = useControlledValue( {\n\t\tdefaultValue,\n\t\tvalue,\n\t\tonChange,\n\t} );\n\n\tconst groupContextValue = useMemo(\n\t\t(): ToggleGroupControlContextProps => ( {\n\t\t\tbaseId,\n\t\t\tvalue: selectedValue,\n\t\t\tsetValue: setSelectedValue,\n\t\t\tisBlock: ! isAdaptiveWidth,\n\t\t\tisDeselectable: true,\n\t\t\tsize,\n\t\t\tsetSelectedElement,\n\t\t} ),\n\t\t[\n\t\t\tbaseId,\n\t\t\tselectedValue,\n\t\t\tsetSelectedValue,\n\t\t\tisAdaptiveWidth,\n\t\t\tsize,\n\t\t\tsetSelectedElement,\n\t\t]\n\t);\n\n\treturn (\n\t\t<ToggleGroupControlContext.Provider value={ groupContextValue }>\n\t\t\t<View\n\t\t\t\taria-label={ label }\n\t\t\t\t{ ...otherProps }\n\t\t\t\tref={ forwardedRef }\n\t\t\t\trole=\"group\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t</ToggleGroupControlContext.Provider>\n\t);\n}\n\nexport const ToggleGroupControlAsButtonGroup = forwardRef(\n\tUnforwardedToggleGroupControlAsButtonGroup\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,kBAAkB,QAAQ,aAAa;AAEhD,OAAOC,yBAAyB,MAAM,YAAY;AAClD,SAASC,uCAAuC,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlE,SAASC,0CAA0CA,CAClD;EACCC,QAAQ;EACRC,eAAe;EACfC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK,EAAEC,SAAS;EAChBC,EAAE,EAAEC,MAAM;EACVC,kBAAkB;EAClB,GAAGC;AAKJ,CAAC,EACDC,YAAkD,EACjD;EACD,MAAMC,WAAW,GAAGtB,aAAa,CAChCuB,+BAA+B,EAC/B,sCACD,CAAC;EACD,MAAMC,MAAM,GAAGN,MAAM,IAAII,WAAW;;EAEpC;EACA;EACA;EACA;EACA,MAAM;IAAEP,KAAK;IAAEU;EAAa,CAAC,GAC5BnB,uCAAuC,CAAEU,SAAU,CAAC;EAErD,MAAM,CAAEU,aAAa,EAAEC,gBAAgB,CAAE,GAAGvB,kBAAkB,CAAE;IAC/DqB,YAAY;IACZV,KAAK;IACLF;EACD,CAAE,CAAC;EAEH,MAAMe,iBAAiB,GAAG1B,OAAO,CAChC,OAAwC;IACvCsB,MAAM;IACNT,KAAK,EAAEW,aAAa;IACpBG,QAAQ,EAAEF,gBAAgB;IAC1BG,OAAO,EAAE,CAAEnB,eAAe;IAC1BoB,cAAc,EAAE,IAAI;IACpBjB,IAAI;IACJK;EACD,CAAC,CAAE,EACH,CACCK,MAAM,EACNE,aAAa,EACbC,gBAAgB,EAChBhB,eAAe,EACfG,IAAI,EACJK,kBAAkB,CAEpB,CAAC;EAED,oBACCX,IAAA,CAACH,yBAAyB,CAAC2B,QAAQ;IAACjB,KAAK,EAAGa,iBAAmB;IAAAlB,QAAA,eAC9DF,IAAA,CAACL,IAAI;MACJ,cAAaS,KAAO;MAAA,GACfQ,UAAU;MACfa,GAAG,EAAGZ,YAAc;MACpBa,IAAI,EAAC,OAAO;MAAAxB,QAAA,EAEVA;IAAQ,CACL;EAAC,CAC4B,CAAC;AAEvC;AAEA,OAAO,MAAMa,+BAA+B,GAAGtB,UAAU,CACxDQ,0CACD,CAAC","ignoreList":[]}
@@ -9,7 +9,7 @@ import { useStoreState } from '@ariakit/react';
9
9
  * WordPress dependencies
10
10
  */
11
11
  import { useInstanceId } from '@wordpress/compose';
12
- import { forwardRef, useMemo } from '@wordpress/element';
12
+ import { forwardRef, useEffect, useMemo } from '@wordpress/element';
13
13
  import { isRTL } from '@wordpress/i18n';
14
14
 
15
15
  /**
@@ -27,6 +27,7 @@ function UnforwardedToggleGroupControlAsRadioGroup({
27
27
  size,
28
28
  value: valueProp,
29
29
  id: idProp,
30
+ setSelectedElement,
30
31
  ...otherProps
31
32
  }, forwardedRef) {
32
33
  const generatedId = useInstanceId(ToggleGroupControlAsRadioGroup, 'toggle-group-control-as-radio-group');
@@ -54,14 +55,24 @@ function UnforwardedToggleGroupControlAsRadioGroup({
54
55
  });
55
56
  const selectedValue = useStoreState(radio, 'value');
56
57
  const setValue = radio.setValue;
58
+
59
+ // Ensures that the active id is also reset after the value is "reset" by the consumer.
60
+ useEffect(() => {
61
+ if (selectedValue === '') {
62
+ radio.setActiveId(undefined);
63
+ }
64
+ }, [radio, selectedValue]);
57
65
  const groupContextValue = useMemo(() => ({
58
66
  activeItemIsNotFirstItem: () => radio.getState().activeId !== radio.first(),
59
67
  baseId,
60
68
  isBlock: !isAdaptiveWidth,
61
69
  size,
70
+ // @ts-expect-error - This is wrong and we should fix it.
62
71
  value: selectedValue,
63
- setValue
64
- }), [baseId, isAdaptiveWidth, radio, size, selectedValue, setValue]);
72
+ // @ts-expect-error - This is wrong and we should fix it.
73
+ setValue,
74
+ setSelectedElement
75
+ }), [baseId, isAdaptiveWidth, radio, selectedValue, setSelectedElement, setValue, size]);
65
76
  return /*#__PURE__*/_jsx(ToggleGroupControlContext.Provider, {
66
77
  value: groupContextValue,
67
78
  children: /*#__PURE__*/_jsx(Ariakit.RadioGroup, {