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.
- package/README.md +4 -1
- package/dist/{chunk-KWAC6IEK.js → chunk-2KB4IAMZ.js} +9 -22
- package/dist/{chunk-5TI2WXYU.js → chunk-3UX7QPLM.js} +10 -21
- package/dist/{chunk-SK27BMU5.js → chunk-4GQRYMDK.js} +11 -23
- package/dist/{chunk-OP35ZJ4X.js → chunk-4TBXH62Z.js} +6 -7
- package/dist/{chunk-M6CLPMRP.js → chunk-6WLHJ5MN.js} +34 -76
- package/dist/chunk-7IOR7UNU.js +77 -0
- package/dist/chunk-7Q2C5RB7.js +167 -0
- package/dist/{chunk-5PIQJ22R.js → chunk-ASBIQC77.js} +13 -18
- package/dist/{chunk-KD4LPFIZ.js → chunk-C2YQVLZ7.js} +15 -18
- package/dist/chunk-CBT6WCJ7.js +52 -0
- package/dist/{chunk-3YIKJK6M.js → chunk-CYBPAHLZ.js} +48 -52
- package/dist/{chunk-VB6V3PHD.js → chunk-D2T6BUOB.js} +6 -16
- package/dist/chunk-DZ3743JO.js +38 -0
- package/dist/{chunk-AO6HPG4R.js → chunk-EDOSCND4.js} +5 -20
- package/dist/chunk-FJHNUBEM.js +59 -0
- package/dist/chunk-FVBDMMNR.js +143 -0
- package/dist/chunk-GKHD33N6.js +52 -0
- package/dist/{chunk-3INCIYDO.js → chunk-GLDCEDTR.js} +22 -77
- package/dist/{chunk-G6T44BDV.js → chunk-HBLVAX45.js} +7 -11
- package/dist/{chunk-UWQFFFTB.js → chunk-JCERRZV6.js} +13 -13
- package/dist/chunk-KXQGZLMK.js +120 -0
- package/dist/{chunk-CEPBVMFU.js → chunk-MFI5R2TJ.js} +1 -3
- package/dist/{chunk-5XNKIBMP.js → chunk-MYMVHSRJ.js} +3 -4
- package/dist/chunk-N5PY3VZH.js +192 -0
- package/dist/{chunk-P4GCF5FQ.js → chunk-OQILIT3B.js} +26 -15
- package/dist/{chunk-6VXVJERU.js → chunk-QKR7NELW.js} +4 -8
- package/dist/chunk-QPN5J5IU.js +177 -0
- package/dist/chunk-RGXB6M3G.js +87 -0
- package/dist/chunk-TAVSU2XB.js +90 -0
- package/dist/chunk-TGNN5ZP3.js +81 -0
- package/dist/chunk-TICBCBDN.js +18 -0
- package/dist/{chunk-7ZCZQN5N.js → chunk-UK7RLSTJ.js} +15 -22
- package/dist/chunk-UXOJELVU.js +37 -0
- package/dist/{chunk-QTSEOPVX.js → chunk-VCJE5UO2.js} +23 -25
- package/dist/{chunk-N67H5OUQ.js → chunk-VHSAXVCF.js} +7 -5
- package/dist/chunk-VMI2XU5D.js +74 -0
- package/dist/{chunk-TXGBUZB4.js → chunk-VRGDQ3SF.js} +3 -10
- package/dist/chunk-W4CWUYTA.js +44 -0
- package/dist/{chunk-LRNZYPC2.js → chunk-YF6EZ57H.js} +14 -44
- package/dist/chunk-ZAKQHDVD.js +40 -0
- package/dist/chunk-ZJB7BBTN.js +188 -0
- package/dist/index.d.ts +15 -13
- package/dist/index.js +41 -39
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.js +1 -1
- package/dist/ui/accordion.d.ts +8 -13
- package/dist/ui/accordion.js +2 -2
- package/dist/ui/back-link.d.ts +4 -4
- package/dist/ui/back-link.js +2 -2
- package/dist/ui/breadcrumbs.d.ts +10 -16
- package/dist/ui/breadcrumbs.js +2 -2
- package/dist/ui/button.d.ts +7 -8
- package/dist/ui/button.js +2 -2
- package/dist/ui/character-count.d.ts +11 -15
- package/dist/ui/character-count.js +3 -3
- package/dist/ui/checkboxes.d.ts +9 -17
- package/dist/ui/checkboxes.js +2 -2
- package/dist/ui/cookie-banner.d.ts +12 -21
- package/dist/ui/cookie-banner.js +2 -2
- package/dist/ui/date-input.d.ts +10 -16
- package/dist/ui/date-input.js +2 -2
- package/dist/ui/details.d.ts +8 -17
- package/dist/ui/details.js +2 -2
- package/dist/ui/error-message.d.ts +4 -4
- package/dist/ui/error-message.js +2 -2
- package/dist/ui/error-summary.d.ts +5 -4
- package/dist/ui/error-summary.js +2 -2
- package/dist/ui/exit-this-page.d.ts +4 -4
- package/dist/ui/exit-this-page.js +3 -3
- package/dist/ui/feedback.d.ts +13 -0
- package/dist/ui/feedback.js +2 -0
- package/dist/ui/fieldset.d.ts +9 -13
- package/dist/ui/fieldset.js +2 -2
- package/dist/ui/file-upload.d.ts +4 -5
- package/dist/ui/file-upload.js +2 -2
- package/dist/ui/footer.d.ts +39 -50
- package/dist/ui/footer.js +2 -2
- package/dist/ui/generic-header.d.ts +10 -15
- package/dist/ui/generic-header.js +2 -2
- package/dist/ui/header.d.ts +14 -32
- package/dist/ui/header.js +2 -2
- package/dist/ui/hint.d.ts +4 -5
- package/dist/ui/hint.js +2 -2
- package/dist/ui/inset-text.d.ts +4 -5
- package/dist/ui/inset-text.js +2 -2
- package/dist/ui/label.d.ts +7 -9
- package/dist/ui/label.js +2 -2
- package/dist/ui/language-navigation.d.ts +20 -0
- package/dist/ui/language-navigation.js +2 -0
- package/dist/ui/link.d.ts +5 -6
- package/dist/ui/link.js +2 -2
- package/dist/ui/notification-banner.d.ts +15 -24
- package/dist/ui/notification-banner.js +2 -2
- package/dist/ui/pagination.d.ts +20 -34
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/panel.d.ts +11 -12
- package/dist/ui/panel.js +2 -2
- package/dist/ui/password-input.d.ts +7 -6
- package/dist/ui/password-input.js +4 -4
- package/dist/ui/phase-banner.d.ts +10 -17
- package/dist/ui/phase-banner.js +2 -2
- package/dist/ui/radios.d.ts +8 -13
- package/dist/ui/radios.js +2 -2
- package/dist/ui/select.d.ts +6 -30
- package/dist/ui/select.js +2 -2
- package/dist/ui/service-navigation.d.ts +15 -23
- package/dist/ui/service-navigation.js +2 -2
- package/dist/ui/skip-link.d.ts +4 -5
- package/dist/ui/skip-link.js +2 -2
- package/dist/ui/summary-list.d.ts +24 -41
- package/dist/ui/summary-list.js +2 -2
- package/dist/ui/table.d.ts +21 -26
- package/dist/ui/table.js +2 -2
- package/dist/ui/tabs.d.ts +7 -9
- package/dist/ui/tabs.js +2 -2
- package/dist/ui/tag.d.ts +4 -6
- package/dist/ui/tag.js +2 -2
- package/dist/ui/task-list.d.ts +14 -23
- package/dist/ui/task-list.js +2 -2
- package/dist/ui/text-input.d.ts +5 -6
- package/dist/ui/text-input.js +2 -2
- package/dist/ui/textarea.d.ts +4 -6
- package/dist/ui/textarea.js +2 -2
- package/dist/ui/warning-text.d.ts +4 -4
- package/dist/ui/warning-text.js +2 -2
- package/package.json +111 -263
- package/registry/default/theme/govuk-tokens.css +207 -40
- package/dist/chunk-2QKZ6DPC.js +0 -27
- package/dist/chunk-4MXR4WNS.js +0 -17
- package/dist/chunk-5AKGRLG2.js +0 -190
- package/dist/chunk-5H55YDJS.js +0 -69
- package/dist/chunk-72PH2FMG.js +0 -180
- package/dist/chunk-GUZIKVAE.js +0 -119
- package/dist/chunk-JESMK3XK.js +0 -105
- package/dist/chunk-JFZN5XP6.js +0 -88
- package/dist/chunk-NRXTKHI2.js +0 -169
- package/dist/chunk-PGZHPAT5.js +0 -183
- package/dist/chunk-RPV43YDC.js +0 -93
- package/dist/chunk-VQOCX44T.js +0 -41
- package/dist/chunk-WONVZ7WK.js +0 -29
- package/dist/chunk-WPPWPEFV.js +0 -150
- package/dist/chunk-XQOYWPKV.js +0 -48
- package/dist/chunk-YAKI4SI7.js +0 -205
- package/dist/chunk-YCLGXX3R.js +0 -68
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Distributed two ways:
|
|
|
16
16
|
These are peer dependencies — install them in your app:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install react@^19 react-dom@^19 tailwindcss@^4 @base-ui/react
|
|
19
|
+
npm install react@^19.3 react-dom@^19.3 tailwindcss@^4.3 @base-ui/react@^1.9
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
---
|
|
@@ -36,8 +36,11 @@ Import the GOV.UK design tokens in your CSS entry point, **after** Tailwind:
|
|
|
36
36
|
```css
|
|
37
37
|
@import 'tailwindcss';
|
|
38
38
|
@import 'whitehall-ui/tokens.css';
|
|
39
|
+
@source '../node_modules/whitehall-ui/dist';
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
Tailwind 4 doesn't scan `node_modules`, so without the `@source` line the component classes are never generated and everything renders unstyled. The path is relative to your CSS file — adjust it if your CSS doesn't live one level below the project root.
|
|
43
|
+
|
|
41
44
|
### 3. Use a component
|
|
42
45
|
|
|
43
46
|
Import from the package root:
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
var Breadcrumbs = ({
|
|
5
5
|
className,
|
|
6
6
|
collapseOnMobile,
|
|
7
7
|
inverse,
|
|
8
|
-
ref,
|
|
9
|
-
children,
|
|
10
8
|
...props
|
|
11
9
|
}) => /* @__PURE__ */ jsx(
|
|
12
10
|
"nav",
|
|
13
11
|
{
|
|
14
|
-
ref,
|
|
15
12
|
"aria-label": "Breadcrumb",
|
|
13
|
+
"data-inverse": inverse || void 0,
|
|
16
14
|
className: cn(
|
|
17
|
-
"font-govuk text-govuk-
|
|
15
|
+
"group/breadcrumbs font-govuk text-govuk-body-small",
|
|
18
16
|
"mt-govuk-3 mb-govuk-2",
|
|
19
17
|
inverse ? "text-white" : "text-govuk-black",
|
|
20
18
|
collapseOnMobile && "[&_ol]:max-sm:flex [&_li]:max-sm:hidden [&_li:first-child]:max-sm:inline-block [&_li:last-child]:max-sm:inline-block",
|
|
21
19
|
className
|
|
22
20
|
),
|
|
23
|
-
...props
|
|
24
|
-
children
|
|
21
|
+
...props
|
|
25
22
|
}
|
|
26
23
|
);
|
|
27
|
-
var BreadcrumbsList = ({
|
|
28
|
-
className,
|
|
29
|
-
ref,
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}) => /* @__PURE__ */ jsx("ol", { ref, className: cn("m-0 p-0 list-none", className), ...props, children });
|
|
24
|
+
var BreadcrumbsList = ({ className, ...props }) => /* @__PURE__ */ jsx("ol", { className: cn("m-0 p-0 list-none", className), ...props });
|
|
33
25
|
var BreadcrumbsListItem = ({
|
|
34
26
|
className,
|
|
35
|
-
ref,
|
|
36
27
|
children,
|
|
37
28
|
...props
|
|
38
29
|
}) => /* @__PURE__ */ jsxs(
|
|
39
30
|
"li",
|
|
40
31
|
{
|
|
41
|
-
ref,
|
|
42
32
|
className: cn(
|
|
43
33
|
"inline-block mb-govuk-1",
|
|
44
34
|
"first:ml-0 first:pl-0 first:[&>svg]:hidden",
|
|
@@ -49,7 +39,7 @@ var BreadcrumbsListItem = ({
|
|
|
49
39
|
/* @__PURE__ */ jsx(
|
|
50
40
|
"svg",
|
|
51
41
|
{
|
|
52
|
-
className: "inline-block align-middle mx-govuk-2 -mt-px",
|
|
42
|
+
className: "inline-block align-middle mx-govuk-2 -mt-px text-govuk-dark-grey group-data-[inverse]/breadcrumbs:text-current",
|
|
53
43
|
xmlns: "http://www.w3.org/2000/svg",
|
|
54
44
|
width: "7",
|
|
55
45
|
height: "11",
|
|
@@ -62,8 +52,7 @@ var BreadcrumbsListItem = ({
|
|
|
62
52
|
{
|
|
63
53
|
d: "M1 1L5.5 5.5L1 10",
|
|
64
54
|
stroke: "currentColor",
|
|
65
|
-
strokeWidth: "1"
|
|
66
|
-
strokeOpacity: "0.65"
|
|
55
|
+
strokeWidth: "1"
|
|
67
56
|
}
|
|
68
57
|
)
|
|
69
58
|
}
|
|
@@ -74,16 +63,14 @@ var BreadcrumbsListItem = ({
|
|
|
74
63
|
);
|
|
75
64
|
var BreadcrumbsLink = ({
|
|
76
65
|
className,
|
|
77
|
-
ref,
|
|
78
66
|
children,
|
|
79
67
|
...props
|
|
80
68
|
}) => /* @__PURE__ */ jsx(
|
|
81
69
|
"a",
|
|
82
70
|
{
|
|
83
|
-
ref,
|
|
84
71
|
className: cn(
|
|
85
|
-
"text-
|
|
86
|
-
"hover:
|
|
72
|
+
"text-inherit underline govuk-link-underline",
|
|
73
|
+
"hover:govuk-link-underline-hover",
|
|
87
74
|
"focus:govuk-link-focus",
|
|
88
75
|
className
|
|
89
76
|
),
|
|
@@ -1,59 +1,48 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
var DateInput = ({ className,
|
|
5
|
-
var DateInputItem = ({
|
|
6
|
-
className,
|
|
7
|
-
children,
|
|
8
|
-
ref,
|
|
9
|
-
...props
|
|
10
|
-
}) => /* @__PURE__ */ jsx(
|
|
4
|
+
var DateInput = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("govuk-date-input", className), ...props });
|
|
5
|
+
var DateInputItem = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
11
6
|
"div",
|
|
12
7
|
{
|
|
13
|
-
ref,
|
|
14
8
|
className: cn("inline-block mr-govuk-4 mb-0 align-bottom", className),
|
|
15
|
-
...props
|
|
16
|
-
children
|
|
9
|
+
...props
|
|
17
10
|
}
|
|
18
11
|
);
|
|
19
12
|
var DateInputLabel = ({
|
|
20
13
|
className,
|
|
21
|
-
children,
|
|
22
14
|
htmlFor,
|
|
23
|
-
ref,
|
|
24
15
|
...props
|
|
25
16
|
}) => /* @__PURE__ */ jsx(
|
|
26
17
|
"label",
|
|
27
18
|
{
|
|
28
|
-
ref,
|
|
29
19
|
htmlFor,
|
|
30
20
|
className: cn(
|
|
31
|
-
"block font-govuk text-govuk-body text-govuk-black",
|
|
21
|
+
"block mb-govuk-1 font-govuk text-govuk-body text-govuk-black",
|
|
32
22
|
className
|
|
33
23
|
),
|
|
34
|
-
...props
|
|
35
|
-
children
|
|
24
|
+
...props
|
|
36
25
|
}
|
|
37
26
|
);
|
|
38
27
|
var DateInputInput = ({
|
|
39
28
|
className,
|
|
40
|
-
error
|
|
41
|
-
ref,
|
|
29
|
+
error,
|
|
42
30
|
...props
|
|
43
31
|
}) => /* @__PURE__ */ jsx(
|
|
44
32
|
"input",
|
|
45
33
|
{
|
|
46
|
-
ref,
|
|
47
34
|
type: "text",
|
|
48
35
|
inputMode: "numeric",
|
|
36
|
+
"aria-invalid": error || void 0,
|
|
49
37
|
className: cn(
|
|
50
|
-
"
|
|
38
|
+
"mb-0 box-border",
|
|
51
39
|
"p-govuk-1 h-10",
|
|
52
40
|
"border-2 border-govuk-black",
|
|
53
41
|
"rounded-none appearance-none",
|
|
54
42
|
"text-govuk-body font-normal font-govuk",
|
|
55
43
|
"focus:outline-3 focus:outline-govuk-yellow focus:outline-offset-0",
|
|
56
44
|
"focus:inset-ring-2 focus:inset-ring-govuk-black",
|
|
45
|
+
"disabled:opacity-50 disabled:bg-transparent disabled:cursor-not-allowed",
|
|
57
46
|
error && "border-govuk-error focus:border-govuk-black",
|
|
58
47
|
className
|
|
59
48
|
),
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import { RadioGroup } from '@base-ui/react/radio-group';
|
|
4
4
|
import { Radio } from '@base-ui/react/radio';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var Radios = ({
|
|
8
|
-
className,
|
|
9
|
-
inline = false,
|
|
10
|
-
children,
|
|
11
|
-
...props
|
|
12
|
-
}) => /* @__PURE__ */ jsx(
|
|
7
|
+
var Radios = ({ className, inline, ...props }) => /* @__PURE__ */ jsx(
|
|
13
8
|
RadioGroup,
|
|
14
9
|
{
|
|
15
10
|
className: cn(
|
|
16
|
-
inline && "sm:flex sm:flex-wrap sm:items-start sm:gap-x-
|
|
11
|
+
inline && "sm:flex sm:flex-wrap sm:items-start sm:gap-x-govuk-4",
|
|
17
12
|
className
|
|
18
13
|
),
|
|
19
|
-
...props
|
|
20
|
-
children
|
|
14
|
+
...props
|
|
21
15
|
}
|
|
22
16
|
);
|
|
23
|
-
var RadiosItem = ({
|
|
24
|
-
className,
|
|
25
|
-
children,
|
|
26
|
-
value,
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
17
|
+
var RadiosItem = ({ className, children, ...props }) => {
|
|
29
18
|
const labelId = useId();
|
|
30
19
|
return /* @__PURE__ */ jsxs(
|
|
31
20
|
"label",
|
|
@@ -33,22 +22,21 @@ var RadiosItem = ({
|
|
|
33
22
|
className: cn(
|
|
34
23
|
"flex flex-wrap items-start",
|
|
35
24
|
"relative",
|
|
36
|
-
"mb-2
|
|
25
|
+
"mb-govuk-2 last:mb-0",
|
|
37
26
|
"cursor-pointer",
|
|
27
|
+
"has-data-[disabled]:opacity-50 has-data-[disabled]:cursor-not-allowed",
|
|
38
28
|
className
|
|
39
29
|
),
|
|
40
30
|
children: [
|
|
41
31
|
/* @__PURE__ */ jsxs(
|
|
42
32
|
Radio.Root,
|
|
43
33
|
{
|
|
44
|
-
value,
|
|
45
34
|
"aria-labelledby": labelId,
|
|
46
35
|
className: cn(
|
|
47
36
|
"group/radio",
|
|
48
37
|
"relative flex-none",
|
|
49
38
|
"w-govuk-radio-touch-target h-govuk-radio-touch-target",
|
|
50
|
-
"
|
|
51
|
-
"data-disabled:cursor-not-allowed data-disabled:opacity-50"
|
|
39
|
+
"outline-none"
|
|
52
40
|
),
|
|
53
41
|
...props,
|
|
54
42
|
children: [
|
|
@@ -95,7 +83,7 @@ var RadiosItem = ({
|
|
|
95
83
|
"self-center",
|
|
96
84
|
"py-govuk-button-pb px-govuk-radio-label-padding-x",
|
|
97
85
|
"text-govuk-tag font-normal font-govuk",
|
|
98
|
-
"
|
|
86
|
+
"max-w-[calc(100%-74px)]"
|
|
99
87
|
),
|
|
100
88
|
children
|
|
101
89
|
}
|
|
@@ -109,7 +97,7 @@ var RadiosHint = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
109
97
|
{
|
|
110
98
|
className: cn(
|
|
111
99
|
"block w-full",
|
|
112
|
-
"-mt-govuk-
|
|
100
|
+
"-mt-govuk-3 mb-govuk-2 last:mb-0",
|
|
113
101
|
"pr-govuk-radio-label-padding-x",
|
|
114
102
|
"pl-[calc(var(--spacing-govuk-radio-label-padding-x)+var(--spacing-govuk-radio-touch-target))]",
|
|
115
103
|
"text-govuk-tag font-normal font-govuk text-govuk-dark-grey",
|
|
@@ -127,7 +115,7 @@ var RadiosDivider = ({
|
|
|
127
115
|
{
|
|
128
116
|
className: cn(
|
|
129
117
|
"w-govuk-radio-size",
|
|
130
|
-
"mb-2
|
|
118
|
+
"mb-govuk-2",
|
|
131
119
|
"text-govuk-tag font-normal font-govuk text-govuk-black",
|
|
132
120
|
"text-center",
|
|
133
121
|
className
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
var WarningText = ({
|
|
5
5
|
className,
|
|
6
|
-
ref,
|
|
7
6
|
assistiveText = "Warning",
|
|
8
7
|
children,
|
|
9
8
|
...props
|
|
10
9
|
}) => /* @__PURE__ */ jsxs(
|
|
11
10
|
"div",
|
|
12
11
|
{
|
|
13
|
-
ref,
|
|
14
12
|
className: cn(
|
|
15
13
|
"font-govuk text-govuk-body font-bold",
|
|
16
|
-
"relative py-govuk-2 mb-govuk-
|
|
14
|
+
"relative py-govuk-2 mb-govuk-r6",
|
|
17
15
|
className
|
|
18
16
|
),
|
|
19
17
|
...props,
|
|
@@ -28,14 +26,15 @@ var WarningText = ({
|
|
|
28
26
|
"mt-govuk-warning-icon-mt",
|
|
29
27
|
"border-govuk-warning-icon-border border-solid border-govuk-black rounded-full",
|
|
30
28
|
"bg-govuk-black text-white",
|
|
31
|
-
"text-
|
|
32
|
-
"select-none"
|
|
29
|
+
"text-govuk-warning-icon",
|
|
30
|
+
"select-none",
|
|
31
|
+
"forced-color-adjust-none forced-colors:border-govuk-canvas-text forced-colors:text-govuk-canvas-text forced-colors:bg-transparent"
|
|
33
32
|
),
|
|
34
33
|
"aria-hidden": "true",
|
|
35
34
|
children: "!"
|
|
36
35
|
}
|
|
37
36
|
),
|
|
38
|
-
/* @__PURE__ */ jsxs("strong", { className:
|
|
37
|
+
/* @__PURE__ */ jsxs("strong", { className: "block pl-govuk-warning-text-pl", children: [
|
|
39
38
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: assistiveText }),
|
|
40
39
|
children
|
|
41
40
|
] })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn } from './chunk-
|
|
2
|
-
import { createContext,
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
|
+
import { createContext, use } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var PaginationBlockContext = createContext(false);
|
|
6
6
|
var PrevArrow = () => {
|
|
7
|
-
const isBlock =
|
|
7
|
+
const isBlock = use(PaginationBlockContext);
|
|
8
8
|
return /* @__PURE__ */ jsx(
|
|
9
9
|
"svg",
|
|
10
10
|
{
|
|
@@ -23,7 +23,7 @@ var PrevArrow = () => {
|
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
var NextArrow = () => {
|
|
26
|
-
const isBlock =
|
|
26
|
+
const isBlock = use(PaginationBlockContext);
|
|
27
27
|
return /* @__PURE__ */ jsx(
|
|
28
28
|
"svg",
|
|
29
29
|
{
|
|
@@ -41,40 +41,26 @@ var NextArrow = () => {
|
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
-
var Pagination = ({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
className: cn(
|
|
57
|
-
"font-govuk mb-govuk-6",
|
|
58
|
-
block ? "govuk-pagination-block" : "flex flex-col flex-wrap items-center md:flex-row md:items-start",
|
|
59
|
-
className
|
|
60
|
-
),
|
|
61
|
-
"aria-label": props["aria-label"] ?? "Pagination",
|
|
62
|
-
...props,
|
|
63
|
-
children
|
|
64
|
-
}
|
|
65
|
-
) });
|
|
66
|
-
};
|
|
44
|
+
var Pagination = ({ className, block = false, ...props }) => /* @__PURE__ */ jsx(PaginationBlockContext, { value: block, children: /* @__PURE__ */ jsx(
|
|
45
|
+
"nav",
|
|
46
|
+
{
|
|
47
|
+
"aria-label": "Pagination",
|
|
48
|
+
className: cn(
|
|
49
|
+
"font-govuk mb-govuk-r6",
|
|
50
|
+
block ? "govuk-pagination-block" : "flex flex-col flex-wrap items-center sm:flex-row sm:items-start",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
67
56
|
var PaginationPrevious = ({
|
|
68
57
|
className,
|
|
69
|
-
children,
|
|
70
|
-
ref,
|
|
71
58
|
...props
|
|
72
59
|
}) => {
|
|
73
|
-
const isBlock =
|
|
60
|
+
const isBlock = use(PaginationBlockContext);
|
|
74
61
|
return /* @__PURE__ */ jsx(
|
|
75
62
|
"div",
|
|
76
63
|
{
|
|
77
|
-
ref,
|
|
78
64
|
className: cn(
|
|
79
65
|
"govuk-pagination-nav-item box-border relative",
|
|
80
66
|
"min-w-govuk-pagination-touch min-h-govuk-pagination-touch",
|
|
@@ -82,22 +68,15 @@ var PaginationPrevious = ({
|
|
|
82
68
|
!isBlock && "govuk-pagination-nav-link float-left",
|
|
83
69
|
className
|
|
84
70
|
),
|
|
85
|
-
...props
|
|
86
|
-
children
|
|
71
|
+
...props
|
|
87
72
|
}
|
|
88
73
|
);
|
|
89
74
|
};
|
|
90
|
-
var PaginationNext = ({
|
|
91
|
-
|
|
92
|
-
children,
|
|
93
|
-
ref,
|
|
94
|
-
...props
|
|
95
|
-
}) => {
|
|
96
|
-
const isBlock = useContext(PaginationBlockContext);
|
|
75
|
+
var PaginationNext = ({ className, ...props }) => {
|
|
76
|
+
const isBlock = use(PaginationBlockContext);
|
|
97
77
|
return /* @__PURE__ */ jsx(
|
|
98
78
|
"div",
|
|
99
79
|
{
|
|
100
|
-
ref,
|
|
101
80
|
className: cn(
|
|
102
81
|
"govuk-pagination-nav-item box-border relative",
|
|
103
82
|
"min-w-govuk-pagination-touch min-h-govuk-pagination-touch",
|
|
@@ -105,47 +84,35 @@ var PaginationNext = ({
|
|
|
105
84
|
isBlock ? "pl-0 pr-govuk-3" : "govuk-pagination-nav-link pl-govuk-3 pr-0 float-left",
|
|
106
85
|
className
|
|
107
86
|
),
|
|
108
|
-
...props
|
|
109
|
-
children
|
|
87
|
+
...props
|
|
110
88
|
}
|
|
111
89
|
);
|
|
112
90
|
};
|
|
113
|
-
var PaginationList = ({
|
|
114
|
-
className,
|
|
115
|
-
children,
|
|
116
|
-
ref,
|
|
117
|
-
...props
|
|
118
|
-
}) => /* @__PURE__ */ jsx("ul", { ref, className: cn("m-0 p-0 list-none", className), ...props, children });
|
|
91
|
+
var PaginationList = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", { className: cn("m-0 p-0 list-none", className), ...props });
|
|
119
92
|
var PaginationItem = ({
|
|
120
93
|
className,
|
|
121
94
|
current,
|
|
122
|
-
children,
|
|
123
|
-
ref,
|
|
124
95
|
...props
|
|
125
96
|
}) => /* @__PURE__ */ jsx(
|
|
126
97
|
"li",
|
|
127
98
|
{
|
|
128
|
-
ref,
|
|
129
99
|
className: cn(
|
|
130
100
|
"box-border relative",
|
|
131
101
|
"min-w-govuk-pagination-touch min-h-govuk-pagination-touch",
|
|
132
102
|
"py-govuk-2 px-govuk-3 float-left text-center text-govuk-body",
|
|
133
|
-
"hidden first:block last:block
|
|
103
|
+
"hidden first:block last:block sm:block",
|
|
134
104
|
current ? "block font-bold govuk-pagination-item-current" : "hover:bg-govuk-light-grey",
|
|
135
105
|
className
|
|
136
106
|
),
|
|
137
|
-
...props
|
|
138
|
-
children
|
|
107
|
+
...props
|
|
139
108
|
}
|
|
140
109
|
);
|
|
141
110
|
var PaginationEllipsis = ({
|
|
142
111
|
className,
|
|
143
|
-
ref,
|
|
144
112
|
...props
|
|
145
113
|
}) => /* @__PURE__ */ jsx(
|
|
146
114
|
"li",
|
|
147
115
|
{
|
|
148
|
-
ref,
|
|
149
116
|
className: cn(
|
|
150
117
|
"box-border relative",
|
|
151
118
|
"min-w-govuk-pagination-touch min-h-govuk-pagination-touch",
|
|
@@ -161,19 +128,17 @@ var PaginationEllipsis = ({
|
|
|
161
128
|
var PaginationLink = ({
|
|
162
129
|
className,
|
|
163
130
|
children,
|
|
164
|
-
ref,
|
|
165
131
|
...props
|
|
166
132
|
}) => {
|
|
167
|
-
const isBlock =
|
|
133
|
+
const isBlock = use(PaginationBlockContext);
|
|
168
134
|
return /* @__PURE__ */ jsx(
|
|
169
135
|
"a",
|
|
170
136
|
{
|
|
171
|
-
ref,
|
|
172
137
|
className: cn(
|
|
173
|
-
"govuk-pagination-link min-w-govuk-3",
|
|
174
|
-
"text-govuk-
|
|
138
|
+
"group govuk-pagination-link min-w-govuk-3",
|
|
139
|
+
"text-govuk-link underline govuk-link-underline",
|
|
175
140
|
"hover:text-govuk-brand-hover hover:govuk-link-underline-hover",
|
|
176
|
-
"visited:text-govuk-visited",
|
|
141
|
+
"visited:text-govuk-visited active:text-govuk-black",
|
|
177
142
|
"focus:govuk-link-focus",
|
|
178
143
|
isBlock ? "inline-block pl-govuk-6 text-left govuk-pagination-block-link" : "block",
|
|
179
144
|
className
|
|
@@ -186,41 +151,34 @@ var PaginationLink = ({
|
|
|
186
151
|
var PaginationLinkTitle = ({
|
|
187
152
|
className,
|
|
188
153
|
decorated,
|
|
189
|
-
children,
|
|
190
|
-
ref,
|
|
191
154
|
...props
|
|
192
155
|
}) => {
|
|
193
|
-
const isBlock =
|
|
156
|
+
const isBlock = use(PaginationBlockContext);
|
|
194
157
|
return /* @__PURE__ */ jsx(
|
|
195
158
|
"span",
|
|
196
159
|
{
|
|
197
|
-
ref,
|
|
198
160
|
className: cn(
|
|
199
|
-
"decoration-inherit",
|
|
200
|
-
decorated && "underline govuk-link-underline",
|
|
161
|
+
"[text-decoration-thickness:inherit]",
|
|
162
|
+
decorated && "govuk-link-underline group-hover:underline group-active:underline group-hover:govuk-link-underline-hover group-focus:no-underline",
|
|
201
163
|
isBlock && "govuk-pagination-block-title",
|
|
202
164
|
className
|
|
203
165
|
),
|
|
204
|
-
...props
|
|
205
|
-
children
|
|
166
|
+
...props
|
|
206
167
|
}
|
|
207
168
|
);
|
|
208
169
|
};
|
|
209
170
|
var PaginationLinkLabel = ({
|
|
210
171
|
className,
|
|
211
|
-
children,
|
|
212
|
-
ref,
|
|
213
172
|
...props
|
|
214
173
|
}) => /* @__PURE__ */ jsx(
|
|
215
174
|
"span",
|
|
216
175
|
{
|
|
217
|
-
ref,
|
|
218
176
|
className: cn(
|
|
219
177
|
"font-normal underline govuk-link-underline inline-block",
|
|
178
|
+
"group-hover:govuk-link-underline-hover group-focus:no-underline",
|
|
220
179
|
className
|
|
221
180
|
),
|
|
222
|
-
...props
|
|
223
|
-
children
|
|
181
|
+
...props
|
|
224
182
|
}
|
|
225
183
|
);
|
|
226
184
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { cn } from './chunk-GKHD33N6.js';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var tableCaptionVariants = cva("font-bold table-caption text-left", {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
m: "text-govuk-heading-m mb-govuk-3",
|
|
9
|
+
l: "text-govuk-heading-l mb-govuk-3",
|
|
10
|
+
xl: "text-govuk-heading-xl mb-govuk-3"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var Table = ({ className, smallTextUntilTablet, ...props }) => /* @__PURE__ */ jsx(
|
|
15
|
+
"table",
|
|
16
|
+
{
|
|
17
|
+
className: cn(
|
|
18
|
+
"w-full mb-govuk-r6 border-spacing-0 border-collapse",
|
|
19
|
+
"font-govuk text-govuk-body text-govuk-black",
|
|
20
|
+
smallTextUntilTablet && "max-sm:text-govuk-body-small",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
var TableContainer = ({
|
|
27
|
+
className,
|
|
28
|
+
label = "Table",
|
|
29
|
+
...props
|
|
30
|
+
}) => /* @__PURE__ */ jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
role: "region",
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
className: cn(
|
|
37
|
+
"overflow-x-auto",
|
|
38
|
+
"focus-visible:outline-3 focus-visible:outline-govuk-yellow focus-visible:outline-offset-0",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
var TableCaption = ({ className, size, ...props }) => /* @__PURE__ */ jsx(
|
|
45
|
+
"caption",
|
|
46
|
+
{
|
|
47
|
+
className: cn("font-govuk", tableCaptionVariants({ size }), className),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
var TableHead = (props) => /* @__PURE__ */ jsx("thead", { ...props });
|
|
52
|
+
var TableBody = (props) => /* @__PURE__ */ jsx("tbody", { ...props });
|
|
53
|
+
var TableRow = (props) => /* @__PURE__ */ jsx("tr", { ...props });
|
|
54
|
+
var TableHeader = ({ className, numeric, ...props }) => /* @__PURE__ */ jsx(
|
|
55
|
+
"th",
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"govuk-table-cell font-bold",
|
|
59
|
+
numeric && "text-right tabular-nums",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
var TableCell = ({ className, numeric, ...props }) => /* @__PURE__ */ jsx(
|
|
66
|
+
"td",
|
|
67
|
+
{
|
|
68
|
+
className: cn(
|
|
69
|
+
"govuk-table-cell",
|
|
70
|
+
numeric && "text-right tabular-nums",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
export { Table, TableBody, TableCaption, TableCell, TableContainer, TableHead, TableHeader, TableRow, tableCaptionVariants };
|