whitehall-ui 1.0.0 → 2.0.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 (145) hide show
  1. package/README.md +4 -1
  2. package/dist/{chunk-KWAC6IEK.js → chunk-2KB4IAMZ.js} +9 -22
  3. package/dist/{chunk-5TI2WXYU.js → chunk-3UX7QPLM.js} +10 -21
  4. package/dist/{chunk-SK27BMU5.js → chunk-4GQRYMDK.js} +11 -23
  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-UWQFFFTB.js → chunk-JCERRZV6.js} +13 -13
  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-LRNZYPC2.js → chunk-YF6EZ57H.js} +14 -44
  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 +9 -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 +8 -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 +207 -40
  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-NRXTKHI2.js +0 -169
  138. package/dist/chunk-PGZHPAT5.js +0 -183
  139. package/dist/chunk-RPV43YDC.js +0 -93
  140. package/dist/chunk-VQOCX44T.js +0 -41
  141. package/dist/chunk-WONVZ7WK.js +0 -29
  142. package/dist/chunk-WPPWPEFV.js +0 -150
  143. package/dist/chunk-XQOYWPKV.js +0 -48
  144. package/dist/chunk-YAKI4SI7.js +0 -205
  145. package/dist/chunk-YCLGXX3R.js +0 -68
@@ -0,0 +1,167 @@
1
+ import { cn, mergeRefs } from './chunk-GKHD33N6.js';
2
+ import { useRef, useState, useId } from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var fileUploadButtonVariants = cva(
7
+ [
8
+ "group block w-full text-left cursor-pointer appearance-none",
9
+ "font-govuk text-govuk-body text-govuk-black",
10
+ "p-govuk-file-upload sm:p-govuk-file-upload-lg",
11
+ "border-2 bg-white",
12
+ "focus:outline-3 focus:outline-govuk-yellow focus:outline-offset-0",
13
+ "focus:border-solid focus:border-govuk-black focus:bg-govuk-light-grey",
14
+ "active:border-solid",
15
+ "focus:inset-ring-2 focus:inset-ring-govuk-black",
16
+ "disabled:opacity-50 disabled:pointer-events-none"
17
+ ],
18
+ {
19
+ variants: {
20
+ empty: {
21
+ true: [
22
+ "border-dashed border-govuk-grey",
23
+ "hover:border-govuk-file-upload-hover-border hover:bg-govuk-light-grey"
24
+ ],
25
+ false: [
26
+ "border-solid border-govuk-mid-grey",
27
+ "hover:border-dashed hover:border-govuk-file-upload-hover-border"
28
+ ]
29
+ },
30
+ dragging: {
31
+ true: "border-solid border-govuk-black bg-govuk-light-grey"
32
+ },
33
+ error: {
34
+ true: "border-solid border-govuk-error"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ empty: true
39
+ }
40
+ }
41
+ );
42
+ var FileUpload = ({
43
+ className,
44
+ id,
45
+ disabled,
46
+ error,
47
+ chooseFileButtonText = "Choose file",
48
+ dropInstructionText = "or drop file",
49
+ noFileChosenText = "No file chosen",
50
+ onChange,
51
+ ref,
52
+ "aria-describedby": ariaDescribedBy,
53
+ ...props
54
+ }) => {
55
+ const internalRef = useRef(null);
56
+ const [fileNames, setFileNames] = useState([]);
57
+ const [dragging, setDragging] = useState(false);
58
+ const generatedId = useId();
59
+ const buttonId = id ?? generatedId;
60
+ const statusId = `${buttonId}-status`;
61
+ const empty = fileNames.length === 0;
62
+ const status = fileNames.length > 1 ? `${fileNames.length} files chosen` : fileNames[0] ?? noFileChosenText;
63
+ return /* @__PURE__ */ jsxs(
64
+ "div",
65
+ {
66
+ className: cn(
67
+ "relative block",
68
+ disabled && "cursor-not-allowed",
69
+ className
70
+ ),
71
+ children: [
72
+ /* @__PURE__ */ jsxs(
73
+ "button",
74
+ {
75
+ type: "button",
76
+ id: buttonId,
77
+ "aria-describedby": `${statusId} ${ariaDescribedBy ?? ""}`.trim(),
78
+ disabled,
79
+ onClick: () => internalRef.current?.click(),
80
+ onDragOver: (event) => event.preventDefault(),
81
+ onDragEnter: () => !disabled && setDragging(true),
82
+ onDragLeave: (event) => {
83
+ if (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) {
84
+ return;
85
+ }
86
+ setDragging(false);
87
+ },
88
+ onDrop: (event) => {
89
+ event.preventDefault();
90
+ setDragging(false);
91
+ const input = internalRef.current;
92
+ const { files } = event.dataTransfer;
93
+ if (disabled || !input || files.length === 0 || !input.multiple && files.length > 1) {
94
+ return;
95
+ }
96
+ input.files = files;
97
+ input.dispatchEvent(new Event("change", { bubbles: true }));
98
+ },
99
+ className: cn(fileUploadButtonVariants({ empty, dragging, error })),
100
+ children: [
101
+ /* @__PURE__ */ jsx(
102
+ "span",
103
+ {
104
+ id: statusId,
105
+ "aria-live": "polite",
106
+ className: cn(
107
+ "block mb-govuk-2 px-govuk-2 py-govuk-3",
108
+ "text-left wrap-break-word font-govuk text-govuk-body",
109
+ empty ? "bg-govuk-tag-blue-bg text-govuk-black" : "bg-govuk-brand text-white"
110
+ ),
111
+ children: status
112
+ }
113
+ ),
114
+ /* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-baseline", children: [
115
+ /* @__PURE__ */ jsx(
116
+ "span",
117
+ {
118
+ className: cn(
119
+ "inline-block",
120
+ "px-govuk-button-x pt-govuk-button-pt pb-govuk-button-pb",
121
+ "mr-govuk-2 mb-govuk-file-upload-pseudo-mb",
122
+ "border-2 border-transparent",
123
+ "font-govuk text-govuk-body leading-none",
124
+ "bg-govuk-light-grey text-govuk-black shadow-govuk-light-grey",
125
+ "group-hover:bg-govuk-mid-grey",
126
+ "group-focus:bg-govuk-yellow group-focus:shadow-govuk-yellow"
127
+ ),
128
+ children: chooseFileButtonText
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsx(
132
+ "span",
133
+ {
134
+ className: cn(
135
+ "inline-block mt-govuk-file-upload-instruction-mt mb-0",
136
+ "text-left font-govuk text-govuk-body text-govuk-black"
137
+ ),
138
+ children: dropInstructionText
139
+ }
140
+ )
141
+ ] })
142
+ ]
143
+ }
144
+ ),
145
+ /* @__PURE__ */ jsx(
146
+ "input",
147
+ {
148
+ ref: mergeRefs(internalRef, ref),
149
+ id: `${buttonId}-input`,
150
+ type: "file",
151
+ disabled,
152
+ hidden: true,
153
+ onChange: (event) => {
154
+ setFileNames(
155
+ Array.from(event.target.files ?? [], (file) => file.name)
156
+ );
157
+ onChange?.(event);
158
+ },
159
+ ...props
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ );
165
+ };
166
+
167
+ export { FileUpload, fileUploadButtonVariants };
@@ -1,7 +1,7 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
1
+ import { cn } from './chunk-GKHD33N6.js';
2
2
  import { Button as Button$1 } from '@base-ui/react/button';
3
3
  import { cva } from 'class-variance-authority';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
 
6
6
  var buttonVariants = cva(
7
7
  [
@@ -10,7 +10,7 @@ var buttonVariants = cva(
10
10
  "box-border",
11
11
  "px-govuk-button-x pt-govuk-button-pt pb-govuk-button-pb",
12
12
  "mb-govuk-button-bottom",
13
- "text-govuk-body font-normal",
13
+ "text-govuk-body leading-none font-normal",
14
14
  "font-govuk",
15
15
  "text-center no-underline",
16
16
  "cursor-pointer",
@@ -22,7 +22,8 @@ var buttonVariants = cva(
22
22
  "focus:not-[:active]:not-[:hover]:text-govuk-black",
23
23
  "focus:not-[:active]:not-[:hover]:shadow-govuk-yellow",
24
24
  "focus:not-[:active]:not-[:hover]:inset-ring-0",
25
- "focus:not-[:active]:not-[:hover]:border-govuk-yellow"
25
+ "focus:not-[:active]:not-[:hover]:border-govuk-yellow",
26
+ "data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed data-[disabled]:active:top-0"
26
27
  ],
27
28
  {
28
29
  variants: {
@@ -66,11 +67,10 @@ var buttonVariants = cva(
66
67
  }
67
68
  }
68
69
  );
69
- var disabledStyles = "data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed data-[disabled]:active:top-0";
70
70
  var StartIcon = () => /* @__PURE__ */ jsx(
71
71
  "svg",
72
72
  {
73
- className: "ml-govuk-1 sm:ml-govuk-2 align-middle shrink-0 self-center forced-color-adjust-auto",
73
+ className: "ml-govuk-1 md:ml-govuk-2 align-middle shrink-0 self-center forced-color-adjust-auto",
74
74
  xmlns: "http://www.w3.org/2000/svg",
75
75
  width: "17.5",
76
76
  height: "19",
@@ -83,23 +83,18 @@ var StartIcon = () => /* @__PURE__ */ jsx(
83
83
  var Button = ({
84
84
  className,
85
85
  variant = "default",
86
- disabled = false,
87
- focusableWhenDisabled = false,
88
86
  children,
89
- ref,
90
87
  ...props
91
- }) => /* @__PURE__ */ jsxs(
88
+ }) => /* @__PURE__ */ jsx(
92
89
  Button$1,
93
90
  {
94
- ref,
95
- disabled,
96
- focusableWhenDisabled,
97
- className: cn(buttonVariants({ variant }), disabledStyles, className),
91
+ type: props.nativeButton === false ? void 0 : "submit",
92
+ className: cn(buttonVariants({ variant }), className),
98
93
  ...props,
99
- children: [
100
- children,
101
- variant === "start" && /* @__PURE__ */ jsx(StartIcon, {})
102
- ]
94
+ children: variant === "start" ? /* @__PURE__ */ jsxs(Fragment, { children: [
95
+ /* @__PURE__ */ jsx("span", { children }),
96
+ /* @__PURE__ */ jsx(StartIcon, {})
97
+ ] }) : children
103
98
  }
104
99
  );
105
100
 
@@ -1,13 +1,11 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { Collapsible } from '@base-ui/react/collapsible';
1
+ import { cn } from './chunk-GKHD33N6.js';
3
2
  import { jsx, jsxs } from 'react/jsx-runtime';
4
3
 
5
- var Details = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
6
- Collapsible.Root,
4
+ var Details = ({ className, ...props }) => /* @__PURE__ */ jsx(
5
+ "details",
7
6
  {
8
- ref,
9
7
  className: cn(
10
- "mb-govuk-6 font-govuk text-govuk-body text-govuk-black",
8
+ "group/details mb-govuk-r6 font-govuk text-govuk-body text-govuk-black",
11
9
  className
12
10
  ),
13
11
  ...props
@@ -15,20 +13,19 @@ var Details = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
15
13
  );
16
14
  var DetailsSummary = ({
17
15
  className,
18
- ref,
19
16
  children,
20
17
  ...props
21
18
  }) => /* @__PURE__ */ jsxs(
22
- Collapsible.Trigger,
19
+ "summary",
23
20
  {
24
- ref,
25
21
  className: cn(
26
- "group relative w-fit cursor-pointer",
27
- "pl-govuk-4 border-none bg-transparent p-0",
28
- "font-govuk text-govuk-body text-govuk-brand",
22
+ "relative inline-block cursor-pointer",
23
+ "pl-govuk-5 group-open/details:mb-govuk-1",
24
+ "font-govuk text-govuk-body text-govuk-link",
29
25
  "underline govuk-link-underline",
30
26
  "hover:text-govuk-brand-hover hover:govuk-link-underline-hover",
31
27
  "focus:govuk-link-focus focus:no-underline",
28
+ "[&::-webkit-details-marker]:hidden",
32
29
  className
33
30
  ),
34
31
  ...props,
@@ -36,7 +33,7 @@ var DetailsSummary = ({
36
33
  /* @__PURE__ */ jsx(
37
34
  "svg",
38
35
  {
39
- className: "absolute left-0 top-0 bottom-0 my-auto shrink-0 transition-transform group-data-panel-open:rotate-90",
36
+ className: "absolute left-0 top-0 bottom-0 my-auto shrink-0 transition-transform group-open/details:rotate-90",
40
37
  xmlns: "http://www.w3.org/2000/svg",
41
38
  width: "14",
42
39
  height: "14",
@@ -44,20 +41,20 @@ var DetailsSummary = ({
44
41
  fill: "currentColor",
45
42
  "aria-hidden": "true",
46
43
  focusable: "false",
47
- children: /* @__PURE__ */ jsx("path", { d: "M3.5 1L10.5 7L3.5 13z" })
44
+ children: /* @__PURE__ */ jsx("path", { d: "M1 0l12.124 7L1 14z" })
48
45
  }
49
46
  ),
50
47
  children
51
48
  ]
52
49
  }
53
50
  );
54
- var DetailsText = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
55
- Collapsible.Panel,
51
+ var DetailsText = ({ className, ...props }) => /* @__PURE__ */ jsx(
52
+ "div",
56
53
  {
57
- ref,
58
54
  className: cn(
59
55
  "pt-govuk-3 pb-govuk-3 pl-govuk-4",
60
- "border-l-govuk-inset",
56
+ "border-l-govuk-standard border-l-govuk-mid-grey",
57
+ "[&_p]:mt-0 [&_p]:mb-govuk-4 *:last:mb-0",
61
58
  className
62
59
  ),
63
60
  ...props
@@ -0,0 +1,52 @@
1
+ import { cn } from './chunk-GKHD33N6.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ var Panel = ({
5
+ className,
6
+ variant = "confirmation",
7
+ ...props
8
+ }) => /* @__PURE__ */ jsx(
9
+ "div",
10
+ {
11
+ "data-variant": variant,
12
+ className: cn(
13
+ "group/panel font-govuk text-govuk-heading-l",
14
+ "box-border",
15
+ "mb-govuk-3 p-govuk-panel max-sm:p-govuk-3",
16
+ "border-govuk-standard border-transparent",
17
+ "text-white wrap-break-word",
18
+ variant === "interruption" ? "bg-govuk-brand text-left" : "bg-govuk-green text-center",
19
+ "[&_.govuk-button-group]:mb-0 sm:[&_.govuk-button-group]:-mb-govuk-2",
20
+ className
21
+ ),
22
+ ...props
23
+ }
24
+ );
25
+ var PanelTitle = ({ className, children, ...props }) => /* @__PURE__ */ jsx(
26
+ "h1",
27
+ {
28
+ className: cn(
29
+ "text-govuk-heading-xl font-bold",
30
+ "mt-0 mb-govuk-6 last:mb-0",
31
+ "group-data-[variant=interruption]/panel:text-govuk-heading-l",
32
+ "group-data-[variant=interruption]/panel:mb-govuk-3",
33
+ className
34
+ ),
35
+ ...props,
36
+ children
37
+ }
38
+ );
39
+ var PanelBody = ({ className, ...props }) => /* @__PURE__ */ jsx(
40
+ "div",
41
+ {
42
+ className: cn(
43
+ "text-govuk-heading-l *:last:mb-0 not-last:mb-govuk-7",
44
+ "group-data-[variant=interruption]/panel:text-govuk-body",
45
+ className
46
+ ),
47
+ ...props
48
+ }
49
+ );
50
+ var PanelActions = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("govuk-button-group", className), ...props });
51
+
52
+ export { Panel, PanelActions, PanelBody, PanelTitle };
@@ -1,91 +1,91 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { useState, useId } from 'react';
1
+ import { cn } from './chunk-GKHD33N6.js';
2
+ import { useState, useId, Children, useSyncExternalStore } from 'react';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
 
5
- var serviceNavigationLinkStyles = [
5
+ var subscribeToNothing = () => () => {
6
+ };
7
+ var useHydrated = () => useSyncExternalStore(
8
+ subscribeToNothing,
9
+ () => true,
10
+ () => false
11
+ );
12
+ var linkStyles = [
6
13
  "font-govuk cursor-pointer",
7
- "no-underline hover:underline",
8
- "hover:govuk-link-underline hover:govuk-link-underline-hover",
14
+ "no-underline hover:underline active:underline",
15
+ "govuk-link-underline hover:govuk-link-underline-hover",
9
16
  "focus:govuk-link-focus"
10
17
  ];
11
18
  var itemStyles = [
12
19
  "relative my-govuk-2",
13
- "sm:my-0 sm:inline-block sm:py-govuk-3",
20
+ "sm:my-0 sm:inline-block sm:py-govuk-3 sm:leading-govuk-service-nav",
14
21
  "sm:not-last:mr-govuk-6"
15
22
  ];
16
- var ServiceNavigation = ({
17
- className,
18
- ref,
19
- children,
20
- ...props
21
- }) => /* @__PURE__ */ jsx(
23
+ var ServiceNavigation = ({ className, ...props }) => /* @__PURE__ */ jsx(
22
24
  "section",
23
25
  {
24
- ref,
25
- "aria-label": props["aria-label"] ?? "Service information",
26
+ "aria-label": "Service information",
26
27
  className: cn(
27
28
  "font-govuk text-govuk-body text-govuk-black",
28
- "border-b border-b-govuk-mid-grey",
29
- "bg-govuk-light-grey",
29
+ "border-b border-b-govuk-surface-border",
30
+ "bg-govuk-surface",
30
31
  className
31
32
  ),
32
- ...props,
33
- children
33
+ ...props
34
34
  }
35
35
  );
36
36
  var ServiceNavigationContainer = ({
37
37
  className,
38
- ref,
39
- children,
40
38
  ...props
41
39
  }) => /* @__PURE__ */ jsx(
42
40
  "div",
43
41
  {
44
- ref,
45
42
  className: cn(
46
- "max-w-240 mx-auto px-govuk-3",
43
+ "govuk-width-container",
47
44
  "flex flex-col items-start",
48
45
  "sm:flex-row sm:flex-wrap",
49
46
  className
50
47
  ),
51
- ...props,
52
- children
48
+ ...props
53
49
  }
54
50
  );
55
51
  var ServiceNavigationServiceName = ({
56
52
  className,
57
- ref,
58
53
  children,
54
+ href,
59
55
  ...props
60
56
  }) => /* @__PURE__ */ jsx(
61
- "a",
57
+ "span",
62
58
  {
63
- ref,
64
- className: cn(
65
- itemStyles,
66
- "font-bold",
67
- "text-govuk-black visited:text-govuk-black hover:text-govuk-black",
68
- serviceNavigationLinkStyles,
69
- className
70
- ),
71
- ...props,
72
- children
59
+ className: cn(itemStyles, "font-bold max-sm:not-last:mb-0", className),
60
+ children: href ? /* @__PURE__ */ jsx(
61
+ "a",
62
+ {
63
+ href,
64
+ className: cn(
65
+ "text-govuk-black visited:text-govuk-black",
66
+ "hover:text-govuk-black active:text-govuk-black",
67
+ linkStyles
68
+ ),
69
+ ...props,
70
+ children
71
+ }
72
+ ) : children
73
73
  }
74
74
  );
75
75
  var ServiceNavigationNav = ({
76
76
  className,
77
- ref,
78
77
  children,
79
78
  menuButtonText = "Menu",
79
+ collapseOnMobile = Children.count(children) > 1,
80
80
  ...props
81
81
  }) => {
82
82
  const [menuOpen, setMenuOpen] = useState(false);
83
83
  const listId = useId();
84
+ const collapsible = useHydrated() && collapseOnMobile;
84
85
  return /* @__PURE__ */ jsxs(
85
86
  "nav",
86
87
  {
87
- ref,
88
- "aria-label": props["aria-label"] ?? menuButtonText,
88
+ "aria-label": menuButtonText,
89
89
  className: cn("max-sm:w-full sm:grow", className),
90
90
  ...props,
91
91
  children: [
@@ -93,12 +93,13 @@ var ServiceNavigationNav = ({
93
93
  "button",
94
94
  {
95
95
  type: "button",
96
+ hidden: !collapsible,
96
97
  className: cn(
97
98
  "sm:hidden inline-flex items-center gap-govuk-1",
98
99
  "my-govuk-2 p-0",
99
100
  "font-govuk text-govuk-body font-bold",
100
- "bg-transparent border-0 text-govuk-brand cursor-pointer",
101
- "hover:underline focus:govuk-link-focus"
101
+ "bg-transparent border-0 text-govuk-link cursor-pointer",
102
+ "focus:govuk-link-focus"
102
103
  ),
103
104
  onClick: () => setMenuOpen((prev) => !prev),
104
105
  "aria-expanded": menuOpen,
@@ -127,7 +128,7 @@ var ServiceNavigationNav = ({
127
128
  className: cn(
128
129
  "list-none m-0 mb-govuk-3 p-0",
129
130
  "sm:flex sm:flex-wrap sm:mb-0",
130
- menuOpen ? "max-sm:block" : "max-sm:hidden"
131
+ collapsible && !menuOpen && "max-sm:hidden"
131
132
  ),
132
133
  children
133
134
  }
@@ -139,38 +140,33 @@ var ServiceNavigationNav = ({
139
140
  var ServiceNavigationItem = ({
140
141
  className,
141
142
  active,
142
- ref,
143
- children,
144
143
  ...props
145
144
  }) => /* @__PURE__ */ jsx(
146
145
  "li",
147
146
  {
148
- ref,
149
147
  className: cn(
150
148
  itemStyles,
151
- "border-govuk-brand",
149
+ "border-govuk-link",
152
150
  active && [
153
151
  "max-sm:-ml-govuk-3 max-sm:pl-govuk-2 max-sm:border-l-govuk-standard",
154
152
  "sm:border-b-govuk-standard sm:pb-govuk-2"
155
153
  ],
156
154
  className
157
155
  ),
158
- ...props,
159
- children
156
+ ...props
160
157
  }
161
158
  );
162
159
  var ServiceNavigationLink = ({
163
160
  className,
164
- ref,
165
161
  children,
166
162
  ...props
167
163
  }) => /* @__PURE__ */ jsx(
168
164
  "a",
169
165
  {
170
- ref,
171
166
  className: cn(
172
- "text-govuk-brand visited:text-govuk-brand hover:text-govuk-brand-hover",
173
- serviceNavigationLinkStyles,
167
+ "text-govuk-link visited:text-govuk-link",
168
+ "hover:text-govuk-brand-hover active:text-govuk-black",
169
+ linkStyles,
174
170
  className
175
171
  ),
176
172
  ...props,
@@ -1,4 +1,4 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
1
+ import { cn } from './chunk-GKHD33N6.js';
2
2
  import { cva } from 'class-variance-authority';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -19,29 +19,19 @@ var fieldsetLegendVariants = cva(
19
19
  m: "text-govuk-heading-m font-bold mb-govuk-3",
20
20
  s: "text-govuk-body font-bold mb-govuk-2"
21
21
  }
22
- },
23
- defaultVariants: {
24
- size: void 0
25
22
  }
26
23
  }
27
24
  );
28
- var Fieldset = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
25
+ var Fieldset = ({ className, ...props }) => /* @__PURE__ */ jsx(
29
26
  "fieldset",
30
27
  {
31
- ref,
32
28
  className: cn("min-w-0 m-0 p-0 border-0", className),
33
29
  ...props
34
30
  }
35
31
  );
36
- var FieldsetLegend = ({
37
- className,
38
- size,
39
- ref,
40
- ...props
41
- }) => /* @__PURE__ */ jsx(
32
+ var FieldsetLegend = ({ className, size, ...props }) => /* @__PURE__ */ jsx(
42
33
  "legend",
43
34
  {
44
- ref,
45
35
  className: cn(
46
36
  fieldsetLegendVariants({ size }),
47
37
  !size && "text-govuk-body mb-govuk-2",
@@ -53,14 +43,14 @@ var FieldsetLegend = ({
53
43
  var FieldsetHeading = ({
54
44
  as: Tag = "h1",
55
45
  className,
56
- ref,
46
+ children,
57
47
  ...props
58
48
  }) => /* @__PURE__ */ jsx(
59
49
  Tag,
60
50
  {
61
- ref,
62
51
  className: cn("m-0 text-[length:inherit] font-[weight:inherit]", className),
63
- ...props
52
+ ...props,
53
+ children
64
54
  }
65
55
  );
66
56
 
@@ -0,0 +1,38 @@
1
+ import { cn } from './chunk-GKHD33N6.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ var Feedback = ({ className, children, ...props }) => /* @__PURE__ */ jsx(
5
+ "div",
6
+ {
7
+ className: cn(
8
+ "box-border max-w-240 mx-0 sm:mx-govuk-6 min-[1020px]:mx-auto",
9
+ "pt-govuk-4 pb-govuk-5 px-govuk-3 sm:px-govuk-4",
10
+ "border-t border-govuk-brand bg-govuk-surface",
11
+ "font-govuk text-govuk-body text-govuk-black",
12
+ "print:border-current print:bg-transparent",
13
+ className
14
+ ),
15
+ ...props,
16
+ children: /* @__PURE__ */ jsx("div", { className: "sm:w-2/3", children })
17
+ }
18
+ );
19
+ var FeedbackTitle = ({
20
+ as: Tag = "h2",
21
+ className,
22
+ children,
23
+ ...props
24
+ }) => /* @__PURE__ */ jsx(
25
+ Tag,
26
+ {
27
+ className: cn(
28
+ "text-govuk-heading-m font-bold text-govuk-black",
29
+ "mt-0 mb-govuk-1",
30
+ className
31
+ ),
32
+ ...props,
33
+ children
34
+ }
35
+ );
36
+ var FeedbackBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("*:last:mb-0", className), ...props });
37
+
38
+ export { Feedback, FeedbackBody, FeedbackTitle };