@wordpress/components 19.4.1 → 19.7.0-next.e230fbab09.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 (929) hide show
  1. package/CHANGELOG.md +34 -3
  2. package/CONTRIBUTING.md +69 -2
  3. package/build/alignment-matrix-control/utils.js +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js +1 -1
  6. package/build/angle-picker-control/angle-circle.js.map +1 -1
  7. package/build/animation/index.js +0 -6
  8. package/build/animation/index.js.map +1 -1
  9. package/build/autocomplete/get-default-use-items.js +3 -3
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/base-field/hook.js +1 -1
  12. package/build/base-field/hook.js.map +1 -1
  13. package/build/box-control/icon.js +1 -1
  14. package/build/box-control/icon.js.map +1 -1
  15. package/build/box-control/index.js +4 -4
  16. package/build/box-control/index.js.map +1 -1
  17. package/build/box-control/unit-control.js +2 -2
  18. package/build/box-control/unit-control.js.map +1 -1
  19. package/build/box-control/utils.js +12 -8
  20. package/build/box-control/utils.js.map +1 -1
  21. package/build/button/index.js +5 -5
  22. package/build/button/index.js.map +1 -1
  23. package/build/button/index.native.js +7 -7
  24. package/build/button/index.native.js.map +1 -1
  25. package/build/card/card/component.js +2 -2
  26. package/build/card/card/component.js.map +1 -1
  27. package/build/card/card-body/component.js +1 -1
  28. package/build/card/card-body/component.js.map +1 -1
  29. package/build/card/card-divider/component.js +1 -1
  30. package/build/card/card-divider/component.js.map +1 -1
  31. package/build/card/card-footer/component.js +1 -1
  32. package/build/card/card-footer/component.js.map +1 -1
  33. package/build/card/card-header/component.js +1 -1
  34. package/build/card/card-header/component.js.map +1 -1
  35. package/build/card/card-media/component.js +1 -1
  36. package/build/card/card-media/component.js.map +1 -1
  37. package/build/color-palette/index.native.js +35 -30
  38. package/build/color-palette/index.native.js.map +1 -1
  39. package/build/color-picker/color-display.js +1 -1
  40. package/build/color-picker/color-display.js.map +1 -1
  41. package/build/color-picker/component.js.map +1 -1
  42. package/build/color-picker/hex-input.js +6 -9
  43. package/build/color-picker/hex-input.js.map +1 -1
  44. package/build/color-picker/styles.js +8 -8
  45. package/build/color-picker/styles.js.map +1 -1
  46. package/build/combobox-control/index.js +1 -1
  47. package/build/combobox-control/index.js.map +1 -1
  48. package/build/confirm-dialog/component.js +4 -2
  49. package/build/confirm-dialog/component.js.map +1 -1
  50. package/build/date-time/time.js +7 -4
  51. package/build/date-time/time.js.map +1 -1
  52. package/build/divider/component.js +5 -4
  53. package/build/divider/component.js.map +1 -1
  54. package/build/draggable/index.js +3 -3
  55. package/build/draggable/index.js.map +1 -1
  56. package/build/elevation/component.js +1 -1
  57. package/build/elevation/component.js.map +1 -1
  58. package/build/flex/flex/component.js +1 -1
  59. package/build/flex/flex/component.js.map +1 -1
  60. package/build/flex/flex-block/component.js +1 -1
  61. package/build/flex/flex-block/component.js.map +1 -1
  62. package/build/flex/flex-item/component.js +1 -1
  63. package/build/flex/flex-item/component.js.map +1 -1
  64. package/build/flyout/flyout/component.js +1 -1
  65. package/build/flyout/flyout/component.js.map +1 -1
  66. package/build/flyout/flyout-content/component.js +1 -1
  67. package/build/flyout/flyout-content/component.js.map +1 -1
  68. package/build/focal-point-picker/index.js +18 -12
  69. package/build/focal-point-picker/index.js.map +1 -1
  70. package/build/focal-point-picker/index.native.js +7 -7
  71. package/build/focal-point-picker/index.native.js.map +1 -1
  72. package/build/focal-point-picker/tooltip/index.native.js +1 -1
  73. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  74. package/build/font-size-picker/index.js +1 -2
  75. package/build/font-size-picker/index.js.map +1 -1
  76. package/build/form-token-field/index.js +6 -6
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/form-token-field/suggestions-list.js +2 -2
  79. package/build/form-token-field/suggestions-list.js.map +1 -1
  80. package/build/grid/component.js +1 -1
  81. package/build/grid/component.js.map +1 -1
  82. package/build/h-stack/component.js +1 -1
  83. package/build/h-stack/component.js.map +1 -1
  84. package/build/heading/component.js +6 -5
  85. package/build/heading/component.js.map +1 -1
  86. package/build/heading/hook.js +1 -1
  87. package/build/heading/hook.js.map +1 -1
  88. package/build/higher-order/with-notices/index.js +1 -1
  89. package/build/higher-order/with-notices/index.js.map +1 -1
  90. package/build/index.js +14 -2
  91. package/build/index.js.map +1 -1
  92. package/build/index.native.js +15 -1
  93. package/build/index.native.js.map +1 -1
  94. package/build/input-control/index.js.map +1 -1
  95. package/build/input-control/input-base.js +1 -1
  96. package/build/input-control/input-base.js.map +1 -1
  97. package/build/input-control/input-field.js +19 -17
  98. package/build/input-control/input-field.js.map +1 -1
  99. package/build/input-control/reducer/reducer.js +3 -0
  100. package/build/input-control/reducer/reducer.js.map +1 -1
  101. package/build/input-control/styles/input-control-styles.js +25 -25
  102. package/build/input-control/styles/input-control-styles.js.map +1 -1
  103. package/build/isolated-event-container/index.js +1 -1
  104. package/build/isolated-event-container/index.js.map +1 -1
  105. package/build/item-group/item/component.js.map +1 -1
  106. package/build/item-group/item-group/component.js.map +1 -1
  107. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  108. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  109. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  110. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  111. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  112. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  113. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  114. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  115. package/build/mobile/bottom-sheet/index.native.js +11 -11
  116. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  117. package/build/mobile/bottom-sheet/link-cell.native.js +1 -1
  118. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  119. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  120. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  121. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  122. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  123. package/build/mobile/color-settings/palette.screen.native.js +26 -9
  124. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  125. package/build/mobile/global-styles-context/utils.native.js +73 -19
  126. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  127. package/build/mobile/gradient/index.native.js +2 -2
  128. package/build/mobile/gradient/index.native.js.map +1 -1
  129. package/build/mobile/html-text-input/container.ios.js +3 -3
  130. package/build/mobile/html-text-input/container.ios.js.map +1 -1
  131. package/build/mobile/html-text-input/index.native.js +1 -1
  132. package/build/mobile/html-text-input/index.native.js.map +1 -1
  133. package/build/mobile/image/index.native.js +1 -1
  134. package/build/mobile/image/index.native.js.map +1 -1
  135. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  136. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  137. package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  138. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  139. package/build/mobile/link-picker/index.native.js +3 -3
  140. package/build/mobile/link-picker/index.native.js.map +1 -1
  141. package/build/mobile/link-picker/link-picker-results.native.js +8 -8
  142. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  143. package/build/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  144. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  145. package/build/mobile/link-settings/index.native.js +1 -1
  146. package/build/mobile/link-settings/index.native.js.map +1 -1
  147. package/build/modal/aria-helper.js +1 -1
  148. package/build/modal/aria-helper.js.map +1 -1
  149. package/build/modal/index.js +2 -2
  150. package/build/modal/index.js.map +1 -1
  151. package/build/navigable-container/container.js +2 -2
  152. package/build/navigable-container/container.js.map +1 -1
  153. package/build/navigable-container/tabbable.js +1 -1
  154. package/build/navigable-container/tabbable.js.map +1 -1
  155. package/build/navigation/item/index.js +1 -1
  156. package/build/navigation/item/index.js.map +1 -1
  157. package/build/navigation/menu/index.js +1 -1
  158. package/build/navigation/menu/index.js.map +1 -1
  159. package/build/navigator/index.js +16 -0
  160. package/build/navigator/index.js.map +1 -1
  161. package/build/navigator/navigator-back-button/component.js +72 -0
  162. package/build/navigator/navigator-back-button/component.js.map +1 -0
  163. package/build/navigator/navigator-back-button/hook.js +49 -0
  164. package/build/navigator/navigator-back-button/hook.js.map +1 -0
  165. package/build/navigator/navigator-back-button/index.js +16 -0
  166. package/build/navigator/navigator-back-button/index.js.map +1 -0
  167. package/build/navigator/navigator-button/component.js +71 -0
  168. package/build/navigator/navigator-button/component.js.map +1 -0
  169. package/build/navigator/navigator-button/hook.js +59 -0
  170. package/build/navigator/navigator-button/hook.js.map +1 -0
  171. package/build/navigator/navigator-button/index.js +16 -0
  172. package/build/navigator/navigator-button/index.js.map +1 -0
  173. package/build/navigator/navigator-provider/component.js +12 -22
  174. package/build/navigator/navigator-provider/component.js.map +1 -1
  175. package/build/navigator/navigator-screen/component.js +14 -22
  176. package/build/navigator/navigator-screen/component.js.map +1 -1
  177. package/build/number-control/index.js +1 -1
  178. package/build/number-control/index.js.map +1 -1
  179. package/build/panel/body.js +2 -2
  180. package/build/panel/body.js.map +1 -1
  181. package/build/popover/index.js +3 -3
  182. package/build/popover/index.js.map +1 -1
  183. package/build/popover/utils.js +6 -6
  184. package/build/popover/utils.js.map +1 -1
  185. package/build/radio-group/index.js +1 -1
  186. package/build/radio-group/index.js.map +1 -1
  187. package/build/range-control/styles/range-control-styles.js +29 -29
  188. package/build/range-control/styles/range-control-styles.js.map +1 -1
  189. package/build/resizable-box/index.js.map +1 -1
  190. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  191. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  192. package/build/sandbox/index.js +5 -5
  193. package/build/sandbox/index.js.map +1 -1
  194. package/build/sandbox/index.native.js +1 -1
  195. package/build/sandbox/index.native.js.map +1 -1
  196. package/build/scrollable/component.js +1 -1
  197. package/build/scrollable/component.js.map +1 -1
  198. package/build/select-control/index.js +1 -1
  199. package/build/select-control/index.js.map +1 -1
  200. package/build/select-control/styles/select-control-styles.js +5 -5
  201. package/build/select-control/styles/select-control-styles.js.map +1 -1
  202. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  203. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  204. package/build/slot-fill/bubbles-virtually/slot.js +1 -1
  205. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  206. package/build/slot-fill/fill.js +1 -1
  207. package/build/slot-fill/fill.js.map +1 -1
  208. package/build/slot-fill/provider.js +1 -1
  209. package/build/slot-fill/provider.js.map +1 -1
  210. package/build/snackbar/index.js +1 -1
  211. package/build/snackbar/index.js.map +1 -1
  212. package/build/snackbar/list.js +1 -1
  213. package/build/snackbar/list.js.map +1 -1
  214. package/build/spacer/component.js.map +1 -1
  215. package/build/style-provider/index.js +2 -2
  216. package/build/style-provider/index.js.map +1 -1
  217. package/build/surface/component.js +1 -1
  218. package/build/surface/component.js.map +1 -1
  219. package/build/text/component.js +1 -1
  220. package/build/text/component.js.map +1 -1
  221. package/build/text-control/index.js +2 -2
  222. package/build/text-control/index.js.map +1 -1
  223. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  224. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  225. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  226. package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  227. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  228. package/build/toolbar/index.js +1 -1
  229. package/build/toolbar/index.js.map +1 -1
  230. package/build/tools-panel/tools-panel/component.js.map +1 -1
  231. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  232. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  233. package/build/tooltip/index.js +3 -3
  234. package/build/tooltip/index.js.map +1 -1
  235. package/build/tooltip/index.native.js +7 -7
  236. package/build/tooltip/index.native.js.map +1 -1
  237. package/build/tree-grid/index.js +50 -6
  238. package/build/tree-grid/index.js.map +1 -1
  239. package/build/truncate/component.js +1 -1
  240. package/build/truncate/component.js.map +1 -1
  241. package/build/truncate/utils.js +1 -1
  242. package/build/truncate/utils.js.map +1 -1
  243. package/build/ui/context/context-connect.js +8 -15
  244. package/build/ui/context/context-connect.js.map +1 -1
  245. package/build/ui/context/context-system-provider.js +2 -2
  246. package/build/ui/context/context-system-provider.js.map +1 -1
  247. package/build/ui/context/index.js.map +1 -1
  248. package/build/ui/control-group/component.js +1 -1
  249. package/build/ui/control-group/component.js.map +1 -1
  250. package/build/ui/control-label/component.js +1 -1
  251. package/build/ui/control-label/component.js.map +1 -1
  252. package/build/ui/form-group/form-group.js +1 -1
  253. package/build/ui/form-group/form-group.js.map +1 -1
  254. package/build/ui/shortcut/component.js.map +1 -1
  255. package/build/ui/spinner/component.js +1 -1
  256. package/build/ui/spinner/component.js.map +1 -1
  257. package/build/ui/tooltip/component.js +1 -1
  258. package/build/ui/tooltip/component.js.map +1 -1
  259. package/build/ui/tooltip/content.js +1 -1
  260. package/build/ui/tooltip/content.js.map +1 -1
  261. package/build/ui/utils/colors.js +2 -2
  262. package/build/ui/utils/colors.js.map +1 -1
  263. package/build/ui/utils/space.js +2 -2
  264. package/build/ui/utils/space.js.map +1 -1
  265. package/build/unit-control/index.js +38 -29
  266. package/build/unit-control/index.js.map +1 -1
  267. package/build/unit-control/index.native.js +4 -2
  268. package/build/unit-control/index.native.js.map +1 -1
  269. package/build/unit-control/unit-select-control.js +1 -1
  270. package/build/unit-control/unit-select-control.js.map +1 -1
  271. package/build/unit-control/utils.js +96 -104
  272. package/build/unit-control/utils.js.map +1 -1
  273. package/build/utils/breakpoint-values.js +1 -1
  274. package/build/utils/breakpoint-values.js.map +1 -1
  275. package/build/utils/colors-values.js +1 -1
  276. package/build/utils/colors-values.js.map +1 -1
  277. package/build/v-stack/component.js +1 -1
  278. package/build/v-stack/component.js.map +1 -1
  279. package/build/visually-hidden/component.js +1 -1
  280. package/build/visually-hidden/component.js.map +1 -1
  281. package/build/z-stack/component.js.map +1 -1
  282. package/build-module/alignment-matrix-control/utils.js +1 -1
  283. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  284. package/build-module/angle-picker-control/angle-circle.js +1 -1
  285. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  286. package/build-module/animation/index.js +1 -1
  287. package/build-module/animation/index.js.map +1 -1
  288. package/build-module/autocomplete/get-default-use-items.js +3 -3
  289. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  290. package/build-module/base-field/hook.js +1 -1
  291. package/build-module/base-field/hook.js.map +1 -1
  292. package/build-module/box-control/icon.js +1 -1
  293. package/build-module/box-control/icon.js.map +1 -1
  294. package/build-module/box-control/index.js +5 -5
  295. package/build-module/box-control/index.js.map +1 -1
  296. package/build-module/box-control/unit-control.js +1 -1
  297. package/build-module/box-control/unit-control.js.map +1 -1
  298. package/build-module/box-control/utils.js +13 -9
  299. package/build-module/box-control/utils.js.map +1 -1
  300. package/build-module/button/index.js +5 -5
  301. package/build-module/button/index.js.map +1 -1
  302. package/build-module/button/index.native.js +7 -7
  303. package/build-module/button/index.native.js.map +1 -1
  304. package/build-module/card/card/component.js +2 -2
  305. package/build-module/card/card/component.js.map +1 -1
  306. package/build-module/card/card-body/component.js +1 -1
  307. package/build-module/card/card-body/component.js.map +1 -1
  308. package/build-module/card/card-divider/component.js +1 -1
  309. package/build-module/card/card-divider/component.js.map +1 -1
  310. package/build-module/card/card-footer/component.js +1 -1
  311. package/build-module/card/card-footer/component.js.map +1 -1
  312. package/build-module/card/card-header/component.js +1 -1
  313. package/build-module/card/card-header/component.js.map +1 -1
  314. package/build-module/card/card-media/component.js +1 -1
  315. package/build-module/card/card-media/component.js.map +1 -1
  316. package/build-module/color-palette/index.native.js +36 -31
  317. package/build-module/color-palette/index.native.js.map +1 -1
  318. package/build-module/color-picker/color-display.js +1 -1
  319. package/build-module/color-picker/color-display.js.map +1 -1
  320. package/build-module/color-picker/component.js.map +1 -1
  321. package/build-module/color-picker/hex-input.js +6 -9
  322. package/build-module/color-picker/hex-input.js.map +1 -1
  323. package/build-module/color-picker/styles.js +8 -8
  324. package/build-module/color-picker/styles.js.map +1 -1
  325. package/build-module/combobox-control/index.js +1 -1
  326. package/build-module/combobox-control/index.js.map +1 -1
  327. package/build-module/confirm-dialog/component.js +4 -5
  328. package/build-module/confirm-dialog/component.js.map +1 -1
  329. package/build-module/date-time/time.js +7 -4
  330. package/build-module/date-time/time.js.map +1 -1
  331. package/build-module/divider/component.js +3 -3
  332. package/build-module/divider/component.js.map +1 -1
  333. package/build-module/draggable/index.js +3 -3
  334. package/build-module/draggable/index.js.map +1 -1
  335. package/build-module/elevation/component.js +1 -1
  336. package/build-module/elevation/component.js.map +1 -1
  337. package/build-module/flex/flex/component.js +1 -1
  338. package/build-module/flex/flex/component.js.map +1 -1
  339. package/build-module/flex/flex-block/component.js +1 -1
  340. package/build-module/flex/flex-block/component.js.map +1 -1
  341. package/build-module/flex/flex-item/component.js +1 -1
  342. package/build-module/flex/flex-item/component.js.map +1 -1
  343. package/build-module/flyout/flyout/component.js +1 -1
  344. package/build-module/flyout/flyout/component.js.map +1 -1
  345. package/build-module/flyout/flyout-content/component.js +1 -1
  346. package/build-module/flyout/flyout-content/component.js.map +1 -1
  347. package/build-module/focal-point-picker/index.js +18 -12
  348. package/build-module/focal-point-picker/index.js.map +1 -1
  349. package/build-module/focal-point-picker/index.native.js +7 -7
  350. package/build-module/focal-point-picker/index.native.js.map +1 -1
  351. package/build-module/focal-point-picker/tooltip/index.native.js +1 -1
  352. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  353. package/build-module/font-size-picker/index.js +1 -2
  354. package/build-module/font-size-picker/index.js.map +1 -1
  355. package/build-module/form-token-field/index.js +6 -6
  356. package/build-module/form-token-field/index.js.map +1 -1
  357. package/build-module/form-token-field/suggestions-list.js +2 -2
  358. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  359. package/build-module/grid/component.js +1 -1
  360. package/build-module/grid/component.js.map +1 -1
  361. package/build-module/h-stack/component.js +1 -1
  362. package/build-module/h-stack/component.js.map +1 -1
  363. package/build-module/heading/component.js +4 -4
  364. package/build-module/heading/component.js.map +1 -1
  365. package/build-module/heading/hook.js +1 -1
  366. package/build-module/heading/hook.js.map +1 -1
  367. package/build-module/higher-order/with-notices/index.js +1 -1
  368. package/build-module/higher-order/with-notices/index.js.map +1 -1
  369. package/build-module/index.js +5 -5
  370. package/build-module/index.js.map +1 -1
  371. package/build-module/index.native.js +5 -5
  372. package/build-module/index.native.js.map +1 -1
  373. package/build-module/input-control/index.js.map +1 -1
  374. package/build-module/input-control/input-base.js +1 -1
  375. package/build-module/input-control/input-base.js.map +1 -1
  376. package/build-module/input-control/input-field.js +19 -16
  377. package/build-module/input-control/input-field.js.map +1 -1
  378. package/build-module/input-control/reducer/reducer.js +3 -0
  379. package/build-module/input-control/reducer/reducer.js.map +1 -1
  380. package/build-module/input-control/styles/input-control-styles.js +25 -25
  381. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  382. package/build-module/isolated-event-container/index.js +1 -1
  383. package/build-module/isolated-event-container/index.js.map +1 -1
  384. package/build-module/item-group/item/component.js.map +1 -1
  385. package/build-module/item-group/item-group/component.js.map +1 -1
  386. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  387. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  388. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  389. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  390. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  391. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  392. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  393. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  394. package/build-module/mobile/bottom-sheet/index.native.js +11 -11
  395. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  396. package/build-module/mobile/bottom-sheet/link-cell.native.js +1 -1
  397. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  398. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  399. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  400. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  401. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  402. package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
  403. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  404. package/build-module/mobile/global-styles-context/utils.native.js +70 -20
  405. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  406. package/build-module/mobile/gradient/index.native.js +2 -2
  407. package/build-module/mobile/gradient/index.native.js.map +1 -1
  408. package/build-module/mobile/html-text-input/container.ios.js +3 -3
  409. package/build-module/mobile/html-text-input/container.ios.js.map +1 -1
  410. package/build-module/mobile/html-text-input/index.native.js +1 -1
  411. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  412. package/build-module/mobile/image/index.native.js +1 -1
  413. package/build-module/mobile/image/index.native.js.map +1 -1
  414. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  415. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  416. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  417. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  418. package/build-module/mobile/link-picker/index.native.js +3 -3
  419. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  420. package/build-module/mobile/link-picker/link-picker-results.native.js +8 -8
  421. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  422. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  423. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  424. package/build-module/mobile/link-settings/index.native.js +1 -1
  425. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  426. package/build-module/modal/aria-helper.js +1 -1
  427. package/build-module/modal/aria-helper.js.map +1 -1
  428. package/build-module/modal/index.js +2 -2
  429. package/build-module/modal/index.js.map +1 -1
  430. package/build-module/navigable-container/container.js +2 -2
  431. package/build-module/navigable-container/container.js.map +1 -1
  432. package/build-module/navigable-container/tabbable.js +1 -1
  433. package/build-module/navigable-container/tabbable.js.map +1 -1
  434. package/build-module/navigation/item/index.js +1 -1
  435. package/build-module/navigation/item/index.js.map +1 -1
  436. package/build-module/navigation/menu/index.js +1 -1
  437. package/build-module/navigation/menu/index.js.map +1 -1
  438. package/build-module/navigator/index.js +2 -0
  439. package/build-module/navigator/index.js.map +1 -1
  440. package/build-module/navigator/navigator-back-button/component.js +59 -0
  441. package/build-module/navigator/navigator-back-button/component.js.map +1 -0
  442. package/build-module/navigator/navigator-back-button/hook.js +36 -0
  443. package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
  444. package/build-module/navigator/navigator-back-button/index.js +2 -0
  445. package/build-module/navigator/navigator-back-button/index.js.map +1 -0
  446. package/build-module/navigator/navigator-button/component.js +58 -0
  447. package/build-module/navigator/navigator-button/component.js.map +1 -0
  448. package/build-module/navigator/navigator-button/hook.js +46 -0
  449. package/build-module/navigator/navigator-button/hook.js.map +1 -0
  450. package/build-module/navigator/navigator-button/index.js +2 -0
  451. package/build-module/navigator/navigator-button/index.js.map +1 -0
  452. package/build-module/navigator/navigator-provider/component.js +12 -22
  453. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  454. package/build-module/navigator/navigator-screen/component.js +13 -22
  455. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  456. package/build-module/number-control/index.js +1 -1
  457. package/build-module/number-control/index.js.map +1 -1
  458. package/build-module/panel/body.js +2 -2
  459. package/build-module/panel/body.js.map +1 -1
  460. package/build-module/popover/index.js +3 -3
  461. package/build-module/popover/index.js.map +1 -1
  462. package/build-module/popover/utils.js +6 -6
  463. package/build-module/popover/utils.js.map +1 -1
  464. package/build-module/radio-group/index.js +1 -1
  465. package/build-module/radio-group/index.js.map +1 -1
  466. package/build-module/range-control/styles/range-control-styles.js +29 -29
  467. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  468. package/build-module/resizable-box/index.js.map +1 -1
  469. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  470. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  471. package/build-module/sandbox/index.js +5 -5
  472. package/build-module/sandbox/index.js.map +1 -1
  473. package/build-module/sandbox/index.native.js +1 -1
  474. package/build-module/sandbox/index.native.js.map +1 -1
  475. package/build-module/scrollable/component.js +1 -1
  476. package/build-module/scrollable/component.js.map +1 -1
  477. package/build-module/select-control/index.js +2 -2
  478. package/build-module/select-control/index.js.map +1 -1
  479. package/build-module/select-control/styles/select-control-styles.js +5 -5
  480. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  481. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  482. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  483. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -1
  484. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  485. package/build-module/slot-fill/fill.js +1 -1
  486. package/build-module/slot-fill/fill.js.map +1 -1
  487. package/build-module/slot-fill/provider.js +1 -1
  488. package/build-module/slot-fill/provider.js.map +1 -1
  489. package/build-module/snackbar/index.js +1 -1
  490. package/build-module/snackbar/index.js.map +1 -1
  491. package/build-module/snackbar/list.js +1 -1
  492. package/build-module/snackbar/list.js.map +1 -1
  493. package/build-module/spacer/component.js.map +1 -1
  494. package/build-module/style-provider/index.js +2 -2
  495. package/build-module/style-provider/index.js.map +1 -1
  496. package/build-module/surface/component.js +1 -1
  497. package/build-module/surface/component.js.map +1 -1
  498. package/build-module/text/component.js +1 -1
  499. package/build-module/text/component.js.map +1 -1
  500. package/build-module/text-control/index.js +2 -2
  501. package/build-module/text-control/index.js.map +1 -1
  502. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  503. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  504. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  505. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  506. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  507. package/build-module/toolbar/index.js +1 -1
  508. package/build-module/toolbar/index.js.map +1 -1
  509. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  510. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  511. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  512. package/build-module/tooltip/index.js +3 -3
  513. package/build-module/tooltip/index.js.map +1 -1
  514. package/build-module/tooltip/index.native.js +7 -7
  515. package/build-module/tooltip/index.native.js.map +1 -1
  516. package/build-module/tree-grid/index.js +51 -7
  517. package/build-module/tree-grid/index.js.map +1 -1
  518. package/build-module/truncate/component.js +1 -1
  519. package/build-module/truncate/component.js.map +1 -1
  520. package/build-module/truncate/utils.js +1 -1
  521. package/build-module/truncate/utils.js.map +1 -1
  522. package/build-module/ui/context/context-connect.js +9 -16
  523. package/build-module/ui/context/context-connect.js.map +1 -1
  524. package/build-module/ui/context/context-system-provider.js +2 -2
  525. package/build-module/ui/context/context-system-provider.js.map +1 -1
  526. package/build-module/ui/context/index.js.map +1 -1
  527. package/build-module/ui/control-group/component.js +1 -1
  528. package/build-module/ui/control-group/component.js.map +1 -1
  529. package/build-module/ui/control-label/component.js +1 -1
  530. package/build-module/ui/control-label/component.js.map +1 -1
  531. package/build-module/ui/form-group/form-group.js +1 -1
  532. package/build-module/ui/form-group/form-group.js.map +1 -1
  533. package/build-module/ui/shortcut/component.js.map +1 -1
  534. package/build-module/ui/spinner/component.js +1 -1
  535. package/build-module/ui/spinner/component.js.map +1 -1
  536. package/build-module/ui/tooltip/component.js +1 -1
  537. package/build-module/ui/tooltip/component.js.map +1 -1
  538. package/build-module/ui/tooltip/content.js +1 -1
  539. package/build-module/ui/tooltip/content.js.map +1 -1
  540. package/build-module/ui/utils/colors.js +2 -2
  541. package/build-module/ui/utils/colors.js.map +1 -1
  542. package/build-module/ui/utils/space.js +2 -2
  543. package/build-module/ui/utils/space.js.map +1 -1
  544. package/build-module/unit-control/index.js +39 -30
  545. package/build-module/unit-control/index.js.map +1 -1
  546. package/build-module/unit-control/index.native.js +5 -3
  547. package/build-module/unit-control/index.native.js.map +1 -1
  548. package/build-module/unit-control/unit-select-control.js +1 -1
  549. package/build-module/unit-control/unit-select-control.js.map +1 -1
  550. package/build-module/unit-control/utils.js +92 -100
  551. package/build-module/unit-control/utils.js.map +1 -1
  552. package/build-module/utils/breakpoint-values.js +1 -1
  553. package/build-module/utils/breakpoint-values.js.map +1 -1
  554. package/build-module/utils/colors-values.js +1 -1
  555. package/build-module/utils/colors-values.js.map +1 -1
  556. package/build-module/v-stack/component.js +1 -1
  557. package/build-module/v-stack/component.js.map +1 -1
  558. package/build-module/visually-hidden/component.js +1 -1
  559. package/build-module/visually-hidden/component.js.map +1 -1
  560. package/build-module/z-stack/component.js.map +1 -1
  561. package/build-style/style-rtl.css +8 -0
  562. package/build-style/style.css +8 -0
  563. package/build-types/base-field/hook.d.ts +2 -1
  564. package/build-types/base-field/hook.d.ts.map +1 -1
  565. package/build-types/card/card/hook.d.ts +2 -1
  566. package/build-types/card/card/hook.d.ts.map +1 -1
  567. package/build-types/card/card-body/hook.d.ts +2 -1
  568. package/build-types/card/card-body/hook.d.ts.map +1 -1
  569. package/build-types/card/card-divider/hook.d.ts +2 -3
  570. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  571. package/build-types/card/card-footer/hook.d.ts +2 -1
  572. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  573. package/build-types/card/card-header/hook.d.ts +2 -1
  574. package/build-types/card/card-header/hook.d.ts.map +1 -1
  575. package/build-types/card/card-media/hook.d.ts +2 -1
  576. package/build-types/card/card-media/hook.d.ts.map +1 -1
  577. package/build-types/color-picker/styles.d.ts +2 -4
  578. package/build-types/color-picker/styles.d.ts.map +1 -1
  579. package/build-types/confirm-dialog/component.d.ts +10 -6
  580. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  581. package/build-types/confirm-dialog/types.d.ts +2 -0
  582. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  583. package/build-types/divider/component.d.ts +2 -2
  584. package/build-types/divider/component.d.ts.map +1 -1
  585. package/build-types/divider/stories/index.d.ts +10 -0
  586. package/build-types/divider/stories/index.d.ts.map +1 -0
  587. package/build-types/divider/types.d.ts +1 -1
  588. package/build-types/divider/types.d.ts.map +1 -1
  589. package/build-types/elevation/hook.d.ts +2 -1
  590. package/build-types/elevation/hook.d.ts.map +1 -1
  591. package/build-types/flex/flex/hook.d.ts +2 -1
  592. package/build-types/flex/flex/hook.d.ts.map +1 -1
  593. package/build-types/flex/flex-block/hook.d.ts +2 -1
  594. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  595. package/build-types/flex/flex-item/hook.d.ts +2 -1
  596. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  597. package/build-types/flyout/flyout/hook.d.ts +2 -2
  598. package/build-types/grid/hook.d.ts +2 -1
  599. package/build-types/grid/hook.d.ts.map +1 -1
  600. package/build-types/h-stack/hook.d.ts +3 -2
  601. package/build-types/h-stack/hook.d.ts.map +1 -1
  602. package/build-types/heading/component.d.ts +3 -3
  603. package/build-types/heading/component.d.ts.map +1 -1
  604. package/build-types/heading/hook.d.ts +2 -1
  605. package/build-types/heading/hook.d.ts.map +1 -1
  606. package/build-types/heading/stories/index.d.ts +12 -0
  607. package/build-types/heading/stories/index.d.ts.map +1 -0
  608. package/build-types/input-control/index.d.ts +3 -3
  609. package/build-types/input-control/index.d.ts.map +1 -1
  610. package/build-types/input-control/input-base.d.ts +2 -2
  611. package/build-types/input-control/input-base.d.ts.map +1 -1
  612. package/build-types/input-control/input-field.d.ts +1 -3
  613. package/build-types/input-control/input-field.d.ts.map +1 -1
  614. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  615. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  616. package/build-types/input-control/types.d.ts +1 -1
  617. package/build-types/input-control/types.d.ts.map +1 -1
  618. package/build-types/item-group/item/hook.d.ts +2 -1
  619. package/build-types/item-group/item/hook.d.ts.map +1 -1
  620. package/build-types/item-group/item-group/hook.d.ts +2 -1
  621. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  622. package/build-types/navigator/index.d.ts +2 -0
  623. package/build-types/navigator/index.d.ts.map +1 -1
  624. package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
  625. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
  626. package/build-types/navigator/navigator-back-button/hook.d.ts +283 -0
  627. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
  628. package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
  629. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
  630. package/build-types/navigator/navigator-button/component.d.ts +37 -0
  631. package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
  632. package/build-types/navigator/navigator-button/hook.d.ts +283 -0
  633. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
  634. package/build-types/navigator/navigator-button/index.d.ts +2 -0
  635. package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
  636. package/build-types/navigator/navigator-provider/component.d.ts +10 -20
  637. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  638. package/build-types/navigator/navigator-screen/component.d.ts +10 -20
  639. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  640. package/build-types/navigator/types.d.ts +21 -0
  641. package/build-types/navigator/types.d.ts.map +1 -1
  642. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  643. package/build-types/resizable-box/index.d.ts +2 -2
  644. package/build-types/resizable-box/index.d.ts.map +1 -1
  645. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  646. package/build-types/scrollable/hook.d.ts +2 -1
  647. package/build-types/scrollable/hook.d.ts.map +1 -1
  648. package/build-types/select-control/index.d.ts +1 -3
  649. package/build-types/select-control/index.d.ts.map +1 -1
  650. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  651. package/build-types/spacer/hook.d.ts +2 -1
  652. package/build-types/spacer/hook.d.ts.map +1 -1
  653. package/build-types/surface/hook.d.ts +2 -1
  654. package/build-types/surface/hook.d.ts.map +1 -1
  655. package/build-types/text/hook.d.ts +2 -1
  656. package/build-types/text/hook.d.ts.map +1 -1
  657. package/build-types/text/types.d.ts +1 -2
  658. package/build-types/text/types.d.ts.map +1 -1
  659. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  660. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
  661. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  662. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
  663. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  664. package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -1
  665. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  666. package/build-types/truncate/hook.d.ts +2 -1
  667. package/build-types/truncate/hook.d.ts.map +1 -1
  668. package/build-types/ui/context/context-connect.d.ts +18 -16
  669. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  670. package/build-types/ui/context/index.d.ts +4 -4
  671. package/build-types/ui/context/index.d.ts.map +1 -1
  672. package/build-types/ui/context/wordpress-component.d.ts +3 -6
  673. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  674. package/build-types/ui/control-group/hook.d.ts +2 -1
  675. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  676. package/build-types/ui/control-label/hook.d.ts +2 -1
  677. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  678. package/build-types/ui/form-group/use-form-group.d.ts +6 -4
  679. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  680. package/build-types/unit-control/index.d.ts +3 -5
  681. package/build-types/unit-control/index.d.ts.map +1 -1
  682. package/build-types/unit-control/types.d.ts +4 -6
  683. package/build-types/unit-control/types.d.ts.map +1 -1
  684. package/build-types/unit-control/utils.d.ts +47 -38
  685. package/build-types/unit-control/utils.d.ts.map +1 -1
  686. package/build-types/v-stack/hook.d.ts +2 -1
  687. package/build-types/v-stack/hook.d.ts.map +1 -1
  688. package/build-types/z-stack/component.d.ts.map +1 -1
  689. package/package.json +19 -18
  690. package/src/alignment-matrix-control/README.md +4 -0
  691. package/src/alignment-matrix-control/stories/index.js +1 -1
  692. package/src/alignment-matrix-control/utils.js +1 -1
  693. package/src/angle-picker-control/angle-circle.js +1 -1
  694. package/src/animation/index.js +0 -1
  695. package/src/autocomplete/get-default-use-items.js +3 -3
  696. package/src/base-control/stories/index.js +65 -22
  697. package/src/base-field/hook.js +1 -1
  698. package/src/box-control/icon.js +1 -1
  699. package/src/box-control/index.js +5 -5
  700. package/src/box-control/stories/index.js +4 -1
  701. package/src/box-control/test/index.js +27 -7
  702. package/src/box-control/unit-control.js +1 -1
  703. package/src/box-control/utils.js +13 -9
  704. package/src/button/index.js +5 -5
  705. package/src/button/index.native.js +7 -7
  706. package/src/button/style.scss +1 -0
  707. package/src/card/card/component.js +1 -1
  708. package/src/card/card-body/component.js +1 -1
  709. package/src/card/card-divider/component.js +1 -1
  710. package/src/card/card-footer/component.js +1 -1
  711. package/src/card/card-header/component.js +1 -1
  712. package/src/card/card-media/component.js +1 -1
  713. package/src/color-palette/index.native.js +92 -75
  714. package/src/color-palette/style.native.scss +10 -5
  715. package/src/color-palette/style.scss +1 -0
  716. package/src/color-picker/color-display.tsx +1 -1
  717. package/src/color-picker/component.tsx +2 -2
  718. package/src/color-picker/hex-input.tsx +9 -9
  719. package/src/color-picker/styles.ts +1 -1
  720. package/src/color-picker/test/index.js +1 -1
  721. package/src/combobox-control/index.js +1 -1
  722. package/src/combobox-control/style.scss +1 -0
  723. package/src/confirm-dialog/README.md +56 -45
  724. package/src/confirm-dialog/component.tsx +6 -4
  725. package/src/confirm-dialog/stories/index.js +19 -0
  726. package/src/confirm-dialog/test/index.js +28 -0
  727. package/src/confirm-dialog/types.ts +2 -0
  728. package/src/date-time/style.scss +4 -0
  729. package/src/date-time/time.js +16 -5
  730. package/src/dimension-control/test/index.test.js +1 -1
  731. package/src/disabled/test/index.js +1 -1
  732. package/src/divider/component.tsx +5 -5
  733. package/src/divider/stories/index.tsx +70 -0
  734. package/src/divider/types.ts +3 -1
  735. package/src/draggable/index.js +3 -3
  736. package/src/draggable/stories/index.js +1 -1
  737. package/src/elevation/component.js +1 -1
  738. package/src/flex/flex/component.js +1 -1
  739. package/src/flex/flex-block/component.js +1 -1
  740. package/src/flex/flex-item/component.js +1 -1
  741. package/src/flyout/flyout/README.md +1 -1
  742. package/src/flyout/flyout/component.js +1 -1
  743. package/src/flyout/flyout-content/component.js +1 -1
  744. package/src/flyout/test/index.js +1 -1
  745. package/src/focal-point-picker/README.md +7 -0
  746. package/src/focal-point-picker/index.js +12 -7
  747. package/src/focal-point-picker/index.native.js +7 -7
  748. package/src/focal-point-picker/stories/index.js +30 -0
  749. package/src/focal-point-picker/test/index.js +44 -0
  750. package/src/focal-point-picker/tooltip/index.native.js +1 -1
  751. package/src/font-size-picker/README.md +1 -2
  752. package/src/font-size-picker/index.js +1 -2
  753. package/src/font-size-picker/stories/index.js +87 -108
  754. package/src/form-file-upload/README.md +1 -1
  755. package/src/form-file-upload/stories/index.js +51 -0
  756. package/src/form-token-field/index.js +6 -6
  757. package/src/form-token-field/style.scss +1 -0
  758. package/src/form-token-field/suggestions-list.js +2 -2
  759. package/src/form-token-field/test/index.js +6 -6
  760. package/src/grid/component.js +1 -1
  761. package/src/h-stack/component.js +1 -1
  762. package/src/heading/component.tsx +6 -6
  763. package/src/heading/hook.ts +1 -1
  764. package/src/heading/stories/index.tsx +37 -0
  765. package/src/higher-order/with-filters/test/index.js +1 -1
  766. package/src/higher-order/with-focus-outside/test/index.js +1 -1
  767. package/src/higher-order/with-notices/index.js +1 -1
  768. package/src/higher-order/with-notices/test/index.js +3 -3
  769. package/src/index.js +6 -4
  770. package/src/index.native.js +9 -5
  771. package/src/input-control/index.tsx +2 -2
  772. package/src/input-control/input-base.tsx +3 -3
  773. package/src/input-control/input-field.tsx +16 -15
  774. package/src/input-control/reducer/reducer.ts +3 -0
  775. package/src/input-control/stories/index.js +1 -1
  776. package/src/input-control/styles/input-control-styles.tsx +1 -0
  777. package/src/input-control/test/index.js +4 -4
  778. package/src/input-control/types.ts +1 -1
  779. package/src/isolated-event-container/index.js +1 -1
  780. package/src/item-group/item/component.tsx +2 -2
  781. package/src/item-group/item-group/component.tsx +2 -2
  782. package/src/item-group/test/index.js +0 -1
  783. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  784. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  785. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
  786. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  787. package/src/mobile/bottom-sheet/index.native.js +11 -11
  788. package/src/mobile/bottom-sheet/link-cell.native.js +1 -1
  789. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  790. package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  791. package/src/mobile/color-settings/palette.screen.native.js +39 -9
  792. package/src/mobile/color-settings/style.native.scss +4 -0
  793. package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
  794. package/src/mobile/global-styles-context/test/utils.native.js +2 -2
  795. package/src/mobile/global-styles-context/utils.native.js +85 -16
  796. package/src/mobile/gradient/index.native.js +2 -2
  797. package/src/mobile/html-text-input/container.ios.js +3 -3
  798. package/src/mobile/html-text-input/index.native.js +1 -1
  799. package/src/mobile/html-text-input/test/index.native.js +14 -14
  800. package/src/mobile/image/index.native.js +1 -1
  801. package/src/mobile/image/style.native.scss +1 -0
  802. package/src/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  803. package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  804. package/src/mobile/link-picker/index.native.js +3 -3
  805. package/src/mobile/link-picker/link-picker-results.native.js +8 -8
  806. package/src/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  807. package/src/mobile/link-settings/index.native.js +1 -2
  808. package/src/mobile/link-settings/test/edit.native.js +15 -15
  809. package/src/modal/aria-helper.js +1 -1
  810. package/src/modal/index.js +2 -2
  811. package/src/navigable-container/container.js +2 -2
  812. package/src/navigable-container/tabbable.js +1 -1
  813. package/src/navigable-container/test/menu.js +5 -5
  814. package/src/navigable-container/test/tabbable.js +2 -2
  815. package/src/navigation/item/index.js +1 -1
  816. package/src/navigation/menu/index.js +1 -1
  817. package/src/navigation/stories/controlled-state.js +2 -2
  818. package/src/navigation/stories/index.js +1 -1
  819. package/src/navigator/index.ts +2 -0
  820. package/src/navigator/navigator-back-button/README.md +31 -0
  821. package/src/navigator/navigator-back-button/component.tsx +62 -0
  822. package/src/navigator/navigator-back-button/hook.ts +40 -0
  823. package/src/navigator/navigator-back-button/index.ts +1 -0
  824. package/src/navigator/navigator-button/README.md +38 -0
  825. package/src/navigator/navigator-button/component.tsx +61 -0
  826. package/src/navigator/navigator-button/hook.ts +55 -0
  827. package/src/navigator/navigator-button/index.ts +1 -0
  828. package/src/navigator/navigator-provider/README.md +20 -33
  829. package/src/navigator/navigator-provider/component.tsx +13 -23
  830. package/src/navigator/navigator-screen/README.md +1 -1
  831. package/src/navigator/navigator-screen/component.tsx +16 -25
  832. package/src/navigator/stories/index.js +24 -37
  833. package/src/navigator/test/index.js +105 -51
  834. package/src/navigator/types.ts +27 -1
  835. package/src/number-control/index.js +1 -1
  836. package/src/number-control/stories/index.js +1 -1
  837. package/src/panel/body.js +2 -2
  838. package/src/popover/index.js +3 -3
  839. package/src/popover/utils.js +6 -6
  840. package/src/radio/stories/index.js +1 -1
  841. package/src/radio-group/index.js +1 -1
  842. package/src/radio-group/stories/index.js +4 -1
  843. package/src/range-control/stories/index.js +1 -1
  844. package/src/range-control/styles/range-control-styles.js +1 -1
  845. package/src/range-control/test/index.js +2 -2
  846. package/src/resizable-box/index.tsx +2 -2
  847. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  848. package/src/resizable-box/resize-tooltip/label.tsx +2 -2
  849. package/src/sandbox/index.js +5 -5
  850. package/src/sandbox/index.native.js +1 -1
  851. package/src/scrollable/component.js +1 -1
  852. package/src/select-control/index.tsx +3 -4
  853. package/src/select-control/styles/select-control-styles.ts +1 -0
  854. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  855. package/src/slot-fill/bubbles-virtually/slot.js +1 -2
  856. package/src/slot-fill/fill.js +1 -1
  857. package/src/slot-fill/provider.js +1 -1
  858. package/src/snackbar/index.js +1 -1
  859. package/src/snackbar/list.js +1 -1
  860. package/src/spacer/component.tsx +2 -2
  861. package/src/style-provider/index.js +2 -2
  862. package/src/surface/component.js +1 -1
  863. package/src/tab-panel/test/index.js +1 -1
  864. package/src/text/component.js +1 -1
  865. package/src/text/test/index.js +2 -2
  866. package/src/text/types.ts +6 -8
  867. package/src/text-control/index.js +2 -2
  868. package/src/text-highlight/test/index.js +4 -4
  869. package/src/toggle-control/test/index.js +3 -3
  870. package/src/toggle-group-control/stories/index.js +1 -1
  871. package/src/toggle-group-control/test/__snapshots__/index.js.snap +1 -0
  872. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -4
  873. package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
  874. package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -0
  875. package/src/toolbar/index.js +1 -1
  876. package/src/toolbar-group/test/index.js +2 -2
  877. package/src/tools-panel/stories/index.js +0 -1
  878. package/src/tools-panel/tools-panel/component.tsx +2 -2
  879. package/src/tools-panel/tools-panel-header/component.tsx +2 -2
  880. package/src/tools-panel/tools-panel-item/component.tsx +2 -2
  881. package/src/tooltip/index.js +3 -3
  882. package/src/tooltip/index.native.js +7 -7
  883. package/src/tooltip/test/index.js +2 -2
  884. package/src/tooltip/test/index.native.js +2 -2
  885. package/src/tree-grid/README.md +24 -1
  886. package/src/tree-grid/index.js +66 -7
  887. package/src/tree-grid/stories/index.js +4 -1
  888. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
  889. package/src/tree-grid/test/index.js +259 -8
  890. package/src/truncate/component.js +1 -1
  891. package/src/truncate/utils.js +1 -1
  892. package/src/ui/context/{context-connect.js → context-connect.ts} +27 -16
  893. package/src/ui/context/context-system-provider.js +2 -2
  894. package/src/ui/context/{index.js → index.ts} +0 -0
  895. package/src/ui/context/wordpress-component.ts +3 -2
  896. package/src/ui/control-group/component.js +1 -1
  897. package/src/ui/control-label/component.js +1 -1
  898. package/src/ui/form-group/form-group.js +1 -1
  899. package/src/ui/shortcut/component.tsx +2 -2
  900. package/src/ui/spinner/component.js +1 -1
  901. package/src/ui/tooltip/component.js +1 -1
  902. package/src/ui/tooltip/content.js +1 -1
  903. package/src/ui/tooltip/test/index.js +4 -4
  904. package/src/ui/utils/colors.js +2 -2
  905. package/src/ui/utils/space.ts +2 -2
  906. package/src/unit-control/README.md +1 -1
  907. package/src/unit-control/index.native.js +5 -3
  908. package/src/unit-control/index.tsx +66 -37
  909. package/src/unit-control/stories/index.js +1 -1
  910. package/src/unit-control/test/index.js +102 -3
  911. package/src/unit-control/test/utils.js +56 -15
  912. package/src/unit-control/types.ts +5 -8
  913. package/src/unit-control/unit-select-control.tsx +1 -1
  914. package/src/unit-control/utils.ts +128 -125
  915. package/src/utils/breakpoint-values.js +1 -1
  916. package/src/utils/colors-values.js +1 -1
  917. package/src/utils/hooks/test/use-controlled-state.js +1 -1
  918. package/src/utils/hooks/test/use-controlled-value.js +3 -3
  919. package/src/utils/hooks/test/use-latest-ref.js +1 -1
  920. package/src/utils/test/math.js +2 -2
  921. package/src/utils/test/rtl.js +12 -12
  922. package/src/v-stack/component.js +1 -1
  923. package/src/visually-hidden/component.js +1 -1
  924. package/src/z-stack/component.tsx +2 -2
  925. package/tsconfig.json +1 -1
  926. package/tsconfig.tsbuildinfo +1 -1
  927. package/src/divider/stories/index.js +0 -64
  928. package/src/heading/stories/index.js +0 -24
  929. package/src/tools-panel/stories/typography-panel.js +0 -215
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/button/index.js"],"names":["disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","variant","otherProps","computedVariant","since","alternative","version","Button","props","ref","href","target","isSmall","isPressed","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","additionalProps","instanceId","classes","trulyDisabled","Tag","undefined","tagProps","type","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","element"],"mappings":";;;;;;;;;;AAWA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAnBA;;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAKA,MAAMA,8BAA8B,GAAG,CAAE,aAAF,EAAiB,SAAjB,CAAvC;;AAEA,SAASC,kBAAT,OAQI;AAAA,MARyB;AAC5BC,IAAAA,SAD4B;AAE5BC,IAAAA,SAF4B;AAG5BC,IAAAA,WAH4B;AAI5BC,IAAAA,UAJ4B;AAK5BC,IAAAA,MAL4B;AAM5BC,IAAAA,OAN4B;AAO5B,OAAGC;AAPyB,GAQzB;AACH,MAAIC,eAAe,GAAGF,OAAtB;;AAEA,MAAKJ,SAAL,EAAiB;AAAA;;AAChB,wBAAAM,eAAe,UAAf,qDAAAA,eAAe,GAAK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n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ];\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tvariant,\n\t...otherProps\n} ) {\n\tlet computedVariant = variant;\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...otherProps,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function Button( props, ref ) {\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\tisSmall,\n\t\tisPressed,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...additionalProps\n\t} = useDeprecatedProps( props );\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': isSmall,\n\t\t'is-tertiary': variant === 'tertiary',\n\t\t'is-pressed': isPressed,\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && !! children,\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst tagProps =\n\t\tTag === 'a'\n\t\t\t? { href, target }\n\t\t\t: {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-pressed': isPressed,\n\t\t\t };\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\ttagProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event ) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// an explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// there's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// there's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// the children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// the tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : null;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst element = (\n\t\t<Tag\n\t\t\t{ ...tagProps }\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\taria-label={ additionalProps[ 'aria-label' ] || label }\n\t\t\taria-describedby={ describedById }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ element }\n\t\t\t\t{ describedBy && (\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip\n\t\t\t\ttext={ describedBy ? describedBy : label }\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tposition={ tooltipPosition }\n\t\t\t>\n\t\t\t\t{ element }\n\t\t\t</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default forwardRef( Button );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/button/index.js"],"names":["disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","variant","otherProps","computedVariant","since","alternative","version","Button","props","ref","href","target","isSmall","isPressed","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","additionalProps","instanceId","classes","trulyDisabled","Tag","undefined","tagProps","type","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describ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AeGK,QAfH,CADD;;AAoBA,MAAK,CAAEiB,iBAAP,EAA2B;AAC1B,WACC,qDACGI,OADH,EAEGjB,WAAW,IACZ,4BAAC,8BAAD,QACC;AAAM,MAAA,EAAE,EAAGe;AAAX,OAA6Bf,WAA7B,CADD,CAHF,CADD;AAUA;;AAED,SACC,qDACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGA,WAAW,GAAGA,WAAH,GAAiBL,KADpC;AAEC,IAAA,QAAQ,EAAGD,QAFZ;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKGwB,OALH,CADD,EAQGjB,WAAW,IACZ,4BAAC,8BAAD,QACC;AAAM,IAAA,EAAE,EAAGe;AAAX,KAA6Bf,WAA7B,CADD,CATF,CADD;AAgBA;;eAEc,yBAAYtB,MAAZ,C","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ];\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tvariant,\n\t...otherProps\n} ) {\n\tlet computedVariant = variant;\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...otherProps,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function Button( props, ref ) {\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\tisSmall,\n\t\tisPressed,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...additionalProps\n\t} = useDeprecatedProps( props );\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': isSmall,\n\t\t'is-tertiary': variant === 'tertiary',\n\t\t'is-pressed': isPressed,\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && !! children,\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst tagProps =\n\t\tTag === 'a'\n\t\t\t? { href, target }\n\t\t\t: {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-pressed': isPressed,\n\t\t\t };\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\ttagProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event ) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.preventDefault();\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : null;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst element = (\n\t\t<Tag\n\t\t\t{ ...tagProps }\n\t\t\t{ ...additionalProps }\n\t\t\tclassName={ classes }\n\t\t\taria-label={ additionalProps[ 'aria-label' ] || label }\n\t\t\taria-describedby={ describedById }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</Tag>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ element }\n\t\t\t\t{ describedBy && (\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip\n\t\t\t\ttext={ describedBy ? describedBy : label }\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tposition={ tooltipPosition }\n\t\t\t>\n\t\t\t\t{ element }\n\t\t\t</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default forwardRef( Button );\n"]}
@@ -62,7 +62,7 @@ const styles = _reactNative.StyleSheet.create({
62
62
  },
63
63
  subscriptInactive: {
64
64
  color: '#7b9ab1',
65
- // $toolbar-button
65
+ // $toolbar-button.
66
66
  fontWeight: 'bold',
67
67
  fontSize: 13,
68
68
  alignSelf: 'flex-end',
@@ -70,7 +70,7 @@ const styles = _reactNative.StyleSheet.create({
70
70
  marginBottom
71
71
  },
72
72
  subscriptInactiveDark: {
73
- color: '#a7aaad' // $gray_20
73
+ color: '#a7aaad' // $gray_20.
74
74
 
75
75
  },
76
76
  subscriptActive: {
@@ -139,11 +139,11 @@ function Button(props) {
139
139
  }); // Should show the tooltip if...
140
140
 
141
141
 
142
- const shouldShowTooltip = !isDisabled && ( // an explicit tooltip is passed or...
143
- showTooltip && label || // there's a shortcut or...
144
- shortcut || // there's a label and...
145
- !!label && ( // the children are empty and...
146
- !children || (0, _lodash.isArray)(children) && !children.length) && // the tooltip is not explicitly disabled.
142
+ const shouldShowTooltip = !isDisabled && ( // An explicit tooltip is passed or...
143
+ showTooltip && label || // There's a shortcut or...
144
+ shortcut || // There's a label and...
145
+ !!label && ( // The children are empty and...
146
+ !children || (0, _lodash.isArray)(children) && !children.length) && // The tooltip is not explicitly disabled.
147
147
  false !== showTooltip);
148
148
  const newIcon = icon ? (0, _element.cloneElement)((0, _element.createElement)(_icon.default, {
149
149
  icon: icon,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","Children","map","child","colorScheme","shouldShowTooltip","length","newIcon","element"],"mappings":";;;;;;;;;;AAeA;;AAZA;;AAOA;;AAMA;;AAQA;;AACA;;AAzBA;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;AACA,MAAMC,YAAY,GAAGH,SAAS,GAAG,CAAC,GAAJ,GAAU,CAAxC;AACA,MAAMI,UAAU,GAAG,CAAC,CAApB;;AAEA,MAAMC,MAAM,GAAGC,wBAAWC,MAAX,CAAmB;AACjCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,OAAO,EAAE,CAFC;AAGVC,IAAAA,cAAc,EAAE,QAHN;AAIVC,IAAAA,UAAU,EAAE;AAJF,GADsB;AAOjCC,EAAAA,cAAc,EAAE;AACfJ,IAAAA,IAAI,EAAE,CADS;AAEfK,IAAAA,aAAa,EAAE,KAFA;AAGfH,IAAAA,cAAc,EAAE,QAHD;AAIfC,IAAAA,UAAU,EAAE;AAJG,GAPiB;AAajCG,EAAAA,UAAU,EAAE;AACXC,IAAAA,WAAW,EAAE;AADF,GAbqB;AAgBjCC,EAAAA,YAAY,EAAE;AACbR,IAAAA,IAAI,EAAE,CADO;AAEbK,IAAAA,aAAa,EAAE,KAFF;AAGbH,IAAAA,cAAc,EAAE,QAHH;AAIbC,IAAAA,UAAU,EAAE,QAJC;AAKbM,IAAAA,YAAY,EAAE,CALD;AAMbC,IAAAA,WAAW,EAAE,SANA;AAObC,IAAAA,eAAe,EAAE;AAPJ,GAhBmB;AAyBjCC,EAAAA,iBAAiB,EAAE;AAClBC,IAAAA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atform,\n} from 'react-native';\nimport { isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// an explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// there's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// there's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// the children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// the tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tonLongPress={ onLongPress }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t{ newIcon }\n\t\t\t\t\t{ newChildren }\n\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","Children","map","child","colorScheme","shouldShowTooltip","length","newIcon","element"],"mappings":";;;;;;;;;;AAeA;;AAZA;;AAOA;;AAMA;;AAQA;;AACA;;AAzBA;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;AACA,MAAMC,YAAY,GAAGH,SAAS,GAAG,CAAC,GAAJ,GAAU,CAAxC;AACA,MAAMI,UAAU,GAAG,CAAC,CAApB;;AAEA,MAAMC,MAAM,GAAGC,wBAAWC,MAAX,CAAmB;AACjCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,OAAO,EAAE,CAFC;AAGVC,IAAAA,cAAc,EAAE,QAHN;AAIVC,IAAAA,UAAU,EAAE;AAJF,GADsB;AAOjCC,EAAAA,cAAc,EAAE;AACfJ,IAAAA,IAAI,EAAE,CADS;AAEfK,IAAAA,aAAa,EAAE,KAFA;AAGfH,IAAAA,cAAc,EAAE,QAHD;AAIfC,IAAAA,UAAU,EAAE;AAJG,GAPiB;AAajCG,EAAAA,UAAU,EAAE;AACXC,IAAAA,WAAW,EAAE;AADF,GAbqB;AAgBjCC,EAAAA,YAAY,EAAE;AACbR,IAAAA,IAAI,EAAE,CADO;AAEbK,IAAAA,aAAa,EAAE,KAFF;AAGbH,IAAAA,cAAc,EAAE,QAHH;AAIbC,IAAAA,UAAU,EAAE,QAJC;AAKbM,IAAAA,YAAY,EAAE,CALD;AAMbC,IAAAA,WAAW,EAAE,SANA;AAObC,IAAAA,eAAe,EAAE;AAPJ,GAhBmB;AAyBjCC,EAAAA,iBAAiB,EAAE;AAClBC,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n\tPlatform,\n} from 'react-native';\nimport { isArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tonLongPress={ onLongPress }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t{ newIcon }\n\t\t\t\t\t{ newChildren }\n\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
@@ -45,7 +45,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
45
45
 
46
46
  /**
47
47
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props
48
- * @param {import('react').Ref<any>} forwardedRef
48
+ * @param {import('react').ForwardedRef<any>} forwardedRef
49
49
  */
50
50
  function Card(props, forwardedRef) {
51
51
  const {
@@ -60,7 +60,7 @@ function Card(props, forwardedRef) {
60
60
  const cx = (0, _useCx.useCx)();
61
61
  const elevationClassName = (0, _element.useMemo)(() => cx( /*#__PURE__*/(0, _react.css)({
62
62
  borderRadius: elevationBorderRadius
63
- }, process.env.NODE_ENV === "production" ? "" : ";label:elevationClassName;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY2FyZC9jYXJkL2NvbXBvbmVudC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q1kiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9jYXJkL2NhcmQvY29tcG9uZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG4vKipcbiAqIFdvcmRQcmVzcyBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgdXNlTWVtbyB9IGZyb20gJ0B3b3JkcHJlc3MvZWxlbWVudCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNvbnRleHRDb25uZWN0LCBDb250ZXh0U3lzdGVtUHJvdmlkZXIgfSBmcm9tICcuLi8uLi91aS9jb250ZXh0JztcbmltcG9ydCB7IEVsZXZhdGlvbiB9IGZyb20gJy4uLy4uL2VsZXZhdGlvbic7XG5pbXBvcnQgeyBWaWV3IH0gZnJvbSAnLi4vLi4vdmlldyc7XG5pbXBvcnQgKiBhcyBzdHlsZXMgZnJvbSAnLi4vc3R5bGVzJztcbmltcG9ydCB7IHVzZUNhcmQg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h0ZW5zaWJsZSBjb250ZW50IGNvbnRhaW5lci5cbiAqIGBDYXJkYCBhbHNvIHByb3ZpZGVzIGEgY29udmVuaWVudCBzZXQgb2Ygc3ViLWNvbXBvbmVudHMgc3VjaCBhcyBgQ2FyZEJvZHlgLFxuICogYENhcmRIZWFkZXJgLCBgQ2FyZEZvb3RlcmAsIGFuZCBtb3JlLlxuICpcbiAqIEBleGFtcGxlXG4gKiBgYGBqc3hcbiAqIGltcG9ydCB7XG4gKiAgIENhcmQsXG4gKiAgIENhcmRIZWFkZXIsXG4gKiAgIENhcmRCb2R5LFxuICogICBDYXJkRm9vdGVyLFxuICogICBUZXh0LFxuICogICBIZWFkaW5nLFxuICogfSBmcm9tIGBAd29yZHByZXNzL2NvbXBvbmVudHNgO1xuICpcbiAqIGZ1bmN0aW9uIEV4YW1wbGUoKSB7XG4gKiAgIHJldHVybiAoXG4gKiAgICAgPENhcmQ+XG4gKiAgICAgICA8Q2FyZEhlYWRlcj5cbiAqICAgICAgICAgPEhlYWRpbmcgc2l6ZT17IDQgfT5DYXJkIFRpdGxlPC9IZWFkaW5nPlxuICogICAgICAgPC9DYXJkSGVhZGVyPlxuICogICAgICAgPENhcmRCb2R5PlxuICogICAgICAgICA8VGV4dD5DYXJkIENvbnRlbnQ8L1RleHQ+XG4gKiAgICAgICA8L0NhcmRCb2R5PlxuICogICAgICAgPENhcmRGb290ZXI+XG4gKiAgICAgICAgIDxUZXh0PkNhcmQgRm9vdGVyPC9UZXh0PlxuICogICAgICAgPC9DYXJkRm9vdGVyPlxuICogICAgIDwvQ2FyZD5cbiAqICAgKTtcbiAqIH1cbiAqIGBgYFxuICovXG5jb25zdCBDb25uZWN0ZWRDYXJkID0gY29udGV4dENvbm5lY3QoIENhcmQsICdDYXJkJyApO1xuXG5leHBvcnQgZGVmYXVsdCBDb25uZWN0ZWRDYXJkO1xuIl19 */")), [cx, elevationBorderRadius]);
63
+ }, process.env.NODE_ENV === "production" ? "" : ";label:elevationClassName;", process.env.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cGxlXG4gKiBgYGBqc3hcbiAqIGltcG9ydCB7XG4gKiAgIENhcmQsXG4gKiAgIENhcmRIZWFkZXIsXG4gKiAgIENhcmRCb2R5LFxuICogICBDYXJkRm9vdGVyLFxuICogICBUZXh0LFxuICogICBIZWFkaW5nLFxuICogfSBmcm9tIGBAd29yZHByZXNzL2NvbXBvbmVudHNgO1xuICpcbiAqIGZ1bmN0aW9uIEV4YW1wbGUoKSB7XG4gKiAgIHJldHVybiAoXG4gKiAgICAgPENhcmQ+XG4gKiAgICAgICA8Q2FyZEhlYWRlcj5cbiAqICAgICAgICAgPEhlYWRpbmcgc2l6ZT17IDQgfT5DYXJkIFRpdGxlPC9IZWFkaW5nPlxuICogICAgICAgPC9DYXJkSGVhZGVyPlxuICogICAgICAgPENhcmRCb2R5PlxuICogICAgICAgICA8VGV4dD5DYXJkIENvbnRlbnQ8L1RleHQ+XG4gKiAgICAgICA8L0NhcmRCb2R5PlxuICogICAgICAgPENhcmRGb290ZXI+XG4gKiAgICAgICAgIDxUZXh0PkNhcmQgRm9vdGVyPC9UZXh0PlxuICogICAgICAgPC9DYXJkRm9vdGVyPlxuICogICAgIDwvQ2FyZD5cbiAqICAgKTtcbiAqIH1cbiAqIGBgYFxuICovXG5jb25zdCBDb25uZWN0ZWRDYXJkID0gY29udGV4dENvbm5lY3QoIENhcmQsICdDYXJkJyApO1xuXG5leHBvcnQgZGVmYXVsdCBDb25uZWN0ZWRDYXJkO1xuIl19 */")), [cx, elevationBorderRadius]);
64
64
  const contextProviderValue = (0, _element.useMemo)(() => {
65
65
  const contextProps = {
66
66
  size,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card/component.js"],"names":["Card","props","forwardedRef","children","elevation","isBorderless","isRounded","size","otherProps","elevationBorderRadius","CONFIG","cardBorderRadius","cx","elevationClassName","borderRadius","contextProviderValue","contextProps","CardBody","CardHeader","CardFooter","styles","Content","ConnectedCard"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAU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AAG,CAAH,GAAO;AAHzB,IAFD,EAOC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAGS,kBADb;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,KAAK,EAAGT;AAHT,IAPD,CADD,CADD;AAiBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMkB,aAAa,GAAG,6BAAgBtB,IAAhB,EAAsB,MAAtB,CAAtB;eAEesB,a","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, ContextSystemProvider } from '../../ui/context';\nimport { Elevation } from '../../elevation';\nimport { View } from '../../view';\nimport * as styles from '../styles';\nimport { useCard } from './hook';\nimport CONFIG from '../../utils/config-values';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction Card( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tisBorderless,\n\t\tisRounded,\n\t\tsize,\n\t\t...otherProps\n\t} = useCard( props );\n\tconst elevationBorderRadius = isRounded ? CONFIG.cardBorderRadius : 0;\n\n\tconst cx = useCx();\n\n\tconst elevationClassName = useMemo(\n\t\t() => cx( css( { borderRadius: elevationBorderRadius } ) ),\n\t\t[ cx, elevationBorderRadius ]\n\t);\n\n\tconst contextProviderValue = useMemo( () => {\n\t\tconst contextProps = {\n\t\t\tsize,\n\t\t\tisBorderless,\n\t\t};\n\t\treturn {\n\t\t\tCardBody: contextProps,\n\t\t\tCardHeader: contextProps,\n\t\t\tCardFooter: contextProps,\n\t\t};\n\t}, [ isBorderless, size ] );\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextProviderValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t\t<View className={ cx( styles.Content ) }>{ children }</View>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation ? 1 : 0 }\n\t\t\t\t/>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * `Card` provides a flexible and extensible content container.\n * `Card` also provides a convenient set of sub-components such as `CardBody`,\n * `CardHeader`, `CardFooter`, and more.\n *\n * @example\n * ```jsx\n * import {\n * Card,\n * CardHeader,\n * CardBody,\n * CardFooter,\n * Text,\n * Heading,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * return (\n * <Card>\n * <CardHeader>\n * <Heading size={ 4 }>Card Title</Heading>\n * </CardHeader>\n * <CardBody>\n * <Text>Card Content</Text>\n * </CardBody>\n * <CardFooter>\n * <Text>Card Footer</Text>\n * </CardFooter>\n * </Card>\n * );\n * }\n * ```\n */\nconst ConnectedCard = contextConnect( Card, 'Card' );\n\nexport default ConnectedCard;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card/component.js"],"names":["Card","props","forwardedRef","children","elevation","isBorderless","isRounded","size","otherProps","elevationBorderRadius","CONFIG","cardBorderRadius","cx","elevationClassName","borderRadius","contextProviderValue","contextProps","CardBody","CardHeader","CardFooter","styles","Content","ConnectedCard"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA,SAASA,IAAT,CAAeC,KAAf,EAAsBC,YA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D;AAiBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMkB,aAAa,GAAG,6BAAgBtB,IAAhB,EAAsB,MAAtB,CAAtB;eAEesB,a","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, ContextSystemProvider } from '../../ui/context';\nimport { Elevation } from '../../elevation';\nimport { View } from '../../view';\nimport * as styles from '../styles';\nimport { useCard } from './hook';\nimport CONFIG from '../../utils/config-values';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction Card( props, forwardedRef ) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tisBorderless,\n\t\tisRounded,\n\t\tsize,\n\t\t...otherProps\n\t} = useCard( props );\n\tconst elevationBorderRadius = isRounded ? CONFIG.cardBorderRadius : 0;\n\n\tconst cx = useCx();\n\n\tconst elevationClassName = useMemo(\n\t\t() => cx( css( { borderRadius: elevationBorderRadius } ) ),\n\t\t[ cx, elevationBorderRadius ]\n\t);\n\n\tconst contextProviderValue = useMemo( () => {\n\t\tconst contextProps = {\n\t\t\tsize,\n\t\t\tisBorderless,\n\t\t};\n\t\treturn {\n\t\t\tCardBody: contextProps,\n\t\t\tCardHeader: contextProps,\n\t\t\tCardFooter: contextProps,\n\t\t};\n\t}, [ isBorderless, size ] );\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextProviderValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t\t<View className={ cx( styles.Content ) }>{ children }</View>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation ? 1 : 0 }\n\t\t\t\t/>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * `Card` provides a flexible and extensible content container.\n * `Card` also provides a convenient set of sub-components such as `CardBody`,\n * `CardHeader`, `CardFooter`, and more.\n *\n * @example\n * ```jsx\n * import {\n * Card,\n * CardHeader,\n * CardBody,\n * CardFooter,\n * Text,\n * Heading,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * return (\n * <Card>\n * <CardHeader>\n * <Heading size={ 4 }>Card Title</Heading>\n * </CardHeader>\n * <CardBody>\n * <Text>Card Content</Text>\n * </CardBody>\n * <CardFooter>\n * <Text>Card Footer</Text>\n * </CardFooter>\n * </Card>\n * );\n * }\n * ```\n */\nconst ConnectedCard = contextConnect( Card, 'Card' );\n\nexport default ConnectedCard;\n"]}
@@ -25,7 +25,7 @@ var _hook = require("./hook");
25
25
 
26
26
  /**
27
27
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props
28
- * @param {import('react').Ref<any>} forwardedRef
28
+ * @param {import('react').ForwardedRef<any>} forwardedRef
29
29
  */
30
30
  function CardBody(props, forwardedRef) {
31
31
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card-body/component.js"],"names":["CardBody","props","forwardedRef","isScrollable","otherProps","ConnectedCardBody"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAyC;AACxC,QAAM;AAAEC,IAAAA,YAAF;AAAgB,OAAGC;AAAnB,MAAkC,uBAAaH,KAAb,CAAxC;;AAEA,MAAKE,YAAL,EAAoB;AACnB,WAAO,4BAAC,sBAAD,6BAAiBC,UAAjB;AAA8B,MAAA,GAAG,EAAGF;AAApC,OAAP;AACA;;AAED,SAAO,4BAAC,UAAD,6BAAWE,UAAX;AAAwB,IAAA,GAAG,EAAGF;AAA9B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,iBAAiB,GAAG,6BAAgBL,QAAhB,EAA0B,UAA1B,CAA1B;eAEeK,iB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Scrollable } from '../../scrollable';\nimport { View } from '../../view';\nimport { useCardBody } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction CardBody( props, forwardedRef ) {\n\tconst { isScrollable, ...otherProps } = useCardBody( props );\n\n\tif ( isScrollable ) {\n\t\treturn <Scrollable { ...otherProps } ref={ forwardedRef } />;\n\t}\n\n\treturn <View { ...otherProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardBody` renders an optional content area for a `Card`.\n * Multiple `CardBody` components can be used within `Card` if needed.\n *\n * @example\n * ```jsx\n * import { Card, CardBody } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardBody>\n * \t\t...\n * \t</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardBody = contextConnect( CardBody, 'CardBody' );\n\nexport default ConnectedCardBody;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card-body/component.js"],"names":["CardBody","props","forwardedRef","isScrollable","otherProps","ConnectedCardBody"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,KAAnB,EAA0BC,YAA1B,EAAyC;AACxC,QAAM;AAAEC,IAAAA,YAAF;AAAgB,OAAGC;AAAnB,MAAkC,uBAAaH,KAAb,CAAxC;;AAEA,MAAKE,YAAL,EAAoB;AACnB,WAAO,4BAAC,sBAAD,6BAAiBC,UAAjB;AAA8B,MAAA,GAAG,EAAGF;AAApC,OAAP;AACA;;AAED,SAAO,4BAAC,UAAD,6BAAWE,UAAX;AAAwB,IAAA,GAAG,EAAGF;AAA9B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,iBAAiB,GAAG,6BAAgBL,QAAhB,EAA0B,UAA1B,CAA1B;eAEeK,iB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Scrollable } from '../../scrollable';\nimport { View } from '../../view';\nimport { useCardBody } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').BodyProps, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction CardBody( props, forwardedRef ) {\n\tconst { isScrollable, ...otherProps } = useCardBody( props );\n\n\tif ( isScrollable ) {\n\t\treturn <Scrollable { ...otherProps } ref={ forwardedRef } />;\n\t}\n\n\treturn <View { ...otherProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardBody` renders an optional content area for a `Card`.\n * Multiple `CardBody` components can be used within `Card` if needed.\n *\n * @example\n * ```jsx\n * import { Card, CardBody } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardBody>\n * \t\t...\n * \t</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardBody = contextConnect( CardBody, 'CardBody' );\n\nexport default ConnectedCardBody;\n"]}
@@ -23,7 +23,7 @@ var _hook = require("./hook");
23
23
 
24
24
  /**
25
25
  * @param {import('../../ui/context').WordPressComponentProps<import('../../divider').DividerProps, 'hr', false>} props
26
- * @param {import('react').Ref<any>} forwardedRef
26
+ * @param {import('react').ForwardedRef<any>} forwardedRef
27
27
  */
28
28
  function CardDivider(props, forwardedRef) {
29
29
  const dividerProps = (0, _hook.useCardDivider)(props);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card-divider/component.js"],"names":["CardDivider","props","forwardedRef","dividerProps","ConnectedCardDivider"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,WAAT,CAAsBC,KAAtB,EAA6BC,YAA7B,EAA4C;AAC3C,QAAMC,YAAY,GAAG,0BAAgBF,KAAhB,CAArB;AAEA,SAAO,4BAAC,gBAAD,6BAAcE,YAAd;AAA6B,IAAA,GAAG,EAAGD;AAAnC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,oBAAoB,GAAG,6BAAgBJ,WAAhB,EAA6B,aAA7B,CAA7B;eAEeI,oB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Divider } from '../../divider';\nimport { useCardDivider } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../../divider').DividerProps, 'hr', false>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction CardDivider( props, forwardedRef ) {\n\tconst dividerProps = useCardDivider( props );\n\n\treturn <Divider { ...dividerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardDivider` renders an optional divider within a `Card`.\n * It is typically used to divide multiple `CardBody` components from each other.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardDivider } from `@wordpress/components`;\n *\n * <Card>\n * <CardBody>...</CardBody>\n * <CardDivider />\n * <CardBody>...</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardDivider = contextConnect( CardDivider, 'CardDivider' );\n\nexport default ConnectedCardDivider;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card-divider/component.js"],"names":["CardDivider","props","forwardedRef","dividerProps","ConnectedCardDivider"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,WAAT,CAAsBC,KAAtB,EAA6BC,YAA7B,EAA4C;AAC3C,QAAMC,YAAY,GAAG,0BAAgBF,KAAhB,CAArB;AAEA,SAAO,4BAAC,gBAAD,6BAAcE,YAAd;AAA6B,IAAA,GAAG,EAAGD;AAAnC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,oBAAoB,GAAG,6BAAgBJ,WAAhB,EAA6B,aAA7B,CAA7B;eAEeI,oB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Divider } from '../../divider';\nimport { useCardDivider } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../../divider').DividerProps, 'hr', false>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction CardDivider( props, forwardedRef ) {\n\tconst dividerProps = useCardDivider( props );\n\n\treturn <Divider { ...dividerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardDivider` renders an optional divider within a `Card`.\n * It is typically used to divide multiple `CardBody` components from each other.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardDivider } from `@wordpress/components`;\n *\n * <Card>\n * <CardBody>...</CardBody>\n * <CardDivider />\n * <CardBody>...</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardDivider = contextConnect( CardDivider, 'CardDivider' );\n\nexport default ConnectedCardDivider;\n"]}
@@ -23,7 +23,7 @@ var _hook = require("./hook");
23
23
 
24
24
  /**
25
25
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').FooterProps, 'div'>} props
26
- * @param {import('react').Ref<any>} forwardedRef
26
+ * @param {import('react').ForwardedRef<any>} forwardedRef
27
27
  */
28
28
  function CardFooter(props, forwardedRef) {
29
29
  const footerProps = (0, _hook.useCardFooter)(props);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card-footer/component.js"],"names":["CardFooter","props","forwardedRef","footerProps","ConnectedCardFooter"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,UAAT,CAAqBC,KAArB,EAA4BC,YAA5B,EAA2C;AAC1C,QAAMC,WAAW,GAAG,yBAAeF,KAAf,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,mBAAmB,GAAG,6BAAgBJ,UAAhB,EAA4B,YAA5B,CAA5B;eAEeI,mB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Flex } from '../../flex';\nimport { useCardFooter } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').FooterProps, 'div'>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction CardFooter( props, forwardedRef ) {\n\tconst footerProps = useCardFooter( props );\n\n\treturn <Flex { ...footerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardFooter` renders an optional footer within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardFooter } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardBody>...</CardBody>\n * \t<CardFooter>...</CardFooter>\n * </Card>\n * ```\n */\nconst ConnectedCardFooter = contextConnect( CardFooter, 'CardFooter' );\n\nexport default ConnectedCardFooter;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card-footer/component.js"],"names":["CardFooter","props","forwardedRef","footerProps","ConnectedCardFooter"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,UAAT,CAAqBC,KAArB,EAA4BC,YAA5B,EAA2C;AAC1C,QAAMC,WAAW,GAAG,yBAAeF,KAAf,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,mBAAmB,GAAG,6BAAgBJ,UAAhB,EAA4B,YAA5B,CAA5B;eAEeI,mB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Flex } from '../../flex';\nimport { useCardFooter } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').FooterProps, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction CardFooter( props, forwardedRef ) {\n\tconst footerProps = useCardFooter( props );\n\n\treturn <Flex { ...footerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardFooter` renders an optional footer within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardFooter } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardBody>...</CardBody>\n * \t<CardFooter>...</CardFooter>\n * </Card>\n * ```\n */\nconst ConnectedCardFooter = contextConnect( CardFooter, 'CardFooter' );\n\nexport default ConnectedCardFooter;\n"]}
@@ -23,7 +23,7 @@ var _hook = require("./hook");
23
23
 
24
24
  /**
25
25
  * @param {import('../../ui/context').WordPressComponentProps<import('../types').HeaderProps, 'div'>} props
26
- * @param {import('react').Ref<any>} forwardedRef
26
+ * @param {import('react').ForwardedRef<any>} forwardedRef
27
27
  */
28
28
  function CardHeader(props, forwardedRef) {
29
29
  const headerProps = (0, _hook.useCardHeader)(props);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card-header/component.js"],"names":["CardHeader","props","forwardedRef","headerProps","ConnectedCardHeader"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,UAAT,CAAqBC,KAArB,EAA4BC,YAA5B,EAA2C;AAC1C,QAAMC,WAAW,GAAG,yBAAeF,KAAf,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,mBAAmB,GAAG,6BAAgBJ,UAAhB,EAA4B,YAA5B,CAA5B;eAEeI,mB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Flex } from '../../flex';\nimport { useCardHeader } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').HeaderProps, 'div'>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction CardHeader( props, forwardedRef ) {\n\tconst headerProps = useCardHeader( props );\n\n\treturn <Flex { ...headerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardHeader` renders an optional header within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardHeader } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardHeader>...</CardHeader>\n * \t<CardBody>...</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardHeader = contextConnect( CardHeader, 'CardHeader' );\n\nexport default ConnectedCardHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card-header/component.js"],"names":["CardHeader","props","forwardedRef","headerProps","ConnectedCardHeader"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,UAAT,CAAqBC,KAArB,EAA4BC,YAA5B,EAA2C;AAC1C,QAAMC,WAAW,GAAG,yBAAeF,KAAf,CAApB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,WAAX;AAAyB,IAAA,GAAG,EAAGD;AAA/B,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,mBAAmB,GAAG,6BAAgBJ,UAAhB,EAA4B,YAA5B,CAA5B;eAEeI,mB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { Flex } from '../../flex';\nimport { useCardHeader } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<import('../types').HeaderProps, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction CardHeader( props, forwardedRef ) {\n\tconst headerProps = useCardHeader( props );\n\n\treturn <Flex { ...headerProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardHeader` renders an optional header within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardHeader } from `@wordpress/components`;\n *\n * <Card>\n * \t<CardHeader>...</CardHeader>\n * \t<CardBody>...</CardBody>\n * </Card>\n * ```\n */\nconst ConnectedCardHeader = contextConnect( CardHeader, 'CardHeader' );\n\nexport default ConnectedCardHeader;\n"]}
@@ -23,7 +23,7 @@ var _hook = require("./hook");
23
23
 
24
24
  /**
25
25
  * @param {import('../../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props
26
- * @param {import('react').Ref<any>} forwardedRef
26
+ * @param {import('react').ForwardedRef<any>} forwardedRef
27
27
  */
28
28
  function CardMedia(props, forwardedRef) {
29
29
  const cardMediaProps = (0, _hook.useCardMedia)(props);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/card/card-media/component.js"],"names":["CardMedia","props","forwardedRef","cardMediaProps","ConnectedCardMedia"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,SAAT,CAAoBC,KAApB,EAA2BC,YAA3B,EAA0C;AACzC,QAAMC,cAAc,GAAG,wBAAcF,KAAd,CAAvB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,cAAX;AAA4B,IAAA,GAAG,EAAGD;AAAlC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,kBAAkB,GAAG,6BAAgBJ,SAAhB,EAA2B,WAA3B,CAA3B;eAEeI,kB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { View } from '../../view';\nimport { useCardMedia } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props\n * @param {import('react').Ref<any>} forwardedRef\n */\nfunction CardMedia( props, forwardedRef ) {\n\tconst cardMediaProps = useCardMedia( props );\n\n\treturn <View { ...cardMediaProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardMedia` provides a container for media elements within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardMedia } from '@wordpress/components';\n *\n * const Example = () => (\n * <Card>\n *\t <CardMedia>\n *\t\t <img src=\"...\" />\n * </CardMedia>\n * <CardBody>...</CardBody>\n * </Card>\n * );\n * ```\n */\nconst ConnectedCardMedia = contextConnect( CardMedia, 'CardMedia' );\n\nexport default ConnectedCardMedia;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/card/card-media/component.js"],"names":["CardMedia","props","forwardedRef","cardMediaProps","ConnectedCardMedia"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA,SAASA,SAAT,CAAoBC,KAApB,EAA2BC,YAA3B,EAA0C;AACzC,QAAMC,cAAc,GAAG,wBAAcF,KAAd,CAAvB;AAEA,SAAO,4BAAC,UAAD,6BAAWE,cAAX;AAA4B,IAAA,GAAG,EAAGD;AAAlC,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,kBAAkB,GAAG,6BAAgBJ,SAAhB,EAA2B,WAA3B,CAA3B;eAEeI,kB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { contextConnect } from '../../ui/context';\nimport { View } from '../../view';\nimport { useCardMedia } from './hook';\n\n/**\n * @param {import('../../ui/context').WordPressComponentProps<{ children: import('react').ReactNode }, 'div'>} props\n * @param {import('react').ForwardedRef<any>} forwardedRef\n */\nfunction CardMedia( props, forwardedRef ) {\n\tconst cardMediaProps = useCardMedia( props );\n\n\treturn <View { ...cardMediaProps } ref={ forwardedRef } />;\n}\n\n/**\n * `CardMedia` provides a container for media elements within a `Card`.\n *\n * @example\n * ```jsx\n * import { Card, CardBody, CardMedia } from '@wordpress/components';\n *\n * const Example = () => (\n * <Card>\n *\t <CardMedia>\n *\t\t <img src=\"...\" />\n * </CardMedia>\n * <CardBody>...</CardBody>\n * </Card>\n * );\n * ```\n */\nconst ConnectedCardMedia = contextConnect( CardMedia, 'CardMedia' );\n\nexport default ConnectedCardMedia;\n"]}
@@ -41,6 +41,7 @@ let customIndicatorWidth = 0;
41
41
 
42
42
  function ColorPalette(_ref) {
43
43
  let {
44
+ enableCustomColor = true,
44
45
  setColor,
45
46
  activeColor,
46
47
  isGradientColor,
@@ -52,7 +53,8 @@ function ColorPalette(_ref) {
52
53
  shouldShowCustomLabel = true,
53
54
  shouldShowCustomVerticalSeparator = true,
54
55
  customColorIndicatorStyles,
55
- customIndicatorWrapperStyles
56
+ customIndicatorWrapperStyles,
57
+ label
56
58
  } = _ref;
57
59
  const customSwatchGradients = ['linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)', 'linear-gradient(240deg, rgba(0,255,0,.8) 0%, rgba(0,255,0,0) 70.71%)', 'linear-gradient(360deg, rgba(0,0,255,.8) 0%, rgba(0,0,255,0) 70.71%)'];
58
60
  const scrollViewRef = (0, _element.useRef)();
@@ -61,11 +63,12 @@ function ColorPalette(_ref) {
61
63
  const scale = (0, _element.useRef)(new _reactNative.Animated.Value(1)).current;
62
64
  const opacity = (0, _element.useRef)(new _reactNative.Animated.Value(1)).current;
63
65
  const defaultColors = (0, _lodash.uniq)((0, _lodash.map)(defaultSettings.colors, 'color'));
66
+ const mergedColors = (0, _lodash.uniq)((0, _lodash.map)(defaultSettings.allColors, 'color'));
64
67
  const defaultGradientColors = (0, _lodash.uniq)((0, _lodash.map)(defaultSettings.gradients, 'gradient'));
65
68
  const colors = isGradientSegment ? defaultGradientColors : defaultColors;
66
69
  const customIndicatorColor = isGradientSegment ? activeColor : customSwatchGradients;
67
70
  const isCustomGradientColor = isGradientColor && isSelectedCustom();
68
- const shouldShowCustomIndicator = shouldShowCustomIndicatorOption && (!isGradientSegment || isCustomGradientColor);
71
+ const shouldShowCustomIndicator = enableCustomColor && shouldShowCustomIndicatorOption && (!isGradientSegment || isCustomGradientColor);
69
72
  const accessibilityHint = isGradientSegment ? (0, _i18n.__)('Navigates to customize the gradient') : (0, _i18n.__)('Navigates to custom color picker');
70
73
  const customText = (0, _i18n.__)('Custom');
71
74
  (0, _element.useEffect)(() => {
@@ -82,9 +85,9 @@ function ColorPalette(_ref) {
82
85
  }, [currentSegment]);
83
86
 
84
87
  function isSelectedCustom() {
85
- const isWithinColors = activeColor && colors && colors.includes(activeColor);
88
+ const isWithinColors = activeColor && mergedColors && mergedColors.includes(activeColor);
86
89
 
87
- if (activeColor) {
90
+ if (enableCustomColor && activeColor) {
88
91
  if (isGradientSegment) {
89
92
  return isGradientColor && !isWithinColors;
90
93
  }
@@ -191,9 +194,11 @@ function ColorPalette(_ref) {
191
194
  const verticalSeparatorStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.verticalSeparator, _style.default.verticalSeparatorDark);
192
195
  const customTextStyle = (0, _compose.usePreferredColorSchemeStyle)([_style.default.customText, !isIOS && _style.default.customTextAndroid], _style.default.customTextDark);
193
196
  const customIndicatorWrapperStyle = [_style.default.customIndicatorWrapper, customIndicatorWrapperStyles];
194
- return (0, _element.createElement)(_reactNative.ScrollView, {
197
+ return (0, _element.createElement)(_element.Fragment, null, label && (0, _element.createElement)(_reactNative.Text, {
198
+ accessibilityRole: "header",
199
+ style: _style.default.headerText
200
+ }, label), (0, _element.createElement)(_reactNative.ScrollView, {
195
201
  contentContainerStyle: _style.default.contentContainer,
196
- style: _style.default.container,
197
202
  horizontal: true,
198
203
  showsHorizontalScrollIndicator: false,
199
204
  keyboardShouldPersistTaps: "always",
@@ -204,29 +209,8 @@ function ColorPalette(_ref) {
204
209
  onScrollBeginDrag: () => shouldEnableBottomSheetScroll(false),
205
210
  onScrollEndDrag: () => shouldEnableBottomSheetScroll(true),
206
211
  ref: scrollViewRef,
207
- testID: "color-palette"
208
- }, shouldShowCustomIndicator && (0, _element.createElement)(_reactNative.View, {
209
- style: customIndicatorWrapperStyle,
210
- onLayout: onCustomIndicatorLayout
211
- }, shouldShowCustomVerticalSeparator && (0, _element.createElement)(_reactNative.View, {
212
- style: verticalSeparatorStyle
213
- }), (0, _element.createElement)(_reactNative.TouchableWithoutFeedback, {
214
- onPress: onCustomPress,
215
- accessibilityRole: 'button',
216
- accessibilityState: {
217
- selected: isSelectedCustom()
218
- },
219
- accessibilityHint: accessibilityHint
220
- }, (0, _element.createElement)(_reactNative.View, {
221
- style: customIndicatorWrapperStyle
222
- }, (0, _element.createElement)(_colorIndicator.default, {
223
- withCustomPicker: !isGradientSegment,
224
- color: customIndicatorColor,
225
- isSelected: isSelectedCustom(),
226
- style: [_style.default.colorIndicator, customColorIndicatorStyles]
227
- }), shouldShowCustomLabel && (0, _element.createElement)(_reactNative.Text, {
228
- style: customTextStyle
229
- }, isIOS ? customText : customText.toUpperCase())))), colors.map(color => {
212
+ testID: `color-palette${label ? '-' + label : ''}`
213
+ }, colors.map(color => {
230
214
  const scaleValue = isSelected(color) ? scaleInterpolation : 1;
231
215
  return (0, _element.createElement)(_reactNative.View, {
232
216
  key: `${color}-${isSelected(color)}`
@@ -250,7 +234,28 @@ function ColorPalette(_ref) {
250
234
  opacity: opacity,
251
235
  style: [_style.default.colorIndicator, customColorIndicatorStyles]
252
236
  }))));
253
- }));
237
+ }), shouldShowCustomIndicator && (0, _element.createElement)(_reactNative.View, {
238
+ style: customIndicatorWrapperStyle,
239
+ onLayout: onCustomIndicatorLayout
240
+ }, shouldShowCustomVerticalSeparator && (0, _element.createElement)(_reactNative.View, {
241
+ style: verticalSeparatorStyle
242
+ }), (0, _element.createElement)(_reactNative.TouchableWithoutFeedback, {
243
+ onPress: onCustomPress,
244
+ accessibilityRole: 'button',
245
+ accessibilityState: {
246
+ selected: isSelectedCustom()
247
+ },
248
+ accessibilityHint: accessibilityHint
249
+ }, (0, _element.createElement)(_reactNative.View, {
250
+ style: customIndicatorWrapperStyle
251
+ }, (0, _element.createElement)(_colorIndicator.default, {
252
+ withCustomPicker: !isGradientSegment,
253
+ color: customIndicatorColor,
254
+ isSelected: isSelectedCustom(),
255
+ style: [_style.default.colorIndicator, customColorIndicatorStyles]
256
+ }), shouldShowCustomLabel && (0, _element.createElement)(_reactNative.Text, {
257
+ style: customTextStyle
258
+ }, isIOS ? customText : customText.toUpperCase()))))));
254
259
  }
255
260
 
256
261
  var _default = ColorPalette;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/color-palette/index.native.js"],"names":["ANIMATION_DURATION","contentWidth","scrollPosition","customIndicatorWidth","ColorPalette","setColor","activeColor","isGradientColor","defaultSettings","currentSegment","onCustomPress","shouldEnableBottomSheetScroll","shouldShowCustomIndicatorOption","shouldShowCustomLabel","shouldShowCustomVerticalSeparator","customColorIndicatorStyles","customIndicatorWrapperStyles","customSwatchGradients","scrollViewRef","isIOS","Platform","OS","isGradientSegment","colorsUtils","segments","scale","Animated","Value","current","opacity","defaultColors","colors","defaultGradientColors","gradients","customIndicatorColor","isCustomGradientColor","isSelectedCustom","shouldShowCustomIndicator","accessibilityHint","customText","scrollToEndWithDelay","scrollTo","x","y","isWithinColors","includes","isSelected","color","timingAnimation","property","toValue","timing","duration","easing","Easing","ease","useNativeDriver","performAnimation","setValue","parallel","start","scaleInterpolation","interpolate","inputRange","outputRange","deselectCustomGradient","width","Dimensions","get","isVisible","onColorPress","onContentSizeChange","delayedScroll","setTimeout","scrollToEnd","clearTimeout","onCustomIndicatorLayout","nativeEvent","layout","onScroll","contentOffset","verticalSeparatorStyle","styles","verticalSeparator","verticalSeparatorDark","customTextStyle","customTextAndroid","customTextDark","customIndicatorWrapperStyle","customIndicatorWrapper","contentContainer","container","selected","colorIndicator","toUpperCase","map","scaleValue","transform"],"mappings":";;;;;;;;;AAmBA;;AAhBA;;AAUA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAaA;AACA;AACA;;AAKA;AACA;AACA;AAKA,MAAMA,kBAAkB,GAAG,GAA3B;AAEA,IAAIC,YAAY,GAAG,CAAnB;AACA,IAAIC,cAAc,GAAG,CAArB;AACA,IAAIC,oBAAoB,GAAG,CAA3B;;AAEA,SAASC,YAAT,OAaI;AAAA,MAbmB;AACtBC,IAAAA,QADsB;AAEtBC,IAAAA,WAFsB;AAGtBC,IAAAA,eAHsB;AAItBC,IAAAA,eAJsB;AAKtBC,IAAAA,cALsB;AAMtBC,IAAAA,aANsB;AAOtBC,IAAAA,6BAPsB;AAQtBC,IAAAA,+BAA+B,GAAG,IARZ;AAStBC,IAAAA,qBAAqB,GAAG,IATF;AAUtBC,IAAAA,iCAAiC,GAAG,IAVd;AAWtBC,IAAAA,0BAXsB;AAYtBC,IAAAA;AAZsB,GAanB;AACH,QAAMC,qBAAqB,GAAG,CAC7B,0EAD6B,EAE7B,sEAF6B,EAG7B,sEAH6B,CAA9B;AAMA,QAAMC,aAAa,GAAG,sBAAtB;AACA,QAAMC,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;AAEA,QAAMC,iBAAiB,GAAGb,cAAc,KAAKc,mBAAYC,QAAZ,CAAsB,CAAtB,CAA7C;AAEA,QAAMC,KAAK,GAAG,qBAAQ,IAAIC,sBAASC,KAAb,CAAoB,CAApB,CAAR,EAAkCC,OAAhD;AACA,QAAMC,OAAO,GAAG,qBAAQ,IAAIH,sBAASC,KAAb,CAAoB,CA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rollView,\n\tTouchableWithoutFeedback,\n\tView,\n\tAnimated,\n\tEasing,\n\tDimensions,\n\tPlatform,\n\tText,\n} from 'react-native';\nimport { map, uniq } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport ColorIndicator from '../color-indicator';\nimport { colorsUtils } from '../mobile/color-settings/utils';\n\nconst ANIMATION_DURATION = 200;\n\nlet contentWidth = 0;\nlet scrollPosition = 0;\nlet customIndicatorWidth = 0;\n\nfunction ColorPalette( {\n\tsetColor,\n\tactiveColor,\n\tisGradientColor,\n\tdefaultSettings,\n\tcurrentSegment,\n\tonCustomPress,\n\tshouldEnableBottomSheetScroll,\n\tshouldShowCustomIndicatorOption = true,\n\tshouldShowCustomLabel = true,\n\tshouldShowCustomVerticalSeparator = true,\n\tcustomColorIndicatorStyles,\n\tcustomIndicatorWrapperStyles,\n} ) {\n\tconst customSwatchGradients = [\n\t\t'linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)',\n\t\t'linear-gradient(240deg, rgba(0,255,0,.8) 0%, rgba(0,255,0,0) 70.71%)',\n\t\t'linear-gradient(360deg, rgba(0,0,255,.8) 0%, rgba(0,0,255,0) 70.71%)',\n\t];\n\n\tconst scrollViewRef = useRef();\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst isGradientSegment = currentSegment === colorsUtils.segments[ 1 ];\n\n\tconst scale = useRef( new Animated.Value( 1 ) ).current;\n\tconst opacity = useRef( new Animated.Value( 1 ) ).current;\n\n\tconst defaultColors = uniq( map( defaultSettings.colors, 'color' ) );\n\tconst defaultGradientColors = uniq(\n\t\tmap( defaultSettings.gradients, 'gradient' )\n\t);\n\tconst colors = isGradientSegment ? defaultGradientColors : defaultColors;\n\n\tconst customIndicatorColor = isGradientSegment\n\t\t? activeColor\n\t\t: customSwatchGradients;\n\tconst isCustomGradientColor = isGradientColor && isSelectedCustom();\n\tconst shouldShowCustomIndicator =\n\t\tshouldShowCustomIndicatorOption &&\n\t\t( ! isGradientSegment || isCustomGradientColor );\n\n\tconst accessibilityHint = isGradientSegment\n\t\t? __( 'Navigates to customize the gradient' )\n\t\t: __( 'Navigates to custom color picker' );\n\tconst customText = __( 'Custom' );\n\n\tuseEffect( () => {\n\t\tif ( scrollViewRef.current ) {\n\t\t\tif ( isSelectedCustom() ) {\n\t\t\t\tscrollToEndWithDelay();\n\t\t\t} else {\n\t\t\t\tscrollViewRef.current.scrollTo( { x: 0, y: 0 } );\n\t\t\t}\n\t\t}\n\t}, [ currentSegment ] );\n\n\tfunction isSelectedCustom() {\n\t\tconst isWithinColors =\n\t\t\tactiveColor && colors && colors.includes( activeColor );\n\t\tif ( activeColor ) {\n\t\t\tif ( isGradientSegment ) {\n\t\t\t\treturn isGradientColor && ! isWithinColors;\n\t\t\t}\n\t\t\treturn ! isGradientColor && ! isWithinColors;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction isSelected( color ) {\n\t\treturn ! isSelectedCustom() && activeColor === color;\n\t}\n\n\tfunction timingAnimation( property, toValue ) {\n\t\treturn Animated.timing( property, {\n\t\t\ttoValue,\n\t\t\tduration: ANIMATION_DURATION,\n\t\t\teasing: Easing.ease,\n\t\t\tuseNativeDriver: true,\n\t\t} );\n\t}\n\n\tfunction performAnimation( color ) {\n\t\tif ( ! isSelected( color ) ) {\n\t\t\topacity.setValue( 0 );\n\t\t}\n\n\t\tAnimated.parallel( [\n\t\t\ttimingAnimation( scale, 2 ),\n\t\t\ttimingAnimation( opacity, 1 ),\n\t\t] ).start( () => {\n\t\t\topacity.setValue( 1 );\n\t\t\tscale.setValue( 1 );\n\t\t} );\n\t}\n\n\tconst scaleInterpolation = scale.interpolate( {\n\t\tinputRange: [ 1, 1.5, 2 ],\n\t\toutputRange: [ 1, 0.7, 1 ],\n\t} );\n\n\tfunction deselectCustomGradient() {\n\t\tconst { width } = Dimensions.get( 'window' );\n\t\tconst isVisible =\n\t\t\tcontentWidth - scrollPosition - customIndicatorWidth < width;\n\n\t\tif ( isCustomGradientColor ) {\n\t\t\tif ( ! isIOS ) {\n\t\t\t\t// Scroll position on Android doesn't adjust automatically when removing the last item from the horizontal list.\n\t\t\t\t// https://github.com/facebook/react-native/issues/27504\n\t\t\t\t// Workaround: Force the scroll when deselecting custom gradient color and when custom indicator is visible on layout.\n\t\t\t\tif (\n\t\t\t\t\tisCustomGradientColor &&\n\t\t\t\t\tisVisible &&\n\t\t\t\t\tscrollViewRef.current\n\t\t\t\t) {\n\t\t\t\t\tscrollViewRef.current.scrollTo( {\n\t\t\t\t\t\tx: scrollPosition - customIndicatorWidth,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction onColorPress( color ) {\n\t\tdeselectCustomGradient();\n\t\tperformAnimation( color );\n\t\tsetColor( color );\n\t}\n\n\tfunction onContentSizeChange( width ) {\n\t\tcontentWidth = width;\n\t\tif ( isSelectedCustom() && scrollViewRef.current ) {\n\t\t\tscrollToEndWithDelay();\n\t\t}\n\t}\n\n\tfunction scrollToEndWithDelay() {\n\t\tconst delayedScroll = setTimeout( () => {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t}, ANIMATION_DURATION );\n\t\treturn () => {\n\t\t\tclearTimeout( delayedScroll );\n\t\t};\n\t}\n\n\tfunction onCustomIndicatorLayout( { nativeEvent } ) {\n\t\tconst { width } = nativeEvent.layout;\n\t\tif ( width !== customIndicatorWidth ) {\n\t\t\tcustomIndicatorWidth = width;\n\t\t}\n\t}\n\n\tfunction onScroll( { nativeEvent } ) {\n\t\tscrollPosition = nativeEvent.contentOffset.x;\n\t}\n\n\tconst verticalSeparatorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.verticalSeparator,\n\t\tstyles.verticalSeparatorDark\n\t);\n\n\tconst customTextStyle = usePreferredColorSchemeStyle(\n\t\t[ styles.customText, ! isIOS && styles.customTextAndroid ],\n\t\tstyles.customTextDark\n\t);\n\n\tconst customIndicatorWrapperStyle = [\n\t\tstyles.customIndicatorWrapper,\n\t\tcustomIndicatorWrapperStyles,\n\t];\n\n\treturn (\n\t\t<ScrollView\n\t\t\tcontentContainerStyle={ styles.contentContainer }\n\t\t\tstyle={ styles.container }\n\t\t\thorizontal\n\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\tdisableScrollViewPanResponder\n\t\t\tscrollEventThrottle={ 16 }\n\t\t\tonScroll={ onScroll }\n\t\t\tonContentSizeChange={ onContentSizeChange }\n\t\t\tonScrollBeginDrag={ () => shouldEnableBottomSheetScroll( false ) }\n\t\t\tonScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }\n\t\t\tref={ scrollViewRef }\n\t\t\ttestID=\"color-palette\"\n\t\t>\n\t\t\t{ shouldShowCustomIndicator && (\n\t\t\t\t<View\n\t\t\t\t\tstyle={ customIndicatorWrapperStyle }\n\t\t\t\t\tonLayout={ onCustomIndicatorLayout }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowCustomVerticalSeparator && (\n\t\t\t\t\t\t<View style={ verticalSeparatorStyle } />\n\t\t\t\t\t) }\n\t\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\t\tonPress={ onCustomPress }\n\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\taccessibilityState={ { selected: isSelectedCustom() } }\n\t\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ customIndicatorWrapperStyle }>\n\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\twithCustomPicker={ ! isGradientSegment }\n\t\t\t\t\t\t\t\tcolor={ customIndicatorColor }\n\t\t\t\t\t\t\t\tisSelected={ isSelectedCustom() }\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tstyles.colorIndicator,\n\t\t\t\t\t\t\t\t\tcustomColorIndicatorStyles,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ shouldShowCustomLabel && (\n\t\t\t\t\t\t\t\t<Text style={ customTextStyle }>\n\t\t\t\t\t\t\t\t\t{ isIOS\n\t\t\t\t\t\t\t\t\t\t? customText\n\t\t\t\t\t\t\t\t\t\t: customText.toUpperCase() }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ colors.map( ( color ) => {\n\t\t\t\tconst scaleValue = isSelected( color ) ? scaleInterpolation : 1;\n\t\t\t\treturn (\n\t\t\t\t\t<View key={ `${ color }-${ isSelected( color ) }` }>\n\t\t\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\t\t\tonPress={ () => onColorPress( color ) }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityState={ {\n\t\t\t\t\t\t\t\tselected: isSelected( color ),\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taccessibilityHint={ color }\n\t\t\t\t\t\t\ttestID={ color }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Animated.View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\ttransform: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tscale: scaleValue,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\tcolor={ color }\n\t\t\t\t\t\t\t\t\tisSelected={ isSelected( color ) }\n\t\t\t\t\t\t\t\t\topacity={ opacity }\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.colorIndicator,\n\t\t\t\t\t\t\t\t\t\tcustomColorIndicatorStyles,\n\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Animated.View>\n\t\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t\t</View>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ScrollView>\n\t);\n}\n\nexport default ColorPalette;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/color-palette/index.native.js"],"names":["ANIMATION_DURATION","contentWidth","scrollPosition","customIndicatorWidth","ColorPalette","enableCustomColor","setColor","activeColor","isGradientColor","defaultSettings","currentSegment","onCustomPress","shouldEnableBottomSheetScroll","shouldShowCustomIndicatorOption","shouldShowCustomLabel","shouldShowCustomVerticalSeparator","customColorIndicatorStyles","customIndicatorWrapperStyles","label","customSwatchGradients","scrollViewRef","isIOS","Platform","OS","isGradientSegment","colorsUtils","segments","scale","Animated","Value","current","opacity","defaultColors","colors","mergedColors","allColors","defaultGradientColors","gradients","customIndicatorColor","isCustomGradientColor","isSelectedCustom","shouldShowCustomIndicator","accessibilityHint","customText","scrollToEndWithDelay","scrollTo","x","y","isWithinColors","includes","isSelected","color","timingAnimation","property","toValue","timing","duration","easing","Easing","ease","useNativeDriver","performAnimation","setValue","parallel","start","scaleInterpolation","interpolate","inputRange","outputRange","deselectCustomGradient","width","Dimensions","get","isVisible","onColorPress","onContentSizeChange","delayedScroll","setTimeout","scrollToEnd","clearTimeout","onCustomIndicatorLayout","nativeEvent","layout","onScroll","contentOffset","verticalSeparatorStyle","styles","verticalSeparator","verticalSeparatorDark","customTextStyle","customTextAndroid","customTextDark","customIndicatorWrapperStyle","customIndicatorWrapper","headerText","contentContainer","map","scaleValue","selected","transform","colorIndicator","toUpperCase"],"mappings":";;;;;;;;;AAmBA;;AAhBA;;AAUA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AA3BA;AACA;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\nimport {\n\tScrollView,\n\tTouchableWithoutFeedback,\n\tView,\n\tAnimated,\n\tEasing,\n\tDimensions,\n\tPlatform,\n\tText,\n} from 'react-native';\nimport { map, uniq } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport ColorIndicator from '../color-indicator';\nimport { colorsUtils } from '../mobile/color-settings/utils';\n\nconst ANIMATION_DURATION = 200;\n\nlet contentWidth = 0;\nlet scrollPosition = 0;\nlet customIndicatorWidth = 0;\n\nfunction ColorPalette( {\n\tenableCustomColor = true,\n\tsetColor,\n\tactiveColor,\n\tisGradientColor,\n\tdefaultSettings,\n\tcurrentSegment,\n\tonCustomPress,\n\tshouldEnableBottomSheetScroll,\n\tshouldShowCustomIndicatorOption = true,\n\tshouldShowCustomLabel = true,\n\tshouldShowCustomVerticalSeparator = true,\n\tcustomColorIndicatorStyles,\n\tcustomIndicatorWrapperStyles,\n\tlabel,\n} ) {\n\tconst customSwatchGradients = [\n\t\t'linear-gradient(120deg, rgba(255,0,0,.8) 0%, rgba(255,255,255,1) 70.71%)',\n\t\t'linear-gradient(240deg, rgba(0,255,0,.8) 0%, rgba(0,255,0,0) 70.71%)',\n\t\t'linear-gradient(360deg, rgba(0,0,255,.8) 0%, rgba(0,0,255,0) 70.71%)',\n\t];\n\n\tconst scrollViewRef = useRef();\n\tconst isIOS = Platform.OS === 'ios';\n\n\tconst isGradientSegment = currentSegment === colorsUtils.segments[ 1 ];\n\n\tconst scale = useRef( new Animated.Value( 1 ) ).current;\n\tconst opacity = useRef( new Animated.Value( 1 ) ).current;\n\n\tconst defaultColors = uniq( map( defaultSettings.colors, 'color' ) );\n\tconst mergedColors = uniq( map( defaultSettings.allColors, 'color' ) );\n\tconst defaultGradientColors = uniq(\n\t\tmap( defaultSettings.gradients, 'gradient' )\n\t);\n\tconst colors = isGradientSegment ? defaultGradientColors : defaultColors;\n\n\tconst customIndicatorColor = isGradientSegment\n\t\t? activeColor\n\t\t: customSwatchGradients;\n\tconst isCustomGradientColor = isGradientColor && isSelectedCustom();\n\tconst shouldShowCustomIndicator =\n\t\tenableCustomColor &&\n\t\tshouldShowCustomIndicatorOption &&\n\t\t( ! isGradientSegment || isCustomGradientColor );\n\n\tconst accessibilityHint = isGradientSegment\n\t\t? __( 'Navigates to customize the gradient' )\n\t\t: __( 'Navigates to custom color picker' );\n\tconst customText = __( 'Custom' );\n\n\tuseEffect( () => {\n\t\tif ( scrollViewRef.current ) {\n\t\t\tif ( isSelectedCustom() ) {\n\t\t\t\tscrollToEndWithDelay();\n\t\t\t} else {\n\t\t\t\tscrollViewRef.current.scrollTo( { x: 0, y: 0 } );\n\t\t\t}\n\t\t}\n\t}, [ currentSegment ] );\n\n\tfunction isSelectedCustom() {\n\t\tconst isWithinColors =\n\t\t\tactiveColor && mergedColors && mergedColors.includes( activeColor );\n\t\tif ( enableCustomColor && activeColor ) {\n\t\t\tif ( isGradientSegment ) {\n\t\t\t\treturn isGradientColor && ! isWithinColors;\n\t\t\t}\n\t\t\treturn ! isGradientColor && ! isWithinColors;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction isSelected( color ) {\n\t\treturn ! isSelectedCustom() && activeColor === color;\n\t}\n\n\tfunction timingAnimation( property, toValue ) {\n\t\treturn Animated.timing( property, {\n\t\t\ttoValue,\n\t\t\tduration: ANIMATION_DURATION,\n\t\t\teasing: Easing.ease,\n\t\t\tuseNativeDriver: true,\n\t\t} );\n\t}\n\n\tfunction performAnimation( color ) {\n\t\tif ( ! isSelected( color ) ) {\n\t\t\topacity.setValue( 0 );\n\t\t}\n\n\t\tAnimated.parallel( [\n\t\t\ttimingAnimation( scale, 2 ),\n\t\t\ttimingAnimation( opacity, 1 ),\n\t\t] ).start( () => {\n\t\t\topacity.setValue( 1 );\n\t\t\tscale.setValue( 1 );\n\t\t} );\n\t}\n\n\tconst scaleInterpolation = scale.interpolate( {\n\t\tinputRange: [ 1, 1.5, 2 ],\n\t\toutputRange: [ 1, 0.7, 1 ],\n\t} );\n\n\tfunction deselectCustomGradient() {\n\t\tconst { width } = Dimensions.get( 'window' );\n\t\tconst isVisible =\n\t\t\tcontentWidth - scrollPosition - customIndicatorWidth < width;\n\n\t\tif ( isCustomGradientColor ) {\n\t\t\tif ( ! isIOS ) {\n\t\t\t\t// Scroll position on Android doesn't adjust automatically when removing the last item from the horizontal list.\n\t\t\t\t// https://github.com/facebook/react-native/issues/27504\n\t\t\t\t// Workaround: Force the scroll when deselecting custom gradient color and when custom indicator is visible on layout.\n\t\t\t\tif (\n\t\t\t\t\tisCustomGradientColor &&\n\t\t\t\t\tisVisible &&\n\t\t\t\t\tscrollViewRef.current\n\t\t\t\t) {\n\t\t\t\t\tscrollViewRef.current.scrollTo( {\n\t\t\t\t\t\tx: scrollPosition - customIndicatorWidth,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction onColorPress( color ) {\n\t\tdeselectCustomGradient();\n\t\tperformAnimation( color );\n\t\tsetColor( color );\n\t}\n\n\tfunction onContentSizeChange( width ) {\n\t\tcontentWidth = width;\n\t\tif ( isSelectedCustom() && scrollViewRef.current ) {\n\t\t\tscrollToEndWithDelay();\n\t\t}\n\t}\n\n\tfunction scrollToEndWithDelay() {\n\t\tconst delayedScroll = setTimeout( () => {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t}, ANIMATION_DURATION );\n\t\treturn () => {\n\t\t\tclearTimeout( delayedScroll );\n\t\t};\n\t}\n\n\tfunction onCustomIndicatorLayout( { nativeEvent } ) {\n\t\tconst { width } = nativeEvent.layout;\n\t\tif ( width !== customIndicatorWidth ) {\n\t\t\tcustomIndicatorWidth = width;\n\t\t}\n\t}\n\n\tfunction onScroll( { nativeEvent } ) {\n\t\tscrollPosition = nativeEvent.contentOffset.x;\n\t}\n\n\tconst verticalSeparatorStyle = usePreferredColorSchemeStyle(\n\t\tstyles.verticalSeparator,\n\t\tstyles.verticalSeparatorDark\n\t);\n\n\tconst customTextStyle = usePreferredColorSchemeStyle(\n\t\t[ styles.customText, ! isIOS && styles.customTextAndroid ],\n\t\tstyles.customTextDark\n\t);\n\n\tconst customIndicatorWrapperStyle = [\n\t\tstyles.customIndicatorWrapper,\n\t\tcustomIndicatorWrapperStyles,\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t{ label && (\n\t\t\t\t<Text accessibilityRole=\"header\" style={ styles.headerText }>\n\t\t\t\t\t{ label }\n\t\t\t\t</Text>\n\t\t\t) }\n\n\t\t\t<ScrollView\n\t\t\t\tcontentContainerStyle={ styles.contentContainer }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\tdisableScrollViewPanResponder\n\t\t\t\tscrollEventThrottle={ 16 }\n\t\t\t\tonScroll={ onScroll }\n\t\t\t\tonContentSizeChange={ onContentSizeChange }\n\t\t\t\tonScrollBeginDrag={ () =>\n\t\t\t\t\tshouldEnableBottomSheetScroll( false )\n\t\t\t\t}\n\t\t\t\tonScrollEndDrag={ () => shouldEnableBottomSheetScroll( true ) }\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\ttestID={ `color-palette${ label ? '-' + label : '' }` }\n\t\t\t>\n\t\t\t\t{ colors.map( ( color ) => {\n\t\t\t\t\tconst scaleValue = isSelected( color )\n\t\t\t\t\t\t? scaleInterpolation\n\t\t\t\t\t\t: 1;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<View key={ `${ color }-${ isSelected( color ) }` }>\n\t\t\t\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\t\t\t\tonPress={ () => onColorPress( color ) }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t\taccessibilityState={ {\n\t\t\t\t\t\t\t\t\tselected: isSelected( color ),\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\taccessibilityHint={ color }\n\t\t\t\t\t\t\t\ttestID={ color }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Animated.View\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\ttransform: [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tscale: scaleValue,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\tcolor={ color }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isSelected( color ) }\n\t\t\t\t\t\t\t\t\t\topacity={ opacity }\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tstyles.colorIndicator,\n\t\t\t\t\t\t\t\t\t\t\tcustomColorIndicatorStyles,\n\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Animated.View>\n\t\t\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ shouldShowCustomIndicator && (\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ customIndicatorWrapperStyle }\n\t\t\t\t\t\tonLayout={ onCustomIndicatorLayout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ shouldShowCustomVerticalSeparator && (\n\t\t\t\t\t\t\t<View style={ verticalSeparatorStyle } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\t\t\tonPress={ onCustomPress }\n\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\taccessibilityState={ {\n\t\t\t\t\t\t\t\tselected: isSelectedCustom(),\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<View style={ customIndicatorWrapperStyle }>\n\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\twithCustomPicker={ ! isGradientSegment }\n\t\t\t\t\t\t\t\t\tcolor={ customIndicatorColor }\n\t\t\t\t\t\t\t\t\tisSelected={ isSelectedCustom() }\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.colorIndicator,\n\t\t\t\t\t\t\t\t\t\tcustomColorIndicatorStyles,\n\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ shouldShowCustomLabel && (\n\t\t\t\t\t\t\t\t\t<Text style={ customTextStyle }>\n\t\t\t\t\t\t\t\t\t\t{ isIOS\n\t\t\t\t\t\t\t\t\t\t\t? customText\n\t\t\t\t\t\t\t\t\t\t\t: customText.toUpperCase() }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t\t</View>\n\t\t\t\t) }\n\t\t\t</ScrollView>\n\t\t</>\n\t);\n}\n\nexport default ColorPalette;\n"]}
@@ -159,7 +159,7 @@ const ColorDisplay = _ref6 => {
159
159
  }, 3000);
160
160
  });
161
161
  (0, _element.useEffect)(() => {
162
- // clear copyTimer on component unmount.
162
+ // Clear copyTimer on component unmount.
163
163
  return () => {
164
164
  if (copyTimer.current) {
165
165
  clearTimeout(copyTimer.current);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/color-picker/color-display.tsx"],"names":["ValueDisplay","values","map","value","abbreviation","COLORS","ui","theme","HslDisplay","color","enableAlpha","h","s","l","a","toHsl","Math","floor","round","push","RgbDisplay","r","g","b","toRgb","HexDisplay","colorWithoutHash","toHex","slice","toUpperCase","getComponent","colorType","ColorDisplay","copiedColor","setCopiedColor","copyTimer","props","Component","copyRef","toHslString","toRgbString","current","clearTimeout","setTimeout","undefined","height"],"mappings":";;;;;;;AASA;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAyBA,MAAMA,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACpB,qDACGA,MAAM,CAACC,GAAP,CAAY,SAA+B;AAAA,QAA7B,CAAEC,KAAF,EAASC,YAAT,CAA6B;AAC5C,WACC,4BAAC,cAAD;AAAU,MAAA,GAAG,EAAGA,YAAhB;AAA+B,MAAA,OAAO,MAAtC;AAAuC,MAAA,OAAO,EAAC;AAA/C,OACC,4BAAC,UAAD;AAAM,MAAA,KAAK,EAAGC,qBAAOC,EAAP,CAAUC;AAAxB,OAAkCH,YAAlC,CADD,EAEC,4BAAC,UAAD,QAAQD,KAAR,CAFD,CADD;AAMA,GAPC,CADH,CADoB;AAAA,CAArB;;AAaA,MAAMK,UAAU,GAAG,SAA4C;AAAA,MAA1C;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA0C;AAC9D,QAAM;AAAEC,IAAAA,CAAF;AAAKC,IAAAA,CAAL;AAAQC,IAAAA,CAAR;AAAWC,IAAAA;AAAX,MAAiBL,KAAK,CAACM,KAAN,EAAvB;AAEA,QAAMd,MAAc,GAAG,CACtB,CAAEe,IAAI,CAACC,KAAL,CAAYN,CAAZ,CAAF,EAAmB,GAAnB,CADsB,EAEtB,CAAEK,IAAI,CAACE,KAAL,CAAYN,CAAC,GAAG,GAAhB,CAAF,EAAyB,GAAzB,CAFsB,EAGtB,CAAEI,IAAI,CAACE,KAAL,CAAYL,CAAC,GAAG,GAAhB,CAAF,EAAyB,GAAzB,CAHsB,CAAvB;;AAKA,MAAKH,WAAL,EAAmB;AAClBT,IAAAA,MAAM,CAAC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AOG,EAPH;AAQA,SACC,4BAAC,gBAAD;AACC,IAAA,OAAO,EACN,4BAAC,UAAD;AAAM,MAAA,KAAK,EAAC;AAAZ,OACGR,WAAW,KAAKxB,KAAK,CAACkB,KAAN,EAAhB,GACC,cAAI,SAAJ,CADD,GAEC,cAAI,MAAJ,CAHJ;AAFF,KASC,4BAAC,UAAD;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,GAAG,EAAG,kBAAO,CAAP,CAFP;AAGC,IAAA,GAAG,EAAGW,OAHP;AAIC,IAAA,KAAK,EAAG;AAAEO,MAAAA,MAAM,EAAE;AAAV;AAJT,KAMC,4BAAC,SAAD,EAAgBT,KAAhB,CAND,CATD,CADD;AAoBA,CA/DM","sourcesContent":["/**\n * External dependencies\n */\nimport type { Colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../text';\nimport { Flex, FlexItem } from '../flex';\nimport { Tooltip } from '../ui/tooltip';\nimport type { ColorType } from './types';\nimport { space } from '../ui/utils/space';\nimport { COLORS } from '../utils/colors-values';\n\ninterface ColorDisplayProps {\n\tcolor: Colord;\n\tcolorType: ColorType;\n\tenableAlpha: boolean;\n}\n\ninterface DisplayProps {\n\tcolor: Colord;\n\tenableAlpha: boolean;\n}\n\ntype Values = [ number, string ][];\n\ninterface ValueDisplayProps {\n\tvalues: Values;\n}\n\nconst ValueDisplay = ( { values }: ValueDisplayProps ) => (\n\t<>\n\t\t{ values.map( ( [ value, abbreviation ] ) => {\n\t\t\treturn (\n\t\t\t\t<FlexItem key={ abbreviation } isBlock display=\"flex\">\n\t\t\t\t\t<Text color={ COLORS.ui.theme }>{ abbreviation }</Text>\n\t\t\t\t\t<Text>{ value }</Text>\n\t\t\t\t</FlexItem>\n\t\t\t);\n\t\t} ) }\n\t</>\n);\n\nconst HslDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { h, s, l, a } = color.toHsl();\n\n\tconst values: Values = [\n\t\t[ Math.floor( h ), 'H' ],\n\t\t[ Math.round( s * 100 ), 'S' ],\n\t\t[ Math.round( l * 100 ), 'L' ],\n\t];\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst RgbDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { r, g, b, a } = color.toRgb();\n\n\tconst values: Values = [\n\t\t[ r, 'R' ],\n\t\t[ g, 'G' ],\n\t\t[ b, 'B' ],\n\t];\n\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst HexDisplay = ( { color }: DisplayProps ) => {\n\tconst colorWithoutHash = color.toHex().slice( 1 ).toUpperCase();\n\treturn (\n\t\t<FlexItem>\n\t\t\t<Text color={ COLORS.ui.theme }>#</Text>\n\t\t\t<Text>{ colorWithoutHash }</Text>\n\t\t</FlexItem>\n\t);\n};\n\nconst getComponent = ( colorType: ColorType ) => {\n\tswitch ( colorType ) {\n\t\tcase 'hsl':\n\t\t\treturn HslDisplay;\n\t\tcase 'rgb':\n\t\t\treturn RgbDisplay;\n\t\tdefault:\n\t\tcase 'hex':\n\t\t\treturn HexDisplay;\n\t}\n};\n\nexport const ColorDisplay = ( {\n\tcolor,\n\tcolorType,\n\tenableAlpha,\n}: ColorDisplayProps ) => {\n\tconst [ copiedColor, setCopiedColor ] = useState< string | null >( null );\n\tconst copyTimer = useRef< ReturnType< typeof setTimeout > | undefined >();\n\tconst props = { color, enableAlpha };\n\tconst Component = getComponent( colorType );\n\tconst copyRef = useCopyToClipboard< HTMLDivElement >(\n\t\t() => {\n\t\t\tswitch ( colorType ) {\n\t\t\t\tcase 'hsl': {\n\t\t\t\t\treturn color.toHslString();\n\t\t\t\t}\n\t\t\t\tcase 'rgb': {\n\t\t\t\t\treturn color.toRgbString();\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\tcase 'hex': {\n\t\t\t\t\treturn color.toHex();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t() => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t\tsetCopiedColor( color.toHex() );\n\t\t\tcopyTimer.current = setTimeout( () => {\n\t\t\t\tsetCopiedColor( null );\n\t\t\t\tcopyTimer.current = undefined;\n\t\t\t}, 3000 );\n\t\t}\n\t);\n\tuseEffect( () => {\n\t\t// clear copyTimer on component unmount.\n\t\treturn () => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<Tooltip\n\t\t\tcontent={\n\t\t\t\t<Text color=\"white\">\n\t\t\t\t\t{ copiedColor === color.toHex()\n\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t</Text>\n\t\t\t}\n\t\t>\n\t\t\t<Flex\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tgap={ space( 1 ) }\n\t\t\t\tref={ copyRef }\n\t\t\t\tstyle={ { height: 30 } }\n\t\t\t>\n\t\t\t\t<Component { ...props } />\n\t\t\t</Flex>\n\t\t</Tooltip>\n\t);\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/color-picker/color-display.tsx"],"names":["ValueDisplay","values","map","value","abbreviation","COLORS","ui","theme","HslDisplay","color","enableAlpha","h","s","l","a","toHsl","Math","floor","round","push","RgbDisplay","r","g","b","toRgb","HexDisplay","colorWithoutHash","toHex","slice","toUpperCase","getComponent","colorType","ColorDisplay","copiedColor","setCopiedColor","copyTimer","props","Component","copyRef","toHslString","toRgbString","current","clearTimeout","setTimeout","undefined","height"],"mappings":";;;;;;;AASA;;AADA;;AAE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hB,GACC,cAAI,SAAJ,CADD,GAEC,cAAI,MAAJ,CAHJ;AAFF,KASC,4BAAC,UAAD;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,GAAG,EAAG,kBAAO,CAAP,CAFP;AAGC,IAAA,GAAG,EAAGW,OAHP;AAIC,IAAA,KAAK,EAAG;AAAEO,MAAAA,MAAM,EAAE;AAAV;AAJT,KAMC,4BAAC,SAAD,EAAgBT,KAAhB,CAND,CATD,CADD;AAoBA,CA/DM","sourcesContent":["/**\n * External dependencies\n */\nimport type { Colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../text';\nimport { Flex, FlexItem } from '../flex';\nimport { Tooltip } from '../ui/tooltip';\nimport type { ColorType } from './types';\nimport { space } from '../ui/utils/space';\nimport { COLORS } from '../utils/colors-values';\n\ninterface ColorDisplayProps {\n\tcolor: Colord;\n\tcolorType: ColorType;\n\tenableAlpha: boolean;\n}\n\ninterface DisplayProps {\n\tcolor: Colord;\n\tenableAlpha: boolean;\n}\n\ntype Values = [ number, string ][];\n\ninterface ValueDisplayProps {\n\tvalues: Values;\n}\n\nconst ValueDisplay = ( { values }: ValueDisplayProps ) => (\n\t<>\n\t\t{ values.map( ( [ value, abbreviation ] ) => {\n\t\t\treturn (\n\t\t\t\t<FlexItem key={ abbreviation } isBlock display=\"flex\">\n\t\t\t\t\t<Text color={ COLORS.ui.theme }>{ abbreviation }</Text>\n\t\t\t\t\t<Text>{ value }</Text>\n\t\t\t\t</FlexItem>\n\t\t\t);\n\t\t} ) }\n\t</>\n);\n\nconst HslDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { h, s, l, a } = color.toHsl();\n\n\tconst values: Values = [\n\t\t[ Math.floor( h ), 'H' ],\n\t\t[ Math.round( s * 100 ), 'S' ],\n\t\t[ Math.round( l * 100 ), 'L' ],\n\t];\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst RgbDisplay = ( { color, enableAlpha }: DisplayProps ) => {\n\tconst { r, g, b, a } = color.toRgb();\n\n\tconst values: Values = [\n\t\t[ r, 'R' ],\n\t\t[ g, 'G' ],\n\t\t[ b, 'B' ],\n\t];\n\n\tif ( enableAlpha ) {\n\t\tvalues.push( [ Math.round( a * 100 ), 'A' ] );\n\t}\n\n\treturn <ValueDisplay values={ values } />;\n};\n\nconst HexDisplay = ( { color }: DisplayProps ) => {\n\tconst colorWithoutHash = color.toHex().slice( 1 ).toUpperCase();\n\treturn (\n\t\t<FlexItem>\n\t\t\t<Text color={ COLORS.ui.theme }>#</Text>\n\t\t\t<Text>{ colorWithoutHash }</Text>\n\t\t</FlexItem>\n\t);\n};\n\nconst getComponent = ( colorType: ColorType ) => {\n\tswitch ( colorType ) {\n\t\tcase 'hsl':\n\t\t\treturn HslDisplay;\n\t\tcase 'rgb':\n\t\t\treturn RgbDisplay;\n\t\tdefault:\n\t\tcase 'hex':\n\t\t\treturn HexDisplay;\n\t}\n};\n\nexport const ColorDisplay = ( {\n\tcolor,\n\tcolorType,\n\tenableAlpha,\n}: ColorDisplayProps ) => {\n\tconst [ copiedColor, setCopiedColor ] = useState< string | null >( null );\n\tconst copyTimer = useRef< ReturnType< typeof setTimeout > | undefined >();\n\tconst props = { color, enableAlpha };\n\tconst Component = getComponent( colorType );\n\tconst copyRef = useCopyToClipboard< HTMLDivElement >(\n\t\t() => {\n\t\t\tswitch ( colorType ) {\n\t\t\t\tcase 'hsl': {\n\t\t\t\t\treturn color.toHslString();\n\t\t\t\t}\n\t\t\t\tcase 'rgb': {\n\t\t\t\t\treturn color.toRgbString();\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\tcase 'hex': {\n\t\t\t\t\treturn color.toHex();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t() => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t\tsetCopiedColor( color.toHex() );\n\t\t\tcopyTimer.current = setTimeout( () => {\n\t\t\t\tsetCopiedColor( null );\n\t\t\t\tcopyTimer.current = undefined;\n\t\t\t}, 3000 );\n\t\t}\n\t);\n\tuseEffect( () => {\n\t\t// Clear copyTimer on component unmount.\n\t\treturn () => {\n\t\t\tif ( copyTimer.current ) {\n\t\t\t\tclearTimeout( copyTimer.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<Tooltip\n\t\t\tcontent={\n\t\t\t\t<Text color=\"white\">\n\t\t\t\t\t{ copiedColor === color.toHex()\n\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t</Text>\n\t\t\t}\n\t\t>\n\t\t\t<Flex\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tgap={ space( 1 ) }\n\t\t\t\tref={ copyRef }\n\t\t\t\tstyle={ { height: 30 } }\n\t\t\t>\n\t\t\t\t<Component { ...props } />\n\t\t\t</Flex>\n\t\t</Tooltip>\n\t);\n};\n"]}