@wordpress/components 28.7.0 → 28.8.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 (240) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/build/box-control/all-input-control.js +1 -2
  3. package/build/box-control/all-input-control.js.map +1 -1
  4. package/build/box-control/utils.js +1 -1
  5. package/build/box-control/utils.js.map +1 -1
  6. package/build/card/card/component.js +2 -2
  7. package/build/card/card/component.js.map +1 -1
  8. package/build/card/styles.js +18 -18
  9. package/build/card/styles.js.map +1 -1
  10. package/build/combobox-control/index.js +3 -1
  11. package/build/combobox-control/index.js.map +1 -1
  12. package/build/combobox-control/types.js.map +1 -1
  13. package/build/composite/context.js +1 -1
  14. package/build/composite/context.js.map +1 -1
  15. package/build/composite/group-label.js +1 -1
  16. package/build/composite/group-label.js.map +1 -1
  17. package/build/composite/group.js +1 -1
  18. package/build/composite/group.js.map +1 -1
  19. package/build/composite/hover.js +1 -1
  20. package/build/composite/hover.js.map +1 -1
  21. package/build/composite/index.js +17 -26
  22. package/build/composite/index.js.map +1 -1
  23. package/build/composite/item.js +1 -1
  24. package/build/composite/item.js.map +1 -1
  25. package/build/composite/legacy/index.js +59 -8
  26. package/build/composite/legacy/index.js.map +1 -1
  27. package/build/composite/row.js +1 -1
  28. package/build/composite/row.js.map +1 -1
  29. package/build/composite/typeahead.js +1 -1
  30. package/build/composite/typeahead.js.map +1 -1
  31. package/build/composite/types.js.map +1 -1
  32. package/build/custom-select-control-v2/styles.js +9 -9
  33. package/build/custom-select-control-v2/styles.js.map +1 -1
  34. package/build/date-time/date/index.js +1 -1
  35. package/build/date-time/date/index.js.map +1 -1
  36. package/build/date-time/date/styles.js +35 -24
  37. package/build/date-time/date/styles.js.map +1 -1
  38. package/build/date-time/date/use-lilius/index.js +163 -0
  39. package/build/date-time/date/use-lilius/index.js.map +1 -0
  40. package/build/dropdown-menu-v2/styles.js +17 -17
  41. package/build/dropdown-menu-v2/styles.js.map +1 -1
  42. package/build/index.js +7 -0
  43. package/build/index.js.map +1 -1
  44. package/build/modal/index.js +27 -12
  45. package/build/modal/index.js.map +1 -1
  46. package/build/modal/types.js.map +1 -1
  47. package/build/modal/use-modal-exit-animation.js +75 -0
  48. package/build/modal/use-modal-exit-animation.js.map +1 -0
  49. package/build/navigator/navigator-screen/component.js +5 -0
  50. package/build/navigator/navigator-screen/component.js.map +1 -1
  51. package/build/private-apis.js +0 -9
  52. package/build/private-apis.js.map +1 -1
  53. package/build/range-control/styles/range-control-styles.js +28 -28
  54. package/build/range-control/styles/range-control-styles.js.map +1 -1
  55. package/build/slot-fill/index.js +1 -0
  56. package/build/slot-fill/index.js.map +1 -1
  57. package/build/tabs/styles.js +3 -3
  58. package/build/tabs/styles.js.map +1 -1
  59. package/build/tabs/tablist.js +5 -4
  60. package/build/tabs/tablist.js.map +1 -1
  61. package/build/utils/config-values.js +4 -5
  62. package/build/utils/config-values.js.map +1 -1
  63. package/build/utils/element-rect.js +73 -105
  64. package/build/utils/element-rect.js.map +1 -1
  65. package/build-module/box-control/all-input-control.js +2 -2
  66. package/build-module/box-control/all-input-control.js.map +1 -1
  67. package/build-module/box-control/utils.js +1 -1
  68. package/build-module/box-control/utils.js.map +1 -1
  69. package/build-module/card/card/component.js +2 -2
  70. package/build-module/card/card/component.js.map +1 -1
  71. package/build-module/card/styles.js +18 -18
  72. package/build-module/card/styles.js.map +1 -1
  73. package/build-module/combobox-control/index.js +3 -1
  74. package/build-module/combobox-control/index.js.map +1 -1
  75. package/build-module/combobox-control/types.js.map +1 -1
  76. package/build-module/composite/context.js +1 -1
  77. package/build-module/composite/context.js.map +1 -1
  78. package/build-module/composite/group-label.js +1 -1
  79. package/build-module/composite/group-label.js.map +1 -1
  80. package/build-module/composite/group.js +1 -1
  81. package/build-module/composite/group.js.map +1 -1
  82. package/build-module/composite/hover.js +1 -1
  83. package/build-module/composite/hover.js.map +1 -1
  84. package/build-module/composite/index.js +17 -26
  85. package/build-module/composite/index.js.map +1 -1
  86. package/build-module/composite/item.js +1 -1
  87. package/build-module/composite/item.js.map +1 -1
  88. package/build-module/composite/legacy/index.js +56 -8
  89. package/build-module/composite/legacy/index.js.map +1 -1
  90. package/build-module/composite/row.js +1 -1
  91. package/build-module/composite/row.js.map +1 -1
  92. package/build-module/composite/typeahead.js +1 -1
  93. package/build-module/composite/typeahead.js.map +1 -1
  94. package/build-module/composite/types.js.map +1 -1
  95. package/build-module/custom-select-control-v2/styles.js +9 -9
  96. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  97. package/build-module/date-time/date/index.js +1 -2
  98. package/build-module/date-time/date/index.js.map +1 -1
  99. package/build-module/date-time/date/styles.js +31 -24
  100. package/build-module/date-time/date/styles.js.map +1 -1
  101. package/build-module/date-time/date/use-lilius/index.js +158 -0
  102. package/build-module/date-time/date/use-lilius/index.js.map +1 -0
  103. package/build-module/dropdown-menu-v2/styles.js +17 -17
  104. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  105. package/build-module/index.js +1 -0
  106. package/build-module/index.js.map +1 -1
  107. package/build-module/modal/index.js +29 -12
  108. package/build-module/modal/index.js.map +1 -1
  109. package/build-module/modal/types.js.map +1 -1
  110. package/build-module/modal/use-modal-exit-animation.js +68 -0
  111. package/build-module/modal/use-modal-exit-animation.js.map +1 -0
  112. package/build-module/navigator/navigator-screen/component.js +4 -0
  113. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  114. package/build-module/private-apis.js +0 -9
  115. package/build-module/private-apis.js.map +1 -1
  116. package/build-module/range-control/styles/range-control-styles.js +28 -28
  117. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  118. package/build-module/slot-fill/index.js +1 -0
  119. package/build-module/slot-fill/index.js.map +1 -1
  120. package/build-module/tabs/styles.js +3 -3
  121. package/build-module/tabs/styles.js.map +1 -1
  122. package/build-module/tabs/tablist.js +5 -4
  123. package/build-module/tabs/tablist.js.map +1 -1
  124. package/build-module/utils/config-values.js +4 -5
  125. package/build-module/utils/config-values.js.map +1 -1
  126. package/build-module/utils/element-rect.js +74 -105
  127. package/build-module/utils/element-rect.js.map +1 -1
  128. package/build-style/style-rtl.css +51 -10
  129. package/build-style/style.css +51 -10
  130. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  131. package/build-types/box-control/utils.d.ts +1 -1
  132. package/build-types/box-control/utils.d.ts.map +1 -1
  133. package/build-types/button-group/stories/index.story.d.ts +2 -2
  134. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  135. package/build-types/combobox-control/index.d.ts.map +1 -1
  136. package/build-types/combobox-control/stories/index.story.d.ts +4 -0
  137. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  138. package/build-types/combobox-control/types.d.ts +4 -0
  139. package/build-types/combobox-control/types.d.ts.map +1 -1
  140. package/build-types/composite/context.d.ts.map +1 -1
  141. package/build-types/composite/index.d.ts +36 -24
  142. package/build-types/composite/index.d.ts.map +1 -1
  143. package/build-types/composite/legacy/index.d.ts +25 -2
  144. package/build-types/composite/legacy/index.d.ts.map +1 -1
  145. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  146. package/build-types/composite/stories/index.story.d.ts +9 -9
  147. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  148. package/build-types/composite/types.d.ts +11 -10
  149. package/build-types/composite/types.d.ts.map +1 -1
  150. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  151. package/build-types/date-time/date/index.d.ts +0 -3
  152. package/build-types/date-time/date/index.d.ts.map +1 -1
  153. package/build-types/date-time/date/styles.d.ts.map +1 -1
  154. package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
  155. package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
  156. package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
  157. package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
  158. package/build-types/index.d.ts +1 -0
  159. package/build-types/index.d.ts.map +1 -1
  160. package/build-types/modal/index.d.ts.map +1 -1
  161. package/build-types/modal/stories/index.story.d.ts +3 -0
  162. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  163. package/build-types/modal/types.d.ts +6 -10
  164. package/build-types/modal/types.d.ts.map +1 -1
  165. package/build-types/modal/use-modal-exit-animation.d.ts +9 -0
  166. package/build-types/modal/use-modal-exit-animation.d.ts.map +1 -0
  167. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  168. package/build-types/private-apis.d.ts.map +1 -1
  169. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  170. package/build-types/slot-fill/index.d.ts +3 -0
  171. package/build-types/slot-fill/index.d.ts.map +1 -1
  172. package/build-types/tabs/styles.d.ts.map +1 -1
  173. package/build-types/tabs/tablist.d.ts.map +1 -1
  174. package/build-types/utils/config-values.d.ts +0 -1
  175. package/build-types/utils/element-rect.d.ts +32 -74
  176. package/build-types/utils/element-rect.d.ts.map +1 -1
  177. package/package.json +19 -20
  178. package/src/box-control/README.md +7 -0
  179. package/src/box-control/all-input-control.tsx +2 -3
  180. package/src/box-control/utils.ts +1 -1
  181. package/src/button-group/stories/index.story.tsx +10 -15
  182. package/src/card/card/component.tsx +1 -1
  183. package/src/card/styles.ts +1 -1
  184. package/src/card/test/__snapshots__/index.tsx.snap +54 -54
  185. package/src/combobox-control/README.md +7 -0
  186. package/src/combobox-control/index.tsx +2 -0
  187. package/src/combobox-control/test/index.tsx +40 -0
  188. package/src/combobox-control/types.ts +4 -0
  189. package/src/composite/README.md +5 -24
  190. package/src/composite/{context.ts → context.tsx} +1 -2
  191. package/src/composite/group-label.tsx +1 -1
  192. package/src/composite/group.tsx +1 -1
  193. package/src/composite/hover.tsx +1 -1
  194. package/src/composite/index.tsx +17 -28
  195. package/src/composite/item.tsx +1 -1
  196. package/src/composite/legacy/index.tsx +72 -11
  197. package/src/composite/legacy/stories/index.story.tsx +2 -1
  198. package/src/composite/legacy/test/index.tsx +57 -1
  199. package/src/composite/row.tsx +1 -1
  200. package/src/composite/stories/index.story.tsx +185 -169
  201. package/src/composite/typeahead.tsx +1 -1
  202. package/src/composite/types.ts +13 -15
  203. package/src/custom-select-control-v2/styles.ts +1 -0
  204. package/src/date-time/date/index.tsx +1 -1
  205. package/src/date-time/date/styles.ts +31 -11
  206. package/src/date-time/date/test/use-lilius.ts +417 -0
  207. package/src/date-time/date/use-lilius/index.ts +394 -0
  208. package/src/dropdown-menu-v2/styles.ts +1 -1
  209. package/src/form-toggle/style.scss +1 -0
  210. package/src/index.ts +1 -0
  211. package/src/modal/index.tsx +42 -19
  212. package/src/modal/stories/index.story.tsx +8 -14
  213. package/src/modal/style.scss +30 -8
  214. package/src/modal/types.ts +6 -18
  215. package/src/modal/use-modal-exit-animation.ts +99 -0
  216. package/src/navigator/navigator-screen/component.tsx +7 -0
  217. package/src/navigator/test/index.tsx +8 -0
  218. package/src/popover/style.scss +3 -2
  219. package/src/private-apis.ts +0 -9
  220. package/src/range-control/styles/range-control-styles.ts +1 -0
  221. package/src/resizable-box/style.scss +1 -1
  222. package/src/select-control/README.md +2 -2
  223. package/src/slot-fill/index.tsx +1 -0
  224. package/src/snackbar/style.scss +1 -1
  225. package/src/tabs/styles.ts +40 -11
  226. package/src/tabs/tablist.tsx +5 -4
  227. package/src/tooltip/style.scss +1 -0
  228. package/src/utils/config-values.js +4 -5
  229. package/src/utils/element-rect.ts +93 -130
  230. package/tsconfig.tsbuildinfo +1 -1
  231. package/build/composite/store.js +0 -54
  232. package/build/composite/store.js.map +0 -1
  233. package/build-module/composite/store.js +0 -46
  234. package/build-module/composite/store.js.map +0 -1
  235. package/build-types/composite/store.d.ts +0 -25
  236. package/build-types/composite/store.d.ts.map +0 -1
  237. package/build-types/composite/stories/utils.d.ts +0 -29
  238. package/build-types/composite/stories/utils.d.ts.map +0 -1
  239. package/src/composite/store.ts +0 -46
  240. package/src/composite/stories/utils.tsx +0 -76
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useCompositeStore = useCompositeStore;
7
- var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
- /**
11
- * External dependencies
12
- */
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
-
18
- // Props are already documented in TypeScript types.
19
- // eslint-disable-next-line jsdoc/require-param
20
- /**
21
- * Creates a composite store.
22
- *
23
- * @example
24
- * ```jsx
25
- * import { Composite, useCompositeStore } from '@wordpress/components';
26
- *
27
- * const store = useCompositeStore();
28
- * <Composite store={store}>
29
- * <Composite.Item>Item</Composite.Item>
30
- * <Composite.Item>Item</Composite.Item>
31
- * <Composite.Item>Item</Composite.Item>
32
- * </Composite>
33
- * ```
34
- */
35
- function useCompositeStore({
36
- focusLoop = false,
37
- focusWrap = false,
38
- focusShift = false,
39
- virtualFocus = false,
40
- orientation = 'both',
41
- rtl = false,
42
- ...props
43
- } = {}) {
44
- return Ariakit.useCompositeStore({
45
- focusLoop,
46
- focusWrap,
47
- focusShift,
48
- virtualFocus,
49
- orientation,
50
- rtl,
51
- ...props
52
- });
53
- }
54
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useCompositeStore","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","props"],"sources":["@wordpress/components/src/composite/store.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport type { CompositeStoreProps } from './types';\n\n// Props are already documented in TypeScript types.\n// eslint-disable-next-line jsdoc/require-param\n/**\n * Creates a composite store.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * </Composite>\n * ```\n */\nexport function useCompositeStore( {\n\tfocusLoop = false,\n\tfocusWrap = false,\n\tfocusShift = false,\n\tvirtualFocus = false,\n\torientation = 'both',\n\trtl = false,\n\t...props\n}: CompositeStoreProps = {} ) {\n\treturn Ariakit.useCompositeStore( {\n\t\tfocusLoop,\n\t\tfocusWrap,\n\t\tfocusShift,\n\t\tvirtualFocus,\n\t\torientation,\n\t\trtl,\n\t\t...props,\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAH1C;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASW,iBAAiBA,CAAE;EAClCC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,MAAM;EACpBC,GAAG,GAAG,KAAK;EACX,GAAGC;AACiB,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7B,OAAO9B,OAAO,CAACuB,iBAAiB,CAAE;IACjCC,SAAS;IACTC,SAAS;IACTC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,GAAG;IACH,GAAGC;EACJ,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1,46 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import * as Ariakit from '@ariakit/react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
-
10
- // Props are already documented in TypeScript types.
11
- // eslint-disable-next-line jsdoc/require-param
12
- /**
13
- * Creates a composite store.
14
- *
15
- * @example
16
- * ```jsx
17
- * import { Composite, useCompositeStore } from '@wordpress/components';
18
- *
19
- * const store = useCompositeStore();
20
- * <Composite store={store}>
21
- * <Composite.Item>Item</Composite.Item>
22
- * <Composite.Item>Item</Composite.Item>
23
- * <Composite.Item>Item</Composite.Item>
24
- * </Composite>
25
- * ```
26
- */
27
- export function useCompositeStore({
28
- focusLoop = false,
29
- focusWrap = false,
30
- focusShift = false,
31
- virtualFocus = false,
32
- orientation = 'both',
33
- rtl = false,
34
- ...props
35
- } = {}) {
36
- return Ariakit.useCompositeStore({
37
- focusLoop,
38
- focusWrap,
39
- focusShift,
40
- virtualFocus,
41
- orientation,
42
- rtl,
43
- ...props
44
- });
45
- }
46
- //# sourceMappingURL=store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Ariakit","useCompositeStore","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","props"],"sources":["@wordpress/components/src/composite/store.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport type { CompositeStoreProps } from './types';\n\n// Props are already documented in TypeScript types.\n// eslint-disable-next-line jsdoc/require-param\n/**\n * Creates a composite store.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * </Composite>\n * ```\n */\nexport function useCompositeStore( {\n\tfocusLoop = false,\n\tfocusWrap = false,\n\tfocusShift = false,\n\tvirtualFocus = false,\n\torientation = 'both',\n\trtl = false,\n\t...props\n}: CompositeStoreProps = {} ) {\n\treturn Ariakit.useCompositeStore( {\n\t\tfocusLoop,\n\t\tfocusWrap,\n\t\tfocusShift,\n\t\tvirtualFocus,\n\t\torientation,\n\t\trtl,\n\t\t...props,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAE;EAClCC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,MAAM;EACpBC,GAAG,GAAG,KAAK;EACX,GAAGC;AACiB,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7B,OAAOR,OAAO,CAACC,iBAAiB,CAAE;IACjCC,SAAS;IACTC,SAAS;IACTC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,GAAG;IACH,GAAGC;EACJ,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1,25 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import * as Ariakit from '@ariakit/react';
5
- /**
6
- * Internal dependencies
7
- */
8
- import type { CompositeStoreProps } from './types';
9
- /**
10
- * Creates a composite store.
11
- *
12
- * @example
13
- * ```jsx
14
- * import { Composite, useCompositeStore } from '@wordpress/components';
15
- *
16
- * const store = useCompositeStore();
17
- * <Composite store={store}>
18
- * <Composite.Item>Item</Composite.Item>
19
- * <Composite.Item>Item</Composite.Item>
20
- * <Composite.Item>Item</Composite.Item>
21
- * </Composite>
22
- * ```
23
- */
24
- export declare function useCompositeStore({ focusLoop, focusWrap, focusShift, virtualFocus, orientation, rtl, ...props }?: CompositeStoreProps): Ariakit.CompositeStore<import("@ariakit/react-core/cjs/composite/composite-store").CompositeStoreItem>;
25
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/composite/store.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,YAAoB,EACpB,WAAoB,EACpB,GAAW,EACX,GAAG,KAAK,EACR,GAAE,mBAAwB,0GAU1B"}
@@ -1,29 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { StoryContext } from '@storybook/react';
5
- /**
6
- * Internal dependencies
7
- */
8
- import type { CompositeStoreProps } from '../types';
9
- /**
10
- * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)
11
- * role, which provides a single tab stop on the page and arrow key navigation
12
- * through the focusable descendants.
13
- *
14
- * ```jsx
15
- * import { Composite, useCompositeStore } from '@wordpress/components';
16
- *
17
- * const store = useCompositeStore();
18
- * <Composite store={ store }>
19
- * <Composite.Item>Item 1</Composite.Item>
20
- * <Composite.Item>Item 2</Composite.Item>
21
- * </Composite>
22
- * ```
23
- */
24
- export declare function UseCompositeStorePlaceholder(props: CompositeStoreProps): import("react").JSX.Element;
25
- export declare namespace UseCompositeStorePlaceholder {
26
- var displayName: string;
27
- }
28
- export declare function transform(code: string, context: StoryContext): string;
29
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/composite/stories/utils.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAE,KAAK,EAAE,mBAAmB,+BAWvE;yBAXe,4BAA4B;;;AAiB5C,wBAAgB,SAAS,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,UAiC7D"}
@@ -1,46 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import * as Ariakit from '@ariakit/react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import type { CompositeStoreProps } from './types';
10
-
11
- // Props are already documented in TypeScript types.
12
- // eslint-disable-next-line jsdoc/require-param
13
- /**
14
- * Creates a composite store.
15
- *
16
- * @example
17
- * ```jsx
18
- * import { Composite, useCompositeStore } from '@wordpress/components';
19
- *
20
- * const store = useCompositeStore();
21
- * <Composite store={store}>
22
- * <Composite.Item>Item</Composite.Item>
23
- * <Composite.Item>Item</Composite.Item>
24
- * <Composite.Item>Item</Composite.Item>
25
- * </Composite>
26
- * ```
27
- */
28
- export function useCompositeStore( {
29
- focusLoop = false,
30
- focusWrap = false,
31
- focusShift = false,
32
- virtualFocus = false,
33
- orientation = 'both',
34
- rtl = false,
35
- ...props
36
- }: CompositeStoreProps = {} ) {
37
- return Ariakit.useCompositeStore( {
38
- focusLoop,
39
- focusWrap,
40
- focusShift,
41
- virtualFocus,
42
- orientation,
43
- rtl,
44
- ...props,
45
- } );
46
- }
@@ -1,76 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { StoryContext } from '@storybook/react';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import type { CompositeStoreProps } from '../types';
10
-
11
- /**
12
- * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)
13
- * role, which provides a single tab stop on the page and arrow key navigation
14
- * through the focusable descendants.
15
- *
16
- * ```jsx
17
- * import { Composite, useCompositeStore } from '@wordpress/components';
18
- *
19
- * const store = useCompositeStore();
20
- * <Composite store={ store }>
21
- * <Composite.Item>Item 1</Composite.Item>
22
- * <Composite.Item>Item 2</Composite.Item>
23
- * </Composite>
24
- * ```
25
- */
26
- export function UseCompositeStorePlaceholder( props: CompositeStoreProps ) {
27
- return (
28
- <dl>
29
- { Object.entries( props ).map( ( [ name, value ] ) => (
30
- <>
31
- <dt>{ name }</dt>
32
- <dd>{ JSON.stringify( value ) }</dd>
33
- </>
34
- ) ) }
35
- </dl>
36
- );
37
- }
38
- UseCompositeStorePlaceholder.displayName = 'useCompositeStore';
39
-
40
- // The output generated by Storybook for these components is
41
- // messy, so we apply this transform to make it more useful
42
- // for anyone reading the docs.
43
- export function transform( code: string, context: StoryContext ) {
44
- const storeConfig = ` ${ JSON.stringify( context.args, null, 2 ) } `;
45
- const formattedStoreConfig = storeConfig.replace( ' {} ', '' );
46
- return [
47
- // Include a setup line, showing how to make use of
48
- // `useCompositeStore` to convert store options into
49
- // a composite store prop.
50
- `const store = useCompositeStore(${ formattedStoreConfig });`,
51
- '',
52
- 'return (',
53
- ' ' +
54
- code
55
- // The generated output includes a full dump of everything
56
- // in the store; the reader probably isn't interested in
57
- // what that looks like, so instead we drop all of that
58
- // in favor of the store generated above.
59
- .replaceAll( /store=\{\{[\s\S]*?\}\}/g, 'store={ store }' )
60
- // Now we tidy the output by removing any unnecessary
61
- // whitespace...
62
- .replaceAll( /<Composite\w+[\s\S]*?>/g, ( match ) =>
63
- match.replaceAll( /\s+\s/g, ' ' )
64
- )
65
- // ...including around <Composite*> children...
66
- .replaceAll(
67
- />\s*(\w[\w ]*?)\s*<\//g,
68
- ( _, value ) => `>${ value }</`
69
- )
70
- // ...and inside JSX definitions.
71
- .replaceAll( '} >', '}>' )
72
- // Finally we indent everything to make it more readable.
73
- .replaceAll( /\n/g, '\n ' ),
74
- ');',
75
- ].join( '\n' );
76
- }