@wordpress/components 20.0.2-next.957ca95e4c.0 → 21.0.1

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 (895) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/CONTRIBUTING.md +3 -54
  3. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  5. package/build/angle-picker-control/index.js +10 -0
  6. package/build/angle-picker-control/index.js.map +1 -1
  7. package/build/autocomplete/autocompleter-ui.js +3 -3
  8. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  9. package/build/border-box-control/border-box-control/component.js +10 -7
  10. package/build/border-box-control/border-box-control/component.js.map +1 -1
  11. package/build/border-box-control/border-box-control-linked-button/component.js +1 -2
  12. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  13. package/build/border-box-control/border-box-control-split-controls/component.js +10 -7
  14. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  15. package/build/border-box-control/styles.js +7 -7
  16. package/build/border-box-control/styles.js.map +1 -1
  17. package/build/border-control/border-control-dropdown/component.js +2 -1
  18. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  19. package/build/box-control/linked-button.js +3 -3
  20. package/build/box-control/linked-button.js.map +1 -1
  21. package/build/card/styles.js +17 -17
  22. package/build/card/styles.js.map +1 -1
  23. package/build/checkbox-control/index.js +3 -3
  24. package/build/checkbox-control/index.js.map +1 -1
  25. package/build/color-palette/index.js +1 -1
  26. package/build/color-palette/index.js.map +1 -1
  27. package/build/color-picker/input-with-slider.js +2 -1
  28. package/build/color-picker/input-with-slider.js.map +1 -1
  29. package/build/combobox-control/index.js +1 -1
  30. package/build/combobox-control/index.js.map +1 -1
  31. package/build/custom-gradient-picker/index.js +1 -1
  32. package/build/custom-gradient-picker/index.js.map +1 -1
  33. package/build/date-time/date/index.js +1 -1
  34. package/build/date-time/date/index.js.map +1 -1
  35. package/build/date-time/time/timezone.js +1 -1
  36. package/build/date-time/time/timezone.js.map +1 -1
  37. package/build/disabled/index.js +14 -6
  38. package/build/disabled/index.js.map +1 -1
  39. package/build/disabled/styles/disabled-styles.js +8 -18
  40. package/build/disabled/styles/disabled-styles.js.map +1 -1
  41. package/build/drop-zone/index.js +44 -9
  42. package/build/drop-zone/index.js.map +1 -1
  43. package/build/drop-zone/provider.js.map +1 -1
  44. package/build/drop-zone/types.js +6 -0
  45. package/build/drop-zone/types.js.map +1 -0
  46. package/build/dropdown/index.js +11 -4
  47. package/build/dropdown/index.js.map +1 -1
  48. package/build/flex/flex/hook.js +6 -30
  49. package/build/flex/flex/hook.js.map +1 -1
  50. package/build/focal-point-picker/controls.js +10 -5
  51. package/build/focal-point-picker/controls.js.map +1 -1
  52. package/build/focal-point-picker/focal-point.js.map +1 -1
  53. package/build/focal-point-picker/grid.js.map +1 -1
  54. package/build/focal-point-picker/index.js +83 -16
  55. package/build/focal-point-picker/index.js.map +1 -1
  56. package/build/focal-point-picker/media.js +4 -0
  57. package/build/focal-point-picker/media.js.map +1 -1
  58. package/build/focal-point-picker/styles/focal-point-picker-style.js +70 -41
  59. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  60. package/build/focal-point-picker/styles/focal-point-style.js +12 -12
  61. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  62. package/build/focal-point-picker/types.js +6 -0
  63. package/build/focal-point-picker/types.js.map +1 -0
  64. package/build/focal-point-picker/utils.js +6 -6
  65. package/build/focal-point-picker/utils.js.map +1 -1
  66. package/build/font-size-picker/index.js +11 -0
  67. package/build/font-size-picker/index.js.map +1 -1
  68. package/build/font-size-picker/utils.js +1 -1
  69. package/build/font-size-picker/utils.js.map +1 -1
  70. package/build/form-file-upload/index.js +22 -2
  71. package/build/form-file-upload/index.js.map +1 -1
  72. package/build/form-file-upload/types.js +6 -0
  73. package/build/form-file-upload/types.js.map +1 -0
  74. package/build/form-toggle/index.js +1 -3
  75. package/build/form-toggle/index.js.map +1 -1
  76. package/build/form-token-field/index.js +4 -6
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/form-token-field/suggestions-list.js +1 -3
  79. package/build/form-token-field/suggestions-list.js.map +1 -1
  80. package/build/gradient-picker/index.js +25 -26
  81. package/build/gradient-picker/index.js.map +1 -1
  82. package/build/icon/index.js +1 -2
  83. package/build/icon/index.js.map +1 -1
  84. package/build/input-control/input-base.js +3 -2
  85. package/build/input-control/input-base.js.map +1 -1
  86. package/build/input-control/label.js +2 -2
  87. package/build/input-control/label.js.map +1 -1
  88. package/build/input-control/styles/input-control-styles.js +41 -128
  89. package/build/input-control/styles/input-control-styles.js.map +1 -1
  90. package/build/modal/aria-helper.js +3 -10
  91. package/build/modal/aria-helper.js.map +1 -1
  92. package/build/navigable-container/container.js +5 -1
  93. package/build/navigable-container/container.js.map +1 -1
  94. package/build/navigable-container/menu.js +10 -12
  95. package/build/navigable-container/menu.js.map +1 -1
  96. package/build/navigable-container/tabbable.js +2 -4
  97. package/build/navigable-container/tabbable.js.map +1 -1
  98. package/build/navigation/menu/menu-title-search.js +2 -1
  99. package/build/navigation/menu/menu-title-search.js.map +1 -1
  100. package/build/navigation/menu/use-navigation-tree-menu.js +2 -1
  101. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  102. package/build/navigator/navigator-button/hook.js +1 -1
  103. package/build/navigator/navigator-button/hook.js.map +1 -1
  104. package/build/navigator/navigator-screen/component.js +2 -2
  105. package/build/navigator/navigator-screen/component.js.map +1 -1
  106. package/build/number-control/index.js +29 -25
  107. package/build/number-control/index.js.map +1 -1
  108. package/build/number-control/types.js +6 -0
  109. package/build/number-control/types.js.map +1 -0
  110. package/build/placeholder/index.js +1 -3
  111. package/build/placeholder/index.js.map +1 -1
  112. package/build/popover/index.js +190 -160
  113. package/build/popover/index.js.map +1 -1
  114. package/build/popover/types.js +6 -0
  115. package/build/popover/types.js.map +1 -0
  116. package/build/popover/utils.js +125 -24
  117. package/build/popover/utils.js.map +1 -1
  118. package/build/radio-control/index.js +7 -4
  119. package/build/radio-control/index.js.map +1 -1
  120. package/build/range-control/index.js +4 -1
  121. package/build/range-control/index.js.map +1 -1
  122. package/build/range-control/styles/range-control-styles.js +33 -33
  123. package/build/range-control/styles/range-control-styles.js.map +1 -1
  124. package/build/sandbox/index.js +2 -2
  125. package/build/sandbox/index.js.map +1 -1
  126. package/build/search-control/index.js +38 -10
  127. package/build/search-control/index.js.map +1 -1
  128. package/build/search-control/types.js +6 -0
  129. package/build/search-control/types.js.map +1 -0
  130. package/build/select-control/index.native.js +2 -1
  131. package/build/select-control/index.native.js.map +1 -1
  132. package/build/tab-panel/index.js +48 -9
  133. package/build/tab-panel/index.js.map +1 -1
  134. package/build/tab-panel/types.js +6 -0
  135. package/build/tab-panel/types.js.map +1 -0
  136. package/build/text-control/index.js +2 -0
  137. package/build/text-control/index.js.map +1 -1
  138. package/build/textarea-control/index.js +3 -3
  139. package/build/textarea-control/index.js.map +1 -1
  140. package/build/toggle-control/index.js +44 -4
  141. package/build/toggle-control/index.js.map +1 -1
  142. package/build/toggle-control/types.js +6 -0
  143. package/build/toggle-control/types.js.map +1 -0
  144. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  145. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  146. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  147. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  148. package/build/tooltip/index.js +9 -7
  149. package/build/tooltip/index.js.map +1 -1
  150. package/build/ui/context/context-connect.js +31 -22
  151. package/build/ui/context/context-connect.js.map +1 -1
  152. package/build/ui/context/context-system-provider.js +4 -3
  153. package/build/ui/context/context-system-provider.js.map +1 -1
  154. package/build/unit-control/index.js +1 -1
  155. package/build/unit-control/index.js.map +1 -1
  156. package/build/unit-control/styles/unit-control-styles.js +9 -9
  157. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  158. package/build/utils/colors-values.js +2 -30
  159. package/build/utils/colors-values.js.map +1 -1
  160. package/build/utils/math.js +4 -4
  161. package/build/utils/math.js.map +1 -1
  162. package/build/utils/values.js +62 -6
  163. package/build/utils/values.js.map +1 -1
  164. package/build/view/component.js +6 -7
  165. package/build/view/component.js.map +1 -1
  166. package/build/view/types.js +6 -0
  167. package/build/view/types.js.map +1 -0
  168. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  169. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  170. package/build-module/angle-picker-control/index.js +9 -0
  171. package/build-module/angle-picker-control/index.js.map +1 -1
  172. package/build-module/autocomplete/autocompleter-ui.js +4 -4
  173. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  174. package/build-module/border-box-control/border-box-control/component.js +11 -8
  175. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  176. package/build-module/border-box-control/border-box-control-linked-button/component.js +1 -2
  177. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  178. package/build-module/border-box-control/border-box-control-split-controls/component.js +11 -8
  179. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  180. package/build-module/border-box-control/styles.js +7 -7
  181. package/build-module/border-box-control/styles.js.map +1 -1
  182. package/build-module/border-control/border-control-dropdown/component.js +2 -1
  183. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  184. package/build-module/box-control/linked-button.js +3 -3
  185. package/build-module/box-control/linked-button.js.map +1 -1
  186. package/build-module/card/styles.js +17 -17
  187. package/build-module/card/styles.js.map +1 -1
  188. package/build-module/checkbox-control/index.js +3 -3
  189. package/build-module/checkbox-control/index.js.map +1 -1
  190. package/build-module/color-palette/index.js +1 -1
  191. package/build-module/color-palette/index.js.map +1 -1
  192. package/build-module/color-picker/input-with-slider.js +2 -1
  193. package/build-module/color-picker/input-with-slider.js.map +1 -1
  194. package/build-module/combobox-control/index.js +1 -1
  195. package/build-module/combobox-control/index.js.map +1 -1
  196. package/build-module/custom-gradient-picker/index.js +1 -1
  197. package/build-module/custom-gradient-picker/index.js.map +1 -1
  198. package/build-module/date-time/date/index.js +2 -3
  199. package/build-module/date-time/date/index.js.map +1 -1
  200. package/build-module/date-time/time/timezone.js +1 -1
  201. package/build-module/date-time/time/timezone.js.map +1 -1
  202. package/build-module/disabled/index.js +16 -8
  203. package/build-module/disabled/index.js.map +1 -1
  204. package/build-module/disabled/styles/disabled-styles.js +6 -12
  205. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  206. package/build-module/drop-zone/index.js +40 -9
  207. package/build-module/drop-zone/index.js.map +1 -1
  208. package/build-module/drop-zone/provider.js.map +1 -1
  209. package/build-module/drop-zone/types.js +2 -0
  210. package/build-module/drop-zone/types.js.map +1 -0
  211. package/build-module/dropdown/index.js +10 -4
  212. package/build-module/dropdown/index.js.map +1 -1
  213. package/build-module/flex/flex/hook.js +7 -29
  214. package/build-module/flex/flex/hook.js.map +1 -1
  215. package/build-module/focal-point-picker/controls.js +11 -6
  216. package/build-module/focal-point-picker/controls.js.map +1 -1
  217. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  218. package/build-module/focal-point-picker/grid.js.map +1 -1
  219. package/build-module/focal-point-picker/index.js +81 -16
  220. package/build-module/focal-point-picker/index.js.map +1 -1
  221. package/build-module/focal-point-picker/media.js +4 -0
  222. package/build-module/focal-point-picker/media.js.map +1 -1
  223. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +68 -40
  224. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  225. package/build-module/focal-point-picker/styles/focal-point-style.js +12 -12
  226. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  227. package/build-module/focal-point-picker/types.js +2 -0
  228. package/build-module/focal-point-picker/types.js.map +1 -0
  229. package/build-module/focal-point-picker/utils.js +6 -6
  230. package/build-module/focal-point-picker/utils.js.map +1 -1
  231. package/build-module/font-size-picker/index.js +10 -0
  232. package/build-module/font-size-picker/index.js.map +1 -1
  233. package/build-module/font-size-picker/utils.js +1 -1
  234. package/build-module/font-size-picker/utils.js.map +1 -1
  235. package/build-module/form-file-upload/index.js +21 -4
  236. package/build-module/form-file-upload/index.js.map +1 -1
  237. package/build-module/form-file-upload/types.js +2 -0
  238. package/build-module/form-file-upload/types.js.map +1 -0
  239. package/build-module/form-toggle/index.js +1 -3
  240. package/build-module/form-toggle/index.js.map +1 -1
  241. package/build-module/form-token-field/index.js +4 -5
  242. package/build-module/form-token-field/index.js.map +1 -1
  243. package/build-module/form-token-field/suggestions-list.js +1 -2
  244. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  245. package/build-module/gradient-picker/index.js +25 -26
  246. package/build-module/gradient-picker/index.js.map +1 -1
  247. package/build-module/icon/index.js +1 -2
  248. package/build-module/icon/index.js.map +1 -1
  249. package/build-module/input-control/input-base.js +4 -3
  250. package/build-module/input-control/input-base.js.map +1 -1
  251. package/build-module/input-control/label.js +3 -3
  252. package/build-module/input-control/label.js.map +1 -1
  253. package/build-module/input-control/styles/input-control-styles.js +41 -127
  254. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  255. package/build-module/modal/aria-helper.js +3 -8
  256. package/build-module/modal/aria-helper.js.map +1 -1
  257. package/build-module/navigable-container/container.js +5 -1
  258. package/build-module/navigable-container/container.js.map +1 -1
  259. package/build-module/navigable-container/menu.js +10 -11
  260. package/build-module/navigable-container/menu.js.map +1 -1
  261. package/build-module/navigable-container/tabbable.js +2 -3
  262. package/build-module/navigable-container/tabbable.js.map +1 -1
  263. package/build-module/navigation/menu/menu-title-search.js +2 -1
  264. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  265. package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -1
  266. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  267. package/build-module/navigator/navigator-button/hook.js +1 -1
  268. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  269. package/build-module/navigator/navigator-screen/component.js +2 -2
  270. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  271. package/build-module/number-control/index.js +31 -23
  272. package/build-module/number-control/index.js.map +1 -1
  273. package/build-module/number-control/types.js +2 -0
  274. package/build-module/number-control/types.js.map +1 -0
  275. package/build-module/placeholder/index.js +1 -3
  276. package/build-module/placeholder/index.js.map +1 -1
  277. package/build-module/popover/index.js +192 -162
  278. package/build-module/popover/index.js.map +1 -1
  279. package/build-module/popover/types.js +2 -0
  280. package/build-module/popover/types.js.map +1 -0
  281. package/build-module/popover/utils.js +118 -23
  282. package/build-module/popover/utils.js.map +1 -1
  283. package/build-module/radio-control/index.js +7 -5
  284. package/build-module/radio-control/index.js.map +1 -1
  285. package/build-module/range-control/index.js +4 -1
  286. package/build-module/range-control/index.js.map +1 -1
  287. package/build-module/range-control/styles/range-control-styles.js +33 -33
  288. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  289. package/build-module/sandbox/index.js +2 -2
  290. package/build-module/sandbox/index.js.map +1 -1
  291. package/build-module/search-control/index.js +34 -7
  292. package/build-module/search-control/index.js.map +1 -1
  293. package/build-module/search-control/types.js +2 -0
  294. package/build-module/search-control/types.js.map +1 -0
  295. package/build-module/select-control/index.native.js +1 -1
  296. package/build-module/select-control/index.native.js.map +1 -1
  297. package/build-module/tab-panel/index.js +46 -10
  298. package/build-module/tab-panel/index.js.map +1 -1
  299. package/build-module/tab-panel/types.js +2 -0
  300. package/build-module/tab-panel/types.js.map +1 -0
  301. package/build-module/text-control/index.js +2 -0
  302. package/build-module/text-control/index.js.map +1 -1
  303. package/build-module/textarea-control/index.js +3 -3
  304. package/build-module/textarea-control/index.js.map +1 -1
  305. package/build-module/toggle-control/index.js +38 -4
  306. package/build-module/toggle-control/index.js.map +1 -1
  307. package/build-module/toggle-control/types.js +2 -0
  308. package/build-module/toggle-control/types.js.map +1 -0
  309. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  310. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  311. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  312. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  313. package/build-module/tooltip/index.js +10 -8
  314. package/build-module/tooltip/index.js.map +1 -1
  315. package/build-module/ui/context/context-connect.js +30 -23
  316. package/build-module/ui/context/context-connect.js.map +1 -1
  317. package/build-module/ui/context/context-system-provider.js +5 -4
  318. package/build-module/ui/context/context-system-provider.js.map +1 -1
  319. package/build-module/unit-control/index.js +1 -1
  320. package/build-module/unit-control/index.js.map +1 -1
  321. package/build-module/unit-control/styles/unit-control-styles.js +9 -9
  322. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  323. package/build-module/utils/colors-values.js +2 -30
  324. package/build-module/utils/colors-values.js.map +1 -1
  325. package/build-module/utils/math.js +4 -4
  326. package/build-module/utils/math.js.map +1 -1
  327. package/build-module/utils/values.js +48 -6
  328. package/build-module/utils/values.js.map +1 -1
  329. package/build-module/view/component.js +5 -8
  330. package/build-module/view/component.js.map +1 -1
  331. package/build-module/view/types.js +2 -0
  332. package/build-module/view/types.js.map +1 -0
  333. package/build-style/style-rtl.css +4 -31
  334. package/build-style/style.css +4 -31
  335. package/build-types/base-field/hook.d.ts +54 -55
  336. package/build-types/base-field/hook.d.ts.map +1 -1
  337. package/build-types/border-box-control/border-box-control/component.d.ts +10 -2
  338. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  339. package/build-types/border-box-control/border-box-control/hook.d.ts +56 -57
  340. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  341. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +2 -1
  342. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  343. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +55 -56
  344. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  345. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +9 -2
  346. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  347. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +56 -57
  348. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  349. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +2 -1
  350. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  351. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +55 -56
  352. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  353. package/build-types/border-box-control/styles.d.ts.map +1 -1
  354. package/build-types/border-box-control/types.d.ts +5 -4
  355. package/build-types/border-box-control/types.d.ts.map +1 -1
  356. package/build-types/border-control/border-control/component.d.ts +14 -2
  357. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  358. package/build-types/border-control/border-control/hook.d.ts +56 -57
  359. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  360. package/build-types/border-control/border-control-dropdown/component.d.ts +10 -2
  361. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  362. package/build-types/border-control/border-control-dropdown/hook.d.ts +56 -57
  363. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  364. package/build-types/border-control/border-control-style-picker/component.d.ts +6 -2
  365. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  366. package/build-types/border-control/border-control-style-picker/hook.d.ts +55 -56
  367. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  368. package/build-types/border-control/stories/index.d.ts +74 -6
  369. package/build-types/border-control/stories/index.d.ts.map +1 -1
  370. package/build-types/border-control/types.d.ts +6 -8
  371. package/build-types/border-control/types.d.ts.map +1 -1
  372. package/build-types/button-group/index.d.ts +1 -3
  373. package/build-types/button-group/index.d.ts.map +1 -1
  374. package/build-types/card/card/component.d.ts +9 -2
  375. package/build-types/card/card/component.d.ts.map +1 -1
  376. package/build-types/card/card/hook.d.ts +55 -56
  377. package/build-types/card/card/hook.d.ts.map +1 -1
  378. package/build-types/card/card-body/component.d.ts +9 -2
  379. package/build-types/card/card-body/component.d.ts.map +1 -1
  380. package/build-types/card/card-body/hook.d.ts +55 -56
  381. package/build-types/card/card-body/hook.d.ts.map +1 -1
  382. package/build-types/card/card-divider/component.d.ts +7 -2
  383. package/build-types/card/card-divider/component.d.ts.map +1 -1
  384. package/build-types/card/card-divider/hook.d.ts +55 -55
  385. package/build-types/card/card-footer/component.d.ts +11 -2
  386. package/build-types/card/card-footer/component.d.ts.map +1 -1
  387. package/build-types/card/card-footer/hook.d.ts +55 -56
  388. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  389. package/build-types/card/card-header/component.d.ts +1 -1
  390. package/build-types/card/card-header/component.d.ts.map +1 -1
  391. package/build-types/card/card-header/hook.d.ts +55 -56
  392. package/build-types/card/card-header/hook.d.ts.map +1 -1
  393. package/build-types/card/card-media/component.d.ts +2 -1
  394. package/build-types/card/card-media/component.d.ts.map +1 -1
  395. package/build-types/card/card-media/hook.d.ts +55 -56
  396. package/build-types/card/card-media/hook.d.ts.map +1 -1
  397. package/build-types/checkbox-control/index.d.ts +1 -1
  398. package/build-types/checkbox-control/index.d.ts.map +1 -1
  399. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  400. package/build-types/checkbox-control/types.d.ts +1 -1
  401. package/build-types/checkbox-control/types.d.ts.map +1 -1
  402. package/build-types/color-indicator/index.d.ts +1 -3
  403. package/build-types/color-indicator/index.d.ts.map +1 -1
  404. package/build-types/color-palette/styles.d.ts +1 -3
  405. package/build-types/color-palette/styles.d.ts.map +1 -1
  406. package/build-types/color-picker/component.d.ts +2 -1
  407. package/build-types/color-picker/component.d.ts.map +1 -1
  408. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  409. package/build-types/color-picker/styles.d.ts +12 -25
  410. package/build-types/color-picker/styles.d.ts.map +1 -1
  411. package/build-types/confirm-dialog/component.d.ts +4 -8
  412. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  413. package/build-types/date-time/date/styles.d.ts +4 -8
  414. package/build-types/date-time/date/styles.d.ts.map +1 -1
  415. package/build-types/date-time/date-time/styles.d.ts +4 -6
  416. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  417. package/build-types/date-time/time/styles.d.ts +21 -43
  418. package/build-types/date-time/time/styles.d.ts.map +1 -1
  419. package/build-types/disabled/index.d.ts +1 -1
  420. package/build-types/disabled/index.d.ts.map +1 -1
  421. package/build-types/disabled/styles/disabled-styles.d.ts +1 -5
  422. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  423. package/build-types/divider/component.d.ts +7 -2
  424. package/build-types/divider/component.d.ts.map +1 -1
  425. package/build-types/drop-zone/index.d.ts +29 -0
  426. package/build-types/drop-zone/index.d.ts.map +1 -0
  427. package/build-types/drop-zone/provider.d.ts +5 -0
  428. package/build-types/drop-zone/provider.d.ts.map +1 -0
  429. package/build-types/drop-zone/stories/index.d.ts +12 -0
  430. package/build-types/drop-zone/stories/index.d.ts.map +1 -0
  431. package/build-types/drop-zone/types.d.ts +29 -0
  432. package/build-types/drop-zone/types.d.ts.map +1 -0
  433. package/build-types/dropdown/dropdown-content-wrapper.d.ts +2 -1
  434. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  435. package/build-types/dropdown/index.d.ts.map +1 -1
  436. package/build-types/elevation/component.d.ts +2 -1
  437. package/build-types/elevation/component.d.ts.map +1 -1
  438. package/build-types/elevation/hook.d.ts +54 -55
  439. package/build-types/elevation/hook.d.ts.map +1 -1
  440. package/build-types/external-link/index.d.ts +1 -1
  441. package/build-types/external-link/index.d.ts.map +1 -1
  442. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  443. package/build-types/flex/flex/component.d.ts +2 -1
  444. package/build-types/flex/flex/component.d.ts.map +1 -1
  445. package/build-types/flex/flex/hook.d.ts +55 -56
  446. package/build-types/flex/flex/hook.d.ts.map +1 -1
  447. package/build-types/flex/flex-block/component.d.ts +2 -1
  448. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  449. package/build-types/flex/flex-block/hook.d.ts +55 -56
  450. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  451. package/build-types/flex/flex-item/component.d.ts +2 -1
  452. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  453. package/build-types/flex/flex-item/hook.d.ts +55 -56
  454. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  455. package/build-types/focal-point-picker/controls.d.ts +4 -0
  456. package/build-types/focal-point-picker/controls.d.ts.map +1 -0
  457. package/build-types/focal-point-picker/focal-point.d.ts +5 -0
  458. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -0
  459. package/build-types/focal-point-picker/grid.d.ts +5 -0
  460. package/build-types/focal-point-picker/grid.d.ts.map +1 -0
  461. package/build-types/focal-point-picker/index.d.ts +51 -0
  462. package/build-types/focal-point-picker/index.d.ts.map +1 -0
  463. package/build-types/focal-point-picker/media.d.ts +4 -0
  464. package/build-types/focal-point-picker/media.d.ts.map +1 -0
  465. package/build-types/focal-point-picker/stories/index.d.ts +15 -0
  466. package/build-types/focal-point-picker/stories/index.d.ts.map +1 -0
  467. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +56 -0
  468. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -0
  469. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +19 -0
  470. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -0
  471. package/build-types/focal-point-picker/types.d.ts +79 -0
  472. package/build-types/focal-point-picker/types.d.ts.map +1 -0
  473. package/build-types/focal-point-picker/utils.d.ts +26 -0
  474. package/build-types/focal-point-picker/utils.d.ts.map +1 -0
  475. package/build-types/form-file-upload/index.d.ts +22 -0
  476. package/build-types/form-file-upload/index.d.ts.map +1 -0
  477. package/build-types/form-file-upload/stories/index.d.ts +23 -0
  478. package/build-types/form-file-upload/stories/index.d.ts.map +1 -0
  479. package/build-types/form-file-upload/test/index.d.ts +2 -0
  480. package/build-types/form-file-upload/test/index.d.ts.map +1 -0
  481. package/build-types/form-file-upload/types.d.ts +63 -0
  482. package/build-types/form-file-upload/types.d.ts.map +1 -0
  483. package/build-types/form-toggle/index.d.ts +1 -1
  484. package/build-types/form-toggle/index.d.ts.map +1 -1
  485. package/build-types/form-token-field/index.d.ts.map +1 -1
  486. package/build-types/form-token-field/styles.d.ts +1 -3
  487. package/build-types/form-token-field/styles.d.ts.map +1 -1
  488. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  489. package/build-types/form-token-field/token-input.d.ts +1 -3
  490. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  491. package/build-types/grid/component.d.ts +2 -1
  492. package/build-types/grid/component.d.ts.map +1 -1
  493. package/build-types/grid/hook.d.ts +55 -56
  494. package/build-types/grid/hook.d.ts.map +1 -1
  495. package/build-types/h-stack/component.d.ts +5 -2
  496. package/build-types/h-stack/component.d.ts.map +1 -1
  497. package/build-types/h-stack/hook.d.ts +55 -56
  498. package/build-types/h-stack/hook.d.ts.map +1 -1
  499. package/build-types/heading/component.d.ts +4 -2
  500. package/build-types/heading/component.d.ts.map +1 -1
  501. package/build-types/heading/hook.d.ts +54 -55
  502. package/build-types/heading/hook.d.ts.map +1 -1
  503. package/build-types/input-control/index.d.ts +1 -1
  504. package/build-types/input-control/index.d.ts.map +1 -1
  505. package/build-types/input-control/input-base.d.ts.map +1 -1
  506. package/build-types/input-control/input-field.d.ts +1 -3
  507. package/build-types/input-control/input-field.d.ts.map +1 -1
  508. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -1
  509. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  510. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -1
  511. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  512. package/build-types/input-control/label.d.ts.map +1 -1
  513. package/build-types/input-control/stories/index.d.ts +5 -5
  514. package/build-types/input-control/stories/index.d.ts.map +1 -1
  515. package/build-types/input-control/styles/input-control-styles.d.ts +2 -6
  516. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  517. package/build-types/input-control/types.d.ts +3 -0
  518. package/build-types/input-control/types.d.ts.map +1 -1
  519. package/build-types/item-group/item/component.d.ts +2 -1
  520. package/build-types/item-group/item/component.d.ts.map +1 -1
  521. package/build-types/item-group/item/hook.d.ts +54 -55
  522. package/build-types/item-group/item/hook.d.ts.map +1 -1
  523. package/build-types/item-group/item-group/component.d.ts +2 -1
  524. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  525. package/build-types/item-group/item-group/hook.d.ts +54 -55
  526. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  527. package/build-types/modal/aria-helper.d.ts.map +1 -1
  528. package/build-types/navigable-container/menu.d.ts.map +1 -1
  529. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  530. package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
  531. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  532. package/build-types/navigator/navigator-back-button/hook.d.ts +59 -60
  533. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  534. package/build-types/navigator/navigator-button/component.d.ts +7 -2
  535. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  536. package/build-types/navigator/navigator-button/hook.d.ts +59 -60
  537. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  538. package/build-types/navigator/navigator-provider/component.d.ts +2 -1
  539. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  540. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  541. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  542. package/build-types/number-control/index.d.ts +10 -28
  543. package/build-types/number-control/index.d.ts.map +1 -1
  544. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  545. package/build-types/number-control/types.d.ts +72 -0
  546. package/build-types/number-control/types.d.ts.map +1 -0
  547. package/build-types/placeholder/index.d.ts +1 -1
  548. package/build-types/placeholder/index.d.ts.map +1 -1
  549. package/build-types/popover/index.d.ts +28 -24
  550. package/build-types/popover/index.d.ts.map +1 -1
  551. package/build-types/popover/stories/index.d.ts +12 -0
  552. package/build-types/popover/stories/index.d.ts.map +1 -0
  553. package/build-types/popover/types.d.ts +179 -0
  554. package/build-types/popover/types.d.ts.map +1 -0
  555. package/build-types/popover/utils.d.ts +42 -24
  556. package/build-types/popover/utils.d.ts.map +1 -1
  557. package/build-types/radio-control/index.d.ts +1 -1
  558. package/build-types/radio-control/index.d.ts.map +1 -1
  559. package/build-types/range-control/index.d.ts +2 -4
  560. package/build-types/range-control/index.d.ts.map +1 -1
  561. package/build-types/range-control/input-range.d.ts +2 -4
  562. package/build-types/range-control/input-range.d.ts.map +1 -1
  563. package/build-types/range-control/styles/range-control-styles.d.ts +5 -10
  564. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  565. package/build-types/resizable-box/index.d.ts +1 -1
  566. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  567. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  568. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +1 -3
  569. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  570. package/build-types/scrollable/component.d.ts +2 -1
  571. package/build-types/scrollable/component.d.ts.map +1 -1
  572. package/build-types/scrollable/hook.d.ts +55 -56
  573. package/build-types/scrollable/hook.d.ts.map +1 -1
  574. package/build-types/search-control/index.d.ts +29 -0
  575. package/build-types/search-control/index.d.ts.map +1 -0
  576. package/build-types/search-control/stories/index.d.ts +47 -0
  577. package/build-types/search-control/stories/index.d.ts.map +1 -0
  578. package/build-types/search-control/types.d.ts +39 -0
  579. package/build-types/search-control/types.d.ts.map +1 -0
  580. package/build-types/select-control/index.d.ts +1 -3
  581. package/build-types/select-control/index.d.ts.map +1 -1
  582. package/build-types/select-control/stories/index.d.ts +2 -6
  583. package/build-types/select-control/stories/index.d.ts.map +1 -1
  584. package/build-types/select-control/styles/select-control-styles.d.ts +1 -3
  585. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  586. package/build-types/spacer/component.d.ts +2 -1
  587. package/build-types/spacer/component.d.ts.map +1 -1
  588. package/build-types/spacer/hook.d.ts +55 -56
  589. package/build-types/spacer/hook.d.ts.map +1 -1
  590. package/build-types/spinner/index.d.ts +1 -3
  591. package/build-types/spinner/index.d.ts.map +1 -1
  592. package/build-types/surface/component.d.ts +2 -1
  593. package/build-types/surface/component.d.ts.map +1 -1
  594. package/build-types/surface/hook.d.ts +55 -56
  595. package/build-types/surface/hook.d.ts.map +1 -1
  596. package/build-types/tab-panel/index.d.ts +42 -0
  597. package/build-types/tab-panel/index.d.ts.map +1 -0
  598. package/build-types/tab-panel/stories/index.d.ts +12 -0
  599. package/build-types/tab-panel/stories/index.d.ts.map +1 -0
  600. package/build-types/tab-panel/test/index.d.ts +2 -0
  601. package/build-types/tab-panel/test/index.d.ts.map +1 -0
  602. package/build-types/tab-panel/types.d.ts +64 -0
  603. package/build-types/tab-panel/types.d.ts.map +1 -0
  604. package/build-types/text/component.d.ts +1 -1
  605. package/build-types/text/component.d.ts.map +1 -1
  606. package/build-types/text/hook.d.ts +55 -56
  607. package/build-types/text/hook.d.ts.map +1 -1
  608. package/build-types/text-control/index.d.ts +2 -4
  609. package/build-types/text-control/index.d.ts.map +1 -1
  610. package/build-types/text-control/types.d.ts +1 -1
  611. package/build-types/text-control/types.d.ts.map +1 -1
  612. package/build-types/textarea-control/index.d.ts +1 -1
  613. package/build-types/textarea-control/index.d.ts.map +1 -1
  614. package/build-types/textarea-control/types.d.ts +1 -1
  615. package/build-types/textarea-control/types.d.ts.map +1 -1
  616. package/build-types/toggle-control/index.d.ts +26 -0
  617. package/build-types/toggle-control/index.d.ts.map +1 -0
  618. package/build-types/toggle-control/stories/index.d.ts +13 -0
  619. package/build-types/toggle-control/stories/index.d.ts.map +1 -0
  620. package/build-types/toggle-control/test/index.d.ts +2 -0
  621. package/build-types/toggle-control/test/index.d.ts.map +1 -0
  622. package/build-types/toggle-control/types.d.ts +20 -0
  623. package/build-types/toggle-control/types.d.ts.map +1 -0
  624. package/build-types/toggle-group-control/stories/index.d.ts +4 -2
  625. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
  626. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +12 -2
  627. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  628. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +2 -4
  629. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  630. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +2 -1
  631. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  632. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +3 -5
  633. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  634. package/build-types/toggle-group-control/types.d.ts +2 -2
  635. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  636. package/build-types/tools-panel/tools-panel/component.d.ts +2 -1
  637. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  638. package/build-types/tools-panel/tools-panel/hook.d.ts +55 -56
  639. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  640. package/build-types/tools-panel/tools-panel-header/component.d.ts +2 -1
  641. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  642. package/build-types/tools-panel/tools-panel-header/hook.d.ts +55 -56
  643. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  644. package/build-types/tools-panel/tools-panel-item/component.d.ts +6 -2
  645. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  646. package/build-types/tools-panel/tools-panel-item/hook.d.ts +55 -56
  647. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  648. package/build-types/tooltip/index.d.ts.map +1 -1
  649. package/build-types/truncate/component.d.ts +2 -1
  650. package/build-types/truncate/component.d.ts.map +1 -1
  651. package/build-types/truncate/hook.d.ts +55 -56
  652. package/build-types/truncate/hook.d.ts.map +1 -1
  653. package/build-types/ui/context/context-connect.d.ts +10 -9
  654. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  655. package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
  656. package/build-types/ui/context/test/context-connect.d.ts +2 -0
  657. package/build-types/ui/context/test/context-connect.d.ts.map +1 -0
  658. package/build-types/ui/context/test/wordpress-component.d.ts +2 -0
  659. package/build-types/ui/context/test/wordpress-component.d.ts.map +1 -0
  660. package/build-types/ui/context/wordpress-component.d.ts +8 -9
  661. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  662. package/build-types/ui/control-group/component.d.ts +4 -1
  663. package/build-types/ui/control-group/component.d.ts.map +1 -1
  664. package/build-types/ui/control-group/hook.d.ts +55 -56
  665. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  666. package/build-types/ui/control-label/component.d.ts +4 -1
  667. package/build-types/ui/control-label/component.d.ts.map +1 -1
  668. package/build-types/ui/control-label/hook.d.ts +55 -56
  669. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  670. package/build-types/ui/form-group/form-group.d.ts +4 -8
  671. package/build-types/ui/form-group/form-group.d.ts.map +1 -1
  672. package/build-types/ui/form-group/use-form-group.d.ts +112 -114
  673. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  674. package/build-types/ui/shortcut/component.d.ts +2 -1
  675. package/build-types/ui/shortcut/component.d.ts.map +1 -1
  676. package/build-types/ui/spinner/component.d.ts +1 -1
  677. package/build-types/ui/tooltip/component.d.ts +11 -1
  678. package/build-types/ui/tooltip/component.d.ts.map +1 -1
  679. package/build-types/ui/tooltip/content.d.ts +7 -1
  680. package/build-types/ui/tooltip/styles.d.ts +1 -3
  681. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  682. package/build-types/unit-control/index.d.ts +2 -12
  683. package/build-types/unit-control/index.d.ts.map +1 -1
  684. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  685. package/build-types/unit-control/styles/unit-control-styles.d.ts +5 -10
  686. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  687. package/build-types/unit-control/types.d.ts +3 -35
  688. package/build-types/unit-control/types.d.ts.map +1 -1
  689. package/build-types/utils/colors-values.d.ts +0 -18
  690. package/build-types/utils/colors-values.d.ts.map +1 -1
  691. package/build-types/utils/math.d.ts +6 -6
  692. package/build-types/utils/math.d.ts.map +1 -1
  693. package/build-types/utils/values.d.ts +10 -8
  694. package/build-types/utils/values.d.ts.map +1 -1
  695. package/build-types/v-stack/component.d.ts +8 -2
  696. package/build-types/v-stack/component.d.ts.map +1 -1
  697. package/build-types/v-stack/hook.d.ts +55 -56
  698. package/build-types/v-stack/hook.d.ts.map +1 -1
  699. package/build-types/v-stack/stories/index.d.ts +8 -1
  700. package/build-types/v-stack/stories/index.d.ts.map +1 -1
  701. package/build-types/view/component.d.ts +8 -6
  702. package/build-types/view/component.d.ts.map +1 -1
  703. package/build-types/view/stories/index.d.ts +12 -0
  704. package/build-types/view/stories/index.d.ts.map +1 -0
  705. package/build-types/view/types.d.ts +8 -0
  706. package/build-types/view/types.d.ts.map +1 -0
  707. package/build-types/visually-hidden/component.d.ts +2 -1
  708. package/build-types/visually-hidden/component.d.ts.map +1 -1
  709. package/build-types/z-stack/component.d.ts +2 -1
  710. package/build-types/z-stack/component.d.ts.map +1 -1
  711. package/package.json +17 -17
  712. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -1
  713. package/src/angle-picker-control/README.md +9 -1
  714. package/src/angle-picker-control/index.js +12 -0
  715. package/src/angle-picker-control/stories/index.js +3 -3
  716. package/src/autocomplete/autocompleter-ui.js +6 -3
  717. package/src/base-field/test/__snapshots__/index.js.snap +3 -5
  718. package/src/border-box-control/border-box-control/component.tsx +28 -12
  719. package/src/border-box-control/border-box-control-linked-button/component.tsx +1 -2
  720. package/src/border-box-control/border-box-control-split-controls/component.tsx +25 -11
  721. package/src/border-box-control/stories/index.js +1 -0
  722. package/src/border-box-control/styles.ts +2 -1
  723. package/src/border-box-control/types.ts +5 -4
  724. package/src/border-control/border-control-dropdown/component.tsx +3 -8
  725. package/src/border-control/types.ts +7 -9
  726. package/src/box-control/linked-button.js +3 -3
  727. package/src/box-control/test/index.js +5 -5
  728. package/src/button/style.scss +4 -3
  729. package/src/card/styles.ts +1 -1
  730. package/src/card/test/__snapshots__/index.tsx.snap +39 -51
  731. package/src/checkbox-control/index.tsx +3 -6
  732. package/src/checkbox-control/stories/index.tsx +6 -2
  733. package/src/checkbox-control/types.ts +4 -1
  734. package/src/color-palette/index.js +1 -1
  735. package/src/color-palette/test/__snapshots__/index.js.snap +67 -91
  736. package/src/color-picker/input-with-slider.tsx +1 -0
  737. package/src/combobox-control/index.js +1 -1
  738. package/src/combobox-control/test/index.js +311 -0
  739. package/src/custom-gradient-picker/index.js +1 -1
  740. package/src/date-time/date/index.tsx +2 -2
  741. package/src/date-time/time/timezone.tsx +1 -1
  742. package/src/dimension-control/test/__snapshots__/index.test.js.snap +1122 -164
  743. package/src/dimension-control/test/index.test.js +29 -38
  744. package/src/disabled/index.tsx +27 -9
  745. package/src/disabled/styles/disabled-styles.tsx +2 -2
  746. package/src/disabled/test/index.tsx +38 -0
  747. package/src/drop-zone/README.md +3 -3
  748. package/src/drop-zone/{index.js → index.tsx} +48 -13
  749. package/src/drop-zone/{provider.js → provider.ts} +5 -1
  750. package/src/drop-zone/stories/index.tsx +30 -0
  751. package/src/drop-zone/types.ts +29 -0
  752. package/src/dropdown/README.md +6 -4
  753. package/src/dropdown/index.js +15 -3
  754. package/src/dropdown/stories/index.js +1 -1
  755. package/src/flex/flex/hook.ts +5 -54
  756. package/src/flex/test/__snapshots__/index.tsx.snap +7 -15
  757. package/src/focal-point-picker/README.md +2 -2
  758. package/src/focal-point-picker/{controls.js → controls.tsx} +38 -10
  759. package/src/focal-point-picker/{focal-point.js → focal-point.tsx} +7 -1
  760. package/src/focal-point-picker/{grid.js → grid.tsx} +6 -1
  761. package/src/focal-point-picker/{index.js → index.tsx} +99 -15
  762. package/src/focal-point-picker/{media.js → media.tsx} +10 -4
  763. package/src/focal-point-picker/stories/index.tsx +93 -0
  764. package/src/focal-point-picker/styles/{focal-point-picker-style.js → focal-point-picker-style.ts} +31 -5
  765. package/src/focal-point-picker/styles/{focal-point-style.js → focal-point-style.ts} +2 -1
  766. package/src/focal-point-picker/test/index.js +27 -7
  767. package/src/focal-point-picker/types.ts +93 -0
  768. package/src/focal-point-picker/{utils.js → utils.ts} +9 -9
  769. package/src/font-size-picker/README.md +9 -0
  770. package/src/font-size-picker/index.js +9 -0
  771. package/src/font-size-picker/stories/index.js +3 -5
  772. package/src/font-size-picker/test/index.js +15 -2
  773. package/src/font-size-picker/test/utils.js +1 -2
  774. package/src/font-size-picker/utils.js +1 -1
  775. package/src/form-file-upload/README.md +6 -1
  776. package/src/form-file-upload/{index.js → index.tsx} +22 -4
  777. package/src/form-file-upload/stories/index.tsx +74 -0
  778. package/src/form-file-upload/test/{index.js → index.tsx} +7 -3
  779. package/src/form-file-upload/types.ts +63 -0
  780. package/src/form-toggle/index.tsx +1 -6
  781. package/src/form-token-field/index.tsx +4 -5
  782. package/src/form-token-field/suggestions-list.tsx +1 -2
  783. package/src/gradient-picker/index.js +41 -47
  784. package/src/gradient-picker/stories/index.js +10 -0
  785. package/src/h-stack/test/__snapshots__/index.tsx.snap +3 -12
  786. package/src/higher-order/with-filters/test/__snapshots__/index.js.snap +87 -0
  787. package/src/higher-order/with-filters/test/index.js +20 -74
  788. package/src/icon/index.tsx +1 -1
  789. package/src/icon/stories/index.js +18 -0
  790. package/src/icon/test/index.js +32 -83
  791. package/src/input-control/input-base.tsx +9 -11
  792. package/src/input-control/label.tsx +9 -4
  793. package/src/input-control/styles/input-control-styles.tsx +0 -43
  794. package/src/input-control/types.ts +3 -0
  795. package/src/isolated-event-container/test/index.js +53 -11
  796. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  797. package/src/keyboard-shortcuts/test/index.js +16 -31
  798. package/src/menu-item/test/__snapshots__/index.js.snap +60 -62
  799. package/src/menu-item/test/index.js +30 -22
  800. package/src/modal/aria-helper.js +3 -8
  801. package/src/modal/style.scss +3 -4
  802. package/src/navigable-container/README.md +2 -0
  803. package/src/navigable-container/container.js +8 -1
  804. package/src/navigable-container/menu.js +14 -11
  805. package/src/navigable-container/stories/navigable-menu.js +49 -0
  806. package/src/navigable-container/stories/tabbable-container.js +40 -0
  807. package/src/navigable-container/tabbable.js +2 -3
  808. package/src/navigable-container/test/navigable-menu.js +277 -0
  809. package/src/navigable-container/test/tababble-container.js +175 -0
  810. package/src/navigation/menu/menu-title-search.js +2 -0
  811. package/src/navigation/menu/use-navigation-tree-menu.js +2 -0
  812. package/src/navigator/navigator-button/hook.ts +1 -1
  813. package/src/navigator/navigator-screen/component.tsx +6 -1
  814. package/src/number-control/index.tsx +209 -0
  815. package/src/number-control/stories/index.js +6 -18
  816. package/src/number-control/types.ts +75 -0
  817. package/src/panel/README.md +1 -1
  818. package/src/panel/test/__snapshots__/header.js.snap +9 -0
  819. package/src/panel/test/__snapshots__/index.js.snap +17 -0
  820. package/src/panel/test/__snapshots__/row.js.snap +17 -0
  821. package/src/panel/test/header.js +30 -23
  822. package/src/panel/test/index.js +33 -25
  823. package/src/panel/test/row.js +18 -11
  824. package/src/placeholder/index.tsx +4 -5
  825. package/src/placeholder/style.scss +4 -0
  826. package/src/popover/README.md +128 -48
  827. package/src/popover/{index.js → index.tsx} +284 -182
  828. package/src/popover/stories/{index.js → index.tsx} +52 -54
  829. package/src/popover/test/index.js +7 -5
  830. package/src/popover/types.ts +192 -0
  831. package/src/popover/utils.ts +242 -0
  832. package/src/radio-control/index.tsx +28 -29
  833. package/src/radio-control/style.scss +0 -17
  834. package/src/range-control/index.tsx +4 -1
  835. package/src/range-control/styles/range-control-styles.ts +8 -8
  836. package/src/sandbox/index.js +2 -2
  837. package/src/search-control/README.md +5 -3
  838. package/src/search-control/{index.js → index.tsx} +35 -7
  839. package/src/search-control/stories/index.tsx +66 -0
  840. package/src/search-control/types.ts +43 -0
  841. package/src/select-control/index.native.js +1 -1
  842. package/src/slot-fill/test/index.js +69 -12
  843. package/src/style.scss +0 -1
  844. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  845. package/src/tab-panel/README.md +1 -2
  846. package/src/tab-panel/{index.js → index.tsx} +58 -13
  847. package/src/tab-panel/stories/index.tsx +37 -0
  848. package/src/tab-panel/test/index.tsx +120 -0
  849. package/src/tab-panel/types.ts +65 -0
  850. package/src/text-control/index.tsx +2 -0
  851. package/src/text-control/types.ts +5 -1
  852. package/src/textarea-control/index.tsx +3 -6
  853. package/src/textarea-control/types.ts +1 -1
  854. package/src/toggle-control/index.tsx +97 -0
  855. package/src/toggle-control/stories/index.tsx +58 -0
  856. package/src/toggle-control/test/index.tsx +53 -0
  857. package/src/toggle-control/types.ts +28 -0
  858. package/src/toggle-group-control/stories/index.tsx +10 -3
  859. package/src/toggle-group-control/toggle-group-control/component.tsx +3 -3
  860. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  861. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  862. package/src/toggle-group-control/types.ts +2 -2
  863. package/src/tooltip/index.js +11 -7
  864. package/src/ui/context/context-connect.ts +58 -31
  865. package/src/ui/context/context-system-provider.js +5 -4
  866. package/src/ui/context/test/context-connect.tsx +55 -0
  867. package/src/ui/context/test/wordpress-component.tsx +36 -0
  868. package/src/ui/context/wordpress-component.ts +18 -12
  869. package/src/ui/control-group/test/__snapshots__/index.js.snap +1 -4
  870. package/src/unit-control/index.tsx +1 -1
  871. package/src/unit-control/stories/index.tsx +7 -16
  872. package/src/unit-control/styles/unit-control-styles.ts +2 -2
  873. package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -6
  874. package/src/unit-control/types.ts +3 -44
  875. package/src/utils/colors-values.js +2 -24
  876. package/src/utils/math.js +4 -4
  877. package/src/utils/values.js +48 -6
  878. package/src/v-stack/test/__snapshots__/index.tsx.snap +3 -12
  879. package/src/view/{component.js → component.tsx} +13 -4
  880. package/src/view/stories/index.tsx +32 -0
  881. package/src/view/types.ts +6 -0
  882. package/tsconfig.json +1 -6
  883. package/tsconfig.tsbuildinfo +1 -1
  884. package/src/focal-point-picker/stories/index.js +0 -76
  885. package/src/navigable-container/test/menu.js +0 -310
  886. package/src/navigable-container/test/tabbable.js +0 -158
  887. package/src/number-control/index.js +0 -192
  888. package/src/popover/utils.js +0 -107
  889. package/src/search-control/stories/index.js +0 -39
  890. package/src/tab-panel/stories/index.js +0 -39
  891. package/src/tab-panel/test/index.js +0 -179
  892. package/src/toggle-control/index.js +0 -55
  893. package/src/toggle-control/stories/index.js +0 -64
  894. package/src/toggle-control/style.scss +0 -14
  895. package/src/toggle-control/test/index.js +0 -52
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","thumbSize","Root","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","lightGray","Rail","trackBackgroundColor","trackColor","Track","MarksWrapper","markFill","isFilled","backgroundColor","Mark","markLabelFill","darkGray","MarkLabel","thumbColor","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","tooltipPosition","position","isBottom","Tooltip","InputNumber","ActionRightWrapper"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,SAASC,MAAT,EAAiBC,YAAjB,EAA+BC,GAA/B,QAA0C,aAA1C;AACA,SAASC,KAAT,QAAsB,sBAAtB;AAWA,MAAMC,gBAAgB,GAAG,EAAzB;AACA,MAAMC,UAAU,GAAG,CAAnB;;AACA,MAAMC,WAAW,GAAG,mBACn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;AAAA,uEAO1BnD,WAP0B,QAU3BJ,GAAG,CAAE;AAAEsB,EAAAA,UAAU,EAAE;AAAd,CAAF,CAVwB,qoTAAxB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../ui/utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nexport const Root = styled.div`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: flex-start;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.lightGray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.lightGray[ 600 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.lightGray[ 800 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.lightGray[ 600 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.lightGray[ 800 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.darkGray[ 300 ] : COLORS.lightGray[ 600 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.lightGray[ 600 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.lightGray[ 800 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo: Refactor RangeControl with latest HStack configuration\n// @wordpress/components/ui/hstack.\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\twidth: ${ space( 16 ) } !important;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","thumbSize","Root","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","trackBackgroundColor","trackColor","Track","MarksWrapper","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","thumbColor","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","tooltipPosition","position","isBottom","Tooltip","InputNumber","ActionRightWrapper"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,OAAOC,aAAP,MAA0B,sBAA1B;AACA,SAASC,MAAT,EAAiBC,YAAjB,EAA+BC,GAA/B,QAA0C,aAA1C;AACA,SAASC,KAAT,QAAsB,sBAAtB;AAWA,MAAMC,gBAAgB,GAAG,EAAzB;AACA,MAAMC,UAAU,GAAG,CAAnB;;AACA,MAAMC,WAAW,GAAG,mBACnBR,GAAG,CAAE;AAAES,EAAAA,MAAM,EAAEH,gBAAV;AAA4BI,EAAAA,SAAS,EAAEJ;AAAvC,CAAF,ipTADJ;;AAEA,MAAMK,SAAS,GAAG,EAAlB;AAEA,OAAO,MAAMC,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAWP,MAAMC,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAK,GAAGZ,MAAM,CAACa,EAAP,CAAUC;AAApB,GAAF;AAAA,sBACpBhB,GAAG,CAAE;AAAEc,IAAAA;AAAF,GAAF,kpTADiB;AAAA,CAArB;;AAGA,MAAMG,aAAa,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;;;;;;;;;;;;;;;;;;;;;AAMA,MAAME,eAAe,GAAG,UAAkC;AAAA,MAAhC;AAAEC,IAAAA;AAAF,GAAgC;AACzD,QAAMC,QAAQ,GAAGD,QAAQ,KAAK,QAA9B;;AAEA,MAAKC,QAAL,EAAgB;AACf;AAGA;;AAED;AAGA,CAZD;;AAcA,OAAO,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,yQAgBhBN,WAhBgB,OAiBhBG,eAjBgB,OAkBhBnD,YAAY,CAAE,YAAF,CAlBI,OAmBhBC,GAAG,CACL;AAAE0C,EAAAA,SAAS,EAAE;AAAb,CADK,EAEL;AAAEA,EAAAA,SAAS,EAAE;AAAb,CAFK,CAnBa,qlTAAb,C,CAyBP;AACA;;AACA,OAAO,MAAMY,WAAW,GAAG,qBAAQzD,aAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,4DAIbI,KAAK,CAAE,EAAF,CAJQ,uCAOnBG,WAPmB,QAUpBJ,GAAG,CAAE;AAAEsB,EAAAA,UAAU,EAAG,GAAGrB,KAAK,CAAE,CAAF,CAAO;AAA9B,CAAF,CAViB,qlTAAjB;AAaP,OAAO,MAAMsD,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,uEAO1BnD,WAP0B,QAU3BJ,GAAG,CAAE;AAAEsB,EAAAA,UAAU,EAAE;AAAd,CAAF,CAVwB,qlTAAxB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../ui/utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nexport const Root = styled.div`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: flex-start;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: var( --wp-admin-theme-color );\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo: Refactor RangeControl with latest HStack configuration\n// @wordpress/components/ui/hstack.\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\twidth: ${ space( 16 ) } !important;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"]}
@@ -69,14 +69,14 @@ const style = `
69
69
  }
70
70
  html,
71
71
  body,
72
- body > div,
73
- body > div iframe {
72
+ body > div {
74
73
  width: 100%;
75
74
  }
76
75
  html.wp-has-aspect-ratio,
77
76
  body.wp-has-aspect-ratio,
78
77
  body.wp-has-aspect-ratio > div,
79
78
  body.wp-has-aspect-ratio > div iframe {
79
+ width: 100%;
80
80
  height: 100%;
81
81
  overflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */
82
82
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/sandbox/index.js"],"names":["renderToString","useRef","useState","useEffect","useFocusableIframe","useMergeRefs","observeAndResizeJS","style","Sandbox","html","title","type","styles","scripts","onFocus","ref","width","setWidth","height","setHeight","isFrameAccessible","current","contentDocument","body","e","trySandbox","forceRerender","ownerDocument","getAttribute","htmlDoc","documentElement","lang","__html","map","rules","i","src","open","write","close","tryNoForceSandbox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","action","defaultView","addEventListener","removeEventListener","Math","ceil"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,cADD,EAECC,MAFD,EAGCC,QAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,kBAAT,EAA6BC,YAA7B,QAAiD,oBAAjD;AAEA,MAAMC,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAzDA;AA2DA,MAAMC,KAAK,GAAI;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CArBA;AAuBA,eAAe,SAASC,OAAT,OAOX;AAAA,MAP6B;AAChCC,IAAAA,IAAI,GAAG,EADyB;AAEhCC,IAAAA,KAAK,GAAG,EAFwB;AAGhCC,IAAAA,IAHgC;AAIhCC,IAAAA,MAAM,GAAG,EAJuB;AAKhCC,IAAAA,OAAO,GAAG,EALsB;AAMhCC,IAAAA;AANgC,GAO7B;AACH,QAAMC,GAAG,GAAGd,MAAM,EAAlB;AACA,QAAM,CAAEe,KAAF,EAASC,QAAT,IAAsBf,QAAQ,CAAE,CAAF,CAApC;AACA,QAAM,CAAEgB,MAAF,EAAUC,SAAV,IAAwBjB,QAAQ,CAAE,CAAF,CAAtC;;AAEA,WAASkB,iBAAT,GAA6B;AAC5B,QAAI;AACH,aAAO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;AACAU,IAAAA,WAAW,CAACC,gBAAZ,CAA8B,SAA9B,EAAyCV,qBAAzC;AAEA,WAAO,MAAM;AAAA;;AACZ,sBAAA1B,GAAG,CAACM,OAAJ,8DAAa+B,mBAAb,CACC,MADD,EAECZ,iBAFD,EAGC,KAHD;AAKAU,MAAAA,WAAW,CAACC,gBAAZ,CAA8B,SAA9B,EAAyCV,qBAAzC;AACA,KAPD;AAQA,GApDQ,EAoDN,EApDM,CAAT;AAsDAtC,EAAAA,SAAS,CAAE,MAAM;AAChBsB,IAAAA,UAAU;AACV,GAFQ,EAEN,CAAEf,KAAF,EAASE,MAAT,EAAiBC,OAAjB,CAFM,CAAT;AAIAV,EAAAA,SAAS,CAAE,MAAM;AAChBsB,IAAAA,UAAU,CAAE,IAAF,CAAV;AACA,GAFQ,EAEN,CAAEhB,IAAF,EAAQE,IAAR,CAFM,CAAT;AAIA,SACC;AACC,IAAA,GAAG,EAAGN,YAAY,CAAE,CAAEU,GAAF,EAAOX,kBAAkB,EAAzB,CAAF,CADnB;AAEC,IAAA,KAAK,EAAGM,KAFT;AAGC,IAAA,SAAS,EAAC,oBAHX;AAIC,IAAA,OAAO,EAAC,oDAJT;AAKC,IAAA,OAAO,EAAGI,OALX;AAMC,IAAA,KAAK,EAAGuC,IAAI,CAACC,IAAL,CAAWtC,KAAX,CANT;AAOC,IAAA,MAAM,EAAGqC,IAAI,CAACC,IAAL,CAAWpC,MAAX;AAPV,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\nconst observeAndResizeJS = `\n\t( function() {\n\t\tvar observer;\n\n\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\twindow.parent.postMessage( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t}, '*' );\n\t\t}\n\n\t\tobserver = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\tif ( /^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t} );\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n} )();`;\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div,\n\tbody > div iframe {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n`;\n\nexport default function Sandbox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n} ) {\n\tconst ref = useRef();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current.contentDocument.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandbox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } = ref.current;\n\t\tconst { body } = contentDocument;\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !== body.getAttribute( 'data-resizable-iframe-connected' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t<script\n\t\t\t\t\t\ttype=\"text/javascript\"\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: observeAndResizeJS,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\n\t\tfunction tryNoForceSandbox() {\n\t\t\ttrySandbox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tref.current.addEventListener( 'load', tryNoForceSandbox, false );\n\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tref.current?.removeEventListener(\n\t\t\t\t'load',\n\t\t\t\ttryNoForceSandbox,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandbox( true );\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/sandbox/index.js"],"names":["renderToString","useRef","useState","useEffect","useFocusableIframe","useMergeRefs","observeAndResizeJS","style","Sandbox","html","title","type","styles","scripts","onFocus","ref","width","setWidth","height","setHeight","isFrameAccessible","current","contentDocument","body","e","trySandbox","forceRerender","ownerDocument","getAttribute","htmlDoc","documentElement","lang","__html","map","rules","i","src","open","write","close","tryNoForceSandbox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","action","defaultView","addEventListener","removeEventListener","Math","ceil"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,cADD,EAECC,MAFD,EAGCC,QAHD,EAICC,SAJD,QAKO,oBALP;AAMA,SAASC,kBAAT,EAA6BC,YAA7B,QAAiD,oBAAjD;AA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;AAChBsB,IAAAA,UAAU;AACV,GAFQ,EAEN,CAAEf,KAAF,EAASE,MAAT,EAAiBC,OAAjB,CAFM,CAAT;AAIAV,EAAAA,SAAS,CAAE,MAAM;AAChBsB,IAAAA,UAAU,CAAE,IAAF,CAAV;AACA,GAFQ,EAEN,CAAEhB,IAAF,EAAQE,IAAR,CAFM,CAAT;AAIA,SACC;AACC,IAAA,GAAG,EAAGN,YAAY,CAAE,CAAEU,GAAF,EAAOX,kBAAkB,EAAzB,CAAF,CADnB;AAEC,IAAA,KAAK,EAAGM,KAFT;AAGC,IAAA,SAAS,EAAC,oBAHX;AAIC,IAAA,OAAO,EAAC,oDAJT;AAKC,IAAA,OAAO,EAAGI,OALX;AAMC,IAAA,KAAK,EAAGuC,IAAI,CAACC,IAAL,CAAWtC,KAAX,CANT;AAOC,IAAA,MAAM,EAAGqC,IAAI,CAACC,IAAL,CAAWpC,MAAX;AAPV,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\nconst observeAndResizeJS = `\n\t( function() {\n\t\tvar observer;\n\n\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\twindow.parent.postMessage( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t}, '*' );\n\t\t}\n\n\t\tobserver = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\tif ( /^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t} );\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n} )();`;\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n`;\n\nexport default function Sandbox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n} ) {\n\tconst ref = useRef();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current.contentDocument.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandbox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } = ref.current;\n\t\tconst { body } = contentDocument;\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !== body.getAttribute( 'data-resizable-iframe-connected' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t<script\n\t\t\t\t\t\ttype=\"text/javascript\"\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: observeAndResizeJS,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\n\t\tfunction tryNoForceSandbox() {\n\t\t\ttrySandbox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tref.current.addEventListener( 'load', tryNoForceSandbox, false );\n\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tref.current?.removeEventListener(\n\t\t\t\t'load',\n\t\t\t\ttryNoForceSandbox,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tdefaultView.addEventListener( 'message', checkMessageForResize );\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandbox();\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandbox( true );\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import { createElement } from "@wordpress/element";
2
3
 
3
4
  /**
@@ -16,11 +17,12 @@ import { forwardRef, useRef } from '@wordpress/element';
16
17
  * Internal dependencies
17
18
  */
18
19
 
19
- import { Button } from '../';
20
+ import Button from '../button';
20
21
  import BaseControl from '../base-control';
21
22
 
22
- function SearchControl(_ref, forwardedRef) {
23
+ function UnforwardedSearchControl(_ref, forwardedRef) {
23
24
  let {
25
+ __nextHasNoMarginBottom,
24
26
  className,
25
27
  onChange,
26
28
  onKeyDown,
@@ -29,7 +31,8 @@ function SearchControl(_ref, forwardedRef) {
29
31
  placeholder = __('Search'),
30
32
  hideLabelFromVision = true,
31
33
  help,
32
- onClose
34
+ onClose,
35
+ ...restProps
33
36
  } = _ref;
34
37
  const searchRef = useRef();
35
38
  const instanceId = useInstanceId(SearchControl);
@@ -49,8 +52,10 @@ function SearchControl(_ref, forwardedRef) {
49
52
  icon: closeSmall,
50
53
  label: __('Reset search'),
51
54
  onClick: () => {
55
+ var _searchRef$current;
56
+
52
57
  onChange('');
53
- searchRef.current.focus();
58
+ (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus();
54
59
  }
55
60
  });
56
61
  }
@@ -61,6 +66,7 @@ function SearchControl(_ref, forwardedRef) {
61
66
  };
62
67
 
63
68
  return createElement(BaseControl, {
69
+ __nextHasNoMarginBottom: __nextHasNoMarginBottom,
64
70
  label: label,
65
71
  id: id,
66
72
  hideLabelFromVision: hideLabelFromVision,
@@ -68,7 +74,7 @@ function SearchControl(_ref, forwardedRef) {
68
74
  className: classnames(className, 'components-search-control')
69
75
  }, createElement("div", {
70
76
  className: "components-search-control__input-wrapper"
71
- }, createElement("input", {
77
+ }, createElement("input", _extends({}, restProps, {
72
78
  ref: useMergeRefs([searchRef, forwardedRef]),
73
79
  className: "components-search-control__input",
74
80
  id: id,
@@ -78,10 +84,31 @@ function SearchControl(_ref, forwardedRef) {
78
84
  onKeyDown: onKeyDown,
79
85
  autoComplete: "off",
80
86
  value: value || ''
81
- }), createElement("div", {
87
+ })), createElement("div", {
82
88
  className: "components-search-control__icon"
83
89
  }, renderRightButton())));
84
90
  }
91
+ /**
92
+ * SearchControl components let users display a search control.
93
+ *
94
+ * ```jsx
95
+ * import { SearchControl } from '@wordpress/components';
96
+ * import { useState } from '@wordpress/element';
97
+ *
98
+ * function MySearchControl( { className, setState } ) {
99
+ * const [ searchInput, setSearchInput ] = useState( '' );
100
+ *
101
+ * return (
102
+ * <SearchControl
103
+ * value={ searchInput }
104
+ * onChange={ setSearchInput }
105
+ * />
106
+ * );
107
+ * }
108
+ * ```
109
+ */
110
+
85
111
 
86
- export default forwardRef(SearchControl);
112
+ export const SearchControl = forwardRef(UnforwardedSearchControl);
113
+ export default SearchControl;
87
114
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/search-control/index.js"],"names":["classnames","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useRef","Button","BaseControl","SearchControl","forwardedRef","className","onChange","onKeyDown","value","label","placeholder","hideLabelFromVision","help","onClose","searchRef","instanceId","id","renderRightButton","current","focus","event","target"],"mappings":";;AAAA;AACA;AACA;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C,IAAD;AAAM,MAAA,IAAI,EAAGtB;AAAb,MAAP;AACA,GAzBD;;AA2BA,SACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGY,KADT;AAEC,IAAA,EAAE,EAAGO,EAFN;AAGC,IAAA,mBAAmB,EAAGL,mBAHvB;AAIC,IAAA,IAAI,EAAGC,IAJR;AAKC,IAAA,SAAS,EAAGpB,UAAU,CAAEa,SAAF,EAAa,2BAAb;AALvB,KAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,GAAG,EAAGX,YAAY,CAAE,CAAEoB,SAAF,EAAaV,YAAb,CAAF,CADnB;AAEC,IAAA,SAAS,EAAC,kCAFX;AAGC,IAAA,EAAE,EAAGY,EAHN;AAIC,IAAA,IAAI,EAAC,QAJN;AAKC,IAAA,WAAW,EAAGN,WALf;AAMC,IAAA,QAAQ,EAAKU,KAAF,IAAad,QAAQ,CAAEc,KAAK,CAACC,MAAN,CAAab,KAAf,CANjC;AAOC,IAAA,SAAS,EAAGD,SAPb;AAQC,IAAA,YAAY,EAAC,KARd;AASC,IAAA,KAAK,EAAGC,KAAK,IAAI;AATlB,IADD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGS,iBAAiB,EADpB,CAZD,CAPD,CADD;AA0BA;;AAED,eAAelB,UAAU,CAAEI,aAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../';\nimport BaseControl from '../base-control';\n\nfunction SearchControl(\n\t{\n\t\tclassName,\n\t\tonChange,\n\t\tonKeyDown,\n\t\tvalue,\n\t\tlabel,\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\thelp,\n\t\tonClose,\n\t},\n\tforwardedRef\n) {\n\tconst searchRef = useRef();\n\tconst instanceId = useInstanceId( SearchControl );\n\tconst id = `components-search-control-${ instanceId }`;\n\n\tconst renderRightButton = () => {\n\t\tif ( onClose ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close search' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Reset search' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonChange( '' );\n\t\t\t\t\t\tsearchRef.current.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn <Icon icon={ search } />;\n\t};\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( className, 'components-search-control' ) }\n\t\t>\n\t\t\t<div className=\"components-search-control__input-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\t\tclassName=\"components-search-control__input\"\n\t\t\t\t\tid={ id }\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => onChange( event.target.value ) }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t/>\n\t\t\t\t<div className=\"components-search-control__icon\">\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</BaseControl>\n\t);\n}\n\nexport default forwardRef( SearchControl );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/search-control/index.tsx"],"names":["classnames","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useRef","Button","BaseControl","UnforwardedSearchControl","forwardedRef","__nextHasNoMarginBottom","className","onChange","onKeyDown","value","label","placeholder","hideLabelFromVision","help","onClose","restProps","searchRef","instanceId","SearchControl","id","renderRightButton","current","focus","event","target"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,EAAwBC,YAAxB,QAA4C,oBAA5C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,MAAf,EAAuBC,UAAvB,QAAyC,kBAAzC;AACA,SAASC,UAAT,EAAqBC,MAArB,QAAmC,oBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAKA,SAASC,wBAAT,OAcCC,YAdD,EAeE;AAAA,MAdD;AACCC,IAAAA,uBADD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,QAHD;AAICC,IAAAA,SAJD;AAKCC,IAAAA,KALD;AAMCC,IAAAA,KAND;AAOCC,IAAAA,WAAW,GAAGhB,EAAE,CAAE,QAAF,CAPjB;AAQCiB,IAAAA,mBAAmB,GAAG,IARvB;AASCC,IAAAA,IATD;AAUCC,IAAAA,OAVD;AAWC,OAAGC;AAXJ,GAcC;AACD,QAAMC,SAAS,GAAGhB,MAAM,EAAxB;AACA,QAAMiB,UAAU,GAAGxB,aAAa,CAAEyB,aAAF,CAAhC;AACA,QAAMC,EAAE,GAAI,6BAA6BF,UAAY,EAArD;;AAEA,QAAMG,iBAAiB,GAAG,MAAM;AAC/B,QAAKN,OAAL,EAAe;AACd,aACC,cAAC,MAAD;AACC,QAAA,IAAI,EAAGhB,UADR;AAEC,QAAA,KAAK,EAAGH,EAAE,CAAE,cAAF,CAFX;AAGC,QAAA,OAAO,EAAGmB;AAHX,QADD;AAOA;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A;AACA;;;AACA,OAAO,MAAMF,aAAa,GAAGnB,UAAU,CAAEI,wBAAF,CAAhC;AAEP,eAAee,aAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { SearchControlProps } from './types';\nimport type { ForwardedRef } from 'react';\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom,\n\t\tclassName,\n\t\tonChange,\n\t\tonKeyDown,\n\t\tvalue,\n\t\tlabel,\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\thelp,\n\t\tonClose,\n\t\t...restProps\n\t}: WordPressComponentProps< SearchControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst searchRef = useRef< HTMLInputElement >();\n\tconst instanceId = useInstanceId( SearchControl );\n\tconst id = `components-search-control-${ instanceId }`;\n\n\tconst renderRightButton = () => {\n\t\tif ( onClose ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close search' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif ( !! value ) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Reset search' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonChange( '' );\n\t\t\t\t\t\tsearchRef.current?.focus();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn <Icon icon={ search } />;\n\t};\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\tid={ id }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( className, 'components-search-control' ) }\n\t\t>\n\t\t\t<div className=\"components-search-control__input-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\t\tclassName=\"components-search-control__input\"\n\t\t\t\t\tid={ id }\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => onChange( event.target.value ) }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t/>\n\t\t\t\t<div className=\"components-search-control__icon\">\n\t\t\t\t\t{ renderRightButton() }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -10,7 +10,7 @@ import { memo } from '@wordpress/element';
10
10
  */
11
11
 
12
12
  import PickerCell from '../mobile/bottom-sheet/picker-cell';
13
- const SelectControl = memo(_ref => {
13
+ export const SelectControl = memo(_ref => {
14
14
  let {
15
15
  help,
16
16
  instanceId,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/select-control/index.native.js"],"names":["memo","PickerCell","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,oCAAvB;AAEA,MAAMC,aAAa,GAAGF,IAAI,CACzB,QAUO;AAAA,MAVL;AACDG,IAAAA,IADC;AAEDC,IAAAA,UAFC;AAGDC,IAAAA,KAHC;AAIDC,IAAAA,QAAQ,GAAG,KAJV;AAKDC,IAAAA,QALC;AAMDC,IAAAA,OAAO,GAAG,EANT;AAODC,IAAAA,SAPC;AAQDC,IAAAA,mBARC;AASD,OAAGC;AATF,GAUK;AACN,QAAMC,EAAE,GAAI,4BAA4BR,UAAY,EAApD;AAEA,SACC,cAAC,UAAD;AACC,IAAA,KAAK,EAAGC,KADT;AAEC,IAAA,mBAAmB,EAAGK,mBAFvB;AAGC,IAAA,EAAE,EAAGE,EAHN;AAIC,IAAA,IAAI,EAAGT,IAJR;AAKC,IAAA,SAAS,EAAGM,SALb;AAMC,IAAA,aAAa,EAAGF,QANjB;AAOC,wBAAmB,CAAC,CAAEJ,IAAH,GAAW,GAAGS,EAAI,QAAlB,GAA4BC,SAPhD;AAQC,IAAA,QAAQ,EAAGP,QARZ;AASC,IAAA,OAAO,EAAGE;AATX,KAUMG,KAVN,EADD;AAcA,CA5BwB,CAA1B;AA+BA,eAAeT,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PickerCell from '../mobile/bottom-sheet/picker-cell';\n\nconst SelectControl = memo(\n\t( {\n\t\thelp,\n\t\tinstanceId,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\t...props\n\t} ) => {\n\t\tconst id = `inspector-select-control-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<PickerCell\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ help }\n\t\t\t\tclassName={ className }\n\t\t\t\tonChangeValue={ onChange }\n\t\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\toptions={ options }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default SelectControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/select-control/index.native.js"],"names":["memo","PickerCell","SelectControl","help","instanceId","label","multiple","onChange","options","className","hideLabelFromVision","props","id","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,oBAArB;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,oCAAvB;AAEA,OAAO,MAAMC,aAAa,GAAGF,IAAI,CAChC,QAUO;AAAA,MAVL;AACDG,IAAAA,IADC;AAEDC,IAAAA,UAFC;AAGDC,IAAAA,KAHC;AAIDC,IAAAA,QAAQ,GAAG,KAJV;AAKDC,IAAAA,QALC;AAMDC,IAAAA,OAAO,GAAG,EANT;AAODC,IAAAA,SAPC;AAQDC,IAAAA,mBARC;AASD,OAAGC;AATF,GAUK;AACN,QAAMC,EAAE,GAAI,4BAA4BR,UAAY,EAApD;AAEA,SACC,cAAC,UAAD;AACC,IAAA,KAAK,EAAGC,KADT;AAEC,IAAA,mBAAmB,EAAGK,mBAFvB;AAGC,IAAA,EAAE,EAAGE,EAHN;AAIC,IAAA,IAAI,EAAGT,IAJR;AAKC,IAAA,SAAS,EAAGM,SALb;AAMC,IAAA,aAAa,EAAGF,QANjB;AAOC,wBAAmB,CAAC,CAAEJ,IAAH,GAAW,GAAGS,EAAI,QAAlB,GAA4BC,SAPhD;AAQC,IAAA,QAAQ,EAAGP,QARZ;AASC,IAAA,OAAO,EAAGE;AATX,KAUMG,KAVN,EADD;AAcA,CA5B+B,CAA1B;AA+BP,eAAeT,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PickerCell from '../mobile/bottom-sheet/picker-cell';\n\nexport const SelectControl = memo(\n\t( {\n\t\thelp,\n\t\tinstanceId,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonChange,\n\t\toptions = [],\n\t\tclassName,\n\t\thideLabelFromVision,\n\t\t...props\n\t} ) => {\n\t\tconst id = `inspector-select-control-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<PickerCell\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\thelp={ help }\n\t\t\t\tclassName={ className }\n\t\t\t\tonChangeValue={ onChange }\n\t\t\t\taria-describedby={ !! help ? `${ id }__help` : undefined }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\toptions={ options }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport default SelectControl;\n"]}
@@ -5,7 +5,7 @@ import { createElement } from "@wordpress/element";
5
5
  * External dependencies
6
6
  */
7
7
  import classnames from 'classnames';
8
- import { partial, find } from 'lodash';
8
+ import { find } from 'lodash';
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
@@ -19,8 +19,6 @@ import { useInstanceId } from '@wordpress/compose';
19
19
  import { NavigableMenu } from '../navigable-container';
20
20
  import Button from '../button';
21
21
 
22
- const noop = () => {};
23
-
24
22
  const TabButton = _ref => {
25
23
  let {
26
24
  tabId,
@@ -37,8 +35,45 @@ const TabButton = _ref => {
37
35
  onClick: onClick
38
36
  }, rest), children);
39
37
  };
38
+ /**
39
+ * TabPanel is an ARIA-compliant tabpanel.
40
+ *
41
+ * TabPanels organize content across different screens, data sets, and interactions.
42
+ * It has two sections: a list of tabs, and the view to show when tabs are chosen.
43
+ *
44
+ * ```jsx
45
+ * import { TabPanel } from '@wordpress/components';
46
+ *
47
+ * const onSelect = ( tabName ) => {
48
+ * console.log( 'Selecting tab', tabName );
49
+ * };
50
+ *
51
+ * const MyTabPanel = () => (
52
+ * <TabPanel
53
+ * className="my-tab-panel"
54
+ * activeClass="active-tab"
55
+ * onSelect={ onSelect }
56
+ * tabs={ [
57
+ * {
58
+ * name: 'tab1',
59
+ * title: 'Tab 1',
60
+ * className: 'tab-one',
61
+ * },
62
+ * {
63
+ * name: 'tab2',
64
+ * title: 'Tab 2',
65
+ * className: 'tab-two',
66
+ * },
67
+ * ] }
68
+ * >
69
+ * { ( tab ) => <p>{ tab.title }</p> }
70
+ * </TabPanel>
71
+ * );
72
+ * ```
73
+ */
74
+
40
75
 
41
- export default function TabPanel(_ref2) {
76
+ export function TabPanel(_ref2) {
42
77
  var _selectedTab$name;
43
78
 
44
79
  let {
@@ -48,17 +83,17 @@ export default function TabPanel(_ref2) {
48
83
  initialTabName,
49
84
  orientation = 'horizontal',
50
85
  activeClass = 'is-active',
51
- onSelect = noop
86
+ onSelect
52
87
  } = _ref2;
53
88
  const instanceId = useInstanceId(TabPanel, 'tab-panel');
54
- const [selected, setSelected] = useState(null);
89
+ const [selected, setSelected] = useState();
55
90
 
56
91
  const handleClick = tabKey => {
57
92
  setSelected(tabKey);
58
- onSelect(tabKey);
93
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(tabKey);
59
94
  };
60
95
 
61
- const onNavigate = (childIndex, child) => {
96
+ const onNavigate = (_childIndex, child) => {
62
97
  child.click();
63
98
  };
64
99
 
@@ -72,7 +107,7 @@ export default function TabPanel(_ref2) {
72
107
  });
73
108
 
74
109
  if (!newSelectedTab) {
75
- setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name : null));
110
+ setSelected(initialTabName || (tabs.length > 0 ? tabs[0].name : undefined));
76
111
  }
77
112
  }, [tabs]);
78
113
  return createElement("div", {
@@ -90,7 +125,7 @@ export default function TabPanel(_ref2) {
90
125
  "aria-controls": `${instanceId}-${tab.name}-view`,
91
126
  selected: tab.name === selected,
92
127
  key: tab.name,
93
- onClick: partial(handleClick, tab.name)
128
+ onClick: () => handleClick(tab.name)
94
129
  }, tab.title))), selectedTab && createElement("div", {
95
130
  key: selectedId,
96
131
  "aria-labelledby": selectedId,
@@ -99,4 +134,5 @@ export default function TabPanel(_ref2) {
99
134
  className: "components-tab-panel__tab-content"
100
135
  }, children(selectedTab)));
101
136
  }
137
+ export default TabPanel;
102
138
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tab-panel/index.js"],"names":["classnames","partial","find","useState","useEffect","useInstanceId","NavigableMenu","Button","noop","TabButton","tabId","onClick","children","selected","rest","TabPanel","className","tabs","initialTabName","orientation","activeClass","onSelect","instanceId","setSelected","handleClick","tabKey","onNavigate","childIndex","child","click","selectedTab","name","selectedId","newSelectedTab","length","map","tab","title"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,OAAT,EAAkBC,IAAlB,QAA8B,QAA9B;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,wBAA9B;AACA,OAAOC,MAAP,MAAmB,WAAnB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,MAAMC,SAAS,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA,QAA5B;AAAsC,OAAGC;AAAzC,GAAF;AAAA,SACjB,cAAC,MAAD;AACC,IAAA,IAAI,EAAC,KADN;AAEC,IAAA,QAAQ,EAAGD,QAAQ,GAAG,IAAH,GAAU,CAAC,CAF/B;AAGC,qBAAgBA,QAHjB;AAIC,IAAA,EAAE,EAAGH,KAJN;A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,IAAzC,CADJ,CAAX;AAGA;AACD,GAPQ,EAON,CAAEd,IAAF,CAPM,CAAT;AASA,SACC;AAAK,IAAA,SAAS,EAAGD;AAAjB,KACC,cAAC,aAAD;AACC,IAAA,IAAI,EAAC,SADN;AAEC,IAAA,WAAW,EAAGG,WAFf;AAGC,IAAA,UAAU,EAAGO,UAHd;AAIC,IAAA,SAAS,EAAC;AAJX,KAMGT,IAAI,CAACkB,GAAL,CAAYC,GAAF,IACX,cAAC,SAAD;AACC,IAAA,SAAS,EAAGpC,UAAU,CACrB,iCADqB,EAErBoC,GAAG,CAACpB,SAFiB,EAGrB;AACC,OAAEI,WAAF,GAAiBgB,GAAG,CAACL,IAAJ,KAAalB;AAD/B,KAHqB,CADvB;AAQC,IAAA,KAAK,EAAI,GAAGS,UAAY,IAAIc,GAAG,CAACL,IAAM,EARvC;AASC,qBAAiB,GAAGT,UAAY,IAAIc,GAAG,CAACL,IAAM,OAT/C;AAUC,IAAA,QAAQ,EAAGK,GAAG,CAACL,IAAJ,KAAalB,QAVzB;AAWC,IAAA,GAAG,EAAGuB,GAAG,CAACL,IAXX;AAYC,IAAA,OAAO,EAAG9B,OAAO,CAAEuB,WAAF,EAAeY,GAAG,CAACL,IAAnB;AAZlB,KAcGK,GAAG,CAACC,KAdP,CADC,CANH,CADD,EA0BGP,WAAW,IACZ;AACC,IAAA,GAAG,EAAGE,UADP;AAEC,uBAAkBA,UAFnB;AAGC,IAAA,IAAI,EAAC,UAHN;AAIC,IAAA,EAAE,EAAI,GAAGA,UAAY,OAJtB;AAKC,IAAA,SAAS,EAAC;AALX,KAOGpB,QAAQ,CAAEkB,WAAF,CAPX,CA3BF,CADD;AAwCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { partial, find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { NavigableMenu } from '../navigable-container';\nimport Button from '../button';\n\nconst noop = () => {};\n\nconst TabButton = ( { tabId, onClick, children, selected, ...rest } ) => (\n\t<Button\n\t\trole=\"tab\"\n\t\ttabIndex={ selected ? null : -1 }\n\t\taria-selected={ selected }\n\t\tid={ tabId }\n\t\tonClick={ onClick }\n\t\t{ ...rest }\n\t>\n\t\t{ children }\n\t</Button>\n);\n\nexport default function TabPanel( {\n\tclassName,\n\tchildren,\n\ttabs,\n\tinitialTabName,\n\torientation = 'horizontal',\n\tactiveClass = 'is-active',\n\tonSelect = noop,\n} ) {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\tconst [ selected, setSelected ] = useState( null );\n\n\tconst handleClick = ( tabKey ) => {\n\t\tsetSelected( tabKey );\n\t\tonSelect( tabKey );\n\t};\n\n\tconst onNavigate = ( childIndex, child ) => {\n\t\tchild.click();\n\t};\n\tconst selectedTab = find( tabs, { name: selected } );\n\tconst selectedId = `${ instanceId }-${ selectedTab?.name ?? 'none' }`;\n\n\tuseEffect( () => {\n\t\tconst newSelectedTab = find( tabs, { name: selected } );\n\t\tif ( ! newSelectedTab ) {\n\t\t\tsetSelected(\n\t\t\t\tinitialTabName || ( tabs.length > 0 ? tabs[ 0 ].name : null )\n\t\t\t);\n\t\t}\n\t}, [ tabs ] );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<NavigableMenu\n\t\t\t\trole=\"tablist\"\n\t\t\t\torientation={ orientation }\n\t\t\t\tonNavigate={ onNavigate }\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t<TabButton\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ activeClass ]: tab.name === selected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttabId={ `${ instanceId }-${ tab.name }` }\n\t\t\t\t\t\taria-controls={ `${ instanceId }-${ tab.name }-view` }\n\t\t\t\t\t\tselected={ tab.name === selected }\n\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\tonClick={ partial( handleClick, tab.name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t</TabButton>\n\t\t\t\t) ) }\n\t\t\t</NavigableMenu>\n\t\t\t{ selectedTab && (\n\t\t\t\t<div\n\t\t\t\t\tkey={ selectedId }\n\t\t\t\t\taria-labelledby={ selectedId }\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\tid={ `${ selectedId }-view` }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tab-panel/index.tsx"],"names":["classnames","find","useState","useEffect","useInstanceId","NavigableMenu","Button","TabButton","tabId","onClick","children","selected","rest","TabPanel","className","tabs","initialTabName","orientation","activeClass","onSelect","instanceId","setSelected","handleClick","tabKey","onNavigate","_childIndex","child","click","selectedTab","name","selectedId","newSelectedTab","length","undefined","map","tab","title"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,wBAA9B;AACA,OAAOC,MAAP,MAAmB,WAAnB;;AAIA,MAAMC,SAAS,GAAG;AAAA,MAAE;AACnBC,IAAAA,KADmB;AAEnBC,IAAAA,OAFmB;AAGnBC,IAAAA,QAHmB;AAInBC,IAAAA,QAJmB;AAKnB,OAAGC;AALgB,GAAF;AAAA,SAOjB,cAAC,MA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I,EAAC,UAHN;AAIC,IAAA,EAAE,EAAI,GAAGA,UAAY,OAJtB;AAKC,IAAA,SAAS,EAAC;AALX,KAOGpB,QAAQ,CAAEkB,WAAF,CAPX,CA3BF,CADD;AAwCA;AAED,eAAef,QAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { NavigableMenu } from '../navigable-container';\nimport Button from '../button';\nimport type { TabButtonProps, TabPanelProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst TabButton = ( {\n\ttabId,\n\tonClick,\n\tchildren,\n\tselected,\n\t...rest\n}: TabButtonProps ) => (\n\t<Button\n\t\trole=\"tab\"\n\t\ttabIndex={ selected ? null : -1 }\n\t\taria-selected={ selected }\n\t\tid={ tabId }\n\t\tonClick={ onClick }\n\t\t{ ...rest }\n\t>\n\t\t{ children }\n\t</Button>\n);\n\n/**\n * TabPanel is an ARIA-compliant tabpanel.\n *\n * TabPanels organize content across different screens, data sets, and interactions.\n * It has two sections: a list of tabs, and the view to show when tabs are chosen.\n *\n * ```jsx\n * import { TabPanel } from '@wordpress/components';\n *\n * const onSelect = ( tabName ) => {\n * console.log( 'Selecting tab', tabName );\n * };\n *\n * const MyTabPanel = () => (\n * <TabPanel\n * className=\"my-tab-panel\"\n * activeClass=\"active-tab\"\n * onSelect={ onSelect }\n * tabs={ [\n * {\n * name: 'tab1',\n * title: 'Tab 1',\n * className: 'tab-one',\n * },\n * {\n * name: 'tab2',\n * title: 'Tab 2',\n * className: 'tab-two',\n * },\n * ] }\n * >\n * { ( tab ) => <p>{ tab.title }</p> }\n * </TabPanel>\n * );\n * ```\n */\nexport function TabPanel( {\n\tclassName,\n\tchildren,\n\ttabs,\n\tinitialTabName,\n\torientation = 'horizontal',\n\tactiveClass = 'is-active',\n\tonSelect,\n}: WordPressComponentProps< TabPanelProps, 'div', false > ) {\n\tconst instanceId = useInstanceId( TabPanel, 'tab-panel' );\n\tconst [ selected, setSelected ] = useState< string >();\n\n\tconst handleClick = ( tabKey: string ) => {\n\t\tsetSelected( tabKey );\n\t\tonSelect?.( tabKey );\n\t};\n\n\tconst onNavigate = ( _childIndex: number, child: HTMLButtonElement ) => {\n\t\tchild.click();\n\t};\n\tconst selectedTab = find( tabs, { name: selected } );\n\tconst selectedId = `${ instanceId }-${ selectedTab?.name ?? 'none' }`;\n\n\tuseEffect( () => {\n\t\tconst newSelectedTab = find( tabs, { name: selected } );\n\t\tif ( ! newSelectedTab ) {\n\t\t\tsetSelected(\n\t\t\t\tinitialTabName ||\n\t\t\t\t\t( tabs.length > 0 ? tabs[ 0 ].name : undefined )\n\t\t\t);\n\t\t}\n\t}, [ tabs ] );\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<NavigableMenu\n\t\t\t\trole=\"tablist\"\n\t\t\t\torientation={ orientation }\n\t\t\t\tonNavigate={ onNavigate }\n\t\t\t\tclassName=\"components-tab-panel__tabs\"\n\t\t\t>\n\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t<TabButton\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-tab-panel__tabs-item',\n\t\t\t\t\t\t\ttab.className,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ activeClass ]: tab.name === selected,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ttabId={ `${ instanceId }-${ tab.name }` }\n\t\t\t\t\t\taria-controls={ `${ instanceId }-${ tab.name }-view` }\n\t\t\t\t\t\tselected={ tab.name === selected }\n\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\tonClick={ () => handleClick( tab.name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t</TabButton>\n\t\t\t\t) ) }\n\t\t\t</NavigableMenu>\n\t\t\t{ selectedTab && (\n\t\t\t\t<div\n\t\t\t\t\tkey={ selectedId }\n\t\t\t\t\taria-labelledby={ selectedId }\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\tid={ `${ selectedId }-view` }\n\t\t\t\t\tclassName=\"components-tab-panel__tab-content\"\n\t\t\t\t>\n\t\t\t\t\t{ children( selectedTab ) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default TabPanel;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -18,6 +18,7 @@ import BaseControl from '../base-control';
18
18
 
19
19
  function UnforwardedTextControl(props, ref) {
20
20
  const {
21
+ __nextHasNoMarginBottom,
21
22
  label,
22
23
  hideLabelFromVision,
23
24
  value,
@@ -33,6 +34,7 @@ function UnforwardedTextControl(props, ref) {
33
34
  const onChangeValue = event => onChange(event.target.value);
34
35
 
35
36
  return createElement(BaseControl, {
37
+ __nextHasNoMarginBottom: __nextHasNoMarginBottom,
36
38
  label: label,
37
39
  hideLabelFromVision: hideLabelFromVision,
38
40
  id: id,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/text-control/index.tsx"],"names":["useInstanceId","forwardRef","BaseControl","UnforwardedTextControl","props","ref","label","hideLabelFromVision","value","help","className","onChange","type","additionalProps","instanceId","TextControl","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAIA,SAASC,sBAAT,CACCC,KADD,EAECC,GAFD,EAGE;AACD,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,mBAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA,QANK;AAOLC,IAAAA,IAAI,GAAG,MAPF;AAQL,OAAGC;AARE,MASFT,KATJ;AAUA,QAAMU,UAAU,GAAGd,aAAa,CAAEe,WAAF,CAAhC;AACA,QAAMC,EAAE,GAAI,0BAA0BF,UAAY,EAAlD;;AACA,QAAMG,aAAa,GAAKC,KAAF,IACrBP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaX,KAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,mBAAmB,EAAGC,mBAFvB;AAGC,IAAA,EAAE,EAAGS,EAHN;AAIC,IAAA,IAAI,EAAGP,IAJR;AAKC,IAAA,SAAS,EAAGC;AALb,KAOC;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,IAAI,EAAGE,IAFR;AAGC,IAAA,EAAE,EAAGI,EAHN;AAIC,IAAA,KAAK,EAAGR,KAJT;AAKC,IAAA,QAAQ,EAAGS,aALZ;AAMC,wBAAmB,CAAC,CAAER,IAAH,GAAUO,EAAE,GAAG,QAAf,GAA0BI,SAN9C;AAOC,IAAA,GAAG,EAAGf;AAPP,KAQMQ,eARN,EAPD,CADD;AAoBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAME,WAAW,GAAGd,UAAU,CAAEE,sBAAF,CAA9B;AAEP,eAAeY,WAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TextControlProps } from './types';\n\nfunction UnforwardedTextControl(\n\tprops: WordPressComponentProps< TextControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextControl );\n\tconst id = `inspector-text-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"components-text-control__input\"\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextControl components let users enter and edit text.\n *\n *\n * @example\n * ```jsx\n * import { TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextControl = () => {\n * const [ className, setClassName ] = useState( '' );\n *\n * return (\n * <TextControl\n * label=\"Additional CSS Class\"\n * value={ className }\n * onChange={ ( value ) => setClassName( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextControl = forwardRef( UnforwardedTextControl );\n\nexport default TextControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/text-control/index.tsx"],"names":["useInstanceId","forwardRef","BaseControl","UnforwardedTextControl","props","ref","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","className","onChange","type","additionalProps","instanceId","TextControl","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AACA,SAASC,UAAT,QA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ependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { TextControlProps } from './types';\n\nfunction UnforwardedTextControl(\n\tprops: WordPressComponentProps< TextControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextControl );\n\tconst id = `inspector-text-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"components-text-control__input\"\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextControl components let users enter and edit text.\n *\n *\n * @example\n * ```jsx\n * import { TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextControl = () => {\n * const [ className, setClassName ] = useState( '' );\n *\n * return (\n * <TextControl\n * label=\"Additional CSS Class\"\n * value={ className }\n * onChange={ ( value ) => setClassName( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextControl = forwardRef( UnforwardedTextControl );\n\nexport default TextControl;\n"]}
@@ -39,10 +39,9 @@ import { StyledTextarea } from './styles/textarea-control-styles';
39
39
  * };
40
40
  * ```
41
41
  */
42
- export function TextareaControl( // ref is omitted until we have `WordPressComponentPropsWithoutRef` or add
43
- // ref forwarding to TextareaControl.
44
- props) {
42
+ export function TextareaControl(props) {
45
43
  const {
44
+ __nextHasNoMarginBottom,
46
45
  label,
47
46
  hideLabelFromVision,
48
47
  value,
@@ -58,6 +57,7 @@ props) {
58
57
  const onChangeValue = event => onChange(event.target.value);
59
58
 
60
59
  return createElement(BaseControl, {
60
+ __nextHasNoMarginBottom: __nextHasNoMarginBottom,
61
61
  label: label,
62
62
  hideLabelFromVision: hideLabelFromVision,
63
63
  id: id,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/textarea-control/index.tsx"],"names":["useInstanceId","BaseControl","StyledTextarea","TextareaControl","props","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAASC,cAAT,QAA+B,kCAA/B;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAT,EACN;AACA;AACAC,KAHM,EAOL;AACD,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,mBAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA,IAJK;AAKLC,IAAAA,QALK;AAMLC,IAAAA,IAAI,GAAG,CANF;AAOLC,IAAAA,SAPK;AAQL,OAAGC;AARE,MASFR,KATJ;AAUA,QAAMS,UAAU,GAAGb,aAAa,CAAEG,eAAF,CAAhC;AACA,QAAMW,EAAE,GAAI,8BAA8BD,UAAY,EAAtD;;AACA,QAAME,aAAa,GAAKC,KAAF,IACrBP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaV,KAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,mBAAmB,EAAGC,mBAFvB;AAGC,IAAA,EAAE,EAAGQ,EAHN;AAIC,IAAA,IAAI,EAAGN,IAJR;AAKC,IAAA,SAAS,EAAGG;AALb,KAOC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,EAAE,EAAGG,EAFN;AAGC,IAAA,IAAI,EAAGJ,IAHR;AAIC,IAAA,QAAQ,EAAGK,aAJZ;AAKC,wBAAmB,CAAC,CAAEP,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI,SAL9C;AAMC,IAAA,KAAK,EAAGX;AANT,KAOMK,eAPN,EAPD,CADD;AAmBA;AAED,eAAeT,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { StyledTextarea } from './styles/textarea-control-styles';\nimport type { TextareaControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * TextareaControls are TextControls that allow for multiple lines of text, and\n * wrap overflow text onto a new line. They are a fixed height and scroll\n * vertically when the cursor reaches the bottom of the field.\n *\n * ```jsx\n * import { TextareaControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextareaControl = () => {\n * const [ text, setText ] = useState( '' );\n *\n * return (\n * <TextareaControl\n * label=\"Text\"\n * help=\"Enter some text\"\n * value={ text }\n * onChange={ ( value ) => setText( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function TextareaControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to TextareaControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< TextareaControlProps, 'textarea', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tonChange,\n\t\trows = 4,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextareaControl );\n\tconst id = `inspector-textarea-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLTextAreaElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<StyledTextarea\n\t\t\t\tclassName=\"components-textarea-control__input\"\n\t\t\t\tid={ id }\n\t\t\t\trows={ rows }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tvalue={ value }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default TextareaControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/textarea-control/index.tsx"],"names":["useInstanceId","BaseControl","StyledTextarea","TextareaControl","props","__nextHasNoMarginBottom","label","hideLabelFromVision","value","help","onChange","rows","className","additionalProps","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,SAASC,cAAT,QAA+B,kCAA/B;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA,KAJK;AAKLC,IAAAA,IALK;AAMLC,IAAAA,QANK;AAOLC,IAAAA,IAAI,GAAG,CAPF;AAQLC,IAAAA,SARK;AASL,OAAGC;AATE,MAUFT,KAVJ;AAWA,QAAMU,UAAU,GAAGd,aAAa,CAAEG,eAAF,CAAhC;AACA,QAAMY,EAAE,GAAI,8BAA8BD,UAAY,EAAtD;;AACA,QAAME,aAAa,GAAKC,KAAF,IACrBP,QAAQ,CAAEO,KAAK,CAACC,MAAN,CAAaV,KAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,uBAAuB,EAAGH,uBAD3B;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,EAAE,EAAGQ,EAJN;AAKC,IAAA,IAAI,EAAGN,IALR;AAMC,IAAA,SAAS,EAAGG;AANb,KAQC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,EAAE,EAAGG,EAFN;AAGC,IAAA,IAAI,EAAGJ,IAHR;AAIC,IAAA,QAAQ,EAAGK,aAJZ;AAKC,wBAAmB,CAAC,CAAEP,IAAH,GAAUM,EAAE,GAAG,QAAf,GAA0BI,SAL9C;AAMC,IAAA,KAAK,EAAGX;AANT,KAOMK,eAPN,EARD,CADD;AAoBA;AAED,eAAeV,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { StyledTextarea } from './styles/textarea-control-styles';\nimport type { TextareaControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * TextareaControls are TextControls that allow for multiple lines of text, and\n * wrap overflow text onto a new line. They are a fixed height and scroll\n * vertically when the cursor reaches the bottom of the field.\n *\n * ```jsx\n * import { TextareaControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextareaControl = () => {\n * const [ text, setText ] = useState( '' );\n *\n * return (\n * <TextareaControl\n * label=\"Text\"\n * help=\"Enter some text\"\n * value={ text }\n * onChange={ ( value ) => setText( value ) }\n * />\n * );\n * };\n * ```\n */\nexport function TextareaControl(\n\tprops: WordPressComponentProps< TextareaControlProps, 'textarea', false >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tonChange,\n\t\trows = 4,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\tconst instanceId = useInstanceId( TextareaControl );\n\tconst id = `inspector-textarea-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLTextAreaElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<StyledTextarea\n\t\t\t\tclassName=\"components-textarea-control__input\"\n\t\t\t\tid={ id }\n\t\t\t\trows={ rows }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tvalue={ value }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\nexport default TextareaControl;\n"]}
@@ -3,7 +3,7 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * External dependencies
5
5
  */
6
- import classnames from 'classnames';
6
+ import { css } from '@emotion/react';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
@@ -15,8 +15,33 @@ import { useInstanceId } from '@wordpress/compose';
15
15
 
16
16
  import FormToggle from '../form-toggle';
17
17
  import BaseControl from '../base-control';
18
- export default function ToggleControl(_ref) {
18
+ import { HStack } from '../h-stack';
19
+ import { useCx } from '../utils';
20
+ import { space } from '../ui/utils/space';
21
+ /**
22
+ * ToggleControl is used to generate a toggle user interface.
23
+ *
24
+ * ```jsx
25
+ * import { ToggleControl } from '@wordpress/components';
26
+ * import { useState } from '@wordpress/element';
27
+ *
28
+ * const MyToggleControl = () => {
29
+ * const [ value, setValue ] = useState( false );
30
+ *
31
+ * return (
32
+ * <ToggleControl
33
+ * label="Fixed Background"
34
+ * checked={ value }
35
+ * onChange={ () => setValue( ( state ) => ! state ) }
36
+ * />
37
+ * );
38
+ * };
39
+ * ```
40
+ */
41
+
42
+ export function ToggleControl(_ref) {
19
43
  let {
44
+ __nextHasNoMarginBottom,
20
45
  label,
21
46
  checked,
22
47
  help,
@@ -31,6 +56,10 @@ export default function ToggleControl(_ref) {
31
56
 
32
57
  const instanceId = useInstanceId(ToggleControl);
33
58
  const id = `inspector-toggle-control-${instanceId}`;
59
+ const cx = useCx();
60
+ const classes = cx('components-toggle-control', className, !__nextHasNoMarginBottom && /*#__PURE__*/css({
61
+ marginBottom: space(3)
62
+ }, process.env.NODE_ENV === "production" ? "" : ";label:classes;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWNvbnRyb2wvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZEK0IiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy90b2dnbGUtY29udHJvbC9pbmRleC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgdHlwZSB7IENoYW5nZUV2ZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzIH0gZnJvb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  if (help) {
@@ -41,7 +70,11 @@ export default function ToggleControl(_ref) {
41
70
  return createElement(BaseControl, {
42
71
  id: id,
43
72
  help: helpLabel,
44
- className: classnames('components-toggle-control', className)
73
+ className: classes,
74
+ __nextHasNoMarginBottom: true
75
+ }, createElement(HStack, {
76
+ justify: "flex-start",
77
+ spacing: 3
45
78
  }, createElement(FormToggle, {
46
79
  id: id,
47
80
  checked: checked,
@@ -51,6 +84,7 @@ export default function ToggleControl(_ref) {
51
84
  }), createElement("label", {
52
85
  htmlFor: id,
53
86
  className: "components-toggle-control__label"
54
- }, label));
87
+ }, label)));
55
88
  }
89
+ export default ToggleControl;
56
90
  //# sourceMappingURL=index.js.map