whitehall-ui 1.0.0 → 2.1.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 (148) hide show
  1. package/README.md +13 -3
  2. package/dist/{chunk-KWAC6IEK.js → chunk-2KB4IAMZ.js} +9 -22
  3. package/dist/chunk-3NOO2YUQ.js +139 -0
  4. package/dist/{chunk-5TI2WXYU.js → chunk-3UX7QPLM.js} +10 -21
  5. package/dist/{chunk-OP35ZJ4X.js → chunk-4TBXH62Z.js} +6 -7
  6. package/dist/{chunk-M6CLPMRP.js → chunk-6WLHJ5MN.js} +34 -76
  7. package/dist/chunk-7IOR7UNU.js +77 -0
  8. package/dist/chunk-7Q2C5RB7.js +167 -0
  9. package/dist/{chunk-5PIQJ22R.js → chunk-ASBIQC77.js} +13 -18
  10. package/dist/{chunk-KD4LPFIZ.js → chunk-C2YQVLZ7.js} +15 -18
  11. package/dist/chunk-CBT6WCJ7.js +52 -0
  12. package/dist/{chunk-3YIKJK6M.js → chunk-CYBPAHLZ.js} +48 -52
  13. package/dist/{chunk-VB6V3PHD.js → chunk-D2T6BUOB.js} +6 -16
  14. package/dist/chunk-DZ3743JO.js +38 -0
  15. package/dist/{chunk-AO6HPG4R.js → chunk-EDOSCND4.js} +5 -20
  16. package/dist/chunk-FJHNUBEM.js +59 -0
  17. package/dist/chunk-FVBDMMNR.js +143 -0
  18. package/dist/chunk-GKHD33N6.js +52 -0
  19. package/dist/{chunk-3INCIYDO.js → chunk-GLDCEDTR.js} +22 -77
  20. package/dist/{chunk-G6T44BDV.js → chunk-HBLVAX45.js} +7 -11
  21. package/dist/chunk-JU7A7KQI.js +152 -0
  22. package/dist/chunk-KXQGZLMK.js +120 -0
  23. package/dist/{chunk-CEPBVMFU.js → chunk-MFI5R2TJ.js} +1 -3
  24. package/dist/{chunk-5XNKIBMP.js → chunk-MYMVHSRJ.js} +3 -4
  25. package/dist/chunk-N5PY3VZH.js +192 -0
  26. package/dist/{chunk-P4GCF5FQ.js → chunk-OQILIT3B.js} +26 -15
  27. package/dist/{chunk-6VXVJERU.js → chunk-QKR7NELW.js} +4 -8
  28. package/dist/chunk-QPN5J5IU.js +177 -0
  29. package/dist/chunk-RGXB6M3G.js +87 -0
  30. package/dist/chunk-TAVSU2XB.js +90 -0
  31. package/dist/chunk-TGNN5ZP3.js +81 -0
  32. package/dist/chunk-TICBCBDN.js +18 -0
  33. package/dist/{chunk-7ZCZQN5N.js → chunk-UK7RLSTJ.js} +15 -22
  34. package/dist/chunk-UXOJELVU.js +37 -0
  35. package/dist/{chunk-QTSEOPVX.js → chunk-VCJE5UO2.js} +23 -25
  36. package/dist/{chunk-N67H5OUQ.js → chunk-VHSAXVCF.js} +7 -5
  37. package/dist/chunk-VMI2XU5D.js +74 -0
  38. package/dist/{chunk-TXGBUZB4.js → chunk-VRGDQ3SF.js} +3 -10
  39. package/dist/chunk-W4CWUYTA.js +44 -0
  40. package/dist/chunk-YMQVN3MH.js +100 -0
  41. package/dist/chunk-ZAKQHDVD.js +40 -0
  42. package/dist/chunk-ZJB7BBTN.js +188 -0
  43. package/dist/index.d.ts +15 -13
  44. package/dist/index.js +41 -39
  45. package/dist/lib/utils.d.ts +2 -1
  46. package/dist/lib/utils.js +1 -1
  47. package/dist/ui/accordion.d.ts +8 -13
  48. package/dist/ui/accordion.js +2 -2
  49. package/dist/ui/back-link.d.ts +4 -4
  50. package/dist/ui/back-link.js +2 -2
  51. package/dist/ui/breadcrumbs.d.ts +10 -16
  52. package/dist/ui/breadcrumbs.js +2 -2
  53. package/dist/ui/button.d.ts +7 -8
  54. package/dist/ui/button.js +2 -2
  55. package/dist/ui/character-count.d.ts +11 -15
  56. package/dist/ui/character-count.js +3 -3
  57. package/dist/ui/checkboxes.d.ts +10 -17
  58. package/dist/ui/checkboxes.js +2 -2
  59. package/dist/ui/cookie-banner.d.ts +12 -21
  60. package/dist/ui/cookie-banner.js +2 -2
  61. package/dist/ui/date-input.d.ts +10 -16
  62. package/dist/ui/date-input.js +2 -2
  63. package/dist/ui/details.d.ts +8 -17
  64. package/dist/ui/details.js +2 -2
  65. package/dist/ui/error-message.d.ts +4 -4
  66. package/dist/ui/error-message.js +2 -2
  67. package/dist/ui/error-summary.d.ts +5 -4
  68. package/dist/ui/error-summary.js +2 -2
  69. package/dist/ui/exit-this-page.d.ts +4 -4
  70. package/dist/ui/exit-this-page.js +3 -3
  71. package/dist/ui/feedback.d.ts +13 -0
  72. package/dist/ui/feedback.js +2 -0
  73. package/dist/ui/fieldset.d.ts +9 -13
  74. package/dist/ui/fieldset.js +2 -2
  75. package/dist/ui/file-upload.d.ts +4 -5
  76. package/dist/ui/file-upload.js +2 -2
  77. package/dist/ui/footer.d.ts +39 -50
  78. package/dist/ui/footer.js +2 -2
  79. package/dist/ui/generic-header.d.ts +10 -15
  80. package/dist/ui/generic-header.js +2 -2
  81. package/dist/ui/header.d.ts +14 -32
  82. package/dist/ui/header.js +2 -2
  83. package/dist/ui/hint.d.ts +4 -5
  84. package/dist/ui/hint.js +2 -2
  85. package/dist/ui/inset-text.d.ts +4 -5
  86. package/dist/ui/inset-text.js +2 -2
  87. package/dist/ui/label.d.ts +7 -9
  88. package/dist/ui/label.js +2 -2
  89. package/dist/ui/language-navigation.d.ts +20 -0
  90. package/dist/ui/language-navigation.js +2 -0
  91. package/dist/ui/link.d.ts +5 -6
  92. package/dist/ui/link.js +2 -2
  93. package/dist/ui/notification-banner.d.ts +15 -24
  94. package/dist/ui/notification-banner.js +2 -2
  95. package/dist/ui/pagination.d.ts +20 -34
  96. package/dist/ui/pagination.js +2 -2
  97. package/dist/ui/panel.d.ts +11 -12
  98. package/dist/ui/panel.js +2 -2
  99. package/dist/ui/password-input.d.ts +7 -6
  100. package/dist/ui/password-input.js +4 -4
  101. package/dist/ui/phase-banner.d.ts +10 -17
  102. package/dist/ui/phase-banner.js +2 -2
  103. package/dist/ui/radios.d.ts +9 -13
  104. package/dist/ui/radios.js +2 -2
  105. package/dist/ui/select.d.ts +6 -30
  106. package/dist/ui/select.js +2 -2
  107. package/dist/ui/service-navigation.d.ts +15 -23
  108. package/dist/ui/service-navigation.js +2 -2
  109. package/dist/ui/skip-link.d.ts +4 -5
  110. package/dist/ui/skip-link.js +2 -2
  111. package/dist/ui/summary-list.d.ts +24 -41
  112. package/dist/ui/summary-list.js +2 -2
  113. package/dist/ui/table.d.ts +21 -26
  114. package/dist/ui/table.js +2 -2
  115. package/dist/ui/tabs.d.ts +7 -9
  116. package/dist/ui/tabs.js +2 -2
  117. package/dist/ui/tag.d.ts +4 -6
  118. package/dist/ui/tag.js +2 -2
  119. package/dist/ui/task-list.d.ts +14 -23
  120. package/dist/ui/task-list.js +2 -2
  121. package/dist/ui/text-input.d.ts +5 -6
  122. package/dist/ui/text-input.js +2 -2
  123. package/dist/ui/textarea.d.ts +4 -6
  124. package/dist/ui/textarea.js +2 -2
  125. package/dist/ui/warning-text.d.ts +4 -4
  126. package/dist/ui/warning-text.js +2 -2
  127. package/package.json +111 -263
  128. package/registry/default/theme/govuk-tokens.css +208 -41
  129. package/dist/chunk-2QKZ6DPC.js +0 -27
  130. package/dist/chunk-4MXR4WNS.js +0 -17
  131. package/dist/chunk-5AKGRLG2.js +0 -190
  132. package/dist/chunk-5H55YDJS.js +0 -69
  133. package/dist/chunk-72PH2FMG.js +0 -180
  134. package/dist/chunk-GUZIKVAE.js +0 -119
  135. package/dist/chunk-JESMK3XK.js +0 -105
  136. package/dist/chunk-JFZN5XP6.js +0 -88
  137. package/dist/chunk-LRNZYPC2.js +0 -107
  138. package/dist/chunk-NRXTKHI2.js +0 -169
  139. package/dist/chunk-PGZHPAT5.js +0 -183
  140. package/dist/chunk-RPV43YDC.js +0 -93
  141. package/dist/chunk-SK27BMU5.js +0 -140
  142. package/dist/chunk-UWQFFFTB.js +0 -136
  143. package/dist/chunk-VQOCX44T.js +0 -41
  144. package/dist/chunk-WONVZ7WK.js +0 -29
  145. package/dist/chunk-WPPWPEFV.js +0 -150
  146. package/dist/chunk-XQOYWPKV.js +0 -48
  147. package/dist/chunk-YAKI4SI7.js +0 -205
  148. package/dist/chunk-YCLGXX3R.js +0 -68
@@ -1,169 +0,0 @@
1
- import { buttonVariants } from './chunk-5PIQJ22R.js';
2
- import { cn } from './chunk-WONVZ7WK.js';
3
- import { useState, useRef, useEffect } from 'react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
-
6
- var REQUIRED_PRESSES = 3;
7
- var TIMEOUT_MS = 5e3;
8
- var indicatorStyles = [
9
- "p-govuk-2 pb-0 pointer-events-none text-center"
10
- ];
11
- var dotStyles = [
12
- "inline-block box-border rounded-full",
13
- "w-govuk-exit-page-dot h-govuk-exit-page-dot",
14
- "mx-govuk-exit-page-dot-gap",
15
- "border-2 border-solid border-current"
16
- ];
17
- var ExitThisPage = ({
18
- className,
19
- redirectUrl = "https://www.bbc.co.uk/weather",
20
- text = "Exit this page",
21
- activatedText = "Loading.",
22
- timedOutText = "Exit this page expired.",
23
- pressTwoMoreTimesText = "Shift, press 2 more times to exit.",
24
- pressOneMoreTimeText = "Shift, press 1 more time to exit.",
25
- ref,
26
- ...props
27
- }) => {
28
- const [keypressCount, setKeypressCount] = useState(0);
29
- const [announcement, setAnnouncement] = useState("");
30
- const [activated, setActivated] = useState(false);
31
- const countRef = useRef(0);
32
- const lastKeyModifiedRef = useRef(false);
33
- const keypressTimeoutRef = useRef(null);
34
- const messageTimeoutRef = useRef(null);
35
- const exitPage = () => {
36
- setAnnouncement("");
37
- setActivated(true);
38
- globalThis.location.assign(redirectUrl);
39
- };
40
- const handleClick = (event) => {
41
- event.preventDefault();
42
- exitPage();
43
- };
44
- useEffect(() => {
45
- const clearKeypressTimer = () => {
46
- if (keypressTimeoutRef.current !== null) {
47
- globalThis.clearTimeout(keypressTimeoutRef.current);
48
- keypressTimeoutRef.current = null;
49
- }
50
- };
51
- const resetKeypressTimer = () => {
52
- clearKeypressTimer();
53
- countRef.current = 0;
54
- setKeypressCount(0);
55
- setAnnouncement(timedOutText);
56
- if (messageTimeoutRef.current !== null) {
57
- globalThis.clearTimeout(messageTimeoutRef.current);
58
- }
59
- messageTimeoutRef.current = globalThis.setTimeout(() => {
60
- setAnnouncement("");
61
- }, TIMEOUT_MS);
62
- };
63
- const setKeypressTimer = () => {
64
- clearKeypressTimer();
65
- keypressTimeoutRef.current = globalThis.setTimeout(
66
- resetKeypressTimer,
67
- TIMEOUT_MS
68
- );
69
- };
70
- const handleKeyup = (event) => {
71
- if (event.key === "Shift" && !lastKeyModifiedRef.current) {
72
- countRef.current += 1;
73
- setKeypressCount(countRef.current);
74
- if (messageTimeoutRef.current !== null) {
75
- globalThis.clearTimeout(messageTimeoutRef.current);
76
- messageTimeoutRef.current = null;
77
- }
78
- if (countRef.current >= REQUIRED_PRESSES) {
79
- countRef.current = 0;
80
- clearKeypressTimer();
81
- exitPage();
82
- } else {
83
- setAnnouncement(
84
- countRef.current === 1 ? pressTwoMoreTimesText : pressOneMoreTimeText
85
- );
86
- setKeypressTimer();
87
- }
88
- } else if (keypressTimeoutRef.current !== null) {
89
- resetKeypressTimer();
90
- }
91
- lastKeyModifiedRef.current = event.shiftKey;
92
- };
93
- document.addEventListener("keyup", handleKeyup, true);
94
- return () => {
95
- document.removeEventListener("keyup", handleKeyup, true);
96
- clearKeypressTimer();
97
- if (messageTimeoutRef.current !== null) {
98
- globalThis.clearTimeout(messageTimeoutRef.current);
99
- }
100
- };
101
- }, [
102
- redirectUrl,
103
- timedOutText,
104
- pressTwoMoreTimesText,
105
- pressOneMoreTimeText
106
- ]);
107
- return /* @__PURE__ */ jsxs(
108
- "div",
109
- {
110
- ref,
111
- className: cn(
112
- "block sm:inline-block",
113
- "sticky top-0 left-0 z-govuk-exit-page w-full",
114
- "mb-govuk-8",
115
- "sm:right-0 sm:left-auto sm:w-auto sm:float-right",
116
- "print:hidden",
117
- className
118
- ),
119
- ...props,
120
- children: [
121
- /* @__PURE__ */ jsxs(
122
- "a",
123
- {
124
- href: redirectUrl,
125
- rel: "nofollow noreferrer",
126
- onClick: handleClick,
127
- className: cn(
128
- buttonVariants({ variant: "warning" }),
129
- "mb-0 max-sm:w-full"
130
- ),
131
- children: [
132
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Emergency" }),
133
- " ",
134
- text,
135
- /* @__PURE__ */ jsx(
136
- "span",
137
- {
138
- "aria-hidden": "true",
139
- className: cn(indicatorStyles, keypressCount > 0 ? "block" : "hidden"),
140
- children: [0, 1, 2].map((index) => /* @__PURE__ */ jsx(
141
- "span",
142
- {
143
- className: cn(
144
- dotStyles,
145
- index < keypressCount && "border-govuk-exit-page-dot"
146
- )
147
- },
148
- index
149
- ))
150
- }
151
- )
152
- ]
153
- }
154
- ),
155
- /* @__PURE__ */ jsx("output", { className: "sr-only", children: announcement }),
156
- activated && /* @__PURE__ */ jsx(
157
- "div",
158
- {
159
- role: "alert",
160
- className: "fixed inset-0 z-govuk-exit-page-overlay bg-govuk-canvas text-govuk-canvas-text",
161
- children: activatedText
162
- }
163
- )
164
- ]
165
- }
166
- );
167
- };
168
-
169
- export { ExitThisPage };
@@ -1,183 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
3
- import { useState, useCallback } from 'react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
-
6
- var Accordion = ({
7
- className,
8
- ref,
9
- children,
10
- showAllSections,
11
- defaultValue,
12
- ...props
13
- }) => {
14
- const [openSections, setOpenSections] = useState(
15
- defaultValue ?? []
16
- );
17
- const allOpen = showAllSections !== void 0 && showAllSections.length > 0 && showAllSections.every((v) => openSections.includes(v));
18
- const handleToggleAll = useCallback(() => {
19
- if (allOpen) {
20
- setOpenSections([]);
21
- } else {
22
- setOpenSections(showAllSections ?? []);
23
- }
24
- }, [allOpen, showAllSections]);
25
- return /* @__PURE__ */ jsxs(
26
- Accordion$1.Root,
27
- {
28
- ref,
29
- multiple: true,
30
- value: openSections,
31
- onValueChange: setOpenSections,
32
- className: cn(
33
- "mb-govuk-6 font-govuk text-govuk-body text-govuk-black",
34
- "border-b border-govuk-mid-grey",
35
- className
36
- ),
37
- ...props,
38
- children: [
39
- showAllSections && /* @__PURE__ */ jsx("div", { className: "pb-govuk-1", children: /* @__PURE__ */ jsxs(
40
- "button",
41
- {
42
- type: "button",
43
- onClick: handleToggleAll,
44
- "aria-expanded": allOpen,
45
- className: cn(
46
- "group inline-flex items-center",
47
- "py-govuk-1 border-0 bg-transparent cursor-pointer",
48
- "font-govuk text-govuk-body text-govuk-brand",
49
- "hover:text-govuk-black hover:bg-govuk-light-grey",
50
- "focus-visible:govuk-link-focus focus-visible:outline-none"
51
- ),
52
- children: [
53
- /* @__PURE__ */ jsxs(
54
- "svg",
55
- {
56
- className: cn(
57
- "transition-transform",
58
- allOpen ? "" : "rotate-180"
59
- ),
60
- xmlns: "http://www.w3.org/2000/svg",
61
- width: "18",
62
- height: "18",
63
- viewBox: "0 0 20 20",
64
- "aria-hidden": "true",
65
- focusable: "false",
66
- children: [
67
- /* @__PURE__ */ jsx(
68
- "circle",
69
- {
70
- className: "fill-none stroke-current group-hover:fill-govuk-black group-hover:stroke-govuk-black",
71
- cx: "10",
72
- cy: "10",
73
- r: "9",
74
- strokeWidth: "1"
75
- }
76
- ),
77
- /* @__PURE__ */ jsx(
78
- "polyline",
79
- {
80
- className: "fill-none stroke-current group-hover:stroke-govuk-light-grey",
81
- points: "6.5 8.5 10 12 13.5 8.5",
82
- strokeWidth: "2",
83
- strokeLinecap: "round",
84
- strokeLinejoin: "round"
85
- }
86
- )
87
- ]
88
- }
89
- ),
90
- /* @__PURE__ */ jsx("span", { className: "ml-govuk-1", children: allOpen ? "Hide all sections" : "Show all sections" })
91
- ]
92
- }
93
- ) }),
94
- children
95
- ]
96
- }
97
- );
98
- };
99
- var AccordionSection = ({
100
- className,
101
- ref,
102
- children,
103
- ...props
104
- }) => /* @__PURE__ */ jsx(Accordion$1.Item, { ref, className: cn(className), ...props, children });
105
- var AccordionHeading = ({
106
- className,
107
- ref,
108
- children,
109
- summary,
110
- ...props
111
- }) => /* @__PURE__ */ jsx(Accordion$1.Header, { render: /* @__PURE__ */ jsx("h2", {}), className: "m-0 p-0", children: /* @__PURE__ */ jsxs(
112
- Accordion$1.Trigger,
113
- {
114
- ref,
115
- className: cn(
116
- "group w-full",
117
- "pt-govuk-2 pb-govuk-2 govuk-accordion-button-border",
118
- "bg-transparent cursor-pointer text-left",
119
- "hover:bg-govuk-light-grey",
120
- "focus-visible:outline-none",
121
- className
122
- ),
123
- ...props,
124
- children: [
125
- /* @__PURE__ */ jsx("span", { className: "block mb-govuk-2", children: /* @__PURE__ */ jsx("span", { className: "text-govuk-heading-m font-bold text-govuk-black group-focus-visible:govuk-link-focus", children }) }),
126
- summary && /* @__PURE__ */ jsx("span", { className: "block mb-govuk-2", children: /* @__PURE__ */ jsx("span", { className: "text-govuk-body text-govuk-dark-grey group-focus-visible:govuk-link-focus", children: summary }) }),
127
- /* @__PURE__ */ jsx("span", { className: "block mb-govuk-2", children: /* @__PURE__ */ jsxs("span", { className: "group-focus-visible:govuk-link-focus inline-flex items-center text-govuk-body text-govuk-brand group-hover:text-govuk-black", children: [
128
- /* @__PURE__ */ jsxs(
129
- "svg",
130
- {
131
- className: "govuk-accordion-chevron transition-transform group-data-panel-open:rotate-180",
132
- xmlns: "http://www.w3.org/2000/svg",
133
- width: "18",
134
- height: "18",
135
- viewBox: "0 0 20 20",
136
- "aria-hidden": "true",
137
- focusable: "false",
138
- children: [
139
- /* @__PURE__ */ jsx(
140
- "circle",
141
- {
142
- className: "fill-none stroke-current group-hover:fill-govuk-black group-hover:stroke-govuk-black",
143
- cx: "10",
144
- cy: "10",
145
- r: "9",
146
- strokeWidth: "1"
147
- }
148
- ),
149
- /* @__PURE__ */ jsx(
150
- "polyline",
151
- {
152
- className: "fill-none stroke-current group-hover:stroke-govuk-light-grey",
153
- points: "6.5 8.5 10 12 13.5 8.5",
154
- strokeWidth: "2",
155
- strokeLinecap: "round",
156
- strokeLinejoin: "round"
157
- }
158
- )
159
- ]
160
- }
161
- ),
162
- /* @__PURE__ */ jsx("span", { className: "ml-govuk-1 group-data-panel-open:hidden", children: "Show" }),
163
- /* @__PURE__ */ jsx("span", { className: "ml-govuk-1 hidden group-data-panel-open:inline", children: "Hide" })
164
- ] }) })
165
- ]
166
- }
167
- ) });
168
- var AccordionContent = ({
169
- className,
170
- ref,
171
- children,
172
- ...props
173
- }) => /* @__PURE__ */ jsx(
174
- Accordion$1.Panel,
175
- {
176
- ref,
177
- className: cn("pt-govuk-3 pb-govuk-8 *:last:mb-0", className),
178
- ...props,
179
- children
180
- }
181
- );
182
-
183
- export { Accordion, AccordionContent, AccordionHeading, AccordionSection };
@@ -1,93 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- var CookieBanner = ({
5
- className,
6
- ref,
7
- children,
8
- role = "region",
9
- ...props
10
- }) => /* @__PURE__ */ jsx(
11
- "div",
12
- {
13
- ref,
14
- role,
15
- "data-nosnippet": true,
16
- className: cn(
17
- "font-govuk text-govuk-body",
18
- "pt-govuk-4",
19
- "border-b-govuk-wide border-b-transparent",
20
- "bg-govuk-light-grey",
21
- className
22
- ),
23
- ...props,
24
- children
25
- }
26
- );
27
- var CookieBannerMessage = ({
28
- className,
29
- ref,
30
- children,
31
- ...props
32
- }) => /* @__PURE__ */ jsx(
33
- "div",
34
- {
35
- ref,
36
- className: cn("max-w-240 mx-auto px-govuk-3", "-mb-govuk-2", className),
37
- ...props,
38
- children
39
- }
40
- );
41
- var CookieBannerContent = ({
42
- className,
43
- ref,
44
- children,
45
- ...props
46
- }) => /* @__PURE__ */ jsx(
47
- "div",
48
- {
49
- ref,
50
- className: cn("sm:w-2/3", "mb-govuk-3", "*:last:mb-0", className),
51
- ...props,
52
- children
53
- }
54
- );
55
- var CookieBannerHeading = ({
56
- className,
57
- ref,
58
- children,
59
- ...props
60
- }) => /* @__PURE__ */ jsx(
61
- "h2",
62
- {
63
- ref,
64
- className: cn(
65
- "text-govuk-heading-m font-bold text-govuk-black",
66
- "m-0 mb-govuk-3",
67
- className
68
- ),
69
- ...props,
70
- children
71
- }
72
- );
73
- var CookieBannerActions = ({
74
- className,
75
- ref,
76
- children,
77
- ...props
78
- }) => /* @__PURE__ */ jsx(
79
- "div",
80
- {
81
- ref,
82
- className: cn(
83
- "flex flex-col items-start",
84
- "sm:flex-row sm:flex-wrap sm:items-baseline",
85
- "gap-govuk-3",
86
- className
87
- ),
88
- ...props,
89
- children
90
- }
91
- );
92
-
93
- export { CookieBanner, CookieBannerActions, CookieBannerContent, CookieBannerHeading, CookieBannerMessage };
@@ -1,140 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { useId } from 'react';
3
- import { RadioGroup } from '@base-ui/react/radio-group';
4
- import { Radio } from '@base-ui/react/radio';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
-
7
- var Radios = ({
8
- className,
9
- inline = false,
10
- children,
11
- ...props
12
- }) => /* @__PURE__ */ jsx(
13
- RadioGroup,
14
- {
15
- className: cn(
16
- inline && "sm:flex sm:flex-wrap sm:items-start sm:gap-x-5",
17
- className
18
- ),
19
- ...props,
20
- children
21
- }
22
- );
23
- var RadiosItem = ({
24
- className,
25
- children,
26
- value,
27
- ...props
28
- }) => {
29
- const labelId = useId();
30
- return /* @__PURE__ */ jsxs(
31
- "label",
32
- {
33
- className: cn(
34
- "flex flex-wrap items-start",
35
- "relative",
36
- "mb-2.5 last:mb-0",
37
- "cursor-pointer",
38
- className
39
- ),
40
- children: [
41
- /* @__PURE__ */ jsxs(
42
- Radio.Root,
43
- {
44
- value,
45
- "aria-labelledby": labelId,
46
- className: cn(
47
- "group/radio",
48
- "relative flex-none",
49
- "w-govuk-radio-touch-target h-govuk-radio-touch-target",
50
- "cursor-pointer outline-none",
51
- "data-disabled:cursor-not-allowed data-disabled:opacity-50"
52
- ),
53
- ...props,
54
- children: [
55
- /* @__PURE__ */ jsx(
56
- "span",
57
- {
58
- "aria-hidden": "true",
59
- className: cn(
60
- "absolute box-border",
61
- "top-[calc(var(--spacing-govuk-radio-gutter)/2)] left-[calc(var(--spacing-govuk-radio-gutter)/2)]",
62
- "w-govuk-radio-size h-govuk-radio-size",
63
- "rounded-full",
64
- "border-2 border-current bg-transparent",
65
- "group-focus/radio:border-4",
66
- "group-focus/radio:shadow-[0_0_0_var(--spacing-govuk-radio-focus-width)_var(--color-govuk-yellow)]",
67
- "group-focus/radio:outline-govuk-radio-focus-width group-focus/radio:outline-transparent group-focus/radio:outline-offset-1"
68
- )
69
- }
70
- ),
71
- /* @__PURE__ */ jsx(
72
- Radio.Indicator,
73
- {
74
- keepMounted: true,
75
- className: cn(
76
- "absolute",
77
- "top-[calc(var(--spacing-govuk-radio-touch-target)/2-var(--spacing-govuk-radio-dot))]",
78
- "left-[calc(var(--spacing-govuk-radio-touch-target)/2-var(--spacing-govuk-radio-dot))]",
79
- "w-0 h-0",
80
- "rounded-full",
81
- "border-(length:--spacing-govuk-radio-dot) border-current",
82
- "bg-current",
83
- "opacity-0 data-checked:opacity-100"
84
- )
85
- }
86
- )
87
- ]
88
- }
89
- ),
90
- /* @__PURE__ */ jsx(
91
- "span",
92
- {
93
- id: labelId,
94
- className: cn(
95
- "self-center",
96
- "py-govuk-button-pb px-govuk-radio-label-padding-x",
97
- "text-govuk-tag font-normal font-govuk",
98
- "cursor-pointer"
99
- ),
100
- children
101
- }
102
- )
103
- ]
104
- }
105
- );
106
- };
107
- var RadiosHint = ({ className, ...props }) => /* @__PURE__ */ jsx(
108
- "span",
109
- {
110
- className: cn(
111
- "block w-full",
112
- "-mt-govuk-1",
113
- "pr-govuk-radio-label-padding-x",
114
- "pl-[calc(var(--spacing-govuk-radio-label-padding-x)+var(--spacing-govuk-radio-touch-target))]",
115
- "text-govuk-tag font-normal font-govuk text-govuk-dark-grey",
116
- className
117
- ),
118
- ...props
119
- }
120
- );
121
- var RadiosDivider = ({
122
- className,
123
- children = "or",
124
- ...props
125
- }) => /* @__PURE__ */ jsx(
126
- "div",
127
- {
128
- className: cn(
129
- "w-govuk-radio-size",
130
- "mb-2.5",
131
- "text-govuk-tag font-normal font-govuk text-govuk-black",
132
- "text-center",
133
- className
134
- ),
135
- ...props,
136
- children
137
- }
138
- );
139
-
140
- export { Radios, RadiosDivider, RadiosHint, RadiosItem };