@wordpress/components 22.1.0 → 23.1.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 (660) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/CONTRIBUTING.md +0 -21
  3. package/build/alignment-matrix-control/cell.js.map +1 -1
  4. package/build/alignment-matrix-control/icon.js +4 -2
  5. package/build/alignment-matrix-control/icon.js.map +1 -1
  6. package/build/alignment-matrix-control/index.js +25 -1
  7. package/build/alignment-matrix-control/index.js.map +1 -1
  8. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
  9. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  10. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
  11. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  12. package/build/alignment-matrix-control/types.js +6 -0
  13. package/build/alignment-matrix-control/types.js.map +1 -0
  14. package/build/alignment-matrix-control/utils.js +9 -8
  15. package/build/alignment-matrix-control/utils.js.map +1 -1
  16. package/build/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
  17. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  18. package/build/autocomplete/index.js +39 -12
  19. package/build/autocomplete/index.js.map +1 -1
  20. package/build/base-control/hooks.js +52 -0
  21. package/build/base-control/hooks.js.map +1 -0
  22. package/build/base-control/index.js +24 -7
  23. package/build/base-control/index.js.map +1 -1
  24. package/build/base-field/hook.js +0 -14
  25. package/build/base-field/hook.js.map +1 -1
  26. package/build/base-field/index.js.map +1 -1
  27. package/build/base-field/styles.js +5 -5
  28. package/build/base-field/styles.js.map +1 -1
  29. package/build/base-field/types.js +6 -0
  30. package/build/base-field/types.js.map +1 -0
  31. package/build/border-box-control/border-box-control/component.js +0 -3
  32. package/build/border-box-control/border-box-control/component.js.map +1 -1
  33. package/build/border-box-control/border-box-control/hook.js +0 -2
  34. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  35. package/build/border-box-control/border-box-control-split-controls/component.js +0 -2
  36. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  37. package/build/border-box-control/border-box-control-split-controls/hook.js +0 -2
  38. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  39. package/build/border-control/border-control/component.js +1 -2
  40. package/build/border-control/border-control/component.js.map +1 -1
  41. package/build/border-control/border-control/hook.js +0 -2
  42. package/build/border-control/border-control/hook.js.map +1 -1
  43. package/build/border-control/border-control-dropdown/component.js +6 -11
  44. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  45. package/build/border-control/border-control-dropdown/hook.js +0 -2
  46. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  47. package/build/border-control/styles.js +16 -16
  48. package/build/border-control/styles.js.map +1 -1
  49. package/build/box-control/linked-button.js +3 -4
  50. package/build/box-control/linked-button.js.map +1 -1
  51. package/build/color-palette/index.js +7 -15
  52. package/build/color-palette/index.js.map +1 -1
  53. package/build/color-picker/input-with-slider.js +1 -0
  54. package/build/color-picker/input-with-slider.js.map +1 -1
  55. package/build/color-picker/styles.js +8 -8
  56. package/build/color-picker/styles.js.map +1 -1
  57. package/build/custom-select-control/index.js +14 -2
  58. package/build/custom-select-control/index.js.map +1 -1
  59. package/build/dashicon/index.js +1 -4
  60. package/build/dashicon/index.js.map +1 -1
  61. package/build/date-time/date-time/index.js +4 -4
  62. package/build/date-time/date-time/index.js.map +1 -1
  63. package/build/dimension-control/index.js.map +1 -1
  64. package/build/dropdown/index.js +45 -10
  65. package/build/dropdown/index.js.map +1 -1
  66. package/build/duotone-picker/duotone-picker.js +2 -2
  67. package/build/duotone-picker/duotone-picker.js.map +1 -1
  68. package/build/gradient-picker/index.js +4 -11
  69. package/build/gradient-picker/index.js.map +1 -1
  70. package/build/higher-order/navigate-regions/index.js +4 -3
  71. package/build/higher-order/navigate-regions/index.js.map +1 -1
  72. package/build/higher-order/with-fallback-styles/index.js +2 -2
  73. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  74. package/build/index.js +13 -9
  75. package/build/index.js.map +1 -1
  76. package/build/input-control/index.js +17 -5
  77. package/build/input-control/index.js.map +1 -1
  78. package/build/input-control/input-base.js +2 -0
  79. package/build/input-control/input-base.js.map +1 -1
  80. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  81. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  82. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -9
  83. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  84. package/build/mobile/bottom-sheet/switch-cell.native.js +1 -3
  85. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  86. package/build/mobile/global-styles-context/index.native.js +8 -8
  87. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  88. package/build/mobile/global-styles-context/utils.native.js +30 -12
  89. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  90. package/build/mobile/keyboard-aware-flat-list/index.ios.js +4 -2
  91. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  92. package/build/modal/index.js +8 -0
  93. package/build/modal/index.js.map +1 -1
  94. package/build/navigator/navigator-provider/component.js +12 -8
  95. package/build/navigator/navigator-provider/component.js.map +1 -1
  96. package/build/number-control/styles/number-control-styles.js +8 -8
  97. package/build/number-control/styles/number-control-styles.js.map +1 -1
  98. package/build/palette-edit/index.js +72 -33
  99. package/build/palette-edit/index.js.map +1 -1
  100. package/build/popover/index.js +10 -2
  101. package/build/popover/index.js.map +1 -1
  102. package/build/query-controls/index.js +1 -0
  103. package/build/query-controls/index.js.map +1 -1
  104. package/build/snackbar/index.js +35 -24
  105. package/build/snackbar/index.js.map +1 -1
  106. package/build/snackbar/list.js +14 -19
  107. package/build/snackbar/list.js.map +1 -1
  108. package/build/snackbar/types.js +6 -0
  109. package/build/snackbar/types.js.map +1 -0
  110. package/build/tab-panel/index.js +15 -9
  111. package/build/tab-panel/index.js.map +1 -1
  112. package/build/theme/color-algorithms.js +118 -0
  113. package/build/theme/color-algorithms.js.map +1 -0
  114. package/build/theme/index.js +21 -18
  115. package/build/theme/index.js.map +1 -1
  116. package/build/theme/styles.js +10 -7
  117. package/build/theme/styles.js.map +1 -1
  118. package/build/toggle-control/index.js +5 -2
  119. package/build/toggle-control/index.js.map +1 -1
  120. package/build/ui/context/context-system-provider.js +3 -1
  121. package/build/ui/context/context-system-provider.js.map +1 -1
  122. package/build/unit-control/index.js +5 -2
  123. package/build/unit-control/index.js.map +1 -1
  124. package/build/utils/colors-values.js +1 -1
  125. package/build/utils/colors-values.js.map +1 -1
  126. package/build/utils/config-values.js +0 -2
  127. package/build/utils/config-values.js.map +1 -1
  128. package/build/utils/hooks/use-controlled-value.js.map +1 -1
  129. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  130. package/build-module/alignment-matrix-control/icon.js +4 -2
  131. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  132. package/build-module/alignment-matrix-control/index.js +23 -1
  133. package/build-module/alignment-matrix-control/index.js.map +1 -1
  134. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
  135. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  136. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
  137. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  138. package/build-module/alignment-matrix-control/types.js +2 -0
  139. package/build-module/alignment-matrix-control/types.js.map +1 -0
  140. package/build-module/alignment-matrix-control/utils.js +13 -8
  141. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  142. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
  143. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  144. package/build-module/autocomplete/index.js +39 -11
  145. package/build-module/autocomplete/index.js.map +1 -1
  146. package/build-module/base-control/hooks.js +41 -0
  147. package/build-module/base-control/hooks.js.map +1 -0
  148. package/build-module/base-control/index.js +18 -8
  149. package/build-module/base-control/index.js.map +1 -1
  150. package/build-module/base-field/hook.js +0 -14
  151. package/build-module/base-field/hook.js.map +1 -1
  152. package/build-module/base-field/index.js.map +1 -1
  153. package/build-module/base-field/styles.js +5 -5
  154. package/build-module/base-field/styles.js.map +1 -1
  155. package/build-module/base-field/types.js +2 -0
  156. package/build-module/base-field/types.js.map +1 -0
  157. package/build-module/border-box-control/border-box-control/component.js +0 -3
  158. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  159. package/build-module/border-box-control/border-box-control/hook.js +0 -2
  160. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  161. package/build-module/border-box-control/border-box-control-split-controls/component.js +0 -2
  162. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  163. package/build-module/border-box-control/border-box-control-split-controls/hook.js +0 -2
  164. package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  165. package/build-module/border-control/border-control/component.js +1 -2
  166. package/build-module/border-control/border-control/component.js.map +1 -1
  167. package/build-module/border-control/border-control/hook.js +0 -2
  168. package/build-module/border-control/border-control/hook.js.map +1 -1
  169. package/build-module/border-control/border-control-dropdown/component.js +6 -11
  170. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  171. package/build-module/border-control/border-control-dropdown/hook.js +0 -2
  172. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  173. package/build-module/border-control/styles.js +17 -17
  174. package/build-module/border-control/styles.js.map +1 -1
  175. package/build-module/box-control/linked-button.js +3 -4
  176. package/build-module/box-control/linked-button.js.map +1 -1
  177. package/build-module/color-palette/index.js +7 -15
  178. package/build-module/color-palette/index.js.map +1 -1
  179. package/build-module/color-picker/input-with-slider.js +1 -0
  180. package/build-module/color-picker/input-with-slider.js.map +1 -1
  181. package/build-module/color-picker/styles.js +8 -8
  182. package/build-module/color-picker/styles.js.map +1 -1
  183. package/build-module/custom-select-control/index.js +14 -2
  184. package/build-module/custom-select-control/index.js.map +1 -1
  185. package/build-module/dashicon/index.js +1 -4
  186. package/build-module/dashicon/index.js.map +1 -1
  187. package/build-module/date-time/date-time/index.js +4 -4
  188. package/build-module/date-time/date-time/index.js.map +1 -1
  189. package/build-module/dimension-control/index.js +1 -2
  190. package/build-module/dimension-control/index.js.map +1 -1
  191. package/build-module/dropdown/index.js +44 -10
  192. package/build-module/dropdown/index.js.map +1 -1
  193. package/build-module/duotone-picker/duotone-picker.js +2 -2
  194. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  195. package/build-module/gradient-picker/index.js +4 -10
  196. package/build-module/gradient-picker/index.js.map +1 -1
  197. package/build-module/higher-order/navigate-regions/index.js +4 -3
  198. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  199. package/build-module/higher-order/with-fallback-styles/index.js +2 -2
  200. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  201. package/build-module/index.js +2 -3
  202. package/build-module/index.js.map +1 -1
  203. package/build-module/input-control/index.js +16 -5
  204. package/build-module/input-control/index.js.map +1 -1
  205. package/build-module/input-control/input-base.js +2 -0
  206. package/build-module/input-control/input-base.js.map +1 -1
  207. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  208. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  209. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -8
  210. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  211. package/build-module/mobile/bottom-sheet/switch-cell.native.js +1 -2
  212. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  213. package/build-module/mobile/global-styles-context/index.native.js +8 -7
  214. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  215. package/build-module/mobile/global-styles-context/utils.native.js +31 -13
  216. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  217. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  218. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  219. package/build-module/modal/index.js +8 -0
  220. package/build-module/modal/index.js.map +1 -1
  221. package/build-module/navigator/navigator-provider/component.js +12 -8
  222. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  223. package/build-module/number-control/styles/number-control-styles.js +8 -10
  224. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  225. package/build-module/palette-edit/index.js +73 -34
  226. package/build-module/palette-edit/index.js.map +1 -1
  227. package/build-module/popover/index.js +10 -2
  228. package/build-module/popover/index.js.map +1 -1
  229. package/build-module/query-controls/index.js +1 -0
  230. package/build-module/query-controls/index.js.map +1 -1
  231. package/build-module/snackbar/index.js +33 -23
  232. package/build-module/snackbar/index.js.map +1 -1
  233. package/build-module/snackbar/list.js +14 -22
  234. package/build-module/snackbar/list.js.map +1 -1
  235. package/build-module/snackbar/types.js +2 -0
  236. package/build-module/snackbar/types.js.map +1 -0
  237. package/build-module/tab-panel/index.js +15 -8
  238. package/build-module/tab-panel/index.js.map +1 -1
  239. package/build-module/theme/color-algorithms.js +105 -0
  240. package/build-module/theme/color-algorithms.js.map +1 -0
  241. package/build-module/theme/index.js +21 -17
  242. package/build-module/theme/index.js.map +1 -1
  243. package/build-module/theme/styles.js +8 -6
  244. package/build-module/theme/styles.js.map +1 -1
  245. package/build-module/toggle-control/index.js +4 -2
  246. package/build-module/toggle-control/index.js.map +1 -1
  247. package/build-module/ui/context/context-system-provider.js +3 -2
  248. package/build-module/ui/context/context-system-provider.js.map +1 -1
  249. package/build-module/unit-control/index.js +5 -2
  250. package/build-module/unit-control/index.js.map +1 -1
  251. package/build-module/utils/colors-values.js +1 -1
  252. package/build-module/utils/colors-values.js.map +1 -1
  253. package/build-module/utils/config-values.js +0 -2
  254. package/build-module/utils/config-values.js.map +1 -1
  255. package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
  256. package/build-style/style-rtl.css +108 -104
  257. package/build-style/style.css +108 -104
  258. package/build-types/alignment-matrix-control/cell.d.ts +5 -0
  259. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -0
  260. package/build-types/alignment-matrix-control/icon.d.ts +6 -0
  261. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -0
  262. package/build-types/alignment-matrix-control/index.d.ts +30 -0
  263. package/build-types/alignment-matrix-control/index.d.ts.map +1 -0
  264. package/build-types/alignment-matrix-control/stories/index.d.ts +14 -0
  265. package/build-types/alignment-matrix-control/stories/index.d.ts.map +1 -0
  266. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +19 -0
  267. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -0
  268. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +23 -0
  269. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -0
  270. package/build-types/alignment-matrix-control/test/index.d.ts +2 -0
  271. package/build-types/alignment-matrix-control/test/index.d.ts.map +1 -0
  272. package/build-types/alignment-matrix-control/types.d.ts +39 -0
  273. package/build-types/alignment-matrix-control/types.d.ts.map +1 -0
  274. package/build-types/alignment-matrix-control/utils.d.ts +33 -0
  275. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -0
  276. package/build-types/base-control/hooks.d.ts +23 -0
  277. package/build-types/base-control/hooks.d.ts.map +1 -0
  278. package/build-types/base-control/index.d.ts +17 -7
  279. package/build-types/base-control/index.d.ts.map +1 -1
  280. package/build-types/base-control/stories/index.d.ts.map +1 -1
  281. package/build-types/base-control/test/index.d.ts +2 -0
  282. package/build-types/base-control/test/index.d.ts.map +1 -0
  283. package/build-types/base-control/types.d.ts +8 -2
  284. package/build-types/base-control/types.d.ts.map +1 -1
  285. package/build-types/base-field/hook.d.ts +7 -31
  286. package/build-types/base-field/hook.d.ts.map +1 -1
  287. package/build-types/base-field/index.d.ts +1 -1
  288. package/build-types/base-field/index.d.ts.map +1 -1
  289. package/build-types/base-field/styles.d.ts +5 -5
  290. package/build-types/base-field/styles.d.ts.map +1 -1
  291. package/build-types/base-field/test/index.d.ts +2 -0
  292. package/build-types/base-field/test/index.d.ts.map +1 -0
  293. package/build-types/base-field/types.d.ts +29 -0
  294. package/build-types/base-field/types.d.ts.map +1 -0
  295. package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
  296. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  297. package/build-types/border-box-control/border-box-control/hook.d.ts +2 -3
  298. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  299. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +2 -2
  300. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
  301. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  302. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +2 -3
  303. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  304. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +2 -2
  305. package/build-types/border-box-control/stories/index.d.ts +1 -1
  306. package/build-types/border-control/border-control/component.d.ts +1 -1
  307. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  308. package/build-types/border-control/border-control/hook.d.ts +2 -3
  309. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  310. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -1
  311. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  312. package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -3
  313. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  314. package/build-types/border-control/border-control-style-picker/hook.d.ts +2 -2
  315. package/build-types/border-control/stories/index.d.ts +6 -6
  316. package/build-types/border-control/stories/index.d.ts.map +1 -1
  317. package/build-types/border-control/styles.d.ts.map +1 -1
  318. package/build-types/border-control/types.d.ts +1 -1
  319. package/build-types/border-control/types.d.ts.map +1 -1
  320. package/build-types/card/card/hook.d.ts +2 -2
  321. package/build-types/card/card-body/hook.d.ts +2 -2
  322. package/build-types/card/card-divider/hook.d.ts +2 -2
  323. package/build-types/card/card-footer/hook.d.ts +2 -2
  324. package/build-types/card/card-header/hook.d.ts +2 -2
  325. package/build-types/card/card-media/hook.d.ts +2 -2
  326. package/build-types/color-palette/index.d.ts +3 -4
  327. package/build-types/color-palette/index.d.ts.map +1 -1
  328. package/build-types/color-palette/stories/index.d.ts +6 -14
  329. package/build-types/color-palette/stories/index.d.ts.map +1 -1
  330. package/build-types/color-palette/styles.d.ts +1 -1
  331. package/build-types/color-palette/types.d.ts +4 -17
  332. package/build-types/color-palette/types.d.ts.map +1 -1
  333. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  334. package/build-types/color-picker/styles.d.ts +5 -5
  335. package/build-types/color-picker/styles.d.ts.map +1 -1
  336. package/build-types/custom-select-control/index.d.ts.map +1 -1
  337. package/build-types/dashicon/index.d.ts +6 -20
  338. package/build-types/dashicon/index.d.ts.map +1 -1
  339. package/build-types/dashicon/types.d.ts +14 -0
  340. package/build-types/dashicon/types.d.ts.map +1 -1
  341. package/build-types/date-time/date/styles.d.ts +3 -3
  342. package/build-types/date-time/date-time/styles.d.ts +3 -3
  343. package/build-types/date-time/time/styles.d.ts +8 -8
  344. package/build-types/disabled/stories/index.d.ts.map +1 -1
  345. package/build-types/dropdown/index.d.ts +29 -1
  346. package/build-types/dropdown/index.d.ts.map +1 -1
  347. package/build-types/dropdown/stories/index.d.ts +23 -0
  348. package/build-types/dropdown/stories/index.d.ts.map +1 -0
  349. package/build-types/dropdown/test/index.d.ts +2 -0
  350. package/build-types/dropdown/test/index.d.ts.map +1 -0
  351. package/build-types/dropdown/types.d.ts +101 -0
  352. package/build-types/dropdown/types.d.ts.map +1 -1
  353. package/build-types/elevation/hook.d.ts +2 -2
  354. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  355. package/build-types/flex/flex/hook.d.ts +2 -2
  356. package/build-types/flex/flex-block/hook.d.ts +2 -2
  357. package/build-types/flex/flex-item/hook.d.ts +2 -2
  358. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -5
  359. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  360. package/build-types/grid/hook.d.ts +2 -2
  361. package/build-types/h-stack/component.d.ts +1 -1
  362. package/build-types/h-stack/hook.d.ts +2 -2
  363. package/build-types/heading/hook.d.ts +2 -2
  364. package/build-types/icon/stories/index.d.ts +22 -0
  365. package/build-types/icon/stories/index.d.ts.map +1 -0
  366. package/build-types/input-control/index.d.ts +1 -1
  367. package/build-types/input-control/index.d.ts.map +1 -1
  368. package/build-types/input-control/input-base.d.ts.map +1 -1
  369. package/build-types/input-control/stories/index.d.ts +1 -0
  370. package/build-types/input-control/stories/index.d.ts.map +1 -1
  371. package/build-types/input-control/types.d.ts +2 -1
  372. package/build-types/input-control/types.d.ts.map +1 -1
  373. package/build-types/item-group/item/hook.d.ts +2 -2
  374. package/build-types/item-group/item-group/hook.d.ts +2 -2
  375. package/build-types/modal/index.d.ts.map +1 -1
  376. package/build-types/modal/stories/index.d.ts.map +1 -1
  377. package/build-types/navigator/navigator-back-button/hook.d.ts +3 -3
  378. package/build-types/navigator/navigator-button/hook.d.ts +3 -3
  379. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  380. package/build-types/number-control/index.d.ts +2 -2
  381. package/build-types/number-control/index.d.ts.map +1 -1
  382. package/build-types/number-control/stories/index.d.ts +25 -0
  383. package/build-types/number-control/stories/index.d.ts.map +1 -0
  384. package/build-types/number-control/styles/number-control-styles.d.ts +6 -6
  385. package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
  386. package/build-types/number-control/test/index.d.ts +2 -0
  387. package/build-types/number-control/test/index.d.ts.map +1 -0
  388. package/build-types/popover/index.d.ts +1 -1
  389. package/build-types/popover/index.d.ts.map +1 -1
  390. package/build-types/popover/stories/e2e/index.d.ts +1 -1
  391. package/build-types/range-control/index.d.ts +1 -1
  392. package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
  393. package/build-types/resizable-box/resize-tooltip/index.d.ts +15 -19
  394. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  395. package/build-types/resizable-box/resize-tooltip/label.d.ts +4 -3
  396. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  397. package/build-types/scrollable/hook.d.ts +2 -2
  398. package/build-types/search-control/index.d.ts +1 -1
  399. package/build-types/search-control/stories/index.d.ts +2 -2
  400. package/build-types/snackbar/index.d.ts +19 -0
  401. package/build-types/snackbar/index.d.ts.map +1 -0
  402. package/build-types/snackbar/list.d.ts +18 -0
  403. package/build-types/snackbar/list.d.ts.map +1 -0
  404. package/build-types/snackbar/stories/index.d.ts +16 -0
  405. package/build-types/snackbar/stories/index.d.ts.map +1 -0
  406. package/build-types/snackbar/stories/list.d.ts +12 -0
  407. package/build-types/snackbar/stories/list.d.ts.map +1 -0
  408. package/build-types/snackbar/types.d.ts +111 -0
  409. package/build-types/snackbar/types.d.ts.map +1 -0
  410. package/build-types/spacer/hook.d.ts +2 -2
  411. package/build-types/spinner/index.d.ts +1 -1
  412. package/build-types/surface/hook.d.ts +2 -2
  413. package/build-types/tab-panel/index.d.ts +1 -1
  414. package/build-types/tab-panel/index.d.ts.map +1 -1
  415. package/build-types/tab-panel/types.d.ts +19 -1
  416. package/build-types/tab-panel/types.d.ts.map +1 -1
  417. package/build-types/text/hook.d.ts +2 -2
  418. package/build-types/text-control/index.d.ts +2 -2
  419. package/build-types/text-control/stories/index.d.ts.map +1 -1
  420. package/build-types/text-control/types.d.ts +1 -5
  421. package/build-types/text-control/types.d.ts.map +1 -1
  422. package/build-types/theme/color-algorithms.d.ts +20 -0
  423. package/build-types/theme/color-algorithms.d.ts.map +1 -0
  424. package/build-types/theme/index.d.ts +1 -1
  425. package/build-types/theme/index.d.ts.map +1 -1
  426. package/build-types/theme/stories/index.d.ts +4 -0
  427. package/build-types/theme/stories/index.d.ts.map +1 -1
  428. package/build-types/theme/styles.d.ts +3 -2
  429. package/build-types/theme/styles.d.ts.map +1 -1
  430. package/build-types/theme/test/color-algorithms.d.ts +2 -0
  431. package/build-types/theme/test/color-algorithms.d.ts.map +1 -0
  432. package/build-types/theme/types.d.ts +41 -3
  433. package/build-types/theme/types.d.ts.map +1 -1
  434. package/build-types/toggle-control/index.d.ts.map +1 -1
  435. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
  436. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
  437. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  438. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  439. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -2
  440. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -2
  441. package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -2
  442. package/build-types/truncate/hook.d.ts +2 -2
  443. package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
  444. package/build-types/ui/control-group/hook.d.ts +2 -2
  445. package/build-types/ui/control-label/hook.d.ts +2 -2
  446. package/build-types/ui/form-group/form-group.d.ts +2 -2
  447. package/build-types/ui/form-group/use-form-group.d.ts +5 -5
  448. package/build-types/unit-control/index.d.ts +2 -1
  449. package/build-types/unit-control/index.d.ts.map +1 -1
  450. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -2
  451. package/build-types/unit-control/types.d.ts +4 -0
  452. package/build-types/unit-control/types.d.ts.map +1 -1
  453. package/build-types/utils/config-values.d.ts +0 -2
  454. package/build-types/utils/hooks/use-controlled-value.d.ts +2 -1
  455. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  456. package/build-types/v-stack/component.d.ts +2 -2
  457. package/build-types/v-stack/hook.d.ts +2 -2
  458. package/build-types/v-stack/stories/index.d.ts +2 -2
  459. package/package.json +21 -20
  460. package/src/alignment-matrix-control/README.md +7 -7
  461. package/src/alignment-matrix-control/{cell.js → cell.tsx} +7 -1
  462. package/src/alignment-matrix-control/{icon.js → icon.tsx} +6 -3
  463. package/src/alignment-matrix-control/{index.js → index.tsx} +31 -4
  464. package/src/alignment-matrix-control/stories/{index.js → index.tsx} +17 -9
  465. package/src/alignment-matrix-control/styles/{alignment-matrix-control-icon-styles.js → alignment-matrix-control-icon-styles.ts} +11 -3
  466. package/src/alignment-matrix-control/styles/{alignment-matrix-control-styles.js → alignment-matrix-control-styles.ts} +13 -3
  467. package/src/alignment-matrix-control/test/{index.js → index.tsx} +5 -5
  468. package/src/alignment-matrix-control/types.ts +54 -0
  469. package/src/alignment-matrix-control/{utils.js → utils.tsx} +24 -14
  470. package/src/angle-picker-control/styles/angle-picker-control-styles.js +4 -0
  471. package/src/autocomplete/index.js +44 -15
  472. package/src/autocomplete/test/index.js +2 -0
  473. package/src/base-control/README.md +21 -12
  474. package/src/base-control/hooks.ts +45 -0
  475. package/src/base-control/index.tsx +18 -7
  476. package/src/base-control/stories/index.tsx +8 -10
  477. package/src/base-control/test/index.tsx +53 -0
  478. package/src/base-control/types.ts +8 -2
  479. package/src/base-field/README.md +21 -22
  480. package/src/base-field/{hook.js → hook.ts} +5 -15
  481. package/src/base-field/{index.js → index.ts} +0 -0
  482. package/src/base-field/{styles.js → styles.ts} +2 -2
  483. package/src/base-field/test/__snapshots__/{index.js.snap → index.tsx.snap} +4 -4
  484. package/src/base-field/test/{index.js → index.tsx} +10 -5
  485. package/src/base-field/types.ts +29 -0
  486. package/src/border-box-control/border-box-control/README.md +1 -0
  487. package/src/border-box-control/border-box-control/component.tsx +0 -7
  488. package/src/border-box-control/border-box-control/hook.ts +0 -2
  489. package/src/border-box-control/border-box-control-split-controls/component.tsx +0 -2
  490. package/src/border-box-control/border-box-control-split-controls/hook.ts +0 -2
  491. package/src/border-box-control/test/index.js +5 -1
  492. package/src/border-control/border-control/component.tsx +1 -4
  493. package/src/border-control/border-control/hook.ts +0 -2
  494. package/src/border-control/border-control-dropdown/component.tsx +11 -17
  495. package/src/border-control/border-control-dropdown/hook.ts +0 -2
  496. package/src/border-control/stories/index.tsx +0 -1
  497. package/src/border-control/styles.ts +1 -10
  498. package/src/border-control/test/index.js +70 -67
  499. package/src/border-control/types.ts +1 -4
  500. package/src/box-control/linked-button.js +8 -11
  501. package/src/box-control/test/index.js +207 -134
  502. package/src/button/stories/index.js +30 -0
  503. package/src/button/style.scss +17 -14
  504. package/src/button/test/index.js +32 -15
  505. package/src/card/test/index.tsx +32 -20
  506. package/src/checkbox-control/test/index.tsx +2 -0
  507. package/src/circular-option-picker/style.scss +1 -0
  508. package/src/color-palette/index.tsx +16 -18
  509. package/src/color-palette/stories/index.tsx +1 -18
  510. package/src/color-palette/test/__snapshots__/index.tsx.snap +4 -4
  511. package/src/color-palette/test/index.tsx +86 -36
  512. package/src/color-palette/types.ts +4 -18
  513. package/src/color-picker/README.md +1 -0
  514. package/src/color-picker/input-with-slider.tsx +1 -0
  515. package/src/color-picker/styles.ts +0 -4
  516. package/src/color-picker/test/index.js +2 -0
  517. package/src/combobox-control/test/index.js +2 -0
  518. package/src/confirm-dialog/README.md +3 -2
  519. package/src/confirm-dialog/test/index.js +2 -0
  520. package/src/custom-select-control/README.md +14 -0
  521. package/src/custom-select-control/index.js +14 -2
  522. package/src/dashicon/{index.js → index.tsx} +10 -4
  523. package/src/dashicon/types.ts +17 -0
  524. package/src/date-time/date/test/index.tsx +2 -0
  525. package/src/date-time/date-time/index.tsx +2 -2
  526. package/src/date-time/time/test/index.tsx +2 -0
  527. package/src/dimension-control/index.js +2 -3
  528. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -8
  529. package/src/dimension-control/test/index.test.js +2 -0
  530. package/src/disabled/stories/index.tsx +6 -2
  531. package/src/disabled/test/index.tsx +23 -11
  532. package/src/dropdown/README.md +41 -46
  533. package/src/dropdown/{index.js → index.tsx} +57 -13
  534. package/src/dropdown/stories/{index.js → index.tsx} +21 -8
  535. package/src/dropdown/test/index.tsx +88 -0
  536. package/src/dropdown/types.ts +107 -0
  537. package/src/dropdown-menu/README.md +2 -3
  538. package/src/dropdown-menu/test/index.js +20 -12
  539. package/src/duotone-picker/duotone-picker.js +2 -2
  540. package/src/external-link/test/index.tsx +2 -0
  541. package/src/focal-point-picker/test/index.js +2 -0
  542. package/src/focal-point-picker/test/media.js +26 -21
  543. package/src/font-size-picker/test/index.tsx +2 -0
  544. package/src/form-file-upload/test/index.tsx +2 -0
  545. package/src/form-toggle/test/index.tsx +2 -0
  546. package/src/form-token-field/style.scss +1 -1
  547. package/src/form-token-field/test/index.tsx +3 -0
  548. package/src/gradient-picker/index.js +6 -10
  549. package/src/gradient-picker/stories/index.js +0 -1
  550. package/src/grid/test/grid.tsx +31 -31
  551. package/src/guide/test/index.js +2 -0
  552. package/src/higher-order/navigate-regions/index.js +5 -2
  553. package/src/higher-order/navigate-regions/style.scss +13 -59
  554. package/src/higher-order/with-fallback-styles/index.js +4 -2
  555. package/src/higher-order/with-filters/test/index.js +32 -43
  556. package/src/higher-order/with-focus-outside/test/index.js +2 -0
  557. package/src/higher-order/with-focus-return/test/index.js +3 -4
  558. package/src/higher-order/with-notices/test/index.js +1 -0
  559. package/src/icon/stories/index.tsx +103 -0
  560. package/src/index.js +2 -3
  561. package/src/input-control/index.tsx +42 -28
  562. package/src/input-control/input-base.tsx +8 -1
  563. package/src/input-control/stories/index.tsx +6 -0
  564. package/src/input-control/test/index.js +21 -0
  565. package/src/input-control/types.ts +2 -0
  566. package/src/isolated-event-container/test/index.js +2 -0
  567. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  568. package/src/mobile/bottom-sheet/picker-cell.native.js +1 -6
  569. package/src/mobile/bottom-sheet/switch-cell.native.js +2 -2
  570. package/src/mobile/global-styles-context/index.native.js +9 -11
  571. package/src/mobile/global-styles-context/utils.native.js +17 -16
  572. package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  573. package/src/mobile/link-settings/test/edit.native.js +68 -124
  574. package/src/modal/index.tsx +11 -0
  575. package/src/modal/stories/index.tsx +3 -0
  576. package/src/modal/test/index.tsx +13 -0
  577. package/src/navigable-container/test/navigable-menu.js +2 -0
  578. package/src/navigable-container/test/tababble-container.js +2 -0
  579. package/src/navigation/stories/index.js +6 -6
  580. package/src/navigation/stories/{controlled-state.js → utils/controlled-state.js} +3 -3
  581. package/src/navigation/stories/{default.js → utils/default.js} +3 -3
  582. package/src/navigation/stories/{group.js → utils/group.js} +4 -4
  583. package/src/navigation/stories/{hide-if-empty.js → utils/hide-if-empty.js} +3 -3
  584. package/src/navigation/stories/{more-examples.js → utils/more-examples.js} +4 -4
  585. package/src/navigation/stories/{search.js → utils/search.js} +5 -5
  586. package/src/navigation/test/index.js +2 -0
  587. package/src/navigator/navigator-provider/component.tsx +13 -10
  588. package/src/navigator/test/index.tsx +2 -0
  589. package/src/notice/test/index.js +8 -3
  590. package/src/notice/test/list.js +8 -5
  591. package/src/number-control/stories/{index.js → index.tsx} +24 -7
  592. package/src/number-control/styles/{number-control-styles.js → number-control-styles.ts} +5 -3
  593. package/src/number-control/test/index.tsx +602 -0
  594. package/src/palette-edit/index.js +88 -39
  595. package/src/palette-edit/test/index.js +25 -1
  596. package/src/panel/test/__snapshots__/body.js.snap +9 -0
  597. package/src/panel/test/body.js +71 -62
  598. package/src/placeholder/test/index.tsx +3 -0
  599. package/src/popover/index.tsx +10 -2
  600. package/src/popover/style.scss +12 -11
  601. package/src/popover/test/index.tsx +25 -15
  602. package/src/query-controls/index.js +1 -0
  603. package/src/range-control/test/index.tsx +57 -60
  604. package/src/resizable-box/style.scss +1 -0
  605. package/src/sandbox/test/index.js +13 -11
  606. package/src/search-control/style.scss +4 -0
  607. package/src/select-control/test/select-control.tsx +2 -0
  608. package/src/snackbar/README.md +63 -8
  609. package/src/snackbar/{index.js → index.tsx} +46 -28
  610. package/src/snackbar/{list.js → list.tsx} +20 -21
  611. package/src/snackbar/stories/index.tsx +96 -0
  612. package/src/snackbar/stories/list.tsx +98 -0
  613. package/src/snackbar/types.ts +116 -0
  614. package/src/tab-panel/README.md +9 -0
  615. package/src/tab-panel/index.tsx +15 -5
  616. package/src/tab-panel/style.scss +46 -34
  617. package/src/tab-panel/test/index.tsx +113 -0
  618. package/src/tab-panel/types.ts +20 -1
  619. package/src/text/test/__snapshots__/index.tsx.snap +1 -0
  620. package/src/text/test/index.tsx +98 -46
  621. package/src/text-control/stories/index.tsx +0 -1
  622. package/src/text-control/types.ts +1 -6
  623. package/src/text-highlight/test/index.tsx +1 -0
  624. package/src/theme/README.md +32 -2
  625. package/src/theme/color-algorithms.ts +138 -0
  626. package/src/theme/index.tsx +23 -16
  627. package/src/theme/stories/index.tsx +67 -0
  628. package/src/theme/styles.ts +22 -17
  629. package/src/theme/test/color-algorithms.ts +100 -0
  630. package/src/theme/test/index.tsx +68 -35
  631. package/src/theme/types.ts +43 -3
  632. package/src/toggle-control/index.tsx +4 -2
  633. package/src/toggle-group-control/test/index.tsx +15 -2
  634. package/src/toolbar/style.scss +1 -1
  635. package/src/toolbar-group/test/index.js +10 -6
  636. package/src/tools-panel/stories/index.js +1 -1
  637. package/src/tools-panel/stories/{tools-panel-with-item-group-slot.js → utils/tools-panel-with-item-group-slot.js} +14 -11
  638. package/src/tools-panel/test/index.js +20 -14
  639. package/src/tooltip/README.md +7 -0
  640. package/src/tooltip/stories/index.js +68 -78
  641. package/src/tooltip/style.scss +2 -2
  642. package/src/tooltip/test/index.js +111 -18
  643. package/src/ui/context/context-system-provider.js +3 -2
  644. package/src/ui/context/test/context-system-provider.js +5 -4
  645. package/src/ui/control-label/test/index.js +3 -5
  646. package/src/unit-control/README.md +9 -1
  647. package/src/unit-control/index.tsx +3 -0
  648. package/src/unit-control/test/index.tsx +4 -0
  649. package/src/unit-control/types.ts +4 -0
  650. package/src/utils/colors-values.js +1 -1
  651. package/src/utils/config-values.js +0 -2
  652. package/src/utils/hooks/test/use-latest-ref.js +2 -0
  653. package/src/utils/hooks/use-controlled-value.ts +2 -2
  654. package/src/utils/theme-variables.scss +20 -0
  655. package/tsconfig.json +2 -4
  656. package/tsconfig.tsbuildinfo +1 -1
  657. package/src/dropdown/test/index.js +0 -98
  658. package/src/icon/stories/index.js +0 -128
  659. package/src/number-control/test/index.js +0 -478
  660. package/src/snackbar/stories/index.js +0 -89
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/higher-order/with-fallback-styles/index.js"],"names":["mapNodeToProps","WrappedComponent","Component","constructor","arguments","nodeRef","props","node","state","fallbackStyles","undefined","grabStylesCompleted","bindRef","bind","componentDidMount","grabFallbackStyles","componentDidUpdate","newFallbackStyles","setState","Object","values","every","Boolean","render","wrappedComponent"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;eAIiBA,cAAF,IACd,yCAA8BC,gBAAF,IAAwB;AACnD,SAAO,cAAcC,kBAAd,CAAwB;AAC9BC,IAAAA,WAAW,GAAG;AACb,YAAO,GAAGC,SAAV;AACA,WAAKC,OAAL,GAAe,KAAKC,KAAL,CAAWC,IAA1B;AACA,WAAKC,KAAL,GAAa;AACZC,QAAAA,cAAc,EAAEC,SADJ;AAEZC,QAAAA,mBAAmB,EAAE;AAFT,OAAb;AAKA,WAAKC,OAAL,GAAe,KAAKA,OAAL,CAAaC,IAAb,CAAmB,IAAnB,CAAf;AACA;;AAEDD,IAAAA,OAAO,CAAEL,IAAF,EAAS;AACf,UAAK,CAAEA,IAAP,EAAc;AACb;AACA;;AACD,WAAKF,OAAL,GAAeE,IAAf;AACA;;AAEDO,IAAAA,iBAAiB,GAAG;AACnB,WAAKC,kBAAL;AACA;;AAEDC,IAAAA,kBAAkB,GAAG;AACpB,WAAKD,kBAAL;AACA;;AAEDA,IAAAA,kBAAkB,GAAG;AACpB,YAAM;AAAEJ,QAAAA,mBAAF;AAAuBF,QAAAA;AAAvB,UAA0C,KAAKD,KAArD;;AACA,UAAK,KAAKH,OAAL,IAAgB,CAAEM,mBAAvB,EAA6C;AAC5C,cAAMM,iBAAiB,GAAGjB,cAAc,CACvC,KAAKK,OADkC,EAEvC,KAAKC,KAFkC,CAAxC;;AAKA,YAAK,CAAE,qBAASW,iBAAT,EAA4BR,cAA5B,CAAP,EAAsD;AACrD,eAAKS,QAAL,CAAe;AACdT,YAAAA,cAAc,EAAEQ,iBADF;AAEdN,YAAAA,mBAAmB,EAClBQ,MAAM,CAACC,MAAP,CAAeH,iBAAf,EAAmCI,KAAnC,CACCC,OADD;AAHa,WAAf;AAOA;AACD;AACD;;AAEDC,IAAAA,MAAM,GAAG;AACR,YAAMC,gBAAgB,GACrB,4BAAC,gBAAD,6BACM,KAAKlB,KADX,EAEM,KAAKE,KAAL,CAAWC,cAFjB,EADD;AAMA,aAAO,KAAKH,KAAL,CAAWC,IAAX,GACNiB,gBADM,GAGN;AAAK,QAAA,GAAG,EAAG,KAAKZ;AAAhB,cAA6BY,gBAA7B,MAHD;AAKA;;AA3D6B,GAA/B;AA6DA,CA9DD,EA8DG,oBA9DH,C","sourcesContent":["/**\n * External dependencies\n */\nimport { isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\nexport default ( mapNodeToProps ) =>\n\tcreateHigherOrderComponent( ( WrappedComponent ) => {\n\t\treturn class extends Component {\n\t\t\tconstructor() {\n\t\t\t\tsuper( ...arguments );\n\t\t\t\tthis.nodeRef = this.props.node;\n\t\t\t\tthis.state = {\n\t\t\t\t\tfallbackStyles: undefined,\n\t\t\t\t\tgrabStylesCompleted: false,\n\t\t\t\t};\n\n\t\t\t\tthis.bindRef = this.bindRef.bind( this );\n\t\t\t}\n\n\t\t\tbindRef( node ) {\n\t\t\t\tif ( ! node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.nodeRef = node;\n\t\t\t}\n\n\t\t\tcomponentDidMount() {\n\t\t\t\tthis.grabFallbackStyles();\n\t\t\t}\n\n\t\t\tcomponentDidUpdate() {\n\t\t\t\tthis.grabFallbackStyles();\n\t\t\t}\n\n\t\t\tgrabFallbackStyles() {\n\t\t\t\tconst { grabStylesCompleted, fallbackStyles } = this.state;\n\t\t\t\tif ( this.nodeRef && ! grabStylesCompleted ) {\n\t\t\t\t\tconst newFallbackStyles = mapNodeToProps(\n\t\t\t\t\t\tthis.nodeRef,\n\t\t\t\t\t\tthis.props\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( ! isEqual( newFallbackStyles, fallbackStyles ) ) {\n\t\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\t\tfallbackStyles: newFallbackStyles,\n\t\t\t\t\t\t\tgrabStylesCompleted:\n\t\t\t\t\t\t\t\tObject.values( newFallbackStyles ).every(\n\t\t\t\t\t\t\t\t\tBoolean\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trender() {\n\t\t\t\tconst wrappedComponent = (\n\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t{ ...this.props }\n\t\t\t\t\t\t{ ...this.state.fallbackStyles }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\treturn this.props.node ? (\n\t\t\t\t\twrappedComponent\n\t\t\t\t) : (\n\t\t\t\t\t<div ref={ this.bindRef }> { wrappedComponent } </div>\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, 'withFallbackStyles' );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/higher-order/with-fallback-styles/index.js"],"names":["mapNodeToProps","WrappedComponent","Component","constructor","arguments","nodeRef","props","node","state","fallbackStyles","undefined","grabStylesCompleted","bindRef","bind","componentDidMount","grabFallbackStyles","componentDidUpdate","newFallbackStyles","setState","Object","values","every","Boolean","render","wrappedComponent"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;eAIiBA,cAAF,IACd,yCAA8BC,gBAAF,IAAwB;AACnD,SAAO,cAAcC,kBAAd,CAAwB;AAC9BC,IAAAA,WAAW,GAAG;AACb,YAAO,GAAGC,SAAV;AACA,WAAKC,OAAL,GAAe,KAAKC,KAAL,CAAWC,IAA1B;AACA,WAAKC,KAAL,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n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\nexport default ( mapNodeToProps ) =>\n\tcreateHigherOrderComponent( ( WrappedComponent ) => {\n\t\treturn class extends Component {\n\t\t\tconstructor() {\n\t\t\t\tsuper( ...arguments );\n\t\t\t\tthis.nodeRef = this.props.node;\n\t\t\t\tthis.state = {\n\t\t\t\t\tfallbackStyles: undefined,\n\t\t\t\t\tgrabStylesCompleted: false,\n\t\t\t\t};\n\n\t\t\t\tthis.bindRef = this.bindRef.bind( this );\n\t\t\t}\n\n\t\t\tbindRef( node ) {\n\t\t\t\tif ( ! node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.nodeRef = node;\n\t\t\t}\n\n\t\t\tcomponentDidMount() {\n\t\t\t\tthis.grabFallbackStyles();\n\t\t\t}\n\n\t\t\tcomponentDidUpdate() {\n\t\t\t\tthis.grabFallbackStyles();\n\t\t\t}\n\n\t\t\tgrabFallbackStyles() {\n\t\t\t\tconst { grabStylesCompleted, fallbackStyles } = this.state;\n\t\t\t\tif ( this.nodeRef && ! grabStylesCompleted ) {\n\t\t\t\t\tconst newFallbackStyles = mapNodeToProps(\n\t\t\t\t\t\tthis.nodeRef,\n\t\t\t\t\t\tthis.props\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! fastDeepEqual( newFallbackStyles, fallbackStyles )\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.setState( {\n\t\t\t\t\t\t\tfallbackStyles: newFallbackStyles,\n\t\t\t\t\t\t\tgrabStylesCompleted:\n\t\t\t\t\t\t\t\tObject.values( newFallbackStyles ).every(\n\t\t\t\t\t\t\t\t\tBoolean\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trender() {\n\t\t\t\tconst wrappedComponent = (\n\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t{ ...this.props }\n\t\t\t\t\t\t{ ...this.state.fallbackStyles }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\treturn this.props.node ? (\n\t\t\t\t\twrappedComponent\n\t\t\t\t) : (\n\t\t\t\t\t<div ref={ this.bindRef }> { wrappedComponent } </div>\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, 'withFallbackStyles' );\n"]}
package/build/index.js CHANGED
@@ -863,12 +863,6 @@ Object.defineProperty(exports, "__experimentalText", {
863
863
  return _text.Text;
864
864
  }
865
865
  });
866
- Object.defineProperty(exports, "__experimentalTheme", {
867
- enumerable: true,
868
- get: function () {
869
- return _theme.default;
870
- }
871
- });
872
866
  Object.defineProperty(exports, "__experimentalToggleGroupControl", {
873
867
  enumerable: true,
874
868
  get: function () {
@@ -989,6 +983,12 @@ Object.defineProperty(exports, "__experimentalZStack", {
989
983
  return _zStack.ZStack;
990
984
  }
991
985
  });
986
+ Object.defineProperty(exports, "__unstableAnimatePresence", {
987
+ enumerable: true,
988
+ get: function () {
989
+ return _animation.__unstableAnimatePresence;
990
+ }
991
+ });
992
992
  Object.defineProperty(exports, "__unstableComposite", {
993
993
  enumerable: true,
994
994
  get: function () {
@@ -1055,6 +1055,12 @@ Object.defineProperty(exports, "navigateRegions", {
1055
1055
  return _navigateRegions.default;
1056
1056
  }
1057
1057
  });
1058
+ Object.defineProperty(exports, "useBaseControlProps", {
1059
+ enumerable: true,
1060
+ get: function () {
1061
+ return _baseControl.useBaseControlProps;
1062
+ }
1063
+ });
1058
1064
  Object.defineProperty(exports, "withConstrainedTabbing", {
1059
1065
  enumerable: true,
1060
1066
  get: function () {
@@ -1110,7 +1116,7 @@ var _anglePickerControl = _interopRequireDefault(require("./angle-picker-control
1110
1116
 
1111
1117
  var _autocomplete = _interopRequireWildcard(require("./autocomplete"));
1112
1118
 
1113
- var _baseControl = _interopRequireDefault(require("./base-control"));
1119
+ var _baseControl = _interopRequireWildcard(require("./base-control"));
1114
1120
 
1115
1121
  var _borderBoxControl = require("./border-box-control");
1116
1122
 
@@ -1302,8 +1308,6 @@ var _textareaControl = _interopRequireDefault(require("./textarea-control"));
1302
1308
 
1303
1309
  var _textHighlight = _interopRequireDefault(require("./text-highlight"));
1304
1310
 
1305
- var _theme = _interopRequireDefault(require("./theme"));
1306
-
1307
1311
  var _tip = _interopRequireDefault(require("./tip"));
1308
1312
 
1309
1313
  var _toggleControl = _interopRequireDefault(require("./toggle-control"));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAaA;;AACA;;AAIA;;AACA;;AACA;;AAIA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA","sourcesContent":["// Primitives.\nexport {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tLine,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\n\n// Components.\nexport { default as __experimentalAlignmentMatrixControl } from './alignment-matrix-control';\nexport {\n\tdefault as Animate,\n\tgetAnimateClassName as __unstableGetAnimateClassName,\n} from './animate';\nexport { __unstableMotion } from './animation';\nexport { default as AnglePickerControl } from './angle-picker-control';\nexport {\n\tdefault as Autocomplete,\n\tuseAutocompleteProps as __unstableUseAutocompleteProps,\n} from './autocomplete';\nexport { default as BaseControl } from './base-control';\nexport {\n\tBorderBoxControl as __experimentalBorderBoxControl,\n\thasSplitBorders as __experimentalHasSplitBorders,\n\tisDefinedBorder as __experimentalIsDefinedBorder,\n\tisEmptyBorder as __experimentalIsEmptyBorder,\n} from './border-box-control';\nexport { BorderControl as __experimentalBorderControl } from './border-control';\nexport {\n\tdefault as __experimentalBoxControl,\n\tapplyValueToSides as __experimentalApplyValueToSides,\n} from './box-control';\nexport { default as Button } from './button';\nexport { default as ButtonGroup } from './button-group';\nexport {\n\tCard,\n\tCardBody,\n\tCardDivider,\n\tCardFooter,\n\tCardHeader,\n\tCardMedia,\n} from './card';\nexport { default as CheckboxControl } from './checkbox-control';\nexport { default as ClipboardButton } from './clipboard-button';\nexport { default as __experimentalPaletteEdit } from './palette-edit';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as ComboboxControl } from './combobox-control';\nexport {\n\tComposite as __unstableComposite,\n\tCompositeGroup as __unstableCompositeGroup,\n\tCompositeItem as __unstableCompositeItem,\n\tuseCompositeState as __unstableUseCompositeState,\n} from './composite';\nexport { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';\nexport { default as CustomSelectControl } from './custom-select-control';\nexport { default as Dashicon } from './dashicon';\nexport { default as DateTimePicker, DatePicker, TimePicker } from './date-time';\nexport { default as __experimentalDimensionControl } from './dimension-control';\nexport { default as Disabled } from './disabled';\nexport { DisclosureContent as __unstableDisclosureContent } from './disclosure';\nexport { Divider as __experimentalDivider } from './divider';\nexport { default as Draggable } from './draggable';\nexport { default as DropZone } from './drop-zone';\nexport { default as DropZoneProvider } from './drop-zone/provider';\nexport { default as Dropdown } from './dropdown';\nexport { default as __experimentalDropdownContentWrapper } from './dropdown/dropdown-content-wrapper';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { DuotoneSwatch, DuotonePicker } from './duotone-picker';\nexport { Elevation as __experimentalElevation } from './elevation';\nexport { default as ExternalLink } from './external-link';\nexport { Flex, FlexBlock, FlexItem } from './flex';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as FocusableIframe } from './focusable-iframe';\nexport { default as FontSizePicker } from './font-size-picker';\nexport { default as FormFileUpload } from './form-file-upload';\nexport { default as FormToggle } from './form-toggle';\nexport { default as FormTokenField } from './form-token-field';\nexport { default as GradientPicker } from './gradient-picker';\nexport { default as CustomGradientPicker } from './custom-gradient-picker';\nexport { Grid as __experimentalGrid } from './grid';\nexport { default as Guide } from './guide';\nexport { default as GuidePage } from './guide/page';\nexport { Heading as __experimentalHeading } from './heading';\nexport { HStack as __experimentalHStack } from './h-stack';\nexport { default as Icon } from './icon';\nexport { default as IconButton } from './button/deprecated';\nexport {\n\tItemGroup as __experimentalItemGroup,\n\tItem as __experimentalItem,\n} from './item-group';\nexport { default as __experimentalInputControl } from './input-control';\nexport { default as __experimentalInputControlPrefixWrapper } from './input-control/input-prefix-wrapper';\nexport { default as __experimentalInputControlSuffixWrapper } from './input-control/input-suffix-wrapper';\nexport { default as KeyboardShortcuts } from './keyboard-shortcuts';\nexport { default as MenuGroup } from './menu-group';\nexport { default as MenuItem } from './menu-item';\nexport { default as MenuItemsChoice } from './menu-items-choice';\nexport { default as Modal } from './modal';\nexport { default as ScrollLock } from './scroll-lock';\nexport { NavigableMenu, TabbableContainer } from './navigable-container';\nexport { default as __experimentalNavigation } from './navigation';\nexport { default as __experimentalNavigationBackButton } from './navigation/back-button';\nexport { default as __experimentalNavigationGroup } from './navigation/group';\nexport { default as __experimentalNavigationItem } from './navigation/item';\nexport { default as __experimentalNavigationMenu } from './navigation/menu';\nexport {\n\tNavigatorProvider as __experimentalNavigatorProvider,\n\tNavigatorScreen as __experimentalNavigatorScreen,\n\tNavigatorButton as __experimentalNavigatorButton,\n\tNavigatorBackButton as __experimentalNavigatorBackButton,\n\tuseNavigator as __experimentalUseNavigator,\n} from './navigator';\nexport { default as Notice } from './notice';\nexport { default as __experimentalNumberControl } from './number-control';\nexport { default as NoticeList } from './notice/list';\nexport { default as Panel } from './panel';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelHeader } from './panel/header';\nexport { default as PanelRow } from './panel/row';\nexport { default as Placeholder } from './placeholder';\nexport { default as Popover } from './popover';\nexport { positionToPlacement as __experimentalPopoverPositionToPlacement } from './popover/utils';\nexport { default as QueryControls } from './query-controls';\nexport { default as __experimentalRadio } from './radio-group/radio';\nexport { default as __experimentalRadioGroup } from './radio-group';\nexport { default as RadioControl } from './radio-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as ResponsiveWrapper } from './responsive-wrapper';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as Snackbar } from './snackbar';\nexport { default as SnackbarList } from './snackbar/list';\nexport { Spacer as __experimentalSpacer } from './spacer';\nexport { Scrollable as __experimentalScrollable } from './scrollable';\nexport { default as Spinner } from './spinner';\nexport { Surface as __experimentalSurface } from './surface';\nexport { default as TabPanel } from './tab-panel';\nexport { Text as __experimentalText } from './text';\nexport { default as TextControl } from './text-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as TextHighlight } from './text-highlight';\nexport { default as __experimentalTheme } from './theme';\nexport { default as Tip } from './tip';\nexport { default as ToggleControl } from './toggle-control';\nexport {\n\tToggleGroupControl as __experimentalToggleGroupControl,\n\tToggleGroupControlOption as __experimentalToggleGroupControlOption,\n\tToggleGroupControlOptionIcon as __experimentalToggleGroupControlOptionIcon,\n} from './toggle-group-control';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport {\n\tToolsPanel as __experimentalToolsPanel,\n\tToolsPanelItem as __experimentalToolsPanelItem,\n\tToolsPanelContext as __experimentalToolsPanelContext,\n} from './tools-panel';\nexport { default as Tooltip } from './tooltip';\nexport {\n\tdefault as __experimentalTreeGrid,\n\tTreeGridRow as __experimentalTreeGridRow,\n\tTreeGridCell as __experimentalTreeGridCell,\n\tTreeGridItem as __experimentalTreeGridItem,\n} from './tree-grid';\nexport { default as TreeSelect } from './tree-select';\nexport { Truncate as __experimentalTruncate } from './truncate';\nexport {\n\tdefault as __experimentalUnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n\tparseQuantityAndUnitFromRawValue as __experimentalParseQuantityAndUnitFromRawValue,\n} from './unit-control';\nexport { View as __experimentalView } from './view';\nexport { VisuallyHidden } from './visually-hidden';\nexport { VStack as __experimentalVStack } from './v-stack';\nexport { default as IsolatedEventContainer } from './isolated-event-container';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n\tuseSlot as __experimentalUseSlot,\n\tuseSlotFills as __experimentalUseSlotFills,\n} from './slot-fill';\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { ZStack as __experimentalZStack } from './z-stack';\n\n// Higher-Order Components.\nexport {\n\tdefault as navigateRegions,\n\tuseNavigateRegions as __unstableUseNavigateRegions,\n} from './higher-order/navigate-regions';\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport {\n\tdefault as withFocusReturn,\n\tProvider as FocusReturnProvider,\n} from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAaA;;AACA;;AAIA;;AACA;;AACA;;AAIA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA","sourcesContent":["// Primitives.\nexport {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tLine,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\n\n// Components.\nexport { default as __experimentalAlignmentMatrixControl } from './alignment-matrix-control';\nexport {\n\tdefault as Animate,\n\tgetAnimateClassName as __unstableGetAnimateClassName,\n} from './animate';\nexport { __unstableMotion, __unstableAnimatePresence } from './animation';\nexport { default as AnglePickerControl } from './angle-picker-control';\nexport {\n\tdefault as Autocomplete,\n\tuseAutocompleteProps as __unstableUseAutocompleteProps,\n} from './autocomplete';\nexport { default as BaseControl, useBaseControlProps } from './base-control';\nexport {\n\tBorderBoxControl as __experimentalBorderBoxControl,\n\thasSplitBorders as __experimentalHasSplitBorders,\n\tisDefinedBorder as __experimentalIsDefinedBorder,\n\tisEmptyBorder as __experimentalIsEmptyBorder,\n} from './border-box-control';\nexport { BorderControl as __experimentalBorderControl } from './border-control';\nexport {\n\tdefault as __experimentalBoxControl,\n\tapplyValueToSides as __experimentalApplyValueToSides,\n} from './box-control';\nexport { default as Button } from './button';\nexport { default as ButtonGroup } from './button-group';\nexport {\n\tCard,\n\tCardBody,\n\tCardDivider,\n\tCardFooter,\n\tCardHeader,\n\tCardMedia,\n} from './card';\nexport { default as CheckboxControl } from './checkbox-control';\nexport { default as ClipboardButton } from './clipboard-button';\nexport { default as __experimentalPaletteEdit } from './palette-edit';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as ComboboxControl } from './combobox-control';\nexport {\n\tComposite as __unstableComposite,\n\tCompositeGroup as __unstableCompositeGroup,\n\tCompositeItem as __unstableCompositeItem,\n\tuseCompositeState as __unstableUseCompositeState,\n} from './composite';\nexport { ConfirmDialog as __experimentalConfirmDialog } from './confirm-dialog';\nexport { default as CustomSelectControl } from './custom-select-control';\nexport { default as Dashicon } from './dashicon';\nexport { default as DateTimePicker, DatePicker, TimePicker } from './date-time';\nexport { default as __experimentalDimensionControl } from './dimension-control';\nexport { default as Disabled } from './disabled';\nexport { DisclosureContent as __unstableDisclosureContent } from './disclosure';\nexport { Divider as __experimentalDivider } from './divider';\nexport { default as Draggable } from './draggable';\nexport { default as DropZone } from './drop-zone';\nexport { default as DropZoneProvider } from './drop-zone/provider';\nexport { default as Dropdown } from './dropdown';\nexport { default as __experimentalDropdownContentWrapper } from './dropdown/dropdown-content-wrapper';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { DuotoneSwatch, DuotonePicker } from './duotone-picker';\nexport { Elevation as __experimentalElevation } from './elevation';\nexport { default as ExternalLink } from './external-link';\nexport { Flex, FlexBlock, FlexItem } from './flex';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport { default as FocusableIframe } from './focusable-iframe';\nexport { default as FontSizePicker } from './font-size-picker';\nexport { default as FormFileUpload } from './form-file-upload';\nexport { default as FormToggle } from './form-toggle';\nexport { default as FormTokenField } from './form-token-field';\nexport { default as GradientPicker } from './gradient-picker';\nexport { default as CustomGradientPicker } from './custom-gradient-picker';\nexport { Grid as __experimentalGrid } from './grid';\nexport { default as Guide } from './guide';\nexport { default as GuidePage } from './guide/page';\nexport { Heading as __experimentalHeading } from './heading';\nexport { HStack as __experimentalHStack } from './h-stack';\nexport { default as Icon } from './icon';\nexport { default as IconButton } from './button/deprecated';\nexport {\n\tItemGroup as __experimentalItemGroup,\n\tItem as __experimentalItem,\n} from './item-group';\nexport { default as __experimentalInputControl } from './input-control';\nexport { default as __experimentalInputControlPrefixWrapper } from './input-control/input-prefix-wrapper';\nexport { default as __experimentalInputControlSuffixWrapper } from './input-control/input-suffix-wrapper';\nexport { default as KeyboardShortcuts } from './keyboard-shortcuts';\nexport { default as MenuGroup } from './menu-group';\nexport { default as MenuItem } from './menu-item';\nexport { default as MenuItemsChoice } from './menu-items-choice';\nexport { default as Modal } from './modal';\nexport { default as ScrollLock } from './scroll-lock';\nexport { NavigableMenu, TabbableContainer } from './navigable-container';\nexport { default as __experimentalNavigation } from './navigation';\nexport { default as __experimentalNavigationBackButton } from './navigation/back-button';\nexport { default as __experimentalNavigationGroup } from './navigation/group';\nexport { default as __experimentalNavigationItem } from './navigation/item';\nexport { default as __experimentalNavigationMenu } from './navigation/menu';\nexport {\n\tNavigatorProvider as __experimentalNavigatorProvider,\n\tNavigatorScreen as __experimentalNavigatorScreen,\n\tNavigatorButton as __experimentalNavigatorButton,\n\tNavigatorBackButton as __experimentalNavigatorBackButton,\n\tuseNavigator as __experimentalUseNavigator,\n} from './navigator';\nexport { default as Notice } from './notice';\nexport { default as __experimentalNumberControl } from './number-control';\nexport { default as NoticeList } from './notice/list';\nexport { default as Panel } from './panel';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelHeader } from './panel/header';\nexport { default as PanelRow } from './panel/row';\nexport { default as Placeholder } from './placeholder';\nexport { default as Popover } from './popover';\nexport { positionToPlacement as __experimentalPopoverPositionToPlacement } from './popover/utils';\nexport { default as QueryControls } from './query-controls';\nexport { default as __experimentalRadio } from './radio-group/radio';\nexport { default as __experimentalRadioGroup } from './radio-group';\nexport { default as RadioControl } from './radio-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as ResponsiveWrapper } from './responsive-wrapper';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as Snackbar } from './snackbar';\nexport { default as SnackbarList } from './snackbar/list';\nexport { Spacer as __experimentalSpacer } from './spacer';\nexport { Scrollable as __experimentalScrollable } from './scrollable';\nexport { default as Spinner } from './spinner';\nexport { Surface as __experimentalSurface } from './surface';\nexport { default as TabPanel } from './tab-panel';\nexport { Text as __experimentalText } from './text';\nexport { default as TextControl } from './text-control';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as TextHighlight } from './text-highlight';\nexport { default as Tip } from './tip';\nexport { default as ToggleControl } from './toggle-control';\nexport {\n\tToggleGroupControl as __experimentalToggleGroupControl,\n\tToggleGroupControlOption as __experimentalToggleGroupControlOption,\n\tToggleGroupControlOptionIcon as __experimentalToggleGroupControlOptionIcon,\n} from './toggle-group-control';\nexport { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as __experimentalToolbarContext } from './toolbar-context';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\nexport {\n\tToolsPanel as __experimentalToolsPanel,\n\tToolsPanelItem as __experimentalToolsPanelItem,\n\tToolsPanelContext as __experimentalToolsPanelContext,\n} from './tools-panel';\nexport { default as Tooltip } from './tooltip';\nexport {\n\tdefault as __experimentalTreeGrid,\n\tTreeGridRow as __experimentalTreeGridRow,\n\tTreeGridCell as __experimentalTreeGridCell,\n\tTreeGridItem as __experimentalTreeGridItem,\n} from './tree-grid';\nexport { default as TreeSelect } from './tree-select';\nexport { Truncate as __experimentalTruncate } from './truncate';\nexport {\n\tdefault as __experimentalUnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n\tparseQuantityAndUnitFromRawValue as __experimentalParseQuantityAndUnitFromRawValue,\n} from './unit-control';\nexport { View as __experimentalView } from './view';\nexport { VisuallyHidden } from './visually-hidden';\nexport { VStack as __experimentalVStack } from './v-stack';\nexport { default as IsolatedEventContainer } from './isolated-event-container';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n\tuseSlot as __experimentalUseSlot,\n\tuseSlotFills as __experimentalUseSlotFills,\n} from './slot-fill';\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { ZStack as __experimentalZStack } from './z-stack';\n\n// Higher-Order Components.\nexport {\n\tdefault as navigateRegions,\n\tuseNavigateRegions as __unstableUseNavigateRegions,\n} from './higher-order/navigate-regions';\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport {\n\tdefault as withFocusReturn,\n\tProvider as FocusReturnProvider,\n} from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\n"]}
@@ -25,6 +25,8 @@ var _space = require("../ui/utils/space");
25
25
 
26
26
  var _utils = require("./utils");
27
27
 
28
+ var _baseControl = _interopRequireDefault(require("../base-control"));
29
+
28
30
  /**
29
31
  * External dependencies
30
32
  */
@@ -51,6 +53,7 @@ function UnforwardedInputControl(_ref, ref) {
51
53
  __unstableInputWidth,
52
54
  className,
53
55
  disabled = false,
56
+ help,
54
57
  hideLabelFromVision = false,
55
58
  id: idProp,
56
59
  isPressEnterToChange = false,
@@ -73,11 +76,20 @@ function UnforwardedInputControl(_ref, ref) {
73
76
  value,
74
77
  onBlur: props.onBlur,
75
78
  onChange
76
- });
77
- return (0, _element.createElement)(_inputBase.default, {
79
+ }); // ARIA descriptions can only contain plain text, so fall back to aria-details if not.
80
+
81
+ const helpPropName = typeof help === 'string' ? 'aria-describedby' : 'aria-details';
82
+ const helpProp = !!help ? {
83
+ [helpPropName]: `${id}__help`
84
+ } : {};
85
+ return (0, _element.createElement)(_baseControl.default, {
86
+ className: classes,
87
+ help: help,
88
+ id: id,
89
+ __nextHasNoMarginBottom: true
90
+ }, (0, _element.createElement)(_inputBase.default, {
78
91
  __next36pxDefaultSize: __next36pxDefaultSize,
79
92
  __unstableInputWidth: __unstableInputWidth,
80
- className: classes,
81
93
  disabled: disabled,
82
94
  gap: 3,
83
95
  hideLabelFromVision: hideLabelFromVision,
@@ -90,7 +102,7 @@ function UnforwardedInputControl(_ref, ref) {
90
102
  size: size,
91
103
  style: style,
92
104
  suffix: suffix
93
- }, (0, _element.createElement)(_inputField.default, (0, _extends2.default)({}, props, {
105
+ }, (0, _element.createElement)(_inputField.default, (0, _extends2.default)({}, props, helpProp, {
94
106
  __next36pxDefaultSize: __next36pxDefaultSize,
95
107
  className: "components-input-control__input",
96
108
  disabled: disabled,
@@ -105,7 +117,7 @@ function UnforwardedInputControl(_ref, ref) {
105
117
  setIsFocused: setIsFocused,
106
118
  size: size,
107
119
  stateReducer: stateReducer
108
- }, draftHookProps)));
120
+ }, draftHookProps))));
109
121
  }
110
122
  /**
111
123
  * InputControl components let users enter and edit text. This is an experimental component
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","ref","__next36pxDefaultSize","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","style","suffix","value","props","isFocused","setIsFocused","classes","draftHookProps","onBlur","undefined"],"mappings":";;;;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAMA;;AACA;;AAEA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAOA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,YAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,2BAA2BF,UAAY,EAAnD;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA;;AAEM,SAASC,uBAAT,OAsBNC,GAtBM,EAuBL;AAAA,MAtBD;AACCC,IAAAA,qBADD;AAECC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KAFrD;AAGCC,IAAAA,oBAHD;AAICC,IAAAA,SAJD;AAKCC,IAAAA,QAAQ,GAAG,KALZ;AAMCC,IAAAA,mBAAmB,GAAG,KANvB;AAOCV,IAAAA,EAAE,EAAEH,MAPL;AAQCc,IAAAA,oBAAoB,GAAG,KARxB;AASCC,IAAAA,KATD;AAUCC,IAAAA,aAAa,GAAG,KAVjB;AAWCC,IAAAA,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GT,EALN;AAMC,IAAA,SAAS,EAAGuB,SANb;AAOC,IAAA,oBAAoB,EAAGZ,oBAPxB;AAQC,IAAA,SAAS,EAAGK,SARb;AASC,IAAA,UAAU,EAAGD,UATd;AAUC,IAAA,kBAAkB,EAAGE,MAAM,GAAG,kBAAO,CAAP,CAAH,GAAgBW,SAV5C;AAWC,IAAA,gBAAgB,EAAGR,MAAM,GAAG,kBAAO,CAAP,CAAH,GAAgBQ,SAX1C;AAYC,IAAA,GAAG,EAAG1B,GAZP;AAaC,IAAA,YAAY,EAAGsB,YAbhB;AAcC,IAAA,IAAI,EAAGN,IAdR;AAeC,IAAA,YAAY,EAAGb;AAfhB,KAgBMqB,cAhBN,EAjBD,CADD;AAsCA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAM3B,YAAY,GAAG,yBAAYE,uBAAZ,CAArB;;eAEQF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\nimport { space } from '../ui/utils/space';\nimport { useDraft } from './utils';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function UnforwardedInputControl(\n\t{\n\t\t__next36pxDefaultSize,\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tsuffix,\n\t\tvalue,\n\t\t...props\n\t}: InputControlProps,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = classNames( 'components-input-control', className );\n\n\tconst draftHookProps = useDraft( {\n\t\tvalue,\n\t\tonBlur: props.onBlur,\n\t\tonChange,\n\t} );\n\n\treturn (\n\t\t<InputBase\n\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tgap={ 3 }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\tisFocused={ isFocused }\n\t\t\tjustify=\"left\"\n\t\t\tlabel={ label }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tprefix={ prefix }\n\t\t\tsize={ size }\n\t\t\tstyle={ style }\n\t\t\tsuffix={ suffix }\n\t\t>\n\t\t\t<InputField\n\t\t\t\t{ ...props }\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonValidate={ onValidate }\n\t\t\t\tpaddingInlineStart={ prefix ? space( 2 ) : undefined }\n\t\t\t\tpaddingInlineEnd={ suffix ? space( 2 ) : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\tsetIsFocused={ setIsFocused }\n\t\t\t\tsize={ size }\n\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\t{ ...draftHookProps }\n\t\t\t/>\n\t\t</InputBase>\n\t);\n}\n\n/**\n * InputControl components let users enter and edit text. This is an experimental component\n * intended to (in time) merge with or replace `TextControl`.\n *\n * ```jsx\n * import { __experimentalInputControl as InputControl } from '@wordpress/components';\n * import { useState } from '@wordpress/compose';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '' );\n *\n * return (\n * \t<InputControl\n * \t\tvalue={ value }\n * \t\tonChange={ ( nextValue ) => setValue( nextValue ?? '' ) }\n * \t/>\n * );\n * };\n * ```\n */\nexport const InputControl = forwardRef( UnforwardedInputControl );\n\nexport default InputControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","ref","__next36pxDefaultSize","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","help","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","style","suffix","value","props","isFocused","setIsFocused","classes","draftHookProps","onBlur","helpPropName","helpProp","undefined"],"mappings":";;;;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAMA;;AACA;;AAEA;;AACA;;AACA;;AApBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAQA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,YAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,2BAA2BF,UAAY,EAAnD;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA;;AAEM,SAASC,uBAAT,OAuBNC,GAvBM,EAwBL;AAAA,MAvBD;AACCC,IAAAA,qBADD;AAECC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KAFrD;AAGCC,IAAAA,oBAHD;AAICC,IAAAA,SAJD;AAKCC,IAAAA,QAAQ,GAAG,KALZ;AAMCC,IAAAA,IAND;AAOCC,IAAAA,mBAAmB,GAAG,KAPvB;AAQCX,IAAAA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AAGE,mBALvB;AAMC,IAAA,EAAE,EAAGX,EANN;AAOC,IAAA,SAAS,EAAGwB,SAPb;AAQC,IAAA,OAAO,EAAC,MART;AASC,IAAA,KAAK,EAAGX,KATT;AAUC,IAAA,aAAa,EAAGC,aAVjB;AAWC,IAAA,MAAM,EAAGI,MAXV;AAYC,IAAA,IAAI,EAAGC,IAZR;AAaC,IAAA,KAAK,EAAGC,KAbT;AAcC,IAAA,MAAM,EAAGC;AAdV,KAgBC,4BAAC,mBAAD,6BACME,KADN,EAEMO,QAFN;AAGC,IAAA,qBAAqB,EAAG3B,qBAHzB;AAIC,IAAA,SAAS,EAAC,iCAJX;AAKC,IAAA,QAAQ,EAAGM,QALZ;AAMC,IAAA,EAAE,EAAGT,EANN;AAOC,IAAA,SAAS,EAAGwB,SAPb;AAQC,IAAA,oBAAoB,EAAGZ,oBARxB;AASC,IAAA,SAAS,EAAGK,SATb;AAUC,IAAA,UAAU,EAAGD,UAVd;AAWC,IAAA,kBAAkB,EAAGE,MAAM,GAAG,kBAAO,CAAP,CAAH,GAAgBa,SAX5C;AAYC,IAAA,gBAAgB,EAAGV,MAAM,GAAG,kBAAO,CAAP,CAAH,GAAgBU,SAZ1C;AAaC,IAAA,GAAG,EAAG7B,GAbP;AAcC,IAAA,YAAY,EAAGuB,YAdhB;AAeC,IAAA,IAAI,EAAGN,IAfR;AAgBC,IAAA,YAAY,EAAGd;AAhBhB,KAiBMsB,cAjBN,EAhBD,CAND,CADD;AA6CA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAM5B,YAAY,GAAG,yBAAYE,uBAAZ,CAArB;;eAEQF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\nimport { space } from '../ui/utils/space';\nimport { useDraft } from './utils';\nimport BaseControl from '../base-control';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function UnforwardedInputControl(\n\t{\n\t\t__next36pxDefaultSize,\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tsuffix,\n\t\tvalue,\n\t\t...props\n\t}: InputControlProps,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = classNames( 'components-input-control', className );\n\n\tconst draftHookProps = useDraft( {\n\t\tvalue,\n\t\tonBlur: props.onBlur,\n\t\tonChange,\n\t} );\n\n\t// ARIA descriptions can only contain plain text, so fall back to aria-details if not.\n\tconst helpPropName =\n\t\ttypeof help === 'string' ? 'aria-describedby' : 'aria-details';\n\tconst helpProp = !! help ? { [ helpPropName ]: `${ id }__help` } : {};\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName={ classes }\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom\n\t\t>\n\t\t\t<InputBase\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tgap={ 3 }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tjustify=\"left\"\n\t\t\t\tlabel={ label }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\tprefix={ prefix }\n\t\t\t\tsize={ size }\n\t\t\t\tstyle={ style }\n\t\t\t\tsuffix={ suffix }\n\t\t\t>\n\t\t\t\t<InputField\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t{ ...helpProp }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tonValidate={ onValidate }\n\t\t\t\t\tpaddingInlineStart={ prefix ? space( 2 ) : undefined }\n\t\t\t\t\tpaddingInlineEnd={ suffix ? space( 2 ) : undefined }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tsetIsFocused={ setIsFocused }\n\t\t\t\t\tsize={ size }\n\t\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\t\t{ ...draftHookProps }\n\t\t\t\t/>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * InputControl components let users enter and edit text. This is an experimental component\n * intended to (in time) merge with or replace `TextControl`.\n *\n * ```jsx\n * import { __experimentalInputControl as InputControl } from '@wordpress/components';\n * import { useState } from '@wordpress/compose';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '' );\n *\n * return (\n * \t<InputControl\n * \t\tvalue={ value }\n * \t\tonChange={ ( nextValue ) => setValue( nextValue ?? '' ) }\n * \t/>\n * );\n * };\n * ```\n */\nexport const InputControl = forwardRef( UnforwardedInputControl );\n\nexport default InputControl;\n"]}
@@ -46,11 +46,13 @@ function getUIFlexProps(labelPosition) {
46
46
  switch (labelPosition) {
47
47
  case 'top':
48
48
  props.direction = 'column';
49
+ props.expanded = false;
49
50
  props.gap = 0;
50
51
  break;
51
52
 
52
53
  case 'bottom':
53
54
  props.direction = 'column-reverse';
55
+ props.expanded = false;
54
56
  props.gap = 0;
55
57
  break;
56
58
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/input-base.tsx"],"names":["useUniqueId","idProp","instanceId","InputBase","id","getUIFlexProps","labelPosition","props","direction","gap","justify","ref","__next36pxDefaultSize","__unstableInputWidth","children","className","disabled","hideLabelFromVision","isFocused","label","prefix","size","suffix","hideLabel","paddingLeft","paddingRight","inputSize","prefixSuffixContextValue","InputControlPrefixWrapper","InputControlSuffixWrapper"],"mappings":";;;;;;;;;;AASA;;;;AADA;;AAMA;;AACA;;AACA;;AAQA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAaA,SAASA,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,SAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,sBAAsBF,UAAY,EAA9C;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA,C,CAED;;;AACA,SAASC,cAAT,CAAyBC,aAAzB,EAAyD;AACxD,QAAMC,KAA6D,GAAG,EAAtE;;AACA,UAASD,aAAT;AACC,SAAK,KAAL;AACCC,MAAAA,KAAK,CAACC,SAAN,GAAkB,QAAlB;AACAD,MAAAA,KAAK,CAACE,GAAN,GAAY,CAAZ;AACA;;AACD,SAAK,QAAL;AACCF,MAAAA,KAAK,CAACC,SAAN,GAAkB,gBAAlB;AACAD,MAAAA,KAAK,CAACE,GAAN,GAAY,CAAZ;AACA;;AACD,SAAK,MAAL;AACCF,MAAAA,KAAK,CAACG,OAAN,GAAgB,eAAhB;AACA;AAXF;;AAcA,SAAOH,KAAP;AACA;;AAEM,SAASJ,SAAT,OAiBNQ,GAjBM,EAkBL;AAAA,MAjBD;AACCC,IAAAA,qBADD;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,MAAA,oBAAoB,EAAGN,oBADxB;AAEC,MAAA,SAAS,EAAC,qCAFX;AAGC,MAAA,QAAQ,EAAGG,QAHZ;AAIC,MAAA,SAAS,EAAGO,SAJb;AAKC,MAAA,aAAa,EAAGjB;AALjB,OAOC,4BAAC,8BAAD;AAAuB,MAAA,KAAK,EAAGqB;AAA/B,OACGP,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CAFF,EAMGN,QANH,EAOGQ,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CARF,CAPD,EAoBC,4BAAC,iBAAD;AAAU,MAAA,QAAQ,EAAGN,QAArB;AAAgC,MAAA,SAAS,EAAGE;AAA5C,MApBD,CAjBD;AAFD;AA2CA;;eAEc,yBAAYf,SAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Backdrop from './backdrop';\nimport Label from './label';\nimport {\n\tContainer,\n\tRoot,\n\tPrefix,\n\tSuffix,\n\tgetSizeConfig,\n} from './styles/input-control-styles';\nimport type { InputBaseProps, LabelPosition } from './types';\nimport { ContextSystemProvider, WordPressComponentProps } from '../ui/context';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputBase );\n\tconst id = `input-base-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\n// Adapter to map props for the new ui/flex component.\nfunction getUIFlexProps( labelPosition?: LabelPosition ) {\n\tconst props: { direction?: string; gap?: number; justify?: string } = {};\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\tprops.direction = 'column';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'bottom':\n\t\t\tprops.direction = 'column-reverse';\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'edge':\n\t\t\tprops.justify = 'space-between';\n\t\t\tbreak;\n\t}\n\n\treturn props;\n}\n\nexport function InputBase(\n\t{\n\t\t__next36pxDefaultSize,\n\t\t__unstableInputWidth,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tlabelPosition,\n\t\tid: idProp,\n\t\tisFocused = false,\n\t\tlabel,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\t...props\n\t}: WordPressComponentProps< InputBaseProps, 'div' >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst id = useUniqueId( idProp );\n\tconst hideLabel = hideLabelFromVision || ! label;\n\n\tconst { paddingLeft, paddingRight } = getSizeConfig( {\n\t\tinputSize: size,\n\t\t__next36pxDefaultSize,\n\t} );\n\tconst prefixSuffixContextValue = useMemo( () => {\n\t\treturn {\n\t\t\tInputControlPrefixWrapper: { paddingLeft },\n\t\t\tInputControlSuffixWrapper: { paddingRight },\n\t\t};\n\t}, [ paddingLeft, paddingRight ] );\n\n\treturn (\n\t\t// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\t{ ...getUIFlexProps( labelPosition ) }\n\t\t\tclassName={ className }\n\t\t\tgap={ 2 }\n\t\t\tisFocused={ isFocused }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<Label\n\t\t\t\tclassName=\"components-input-control__label\"\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</Label>\n\t\t\t<Container\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tclassName=\"components-input-control__container\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabel={ hideLabel }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t>\n\t\t\t\t<ContextSystemProvider value={ prefixSuffixContextValue }>\n\t\t\t\t\t{ prefix && (\n\t\t\t\t\t\t<Prefix className=\"components-input-control__prefix\">\n\t\t\t\t\t\t\t{ prefix }\n\t\t\t\t\t\t</Prefix>\n\t\t\t\t\t) }\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ suffix && (\n\t\t\t\t\t\t<Suffix className=\"components-input-control__suffix\">\n\t\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t</Suffix>\n\t\t\t\t\t) }\n\t\t\t\t</ContextSystemProvider>\n\t\t\t\t<Backdrop disabled={ disabled } isFocused={ isFocused } />\n\t\t\t</Container>\n\t\t</Root>\n\t);\n}\n\nexport default forwardRef( InputBase );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/input-base.tsx"],"names":["useUniqueId","idProp","instanceId","InputBase","id","getUIFlexProps","labelPosition","props","direction","expanded","gap","justify","ref","__next36pxDefaultSize","__unstableInputWidth","children","className","disabled","hideLabelFromVision","isFocused","label","prefix","size","suffix","hideLabel","paddingLeft","paddingRight","inputSize","prefixSuffixContextValue","InputControlPrefixWrapper","InputControlSuffixWrapper"],"mappings":";;;;;;;;;;AASA;;;;AADA;;AAMA;;AACA;;AACA;;AAQA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAaA,SAASA,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,SAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,sBAAsBF,UAAY,EAA9C;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA,C,CAED;;;AACA,SAASC,cAAT,CAAyBC,aAAzB,EAAyD;AACxD,QAAMC,KAKL,GAAG,EALJ;;AAMA,UAASD,aAAT;AACC,SAAK,KAAL;AACCC,MAAAA,KAAK,CAACC,SAAN,GAAkB,QAAlB;AACAD,MAAAA,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;AAOA,SACC;AACA,gCAAC,wBAAD,6BACMnB,KADN,EAEMF,cAAc,CAAEC,aAAF,CAFpB;AAGC,MAAA,SAAS,EAAGU,SAHb;AAIC,MAAA,GAAG,EAAG,CAJP;AAKC,MAAA,SAAS,EAAGG,SALb;AAMC,MAAA,aAAa,EAAGb,aANjB;AAOC,MAAA,GAAG,EAAGM;AAPP,QASC,4BAAC,cAAD;AACC,MAAA,SAAS,EAAC,iCADX;AAEC,MAAA,mBAAmB,EAAGM,mBAFvB;AAGC,MAAA,aAAa,EAAGZ,aAHjB;AAIC,MAAA,OAAO,EAAGF;AAJX,OAMGgB,KANH,CATD,EAiBC,4BAAC,6BAAD;AACC,MAAA,oBAAoB,EAAGN,oBADxB;AAEC,MAAA,SAAS,EAAC,qCAFX;AAGC,MAAA,QAAQ,EAAGG,QAHZ;AAIC,MAAA,SAAS,EAAGO,SAJb;AAKC,MAAA,aAAa,EAAGlB;AALjB,OAOC,4BAAC,8BAAD;AAAuB,MAAA,KAAK,EAAGsB;AAA/B,OACGP,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CAFF,EAMGN,QANH,EAOGQ,MAAM,IACP,4BAAC,0BAAD;AAAQ,MAAA,SAAS,EAAC;AAAlB,OACGA,MADH,CARF,CAPD,EAoBC,4BAAC,iBAAD;AAAU,MAAA,QAAQ,EAAGN,QAArB;AAAgC,MAAA,SAAS,EAAGE;AAA5C,MApBD,CAjBD;AAFD;AA2CA;;eAEc,yBAAYhB,SAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Backdrop from './backdrop';\nimport Label from './label';\nimport {\n\tContainer,\n\tRoot,\n\tPrefix,\n\tSuffix,\n\tgetSizeConfig,\n} from './styles/input-control-styles';\nimport type { InputBaseProps, LabelPosition } from './types';\nimport { ContextSystemProvider, WordPressComponentProps } from '../ui/context';\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputBase );\n\tconst id = `input-base-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\n// Adapter to map props for the new ui/flex component.\nfunction getUIFlexProps( labelPosition?: LabelPosition ) {\n\tconst props: {\n\t\tdirection?: string;\n\t\tgap?: number;\n\t\tjustify?: string;\n\t\texpanded?: boolean;\n\t} = {};\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\tprops.direction = 'column';\n\t\t\tprops.expanded = false;\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'bottom':\n\t\t\tprops.direction = 'column-reverse';\n\t\t\tprops.expanded = false;\n\t\t\tprops.gap = 0;\n\t\t\tbreak;\n\t\tcase 'edge':\n\t\t\tprops.justify = 'space-between';\n\t\t\tbreak;\n\t}\n\n\treturn props;\n}\n\nexport function InputBase(\n\t{\n\t\t__next36pxDefaultSize,\n\t\t__unstableInputWidth,\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thideLabelFromVision = false,\n\t\tlabelPosition,\n\t\tid: idProp,\n\t\tisFocused = false,\n\t\tlabel,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\t...props\n\t}: WordPressComponentProps< InputBaseProps, 'div' >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst id = useUniqueId( idProp );\n\tconst hideLabel = hideLabelFromVision || ! label;\n\n\tconst { paddingLeft, paddingRight } = getSizeConfig( {\n\t\tinputSize: size,\n\t\t__next36pxDefaultSize,\n\t} );\n\tconst prefixSuffixContextValue = useMemo( () => {\n\t\treturn {\n\t\t\tInputControlPrefixWrapper: { paddingLeft },\n\t\t\tInputControlSuffixWrapper: { paddingRight },\n\t\t};\n\t}, [ paddingLeft, paddingRight ] );\n\n\treturn (\n\t\t// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\t{ ...getUIFlexProps( labelPosition ) }\n\t\t\tclassName={ className }\n\t\t\tgap={ 2 }\n\t\t\tisFocused={ isFocused }\n\t\t\tlabelPosition={ labelPosition }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<Label\n\t\t\t\tclassName=\"components-input-control__label\"\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</Label>\n\t\t\t<Container\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tclassName=\"components-input-control__container\"\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabel={ hideLabel }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t>\n\t\t\t\t<ContextSystemProvider value={ prefixSuffixContextValue }>\n\t\t\t\t\t{ prefix && (\n\t\t\t\t\t\t<Prefix className=\"components-input-control__prefix\">\n\t\t\t\t\t\t\t{ prefix }\n\t\t\t\t\t\t</Prefix>\n\t\t\t\t\t) }\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ suffix && (\n\t\t\t\t\t\t<Suffix className=\"components-input-control__suffix\">\n\t\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t</Suffix>\n\t\t\t\t\t) }\n\t\t\t\t</ContextSystemProvider>\n\t\t\t\t<Backdrop disabled={ disabled } isFocused={ isFocused } />\n\t\t\t</Container>\n\t\t</Root>\n\t);\n}\n\nexport default forwardRef( InputBase );\n"]}
@@ -64,7 +64,7 @@ class BottomSheetCell extends _element.Component {
64
64
  this.a11yInfoChangeSubscription = _reactNative.AccessibilityInfo.addEventListener('screenReaderChanged', this.handleScreenReaderToggled);
65
65
 
66
66
  _reactNative.AccessibilityInfo.isScreenReaderEnabled().then(isScreenReaderEnabled => {
67
- if (this.isCurrent) {
67
+ if (this.isCurrent && isScreenReaderEnabled) {
68
68
  this.setState({
69
69
  isScreenReaderEnabled
70
70
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["isIOS","Platform","OS","BottomSheetCell","Component","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","AccessibilityInfo","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","styles","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","platformStyles","separatorMarginLeft","getValueComponent","styleRTL","I18nManager","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","check","placeholderColor"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AASA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HH,CAzCF,CADD,EAiDGmB,kBAAkB,IACnB,4BAAC,6BAAD;AACC,MAAA,OAAO,EAAG6D,OADX;AAEC,MAAA,iBAAiB,EAAG;AAFrB,OAIC,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGR;AAAd,OACGO,KADH,CAJD,CAlDF,CAJD,EAgEGhE,UAAU,IACX,4BAAC,gBAAD;AACC,MAAA,IAAI,EAAGuE,YADR;AAEC,MAAA,IAAI,EAAG7B,oBAAe1C,UAAf,CAA0BqE;AAFlC,MAjEF,EAsEG7D,SAAS,IAAIoC,iBAAiB,EAtEjC,EAuEG9C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAG,CAAEsD,aAAF,EAAiBhD,gBAAO4D,gBAAxB;AAAd,OACGlE,IADH,CAhGF,EAoGG,CAAEoB,gBAAF,IAAsB,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAhZsC;;eAmZzB,uCAA0BhF,eAA1B,C","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 =\n\t\t\tthis.handleScreenReaderToggled.bind( this );\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"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["isIOS","Platform","OS","BottomSheetCell","Component","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","AccessibilityInfo","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","styles","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","platformStyles","separatorMarginLeft","getValueComponent","styleRTL","I18nManager","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","check","placeholderColor"],"mappings":";;;;;;;;;AAmBA;;;;AAhBA;;AASA;;AAKA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AA5BA;AACA;AACA;;AAYA;AACA;AACA;;AAOA;AACA;AACA;AAKA,MAAMA,KAAK,GAAGC,sBAASC,EAAT,KAAgB,KAA9B;;AACA,MAAMC,eAAN,SAA8BC,kBAA9B,CAAwC;AACvCC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,cAAc,EAAEH,KAAK,CAACI,SAAN,IAAmB,KADvB;AAEZC,MAAAA,qBAAqB,EAAE;AAFX,KAAb;AAKA,SAAKC,yBAAL,GACC,KAAKA,yBAAL,CAA+BC,IAA/B,CAAqC,IAArC,CADD;AAGA,SAAKC,SAAL,GAAiB,KAAjB;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAaC,SAAb,EAAyB;AAC1C,QAAK,CAAEA,SAAS,CAACR,cAAZ,IAA8B,KAAKD,KAAL,CAAWC,cAA9C,EAA+D;AAC9D,WAAKS,e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;;eAmZzB,uCAA0BhF,eAA1B,C","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 =\n\t\t\tthis.handleScreenReaderToggled.bind( this );\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 && isScreenReaderEnabled ) {\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"]}
@@ -11,16 +11,10 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _cell = _interopRequireDefault(require("./cell"));
17
15
 
18
16
  var _picker = _interopRequireDefault(require("../picker"));
19
17
 
20
- /**
21
- * External dependencies
22
- */
23
-
24
18
  /**
25
19
  * Internal dependencies
26
20
  */
@@ -42,9 +36,7 @@ function BottomSheetPickerCell(props) {
42
36
  onChangeValue(newValue);
43
37
  };
44
38
 
45
- const option = (0, _lodash.find)(options, {
46
- value
47
- });
39
+ const option = options.find(opt => opt.value === value);
48
40
  const label = option ? option.label : value;
49
41
  return (0, _element.createElement)(_cell.default, (0, _extends2.default)({
50
42
  onPress: onCellPress,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/picker-cell.native.js"],"names":["BottomSheetPickerCell","props","options","hideCancelButton","onChangeValue","value","cellProps","picker","onCellPress","presentPicker","onChange","newValue","option","label","instance"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,qBAAT,CAAgCC,KAAhC,EAAwC;AACtD,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,gBAAX;AAA6BC,IAAAA,aAA7B;AAA4CC,IAAAA,KAA5C;AAAmD,OAAGC;AAAtD,MACLL,KADD;AAGA,MAAIM,MAAJ;;AAEA,QAAMC,WAAW,GAAG,MAAM;AACzBD,IAAAA,MAAM,CAACE,aAAP;AACA,GAFD;;AAIA,QAAMC,QAAQ,GAAKC,QAAF,IAAgB;AAChCP,IAAAA,aAAa,CAAEO,QAAF,CAAb;AACA,GAFD;;AAIA,QAAMC,MAAM,GAAG,kBAAMV,OAAN,EAAe;AAAEG,IAAAA;AAAF,GAAf,CAAf;AACA,QAAMQ,KAAK,GAAGD,MAAM,GAAGA,MAAM,CAACC,KAAV,GAAkBR,KAAtC;AAEA,SACC,4BAAC,aAAD;AACC,IAAA,OAAO,EAAGG,WADX;AAEC,IAAA,QAAQ,EAAG,KAFZ;AAGC,IAAA,KAAK,EAAGK;AAHT,KAIMP,SAJN,GAMC,4BAAC,eAAD;AACC,IAAA,SAAS,MADV;AAEC,IAAA,gBAAgB,EAAGH,gBAFpB;AAGC,IAAA,GAAG,EAAKW,QAAF,IAAkBP,MAAM,GAAGO,QAHlC;AAIC,IAAA,OAAO,EAAGZ,OAJX;AAKC,IAAA,QAAQ,EAAGQ;AALZ,IAND,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport Picker from '../picker';\n\nexport default function BottomSheetPickerCell( props ) {\n\tconst { options, hideCancelButton, onChangeValue, value, ...cellProps } =\n\t\tprops;\n\n\tlet picker;\n\n\tconst onCellPress = () => {\n\t\tpicker.presentPicker();\n\t};\n\n\tconst onChange = ( newValue ) => {\n\t\tonChangeValue( newValue );\n\t};\n\n\tconst option = find( options, { value } );\n\tconst label = option ? option.label : value;\n\n\treturn (\n\t\t<Cell\n\t\t\tonPress={ onCellPress }\n\t\t\teditable={ false }\n\t\t\tvalue={ label }\n\t\t\t{ ...cellProps }\n\t\t>\n\t\t\t<Picker\n\t\t\t\tleftAlign\n\t\t\t\thideCancelButton={ hideCancelButton }\n\t\t\t\tref={ ( instance ) => ( picker = instance ) }\n\t\t\t\toptions={ options }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</Cell>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/picker-cell.native.js"],"names":["BottomSheetPickerCell","props","options","hideCancelButton","onChangeValue","value","cellProps","picker","onCellPress","presentPicker","onChange","newValue","option","find","opt","label","instance"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIe,SAASA,qBAAT,CAAgCC,KAAhC,EAAwC;AACtD,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,gBAAX;AAA6BC,IAAAA,aAA7B;AAA4CC,IAAAA,KAA5C;AAAmD,OAAGC;AAAtD,MACLL,KADD;AAGA,MAAIM,MAAJ;;AAEA,QAAMC,WAAW,GAAG,MAAM;AACzBD,IAAAA,MAAM,CAACE,aAAP;AACA,GAFD;;AAIA,QAAMC,QAAQ,GAAKC,QAAF,IAAgB;AAChCP,IAAAA,aAAa,CAAEO,QAAF,CAAb;AACA,GAFD;;AAIA,QAAMC,MAAM,GAAGV,OAAO,CAACW,IAAR,CAAgBC,GAAF,IAAWA,GAAG,CAACT,KAAJ,KAAcA,KAAvC,CAAf;AACA,QAAMU,KAAK,GAAGH,MAAM,GAAGA,MAAM,CAACG,KAAV,GAAkBV,KAAtC;AAEA,SACC,4BAAC,aAAD;AACC,IAAA,OAAO,EAAGG,WADX;AAEC,IAAA,QAAQ,EAAG,KAFZ;AAGC,IAAA,KAAK,EAAGO;AAHT,KAIMT,SAJN,GAMC,4BAAC,eAAD;AACC,IAAA,SAAS,MADV;AAEC,IAAA,gBAAgB,EAAGH,gBAFpB;AAGC,IAAA,GAAG,EAAKa,QAAF,IAAkBT,MAAM,GAAGS,QAHlC;AAIC,IAAA,OAAO,EAAGd,OAJX;AAKC,IAAA,QAAQ,EAAGQ;AALZ,IAND,CADD;AAgBA","sourcesContent":["/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport Picker from '../picker';\n\nexport default function BottomSheetPickerCell( props ) {\n\tconst { options, hideCancelButton, onChangeValue, value, ...cellProps } =\n\t\tprops;\n\n\tlet picker;\n\n\tconst onCellPress = () => {\n\t\tpicker.presentPicker();\n\t};\n\n\tconst onChange = ( newValue ) => {\n\t\tonChangeValue( newValue );\n\t};\n\n\tconst option = options.find( ( opt ) => opt.value === value );\n\tconst label = option ? option.label : value;\n\n\treturn (\n\t\t<Cell\n\t\t\tonPress={ onCellPress }\n\t\t\teditable={ false }\n\t\t\tvalue={ label }\n\t\t\t{ ...cellProps }\n\t\t>\n\t\t\t<Picker\n\t\t\t\tleftAlign\n\t\t\t\thideCancelButton={ hideCancelButton }\n\t\t\t\tref={ ( instance ) => ( picker = instance ) }\n\t\t\t\toptions={ options }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</Cell>\n\t);\n}\n"]}
@@ -13,8 +13,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
13
 
14
14
  var _reactNative = require("react-native");
15
15
 
16
- var _lodash = require("lodash");
17
-
18
16
  var _i18n = require("@wordpress/i18n");
19
17
 
20
18
  var _cell = _interopRequireDefault(require("./cell"));
@@ -42,7 +40,7 @@ function BottomSheetSwitchCell(props) {
42
40
  };
43
41
 
44
42
  const getAccessibilityLabel = () => {
45
- if ((0, _lodash.isEmpty)(cellProps.help)) {
43
+ if (!cellProps.help) {
46
44
  return value ? (0, _i18n.sprintf)(
47
45
  /* translators: accessibility text. Switch setting ON state. %s: Switch title. */
48
46
  (0, _i18n._x)('%s. On', 'switch control'), cellProps.label) : (0, _i18n.sprintf)(
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/switch-cell.native.js"],"names":["BottomSheetSwitchCell","props","value","onValueChange","cellProps","onPress","getAccessibilityLabel","help","label"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAIA;;AAIA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgCC,KAAhC,EAAwC;AACtD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,aAAT;AAAwB,OAAGC;AAA3B,MAAyCH,KAA/C;;AAEA,QAAMI,OAAO,GAAG,MAAM;AACrBF,IAAAA,aAAa,CAAE,CAAED,KAAJ,CAAb;AACA,GAFD;;AAIA,QAAMI,qBAAqB,GAAG,MAAM;AACnC,QAAK,qBAASF,SAAS,CAACG,IAAnB,CAAL,EAAiC;AAChC,aAAOL,KAAK,GACT;AACA;AACA,oBAAI,QAAJ,EAAc,gBAAd,CAFA,EAGAE,SAAS,CAACI,KAHV,CADS,GAMT;AACA;AACA,oBAAI,SAAJ,EAAe,gBAAf,CAFA,EAGAJ,SAAS,CAACI,KAHV,CANH;AAWA;;AACD,WAAON,KAAK,GACT;AACA;AACA,kBAAI,gBAAJ,EAAsB,gBAAtB,CAFA,EAGAE,SAAS,CAACI,KAHV,EAIAJ,SAAS,CAACG,IAJV,CADS,GAOT;AACA;AACA,kBAAI,iBAAJ,EAAuB,gBAAvB,CAFA,EAGAH,SAAS,CAACI,KAHV,EAIAJ,SAAS,CAACG,IAJV,CAPH;AAaA,GA3BD;;AA6BA,SACC,4BAAC,aAAD,6BACMH,SADN;AAEC,IAAA,kBAAkB,EAAGE,qBAAqB,EAF3C;AAGC,IAAA,iBAAiB,EAAG,MAHrB;AAIC,IAAA,iBAAiB;AAChB;AACA,kBAAI,8BAAJ,CANF;AAQC,IAAA,OAAO,EAAGD,OARX;AASC,IAAA,QAAQ,EAAG,KATZ;AAUC,IAAA,KAAK,EAAG;AAVT,MAYC,4BAAC,mBAAD;AAAQ,IAAA,KAAK,EAAGH,KAAhB;AAAwB,IAAA,aAAa,EAAGC;AAAxC,IAZD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport { Switch } from 'react-native';\nimport { isEmpty } from 'lodash';\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\n\nexport default function BottomSheetSwitchCell( props ) {\n\tconst { value, onValueChange, ...cellProps } = props;\n\n\tconst onPress = () => {\n\t\tonValueChange( ! value );\n\t};\n\n\tconst getAccessibilityLabel = () => {\n\t\tif ( isEmpty( cellProps.help ) ) {\n\t\t\treturn value\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Switch setting ON state. %s: Switch title. */\n\t\t\t\t\t\t_x( '%s. On', 'switch control' ),\n\t\t\t\t\t\tcellProps.label\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Switch setting OFF state. %s: Switch title. */\n\t\t\t\t\t\t_x( '%s. Off', 'switch control' ),\n\t\t\t\t\t\tcellProps.label\n\t\t\t\t );\n\t\t}\n\t\treturn value\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: accessibility text. Switch setting ON state. %1: Switch title, %2: switch help. */\n\t\t\t\t\t_x( '%1$s, %2$s. On', 'switch control' ),\n\t\t\t\t\tcellProps.label,\n\t\t\t\t\tcellProps.help\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. Switch setting OFF state. %1: Switch title, %2: switch help. */\n\t\t\t\t\t_x( '%1$s, %2$s. Off', 'switch control' ),\n\t\t\t\t\tcellProps.label,\n\t\t\t\t\tcellProps.help\n\t\t\t );\n\t};\n\n\treturn (\n\t\t<Cell\n\t\t\t{ ...cellProps }\n\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\taccessibilityRole={ 'none' }\n\t\t\taccessibilityHint={\n\t\t\t\t/* translators: accessibility text (hint for switches) */\n\t\t\t\t__( 'Double tap to toggle setting' )\n\t\t\t}\n\t\t\tonPress={ onPress }\n\t\t\teditable={ false }\n\t\t\tvalue={ '' }\n\t\t>\n\t\t\t<Switch value={ value } onValueChange={ onValueChange } />\n\t\t</Cell>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/switch-cell.native.js"],"names":["BottomSheetSwitchCell","props","value","onValueChange","cellProps","onPress","getAccessibilityLabel","help","label"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAIA;;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgCC,KAAhC,EAAwC;AACtD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,aAAT;AAAwB,OAAGC;AAA3B,MAAyCH,KAA/C;;AAEA,QAAMI,OAAO,GAAG,MAAM;AACrBF,IAAAA,aAAa,CAAE,CAAED,KAAJ,CAAb;AACA,GAFD;;AAIA,QAAMI,qBAAqB,GAAG,MAAM;AACnC,QAAK,CAAEF,SAAS,CAACG,IAAjB,EAAwB;AACvB,aAAOL,KAAK,GACT;AACA;AACA,oBAAI,QAAJ,EAAc,gBAAd,CAFA,EAGAE,SAAS,CAACI,KAHV,CADS,GAMT;AACA;AACA,oBAAI,SAAJ,EAAe,gBAAf,CAFA,EAGAJ,SAAS,CAACI,KAHV,CANH;AAWA;;AACD,WAAON,KAAK,GACT;AACA;AACA,kBAAI,gBAAJ,EAAsB,gBAAtB,CAFA,EAGAE,SAAS,CAACI,KAHV,EAIAJ,SAAS,CAACG,IAJV,CADS,GAOT;AACA;AACA,kBAAI,iBAAJ,EAAuB,gBAAvB,CAFA,EAGAH,SAAS,CAACI,KAHV,EAIAJ,SAAS,CAACG,IAJV,CAPH;AAaA,GA3BD;;AA6BA,SACC,4BAAC,aAAD,6BACMH,SADN;AAEC,IAAA,kBAAkB,EAAGE,qBAAqB,EAF3C;AAGC,IAAA,iBAAiB,EAAG,MAHrB;AAIC,IAAA,iBAAiB;AAChB;AACA,kBAAI,8BAAJ,CANF;AAQC,IAAA,OAAO,EAAGD,OARX;AASC,IAAA,QAAQ,EAAG,KATZ;AAUC,IAAA,KAAK,EAAG;AAVT,MAYC,4BAAC,mBAAD;AAAQ,IAAA,KAAK,EAAGH,KAAhB;AAAwB,IAAA,aAAa,EAAGC;AAAxC,IAZD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport { Switch } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\n\nexport default function BottomSheetSwitchCell( props ) {\n\tconst { value, onValueChange, ...cellProps } = props;\n\n\tconst onPress = () => {\n\t\tonValueChange( ! value );\n\t};\n\n\tconst getAccessibilityLabel = () => {\n\t\tif ( ! cellProps.help ) {\n\t\t\treturn value\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Switch setting ON state. %s: Switch title. */\n\t\t\t\t\t\t_x( '%s. On', 'switch control' ),\n\t\t\t\t\t\tcellProps.label\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Switch setting OFF state. %s: Switch title. */\n\t\t\t\t\t\t_x( '%s. Off', 'switch control' ),\n\t\t\t\t\t\tcellProps.label\n\t\t\t\t );\n\t\t}\n\t\treturn value\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: accessibility text. Switch setting ON state. %1: Switch title, %2: switch help. */\n\t\t\t\t\t_x( '%1$s, %2$s. On', 'switch control' ),\n\t\t\t\t\tcellProps.label,\n\t\t\t\t\tcellProps.help\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. Switch setting OFF state. %1: Switch title, %2: switch help. */\n\t\t\t\t\t_x( '%1$s, %2$s. Off', 'switch control' ),\n\t\t\t\t\tcellProps.label,\n\t\t\t\t\tcellProps.help\n\t\t\t );\n\t};\n\n\treturn (\n\t\t<Cell\n\t\t\t{ ...cellProps }\n\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\taccessibilityRole={ 'none' }\n\t\t\taccessibilityHint={\n\t\t\t\t/* translators: accessibility text (hint for switches) */\n\t\t\t\t__( 'Double tap to toggle setting' )\n\t\t\t}\n\t\t\tonPress={ onPress }\n\t\t\teditable={ false }\n\t\t\tvalue={ '' }\n\t\t>\n\t\t\t<Switch value={ value } onValueChange={ onValueChange } />\n\t\t</Cell>\n\t);\n}\n"]}
@@ -11,14 +11,8 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _utils = require("./utils");
17
15
 
18
- /**
19
- * External dependencies
20
- */
21
-
22
16
  /**
23
17
  * WordPress dependencies
24
18
  */
@@ -35,10 +29,16 @@ const getMergedGlobalStyles = (baseGlobalStyles, globalStyle, wrapperPropsStyle,
35
29
  const baseGlobalColors = {
36
30
  baseColors: baseGlobalStyles || {}
37
31
  };
38
- const blockStyleAttributes = (0, _lodash.pick)(blockAttributes, _utils.BLOCK_STYLE_ATTRIBUTES); // This prevents certain wrapper styles from being applied to blocks that
32
+ const blockStyleAttributes = Object.fromEntries(Object.entries(blockAttributes !== null && blockAttributes !== void 0 ? blockAttributes : {}).filter(_ref => {
33
+ let [key] = _ref;
34
+ return _utils.BLOCK_STYLE_ATTRIBUTES.includes(key);
35
+ })); // This prevents certain wrapper styles from being applied to blocks that
39
36
  // don't support them yet.
40
37
 
41
- const wrapperPropsStyleFiltered = (0, _lodash.pick)(wrapperPropsStyle, _utils.BLOCK_STYLE_ATTRIBUTES);
38
+ const wrapperPropsStyleFiltered = Object.fromEntries(Object.entries(wrapperPropsStyle !== null && wrapperPropsStyle !== void 0 ? wrapperPropsStyle : {}).filter(_ref2 => {
39
+ let [key] = _ref2;
40
+ return _utils.BLOCK_STYLE_ATTRIBUTES.includes(key);
41
+ }));
42
42
  const mergedStyle = { ...baseGlobalColors,
43
43
  ...globalStyle,
44
44
  ...wrapperPropsStyleFiltered
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/global-styles-context/index.native.js"],"names":["GlobalStylesContext","style","BLOCK_STYLE_ATTRIBUTES","getMergedGlobalStyles","baseGlobalStyles","globalStyle","wrapperPropsStyle","blockAttributes","defaultColors","blockName","fontSizes","baseGlobalColors","baseColors","blockStyleAttributes","wrapperPropsStyleFiltered","mergedStyle","blockColors","blockPaddings","blockTypography","useGlobalStyles","globalStyles","withGlobalStyles","WrappedComponent","props"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MA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B;AAA+B,EAAA,YAAY,EAAGH;AAA9C,GAFF,CAFK;;;eASQpB,mB","sourcesContent":["/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBLOCK_STYLE_ATTRIBUTES,\n\tgetBlockPaddings,\n\tgetBlockColors,\n\tgetBlockTypography,\n} from './utils';\n\nconst GlobalStylesContext = createContext( { style: {} } );\n\nGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES = BLOCK_STYLE_ATTRIBUTES;\n\nexport const getMergedGlobalStyles = (\n\tbaseGlobalStyles,\n\tglobalStyle,\n\twrapperPropsStyle,\n\tblockAttributes,\n\tdefaultColors,\n\tblockName,\n\tfontSizes\n) => {\n\tconst baseGlobalColors = {\n\t\tbaseColors: baseGlobalStyles || {},\n\t};\n\tconst blockStyleAttributes = pick(\n\t\tblockAttributes,\n\t\tBLOCK_STYLE_ATTRIBUTES\n\t);\n\t// This prevents certain wrapper styles from being applied to blocks that\n\t// don't support them yet.\n\tconst wrapperPropsStyleFiltered = pick(\n\t\twrapperPropsStyle,\n\t\tBLOCK_STYLE_ATTRIBUTES\n\t);\n\n\tconst mergedStyle = {\n\t\t...baseGlobalColors,\n\t\t...globalStyle,\n\t\t...wrapperPropsStyleFiltered,\n\t};\n\tconst blockColors = getBlockColors(\n\t\tblockStyleAttributes,\n\t\tdefaultColors,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\tconst blockPaddings = getBlockPaddings(\n\t\tmergedStyle,\n\t\twrapperPropsStyle,\n\t\tblockStyleAttributes,\n\t\tblockColors\n\t);\n\tconst blockTypography = getBlockTypography(\n\t\tblockStyleAttributes,\n\t\tfontSizes,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\n\treturn {\n\t\t...mergedStyle,\n\t\t...blockPaddings,\n\t\t...blockColors,\n\t\t...blockTypography,\n\t};\n};\n\nexport const useGlobalStyles = () => {\n\tconst globalStyles = useContext( GlobalStylesContext );\n\n\treturn globalStyles;\n};\n\nexport const withGlobalStyles = ( WrappedComponent ) => ( props ) =>\n\t(\n\t\t<GlobalStylesContext.Consumer>\n\t\t\t{ ( globalStyles ) => (\n\t\t\t\t<WrappedComponent { ...props } globalStyles={ globalStyles } />\n\t\t\t) }\n\t\t</GlobalStylesContext.Consumer>\n\t);\n\nexport default GlobalStylesContext;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/global-styles-context/index.native.js"],"names":["GlobalStylesContext","style","BLOCK_STYLE_ATTRIBUTES","getMergedGlobalStyles","baseGlobalStyles","globalStyle","wrapperPropsStyle","blockAttributes","defaultColors","blockName","fontSizes","baseGlobalColors","baseColors","blockStyleAttributes","Object","fromEntries","entries","filter","key","includes","wrapperPropsStyleFiltered","mergedStyle","blockColors","blockPaddings","blockTypography","useGlobalStyles","globalStyles","withGlobalStyles","WrappedComponent","props"],"mappings":";;;;;;;;;AAGA;;;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,mBAAmB,GAAG,4BAAe;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAAf,CAA5B;AAEAD,mBAAmB,CAACE,sBAApB,GAA6CA,6BAA7C;;AAEO,MAAMC,qBAAqB,GAAG,CACpCC,gBADoC,EAEpCC,WAFoC,EAGpCC,iBAHoC,EAIpCC,eAJoC,EAKpCC,aALoC,EAMpCC,SANoC,EAOpCC,SAPoC,KAQhC;AACJ,QAAMC,gBAAgB,GAAG;AACxBC,IAAAA,UAAU,EAAER,gBAAgB,IAAI;AADR,GAAzB;AAGA,QAAMS,oBAAoB,GAAGC,MAAM,CAACC,WAAP,CAC5BD,MAAM,CAACE,OAAP,CAAgBT,eAAhB,aAAgBA,eAAhB,cAAgBA,eAAhB,GAAmC,EAAnC,EAAwCU,MAAxC,CAAgD;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WAC/ChB,8BAAuBiB,QAAvB,CAAiCD,GAAjC,CAD+C;AAAA,GAAhD,CAD4B,CAA7B,CAJI,CAUJ;AACA;;AACA,QAAME,yBAAyB,GAAGN,MAAM,CAACC,WAAP,CACjCD,MAAM,CAACE,OAAP,CAAgBV,iBAAhB,aAAgBA,iBAAhB,cAAgBA,iBAAhB,GAAqC,EAArC,EAA0CW,MAA1C,CAAkD;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WACjDhB,8BAAuBiB,QAAvB,CAAiCD,GAAjC,CADiD;AAAA,GAAlD,CADiC,CAAlC;AAMA,QAAMG,WAAW,GAAG,EACnB,GAAGV,gBADgB;AAEnB,OAAGN,WAFgB;AAGnB,OAAGe;AAHgB,GAApB;AAKA,QAAME,WAAW,GAAG,2BACnBT,oBADmB,EAEnBL,aAFmB,EAGnBC,SAHmB,EAInBL,gBAJmB,CAApB;AAMA,QAAMmB,aAAa,GAAG,6BACrBF,WADqB,EAErBf,iBAFqB,EAGrBO,oBAHqB,EAIrBS,WAJqB,CAAtB;AAMA,QAAME,eAAe,GAAG,+BACvBX,oBADuB,EAEvBH,SAFuB,EAGvBD,SAHuB,EAIvBL,gBAJuB,CAAxB;AAOA,SAAO,EACN,GAAGiB,WADG;AAEN,OAAGE,aAFG;AAGN,OAAGD,WAHG;AAIN,OAAGE;AAJG,GAAP;AAMA,CAxDM;;;;AA0DA,MAAMC,eAAe,GAAG,MAAM;AACpC,QAAMC,YAAY,GAAG,yBAAY1B,mBAAZ,CAArB;AAEA,SAAO0B,YAAP;AACA,CAJM;;;;AAMA,MAAMC,gBAAgB,GAAKC,gBAAF,IAA0BC,KAAF,IAEtD,4BAAC,mBAAD,CAAqB,QAArB,QACKH,YAAF,IACD,4BAAC,gBAAD,6BAAuBG,KAAvB;AAA+B,EAAA,YAAY,EAAGH;AAA9C,GAFF,CAFK;;;eASQ1B,mB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBLOCK_STYLE_ATTRIBUTES,\n\tgetBlockPaddings,\n\tgetBlockColors,\n\tgetBlockTypography,\n} from './utils';\n\nconst GlobalStylesContext = createContext( { style: {} } );\n\nGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES = BLOCK_STYLE_ATTRIBUTES;\n\nexport const getMergedGlobalStyles = (\n\tbaseGlobalStyles,\n\tglobalStyle,\n\twrapperPropsStyle,\n\tblockAttributes,\n\tdefaultColors,\n\tblockName,\n\tfontSizes\n) => {\n\tconst baseGlobalColors = {\n\t\tbaseColors: baseGlobalStyles || {},\n\t};\n\tconst blockStyleAttributes = Object.fromEntries(\n\t\tObject.entries( blockAttributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\t// This prevents certain wrapper styles from being applied to blocks that\n\t// don't support them yet.\n\tconst wrapperPropsStyleFiltered = Object.fromEntries(\n\t\tObject.entries( wrapperPropsStyle ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\tconst mergedStyle = {\n\t\t...baseGlobalColors,\n\t\t...globalStyle,\n\t\t...wrapperPropsStyleFiltered,\n\t};\n\tconst blockColors = getBlockColors(\n\t\tblockStyleAttributes,\n\t\tdefaultColors,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\tconst blockPaddings = getBlockPaddings(\n\t\tmergedStyle,\n\t\twrapperPropsStyle,\n\t\tblockStyleAttributes,\n\t\tblockColors\n\t);\n\tconst blockTypography = getBlockTypography(\n\t\tblockStyleAttributes,\n\t\tfontSizes,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\n\treturn {\n\t\t...mergedStyle,\n\t\t...blockPaddings,\n\t\t...blockColors,\n\t\t...blockTypography,\n\t};\n};\n\nexport const useGlobalStyles = () => {\n\tconst globalStyles = useContext( GlobalStylesContext );\n\n\treturn globalStyles;\n};\n\nexport const withGlobalStyles = ( WrappedComponent ) => ( props ) =>\n\t(\n\t\t<GlobalStylesContext.Consumer>\n\t\t\t{ ( globalStyles ) => (\n\t\t\t\t<WrappedComponent { ...props } globalStyles={ globalStyles } />\n\t\t\t) }\n\t\t</GlobalStylesContext.Consumer>\n\t);\n\nexport default GlobalStylesContext;\n"]}