@wordpress/components 21.2.0 → 21.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/CHANGELOG.md +35 -3
  2. package/CONTRIBUTING.md +20 -0
  3. package/build/border-box-control/border-box-control/component.js +2 -0
  4. package/build/border-box-control/border-box-control/component.js.map +1 -1
  5. package/build/border-box-control/border-box-control/hook.js +4 -1
  6. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  7. package/build/border-control/border-control/component.js +2 -0
  8. package/build/border-control/border-control/component.js.map +1 -1
  9. package/build/disabled/index.js +6 -26
  10. package/build/disabled/index.js.map +1 -1
  11. package/build/font-size-picker/index.js +1 -1
  12. package/build/font-size-picker/index.js.map +1 -1
  13. package/build/font-size-picker/styles.js +5 -13
  14. package/build/font-size-picker/styles.js.map +1 -1
  15. package/build/font-size-picker/utils.js +1 -1
  16. package/build/font-size-picker/utils.js.map +1 -1
  17. package/build/form-token-field/suggestions-list.js +5 -5
  18. package/build/form-token-field/suggestions-list.js.map +1 -1
  19. package/build/higher-order/with-fallback-styles/index.js +1 -1
  20. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  21. package/build/index.js +8 -6
  22. package/build/index.js.map +1 -1
  23. package/build/modal/aria-helper.js +2 -3
  24. package/build/modal/aria-helper.js.map +1 -1
  25. package/build/modal/index.js +42 -11
  26. package/build/modal/index.js.map +1 -1
  27. package/build/modal/types.js +6 -0
  28. package/build/modal/types.js.map +1 -0
  29. package/build/navigator/index.js +8 -8
  30. package/build/navigator/index.js.map +1 -1
  31. package/build/navigator/navigator-back-button/component.js +5 -4
  32. package/build/navigator/navigator-back-button/component.js.map +1 -1
  33. package/build/navigator/navigator-back-button/index.js +1 -1
  34. package/build/navigator/navigator-back-button/index.js.map +1 -1
  35. package/build/navigator/navigator-button/component.js +5 -4
  36. package/build/navigator/navigator-button/component.js.map +1 -1
  37. package/build/navigator/navigator-button/index.js +1 -1
  38. package/build/navigator/navigator-button/index.js.map +1 -1
  39. package/build/navigator/navigator-provider/component.js +10 -7
  40. package/build/navigator/navigator-provider/component.js.map +1 -1
  41. package/build/navigator/navigator-provider/index.js +1 -1
  42. package/build/navigator/navigator-provider/index.js.map +1 -1
  43. package/build/navigator/navigator-screen/component.js +24 -27
  44. package/build/navigator/navigator-screen/component.js.map +1 -1
  45. package/build/navigator/navigator-screen/index.js +1 -1
  46. package/build/navigator/navigator-screen/index.js.map +1 -1
  47. package/build/sandbox/index.js +55 -59
  48. package/build/sandbox/index.js.map +1 -1
  49. package/build/sandbox/index.native.js +63 -62
  50. package/build/sandbox/index.native.js.map +1 -1
  51. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  52. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  53. package/build/tab-panel/index.js +4 -4
  54. package/build/tab-panel/index.js.map +1 -1
  55. package/build/theme/index.js +62 -0
  56. package/build/theme/index.js.map +1 -0
  57. package/build/theme/styles.js +33 -0
  58. package/build/theme/styles.js.map +1 -0
  59. package/build/theme/types.js +6 -0
  60. package/build/theme/types.js.map +1 -0
  61. package/build/tools-panel/tools-panel/hook.js +3 -3
  62. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  63. package/build/tools-panel/tools-panel-item/hook.js +6 -6
  64. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  65. package/build/tooltip/index.js +4 -1
  66. package/build/tooltip/index.js.map +1 -1
  67. package/build/tooltip/index.native.js +17 -4
  68. package/build/tooltip/index.native.js.map +1 -1
  69. package/build-module/border-box-control/border-box-control/component.js +2 -0
  70. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  71. package/build-module/border-box-control/border-box-control/hook.js +4 -1
  72. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  73. package/build-module/border-control/border-control/component.js +2 -0
  74. package/build-module/border-control/border-control/component.js.map +1 -1
  75. package/build-module/disabled/index.js +7 -26
  76. package/build-module/disabled/index.js.map +1 -1
  77. package/build-module/font-size-picker/index.js +1 -1
  78. package/build-module/font-size-picker/index.js.map +1 -1
  79. package/build-module/font-size-picker/styles.js +5 -13
  80. package/build-module/font-size-picker/styles.js.map +1 -1
  81. package/build-module/font-size-picker/utils.js +1 -1
  82. package/build-module/font-size-picker/utils.js.map +1 -1
  83. package/build-module/form-token-field/suggestions-list.js +5 -5
  84. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  85. package/build-module/higher-order/with-fallback-styles/index.js +2 -2
  86. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  87. package/build-module/index.js +2 -1
  88. package/build-module/index.js.map +1 -1
  89. package/build-module/modal/aria-helper.js +2 -3
  90. package/build-module/modal/aria-helper.js.map +1 -1
  91. package/build-module/modal/index.js +44 -12
  92. package/build-module/modal/index.js.map +1 -1
  93. package/build-module/modal/types.js +2 -0
  94. package/build-module/modal/types.js.map +1 -0
  95. package/build-module/navigator/index.js +4 -4
  96. package/build-module/navigator/index.js.map +1 -1
  97. package/build-module/navigator/navigator-back-button/component.js +3 -3
  98. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  99. package/build-module/navigator/navigator-back-button/index.js +1 -1
  100. package/build-module/navigator/navigator-back-button/index.js.map +1 -1
  101. package/build-module/navigator/navigator-button/component.js +3 -3
  102. package/build-module/navigator/navigator-button/component.js.map +1 -1
  103. package/build-module/navigator/navigator-button/index.js +1 -1
  104. package/build-module/navigator/navigator-button/index.js.map +1 -1
  105. package/build-module/navigator/navigator-provider/component.js +8 -6
  106. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  107. package/build-module/navigator/navigator-provider/index.js +1 -1
  108. package/build-module/navigator/navigator-provider/index.js.map +1 -1
  109. package/build-module/navigator/navigator-screen/component.js +12 -26
  110. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  111. package/build-module/navigator/navigator-screen/index.js +1 -1
  112. package/build-module/navigator/navigator-screen/index.js.map +1 -1
  113. package/build-module/sandbox/index.js +56 -59
  114. package/build-module/sandbox/index.js.map +1 -1
  115. package/build-module/sandbox/index.native.js +54 -52
  116. package/build-module/sandbox/index.native.js.map +1 -1
  117. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  118. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  119. package/build-module/tab-panel/index.js +4 -4
  120. package/build-module/tab-panel/index.js.map +1 -1
  121. package/build-module/theme/index.js +52 -0
  122. package/build-module/theme/index.js.map +1 -0
  123. package/build-module/theme/styles.js +25 -0
  124. package/build-module/theme/styles.js.map +1 -0
  125. package/build-module/theme/types.js +2 -0
  126. package/build-module/theme/types.js.map +1 -0
  127. package/build-module/tools-panel/tools-panel/hook.js +3 -3
  128. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  129. package/build-module/tools-panel/tools-panel-item/hook.js +6 -6
  130. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  131. package/build-module/tooltip/index.js +4 -1
  132. package/build-module/tooltip/index.js.map +1 -1
  133. package/build-module/tooltip/index.native.js +17 -4
  134. package/build-module/tooltip/index.native.js.map +1 -1
  135. package/build-style/style-rtl.css +26 -22
  136. package/build-style/style.css +26 -22
  137. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  138. package/build-types/border-box-control/border-box-control/hook.d.ts +1 -0
  139. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  140. package/build-types/border-control/border-control/component.d.ts +1 -0
  141. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  142. package/build-types/border-control/border-control/hook.d.ts +1 -0
  143. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  144. package/build-types/border-control/stories/index.d.ts +6 -0
  145. package/build-types/border-control/stories/index.d.ts.map +1 -1
  146. package/build-types/border-control/types.d.ts +4 -0
  147. package/build-types/border-control/types.d.ts.map +1 -1
  148. package/build-types/confirm-dialog/types.d.ts +5 -1
  149. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  150. package/build-types/disabled/index.d.ts.map +1 -1
  151. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  152. package/build-types/modal/aria-helper.d.ts +4 -4
  153. package/build-types/modal/aria-helper.d.ts.map +1 -1
  154. package/build-types/modal/index.d.ts +35 -2
  155. package/build-types/modal/index.d.ts.map +1 -1
  156. package/build-types/modal/stories/index.d.ts +9 -0
  157. package/build-types/modal/stories/index.d.ts.map +1 -0
  158. package/build-types/modal/test/aria-helper.d.ts +2 -0
  159. package/build-types/modal/test/aria-helper.d.ts.map +1 -0
  160. package/build-types/modal/test/index.d.ts +2 -0
  161. package/build-types/modal/test/index.d.ts.map +1 -0
  162. package/build-types/modal/types.d.ts +134 -0
  163. package/build-types/modal/types.d.ts.map +1 -0
  164. package/build-types/navigator/index.d.ts +4 -4
  165. package/build-types/navigator/index.d.ts.map +1 -1
  166. package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
  167. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  168. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
  169. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  170. package/build-types/navigator/navigator-back-button/index.d.ts +1 -1
  171. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -1
  172. package/build-types/navigator/navigator-button/component.d.ts +4 -2
  173. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  174. package/build-types/navigator/navigator-button/hook.d.ts +1 -0
  175. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  176. package/build-types/navigator/navigator-button/index.d.ts +1 -1
  177. package/build-types/navigator/navigator-button/index.d.ts.map +1 -1
  178. package/build-types/navigator/navigator-provider/component.d.ts +2 -2
  179. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  180. package/build-types/navigator/navigator-provider/index.d.ts +1 -1
  181. package/build-types/navigator/navigator-provider/index.d.ts.map +1 -1
  182. package/build-types/navigator/navigator-screen/component.d.ts +2 -2
  183. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  184. package/build-types/navigator/navigator-screen/index.d.ts +1 -1
  185. package/build-types/navigator/navigator-screen/index.d.ts.map +1 -1
  186. package/build-types/navigator/stories/index.d.ts +9 -0
  187. package/build-types/navigator/stories/index.d.ts.map +1 -0
  188. package/build-types/navigator/test/index.d.ts +2 -0
  189. package/build-types/navigator/test/index.d.ts.map +1 -0
  190. package/build-types/navigator/types.d.ts +4 -1
  191. package/build-types/navigator/types.d.ts.map +1 -1
  192. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  193. package/build-types/tab-panel/index.d.ts.map +1 -1
  194. package/build-types/theme/index.d.ts +31 -0
  195. package/build-types/theme/index.d.ts.map +1 -0
  196. package/build-types/theme/stories/index.d.ts +13 -0
  197. package/build-types/theme/stories/index.d.ts.map +1 -0
  198. package/build-types/theme/styles.d.ts +10 -0
  199. package/build-types/theme/styles.d.ts.map +1 -0
  200. package/build-types/theme/test/index.d.ts +2 -0
  201. package/build-types/theme/test/index.d.ts.map +1 -0
  202. package/build-types/theme/types.d.ts +21 -0
  203. package/build-types/theme/types.d.ts.map +1 -0
  204. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  205. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  206. package/build-types/tooltip/index.d.ts.map +1 -1
  207. package/package.json +17 -17
  208. package/src/base-field/test/index.js +4 -6
  209. package/src/border-box-control/border-box-control/component.tsx +2 -0
  210. package/src/border-box-control/border-box-control/hook.ts +4 -0
  211. package/src/border-box-control/test/index.js +7 -2
  212. package/src/border-control/border-control/README.md +6 -0
  213. package/src/border-control/border-control/component.tsx +2 -0
  214. package/src/border-control/types.ts +4 -0
  215. package/src/button/style.scss +25 -25
  216. package/src/button/test/index.js +3 -5
  217. package/src/combobox-control/test/index.js +1 -1
  218. package/src/confirm-dialog/types.ts +6 -0
  219. package/src/date-time/time/test/index.tsx +2 -6
  220. package/src/disabled/index.tsx +11 -33
  221. package/src/disabled/test/index.tsx +14 -82
  222. package/src/dropdown/test/index.js +4 -3
  223. package/src/font-size-picker/index.tsx +1 -1
  224. package/src/font-size-picker/styles.ts +3 -1
  225. package/src/font-size-picker/test/index.tsx +2 -2
  226. package/src/font-size-picker/test/utils.ts +5 -5
  227. package/src/font-size-picker/utils.ts +1 -1
  228. package/src/form-file-upload/test/index.tsx +1 -1
  229. package/src/form-token-field/suggestions-list.tsx +5 -5
  230. package/src/higher-order/with-fallback-styles/index.js +6 -2
  231. package/src/higher-order/with-focus-outside/test/index.js +44 -45
  232. package/src/higher-order/with-focus-return/test/index.js +34 -30
  233. package/src/higher-order/with-notices/test/index.js +1 -1
  234. package/src/index.js +2 -1
  235. package/src/input-control/test/index.js +2 -2
  236. package/src/item-group/test/index.js +2 -2
  237. package/src/menu-item/test/index.js +0 -3
  238. package/src/mobile/bottom-sheet/test/range-cell.native.js +16 -14
  239. package/src/modal/README.md +53 -54
  240. package/src/modal/{aria-helper.js → aria-helper.ts} +5 -7
  241. package/src/modal/{index.js → index.tsx} +48 -12
  242. package/src/modal/stories/{index.js → index.tsx} +47 -42
  243. package/src/modal/test/{aria-helper.js → aria-helper.ts} +0 -0
  244. package/src/modal/test/{index.js → index.tsx} +13 -3
  245. package/src/modal/types.ts +144 -0
  246. package/src/navigation/test/index.js +1 -1
  247. package/src/navigator/index.ts +4 -4
  248. package/src/navigator/navigator-back-button/component.tsx +4 -4
  249. package/src/navigator/navigator-back-button/index.ts +1 -1
  250. package/src/navigator/navigator-button/component.tsx +4 -4
  251. package/src/navigator/navigator-button/index.ts +1 -1
  252. package/src/navigator/navigator-provider/component.tsx +6 -4
  253. package/src/navigator/navigator-provider/index.ts +1 -1
  254. package/src/navigator/navigator-screen/component.tsx +20 -26
  255. package/src/navigator/navigator-screen/index.ts +1 -1
  256. package/src/navigator/stories/index.tsx +210 -0
  257. package/src/navigator/test/index.tsx +509 -0
  258. package/src/navigator/types.ts +2 -0
  259. package/src/notice/test/__snapshots__/index.js.snap +39 -38
  260. package/src/notice/test/index.js +15 -36
  261. package/src/notice/test/list.js +6 -14
  262. package/src/number-control/test/index.js +3 -2
  263. package/src/panel/test/body.js +2 -2
  264. package/src/placeholder/style.scss +5 -0
  265. package/src/sandbox/index.js +62 -47
  266. package/src/sandbox/index.native.js +72 -52
  267. package/src/sandbox/test/index.js +7 -10
  268. package/src/shortcut/test/index.tsx +1 -1
  269. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +5 -3
  270. package/src/style.scss +4 -0
  271. package/src/tab-panel/index.tsx +4 -7
  272. package/src/text-highlight/test/index.tsx +1 -3
  273. package/src/theme/README.md +34 -0
  274. package/src/theme/index.tsx +51 -0
  275. package/src/theme/stories/index.tsx +47 -0
  276. package/src/theme/styles.ts +28 -0
  277. package/src/theme/test/index.tsx +101 -0
  278. package/src/theme/types.ts +21 -0
  279. package/src/toolbar/test/index.js +2 -2
  280. package/src/toolbar-group/test/index.js +6 -10
  281. package/src/tools-panel/test/index.js +4 -6
  282. package/src/tools-panel/tools-panel/hook.ts +2 -9
  283. package/src/tools-panel/tools-panel-item/hook.ts +17 -3
  284. package/src/tooltip/index.js +3 -0
  285. package/src/tooltip/index.native.js +15 -0
  286. package/src/tooltip/test/index.native.js +1 -2
  287. package/src/tree-grid/test/__snapshots__/cell.js.snap +1 -3
  288. package/src/tree-grid/test/__snapshots__/roving-tab-index-item.js.snap +17 -15
  289. package/src/tree-grid/test/__snapshots__/row.js.snap +25 -21
  290. package/src/tree-grid/test/cell.js +4 -4
  291. package/src/tree-grid/test/roving-tab-index-item.js +8 -8
  292. package/src/tree-grid/test/roving-tab-index.js +3 -3
  293. package/src/tree-grid/test/row.js +20 -16
  294. package/src/truncate/test/index.tsx +4 -4
  295. package/src/ui/shortcut/test/index.js +2 -1
  296. package/src/ui/spinner/test/index.js +14 -13
  297. package/src/ui/tooltip/test/index.js +16 -14
  298. package/src/utils/theme-variables.scss +8 -0
  299. package/src/visually-hidden/README.md +4 -0
  300. package/tsconfig.tsbuildinfo +1 -1
  301. package/src/navigator/stories/index.js +0 -194
  302. package/src/navigator/test/index.js +0 -472
@@ -0,0 +1,134 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { AriaRole, CSSProperties, ReactNode, KeyboardEventHandler, KeyboardEvent, SyntheticEvent } from 'react';
5
+ /**
6
+ * WordPress dependencies
7
+ */
8
+ import type { useFocusOnMount } from '@wordpress/compose';
9
+ export declare type ModalProps = {
10
+ aria?: {
11
+ /**
12
+ * If this property is added, it will be added to the modal content
13
+ * `div` as `aria-describedby`.
14
+ */
15
+ describedby?: string;
16
+ /**
17
+ * If this property is added, it will be added to the modal content
18
+ * `div` as `aria-labelledby`. Use this when you are rendering the title
19
+ * yourself within the modal's content area instead of using the `title`
20
+ * prop. This ensures the title is usable by assistive technology.
21
+ *
22
+ * Titles are required for accessibility reasons, see `contentLabel` and
23
+ * `title` for other ways to provide a title.
24
+ */
25
+ labelledby?: string;
26
+ };
27
+ /**
28
+ * Class name added to the body element when the modal is open.
29
+ *
30
+ * @default 'modal-open'
31
+ */
32
+ bodyOpenClassName?: string;
33
+ /**
34
+ * The children elements.
35
+ */
36
+ children: ReactNode;
37
+ /**
38
+ * If this property is added, it will an additional class name to the modal
39
+ * content `div`.
40
+ */
41
+ className?: string;
42
+ /**
43
+ * Label on the close button.
44
+ */
45
+ closeButtonLabel?: string;
46
+ /**
47
+ * If this property is added, it will be added to the modal content `div` as
48
+ * `aria-label`.
49
+ *
50
+ * Titles are required for accessibility reasons, see `aria.labelledby` and
51
+ * `title` for other ways to provide a title.
52
+ */
53
+ contentLabel?: string;
54
+ /**
55
+ * If this property is true, it will focus the first tabbable element
56
+ * rendered in the modal.
57
+ *
58
+ * @default true
59
+ */
60
+ focusOnMount?: Parameters<typeof useFocusOnMount>[0];
61
+ /**
62
+ * If this property is added, an icon will be added before the title.
63
+ */
64
+ icon?: JSX.Element;
65
+ /**
66
+ * If this property is set to false, the modal will not display a close icon
67
+ * and cannot be dismissed.
68
+ *
69
+ * @default true
70
+ */
71
+ isDismissible?: boolean;
72
+ /**
73
+ * This property when set to `true` will render a full screen modal.
74
+ *
75
+ * @default false
76
+ */
77
+ isFullScreen?: boolean;
78
+ /**
79
+ * Handle the key down on the modal frame `div`.
80
+ */
81
+ onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
82
+ /**
83
+ * This function is called to indicate that the modal should be closed.
84
+ */
85
+ onRequestClose: (event?: KeyboardEvent<HTMLDivElement> | SyntheticEvent) => void;
86
+ /**
87
+ * If this property is added, it will an additional class name to the modal
88
+ * overlay `div`.
89
+ */
90
+ overlayClassName?: string;
91
+ /**
92
+ * If this property is added, it will override the default role of the
93
+ * modal.
94
+ *
95
+ * @default 'dialog'
96
+ */
97
+ role?: AriaRole;
98
+ /**
99
+ * If this property is added, it will determine whether the modal requests
100
+ * to close when a mouse click occurs outside of the modal content.
101
+ *
102
+ * @default true
103
+ */
104
+ shouldCloseOnClickOutside?: boolean;
105
+ /**
106
+ * If this property is added, it will determine whether the modal requests
107
+ * to close when the escape key is pressed.
108
+ *
109
+ * @default true
110
+ */
111
+ shouldCloseOnEsc?: boolean;
112
+ /**
113
+ * If this property is added, it will be added to the modal frame `div`.
114
+ */
115
+ style?: CSSProperties;
116
+ /**
117
+ * This property is used as the modal header's title.
118
+ *
119
+ * Titles are required for accessibility reasons, see `aria.labelledby` and
120
+ * `contentLabel` for other ways to provide a title.
121
+ */
122
+ title?: string;
123
+ /**
124
+ * When set to `true`, the Modal's header (including the icon, title and
125
+ * close button) will not be rendered.
126
+ *
127
+ * _Warning_: This property is still experimental. “Experimental” means this
128
+ * is an early implementation subject to drastic and breaking changes.
129
+ *
130
+ * @default false
131
+ */
132
+ __experimentalHideHeader?: boolean;
133
+ };
134
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modal/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,QAAQ,EACR,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,MAAM,OAAO,CAAC;AAEf;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,oBAAY,UAAU,GAAG;IACxB,IAAI,CAAC,EAAE;QACN;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB;;;;;;;;WAQG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,UAAU,CAAE,OAAO,eAAe,CAAE,CAAE,CAAC,CAAE,CAAC;IACzD;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAE,cAAc,CAAE,CAAC;IACnD;;OAEG;IACH,cAAc,EAAE,CACf,KAAK,CAAC,EAAE,aAAa,CAAE,cAAc,CAAE,GAAG,cAAc,KACpD,IAAI,CAAC;IACV;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC"}
@@ -1,6 +1,6 @@
1
- export { default as NavigatorProvider } from './navigator-provider';
2
- export { default as NavigatorScreen } from './navigator-screen';
3
- export { default as NavigatorButton } from './navigator-button';
4
- export { default as NavigatorBackButton } from './navigator-back-button';
1
+ export { NavigatorProvider } from './navigator-provider';
2
+ export { NavigatorScreen } from './navigator-screen';
3
+ export { NavigatorButton } from './navigator-button';
4
+ export { NavigatorBackButton } from './navigator-back-button';
5
5
  export { default as useNavigator } from './use-navigator';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -33,8 +33,10 @@
33
33
  * );
34
34
  * ```
35
35
  */
36
- declare const ConnectedNavigatorBackButton: import("../../ui/context").WordPressComponent<"button", Omit<{}, "href"> & {
36
+ export declare const NavigatorBackButton: import("../../ui/context").WordPressComponent<"button", Omit<{
37
+ variant?: "link" | "secondary" | "tertiary" | "primary" | undefined;
38
+ }, "href"> & {
37
39
  children: import("react").ReactNode;
38
40
  } & import("react").RefAttributes<any>, true>;
39
- export default ConnectedNavigatorBackButton;
41
+ export default NavigatorBackButton;
40
42
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/component.tsx"],"names":[],"mappings":";AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,4BAA4B;;6CAGjC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/component.tsx"],"names":[],"mappings":";AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,mBAAmB;;;;6CAG/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -5,6 +5,7 @@
5
5
  import { WordPressComponentProps } from '../../ui/context';
6
6
  import type { NavigatorBackButtonProps } from '../types';
7
7
  export declare function useNavigatorBackButton(props: WordPressComponentProps<NavigatorBackButtonProps, 'button'>): {
8
+ variant?: "link" | "secondary" | "tertiary" | "primary" | undefined;
8
9
  children: import("react").ReactNode;
9
10
  type?: "button" | "reset" | "submit" | undefined;
10
11
  value?: string | number | readonly string[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/hook.ts"],"names":[],"mappings":";AAKA;;GAEG;AACH,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,uBAAuB,CAAE,wBAAwB,EAAE,QAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBpE"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/hook.ts"],"names":[],"mappings":";AAKA;;GAEG;AACH,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,uBAAuB,CAAE,wBAAwB,EAAE,QAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBpE"}
@@ -1,2 +1,2 @@
1
- export { default } from './component';
1
+ export { default as NavigatorBackButton } from './component';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-back-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
@@ -32,11 +32,13 @@
32
32
  * );
33
33
  * ```
34
34
  */
35
- declare const ConnectedNavigatorButton: import("../../ui/context").WordPressComponent<"button", Omit<{}, "href"> & {
35
+ export declare const NavigatorButton: import("../../ui/context").WordPressComponent<"button", Omit<{
36
+ variant?: "link" | "secondary" | "tertiary" | "primary" | undefined;
37
+ }, "href"> & {
36
38
  children: import("react").ReactNode;
37
39
  } & {
38
40
  path: string;
39
41
  attributeName?: string | undefined;
40
42
  } & import("react").RefAttributes<any>, true>;
41
- export default ConnectedNavigatorButton;
43
+ export default NavigatorButton;
42
44
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/component.tsx"],"names":[],"mappings":";AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,QAAA,MAAM,wBAAwB;;;;;6CAG7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/component.tsx"],"names":[],"mappings":";AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,eAAe;;;;;;;6CAG3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -5,6 +5,7 @@
5
5
  import { WordPressComponentProps } from '../../ui/context';
6
6
  import type { NavigatorButtonProps } from '../types';
7
7
  export declare function useNavigatorButton(props: WordPressComponentProps<NavigatorButtonProps, 'button'>): {
8
+ variant?: "link" | "secondary" | "tertiary" | "primary" | undefined;
8
9
  children: import("react").ReactNode;
9
10
  type?: "button" | "reset" | "submit" | undefined;
10
11
  value?: string | number | readonly string[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/hook.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKrD,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,uBAAuB,CAAE,oBAAoB,EAAE,QAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkChE"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/hook.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKrD,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,uBAAuB,CAAE,oBAAoB,EAAE,QAAQ,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkChE"}
@@ -1,2 +1,2 @@
1
- export { default } from './component';
1
+ export { default as NavigatorButton } from './component';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -34,6 +34,6 @@ import type { NavigatorProviderProps } from '../types';
34
34
  * );
35
35
  * ```
36
36
  */
37
- declare const ConnectedNavigatorProvider: import("../../ui/context").WordPressComponent<"div", NavigatorProviderProps & import("react").RefAttributes<any>, true>;
38
- export default ConnectedNavigatorProvider;
37
+ export declare const NavigatorProvider: import("../../ui/context").WordPressComponent<"div", NavigatorProviderProps & import("react").RefAttributes<any>, true>;
38
+ export default NavigatorProvider;
39
39
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/component.tsx"],"names":[],"mappings":";AAsBA,OAAO,KAAK,EACX,sBAAsB,EAGtB,MAAM,UAAU,CAAC;AAuElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,0BAA0B,yHAG/B,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/component.tsx"],"names":[],"mappings":";AAsBA,OAAO,KAAK,EACX,sBAAsB,EAGtB,MAAM,UAAU,CAAC;AAyElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,iBAAiB,yHAG7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { default } from './component';
1
+ export { default as NavigatorProvider } from './component';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -40,6 +40,6 @@ declare type Props = Omit<WordPressComponentProps<NavigatorScreenProps, 'div', f
40
40
  * );
41
41
  * ```
42
42
  */
43
- declare const ConnectedNavigatorScreen: import("../../ui/context").WordPressComponent<import("react").ElementType<any>, Props & import("react").RefAttributes<any>, boolean>;
44
- export default ConnectedNavigatorScreen;
43
+ export declare const NavigatorScreen: import("../../ui/context").WordPressComponent<import("react").ElementType<any>, Props & import("react").RefAttributes<any>, boolean>;
44
+ export default NavigatorScreen;
45
45
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/component.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAgBpD;;GAEG;AACH,OAAO,EAGN,uBAAuB,EACvB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AASrD,aAAK,KAAK,GAAG,IAAI,CAChB,uBAAuB,CAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,CAAE,EAC7D,MAAM,WAAW,CACjB,CAAC;AA6IF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,wBAAwB,sIAG7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/component.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAepD;;GAEG;AACH,OAAO,EAGN,uBAAuB,EACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AASrD,aAAK,KAAK,GAAG,IAAI,CAChB,uBAAuB,CAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,CAAE,EAC7D,MAAM,WAAW,CACjB,CAAC;AAyIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,eAAe,sIAG3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,2 +1,2 @@
1
- export { default } from './component';
1
+ export { default as NavigatorScreen } from './component';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
+ import { NavigatorProvider } from '..';
6
+ declare const meta: ComponentMeta<typeof NavigatorProvider>;
7
+ export default meta;
8
+ export declare const Default: ComponentStory<typeof NavigatorProvider>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAStE,OAAO,EACN,iBAAiB,EAIjB,MAAM,IAAI,CAAC;AAEZ,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,iBAAiB,CAalD,CAAC;AACF,eAAe,IAAI,CAAC;AA0IpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,iBAAiB,CAC1C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/navigator/test/index.tsx"],"names":[],"mappings":""}
@@ -9,6 +9,7 @@ export declare type NavigatorLocation = NavigateOptions & {
9
9
  isInitial?: boolean;
10
10
  isBack?: boolean;
11
11
  path?: string;
12
+ hasRestoredFocus?: boolean;
12
13
  };
13
14
  export declare type NavigatorContext = {
14
15
  location: NavigatorLocation;
@@ -36,7 +37,9 @@ export declare type NavigatorScreenProps = {
36
37
  */
37
38
  children: ReactNode;
38
39
  };
39
- declare type ButtonProps = {};
40
+ declare type ButtonProps = {
41
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'link';
42
+ };
40
43
  export declare type NavigatorBackButtonProps = Omit<ButtonProps, 'href'> & {
41
44
  /**
42
45
  * The children elements.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,aAAK,eAAe,GAAG;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,eAAe,GAAG;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAM,IAAI,CAAC;IAC1D,MAAM,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAGF,oBAAY,SAAS,GAAG,gBAAgB,CAAC;AAEzC,oBAAY,sBAAsB,GAAG;IACpC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,aAAK,WAAW,GAAG,EAGlB,CAAC;AACF,oBAAY,wBAAwB,GAAG,IAAI,CAAE,WAAW,EAAE,MAAM,CAAE,GAAG;IACpE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,wBAAwB,GAAG;IAC7D;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,aAAK,eAAe,GAAG;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,eAAe,GAAG;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAM,IAAI,CAAC;IAC1D,MAAM,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAGF,oBAAY,SAAS,GAAG,gBAAgB,CAAC;AAEzC,oBAAY,sBAAsB,GAAG;IACpC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,aAAK,WAAW,GAAG;IAGlB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;CACxD,CAAC;AACF,oBAAY,wBAAwB,GAAG,IAAI,CAAE,WAAW,EAAE,MAAM,CAAE,GAAG;IACpE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,wBAAwB,GAAG;IAC7D;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slot-fill-provider.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/slot-fill-provider.js"],"names":[],"mappings":"AAmGA;;gBAOC"}
1
+ {"version":3,"file":"slot-fill-provider.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/slot-fill-provider.js"],"names":[],"mappings":"AAqGA;;gBAOC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAiBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAqB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAE,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,WAA0B,EAC1B,WAAyB,EACzB,QAAQ,GACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eAiExD;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAiBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAqB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAE,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,WAA0B,EAC1B,WAAyB,EACzB,QAAQ,GACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eA8DxD;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Internal dependencies
4
+ */
5
+ import type { ThemeProps } from './types';
6
+ import type { WordPressComponentProps } from '../ui/context';
7
+ /**
8
+ * `Theme` allows defining theme variables for components in the `@wordpress/components` package.
9
+ *
10
+ * Multiple `Theme` components can be nested in order to override specific theme variables.
11
+ *
12
+ *
13
+ * @example
14
+ * ```jsx
15
+ * import { __experimentalTheme as Theme } from '@wordpress/components';
16
+ *
17
+ * const Example = () => {
18
+ * return (
19
+ * <Theme accent="red">
20
+ * <Button variant="primary">I'm red</Button>
21
+ * <Theme accent="blue">
22
+ * <Button variant="primary">I'm blue</Button>
23
+ * </Theme>
24
+ * </Theme>
25
+ * );
26
+ * };
27
+ * ```
28
+ */
29
+ declare function Theme(props: WordPressComponentProps<ThemeProps, 'div', true>): JSX.Element;
30
+ export default Theme;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.tsx"],"names":[],"mappings":";AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAK7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,KAAK,CAAE,KAAK,EAAE,uBAAuB,CAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAE,eAUxE;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import Theme from '../index';
9
+ declare const meta: ComponentMeta<typeof Theme>;
10
+ export default meta;
11
+ export declare const Default: ComponentStory<typeof Theme>;
12
+ export declare const Nested: ComponentStory<typeof Theme>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,KAAK,MAAM,UAAU,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,KAAK,CAUtC,CAAC;AACF,eAAe,IAAI,CAAC;AAQpB,eAAO,MAAM,OAAO,8BAAsB,CAAC;AAG3C,eAAO,MAAM,MAAM,EAAE,cAAc,CAAE,OAAO,KAAK,CAUhD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Internal dependencies
4
+ */
5
+ import type { ThemeProps } from './types';
6
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ } & ThemeProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/theme/styles.ts"],"names":[],"mappings":";AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAe1C,eAAO,MAAM,OAAO;;;sHAEnB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/test/index.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ReactNode } from 'react';
5
+ export declare type ThemeProps = {
6
+ /**
7
+ * Used to set the accent color (used by components as the primary color).
8
+ *
9
+ * If an accent color is not defined, the default fallback value is the original
10
+ * WP Admin main theme color. No all valid CSS color syntaxes are supported —
11
+ * in particular, keywords (like `'currentcolor'`, `'inherit'`, `'initial'`,
12
+ * `'revert'`, `'unset'`...) and CSS custom properties (e.g.
13
+ * `var(--my-custom-property)`) are _not_ supported values for this property.
14
+ */
15
+ accent?: string;
16
+ /**
17
+ * The children elements.
18
+ */
19
+ children?: ReactNode;
20
+ };
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,UAAU,GAAG;IACxB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel/hook.ts"],"names":[],"mappings":";AAeA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EAEnB,eAAe,EACf,MAAM,UAAU,CAAC;AA+BlB,wBAAgB,aAAa,CAC5B,KAAK,EAAE,uBAAuB,CAAE,eAAe,EAAE,KAAK,CAAE;;;qCAmD9C,MAAM;;uCA0CN,MAAM,UAAS,qBAAqB;;;;;;kCA/DrC,cAAc;;;;;;wBA4Hb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgHhB"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel/hook.ts"],"names":[],"mappings":";AAeA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EAEnB,eAAe,EACf,MAAM,UAAU,CAAC;AA+BlB,wBAAgB,aAAa,CAC5B,KAAK,EAAE,uBAAuB,CAAE,eAAe,EAAE,KAAK,CAAE;;;qCAmD9C,MAAM;;uCA0CN,MAAM,UAAS,qBAAqB;;;;;;kCA/DrC,cAAc;;;;;;wBA4Hb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyGhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-item/hook.ts"],"names":[],"mappings":";AAWA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,uBAAuB,CAAE,mBAAmB,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmJ5D"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-item/hook.ts"],"names":[],"mappings":";AAWA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,uBAAuB,CAAE,mBAAmB,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiK5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,4BAFU,MAAM,CAEiB;;AAmFjC,0CAyKC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,4BAFU,MAAM,CAEiB;;AAmFjC,0CA4KC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "21.2.0",
3
+ "version": "21.3.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,21 +38,21 @@
38
38
  "@emotion/utils": "^1.0.0",
39
39
  "@floating-ui/react-dom": "^1.0.0",
40
40
  "@use-gesture/react": "^10.2.6",
41
- "@wordpress/a11y": "^3.19.0",
42
- "@wordpress/compose": "^5.17.0",
43
- "@wordpress/date": "^4.19.0",
44
- "@wordpress/deprecated": "^3.19.0",
45
- "@wordpress/dom": "^3.19.0",
46
- "@wordpress/element": "^4.17.0",
47
- "@wordpress/escape-html": "^2.19.0",
48
- "@wordpress/hooks": "^3.19.0",
49
- "@wordpress/i18n": "^4.19.0",
50
- "@wordpress/icons": "^9.10.0",
51
- "@wordpress/is-shallow-equal": "^4.19.0",
52
- "@wordpress/keycodes": "^3.19.0",
53
- "@wordpress/primitives": "^3.17.0",
54
- "@wordpress/rich-text": "^5.17.0",
55
- "@wordpress/warning": "^2.19.0",
41
+ "@wordpress/a11y": "^3.20.0",
42
+ "@wordpress/compose": "^5.18.0",
43
+ "@wordpress/date": "^4.20.0",
44
+ "@wordpress/deprecated": "^3.20.0",
45
+ "@wordpress/dom": "^3.20.0",
46
+ "@wordpress/element": "^4.18.0",
47
+ "@wordpress/escape-html": "^2.20.0",
48
+ "@wordpress/hooks": "^3.20.0",
49
+ "@wordpress/i18n": "^4.20.0",
50
+ "@wordpress/icons": "^9.11.0",
51
+ "@wordpress/is-shallow-equal": "^4.20.0",
52
+ "@wordpress/keycodes": "^3.20.0",
53
+ "@wordpress/primitives": "^3.18.0",
54
+ "@wordpress/rich-text": "^5.18.0",
55
+ "@wordpress/warning": "^2.20.0",
56
56
  "change-case": "^4.1.2",
57
57
  "classnames": "^2.3.1",
58
58
  "colord": "^2.7.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "8d42d2febb7d0ba8372a33e560a62f5a5f6a9112"
82
+ "gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
83
83
  }
@@ -14,18 +14,14 @@ const TestField = ( props ) => {
14
14
  };
15
15
 
16
16
  describe( 'base field', () => {
17
- let base;
18
-
19
- beforeEach( () => {
20
- base = render( <TestField /> ).container;
21
- } );
22
-
23
17
  it( 'should render correctly', () => {
18
+ const base = render( <TestField /> ).container;
24
19
  expect( base.firstChild ).toMatchSnapshot();
25
20
  } );
26
21
 
27
22
  describe( 'props', () => {
28
23
  it( 'should render error styles', () => {
24
+ const base = render( <TestField /> ).container;
29
25
  const { container } = render( <TestField hasError /> );
30
26
  expect( container.firstChild ).toMatchStyleDiffSnapshot(
31
27
  base.firstChild
@@ -33,6 +29,7 @@ describe( 'base field', () => {
33
29
  } );
34
30
 
35
31
  it( 'should render inline styles', () => {
32
+ const base = render( <TestField /> ).container;
36
33
  const { container } = render( <TestField isInline /> );
37
34
  expect( container.firstChild ).toMatchStyleDiffSnapshot(
38
35
  base.firstChild
@@ -40,6 +37,7 @@ describe( 'base field', () => {
40
37
  } );
41
38
 
42
39
  it( 'should render subtle styles', () => {
40
+ const base = render( <TestField /> ).container;
43
41
  const { container } = render( <TestField isSubtle /> );
44
42
  expect( container.firstChild ).toMatchStyleDiffSnapshot(
45
43
  base.firstChild
@@ -46,6 +46,7 @@ const BorderBoxControl = (
46
46
  className,
47
47
  colors,
48
48
  disableCustomColors,
49
+ disableUnits,
49
50
  enableAlpha,
50
51
  enableStyle,
51
52
  hasMixedBorders,
@@ -100,6 +101,7 @@ const BorderBoxControl = (
100
101
  <BorderControl
101
102
  className={ linkedControlClassName }
102
103
  colors={ colors }
104
+ disableUnits={ disableUnits }
103
105
  disableCustomColors={ disableCustomColors }
104
106
  enableAlpha={ enableAlpha }
105
107
  enableStyle={ enableStyle }
@@ -41,6 +41,9 @@ export function useBorderBoxControl(
41
41
  ? ( value as Borders )
42
42
  : getSplitBorders( value as Border | undefined );
43
43
 
44
+ // If no numeric width value is set, the unit select will be disabled.
45
+ const hasWidthValue = ! isNaN( parseFloat( `${ linkedValue?.width }` ) );
46
+
44
47
  const [ isLinked, setIsLinked ] = useState( ! mixedBorders );
45
48
  const toggleLinked = () => setIsLinked( ! isLinked );
46
49
 
@@ -107,6 +110,7 @@ export function useBorderBoxControl(
107
110
  return {
108
111
  ...otherProps,
109
112
  className: classes,
113
+ disableUnits: mixedBorders && ! hasWidthValue,
110
114
  hasMixedBorders: mixedBorders,
111
115
  isLinked,
112
116
  linkedControlClassName,