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,136 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { useId } from 'react';
3
- import { Checkbox } from '@base-ui/react/checkbox';
4
- import { CheckboxGroup } from '@base-ui/react/checkbox-group';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
-
7
- var Checkboxes = ({ className, children, ...props }) => /* @__PURE__ */ jsx(CheckboxGroup, { className: cn(className), ...props, children });
8
- var CheckboxesItem = ({
9
- className,
10
- children,
11
- value,
12
- small = false,
13
- ...props
14
- }) => {
15
- const labelId = useId();
16
- return /* @__PURE__ */ jsxs(
17
- "label",
18
- {
19
- className: cn(
20
- "flex flex-wrap items-start",
21
- "relative",
22
- small ? "group/item mb-0" : "mb-2.5 last:mb-0",
23
- "cursor-pointer touch-action-manipulation",
24
- className
25
- ),
26
- children: [
27
- /* @__PURE__ */ jsxs(
28
- Checkbox.Root,
29
- {
30
- value,
31
- "aria-labelledby": labelId,
32
- className: cn(
33
- "group/checkbox",
34
- "relative flex-none",
35
- "w-govuk-checkbox-touch-target h-govuk-checkbox-touch-target",
36
- "cursor-pointer outline-none"
37
- ),
38
- ...props,
39
- children: [
40
- /* @__PURE__ */ jsx(
41
- "span",
42
- {
43
- "aria-hidden": "true",
44
- className: cn(
45
- "absolute box-border",
46
- small ? "top-govuk-checkbox-small-box-offset left-govuk-checkbox-small-box-offset w-govuk-checkbox-small-size h-govuk-checkbox-small-size" : "top-[calc(var(--spacing-govuk-checkbox-gutter)/2)] left-[calc(var(--spacing-govuk-checkbox-gutter)/2)] w-govuk-checkbox-size h-govuk-checkbox-size",
47
- "border-2 border-current bg-transparent",
48
- "govuk-checkbox-composed-shadow",
49
- "group-focus/checkbox:border-4",
50
- "group-focus/checkbox:govuk-checkbox-focus-shadow",
51
- "group-focus/checkbox:outline-3 group-focus/checkbox:outline-transparent group-focus/checkbox:outline-offset-1",
52
- small && "group-hover/item:govuk-checkbox-small-hover"
53
- )
54
- }
55
- ),
56
- /* @__PURE__ */ jsx(
57
- Checkbox.Indicator,
58
- {
59
- keepMounted: true,
60
- className: cn(
61
- "absolute box-border",
62
- small ? "top-govuk-checkbox-small-check-top left-govuk-checkbox-small-check-left w-govuk-checkbox-small-check-width h-govuk-checkbox-small-check-height govuk-checkmark-small" : "top-govuk-checkbox-check-top left-govuk-checkbox-check-left w-govuk-checkbox-check-width h-govuk-checkbox-check-height govuk-checkmark",
63
- "opacity-0 data-checked:opacity-100"
64
- )
65
- }
66
- )
67
- ]
68
- }
69
- ),
70
- /* @__PURE__ */ jsx(
71
- "span",
72
- {
73
- id: labelId,
74
- className: cn(
75
- "self-center",
76
- "py-govuk-checkbox-label-padding-y px-govuk-checkbox-label-padding-x",
77
- "text-govuk-tag font-normal font-govuk",
78
- "cursor-pointer"
79
- ),
80
- children
81
- }
82
- )
83
- ]
84
- }
85
- );
86
- };
87
- var CheckboxesHint = ({ className, ...props }) => /* @__PURE__ */ jsx(
88
- "span",
89
- {
90
- className: cn(
91
- "block w-full",
92
- "-mt-govuk-1",
93
- "pr-govuk-checkbox-label-padding-x",
94
- "pl-[calc(var(--spacing-govuk-checkbox-label-padding-x)+var(--spacing-govuk-checkbox-touch-target))]",
95
- "text-govuk-tag font-normal font-govuk text-govuk-dark-grey",
96
- className
97
- ),
98
- ...props
99
- }
100
- );
101
- var CheckboxesDivider = ({
102
- className,
103
- children = "or",
104
- small = false,
105
- ...props
106
- }) => /* @__PURE__ */ jsx(
107
- "div",
108
- {
109
- className: cn(
110
- small ? "w-govuk-checkbox-small-size mb-govuk-1" : "w-govuk-checkbox-size mb-govuk-2",
111
- "text-govuk-tag font-normal font-govuk text-govuk-black",
112
- "text-center",
113
- className
114
- ),
115
- ...props,
116
- children
117
- }
118
- );
119
- var CheckboxesConditional = ({
120
- className,
121
- ...props
122
- }) => /* @__PURE__ */ jsx(
123
- "div",
124
- {
125
- className: cn(
126
- "ml-govuk-checkbox-conditional-ml pl-govuk-checkbox-conditional-pl",
127
- "mb-5",
128
- "border-l-2 border-govuk-grey",
129
- "*:last:mb-0",
130
- className
131
- ),
132
- ...props
133
- }
134
- );
135
-
136
- export { Checkboxes, CheckboxesConditional, CheckboxesDivider, CheckboxesHint, CheckboxesItem };
@@ -1,41 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- var Panel = ({ className, ref, children, ...props }) => /* @__PURE__ */ jsx(
5
- "div",
6
- {
7
- ref,
8
- className: cn(
9
- "font-govuk text-govuk-heading-l",
10
- "box-border text-center",
11
- "mb-govuk-3 p-govuk-7 max-sm:p-govuk-4",
12
- "border-govuk-standard border-transparent",
13
- "text-white bg-govuk-green",
14
- "overflow-wrap-break-word",
15
- className
16
- ),
17
- ...props,
18
- children
19
- }
20
- );
21
- var PanelTitle = ({
22
- className,
23
- ref,
24
- children,
25
- ...props
26
- }) => /* @__PURE__ */ jsx(
27
- "h1",
28
- {
29
- ref,
30
- className: cn(
31
- "text-govuk-heading-xl font-bold",
32
- "mt-0 mb-govuk-6 last:mb-0",
33
- className
34
- ),
35
- ...props,
36
- children
37
- }
38
- );
39
- var PanelBody = ({ className, ref, children, ...props }) => /* @__PURE__ */ jsx("div", { ref, className: cn("text-govuk-heading-l", className), ...props, children });
40
-
41
- export { Panel, PanelBody, PanelTitle };
@@ -1,29 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { extendTailwindMerge } from 'tailwind-merge';
3
-
4
- // registry/default/lib/utils.ts
5
- var twMerge = extendTailwindMerge({
6
- extend: {
7
- classGroups: {
8
- "font-size": [
9
- {
10
- text: [
11
- "govuk-header",
12
- "govuk-header-link",
13
- "govuk-body",
14
- "govuk-tag",
15
- "govuk-start",
16
- "govuk-heading-xl",
17
- "govuk-heading-l",
18
- "govuk-heading-m",
19
- "govuk-warning-icon",
20
- "govuk-phase-banner"
21
- ]
22
- }
23
- ]
24
- }
25
- }
26
- });
27
- var cn = (...inputs) => twMerge(clsx(inputs));
28
-
29
- export { cn };
@@ -1,150 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { Select as Select$1 } from '@base-ui/react/select';
3
- import { cva } from 'class-variance-authority';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
-
6
- var selectTriggerVariants = cva(
7
- [
8
- "box-border",
9
- "w-full sm:w-auto max-w-full",
10
- "h-10",
11
- "py-1.25 pr-1.25 pl-2",
12
- "border-2 border-govuk-black",
13
- "rounded-none",
14
- "appearance-none",
15
- "text-govuk-body leading-tight font-normal font-govuk text-govuk-black",
16
- "bg-white",
17
- "inline-flex items-center",
18
- "cursor-pointer",
19
- "focus:outline-3 focus:outline-govuk-yellow focus:outline-offset-0",
20
- "focus:inset-ring-2 focus:inset-ring-govuk-black",
21
- "data-popup-open:outline-3 data-popup-open:outline-govuk-yellow data-popup-open:outline-offset-0",
22
- "data-popup-open:inset-ring-2 data-popup-open:inset-ring-govuk-black",
23
- "data-disabled:opacity-50 data-disabled:cursor-not-allowed"
24
- ],
25
- {
26
- variants: {
27
- error: {
28
- true: "border-govuk-error focus:border-govuk-black",
29
- false: ""
30
- }
31
- },
32
- defaultVariants: {
33
- error: false
34
- }
35
- }
36
- );
37
- var Select = ({
38
- children,
39
- className,
40
- error = false,
41
- placeholder,
42
- defaultValue,
43
- value,
44
- onValueChange,
45
- disabled,
46
- name,
47
- required,
48
- items,
49
- "aria-label": ariaLabel,
50
- "aria-labelledby": ariaLabelledBy
51
- }) => /* @__PURE__ */ jsxs(
52
- Select$1.Root,
53
- {
54
- defaultValue,
55
- value,
56
- onValueChange,
57
- disabled,
58
- name,
59
- required,
60
- items,
61
- children: [
62
- /* @__PURE__ */ jsxs(
63
- Select$1.Trigger,
64
- {
65
- "aria-label": ariaLabel,
66
- "aria-labelledby": ariaLabelledBy,
67
- className: cn(selectTriggerVariants({ error }), className),
68
- children: [
69
- /* @__PURE__ */ jsxs("span", { className: "relative flex-1 text-left", children: [
70
- /* @__PURE__ */ jsx(Select$1.Value, { placeholder }),
71
- items && /* @__PURE__ */ jsx(
72
- "span",
73
- {
74
- "aria-hidden": "true",
75
- className: "invisible block h-0 overflow-hidden",
76
- children: items.map((item) => /* @__PURE__ */ jsx("span", { className: "block whitespace-nowrap", children: item.label }, item.value))
77
- }
78
- )
79
- ] }),
80
- /* @__PURE__ */ jsx(Select$1.Icon, { className: "ml-govuk-1 flex-none", children: /* @__PURE__ */ jsx(
81
- "svg",
82
- {
83
- xmlns: "http://www.w3.org/2000/svg",
84
- width: "16",
85
- height: "16",
86
- viewBox: "0 0 16 16",
87
- fill: "none",
88
- "aria-hidden": "true",
89
- children: /* @__PURE__ */ jsx("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "2" })
90
- }
91
- ) })
92
- ]
93
- }
94
- ),
95
- /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(
96
- Select$1.Positioner,
97
- {
98
- alignItemWithTrigger: false,
99
- side: "bottom",
100
- align: "start",
101
- sideOffset: -2,
102
- collisionPadding: 0,
103
- positionMethod: "fixed",
104
- className: "z-50",
105
- children: /* @__PURE__ */ jsx(
106
- Select$1.Popup,
107
- {
108
- className: cn(
109
- "w-anchor box-border",
110
- "border-2 border-govuk-black",
111
- "max-h-60 overflow-y-auto",
112
- "bg-white",
113
- "outline-none"
114
- ),
115
- children: /* @__PURE__ */ jsx(Select$1.List, { children })
116
- }
117
- )
118
- }
119
- ) })
120
- ]
121
- }
122
- );
123
- var SelectItem = ({
124
- children,
125
- className,
126
- value,
127
- label,
128
- disabled,
129
- ...props
130
- }) => /* @__PURE__ */ jsx(
131
- Select$1.Item,
132
- {
133
- value,
134
- label: label ?? (typeof children === "string" ? children : void 0),
135
- disabled,
136
- className: cn(
137
- "py-govuk-1 pr-govuk-1 pl-2",
138
- "text-govuk-body font-govuk text-govuk-black",
139
- "cursor-pointer select-none",
140
- "outline-none",
141
- "data-highlighted:bg-govuk-brand data-highlighted:text-white",
142
- "data-disabled:opacity-50 data-disabled:cursor-not-allowed",
143
- className
144
- ),
145
- ...props,
146
- children: /* @__PURE__ */ jsx(Select$1.ItemText, { children })
147
- }
148
- );
149
-
150
- export { Select, SelectItem, selectTriggerVariants };
@@ -1,48 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- var PhaseBanner = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
5
- "div",
6
- {
7
- ref,
8
- className: cn("py-govuk-2 border-b border-govuk-mid-grey", className),
9
- ...props
10
- }
11
- );
12
- var PhaseBannerContent = ({
13
- className,
14
- ref,
15
- ...props
16
- }) => /* @__PURE__ */ jsx(
17
- "p",
18
- {
19
- ref,
20
- className: cn(
21
- "table m-0 font-govuk text-govuk-phase-banner text-govuk-black",
22
- className
23
- ),
24
- ...props
25
- }
26
- );
27
- var PhaseBannerTag = ({ className, ref, ...props }) => /* @__PURE__ */ jsx(
28
- "span",
29
- {
30
- ref,
31
- className: cn("mr-govuk-3 sm:mr-govuk-2", className),
32
- ...props
33
- }
34
- );
35
- var PhaseBannerText = ({
36
- className,
37
- ref,
38
- ...props
39
- }) => /* @__PURE__ */ jsx(
40
- "span",
41
- {
42
- ref,
43
- className: cn("table-cell align-middle", className),
44
- ...props
45
- }
46
- );
47
-
48
- export { PhaseBanner, PhaseBannerContent, PhaseBannerTag, PhaseBannerText };
@@ -1,205 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- var footerLinkStyles = [
5
- "underline govuk-link-underline",
6
- "text-govuk-dark-grey visited:text-govuk-dark-grey",
7
- "hover:govuk-link-underline-hover",
8
- "focus:govuk-link-focus"
9
- ];
10
- var Footer = ({ className, children, ref, ...props }) => /* @__PURE__ */ jsx(
11
- "footer",
12
- {
13
- ref,
14
- className: cn(
15
- "font-govuk text-govuk-body text-govuk-dark-grey",
16
- "border-t-govuk-wide border-t-govuk-brand",
17
- "pt-govuk-7 sm:pt-govuk-8 pb-govuk-5 sm:pb-govuk-6",
18
- "bg-govuk-light-grey",
19
- className
20
- ),
21
- ...props,
22
- children
23
- }
24
- );
25
- var FooterContainer = ({
26
- className,
27
- fullWidth,
28
- ref,
29
- children,
30
- ...props
31
- }) => /* @__PURE__ */ jsx(
32
- "div",
33
- {
34
- ref,
35
- className: cn(
36
- fullWidth ? "px-govuk-3" : "max-w-240 mx-auto px-govuk-3",
37
- className
38
- ),
39
- ...props,
40
- children
41
- }
42
- );
43
- var FooterNavigation = ({
44
- className,
45
- ref,
46
- children,
47
- ...props
48
- }) => /* @__PURE__ */ jsx("div", { ref, className: cn(className), ...props, children });
49
- var FooterSection = ({
50
- className,
51
- width = "full",
52
- ref,
53
- children,
54
- ...props
55
- }) => {
56
- const widthClasses = {
57
- full: "w-full",
58
- "one-half": "sm:inline-block sm:w-1/2 sm:align-top",
59
- "one-third": "sm:inline-block sm:w-1/3 sm:align-top",
60
- "two-thirds": "sm:inline-block sm:w-2/3 sm:align-top"
61
- };
62
- return /* @__PURE__ */ jsx(
63
- "div",
64
- {
65
- ref,
66
- className: cn(widthClasses[width], "mb-govuk-6", className),
67
- ...props,
68
- children
69
- }
70
- );
71
- };
72
- var FooterHeading = ({
73
- className,
74
- ref,
75
- children,
76
- ...props
77
- }) => /* @__PURE__ */ jsx(
78
- "h2",
79
- {
80
- ref,
81
- className: cn(
82
- "text-govuk-heading-m font-bold text-govuk-black",
83
- "mb-govuk-6 pb-govuk-4 sm:pb-govuk-2",
84
- "border-b border-govuk-mid-grey",
85
- className
86
- ),
87
- ...props,
88
- children
89
- }
90
- );
91
- var FooterList = ({
92
- className,
93
- columns = 1,
94
- ref,
95
- children,
96
- ...props
97
- }) => /* @__PURE__ */ jsx(
98
- "ul",
99
- {
100
- ref,
101
- className: cn(
102
- "list-none m-0 p-0",
103
- "gap-x-govuk-6",
104
- columns === 2 && "sm:columns-2",
105
- columns === 3 && "sm:columns-3",
106
- className
107
- ),
108
- ...props,
109
- children
110
- }
111
- );
112
- var FooterListItem = ({
113
- className,
114
- ref,
115
- children,
116
- ...props
117
- }) => /* @__PURE__ */ jsx(
118
- "li",
119
- {
120
- ref,
121
- className: cn("mb-govuk-3 sm:mb-govuk-4", "last:mb-0", className),
122
- ...props,
123
- children
124
- }
125
- );
126
- var FooterLink = ({
127
- className,
128
- ref,
129
- children,
130
- ...props
131
- }) => /* @__PURE__ */ jsx("a", { ref, className: cn(footerLinkStyles, className), ...props, children });
132
- var FooterSectionBreak = () => /* @__PURE__ */ jsx("hr", { className: "m-0 mb-govuk-6 sm:mb-govuk-8 border-0 border-b border-govuk-mid-grey" });
133
- var FooterMeta = ({
134
- className,
135
- ref,
136
- children,
137
- ...props
138
- }) => /* @__PURE__ */ jsx(
139
- "div",
140
- {
141
- ref,
142
- className: cn("flex flex-wrap items-end justify-center", className),
143
- ...props,
144
- children
145
- }
146
- );
147
- var FooterMetaItem = ({
148
- className,
149
- grow,
150
- ref,
151
- children,
152
- ...props
153
- }) => /* @__PURE__ */ jsx(
154
- "div",
155
- {
156
- ref,
157
- className: cn("mb-govuk-5", grow && "flex-1 max-sm:basis-80", className),
158
- ...props,
159
- children
160
- }
161
- );
162
- var FooterInlineList = ({
163
- className,
164
- ref,
165
- children,
166
- ...props
167
- }) => /* @__PURE__ */ jsx(
168
- "ul",
169
- {
170
- ref,
171
- className: cn("list-none m-0 mb-govuk-3 p-0", "last:mb-0", className),
172
- ...props,
173
- children
174
- }
175
- );
176
- var FooterInlineListItem = ({
177
- className,
178
- ref,
179
- children,
180
- ...props
181
- }) => /* @__PURE__ */ jsx(
182
- "li",
183
- {
184
- ref,
185
- className: cn("inline-block mr-govuk-3 mb-govuk-1", className),
186
- ...props,
187
- children
188
- }
189
- );
190
- var FooterContentLicence = ({
191
- className,
192
- ref,
193
- children,
194
- ...props
195
- }) => /* @__PURE__ */ jsx(
196
- "span",
197
- {
198
- ref,
199
- className: cn("inline-block text-balance", className),
200
- ...props,
201
- children
202
- }
203
- );
204
-
205
- export { Footer, FooterContainer, FooterContentLicence, FooterHeading, FooterInlineList, FooterInlineListItem, FooterLink, FooterList, FooterListItem, FooterMeta, FooterMetaItem, FooterNavigation, FooterSection, FooterSectionBreak };
@@ -1,68 +0,0 @@
1
- import { cn } from './chunk-WONVZ7WK.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
-
4
- var ErrorSummary = ({
5
- className,
6
- titleText = "There is a problem",
7
- descriptionText,
8
- errorList,
9
- ref,
10
- ...props
11
- }) => /* @__PURE__ */ jsx(
12
- "div",
13
- {
14
- ref,
15
- tabIndex: -1,
16
- className: cn(
17
- "font-govuk text-govuk-body text-govuk-black",
18
- "p-govuk-3 sm:p-govuk-4",
19
- "mb-govuk-6 sm:mb-govuk-8",
20
- "border-govuk-error-summary",
21
- "focus:outline-3 focus:outline-govuk-yellow",
22
- className
23
- ),
24
- ...props,
25
- children: /* @__PURE__ */ jsxs("div", { role: "alert", children: [
26
- /* @__PURE__ */ jsx(
27
- "h2",
28
- {
29
- className: cn(
30
- "text-govuk-heading-m font-bold",
31
- "mt-0 mb-govuk-3 sm:mb-govuk-4"
32
- ),
33
- children: titleText
34
- }
35
- ),
36
- /* @__PURE__ */ jsxs(
37
- "div",
38
- {
39
- className: cn(
40
- "[&>p]:mb-0",
41
- "[&>*+*]:mt-govuk-3 sm:[&>*+*]:mt-govuk-4",
42
- "*:last:mb-govuk-1"
43
- ),
44
- children: [
45
- descriptionText && /* @__PURE__ */ jsx("p", { children: descriptionText }),
46
- /* @__PURE__ */ jsx("ul", { className: "list-none p-0 m-0 [&>li]:mb-govuk-1 [&>li:last-child]:mb-0", children: errorList.map((item) => /* @__PURE__ */ jsx("li", { children: item.href ? /* @__PURE__ */ jsx(
47
- "a",
48
- {
49
- href: item.href,
50
- className: cn(
51
- "font-bold",
52
- "text-govuk-error visited:text-govuk-error",
53
- "hover:text-govuk-error-hover",
54
- "underline govuk-link-underline",
55
- "hover:govuk-link-underline-hover",
56
- "focus:govuk-link-focus"
57
- ),
58
- children: item.text
59
- }
60
- ) : /* @__PURE__ */ jsx("span", { className: "font-bold", children: item.text }) }, item.href ?? item.text)) })
61
- ]
62
- }
63
- )
64
- ] })
65
- }
66
- );
67
-
68
- export { ErrorSummary };