@wordpress/components 19.12.0 → 19.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1409) hide show
  1. package/CHANGELOG.md +116 -3
  2. package/CONTRIBUTING.md +94 -12
  3. package/build/alignment-matrix-control/index.js +3 -3
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/alignment-matrix-control/utils.js +1 -7
  6. package/build/alignment-matrix-control/utils.js.map +1 -1
  7. package/build/angle-picker-control/index.js +2 -2
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/autocomplete/autocompleter-ui.js +4 -2
  10. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  11. package/build/autocomplete/autocompleter-ui.native.js +9 -3
  12. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  13. package/build/autocomplete/get-default-use-items.js +5 -1
  14. package/build/autocomplete/get-default-use-items.js.map +1 -1
  15. package/build/autocomplete/index.js +9 -3
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/border-box-control/border-box-control/component.js +2 -1
  18. package/build/border-box-control/border-box-control/component.js.map +1 -1
  19. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  20. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  21. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  22. package/build/border-box-control/utils.js.map +1 -1
  23. package/build/border-control/border-control/component.js +40 -4
  24. package/build/border-control/border-control/component.js.map +1 -1
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/box-control/all-input-control.js +6 -10
  27. package/build/box-control/all-input-control.js.map +1 -1
  28. package/build/box-control/axial-input-controls.js.map +1 -1
  29. package/build/box-control/index.js +4 -8
  30. package/build/box-control/index.js.map +1 -1
  31. package/build/box-control/input-controls.js +6 -10
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/box-control/unit-control.js +4 -4
  34. package/build/box-control/unit-control.js.map +1 -1
  35. package/build/box-control/utils.js +3 -3
  36. package/build/box-control/utils.js.map +1 -1
  37. package/build/button/index.native.js +1 -3
  38. package/build/button/index.native.js.map +1 -1
  39. package/build/checkbox-control/index.js.map +1 -1
  40. package/build/color-indicator/index.js +27 -10
  41. package/build/color-indicator/index.js.map +1 -1
  42. package/build/color-indicator/types.js +6 -0
  43. package/build/color-indicator/types.js.map +1 -0
  44. package/build/color-palette/index.js +2 -1
  45. package/build/color-palette/index.js.map +1 -1
  46. package/build/color-picker/component.js +6 -9
  47. package/build/color-picker/component.js.map +1 -1
  48. package/build/color-picker/hex-input.js +5 -4
  49. package/build/color-picker/hex-input.js.map +1 -1
  50. package/build/color-picker/index.native.js +35 -34
  51. package/build/color-picker/index.native.js.map +1 -1
  52. package/build/color-picker/input-with-slider.js +4 -3
  53. package/build/color-picker/input-with-slider.js.map +1 -1
  54. package/build/color-picker/styles.js +42 -36
  55. package/build/color-picker/styles.js.map +1 -1
  56. package/build/color-picker/use-deprecated-props.js +22 -31
  57. package/build/color-picker/use-deprecated-props.js.map +1 -1
  58. package/build/combobox-control/index.js +18 -8
  59. package/build/combobox-control/index.js.map +1 -1
  60. package/build/combobox-control/styles.js +39 -0
  61. package/build/combobox-control/styles.js.map +1 -0
  62. package/build/confirm-dialog/component.js.map +1 -1
  63. package/build/custom-gradient-bar/constants.js +1 -3
  64. package/build/custom-gradient-bar/constants.js.map +1 -1
  65. package/build/custom-gradient-bar/control-points.js +15 -8
  66. package/build/custom-gradient-bar/control-points.js.map +1 -1
  67. package/build/custom-gradient-bar/index.js +5 -5
  68. package/build/custom-gradient-bar/index.js.map +1 -1
  69. package/build/custom-gradient-bar/utils.js +5 -7
  70. package/build/custom-gradient-bar/utils.js.map +1 -1
  71. package/build/custom-gradient-picker/index.js +8 -8
  72. package/build/custom-gradient-picker/index.js.map +1 -1
  73. package/build/custom-gradient-picker/index.native.js +8 -9
  74. package/build/custom-gradient-picker/index.native.js.map +1 -1
  75. package/build/custom-gradient-picker/serializer.js +4 -7
  76. package/build/custom-gradient-picker/serializer.js.map +1 -1
  77. package/build/custom-gradient-picker/utils.js.map +1 -1
  78. package/build/custom-select-control/index.js.map +1 -1
  79. package/build/date-time/date/index.js +7 -5
  80. package/build/date-time/date/index.js.map +1 -1
  81. package/build/date-time/date-time/index.js +6 -4
  82. package/build/date-time/date-time/index.js.map +1 -1
  83. package/build/dimension-control/index.js +1 -3
  84. package/build/dimension-control/index.js.map +1 -1
  85. package/build/divider/styles.js +5 -5
  86. package/build/divider/styles.js.map +1 -1
  87. package/build/draggable/index.js.map +1 -1
  88. package/build/draggable/index.native.js +6 -1
  89. package/build/draggable/index.native.js.map +1 -1
  90. package/build/drop-zone/provider.js.map +1 -1
  91. package/build/dropdown/index.js +2 -2
  92. package/build/dropdown/index.js.map +1 -1
  93. package/build/dropdown-menu/index.js +16 -5
  94. package/build/dropdown-menu/index.js.map +1 -1
  95. package/build/dropdown-menu/index.native.js +17 -6
  96. package/build/dropdown-menu/index.native.js.map +1 -1
  97. package/build/duotone-picker/duotone-picker.js +42 -29
  98. package/build/duotone-picker/duotone-picker.js.map +1 -1
  99. package/build/elevation/hook.js +14 -14
  100. package/build/elevation/hook.js.map +1 -1
  101. package/build/external-link/index.js +20 -10
  102. package/build/external-link/index.js.map +1 -1
  103. package/build/external-link/styles/external-link-styles.js +3 -3
  104. package/build/external-link/styles/external-link-styles.js.map +1 -1
  105. package/build/external-link/types.js +6 -0
  106. package/build/external-link/types.js.map +1 -0
  107. package/build/flex/flex/hook.js +9 -5
  108. package/build/flex/flex/hook.js.map +1 -1
  109. package/build/focal-point-picker/controls.js +3 -7
  110. package/build/focal-point-picker/controls.js.map +1 -1
  111. package/build/focal-point-picker/grid.js +2 -7
  112. package/build/focal-point-picker/grid.js.map +1 -1
  113. package/build/focal-point-picker/index.js.map +1 -1
  114. package/build/focal-point-picker/index.native.js +12 -12
  115. package/build/focal-point-picker/index.native.js.map +1 -1
  116. package/build/focal-point-picker/media.js +4 -8
  117. package/build/focal-point-picker/media.js.map +1 -1
  118. package/build/focal-point-picker/tooltip/index.native.js +11 -12
  119. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  120. package/build/font-size-picker/index.js +1 -1
  121. package/build/font-size-picker/index.js.map +1 -1
  122. package/build/form-toggle/index.js +34 -9
  123. package/build/form-toggle/index.js.map +1 -1
  124. package/build/form-toggle/types.js +6 -0
  125. package/build/form-toggle/types.js.map +1 -0
  126. package/build/form-token-field/index.js +344 -360
  127. package/build/form-token-field/index.js.map +1 -1
  128. package/build/form-token-field/styles.js +40 -0
  129. package/build/form-token-field/styles.js.map +1 -0
  130. package/build/form-token-field/suggestions-list.js +22 -21
  131. package/build/form-token-field/suggestions-list.js.map +1 -1
  132. package/build/form-token-field/token-input.js +39 -53
  133. package/build/form-token-field/token-input.js.map +1 -1
  134. package/build/form-token-field/token.js +3 -3
  135. package/build/form-token-field/token.js.map +1 -1
  136. package/build/form-token-field/types.js +6 -0
  137. package/build/form-token-field/types.js.map +1 -0
  138. package/build/gradient-picker/index.js.map +1 -1
  139. package/build/grid/component.js +7 -8
  140. package/build/grid/component.js.map +1 -1
  141. package/build/grid/hook.js +1 -5
  142. package/build/grid/hook.js.map +1 -1
  143. package/build/grid/index.js.map +1 -1
  144. package/build/grid/utils.js +4 -7
  145. package/build/grid/utils.js.map +1 -1
  146. package/build/h-stack/component.js +5 -9
  147. package/build/h-stack/component.js.map +1 -1
  148. package/build/h-stack/hook.js +8 -10
  149. package/build/h-stack/hook.js.map +1 -1
  150. package/build/h-stack/index.js.map +1 -1
  151. package/build/h-stack/utils.js +8 -19
  152. package/build/h-stack/utils.js.map +1 -1
  153. package/build/heading/component.js +0 -1
  154. package/build/heading/component.js.map +1 -1
  155. package/build/heading/hook.js.map +1 -1
  156. package/build/heading/types.js +6 -0
  157. package/build/heading/types.js.map +1 -0
  158. package/build/higher-order/navigate-regions/index.js.map +1 -1
  159. package/build/higher-order/with-focus-return/index.js.map +1 -1
  160. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  161. package/build/icon/index.js.map +1 -1
  162. package/build/input-control/index.js +5 -5
  163. package/build/input-control/index.js.map +1 -1
  164. package/build/input-control/input-field.js +10 -10
  165. package/build/input-control/input-field.js.map +1 -1
  166. package/build/input-control/reducer/reducer.js.map +1 -1
  167. package/build/input-control/utils.js +1 -1
  168. package/build/input-control/utils.js.map +1 -1
  169. package/build/menu-item/index.js +1 -3
  170. package/build/menu-item/index.js.map +1 -1
  171. package/build/menu-items-choice/index.js +3 -7
  172. package/build/menu-items-choice/index.js.map +1 -1
  173. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  174. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  175. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
  176. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  177. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  178. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  179. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  180. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  181. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  182. package/build/mobile/color-settings/index.native.js.map +1 -1
  183. package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
  184. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  185. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  186. package/build/mobile/gradient/index.native.js.map +1 -1
  187. package/build/mobile/html-text-input/index.native.js.map +1 -1
  188. package/build/mobile/image/index.native.js +4 -2
  189. package/build/mobile/image/index.native.js.map +1 -1
  190. package/build/mobile/inserter-button/index.native.js.map +1 -1
  191. package/build/mobile/link-picker/index.native.js +4 -4
  192. package/build/mobile/link-picker/index.native.js.map +1 -1
  193. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  194. package/build/mobile/media-edit/index.native.js.map +1 -1
  195. package/build/mobile/segmented-control/index.native.js +3 -5
  196. package/build/mobile/segmented-control/index.native.js.map +1 -1
  197. package/build/modal/index.js +18 -4
  198. package/build/modal/index.js.map +1 -1
  199. package/build/navigable-container/container.js +4 -2
  200. package/build/navigable-container/container.js.map +1 -1
  201. package/build/navigation/context.js +12 -16
  202. package/build/navigation/context.js.map +1 -1
  203. package/build/navigation/group/index.js +4 -7
  204. package/build/navigation/group/index.js.map +1 -1
  205. package/build/navigation/index.js +7 -4
  206. package/build/navigation/index.js.map +1 -1
  207. package/build/navigation/item/base.js +6 -3
  208. package/build/navigation/item/base.js.map +1 -1
  209. package/build/navigation/item/index.js +3 -3
  210. package/build/navigation/item/index.js.map +1 -1
  211. package/build/navigation/item/use-navigation-tree-item.js +2 -1
  212. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  213. package/build/navigation/menu/menu-title-search.js +1 -7
  214. package/build/navigation/menu/menu-title-search.js.map +1 -1
  215. package/build/navigation/menu/search-no-results-found.js +1 -7
  216. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  217. package/build/navigation/use-navigation-tree-nodes.js +18 -10
  218. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  219. package/build/navigation/utils.js +4 -2
  220. package/build/navigation/utils.js.map +1 -1
  221. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  222. package/build/navigator/navigator-button/hook.js.map +1 -1
  223. package/build/navigator/navigator-provider/component.js +1 -1
  224. package/build/navigator/navigator-provider/component.js.map +1 -1
  225. package/build/navigator/navigator-screen/component.js +1 -1
  226. package/build/navigator/navigator-screen/component.js.map +1 -1
  227. package/build/notice/index.js +5 -5
  228. package/build/notice/index.js.map +1 -1
  229. package/build/notice/list.js +4 -2
  230. package/build/notice/list.js.map +1 -1
  231. package/build/panel/body.js +3 -3
  232. package/build/panel/body.js.map +1 -1
  233. package/build/placeholder/index.js +26 -12
  234. package/build/placeholder/index.js.map +1 -1
  235. package/build/popover/index.js +4 -4
  236. package/build/popover/index.js.map +1 -1
  237. package/build/radio-control/index.js +43 -7
  238. package/build/radio-control/index.js.map +1 -1
  239. package/build/radio-control/types.js +6 -0
  240. package/build/radio-control/types.js.map +1 -0
  241. package/build/range-control/index.js +63 -47
  242. package/build/range-control/index.js.map +1 -1
  243. package/build/range-control/input-range.js +11 -17
  244. package/build/range-control/input-range.js.map +1 -1
  245. package/build/range-control/mark.js +5 -7
  246. package/build/range-control/mark.js.map +1 -1
  247. package/build/range-control/rail.js +10 -16
  248. package/build/range-control/rail.js.map +1 -1
  249. package/build/range-control/styles/range-control-styles.js +62 -62
  250. package/build/range-control/styles/range-control-styles.js.map +1 -1
  251. package/build/range-control/tooltip.js +5 -7
  252. package/build/range-control/tooltip.js.map +1 -1
  253. package/build/range-control/types.js +6 -0
  254. package/build/range-control/types.js.map +1 -0
  255. package/build/range-control/utils.js +27 -36
  256. package/build/range-control/utils.js.map +1 -1
  257. package/build/resizable-box/resize-tooltip/index.js +3 -3
  258. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  259. package/build/resizable-box/resize-tooltip/utils.js +5 -13
  260. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  261. package/build/responsive-wrapper/index.js.map +1 -1
  262. package/build/scrollable/component.js +7 -8
  263. package/build/scrollable/component.js.map +1 -1
  264. package/build/scrollable/hook.js +0 -8
  265. package/build/scrollable/hook.js.map +1 -1
  266. package/build/scrollable/index.js.map +1 -1
  267. package/build/scrollable/styles.js +7 -7
  268. package/build/scrollable/styles.js.map +1 -1
  269. package/build/select-control/index.js +5 -3
  270. package/build/select-control/index.js.map +1 -1
  271. package/build/shortcut/index.js +2 -8
  272. package/build/shortcut/index.js.map +1 -1
  273. package/build/slot-fill/fill.js +1 -7
  274. package/build/slot-fill/fill.js.map +1 -1
  275. package/build/slot-fill/index.native.js +6 -8
  276. package/build/slot-fill/index.native.js.map +1 -1
  277. package/build/slot-fill/provider.js +4 -8
  278. package/build/slot-fill/provider.js.map +1 -1
  279. package/build/slot-fill/slot.js +17 -10
  280. package/build/slot-fill/slot.js.map +1 -1
  281. package/build/snackbar/index.js +7 -7
  282. package/build/snackbar/index.js.map +1 -1
  283. package/build/snackbar/list.js +3 -1
  284. package/build/snackbar/list.js.map +1 -1
  285. package/build/spacer/component.js +5 -5
  286. package/build/spacer/component.js.map +1 -1
  287. package/build/spacer/hook.js +2 -2
  288. package/build/spacer/hook.js.map +1 -1
  289. package/build/spacer/index.js.map +1 -1
  290. package/build/spinner/index.js +26 -13
  291. package/build/spinner/index.js.map +1 -1
  292. package/build/spinner/styles.js +10 -10
  293. package/build/spinner/styles.js.map +1 -1
  294. package/build/tab-panel/index.js +3 -1
  295. package/build/tab-panel/index.js.map +1 -1
  296. package/build/text/hook.js +4 -4
  297. package/build/text/hook.js.map +1 -1
  298. package/build/text/utils.js.map +1 -1
  299. package/build/text-highlight/index.js +22 -5
  300. package/build/text-highlight/index.js.map +1 -1
  301. package/build/text-highlight/types.js +6 -0
  302. package/build/text-highlight/types.js.map +1 -0
  303. package/build/tip/index.js +5 -11
  304. package/build/tip/index.js.map +1 -1
  305. package/build/tip/types.js +6 -0
  306. package/build/tip/types.js.map +1 -0
  307. package/build/toggle-control/index.js +1 -3
  308. package/build/toggle-control/index.js.map +1 -1
  309. package/build/toggle-control/index.native.js +1 -7
  310. package/build/toggle-control/index.native.js.map +1 -1
  311. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  312. package/build/toolbar/index.js.map +1 -1
  313. package/build/toolbar-group/index.js +3 -3
  314. package/build/toolbar-group/index.js.map +1 -1
  315. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  316. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  317. package/build/tooltip/index.js +2 -1
  318. package/build/tooltip/index.js.map +1 -1
  319. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  320. package/build/tree-select/index.js +59 -6
  321. package/build/tree-select/index.js.map +1 -1
  322. package/build/tree-select/types.js +6 -0
  323. package/build/tree-select/types.js.map +1 -0
  324. package/build/truncate/component.js +7 -8
  325. package/build/truncate/component.js.map +1 -1
  326. package/build/truncate/hook.js +3 -10
  327. package/build/truncate/hook.js.map +1 -1
  328. package/build/truncate/index.js.map +1 -1
  329. package/build/truncate/styles.js +1 -1
  330. package/build/truncate/styles.js.map +1 -1
  331. package/build/truncate/utils.js +3 -16
  332. package/build/truncate/utils.js.map +1 -1
  333. package/build/ui/form-group/form-group-content.js.map +1 -1
  334. package/build/ui/utils/get-valid-children.js.map +1 -1
  335. package/build/unit-control/index.js.map +1 -1
  336. package/build/utils/math.js +17 -7
  337. package/build/utils/math.js.map +1 -1
  338. package/build/utils/unit-values.js.map +1 -1
  339. package/build/utils/values.js.map +1 -1
  340. package/build/v-stack/component.js +9 -9
  341. package/build/v-stack/component.js.map +1 -1
  342. package/build/v-stack/hook.js +0 -5
  343. package/build/v-stack/hook.js.map +1 -1
  344. package/build/v-stack/index.js.map +1 -1
  345. package/build/visually-hidden/component.js +12 -13
  346. package/build/visually-hidden/component.js.map +1 -1
  347. package/build/visually-hidden/index.js.map +1 -1
  348. package/build/visually-hidden/styles.js +3 -1
  349. package/build/visually-hidden/styles.js.map +1 -1
  350. package/build/visually-hidden/types.js +6 -0
  351. package/build/visually-hidden/types.js.map +1 -0
  352. package/build/z-stack/component.js +22 -3
  353. package/build/z-stack/component.js.map +1 -1
  354. package/build/z-stack/types.js +6 -0
  355. package/build/z-stack/types.js.map +1 -0
  356. package/build-module/alignment-matrix-control/index.js +2 -1
  357. package/build-module/alignment-matrix-control/index.js.map +1 -1
  358. package/build-module/alignment-matrix-control/utils.js +1 -6
  359. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  360. package/build-module/angle-picker-control/index.js +1 -1
  361. package/build-module/angle-picker-control/index.js.map +1 -1
  362. package/build-module/autocomplete/autocompleter-ui.js +4 -2
  363. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  364. package/build-module/autocomplete/autocompleter-ui.native.js +9 -3
  365. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  366. package/build-module/autocomplete/get-default-use-items.js +3 -2
  367. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  368. package/build-module/autocomplete/index.js +7 -4
  369. package/build-module/autocomplete/index.js.map +1 -1
  370. package/build-module/border-box-control/border-box-control/component.js +2 -1
  371. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  372. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  373. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  374. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  375. package/build-module/border-box-control/utils.js.map +1 -1
  376. package/build-module/border-control/border-control/component.js +38 -3
  377. package/build-module/border-control/border-control/component.js.map +1 -1
  378. package/build-module/border-control/border-control/hook.js.map +1 -1
  379. package/build-module/box-control/all-input-control.js +3 -5
  380. package/build-module/box-control/all-input-control.js.map +1 -1
  381. package/build-module/box-control/axial-input-controls.js.map +1 -1
  382. package/build-module/box-control/index.js +3 -6
  383. package/build-module/box-control/index.js.map +1 -1
  384. package/build-module/box-control/input-controls.js +3 -5
  385. package/build-module/box-control/input-controls.js.map +1 -1
  386. package/build-module/box-control/unit-control.js +3 -1
  387. package/build-module/box-control/unit-control.js.map +1 -1
  388. package/build-module/box-control/utils.js +4 -4
  389. package/build-module/box-control/utils.js.map +1 -1
  390. package/build-module/button/index.native.js +1 -2
  391. package/build-module/button/index.native.js.map +1 -1
  392. package/build-module/checkbox-control/index.js.map +1 -1
  393. package/build-module/color-indicator/index.js +29 -8
  394. package/build-module/color-indicator/index.js.map +1 -1
  395. package/build-module/color-indicator/types.js +2 -0
  396. package/build-module/color-indicator/types.js.map +1 -0
  397. package/build-module/color-palette/index.js +2 -1
  398. package/build-module/color-palette/index.js.map +1 -1
  399. package/build-module/color-picker/component.js +7 -8
  400. package/build-module/color-picker/component.js.map +1 -1
  401. package/build-module/color-picker/hex-input.js +4 -3
  402. package/build-module/color-picker/hex-input.js.map +1 -1
  403. package/build-module/color-picker/index.native.js +36 -35
  404. package/build-module/color-picker/index.native.js.map +1 -1
  405. package/build-module/color-picker/input-with-slider.js +4 -3
  406. package/build-module/color-picker/input-with-slider.js.map +1 -1
  407. package/build-module/color-picker/styles.js +28 -31
  408. package/build-module/color-picker/styles.js.map +1 -1
  409. package/build-module/color-picker/use-deprecated-props.js +22 -31
  410. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  411. package/build-module/combobox-control/index.js +18 -8
  412. package/build-module/combobox-control/index.js.map +1 -1
  413. package/build-module/combobox-control/styles.js +27 -0
  414. package/build-module/combobox-control/styles.js.map +1 -0
  415. package/build-module/confirm-dialog/component.js.map +1 -1
  416. package/build-module/custom-gradient-bar/constants.js +0 -1
  417. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  418. package/build-module/custom-gradient-bar/control-points.js +16 -9
  419. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  420. package/build-module/custom-gradient-bar/index.js +6 -6
  421. package/build-module/custom-gradient-bar/index.js.map +1 -1
  422. package/build-module/custom-gradient-bar/utils.js +6 -8
  423. package/build-module/custom-gradient-bar/utils.js.map +1 -1
  424. package/build-module/custom-gradient-picker/index.js +8 -7
  425. package/build-module/custom-gradient-picker/index.js.map +1 -1
  426. package/build-module/custom-gradient-picker/index.native.js +8 -8
  427. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  428. package/build-module/custom-gradient-picker/serializer.js +4 -6
  429. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  430. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  431. package/build-module/custom-select-control/index.js.map +1 -1
  432. package/build-module/date-time/date/index.js +7 -4
  433. package/build-module/date-time/date/index.js.map +1 -1
  434. package/build-module/date-time/date-time/index.js +5 -2
  435. package/build-module/date-time/date-time/index.js.map +1 -1
  436. package/build-module/dimension-control/index.js +1 -2
  437. package/build-module/dimension-control/index.js.map +1 -1
  438. package/build-module/divider/styles.js +5 -5
  439. package/build-module/divider/styles.js.map +1 -1
  440. package/build-module/draggable/index.js.map +1 -1
  441. package/build-module/draggable/index.native.js +6 -1
  442. package/build-module/draggable/index.native.js.map +1 -1
  443. package/build-module/drop-zone/provider.js.map +1 -1
  444. package/build-module/dropdown/index.js +2 -2
  445. package/build-module/dropdown/index.js.map +1 -1
  446. package/build-module/dropdown-menu/index.js +16 -4
  447. package/build-module/dropdown-menu/index.js.map +1 -1
  448. package/build-module/dropdown-menu/index.native.js +16 -4
  449. package/build-module/dropdown-menu/index.native.js.map +1 -1
  450. package/build-module/duotone-picker/duotone-picker.js +42 -29
  451. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  452. package/build-module/elevation/hook.js +13 -13
  453. package/build-module/elevation/hook.js.map +1 -1
  454. package/build-module/external-link/index.js +22 -8
  455. package/build-module/external-link/index.js.map +1 -1
  456. package/build-module/external-link/styles/external-link-styles.js +3 -3
  457. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  458. package/build-module/external-link/types.js +2 -0
  459. package/build-module/external-link/types.js.map +1 -0
  460. package/build-module/flex/flex/hook.js +7 -5
  461. package/build-module/flex/flex/hook.js.map +1 -1
  462. package/build-module/focal-point-picker/controls.js +3 -5
  463. package/build-module/focal-point-picker/controls.js.map +1 -1
  464. package/build-module/focal-point-picker/grid.js +2 -6
  465. package/build-module/focal-point-picker/grid.js.map +1 -1
  466. package/build-module/focal-point-picker/index.js.map +1 -1
  467. package/build-module/focal-point-picker/index.native.js +9 -9
  468. package/build-module/focal-point-picker/index.native.js.map +1 -1
  469. package/build-module/focal-point-picker/media.js +3 -5
  470. package/build-module/focal-point-picker/media.js.map +1 -1
  471. package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
  472. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  473. package/build-module/font-size-picker/index.js +1 -1
  474. package/build-module/font-size-picker/index.js.map +1 -1
  475. package/build-module/form-toggle/index.js +31 -7
  476. package/build-module/form-toggle/index.js.map +1 -1
  477. package/build-module/form-toggle/types.js +2 -0
  478. package/build-module/form-toggle/types.js.map +1 -0
  479. package/build-module/form-token-field/index.js +345 -363
  480. package/build-module/form-token-field/index.js.map +1 -1
  481. package/build-module/form-token-field/styles.js +28 -0
  482. package/build-module/form-token-field/styles.js.map +1 -0
  483. package/build-module/form-token-field/suggestions-list.js +27 -23
  484. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  485. package/build-module/form-token-field/token-input.js +43 -58
  486. package/build-module/form-token-field/token-input.js.map +1 -1
  487. package/build-module/form-token-field/token.js +3 -1
  488. package/build-module/form-token-field/token.js.map +1 -1
  489. package/build-module/form-token-field/types.js +2 -0
  490. package/build-module/form-token-field/types.js.map +1 -0
  491. package/build-module/gradient-picker/index.js.map +1 -1
  492. package/build-module/grid/component.js +7 -8
  493. package/build-module/grid/component.js.map +1 -1
  494. package/build-module/grid/hook.js +1 -5
  495. package/build-module/grid/hook.js.map +1 -1
  496. package/build-module/grid/index.js.map +1 -1
  497. package/build-module/grid/utils.js +3 -8
  498. package/build-module/grid/utils.js.map +1 -1
  499. package/build-module/h-stack/component.js +3 -7
  500. package/build-module/h-stack/component.js.map +1 -1
  501. package/build-module/h-stack/hook.js +10 -12
  502. package/build-module/h-stack/hook.js.map +1 -1
  503. package/build-module/h-stack/index.js.map +1 -1
  504. package/build-module/h-stack/utils.js +8 -20
  505. package/build-module/h-stack/utils.js.map +1 -1
  506. package/build-module/heading/component.js +0 -1
  507. package/build-module/heading/component.js.map +1 -1
  508. package/build-module/heading/hook.js.map +1 -1
  509. package/build-module/heading/types.js +2 -0
  510. package/build-module/heading/types.js.map +1 -0
  511. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  512. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  513. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  514. package/build-module/icon/index.js.map +1 -1
  515. package/build-module/input-control/index.js +2 -1
  516. package/build-module/input-control/index.js.map +1 -1
  517. package/build-module/input-control/input-field.js +2 -1
  518. package/build-module/input-control/input-field.js.map +1 -1
  519. package/build-module/input-control/reducer/reducer.js.map +1 -1
  520. package/build-module/input-control/utils.js +1 -1
  521. package/build-module/input-control/utils.js.map +1 -1
  522. package/build-module/menu-item/index.js +1 -2
  523. package/build-module/menu-item/index.js.map +1 -1
  524. package/build-module/menu-items-choice/index.js +3 -5
  525. package/build-module/menu-items-choice/index.js.map +1 -1
  526. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  528. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
  529. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  530. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  532. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  534. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  535. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  536. package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
  537. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  538. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  539. package/build-module/mobile/gradient/index.native.js.map +1 -1
  540. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  541. package/build-module/mobile/image/index.native.js +3 -2
  542. package/build-module/mobile/image/index.native.js.map +1 -1
  543. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  544. package/build-module/mobile/link-picker/index.native.js +4 -3
  545. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  546. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  547. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  548. package/build-module/mobile/segmented-control/index.native.js +3 -4
  549. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  550. package/build-module/modal/index.js +20 -6
  551. package/build-module/modal/index.js.map +1 -1
  552. package/build-module/navigable-container/container.js +5 -2
  553. package/build-module/navigable-container/container.js.map +1 -1
  554. package/build-module/navigation/context.js +3 -5
  555. package/build-module/navigation/context.js.map +1 -1
  556. package/build-module/navigation/group/index.js +3 -6
  557. package/build-module/navigation/group/index.js.map +1 -1
  558. package/build-module/navigation/index.js +7 -2
  559. package/build-module/navigation/index.js.map +1 -1
  560. package/build-module/navigation/item/base.js +5 -2
  561. package/build-module/navigation/item/base.js.map +1 -1
  562. package/build-module/navigation/item/index.js +3 -1
  563. package/build-module/navigation/item/index.js.map +1 -1
  564. package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
  565. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  566. package/build-module/navigation/menu/menu-title-search.js +1 -6
  567. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  568. package/build-module/navigation/menu/search-no-results-found.js +1 -6
  569. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  570. package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
  571. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  572. package/build-module/navigation/utils.js +2 -2
  573. package/build-module/navigation/utils.js.map +1 -1
  574. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  575. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  576. package/build-module/navigator/navigator-provider/component.js +1 -1
  577. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  578. package/build-module/navigator/navigator-screen/component.js +1 -1
  579. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  580. package/build-module/notice/index.js +2 -1
  581. package/build-module/notice/index.js.map +1 -1
  582. package/build-module/notice/list.js +4 -1
  583. package/build-module/notice/list.js.map +1 -1
  584. package/build-module/panel/body.js +3 -1
  585. package/build-module/panel/body.js.map +1 -1
  586. package/build-module/placeholder/index.js +24 -11
  587. package/build-module/placeholder/index.js.map +1 -1
  588. package/build-module/popover/index.js +4 -4
  589. package/build-module/popover/index.js.map +1 -1
  590. package/build-module/radio-control/index.js +40 -7
  591. package/build-module/radio-control/index.js.map +1 -1
  592. package/build-module/radio-control/types.js +2 -0
  593. package/build-module/radio-control/types.js.map +1 -0
  594. package/build-module/range-control/index.js +57 -41
  595. package/build-module/range-control/index.js.map +1 -1
  596. package/build-module/range-control/input-range.js +7 -11
  597. package/build-module/range-control/input-range.js.map +1 -1
  598. package/build-module/range-control/mark.js +5 -6
  599. package/build-module/range-control/mark.js.map +1 -1
  600. package/build-module/range-control/rail.js +10 -15
  601. package/build-module/range-control/rail.js.map +1 -1
  602. package/build-module/range-control/styles/range-control-styles.js +62 -64
  603. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  604. package/build-module/range-control/tooltip.js +5 -6
  605. package/build-module/range-control/tooltip.js.map +1 -1
  606. package/build-module/range-control/types.js +2 -0
  607. package/build-module/range-control/types.js.map +1 -0
  608. package/build-module/range-control/utils.js +24 -32
  609. package/build-module/range-control/utils.js.map +1 -1
  610. package/build-module/resizable-box/resize-tooltip/index.js +2 -1
  611. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  612. package/build-module/resizable-box/resize-tooltip/utils.js +5 -11
  613. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  614. package/build-module/responsive-wrapper/index.js.map +1 -1
  615. package/build-module/scrollable/component.js +7 -8
  616. package/build-module/scrollable/component.js.map +1 -1
  617. package/build-module/scrollable/hook.js +0 -8
  618. package/build-module/scrollable/hook.js.map +1 -1
  619. package/build-module/scrollable/index.js.map +1 -1
  620. package/build-module/scrollable/styles.js +7 -7
  621. package/build-module/scrollable/styles.js.map +1 -1
  622. package/build-module/select-control/index.js +3 -1
  623. package/build-module/select-control/index.js.map +1 -1
  624. package/build-module/shortcut/index.js +2 -7
  625. package/build-module/shortcut/index.js.map +1 -1
  626. package/build-module/slot-fill/fill.js +1 -6
  627. package/build-module/slot-fill/fill.js.map +1 -1
  628. package/build-module/slot-fill/index.native.js +6 -7
  629. package/build-module/slot-fill/index.native.js.map +1 -1
  630. package/build-module/slot-fill/provider.js +4 -7
  631. package/build-module/slot-fill/provider.js.map +1 -1
  632. package/build-module/slot-fill/slot.js +15 -8
  633. package/build-module/slot-fill/slot.js.map +1 -1
  634. package/build-module/snackbar/index.js +3 -1
  635. package/build-module/snackbar/index.js.map +1 -1
  636. package/build-module/snackbar/list.js +4 -1
  637. package/build-module/snackbar/list.js.map +1 -1
  638. package/build-module/spacer/component.js +3 -4
  639. package/build-module/spacer/component.js.map +1 -1
  640. package/build-module/spacer/hook.js +2 -2
  641. package/build-module/spacer/hook.js.map +1 -1
  642. package/build-module/spacer/index.js.map +1 -1
  643. package/build-module/spinner/index.js +22 -13
  644. package/build-module/spinner/index.js.map +1 -1
  645. package/build-module/spinner/styles.js +10 -10
  646. package/build-module/spinner/styles.js.map +1 -1
  647. package/build-module/tab-panel/index.js +3 -1
  648. package/build-module/tab-panel/index.js.map +1 -1
  649. package/build-module/text/hook.js +4 -4
  650. package/build-module/text/hook.js.map +1 -1
  651. package/build-module/text/utils.js.map +1 -1
  652. package/build-module/text-highlight/index.js +23 -6
  653. package/build-module/text-highlight/index.js.map +1 -1
  654. package/build-module/text-highlight/types.js +2 -0
  655. package/build-module/text-highlight/types.js.map +1 -0
  656. package/build-module/tip/index.js +6 -10
  657. package/build-module/tip/index.js.map +1 -1
  658. package/build-module/tip/types.js +2 -0
  659. package/build-module/tip/types.js.map +1 -0
  660. package/build-module/toggle-control/index.js +1 -2
  661. package/build-module/toggle-control/index.js.map +1 -1
  662. package/build-module/toggle-control/index.native.js +1 -6
  663. package/build-module/toggle-control/index.native.js.map +1 -1
  664. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  665. package/build-module/toolbar/index.js.map +1 -1
  666. package/build-module/toolbar-group/index.js +3 -2
  667. package/build-module/toolbar-group/index.js.map +1 -1
  668. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  669. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  670. package/build-module/tooltip/index.js +2 -1
  671. package/build-module/tooltip/index.js.map +1 -1
  672. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  673. package/build-module/tree-select/index.js +56 -6
  674. package/build-module/tree-select/index.js.map +1 -1
  675. package/build-module/tree-select/types.js +2 -0
  676. package/build-module/tree-select/types.js.map +1 -0
  677. package/build-module/truncate/component.js +7 -8
  678. package/build-module/truncate/component.js.map +1 -1
  679. package/build-module/truncate/hook.js +3 -10
  680. package/build-module/truncate/hook.js.map +1 -1
  681. package/build-module/truncate/index.js.map +1 -1
  682. package/build-module/truncate/styles.js +1 -1
  683. package/build-module/truncate/styles.js.map +1 -1
  684. package/build-module/truncate/utils.js +3 -16
  685. package/build-module/truncate/utils.js.map +1 -1
  686. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  687. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  688. package/build-module/unit-control/index.js.map +1 -1
  689. package/build-module/utils/math.js +15 -6
  690. package/build-module/utils/math.js.map +1 -1
  691. package/build-module/utils/unit-values.js.map +1 -1
  692. package/build-module/utils/values.js.map +1 -1
  693. package/build-module/v-stack/component.js +9 -9
  694. package/build-module/v-stack/component.js.map +1 -1
  695. package/build-module/v-stack/hook.js +0 -5
  696. package/build-module/v-stack/hook.js.map +1 -1
  697. package/build-module/v-stack/index.js.map +1 -1
  698. package/build-module/visually-hidden/component.js +12 -13
  699. package/build-module/visually-hidden/component.js.map +1 -1
  700. package/build-module/visually-hidden/index.js.map +1 -1
  701. package/build-module/visually-hidden/styles.js +3 -1
  702. package/build-module/visually-hidden/styles.js.map +1 -1
  703. package/build-module/visually-hidden/types.js +2 -0
  704. package/build-module/visually-hidden/types.js.map +1 -0
  705. package/build-module/z-stack/component.js +21 -2
  706. package/build-module/z-stack/component.js.map +1 -1
  707. package/build-module/z-stack/types.js +2 -0
  708. package/build-module/z-stack/types.js.map +1 -0
  709. package/build-style/style-rtl.css +61 -22
  710. package/build-style/style.css +61 -23
  711. package/build-types/base-control/stories/index.d.ts.map +1 -1
  712. package/build-types/base-field/hook.d.ts +0 -1
  713. package/build-types/base-field/hook.d.ts.map +1 -1
  714. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  715. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  716. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  717. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  718. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
  719. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  720. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  721. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
  722. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  723. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
  724. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  725. package/build-types/border-box-control/utils.d.ts.map +1 -1
  726. package/build-types/border-control/border-control/component.d.ts +36 -2
  727. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  728. package/build-types/border-control/border-control/hook.d.ts +1 -2
  729. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  730. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  731. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  732. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
  733. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  734. package/build-types/border-control/stories/index.d.ts +33 -0
  735. package/build-types/border-control/stories/index.d.ts.map +1 -0
  736. package/build-types/button-group/index.d.ts +1 -1
  737. package/build-types/button-group/index.d.ts.map +1 -1
  738. package/build-types/card/card/hook.d.ts +0 -1
  739. package/build-types/card/card/hook.d.ts.map +1 -1
  740. package/build-types/card/card-body/hook.d.ts +0 -1
  741. package/build-types/card/card-body/hook.d.ts.map +1 -1
  742. package/build-types/card/card-divider/hook.d.ts +0 -1
  743. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  744. package/build-types/card/card-footer/hook.d.ts +0 -1
  745. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  746. package/build-types/card/card-header/hook.d.ts +0 -1
  747. package/build-types/card/card-header/hook.d.ts.map +1 -1
  748. package/build-types/card/card-media/hook.d.ts +0 -1
  749. package/build-types/card/card-media/hook.d.ts.map +1 -1
  750. package/build-types/checkbox-control/index.d.ts.map +1 -1
  751. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  752. package/build-types/color-indicator/index.d.ts +16 -5
  753. package/build-types/color-indicator/index.d.ts.map +1 -1
  754. package/build-types/color-indicator/stories/index.d.ts +12 -0
  755. package/build-types/color-indicator/stories/index.d.ts.map +1 -0
  756. package/build-types/color-indicator/test/index.d.ts +2 -0
  757. package/build-types/color-indicator/test/index.d.ts.map +1 -0
  758. package/build-types/color-indicator/types.d.ts +12 -0
  759. package/build-types/color-indicator/types.d.ts.map +1 -0
  760. package/build-types/color-palette/index.d.ts.map +1 -1
  761. package/build-types/color-palette/styles.d.ts +4 -2
  762. package/build-types/color-palette/styles.d.ts.map +1 -1
  763. package/build-types/color-picker/component.d.ts.map +1 -1
  764. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  765. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  766. package/build-types/color-picker/styles.d.ts +48 -32
  767. package/build-types/color-picker/styles.d.ts.map +1 -1
  768. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  769. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  770. package/build-types/date-time/date/index.d.ts +1 -1
  771. package/build-types/date-time/date/index.d.ts.map +1 -1
  772. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  773. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  774. package/build-types/date-time/stories/date.d.ts.map +1 -1
  775. package/build-types/date-time/time/styles.d.ts +1 -1
  776. package/build-types/date-time/types.d.ts +6 -0
  777. package/build-types/date-time/types.d.ts.map +1 -1
  778. package/build-types/divider/styles.d.ts.map +1 -1
  779. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  780. package/build-types/elevation/hook.d.ts +0 -1
  781. package/build-types/elevation/hook.d.ts.map +1 -1
  782. package/build-types/external-link/index.d.ts +17 -0
  783. package/build-types/external-link/index.d.ts.map +1 -0
  784. package/build-types/external-link/stories/index.d.ts +12 -0
  785. package/build-types/external-link/stories/index.d.ts.map +1 -0
  786. package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
  787. package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
  788. package/build-types/external-link/types.d.ts +15 -0
  789. package/build-types/external-link/types.d.ts.map +1 -0
  790. package/build-types/flex/flex/hook.d.ts +0 -1
  791. package/build-types/flex/flex/hook.d.ts.map +1 -1
  792. package/build-types/flex/flex-block/hook.d.ts +0 -1
  793. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  794. package/build-types/flex/flex-item/hook.d.ts +0 -1
  795. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  796. package/build-types/form-toggle/index.d.ts +29 -0
  797. package/build-types/form-toggle/index.d.ts.map +1 -0
  798. package/build-types/form-toggle/stories/index.d.ts +12 -0
  799. package/build-types/form-toggle/stories/index.d.ts.map +1 -0
  800. package/build-types/form-toggle/test/index.d.ts +2 -0
  801. package/build-types/form-toggle/test/index.d.ts.map +1 -0
  802. package/build-types/form-toggle/types.d.ts +22 -0
  803. package/build-types/form-toggle/types.d.ts.map +1 -0
  804. package/build-types/form-token-field/index.d.ts +15 -0
  805. package/build-types/form-token-field/index.d.ts.map +1 -0
  806. package/build-types/form-token-field/stories/index.d.ts +13 -0
  807. package/build-types/form-token-field/stories/index.d.ts.map +1 -0
  808. package/build-types/form-token-field/styles.d.ts +14 -0
  809. package/build-types/form-token-field/styles.d.ts.map +1 -0
  810. package/build-types/form-token-field/suggestions-list.d.ts +10 -0
  811. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
  812. package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
  813. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
  814. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
  815. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
  816. package/build-types/form-token-field/token-input.d.ts +12 -0
  817. package/build-types/form-token-field/token-input.d.ts.map +1 -0
  818. package/build-types/form-token-field/token.d.ts +4 -0
  819. package/build-types/form-token-field/token.d.ts.map +1 -0
  820. package/build-types/form-token-field/types.d.ts +183 -0
  821. package/build-types/form-token-field/types.d.ts.map +1 -0
  822. package/build-types/grid/component.d.ts +3 -3
  823. package/build-types/grid/component.d.ts.map +1 -1
  824. package/build-types/grid/hook.d.ts +5 -3
  825. package/build-types/grid/hook.d.ts.map +1 -1
  826. package/build-types/grid/index.d.ts +2 -2
  827. package/build-types/grid/index.d.ts.map +1 -1
  828. package/build-types/grid/stories/index.d.ts +9 -0
  829. package/build-types/grid/stories/index.d.ts.map +1 -0
  830. package/build-types/grid/test/grid.d.ts +2 -0
  831. package/build-types/grid/test/grid.d.ts.map +1 -0
  832. package/build-types/grid/types.d.ts +16 -15
  833. package/build-types/grid/types.d.ts.map +1 -1
  834. package/build-types/grid/utils.d.ts +50 -69
  835. package/build-types/grid/utils.d.ts.map +1 -1
  836. package/build-types/h-stack/component.d.ts +3 -2
  837. package/build-types/h-stack/component.d.ts.map +1 -1
  838. package/build-types/h-stack/hook.d.ts +5 -4
  839. package/build-types/h-stack/hook.d.ts.map +1 -1
  840. package/build-types/h-stack/index.d.ts +2 -2
  841. package/build-types/h-stack/index.d.ts.map +1 -1
  842. package/build-types/h-stack/stories/index.d.ts +9 -0
  843. package/build-types/h-stack/stories/index.d.ts.map +1 -0
  844. package/build-types/h-stack/test/index.d.ts +2 -0
  845. package/build-types/h-stack/test/index.d.ts.map +1 -0
  846. package/build-types/h-stack/utils.d.ts +8 -4
  847. package/build-types/h-stack/utils.d.ts.map +1 -1
  848. package/build-types/heading/component.d.ts +1 -2
  849. package/build-types/heading/component.d.ts.map +1 -1
  850. package/build-types/heading/hook.d.ts +1 -29
  851. package/build-types/heading/hook.d.ts.map +1 -1
  852. package/build-types/heading/stories/index.d.ts.map +1 -1
  853. package/build-types/heading/test/index.d.ts +2 -0
  854. package/build-types/heading/test/index.d.ts.map +1 -0
  855. package/build-types/heading/types.d.ts +16 -0
  856. package/build-types/heading/types.d.ts.map +1 -0
  857. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  858. package/build-types/icon/index.d.ts +1 -1
  859. package/build-types/icon/index.d.ts.map +1 -1
  860. package/build-types/input-control/index.d.ts +1 -1
  861. package/build-types/input-control/index.d.ts.map +1 -1
  862. package/build-types/input-control/input-field.d.ts +1 -1
  863. package/build-types/input-control/input-field.d.ts.map +1 -1
  864. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  865. package/build-types/input-control/stories/index.d.ts +5 -5
  866. package/build-types/input-control/stories/index.d.ts.map +1 -1
  867. package/build-types/item-group/item/hook.d.ts +0 -1
  868. package/build-types/item-group/item/hook.d.ts.map +1 -1
  869. package/build-types/item-group/item-group/hook.d.ts +0 -1
  870. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  871. package/build-types/menu-item/index.d.ts.map +1 -1
  872. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
  873. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  874. package/build-types/navigator/navigator-button/hook.d.ts +0 -1
  875. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  876. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  877. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  878. package/build-types/popover/index.d.ts.map +1 -1
  879. package/build-types/radio-control/index.d.ts +31 -0
  880. package/build-types/radio-control/index.d.ts.map +1 -0
  881. package/build-types/radio-control/stories/index.d.ts +12 -0
  882. package/build-types/radio-control/stories/index.d.ts.map +1 -0
  883. package/build-types/radio-control/types.d.ts +29 -0
  884. package/build-types/radio-control/types.d.ts.map +1 -0
  885. package/build-types/range-control/index.d.ts +54 -29
  886. package/build-types/range-control/index.d.ts.map +1 -1
  887. package/build-types/range-control/input-range.d.ts +7 -10
  888. package/build-types/range-control/input-range.d.ts.map +1 -1
  889. package/build-types/range-control/mark.d.ts +4 -7
  890. package/build-types/range-control/mark.d.ts.map +1 -1
  891. package/build-types/range-control/rail.d.ts +4 -9
  892. package/build-types/range-control/rail.d.ts.map +1 -1
  893. package/build-types/range-control/stories/index.d.ts +48 -0
  894. package/build-types/range-control/stories/index.d.ts.map +1 -0
  895. package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
  896. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  897. package/build-types/range-control/test/index.d.ts +2 -0
  898. package/build-types/range-control/test/index.d.ts.map +1 -0
  899. package/build-types/range-control/tooltip.d.ts +4 -11
  900. package/build-types/range-control/tooltip.d.ts.map +1 -1
  901. package/build-types/range-control/types.d.ts +302 -0
  902. package/build-types/range-control/types.d.ts.map +1 -0
  903. package/build-types/range-control/utils.d.ts +15 -33
  904. package/build-types/range-control/utils.d.ts.map +1 -1
  905. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  906. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  907. package/build-types/scrollable/component.d.ts +3 -3
  908. package/build-types/scrollable/component.d.ts.map +1 -1
  909. package/build-types/scrollable/hook.d.ts +5 -3
  910. package/build-types/scrollable/hook.d.ts.map +1 -1
  911. package/build-types/scrollable/index.d.ts +2 -2
  912. package/build-types/scrollable/index.d.ts.map +1 -1
  913. package/build-types/scrollable/stories/index.d.ts +9 -0
  914. package/build-types/scrollable/stories/index.d.ts.map +1 -0
  915. package/build-types/scrollable/styles.d.ts +7 -7
  916. package/build-types/scrollable/styles.d.ts.map +1 -1
  917. package/build-types/scrollable/test/index.d.ts +2 -0
  918. package/build-types/scrollable/test/index.d.ts.map +1 -0
  919. package/build-types/scrollable/types.d.ts +9 -6
  920. package/build-types/scrollable/types.d.ts.map +1 -1
  921. package/build-types/select-control/index.d.ts +1 -1
  922. package/build-types/select-control/index.d.ts.map +1 -1
  923. package/build-types/select-control/stories/index.d.ts +3 -3
  924. package/build-types/select-control/stories/index.d.ts.map +1 -1
  925. package/build-types/shortcut/index.d.ts.map +1 -1
  926. package/build-types/slot-fill/fill.d.ts.map +1 -1
  927. package/build-types/slot-fill/provider.d.ts.map +1 -1
  928. package/build-types/slot-fill/slot.d.ts.map +1 -1
  929. package/build-types/spacer/component.d.ts +3 -4
  930. package/build-types/spacer/component.d.ts.map +1 -1
  931. package/build-types/spacer/hook.d.ts +2 -3
  932. package/build-types/spacer/hook.d.ts.map +1 -1
  933. package/build-types/spacer/index.d.ts +1 -1
  934. package/build-types/spacer/index.d.ts.map +1 -1
  935. package/build-types/spacer/stories/index.d.ts +12 -0
  936. package/build-types/spacer/stories/index.d.ts.map +1 -0
  937. package/build-types/spacer/test/index.d.ts +2 -0
  938. package/build-types/spacer/test/index.d.ts.map +1 -0
  939. package/build-types/spacer/types.d.ts +41 -29
  940. package/build-types/spacer/types.d.ts.map +1 -1
  941. package/build-types/spinner/index.d.ts +16 -15
  942. package/build-types/spinner/index.d.ts.map +1 -1
  943. package/build-types/spinner/stories/index.d.ts +13 -0
  944. package/build-types/spinner/stories/index.d.ts.map +1 -0
  945. package/build-types/spinner/styles.d.ts +4 -3
  946. package/build-types/spinner/styles.d.ts.map +1 -1
  947. package/build-types/surface/hook.d.ts +0 -1
  948. package/build-types/surface/hook.d.ts.map +1 -1
  949. package/build-types/text/hook.d.ts +0 -1
  950. package/build-types/text/hook.d.ts.map +1 -1
  951. package/build-types/text/types.d.ts +1 -1
  952. package/build-types/text/types.d.ts.map +1 -1
  953. package/build-types/text/utils.d.ts.map +1 -1
  954. package/build-types/text-control/index.d.ts +1 -1
  955. package/build-types/text-control/index.d.ts.map +1 -1
  956. package/build-types/text-control/stories/index.d.ts.map +1 -1
  957. package/build-types/text-highlight/index.d.ts +23 -0
  958. package/build-types/text-highlight/index.d.ts.map +1 -0
  959. package/build-types/text-highlight/stories/index.d.ts +12 -0
  960. package/build-types/text-highlight/stories/index.d.ts.map +1 -0
  961. package/build-types/text-highlight/test/index.d.ts +2 -0
  962. package/build-types/text-highlight/test/index.d.ts.map +1 -0
  963. package/build-types/text-highlight/types.d.ts +17 -0
  964. package/build-types/text-highlight/types.d.ts.map +1 -0
  965. package/build-types/tip/index.d.ts +5 -14
  966. package/build-types/tip/index.d.ts.map +1 -1
  967. package/build-types/tip/stories/index.d.ts +12 -0
  968. package/build-types/tip/stories/index.d.ts.map +1 -0
  969. package/build-types/tip/types.d.ts +11 -0
  970. package/build-types/tip/types.d.ts.map +1 -0
  971. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  972. package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
  973. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  974. package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
  975. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  976. package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
  977. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  978. package/build-types/tooltip/index.d.ts.map +1 -1
  979. package/build-types/tree-select/index.d.ts +53 -0
  980. package/build-types/tree-select/index.d.ts.map +1 -0
  981. package/build-types/tree-select/stories/index.d.ts +12 -0
  982. package/build-types/tree-select/stories/index.d.ts.map +1 -0
  983. package/build-types/tree-select/types.d.ts +30 -0
  984. package/build-types/tree-select/types.d.ts.map +1 -0
  985. package/build-types/truncate/component.d.ts +3 -3
  986. package/build-types/truncate/component.d.ts.map +1 -1
  987. package/build-types/truncate/hook.d.ts +5 -3
  988. package/build-types/truncate/hook.d.ts.map +1 -1
  989. package/build-types/truncate/index.d.ts +2 -2
  990. package/build-types/truncate/index.d.ts.map +1 -1
  991. package/build-types/truncate/stories/index.d.ts +13 -0
  992. package/build-types/truncate/stories/index.d.ts.map +1 -0
  993. package/build-types/truncate/styles.d.ts +1 -1
  994. package/build-types/truncate/styles.d.ts.map +1 -1
  995. package/build-types/truncate/test/index.d.ts +2 -0
  996. package/build-types/truncate/test/index.d.ts.map +1 -0
  997. package/build-types/truncate/types.d.ts +22 -11
  998. package/build-types/truncate/types.d.ts.map +1 -1
  999. package/build-types/truncate/utils.d.ts +17 -28
  1000. package/build-types/truncate/utils.d.ts.map +1 -1
  1001. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  1002. package/build-types/ui/control-group/hook.d.ts +0 -1
  1003. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  1004. package/build-types/ui/control-label/hook.d.ts +0 -1
  1005. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  1006. package/build-types/ui/form-group/form-group.d.ts +1 -1
  1007. package/build-types/ui/form-group/types.d.ts +1 -1
  1008. package/build-types/ui/form-group/types.d.ts.map +1 -1
  1009. package/build-types/ui/form-group/use-form-group.d.ts +5 -7
  1010. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  1011. package/build-types/ui/utils/get-valid-children.d.ts +2 -2
  1012. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  1013. package/build-types/unit-control/index.d.ts +1 -1
  1014. package/build-types/unit-control/index.d.ts.map +1 -1
  1015. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  1016. package/build-types/utils/math.d.ts +10 -0
  1017. package/build-types/utils/math.d.ts.map +1 -1
  1018. package/build-types/utils/unit-values.d.ts.map +1 -1
  1019. package/build-types/utils/values.d.ts.map +1 -1
  1020. package/build-types/v-stack/component.d.ts +5 -4
  1021. package/build-types/v-stack/component.d.ts.map +1 -1
  1022. package/build-types/v-stack/hook.d.ts +5 -4
  1023. package/build-types/v-stack/hook.d.ts.map +1 -1
  1024. package/build-types/v-stack/index.d.ts +2 -2
  1025. package/build-types/v-stack/index.d.ts.map +1 -1
  1026. package/build-types/v-stack/stories/index.d.ts +9 -0
  1027. package/build-types/v-stack/stories/index.d.ts.map +1 -0
  1028. package/build-types/v-stack/test/index.d.ts +2 -0
  1029. package/build-types/v-stack/test/index.d.ts.map +1 -0
  1030. package/build-types/v-stack/types.d.ts +21 -1
  1031. package/build-types/v-stack/types.d.ts.map +1 -1
  1032. package/build-types/visually-hidden/component.d.ts +8 -10
  1033. package/build-types/visually-hidden/component.d.ts.map +1 -1
  1034. package/build-types/visually-hidden/index.d.ts +1 -1
  1035. package/build-types/visually-hidden/index.d.ts.map +1 -1
  1036. package/build-types/visually-hidden/stories/index.d.ts +14 -0
  1037. package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
  1038. package/build-types/visually-hidden/styles.d.ts +5 -2
  1039. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  1040. package/build-types/visually-hidden/test/index.d.ts +2 -0
  1041. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  1042. package/build-types/visually-hidden/types.d.ts +11 -0
  1043. package/build-types/visually-hidden/types.d.ts.map +1 -0
  1044. package/build-types/z-stack/component.d.ts +18 -28
  1045. package/build-types/z-stack/component.d.ts.map +1 -1
  1046. package/build-types/z-stack/stories/index.d.ts +6 -0
  1047. package/build-types/z-stack/stories/index.d.ts.map +1 -0
  1048. package/build-types/z-stack/types.d.ts +33 -0
  1049. package/build-types/z-stack/types.d.ts.map +1 -0
  1050. package/package.json +18 -17
  1051. package/src/alignment-matrix-control/index.js +2 -1
  1052. package/src/alignment-matrix-control/utils.js +1 -6
  1053. package/src/angle-picker-control/index.js +1 -1
  1054. package/src/autocomplete/autocompleter-ui.js +4 -1
  1055. package/src/autocomplete/autocompleter-ui.native.js +8 -2
  1056. package/src/autocomplete/get-default-use-items.js +3 -2
  1057. package/src/autocomplete/index.js +7 -10
  1058. package/src/base-control/stories/index.tsx +2 -3
  1059. package/src/border-box-control/border-box-control/component.tsx +1 -0
  1060. package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
  1061. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  1062. package/src/border-box-control/utils.ts +5 -2
  1063. package/src/border-control/border-control/component.tsx +41 -4
  1064. package/src/border-control/border-control/hook.ts +3 -4
  1065. package/src/border-control/stories/index.tsx +150 -0
  1066. package/src/box-control/all-input-control.js +2 -4
  1067. package/src/box-control/axial-input-controls.js +4 -6
  1068. package/src/box-control/index.js +3 -6
  1069. package/src/box-control/input-controls.js +33 -36
  1070. package/src/box-control/unit-control.js +2 -1
  1071. package/src/box-control/utils.js +4 -4
  1072. package/src/button/README.md +1 -1
  1073. package/src/button/index.native.js +1 -2
  1074. package/src/card/stories/index.js +10 -5
  1075. package/src/checkbox-control/index.tsx +2 -3
  1076. package/src/checkbox-control/stories/index.tsx +2 -3
  1077. package/src/checkbox-control/test/index.tsx +2 -1
  1078. package/src/color-indicator/README.md +7 -9
  1079. package/src/color-indicator/index.tsx +47 -0
  1080. package/src/color-indicator/stories/index.tsx +37 -0
  1081. package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
  1082. package/src/color-indicator/test/{index.js → index.tsx} +4 -4
  1083. package/src/color-indicator/types.ts +12 -0
  1084. package/src/color-palette/index.js +5 -1
  1085. package/src/color-picker/component.tsx +12 -11
  1086. package/src/color-picker/hex-input.tsx +3 -2
  1087. package/src/color-picker/index.native.js +27 -31
  1088. package/src/color-picker/input-with-slider.tsx +4 -2
  1089. package/src/color-picker/styles.ts +20 -6
  1090. package/src/color-picker/use-deprecated-props.ts +24 -43
  1091. package/src/combobox-control/index.js +18 -8
  1092. package/src/combobox-control/stories/index.js +3 -2
  1093. package/src/combobox-control/style.scss +1 -1
  1094. package/src/combobox-control/styles.ts +27 -0
  1095. package/src/confirm-dialog/component.tsx +7 -8
  1096. package/src/custom-gradient-bar/constants.js +2 -2
  1097. package/src/custom-gradient-bar/control-points.js +20 -16
  1098. package/src/custom-gradient-bar/index.js +11 -11
  1099. package/src/custom-gradient-bar/test/utils.js +79 -0
  1100. package/src/custom-gradient-bar/utils.js +6 -18
  1101. package/src/custom-gradient-picker/index.js +4 -11
  1102. package/src/custom-gradient-picker/index.native.js +3 -11
  1103. package/src/custom-gradient-picker/serializer.js +5 -11
  1104. package/src/custom-gradient-picker/style.scss +1 -3
  1105. package/src/custom-gradient-picker/utils.js +4 -3
  1106. package/src/custom-select-control/index.js +2 -1
  1107. package/src/custom-select-control/stories/index.js +1 -2
  1108. package/src/date-time/README.md +7 -0
  1109. package/src/date-time/date/index.tsx +4 -2
  1110. package/src/date-time/date/style.scss +10 -0
  1111. package/src/date-time/date/test/index.tsx +1 -1
  1112. package/src/date-time/date-time/index.tsx +8 -8
  1113. package/src/date-time/stories/date-time.tsx +4 -6
  1114. package/src/date-time/stories/date.tsx +2 -3
  1115. package/src/date-time/time/test/index.tsx +12 -12
  1116. package/src/date-time/types.ts +7 -0
  1117. package/src/dimension-control/README.md +5 -2
  1118. package/src/dimension-control/index.js +1 -2
  1119. package/src/dimension-control/test/index.test.js +7 -7
  1120. package/src/divider/styles.ts +2 -3
  1121. package/src/draggable/index.js +3 -3
  1122. package/src/draggable/index.native.js +12 -4
  1123. package/src/drop-zone/provider.js +1 -2
  1124. package/src/dropdown/index.js +2 -2
  1125. package/src/dropdown-menu/index.js +13 -4
  1126. package/src/dropdown-menu/index.native.js +13 -5
  1127. package/src/duotone-picker/duotone-picker.js +58 -37
  1128. package/src/duotone-picker/style.scss +19 -0
  1129. package/src/elevation/hook.js +11 -11
  1130. package/src/external-link/README.md +18 -0
  1131. package/src/external-link/{index.js → index.tsx} +35 -9
  1132. package/src/external-link/stories/index.tsx +36 -0
  1133. package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
  1134. package/src/external-link/types.ts +15 -0
  1135. package/src/flex/flex/README.md +5 -10
  1136. package/src/flex/flex/hook.js +4 -1
  1137. package/src/flex/flex-item/README.md +1 -1
  1138. package/src/focal-point-picker/controls.js +1 -5
  1139. package/src/focal-point-picker/grid.js +2 -5
  1140. package/src/focal-point-picker/index.js +2 -8
  1141. package/src/focal-point-picker/index.native.js +9 -9
  1142. package/src/focal-point-picker/media.js +2 -5
  1143. package/src/focal-point-picker/tooltip/index.native.js +10 -11
  1144. package/src/font-size-picker/index.js +3 -1
  1145. package/src/form-toggle/README.md +10 -11
  1146. package/src/form-toggle/index.tsx +71 -0
  1147. package/src/form-toggle/stories/index.tsx +52 -0
  1148. package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
  1149. package/src/form-toggle/test/index.tsx +102 -0
  1150. package/src/form-toggle/types.ts +22 -0
  1151. package/src/form-token-field/index.tsx +715 -0
  1152. package/src/form-token-field/stories/index.tsx +103 -0
  1153. package/src/form-token-field/style.scss +4 -8
  1154. package/src/form-token-field/styles.ts +32 -0
  1155. package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +43 -29
  1156. package/src/form-token-field/test/index.js +70 -40
  1157. package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
  1158. package/src/form-token-field/token-input.tsx +76 -0
  1159. package/src/form-token-field/{token.js → token.tsx} +4 -2
  1160. package/src/form-token-field/types.ts +185 -0
  1161. package/src/gradient-picker/index.js +4 -3
  1162. package/src/grid/README.md +33 -19
  1163. package/src/grid/{component.js → component.tsx} +13 -9
  1164. package/src/grid/{hook.js → hook.ts} +5 -5
  1165. package/src/grid/{index.js → index.ts} +0 -0
  1166. package/src/grid/stories/index.tsx +72 -0
  1167. package/src/grid/test/{grid.js → grid.tsx} +4 -4
  1168. package/src/grid/types.ts +16 -17
  1169. package/src/grid/{utils.js → utils.ts} +9 -7
  1170. package/src/guide/style.scss +1 -0
  1171. package/src/h-stack/{component.js → component.tsx} +8 -8
  1172. package/src/h-stack/{hook.js → hook.tsx} +21 -16
  1173. package/src/h-stack/{index.js → index.ts} +0 -0
  1174. package/src/h-stack/stories/index.tsx +92 -0
  1175. package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1176. package/src/h-stack/test/{index.js → index.tsx} +0 -0
  1177. package/src/h-stack/{utils.js → utils.ts} +16 -16
  1178. package/src/heading/README.md +4 -3
  1179. package/src/heading/component.tsx +2 -2
  1180. package/src/heading/hook.ts +6 -46
  1181. package/src/heading/stories/index.tsx +5 -1
  1182. package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1183. package/src/heading/test/index.tsx +68 -0
  1184. package/src/heading/types.ts +29 -0
  1185. package/src/higher-order/navigate-regions/README.md +4 -1
  1186. package/src/higher-order/navigate-regions/index.js +7 -5
  1187. package/src/higher-order/with-filters/test/index.js +43 -36
  1188. package/src/higher-order/with-focus-return/index.js +14 -13
  1189. package/src/higher-order/with-spoken-messages/index.js +8 -7
  1190. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  1191. package/src/icon/index.tsx +3 -3
  1192. package/src/input-control/index.tsx +2 -1
  1193. package/src/input-control/input-field.tsx +2 -1
  1194. package/src/input-control/reducer/reducer.ts +23 -21
  1195. package/src/input-control/test/index.js +106 -31
  1196. package/src/input-control/utils.ts +1 -1
  1197. package/src/item-group/stories/index.js +2 -1
  1198. package/src/menu-item/index.js +1 -2
  1199. package/src/menu-item/test/index.js +2 -1
  1200. package/src/menu-items-choice/index.js +2 -5
  1201. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
  1202. package/src/mobile/bottom-sheet/cell.native.js +2 -3
  1203. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
  1204. package/src/mobile/bottom-sheet/index.native.js +14 -17
  1205. package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
  1206. package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
  1207. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
  1208. package/src/mobile/color-settings/index.native.js +2 -4
  1209. package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
  1210. package/src/mobile/global-styles-context/index.native.js +8 -7
  1211. package/src/mobile/gradient/index.native.js +12 -9
  1212. package/src/mobile/gradient/test/index.native.js +1 -3
  1213. package/src/mobile/html-text-input/index.native.js +2 -3
  1214. package/src/mobile/image/index.native.js +3 -2
  1215. package/src/mobile/inserter-button/index.native.js +2 -6
  1216. package/src/mobile/link-picker/index.native.js +2 -3
  1217. package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
  1218. package/src/mobile/media-edit/index.native.js +2 -3
  1219. package/src/mobile/segmented-control/index.native.js +9 -9
  1220. package/src/mobile/utils/test/index.native.js +3 -12
  1221. package/src/modal/index.js +22 -3
  1222. package/src/modal/stories/index.js +17 -1
  1223. package/src/modal/style.scss +9 -18
  1224. package/src/navigable-container/container.js +3 -2
  1225. package/src/navigable-container/test/menu.js +1 -2
  1226. package/src/navigable-container/test/tabbable.js +1 -2
  1227. package/src/navigation/context.js +2 -5
  1228. package/src/navigation/group/index.js +8 -3
  1229. package/src/navigation/index.js +5 -1
  1230. package/src/navigation/item/base.js +5 -3
  1231. package/src/navigation/item/index.js +2 -1
  1232. package/src/navigation/item/use-navigation-tree-item.js +2 -0
  1233. package/src/navigation/menu/menu-title-search.js +3 -6
  1234. package/src/navigation/menu/search-no-results-found.js +3 -6
  1235. package/src/navigation/stories/controlled-state.js +1 -1
  1236. package/src/navigation/stories/more-examples.js +2 -3
  1237. package/src/navigation/test/index.js +252 -52
  1238. package/src/navigation/use-navigation-tree-nodes.js +11 -10
  1239. package/src/navigation/utils.js +2 -2
  1240. package/src/navigator/navigator-back-button/hook.ts +14 -12
  1241. package/src/navigator/navigator-button/hook.ts +14 -13
  1242. package/src/navigator/navigator-provider/component.tsx +2 -6
  1243. package/src/navigator/navigator-screen/component.tsx +3 -3
  1244. package/src/notice/index.js +2 -1
  1245. package/src/notice/list.js +3 -1
  1246. package/src/number-control/stories/index.js +24 -24
  1247. package/src/panel/body.js +2 -1
  1248. package/src/placeholder/README.md +7 -6
  1249. package/src/placeholder/index.js +27 -10
  1250. package/src/placeholder/style.scss +23 -0
  1251. package/src/popover/README.md +2 -2
  1252. package/src/popover/index.js +7 -4
  1253. package/src/radio-control/README.md +17 -23
  1254. package/src/radio-control/index.tsx +107 -0
  1255. package/src/radio-control/stories/index.tsx +72 -0
  1256. package/src/radio-control/types.ts +32 -0
  1257. package/src/range-control/README.md +107 -79
  1258. package/src/range-control/{index.js → index.tsx} +81 -49
  1259. package/src/range-control/{input-range.js → input-range.tsx} +13 -12
  1260. package/src/range-control/{mark.js → mark.tsx} +15 -9
  1261. package/src/range-control/{rail.js → rail.tsx} +40 -23
  1262. package/src/range-control/stories/index.tsx +244 -0
  1263. package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
  1264. package/src/range-control/test/index.tsx +311 -0
  1265. package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
  1266. package/src/range-control/types.ts +326 -0
  1267. package/src/range-control/utils.ts +132 -0
  1268. package/src/resizable-box/resize-tooltip/index.tsx +2 -1
  1269. package/src/resizable-box/resize-tooltip/utils.ts +3 -8
  1270. package/src/responsive-wrapper/index.js +2 -4
  1271. package/src/sandbox/test/index.js +4 -6
  1272. package/src/scrollable/README.md +14 -8
  1273. package/src/scrollable/{component.js → component.tsx} +13 -10
  1274. package/src/scrollable/{hook.js → hook.ts} +5 -7
  1275. package/src/scrollable/{index.js → index.ts} +0 -0
  1276. package/src/scrollable/stories/{index.js → index.tsx} +29 -34
  1277. package/src/scrollable/{styles.js → styles.ts} +0 -0
  1278. package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1279. package/src/scrollable/test/index.tsx +34 -0
  1280. package/src/scrollable/types.ts +10 -5
  1281. package/src/select-control/index.tsx +3 -1
  1282. package/src/select-control/stories/index.tsx +3 -4
  1283. package/src/select-control/test/select-control.tsx +22 -15
  1284. package/src/shortcut/index.js +2 -7
  1285. package/src/slot-fill/fill.js +1 -5
  1286. package/src/slot-fill/index.native.js +2 -7
  1287. package/src/slot-fill/provider.js +3 -7
  1288. package/src/slot-fill/slot.js +31 -24
  1289. package/src/slot-fill/test/slot.js +2 -3
  1290. package/src/snackbar/index.js +1 -1
  1291. package/src/snackbar/list.js +2 -1
  1292. package/src/spacer/README.md +43 -37
  1293. package/src/spacer/component.tsx +5 -6
  1294. package/src/spacer/hook.ts +4 -2
  1295. package/src/spacer/index.ts +1 -1
  1296. package/src/spacer/stories/index.tsx +70 -0
  1297. package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1298. package/src/spacer/test/index.tsx +149 -0
  1299. package/src/spacer/types.ts +41 -29
  1300. package/src/spinner/{index.js → index.tsx} +23 -9
  1301. package/src/spinner/stories/index.tsx +32 -0
  1302. package/src/spinner/{styles.js → styles.ts} +0 -0
  1303. package/src/style.scss +1 -0
  1304. package/src/tab-panel/README.md +1 -1
  1305. package/src/tab-panel/index.js +3 -1
  1306. package/src/text/hook.js +4 -1
  1307. package/src/text/types.ts +1 -1
  1308. package/src/text/utils.js +2 -3
  1309. package/src/text-control/stories/index.tsx +4 -6
  1310. package/src/text-highlight/README.md +6 -6
  1311. package/src/text-highlight/index.tsx +49 -0
  1312. package/src/text-highlight/stories/index.tsx +33 -0
  1313. package/src/text-highlight/test/index.tsx +93 -0
  1314. package/src/text-highlight/types.ts +16 -0
  1315. package/src/tip/index.tsx +22 -0
  1316. package/src/tip/stories/index.tsx +33 -0
  1317. package/src/tip/types.ts +11 -0
  1318. package/src/toggle-control/index.js +1 -2
  1319. package/src/toggle-control/index.native.js +2 -6
  1320. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
  1321. package/src/toolbar/index.js +1 -2
  1322. package/src/toolbar-group/index.js +1 -2
  1323. package/src/tools-panel/tools-panel/hook.ts +2 -4
  1324. package/src/tools-panel/tools-panel-header/hook.ts +2 -5
  1325. package/src/tooltip/index.js +1 -0
  1326. package/src/tree-grid/roving-tab-index-item.js +2 -4
  1327. package/src/tree-grid/test/index.js +2 -3
  1328. package/src/tree-select/README.md +2 -2
  1329. package/src/tree-select/index.tsx +99 -0
  1330. package/src/tree-select/stories/index.tsx +80 -0
  1331. package/src/tree-select/types.ts +35 -0
  1332. package/src/truncate/README.md +16 -12
  1333. package/src/truncate/{component.js → component.tsx} +13 -9
  1334. package/src/truncate/{hook.js → hook.ts} +8 -10
  1335. package/src/truncate/{index.js → index.ts} +0 -0
  1336. package/src/truncate/stories/index.tsx +49 -0
  1337. package/src/truncate/{styles.js → styles.ts} +0 -0
  1338. package/src/truncate/test/{index.js → index.tsx} +4 -4
  1339. package/src/truncate/types.ts +28 -10
  1340. package/src/truncate/{utils.js → utils.ts} +19 -19
  1341. package/src/ui/context/wordpress-component.ts +4 -5
  1342. package/src/ui/form-group/form-group-content.js +4 -4
  1343. package/src/ui/form-group/types.ts +1 -1
  1344. package/src/ui/utils/get-valid-children.ts +4 -2
  1345. package/src/unit-control/index.tsx +7 -9
  1346. package/src/unit-control/stories/index.tsx +8 -12
  1347. package/src/unit-control/test/index.tsx +4 -7
  1348. package/src/utils/hooks/stories/use-cx.js +8 -7
  1349. package/src/utils/hooks/test/use-controlled-state.js +2 -1
  1350. package/src/utils/math.js +14 -5
  1351. package/src/utils/test/math.js +22 -1
  1352. package/src/utils/unit-values.ts +2 -1
  1353. package/src/utils/values.js +2 -3
  1354. package/src/v-stack/README.md +6 -18
  1355. package/src/v-stack/{component.js → component.tsx} +15 -10
  1356. package/src/v-stack/{hook.js → hook.ts} +5 -6
  1357. package/src/v-stack/{index.js → index.ts} +0 -0
  1358. package/src/v-stack/stories/index.tsx +41 -0
  1359. package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1360. package/src/v-stack/test/{index.js → index.tsx} +0 -0
  1361. package/src/v-stack/types.ts +21 -1
  1362. package/src/visually-hidden/{component.js → component.tsx} +23 -15
  1363. package/src/visually-hidden/{index.js → index.ts} +0 -0
  1364. package/src/visually-hidden/stories/index.tsx +66 -0
  1365. package/src/visually-hidden/{styles.js → styles.ts} +6 -2
  1366. package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1367. package/src/visually-hidden/test/index.tsx +17 -0
  1368. package/src/visually-hidden/types.ts +11 -0
  1369. package/src/z-stack/README.md +14 -3
  1370. package/src/z-stack/component.tsx +24 -29
  1371. package/src/z-stack/stories/index.tsx +76 -0
  1372. package/src/z-stack/types.ts +33 -0
  1373. package/tsconfig.json +7 -0
  1374. package/tsconfig.tsbuildinfo +1 -1
  1375. package/src/border-control/stories/index.js +0 -119
  1376. package/src/color-indicator/index.js +0 -16
  1377. package/src/color-indicator/stories/index.js +0 -22
  1378. package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
  1379. package/src/external-link/stories/index.js +0 -23
  1380. package/src/form-toggle/index.js +0 -37
  1381. package/src/form-toggle/stories/index.js +0 -28
  1382. package/src/form-toggle/test/index.js +0 -75
  1383. package/src/form-token-field/index.js +0 -725
  1384. package/src/form-token-field/stories/index.js +0 -102
  1385. package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
  1386. package/src/form-token-field/token-input.js +0 -81
  1387. package/src/grid/stories/index.js +0 -49
  1388. package/src/h-stack/stories/index.js +0 -22
  1389. package/src/heading/test/index.js +0 -67
  1390. package/src/radio-control/index.js +0 -69
  1391. package/src/radio-control/stories/index.js +0 -41
  1392. package/src/range-control/stories/index.js +0 -180
  1393. package/src/range-control/test/index.js +0 -320
  1394. package/src/range-control/utils.js +0 -132
  1395. package/src/scrollable/test/index.js +0 -31
  1396. package/src/spacer/stories/index.js +0 -59
  1397. package/src/spacer/test/index.js +0 -146
  1398. package/src/spinner/stories/index.js +0 -43
  1399. package/src/text-highlight/index.js +0 -28
  1400. package/src/text-highlight/stories/index.js +0 -28
  1401. package/src/text-highlight/test/index.js +0 -120
  1402. package/src/tip/index.js +0 -24
  1403. package/src/tip/stories/index.js +0 -26
  1404. package/src/tree-select/index.js +0 -48
  1405. package/src/tree-select/stories/index.js +0 -80
  1406. package/src/truncate/stories/index.js +0 -38
  1407. package/src/visually-hidden/stories/index.js +0 -42
  1408. package/src/visually-hidden/test/index.js +0 -19
  1409. package/src/z-stack/stories/index.js +0 -70
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/index.tsx"],"names":["noop","classNames","useInstanceId","useState","forwardRef","InputBase","InputField","useDraft","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","ref","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","suffix","value","props","isFocused","setIsFocused","classes","draftHookProps","onBlur"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,SAASC,QAAT,QAAyB,SAAzB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAGR,aAAa,CAAES,YAAF,CAAhC;AACA,QAAMC,EAAE,GAAI,2BAA2BF,UAAY,EAAnD;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA;;AAED,OAAO,SAASC,uBAAT,OAoBNC,GApBM,EAqBL;AAAA,MApBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,oBAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,QAAQ,GAAG,KAJZ;AAKCC,IAAAA,mBAAmB,GAAG,KALvB;AAMCT,IAAAA,EAAE,EAAEH,MANL;AAOCa,IAAAA,oBAAoB,GAAG,KAPxB;AAQCC,IAAAA,KARD;AASCC,IAAAA,aAAa,GAAG,KATjB;AAUCC,IAAAA,QAAQ,GAAGzB,IAVZ;AAWC0B,IAAAA,UAAU,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GZ,GATP;AAUC,IAAA,YAAY,EAAGoB,YAVhB;AAWC,IAAA,IAAI,EAAGL,IAXR;AAYC,IAAA,YAAY,EAAGb;AAZhB,KAaMoB,cAbN,EAfD,CADD;AAiCA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMzB,YAAY,GAAGP,UAAU,CAAES,uBAAF,CAA/B;AAEP,eAAeF,YAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\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 { useDraft } from './utils';\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__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\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__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\tsuffix={ suffix }\n\t\t>\n\t\t\t<InputField\n\t\t\t\t{ ...props }\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\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":["classNames","useInstanceId","useState","forwardRef","InputBase","InputField","useDraft","noop","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","ref","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","suffix","value","props","isFocused","setIsFocused","classes","draftHookProps","onBlur"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,SAASC,QAAT,QAAyB,SAAzB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAGT,aAAa,CAAEU,YAAF,CAAhC;AACA,QAAMC,EAAE,GAAI,2BAA2BF,UAAY,EAAnD;AAEA,SAAOD,MAAM,IAAIG,EAAjB;AACA;;AAED,OAAO,SAASC,uBAAT,OAoBNC,GApBM,EAqBL;AAAA,MApBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,oBAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,QAAQ,GAAG,KAJZ;AAKCC,IAAAA,mBAAmB,GAAG,KALvB;AAMCT,IAAAA,EAAE,EAAEH,MANL;AAOCa,IAAAA,oBAAoB,GAAG,KAPxB;AAQCC,IAAAA,KARD;AASCC,IAAAA,aAAa,GAAG,KATjB;AAUCC,IAAAA,QAAQ,GAAGlB,IAVZ;AAWCmB,IAAAA,UAAU,GAAGnB,IAXd;AAYCoB,IAAAA,SAAS,GAAGpB,IAZb;AAaCqB,IAAAA,MAbD;AAcCC,IAAAA,IAAI,GAAG,SAdR;AAeCC,IAAAA,MAfD;AAgBCC,IAAAA,KAhBD;AAiBC,OAAGC;AAjBJ,GAoBC;AACD,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8BhC,QAAQ,CAAE,KAAF,CAA5C;AAEA,QAA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,GAAGR,UAAU,CAAEU,uBAAF,CAA/B;AAEP,eAAeF,YAAf","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 { 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__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\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__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\tsuffix={ suffix }\n\t\t>\n\t\t\t<InputField\n\t\t\t\t{ ...props }\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\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"]}
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- import { noop } from 'lodash';
8
7
  import { useDrag } from '@use-gesture/react';
9
8
 
10
9
  /**
@@ -19,6 +18,8 @@ import { useDragCursor } from './utils';
19
18
  import { Input } from './styles/input-control-styles';
20
19
  import { useInputControlStateReducer } from './reducer/reducer';
21
20
 
21
+ const noop = () => {};
22
+
22
23
  function InputField(_ref, ref) {
23
24
  let {
24
25
  disabled = false,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/input-field.tsx"],"names":["noop","useDrag","forwardRef","useRef","useDragCursor","Input","useInputControlStateReducer","InputField","ref","disabled","dragDirection","dragThreshold","id","isDragEnabled","isFocused","isPressEnterToChange","onBlur","onChange","onDrag","onDragEnd","onDragStart","onFocus","onKeyDown","onValidate","size","setIsFocused","stateReducer","state","value","valueProp","type","props","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","isDragging","isDirty","wasDirtyOnBlur","dragCursor","handleOnBlur","event","target","validity","valid","current","handleOnCommit","handleOnFocus","handleOnChange","nextValue","currentTarget","err","handleOnKeyDown","key","preventDefault","dragGestureProps","dragProps","distance","dragging","stopPropagation","axis","threshold","enabled","pointer","capture","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","ForwardedComponent"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,OAAT,QAAwB,oBAAxB;;AAWA;AACA;AACA;AACA,SAASC,UAAT,EAAqBC,MAArB,QAAmC,oBAAnC;AACA;AACA;AACA;;AAEA,SAASC,aAAT,QAA8B,SAA9B;AACA,SAASC,KAAT,QAAsB,+BAAtB;AACA,SAASC,2BAAT,QAA4C,mBAA5C;;AAGA,SAASC,UAAT,OAwBCC,GAxBD,EAyBE;AAAA,MAxBD;AACCC,IAAAA,QAAQ,GAAG,KADZ;AAECC,IAAAA,aAAa,GAAG,GAFjB;AAGCC,IAAAA,aAAa,GAAG,EAHjB;AAICC,IAAAA,EAJD;AAKCC,IAAAA,aAAa,GAAG,KALjB;AAMCC,IAAAA,SAND;AAOCC,IAAAA,oBAAoB,GAAG,KAPxB;AAQCC,IAAAA,MAAM,GAAGhB,IARV;AASCiB,IAAAA,QAAQ,GAAGjB,IATZ;AAUCkB,IAAAA,MAAM,GAAGlB,IAVV;AAWCmB,IAAAA,SAAS,GAAGnB,IAXb;AAYCoB,IAAAA,WAAW,GAAGpB,IAZf;AAaCqB,IAAAA,OAAO,GAAGrB,IAbX;AAcCsB,IAAAA,SAAS,GAAGtB,IAdb;AAeCuB,IAAAA,UAAU,GAAGvB,IAfd;AAgBCwB,IAAAA,IAAI,GAAG,SAhBR;AAiBCC,I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UACCA,KAAK,CAACS,aAAN,KACAT,KAAK,CAACS,aAAN,CAAoBiB,aAApB,CAAkCC,aAFnC,EAGE;AACD3B,QAAAA,KAAK,CAACS,aAAN,CAAoBmB,KAApB;AACA;AACD,KARD;AASA;;AAED,SACC,cAAC,KAAD,eACM5C,KADN,EAEM+B,SAFN;AAGC,IAAA,SAAS,EAAC,iCAHX;AAIC,IAAA,QAAQ,EAAGrD,QAJZ;AAKC,IAAA,UAAU,EAAGoC,UALd;AAMC,IAAA,UAAU,EAAGH,UANd;AAOC,IAAA,EAAE,EAAG9B,EAPN;AAQC,IAAA,MAAM,EAAGkC,YARV;AASC,IAAA,QAAQ,EAAGQ,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,SAAS,EAAGK,eAXb;AAYC,IAAA,WAAW,EAAGa,iBAZf;AAaC,IAAA,GAAG,EAAG/D,GAbP;AAcC,IAAA,SAAS,EAAGgB,IAdb;AAeC,IAAA,KAAK,EAAGI,KAfT;AAgBC,IAAA,IAAI,EAAGE;AAhBR,KADD;AAoBA;;AAED,MAAM8C,kBAAkB,GAAG1E,UAAU,CAAEK,UAAF,CAArC;AAEA,eAAeqE,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport { useDrag } from '@use-gesture/react';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tForwardedRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport type { InputFieldProps } from './types';\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisFocused,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonFocus = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tsetIsFocused,\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t// State.\n\t\tstate,\n\t\t// Actions.\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t} = useInputControlStateReducer(\n\t\tstateReducer,\n\t\t{\n\t\t\tisDragEnabled,\n\t\t\tvalue: valueProp,\n\t\t\tisPressEnterToChange,\n\t\t},\n\t\tonChange\n\t);\n\n\tconst { value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused?.( false );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isDirty || ! event.target.validity.valid ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\thandleOnCommit( event );\n\t\t}\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused?.( true );\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( key ) {\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'Escape':\n\t\t\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treset( valueProp, event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event, target } = dragProps;\n\n\t\t\t// The `target` prop always references the `input` element while, by\n\t\t\t// default, the `dragProps.event.target` property would reference the real\n\t\t\t// event target (i.e. any DOM element that the pointer is hovering while\n\t\t\t// dragging). Ensuring that the `target` is always the `input` element\n\t\t\t// allows consumers of `InputControl` (or any higher-level control) to\n\t\t\t// check the input's validity by accessing `event.target.validity.valid`.\n\t\t\tdragProps.event = {\n\t\t\t\t...dragProps.event,\n\t\t\t\ttarget,\n\t\t\t};\n\n\t\t\tif ( ! distance ) return;\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\taxis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t\tpointer: { capture: false },\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\tvalue={ value }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/input-field.tsx"],"names":["useDrag","forwardRef","useRef","useDragCursor","Input","useInputControlStateReducer","noop","InputField","ref","disabled","dragDirection","dragThreshold","id","isDragEnabled","isFocused","isPressEnterToChange","onBlur","onChange","onDrag","onDragEnd","onDragStart","onFocus","onKeyDown","onValidate","size","setIsFocused","stateReducer","state","value","valueProp","type","props","change","commit","drag","dragEnd","dragStart","invalidate","pressDown","pressEnter","pressUp","reset","isDragging","isDirty","wasDirtyOnBlur","dragCursor","handleOnBlur","event","target","validity","valid","current","handleOnCommit","handleOnFocus","handleOnChange","nextValue","currentTarget","err","handleOnKeyDown","key","preventDefault","dragGestureProps","dragProps","distance","dragging","stopPropagation","axis","threshold","enabled","pointer","capture","handleOnMouseDown","onMouseDown","ownerDocument","activeElement","focus","ForwardedComponent"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;;AAWA;AACA;AACA;AACA,SAASC,UAAT,EAAqBC,MAArB,QAAmC,oBAAnC;AACA;AACA;AACA;;AAEA,SAASC,aAAT,QAA8B,SAA9B;AACA,SAASC,KAAT,QAAsB,+BAAtB;AACA,SAASC,2BAAT,QAA4C,mBAA5C;;AAGA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,UAAT,OAwBCC,GAxBD,EAyBE;AAAA,MAxBD;AACCC,IAAAA,QAAQ,GAAG,KADZ;AAECC,IAAAA,aAAa,GAAG,GAFjB;AAGCC,IAAAA,aAAa,GAAG,EAHjB;AAICC,IAAAA,EAJD;AAKCC,IAAAA,aAAa,GAAG,KALjB;AAMCC,IAAAA,SAND;AAOCC,IAAAA,oBAAoB,GAAG,KAPxB;AAQCC,IAAAA,MAAM,GAAGV,IARV;AASCW,IAAAA,QAAQ,GAAGX,IATZ;AAUCY,IAAAA,MAAM,GAAGZ,IAVV;AAWCa,IAAAA,SAAS,GAAGb,IAXb;AAYCc,IAAAA,WAAW,GAAGd,IAZf;AAaCe,IAAAA,OAAO,GAAGf,IAbX;AAcCgB,IAAAA,SAAS,GAAGhB,IAdb;AAeCi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E,4BAAAhB,KAAK,CAACyC,WAAN,+EAAAzC,KAAK,EAAgBgB,KAAhB,CAAL;;AACA,UACCA,KAAK,CAACS,aAAN,KACAT,KAAK,CAACS,aAAN,CAAoBiB,aAApB,CAAkCC,aAFnC,EAGE;AACD3B,QAAAA,KAAK,CAACS,aAAN,CAAoBmB,KAApB;AACA;AACD,KARD;AASA;;AAED,SACC,cAAC,KAAD,eACM5C,KADN,EAEM+B,SAFN;AAGC,IAAA,SAAS,EAAC,iCAHX;AAIC,IAAA,QAAQ,EAAGrD,QAJZ;AAKC,IAAA,UAAU,EAAGoC,UALd;AAMC,IAAA,UAAU,EAAGH,UANd;AAOC,IAAA,EAAE,EAAG9B,EAPN;AAQC,IAAA,MAAM,EAAGkC,YARV;AASC,IAAA,QAAQ,EAAGQ,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,SAAS,EAAGK,eAXb;AAYC,IAAA,WAAW,EAAGa,iBAZf;AAaC,IAAA,GAAG,EAAG/D,GAbP;AAcC,IAAA,SAAS,EAAGgB,IAdb;AAeC,IAAA,KAAK,EAAGI,KAfT;AAgBC,IAAA,IAAI,EAAGE;AAhBR,KADD;AAoBA;;AAED,MAAM8C,kBAAkB,GAAG3E,UAAU,CAAEM,UAAF,CAArC;AAEA,eAAeqE,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { useDrag } from '@use-gesture/react';\nimport type {\n\tSyntheticEvent,\n\tChangeEvent,\n\tKeyboardEvent,\n\tPointerEvent,\n\tFocusEvent,\n\tForwardedRef,\n\tMouseEvent,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { useDragCursor } from './utils';\nimport { Input } from './styles/input-control-styles';\nimport { useInputControlStateReducer } from './reducer/reducer';\nimport type { InputFieldProps } from './types';\n\nconst noop = () => {};\n\nfunction InputField(\n\t{\n\t\tdisabled = false,\n\t\tdragDirection = 'n',\n\t\tdragThreshold = 10,\n\t\tid,\n\t\tisDragEnabled = false,\n\t\tisFocused,\n\t\tisPressEnterToChange = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonDrag = noop,\n\t\tonDragEnd = noop,\n\t\tonDragStart = noop,\n\t\tonFocus = noop,\n\t\tonKeyDown = noop,\n\t\tonValidate = noop,\n\t\tsize = 'default',\n\t\tsetIsFocused,\n\t\tstateReducer = ( state: any ) => state,\n\t\tvalue: valueProp,\n\t\ttype,\n\t\t...props\n\t}: WordPressComponentProps< InputFieldProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t// State.\n\t\tstate,\n\t\t// Actions.\n\t\tchange,\n\t\tcommit,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t} = useInputControlStateReducer(\n\t\tstateReducer,\n\t\t{\n\t\t\tisDragEnabled,\n\t\t\tvalue: valueProp,\n\t\t\tisPressEnterToChange,\n\t\t},\n\t\tonChange\n\t);\n\n\tconst { value, isDragging, isDirty } = state;\n\tconst wasDirtyOnBlur = useRef( false );\n\n\tconst dragCursor = useDragCursor( isDragging, dragDirection );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused?.( false );\n\n\t\t/**\n\t\t * If isPressEnterToChange is set, this commits the value to\n\t\t * the onChange callback.\n\t\t */\n\t\tif ( isDirty || ! event.target.validity.valid ) {\n\t\t\twasDirtyOnBlur.current = true;\n\t\t\thandleOnCommit( event );\n\t\t}\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused?.( true );\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.target.value;\n\t\tchange( nextValue, event );\n\t};\n\n\tconst handleOnCommit = ( event: SyntheticEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = event.currentTarget.value;\n\n\t\ttry {\n\t\t\tonValidate( nextValue );\n\t\t\tcommit( nextValue, event );\n\t\t} catch ( err ) {\n\t\t\tinvalidate( err, event );\n\t\t}\n\t};\n\n\tconst handleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\tconst { key } = event;\n\t\tonKeyDown( event );\n\n\t\tswitch ( key ) {\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpressUp( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpressDown( event );\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tpressEnter( event );\n\n\t\t\t\tif ( isPressEnterToChange ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleOnCommit( event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'Escape':\n\t\t\t\tif ( isPressEnterToChange && isDirty ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treset( valueProp, event );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tconst dragGestureProps = useDrag< PointerEvent< HTMLInputElement > >(\n\t\t( dragProps ) => {\n\t\t\tconst { distance, dragging, event, target } = dragProps;\n\n\t\t\t// The `target` prop always references the `input` element while, by\n\t\t\t// default, the `dragProps.event.target` property would reference the real\n\t\t\t// event target (i.e. any DOM element that the pointer is hovering while\n\t\t\t// dragging). Ensuring that the `target` is always the `input` element\n\t\t\t// allows consumers of `InputControl` (or any higher-level control) to\n\t\t\t// check the input's validity by accessing `event.target.validity.valid`.\n\t\t\tdragProps.event = {\n\t\t\t\t...dragProps.event,\n\t\t\t\ttarget,\n\t\t\t};\n\n\t\t\tif ( ! distance ) return;\n\t\t\tevent.stopPropagation();\n\n\t\t\t/**\n\t\t\t * Quick return if no longer dragging.\n\t\t\t * This prevents unnecessary value calculations.\n\t\t\t */\n\t\t\tif ( ! dragging ) {\n\t\t\t\tonDragEnd( dragProps );\n\t\t\t\tdragEnd( dragProps );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonDrag( dragProps );\n\t\t\tdrag( dragProps );\n\n\t\t\tif ( ! isDragging ) {\n\t\t\t\tonDragStart( dragProps );\n\t\t\t\tdragStart( dragProps );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\taxis: dragDirection === 'e' || dragDirection === 'w' ? 'x' : 'y',\n\t\t\tthreshold: dragThreshold,\n\t\t\tenabled: isDragEnabled,\n\t\t\tpointer: { capture: false },\n\t\t}\n\t);\n\n\tconst dragProps = isDragEnabled ? dragGestureProps() : {};\n\t/*\n\t * Works around the odd UA (e.g. Firefox) that does not focus inputs of\n\t * type=number when their spinner arrows are pressed.\n\t */\n\tlet handleOnMouseDown;\n\tif ( type === 'number' ) {\n\t\thandleOnMouseDown = ( event: MouseEvent< HTMLInputElement > ) => {\n\t\t\tprops.onMouseDown?.( event );\n\t\t\tif (\n\t\t\t\tevent.currentTarget !==\n\t\t\t\tevent.currentTarget.ownerDocument.activeElement\n\t\t\t) {\n\t\t\t\tevent.currentTarget.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\t{ ...props }\n\t\t\t{ ...dragProps }\n\t\t\tclassName=\"components-input-control__input\"\n\t\t\tdisabled={ disabled }\n\t\t\tdragCursor={ dragCursor }\n\t\t\tisDragging={ isDragging }\n\t\t\tid={ id }\n\t\t\tonBlur={ handleOnBlur }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonMouseDown={ handleOnMouseDown }\n\t\t\tref={ ref }\n\t\t\tinputSize={ size }\n\t\t\tvalue={ value }\n\t\t\ttype={ type }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputField );\n\nexport default ForwardedComponent;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/reducer/reducer.ts"],"names":["useReducer","useLayoutEffect","useRef","initialInputControlState","initialStateReducer","actions","mergeInitialState","initialState","value","initialValue","inputControlStateReducer","composedStateReducers","state","action","nextState","type","PRESS_UP","isDirty","PRESS_DOWN","DRAG_START","isDragging","DRAG_END","CHANGE","error","payload","isPressEnterToChange","COMMIT","RESET","INVALIDATE","_event","event","useInputControlStateReducer","stateReducer","onChangeHandler","dispatch","createChangeEvent","nextValue","createKeyEvent","createDragEvent","change","invalidate","reset","commit","dragStart","drag","DRAG","dragEnd","pressUp","pressDown","pressEnter","PRESS_ENTER","currentState","refProps","current","undefined"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,eAArB,EAAsCC,MAAtC,QAAoD,oBAApD;AAEA;AACA;AACA;;AACA,SAGCC,wBAHD,EAICC,mBAJD,QAKO,SALP;AAMA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAT,GAEc;AAAA,MADbC,YACa,uEADyBJ,wBACzB;AACb,QAAM;AAAEK,IAAAA;AAAF,MAAYD,YAAlB;AAEA,SAAO,EACN,GAAGJ,wBADG;AAEN,OAAGI,YAFG;AAGNE,IAAAA,YAAY,EAAED;AAHR,GAAP;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,wBAAT,CACCC,qBADD,EAEgB;AACf,SAAO,CAAEC,KAAF,EAASC,MAAT,KAAqB;AAC3B,UAAMC,SAAS,GAAG,EAAE,GAAGF;AAAL,KAAlB;;AAEA,YAASC,MAAM,CAACE,IAAhB;AACC;AACH;AACA;AACG,WAAKV,OAAO,CAACW,QAAb;AACCF,QAAAA,SAAS,CAACG,OAAV,GAAoB,KAApB;AACA;;AAED,WAAKZ,OAAO,CAACa,UAAb;AACCJ,QAAAA,SAAS,CAACG,OAA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D,GAZc,EAYZ,CAAEjB,KAAK,CAACJ,KAAR,EAAeI,KAAK,CAACK,OAArB,CAZY,CAAf;AAaAhB,EAAAA,eAAe,CAAE,MAAM;AACtB,QACCM,YAAY,CAACC,KAAb,KAAuB2C,YAAY,CAACE,OAAb,CAAqB7C,KAA5C,IACA,CAAE2C,YAAY,CAACE,OAAb,CAAqBpC,OAFxB,EAGE;AACDiB,MAAAA,QAAQ,CAAE;AACTnB,QAAAA,IAAI,EAAEV,OAAO,CAACsB,KADL;AAETH,QAAAA,OAAO,EAAE;AAAEhB,UAAAA,KAAK,EAAED,YAAY,CAACC;AAAtB;AAFA,OAAF,CAAR;AAIA;AACD,GAVc,EAUZ,CAAED,YAAY,CAACC,KAAf,CAVY,CAAf;AAYA,SAAO;AACN+B,IAAAA,MADM;AAENG,IAAAA,MAFM;AAGNR,IAAAA,QAHM;AAINU,IAAAA,IAJM;AAKNE,IAAAA,OALM;AAMNH,IAAAA,SANM;AAONH,IAAAA,UAPM;AAQNQ,IAAAA,SARM;AASNC,IAAAA,UATM;AAUNF,IAAAA,OAVM;AAWNN,IAAAA,KAXM;AAYN7B,IAAAA;AAZM,GAAP;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport type { SyntheticEvent, ChangeEvent, PointerEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useReducer, useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tInputState,\n\tStateReducer,\n\tinitialInputControlState,\n\tinitialStateReducer,\n} from './state';\nimport * as actions from './actions';\nimport type { InputChangeCallback } from '../types';\n\n/**\n * Prepares initialState for the reducer.\n *\n * @param initialState The initial state.\n * @return Prepared initialState for the reducer\n */\nfunction mergeInitialState(\n\tinitialState: Partial< InputState > = initialInputControlState\n): InputState {\n\tconst { value } = initialState;\n\n\treturn {\n\t\t...initialInputControlState,\n\t\t...initialState,\n\t\tinitialValue: value,\n\t} as InputState;\n}\n\n/**\n * Creates a reducer that opens the channel for external state subscription\n * and modification.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param composedStateReducers A custom reducer that can subscribe and modify state.\n * @return The reducer.\n */\nfunction inputControlStateReducer(\n\tcomposedStateReducers: StateReducer\n): StateReducer {\n\treturn ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\tswitch ( action.type ) {\n\t\t\t/**\n\t\t\t * Keyboard events\n\t\t\t */\n\t\t\tcase actions.PRESS_UP:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.PRESS_DOWN:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Drag events\n\t\t\t */\n\t\t\tcase actions.DRAG_START:\n\t\t\t\tnextState.isDragging = true;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.DRAG_END:\n\t\t\t\tnextState.isDragging = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Input events\n\t\t\t */\n\t\t\tcase actions.CHANGE:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.value = action.payload.value;\n\n\t\t\t\tif ( state.isPressEnterToChange ) {\n\t\t\t\t\tnextState.isDirty = true;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase actions.COMMIT:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.RESET:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tnextState.value = action.payload.value || state.initialValue;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Validation\n\t\t\t */\n\t\t\tcase actions.INVALIDATE:\n\t\t\t\tnextState.error = action.payload.error;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tnextState._event = action.payload.event;\n\n\t\t/**\n\t\t * Send the nextState + action to the composedReducers via\n\t\t * this \"bridge\" mechanism. This allows external stateReducers\n\t\t * to hook into actions, and modify state if needed.\n\t\t */\n\t\treturn composedStateReducers( nextState, action );\n\t};\n}\n\n/**\n * A custom hook that connects and external stateReducer with an internal\n * reducer. This hook manages the internal state of InputControl.\n * However, by connecting an external stateReducer function, other\n * components can react to actions as well as modify state before it is\n * applied.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param stateReducer An external state reducer.\n * @param initialState The initial state for the reducer.\n * @param onChangeHandler A handler for the onChange event.\n * @return State, dispatch, and a collection of actions.\n */\nexport function useInputControlStateReducer(\n\tstateReducer: StateReducer = initialStateReducer,\n\tinitialState: Partial< InputState > = initialInputControlState,\n\tonChangeHandler: InputChangeCallback\n) {\n\tconst [ state, dispatch ] = useReducer< StateReducer >(\n\t\tinputControlStateReducer( stateReducer ),\n\t\tmergeInitialState( initialState )\n\t);\n\n\tconst createChangeEvent = ( type: actions.ChangeEventAction[ 'type' ] ) => (\n\t\tnextValue: actions.ChangeEventAction[ 'payload' ][ 'value' ],\n\t\tevent: actions.ChangeEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\tdispatch( {\n\t\t\ttype,\n\t\t\tpayload: { value: nextValue, event },\n\t\t} as actions.InputAction );\n\t};\n\n\tconst createKeyEvent = ( type: actions.KeyEventAction[ 'type' ] ) => (\n\t\tevent: actions.KeyEventAction[ 'payload' ][ 'event' ]\n\t) => {\n\t\tdispatch( { type, payload: { event } } );\n\t};\n\n\tconst createDragEvent = ( type: actions.DragEventAction[ 'type' ] ) => (\n\t\tpayload: actions.DragEventAction[ 'payload' ]\n\t) => {\n\t\tdispatch( { type, payload } );\n\t};\n\n\t/**\n\t * Actions for the reducer\n\t */\n\tconst change = createChangeEvent( actions.CHANGE );\n\tconst invalidate = ( error: unknown, event: SyntheticEvent ) =>\n\t\tdispatch( { type: actions.INVALIDATE, payload: { error, event } } );\n\tconst reset = createChangeEvent( actions.RESET );\n\tconst commit = createChangeEvent( actions.COMMIT );\n\n\tconst dragStart = createDragEvent( actions.DRAG_START );\n\tconst drag = createDragEvent( actions.DRAG );\n\tconst dragEnd = createDragEvent( actions.DRAG_END );\n\n\tconst pressUp = createKeyEvent( actions.PRESS_UP );\n\tconst pressDown = createKeyEvent( actions.PRESS_DOWN );\n\tconst pressEnter = createKeyEvent( actions.PRESS_ENTER );\n\n\tconst currentState = useRef( state );\n\tconst refProps = useRef( { value: initialState.value, onChangeHandler } );\n\tuseLayoutEffect( () => {\n\t\tcurrentState.current = state;\n\t\trefProps.current = { value: initialState.value, onChangeHandler };\n\t} );\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\tcurrentState.current._event !== undefined &&\n\t\t\tstate.value !== refProps.current.value &&\n\t\t\t! state.isDirty\n\t\t) {\n\t\t\trefProps.current.onChangeHandler( state.value ?? '', {\n\t\t\t\tevent: currentState.current._event as\n\t\t\t\t\t| ChangeEvent< HTMLInputElement >\n\t\t\t\t\t| PointerEvent< HTMLInputElement >,\n\t\t\t} );\n\t\t}\n\t}, [ state.value, state.isDirty ] );\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\tinitialState.value !== currentState.current.value &&\n\t\t\t! currentState.current.isDirty\n\t\t) {\n\t\t\tdispatch( {\n\t\t\t\ttype: actions.RESET,\n\t\t\t\tpayload: { value: initialState.value },\n\t\t\t} );\n\t\t}\n\t}, [ initialState.value ] );\n\n\treturn {\n\t\tchange,\n\t\tcommit,\n\t\tdispatch,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tstate,\n\t} as const;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/reducer/reducer.ts"],"names":["useReducer","useLayoutEffect","useRef","initialInputControlState","initialStateReducer","actions","mergeInitialState","initialState","value","initialValue","inputControlStateReducer","composedStateReducers","state","action","nextState","type","PRESS_UP","isDirty","PRESS_DOWN","DRAG_START","isDragging","DRAG_END","CHANGE","error","payload","isPressEnterToChange","COMMIT","RESET","INVALIDATE","_event","event","useInputControlStateReducer","stateReducer","onChangeHandler","dispatch","createChangeEvent","nextValue","createKeyEvent","createDragEvent","change","invalidate","reset","commit","dragStart","drag","DRAG","dragEnd","pressUp","pressDown","pressEnter","PRESS_ENTER","currentState","refProps","current","undefined"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,eAArB,EAAsCC,MAAtC,QAAoD,oBAApD;AAEA;AACA;AACA;;AACA,SAGCC,wBAHD,EAICC,mBAJD,QAKO,SALP;AAMA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAT,GAEc;AAAA,MADbC,YACa,uEADyBJ,wBACzB;AACb,QAAM;AAAEK,IAAAA;AAAF,MAAYD,YAAlB;AAEA,SAAO,EACN,GAAGJ,wBADG;AAEN,OAAGI,YAFG;AAGNE,IAAAA,YAAY,EAAED;AAHR,GAAP;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,wBAAT,CACCC,qBADD,EAEgB;AACf,SAAO,CAAEC,KAAF,EAASC,MAAT,KAAqB;AAC3B,UAAMC,SAAS,GAAG,EAAE,GAAGF;AAAL,KAAlB;;AAEA,YAASC,MAAM,CAACE,IAAhB;AACC;AACH;AACA;AACG,WAAKV,OAAO,CAACW,QAAb;AACCF,QAAAA,SAAS,CAACG,OAAV,GAAoB,KAApB;AACA;;AAED,WAAKZ,OAAO,CAACa,UAAb;AACCJ,QAAAA,SAAS,CAACG,OAAV,GAAoB,KAApB;AACA;;AAED;AACH;AACA;;AACG,WAAKZ,OAAO,CAACc,UAAb;AACCL,QAAAA,SAAS,CAACM,UAAV,GAAuB,IAAvB;AACA;;AAED,WAAKf,OAAO,CAACgB,QAAb;AACCP,QAAAA,SAAS,CAACM,UAAV,GAAuB,KA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YAAY,CAACE,OAAb,CAAqBpC,OAFxB,EAGE;AACDiB,MAAAA,QAAQ,CAAE;AACTnB,QAAAA,IAAI,EAAEV,OAAO,CAACsB,KADL;AAETH,QAAAA,OAAO,EAAE;AAAEhB,UAAAA,KAAK,EAAED,YAAY,CAACC;AAAtB;AAFA,OAAF,CAAR;AAIA;AACD,GAVc,EAUZ,CAAED,YAAY,CAACC,KAAf,CAVY,CAAf;AAYA,SAAO;AACN+B,IAAAA,MADM;AAENG,IAAAA,MAFM;AAGNR,IAAAA,QAHM;AAINU,IAAAA,IAJM;AAKNE,IAAAA,OALM;AAMNH,IAAAA,SANM;AAONH,IAAAA,UAPM;AAQNQ,IAAAA,SARM;AASNC,IAAAA,UATM;AAUNF,IAAAA,OAVM;AAWNN,IAAAA,KAXM;AAYN7B,IAAAA;AAZM,GAAP;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport type { SyntheticEvent, ChangeEvent, PointerEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useReducer, useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tInputState,\n\tStateReducer,\n\tinitialInputControlState,\n\tinitialStateReducer,\n} from './state';\nimport * as actions from './actions';\nimport type { InputChangeCallback } from '../types';\n\n/**\n * Prepares initialState for the reducer.\n *\n * @param initialState The initial state.\n * @return Prepared initialState for the reducer\n */\nfunction mergeInitialState(\n\tinitialState: Partial< InputState > = initialInputControlState\n): InputState {\n\tconst { value } = initialState;\n\n\treturn {\n\t\t...initialInputControlState,\n\t\t...initialState,\n\t\tinitialValue: value,\n\t} as InputState;\n}\n\n/**\n * Creates a reducer that opens the channel for external state subscription\n * and modification.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param composedStateReducers A custom reducer that can subscribe and modify state.\n * @return The reducer.\n */\nfunction inputControlStateReducer(\n\tcomposedStateReducers: StateReducer\n): StateReducer {\n\treturn ( state, action ) => {\n\t\tconst nextState = { ...state };\n\n\t\tswitch ( action.type ) {\n\t\t\t/**\n\t\t\t * Keyboard events\n\t\t\t */\n\t\t\tcase actions.PRESS_UP:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.PRESS_DOWN:\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Drag events\n\t\t\t */\n\t\t\tcase actions.DRAG_START:\n\t\t\t\tnextState.isDragging = true;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.DRAG_END:\n\t\t\t\tnextState.isDragging = false;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Input events\n\t\t\t */\n\t\t\tcase actions.CHANGE:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.value = action.payload.value;\n\n\t\t\t\tif ( state.isPressEnterToChange ) {\n\t\t\t\t\tnextState.isDirty = true;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase actions.COMMIT:\n\t\t\t\tnextState.value = action.payload.value;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tbreak;\n\n\t\t\tcase actions.RESET:\n\t\t\t\tnextState.error = null;\n\t\t\t\tnextState.isDirty = false;\n\t\t\t\tnextState.value = action.payload.value || state.initialValue;\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * Validation\n\t\t\t */\n\t\t\tcase actions.INVALIDATE:\n\t\t\t\tnextState.error = action.payload.error;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tnextState._event = action.payload.event;\n\n\t\t/**\n\t\t * Send the nextState + action to the composedReducers via\n\t\t * this \"bridge\" mechanism. This allows external stateReducers\n\t\t * to hook into actions, and modify state if needed.\n\t\t */\n\t\treturn composedStateReducers( nextState, action );\n\t};\n}\n\n/**\n * A custom hook that connects and external stateReducer with an internal\n * reducer. This hook manages the internal state of InputControl.\n * However, by connecting an external stateReducer function, other\n * components can react to actions as well as modify state before it is\n * applied.\n *\n * This technique uses the \"stateReducer\" design pattern:\n * https://kentcdodds.com/blog/the-state-reducer-pattern/\n *\n * @param stateReducer An external state reducer.\n * @param initialState The initial state for the reducer.\n * @param onChangeHandler A handler for the onChange event.\n * @return State, dispatch, and a collection of actions.\n */\nexport function useInputControlStateReducer(\n\tstateReducer: StateReducer = initialStateReducer,\n\tinitialState: Partial< InputState > = initialInputControlState,\n\tonChangeHandler: InputChangeCallback\n) {\n\tconst [ state, dispatch ] = useReducer< StateReducer >(\n\t\tinputControlStateReducer( stateReducer ),\n\t\tmergeInitialState( initialState )\n\t);\n\n\tconst createChangeEvent =\n\t\t( type: actions.ChangeEventAction[ 'type' ] ) =>\n\t\t(\n\t\t\tnextValue: actions.ChangeEventAction[ 'payload' ][ 'value' ],\n\t\t\tevent: actions.ChangeEventAction[ 'payload' ][ 'event' ]\n\t\t) => {\n\t\t\tdispatch( {\n\t\t\t\ttype,\n\t\t\t\tpayload: { value: nextValue, event },\n\t\t\t} as actions.InputAction );\n\t\t};\n\n\tconst createKeyEvent =\n\t\t( type: actions.KeyEventAction[ 'type' ] ) =>\n\t\t( event: actions.KeyEventAction[ 'payload' ][ 'event' ] ) => {\n\t\t\tdispatch( { type, payload: { event } } );\n\t\t};\n\n\tconst createDragEvent =\n\t\t( type: actions.DragEventAction[ 'type' ] ) =>\n\t\t( payload: actions.DragEventAction[ 'payload' ] ) => {\n\t\t\tdispatch( { type, payload } );\n\t\t};\n\n\t/**\n\t * Actions for the reducer\n\t */\n\tconst change = createChangeEvent( actions.CHANGE );\n\tconst invalidate = ( error: unknown, event: SyntheticEvent ) =>\n\t\tdispatch( { type: actions.INVALIDATE, payload: { error, event } } );\n\tconst reset = createChangeEvent( actions.RESET );\n\tconst commit = createChangeEvent( actions.COMMIT );\n\n\tconst dragStart = createDragEvent( actions.DRAG_START );\n\tconst drag = createDragEvent( actions.DRAG );\n\tconst dragEnd = createDragEvent( actions.DRAG_END );\n\n\tconst pressUp = createKeyEvent( actions.PRESS_UP );\n\tconst pressDown = createKeyEvent( actions.PRESS_DOWN );\n\tconst pressEnter = createKeyEvent( actions.PRESS_ENTER );\n\n\tconst currentState = useRef( state );\n\tconst refProps = useRef( { value: initialState.value, onChangeHandler } );\n\tuseLayoutEffect( () => {\n\t\tcurrentState.current = state;\n\t\trefProps.current = { value: initialState.value, onChangeHandler };\n\t} );\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\tcurrentState.current._event !== undefined &&\n\t\t\tstate.value !== refProps.current.value &&\n\t\t\t! state.isDirty\n\t\t) {\n\t\t\trefProps.current.onChangeHandler( state.value ?? '', {\n\t\t\t\tevent: currentState.current._event as\n\t\t\t\t\t| ChangeEvent< HTMLInputElement >\n\t\t\t\t\t| PointerEvent< HTMLInputElement >,\n\t\t\t} );\n\t\t}\n\t}, [ state.value, state.isDirty ] );\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\tinitialState.value !== currentState.current.value &&\n\t\t\t! currentState.current.isDirty\n\t\t) {\n\t\t\tdispatch( {\n\t\t\t\ttype: actions.RESET,\n\t\t\t\tpayload: { value: initialState.value },\n\t\t\t} );\n\t\t}\n\t}, [ initialState.value ] );\n\n\treturn {\n\t\tchange,\n\t\tcommit,\n\t\tdispatch,\n\t\tdrag,\n\t\tdragEnd,\n\t\tdragStart,\n\t\tinvalidate,\n\t\tpressDown,\n\t\tpressEnter,\n\t\tpressUp,\n\t\treset,\n\t\tstate,\n\t} as const;\n}\n"]}
@@ -51,7 +51,7 @@ export function useDragCursor(isDragging, dragDirection) {
51
51
  // @ts-expect-error
52
52
  document.documentElement.style.cursor = null;
53
53
  }
54
- }, [isDragging]);
54
+ }, [isDragging, dragCursor]);
55
55
  return dragCursor;
56
56
  }
57
57
  export function useDraft(props) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/utils.ts"],"names":["useEffect","useLayoutEffect","useRef","useState","getDragCursor","dragDirection","dragCursor","useDragCursor","isDragging","document","documentElement","style","cursor","useDraft","props","refPreviousValue","value","draft","setDraft","undefined","current","previousValue","isStale","onChange","nextValue","extra","Object","assign","onBlur","event"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,SADD,EAECC,eAFD,EAGCC,MAHD,EAICC,QAJD,QAKO,oBALP;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAT,CAAwBC,aAAxB,EAAwD;AAC9D,MAAIC,UAAU,GAAG,WAAjB;;AAEA,UAASD,aAAT;AACC,SAAK,GAAL;AACA,SAAK,GAAL;AACCC,MAAAA,UAAU,GAAG,WAAb;AACA;;AAED,SAAK,GAAL;AACA,SAAK,GAAL;AACCA,MAAAA,UAAU,GAAG,WAAb;AACA;AATF;;AAYA,SAAOA,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CACNC,UADM,EAENH,aAFM,EAGG;AACT,QAAMC,UAAU,GAAGF,aAAa,CAAEC,aAAF,CAAhC;AAEAL,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKQ,UAAL,EAAkB;AACjBC,MAAAA,QAAQ,CAACC,eAAT,CAAyBC,KAAzB,CAA+BC,MAA/B,GAAwCN,UAAxC;AACA,KAFD,MAEO;AACN;AACAG,MAAAA,QAAQ,CAACC,eAAT,CAAyBC,KAAzB,CAA+BC,MAA/B,GAAwC,IAAxC;AACA;AACD,GAPQ,EAON,CAAEJ,UAAF,CAPM,CAAT;AASA,SAAOF,UAAP;AACA;AAED,OAAO,SAASO,QAAT,CAAmBC,KAAnB,EAIH;AACH,QAAMC,gBAAgB,GAAGb,MAAM,CAAEY,KAAK,CAACE,KAAR,CAA/B;AACA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsBf,QAAQ,CAG/B,EAH+B,CAApC;AAIA,QAAMa,KAAK,GAAGC,KAAK,CAACD,KAAN,KAAgBG,SAAhB,GAA4BF,KAAK,CAACD,KAAlC,GAA0CF,KAAK,CAACE,KAA9D,CANG,CAQH;AACA;AACA;;AACAf,EAAAA,eAAe,CAAE,MAAM;AACtB,UAAM;AAAEmB,MAAAA,OAAO,EAAEC;AAAX,QAA6BN,gBAAnC;AACAA,IAAAA,gBAAgB,CAACK,OAAjB,GAA2BN,KAAK,CAACE,KAAjC;AACA,QAAKC,KAAK,CAACD,KAAN,KAAgBG,SAAhB,IAA6B,CAAEF,KAAK,CAACK,OAA1C,EACCJ,QAAQ,CAAE,EAAE,GAAGD,KAAL;AAAYK,MAAAA,OAAO,EAAE;AAArB,KAAF,CAAR,CADD,KAEK,IAAKL,KAAK,CAACK,OAAN,IAAiBR,KAAK,CAACE,KAAN,KAAgBK,aAAtC,EACJH,QAAQ,CAAE,EAAF,CAAR;AACD,GAPc,EAOZ,CAAEJ,KAAK,CAACE,KAAR,EAAeC,KAAf,CAPY,CAAf;;AASA,QAAMM,QAA6B,GAAG,CAAEC,SAAF,EAAaC,KAAb,KAAwB;AAC7D;AACAP,IAAAA,QAAQ,CAAIE,OAAF,IACTM,MAAM,CAACC,MAAP,CAAeP,OAAf,EAAwB;AAAEJ,MAAAA,KAAK,EAAEQ,SAAT;AAAoBF,MAAAA,OAAO,EAAE;AAA7B,KAAxB,CADO,CAAR;AAGAR,IAAAA,KAAK,CAACS,QAAN,CAAgBC,SAAhB,EAA2BC,KAA3B;AACA,GAND;;AAOA,QAAMG,MAAyB,GAAKC,KAAF,IAAa;AAAA;;AAC9CX,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACA,qBAAAJ,KAAK,CAACc,MAAN,qEAAAd,KAAK,EAAWe,KAAX,CAAL;AACA,GAHD;;AAKA,SAAO;AAAEb,IAAAA,KAAF;AAASY,IAAAA,MAAT;AAAiBL,IAAAA;AAAjB,GAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { FocusEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { InputChangeCallback } from './types';\n\n/**\n * Gets a CSS cursor value based on a drag direction.\n *\n * @param dragDirection The drag direction.\n * @return The CSS cursor value.\n */\nexport function getDragCursor( dragDirection: string ): string {\n\tlet dragCursor = 'ns-resize';\n\n\tswitch ( dragDirection ) {\n\t\tcase 'n':\n\t\tcase 's':\n\t\t\tdragCursor = 'ns-resize';\n\t\t\tbreak;\n\n\t\tcase 'e':\n\t\tcase 'w':\n\t\t\tdragCursor = 'ew-resize';\n\t\t\tbreak;\n\t}\n\n\treturn dragCursor;\n}\n\n/**\n * Custom hook that renders a drag cursor when dragging.\n *\n * @param {boolean} isDragging The dragging state.\n * @param {string} dragDirection The drag direction.\n *\n * @return {string} The CSS cursor value.\n */\nexport function useDragCursor(\n\tisDragging: boolean,\n\tdragDirection: string\n): string {\n\tconst dragCursor = getDragCursor( dragDirection );\n\n\tuseEffect( () => {\n\t\tif ( isDragging ) {\n\t\t\tdocument.documentElement.style.cursor = dragCursor;\n\t\t} else {\n\t\t\t// @ts-expect-error\n\t\t\tdocument.documentElement.style.cursor = null;\n\t\t}\n\t}, [ isDragging ] );\n\n\treturn dragCursor;\n}\n\nexport function useDraft( props: {\n\tvalue: string | undefined;\n\tonBlur?: FocusEventHandler;\n\tonChange: InputChangeCallback;\n} ) {\n\tconst refPreviousValue = useRef( props.value );\n\tconst [ draft, setDraft ] = useState< {\n\t\tvalue?: string;\n\t\tisStale?: boolean;\n\t} >( {} );\n\tconst value = draft.value !== undefined ? draft.value : props.value;\n\n\t// Determines when to discard the draft value to restore controlled status.\n\t// To do so, it tracks the previous value and marks the draft value as stale\n\t// after each render.\n\tuseLayoutEffect( () => {\n\t\tconst { current: previousValue } = refPreviousValue;\n\t\trefPreviousValue.current = props.value;\n\t\tif ( draft.value !== undefined && ! draft.isStale )\n\t\t\tsetDraft( { ...draft, isStale: true } );\n\t\telse if ( draft.isStale && props.value !== previousValue )\n\t\t\tsetDraft( {} );\n\t}, [ props.value, draft ] );\n\n\tconst onChange: InputChangeCallback = ( nextValue, extra ) => {\n\t\t// Mutates the draft value to avoid an extra effect run.\n\t\tsetDraft( ( current ) =>\n\t\t\tObject.assign( current, { value: nextValue, isStale: false } )\n\t\t);\n\t\tprops.onChange( nextValue, extra );\n\t};\n\tconst onBlur: FocusEventHandler = ( event ) => {\n\t\tsetDraft( {} );\n\t\tprops.onBlur?.( event );\n\t};\n\n\treturn { value, onBlur, onChange };\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/utils.ts"],"names":["useEffect","useLayoutEffect","useRef","useState","getDragCursor","dragDirection","dragCursor","useDragCursor","isDragging","document","documentElement","style","cursor","useDraft","props","refPreviousValue","value","draft","setDraft","undefined","current","previousValue","isStale","onChange","nextValue","extra","Object","assign","onBlur","event"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,SADD,EAECC,eAFD,EAGCC,MAHD,EAICC,QAJD,QAKO,oBALP;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAT,CAAwBC,aAAxB,EAAwD;AAC9D,MAAIC,UAAU,GAAG,WAAjB;;AAEA,UAASD,aAAT;AACC,SAAK,GAAL;AACA,SAAK,GAAL;AACCC,MAAAA,UAAU,GAAG,WAAb;AACA;;AAED,SAAK,GAAL;AACA,SAAK,GAAL;AACCA,MAAAA,UAAU,GAAG,WAAb;AACA;AATF;;AAYA,SAAOA,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,aAAT,CACNC,UADM,EAENH,aAFM,EAGG;AACT,QAAMC,UAAU,GAAGF,aAAa,CAAEC,aAAF,CAAhC;AAEAL,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKQ,UAAL,EAAkB;AACjBC,MAAAA,QAAQ,CAACC,eAAT,CAAyBC,KAAzB,CAA+BC,MAA/B,GAAwCN,UAAxC;AACA,KAFD,MAEO;AACN;AAC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AK,CAACS,QAAN,CAAgBC,SAAhB,EAA2BC,KAA3B;AACA,GAND;;AAOA,QAAMG,MAAyB,GAAKC,KAAF,IAAa;AAAA;;AAC9CX,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACA,qBAAAJ,KAAK,CAACc,MAAN,qEAAAd,KAAK,EAAWe,KAAX,CAAL;AACA,GAHD;;AAKA,SAAO;AAAEb,IAAAA,KAAF;AAASY,IAAAA,MAAT;AAAiBL,IAAAA;AAAjB,GAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { FocusEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { InputChangeCallback } from './types';\n\n/**\n * Gets a CSS cursor value based on a drag direction.\n *\n * @param dragDirection The drag direction.\n * @return The CSS cursor value.\n */\nexport function getDragCursor( dragDirection: string ): string {\n\tlet dragCursor = 'ns-resize';\n\n\tswitch ( dragDirection ) {\n\t\tcase 'n':\n\t\tcase 's':\n\t\t\tdragCursor = 'ns-resize';\n\t\t\tbreak;\n\n\t\tcase 'e':\n\t\tcase 'w':\n\t\t\tdragCursor = 'ew-resize';\n\t\t\tbreak;\n\t}\n\n\treturn dragCursor;\n}\n\n/**\n * Custom hook that renders a drag cursor when dragging.\n *\n * @param {boolean} isDragging The dragging state.\n * @param {string} dragDirection The drag direction.\n *\n * @return {string} The CSS cursor value.\n */\nexport function useDragCursor(\n\tisDragging: boolean,\n\tdragDirection: string\n): string {\n\tconst dragCursor = getDragCursor( dragDirection );\n\n\tuseEffect( () => {\n\t\tif ( isDragging ) {\n\t\t\tdocument.documentElement.style.cursor = dragCursor;\n\t\t} else {\n\t\t\t// @ts-expect-error\n\t\t\tdocument.documentElement.style.cursor = null;\n\t\t}\n\t}, [ isDragging, dragCursor ] );\n\n\treturn dragCursor;\n}\n\nexport function useDraft( props: {\n\tvalue: string | undefined;\n\tonBlur?: FocusEventHandler;\n\tonChange: InputChangeCallback;\n} ) {\n\tconst refPreviousValue = useRef( props.value );\n\tconst [ draft, setDraft ] = useState< {\n\t\tvalue?: string;\n\t\tisStale?: boolean;\n\t} >( {} );\n\tconst value = draft.value !== undefined ? draft.value : props.value;\n\n\t// Determines when to discard the draft value to restore controlled status.\n\t// To do so, it tracks the previous value and marks the draft value as stale\n\t// after each render.\n\tuseLayoutEffect( () => {\n\t\tconst { current: previousValue } = refPreviousValue;\n\t\trefPreviousValue.current = props.value;\n\t\tif ( draft.value !== undefined && ! draft.isStale )\n\t\t\tsetDraft( { ...draft, isStale: true } );\n\t\telse if ( draft.isStale && props.value !== previousValue )\n\t\t\tsetDraft( {} );\n\t}, [ props.value, draft ] );\n\n\tconst onChange: InputChangeCallback = ( nextValue, extra ) => {\n\t\t// Mutates the draft value to avoid an extra effect run.\n\t\tsetDraft( ( current ) =>\n\t\t\tObject.assign( current, { value: nextValue, isStale: false } )\n\t\t);\n\t\tprops.onChange( nextValue, extra );\n\t};\n\tconst onBlur: FocusEventHandler = ( event ) => {\n\t\tsetDraft( {} );\n\t\tprops.onBlur?.( event );\n\t};\n\n\treturn { value, onBlur, onChange };\n}\n"]}
@@ -6,7 +6,6 @@ import { createElement } from "@wordpress/element";
6
6
  * External dependencies
7
7
  */
8
8
  import classnames from 'classnames';
9
- import { isString } from 'lodash';
10
9
  /**
11
10
  * WordPress dependencies
12
11
  */
@@ -43,7 +42,7 @@ export function MenuItem(props, ref) {
43
42
  }, info));
44
43
  }
45
44
 
46
- if (icon && !isString(icon)) {
45
+ if (icon && typeof icon !== 'string') {
47
46
  icon = cloneElement(icon, {
48
47
  className: classnames('components-menu-items__item-icon', {
49
48
  'has-icon-right': iconPosition === 'right'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/menu-item/index.js"],"names":["classnames","isString","cloneElement","forwardRef","Shortcut","Button","Icon","MenuItem","props","ref","children","info","className","icon","iconPosition","shortcut","isSelected","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D,UADH,GAEGG,SANL;AAQC,IAAA,IAAI,EAAGF,IARR;AASC,IAAA,IAAI,EAAGH,YAAY,KAAK,MAAjB,GAA0BD,IAA1B,GAAiCM,SATzC;AAUC,IAAA,SAAS,EAAGP;AAVb,KAWMM,WAXN,GAaC;AAAM,IAAA,SAAS,EAAC;AAAhB,KAA+CR,QAA/C,CAbD,EAcC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,QAAQ,EAAGK;AAFZ,IAdD,EAkBGF,IAAI,IAAIC,YAAY,KAAK,OAAzB,IAAoC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGD;AAAb,IAlBvC,CADD;AAsBA;AAED,eAAeV,UAAU,CAAEI,QAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isString } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from '../shortcut';\nimport Button from '../button';\nimport Icon from '../icon';\n\nexport function MenuItem( props, ref ) {\n\tlet {\n\t\tchildren,\n\t\tinfo,\n\t\tclassName,\n\t\ticon,\n\t\ticonPosition = 'right',\n\t\tshortcut,\n\t\tisSelected,\n\t\trole = 'menuitem',\n\t\t...buttonProps\n\t} = props;\n\n\tclassName = classnames( 'components-menu-item__button', className );\n\n\tif ( info ) {\n\t\tchildren = (\n\t\t\t<span className=\"components-menu-item__info-wrapper\">\n\t\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t\t<span className=\"components-menu-item__info\">{ info }</span>\n\t\t\t</span>\n\t\t);\n\t}\n\n\tif ( icon && ! isString( icon ) ) {\n\t\ticon = cloneElement( icon, {\n\t\t\tclassName: classnames( 'components-menu-items__item-icon', {\n\t\t\t\t'has-icon-right': iconPosition === 'right',\n\t\t\t} ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tref={ ref }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\trole === 'menuitemcheckbox' || role === 'menuitemradio'\n\t\t\t\t\t? isSelected\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trole={ role }\n\t\t\ticon={ iconPosition === 'left' ? icon : undefined }\n\t\t\tclassName={ className }\n\t\t\t{ ...buttonProps }\n\t\t>\n\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t<Shortcut\n\t\t\t\tclassName=\"components-menu-item__shortcut\"\n\t\t\t\tshortcut={ shortcut }\n\t\t\t/>\n\t\t\t{ icon && iconPosition === 'right' && <Icon icon={ icon } /> }\n\t\t</Button>\n\t);\n}\n\nexport default forwardRef( MenuItem );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/menu-item/index.js"],"names":["classnames","cloneElement","forwardRef","Shortcut","Button","Icon","MenuItem","props","ref","children","info","className","icon","iconPosition","shortcut","isSelected","role","buttonProps","undefined"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AAEA,OAAO,SAASC,QAAT,CAAmBC,KAAnB,EAA0BC,GAA1B,EAAgC;AACtC,MAAI;AACHC,IAAAA,QADG;AAEHC,IAAAA,IAFG;AAGHC,IAAAA,SAHG;AAIHC,IAAAA,IAJG;AAKHC,IAAAA,YAAY,GAAG,OALZ;AAMHC,IAAAA,QANG;AAOHC,IAAAA,UAPG;AAQHC,IAAAA,IAAI,GAAG,UARJ;AASH,OAAGC;AATA,MAUAV,KAVJ;AAYAI,EAAAA,SAAS,GAAGX,UAAU,CAAE,8BAAF,EAAkCW,SAAlC,CAAtB;;AAEA,MAAKD,IAAL,EAAY;AACXD,IAAAA,QAAQ,GACP;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC;AAAM,MAAA,SAAS,EAAC;AAAhB,OAA+CA,QAA/C,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OAA+CC,IAA/C,CAFD,CADD;AAMA;;AAED,MAAKE,IAAI,IAAI,OAAOA,IAAP,KAAgB,QAA7B,EAAwC;AACvCA,IAAAA,IAAI,GAAGX,YAAY,CAAEW,IAAF,EAAQ;AAC1BD,MAAAA,SAAS,EAAEX,UAAU,CAAE,kCAAF,EAAsC;AAC1D,0BAAkBa,YAAY,KAAK;AADuB,OAAtC;AADK,KAAR,CAAnB;AAKA;;AAED,SACC,cAAC,MAAD;AACC,IAAA,GAAG,EAAGL,GADP,CAEC;AAFD;AAGC,oBACCQ,IAAI,KAAK,kBAAT,IAA+BA,IAAI,KAAK,eAAxC,GACGD,UADH,GAEGG,SANL;AAQC,IAAA,IAAI,EAAGF,IARR;AASC,IAAA,IAAI,EAAGH,YAAY,KAAK,MAAjB,GAA0BD,IAA1B,GAAiCM,SATzC;AAUC,IAAA,SAAS,EAAGP;AAVb,KAWMM,WAXN,GAaC;AAAM,IAAA,SAAS,EAAC;AAAhB,KAA+CR,QAA/C,CAbD,EAcC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,QAAQ,EAAGK;AAFZ,IAdD,EAkBGF,IAAI,IAAIC,YAAY,KAAK,OAAzB,IAAoC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGD;AAAb,IAlBvC,CADD;AAsBA;AAED,eAAeV,UAAU,CAAEI,QAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from '../shortcut';\nimport Button from '../button';\nimport Icon from '../icon';\n\nexport function MenuItem( props, ref ) {\n\tlet {\n\t\tchildren,\n\t\tinfo,\n\t\tclassName,\n\t\ticon,\n\t\ticonPosition = 'right',\n\t\tshortcut,\n\t\tisSelected,\n\t\trole = 'menuitem',\n\t\t...buttonProps\n\t} = props;\n\n\tclassName = classnames( 'components-menu-item__button', className );\n\n\tif ( info ) {\n\t\tchildren = (\n\t\t\t<span className=\"components-menu-item__info-wrapper\">\n\t\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t\t<span className=\"components-menu-item__info\">{ info }</span>\n\t\t\t</span>\n\t\t);\n\t}\n\n\tif ( icon && typeof icon !== 'string' ) {\n\t\ticon = cloneElement( icon, {\n\t\t\tclassName: classnames( 'components-menu-items__item-icon', {\n\t\t\t\t'has-icon-right': iconPosition === 'right',\n\t\t\t} ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tref={ ref }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\trole === 'menuitemcheckbox' || role === 'menuitemradio'\n\t\t\t\t\t? isSelected\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\trole={ role }\n\t\t\ticon={ iconPosition === 'left' ? icon : undefined }\n\t\t\tclassName={ className }\n\t\t\t{ ...buttonProps }\n\t\t>\n\t\t\t<span className=\"components-menu-item__item\">{ children }</span>\n\t\t\t<Shortcut\n\t\t\t\tclassName=\"components-menu-item__shortcut\"\n\t\t\t\tshortcut={ shortcut }\n\t\t\t/>\n\t\t\t{ icon && iconPosition === 'right' && <Icon icon={ icon } /> }\n\t\t</Button>\n\t);\n}\n\nexport default forwardRef( MenuItem );\n"]}
@@ -1,19 +1,17 @@
1
1
  import { createElement } from "@wordpress/element";
2
2
 
3
- /**
4
- * External dependencies
5
- */
6
- import { noop } from 'lodash';
7
3
  /**
8
4
  * WordPress dependencies
9
5
  */
10
-
11
6
  import { check } from '@wordpress/icons';
12
7
  /**
13
8
  * Internal dependencies
14
9
  */
15
10
 
16
11
  import MenuItem from '../menu-item';
12
+
13
+ const noop = () => {};
14
+
17
15
  export default function MenuItemsChoice(_ref) {
18
16
  let {
19
17
  choices = [],
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/menu-items-choice/index.js"],"names":["noop","check","MenuItem","MenuItemsChoice","choices","onHover","onSelect","value","map","item","isSelected","info","shortcut","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,cAArB;AAEA,eAAe,SAASC,eAAT,OAKX;AAAA,MALqC;AACxCC,IAAAA,OAAO,GAAG,EAD8B;AAExCC,IAAAA,OAAO,GAAGL,IAF8B;AAGxCM,IAAAA,QAHwC;AAIxCC,IAAAA;AAJwC,GAKrC;AACH,SAAOH,OAAO,CAACI,GAAR,CAAeC,IAAF,IAAY;AAC/B,UAAMC,UAAU,GAAGH,KAAK,KAAKE,IAAI,CAACF,KAAlC;AACA,WACC,cAAC,QAAD;AACC,MAAA,GAAG,EAAGE,IAAI,CAACF,KADZ;AAEC,MAAA,IAAI,EAAC,eAFN;AAGC,MAAA,IAAI,EAAGG,UAAU,IAAIT,KAHtB;AAIC,MAAA,IAAI,EAAGQ,IAAI,CAACE,IAJb;AAKC,MAAA,UAAU,EAAGD,UALd;AAMC,MAAA,QAAQ,EAAGD,IAAI,CAACG,QANjB;AAOC,MAAA,SAAS,EAAC,8BAPX;AAQC,MAAA,OAAO,EAAG,MAAM;AACf,YAAK,CAAEF,UAAP,EAAoB;AACnBJ,UAAAA,QAAQ,CAAEG,IAAI,CAACF,KAAP,CAAR;AACA;AACD,OAZF;AAaC,MAAA,YAAY,EAAG,MAAMF,OAAO,CAAEI,IAAI,CAACF,KAAP,CAb7B;AAcC,MAAA,YAAY,EAAG,MAAMF,OAAO,CAAE,IAAF,CAd7B;AAeC,oBAAaI,IAAI,CAAE,YAAF;AAflB,OAiBGA,IAAI,CAACI,KAjBR,CADD;AAqBA,GAvBM,CAAP;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport MenuItem from '../menu-item';\n\nexport default function MenuItemsChoice( {\n\tchoices = [],\n\tonHover = noop,\n\tonSelect,\n\tvalue,\n} ) {\n\treturn choices.map( ( item ) => {\n\t\tconst isSelected = value === item.value;\n\t\treturn (\n\t\t\t<MenuItem\n\t\t\t\tkey={ item.value }\n\t\t\t\trole=\"menuitemradio\"\n\t\t\t\ticon={ isSelected && check }\n\t\t\t\tinfo={ item.info }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tshortcut={ item.shortcut }\n\t\t\t\tclassName=\"components-menu-items-choice\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tif ( ! isSelected ) {\n\t\t\t\t\t\tonSelect( item.value );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\tonMouseEnter={ () => onHover( item.value ) }\n\t\t\t\tonMouseLeave={ () => onHover( null ) }\n\t\t\t\taria-label={ item[ 'aria-label' ] }\n\t\t\t>\n\t\t\t\t{ item.label }\n\t\t\t</MenuItem>\n\t\t);\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/menu-items-choice/index.js"],"names":["check","MenuItem","noop","MenuItemsChoice","choices","onHover","onSelect","value","map","item","isSelected","info","shortcut","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,kBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,cAArB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,eAAe,SAASC,eAAT,OAKX;AAAA,MALqC;AACxCC,IAAAA,OAAO,GAAG,EAD8B;AAExCC,IAAAA,OAAO,GAAGH,IAF8B;AAGxCI,IAAAA,QAHwC;AAIxCC,IAAAA;AAJwC,GAKrC;AACH,SAAOH,OAAO,CAACI,GAAR,CAAeC,IAAF,IAAY;AAC/B,UAAMC,UAAU,GAAGH,KAAK,KAAKE,IAAI,CAACF,KAAlC;AACA,WACC,cAAC,QAAD;AACC,MAAA,GAAG,EAAGE,IAAI,CAACF,KADZ;AAEC,MAAA,IAAI,EAAC,eAFN;AAGC,MAAA,IAAI,EAAGG,UAAU,IAAIV,KAHtB;AAIC,MAAA,IAAI,EAAGS,IAAI,CAACE,IAJb;AAKC,MAAA,UAAU,EAAGD,UALd;AAMC,MAAA,QAAQ,EAAGD,IAAI,CAACG,QANjB;AAOC,MAAA,SAAS,EAAC,8BAPX;AAQC,MAAA,OAAO,EAAG,MAAM;AACf,YAAK,CAAEF,UAAP,EAAoB;AACnBJ,UAAAA,QAAQ,CAAEG,IAAI,CAACF,KAAP,CAAR;AACA;AACD,OAZF;AAaC,MAAA,YAAY,EAAG,MAAMF,OAAO,CAAEI,IAAI,CAACF,KAAP,CAb7B;AAcC,MAAA,YAAY,EAAG,MAAMF,OAAO,CAAE,IAAF,CAd7B;AAeC,oBAAaI,IAAI,CAAE,YAAF;AAflB,OAiBGA,IAAI,CAACI,KAjBR,CADD;AAqBA,GAvBM,CAAP;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport MenuItem from '../menu-item';\n\nconst noop = () => {};\n\nexport default function MenuItemsChoice( {\n\tchoices = [],\n\tonHover = noop,\n\tonSelect,\n\tvalue,\n} ) {\n\treturn choices.map( ( item ) => {\n\t\tconst isSelected = value === item.value;\n\t\treturn (\n\t\t\t<MenuItem\n\t\t\t\tkey={ item.value }\n\t\t\t\trole=\"menuitemradio\"\n\t\t\t\ticon={ isSelected && check }\n\t\t\t\tinfo={ item.info }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tshortcut={ item.shortcut }\n\t\t\t\tclassName=\"components-menu-items-choice\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tif ( ! isSelected ) {\n\t\t\t\t\t\tonSelect( item.value );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t\tonMouseEnter={ () => onHover( item.value ) }\n\t\t\t\tonMouseLeave={ () => onHover( null ) }\n\t\t\t\taria-label={ item[ 'aria-label' ] }\n\t\t\t>\n\t\t\t\t{ item.label }\n\t\t\t</MenuItem>\n\t\t);\n\t} );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-context.native.js"],"names":["Platform","UIManager","createContext","OS","setLayoutAnimationEnabledExperimental","BottomSheetContext","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","onHandleHardwareButtonPress","setIsFullScreen","Provider","BottomSheetProvider","Consumer","BottomSheetConsumer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,cAApC;AACA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B,C,CAEA;AACA;;AACA,IACCF,QAAQ,CAACG,EAAT,KAAgB,SAAhB,IACAF,SAAS,CAACG,qCAFX,EAGE;AACDH,EAAAA,SAAS,CAACG,qCAAV,CAAiD,IAAjD;AACA,C,CAED;AACA;;;AACA,OAAO,MAAMC,kBAAkB,GAAGH,aAAa,CAAE;AAChD;AACAI,EAAAA,6BAA6B,EAAE,KAFiB;AAGhD;AACAC,EAAAA,6BAA6B,EAAE,MAAM,CAAE,CAJS;AAKhD;AACA;AACA;AACAC,EAAAA,gCAAgC,EAAE,MAAM,CAAE,CARM;AAShD;AACAC,EAAAA,0BAA0B,EAAE,MAAM,CAAE,CAVY;AAWhD;AACA;AACAC,EAAAA,2BAA2B,EAAE,MAAM,CAAE,CAbW;AAchD;AACAC,EAAAA,eAAe,EAAE,MAAM,CAAE;AAfuB,CAAF,CAAxC;AAkBP,OAAO,MAAM;AACZC,EAAAA,QAAQ,EAAEC,mBADE;AAEZC,EAAAA,QAAQ,EAAEC;AAFE,IAGTV,kBAHG","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, UIManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n// It's needed to set the following flags via UIManager\n// to have `LayoutAnimation` working on Android\nif (\n\tPlatform.OS === 'android' &&\n\tUIManager.setLayoutAnimationEnabledExperimental\n) {\n\tUIManager.setLayoutAnimationEnabledExperimental( true );\n}\n\n// Context in BottomSheet is necessary for controlling the\n// transition flow between subsheets and replacing a content inside them\nexport const BottomSheetContext = createContext( {\n\t// Specifies whether content is currently scrolling.\n\tisBottomSheetContentScrolling: false,\n\t// Function called to enable scroll within bottom sheet.\n\tshouldEnableBottomSheetScroll: () => {},\n\t// Function called to enable/disable bottom sheet max height.\n\t// E.g. used to extend bottom sheet on full screen in ColorPicker,\n\t// which is helpful on small devices with set the largest font/display size.\n\tshouldEnableBottomSheetMaxHeight: () => {},\n\t// Callback that is called on closing bottom sheet.\n\tonHandleClosingBottomSheet: () => {},\n\t// Android only: Function called to control android hardware back button functionality\n\t// Return true if the bottom-sheet default close action shouldn't be called.\n\tonHandleHardwareButtonPress: () => {},\n\t// Toggle full-screen styles and dimensions\n\tsetIsFullScreen: () => {},\n} );\n\nexport const {\n\tProvider: BottomSheetProvider,\n\tConsumer: BottomSheetConsumer,\n} = BottomSheetContext;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/bottom-sheet-context.native.js"],"names":["Platform","UIManager","createContext","OS","setLayoutAnimationEnabledExperimental","BottomSheetContext","isBottomSheetContentScrolling","shouldEnableBottomSheetScroll","shouldEnableBottomSheetMaxHeight","onHandleClosingBottomSheet","onHandleHardwareButtonPress","setIsFullScreen","Provider","BottomSheetProvider","Consumer","BottomSheetConsumer"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,cAApC;AACA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B,C,CAEA;AACA;;AACA,IACCF,QAAQ,CAACG,EAAT,KAAgB,SAAhB,IACAF,SAAS,CAACG,qCAFX,EAGE;AACDH,EAAAA,SAAS,CAACG,qCAAV,CAAiD,IAAjD;AACA,C,CAED;AACA;;;AACA,OAAO,MAAMC,kBAAkB,GAAGH,aAAa,CAAE;AAChD;AACAI,EAAAA,6BAA6B,EAAE,KAFiB;AAGhD;AACAC,EAAAA,6BAA6B,EAAE,MAAM,CAAE,CAJS;AAKhD;AACA;AACA;AACAC,EAAAA,gCAAgC,EAAE,MAAM,CAAE,CARM;AAShD;AACAC,EAAAA,0BAA0B,EAAE,MAAM,CAAE,CAVY;AAWhD;AACA;AACAC,EAAAA,2BAA2B,EAAE,MAAM,CAAE,CAbW;AAchD;AACAC,EAAAA,eAAe,EAAE,MAAM,CAAE;AAfuB,CAAF,CAAxC;AAkBP,OAAO,MAAM;AAAEC,EAAAA,QAAQ,EAAEC,mBAAZ;AAAiCC,EAAAA,QAAQ,EAAEC;AAA3C,IACZV,kBADM","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, UIManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n// It's needed to set the following flags via UIManager\n// to have `LayoutAnimation` working on Android\nif (\n\tPlatform.OS === 'android' &&\n\tUIManager.setLayoutAnimationEnabledExperimental\n) {\n\tUIManager.setLayoutAnimationEnabledExperimental( true );\n}\n\n// Context in BottomSheet is necessary for controlling the\n// transition flow between subsheets and replacing a content inside them\nexport const BottomSheetContext = createContext( {\n\t// Specifies whether content is currently scrolling.\n\tisBottomSheetContentScrolling: false,\n\t// Function called to enable scroll within bottom sheet.\n\tshouldEnableBottomSheetScroll: () => {},\n\t// Function called to enable/disable bottom sheet max height.\n\t// E.g. used to extend bottom sheet on full screen in ColorPicker,\n\t// which is helpful on small devices with set the largest font/display size.\n\tshouldEnableBottomSheetMaxHeight: () => {},\n\t// Callback that is called on closing bottom sheet.\n\tonHandleClosingBottomSheet: () => {},\n\t// Android only: Function called to control android hardware back button functionality\n\t// Return true if the bottom-sheet default close action shouldn't be called.\n\tonHandleHardwareButtonPress: () => {},\n\t// Toggle full-screen styles and dimensions\n\tsetIsFullScreen: () => {},\n} );\n\nexport const { Provider: BottomSheetProvider, Consumer: BottomSheetConsumer } =\n\tBottomSheetContext;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["TouchableOpacity","Text","View","TextInput","I18nManager","AccessibilityInfo","Platform","isEmpty","get","Icon","check","Component","__","_x","sprintf","withPreferredColorScheme","styles","platformStyles","TouchableRipple","isIOS","OS","BottomSheetCell","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","addEventListener","then","setState","componentWillUnmount","remove","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","separatorMarginLeft","getValueComponent","styleRTL","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","placeholderColor"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,IAFD,EAGCC,IAHD,EAICC,SAJD,EAKCC,WALD,EAMCC,iBAND,EAOCC,QAPD,QAQO,cARP;AASA,SAASC,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,eAAnB;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,eAAP,MAA4B,UAA5B;AAEA,MAAMC,KAAK,GAAGb,QAAQ,CAACc,EAAT,KAAgB,KAA9B;;AACA,MAAMC,eAAN,SAA8BV,SAA9B,CAAwC;AACvCW,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,GAAiC,KAAKA,yBAAL,CAA+BC,IAA/B,CAChC,IADgC,CAAjC;AAIA,SAAKC,SAAL,GAAiB,KAAjB;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAaC,SAAb,EAAyB;AAC1C,QAAK,CAAEA,SAAS,CAACR,cAAZ,IAA8B,KAAKD,KAAL,C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AIkC,iBAAiB,EAtEjC,EAuEG5C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,cAAC,IAAD;AAAM,MAAA,KAAK,EAAG,CAAEmD,aAAF,EAAiBnH,MAAM,CAAC8H,gBAAxB;AAAd,OACG9D,IADH,CAhGF,EAoGG,CAAEmB,gBAAF,IAAsB,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAjZsC;;AAoZxC,eAAenF,wBAAwB,CAAEM,eAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled = this.handleScreenReaderToggled.bind(\n\t\t\tthis\n\t\t);\n\n\t\tthis.isCurrent = false;\n\t}\n\n\tcomponentDidUpdate( prevProps, prevState ) {\n\t\tif ( ! prevState.isEditingValue && this.state.isEditingValue ) {\n\t\t\tthis._valueTextInput.focus();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.isCurrent = true;\n\t\tthis.a11yInfoChangeSubscription = AccessibilityInfo.addEventListener(\n\t\t\t'screenReaderChanged',\n\t\t\tthis.handleScreenReaderToggled\n\t\t);\n\n\t\tAccessibilityInfo.isScreenReaderEnabled().then(\n\t\t\t( isScreenReaderEnabled ) => {\n\t\t\t\tif ( this.isCurrent ) {\n\t\t\t\t\tthis.setState( { isScreenReaderEnabled } );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.isCurrent = false;\n\t\tthis.a11yInfoChangeSubscription.remove();\n\t}\n\n\thandleScreenReaderToggled( isScreenReaderEnabled ) {\n\t\tthis.setState( { isScreenReaderEnabled } );\n\t}\n\n\ttypeToKeyboardType( type, step ) {\n\t\tlet keyboardType = `default`;\n\t\tif ( type === `number` ) {\n\t\t\tif ( step && Math.abs( step ) < 1 ) {\n\t\t\t\tkeyboardType = `decimal-pad`;\n\t\t\t} else {\n\t\t\t\tkeyboardType = `number-pad`;\n\t\t\t}\n\t\t}\n\t\treturn keyboardType;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\taccessible,\n\t\t\taccessibilityLabel,\n\t\t\taccessibilityHint,\n\t\t\taccessibilityRole,\n\t\t\tdisabled = false,\n\t\t\tactiveOpacity,\n\t\t\tonPress,\n\t\t\tonLongPress,\n\t\t\tlabel,\n\t\t\tsubLabel,\n\t\t\tvalue,\n\t\t\tvaluePlaceholder = '',\n\t\t\ticon,\n\t\t\tleftAlign,\n\t\t\ticonStyle = {},\n\t\t\tlabelStyle = {},\n\t\t\tvalueStyle = {},\n\t\t\tcellContainerStyle = {},\n\t\t\tcellRowContainerStyle = {},\n\t\t\tonChangeValue,\n\t\t\tonSubmit,\n\t\t\tchildren,\n\t\t\teditable = true,\n\t\t\tisSelected = false,\n\t\t\tseparatorType,\n\t\t\tstyle = {},\n\t\t\tgetStylesFromColorScheme,\n\t\t\tcustomActionButton,\n\t\t\ttype,\n\t\t\tstep,\n\t\t\tborderless,\n\t\t\thelp,\n\t\t\t...valueProps\n\t\t} = this.props;\n\n\t\tconst showValue = value !== undefined;\n\t\tconst isValueEditable = editable && onChangeValue !== undefined;\n\t\tconst cellLabelStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabel,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelCenteredStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelCentered,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst cellLabelLeftAlignNoIconStyle = getStylesFromColorScheme(\n\t\t\tstyles.cellLabelLeftAlignNoIcon,\n\t\t\tstyles.cellTextDark\n\t\t);\n\t\tconst defaultMissingIconAndValue = leftAlign\n\t\t\t? cellLabelLeftAlignNoIconStyle\n\t\t\t: cellLabelCenteredStyle;\n\t\tconst defaultLabelStyle =\n\t\t\tshowValue || customActionButton || icon\n\t\t\t\t? cellLabelStyle\n\t\t\t\t: defaultMissingIconAndValue;\n\n\t\tconst defaultSubLabelStyleText = getStylesFromColorScheme(\n\t\t\tstyles.cellSubLabelText,\n\t\t\tstyles.cellSubLabelTextDark\n\t\t);\n\n\t\tconst drawSeparator =\n\t\t\t( separatorType && separatorType !== 'none' ) ||\n\t\t\tseparatorStyle === undefined;\n\t\tconst drawTopSeparator =\n\t\t\tdrawSeparator && separatorType === 'topFullWidth';\n\n\t\tconst cellContainerStyles = [\n\t\t\tstyles.cellContainer,\n\t\t\tcellContainerStyle,\n\t\t];\n\t\tconst rowContainerStyles = [\n\t\t\tstyles.cellRowContainer,\n\t\t\tcellRowContainerStyle,\n\t\t];\n\n\t\tconst isInteractive =\n\t\t\tisValueEditable ||\n\t\t\tonPress !== undefined ||\n\t\t\tonLongPress !== undefined;\n\n\t\tconst onCellPress = () => {\n\t\t\tif ( isValueEditable ) {\n\t\t\t\tstartEditing();\n\t\t\t} else if ( onPress !== undefined ) {\n\t\t\t\tonPress();\n\t\t\t}\n\t\t};\n\n\t\tconst finishEditing = () => {\n\t\t\tthis.setState( { isEditingValue: false } );\n\t\t};\n\n\t\tconst startEditing = () => {\n\t\t\tif ( this.state.isEditingValue === false ) {\n\t\t\t\tthis.setState( { isEditingValue: true } );\n\t\t\t}\n\t\t};\n\n\t\tconst separatorStyle = () => {\n\t\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\tconst defaultSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.separator,\n\t\t\t\tstyles.separatorDark\n\t\t\t);\n\t\t\tconst cellSeparatorStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellSeparator,\n\t\t\t\tstyles.cellSeparatorDark\n\t\t\t);\n\t\t\tconst leftMarginStyle = {\n\t\t\t\t...cellSeparatorStyle,\n\t\t\t\t...platformStyles.separatorMarginLeft,\n\t\t\t};\n\t\t\tswitch ( separatorType ) {\n\t\t\t\tcase 'leftMargin':\n\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\tcase 'fullWidth':\n\t\t\t\tcase 'topFullWidth':\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t\tcase 'none':\n\t\t\t\t\treturn undefined;\n\t\t\t\tcase undefined:\n\t\t\t\t\tif ( showValue && icon ) {\n\t\t\t\t\t\treturn leftMarginStyle;\n\t\t\t\t\t}\n\t\t\t\t\treturn defaultSeparatorStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst getValueComponent = () => {\n\t\t\tconst styleRTL = I18nManager.isRTL && styles.cellValueRTL;\n\t\t\tconst cellValueStyle = this.props.getStylesFromColorScheme(\n\t\t\t\tstyles.cellValue,\n\t\t\t\tstyles.cellTextDark\n\t\t\t);\n\t\t\tconst finalStyle = {\n\t\t\t\t...cellValueStyle,\n\t\t\t\t...valueStyle,\n\t\t\t\t...styleRTL,\n\t\t\t};\n\n\t\t\t// To be able to show the `middle` ellipsizeMode on editable cells\n\t\t\t// we show the TextInput just when the user wants to edit the value,\n\t\t\t// and the Text component to display it.\n\t\t\t// We also show the TextInput to display placeholder.\n\t\t\tconst shouldShowPlaceholder = isValueEditable && value === '';\n\t\t\treturn this.state.isEditingValue || shouldShowPlaceholder ? (\n\t\t\t\t<TextInput\n\t\t\t\t\tref={ ( c ) => ( this._valueTextInput = c ) }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tstyle={ finalStyle }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tplaceholder={ valuePlaceholder }\n\t\t\t\t\tplaceholderTextColor={ '#87a6bc' }\n\t\t\t\t\tonChangeText={ onChangeValue }\n\t\t\t\t\teditable={ isValueEditable }\n\t\t\t\t\tpointerEvents={\n\t\t\t\t\t\tthis.state.isEditingValue ? 'auto' : 'none'\n\t\t\t\t\t}\n\t\t\t\t\tonFocus={ startEditing }\n\t\t\t\t\tonBlur={ finishEditing }\n\t\t\t\t\tonSubmitEditing={ onSubmit }\n\t\t\t\t\tkeyboardType={ this.typeToKeyboardType( type, step ) }\n\t\t\t\t\t{ ...valueProps }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ { ...cellValueStyle, ...valueStyle } }\n\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\tellipsizeMode={ 'middle' }\n\t\t\t\t>\n\t\t\t\t\t{ value }\n\t\t\t\t</Text>\n\t\t\t);\n\t\t};\n\n\t\tconst getAccessibilityLabel = () => {\n\t\t\tif ( accessible === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( accessibilityLabel || ! showValue ) {\n\t\t\t\treturn accessibilityLabel || label;\n\t\t\t}\n\n\t\t\tif ( isEmpty( value ) ) {\n\t\t\t\treturn isEmpty( help )\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */\n\t\t\t\t\t\t\t_x( '%s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t\t sprintf(\n\t\t\t\t\t\t\t/* translators: accessibility text. Empty state of a inline textinput cell. %1: Cell title, %2: cell help. */\n\t\t\t\t\t\t\t_x( '%1$s, %2$s. Empty', 'inline textinput cell' ),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\thelp\n\t\t\t\t\t );\n\t\t\t}\n\t\t\treturn isEmpty( help )\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */\n\t\t\t\t\t\t_x( '%1$s, %2$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue\n\t\t\t\t ) // Separating by ',' is necessary to make a pause on urls (non-capitalized text)\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. Inline textinput title, value and help text.%1: Cell title, %2: cell value, , %3: cell help. */\n\t\t\t\t\t\t_x( '%1$s, %2$s, %3$s', 'inline textinput cell' ),\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\thelp\n\t\t\t\t );\n\t\t};\n\n\t\tconst iconStyleBase = getStylesFromColorScheme(\n\t\t\tstyles.icon,\n\t\t\tstyles.iconDark\n\t\t);\n\t\tconst resetButtonStyle = getStylesFromColorScheme(\n\t\t\tstyles.resetButton,\n\t\t\tstyles.resetButtonDark\n\t\t);\n\t\tconst cellHelpStyle = [\n\t\t\tstyles.cellHelpLabel,\n\t\t\tisIOS && styles.cellHelpLabelIOS,\n\t\t];\n\t\tconst containerPointerEvents =\n\t\t\tthis.state.isScreenReaderEnabled && accessible ? 'none' : 'auto';\n\t\tconst { title, handler } = customActionButton || {};\n\n\t\tconst opacity =\n\t\t\tactiveOpacity !== undefined\n\t\t\t\t? activeOpacity\n\t\t\t\t: get( platformStyles, 'activeOpacity.opacity' );\n\n\t\treturn (\n\t\t\t<TouchableRipple\n\t\t\t\taccessible={\n\t\t\t\t\taccessible !== undefined\n\t\t\t\t\t\t? accessible\n\t\t\t\t\t\t: ! this.state.isEditingValue\n\t\t\t\t}\n\t\t\t\taccessibilityLabel={ getAccessibilityLabel() }\n\t\t\t\taccessibilityRole={ accessibilityRole || 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tisValueEditable\n\t\t\t\t\t\t? /* translators: accessibility text */\n\t\t\t\t\t\t __( 'Double tap to edit this value' )\n\t\t\t\t\t\t: accessibilityHint\n\t\t\t\t}\n\t\t\t\tdisabled={ disabled || ! isInteractive }\n\t\t\t\tactiveOpacity={ opacity }\n\t\t\t\tonPress={ onCellPress }\n\t\t\t\tonLongPress={ onLongPress }\n\t\t\t\tstyle={ [ styles.clipToBounds, style ] }\n\t\t\t\tborderless={ borderless }\n\t\t\t>\n\t\t\t\t{ drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t\t<View\n\t\t\t\t\tstyle={ cellContainerStyles }\n\t\t\t\t\tpointerEvents={ containerPointerEvents }\n\t\t\t\t>\n\t\t\t\t\t<View style={ rowContainerStyles }>\n\t\t\t\t\t\t<View style={ styles.cellRowContainer }>\n\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowContainer,\n\t\t\t\t\t\t\t\t\t\tstyles.cellRowIcon,\n\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\ticonStyle.color ||\n\t\t\t\t\t\t\t\t\t\t\ticonStyleBase.color\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tstyle={ iconStyle }\n\t\t\t\t\t\t\t\t\t\tisPressed={ false }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\t\t\tplatformStyles.labelIconSeparator\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ subLabel && label && (\n\t\t\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t\t\tdefaultLabelStyle,\n\t\t\t\t\t\t\t\t\t\t\tlabelStyle,\n\t\t\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<Text style={ defaultSubLabelStyleText }>\n\t\t\t\t\t\t\t\t\t\t{ subLabel }\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ ! subLabel && label && (\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tstyle={ [ defaultLabelStyle, labelStyle ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t{ customActionButton && (\n\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\tonPress={ handler }\n\t\t\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text style={ resetButtonStyle }>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tfill={ platformStyles.isSelected.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showValue && getValueComponent() }\n\t\t\t\t\t{ children }\n\t\t\t\t</View>\n\t\t\t\t{ help && (\n\t\t\t\t\t<Text style={ [ cellHelpStyle, styles.placeholderColor ] }>\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t\t{ ! drawTopSeparator && <View style={ separatorStyle() } /> }\n\t\t\t</TouchableRipple>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( BottomSheetCell );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cell.native.js"],"names":["TouchableOpacity","Text","View","TextInput","I18nManager","AccessibilityInfo","Platform","isEmpty","get","Icon","check","Component","__","_x","sprintf","withPreferredColorScheme","styles","platformStyles","TouchableRipple","isIOS","OS","BottomSheetCell","constructor","props","arguments","state","isEditingValue","autoFocus","isScreenReaderEnabled","handleScreenReaderToggled","bind","isCurrent","componentDidUpdate","prevProps","prevState","_valueTextInput","focus","componentDidMount","a11yInfoChangeSubscription","addEventListener","then","setState","componentWillUnmount","remove","typeToKeyboardType","type","step","keyboardType","Math","abs","render","accessible","accessibilityLabel","accessibilityHint","accessibilityRole","disabled","activeOpacity","onPress","onLongPress","label","subLabel","value","valuePlaceholder","icon","leftAlign","iconStyle","labelStyle","valueStyle","cellContainerStyle","cellRowContainerStyle","onChangeValue","onSubmit","children","editable","isSelected","separatorType","style","getStylesFromColorScheme","customActionButton","borderless","help","valueProps","showValue","undefined","isValueEditable","cellLabelStyle","cellLabel","cellTextDark","cellLabelCenteredStyle","cellLabelCentered","cellLabelLeftAlignNoIconStyle","cellLabelLeftAlignNoIcon","defaultMissingIconAndValue","defaultLabelStyle","defaultSubLabelStyleText","cellSubLabelText","cellSubLabelTextDark","drawSeparator","separatorStyle","drawTopSeparator","cellContainerStyles","cellContainer","rowContainerStyles","cellRowContainer","isInteractive","onCellPress","startEditing","finishEditing","defaultSeparatorStyle","separator","separatorDark","cellSeparatorStyle","cellSeparator","cellSeparatorDark","leftMarginStyle","separatorMarginLeft","getValueComponent","styleRTL","isRTL","cellValueRTL","cellValueStyle","cellValue","finalStyle","shouldShowPlaceholder","c","getAccessibilityLabel","iconStyleBase","iconDark","resetButtonStyle","resetButton","resetButtonDark","cellHelpStyle","cellHelpLabel","cellHelpLabelIOS","containerPointerEvents","title","handler","opacity","clipToBounds","cellRowIcon","color","labelIconSeparator","placeholderColor"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,IAFD,EAGCC,IAHD,EAICC,SAJD,EAKCC,WALD,EAMCC,iBAND,EAOCC,QAPD,QAQO,cARP;AASA,SAASC,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,eAAnB;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,eAAP,MAA4B,UAA5B;AAEA,MAAMC,KAAK,GAAGb,QAAQ,CAACc,EAAT,KAAgB,KAA9B;;AACA,MAAMC,eAAN,SAA8BV,SAA9B,CAAwC;AACvCW,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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,IAAI,EAAGO,cAAc,CAACyD,UAAf,CAA0BkE;AAFlC,MAjEF,EAsEG1D,SAAS,IAAIkC,iBAAiB,EAtEjC,EAuEG5C,QAvEH,CAtBD,EA+FGQ,IAAI,IACL,cAAC,IAAD;AAAM,MAAA,KAAK,EAAG,CAAEmD,aAAF,EAAiBnH,MAAM,CAAC8H,gBAAxB;AAAd,OACG9D,IADH,CAhGF,EAoGG,CAAEmB,gBAAF,IAAsB,cAAC,IAAD;AAAM,MAAA,KAAK,EAAGD,cAAc;AAA5B,MApGzB,CADD;AAwGA;;AAhZsC;;AAmZxC,eAAenF,wBAAwB,CAAEM,eAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tTouchableOpacity,\n\tText,\n\tView,\n\tTextInput,\n\tI18nManager,\n\tAccessibilityInfo,\n\tPlatform,\n} from 'react-native';\nimport { isEmpty, get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { check } from '@wordpress/icons';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport platformStyles from './cellStyles.scss';\nimport TouchableRipple from './ripple';\n\nconst isIOS = Platform.OS === 'ios';\nclass BottomSheetCell extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tisEditingValue: props.autoFocus || false,\n\t\t\tisScreenReaderEnabled: false,\n\t\t};\n\n\t\tthis.handleScreenReaderToggled =\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,14 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { findIndex } from 'lodash';
8
4
  /**
9
5
  * Internal dependencies
10
6
  */
11
-
12
7
  import Cell from './cell';
13
8
  export default function BottomSheetCyclePickerCell(props) {
14
9
  const {
@@ -22,7 +17,7 @@ export default function BottomSheetCyclePickerCell(props) {
22
17
  return options[(selectedOptionIndex + 1) % options.length].value;
23
18
  };
24
19
 
25
- const selectedOptionIndex = findIndex(options, ['value', value]);
20
+ const selectedOptionIndex = options.findIndex(option => option.value === value);
26
21
  const optionsContainsValue = options.length > 0 && selectedOptionIndex !== -1;
27
22
  return createElement(Cell, _extends({
28
23
  onPress: () => optionsContainsValue && onChangeValue(nextOptionValue()),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js"],"names":["findIndex","Cell","BottomSheetCyclePickerCell","props","value","options","onChangeValue","cellProps","nextOptionValue","selectedOptionIndex","length","optionsContainsValue","name"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA;AACA;AACA;;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,eAAe,SAASC,0BAAT,CAAqCC,KAArC,EAA6C;AAC3D,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,aAAlB;AAAiC,OAAGC;AAApC,MAAkDJ,KAAxD;;AAEA,QAAMK,eAAe,GAAG,MAAM;AAC7B,WAAOH,OAAO,CAAE,CAAEI,mBAAmB,GAAG,CAAxB,IAA8BJ,OAAO,CAACK,MAAxC,CAAP,CAAwDN,KAA/D;AACA,GAFD;;AAIA,QAAMK,mBAAmB,GAAGT,SAAS,CAAEK,OAAF,EAAW,CAAE,OAAF,EAAWD,KAAX,CAAX,CAArC;AACA,QAAMO,oBAAoB,GACzBN,OAAO,CAACK,MAAR,GAAiB,CAAjB,IAAsBD,mBAAmB,KAAK,CAAC,CADhD;AAGA,SACC,cAAC,IAAD;AACC,IAAA,OAAO,EAAG,MACTE,oBAAoB,IAAIL,aAAa,CAAEE,eAAe,EAAjB,CAFvC;AAIC,IAAA,QAAQ,EAAG,KAJZ;AAKC,IAAA,KAAK,EACJG,oBAAoB,IAAIN,OAAO,CAAEI,mBAAF,CAAP,CAA+BG;AANzD,KAQML,SARN,EADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport { findIndex } from 'lodash';\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\n\nexport default function BottomSheetCyclePickerCell( props ) {\n\tconst { value, options, onChangeValue, ...cellProps } = props;\n\n\tconst nextOptionValue = () => {\n\t\treturn options[ ( selectedOptionIndex + 1 ) % options.length ].value;\n\t};\n\n\tconst selectedOptionIndex = findIndex( options, [ 'value', value ] );\n\tconst optionsContainsValue =\n\t\toptions.length > 0 && selectedOptionIndex !== -1;\n\n\treturn (\n\t\t<Cell\n\t\t\tonPress={ () =>\n\t\t\t\toptionsContainsValue && onChangeValue( nextOptionValue() )\n\t\t\t}\n\t\t\teditable={ false }\n\t\t\tvalue={\n\t\t\t\toptionsContainsValue && options[ selectedOptionIndex ].name\n\t\t\t}\n\t\t\t{ ...cellProps }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/mobile/bottom-sheet/cycle-picker-cell.native.js"],"names":["Cell","BottomSheetCyclePickerCell","props","value","options","onChangeValue","cellProps","nextOptionValue","selectedOptionIndex","length","findIndex","option","optionsContainsValue","name"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,IAAP,MAAiB,QAAjB;AAEA,eAAe,SAASC,0BAAT,CAAqCC,KAArC,EAA6C;AAC3D,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,aAAlB;AAAiC,OAAGC;AAApC,MAAkDJ,KAAxD;;AAEA,QAAMK,eAAe,GAAG,MAAM;AAC7B,WAAOH,OAAO,CAAE,CAAEI,mBAAmB,GAAG,CAAxB,IAA8BJ,OAAO,CAACK,MAAxC,CAAP,CAAwDN,KAA/D;AACA,GAFD;;AAIA,QAAMK,mBAAmB,GAAGJ,OAAO,CAACM,SAAR,CACzBC,MAAF,IAAcA,MAAM,CAACR,KAAP,KAAiBA,KADJ,CAA5B;AAGA,QAAMS,oBAAoB,GACzBR,OAAO,CAACK,MAAR,GAAiB,CAAjB,IAAsBD,mBAAmB,KAAK,CAAC,CADhD;AAGA,SACC,cAAC,IAAD;AACC,IAAA,OAAO,EAAG,MACTI,oBAAoB,IAAIP,aAAa,CAAEE,eAAe,EAAjB,CAFvC;AAIC,IAAA,QAAQ,EAAG,KAJZ;AAKC,IAAA,KAAK,EACJK,oBAAoB,IAAIR,OAAO,CAAEI,mBAAF,CAAP,CAA+BK;AANzD,KAQMP,SARN,EADD;AAYA","sourcesContent":["/**\n * Internal dependencies\n */\nimport Cell from './cell';\n\nexport default function BottomSheetCyclePickerCell( props ) {\n\tconst { value, options, onChangeValue, ...cellProps } = props;\n\n\tconst nextOptionValue = () => {\n\t\treturn options[ ( selectedOptionIndex + 1 ) % options.length ].value;\n\t};\n\n\tconst selectedOptionIndex = options.findIndex(\n\t\t( option ) => option.value === value\n\t);\n\tconst optionsContainsValue =\n\t\toptions.length > 0 && selectedOptionIndex !== -1;\n\n\treturn (\n\t\t<Cell\n\t\t\tonPress={ () =>\n\t\t\t\toptionsContainsValue && onChangeValue( nextOptionValue() )\n\t\t\t}\n\t\t\teditable={ false }\n\t\t\tvalue={\n\t\t\t\toptionsContainsValue && options[ selectedOptionIndex ].name\n\t\t\t}\n\t\t\t{ ...cellProps }\n\t\t/>\n\t);\n}\n"]}