@amsterdam/design-system-css 0.3.0 → 0.4.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/CHANGELOG.md +23 -0
- package/LICENSE.md +1 -1
- package/README.md +2 -1
- package/dist/alert/alert.css +1 -1
- package/dist/alert/alert.css.map +1 -1
- package/dist/badge/badge.css +1 -0
- package/dist/badge/badge.css.map +1 -0
- package/dist/dialog/dialog.css +1 -1
- package/dist/dialog/dialog.css.map +1 -1
- package/dist/grid/grid.css +1 -1
- package/dist/grid/grid.css.map +1 -1
- package/dist/icon/icon.css +1 -1
- package/dist/icon/icon.css.map +1 -1
- package/dist/icon-button/icon-button.css +1 -0
- package/dist/icon-button/icon-button.css.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/link-list/link-list.css +1 -0
- package/dist/link-list/link-list.css.map +1 -0
- package/dist/mega-menu/mega-menu.css +1 -0
- package/dist/mega-menu/mega-menu.css.map +1 -0
- package/dist/search-field/search-field.css +1 -1
- package/dist/search-field/search-field.css.map +1 -1
- package/dist/spotlight/spotlight.css +1 -1
- package/dist/spotlight/spotlight.css.map +1 -1
- package/dist/table/table.css +1 -0
- package/dist/table/table.css.map +1 -0
- package/documentation/coding-conventions.md +4 -2
- package/package.json +4 -4
- package/src/components/accordion/README.md +45 -38
- package/src/components/alert/README.md +15 -11
- package/src/components/alert/alert.scss +8 -38
- package/src/components/aspect-ratio/README.md +12 -12
- package/src/components/badge/README.md +10 -0
- package/src/components/badge/badge.scss +58 -0
- package/src/components/blockquote/README.md +8 -8
- package/src/components/breadcrumb/README.md +10 -7
- package/src/components/button/README.md +17 -14
- package/src/components/card/README.md +18 -19
- package/src/components/checkbox/README.md +19 -18
- package/src/components/dialog/README.md +9 -8
- package/src/components/dialog/dialog.scss +0 -16
- package/src/components/footer/README.md +11 -7
- package/src/components/form-label/README.md +5 -1
- package/src/components/grid/README.md +12 -13
- package/src/components/grid/grid.scss +4 -0
- package/src/components/header/README.md +2 -2
- package/src/components/heading/README.md +14 -11
- package/src/components/icon/README.md +19 -9
- package/src/components/icon/icon.scss +5 -0
- package/src/components/icon-button/README.md +14 -0
- package/src/components/icon-button/icon-button.scss +60 -0
- package/src/components/image/README.md +16 -17
- package/src/components/index.scss +5 -0
- package/src/components/link/README.md +26 -24
- package/src/components/link-list/README.md +16 -0
- package/src/components/link-list/link-list.scss +80 -0
- package/src/components/logo/README.md +21 -20
- package/src/components/mark/README.md +10 -11
- package/src/components/mega-menu/README.md +1 -0
- package/src/components/mega-menu/mega-menu.scss +14 -0
- package/src/components/ordered-list/README.md +5 -5
- package/src/components/overlap/README.md +1 -1
- package/src/components/page-heading/README.md +10 -9
- package/src/components/page-menu/README.md +10 -9
- package/src/components/pagination/README.md +13 -10
- package/src/components/paragraph/README.md +16 -14
- package/src/components/screen/README.md +12 -12
- package/src/components/search-field/README.md +18 -18
- package/src/components/search-field/search-field.scss +2 -10
- package/src/components/skip-link/README.md +18 -25
- package/src/components/spotlight/README.md +5 -5
- package/src/components/spotlight/spotlight.scss +4 -4
- package/src/components/switch/README.md +11 -9
- package/src/components/table/README.md +11 -0
- package/src/components/table/table.scss +36 -0
- package/src/components/text-input/README.md +10 -8
- package/src/components/top-task-link/README.md +15 -14
- package/src/components/unordered-list/README.md +5 -5
- package/src/components/visually-hidden/README.md +3 -2
- package/src/components/button/button-css.md +0 -12
- package/src/components/checkbox/checkbox-css.md +0 -3
- package/src/components/footer/footer-css.md +0 -11
- package/src/components/heading/heading-css.md +0 -3
- package/src/components/paragraph/paragraph-css.md +0 -3
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
# Switch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A switch is a control element to toggle between two different states quickly.
|
|
4
|
+
A switch applies to a page or the entire system, such as an on/off switch.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Guidelines
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
8
|
+
- Switch only between two different states.
|
|
9
|
+
It is a binary action.
|
|
10
|
+
- Use labels with a switch to make the action clear.
|
|
11
|
+
- The action takes place immediately when the user operates the switch.
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## Relevant WCAG Requirements
|
|
12
14
|
|
|
13
|
-
- [WCAG 1.3.5](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html):
|
|
15
|
+
- [WCAG 1.3.5](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html): it is both clear for a user and programmatically what the purpose of a form field is.
|
|
14
16
|
|
|
15
|
-
Switch is
|
|
17
|
+
The Switch is an interactive element; general requirements and guidelines for interactive elements apply [here](https://amsterdam.github.io/design-system/?path=/docs/docs-designrichtlijnen-interactieve-elementen--docs).
|
|
16
18
|
|
|
17
|
-
##
|
|
19
|
+
## References
|
|
18
20
|
|
|
19
21
|
- [Switch Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/)
|
|
20
22
|
- [Role switch](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/switch_role)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
Use the table component to let users compare information in rows and columns.
|
|
4
|
+
Table is used to display simple information that does not need to be filtered or edited.
|
|
5
|
+
|
|
6
|
+
## Guidelines
|
|
7
|
+
|
|
8
|
+
- Use `<Table.Caption>` to describe a table in the same way you would use a heading.
|
|
9
|
+
A caption helps users find, navigate and understand tables.
|
|
10
|
+
- Never use the table component to layout content on a page.
|
|
11
|
+
Instead, use [Grid](https://amsterdam.github.io/design-system/?path=/docs/react_layout-grid--docs).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2+
|
|
3
|
+
* Copyright (c) 2023 Gemeente Amsterdam
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.amsterdam-table {
|
|
7
|
+
overflow-x: auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.amsterdam-table__table {
|
|
11
|
+
border-spacing: 0;
|
|
12
|
+
break-inside: avoid;
|
|
13
|
+
color: var(--amsterdam-table-color);
|
|
14
|
+
font-family: var(--amsterdam-table-font-family);
|
|
15
|
+
font-size: var(--amsterdam-table-font-size);
|
|
16
|
+
font-weight: var(--amsterdam-table-font-weight);
|
|
17
|
+
line-height: var(--amsterdam-table-line-height);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.amsterdam-table__caption {
|
|
21
|
+
font-weight: var(--amsterdam-table-caption-font-weight);
|
|
22
|
+
text-align: start;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.amsterdam-table__cell,
|
|
26
|
+
.amsterdam-table__header-cell {
|
|
27
|
+
border-bottom: var(--amsterdam-table-cell-border-bottom);
|
|
28
|
+
padding-block: 1rem;
|
|
29
|
+
padding-inline: 1rem;
|
|
30
|
+
text-align: start;
|
|
31
|
+
vertical-align: top;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.amsterdam-table__header-cell {
|
|
35
|
+
font-weight: var(--amsterdam-table-header-cell-font-weight);
|
|
36
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Text Input
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A form field in which a user can enter text.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Guidelines
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
7
|
+
- Use a Text Input when users need to enter a single line of text, such as their name or phone number.
|
|
8
|
+
- Do not use a Text Input when users could provide more than 1 sentence of text.
|
|
9
|
+
- The width of the Text Input should be appropriate for the information to be entered.
|
|
10
|
+
- A Text Input must have a label, and in most cases, this label should be visible.
|
|
11
|
+
- Use `spellcheck="false"` for fields that may contain sensitive information, such as passwords and personal data.
|
|
12
|
+
Some browser extensions for spell-checking send this information to external servers.
|
|
13
|
+
- Apply automatic assistance where possible.
|
|
14
|
+
For example, in logged-in systems, pre-filling input can prevent errors and save time.
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
# Top Task Link
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A prominent navigation element to quickly start a task.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Guidelines
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
- A Top Task Link has both a title and a description.
|
|
8
|
+
- The title describes the essence of the page being referred to, attracting attention when scanning the page.
|
|
9
|
+
- The description provides more context, helping the user confirm that they can indeed achieve their goal on the linked page.
|
|
10
|
+
- Keep both texts concise.
|
|
11
|
+
A title consists of a few words, and the description consists of 1 or 2 short sentences.
|
|
12
|
+
The description should end with a period or another appropriate punctuation mark.
|
|
13
|
+
- For wide windows, place 3 or 4 Top Task Links side by side on the [Grid](?path=/docs/react_layout-grid--docs).
|
|
14
|
+
If you have more Top Task Links, place them in the next row.
|
|
15
|
+
Try to distribute the amount of links on wide windows over rows of 3 or 4 links.
|
|
16
|
+
If this is not possible, leave the last cells of the grid empty.
|
|
17
|
+
- If you have a group of links for which a description is unnecessary or illogical, use a [Link List](?path=/docs/react_navigation-link--docs).
|
|
17
18
|
|
|
18
|
-
##
|
|
19
|
+
## Relevant WCAG requirements
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
The Top Task Link is subject to the same requirements as [regular links](https://amsterdam.github.io/design-system/?path=/docs/react_navigation-link--docs).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Unordered List
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
A list is a vertical group of related content.
|
|
4
|
+
This list can have 2 levels.
|
|
5
|
+
The first level consists of squares.
|
|
6
|
+
The second level consists of en dashes (–).
|
|
7
|
+
Text in the list items is indented by a fixed distance.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Visually Hidden
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hides content from sighted users but keeps it accessible to non-visual user agents, such as screen readers.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Note: in most cases, visually available content should be accessible to non-visual user agents and vice versa.
|
|
6
|
+
Elaborate instructions or guidance read only by non-visual user agents can do more harm than good.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# CSS Button
|
|
2
|
-
|
|
3
|
-
Het button component maakt gebruik van de CSS library van de gemeente Utrecht. Daarop is het Amsterdam Design toegepast. Concreet betekent dit dat de Utrecht class names worden gebruikt met de Amsterdamse css attribuut waarden.
|
|
4
|
-
Een voorbeeld van een HTML button met de Amsterdamse styling is:
|
|
5
|
-
|
|
6
|
-
```html
|
|
7
|
-
<button class="utrecht-button">Amsterdam Button</button>
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Deze button wordt getoond met de Amsterdamse button styling.
|
|
11
|
-
|
|
12
|
-
Vedere documentatie van de Utrecht button is terug te vinden in hun [github](https://github.com/nl-design-system/utrecht/tree/main/components/button) repository.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# CSS Footer
|
|
2
|
-
|
|
3
|
-
Gebruik het `footer` element als buitenste container van de footer.
|
|
4
|
-
|
|
5
|
-
De voettekst is blauw met witte tekst en iconen, met onderaan een witte balk. Op desktop heeft het blauwe deel van de voettekst 3 kolommen. Op mobiel heeft het blauwe deel van de voettekst 1 kolom. Kolom 1, 2 en 3 van de desktop staan dan onder elkaar.
|
|
6
|
-
|
|
7
|
-
De functionaliteit op desktop en mobiel is gelijk.
|
|
8
|
-
|
|
9
|
-
De hoogte wordt bepaald door de content. De breedte van de voettekst op desktop is niet schermvullend.
|
|
10
|
-
|
|
11
|
-
De voettekst wordt nooit ingeklapt. Ook niet in mobiele weergave.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# CSS Heading
|
|
2
|
-
|
|
3
|
-
Gebruik de juiste heading HTML-elementen als je van deze classes gebruik maakt. De beschikbare elementen zijn: `h1`, `h2`, `h3`, `h4`, `h5` en `h6`. Let bij het kiezen van een heading niveau op de structuur van de pagina. Heading niveaus worden gebruikt om informatie te groeperen. De titel van de pagina krijgt een `h1`. De eerste subtitel een `h2`. De daarna volgende titels van secties die horen bij die subtitel krijgen een `h3`, enzovoort. Als je een nieuwe sectie begint, gebruik je weer een `h2`. Het is toegestaan om stijl en semantiek los van elkaar te trekken. Een `h1` kan bijvoorbeeld de class `amsterdam-heading-2` krijgen.
|