@govuk-react/primitives 0.2.0 → 0.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 (267) hide show
  1. package/README.md +100 -25
  2. package/dist/{accordion-element.d.ts → accordion/element.d.ts} +5 -5
  3. package/dist/accordion/element.js +302 -0
  4. package/dist/accordion/element.js.map +1 -0
  5. package/dist/accordion/index.d.ts +70 -0
  6. package/dist/accordion/index.js +140 -0
  7. package/dist/accordion/index.js.map +1 -0
  8. package/dist/auto-focus/element.d.ts +1 -0
  9. package/dist/auto-focus/element.js +75 -0
  10. package/dist/auto-focus/element.js.map +1 -0
  11. package/dist/auto-focus/index.d.ts +15 -0
  12. package/dist/auto-focus/index.js +39 -0
  13. package/dist/auto-focus/index.js.map +1 -0
  14. package/dist/{autocomplete-element.d.ts → autocomplete/element.d.ts} +11 -11
  15. package/dist/autocomplete/element.js +597 -0
  16. package/dist/autocomplete/element.js.map +1 -0
  17. package/dist/{index-D7lMYMUR.d.ts → autocomplete/index.d.ts} +39 -62
  18. package/dist/autocomplete/index.js +100 -0
  19. package/dist/autocomplete/index.js.map +1 -0
  20. package/dist/button/element.d.ts +1 -0
  21. package/dist/button/element.js +59 -0
  22. package/dist/button/element.js.map +1 -0
  23. package/dist/button/index.d.ts +10 -0
  24. package/dist/button/index.js +9 -0
  25. package/dist/button/index.js.map +1 -0
  26. package/dist/character-count/element.d.ts +12 -0
  27. package/dist/character-count/element.js +287 -0
  28. package/dist/character-count/element.js.map +1 -0
  29. package/dist/character-count/index.d.ts +57 -0
  30. package/dist/character-count/index.js +79 -0
  31. package/dist/character-count/index.js.map +1 -0
  32. package/dist/character-count/messages.d.ts +20 -0
  33. package/dist/character-count/messages.js +54 -0
  34. package/dist/character-count/messages.js.map +1 -0
  35. package/dist/choices/element.d.ts +10 -0
  36. package/dist/choices/element.js +177 -0
  37. package/dist/choices/element.js.map +1 -0
  38. package/dist/{index-WuGvkTxu.d.ts → choices/index.d.ts} +30 -44
  39. package/dist/choices/index.js +37 -0
  40. package/dist/choices/index.js.map +1 -0
  41. package/dist/{disclosure-element.d.ts → disclosure/element.d.ts} +5 -5
  42. package/dist/disclosure/element.js +132 -0
  43. package/dist/disclosure/element.js.map +1 -0
  44. package/dist/{index-D4Gzyvfu.d.ts → disclosure/index.d.ts} +43 -56
  45. package/dist/disclosure/index.js +76 -0
  46. package/dist/disclosure/index.js.map +1 -0
  47. package/dist/exit-this-page/element.d.ts +19 -0
  48. package/dist/exit-this-page/element.js +200 -0
  49. package/dist/exit-this-page/element.js.map +1 -0
  50. package/dist/{index-qF0jIQCW.d.ts → exit-this-page/index.d.ts} +44 -68
  51. package/dist/exit-this-page/index.js +54 -0
  52. package/dist/exit-this-page/index.js.map +1 -0
  53. package/dist/file-upload/element.d.ts +28 -0
  54. package/dist/file-upload/element.js +270 -0
  55. package/dist/file-upload/element.js.map +1 -0
  56. package/dist/file-upload/index.d.ts +46 -0
  57. package/dist/file-upload/index.js +65 -0
  58. package/dist/file-upload/index.js.map +1 -0
  59. package/dist/focus-links/element.d.ts +1 -0
  60. package/dist/focus-links/element.js +90 -0
  61. package/dist/focus-links/element.js.map +1 -0
  62. package/dist/{index-BR3MAGF8.d.ts → focus-links/index.d.ts} +24 -35
  63. package/dist/focus-links/index.js +7 -0
  64. package/dist/focus-links/index.js.map +1 -0
  65. package/dist/index.d.ts +13 -17
  66. package/dist/index.js +13 -72
  67. package/dist/index.js.map +1 -1
  68. package/dist/inline/accordion-element.js +1 -1
  69. package/dist/inline/auto-focus-element.js +1 -1
  70. package/dist/inline/autocomplete-element.js +1 -1
  71. package/dist/inline/character-count-element.js +1 -1
  72. package/dist/inline/choices-element.js +1 -1
  73. package/dist/inline/disclosure-element.js +1 -1
  74. package/dist/inline/exit-this-page-element.js +1 -1
  75. package/dist/inline/file-upload-element.js +1 -1
  76. package/dist/inline/focus-links-element.js +1 -1
  77. package/dist/inline/modal-element.js +1 -1
  78. package/dist/inline/password-input-element.js +1 -1
  79. package/dist/inline/tabs-element.js +1 -1
  80. package/dist/inline-script/index.d.ts +26 -0
  81. package/dist/inline-script/index.js +31 -0
  82. package/dist/inline-script/index.js.map +1 -0
  83. package/dist/{modal-element.d.ts → modal/element.d.ts} +2 -4
  84. package/dist/modal/element.js +229 -0
  85. package/dist/modal/element.js.map +1 -0
  86. package/dist/modal/index.d.ts +41 -0
  87. package/dist/modal/index.js +145 -0
  88. package/dist/modal/index.js.map +1 -0
  89. package/dist/password-input/element.d.ts +1 -0
  90. package/dist/password-input/element.js +150 -0
  91. package/dist/password-input/element.js.map +1 -0
  92. package/dist/{index-sEHnx4-M.d.ts → password-input/index.d.ts} +33 -49
  93. package/dist/password-input/index.js +37 -0
  94. package/dist/password-input/index.js.map +1 -0
  95. package/dist/styles.css +11 -0
  96. package/dist/{tabs-element.d.ts → tabs/element.d.ts} +5 -5
  97. package/dist/tabs/element.js +423 -0
  98. package/dist/tabs/element.js.map +1 -0
  99. package/dist/tabs/index.d.ts +74 -0
  100. package/dist/tabs/index.js +142 -0
  101. package/dist/tabs/index.js.map +1 -0
  102. package/dist/utils/change-details.d.ts +11 -0
  103. package/dist/utils/change-details.js +3 -0
  104. package/dist/utils/change-details.js.map +1 -0
  105. package/dist/utils/dom.d.ts +9 -0
  106. package/dist/utils/dom.js +27 -0
  107. package/dist/utils/dom.js.map +1 -0
  108. package/dist/utils/on-property-change.d.ts +7 -0
  109. package/dist/utils/on-property-change.js +19 -0
  110. package/dist/utils/on-property-change.js.map +1 -0
  111. package/dist/utils/set-focus.d.ts +11 -0
  112. package/dist/utils/set-focus.js +38 -0
  113. package/dist/utils/set-focus.js.map +1 -0
  114. package/dist/utils/set-up-when-ready.d.ts +6 -0
  115. package/dist/utils/set-up-when-ready.js +16 -0
  116. package/dist/utils/set-up-when-ready.js.map +1 -0
  117. package/dist/utils/slot.d.ts +15 -0
  118. package/dist/utils/slot.js +62 -0
  119. package/dist/utils/slot.js.map +1 -0
  120. package/dist/utils/translation.d.ts +13 -0
  121. package/dist/utils/translation.js +57 -0
  122. package/dist/utils/translation.js.map +1 -0
  123. package/package.json +17 -4
  124. package/dist/accordion-element.js +0 -9
  125. package/dist/accordion-element.js.map +0 -1
  126. package/dist/accordion.d.ts +0 -2
  127. package/dist/accordion.js +0 -34
  128. package/dist/accordion.js.map +0 -1
  129. package/dist/auto-focus-element.d.ts +0 -3
  130. package/dist/auto-focus-element.js +0 -10
  131. package/dist/auto-focus-element.js.map +0 -1
  132. package/dist/auto-focus.d.ts +0 -2
  133. package/dist/auto-focus.js +0 -15
  134. package/dist/auto-focus.js.map +0 -1
  135. package/dist/autocomplete-element.js +0 -12
  136. package/dist/autocomplete-element.js.map +0 -1
  137. package/dist/autocomplete.d.ts +0 -4
  138. package/dist/autocomplete.js +0 -25
  139. package/dist/autocomplete.js.map +0 -1
  140. package/dist/button-element.d.ts +0 -2
  141. package/dist/button-element.js +0 -3
  142. package/dist/button-element.js.map +0 -1
  143. package/dist/button.d.ts +0 -2
  144. package/dist/button.js +0 -12
  145. package/dist/button.js.map +0 -1
  146. package/dist/character-count-element.d.ts +0 -10
  147. package/dist/character-count-element.js +0 -10
  148. package/dist/character-count-element.js.map +0 -1
  149. package/dist/character-count.d.ts +0 -3
  150. package/dist/character-count.js +0 -26
  151. package/dist/character-count.js.map +0 -1
  152. package/dist/choices-element.d.ts +0 -8
  153. package/dist/choices-element.js +0 -9
  154. package/dist/choices-element.js.map +0 -1
  155. package/dist/choices.d.ts +0 -2
  156. package/dist/choices.js +0 -16
  157. package/dist/choices.js.map +0 -1
  158. package/dist/chunk-2IHAQAYF.js +0 -23
  159. package/dist/chunk-2IHAQAYF.js.map +0 -1
  160. package/dist/chunk-2ZJVSNC2.js +0 -31
  161. package/dist/chunk-2ZJVSNC2.js.map +0 -1
  162. package/dist/chunk-47NMY4SS.js +0 -108
  163. package/dist/chunk-47NMY4SS.js.map +0 -1
  164. package/dist/chunk-4XAR4FFG.js +0 -83
  165. package/dist/chunk-4XAR4FFG.js.map +0 -1
  166. package/dist/chunk-5HWRMQK2.js +0 -91
  167. package/dist/chunk-5HWRMQK2.js.map +0 -1
  168. package/dist/chunk-6ZFU4VYW.js +0 -41
  169. package/dist/chunk-6ZFU4VYW.js.map +0 -1
  170. package/dist/chunk-B2I4J5NL.js +0 -264
  171. package/dist/chunk-B2I4J5NL.js.map +0 -1
  172. package/dist/chunk-DPERPCUH.js +0 -188
  173. package/dist/chunk-DPERPCUH.js.map +0 -1
  174. package/dist/chunk-ECYGKE4D.js +0 -168
  175. package/dist/chunk-ECYGKE4D.js.map +0 -1
  176. package/dist/chunk-ESBMTI25.js +0 -11
  177. package/dist/chunk-ESBMTI25.js.map +0 -1
  178. package/dist/chunk-ET7DCQM7.js +0 -133
  179. package/dist/chunk-ET7DCQM7.js.map +0 -1
  180. package/dist/chunk-F5XFC4QJ.js +0 -177
  181. package/dist/chunk-F5XFC4QJ.js.map +0 -1
  182. package/dist/chunk-GVGBDSDN.js +0 -78
  183. package/dist/chunk-GVGBDSDN.js.map +0 -1
  184. package/dist/chunk-IZQ2C4BC.js +0 -351
  185. package/dist/chunk-IZQ2C4BC.js.map +0 -1
  186. package/dist/chunk-L7E6GN2D.js +0 -87
  187. package/dist/chunk-L7E6GN2D.js.map +0 -1
  188. package/dist/chunk-LWIA644X.js +0 -34
  189. package/dist/chunk-LWIA644X.js.map +0 -1
  190. package/dist/chunk-NX4B3NKM.js +0 -35
  191. package/dist/chunk-NX4B3NKM.js.map +0 -1
  192. package/dist/chunk-PNWPGD7B.js +0 -68
  193. package/dist/chunk-PNWPGD7B.js.map +0 -1
  194. package/dist/chunk-QLQ6O7OW.js +0 -111
  195. package/dist/chunk-QLQ6O7OW.js.map +0 -1
  196. package/dist/chunk-RDUPELOK.js +0 -55
  197. package/dist/chunk-RDUPELOK.js.map +0 -1
  198. package/dist/chunk-RPMHI67T.js +0 -104
  199. package/dist/chunk-RPMHI67T.js.map +0 -1
  200. package/dist/chunk-TE4RUYVK.js +0 -97
  201. package/dist/chunk-TE4RUYVK.js.map +0 -1
  202. package/dist/chunk-TJVBFRIE.js +0 -60
  203. package/dist/chunk-TJVBFRIE.js.map +0 -1
  204. package/dist/chunk-U5OKNKYC.js +0 -510
  205. package/dist/chunk-U5OKNKYC.js.map +0 -1
  206. package/dist/chunk-UXJO4AJP.js +0 -290
  207. package/dist/chunk-UXJO4AJP.js.map +0 -1
  208. package/dist/chunk-VNXXENCU.js +0 -39
  209. package/dist/chunk-VNXXENCU.js.map +0 -1
  210. package/dist/chunk-XGK73UCD.js +0 -62
  211. package/dist/chunk-XGK73UCD.js.map +0 -1
  212. package/dist/chunk-XJYLFTYE.js +0 -157
  213. package/dist/chunk-XJYLFTYE.js.map +0 -1
  214. package/dist/chunk-YCESNTXQ.js +0 -241
  215. package/dist/chunk-YCESNTXQ.js.map +0 -1
  216. package/dist/chunk-ZTJLVNR4.js +0 -62
  217. package/dist/chunk-ZTJLVNR4.js.map +0 -1
  218. package/dist/disclosure-element.js +0 -9
  219. package/dist/disclosure-element.js.map +0 -1
  220. package/dist/disclosure.d.ts +0 -2
  221. package/dist/disclosure.js +0 -16
  222. package/dist/disclosure.js.map +0 -1
  223. package/dist/exit-this-page-element.d.ts +0 -22
  224. package/dist/exit-this-page-element.js +0 -13
  225. package/dist/exit-this-page-element.js.map +0 -1
  226. package/dist/exit-this-page.d.ts +0 -3
  227. package/dist/exit-this-page.js +0 -25
  228. package/dist/exit-this-page.js.map +0 -1
  229. package/dist/file-upload-element.d.ts +0 -27
  230. package/dist/file-upload-element.js +0 -14
  231. package/dist/file-upload-element.js.map +0 -1
  232. package/dist/file-upload.d.ts +0 -3
  233. package/dist/file-upload.js +0 -25
  234. package/dist/file-upload.js.map +0 -1
  235. package/dist/focus-links-element.d.ts +0 -3
  236. package/dist/focus-links-element.js +0 -10
  237. package/dist/focus-links-element.js.map +0 -1
  238. package/dist/focus-links.d.ts +0 -2
  239. package/dist/focus-links.js +0 -12
  240. package/dist/focus-links.js.map +0 -1
  241. package/dist/index--FxJgSOS.d.ts +0 -108
  242. package/dist/index-Bul0NJh_.d.ts +0 -310
  243. package/dist/index-CikOyFud.d.ts +0 -54
  244. package/dist/index-D8N5vxTL.d.ts +0 -90
  245. package/dist/index-DMWpkC_d.d.ts +0 -105
  246. package/dist/index-DN7fGMc3.d.ts +0 -20
  247. package/dist/index-DPXR1Yua.d.ts +0 -69
  248. package/dist/inline-script.d.ts +0 -29
  249. package/dist/inline-script.js +0 -63
  250. package/dist/inline-script.js.map +0 -1
  251. package/dist/modal-element.js +0 -11
  252. package/dist/modal-element.js.map +0 -1
  253. package/dist/modal.d.ts +0 -2
  254. package/dist/modal.js +0 -20
  255. package/dist/modal.js.map +0 -1
  256. package/dist/password-input-element.d.ts +0 -3
  257. package/dist/password-input-element.js +0 -9
  258. package/dist/password-input-element.js.map +0 -1
  259. package/dist/password-input.d.ts +0 -2
  260. package/dist/password-input.js +0 -18
  261. package/dist/password-input.js.map +0 -1
  262. package/dist/tabs-element.js +0 -9
  263. package/dist/tabs-element.js.map +0 -1
  264. package/dist/tabs.d.ts +0 -2
  265. package/dist/tabs.js +0 -28
  266. package/dist/tabs.js.map +0 -1
  267. package/dist/translation-BnpO2mN2.d.ts +0 -4
package/dist/accordion.js DELETED
@@ -1,34 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- Content,
5
- Controls,
6
- Fallback,
7
- Icon,
8
- Label,
9
- Root,
10
- Section,
11
- ShowAll,
12
- ShowAllText,
13
- ToggleText,
14
- Trigger,
15
- accordionCss
16
- } from "./chunk-DPERPCUH.js";
17
- import "./chunk-B2I4J5NL.js";
18
- import "./chunk-NX4B3NKM.js";
19
- import "./chunk-ESBMTI25.js";
20
- export {
21
- Content,
22
- Controls,
23
- Fallback,
24
- Icon,
25
- Label,
26
- Root,
27
- Section,
28
- ShowAll,
29
- ShowAllText,
30
- ToggleText,
31
- Trigger,
32
- accordionCss
33
- };
34
- //# sourceMappingURL=accordion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +0,0 @@
1
- declare const tagName = "govuk-react-auto-focus";
2
-
3
- export { tagName };
@@ -1,10 +0,0 @@
1
- 'use client';
2
- import {
3
- tagName
4
- } from "./chunk-XGK73UCD.js";
5
- import "./chunk-LWIA644X.js";
6
- import "./chunk-ESBMTI25.js";
7
- export {
8
- tagName
9
- };
10
- //# sourceMappingURL=auto-focus-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- import 'react';
2
- export { R as Root, a as RootProps, T as Target, b as TargetProps } from './index-Bul0NJh_.js';
@@ -1,15 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- Root,
5
- Target
6
- } from "./chunk-6ZFU4VYW.js";
7
- import "./chunk-XGK73UCD.js";
8
- import "./chunk-LWIA644X.js";
9
- import "./chunk-NX4B3NKM.js";
10
- import "./chunk-ESBMTI25.js";
11
- export {
12
- Root,
13
- Target
14
- };
15
- //# sourceMappingURL=auto-focus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,12 +0,0 @@
1
- 'use client';
2
- import {
3
- defaults,
4
- tagName
5
- } from "./chunk-U5OKNKYC.js";
6
- import "./chunk-RDUPELOK.js";
7
- import "./chunk-ESBMTI25.js";
8
- export {
9
- defaults,
10
- tagName
11
- };
12
- //# sourceMappingURL=autocomplete-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +0,0 @@
1
- import 'react';
2
- export { T as Translation } from './translation-BnpO2mN2.js';
3
- export { Filter } from './autocomplete-element.js';
4
- export { A as AssistiveHint, a as AssistiveHintProps, I as Input, b as InputProps, L as Listbox, c as ListboxProps, N as NoResults, d as NoResultsProps, O as Option, e as OptionProps, R as Root, f as RootProps, S as Status, g as StatusProps } from './index-D7lMYMUR.js';
@@ -1,25 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- AssistiveHint,
5
- Input,
6
- Listbox,
7
- NoResults,
8
- Option,
9
- Root,
10
- Status
11
- } from "./chunk-XJYLFTYE.js";
12
- import "./chunk-U5OKNKYC.js";
13
- import "./chunk-RDUPELOK.js";
14
- import "./chunk-NX4B3NKM.js";
15
- import "./chunk-ESBMTI25.js";
16
- export {
17
- AssistiveHint,
18
- Input,
19
- Listbox,
20
- NoResults,
21
- Option,
22
- Root,
23
- Status
24
- };
25
- //# sourceMappingURL=autocomplete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
-
2
- export { };
@@ -1,3 +0,0 @@
1
- 'use client';
2
- import "./chunk-VNXXENCU.js";
3
- //# sourceMappingURL=button-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/button.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import 'react';
2
- export { R as Root, a as RootProps } from './index-DN7fGMc3.js';
package/dist/button.js DELETED
@@ -1,12 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- Root
5
- } from "./chunk-2ZJVSNC2.js";
6
- import "./chunk-VNXXENCU.js";
7
- import "./chunk-NX4B3NKM.js";
8
- import "./chunk-ESBMTI25.js";
9
- export {
10
- Root
11
- };
12
- //# sourceMappingURL=button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,10 +0,0 @@
1
- declare const tagName = "govuk-react-character-count";
2
- interface CharacterCountElement extends HTMLElement {
3
- /** The count, once upgraded. */
4
- readonly count: number | undefined;
5
- /** Counts the field again and updates the visible count, such as after setting its value. */
6
- update(): void;
7
- }
8
-
9
- export { tagName };
10
- export type { CharacterCountElement };
@@ -1,10 +0,0 @@
1
- 'use client';
2
- import {
3
- tagName
4
- } from "./chunk-UXJO4AJP.js";
5
- import "./chunk-RDUPELOK.js";
6
- import "./chunk-ESBMTI25.js";
7
- export {
8
- tagName
9
- };
10
- //# sourceMappingURL=character-count-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +0,0 @@
1
- import 'react';
2
- export { C as CountType, D as Description, a as DescriptionProps, I as Input, b as InputProps, R as Root, c as RootProps, S as ScreenReaderStatus, d as ScreenReaderStatusProps, e as Status, f as StatusProps, g as countMessage, h as countOf } from './index-D8N5vxTL.js';
3
- export { T as Translation } from './translation-BnpO2mN2.js';
@@ -1,26 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- Description,
5
- Input,
6
- Root,
7
- ScreenReaderStatus,
8
- Status
9
- } from "./chunk-QLQ6O7OW.js";
10
- import {
11
- countMessage,
12
- countOf
13
- } from "./chunk-UXJO4AJP.js";
14
- import "./chunk-RDUPELOK.js";
15
- import "./chunk-NX4B3NKM.js";
16
- import "./chunk-ESBMTI25.js";
17
- export {
18
- Description,
19
- Input,
20
- Root,
21
- ScreenReaderStatus,
22
- Status,
23
- countMessage,
24
- countOf
25
- };
26
- //# sourceMappingURL=character-count.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +0,0 @@
1
- declare const tagName = "govuk-react-choices";
2
- interface ChoicesElement extends HTMLElement {
3
- /** Shows and hides the reveals to match the choices, such as after setting `checked`. */
4
- sync(): void;
5
- }
6
-
7
- export { tagName };
8
- export type { ChoicesElement };
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import {
3
- tagName
4
- } from "./chunk-ET7DCQM7.js";
5
- import "./chunk-ESBMTI25.js";
6
- export {
7
- tagName
8
- };
9
- //# sourceMappingURL=choices-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/choices.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import 'react';
2
- export { C as Conditional, a as ConditionalProps, I as Input, b as InputProps, R as Root, c as RootProps } from './index-WuGvkTxu.js';
package/dist/choices.js DELETED
@@ -1,16 +0,0 @@
1
- 'use client';
2
- "use client";
3
- import {
4
- Conditional,
5
- Input,
6
- Root
7
- } from "./chunk-TJVBFRIE.js";
8
- import "./chunk-ET7DCQM7.js";
9
- import "./chunk-NX4B3NKM.js";
10
- import "./chunk-ESBMTI25.js";
11
- export {
12
- Conditional,
13
- Input,
14
- Root
15
- };
16
- //# sourceMappingURL=choices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,23 +0,0 @@
1
- 'use client';
2
- import {
3
- tagName
4
- } from "./chunk-PNWPGD7B.js";
5
- import {
6
- __export
7
- } from "./chunk-ESBMTI25.js";
8
-
9
- // src/focus-links/index.tsx
10
- var focus_links_exports = {};
11
- __export(focus_links_exports, {
12
- Root: () => Root
13
- });
14
- import * as React from "react";
15
- function Root({ focusedClass, ...props }) {
16
- return React.createElement(tagName, { ...props, "focused-class": focusedClass });
17
- }
18
-
19
- export {
20
- Root,
21
- focus_links_exports
22
- };
23
- //# sourceMappingURL=chunk-2IHAQAYF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/focus-links/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { tagName } from './element';\n\n/*\n * Headless focus links: the <govuk-react-focus-links> element (./element.ts) makes links to a part\n * of the same page, inside it, move focus there. Links to a form field also scroll its label or\n * legend into view.\n */\n\nexport type RootProps = React.HTMLAttributes<HTMLElement> & {\n /** Classes for a target that isn't a form field while it has focus. */\n focusedClass?: string;\n};\n\nexport function Root({ focusedClass, ...props }: RootProps) {\n return React.createElement(tagName, { ...props, 'focused-class': focusedClass });\n}\n"],"mappings":";;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAEA,YAAY,WAAW;AAchB,SAAS,KAAK,EAAE,cAAc,GAAG,MAAM,GAAc;AAC1D,SAAa,oBAAc,SAAS,EAAE,GAAG,OAAO,iBAAiB,aAAa,CAAC;AACjF;","names":[]}
@@ -1,31 +0,0 @@
1
- 'use client';
2
- import {
3
- Slot
4
- } from "./chunk-NX4B3NKM.js";
5
- import {
6
- __export
7
- } from "./chunk-ESBMTI25.js";
8
-
9
- // src/button/index.tsx
10
- var button_exports = {};
11
- __export(button_exports, {
12
- Root: () => Root
13
- });
14
- import * as React from "react";
15
- function Root({ asChild, preventDoubleClick, ...props }) {
16
- const Element = asChild ? Slot : "button";
17
- return /* @__PURE__ */ React.createElement(
18
- Element,
19
- {
20
- "data-button": "",
21
- "data-prevent-double-click": preventDoubleClick === void 0 ? void 0 : String(preventDoubleClick),
22
- ...props
23
- }
24
- );
25
- }
26
-
27
- export {
28
- Root,
29
- button_exports
30
- };
31
- //# sourceMappingURL=chunk-2ZJVSNC2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/button/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ComponentProps } from 'react';\nimport { Slot } from '../utils/slot';\nimport './element';\n\n/*\n * Headless button behaviour (./element.ts): `Root` marks a button or link button for it. Prevents\n * double clicks with `preventDoubleClick`, and makes Space activate a link with `role=\"button\"`.\n */\n\nexport type RootProps = ComponentProps<'button'> & {\n /** Render the only child instead, such as a link with `role=\"button\"`, with this part's props merged onto it. */\n asChild?: boolean;\n /** Cancel a second click within a second of the first, so a form isn't submitted twice. */\n preventDoubleClick?: boolean;\n};\n\nexport function Root({ asChild, preventDoubleClick, ...props }: RootProps) {\n const Element = asChild ? Slot : 'button';\n return (\n <Element\n data-button=\"\"\n data-prevent-double-click={preventDoubleClick === undefined ? undefined : String(preventDoubleClick)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAEA,YAAY,WAAW;AAiBhB,SAAS,KAAK,EAAE,SAAS,oBAAoB,GAAG,MAAM,GAAc;AACzE,QAAM,UAAU,UAAU,OAAO;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,6BAA2B,uBAAuB,SAAY,SAAY,OAAO,kBAAkB;AAAA,MAClG,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -1,108 +0,0 @@
1
- 'use client';
2
- import {
3
- tagName
4
- } from "./chunk-L7E6GN2D.js";
5
- import {
6
- Slot
7
- } from "./chunk-NX4B3NKM.js";
8
- import {
9
- __export
10
- } from "./chunk-ESBMTI25.js";
11
-
12
- // src/modal/index.tsx
13
- var modal_exports = {};
14
- __export(modal_exports, {
15
- Close: () => Close,
16
- Content: () => Content,
17
- Root: () => Root,
18
- Title: () => Title,
19
- Trigger: () => Trigger
20
- });
21
- import * as React from "react";
22
- import { createContext, useContext, useEffect, useId, useRef } from "react";
23
- var ModalContext = createContext({});
24
- function Root({ children, open, onOpenChange, dialogId: dialogIdProp, ...props }) {
25
- const generatedId = useId();
26
- const dialogId = dialogIdProp != null ? dialogIdProp : generatedId;
27
- return /* @__PURE__ */ React.createElement(ModalContext.Provider, { value: { dialogId, titleId: `${dialogId}-title`, onOpenChange } }, React.createElement(
28
- tagName,
29
- {
30
- ...props,
31
- open: open === void 0 ? void 0 : String(open),
32
- suppressHydrationWarning: true
33
- },
34
- children
35
- ));
36
- }
37
- function Command({ command, asChild, dialogId, ...props }) {
38
- const context = useContext(ModalContext);
39
- const invoker = { command, commandfor: dialogId != null ? dialogId : context.dialogId };
40
- if (asChild) return /* @__PURE__ */ React.createElement(Slot, { ...invoker, ...props });
41
- return /* @__PURE__ */ React.createElement("button", { type: "button", ...invoker, ...props });
42
- }
43
- function Trigger(props) {
44
- return /* @__PURE__ */ React.createElement(Command, { command: "show-modal", ...props });
45
- }
46
- function Close(props) {
47
- return /* @__PURE__ */ React.createElement(Command, { command: "close", ...props });
48
- }
49
- function Content({ asChild, id, onClose, ref, ...props }) {
50
- const context = useContext(ModalContext);
51
- const reported = useRef(void 0);
52
- const onOpenChange = useRef(context.onOpenChange);
53
- useEffect(() => {
54
- onOpenChange.current = context.onOpenChange;
55
- });
56
- const report = (dialog) => {
57
- var _a;
58
- if (reported.current === dialog.open) return;
59
- reported.current = dialog.open;
60
- (_a = onOpenChange.current) == null ? void 0 : _a.call(onOpenChange, dialog.open);
61
- };
62
- const dialogRef = useRef(null);
63
- useEffect(() => {
64
- var _a;
65
- const dialog = dialogRef.current;
66
- if ((dialog == null ? void 0 : dialog.open) && reported.current === void 0) {
67
- reported.current = true;
68
- (_a = onOpenChange.current) == null ? void 0 : _a.call(onOpenChange, true);
69
- }
70
- }, []);
71
- const listen = (dialog) => {
72
- dialogRef.current = dialog;
73
- if (typeof ref === "function") ref(dialog);
74
- else if (ref) ref.current = dialog;
75
- if (!dialog) return void 0;
76
- const onToggle = () => report(dialog);
77
- dialog.addEventListener("toggle", onToggle);
78
- return () => dialog.removeEventListener("toggle", onToggle);
79
- };
80
- const shared = {
81
- id: id != null ? id : context.dialogId,
82
- "aria-labelledby": props["aria-label"] ? void 0 : context.titleId,
83
- ref: listen,
84
- onClose: (event) => {
85
- onClose == null ? void 0 : onClose(event);
86
- report(event.currentTarget);
87
- },
88
- // The dialog's open state belongs to the browser.
89
- suppressHydrationWarning: true
90
- };
91
- if (asChild) return /* @__PURE__ */ React.createElement(Slot, { ...shared, ...props });
92
- return /* @__PURE__ */ React.createElement("dialog", { ...shared, ...props });
93
- }
94
- function Title({ asChild, ...props }) {
95
- const context = useContext(ModalContext);
96
- const Element = asChild ? Slot : "h2";
97
- return /* @__PURE__ */ React.createElement(Element, { id: context.titleId, ...props });
98
- }
99
-
100
- export {
101
- Root,
102
- Trigger,
103
- Close,
104
- Content,
105
- Title,
106
- modal_exports
107
- };
108
- //# sourceMappingURL=chunk-47NMY4SS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/modal/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext, useEffect, useId, useRef } from 'react';\nimport type { ComponentProps, ReactNode, SyntheticEvent } from 'react';\nimport { Slot } from '../utils/slot';\nimport { tagName } from './element';\n\n/*\n * Headless modal dialog: unstyled parts over a native `dialog` and the <govuk-react-modal>\n * element (./element.ts). Every part except Root takes `asChild`.\n *\n * Trigger and Close are buttons with invoker commands (`command` and `commandfor`), so where\n * the browser supports them the dialog opens as a true modal with no JavaScript: the page behind\n * is inert, focus moves into the dialog, and Escape closes it. The element runs the commands in\n * browsers without them, and applies `open` when controlled.\n *\n * Context only fills in ids: in an island without a Root, pass `dialogId` to Trigger and Close,\n * and `id` to Content.\n */\n\nconst ModalContext = createContext<{\n dialogId?: string;\n titleId?: string;\n onOpenChange?: (open: boolean) => void;\n}>({});\n\nexport type RootProps = Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {\n children?: ReactNode;\n /** Whether the dialog is open, to control it. Without it, the buttons alone open and close it. */\n open?: boolean;\n /** Called when the dialog opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** The dialog's id, which the buttons' `commandfor` names. Defaults to a generated one. */\n dialogId?: string;\n};\n\nexport function Root({ children, open, onOpenChange, dialogId: dialogIdProp, ...props }: RootProps) {\n const generatedId = useId();\n const dialogId = dialogIdProp ?? generatedId;\n return (\n <ModalContext.Provider value={{ dialogId, titleId: `${dialogId}-title`, onOpenChange }}>\n {React.createElement(\n tagName,\n {\n ...props,\n open: open === undefined ? undefined : String(open),\n suppressHydrationWarning: true,\n },\n children\n )}\n </ModalContext.Provider>\n );\n}\n\ntype PartProps<E extends keyof React.JSX.IntrinsicElements> = ComponentProps<E> & {\n /** Render the only child instead, with this part's props merged onto it. */\n asChild?: boolean;\n};\n\ntype CommandProps = PartProps<'button'> & {\n /** The dialog's id. Set by Root. */\n dialogId?: string;\n};\n\nfunction Command({ command, asChild, dialogId, ...props }: CommandProps & { command: string }) {\n const context = useContext(ModalContext);\n // `command` and `commandfor` aren't in React's types yet, so they go in as a spread.\n const invoker = { command, commandfor: dialogId ?? context.dialogId };\n if (asChild) return <Slot {...invoker} {...props} />;\n return <button type=\"button\" {...invoker} {...props} />;\n}\n\nexport type TriggerProps = CommandProps;\n\n/** A button that opens the dialog as a modal. */\nexport function Trigger(props: TriggerProps) {\n return <Command command=\"show-modal\" {...props} />;\n}\n\nexport type CloseProps = CommandProps;\n\n/** A button that closes the dialog. */\nexport function Close(props: CloseProps) {\n return <Command command=\"close\" {...props} />;\n}\n\nexport type ContentProps = PartProps<'dialog'>;\n\n/**\n * The dialog. It's named by Title, unless you pass `aria-labelledby` or `aria-label`. Pass\n * `closedby=\"any\"` to also close it when the user clicks outside it.\n */\nexport function Content({ asChild, id, onClose, ref, ...props }: ContentProps) {\n const context = useContext(ModalContext);\n const reported = useRef<boolean | undefined>(undefined);\n const onOpenChange = useRef(context.onOpenChange);\n useEffect(() => {\n onOpenChange.current = context.onOpenChange;\n });\n // Report each change once: `toggle` fires on opening and closing where the browser fires it on\n // dialogs, and `close` on closing everywhere.\n const report = (dialog: HTMLDialogElement) => {\n if (reported.current === dialog.open) return;\n reported.current = dialog.open;\n onOpenChange.current?.(dialog.open);\n };\n // A dialog the user opened before hydration, through its invoker command or the element, fired\n // nothing React heard, so report it once.\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n useEffect(() => {\n const dialog = dialogRef.current;\n if (dialog?.open && reported.current === undefined) {\n reported.current = true;\n onOpenChange.current?.(true);\n }\n }, []);\n // React doesn't listen for `toggle` on a dialog, so listen natively.\n const listen = (dialog: HTMLDialogElement | null) => {\n dialogRef.current = dialog;\n if (typeof ref === 'function') ref(dialog);\n else if (ref) ref.current = dialog;\n if (!dialog) return undefined;\n const onToggle = () => report(dialog);\n dialog.addEventListener('toggle', onToggle);\n return () => dialog.removeEventListener('toggle', onToggle);\n };\n const shared = {\n id: id ?? context.dialogId,\n 'aria-labelledby': props['aria-label'] ? undefined : context.titleId,\n ref: listen,\n onClose: (event: SyntheticEvent<HTMLDialogElement>) => {\n onClose?.(event);\n report(event.currentTarget);\n },\n // The dialog's open state belongs to the browser.\n suppressHydrationWarning: true,\n };\n if (asChild) return <Slot {...shared} {...props} />;\n return <dialog {...shared} {...props} />;\n}\n\nexport type TitleProps = PartProps<'h2'>;\n\n/** The dialog's heading, which names it. */\nexport function Title({ asChild, ...props }: TitleProps) {\n const context = useContext(ModalContext);\n const Element = asChild ? Slot : 'h2';\n return <Element id={context.titleId} {...props} />;\n}\n"],"mappings":"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","names":[]}
@@ -1,83 +0,0 @@
1
- 'use client';
2
- import {
3
- defaultMessages,
4
- tagName
5
- } from "./chunk-ECYGKE4D.js";
6
- import {
7
- Slot
8
- } from "./chunk-NX4B3NKM.js";
9
- import {
10
- __export
11
- } from "./chunk-ESBMTI25.js";
12
-
13
- // src/exit-this-page/index.tsx
14
- var exit_this_page_exports = {};
15
- __export(exit_this_page_exports, {
16
- Button: () => Button,
17
- Indicator: () => Indicator,
18
- Light: () => Light,
19
- Root: () => Root,
20
- SkipLink: () => SkipLink,
21
- Status: () => Status,
22
- defaultMessages: () => defaultMessages
23
- });
24
- import * as React from "react";
25
- function Root({
26
- activatedText,
27
- timedOutText,
28
- pressTwoMoreTimesText,
29
- pressOneMoreTimeText,
30
- indicatorVisibleClass,
31
- lightOnClass,
32
- hideContentClass,
33
- overlayClass,
34
- ...props
35
- }) {
36
- return React.createElement(tagName, {
37
- ...props,
38
- activated: activatedText,
39
- "timed-out": timedOutText,
40
- "press-two-more-times": pressTwoMoreTimesText,
41
- "press-one-more-time": pressOneMoreTimeText,
42
- "indicator-visible-class": indicatorVisibleClass,
43
- "light-on-class": lightOnClass,
44
- "hide-content-class": hideContentClass,
45
- "overlay-class": overlayClass,
46
- // The element owns `data-upgraded`.
47
- suppressHydrationWarning: true
48
- });
49
- }
50
- function Button({ asChild, ...props }) {
51
- const Element = asChild ? Slot : "a";
52
- return /* @__PURE__ */ React.createElement(Element, { "data-exit-this-page-button": "", ...props });
53
- }
54
- function SkipLink({ asChild, ...props }) {
55
- const Element = asChild ? Slot : "a";
56
- return /* @__PURE__ */ React.createElement(Element, { "data-exit-this-page-skiplink": "", ...props });
57
- }
58
- function Indicator({ asChild, children, ...props }) {
59
- const Element = asChild ? Slot : "div";
60
- return (
61
- // The element owns `data-visible` and its classes.
62
- /* @__PURE__ */ React.createElement(Element, { "data-exit-this-page-indicator": "", "aria-hidden": "true", suppressHydrationWarning: true, ...props }, children != null ? children : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Light, null), /* @__PURE__ */ React.createElement(Light, null), /* @__PURE__ */ React.createElement(Light, null)))
63
- );
64
- }
65
- function Light({ asChild, ...props }) {
66
- const Element = asChild ? Slot : "div";
67
- return /* @__PURE__ */ React.createElement(Element, { "data-exit-this-page-light": "", suppressHydrationWarning: true, ...props });
68
- }
69
- function Status({ asChild, children, ...props }) {
70
- const Element = asChild ? Slot : "span";
71
- return /* @__PURE__ */ React.createElement(Element, { "data-exit-this-page-status": "", role: "status", suppressHydrationWarning: true, ...props }, children != null ? children : "");
72
- }
73
-
74
- export {
75
- Root,
76
- Button,
77
- SkipLink,
78
- Indicator,
79
- Light,
80
- Status,
81
- exit_this_page_exports
82
- };
83
- //# sourceMappingURL=chunk-4XAR4FFG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/exit-this-page/index.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ComponentProps } from 'react';\nimport { Slot } from '../utils/slot';\nimport { tagName } from './element';\n\nexport { defaultMessages, type ExitThisPageElement, type MessageName } from './element';\n\n/*\n * Headless exit this page: unstyled parts over the <govuk-react-exit-this-page> element\n * (./element.ts). The button, a SkipLink, or pressing Shift 3 times hides the page and goes to\n * the button's `href`. Every part except Root takes `asChild`.\n *\n * Without JavaScript the button is a plain link. To stay on the page, such as in a test, listen for\n * `govuk-react-exit-this-page:exit` and cancel it.\n */\n\nexport type RootProps = React.HTMLAttributes<HTMLElement> & {\n /** Announced once activated. Defaults to \"Loading.\". */\n activatedText?: string;\n /** Announced when the Shift presses time out. Defaults to \"Exit this page expired.\". */\n timedOutText?: string;\n /** Announced after one press of Shift. Defaults to \"Shift, press 2 more times to exit.\". */\n pressTwoMoreTimesText?: string;\n /** Announced after two presses of Shift. Defaults to \"Shift, press 1 more time to exit.\". */\n pressOneMoreTimeText?: string;\n /** Classes for the indicator while counting presses. */\n indicatorVisibleClass?: string;\n /** Classes for each light of the indicator once pressed. */\n lightOnClass?: string;\n /** Classes for `body` that hide the page behind the overlay. */\n hideContentClass?: string;\n /** Classes for the overlay. Without them, inline styles cover the page. */\n overlayClass?: string;\n};\n\nexport function Root({\n activatedText,\n timedOutText,\n pressTwoMoreTimesText,\n pressOneMoreTimeText,\n indicatorVisibleClass,\n lightOnClass,\n hideContentClass,\n overlayClass,\n ...props\n}: RootProps) {\n return React.createElement(tagName, {\n ...props,\n activated: activatedText,\n 'timed-out': timedOutText,\n 'press-two-more-times': pressTwoMoreTimesText,\n 'press-one-more-time': pressOneMoreTimeText,\n 'indicator-visible-class': indicatorVisibleClass,\n 'light-on-class': lightOnClass,\n 'hide-content-class': hideContentClass,\n 'overlay-class': overlayClass,\n // The element owns `data-upgraded`.\n suppressHydrationWarning: true,\n });\n}\n\ntype PartProps<E extends keyof React.JSX.IntrinsicElements> = ComponentProps<E> & {\n /** Render the only child instead, with this part's props merged onto it. */\n asChild?: boolean;\n};\n\nexport type ButtonProps = PartProps<'a'>;\n\n/** The link to a safe page, which the element follows once it has hidden the page. */\nexport function Button({ asChild, ...props }: ButtonProps) {\n const Element = asChild ? Slot : 'a';\n return <Element data-exit-this-page-button=\"\" {...props} />;\n}\n\nexport type SkipLinkProps = PartProps<'a'>;\n\n/** A link anywhere on the page, such as in the skip links, that exits too. */\nexport function SkipLink({ asChild, ...props }: SkipLinkProps) {\n const Element = asChild ? Slot : 'a';\n return <Element data-exit-this-page-skiplink=\"\" {...props} />;\n}\n\nexport type IndicatorProps = PartProps<'div'>;\n\n/** Shows how many times Shift has been pressed. Has three Lights unless given children. */\nexport function Indicator({ asChild, children, ...props }: IndicatorProps) {\n const Element = asChild ? Slot : 'div';\n return (\n // The element owns `data-visible` and its classes.\n <Element data-exit-this-page-indicator=\"\" aria-hidden=\"true\" suppressHydrationWarning {...props}>\n {children ?? (\n <>\n <Light />\n <Light />\n <Light />\n </>\n )}\n </Element>\n );\n}\n\nexport type LightProps = PartProps<'div'>;\n\n/** One press of Shift. */\nexport function Light({ asChild, ...props }: LightProps) {\n const Element = asChild ? Slot : 'div';\n // The element owns `data-on` and its classes.\n return <Element data-exit-this-page-light=\"\" suppressHydrationWarning {...props} />;\n}\n\nexport type StatusProps = PartProps<'span'>;\n\n/** Tells screen readers how many more presses are needed. Make it visually hidden. */\nexport function Status({ asChild, children, ...props }: StatusProps) {\n const Element = asChild ? Slot : 'span';\n // The element owns its text. A string child, even an empty one, is hydrated as text, so text the\n // element set before hydration is kept rather than being a mismatch.\n return (\n <Element data-exit-this-page-status=\"\" role=\"status\" suppressHydrationWarning {...props}>\n {children ?? ''}\n </Element>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAY,WAAW;AAmChB,SAAS,KAAK;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAc;AACZ,SAAa,oBAAc,SAAS;AAAA,IAClC,GAAG;AAAA,IACH,WAAW;AAAA,IACX,aAAa;AAAA,IACb,wBAAwB;AAAA,IACxB,uBAAuB;AAAA,IACvB,2BAA2B;AAAA,IAC3B,kBAAkB;AAAA,IAClB,sBAAsB;AAAA,IACtB,iBAAiB;AAAA;AAAA,IAEjB,0BAA0B;AAAA,EAC5B,CAAC;AACH;AAUO,SAAS,OAAO,EAAE,SAAS,GAAG,MAAM,GAAgB;AACzD,QAAM,UAAU,UAAU,OAAO;AACjC,SAAO,oCAAC,WAAQ,8BAA2B,IAAI,GAAG,OAAO;AAC3D;AAKO,SAAS,SAAS,EAAE,SAAS,GAAG,MAAM,GAAkB;AAC7D,QAAM,UAAU,UAAU,OAAO;AACjC,SAAO,oCAAC,WAAQ,gCAA6B,IAAI,GAAG,OAAO;AAC7D;AAKO,SAAS,UAAU,EAAE,SAAS,UAAU,GAAG,MAAM,GAAmB;AACzE,QAAM,UAAU,UAAU,OAAO;AACjC;AAAA;AAAA,IAEE,oCAAC,WAAQ,iCAA8B,IAAG,eAAY,QAAO,0BAAwB,MAAE,GAAG,SACvF,8BACC,0DACE,oCAAC,WAAM,GACP,oCAAC,WAAM,GACP,oCAAC,WAAM,CACT,CAEJ;AAAA;AAEJ;AAKO,SAAS,MAAM,EAAE,SAAS,GAAG,MAAM,GAAe;AACvD,QAAM,UAAU,UAAU,OAAO;AAEjC,SAAO,oCAAC,WAAQ,6BAA0B,IAAG,0BAAwB,MAAE,GAAG,OAAO;AACnF;AAKO,SAAS,OAAO,EAAE,SAAS,UAAU,GAAG,MAAM,GAAgB;AACnE,QAAM,UAAU,UAAU,OAAO;AAGjC,SACE,oCAAC,WAAQ,8BAA2B,IAAG,MAAK,UAAS,0BAAwB,MAAE,GAAG,SAC/E,8BAAY,EACf;AAEJ;","names":[]}