@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.4.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 (748) hide show
  1. package/CHANGELOG.md +54 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/LICENSE.md +1 -1
  4. package/README.md +8 -4
  5. package/build/base-control/index.js +2 -3
  6. package/build/base-control/index.js.map +1 -1
  7. package/build/base-control/styles/base-control-styles.js +23 -13
  8. package/build/base-control/styles/base-control-styles.js.map +1 -1
  9. package/build/base-field/hook.js +1 -1
  10. package/build/base-field/hook.js.map +1 -1
  11. package/build/box-control/styles/box-control-styles.js +9 -9
  12. package/build/box-control/styles/box-control-styles.js.map +1 -1
  13. package/build/button/deprecated.js +2 -1
  14. package/build/button/deprecated.js.map +1 -1
  15. package/build/button/index.js +2 -1
  16. package/build/button/index.js.map +1 -1
  17. package/build/card/card/component.js +1 -1
  18. package/build/card/card/component.js.map +1 -1
  19. package/build/card/card/hook.js +1 -1
  20. package/build/card/card/hook.js.map +1 -1
  21. package/build/card/card-body/hook.js +1 -1
  22. package/build/card/card-body/hook.js.map +1 -1
  23. package/build/card/card-divider/hook.js +1 -1
  24. package/build/card/card-divider/hook.js.map +1 -1
  25. package/build/card/card-footer/hook.js +1 -1
  26. package/build/card/card-footer/hook.js.map +1 -1
  27. package/build/card/card-header/hook.js +1 -1
  28. package/build/card/card-header/hook.js.map +1 -1
  29. package/build/card/card-media/hook.js +1 -1
  30. package/build/card/card-media/hook.js.map +1 -1
  31. package/build/circular-option-picker/index.js +2 -0
  32. package/build/circular-option-picker/index.js.map +1 -1
  33. package/build/color-indicator/index.js +2 -0
  34. package/build/color-indicator/index.js.map +1 -1
  35. package/build/color-palette/index.js +4 -7
  36. package/build/color-palette/index.js.map +1 -1
  37. package/build/color-palette/index.native.js +4 -2
  38. package/build/color-palette/index.native.js.map +1 -1
  39. package/build/color-picker/color-display.js.map +1 -1
  40. package/build/color-picker/color-input.js.map +1 -1
  41. package/build/color-picker/component.js +2 -5
  42. package/build/color-picker/component.js.map +1 -1
  43. package/build/color-picker/use-deprecated-props.js +2 -0
  44. package/build/color-picker/use-deprecated-props.js.map +1 -1
  45. package/build/confirm-dialog/component.js +10 -6
  46. package/build/confirm-dialog/component.js.map +1 -1
  47. package/build/confirm-dialog/styles.js +30 -0
  48. package/build/confirm-dialog/styles.js.map +1 -0
  49. package/build/custom-gradient-bar/control-points.js +1 -2
  50. package/build/custom-gradient-bar/control-points.js.map +1 -1
  51. package/build/custom-select-control/index.js +10 -2
  52. package/build/custom-select-control/index.js.map +1 -1
  53. package/build/date-time/time.js +1 -1
  54. package/build/date-time/time.js.map +1 -1
  55. package/build/divider/component.js.map +1 -1
  56. package/build/dropdown/index.js +3 -3
  57. package/build/dropdown/index.js.map +1 -1
  58. package/build/elevation/hook.js +5 -5
  59. package/build/elevation/hook.js.map +1 -1
  60. package/build/external-link/styles/external-link-styles.js +5 -5
  61. package/build/external-link/styles/external-link-styles.js.map +1 -1
  62. package/build/flex/flex/hook.js +4 -4
  63. package/build/flex/flex/hook.js.map +1 -1
  64. package/build/form-token-field/suggestions-list.js +75 -81
  65. package/build/form-token-field/suggestions-list.js.map +1 -1
  66. package/build/grid/hook.js +2 -2
  67. package/build/grid/hook.js.map +1 -1
  68. package/build/heading/component.js +0 -1
  69. package/build/heading/component.js.map +1 -1
  70. package/build/icon/index.js +0 -1
  71. package/build/icon/index.js.map +1 -1
  72. package/build/input-control/index.js.map +1 -1
  73. package/build/input-control/input-base.js +0 -1
  74. package/build/input-control/input-base.js.map +1 -1
  75. package/build/input-control/input-field.js.map +1 -1
  76. package/build/input-control/reducer/actions.js +0 -1
  77. package/build/input-control/reducer/actions.js.map +1 -1
  78. package/build/input-control/reducer/reducer.js.map +1 -1
  79. package/build/input-control/reducer/state.js +0 -1
  80. package/build/input-control/reducer/state.js.map +1 -1
  81. package/build/input-control/styles/input-control-styles.js +32 -30
  82. package/build/input-control/styles/input-control-styles.js.map +1 -1
  83. package/build/item-group/item/component.js +0 -1
  84. package/build/item-group/item/component.js.map +1 -1
  85. package/build/item-group/item/hook.js +1 -2
  86. package/build/item-group/item/hook.js.map +1 -1
  87. package/build/item-group/item-group/component.js +0 -1
  88. package/build/item-group/item-group/component.js.map +1 -1
  89. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
  90. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  91. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +4 -12
  92. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  93. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
  94. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  95. package/build/mobile/bottom-sheet/cell.native.js +3 -5
  96. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  97. package/build/mobile/bottom-sheet/index.native.js +16 -16
  98. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  99. package/build/mobile/bottom-sheet/range-text-input.native.js +2 -3
  100. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  101. package/build/mobile/color-settings/index.native.js +2 -0
  102. package/build/mobile/color-settings/index.native.js.map +1 -1
  103. package/build/mobile/color-settings/palette.screen.native.js +5 -0
  104. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  105. package/build/mobile/color-settings/utils.native.js +9 -3
  106. package/build/mobile/color-settings/utils.native.js.map +1 -1
  107. package/build/mobile/keyboard-avoiding-view/index.ios.js +6 -8
  108. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  109. package/build/mobile/link-picker/index.native.js +3 -1
  110. package/build/mobile/link-picker/index.native.js.map +1 -1
  111. package/build/mobile/link-picker/link-picker-screen.native.js +18 -5
  112. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  113. package/build/mobile/link-settings/index.native.js +3 -1
  114. package/build/mobile/link-settings/index.native.js.map +1 -1
  115. package/build/mobile/readable-content-view/index.native.js +2 -2
  116. package/build/mobile/readable-content-view/index.native.js.map +1 -1
  117. package/build/mobile/utils/use-is-floating-keyboard.native.js +2 -2
  118. package/build/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
  119. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
  120. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  121. package/build/modal/index.js +1 -12
  122. package/build/modal/index.js.map +1 -1
  123. package/build/navigator/context.js +5 -1
  124. package/build/navigator/context.js.map +1 -1
  125. package/build/navigator/navigator-provider/component.js +42 -22
  126. package/build/navigator/navigator-provider/component.js.map +1 -1
  127. package/build/navigator/navigator-screen/component.js +57 -29
  128. package/build/navigator/navigator-screen/component.js.map +1 -1
  129. package/build/navigator/use-navigator.js +8 -8
  130. package/build/navigator/use-navigator.js.map +1 -1
  131. package/build/notice/index.native.js +2 -2
  132. package/build/notice/index.native.js.map +1 -1
  133. package/build/palette-edit/index.js +39 -30
  134. package/build/palette-edit/index.js.map +1 -1
  135. package/build/palette-edit/styles.js +11 -13
  136. package/build/palette-edit/styles.js.map +1 -1
  137. package/build/placeholder/index.js +4 -4
  138. package/build/placeholder/index.js.map +1 -1
  139. package/build/range-control/styles/range-control-styles.js +29 -29
  140. package/build/range-control/styles/range-control-styles.js.map +1 -1
  141. package/build/resizable-box/index.js.map +1 -1
  142. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  143. package/build/resizable-box/resize-tooltip/label.js +0 -1
  144. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  145. package/build/sandbox/index.native.js +5 -5
  146. package/build/sandbox/index.native.js.map +1 -1
  147. package/build/scrollable/hook.js +1 -1
  148. package/build/scrollable/hook.js.map +1 -1
  149. package/build/select-control/index.js.map +1 -1
  150. package/build/slot-fill/bubbles-virtually/fill.js +11 -2
  151. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  152. package/build/spacer/component.js +0 -1
  153. package/build/spacer/component.js.map +1 -1
  154. package/build/spinner/index.js +44 -5
  155. package/build/spinner/index.js.map +1 -1
  156. package/build/spinner/index.native.js +4 -2
  157. package/build/spinner/index.native.js.map +1 -1
  158. package/build/spinner/styles.js +56 -0
  159. package/build/spinner/styles.js.map +1 -0
  160. package/build/surface/hook.js +1 -1
  161. package/build/surface/hook.js.map +1 -1
  162. package/build/text/get-line-height.js +0 -1
  163. package/build/text/get-line-height.js.map +1 -1
  164. package/build/text/hook.js +5 -5
  165. package/build/text/hook.js.map +1 -1
  166. package/build/tip/index.js +4 -8
  167. package/build/tip/index.js.map +1 -1
  168. package/build/toggle-group-control/toggle-group-control/component.js +2 -12
  169. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  170. package/build/toggle-group-control/toggle-group-control/styles.js +3 -14
  171. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  172. package/build/toggle-group-control/toggle-group-control-option/component.js +0 -1
  173. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  174. package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  175. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  176. package/build/tools-panel/styles.js +10 -10
  177. package/build/tools-panel/styles.js.map +1 -1
  178. package/build/tools-panel/tools-panel/component.js +0 -1
  179. package/build/tools-panel/tools-panel/component.js.map +1 -1
  180. package/build/tools-panel/tools-panel/hook.js +51 -44
  181. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  182. package/build/tools-panel/tools-panel-header/component.js +0 -1
  183. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  184. package/build/tools-panel/tools-panel-header/hook.js +3 -3
  185. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  186. package/build/tools-panel/tools-panel-item/component.js +0 -1
  187. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  188. package/build/tools-panel/tools-panel-item/hook.js +17 -9
  189. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  190. package/build/tree-grid/index.js +19 -10
  191. package/build/tree-grid/index.js.map +1 -1
  192. package/build/truncate/hook.js +2 -2
  193. package/build/truncate/hook.js.map +1 -1
  194. package/build/ui/shortcut/component.js +0 -1
  195. package/build/ui/shortcut/component.js.map +1 -1
  196. package/build/ui/utils/font-size.js +0 -1
  197. package/build/ui/utils/font-size.js.map +1 -1
  198. package/build/ui/utils/get-valid-children.js +0 -1
  199. package/build/ui/utils/get-valid-children.js.map +1 -1
  200. package/build/unit-control/index.js +0 -1
  201. package/build/unit-control/index.js.map +1 -1
  202. package/build/unit-control/unit-select-control.js.map +1 -1
  203. package/build/utils/colors-values.js +6 -3
  204. package/build/utils/colors-values.js.map +1 -1
  205. package/build/utils/config-values.js +1 -4
  206. package/build/utils/config-values.js.map +1 -1
  207. package/build/utils/hooks/use-combined-ref.js.map +1 -1
  208. package/build/utils/hooks/use-latest-ref.js +0 -1
  209. package/build/utils/hooks/use-latest-ref.js.map +1 -1
  210. package/build/z-stack/component.js +0 -1
  211. package/build/z-stack/component.js.map +1 -1
  212. package/build-module/base-control/index.js +3 -4
  213. package/build-module/base-control/index.js.map +1 -1
  214. package/build-module/base-control/styles/base-control-styles.js +20 -12
  215. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  216. package/build-module/base-field/hook.js +1 -1
  217. package/build-module/base-field/hook.js.map +1 -1
  218. package/build-module/box-control/styles/box-control-styles.js +9 -9
  219. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  220. package/build-module/button/deprecated.js +2 -1
  221. package/build-module/button/deprecated.js.map +1 -1
  222. package/build-module/button/index.js +2 -1
  223. package/build-module/button/index.js.map +1 -1
  224. package/build-module/card/card/component.js +1 -1
  225. package/build-module/card/card/component.js.map +1 -1
  226. package/build-module/card/card/hook.js +1 -1
  227. package/build-module/card/card/hook.js.map +1 -1
  228. package/build-module/card/card-body/hook.js +1 -1
  229. package/build-module/card/card-body/hook.js.map +1 -1
  230. package/build-module/card/card-divider/hook.js +1 -1
  231. package/build-module/card/card-divider/hook.js.map +1 -1
  232. package/build-module/card/card-footer/hook.js +1 -1
  233. package/build-module/card/card-footer/hook.js.map +1 -1
  234. package/build-module/card/card-header/hook.js +1 -1
  235. package/build-module/card/card-header/hook.js.map +1 -1
  236. package/build-module/card/card-media/hook.js +1 -1
  237. package/build-module/card/card-media/hook.js.map +1 -1
  238. package/build-module/circular-option-picker/index.js +1 -0
  239. package/build-module/circular-option-picker/index.js.map +1 -1
  240. package/build-module/color-indicator/index.js +1 -0
  241. package/build-module/color-indicator/index.js.map +1 -1
  242. package/build-module/color-palette/index.js +4 -8
  243. package/build-module/color-palette/index.js.map +1 -1
  244. package/build-module/color-palette/index.native.js +4 -2
  245. package/build-module/color-palette/index.native.js.map +1 -1
  246. package/build-module/color-picker/color-display.js.map +1 -1
  247. package/build-module/color-picker/color-input.js.map +1 -1
  248. package/build-module/color-picker/component.js +2 -4
  249. package/build-module/color-picker/component.js.map +1 -1
  250. package/build-module/color-picker/use-deprecated-props.js +3 -2
  251. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  252. package/build-module/confirm-dialog/component.js +6 -3
  253. package/build-module/confirm-dialog/component.js.map +1 -1
  254. package/build-module/confirm-dialog/styles.js +25 -0
  255. package/build-module/confirm-dialog/styles.js.map +1 -0
  256. package/build-module/custom-gradient-bar/control-points.js +2 -3
  257. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  258. package/build-module/custom-select-control/index.js +11 -2
  259. package/build-module/custom-select-control/index.js.map +1 -1
  260. package/build-module/date-time/time.js +1 -1
  261. package/build-module/date-time/time.js.map +1 -1
  262. package/build-module/divider/component.js +1 -1
  263. package/build-module/divider/component.js.map +1 -1
  264. package/build-module/dropdown/index.js +3 -3
  265. package/build-module/dropdown/index.js.map +1 -1
  266. package/build-module/elevation/hook.js +5 -5
  267. package/build-module/elevation/hook.js.map +1 -1
  268. package/build-module/external-link/styles/external-link-styles.js +5 -5
  269. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  270. package/build-module/flex/flex/hook.js +4 -4
  271. package/build-module/flex/flex/hook.js.map +1 -1
  272. package/build-module/form-token-field/suggestions-list.js +73 -79
  273. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  274. package/build-module/grid/hook.js +2 -2
  275. package/build-module/grid/hook.js.map +1 -1
  276. package/build-module/heading/component.js +0 -1
  277. package/build-module/heading/component.js.map +1 -1
  278. package/build-module/icon/index.js +0 -1
  279. package/build-module/icon/index.js.map +1 -1
  280. package/build-module/input-control/index.js +1 -1
  281. package/build-module/input-control/index.js.map +1 -1
  282. package/build-module/input-control/input-base.js +0 -1
  283. package/build-module/input-control/input-base.js.map +1 -1
  284. package/build-module/input-control/input-field.js +1 -1
  285. package/build-module/input-control/input-field.js.map +1 -1
  286. package/build-module/input-control/reducer/actions.js +0 -1
  287. package/build-module/input-control/reducer/actions.js.map +1 -1
  288. package/build-module/input-control/reducer/reducer.js +1 -1
  289. package/build-module/input-control/reducer/reducer.js.map +1 -1
  290. package/build-module/input-control/reducer/state.js +0 -1
  291. package/build-module/input-control/reducer/state.js.map +1 -1
  292. package/build-module/input-control/styles/input-control-styles.js +32 -30
  293. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  294. package/build-module/item-group/item/component.js +0 -1
  295. package/build-module/item-group/item/component.js.map +1 -1
  296. package/build-module/item-group/item/hook.js +1 -2
  297. package/build-module/item-group/item/hook.js.map +1 -1
  298. package/build-module/item-group/item-group/component.js +0 -1
  299. package/build-module/item-group/item-group/component.js.map +1 -1
  300. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +3 -1
  301. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  302. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +5 -13
  303. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  304. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +23 -5
  305. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  306. package/build-module/mobile/bottom-sheet/cell.native.js +3 -3
  307. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  308. package/build-module/mobile/bottom-sheet/index.native.js +16 -13
  309. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  310. package/build-module/mobile/bottom-sheet/range-text-input.native.js +2 -2
  311. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  312. package/build-module/mobile/color-settings/index.native.js +2 -0
  313. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  314. package/build-module/mobile/color-settings/palette.screen.native.js +5 -0
  315. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  316. package/build-module/mobile/color-settings/utils.native.js +7 -3
  317. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  318. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +6 -6
  319. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  320. package/build-module/mobile/link-picker/index.native.js +2 -1
  321. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  322. package/build-module/mobile/link-picker/link-picker-screen.native.js +13 -5
  323. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  324. package/build-module/mobile/link-settings/index.native.js +2 -1
  325. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  326. package/build-module/mobile/readable-content-view/index.native.js +2 -2
  327. package/build-module/mobile/readable-content-view/index.native.js.map +1 -1
  328. package/build-module/mobile/utils/use-is-floating-keyboard.native.js +2 -2
  329. package/build-module/mobile/utils/use-is-floating-keyboard.native.js.map +1 -1
  330. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +7 -3
  331. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  332. package/build-module/modal/index.js +1 -11
  333. package/build-module/modal/index.js.map +1 -1
  334. package/build-module/navigator/context.js +5 -1
  335. package/build-module/navigator/context.js.map +1 -1
  336. package/build-module/navigator/navigator-provider/component.js +43 -24
  337. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  338. package/build-module/navigator/navigator-screen/component.js +57 -32
  339. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  340. package/build-module/navigator/use-navigator.js +8 -8
  341. package/build-module/navigator/use-navigator.js.map +1 -1
  342. package/build-module/notice/index.native.js +2 -2
  343. package/build-module/notice/index.native.js.map +1 -1
  344. package/build-module/palette-edit/index.js +38 -30
  345. package/build-module/palette-edit/index.js.map +1 -1
  346. package/build-module/palette-edit/styles.js +11 -12
  347. package/build-module/palette-edit/styles.js.map +1 -1
  348. package/build-module/placeholder/index.js +4 -4
  349. package/build-module/placeholder/index.js.map +1 -1
  350. package/build-module/range-control/styles/range-control-styles.js +29 -29
  351. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  352. package/build-module/resizable-box/index.js.map +1 -1
  353. package/build-module/resizable-box/resize-tooltip/index.js +3 -3
  354. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  355. package/build-module/resizable-box/resize-tooltip/label.js +0 -1
  356. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  357. package/build-module/sandbox/index.native.js +5 -5
  358. package/build-module/sandbox/index.native.js.map +1 -1
  359. package/build-module/scrollable/hook.js +1 -1
  360. package/build-module/scrollable/hook.js.map +1 -1
  361. package/build-module/select-control/index.js.map +1 -1
  362. package/build-module/slot-fill/bubbles-virtually/fill.js +11 -2
  363. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  364. package/build-module/spacer/component.js +0 -1
  365. package/build-module/spacer/component.js.map +1 -1
  366. package/build-module/spinner/index.js +40 -5
  367. package/build-module/spinner/index.js.map +1 -1
  368. package/build-module/spinner/index.native.js +4 -2
  369. package/build-module/spinner/index.native.js.map +1 -1
  370. package/build-module/spinner/styles.js +49 -0
  371. package/build-module/spinner/styles.js.map +1 -0
  372. package/build-module/surface/hook.js +1 -1
  373. package/build-module/surface/hook.js.map +1 -1
  374. package/build-module/text/get-line-height.js +0 -1
  375. package/build-module/text/get-line-height.js.map +1 -1
  376. package/build-module/text/hook.js +5 -5
  377. package/build-module/text/hook.js.map +1 -1
  378. package/build-module/tip/index.js +4 -8
  379. package/build-module/tip/index.js.map +1 -1
  380. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -10
  381. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  382. package/build-module/toggle-group-control/toggle-group-control/styles.js +3 -11
  383. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  384. package/build-module/toggle-group-control/toggle-group-control-option/component.js +0 -1
  385. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  386. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  387. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  388. package/build-module/tools-panel/styles.js +10 -10
  389. package/build-module/tools-panel/styles.js.map +1 -1
  390. package/build-module/tools-panel/tools-panel/component.js +0 -1
  391. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  392. package/build-module/tools-panel/tools-panel/hook.js +52 -45
  393. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  394. package/build-module/tools-panel/tools-panel-header/component.js +0 -1
  395. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  396. package/build-module/tools-panel/tools-panel-header/hook.js +3 -3
  397. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  398. package/build-module/tools-panel/tools-panel-item/component.js +0 -1
  399. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  400. package/build-module/tools-panel/tools-panel-item/hook.js +17 -9
  401. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  402. package/build-module/tree-grid/index.js +18 -10
  403. package/build-module/tree-grid/index.js.map +1 -1
  404. package/build-module/truncate/hook.js +2 -2
  405. package/build-module/truncate/hook.js.map +1 -1
  406. package/build-module/ui/shortcut/component.js +0 -1
  407. package/build-module/ui/shortcut/component.js.map +1 -1
  408. package/build-module/ui/utils/font-size.js +0 -1
  409. package/build-module/ui/utils/font-size.js.map +1 -1
  410. package/build-module/ui/utils/get-valid-children.js +0 -1
  411. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  412. package/build-module/unit-control/index.js +0 -1
  413. package/build-module/unit-control/index.js.map +1 -1
  414. package/build-module/unit-control/unit-select-control.js +1 -2
  415. package/build-module/unit-control/unit-select-control.js.map +1 -1
  416. package/build-module/utils/colors-values.js +6 -3
  417. package/build-module/utils/colors-values.js.map +1 -1
  418. package/build-module/utils/config-values.js +1 -4
  419. package/build-module/utils/config-values.js.map +1 -1
  420. package/build-module/utils/hooks/use-combined-ref.js +0 -1
  421. package/build-module/utils/hooks/use-combined-ref.js.map +1 -1
  422. package/build-module/utils/hooks/use-latest-ref.js +0 -1
  423. package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
  424. package/build-module/z-stack/component.js +0 -1
  425. package/build-module/z-stack/component.js.map +1 -1
  426. package/build-style/style-rtl.css +22 -6
  427. package/build-style/style.css +22 -6
  428. package/build-types/base-control/index.d.ts.map +1 -1
  429. package/build-types/base-control/styles/base-control-styles.d.ts +4 -0
  430. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  431. package/build-types/button/index.d.ts.map +1 -1
  432. package/build-types/card/types.d.ts.map +1 -1
  433. package/build-types/circular-option-picker/index.d.ts +31 -0
  434. package/build-types/circular-option-picker/index.d.ts.map +1 -0
  435. package/build-types/color-palette/index.d.ts +16 -0
  436. package/build-types/color-palette/index.d.ts.map +1 -0
  437. package/build-types/color-palette/styles.d.ts +8 -0
  438. package/build-types/color-palette/styles.d.ts.map +1 -0
  439. package/build-types/color-picker/color-display.d.ts +14 -0
  440. package/build-types/color-picker/color-display.d.ts.map +1 -0
  441. package/build-types/color-picker/color-input.d.ts +14 -0
  442. package/build-types/color-picker/color-input.d.ts.map +1 -0
  443. package/build-types/color-picker/component.d.ts +11 -0
  444. package/build-types/color-picker/component.d.ts.map +1 -0
  445. package/build-types/color-picker/hex-input.d.ts +13 -0
  446. package/build-types/color-picker/hex-input.d.ts.map +1 -0
  447. package/build-types/color-picker/hsl-input.d.ts +13 -0
  448. package/build-types/color-picker/hsl-input.d.ts.map +1 -0
  449. package/build-types/color-picker/index.d.ts +5 -0
  450. package/build-types/color-picker/index.d.ts.map +1 -0
  451. package/build-types/color-picker/input-with-slider.d.ts +12 -0
  452. package/build-types/color-picker/input-with-slider.d.ts.map +1 -0
  453. package/build-types/color-picker/legacy-adapter.d.ts +6 -0
  454. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -0
  455. package/build-types/color-picker/picker.d.ts +10 -0
  456. package/build-types/color-picker/picker.d.ts.map +1 -0
  457. package/build-types/color-picker/rgb-input.d.ts +13 -0
  458. package/build-types/color-picker/rgb-input.d.ts.map +1 -0
  459. package/build-types/color-picker/styles.d.ts +76 -0
  460. package/build-types/color-picker/styles.d.ts.map +1 -0
  461. package/build-types/color-picker/types.d.ts +2 -0
  462. package/build-types/color-picker/types.d.ts.map +1 -0
  463. package/build-types/color-picker/use-deprecated-props.d.ts +49 -0
  464. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -0
  465. package/build-types/confirm-dialog/component.d.ts +11 -14
  466. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  467. package/build-types/confirm-dialog/styles.d.ts +10 -0
  468. package/build-types/confirm-dialog/styles.d.ts.map +1 -0
  469. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  470. package/build-types/divider/component.d.ts.map +1 -1
  471. package/build-types/dropdown/index.d.ts +1 -13
  472. package/build-types/dropdown/index.d.ts.map +1 -1
  473. package/build-types/elevation/hook.d.ts.map +1 -1
  474. package/build-types/elevation/types.d.ts.map +1 -1
  475. package/build-types/flex/flex/hook.d.ts.map +1 -1
  476. package/build-types/flex/types.d.ts.map +1 -1
  477. package/build-types/flyout/types.d.ts.map +1 -1
  478. package/build-types/grid/hook.d.ts.map +1 -1
  479. package/build-types/grid/types.d.ts.map +1 -1
  480. package/build-types/h-stack/hook.d.ts +1 -1
  481. package/build-types/h-stack/hook.d.ts.map +1 -1
  482. package/build-types/h-stack/types.d.ts.map +1 -1
  483. package/build-types/heading/component.d.ts.map +1 -1
  484. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  485. package/build-types/icon/index.d.ts.map +1 -1
  486. package/build-types/input-control/index.d.ts.map +1 -1
  487. package/build-types/input-control/input-base.d.ts.map +1 -1
  488. package/build-types/input-control/input-field.d.ts.map +1 -1
  489. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  490. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  491. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  492. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  493. package/build-types/input-control/types.d.ts.map +1 -1
  494. package/build-types/item-group/item/component.d.ts.map +1 -1
  495. package/build-types/item-group/item/hook.d.ts.map +1 -1
  496. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  497. package/build-types/navigator/context.d.ts.map +1 -1
  498. package/build-types/navigator/navigator-provider/component.d.ts +16 -17
  499. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  500. package/build-types/navigator/navigator-screen/component.d.ts +16 -16
  501. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  502. package/build-types/navigator/types.d.ts +10 -9
  503. package/build-types/navigator/types.d.ts.map +1 -1
  504. package/build-types/resizable-box/index.d.ts +1 -1
  505. package/build-types/resizable-box/index.d.ts.map +1 -1
  506. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  507. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  508. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  509. package/build-types/select-control/index.d.ts +3 -2
  510. package/build-types/select-control/index.d.ts.map +1 -1
  511. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  512. package/build-types/spacer/component.d.ts.map +1 -1
  513. package/build-types/spacer/types.d.ts.map +1 -1
  514. package/build-types/spinner/index.d.ts +18 -1
  515. package/build-types/spinner/index.d.ts.map +1 -1
  516. package/build-types/spinner/styles.d.ts +13 -0
  517. package/build-types/spinner/styles.d.ts.map +1 -0
  518. package/build-types/surface/hook.d.ts.map +1 -1
  519. package/build-types/text/get-line-height.d.ts.map +1 -1
  520. package/build-types/text/hook.d.ts.map +1 -1
  521. package/build-types/text/types.d.ts.map +1 -1
  522. package/build-types/tip/index.d.ts.map +1 -1
  523. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  524. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +0 -5
  525. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  526. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  527. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  528. package/build-types/toggle-group-control/types.d.ts +1 -7
  529. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  530. package/build-types/tools-panel/styles.d.ts.map +1 -1
  531. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  532. package/build-types/tools-panel/tools-panel/hook.d.ts +8 -4
  533. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  534. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  535. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  536. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  537. package/build-types/tools-panel/types.d.ts +14 -0
  538. package/build-types/tools-panel/types.d.ts.map +1 -1
  539. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  540. package/build-types/ui/control-group/types.d.ts.map +1 -1
  541. package/build-types/ui/form-group/types.d.ts.map +1 -1
  542. package/build-types/ui/shortcut/component.d.ts.map +1 -1
  543. package/build-types/ui/tooltip/types.d.ts.map +1 -1
  544. package/build-types/ui/utils/font-size.d.ts.map +1 -1
  545. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  546. package/build-types/unit-control/index.d.ts +3 -2
  547. package/build-types/unit-control/index.d.ts.map +1 -1
  548. package/build-types/unit-control/types.d.ts +2 -1
  549. package/build-types/unit-control/types.d.ts.map +1 -1
  550. package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
  551. package/build-types/utils/colors-values.d.ts +1 -0
  552. package/build-types/utils/colors-values.d.ts.map +1 -1
  553. package/build-types/utils/config-values.d.ts +1 -5
  554. package/build-types/utils/config-values.d.ts.map +1 -1
  555. package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -1
  556. package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -1
  557. package/build-types/v-stack/types.d.ts.map +1 -1
  558. package/build-types/z-stack/component.d.ts.map +1 -1
  559. package/package.json +20 -17
  560. package/src/base-control/index.js +11 -2
  561. package/src/base-control/styles/base-control-styles.js +10 -1
  562. package/src/base-field/hook.js +1 -1
  563. package/src/box-control/styles/box-control-styles.js +1 -1
  564. package/src/button/deprecated.js +1 -0
  565. package/src/button/index.js +1 -0
  566. package/src/card/card/component.js +1 -1
  567. package/src/card/card/hook.js +1 -1
  568. package/src/card/card-body/hook.js +1 -1
  569. package/src/card/card-divider/hook.js +1 -1
  570. package/src/card/card-footer/hook.js +1 -1
  571. package/src/card/card-header/hook.js +1 -1
  572. package/src/card/card-media/hook.js +1 -1
  573. package/src/card/types.ts +0 -1
  574. package/src/circular-option-picker/index.js +1 -0
  575. package/src/color-indicator/README.md +28 -0
  576. package/src/color-indicator/index.js +2 -0
  577. package/src/color-indicator/style.scss +1 -1
  578. package/src/color-palette/index.js +7 -8
  579. package/src/color-palette/index.native.js +2 -0
  580. package/src/color-palette/style.scss +11 -3
  581. package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
  582. package/src/color-picker/README.md +1 -1
  583. package/src/color-picker/color-display.tsx +1 -1
  584. package/src/color-picker/color-input.tsx +1 -1
  585. package/src/color-picker/component.tsx +3 -4
  586. package/src/color-picker/use-deprecated-props.ts +2 -1
  587. package/src/combobox-control/stories/index.js +6 -2
  588. package/src/combobox-control/style.scss +2 -2
  589. package/src/confirm-dialog/component.tsx +7 -4
  590. package/src/confirm-dialog/stories/index.js +5 -2
  591. package/src/confirm-dialog/styles.ts +18 -0
  592. package/src/confirm-dialog/types.ts +0 -1
  593. package/src/custom-gradient-bar/control-points.js +2 -3
  594. package/src/custom-gradient-picker/style.scss +0 -1
  595. package/src/custom-select-control/index.js +13 -1
  596. package/src/custom-select-control/stories/index.js +27 -0
  597. package/src/custom-select-control/test/index.js +46 -0
  598. package/src/date-time/README.md +4 -4
  599. package/src/date-time/test/time.js +2 -2
  600. package/src/date-time/time.js +2 -2
  601. package/src/dimension-control/README.md +2 -0
  602. package/src/divider/component.tsx +0 -1
  603. package/src/dropdown/index.js +14 -13
  604. package/src/elevation/hook.js +1 -0
  605. package/src/elevation/types.ts +0 -1
  606. package/src/external-link/styles/external-link-styles.js +3 -3
  607. package/src/flex/flex/hook.js +1 -0
  608. package/src/flex/types.ts +0 -1
  609. package/src/flyout/types.ts +0 -1
  610. package/src/form-token-field/style.scss +1 -1
  611. package/src/form-token-field/suggestions-list.js +109 -120
  612. package/src/form-token-field/test/index.js +4 -2
  613. package/src/gradient-picker/README.md +94 -0
  614. package/src/grid/hook.js +1 -0
  615. package/src/grid/types.ts +0 -1
  616. package/src/h-stack/types.ts +0 -1
  617. package/src/heading/component.tsx +0 -1
  618. package/src/icon/index.tsx +0 -1
  619. package/src/input-control/index.tsx +0 -1
  620. package/src/input-control/input-base.tsx +0 -1
  621. package/src/input-control/input-field.tsx +0 -1
  622. package/src/input-control/reducer/actions.ts +0 -1
  623. package/src/input-control/reducer/reducer.ts +0 -1
  624. package/src/input-control/reducer/state.ts +0 -1
  625. package/src/input-control/styles/input-control-styles.tsx +7 -7
  626. package/src/input-control/types.ts +0 -1
  627. package/src/item-group/item/component.tsx +0 -1
  628. package/src/item-group/item/hook.ts +1 -2
  629. package/src/item-group/item-group/component.tsx +0 -1
  630. package/src/item-group/stories/index.js +2 -2
  631. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -0
  632. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +8 -14
  633. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +33 -3
  634. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +162 -0
  635. package/src/mobile/bottom-sheet/cell.native.js +8 -6
  636. package/src/mobile/bottom-sheet/index.native.js +24 -14
  637. package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +3 -0
  638. package/src/mobile/bottom-sheet/range-text-input.native.js +5 -2
  639. package/src/mobile/bottom-sheet/styles.native.scss +4 -0
  640. package/src/mobile/bottom-sheet/test/index.native.js +24 -0
  641. package/src/mobile/color-settings/index.native.js +2 -0
  642. package/src/mobile/color-settings/palette.screen.native.js +5 -0
  643. package/src/mobile/color-settings/utils.native.js +8 -3
  644. package/src/mobile/html-text-input/test/index.native.js +34 -35
  645. package/src/mobile/keyboard-avoiding-view/index.ios.js +12 -9
  646. package/src/mobile/link-picker/index.native.js +2 -1
  647. package/src/mobile/link-picker/link-picker-screen.native.js +13 -5
  648. package/src/mobile/link-settings/index.native.js +2 -1
  649. package/src/mobile/link-settings/test/edit.native.js +172 -236
  650. package/src/mobile/link-settings/test/link-settings-navigation.native.js +97 -0
  651. package/src/mobile/readable-content-view/index.native.js +5 -2
  652. package/src/mobile/utils/use-is-floating-keyboard.native.js +2 -5
  653. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +11 -3
  654. package/src/modal/index.js +1 -10
  655. package/src/navigator/context.ts +5 -1
  656. package/src/navigator/navigator-provider/README.md +30 -20
  657. package/src/navigator/navigator-provider/component.tsx +69 -25
  658. package/src/navigator/navigator-screen/component.tsx +71 -34
  659. package/src/navigator/stories/index.js +26 -13
  660. package/src/navigator/test/index.js +167 -32
  661. package/src/navigator/types.ts +11 -11
  662. package/src/navigator/use-navigator.ts +4 -4
  663. package/src/notice/index.native.js +5 -2
  664. package/src/palette-edit/index.js +115 -75
  665. package/src/palette-edit/styles.js +22 -3
  666. package/src/placeholder/index.js +8 -6
  667. package/src/placeholder/style.scss +12 -0
  668. package/src/placeholder/test/index.js +18 -1
  669. package/src/range-control/styles/range-control-styles.js +1 -1
  670. package/src/resizable-box/index.tsx +0 -1
  671. package/src/resizable-box/resize-tooltip/index.tsx +1 -2
  672. package/src/resizable-box/resize-tooltip/label.tsx +0 -1
  673. package/src/sandbox/index.native.js +8 -5
  674. package/src/scrollable/hook.js +1 -1
  675. package/src/scrollable/stories/index.js +6 -3
  676. package/src/select-control/README.md +2 -2
  677. package/src/select-control/index.tsx +3 -2
  678. package/src/select-control/stories/index.js +1 -1
  679. package/src/slot-fill/bubbles-virtually/fill.js +12 -1
  680. package/src/spacer/component.tsx +0 -1
  681. package/src/spacer/types.ts +0 -1
  682. package/src/spinner/README.md +10 -10
  683. package/src/spinner/index.js +42 -3
  684. package/src/spinner/index.native.js +7 -2
  685. package/src/spinner/stories/index.js +36 -3
  686. package/src/spinner/styles.js +47 -0
  687. package/src/surface/hook.js +1 -0
  688. package/src/text/get-line-height.ts +0 -1
  689. package/src/text/hook.js +1 -0
  690. package/src/text/types.ts +0 -1
  691. package/src/tip/index.js +2 -4
  692. package/src/toggle-group-control/test/__snapshots__/index.js.snap +25 -27
  693. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -12
  694. package/src/toggle-group-control/toggle-group-control/styles.ts +0 -14
  695. package/src/toggle-group-control/toggle-group-control-option/component.tsx +0 -1
  696. package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -3
  697. package/src/toggle-group-control/types.ts +1 -9
  698. package/src/tools-panel/stories/index.js +21 -1
  699. package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +244 -0
  700. package/src/tools-panel/styles.ts +1 -3
  701. package/src/tools-panel/test/__snapshots__/index.js.snap +219 -0
  702. package/src/tools-panel/test/index.js +218 -20
  703. package/src/tools-panel/tools-panel/README.md +3 -2
  704. package/src/tools-panel/tools-panel/component.tsx +0 -1
  705. package/src/tools-panel/tools-panel/hook.ts +164 -97
  706. package/src/tools-panel/tools-panel-header/component.tsx +0 -1
  707. package/src/tools-panel/tools-panel-header/hook.ts +3 -3
  708. package/src/tools-panel/tools-panel-item/component.tsx +0 -1
  709. package/src/tools-panel/tools-panel-item/hook.ts +39 -8
  710. package/src/tools-panel/types.ts +14 -1
  711. package/src/tooltip/test/index.native.js +3 -1
  712. package/src/tree-grid/index.js +157 -126
  713. package/src/truncate/hook.js +1 -1
  714. package/src/ui/README.md +1 -1
  715. package/src/ui/context/wordpress-component.ts +0 -1
  716. package/src/ui/control-group/types.ts +0 -1
  717. package/src/ui/form-group/types.ts +0 -1
  718. package/src/ui/shortcut/component.tsx +0 -1
  719. package/src/ui/tooltip/types.ts +0 -1
  720. package/src/ui/utils/font-size.ts +0 -1
  721. package/src/ui/utils/get-valid-children.ts +0 -1
  722. package/src/unit-control/index.tsx +0 -1
  723. package/src/unit-control/types.ts +2 -2
  724. package/src/unit-control/unit-select-control.tsx +0 -1
  725. package/src/utils/colors-values.js +4 -3
  726. package/src/utils/config-values.js +1 -5
  727. package/src/utils/hooks/stories/use-cx.js +121 -44
  728. package/src/utils/hooks/use-combined-ref.ts +0 -1
  729. package/src/utils/hooks/use-latest-ref.ts +0 -1
  730. package/src/v-stack/types.ts +0 -1
  731. package/src/z-stack/component.tsx +0 -1
  732. package/tsconfig.json +3 -0
  733. package/tsconfig.tsbuildinfo +1 -1
  734. package/build/spinner/styles/spinner-styles.js +0 -40
  735. package/build/spinner/styles/spinner-styles.js.map +0 -1
  736. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -90
  737. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
  738. package/build-module/spinner/styles/spinner-styles.js +0 -28
  739. package/build-module/spinner/styles/spinner-styles.js.map +0 -1
  740. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -86
  741. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
  742. package/build-types/spinner/styles/spinner-styles.d.ts +0 -5
  743. package/build-types/spinner/styles/spinner-styles.d.ts.map +0 -1
  744. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
  745. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
  746. package/src/spinner/styles/spinner-styles.js +0 -47
  747. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +0 -86
  748. package/src/ui/visually-hidden/README.md +0 -21
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"names":["css","Flex","FlexItem","Text","COLORS","rtl","rootFocusedStyles","isFocused","rootLabelPositionStyles","labelPosition","Root","containerDisabledStyles","disabled","backgroundColor","ui","backgroundDisabled","background","containerMarginStyles","hideLabel","containerWidthStyles","__unstableInputWidth","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","default","small","fontSize","fontSizeMobile","sizeStyles","height","lineHeight","minHeight","paddingLeft","paddingRight","style","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","black","labelPadding","paddingBottom","paddingTop","BaseLabel","Label","props","LabelWrapper","backdropFocusedStyles","borderColor","borderFocus","border","boxShadow","borderDisabled","borderStyle","borderWidth","BackdropUI","Prefix","Suffix"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAsC,gBAAtC;AASA,SAASC,IAAT,EAAeC,QAAf,QAA+B,YAA/B;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,MAAT,EAAiBC,GAAjB,QAA4B,aAA5B;;;;;;;;;;;;AAeA,MAAMC,iBAAiB,GAAG,SAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB;AACA,CAJD;;;;;;;;;;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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAZ","sourcesContent":["/**\n * External dependencies\n */\nimport { css, SerializedStyles } from '@emotion/react';\nimport styled from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { COLORS, rtl } from '../../utils';\nimport type { LabelPosition, Size } from '../types';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\ntype RootProps = {\n\tisFocused?: boolean;\n\tlabelPosition?: LabelPosition;\n};\n\nconst rootFocusedStyles = ( { isFocused }: RootProps ) => {\n\tif ( ! isFocused ) return '';\n\n\treturn css( { zIndex: 1 } );\n};\n\nconst rootLabelPositionStyles = ( { labelPosition }: RootProps ) => {\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column;\n\t\t\t`;\n\t\tcase 'bottom':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t`;\n\t\tcase 'edge':\n\t\t\treturn css`\n\t\t\t\tjustify-content: space-between;\n\t\t\t`;\n\t\tdefault:\n\t\t\treturn '';\n\t}\n};\n\nexport const Root = styled( Flex )< RootProps >`\n\tposition: relative;\n\tborder-radius: 2px;\n\tpadding-top: 0;\n\t${ rootFocusedStyles }\n\t${ rootLabelPositionStyles }\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\n// Normalizes the margins from the <Flex /> (components/ui/flex/) container.\nconst containerMarginStyles = ( { hideLabel }: ContainerProps ) => {\n\treturn hideLabel ? css( { margin: '0 !important' } ) : null;\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) return css( { width: '100%' } );\n\n\tif ( labelPosition === 'side' ) return '';\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerMarginStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) return '';\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nconst fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) return '';\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nconst sizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 30,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 30,\n\t\t\tpaddingLeft: 8,\n\t\t\tpaddingRight: 8,\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: 8,\n\t\t\tpaddingRight: 8,\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: 16,\n\t\t\tpaddingRight: 16,\n\t\t},\n\t};\n\n\tconst style = sizes[ size as Size ] || sizes.default;\n\n\treturn css( style );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.black };\n\t\tdisplay: block;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\t}\n`;\n\nconst labelPadding = ( {\n\tlabelPosition,\n}: {\n\tlabelPosition?: LabelPosition;\n} ) => {\n\tlet paddingBottom = 4;\n\n\tif ( labelPosition === 'edge' || labelPosition === 'side' ) {\n\t\tpaddingBottom = 0;\n\t}\n\n\treturn css( { paddingTop: 0, paddingBottom } );\n};\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tcolor: currentColor;\n\t\tdisplay: block;\n\t\tmargin: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\t${ labelPadding }\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisFocused?: boolean;\n};\n\nconst backdropFocusedStyles = ( {\n\tdisabled,\n\tisFocused,\n}: BackdropProps ): SerializedStyles => {\n\tlet borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;\n\n\tlet boxShadow;\n\n\tif ( isFocused ) {\n\t\tboxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;\n\t}\n\n\tif ( disabled ) {\n\t\tborderColor = COLORS.ui.borderDisabled;\n\t}\n\n\treturn css( {\n\t\tboxShadow,\n\t\tborderColor,\n\t\tborderStyle: 'solid',\n\t\tborderWidth: 1,\n\t} );\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-radius: inherit;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ backdropFocusedStyles }\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"names":["css","Flex","FlexItem","Text","COLORS","rtl","rootFocusedStyles","isFocused","rootLabelPositionStyles","labelPosition","Root","containerDisabledStyles","disabled","backgroundColor","ui","backgroundDisabled","background","containerMarginStyles","hideLabel","containerWidthStyles","__unstableInputWidth","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","default","small","fontSize","fontSizeMobile","sizeStyles","height","lineHeight","minHeight","paddingLeft","paddingRight","style","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","black","labelMargin","marginBottom","marginTop","marginRight","marginLeft","BaseLabel","Label","props","LabelWrapper","backdropFocusedStyles","borderColor","borderFocus","border","boxShadow","borderDisabled","borderStyle","borderWidth","BackdropUI","Prefix","Suffix"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAsC,gBAAtC;AAQA,SAASC,IAAT,EAAeC,QAAf,QAA+B,YAA/B;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,MAAT,EAAiBC,GAAjB,QAA4B,aAA5B;;;;;;;;;;;;AAeA,MAAMC,iBAAiB,GAAG,SAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB;AACA,CAJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAMC,uBAAuB,GAAG,SAAoC;AAAA,MAAlC;AAAEC,IAAAA;AAAF,GAAkC;;AACnE,UAASA,aAAT;AACC,SAAK,KAAL;AACC;;AAID,SAAK,QAAL;AACC;;AAID,SA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yles } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { COLORS, rtl } from '../../utils';\nimport type { LabelPosition, Size } from '../types';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\ntype RootProps = {\n\tisFocused?: boolean;\n\tlabelPosition?: LabelPosition;\n};\n\nconst rootFocusedStyles = ( { isFocused }: RootProps ) => {\n\tif ( ! isFocused ) return '';\n\n\treturn css( { zIndex: 1 } );\n};\n\nconst rootLabelPositionStyles = ( { labelPosition }: RootProps ) => {\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column;\n\t\t\t`;\n\t\tcase 'bottom':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t`;\n\t\tcase 'edge':\n\t\t\treturn css`\n\t\t\t\tjustify-content: space-between;\n\t\t\t`;\n\t\tdefault:\n\t\t\treturn '';\n\t}\n};\n\nexport const Root = styled( Flex )< RootProps >`\n\tposition: relative;\n\tborder-radius: 2px;\n\tpadding-top: 0;\n\t${ rootFocusedStyles }\n\t${ rootLabelPositionStyles }\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\n// Normalizes the margins from the <Flex /> (components/ui/flex/) container.\nconst containerMarginStyles = ( { hideLabel }: ContainerProps ) => {\n\treturn hideLabel ? css( { margin: '0 !important' } ) : null;\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) return css( { width: '100%' } );\n\n\tif ( labelPosition === 'side' ) return '';\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerMarginStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) return '';\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nconst fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) return '';\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nconst sizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 30,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 30,\n\t\t\tpaddingLeft: 8,\n\t\t\tpaddingRight: 8,\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: 8,\n\t\t\tpaddingRight: 8,\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: 16,\n\t\t\tpaddingRight: 16,\n\t\t},\n\t};\n\n\tconst style = sizes[ size as Size ] || sizes.default;\n\n\treturn css( style );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.black };\n\t\tdisplay: block;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\t}\n`;\n\nconst labelMargin = ( {\n\tlabelPosition,\n}: {\n\tlabelPosition?: LabelPosition;\n} ) => {\n\tlet marginBottom = 8;\n\n\tif ( labelPosition === 'edge' || labelPosition === 'side' ) {\n\t\tmarginBottom = 0;\n\t}\n\n\treturn css( { marginTop: 0, marginRight: 0, marginBottom, marginLeft: 0 } );\n};\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tcolor: currentColor;\n\t\tdisplay: block;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\t${ labelMargin }\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisFocused?: boolean;\n};\n\nconst backdropFocusedStyles = ( {\n\tdisabled,\n\tisFocused,\n}: BackdropProps ): SerializedStyles => {\n\tlet borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;\n\n\tlet boxShadow;\n\n\tif ( isFocused ) {\n\t\tboxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;\n\t}\n\n\tif ( disabled ) {\n\t\tborderColor = COLORS.ui.borderDisabled;\n\t}\n\n\treturn css( {\n\t\tboxShadow,\n\t\tborderColor,\n\t\tborderStyle: 'solid',\n\t\tborderWidth: 1,\n\t} );\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-radius: inherit;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ backdropFocusedStyles }\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n"]}
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- // eslint-disable-next-line no-restricted-imports
8
7
 
9
8
  /**
10
9
  * Internal dependencies
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/item-group/item/component.tsx"],"names":["useItem","contextConnect","View","Item","props","forwardedRef","role","wrapperClassName","otherProps"],"mappings":";;;AAAA;AACA;AACA;AACA;;AAGA;AACA;AACA;AAEA,SAASA,OAAT,QAAwB,QAAxB;AACA,SAASC,cAAT,QAAwD,kBAAxD;AACA,SAASC,IAAT,QAAqB,YAArB;;AAEA,SAASC,IAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,gBAAR;AAA0B,OAAGC;AAA7B,MAA4CR,OAAO,CAAEI,KAAF,CAAzD;AAEA,SACC;AAAK,IAAA,IAAI,EAAGE,IAAZ;AAAmB,IAAA,SAAS,EAAGC;AAA/B,KACC,cAAC,IAAD,eAAWC,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,KADD,CADD;AAKA;;AAED,eAAeJ,cAAc,CAAEE,IAAF,EAAQ,MAAR,CAA7B","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction Item(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\nexport default contextConnect( Item, 'Item' );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/item-group/item/component.tsx"],"names":["useItem","contextConnect","View","Item","props","forwardedRef","role","wrapperClassName","otherProps"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AAEA,SAASA,OAAT,QAAwB,QAAxB;AACA,SAASC,cAAT,QAAwD,kBAAxD;AACA,SAASC,IAAT,QAAqB,YAArB;;AAEA,SAASC,IAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,gBAAR;AAA0B,OAAGC;AAA7B,MAA4CR,OAAO,CAAEI,KAAF,CAAzD;AAEA,SACC;AAAK,IAAA,IAAI,EAAGE,IAAZ;AAAmB,IAAA,SAAS,EAAGC;AAA/B,KACC,cAAC,IAAD,eAAWC,UAAX;AAAwB,IAAA,GAAG,EAAGH;AAA9B,KADD,CADD;AAKA;;AAED,eAAeJ,cAAc,CAAEE,IAAF,EAAQ,MAAR,CAA7B","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ItemProps } from '../types';\nimport { useItem } from './hook';\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { View } from '../../view';\n\nfunction Item(\n\tprops: WordPressComponentProps< ItemProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst { role, wrapperClassName, ...otherProps } = useItem( props );\n\n\treturn (\n\t\t<div role={ role } className={ wrapperClassName }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</div>\n\t);\n}\n\nexport default contextConnect( Item, 'Item' );\n"]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
 
6
5
  /**
7
6
  * WordPress dependencies
@@ -31,7 +30,7 @@ export function useItem(props) {
31
30
  const size = sizeProp || contextSize;
32
31
  const as = asProp || (typeof onClick !== 'undefined' ? 'button' : 'div');
33
32
  const cx = useCx();
34
- const classes = useMemo(() => cx(as === 'button' && styles.unstyledButton, styles.itemSizes[size] || styles.itemSizes.medium, styles.item, spacedAround && styles.spacedAround, className), [as, className, size, spacedAround]);
33
+ const classes = useMemo(() => cx(as === 'button' && styles.unstyledButton, styles.itemSizes[size] || styles.itemSizes.medium, styles.item, spacedAround && styles.spacedAround, className), [as, className, cx, size, spacedAround]);
35
34
  const wrapperClassName = cx(styles.itemWrapper);
36
35
  return {
37
36
  as,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/item-group/item/hook.ts"],"names":["useMemo","useContextSystem","styles","useItemGroupContext","useCx","useItem","props","as","asProp","className","onClick","role","size","sizeProp","otherProps","spacedAround","contextSize","cx","classes","unstyledButton","itemSizes","medium","item","wrapperClassName","itemWrapper"],"mappings":"AAAA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,OAAO,KAAKC,MAAZ,MAAwB,WAAxB;AACA,SAASC,mBAAT,QAAoC,YAApC;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAGA,OAAO,SAASC,OAAT,CAAkBC,KAAlB,EAAuE;AAC7E,QAAM;AACLC,IAAAA,EAAE,EAAEC,MADC;AAELC,IAAAA,SAFK;AAGLC,IAAAA,OAHK;AAILC,IAAAA,IAAI,GAAG,UAJF;AAKLC,IAAAA,IAAI,EAAEC,QALD;AAML,OAAGC;AANE,MAOFb,gBAAgB,CAAEK,KAAF,EAAS,MAAT,CAPpB;AASA,QAAM;AAAES,IAAAA,YAAF;AAAgBH,IAAAA,IAAI,EAAEI;AAAtB,MAAsCb,mBAAmB,EAA/D;AAEA,QAAMS,IAAI,GAAGC,QAAQ,IAAIG,WAAzB;AAEA,QAAMT,EAAE,GACPC,MAAM,KACF,OAAOE,OAAP,KAAmB,WAAnB,GACD,QADC,GAED,KAHG,CADP;AAMA,QAAMO,EAAE,GAAGb,KAAK,EAAhB;AAEA,QAAMc,OAAO,GAAGlB,OAAO,CACtB,MACCiB,EAAE,CACDV,EAAE,KAAK,QAAP,IAAmBL,MAAM,CAACiB,cADzB,EAEDjB,MAAM,CAACkB,SAAP,CAAkBR,IAAlB,KAA4BV,MAAM,CAACkB,SAAP,CAAiBC,MAF5C,EAGDnB,MAAM,CAACoB,IAHN,EAIDP,YAAY,IAAIb,MAAM,CAACa,YAJtB,EAKDN,SALC,CAFmB,EAStB,CAAEF,EAAF,EAAME,SAAN,EAAiBG,IAAjB,EAAuBG,YAAvB,CATsB,CAAvB;AAYA,QAAMQ,gBAAgB,GAAGN,EAAE,CAAEf,MAAM,CAACsB,WAAT,CAA3B;AAEA,SAAO;AACNjB,IAAAA,EADM;AAENE,IAAAA,SAAS,EAAES,OAFL;AAGNR,IAAAA,OAHM;AAINa,IAAAA,gBAJM;AAKNZ,IAAAA,IALM;AAMN,OAAGG;AANG,GAAP;AAQA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { ElementType } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport * as styles from '../styles';\nimport { useItemGroupContext } from '../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { ItemProps } from '../types';\n\nexport function useItem( props: WordPressComponentProps< ItemProps, 'div' > ) {\n\tconst {\n\t\tas: asProp,\n\t\tclassName,\n\t\tonClick,\n\t\trole = 'listitem',\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Item' );\n\n\tconst { spacedAround, size: contextSize } = useItemGroupContext();\n\n\tconst size = sizeProp || contextSize;\n\n\tconst as =\n\t\tasProp ||\n\t\t( ( typeof onClick !== 'undefined'\n\t\t\t? 'button'\n\t\t\t: 'div' ) as ElementType );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tas === 'button' && styles.unstyledButton,\n\t\t\t\tstyles.itemSizes[ size ] || styles.itemSizes.medium,\n\t\t\t\tstyles.item,\n\t\t\t\tspacedAround && styles.spacedAround,\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ as, className, size, spacedAround ]\n\t);\n\n\tconst wrapperClassName = cx( styles.itemWrapper );\n\n\treturn {\n\t\tas,\n\t\tclassName: classes,\n\t\tonClick,\n\t\twrapperClassName,\n\t\trole,\n\t\t...otherProps,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/item-group/item/hook.ts"],"names":["useMemo","useContextSystem","styles","useItemGroupContext","useCx","useItem","props","as","asProp","className","onClick","role","size","sizeProp","otherProps","spacedAround","contextSize","cx","classes","unstyledButton","itemSizes","medium","item","wrapperClassName","itemWrapper"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,OAAO,KAAKC,MAAZ,MAAwB,WAAxB;AACA,SAASC,mBAAT,QAAoC,YAApC;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAGA,OAAO,SAASC,OAAT,CAAkBC,KAAlB,EAAuE;AAC7E,QAAM;AACLC,IAAAA,EAAE,EAAEC,MADC;AAELC,IAAAA,SAFK;AAGLC,IAAAA,OAHK;AAILC,IAAAA,IAAI,GAAG,UAJF;AAKLC,IAAAA,IAAI,EAAEC,QALD;AAML,OAAGC;AANE,MAOFb,gBAAgB,CAAEK,KAAF,EAAS,MAAT,CAPpB;AASA,QAAM;AAAES,IAAAA,YAAF;AAAgBH,IAAAA,IAAI,EAAEI;AAAtB,MAAsCb,mBAAmB,EAA/D;AAEA,QAAMS,IAAI,GAAGC,QAAQ,IAAIG,WAAzB;AAEA,QAAMT,EAAE,GACPC,MAAM,KACF,OAAOE,OAAP,KAAmB,WAAnB,GACD,QADC,GAED,KAHG,CADP;AAMA,QAAMO,EAAE,GAAGb,KAAK,EAAhB;AAEA,QAAMc,OAAO,GAAGlB,OAAO,CACtB,MACCiB,EAAE,CACDV,EAAE,KAAK,QAAP,IAAmBL,MAAM,CAACiB,cADzB,EAEDjB,MAAM,CAACkB,SAAP,CAAkBR,IAAlB,KAA4BV,MAAM,CAACkB,SAAP,CAAiBC,MAF5C,EAGDnB,MAAM,CAACoB,IAHN,EAIDP,YAAY,IAAIb,MAAM,CAACa,YAJtB,EAKDN,SALC,CAFmB,EAStB,CAAEF,EAAF,EAAME,SAAN,EAAiBQ,EAAjB,EAAqBL,IAArB,EAA2BG,YAA3B,CATsB,CAAvB;AAYA,QAAMQ,gBAAgB,GAAGN,EAAE,CAAEf,MAAM,CAACsB,WAAT,CAA3B;AAEA,SAAO;AACNjB,IAAAA,EADM;AAENE,IAAAA,SAAS,EAAES,OAFL;AAGNR,IAAAA,OAHM;AAINa,IAAAA,gBAJM;AAKNZ,IAAAA,IALM;AAMN,OAAGG;AANG,GAAP;AAQA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ElementType } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport * as styles from '../styles';\nimport { useItemGroupContext } from '../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { ItemProps } from '../types';\n\nexport function useItem( props: WordPressComponentProps< ItemProps, 'div' > ) {\n\tconst {\n\t\tas: asProp,\n\t\tclassName,\n\t\tonClick,\n\t\trole = 'listitem',\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Item' );\n\n\tconst { spacedAround, size: contextSize } = useItemGroupContext();\n\n\tconst size = sizeProp || contextSize;\n\n\tconst as =\n\t\tasProp ||\n\t\t( ( typeof onClick !== 'undefined'\n\t\t\t? 'button'\n\t\t\t: 'div' ) as ElementType );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tas === 'button' && styles.unstyledButton,\n\t\t\t\tstyles.itemSizes[ size ] || styles.itemSizes.medium,\n\t\t\t\tstyles.item,\n\t\t\t\tspacedAround && styles.spacedAround,\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ as, className, cx, size, spacedAround ]\n\t);\n\n\tconst wrapperClassName = cx( styles.itemWrapper );\n\n\treturn {\n\t\tas,\n\t\tclassName: classes,\n\t\tonClick,\n\t\twrapperClassName,\n\t\trole,\n\t\t...otherProps,\n\t};\n}\n"]}
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- // eslint-disable-next-line no-restricted-imports
8
7
 
9
8
  /**
10
9
  * Internal dependencies
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/item-group/item-group/component.tsx"],"names":["contextConnect","useItemGroup","ItemGroupContext","useItemGroupContext","View","ItemGroup","props","forwardedRef","isBordered","isSeparated","size","sizeProp","otherProps","contextSize","spacedAround","contextValue"],"mappings":";;;AAAA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,cAAT,QAAwD,kBAAxD;AACA,SAASC,YAAT,QAA6B,QAA7B;AACA,SAASC,gBAAT,EAA2BC,mBAA3B,QAAsD,YAAtD;AACA,SAASC,IAAT,QAAqB,YAArB;;AAGA,SAASC,SAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,IAAI,EAAEC,QAHD;AAIL,OAAGC;AAJE,MAKFX,YAAY,CAAEK,KAAF,CALhB;AAOA,QAAM;AAAEI,IAAAA,IAAI,EAAEG;AAAR,MAAwBV,mBAAmB,EAAjD;AAEA,QAAMW,YAAY,GAAG,CAAEN,UAAF,IAAgB,CAAEC,WAAvC;AACA,QAAMC,IAAI,GAAGC,QAAQ,IAAIE,WAAzB;AAEA,QAAME,YAAY,GAAG;AACpBD,IAAAA,YADoB;AAEpBJ,IAAAA;AAFoB,GAArB;AAKA,SACC,cAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGK;AAAnC,KACC,cAAC,IAAD,eAAWH,UAAX;AAAwB,IAAA,GAAG,EAAGL;AAA9B,KADD,CADD;AAKA;;AAED,eAAeP,cAAc,CAAEK,SAAF,EAAa,WAAb,CAA7B","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useItemGroup } from './hook';\nimport { ItemGroupContext, useItemGroupContext } from '../context';\nimport { View } from '../../view';\nimport type { ItemGroupProps } from '../types';\n\nfunction ItemGroup(\n\tprops: WordPressComponentProps< ItemGroupProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tisBordered,\n\t\tisSeparated,\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useItemGroup( props );\n\n\tconst { size: contextSize } = useItemGroupContext();\n\n\tconst spacedAround = ! isBordered && ! isSeparated;\n\tconst size = sizeProp || contextSize;\n\n\tconst contextValue = {\n\t\tspacedAround,\n\t\tsize,\n\t};\n\n\treturn (\n\t\t<ItemGroupContext.Provider value={ contextValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</ItemGroupContext.Provider>\n\t);\n}\n\nexport default contextConnect( ItemGroup, 'ItemGroup' );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/item-group/item-group/component.tsx"],"names":["contextConnect","useItemGroup","ItemGroupContext","useItemGroupContext","View","ItemGroup","props","forwardedRef","isBordered","isSeparated","size","sizeProp","otherProps","contextSize","spacedAround","contextValue"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,cAAT,QAAwD,kBAAxD;AACA,SAASC,YAAT,QAA6B,QAA7B;AACA,SAASC,gBAAT,EAA2BC,mBAA3B,QAAsD,YAAtD;AACA,SAASC,IAAT,QAAqB,YAArB;;AAGA,SAASC,SAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,IAAI,EAAEC,QAHD;AAIL,OAAGC;AAJE,MAKFX,YAAY,CAAEK,KAAF,CALhB;AAOA,QAAM;AAAEI,IAAAA,IAAI,EAAEG;AAAR,MAAwBV,mBAAmB,EAAjD;AAEA,QAAMW,YAAY,GAAG,CAAEN,UAAF,IAAgB,CAAEC,WAAvC;AACA,QAAMC,IAAI,GAAGC,QAAQ,IAAIE,WAAzB;AAEA,QAAME,YAAY,GAAG;AACpBD,IAAAA,YADoB;AAEpBJ,IAAAA;AAFoB,GAArB;AAKA,SACC,cAAC,gBAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGK;AAAnC,KACC,cAAC,IAAD,eAAWH,UAAX;AAAwB,IAAA,GAAG,EAAGL;AAA9B,KADD,CADD;AAKA;;AAED,eAAeP,cAAc,CAAEK,SAAF,EAAa,WAAb,CAA7B","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { contextConnect, WordPressComponentProps } from '../../ui/context';\nimport { useItemGroup } from './hook';\nimport { ItemGroupContext, useItemGroupContext } from '../context';\nimport { View } from '../../view';\nimport type { ItemGroupProps } from '../types';\n\nfunction ItemGroup(\n\tprops: WordPressComponentProps< ItemGroupProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tisBordered,\n\t\tisSeparated,\n\t\tsize: sizeProp,\n\t\t...otherProps\n\t} = useItemGroup( props );\n\n\tconst { size: contextSize } = useItemGroupContext();\n\n\tconst spacedAround = ! isBordered && ! isSeparated;\n\tconst size = sizeProp || contextSize;\n\n\tconst contextValue = {\n\t\tspacedAround,\n\t\tsize,\n\t};\n\n\treturn (\n\t\t<ItemGroupContext.Provider value={ contextValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef } />\n\t\t</ItemGroupContext.Provider>\n\t);\n}\n\nexport default contextConnect( ItemGroup, 'ItemGroup' );\n"]}
@@ -28,7 +28,9 @@ export const BottomSheetContext = createContext({
28
28
  onHandleClosingBottomSheet: () => {},
29
29
  // Android only: Function called to control android hardware back button functionality
30
30
  // Return true if the bottom-sheet default close action shouldn't be called
31
- onHandleHardwareButtonPress: () => {}
31
+ onHandleHardwareButtonPress: () => {},
32
+ // Toggle full-screen styles and dimensions
33
+ setIsFullScreen: () => {}
32
34
  });
33
35
  export const {
34
36
  Provider: BottomSheetProvider,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-context.native.js"],"names":["Platform","UIManager","createContext","OS","setLayoutAnimationEnabledExperimental","BottomSheetContext","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","onHandleHardwareButtonPress","Provider","BottomSheetProvider","Consumer","BottomSheetConsumer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,cAApC;AACA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B,C,CAEA;AACA;;AACA,IACCF,QAAQ,CAACG,EAAT,KAAgB,SAAhB,IACAF,SAAS,CAACG,qCAFX,EAGE;AACDH,EAAAA,SAAS,CAACG,qCAAV,CAAiD,IAAjD;AACA,C,CAED;AACA;;;AACA,OAAO,MAAMC,kBAAkB,GAAGH,aAAa,CAAE;AAChD;AACAI,EAAAA,6BAA6B,EAAE,KAFiB;AAGhD;AACAC,EAAAA,6BAA6B,EAAE,MAAM,CAAE,CAJS;AAKhD;AACA;AACA;AACAC,EAAAA,gCAAgC,EAAE,MAAM,CAAE,CARM;AAShD;AACAC,EAAAA,0BAA0B,EAAE,MAAM,CAAE,CAVY;AAWhD;AACA;AACAC,EAAAA,2BAA2B,EAAE,MAAM,CAAE;AAbW,CAAF,CAAxC;AAgBP,OAAO,MAAM;AACZC,EAAAA,QAAQ,EAAEC,mBADE;AAEZC,EAAAA,QAAQ,EAAEC;AAFE,IAGTT,kBAHG","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, UIManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n// It's needed to set the following flags via UIManager\n// to have `LayoutAnimation` working on Android\nif (\n\tPlatform.OS === 'android' &&\n\tUIManager.setLayoutAnimationEnabledExperimental\n) {\n\tUIManager.setLayoutAnimationEnabledExperimental( true );\n}\n\n// Context in BottomSheet is necessary for controlling the\n// transition flow between subsheets and replacing a content inside them\nexport const BottomSheetContext = createContext( {\n\t// Specifies whether content is currently scrolling\n\tisBottomSheetContentScrolling: false,\n\t// Function called to enable scroll within bottom sheet\n\tshouldEnableBottomSheetScroll: () => {},\n\t// Function called to enable/disable bottom sheet max height.\n\t// E.g. used to extend bottom sheet on full screen in ColorPicker,\n\t// which is helpful on small devices with set the largest font/display size.\n\tshouldEnableBottomSheetMaxHeight: () => {},\n\t// Callback that is called on closing bottom sheet\n\tonHandleClosingBottomSheet: () => {},\n\t// Android only: Function called to control android hardware back button functionality\n\t// Return true if the bottom-sheet default close action shouldn't be called\n\tonHandleHardwareButtonPress: () => {},\n} );\n\nexport const {\n\tProvider: BottomSheetProvider,\n\tConsumer: BottomSheetConsumer,\n} = BottomSheetContext;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-context.native.js"],"names":["Platform","UIManager","createContext","OS","setLayoutAnimationEnabledExperimental","BottomSheetContext","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","onHandleHardwareButtonPress","setIsFullScreen","Provider","BottomSheetProvider","Consumer","BottomSheetConsumer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,cAApC;AACA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B,C,CAEA;AACA;;AACA,IACCF,QAAQ,CAACG,EAAT,KAAgB,SAAhB,IACAF,SAAS,CAACG,qCAFX,EAGE;AACDH,EAAAA,SAAS,CAACG,qCAAV,CAAiD,IAAjD;AACA,C,CAED;AACA;;;AACA,OAAO,MAAMC,kBAAkB,GAAGH,aAAa,CAAE;AAChD;AACAI,EAAAA,6BAA6B,EAAE,KAFiB;AAGhD;AACAC,EAAAA,6BAA6B,EAAE,MAAM,CAAE,CAJS;AAKhD;AACA;AACA;AACAC,EAAAA,gCAAgC,EAAE,MAAM,CAAE,CARM;AAShD;AACAC,EAAAA,0BAA0B,EAAE,MAAM,CAAE,CAVY;AAWhD;AACA;AACAC,EAAAA,2BAA2B,EAAE,MAAM,CAAE,CAbW;AAchD;AACAC,EAAAA,eAAe,EAAE,MAAM,CAAE;AAfuB,CAAF,CAAxC;AAkBP,OAAO,MAAM;AACZC,EAAAA,QAAQ,EAAEC,mBADE;AAEZC,EAAAA,QAAQ,EAAEC;AAFE,IAGTV,kBAHG","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, UIManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n// It's needed to set the following flags via UIManager\n// to have `LayoutAnimation` working on Android\nif (\n\tPlatform.OS === 'android' &&\n\tUIManager.setLayoutAnimationEnabledExperimental\n) {\n\tUIManager.setLayoutAnimationEnabledExperimental( true );\n}\n\n// Context in BottomSheet is necessary for controlling the\n// transition flow between subsheets and replacing a content inside them\nexport const BottomSheetContext = createContext( {\n\t// Specifies whether content is currently scrolling\n\tisBottomSheetContentScrolling: false,\n\t// Function called to enable scroll within bottom sheet\n\tshouldEnableBottomSheetScroll: () => {},\n\t// Function called to enable/disable bottom sheet max height.\n\t// E.g. used to extend bottom sheet on full screen in ColorPicker,\n\t// which is helpful on small devices with set the largest font/display size.\n\tshouldEnableBottomSheetMaxHeight: () => {},\n\t// Callback that is called on closing bottom sheet\n\tonHandleClosingBottomSheet: () => {},\n\t// Android only: Function called to control android hardware back button functionality\n\t// Return true if the bottom-sheet default close action shouldn't be called\n\tonHandleHardwareButtonPress: () => {},\n\t// Toggle full-screen styles and dimensions\n\tsetIsFullScreen: () => {},\n} );\n\nexport const {\n\tProvider: BottomSheetProvider,\n\tConsumer: BottomSheetConsumer,\n} = BottomSheetContext;\n"]}
@@ -11,7 +11,7 @@ import { createStackNavigator } from '@react-navigation/stack';
11
11
  * WordPress dependencies
12
12
  */
13
13
 
14
- import { useState, useContext, useMemo, useCallback, Children, useRef, cloneElement, Platform } from '@wordpress/element';
14
+ import { useState, useContext, useMemo, useCallback, Children, useRef, cloneElement } from '@wordpress/element';
15
15
  import { usePreferredColorSchemeStyle } from '@wordpress/compose';
16
16
  /**
17
17
  * Internal dependencies
@@ -70,22 +70,14 @@ function BottomSheetNavigationContainer(_ref2) {
70
70
  };
71
71
 
72
72
  const setHeight = useCallback(height => {
73
- // The screen is fullHeight or changing from fullScreen to the default mode
74
- if (typeof currentHeight === 'string' && typeof height !== 'string' || typeof height === 'string') {
75
- // Animating the opacity for the initial modal results in the backdrop
76
- // provided by react-native-modal to never transition from transparent
77
- // to partially opaque black. The core issue was not idenfited, but it
78
- // may relate to the experimental state of LayoutAnimation for Android.
79
- // https://reactnative.dev/docs/layoutanimation
80
- if (!Platform.isAndroid || currentHeight !== 1) {
81
- performLayoutAnimation(ANIMATION_DURATION);
82
- }
83
-
73
+ // The screen is fullHeight
74
+ if (typeof height === 'string' && typeof height !== typeof currentHeight) {
75
+ performLayoutAnimation(ANIMATION_DURATION);
84
76
  setCurrentHeight(height);
85
77
  return;
86
78
  }
87
79
 
88
- if (height > 1) {
80
+ if (height > 1 && Math.round(height) !== Math.round(currentHeight)) {
89
81
  if (currentHeight === 1) {
90
82
  setCurrentHeight(height);
91
83
  } else if (animate) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js"],"names":["View","Easing","NavigationContainer","DefaultTheme","createStackNavigator","useState","useContext","useMemo","useCallback","Children","useRef","cloneElement","Platform","usePreferredColorSchemeStyle","performLayoutAnimation","BottomSheetNavigationContext","BottomSheetNavigationProvider","styles","AnimationSpec","animation","config","duration","easing","ease","fadeConfig","current","cardStyle","opacity","progress","options","transitionSpec","open","close","headerShown","gestureEnabled","cardStyleInterpolator","ANIMATION_DURATION","BottomSheetNavigationContainer","children","animate","main","theme","style","Stack","context","currentHeight","setCurrentHeight","backgroundStyle","background","backgroundDark","_theme","colors","backgroundColor","setHeight","height","isAndroid","screens","map","child","screen","name","otherProps","props","isNested"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,cAA7B;AACA,SAASC,mBAAT,EAA8BC,YAA9B,QAAkD,0BAAlD;AACA,SAASC,oBAAT,QAAqC,yBAArC;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,UAFD,EAGCC,OAHD,EAICC,WAJD,EAKCC,QALD,EAMCC,MAND,EAOCC,YAPD,EAQCC,QARD,QASO,oBATP;AAWA,SAASC,4BAAT,QAA6C,oBAA7C;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,wBAAvC;AACA,SACCC,4BADD,EAECC,6BAFD,QAGO,mCAHP;AAKA,OAAOC,MAAP,MAAmB,eAAnB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,QADU;AAErBC,EAAAA,MAAM,EAAE;AACPC,IAAAA,QAAQ,EAAE,GADH;AAEPC,IAAAA,MAAM,EAAErB,MAAM,CAACsB;AAFR;AAFa,CAAtB;;AAQA,MAAMC,UAAU,GAAG,QAAmB;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AACrC,SAAO;AACNC,IAAAA,SAAS,EAAE;AACVC,MAAAA,OAAO,EAAEF,OAAO,CAACG;AADP;AADL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ACC,MAAA,KAAK,EAAG;AACPQ,QAAAA,SADO;AAEPR,QAAAA;AAFO;AADT,OAMGL,IAAI,GACL,cAAC,mBAAD;AAAqB,MAAA,KAAK,EAAGU;AAA7B,OACC,cAAC,KAAD,CAAO,SAAP;AAAiB,MAAA,aAAa,EAAGrB;AAAjC,OACG2B,OADH,CADD,CADK,GAOL,cAAC,KAAD,CAAO,SAAP;AAAiB,MAAA,aAAa,EAAG3B;AAAjC,OACG2B,OADH,CAbF,CADD,CADD;AAsBA,GAvBa,EAuBX,CAAEX,aAAF,EAAiBK,MAAjB,CAvBW,CAAd;AAwBA;;AAED,eAAeb,8BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Easing } from 'react-native';\nimport { NavigationContainer, DefaultTheme } from '@react-navigation/native';\nimport { createStackNavigator } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseContext,\n\tuseMemo,\n\tuseCallback,\n\tChildren,\n\tuseRef,\n\tcloneElement,\n\tPlatform,\n} from '@wordpress/element';\n\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { performLayoutAnimation } from '../../layout-animation';\nimport {\n\tBottomSheetNavigationContext,\n\tBottomSheetNavigationProvider,\n} from './bottom-sheet-navigation-context';\n\nimport styles from './styles.scss';\n\nconst AnimationSpec = {\n\tanimation: 'timing',\n\tconfig: {\n\t\tduration: 200,\n\t\teasing: Easing.ease,\n\t},\n};\n\nconst fadeConfig = ( { current } ) => {\n\treturn {\n\t\tcardStyle: {\n\t\t\topacity: current.progress,\n\t\t},\n\t};\n};\n\nconst options = {\n\ttransitionSpec: {\n\t\topen: AnimationSpec,\n\t\tclose: AnimationSpec,\n\t},\n\theaderShown: false,\n\tgestureEnabled: false,\n\tcardStyleInterpolator: fadeConfig,\n};\n\nconst ANIMATION_DURATION = 190;\n\nfunction BottomSheetNavigationContainer( {\n\tchildren,\n\tanimate,\n\tmain,\n\ttheme,\n\tstyle,\n} ) {\n\tconst Stack = useRef( createStackNavigator() ).current;\n\tconst context = useContext( BottomSheetNavigationContext );\n\tconst [ currentHeight, setCurrentHeight ] = useState(\n\t\tcontext.currentHeight || 1\n\t);\n\n\tconst backgroundStyle = usePreferredColorSchemeStyle(\n\t\tstyles.background,\n\t\tstyles.backgroundDark\n\t);\n\n\tconst _theme = theme || {\n\t\t...DefaultTheme,\n\t\tcolors: {\n\t\t\t...DefaultTheme.colors,\n\t\t\tbackground: backgroundStyle.backgroundColor,\n\t\t},\n\t};\n\n\tconst setHeight = useCallback(\n\t\t( height ) => {\n\t\t\t// The screen is fullHeight or changing from fullScreen to the default mode\n\t\t\tif (\n\t\t\t\t( typeof currentHeight === 'string' &&\n\t\t\t\t\ttypeof height !== 'string' ) ||\n\t\t\t\ttypeof height === 'string'\n\t\t\t) {\n\t\t\t\t// Animating the opacity for the initial modal results in the backdrop\n\t\t\t\t// provided by react-native-modal to never transition from transparent\n\t\t\t\t// to partially opaque black. The core issue was not idenfited, but it\n\t\t\t\t// may relate to the experimental state of LayoutAnimation for Android.\n\t\t\t\t// https://reactnative.dev/docs/layoutanimation\n\t\t\t\tif ( ! Platform.isAndroid || currentHeight !== 1 ) {\n\t\t\t\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\t\t\t}\n\t\t\t\tsetCurrentHeight( height );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( height > 1 ) {\n\t\t\t\tif ( currentHeight === 1 ) {\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t} else if ( animate ) {\n\t\t\t\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t} else {\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ currentHeight ]\n\t);\n\n\tconst screens = useMemo( () => {\n\t\treturn Children.map( children, ( child ) => {\n\t\t\tlet screen = child;\n\t\t\tconst { name, ...otherProps } = child.props;\n\t\t\tif ( ! main ) {\n\t\t\t\tscreen = cloneElement( child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tisNested: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Stack.Screen\n\t\t\t\t\tname={ name }\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\tchildren={ () => screen }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ children ] );\n\n\treturn useMemo( () => {\n\t\treturn (\n\t\t\t<View style={ [ style, { height: currentHeight } ] }>\n\t\t\t\t<BottomSheetNavigationProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\tsetHeight,\n\t\t\t\t\t\tcurrentHeight,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ main ? (\n\t\t\t\t\t\t<NavigationContainer theme={ _theme }>\n\t\t\t\t\t\t\t<Stack.Navigator screenOptions={ options }>\n\t\t\t\t\t\t\t\t{ screens }\n\t\t\t\t\t\t\t</Stack.Navigator>\n\t\t\t\t\t\t</NavigationContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Stack.Navigator screenOptions={ options }>\n\t\t\t\t\t\t\t{ screens }\n\t\t\t\t\t\t</Stack.Navigator>\n\t\t\t\t\t) }\n\t\t\t\t</BottomSheetNavigationProvider>\n\t\t\t</View>\n\t\t);\n\t}, [ currentHeight, _theme ] );\n}\n\nexport default BottomSheetNavigationContainer;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js"],"names":["View","Easing","NavigationContainer","DefaultTheme","createStackNavigator","useState","useContext","useMemo","useCallback","Children","useRef","cloneElement","usePreferredColorSchemeStyle","performLayoutAnimation","BottomSheetNavigationContext","BottomSheetNavigationProvider","styles","AnimationSpec","animation","config","duration","easing","ease","fadeConfig","current","cardStyle","opacity","progress","options","transitionSpec","open","close","headerShown","gestureEnabled","cardStyleInterpolator","ANIMATION_DURATION","BottomSheetNavigationContainer","children","animate","main","theme","style","Stack","context","currentHeight","setCurrentHeight","backgroundStyle","background","backgroundDark","_theme","colors","backgroundColor","setHeight","height","Math","round","screens","map","child","screen","name","otherProps","props","isNested"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,cAA7B;AACA,SAASC,mBAAT,EAA8BC,YAA9B,QAAkD,0BAAlD;AACA,SAASC,oBAAT,QAAqC,yBAArC;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,UAFD,EAGCC,OAHD,EAICC,WAJD,EAKCC,QALD,EAMCC,MAND,EAOCC,YAPD,QAQO,oBARP;AAUA,SAASC,4BAAT,QAA6C,oBAA7C;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,wBAAvC;AACA,SACCC,4BADD,EAECC,6BAFD,QAGO,mCAHP;AAKA,OAAOC,MAAP,MAAmB,eAAnB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,QADU;AAErBC,EAAAA,MAAM,EAAE;AACPC,IAAAA,QAAQ,EAAE,GADH;AAEPC,IAAAA,MAAM,EAAEpB,MAAM,CAACqB;AAFR;AAFa,CAAtB;;AAQA,MAAMC,UAAU,GAAG,QAAmB;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AACrC,SAAO;AACNC,IAAAA,SAAS,EAAE;AACVC,MAAAA,OAAO,EAAEF,OAAO,CAACG;AADP;AADL,GAAP;AAKA,CAND;;AAQA,MAAMC,OAAO,GAAG;AACfC,EAAAA,cAAc,EAAE;AACfC,IAAAA,IAAI,EAAEb,aADS;AAEfc,IAAAA,KAAK,EAAEd;AAFQ,GADD;AAKfe,EAAAA,WAAW,EAAE,KALE;AAMfC,EAAAA,cAAc,EAAE,KAND;AAOfC,EAAAA,qBAAqB,EAAEX;AAPR,CAAhB;AAUA,MAAMY,kBAAkB,GAAG,GAA3B;;AAEA,SAASC,8BAAT,QAMI;AAAA,MANqC;AACxC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Ad;AAwBA;;AAED,eAAeb,8BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Easing } from 'react-native';\nimport { NavigationContainer, DefaultTheme } from '@react-navigation/native';\nimport { createStackNavigator } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseContext,\n\tuseMemo,\n\tuseCallback,\n\tChildren,\n\tuseRef,\n\tcloneElement,\n} from '@wordpress/element';\n\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { performLayoutAnimation } from '../../layout-animation';\nimport {\n\tBottomSheetNavigationContext,\n\tBottomSheetNavigationProvider,\n} from './bottom-sheet-navigation-context';\n\nimport styles from './styles.scss';\n\nconst AnimationSpec = {\n\tanimation: 'timing',\n\tconfig: {\n\t\tduration: 200,\n\t\teasing: Easing.ease,\n\t},\n};\n\nconst fadeConfig = ( { current } ) => {\n\treturn {\n\t\tcardStyle: {\n\t\t\topacity: current.progress,\n\t\t},\n\t};\n};\n\nconst options = {\n\ttransitionSpec: {\n\t\topen: AnimationSpec,\n\t\tclose: AnimationSpec,\n\t},\n\theaderShown: false,\n\tgestureEnabled: false,\n\tcardStyleInterpolator: fadeConfig,\n};\n\nconst ANIMATION_DURATION = 190;\n\nfunction BottomSheetNavigationContainer( {\n\tchildren,\n\tanimate,\n\tmain,\n\ttheme,\n\tstyle,\n} ) {\n\tconst Stack = useRef( createStackNavigator() ).current;\n\tconst context = useContext( BottomSheetNavigationContext );\n\tconst [ currentHeight, setCurrentHeight ] = useState(\n\t\tcontext.currentHeight || 1\n\t);\n\n\tconst backgroundStyle = usePreferredColorSchemeStyle(\n\t\tstyles.background,\n\t\tstyles.backgroundDark\n\t);\n\n\tconst _theme = theme || {\n\t\t...DefaultTheme,\n\t\tcolors: {\n\t\t\t...DefaultTheme.colors,\n\t\t\tbackground: backgroundStyle.backgroundColor,\n\t\t},\n\t};\n\n\tconst setHeight = useCallback(\n\t\t( height ) => {\n\t\t\t// The screen is fullHeight\n\t\t\tif (\n\t\t\t\ttypeof height === 'string' &&\n\t\t\t\ttypeof height !== typeof currentHeight\n\t\t\t) {\n\t\t\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\t\t\tsetCurrentHeight( height );\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\theight > 1 &&\n\t\t\t\tMath.round( height ) !== Math.round( currentHeight )\n\t\t\t) {\n\t\t\t\tif ( currentHeight === 1 ) {\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t} else if ( animate ) {\n\t\t\t\t\tperformLayoutAnimation( ANIMATION_DURATION );\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t} else {\n\t\t\t\t\tsetCurrentHeight( height );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ currentHeight ]\n\t);\n\n\tconst screens = useMemo( () => {\n\t\treturn Children.map( children, ( child ) => {\n\t\t\tlet screen = child;\n\t\t\tconst { name, ...otherProps } = child.props;\n\t\t\tif ( ! main ) {\n\t\t\t\tscreen = cloneElement( child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tisNested: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Stack.Screen\n\t\t\t\t\tname={ name }\n\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\tchildren={ () => screen }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ children ] );\n\n\treturn useMemo( () => {\n\t\treturn (\n\t\t\t<View style={ [ style, { height: currentHeight } ] }>\n\t\t\t\t<BottomSheetNavigationProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\tsetHeight,\n\t\t\t\t\t\tcurrentHeight,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ main ? (\n\t\t\t\t\t\t<NavigationContainer theme={ _theme }>\n\t\t\t\t\t\t\t<Stack.Navigator screenOptions={ options }>\n\t\t\t\t\t\t\t\t{ screens }\n\t\t\t\t\t\t\t</Stack.Navigator>\n\t\t\t\t\t\t</NavigationContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Stack.Navigator screenOptions={ options }>\n\t\t\t\t\t\t\t{ screens }\n\t\t\t\t\t\t</Stack.Navigator>\n\t\t\t\t\t) }\n\t\t\t\t</BottomSheetNavigationProvider>\n\t\t\t</View>\n\t\t);\n\t}, [ currentHeight, _theme ] );\n}\n\nexport default BottomSheetNavigationContainer;\n"]}
@@ -24,7 +24,8 @@ const BottomSheetNavigationScreen = _ref => {
24
24
  children,
25
25
  fullScreen,
26
26
  isScrollable,
27
- isNested
27
+ isNested,
28
+ name
28
29
  } = _ref;
29
30
  const navigation = useNavigation();
30
31
  const heightRef = useRef({
@@ -53,7 +54,22 @@ const BottomSheetNavigationScreen = _ref => {
53
54
  onHandleHardwareButtonPress(null);
54
55
  return false;
55
56
  });
56
-
57
+ /**
58
+ * TODO: onHandleHardwareButtonPress stores a single value, which means
59
+ * future invocations from sibling screens can replace the callback for
60
+ * the currently active screen. Currently, the empty dependency array
61
+ * passed to useCallback here is what prevents erroneous callback
62
+ * replacements, but leveraging memoization to achieve this is brittle and
63
+ * explicitly discouraged in the React documentation.
64
+ * https://reactjs.org/docs/hooks-reference.html#usememo
65
+ *
66
+ * Ideally, we refactor onHandleHardwareButtonPress to manage multiple
67
+ * callbacks triggered based upon which screen is currently active.
68
+ *
69
+ * Related: https://git.io/JD2no
70
+ */
71
+ }, []));
72
+ useFocusEffect(useCallback(() => {
57
73
  if (fullScreen) {
58
74
  setHeight('100%');
59
75
  setIsFullScreen(true);
@@ -63,7 +79,7 @@ const BottomSheetNavigationScreen = _ref => {
63
79
  }
64
80
 
65
81
  return () => {};
66
- }, []));
82
+ }, [setHeight]));
67
83
 
68
84
  const onLayout = _ref2 => {
69
85
  let {
@@ -86,11 +102,13 @@ const BottomSheetNavigationScreen = _ref => {
86
102
 
87
103
  return useMemo(() => {
88
104
  return isScrollable || isNested ? createElement(View, {
89
- onLayout: onLayout
105
+ onLayout: onLayout,
106
+ testID: `navigation-screen-${name}`
90
107
  }, children) : createElement(ScrollView, listProps, createElement(TouchableHighlight, {
91
108
  accessible: false
92
109
  }, createElement(View, {
93
- onLayout: onLayout
110
+ onLayout: onLayout,
111
+ testID: `navigation-screen-${name}`
94
112
  }, children, !isNested && createElement(View, {
95
113
  style: {
96
114
  height: safeAreaBottomInset || styles.scrollableContent.paddingBottom
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["useIsFocused","useNavigation","useFocusEffect","View","ScrollView","TouchableHighlight","debounce","BottomSheetContext","useRef","useCallback","useContext","useMemo","BottomSheetNavigationContext","styles","BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","setHeight","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","scrollableContent","paddingBottom"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,YADD,EAECC,aAFD,EAGCC,cAHD,QAIO,0BAJP;AAKA,SAASC,IAAT,EAAeC,UAAf,EAA2BC,kBAA3B,QAAqD,cAArD;AACA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SAASC,kBAAT,QAAmC,uBAAnC;AAEA,SAASC,MAAT,EAAiBC,WAAjB,EAA8BC,UAA9B,EAA0CC,OAA1C,QAAyD,oBAAzD;AAEA;AACA;AACA;;AACA,SAASC,4BAAT,QAA6C,mCAA7C;AACA,OAAOC,MAAP,MAAmB,eAAnB;;AAEA,MAAMC,2BAA2B,GAAG,QAK7B;AAAA,MAL+B;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA,YAHqC;AAIrCC,IAAAA;AAJqC,GAK/B;AACN,QAAMC,UAAU,GAAGlB,aAAa,EAAhC;AACA,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,UAAM;AAAEmB,MAAAA;AAAF,QAAaD,WAAW,CAACE,MAA/B;;AAEA,QAAKhB,SAAS,CAACY,OAAV,CAAkBX,SAAlB,KAAgCc,MAAhC,IAA0Cb,SAA/C,EAA2D;AAC1DF,MAAAA,SAAS,CAACY,OAAV,CAAkBX,SAAlB,GAA8Bc,MAA9B;AACAN,MAAAA,iBAAiB,CAAEM,MAAF,CAAjB;AACA;AACD,GAVD;;AAWA,SAAOxB,OAAO,CAAE,MAAM;AACrB,WAAOM,YAAY,IAAIC,QAAhB,GACN,cAAC,IAAD;AAAM,MAAA,QAAQ,EAAGe;AAAjB,OAA8BlB,QAA9B,CADM,GAGN,cAAC,UAAD,EAAiBW,SAAjB,EACC,cAAC,kBAAD;AAAoB,MAAA,UAAU,EAAG;AAAjC,OACC,cAAC,IAAD;AAAM,MAAA,QAAQ,EAAGO;AAAjB,OACGlB,QADH,EAEG,CAAEG,QAAF,IACD,cAAC,IAAD;AACC,MAAA,KAAK,EAAG;AACPiB,QAAAA,MAAM,EACLR,mBAAmB,IACnBd,MAAM,CAACwB,iBAAP,CAAyBC;AAHnB;AADT,MAHF,CADD,CADD,CAHD;AAoBA,GArBa,EAqBX,CAAEvB,QAAF,EAAYO,SAAZ,EAAuBK,mBAAvB,EAA4CD,SAA5C,CArBW,CAAd;AAsBA,CA7ED;;AA+EA,eAAeZ,2BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [] )\n\t);\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View onLayout={ onLayout }>{ children }</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View onLayout={ onLayout }>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [ children, isFocused, safeAreaBottomInset, listProps ] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js"],"names":["useIsFocused","useNavigation","useFocusEffect","View","ScrollView","TouchableHighlight","debounce","BottomSheetContext","useRef","useCallback","useContext","useMemo","BottomSheetNavigationContext","styles","BottomSheetNavigationScreen","children","fullScreen","isScrollable","isNested","name","navigation","heightRef","maxHeight","isFocused","onHandleHardwareButtonPress","shouldEnableBottomSheetMaxHeight","setIsFullScreen","listProps","safeAreaBottomInset","setHeight","setHeightDebounce","canGoBack","goBack","current","onLayout","nativeEvent","height","layout","scrollableContent","paddingBottom"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,YADD,EAECC,aAFD,EAGCC,cAHD,QAIO,0BAJP;AAKA,SAASC,IAAT,EAAeC,UAAf,EAA2BC,kBAA3B,QAAqD,cAArD;AACA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SAASC,kBAAT,QAAmC,uBAAnC;AAEA,SAASC,MAAT,EAAiBC,WAAjB,EAA8BC,UAA9B,EAA0CC,OAA1C,QAAyD,oBAAzD;AAEA;AACA;AACA;;AACA,SAASC,4BAAT,QAA6C,mCAA7C;AACA,OAAOC,MAAP,MAAmB,eAAnB;;AAEA,MAAMC,2BAA2B,GAAG,QAM7B;AAAA,MAN+B;AACrCC,IAAAA,QADqC;AAErC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","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tuseIsFocused,\n\tuseNavigation,\n\tuseFocusEffect,\n} from '@react-navigation/native';\nimport { View, ScrollView, TouchableHighlight } from 'react-native';\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheetContext } from '@wordpress/components';\n\nimport { useRef, useCallback, useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { BottomSheetNavigationContext } from './bottom-sheet-navigation-context';\nimport styles from './styles.scss';\n\nconst BottomSheetNavigationScreen = ( {\n\tchildren,\n\tfullScreen,\n\tisScrollable,\n\tisNested,\n\tname,\n} ) => {\n\tconst navigation = useNavigation();\n\tconst heightRef = useRef( { maxHeight: 0 } );\n\tconst isFocused = useIsFocused();\n\tconst {\n\t\tonHandleHardwareButtonPress,\n\t\tshouldEnableBottomSheetMaxHeight,\n\t\tsetIsFullScreen,\n\t\tlistProps,\n\t\tsafeAreaBottomInset,\n\t} = useContext( BottomSheetContext );\n\n\tconst { setHeight } = useContext( BottomSheetNavigationContext );\n\n\tconst setHeightDebounce = useCallback( debounce( setHeight, 10 ), [\n\t\tsetHeight,\n\t] );\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tonHandleHardwareButtonPress( () => {\n\t\t\t\tif ( navigation.canGoBack() ) {\n\t\t\t\t\tshouldEnableBottomSheetMaxHeight( true );\n\t\t\t\t\tnavigation.goBack();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tonHandleHardwareButtonPress( null );\n\t\t\t\treturn false;\n\t\t\t} );\n\t\t\t/**\n\t\t\t * TODO: onHandleHardwareButtonPress stores a single value, which means\n\t\t\t * future invocations from sibling screens can replace the callback for\n\t\t\t * the currently active screen. Currently, the empty dependency array\n\t\t\t * passed to useCallback here is what prevents erroneous callback\n\t\t\t * replacements, but leveraging memoization to achieve this is brittle and\n\t\t\t * explicitly discouraged in the React documentation.\n\t\t\t * https://reactjs.org/docs/hooks-reference.html#usememo\n\t\t\t *\n\t\t\t * Ideally, we refactor onHandleHardwareButtonPress to manage multiple\n\t\t\t * callbacks triggered based upon which screen is currently active.\n\t\t\t *\n\t\t\t * Related: https://git.io/JD2no\n\t\t\t */\n\t\t}, [] )\n\t);\n\n\tuseFocusEffect(\n\t\tuseCallback( () => {\n\t\t\tif ( fullScreen ) {\n\t\t\t\tsetHeight( '100%' );\n\t\t\t\tsetIsFullScreen( true );\n\t\t\t} else if ( heightRef.current.maxHeight !== 0 ) {\n\t\t\t\tsetIsFullScreen( false );\n\t\t\t\tsetHeight( heightRef.current.maxHeight );\n\t\t\t}\n\t\t\treturn () => {};\n\t\t}, [ setHeight ] )\n\t);\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tif ( fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { height } = nativeEvent.layout;\n\n\t\tif ( heightRef.current.maxHeight !== height && isFocused ) {\n\t\t\theightRef.current.maxHeight = height;\n\t\t\tsetHeightDebounce( height );\n\t\t}\n\t};\n\n\treturn useMemo( () => {\n\t\treturn isScrollable || isNested ? (\n\t\t\t<View\n\t\t\t\tonLayout={ onLayout }\n\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t) : (\n\t\t\t<ScrollView { ...listProps }>\n\t\t\t\t<TouchableHighlight accessible={ false }>\n\t\t\t\t\t<View\n\t\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t\t\ttestID={ `navigation-screen-${ name }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t{ ! isNested && (\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tsafeAreaBottomInset ||\n\t\t\t\t\t\t\t\t\t\tstyles.scrollableContent.paddingBottom,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</TouchableHighlight>\n\t\t\t</ScrollView>\n\t\t);\n\t}, [ children, isFocused, safeAreaBottomInset, listProps ] );\n};\n\nexport default BottomSheetNavigationScreen;\n"]}
@@ -43,7 +43,7 @@ class BottomSheetCell extends Component {
43
43
 
44
44
  componentDidMount() {
45
45
  this.isCurrent = true;
46
- AccessibilityInfo.addEventListener('screenReaderChanged', this.handleScreenReaderToggled);
46
+ this.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener('screenReaderChanged', this.handleScreenReaderToggled);
47
47
  AccessibilityInfo.isScreenReaderEnabled().then(isScreenReaderEnabled => {
48
48
  if (this.isCurrent) {
49
49
  this.setState({
@@ -55,7 +55,7 @@ class BottomSheetCell extends Component {
55
55
 
56
56
  componentWillUnmount() {
57
57
  this.isCurrent = false;
58
- AccessibilityInfo.removeEventListener('screenReaderChanged', this.handleScreenReaderToggled);
58
+ this.a11yInfoChangeSubscription.remove();
59
59
  }
60
60
 
61
61
  handleScreenReaderToggled(isScreenReaderEnabled) {
@@ -271,7 +271,7 @@ class BottomSheetCell extends Component {
271
271
  }, createElement(View, {
272
272
  style: styles.cellRowContainer
273
273
  }, icon && createElement(View, {
274
- style: styles.cellRowContainer
274
+ style: [styles.cellRowContainer, styles.cellRowIcon]
275
275
  }, createElement(Icon, {
276
276
  icon: icon,
277
277
  size: 24,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["TouchableOpacity","Text","View","TextInput","I18nManager","AccessibilityInfo","Platform","isEmpty","get","Icon","check","Component","__","_x","sprintf","withPreferredColorScheme","styles","platformStyles","TouchableRipple","isIOS","OS","BottomSheetCell","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","addEventListener","then","setState","componentWillUnmount","removeEventListener","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","separatorMarginLeft","getValueComponent","styleRTL","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","color","labelIconSeparator","placeholderColor"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,IAFD,EAGCC,IAHD,EAICC,SAJD,EAKCC,WALD,EAMCC,iBAND,EAOCC,QAPD,QAQO,cARP;AASA,SAASC,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,eAAn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UAFO;AADT,OAMGP,KANH,CADD,EASC,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGmC;AAAd,OACGlC,QADH,CATD,CArBF,EAmCG,CAAEA,QAAF,IAAcD,KAAd,IACD,cAAC,IAAD;AACC,MAAA,KAAK,EAAG,CAAEkC,iBAAF,EAAqB3B,UAArB;AADT,OAGGP,KAHH,CApCF,CADD,EA4CGmB,kBAAkB,IACnB,cAAC,gBAAD;AACC,MAAA,OAAO,EAAG0D,OADX;AAEC,MAAA,iBAAiB,EAAG;AAFrB,OAIC,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGR;AAAd,OACGO,KADH,CAJD,CA7CF,CAJD,EA2DG7D,UAAU,IACX,cAAC,IAAD;AACC,MAAA,IAAI,EAAG/D,KADR;AAEC,MAAA,IAAI,EAAGO,cAAc,CAACwD,UAAf,CAA0BiE;AAFlC,MA5DF,EAiEGzD,SAAS,IAAIkC,iBAAiB,EAjEjC,EAkEG5C,QAlEH,CAtBD,EA0FGQ,IAAI,IACL,cAAC,IAAD;AAAM,MAAA,KAAK,EAAG,CAAEmD,aAAF,EAAiBlH,MAAM,CAAC4H,gBAAxB;AAAd,OACG7D,IADH,CA3FF,EA+FG,CAAEmB,gBAAF,IAAsB,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MA/FzB,CADD;AAmGA;;AA/YsC;;AAkZxC,eAAelF,wBAAwB,CAAEM,eAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled = this.handleScreenReaderToggled.bind(\n\t\t\tthis\n\t\t);\n\n\t\tthis.isCurrent = false;\n\t}\n\n\tcomponentDidUpdate( prevProps, prevState ) {\n\t\tif ( ! prevState.isEditingValue && this.state.isEditingValue ) {\n\t\t\tthis._valueTextInput.focus();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.isCurrent = true;\n\t\tAccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( isScreenReaderEnabled ) => {\n\t\t\t\tif ( this.isCurrent ) {\n\t\t\t\t\tthis.setState( { isScreenReaderEnabled } );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.isCurrent = false;\n\t\tAccessibilityInfo.removeEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\t}\n\n\thandleScreenReaderToggled( isScreenReaderEnabled ) {\n\t\tthis.setState( { isScreenReaderEnabled } );\n\t}\n\n\ttypeToKeyboardType( type, step ) {\n\t\tlet keyboardType = `default`;\n\t\tif ( type === `number` ) {\n\t\t\tif ( step && Math.abs( step ) < 1 ) {\n\t\t\t\tkeyboardType = `decimal-pad`;\n\t\t\t} else {\n\t\t\t\tkeyboardType = `number-pad`;\n\t\t\t}\n\t\t}\n\t\treturn keyboardType;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\taccessible,\n\t\t\taccessibilityLabel,\n\t\t\taccessibilityHint,\n\t\t\taccessibilityRole,\n\t\t\tdisabled = false,\n\t\t\tactiveOpacity,\n\t\t\tonPress,\n\t\t\tonLongPress,\n\t\t\tlabel,\n\t\t\tsubLabel,\n\t\t\tvalue,\n\t\t\tvaluePlaceholder = '',\n\t\t\ticon,\n\t\t\tleftAlign,\n\t\t\ticonStyle = {},\n\t\t\tlabelStyle = {},\n\t\t\tvalueStyle = {},\n\t\t\tcellContainerStyle = {},\n\t\t\tcellRowContainerStyle = {},\n\t\t\tonChangeValue,\n\t\t\tonSubmit,\n\t\t\tchildren,\n\t\t\teditable = true,\n\t\t\tisSelected = false,\n\t\t\tseparatorType,\n\t\t\tstyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tcustomActionButton,\n\t\t\ttype,\n\t\t\tstep,\n\t\t\tborderless,\n\t\t\thelp,\n\t\t\t...valueProps\n\t\t} = this.props;\n\n\t\tconst showValue = value !== undefined;\n\t\tconst isValueEditable = editable && onChangeValue !== undefined;\n\t\tconst cellLabelStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabel,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelCenteredStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelCentered,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelLeftAlignNoIconStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelLeftAlignNoIcon,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst defaultMissingIconAndValue = leftAlign\n\t\t\t? cellLabelLeftAlignNoIconStyle\n\t\t\t: cellLabelCenteredStyle;\n\t\tconst defaultLabelStyle =\n\t\t\tshowValue || customActionButton || icon\n\t\t\t\t? cellLabelStyle\n\t\t\t\t: defaultMissingIconAndValue;\n\n\t\tconst defaultSubLabelStyleText = getStylesFromColorScheme(\n\t\t\tstyles.cellSubLabelText,\n\t\t\tstyles.cellSubLabelTextDark\n\t\t);\n\n\t\tconst drawSeparator =\n\t\t\t( separatorType && separatorType !== 'none' ) ||\n\t\t\tseparatorStyle === undefined;\n\t\tconst drawTopSeparator =\n\t\t\tdrawSeparator && separatorType === 'topFullWidth';\n\n\t\tconst cellContainerStyles = [\n\t\t\tstyles.cellContainer,\n\t\t\tcellContainerStyle,\n\t\t];\n\t\tconst rowContainerStyles = [\n\t\t\tstyles.cellRowContainer,\n\t\t\tcellRowContainerStyle,\n\t\t];\n\n\t\tconst isInteractive =\n\t\t\tisValueEditable ||\n\t\t\tonPress !== undefined ||\n\t\t\tonLongPress !== undefined;\n\n\t\tconst onCellPress = () => {\n\t\t\tif ( isValueEditable ) {\n\t\t\t\tstartEditing();\n\t\t\t} else if ( onPress !== undefined ) {\n\t\t\t\tonPress();\n\t\t\t}\n\t\t};\n\n\t\tconst finishEditing = () => {\n\t\t\tthis.setState( { isEditingValue: false } );\n\t\t};\n\n\t\tconst startEditing = () => {\n\t\t\tif ( this.state.isEditingValue === false ) {\n\t\t\t\tthis.setState( { isEditingValue: true } );\n\t\t\t}\n\t\t};\n\n\t\tconst separatorStyle = () => {\n\t\t\t//eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\tconst defaultSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.separator,\n\t\t\t\tstyles.separatorDark\n\t\t\t);\n\t\t\tconst cellSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellSeparator,\n\t\t\t\tstyles.cellSeparatorDark\n\t\t\t);\n\t\t\tconst leftMarginStyle = {\n\t\t\t\t...cellSeparatorStyle,\n\t\t\t\t...platformStyles.separatorMarginLeft,\n\t\t\t};\n\t\t\tswitch ( separatorType ) {\n\t\t\t\tcase 'leftMargin':\n\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\tcase 'fullWidth':\n\t\t\t\tcase 'topFullWidth':\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t\tcase 'none':\n\t\t\t\t\treturn undefined;\n\t\t\t\tcase undefined:\n\t\t\t\t\tif ( showValue && icon ) {\n\t\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst getValueComponent = () => {\n\t\t\tconst styleRTL = I18nManager.isRTL && styles.cellValueRTL;\n\t\t\tconst cellValueStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellValue,\n\t\t\t\tstyles.cellTextDark\n\t\t\t);\n\t\t\tconst finalStyle = {\n\t\t\t\t...cellValueStyle,\n\t\t\t\t...valueStyle,\n\t\t\t\t...styleRTL,\n\t\t\t};\n\n\t\t\t// To be able to show the `middle` ellipsizeMode on editable cells\n\t\t\t// we show the TextInput just when the user wants to edit the value,\n\t\t\t// and the Text component to display it.\n\t\t\t// We also show the TextInput to display placeholder.\n\t\t\tconst shouldShowPlaceholder = isValueEditable && value === '';\n\t\t\treturn this.state.isEditingValue || shouldShowPlaceholder ? (\n\t\t\t\t<TextInput\n\t\t\t\t\tref={ ( c ) => ( this._valueTextInput = c ) }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ finalStyle }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tplaceholder={ valuePlaceholder }\n\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\tonChangeText={ onChangeValue }\n\t\t\t\t\teditable={ isValueEditable }\n\t\t\t\t\tpointerEvents={\n\t\t\t\t\t\tthis.state.isEditingValue ? 'auto' : 'none'\n\t\t\t\t\t}\n\t\t\t\t\tonFocus={ startEditing }\n\t\t\t\t\tonBlur={ finishEditing }\n\t\t\t\t\tonSubmitEditing={ onSubmit }\n\t\t\t\t\tkeyboardType={ this.typeToKeyboardType( type, step ) }\n\t\t\t\t\t{ ...valueProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ { ...cellValueStyle, ...valueStyle } }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tellipsizeMode={ 'middle' }\n\t\t\t\t>\n\t\t\t\t\t{ value }\n\t\t\t\t</Text>\n\t\t\t);\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\tif ( accessible === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( accessibilityLabel || ! showValue ) {\n\t\t\t\treturn accessibilityLabel || label;\n\t\t\t}\n\n\t\t\tif ( isEmpty( value ) ) {\n\t\t\t\treturn isEmpty( help )\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */\n\t\t\t\t\t\t\t_x( '%s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t\t sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %1: Cell title, %2: cell help. */\n\t\t\t\t\t\t\t_x( '%1$s, %2$s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\thelp\n\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn isEmpty( help )\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */\n\t\t\t\t\t\t_x( '%1$s, %2$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue\n\t\t\t\t ) // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title, value and help text.%1: Cell title, %2: cell value, , %3: cell help. */\n\t\t\t\t\t\t_x( '%1$s, %2$s, %3$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\thelp\n\t\t\t\t );\n\t\t};\n\n\t\tconst iconStyleBase = getStylesFromColorScheme(\n\t\t\tstyles.icon,\n\t\t\tstyles.iconDark\n\t\t);\n\t\tconst resetButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.resetButton,\n\t\t\tstyles.resetButtonDark\n\t\t);\n\t\tconst cellHelpStyle = [\n\t\t\tstyles.cellHelpLabel,\n\t\t\tisIOS && styles.cellHelpLabelIOS,\n\t\t];\n\t\tconst containerPointerEvents =\n\t\t\tthis.state.isScreenReaderEnabled && accessible ? 'none' : 'auto';\n\t\tconst { title, handler } = customActionButton || {};\n\n\t\tconst opacity =\n\t\t\tactiveOpacity !== undefined\n\t\t\t\t? activeOpacity\n\t\t\t\t: get( platformStyles, 'activeOpacity.opacity' );\n\n\t\treturn (\n\t\t\t<TouchableRipple\n\t\t\t\taccessible={\n\t\t\t\t\taccessible !== undefined\n\t\t\t\t\t\t? accessible\n\t\t\t\t\t\t: ! this.state.isEditingValue\n\t\t\t\t}\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityRole={ accessibilityRole || 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tisValueEditable\n\t\t\t\t\t\t? /* translators: accessibility text */\n\t\t\t\t\t\t __( 'Double tap to edit this value' )\n\t\t\t\t\t\t: accessibilityHint\n\t\t\t\t}\n\t\t\t\tdisabled={ disabled || ! isInteractive }\n\t\t\t\tactiveOpacity={ opacity }\n\t\t\t\tonPress={ onCellPress }\n\t\t\t\tonLongPress={ onLongPress }\n\t\t\t\tstyle={ [ styles.clipToBounds, style ] }\n\t\t\t\tborderless={ borderless }\n\t\t\t>\n\t\t\t\t{ drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t\t<View\n\t\t\t\t\tstyle={ cellContainerStyles }\n\t\t\t\t\tpointerEvents={ containerPointerEvents }\n\t\t\t\t>\n\t\t\t\t\t<View style={ rowContainerStyles }>\n\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\ticonStyle.color ||\n\t\t\t\t\t\t\t\t\t\t\ticonStyleBase.color\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\tisPressed={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tplatformStyles.labelIconSeparator\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</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ subLabel && label && (\n\t\t\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tdefaultLabelStyle,\n\t\t\t\t\t\t\t\t\t\t\tlabelStyle,\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\t\t{ label }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Text style={ defaultSubLabelStyleText }>\n\t\t\t\t\t\t\t\t\t\t{ subLabel }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! subLabel && label && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tstyle={ [ defaultLabelStyle, labelStyle ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\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\t{ customActionButton && (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={ handler }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text style={ resetButtonStyle }>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tfill={ platformStyles.isSelected.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showValue && getValueComponent() }\n\t\t\t\t\t{ children }\n\t\t\t\t</View>\n\t\t\t\t{ help && (\n\t\t\t\t\t<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t{ ! drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t</TouchableRipple>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetCell );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["TouchableOpacity","Text","View","TextInput","I18nManager","AccessibilityInfo","Platform","isEmpty","get","Icon","check","Component","__","_x","sprintf","withPreferredColorScheme","styles","platformStyles","TouchableRipple","isIOS","OS","BottomSheetCell","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","addEventListener","then","setState","componentWillUnmount","remove","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","separatorMarginLeft","getValueComponent","styleRTL","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","placeholderColor"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,IAFD,EAGCC,IAHD,EAICC,SAJD,EAKCC,WALD,EAMCC,iBAND,EAOCC,QAPD,QAQO,cARP;AASA,SAASC,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,eAAnB;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,eAAP,MAA4B,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AAC,IAAD;AAAM,MAAA,KAAK,EAAGmC;AAAd,OACGlC,QADH,CATD,CA1BF,EAwCG,CAAEA,QAAF,IAAcD,KAAd,IACD,cAAC,IAAD;AACC,MAAA,KAAK,EAAG,CAAEkC,iBAAF,EAAqB3B,UAArB;AADT,OAGGP,KAHH,CAzCF,CADD,EAiDGmB,kBAAkB,IACnB,cAAC,gBAAD;AACC,MAAA,OAAO,EAAG0D,OADX;AAEC,MAAA,iBAAiB,EAAG;AAFrB,OAIC,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGR;AAAd,OACGO,KADH,CAJD,CAlDF,CAJD,EAgEG7D,UAAU,IACX,cAAC,IAAD;AACC,MAAA,IAAI,EAAGhE,KADR;AAEC,MAAA,IAAI,EAAGO,cAAc,CAACyD,UAAf,CAA0BkE;AAFlC,MAjEF,EAsEG1D,SAAS,IAAIkC,iBAAiB,EAtEjC,EAuEG5C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,cAAC,IAAD;AAAM,MAAA,KAAK,EAAG,CAAEmD,aAAF,EAAiBnH,MAAM,CAAC8H,gBAAxB;AAAd,OACG9D,IADH,CAhGF,EAoGG,CAAEmB,gBAAF,IAAsB,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAjZsC;;AAoZxC,eAAenF,wBAAwB,CAAEM,eAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled = this.handleScreenReaderToggled.bind(\n\t\t\tthis\n\t\t);\n\n\t\tthis.isCurrent = false;\n\t}\n\n\tcomponentDidUpdate( prevProps, prevState ) {\n\t\tif ( ! prevState.isEditingValue && this.state.isEditingValue ) {\n\t\t\tthis._valueTextInput.focus();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.isCurrent = true;\n\t\tthis.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( isScreenReaderEnabled ) => {\n\t\t\t\tif ( this.isCurrent ) {\n\t\t\t\t\tthis.setState( { isScreenReaderEnabled } );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.isCurrent = false;\n\t\tthis.a11yInfoChangeSubscription.remove();\n\t}\n\n\thandleScreenReaderToggled( isScreenReaderEnabled ) {\n\t\tthis.setState( { isScreenReaderEnabled } );\n\t}\n\n\ttypeToKeyboardType( type, step ) {\n\t\tlet keyboardType = `default`;\n\t\tif ( type === `number` ) {\n\t\t\tif ( step && Math.abs( step ) < 1 ) {\n\t\t\t\tkeyboardType = `decimal-pad`;\n\t\t\t} else {\n\t\t\t\tkeyboardType = `number-pad`;\n\t\t\t}\n\t\t}\n\t\treturn keyboardType;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\taccessible,\n\t\t\taccessibilityLabel,\n\t\t\taccessibilityHint,\n\t\t\taccessibilityRole,\n\t\t\tdisabled = false,\n\t\t\tactiveOpacity,\n\t\t\tonPress,\n\t\t\tonLongPress,\n\t\t\tlabel,\n\t\t\tsubLabel,\n\t\t\tvalue,\n\t\t\tvaluePlaceholder = '',\n\t\t\ticon,\n\t\t\tleftAlign,\n\t\t\ticonStyle = {},\n\t\t\tlabelStyle = {},\n\t\t\tvalueStyle = {},\n\t\t\tcellContainerStyle = {},\n\t\t\tcellRowContainerStyle = {},\n\t\t\tonChangeValue,\n\t\t\tonSubmit,\n\t\t\tchildren,\n\t\t\teditable = true,\n\t\t\tisSelected = false,\n\t\t\tseparatorType,\n\t\t\tstyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tcustomActionButton,\n\t\t\ttype,\n\t\t\tstep,\n\t\t\tborderless,\n\t\t\thelp,\n\t\t\t...valueProps\n\t\t} = this.props;\n\n\t\tconst showValue = value !== undefined;\n\t\tconst isValueEditable = editable && onChangeValue !== undefined;\n\t\tconst cellLabelStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabel,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelCenteredStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelCentered,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelLeftAlignNoIconStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelLeftAlignNoIcon,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst defaultMissingIconAndValue = leftAlign\n\t\t\t? cellLabelLeftAlignNoIconStyle\n\t\t\t: cellLabelCenteredStyle;\n\t\tconst defaultLabelStyle =\n\t\t\tshowValue || customActionButton || icon\n\t\t\t\t? cellLabelStyle\n\t\t\t\t: defaultMissingIconAndValue;\n\n\t\tconst defaultSubLabelStyleText = getStylesFromColorScheme(\n\t\t\tstyles.cellSubLabelText,\n\t\t\tstyles.cellSubLabelTextDark\n\t\t);\n\n\t\tconst drawSeparator =\n\t\t\t( separatorType && separatorType !== 'none' ) ||\n\t\t\tseparatorStyle === undefined;\n\t\tconst drawTopSeparator =\n\t\t\tdrawSeparator && separatorType === 'topFullWidth';\n\n\t\tconst cellContainerStyles = [\n\t\t\tstyles.cellContainer,\n\t\t\tcellContainerStyle,\n\t\t];\n\t\tconst rowContainerStyles = [\n\t\t\tstyles.cellRowContainer,\n\t\t\tcellRowContainerStyle,\n\t\t];\n\n\t\tconst isInteractive =\n\t\t\tisValueEditable ||\n\t\t\tonPress !== undefined ||\n\t\t\tonLongPress !== undefined;\n\n\t\tconst onCellPress = () => {\n\t\t\tif ( isValueEditable ) {\n\t\t\t\tstartEditing();\n\t\t\t} else if ( onPress !== undefined ) {\n\t\t\t\tonPress();\n\t\t\t}\n\t\t};\n\n\t\tconst finishEditing = () => {\n\t\t\tthis.setState( { isEditingValue: false } );\n\t\t};\n\n\t\tconst startEditing = () => {\n\t\t\tif ( this.state.isEditingValue === false ) {\n\t\t\t\tthis.setState( { isEditingValue: true } );\n\t\t\t}\n\t\t};\n\n\t\tconst separatorStyle = () => {\n\t\t\t//eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\tconst defaultSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.separator,\n\t\t\t\tstyles.separatorDark\n\t\t\t);\n\t\t\tconst cellSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellSeparator,\n\t\t\t\tstyles.cellSeparatorDark\n\t\t\t);\n\t\t\tconst leftMarginStyle = {\n\t\t\t\t...cellSeparatorStyle,\n\t\t\t\t...platformStyles.separatorMarginLeft,\n\t\t\t};\n\t\t\tswitch ( separatorType ) {\n\t\t\t\tcase 'leftMargin':\n\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\tcase 'fullWidth':\n\t\t\t\tcase 'topFullWidth':\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t\tcase 'none':\n\t\t\t\t\treturn undefined;\n\t\t\t\tcase undefined:\n\t\t\t\t\tif ( showValue && icon ) {\n\t\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst getValueComponent = () => {\n\t\t\tconst styleRTL = I18nManager.isRTL && styles.cellValueRTL;\n\t\t\tconst cellValueStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellValue,\n\t\t\t\tstyles.cellTextDark\n\t\t\t);\n\t\t\tconst finalStyle = {\n\t\t\t\t...cellValueStyle,\n\t\t\t\t...valueStyle,\n\t\t\t\t...styleRTL,\n\t\t\t};\n\n\t\t\t// To be able to show the `middle` ellipsizeMode on editable cells\n\t\t\t// we show the TextInput just when the user wants to edit the value,\n\t\t\t// and the Text component to display it.\n\t\t\t// We also show the TextInput to display placeholder.\n\t\t\tconst shouldShowPlaceholder = isValueEditable && value === '';\n\t\t\treturn this.state.isEditingValue || shouldShowPlaceholder ? (\n\t\t\t\t<TextInput\n\t\t\t\t\tref={ ( c ) => ( this._valueTextInput = c ) }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ finalStyle }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tplaceholder={ valuePlaceholder }\n\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\tonChangeText={ onChangeValue }\n\t\t\t\t\teditable={ isValueEditable }\n\t\t\t\t\tpointerEvents={\n\t\t\t\t\t\tthis.state.isEditingValue ? 'auto' : 'none'\n\t\t\t\t\t}\n\t\t\t\t\tonFocus={ startEditing }\n\t\t\t\t\tonBlur={ finishEditing }\n\t\t\t\t\tonSubmitEditing={ onSubmit }\n\t\t\t\t\tkeyboardType={ this.typeToKeyboardType( type, step ) }\n\t\t\t\t\t{ ...valueProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ { ...cellValueStyle, ...valueStyle } }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tellipsizeMode={ 'middle' }\n\t\t\t\t>\n\t\t\t\t\t{ value }\n\t\t\t\t</Text>\n\t\t\t);\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\tif ( accessible === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( accessibilityLabel || ! showValue ) {\n\t\t\t\treturn accessibilityLabel || label;\n\t\t\t}\n\n\t\t\tif ( isEmpty( value ) ) {\n\t\t\t\treturn isEmpty( help )\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */\n\t\t\t\t\t\t\t_x( '%s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t\t sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %1: Cell title, %2: cell help. */\n\t\t\t\t\t\t\t_x( '%1$s, %2$s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\thelp\n\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn isEmpty( help )\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */\n\t\t\t\t\t\t_x( '%1$s, %2$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue\n\t\t\t\t ) // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title, value and help text.%1: Cell title, %2: cell value, , %3: cell help. */\n\t\t\t\t\t\t_x( '%1$s, %2$s, %3$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\thelp\n\t\t\t\t );\n\t\t};\n\n\t\tconst iconStyleBase = getStylesFromColorScheme(\n\t\t\tstyles.icon,\n\t\t\tstyles.iconDark\n\t\t);\n\t\tconst resetButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.resetButton,\n\t\t\tstyles.resetButtonDark\n\t\t);\n\t\tconst cellHelpStyle = [\n\t\t\tstyles.cellHelpLabel,\n\t\t\tisIOS && styles.cellHelpLabelIOS,\n\t\t];\n\t\tconst containerPointerEvents =\n\t\t\tthis.state.isScreenReaderEnabled && accessible ? 'none' : 'auto';\n\t\tconst { title, handler } = customActionButton || {};\n\n\t\tconst opacity =\n\t\t\tactiveOpacity !== undefined\n\t\t\t\t? activeOpacity\n\t\t\t\t: get( platformStyles, 'activeOpacity.opacity' );\n\n\t\treturn (\n\t\t\t<TouchableRipple\n\t\t\t\taccessible={\n\t\t\t\t\taccessible !== undefined\n\t\t\t\t\t\t? accessible\n\t\t\t\t\t\t: ! this.state.isEditingValue\n\t\t\t\t}\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityRole={ accessibilityRole || 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tisValueEditable\n\t\t\t\t\t\t? /* translators: accessibility text */\n\t\t\t\t\t\t __( 'Double tap to edit this value' )\n\t\t\t\t\t\t: accessibilityHint\n\t\t\t\t}\n\t\t\t\tdisabled={ disabled || ! isInteractive }\n\t\t\t\tactiveOpacity={ opacity }\n\t\t\t\tonPress={ onCellPress }\n\t\t\t\tonLongPress={ onLongPress }\n\t\t\t\tstyle={ [ styles.clipToBounds, style ] }\n\t\t\t\tborderless={ borderless }\n\t\t\t>\n\t\t\t\t{ drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t\t<View\n\t\t\t\t\tstyle={ cellContainerStyles }\n\t\t\t\t\tpointerEvents={ containerPointerEvents }\n\t\t\t\t>\n\t\t\t\t\t<View style={ rowContainerStyles }>\n\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowContainer,\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowIcon,\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<Icon\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\ticonStyle.color ||\n\t\t\t\t\t\t\t\t\t\t\ticonStyleBase.color\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\tisPressed={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tplatformStyles.labelIconSeparator\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</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ subLabel && label && (\n\t\t\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tdefaultLabelStyle,\n\t\t\t\t\t\t\t\t\t\t\tlabelStyle,\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\t\t{ label }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Text style={ defaultSubLabelStyleText }>\n\t\t\t\t\t\t\t\t\t\t{ subLabel }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! subLabel && label && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tstyle={ [ defaultLabelStyle, labelStyle ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\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\t{ customActionButton && (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={ handler }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text style={ resetButtonStyle }>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tfill={ platformStyles.isSelected.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showValue && getValueComponent() }\n\t\t\t\t\t{ children }\n\t\t\t\t</View>\n\t\t\t\t{ help && (\n\t\t\t\t\t<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t{ ! drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t</TouchableRipple>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetCell );\n"]}
@@ -132,10 +132,13 @@ class BottomSheet extends Component {
132
132
  this.lastLayoutAnimationFinished = true;
133
133
  });
134
134
  this.lastLayoutAnimation = layoutAnimation;
135
- } else {
136
- this.performRegularLayoutAnimation({
137
- useLastLayoutAnimation: false
138
- });
135
+ } else {// TODO: Reinstate animations, possibly replacing `LayoutAnimation` with
136
+ // more nuanced `Animated` usage or replacing our custom `BottomSheet`
137
+ // with `@gorhom/bottom-sheet`. This animation was disabled to avoid a
138
+ // preexisting bug: https://git.io/JMPCV
139
+ // this.performRegularLayoutAnimation( {
140
+ // useLastLayoutAnimation: false,
141
+ // } );
139
142
  }
140
143
  }
141
144
 
@@ -166,7 +169,7 @@ class BottomSheet extends Component {
166
169
  });
167
170
  }
168
171
 
169
- Dimensions.addEventListener('change', this.onDimensionsChange); // 'Will' keyboard events are not available on Android.
172
+ this.dimensionsChangeSubscription = Dimensions.addEventListener('change', this.onDimensionsChange); // 'Will' keyboard events are not available on Android.
170
173
  // Reference: https://reactnative.dev/docs/0.61/keyboard#addlistener
171
174
 
172
175
  this.keyboardShowListener = Keyboard.addListener(Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow', this.keyboardShow);
@@ -176,7 +179,7 @@ class BottomSheet extends Component {
176
179
  }
177
180
 
178
181
  componentWillUnmount() {
179
- Dimensions.removeEventListener('change', this.onDimensionsChange);
182
+ this.dimensionsChangeSubscription.remove();
180
183
  this.keyboardShowListener.remove();
181
184
  this.keyboardHideListener.remove();
182
185
 
@@ -190,7 +193,6 @@ class BottomSheet extends Component {
190
193
 
191
194
  this.safeAreaEventSubscription.remove();
192
195
  this.safeAreaEventSubscription = null;
193
- SafeArea.removeEventListener('safeAreaInsetsForRootViewDidChange', this.onSafeAreaInsetsUpdate);
194
196
  }
195
197
 
196
198
  onSafeAreaInsetsUpdate(result) {
@@ -225,15 +227,15 @@ class BottomSheet extends Component {
225
227
  } = this.state;
226
228
  const statusBarHeight = Platform.OS === 'android' ? StatusBar.currentHeight : 0; // `maxHeight` when modal is opened along with a keyboard
227
229
 
228
- const maxHeightWithOpenKeyboard = 0.95 * (Dimensions.get('window').height - this.keyboardHeight - statusBarHeight - this.headerHeight); // On horizontal mode `maxHeight` has to be set on 90% of width
230
+ const maxHeightWithOpenKeyboard = 0.95 * (Dimensions.get('window').height - this.keyboardHeight - statusBarHeight - this.headerHeight); // In landscape orientation, set `maxHeight` to ~96% of the height
229
231
 
230
232
  if (width > height) {
231
233
  this.setState({
232
- maxHeight: Math.min(0.9 * height, maxHeightWithOpenKeyboard)
233
- }); // On vertical mode `maxHeight` has to be set on 50% of width
234
+ maxHeight: Math.min(0.96 * height - this.headerHeight, maxHeightWithOpenKeyboard)
235
+ }); // In portrait orientation, set `maxHeight` to ~59% of the height
234
236
  } else {
235
237
  this.setState({
236
- maxHeight: Math.min(height / 2 - safeAreaBottomInset, maxHeightWithOpenKeyboard)
238
+ maxHeight: Math.min(height * 0.59 - safeAreaBottomInset - this.headerHeight, maxHeightWithOpenKeyboard)
237
239
  });
238
240
  }
239
241
  }
@@ -254,7 +256,7 @@ class BottomSheet extends Component {
254
256
  } = nativeEvent.layout; // The layout animation should only be triggered if the header
255
257
  // height has changed after being mounted.
256
258
 
257
- if (this.headerHeight !== 0 && height !== this.headerHeight) {
259
+ if (this.headerHeight !== 0 && Math.round(height) !== Math.round(this.headerHeight)) {
258
260
  this.performRegularLayoutAnimation({
259
261
  useLastLayoutAnimation: true
260
262
  });
@@ -533,7 +535,8 @@ class BottomSheet extends Component {
533
535
  keyboardVerticalOffset: -safeAreaBottomInset
534
536
  }, createElement(View, {
535
537
  style: styles.header,
536
- onLayout: this.onHeaderLayout
538
+ onLayout: this.onHeaderLayout,
539
+ testID: `${rest.testID || 'bottom-sheet'}-header`
537
540
  }, showDragIndicator() && createElement(View, {
538
541
  style: styles.dragIndicator
539
542
  }), !hideHeader && getHeader()), createElement(WrapperView, hasNavigation ? {