@communitiesuk/svelte-component-library 0.1.17 → 0.2.0-alpha.2

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 (97) hide show
  1. package/README.md +116 -98
  2. package/dist/assets/css/base.css +9 -0
  3. package/dist/assets/css/code-block.css +116 -0
  4. package/dist/assets/css/components.css +47 -0
  5. package/dist/assets/css/fonts.css +19 -0
  6. package/dist/assets/css/govuk-additional.css +142 -0
  7. package/dist/assets/css/govuk-frontend.min.css +2 -2
  8. package/dist/assets/css/moduk.css +1 -0
  9. package/dist/assets/css/moj-frontend.min copy.css +4108 -0
  10. package/dist/assets/css/moj-frontend.min.css +2 -0
  11. package/dist/assets/css/moj-frontend.min.css.map +1 -0
  12. package/dist/assets/css/utilities.css +0 -0
  13. package/dist/assets/images/govuk-crest.svg +1 -1
  14. package/dist/assets/js/govuk-frontend.min.js +1 -0
  15. package/dist/assets/js/moj-frontend.min.js +1 -0
  16. package/dist/assets/rebrand/images/favicon.ico +0 -0
  17. package/dist/assets/rebrand/images/favicon.svg +1 -0
  18. package/dist/assets/rebrand/images/govuk-crest.svg +1 -0
  19. package/dist/assets/rebrand/images/govuk-icon-180.png +0 -0
  20. package/dist/assets/rebrand/images/govuk-icon-192.png +0 -0
  21. package/dist/assets/rebrand/images/govuk-icon-512.png +0 -0
  22. package/dist/assets/rebrand/images/govuk-icon-mask.svg +1 -0
  23. package/dist/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  24. package/dist/assets/rebrand/manifest.json +39 -0
  25. package/dist/components/data-vis/line-chart/Line.svelte +48 -41
  26. package/dist/components/data-vis/line-chart/Line.svelte.d.ts +6 -4
  27. package/dist/components/data-vis/line-chart/LineChart.svelte +145 -36
  28. package/dist/components/data-vis/line-chart/LineChart.svelte.d.ts +25 -9
  29. package/dist/components/data-vis/line-chart/Lines.svelte +10 -23
  30. package/dist/components/data-vis/line-chart/Lines.svelte.d.ts +8 -4
  31. package/dist/components/data-vis/line-chart/Marker.svelte +31 -5
  32. package/dist/components/data-vis/line-chart/Marker.svelte.d.ts +6 -2
  33. package/dist/components/data-vis/line-chart/SeriesLabel.svelte +7 -8
  34. package/dist/components/data-vis/line-chart/SeriesLabel.svelte.d.ts +2 -2
  35. package/dist/components/data-vis/line-chart/ValueLabel.svelte +26 -34
  36. package/dist/components/data-vis/line-chart/ValueLabel.svelte.d.ts +8 -4
  37. package/dist/components/data-vis/map/Map.svelte +299 -71
  38. package/dist/components/data-vis/map/Map.svelte.d.ts +39 -12
  39. package/dist/components/data-vis/map/NonStandardControls.svelte +10 -1
  40. package/dist/components/data-vis/map/NonStandardControls.svelte.d.ts +12 -11
  41. package/dist/components/data-vis/map/Tooltip.svelte +3 -4
  42. package/dist/components/data-vis/map/Tooltip.svelte.d.ts +0 -2
  43. package/dist/components/data-vis/map/mapUtils.d.ts +2 -0
  44. package/dist/components/data-vis/map/mapUtils.js +50 -0
  45. package/dist/components/data-vis/table/Table.svelte +28 -40
  46. package/dist/components/data-vis/table/Table.svelte.d.ts +0 -2
  47. package/dist/components/layout/Breadcrumbs.svelte +10 -12
  48. package/dist/components/layout/Breadcrumbs.svelte.d.ts +1 -0
  49. package/dist/components/layout/Footer.svelte +69 -4
  50. package/dist/components/layout/Footer.svelte.d.ts +3 -0
  51. package/dist/components/layout/Header.svelte +56 -16
  52. package/dist/components/layout/Header.svelte.d.ts +1 -0
  53. package/dist/components/layout/InternalHeader.svelte +155 -150
  54. package/dist/components/layout/InternalHeader.svelte.d.ts +1 -0
  55. package/dist/components/ui/Button.svelte +78 -4
  56. package/dist/components/ui/Button.svelte.d.ts +2 -0
  57. package/dist/components/ui/CookieBanner.svelte +356 -0
  58. package/dist/components/ui/CookieBanner.svelte.d.ts +18 -0
  59. package/dist/components/ui/FilterPanel.svelte +167 -158
  60. package/dist/components/ui/FilterPanel.svelte.d.ts +2 -0
  61. package/dist/components/ui/Masthead.svelte +35 -23
  62. package/dist/components/ui/Masthead.svelte.d.ts +2 -0
  63. package/dist/components/ui/PostcodeOrAreaSearch.svelte +200 -0
  64. package/dist/components/ui/PostcodeOrAreaSearch.svelte.d.ts +37 -0
  65. package/dist/components/ui/Search.svelte +2 -2
  66. package/dist/components/ui/SearchAutocomplete.svelte +104 -14
  67. package/dist/components/ui/SearchAutocomplete.svelte.d.ts +4 -0
  68. package/dist/data/IMD2019.json +32846 -0
  69. package/dist/data/places.csv +20039 -0
  70. package/dist/data/places.json +100192 -0
  71. package/dist/data/svgFontDimensions.json +90 -0
  72. package/dist/data/testData.json +52632 -0
  73. package/dist/index.d.ts +2 -0
  74. package/dist/index.js +2 -0
  75. package/dist/package-wrapping/BaseInformation.svelte +0 -33
  76. package/dist/package-wrapping/SidebarContainer.svelte +0 -7
  77. package/dist/utils/area-search/geoConfig.d.ts +435 -0
  78. package/dist/utils/area-search/geoConfig.js +291 -0
  79. package/dist/utils/cookiesNavigation.d.ts +44 -0
  80. package/dist/utils/cookiesNavigation.js +63 -0
  81. package/dist/utils/data-transformations/convert-csv-to-json-proper.cjs +88 -0
  82. package/dist/utils/data-transformations/convert-csv-to-json-proper.d.cts +1 -0
  83. package/dist/utils/data-transformations/convertCSV.d.ts +6 -0
  84. package/dist/utils/data-transformations/convertCSV.js +40 -21
  85. package/dist/utils/text-string-conversion/textStringConversion.d.ts +6 -0
  86. package/dist/utils/text-string-conversion/textStringConversion.js +10 -0
  87. package/package.json +18 -7
  88. package/dist/components/ui/Breadcrumbs.svelte +0 -198
  89. package/dist/components/ui/Breadcrumbs.svelte.d.ts +0 -24
  90. package/dist/components/ui/Footer.svelte +0 -171
  91. package/dist/components/ui/Footer.svelte.d.ts +0 -30
  92. package/dist/components/ui/Header.svelte +0 -43
  93. package/dist/components/ui/Header.svelte.d.ts +0 -7
  94. package/dist/components/ui/ServiceNavigation.svelte +0 -143
  95. package/dist/components/ui/ServiceNavigation.svelte.d.ts +0 -13
  96. package/dist/components/ui/SideNavigation.svelte +0 -346
  97. package/dist/components/ui/SideNavigation.svelte.d.ts +0 -25
package/README.md CHANGED
@@ -1,69 +1,92 @@
1
- # Quick Start Installation
1
+ # MHCLG Svelte Component Library
2
2
 
3
- Because this package is currently privately published to the GitHub npm package registry, you'll need to log in to the package registry before you can install the package. To log in you'll need your GitHub username and a personal access token with the correct permissions.
3
+ A comprehensive component library for government digital services, built with Svelte 5 and following GOV.UK Design System principles.
4
4
 
5
- ## 1. To get your personal access token on GitHub, follow these steps:
5
+ ## Prerequisites
6
6
 
7
- 1. **Log in to GitHub**: Go to your GitHub account.
8
- 2. **Navigate to Developer Settings**:
9
- * Click on your profile photo in the upper-right corner of the page.
10
- * Select Settings.
11
- * In the left sidebar, click Developer settings.
12
- 3. **Access Personal Access Tokens**:
13
- * Under the Personal access tokens section in the sidebar, click either Tokens (classic) or Fine-grained tokens, depending on your preference.
14
- 4. **Generate a New Token**:
15
- * Click Generate new token (for classic tokens, select Generate new token (classic)).
16
- * Provide a descriptive name in the "Note" field.
17
- * Set an expiration date if needed.
18
- * Choose the required scopes or permissions for the token. For installing the package, we will need "write:packages" (Upload packages to GitHub Package Registry), "read:packages" (Download packages from GitHub Package Registry) and "repo".
7
+ This component library is designed for use with:
19
8
 
20
- 5. **Generate and Save the Token**:
21
- * Click Generate token.
22
- * Optionally, copy the new token to your clipboard for immediate use. Make sure to save it securely, as you won’t be able to view it again.
9
+ - **SvelteKit projects** - The components are built for SvelteKit applications
23
10
 
24
- ## 2. Next, you will need to add the GitHub registry path to the npm config file `.npmrc` so that npm knows to look for the package we want to authenticate for within the GitHub registry rather than the npm website.
11
+ - **Svelte 5** - Components use the latest Svelte 5 syntax and runes
25
12
 
26
- 1. Add this line to the `.npmrc` file: `@communitiesuk:registry=https://npm.pkg.github.com`
13
+ ## Documentation and Examples
27
14
 
28
- ## 3. Now we can log in:
15
+ Visit our [component library documentation](https://communitiesuk.github.io/mhclg_svelte_component_library/) for:
29
16
 
30
- 1. Enter the following command into the terminal:
31
- ```bash
32
- npm login --scope=@communitiesuk --auth-type=legacy --registry=https://npm.pkg.github.com
33
- ```
34
- 2. Enter your GitHub username, followed by the PAT token we obtained in the previous step as the password. When copying the token into the terminal, it may not be visible. Press the "Enter" key regardless and it should submit.
17
+ - Interactive component examples
18
+ - API documentation
19
+ - Usage patterns and best practices
20
+ - Installation guides
35
21
 
36
- > Username: USERNAME
37
- > Password: TOKEN
22
+ ## Quick Start Installation
38
23
 
39
- More information about the GitHub npm registry can be found here: [https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry)
24
+ The package is publicly available on npm:
40
25
 
41
- ## 4. Now you are logged in, you can install the package:
26
+ ```bash
27
+ npm install @communitiesuk/svelte-component-library@latest
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ### GOV.UK Frontend Styles
33
+
34
+ To ensure GOV.UK styles are applied correctly, add this script tag to your `app.html` file in the body section:
35
+
36
+ ```html
37
+ <script>
38
+ document.body.className +=
39
+ " js-enabled" +
40
+ ("noModule" in HTMLScriptElement.prototype
41
+ ? " govuk-frontend-supported"
42
+ : "");
43
+ </script>
44
+ ```
42
45
 
43
- 1. Enter the npm install command for this package, using the latest version. The package should start installing.
46
+ This is required because the GOV.UK Frontend CSS checks the document body for JavaScript availability to progressively enhance components.
44
47
 
45
- To import a component from the newly installed package, you can add an import statement in the following structure to your Svelte page file:
48
+ ### GOV.UK Rebranded Styles (Optional)
49
+
50
+ To use the refreshed GOV.UK brand (launched June 2025), add the `govuk-template--rebranded` class to your `app.html` body element:
51
+
52
+ ```html
53
+ <body class="govuk-template--rebranded">
54
+ <!-- Your app content -->
55
+ </body>
56
+ ```
57
+
58
+ **When to use rebrand:**
59
+
60
+ - **Global CSS styles**: The `govuk-template--rebranded` class on `<body>` automatically applies rebranded styles to all components
61
+ - **Component markup**: Some components (like Footer and Header) have a `rebrand` prop that controls whether they show additional rebranded markup elements (like the crown logo). The rebrand prop is set to true by default on all relavent componets - you can specify false should you want to keep the old markup and assets.
62
+ - **Assets**: Rebranded components will use updated assets (logos, icons) from the `/assets/rebrand/` folder
63
+
64
+ **Example with rebranded Footer:**
46
65
 
47
66
  ```javascript
48
- import { InternalHeader, NotificationBanner, WarningText, SearchAutocomplete, Accordion} from "@communitiesuk/svelte-component-library";
67
+ import { Footer } from "@communitiesuk/svelte-component-library";
68
+
69
+ // Use rebrand=true to show the crown logo at top of footer
70
+ <Footer rebrand={true} />;
49
71
  ```
50
72
 
51
- See the documentation app for examples of how to use the imported components.
73
+ ### Importing Components
52
74
 
53
- 2. To make sure govuk styles are applied correctly add this script tag to the app.html body tag section:
75
+ Import components directly from the package:
54
76
 
55
77
  ```javascript
56
- <script>
57
- document.body.className +=
58
- " js-enabled" +
59
- ("noModule" in HTMLScriptElement.prototype
60
- ? " govuk-frontend-supported"
61
- : "");
62
- </script>
78
+ import {
79
+ InternalHeader,
80
+ NotificationBanner,
81
+ WarningText,
82
+ SearchAutocomplete,
83
+ Accordion,
84
+ } from "@communitiesuk/svelte-component-library";
63
85
  ```
86
+
64
87
  # Releasing a new version of the Svelte Component Library
65
88
 
66
- This guide outlines the steps to bump the version of your package, tag the release in Git, and push it to prepare for publishing.
89
+ This guide outlines the steps to bump the version of your package, tag the release in Git, and publish to npm.
67
90
 
68
91
  ## 1. Commit Your Changes
69
92
 
@@ -80,75 +103,80 @@ Make sure you are on your main development branch you want to release (e.g., `ma
80
103
 
81
104
  Use the `npm version` command to update `package.json` and `package-lock.json`, create a commit, and create an annotated Git tag. Choose **one** of the following based on [Semantic Versioning (SemVer)](https://semver.org/):
82
105
 
83
- * **Patch Release (Bug fixes, tiny changes - e.g., 0.1.8 -> 0.1.9):**
84
- ```bash
85
- npm version patch
86
- ```
87
- * **Minor Release (New features, backward-compatible - e.g., 0.1.8 -> 0.2.0):**
88
- ```bash
89
- npm version minor
90
- ```
91
- * **Major Release (Breaking changes - e.g., 0.1.8 -> 1.0.0):**
92
- ```bash
93
- npm version major
94
- ```
95
- * **Specific Version:**
96
- ```bash
97
- npm version <new-version> # Replace <new-version> with the desired version, e.g., 1.2.3
98
- ```
106
+ - **Patch Release (Bug fixes, tiny changes - e.g., 1.0.0 → 1.0.1):**
99
107
 
100
- ## 3. Push Changes and Tags
108
+ ```bash
109
+ npm version patch
110
+ ```
101
111
 
102
- Push the commit and the new tag created by `npm version` to your remote Git repository (e.g., GitHub):
112
+ - **Minor Release (New features, backwards compatible - e.g., 1.0.0 → 1.1.0):**
103
113
 
104
- ```bash
105
- git push && git push --tags
106
- ```
114
+ ```bash
115
+ npm version minor
116
+ ```
107
117
 
108
- * `git push`: Pushes the version commit.
109
- * `git push --tags`: Pushes the newly created version tag.
118
+ - **Major Release (Breaking changes - e.g., 1.0.0 → 2.0.0):**
119
+ ```bash
120
+ npm version major
121
+ ```
110
122
 
111
- ## 4. Publishing (Automatic via GitHub Actions)
123
+ This command will:
112
124
 
113
- Now the tag has been pushed, we can create a release on GitHub to trigger the GitHub Actions workflow defined in `.github/workflows/npm-publish-github-packages.yml`, which will handle the actual `npm publish` step to GitHub Packages.
125
+ - Update the version number in `package.json` and `package-lock.json`
126
+ - Create a new commit with the version bump
127
+ - Create a Git tag with the new version number
114
128
 
115
- Click on "create new release" from the repo homepage.
129
+ ## 3. Push Changes and Tags
116
130
 
117
- Choose the target branch that you want to release (e.g. main).
131
+ Push the commit and the new tag created by `npm version` to the remote Git repository (e.g., GitHub):
118
132
 
119
- Choose the tag version pushed to GitHub in a previous step.
133
+ ```bash
134
+ git push && git push --tags
135
+ ```
120
136
 
121
- Click generate release notes, and add any additional write-up to describe the changes in this release.
137
+ - `git push`: Pushes the version commit.
138
+ - `git push --tags`: Pushes the newly created version tag.
122
139
 
123
- Amend the release title to something appropriate, including the version number in the title.
140
+ ## 4. Create a GitHub Release
124
141
 
125
- Click "Set as pre-release" given the package is not stable yet.
142
+ 1. Go to the GitHub repository
143
+ 2. Click on "Releases" in the right sidebar
144
+ 3. Click "Create a new release"
145
+ 4. Select the tag you just created (e.g., `v1.0.1`)
146
+ 5. Add a release title and description
147
+ 6. Click "Publish release"
126
148
 
127
- Click the publish release button.
149
+ ## 5. Automatic Publishing
128
150
 
129
- If you now go to the "Actions" tab in the repo's horizontal nav bar, you'll see the publish workflow being triggered. Once complete, the package will be uploaded and the new version can be installed.
151
+ Once you create the GitHub release, If you now go to the "Actions" tab in the repo's horizontal nav bar, you'll see the publish workflow being triggered. The GitHub Actions workflow (`.github/workflows/npm-publish.yml`) will automatically:
130
152
 
131
- # create-svelte
153
+ - Build the package
154
+ - Publish it to npm public registry
155
+ - Make it available for installation via `npm install @communitiesuk/svelte-component-library`
132
156
 
133
- Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
157
+ ## 6. Verify the Release
134
158
 
135
- Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
159
+ After the GitHub Action completes, verify that your package was published successfully:
136
160
 
137
- ## Creating a project
161
+ 1. Check the [npm package page](https://www.npmjs.com/package/@communitiesuk/svelte-component-library)
162
+ 2. Try installing the new version in a test project:
163
+ ```bash
164
+ npm install @communitiesuk/svelte-component-library@latest
165
+ ```
138
166
 
139
- If you're seeing this, you've probably already done this step. Congrats!
167
+ ## Notes
140
168
 
141
- ```bash
142
- # create a new project in the current directory
143
- npx sv create
169
+ - Only create releases from the "main" branch to ensure stability
170
+ - Always test changes thoroughly before creating a release
171
+ - Consider creating pre-release versions for testing: `npm version prerelease --preid=alpha`
144
172
 
145
- # create a new project in my-app
146
- npx sv create my-app
147
- ```
173
+ # Developing and Building Commands
174
+
175
+ This project is built with [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
148
176
 
149
177
  ## Developing
150
178
 
151
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
179
+ Start a development server:
152
180
 
153
181
  ```bash
154
182
  npm run dev
@@ -176,13 +204,3 @@ npm run build
176
204
  You can preview the production build with `npm run preview`.
177
205
 
178
206
  > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
179
-
180
- ## Publishing
181
-
182
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also, consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
183
-
184
- To publish your library to [npm](https://www.npmjs.com):
185
-
186
- ```bash
187
- npm publish
188
- ```
@@ -0,0 +1,9 @@
1
+ @layer base {
2
+ .link-to-other-page {
3
+ @apply underline underline-offset-4;
4
+ }
5
+
6
+ .g-top-level-container {
7
+ @apply w-full lg:w-3/4 max-w-3xl mx-auto my-10 px-5;
8
+ }
9
+ }
@@ -0,0 +1,116 @@
1
+ /* Code block styles */
2
+ .code-block {
3
+ background: var(--sk-bg-2);
4
+ border: 1px solid var(--sk-border);
5
+ border-radius: var(--sk-border-radius);
6
+ margin: 0px;
7
+ position: relative;
8
+ }
9
+
10
+ .code-block pre {
11
+ box-sizing: border-box;
12
+ color: var(--shiki-color-text);
13
+ border-radius: var(--sk-border-radius);
14
+ width: 100%;
15
+ margin: 0;
16
+ padding: 0.2rem 0.3rem;
17
+ position: relative;
18
+ overflow-x: auto;
19
+ white-space: pre-wrap; /* Wraps long lines */
20
+ word-break: break-word; /* Prevents breaking words unnecessarily */
21
+ overflow-x: auto;
22
+ }
23
+
24
+ .code-block pre code {
25
+ background: 0 0;
26
+ width: 100%;
27
+ margin: 0;
28
+ padding: 0;
29
+ display: block;
30
+ top: 0;
31
+ }
32
+
33
+ .code-block .controls {
34
+ --height: 3.6rem;
35
+ height: var(--height);
36
+ z-index: 2;
37
+ box-sizing: border-box;
38
+ justify-content: end;
39
+ align-items: center;
40
+ gap: 0.5rem;
41
+ padding: 0.3rem 0.5rem;
42
+ display: flex;
43
+ position: absolute;
44
+ top: 0;
45
+ right: 0;
46
+ }
47
+
48
+ .code-block .controls:has(.filename) {
49
+ background: var(--sk-bg-3);
50
+ padding-left: 1rem;
51
+ position: relative;
52
+ }
53
+
54
+ .code-block .controls:not(:has(.filename)) {
55
+ background: inherit;
56
+ }
57
+
58
+ .code-block .controls .filename {
59
+ content: attr(data-file);
60
+ font: var(--sk-font-ui-small);
61
+ color: var(--sk-fg-3);
62
+ text-overflow: ellipsis;
63
+ white-space: nowrap;
64
+ flex: 1;
65
+ display: block;
66
+ position: relative;
67
+ top: 0.1rem;
68
+ overflow: hidden;
69
+ }
70
+
71
+ .code-block .controls .filename:after {
72
+ content: attr(data-ext);
73
+ }
74
+
75
+ .controls .copy-to-clipboard {
76
+ height: calc(var(--height) - 1rem);
77
+ aspect-ratio: 1;
78
+ border-radius: var(--sk-border-radius);
79
+ position: relative;
80
+ }
81
+
82
+ .code-block .controls .copy-to-clipboard[disabled] {
83
+ opacity: 1;
84
+ }
85
+
86
+ .code-block .controls .copy-to-clipboard:before,
87
+ .code-block .controls .copy-to-clipboard:after {
88
+ content: "";
89
+ background: 50%/1.6rem 1.6rem no-repeat;
90
+ width: 100%;
91
+ height: 100%;
92
+ transition: opacity 0.2s 0.6s;
93
+ display: block;
94
+ position: absolute;
95
+ top: 0;
96
+ left: 0;
97
+ }
98
+
99
+ .code-block .controls .copy-to-clipboard:before {
100
+ background-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='11.2'%20height='14'%20x='7.9'%20y='3'%20rx='1.5'%20ry='1.5'%20style='fill:none;stroke:%23000000e0;stroke-miterlimit:10;stroke-width:1.5px'/%3e%3cpath%20d='M4%207v12.5c0%20.8.7%201.5%201.5%201.5h10'%20style='fill:none;stroke:%23000000e0;stroke-miterlimit:10;stroke-width:1.5px;stroke-linecap:round'/%3e%3c/svg%3e");
101
+ }
102
+
103
+ .code-block .controls .copy-to-clipboard:after {
104
+ opacity: 0;
105
+ background-image: url("data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21%207-12%2012-5.5-5.5%201.41-1.41%204.09%204.08%2010.59-10.58z'%20fill='%23000000e0'/%3e%3c/svg%3e");
106
+ }
107
+
108
+ .code-block .controls .copy-to-clipboard:active:before {
109
+ opacity: 0;
110
+ transition: none;
111
+ }
112
+
113
+ .code-block .controls .copy-to-clipboard:active:after {
114
+ opacity: 1;
115
+ transition: none;
116
+ }
@@ -0,0 +1,47 @@
1
+ @layer components {
2
+ [data-role="details-container"]
3
+ [data-role="component-information-array-container"] {
4
+ @apply flex flex-col gap-6;
5
+ }
6
+
7
+ [data-role="details-container"]
8
+ [data-role="component-information-detail-grid-container"] {
9
+ @apply grid grid-cols-[120px_auto] gap-x-6;
10
+ }
11
+
12
+ [data-role="details-container"]
13
+ [data-role="component-information-detail-grid-container"] {
14
+ dt {
15
+ @apply break-words hyphens-auto;
16
+ }
17
+ }
18
+
19
+ [data-role="details-container"]
20
+ [data-role="component-information-detail-grid-container"]
21
+ dd
22
+ p:first-of-type {
23
+ @apply mt-0;
24
+ }
25
+
26
+ [data-role="details-container"]
27
+ [data-role="component-information-detail-grid-container"]
28
+ dd
29
+ p:last-of-type {
30
+ @apply mb-0;
31
+ }
32
+
33
+ [data-role="examples-section"] {
34
+ @apply max-w-screen-lg my-0;
35
+ }
36
+ [data-role="demo-section"] {
37
+ @apply max-w-screen-lg mx-auto my-0;
38
+ }
39
+
40
+ [data-role="component-container"] {
41
+ @apply grid place-items-center;
42
+ }
43
+ }
44
+
45
+ [role="tabpanel"] {
46
+ @apply my-2 mx-0 p-0;
47
+ }
@@ -0,0 +1,19 @@
1
+ @font-face {
2
+ font-family: "GDS Transport";
3
+ font-style: normal;
4
+ font-weight: normal;
5
+ src:
6
+ url("/fonts/light-94a07e06a1-v2.woff2") format("woff2"),
7
+ url("/fonts/light-f591b13f7d-v2.woff") format("woff");
8
+ font-display: fallback;
9
+ }
10
+
11
+ @font-face {
12
+ font-family: "GDS Transport";
13
+ font-style: normal;
14
+ font-weight: bold;
15
+ src:
16
+ url("/fonts/bold-b542beb274-v2.woff2") format("woff2"),
17
+ url("/fonts/bold-affa96571d-v2.woff") format("woff");
18
+ font-display: fallback;
19
+ }
@@ -0,0 +1,142 @@
1
+ :root {
2
+ /* Font families */
3
+ --sk-font-family-ui: "Fira Sans", -apple-system, sans-serif;
4
+ --sk-font-family-body: "GDS Transport", Georgia, serif;
5
+ --sk-font-family-heading: "DM Serif Display", Georgia, serif;
6
+ --sk-font-family-mono: "Fira Mono", monospace;
7
+
8
+ /* Font sizes and line heights */
9
+ --sk-font-size-body: 1.8rem;
10
+ --sk-line-height-body: calc(1.5 * var(--sk-font-size-body));
11
+
12
+ /* Colors */
13
+ --sk-fg-1: #141414;
14
+ --sk-fg-2: #262626;
15
+ --sk-fg-3: #666;
16
+ --sk-fg-4: gray;
17
+ --sk-fg-accent: #d43008;
18
+ --sk-bg-1: #fff;
19
+ --sk-bg-2: #fdfdfd;
20
+ --sk-bg-3: #fafafa;
21
+ --sk-bg-4: #f2f2f2;
22
+ --sk-border: #ebebeb;
23
+ --sk-scrollbar: #0000004d;
24
+ --sk-bg-selection: #42b4ff4d;
25
+
26
+ /* Borders and spacing */
27
+ --sk-border-radius: .4rem;
28
+ --sk-page-padding-side: 1.6rem;
29
+ }
30
+
31
+ /* Base styles */
32
+ * {
33
+
34
+ scrollbar-width: thin;
35
+ scrollbar-color: var(--sk-scrollbar) transparent;
36
+ }
37
+
38
+ ::selection {
39
+ background: var(--sk-bg-selection);
40
+ }
41
+
42
+ /* GDS Example frame styles */
43
+ .app-example-wrapper {
44
+ margin-top: 20px;
45
+ margin-bottom: 20px;
46
+ border: 1px solid #b1b4b6;
47
+ border-top-width: 1px;
48
+ border-right-width: 1px;
49
+ border-bottom-width: 1px;
50
+ border-left-width: 1px;
51
+ border-top-style: solid;
52
+ border-right-style: solid;
53
+ border-bottom-style: solid;
54
+ border-left-style: solid;
55
+ border-top-color: rgb(177, 180, 182);
56
+ border-right-color: rgb(177, 180, 182);
57
+ border-bottom-color: rgb(177, 180, 182);
58
+ border-left-color: rgb(177, 180, 182);
59
+ border-image-source: initial;
60
+ border-image-slice: initial;
61
+ border-image-width: initial;
62
+ border-image-outset: initial;
63
+ border-image-repeat: initial;
64
+ /* border-top: 0; */
65
+ border-top-width: 1px;
66
+ /* border-top-style: initial;
67
+ border-top-color: initial; */
68
+ }
69
+
70
+ .app-example {
71
+ position: relative;
72
+ font-size: 16px;
73
+ line-height: 1.25;
74
+ border-top: 1px solid #b1b4b6;
75
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJUlEQVQoU2P88ePHfwY0wMHBwYguxjgUFKI7GsTH5m4M3w1ChQAZTSeO0/AZpgAAAABJRU5ErkJggg==") repeat;
76
+ }
77
+
78
+ .app-example--tabs {
79
+ margin-bottom: 0;
80
+ }
81
+
82
+ .app-example__toolbar {
83
+ padding: 10px;
84
+ border-bottom: 1px solid #b1b4b6;
85
+ background: #ffffff;
86
+ }
87
+
88
+ .app-example__frame {
89
+ display: block;
90
+ width: 100%;
91
+ max-width: 100%;
92
+ border: 0;
93
+ border-right: 1px solid #b1b4b6;
94
+ background: #ffffff;
95
+ }
96
+
97
+ /* Frame sizes */
98
+ .app-example__frame,
99
+ .app-example__frame--xs {
100
+ height: 150px;
101
+ }
102
+
103
+ .app-example__frame--s {
104
+ height: 250px;
105
+ }
106
+
107
+ .app-example__frame--m {
108
+ height: 350px;
109
+ }
110
+
111
+ .app-example__frame--l {
112
+ height: 450px;
113
+ }
114
+
115
+ .app-example__frame--xl {
116
+ height: 650px;
117
+ }
118
+
119
+ .app-example__frame--resizable {
120
+ min-width: 230px;
121
+ min-height: 50px;
122
+ overflow: auto;
123
+ transform: translate3d(0, 0, 0);
124
+ }
125
+
126
+ @media (min-width: 40.0625em) {
127
+ .app-example__frame--resizable {
128
+ resize: both;
129
+ }
130
+ }
131
+
132
+ .app-example__code {
133
+ position: relative;
134
+ }
135
+
136
+ /* Responsive margin utilities */
137
+ @media (min-width: 40.0625em) {
138
+ .app-example-wrapper {
139
+ margin-top: 40px;
140
+ margin-bottom: 40px;
141
+ }
142
+ }