You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: storybook/stories/api-reference/javascript-api-reference.mdx
+5-6
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
1
import { Canvas, Meta } from'@storybook/blocks';
2
-
import { Link } from'../components/Link.jsx';
3
2
4
3
<Metatitle="Docs/JavaScript API Reference" />
5
4
6
5
# JavaScript API Reference
7
6
8
-
Some of our components can receive configuration options when you create an instance in JavaScript. This page lists the available options for these components. You can find further information on how to <Linkhref='?path=/docs/docs-configure-components-with-javascript--docs'>configure these options in our guidance</Link>.
7
+
Some of our components can receive configuration options when you create an instance in JavaScript. This page lists the available options for these components. You can find further information on how to [configure these options in our guidance](?path=/docs/docs-configure-components-with-javascript--docs).
9
8
10
9
You can pass these options in an object either as:
11
10
@@ -164,7 +163,7 @@ Default: see properties
164
163
165
164
Type: `object`
166
165
167
-
Message displayed when the number of characters is under the configured maximum, `maxlength`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining characters. This is a <Linkhref='?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules'>pluralised list of messages</Link>.
166
+
Message displayed when the number of characters is under the configured maximum, `maxlength`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining characters. This is a [pluralised list of messages](?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules).
168
167
169
168
Default:
170
169
@@ -191,7 +190,7 @@ You have 0 characters remaining
191
190
192
191
Type: `object`
193
192
194
-
Message displayed when the number of characters is over the configured maximum, `maxlength`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining characters. This is a <Linkhref='?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules'>pluralised list of messages</Link>.
193
+
Message displayed when the number of characters is over the configured maximum, `maxlength`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining characters. This is a [pluralised list of messages](?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules).
195
194
196
195
Default:
197
196
@@ -207,7 +206,7 @@ Default:
207
206
Type: `object`
208
207
209
208
Message displayed when the number of words is under the configured maximum, `maxwords`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder
210
-
with the number of remaining words. This is a <Linkhref='?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules'>pluralised list of messages</Link>
209
+
with the number of remaining words. This is a [pluralised list of messages](?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules)
211
210
212
211
Default:
213
212
@@ -234,7 +233,7 @@ You have 0 words remaining
234
233
235
234
Type: `object`
236
235
237
-
Message displayed when the number of words is over the configured maximum, `maxwords`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining words. This is a <Linkhref='?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules'>pluralised list of messages</Link>.
236
+
Message displayed when the number of words is over the configured maximum, `maxwords`. This message is displayed visually and through assistive technologies. The component will replace the `{'%{count}'}` placeholder with the number of remaining words. This is a [pluralised list of messages](?path=/story/docs-localise-ogcio-ds--docs#pluralisation-rules).
Copy file name to clipboardExpand all lines: storybook/stories/get-started/configure-components-javascript.mdx
+2-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
import { Canvas, Meta } from'@storybook/blocks';
2
-
import { Link } from'../components/Link.jsx';
3
2
4
3
<Metatitle="Docs/Configure components with JavaScript" />
5
4
@@ -41,7 +40,7 @@ If your configuration contains [quotes or other reserved HTML characters](https:
41
40
42
41
Configuration is read from data attributes when the component is initialised. Changes to the data attributes made after the component has been initialised will have no effect on the behaviour of the component.
43
42
44
-
Read the <Linkhref='?path=/docs/docs-javascript-api-reference--docs'>JavaScript API Reference</Link> for the configuration accepted by each component. You'll need to convert the configuration names into kebab-case.
43
+
Read the [JavaScript API Reference](?path=/docs/docs-javascript-api-reference--docs) for the configuration accepted by each component. You'll need to convert the configuration names into kebab-case.
45
44
46
45
## Passing configuration to a new instance of a component in JavaScript
47
46
@@ -73,7 +72,7 @@ new CharacterCount($element, {
73
72
}).init();
74
73
```
75
74
76
-
Read the <Linkhref='?path=/docs/docs-javascript-api-reference--docs'>JavaScript API Reference</Link> to see what configuration each component accepts.
75
+
Read the [JavaScript API Reference](?path=/docs/docs-javascript-api-reference--docs) to see what configuration each component accepts.
77
76
78
77
## Passing configuration using the initAll function
Copy file name to clipboardExpand all lines: storybook/stories/get-started/get-started.mdx
+6-7
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
import { Canvas, Meta } from'@storybook/blocks';
2
-
import { Link } from'../components/Link.jsx';
3
2
4
3
<Metatitle="Docs/Get started" />
5
4
@@ -17,13 +16,13 @@ You will need to do all the following steps to get your component working.
17
16
18
17
## 1. Install Gov IE Frontend package
19
18
20
-
- You can <Linkhref="?path=/docs/docs-install-with-npm--docs">install Gov IE Frontend using npm</Link>.
19
+
- You can [install Gov IE Frontend using npm](?path=/docs/docs-install-and-update-with-npm--docs).
21
20
22
-
- If you've <Linkhref='?path=/story/docs-install-using-precompiled-files--docs'>installed using precompiled files</Link>, get started with a <Linkhref='?path=/story/docs-install-using-precompiled-files--docs#basic-example-page'>a basic page instead</Link>.
21
+
- If you've [installed using precompiled files](?path=/story/docs-install-using-precompiled-files--docs), get started with [a basic page instead](?path=/story/docs-install-using-precompiled-files--docs#basic-example-page).
23
22
24
23
## 2. Add the HTML for a component to your application
25
24
26
-
- Go to the <Linkhref='?path=/docs/typography-accordion--default'>example accordion component</Link>.
25
+
- Go to the [example accordion component](?path=/docs/typography-accordion--default).
27
26
28
27
- Paste the HTML into a page or template in your application.
29
28
@@ -48,7 +47,7 @@ Run your application and check that the accordion displays correctly.
48
47
49
48
The accordion will use a generic font until you get the font and images working, and will not be interactive until you get the JavaScript working.
50
49
51
-
There are also different ways you can <Linkhref='?path=/docs/docs-import-css-assets-and-javascript--docs'>import Gov IE Frontend CSS</Link>.
50
+
There are also different ways you can [import Gov IE Frontend CSS](?path=/docs/docs-import-css-assets-and-javascript--docs).
52
51
53
52
## 4. Get the font and images working
54
53
@@ -61,7 +60,7 @@ Your component will not use the right font or images until you've added Gov IE F
61
60
62
61
Run your application, then use [the Fonts tab in Firefox Page Inspector](https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Edit_fonts#The_Fonts_tab) to check the accordion is using the Lato font.
63
62
64
-
In your live application, we recommend <Linkhref='?path=/docs/docs-import-css-assets-and-javascript--docs#fonts-and-images-assets'>using an automated task or your build pipeline</Link> instead of copying the files manually.
63
+
In your live application, we recommend [using an automated task or your build pipeline](?path=/docs/docs-import-css-assets-and-javascript--docs#fonts-and-images-assets) instead of copying the files manually.
65
64
66
65
## 5. Get the JavaScript working
67
66
@@ -94,6 +93,6 @@ In your live application:
94
93
95
94
- You must use `initAll` to initialise all components that use Gov IE Frontend JavaScript, or some components will not work correctly for disabled users who use assistive technologies
96
95
97
-
We recommend <Linkhref='?path=/docs/docs-import-css-assets-and-javascript--docs#import-javascript'>using an automated task or your build pipeline</Link> instead of copying the files manually
96
+
We recommend [using an automated task or your build pipeline](?path=/docs/docs-import-css-assets-and-javascript--docs#import-javascript) instead of copying the files manually
98
97
99
98
You can now get the full code for page layouts and other components from this website.
Copy file name to clipboardExpand all lines: storybook/stories/get-started/install-with-files.mdx
+4-4
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ You can install Gov IE Frontend by copying our CSS, JavaScript and asset files i
13
13
14
14
You'll not be able to:
15
15
16
-
- Change <Linkhref='?path=/story/docs-sass-api-reference--docs'>Sass settings</Link>, for example override colours or set your own font
16
+
- Change [Sass settings](?path=/story/docs-sass-api-reference--docs), for example override colours or set your own font
17
17
-Importanindividualcomponent's CSS or JavaScript
18
18
- Use Gov IE Frontend colours or mixins in your custom code
19
19
@@ -26,7 +26,7 @@ You'll not be able to:
26
26
27
27
## Check an example page
28
28
29
-
1. Create a page in your project using the following HTML (in your live application, you should use the <Linkhref='?path=/docs/templates-basic-page--default'>Design System basic page template</Link> instead):
29
+
1. Create a page in your project using the following HTML (in your live application, you should use the [Design System basic page template](?path=/docs/templates-basic-page--default) instead):
30
30
31
31
```html
32
32
<!doctype html>
@@ -58,6 +58,6 @@ You'll not be able to:
58
58
```
59
59
60
60
2. Replace `<VERSION-NUMBER>` so the 3 filenames match the files you copied from Gov IE Frontend GitHub repo.
61
-
3. Go to the <Linkhref='?path=/docs/typography-accordion--default'>example accordion component</Link> on the Design System website and copy the HTML from the first example.
61
+
3. Go to the [example accordion component](?path=/docs/typography-accordion--default) on the Design System website and copy the HTML from the first example.
62
62
4. Replace `<!-- component HTML -->` with the accordion HTML you copied.
63
-
5. Run your application - you can check it works the same way as the <Linkhref="iframe.html?id=typography-accordion--default&viewMode=story">Design System accordion example</Link> by selecting the buttons and checking the accordion 'shows' and 'hides' sections.
63
+
5. Run your application - you can check it works the same way as the [Design System accordion example](iframe.html?id=typography-accordion--default&viewMode=story) by selecting the buttons and checking the accordion 'shows' and 'hides' sections.
When the installation finishes, the `@ogcio/ogcio-ds` package will be in your `node_modules` folder.
24
23
25
-
You should now get started by <Linkhref='?path=/docs/docs-get-started--docs'>getting the CSS, assets and JavaScript working</Link> with one gov.ie Frontend component.
24
+
You should now get started by [getting the CSS, assets and JavaScript working](?path=/docs/docs-get-started--docs) with one gov.ie Frontend component.
Copy file name to clipboardExpand all lines: storybook/stories/get-started/localisation.mdx
+2-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
import { Canvas, Meta } from'@storybook/blocks';
2
-
import { Link } from'../components/Link.jsx';
3
2
4
3
<Metatitle="Docs/Localise Gov IE Frontend" />
5
4
@@ -27,7 +26,7 @@ If you're using the Nunjucks macro, look at the Nunjucks macro options table in
27
26
28
27
If you're using the HTML directly, you can customise the text used in the JavaScript by passing configuration using data attributes.
29
28
30
-
Alternatively, you can <Linkhref='?path=/docs/docs-configure-components-with-javascript--docs'>configure the component with JavaScript</Link> at the point you initialise it or when using `initAll`.
29
+
Alternatively, you can [configure the component with JavaScript](?path=/docs/docs-configure-components-with-javascript--docs) at the point you initialise it or when using `initAll`.
31
30
32
31
The naming conventions for:
33
32
@@ -82,7 +81,7 @@ If you're looking to keep English messages and override only one of the plural f
82
81
83
82
Our components will replace the `{'%{count}'}` placeholder with the number used for picking the plural category.
84
83
85
-
The following example shows how to provide pluralisation options using the different ways you can <Linkhref='?path=/docs/docs-configure-components-with-javascript--docs'>configure components with JavaScript</Link>:
84
+
The following example shows how to provide pluralisation options using the different ways you can [configure components with JavaScript](?path=/docs/docs-configure-components-with-javascript--docs):
0 commit comments