whitehall-ui 1.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 (122) hide show
  1. package/README.md +108 -0
  2. package/dist/chunk-2QKZ6DPC.js +27 -0
  3. package/dist/chunk-3INCIYDO.js +213 -0
  4. package/dist/chunk-3YIKJK6M.js +181 -0
  5. package/dist/chunk-4MXR4WNS.js +17 -0
  6. package/dist/chunk-5AKGRLG2.js +190 -0
  7. package/dist/chunk-5H55YDJS.js +69 -0
  8. package/dist/chunk-5PIQJ22R.js +106 -0
  9. package/dist/chunk-5TI2WXYU.js +64 -0
  10. package/dist/chunk-5XNKIBMP.js +21 -0
  11. package/dist/chunk-6VXVJERU.js +38 -0
  12. package/dist/chunk-72PH2FMG.js +180 -0
  13. package/dist/chunk-7ZCZQN5N.js +71 -0
  14. package/dist/chunk-AO6HPG4R.js +50 -0
  15. package/dist/chunk-CEPBVMFU.js +34 -0
  16. package/dist/chunk-G6T44BDV.js +75 -0
  17. package/dist/chunk-GUZIKVAE.js +119 -0
  18. package/dist/chunk-JESMK3XK.js +105 -0
  19. package/dist/chunk-JFZN5XP6.js +88 -0
  20. package/dist/chunk-KD4LPFIZ.js +67 -0
  21. package/dist/chunk-KWAC6IEK.js +95 -0
  22. package/dist/chunk-LRNZYPC2.js +107 -0
  23. package/dist/chunk-M6CLPMRP.js +227 -0
  24. package/dist/chunk-N67H5OUQ.js +51 -0
  25. package/dist/chunk-NRXTKHI2.js +169 -0
  26. package/dist/chunk-OP35ZJ4X.js +46 -0
  27. package/dist/chunk-P4GCF5FQ.js +62 -0
  28. package/dist/chunk-PGZHPAT5.js +183 -0
  29. package/dist/chunk-QTSEOPVX.js +94 -0
  30. package/dist/chunk-RPV43YDC.js +93 -0
  31. package/dist/chunk-SK27BMU5.js +140 -0
  32. package/dist/chunk-TXGBUZB4.js +44 -0
  33. package/dist/chunk-UWQFFFTB.js +136 -0
  34. package/dist/chunk-VB6V3PHD.js +67 -0
  35. package/dist/chunk-VQOCX44T.js +41 -0
  36. package/dist/chunk-WONVZ7WK.js +29 -0
  37. package/dist/chunk-WPPWPEFV.js +150 -0
  38. package/dist/chunk-XQOYWPKV.js +48 -0
  39. package/dist/chunk-YAKI4SI7.js +205 -0
  40. package/dist/chunk-YCLGXX3R.js +68 -0
  41. package/dist/index.d.ts +50 -0
  42. package/dist/index.js +39 -0
  43. package/dist/lib/utils.d.ts +5 -0
  44. package/dist/lib/utils.js +1 -0
  45. package/dist/ui/accordion.d.ts +27 -0
  46. package/dist/ui/accordion.js +2 -0
  47. package/dist/ui/back-link.d.ts +9 -0
  48. package/dist/ui/back-link.js +2 -0
  49. package/dist/ui/breadcrumbs.d.ts +22 -0
  50. package/dist/ui/breadcrumbs.js +2 -0
  51. package/dist/ui/button.d.ts +17 -0
  52. package/dist/ui/button.js +2 -0
  53. package/dist/ui/character-count.d.ts +27 -0
  54. package/dist/ui/character-count.js +3 -0
  55. package/dist/ui/checkboxes.d.ts +30 -0
  56. package/dist/ui/checkboxes.js +2 -0
  57. package/dist/ui/cookie-banner.d.ts +24 -0
  58. package/dist/ui/cookie-banner.js +2 -0
  59. package/dist/ui/date-input.d.ts +21 -0
  60. package/dist/ui/date-input.js +2 -0
  61. package/dist/ui/details.d.ts +20 -0
  62. package/dist/ui/details.js +2 -0
  63. package/dist/ui/error-message.d.ts +9 -0
  64. package/dist/ui/error-message.js +2 -0
  65. package/dist/ui/error-summary.d.ts +15 -0
  66. package/dist/ui/error-summary.js +2 -0
  67. package/dist/ui/exit-this-page.d.ts +14 -0
  68. package/dist/ui/exit-this-page.js +3 -0
  69. package/dist/ui/fieldset.d.ts +22 -0
  70. package/dist/ui/fieldset.js +2 -0
  71. package/dist/ui/file-upload.d.ts +19 -0
  72. package/dist/ui/file-upload.js +2 -0
  73. package/dist/ui/footer.d.ts +61 -0
  74. package/dist/ui/footer.js +2 -0
  75. package/dist/ui/generic-header.d.ts +22 -0
  76. package/dist/ui/generic-header.js +2 -0
  77. package/dist/ui/header.d.ts +39 -0
  78. package/dist/ui/header.js +2 -0
  79. package/dist/ui/hint.d.ts +8 -0
  80. package/dist/ui/hint.js +2 -0
  81. package/dist/ui/inset-text.d.ts +8 -0
  82. package/dist/ui/inset-text.js +2 -0
  83. package/dist/ui/label.d.ts +18 -0
  84. package/dist/ui/label.js +2 -0
  85. package/dist/ui/link.d.ts +16 -0
  86. package/dist/ui/link.js +2 -0
  87. package/dist/ui/notification-banner.d.ts +29 -0
  88. package/dist/ui/notification-banner.js +2 -0
  89. package/dist/ui/pagination.d.ts +45 -0
  90. package/dist/ui/pagination.js +2 -0
  91. package/dist/ui/panel.d.ts +16 -0
  92. package/dist/ui/panel.js +2 -0
  93. package/dist/ui/password-input.d.ts +16 -0
  94. package/dist/ui/password-input.js +4 -0
  95. package/dist/ui/phase-banner.d.ts +20 -0
  96. package/dist/ui/phase-banner.js +2 -0
  97. package/dist/ui/radios.d.ts +25 -0
  98. package/dist/ui/radios.js +2 -0
  99. package/dist/ui/select.d.ts +36 -0
  100. package/dist/ui/select.js +2 -0
  101. package/dist/ui/service-navigation.d.ts +30 -0
  102. package/dist/ui/service-navigation.js +2 -0
  103. package/dist/ui/skip-link.d.ts +8 -0
  104. package/dist/ui/skip-link.js +2 -0
  105. package/dist/ui/summary-list.d.ts +49 -0
  106. package/dist/ui/summary-list.js +2 -0
  107. package/dist/ui/table.d.ts +40 -0
  108. package/dist/ui/table.js +2 -0
  109. package/dist/ui/tabs.d.ts +25 -0
  110. package/dist/ui/tabs.js +2 -0
  111. package/dist/ui/tag.d.ts +15 -0
  112. package/dist/ui/tag.js +2 -0
  113. package/dist/ui/task-list.d.ts +30 -0
  114. package/dist/ui/task-list.js +2 -0
  115. package/dist/ui/text-input.d.ts +18 -0
  116. package/dist/ui/text-input.js +2 -0
  117. package/dist/ui/textarea.d.ts +14 -0
  118. package/dist/ui/textarea.js +2 -0
  119. package/dist/ui/warning-text.d.ts +9 -0
  120. package/dist/ui/warning-text.js +2 -0
  121. package/package.json +263 -0
  122. package/registry/default/theme/govuk-tokens.css +434 -0
package/package.json ADDED
@@ -0,0 +1,263 @@
1
+ {
2
+ "name": "whitehall-ui",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "GOV.UK Design System component library for React 19 + Tailwind CSS 4. Available as an npm package and a shadcn-compatible registry.",
6
+ "license": "MIT",
7
+ "author": "dawidmakos",
8
+ "homepage": "https://dawidmakos.github.io/whitehall-ui/",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/dawidmakos/whitehall-ui.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/dawidmakos/whitehall-ui/issues"
15
+ },
16
+ "keywords": [
17
+ "govuk",
18
+ "gov.uk",
19
+ "design-system",
20
+ "react",
21
+ "tailwindcss",
22
+ "shadcn",
23
+ "components",
24
+ "ui"
25
+ ],
26
+ "sideEffects": [
27
+ "**/*.css"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "registry/default/theme/govuk-tokens.css",
35
+ "README.md"
36
+ ],
37
+ "main": "./dist/index.js",
38
+ "module": "./dist/index.js",
39
+ "types": "./dist/index.d.ts",
40
+ "exports": {
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "import": "./dist/index.js"
44
+ },
45
+ "./tokens.css": "./registry/default/theme/govuk-tokens.css",
46
+ "./lib/utils": {
47
+ "types": "./dist/lib/utils.d.ts",
48
+ "import": "./dist/lib/utils.js"
49
+ },
50
+ "./accordion": {
51
+ "types": "./dist/ui/accordion.d.ts",
52
+ "import": "./dist/ui/accordion.js"
53
+ },
54
+ "./back-link": {
55
+ "types": "./dist/ui/back-link.d.ts",
56
+ "import": "./dist/ui/back-link.js"
57
+ },
58
+ "./button": {
59
+ "types": "./dist/ui/button.d.ts",
60
+ "import": "./dist/ui/button.js"
61
+ },
62
+ "./character-count": {
63
+ "types": "./dist/ui/character-count.d.ts",
64
+ "import": "./dist/ui/character-count.js"
65
+ },
66
+ "./checkboxes": {
67
+ "types": "./dist/ui/checkboxes.d.ts",
68
+ "import": "./dist/ui/checkboxes.js"
69
+ },
70
+ "./cookie-banner": {
71
+ "types": "./dist/ui/cookie-banner.d.ts",
72
+ "import": "./dist/ui/cookie-banner.js"
73
+ },
74
+ "./date-input": {
75
+ "types": "./dist/ui/date-input.d.ts",
76
+ "import": "./dist/ui/date-input.js"
77
+ },
78
+ "./breadcrumbs": {
79
+ "types": "./dist/ui/breadcrumbs.d.ts",
80
+ "import": "./dist/ui/breadcrumbs.js"
81
+ },
82
+ "./details": {
83
+ "types": "./dist/ui/details.d.ts",
84
+ "import": "./dist/ui/details.js"
85
+ },
86
+ "./error-message": {
87
+ "types": "./dist/ui/error-message.d.ts",
88
+ "import": "./dist/ui/error-message.js"
89
+ },
90
+ "./error-summary": {
91
+ "types": "./dist/ui/error-summary.d.ts",
92
+ "import": "./dist/ui/error-summary.js"
93
+ },
94
+ "./exit-this-page": {
95
+ "types": "./dist/ui/exit-this-page.d.ts",
96
+ "import": "./dist/ui/exit-this-page.js"
97
+ },
98
+ "./fieldset": {
99
+ "types": "./dist/ui/fieldset.d.ts",
100
+ "import": "./dist/ui/fieldset.js"
101
+ },
102
+ "./file-upload": {
103
+ "types": "./dist/ui/file-upload.d.ts",
104
+ "import": "./dist/ui/file-upload.js"
105
+ },
106
+ "./footer": {
107
+ "types": "./dist/ui/footer.d.ts",
108
+ "import": "./dist/ui/footer.js"
109
+ },
110
+ "./header": {
111
+ "types": "./dist/ui/header.d.ts",
112
+ "import": "./dist/ui/header.js"
113
+ },
114
+ "./generic-header": {
115
+ "types": "./dist/ui/generic-header.d.ts",
116
+ "import": "./dist/ui/generic-header.js"
117
+ },
118
+ "./hint": {
119
+ "types": "./dist/ui/hint.d.ts",
120
+ "import": "./dist/ui/hint.js"
121
+ },
122
+ "./inset-text": {
123
+ "types": "./dist/ui/inset-text.d.ts",
124
+ "import": "./dist/ui/inset-text.js"
125
+ },
126
+ "./label": {
127
+ "types": "./dist/ui/label.d.ts",
128
+ "import": "./dist/ui/label.js"
129
+ },
130
+ "./link": {
131
+ "types": "./dist/ui/link.d.ts",
132
+ "import": "./dist/ui/link.js"
133
+ },
134
+ "./notification-banner": {
135
+ "types": "./dist/ui/notification-banner.d.ts",
136
+ "import": "./dist/ui/notification-banner.js"
137
+ },
138
+ "./panel": {
139
+ "types": "./dist/ui/panel.d.ts",
140
+ "import": "./dist/ui/panel.js"
141
+ },
142
+ "./password-input": {
143
+ "types": "./dist/ui/password-input.d.ts",
144
+ "import": "./dist/ui/password-input.js"
145
+ },
146
+ "./pagination": {
147
+ "types": "./dist/ui/pagination.d.ts",
148
+ "import": "./dist/ui/pagination.js"
149
+ },
150
+ "./phase-banner": {
151
+ "types": "./dist/ui/phase-banner.d.ts",
152
+ "import": "./dist/ui/phase-banner.js"
153
+ },
154
+ "./radios": {
155
+ "types": "./dist/ui/radios.d.ts",
156
+ "import": "./dist/ui/radios.js"
157
+ },
158
+ "./select": {
159
+ "types": "./dist/ui/select.d.ts",
160
+ "import": "./dist/ui/select.js"
161
+ },
162
+ "./service-navigation": {
163
+ "types": "./dist/ui/service-navigation.d.ts",
164
+ "import": "./dist/ui/service-navigation.js"
165
+ },
166
+ "./skip-link": {
167
+ "types": "./dist/ui/skip-link.d.ts",
168
+ "import": "./dist/ui/skip-link.js"
169
+ },
170
+ "./tag": {
171
+ "types": "./dist/ui/tag.d.ts",
172
+ "import": "./dist/ui/tag.js"
173
+ },
174
+ "./tabs": {
175
+ "types": "./dist/ui/tabs.d.ts",
176
+ "import": "./dist/ui/tabs.js"
177
+ },
178
+ "./table": {
179
+ "types": "./dist/ui/table.d.ts",
180
+ "import": "./dist/ui/table.js"
181
+ },
182
+ "./task-list": {
183
+ "types": "./dist/ui/task-list.d.ts",
184
+ "import": "./dist/ui/task-list.js"
185
+ },
186
+ "./text-input": {
187
+ "types": "./dist/ui/text-input.d.ts",
188
+ "import": "./dist/ui/text-input.js"
189
+ },
190
+ "./textarea": {
191
+ "types": "./dist/ui/textarea.d.ts",
192
+ "import": "./dist/ui/textarea.js"
193
+ },
194
+ "./warning-text": {
195
+ "types": "./dist/ui/warning-text.d.ts",
196
+ "import": "./dist/ui/warning-text.js"
197
+ },
198
+ "./summary-list": {
199
+ "types": "./dist/ui/summary-list.d.ts",
200
+ "import": "./dist/ui/summary-list.js"
201
+ }
202
+ },
203
+ "scripts": {
204
+ "dev": "vite",
205
+ "build": "tsc -b && vite build",
206
+ "build:lib": "tsup",
207
+ "lint": "eslint .",
208
+ "preview": "vite preview",
209
+ "storybook": "storybook dev -p 6006",
210
+ "build-storybook": "storybook build",
211
+ "registry:build": "node scripts/build-registry.mjs",
212
+ "prepublishOnly": "npm run build:lib",
213
+ "test": "vitest --project=storybook"
214
+ },
215
+ "peerDependencies": {
216
+ "@base-ui/react": "^1.6.0",
217
+ "react": "^19.0.0",
218
+ "react-dom": "^19.0.0",
219
+ "tailwindcss": "^4.0.0"
220
+ },
221
+ "peerDependenciesMeta": {
222
+ "@base-ui/react": {
223
+ "optional": true
224
+ }
225
+ },
226
+ "dependencies": {
227
+ "class-variance-authority": "^0.7.1",
228
+ "clsx": "^2.1.1",
229
+ "lucide-react": "^0.575.0",
230
+ "tailwind-merge": "^3.6.0"
231
+ },
232
+ "devDependencies": {
233
+ "@base-ui/react": "^1.6.0",
234
+ "@chromatic-com/storybook": "^5.2.1",
235
+ "@eslint/js": "^9.39.1",
236
+ "@tailwindcss/vite": "^4.3.2",
237
+ "@storybook/addon-a11y": "^10.4.6",
238
+ "@storybook/addon-docs": "^10.4.6",
239
+ "@storybook/addon-vitest": "^10.4.6",
240
+ "@storybook/react-vite": "^10.4.6",
241
+ "@types/node": "^24.13.2",
242
+ "@types/react": "^19.2.17",
243
+ "@types/react-dom": "^19.2.3",
244
+ "@vitejs/plugin-react": "^5.2.0",
245
+ "@vitest/browser-playwright": "^4.0.18",
246
+ "@vitest/coverage-v8": "^4.1.2",
247
+ "eslint": "^9.39.4",
248
+ "eslint-plugin-react-hooks": "^7.1.1",
249
+ "eslint-plugin-react-refresh": "^0.4.26",
250
+ "eslint-plugin-storybook": "^10.4.6",
251
+ "globals": "^16.5.0",
252
+ "playwright": "^1.61.1",
253
+ "react": "^19.2.7",
254
+ "react-dom": "^19.2.7",
255
+ "storybook": "^10.4.6",
256
+ "tailwindcss": "^4.2.1",
257
+ "tsup": "^8.5.1",
258
+ "typescript": "~5.9.3",
259
+ "typescript-eslint": "^8.62.1",
260
+ "vite": "^7.3.6",
261
+ "vitest": "^4.0.18"
262
+ }
263
+ }
@@ -0,0 +1,434 @@
1
+ /* ---------------------------------------------------------------------------
2
+ * Whitehall-UI – Design Tokens (based on GOV.UK Design System)
3
+ * https://design-system.service.gov.uk/styles/colour/
4
+ *
5
+ * Defined as Tailwind 4 @theme variables so they generate real utility
6
+ * classes: bg-govuk-green, text-govuk-black, shadow-govuk-green, etc.
7
+ *
8
+ * Consumers: import this file in your main CSS entry point AFTER
9
+ * `@import "tailwindcss"`:
10
+ *
11
+ * @import "tailwindcss";
12
+ * @import "@/theme/govuk-tokens.css";
13
+ *
14
+ * ------------------------------------------------------------------------- */
15
+
16
+ @theme {
17
+ /* Font */
18
+ --font-govuk: Arial, Helvetica, sans-serif;
19
+
20
+ --color-govuk-brand: #1d70b8;
21
+ --color-govuk-brand-hover: #003078;
22
+ --color-govuk-visited: #4c2c92;
23
+ --color-govuk-green: #0f7a52;
24
+ --color-govuk-green-hover: #0b5c3e;
25
+ --color-govuk-green-shadow: #083d29;
26
+ --color-govuk-black: #0b0c0c;
27
+ --color-govuk-light-grey: #f3f3f3;
28
+ --color-govuk-light-grey-shadow: #858686;
29
+ --color-govuk-grey: #cecece;
30
+ --color-govuk-mid-grey: #b1b4b6;
31
+ --color-govuk-dark-grey: #505a5f;
32
+ --color-govuk-red: #ca3535;
33
+ --color-govuk-red-hover: #982828;
34
+ --color-govuk-red-shadow: #651b1b;
35
+ --color-govuk-inverse-hover: #f4f8fb;
36
+ --color-govuk-inverse-shadow: #0f385c;
37
+ --color-govuk-yellow: #ffdd00;
38
+
39
+ /* Error */
40
+ --color-govuk-error: #d4351c;
41
+ --color-govuk-error-hover: #6a1b0e;
42
+
43
+ /* Tag colours */
44
+ --color-govuk-tag-blue: #0f385c;
45
+ --color-govuk-tag-blue-bg: #d2e2f1;
46
+ --color-govuk-tag-green: #083d29;
47
+ --color-govuk-tag-green-bg: #cfe4dc;
48
+ --color-govuk-tag-teal: #0b4144;
49
+ --color-govuk-tag-teal-bg: #d0e6e7;
50
+ --color-govuk-tag-purple: #2a1950;
51
+ --color-govuk-tag-purple-bg: #ddd6ec;
52
+ --color-govuk-tag-magenta: #651b3e;
53
+ --color-govuk-tag-magenta-bg: #f4d7e5;
54
+ --color-govuk-tag-red: #651b1b;
55
+ --color-govuk-tag-red-bg: #f4d7d7;
56
+ --color-govuk-tag-orange: #7a3c1c;
57
+ --color-govuk-tag-orange-bg: #fde4d7;
58
+ --color-govuk-tag-yellow: #7a3c1c;
59
+ --color-govuk-tag-yellow-bg: #ffee80;
60
+
61
+ /* Typography */
62
+ --text-govuk-header: 16px;
63
+ --text-govuk-header--line-height: 1;
64
+ --text-govuk-header-link: 30px;
65
+ --text-govuk-header-link--line-height: 1;
66
+ --text-govuk-body: 19px;
67
+ --text-govuk-body--line-height: 25px;
68
+ --text-govuk-tag: 19px;
69
+ --text-govuk-tag--line-height: 25px;
70
+ --text-govuk-start: 24px;
71
+ --text-govuk-start--line-height: 1;
72
+ --text-govuk-heading-xl: 48px;
73
+ --text-govuk-heading-xl--line-height: 50px;
74
+ --text-govuk-heading-l: 36px;
75
+ --text-govuk-heading-l--line-height: 40px;
76
+ --text-govuk-heading-m: 24px;
77
+ --text-govuk-heading-m--line-height: 25px;
78
+ --text-govuk-warning-icon: 30px;
79
+ --text-govuk-warning-icon--line-height: 29px;
80
+ --text-govuk-phase-banner: 16px;
81
+ --text-govuk-phase-banner--line-height: 1.25;
82
+
83
+ /* Border radius */
84
+ --radius-govuk-tag: 1px;
85
+
86
+ /* Spacing – GOV.UK uses px-based non-standard spacing values */
87
+ --spacing-govuk-1: 5px;
88
+ --spacing-govuk-2: 10px;
89
+ --spacing-govuk-3: 15px;
90
+ --spacing-govuk-4: 20px;
91
+ --spacing-govuk-5: 25px;
92
+ --spacing-govuk-6: 30px;
93
+ --spacing-govuk-7: 40px;
94
+ --spacing-govuk-8: 50px;
95
+ --spacing-govuk-button-x: 10px;
96
+ --spacing-govuk-button-pt: 8px;
97
+ --spacing-govuk-button-pb: 7px;
98
+ --spacing-govuk-button-bottom: 18px;
99
+ --spacing-govuk-button-press: 2px;
100
+
101
+ /* File upload (improved / JS-enhanced) */
102
+ --spacing-govuk-file-upload: 18px;
103
+ --spacing-govuk-file-upload-lg: 23px;
104
+ --spacing-govuk-file-upload-pseudo-mb: 3px;
105
+ --spacing-govuk-file-upload-instruction-mt: 7px;
106
+ --color-govuk-file-upload-hover-border: #6f777b;
107
+
108
+ /* Exit this page */
109
+ --z-index-govuk-exit-page: 1000;
110
+ --z-index-govuk-exit-page-overlay: 9999;
111
+ --spacing-govuk-exit-page-dot: 0.75em;
112
+ --spacing-govuk-exit-page-dot-gap: 0.125em;
113
+ --border-width-govuk-exit-page-dot: 0.375em;
114
+ --color-govuk-canvas: Canvas;
115
+ --color-govuk-canvas-text: CanvasText;
116
+
117
+ /* Border widths – GOV.UK uses non-standard border widths */
118
+ --border-width-govuk-standard: 5px;
119
+ --border-width-govuk-wide: 10px;
120
+
121
+ /* Warning Text */
122
+ --spacing-govuk-warning-icon-size: 35px;
123
+ --spacing-govuk-warning-text-pl: 45px;
124
+ --spacing-govuk-warning-icon-mt: -7px;
125
+ --spacing-govuk-warning-icon-border: 3px;
126
+
127
+ /* Radios & Checkboxes */
128
+ --spacing-govuk-radio-size: 40px;
129
+ --spacing-govuk-radio-touch-target: 44px;
130
+ --spacing-govuk-radio-small-size: 24px;
131
+ --spacing-govuk-radio-dot: 10px;
132
+ --spacing-govuk-radio-small-dot: 5px;
133
+ --spacing-govuk-radio-label-padding-x: 15px;
134
+ --spacing-govuk-radio-focus-width: 4px;
135
+ --spacing-govuk-radio-gutter: 4px;
136
+ --spacing-govuk-checkbox-size: 40px;
137
+ --spacing-govuk-checkbox-touch-target: 44px;
138
+ --spacing-govuk-checkbox-label-padding-x: 15px;
139
+ --spacing-govuk-checkbox-label-padding-y: 7px;
140
+ --spacing-govuk-checkbox-focus-width: 3px;
141
+ --spacing-govuk-checkbox-gutter: 4px;
142
+ --spacing-govuk-checkbox-check-width: 23px;
143
+ --spacing-govuk-checkbox-check-height: 12px;
144
+ --spacing-govuk-checkbox-check-top: 13px;
145
+ --spacing-govuk-checkbox-check-left: 10px;
146
+ --spacing-govuk-checkbox-check-stroke: 5px;
147
+ --spacing-govuk-checkbox-small-size: 24px;
148
+ --spacing-govuk-checkbox-small-box-offset: 10px;
149
+ --spacing-govuk-checkbox-small-check-top: 17px;
150
+ --spacing-govuk-checkbox-small-check-left: 16px;
151
+ --spacing-govuk-checkbox-small-check-width: 12px;
152
+ --spacing-govuk-checkbox-small-check-height: 6.5px;
153
+ --spacing-govuk-checkbox-small-check-stroke: 3px;
154
+ --spacing-govuk-checkbox-conditional-ml: 21px;
155
+ --spacing-govuk-checkbox-conditional-pl: 36px;
156
+ --spacing-govuk-hover-width: 10px;
157
+
158
+ /* Tag padding */
159
+ --spacing-govuk-tag-x: 8px;
160
+ --spacing-govuk-tag-pt: 2px;
161
+ --spacing-govuk-tag-pb: 3px;
162
+ --spacing-govuk-tag-mt: -2px;
163
+ --spacing-govuk-tag-mb: -3px;
164
+ --spacing-govuk-tag-max-width: 160px;
165
+
166
+ /* Fixed input widths – em-based, include extra padding for browser icons */
167
+ --spacing-govuk-input-width-30: 29.5em;
168
+ --spacing-govuk-input-width-20: 20.5em;
169
+ --spacing-govuk-input-width-10: 11.5em;
170
+ --spacing-govuk-input-width-5: 5.5em;
171
+ --spacing-govuk-input-width-4: 4.5em;
172
+ --spacing-govuk-input-width-3: 3.75em;
173
+ --spacing-govuk-input-width-2: 2.75em;
174
+
175
+ --spacing-govuk-select-item-px: 7px;
176
+
177
+ /* Pagination */
178
+ --spacing-govuk-pagination-touch: 45px;
179
+
180
+ /* Header */
181
+ --spacing-govuk-header-link-underline: 3px;
182
+
183
+ /* Letter spacing – extra spacing for codes and reference numbers */
184
+ --tracking-govuk-code: 0.05em;
185
+
186
+ /* Shadows – bottom edge shadows used across buttons, tags, etc. */
187
+ --shadow-govuk-green: 0 2px 0 #083d29;
188
+ --shadow-govuk-light-grey: 0 2px 0 #858686;
189
+ --shadow-govuk-red: 0 2px 0 #651b1b;
190
+ --shadow-govuk-inverse: 0 2px 0 #0f385c;
191
+ --shadow-govuk-yellow: 0 2px 0 #0b0c0c;
192
+ --shadow-govuk-clear: 0 0 #0000;
193
+ }
194
+
195
+ /* Custom utilities – for styles that can’t be expressed via @theme namespaces */
196
+ @utility border-l-govuk-inset {
197
+ border-left: var(--border-width-govuk-wide) solid var(--color-govuk-grey);
198
+ }
199
+
200
+ @utility govuk-checkmark {
201
+ border-style: solid;
202
+ border-color: currentcolor;
203
+ border-width: 0 0 var(--spacing-govuk-checkbox-check-stroke)
204
+ var(--spacing-govuk-checkbox-check-stroke);
205
+ border-top-color: transparent;
206
+ transform: rotate(-45deg);
207
+ background: transparent;
208
+ }
209
+
210
+ @utility govuk-checkbox-composed-shadow {
211
+ box-shadow:
212
+ var(--govuk-cb-focus-shadow, 0 0 #0000),
213
+ var(--govuk-cb-hover-shadow, 0 0 #0000);
214
+ }
215
+
216
+ @utility govuk-checkbox-focus-shadow {
217
+ --govuk-cb-focus-shadow: 0 0 0 var(--spacing-govuk-checkbox-focus-width)
218
+ var(--color-govuk-yellow);
219
+ }
220
+
221
+ @utility govuk-checkbox-small-hover {
222
+ --govuk-cb-hover-shadow: 0 0 0 var(--spacing-govuk-hover-width)
223
+ var(--color-govuk-mid-grey);
224
+ outline: var(--spacing-govuk-checkbox-focus-width) dashed transparent;
225
+ outline-offset: 1px;
226
+ }
227
+
228
+ @utility govuk-checkmark-small {
229
+ border-style: solid;
230
+ border-color: currentcolor;
231
+ border-width: 0 0 var(--spacing-govuk-checkbox-small-check-stroke)
232
+ var(--spacing-govuk-checkbox-small-check-stroke);
233
+ border-top-color: transparent;
234
+ transform: rotate(-45deg);
235
+ background: transparent;
236
+ }
237
+
238
+ @utility min-w-anchor {
239
+ min-width: var(--anchor-width);
240
+ }
241
+
242
+ @utility w-anchor {
243
+ width: var(--anchor-width);
244
+ }
245
+
246
+ @utility govuk-link-focus {
247
+ outline: 3px solid transparent;
248
+ color: var(--color-govuk-black);
249
+ background-color: var(--color-govuk-yellow);
250
+ box-shadow:
251
+ 0 -2px var(--color-govuk-yellow),
252
+ 0 4px var(--color-govuk-black);
253
+ text-decoration: none;
254
+ }
255
+
256
+ @utility border-govuk-error-summary {
257
+ border: var(--border-width-govuk-standard) solid var(--color-govuk-error);
258
+ }
259
+
260
+ @utility border-govuk-notification-banner {
261
+ border: var(--border-width-govuk-standard) solid var(--color-govuk-brand);
262
+ }
263
+
264
+ @utility border-govuk-notification-banner-success {
265
+ border: var(--border-width-govuk-standard) solid var(--color-govuk-green);
266
+ }
267
+
268
+ @utility govuk-link-underline {
269
+ text-underline-offset: 0.1578em;
270
+ text-decoration-thickness: max(1px, 0.0625rem);
271
+ }
272
+
273
+ @utility govuk-link-underline-hover {
274
+ text-decoration-thickness: max(3px, 0.1875rem, 0.12em);
275
+ text-decoration-skip-ink: none;
276
+ text-decoration-skip: none;
277
+ }
278
+
279
+ @utility govuk-skip-link {
280
+ position: absolute;
281
+ width: 1px;
282
+ height: 1px;
283
+ margin: -1px;
284
+ overflow: hidden;
285
+ clip: rect(0, 0, 0, 0);
286
+ clip-path: inset(50%);
287
+ white-space: nowrap;
288
+ border: 0;
289
+
290
+ &:focus {
291
+ position: static;
292
+ width: auto;
293
+ height: auto;
294
+ margin: 0;
295
+ overflow: visible;
296
+ clip: auto;
297
+ clip-path: none;
298
+ white-space: normal;
299
+ z-index: 50;
300
+ outline: 3px solid var(--color-govuk-yellow);
301
+ outline-offset: 0;
302
+ background-color: var(--color-govuk-yellow);
303
+ }
304
+ }
305
+
306
+ @utility govuk-tab {
307
+ &[data-active] {
308
+ margin-top: calc(-1 * var(--spacing-govuk-1));
309
+ margin-bottom: -1px;
310
+ padding-top: 14px;
311
+ padding-right: 19px;
312
+ padding-bottom: 16px;
313
+ padding-left: 19px;
314
+ border: 1px solid var(--color-govuk-mid-grey);
315
+ border-bottom: 0;
316
+ background-color: #fff;
317
+ }
318
+ }
319
+
320
+ @utility govuk-tab-panel-border {
321
+ border: 1px solid var(--color-govuk-mid-grey);
322
+ border-top: 0;
323
+ }
324
+
325
+ @utility govuk-accordion-button-border {
326
+ border: 0;
327
+ border-top: 1px solid var(--color-govuk-mid-grey);
328
+ }
329
+
330
+ @utility govuk-accordion-chevron {
331
+ vertical-align: middle;
332
+ }
333
+
334
+ @utility govuk-table-cell {
335
+ padding: var(--spacing-govuk-2) var(--spacing-govuk-4) var(--spacing-govuk-2)
336
+ 0;
337
+ border-bottom: 1px solid var(--color-govuk-mid-grey);
338
+ text-align: left;
339
+ vertical-align: top;
340
+
341
+ &:last-child {
342
+ padding-right: 0;
343
+ }
344
+ }
345
+
346
+ @utility govuk-pagination-nav-item {
347
+ &:hover {
348
+ background-color: #f3f2f1;
349
+ }
350
+ }
351
+
352
+ @utility govuk-pagination-item-current {
353
+ outline: 1px solid transparent;
354
+ background-color: var(--color-govuk-brand);
355
+
356
+ &:hover {
357
+ background-color: var(--color-govuk-brand);
358
+ }
359
+
360
+ & a,
361
+ & a:link,
362
+ & a:visited,
363
+ & a:hover,
364
+ & a:active {
365
+ color: white;
366
+ }
367
+ }
368
+
369
+ @utility govuk-pagination-link {
370
+ @media screen {
371
+ &::after {
372
+ content: '';
373
+ position: absolute;
374
+ top: 0;
375
+ right: 0;
376
+ bottom: 0;
377
+ left: 0;
378
+ }
379
+ }
380
+ }
381
+
382
+ @utility govuk-pagination-icon {
383
+ width: 0.9375rem;
384
+ height: 0.8125rem;
385
+ color: var(--color-govuk-dark-grey);
386
+ }
387
+
388
+ @utility govuk-pagination-nav-link {
389
+ & > a {
390
+ display: flex;
391
+ align-items: center;
392
+ }
393
+ }
394
+
395
+ @utility govuk-pagination-block {
396
+ display: block;
397
+
398
+ & > div + div {
399
+ border-top: 1px solid var(--color-govuk-mid-grey);
400
+ }
401
+ }
402
+
403
+ @utility govuk-pagination-block-link {
404
+ &:not(:focus) {
405
+ text-decoration: none;
406
+ }
407
+ }
408
+
409
+ @utility govuk-pagination-block-title {
410
+ &::after {
411
+ content: '';
412
+ display: block;
413
+ }
414
+ }
415
+
416
+ @utility govuk-pagination-block-arrow {
417
+ margin-top: 0.326em;
418
+ margin-left: calc(var(--spacing-govuk-6) * -1);
419
+ float: left;
420
+ }
421
+
422
+ @utility govuk-date-input {
423
+ font-size: 0;
424
+
425
+ &::after {
426
+ content: '';
427
+ display: block;
428
+ clear: both;
429
+ }
430
+ }
431
+
432
+ @utility govuk-date-input-field {
433
+ margin-bottom: 0;
434
+ }