@amsterdam/design-system-css 0.9.0 → 0.11.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 (105) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/accordion/accordion.css +1 -1
  3. package/dist/accordion/accordion.css.map +1 -1
  4. package/dist/alert/alert.css +1 -1
  5. package/dist/alert/alert.css.map +1 -1
  6. package/dist/avatar/avatar.css +1 -1
  7. package/dist/avatar/avatar.css.map +1 -1
  8. package/dist/breadcrumb/breadcrumb.css +1 -1
  9. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  10. package/dist/card/card.css +1 -1
  11. package/dist/card/card.css.map +1 -1
  12. package/dist/character-count/character-count.css +1 -0
  13. package/dist/character-count/character-count.css.map +1 -0
  14. package/dist/checkbox/checkbox.css +1 -1
  15. package/dist/checkbox/checkbox.css.map +1 -1
  16. package/dist/column/column.css +1 -1
  17. package/dist/column/column.css.map +1 -1
  18. package/dist/dialog/dialog.css +1 -1
  19. package/dist/dialog/dialog.css.map +1 -1
  20. package/dist/field-set/field-set.css +1 -1
  21. package/dist/field-set/field-set.css.map +1 -1
  22. package/dist/file-input/file-input.css +1 -1
  23. package/dist/file-input/file-input.css.map +1 -1
  24. package/dist/form-error-list/form-error-list.css +1 -0
  25. package/dist/form-error-list/form-error-list.css.map +1 -0
  26. package/dist/gap/gap.css +1 -1
  27. package/dist/gap/gap.css.map +1 -1
  28. package/dist/header/header.css +1 -1
  29. package/dist/header/header.css.map +1 -1
  30. package/dist/heading/heading.css +1 -1
  31. package/dist/heading/heading.css.map +1 -1
  32. package/dist/index.css +1 -1
  33. package/dist/index.css.map +1 -1
  34. package/dist/margin/margin.css.map +1 -1
  35. package/dist/pagination/pagination.css +1 -1
  36. package/dist/pagination/pagination.css.map +1 -1
  37. package/dist/radio/radio.css +1 -1
  38. package/dist/radio/radio.css.map +1 -1
  39. package/dist/row/row.css +1 -1
  40. package/dist/row/row.css.map +1 -1
  41. package/dist/table-of-contents/table-of-contents.css +1 -0
  42. package/dist/table-of-contents/table-of-contents.css.map +1 -0
  43. package/dist/tabs/tabs.css +1 -1
  44. package/dist/tabs/tabs.css.map +1 -1
  45. package/dist/top-task-link/top-task-link.css +1 -1
  46. package/dist/top-task-link/top-task-link.css.map +1 -1
  47. package/package.json +3 -3
  48. package/src/common/size.scss +2 -1
  49. package/src/components/accordion/accordion.scss +1 -0
  50. package/src/components/alert/README.md +1 -1
  51. package/src/components/alert/alert.scss +3 -0
  52. package/src/components/aspect-ratio/README.md +3 -3
  53. package/src/components/avatar/avatar.scss +30 -5
  54. package/src/components/breadcrumb/breadcrumb.scss +4 -4
  55. package/src/components/card/README.md +1 -1
  56. package/src/components/card/card.scss +4 -3
  57. package/src/components/{form-field-character-counter → character-count}/README.md +4 -4
  58. package/src/components/character-count/character-count.scss +20 -0
  59. package/src/components/checkbox/README.md +3 -3
  60. package/src/components/checkbox/checkbox.scss +1 -1
  61. package/src/components/column/README.md +1 -1
  62. package/src/components/column/column.scss +39 -3
  63. package/src/components/dialog/README.md +1 -1
  64. package/src/components/dialog/dialog.scss +12 -10
  65. package/src/components/field-set/README.md +1 -1
  66. package/src/components/field-set/field-set.scss +4 -0
  67. package/src/components/file-input/file-input.scss +1 -1
  68. package/src/components/footer/README.md +11 -6
  69. package/src/components/form-error-list/README.md +47 -0
  70. package/src/components/form-error-list/form-error-list.scss +14 -0
  71. package/src/components/gap/README.md +22 -1
  72. package/src/components/gap/gap.scss +4 -2
  73. package/src/components/grid/README.md +1 -1
  74. package/src/components/header/README.md +13 -4
  75. package/src/components/header/header.scss +2 -2
  76. package/src/components/heading/README.md +7 -6
  77. package/src/components/heading/heading.scss +6 -6
  78. package/src/components/icon/README.md +6 -2
  79. package/src/components/icon-button/README.md +1 -1
  80. package/src/components/image/README.md +1 -1
  81. package/src/components/index.scss +3 -1
  82. package/src/components/link/README.md +1 -1
  83. package/src/components/margin/README.md +21 -1
  84. package/src/components/margin/margin.scss +4 -2
  85. package/src/components/page-heading/README.md +1 -1
  86. package/src/components/page-menu/README.md +2 -2
  87. package/src/components/pagination/README.md +3 -3
  88. package/src/components/pagination/pagination.scss +1 -1
  89. package/src/components/paragraph/README.md +1 -1
  90. package/src/components/radio/radio.scss +1 -1
  91. package/src/components/row/README.md +2 -0
  92. package/src/components/row/row.scss +45 -2
  93. package/src/components/search-field/README.md +1 -1
  94. package/src/components/spotlight/README.md +1 -1
  95. package/src/components/switch/README.md +2 -2
  96. package/src/components/table-of-contents/README.md +6 -0
  97. package/src/components/table-of-contents/table-of-contents.scss +50 -0
  98. package/src/components/tabs/README.md +1 -1
  99. package/src/components/tabs/tabs.scss +5 -0
  100. package/src/components/text-input/README.md +2 -2
  101. package/src/components/top-task-link/top-task-link.scss +1 -1
  102. package/src/components/visually-hidden/README.md +8 -2
  103. package/dist/form-field-character-counter/form-field-character-counter.css +0 -1
  104. package/dist/form-field-character-counter/form-field-character-counter.css.map +0 -1
  105. package/src/components/form-field-character-counter/form-field-character-counter.scss +0 -20
@@ -4,6 +4,8 @@
4
4
  */
5
5
 
6
6
  /* Append here */
7
+ @import "./form-error-list/form-error-list";
8
+ @import "./table-of-contents/table-of-contents";
7
9
  @import "./error-message/error-message";
8
10
  @import "./file-input/file-input";
9
11
  @import "./field/field";
@@ -12,7 +14,7 @@
12
14
  @import "./date-input/date-input";
13
15
  @import "./document/document";
14
16
  @import "./avatar/avatar";
15
- @import "./form-field-character-counter/form-field-character-counter";
17
+ @import "./character-count/character-count";
16
18
  @import "./description-list/description-list";
17
19
  @import "./row/row";
18
20
  @import "./radio/radio";
@@ -30,7 +30,7 @@ We discourage using styles for visited links because they often make the page le
30
30
  The inline link does have a visited style.
31
31
  It is not part of navigation elements that are frequently scanned.
32
32
 
33
- ## Relevant WCAG Requirements
33
+ ## Relevant WCAG requirements
34
34
 
35
35
  - [WCAG 1.4.3](https://www.w3.org/TR/WCAG21/#contrast-minimum)
36
36
  - [WCAG 2.4.4](https://www.w3.org/TR/WCAG21/#link-purpose-in-context)
@@ -2,4 +2,24 @@
2
2
 
3
3
  # Margin
4
4
 
5
- Use these utility classes to add white space below a single element.
5
+ Adds white space below a single element.
6
+
7
+ ## Class names
8
+
9
+ The five sizes of [Component Space](/docs/brand-design-tokens-space--docs) are available for the height of the bottom margin.
10
+
11
+ | Class name | Preview |
12
+ | ------------ | -------------------------------------------------------------------------------------------- |
13
+ | `ams-mb--xs` | <div className="ams-docs-token-preview--space" style="inline-size: var(--ams-margin-xs);" /> |
14
+ | `ams-mb--sm` | <div className="ams-docs-token-preview--space" style="inline-size: var(--ams-margin-sm);" /> |
15
+ | `ams-mb--md` | <div className="ams-docs-token-preview--space" style="inline-size: var(--ams-margin-md);" /> |
16
+ | `ams-mb--lg` | <div className="ams-docs-token-preview--space" style="inline-size: var(--ams-margin-lg);" /> |
17
+ | `ams-mb--xl` | <div className="ams-docs-token-preview--space" style="inline-size: var(--ams-margin-xl);" /> |
18
+
19
+ ## Guidelines
20
+
21
+ - Use this utility class to vertically separate one element from the next.
22
+ - It can be used on any element and sets the `margin-block-end` CSS property. This declaration is marked with the `!important` flag to ensure it overrides any other margins.
23
+ - Elements’ top and bottom margins are sometimes collapsed into a single margin. Consult [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_box_model/Mastering_margin_collapsing) for details.
24
+ - To add equal margins between elements, either use the [Gap](/docs/utilities-css-gap--docs) utility class on their common parent or wrap them in a [Column](/docs/components-layout-column--docs) component.
25
+ This helps in loops: it prevents having to treat the last element differently.
@@ -6,7 +6,9 @@
6
6
  @import "../../common/size";
7
7
 
8
8
  @each $size in map-keys($ams-sizes) {
9
- .ams-mb--#{$size} {
10
- margin-block-end: var(--ams-margin-#{$size}) !important;
9
+ @if $size != "no" {
10
+ .ams-mb--#{$size} {
11
+ margin-block-end: var(--ams-margin-#{$size}) !important;
12
+ }
11
13
  }
12
14
  }
@@ -11,7 +11,7 @@ Use this component for a name, title, or motto.
11
11
  - Only use this component once per page, typically only on the homepage.
12
12
  - Avoid using it if you need to display long pieces of text; the text should be short and precise.
13
13
 
14
- ## Relevant WCAG Requirements
14
+ ## Relevant WCAG requirements
15
15
 
16
16
  The page heading component is a variant of a heading level 1 with a distinct style.
17
17
  When using this component, ensure that the heading hierarchy of the page remains logical.
@@ -13,8 +13,8 @@ A small set of links for use in the Header and Footer.
13
13
  - The ‘Menu’ button opens the Mega Menu.
14
14
  - On narrow screens, menu items other than ‘Search’ and ‘Menu’ move from the Page Menu to the Mega Menu.
15
15
 
16
- ## Relevant WCAG Requirements
16
+ ## Relevant WCAG requirements
17
17
 
18
18
  - [Consistent Navigation (Level AA)](https://www.w3.org/WAI/WCAG21/Understanding/consistent-navigation.html)
19
19
 
20
- PageMenu is an interactive element, and the [general requirements and guidelines for interactive elements](/docs/docs-design-guidelines-interactive-elements--docs) apply.
20
+ PageMenu is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
@@ -13,10 +13,10 @@ Pagination indicates the current page and allows users to navigate to other page
13
13
  - Place pagination below the overview list.
14
14
  - Pagination should not be displayed if there is only one page.
15
15
  - Redirect users to the first page if they enter a URL with a page number that doesn’t exist.
16
- - Pagination can be combined with a counter at the top of the page indicating “Page # of ##.”
16
+ - Pagination can be combined with a count at the top of the page indicating “Page # of ##.”
17
17
  - Start a page with an overview list at the top after changing the page.
18
18
  - Make sure that the visible and accessible labels for the ‘previous’ and ‘next’ buttons convey the same meaning at all times – e.g. don’t update one and forget the other.
19
19
 
20
- ## Relevant WCAG Rules
20
+ ## Relevant WCAG rules
21
21
 
22
- Pagination is an interactive element, and the [general requirements and guidelines for interactive elements](/docs/docs-design-guidelines-interactive-elements--docs) apply.
22
+ Pagination is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
@@ -37,7 +37,7 @@
37
37
 
38
38
  cursor: pointer;
39
39
  display: flex;
40
- gap: 0.5rem;
40
+ gap: var(--ams-pagination-button-gap);
41
41
  outline-offset: var(--ams-pagination-button-outline-offset);
42
42
  padding-inline: var(--ams-pagination-button-padding-inline);
43
43
  text-decoration-line: var(--ams-pagination-button-text-decoration-line);
@@ -11,7 +11,7 @@ Represents a paragraph of running text, form instructions, and other standalone
11
11
  - Consider whether a paragraph with more than 7 sentences or 140 words would be clearer if you divide the text into two paragraphs.
12
12
  Texts with not overly long paragraphs are easier to understand, and grouping makes information quicker to locate.
13
13
 
14
- ## Relevant WCAG Rules
14
+ ## Relevant WCAG rules
15
15
 
16
16
  - [WCAG 1.3.1](https://www.w3.org/TR/WCAG21/#info-and-relationships): Blocks that look like a paragraph are also recognized by a computer as a paragraph.
17
17
  - [WCAG 1.4.3](https://www.w3.org/TR/WCAG21/#contrast-minimum): The contrast of black text on a white background is high enough.
@@ -41,7 +41,7 @@
41
41
  font-family: var(--ams-radio-font-family);
42
42
  font-size: var(--ams-radio-font-size);
43
43
  font-weight: var(--ams-radio-font-weight);
44
- gap: 0.5rem;
44
+ gap: var(--ams-radio-gap);
45
45
  line-height: var(--ams-radio-line-height);
46
46
  outline-offset: var(--ams-radio-outline-offset);
47
47
 
@@ -1,3 +1,5 @@
1
1
  <!-- @license CC0-1.0 -->
2
2
 
3
3
  # Row
4
+
5
+ Stacks its children horizontally with gaps between them and offers alignment options.
@@ -8,10 +8,53 @@
8
8
  .ams-row {
9
9
  display: flex;
10
10
  flex-direction: row;
11
+ gap: var(--ams-row-gap-md);
11
12
  }
12
13
 
13
14
  @each $size, $label in $ams-sizes {
14
- .ams-row--#{$label} {
15
- gap: var(--ams-row-gap-#{$size});
15
+ @if $size != "md" {
16
+ .ams-row--gap-#{$label} {
17
+ gap: var(--ams-row-gap-#{$size});
18
+ }
16
19
  }
17
20
  }
21
+
22
+ .ams-row--wrap {
23
+ flex-wrap: wrap;
24
+ }
25
+
26
+ .ams-row--align-around {
27
+ justify-content: space-around;
28
+ }
29
+
30
+ .ams-row--align-between {
31
+ justify-content: space-between;
32
+ }
33
+
34
+ .ams-row--align-center {
35
+ justify-content: center;
36
+ }
37
+
38
+ .ams-row--align-end {
39
+ justify-content: flex-end;
40
+ }
41
+
42
+ .ams-row--align-evenly {
43
+ justify-content: space-evenly;
44
+ }
45
+
46
+ .ams-row--align-vertical-baseline {
47
+ align-items: baseline;
48
+ }
49
+
50
+ .ams-row--align-vertical-center {
51
+ align-items: center;
52
+ }
53
+
54
+ .ams-row--align-vertical-end {
55
+ align-items: flex-end;
56
+ }
57
+
58
+ .ams-row--align-vertical-start {
59
+ align-items: flex-start;
60
+ }
@@ -32,4 +32,4 @@ These features can be disruptive for a user searching for part of a word, and `a
32
32
  - [WCAG 1.3.5](https://www.w3.org/TR/WCAG22/#identify-input-purpose): It is clear both to the user and programmatically what the purpose of a form field is.
33
33
  - [WCAG 2.4.6](https://www.w3.org/TR/WCAG22/#headings-and-labels): There is a label describing the purpose of the input.
34
34
 
35
- Search Field is an interactive element; therefore, [the general requirements and guidelines for interactive elements](/docs/docs-design-guidelines-interactive-elements--docs) apply.
35
+ Search Field is an interactive element; therefore, [the general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
@@ -8,7 +8,7 @@ Emphasizes a section on a page through a distinctive background colour.
8
8
 
9
9
  Refer to [this overview on Stijlweb](https://amsterdam.nl/stijlweb/basiselementen/kleuren/#PagCls_15671872) to determine whether you can use black or white text on the background colour of your choice.
10
10
 
11
- ## Relevant WCAG Requirements
11
+ ## Relevant WCAG requirements
12
12
 
13
13
  - [WCAG 1.4.3](https://www.w3.org/TR/WCAG21/#contrast-minimum): Large-scale text and images of large-scale text have a contrast ratio of at least 3:1;
14
14
 
@@ -12,11 +12,11 @@ A switch applies to a page or the entire system, such as an on/off switch.
12
12
  - Use labels with a switch to make the action clear.
13
13
  - The action takes place immediately when the user operates the switch.
14
14
 
15
- ## Relevant WCAG Requirements
15
+ ## Relevant WCAG requirements
16
16
 
17
17
  - [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.
18
18
 
19
- The Switch is an interactive element; general requirements and guidelines for interactive elements apply [here](/docs/docs-design-guidelines-interactive-elements--docs).
19
+ Switch is an interactive element; general requirements and guidelines for interactivity apply [here](/docs/docs-developer-guide-interactivity--docs).
20
20
 
21
21
  ## References
22
22
 
@@ -0,0 +1,6 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Table of Contents
4
+
5
+ A list of links corresponding to the content sections on the page.
6
+ It helps users to easily navigate to different sections on the same page.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ @import "../../common/text-rendering";
7
+
8
+ @mixin reset {
9
+ box-sizing: border-box;
10
+ margin-block: 0;
11
+ padding-inline: 0;
12
+ }
13
+
14
+ .ams-table-of-contents {
15
+ display: flex;
16
+ flex-direction: column;
17
+ font-family: var(--ams-table-of-contents-font-family);
18
+ font-size: var(--ams-table-of-contents-font-size);
19
+ font-weight: var(--ams-table-of-contents-font-weight);
20
+ gap: var(--ams-table-of-contents-gap);
21
+ line-height: var(--ams-table-of-contents-line-height);
22
+ }
23
+
24
+ .ams-table-of-contents__list {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--ams-table-of-contents-list-gap);
28
+ list-style: none;
29
+
30
+ @include text-rendering;
31
+ @include reset;
32
+
33
+ .ams-table-of-contents__list {
34
+ padding-block-start: var(--ams-table-of-contents-list-list-padding-block-start);
35
+ padding-inline-start: var(--ams-table-of-contents-list-list-padding-inline-start);
36
+ }
37
+ }
38
+
39
+ .ams-table-of-contents__link {
40
+ color: var(--ams-table-of-contents-link-color);
41
+ outline-offset: var(--ams-table-of-contents-link-outline-offset);
42
+ text-decoration-line: var(--ams-table-of-contents-link-text-decoration-line);
43
+ text-decoration-thickness: var(--ams-table-of-contents-link-text-decoration-thickness);
44
+ text-underline-offset: var(--ams-table-of-contents-link-text-underline-offset);
45
+
46
+ &:hover {
47
+ color: var(--ams-table-of-contents-link-hover-color);
48
+ text-decoration-line: var(--ams-table-of-contents-link-hover-text-decoration-line);
49
+ }
50
+ }
@@ -4,7 +4,7 @@
4
4
 
5
5
  Tabs are used to bundle related content in a compact overview within a page. Each tab has a short name, and these names indicate the relationship between the information displayed in each tab.
6
6
 
7
- ## How to Use
7
+ ## How to use
8
8
 
9
9
  - The content of each tab is viewable independently, not in the context of one another.
10
10
  - The content within each tab should have a similar structure.
@@ -10,6 +10,11 @@
10
10
  border: 0;
11
11
  }
12
12
 
13
+ .ams-tabs {
14
+ display: grid;
15
+ gap: var(--ams-tabs-gap);
16
+ }
17
+
13
18
  .ams-tabs__list {
14
19
  background-color: var(--ams-tabs-list-background-color);
15
20
  border-block-end: var(--ams-tabs-list-border-block-end);
@@ -9,8 +9,8 @@ A form field in which a user can enter text.
9
9
  - Use a Text Input when users need to enter a single line of text, such as their name or phone number.
10
10
  - Do not use a Text Input when users could provide more than 1 sentence of text.
11
11
  - The width of the Text Input should be appropriate for the information to be entered.
12
- - A Text Input must have a label, and in most cases, this label should be visible.
12
+ - A Text Input must have a Label, and in most cases, this label should be visible.
13
13
  - Use `spellcheck="false"` for fields that may contain sensitive information, such as passwords and personal data.
14
14
  Some browser extensions for spell-checking send this information to external servers.
15
15
  - Apply automatic assistance where possible.
16
- For example, in logged-in systems, pre-filling input can prevent errors and save time.
16
+ For example, in logged-in systems, pre-filling known values can prevent errors and save time.
@@ -10,7 +10,7 @@
10
10
  break-inside: avoid;
11
11
  display: flex;
12
12
  flex-direction: column;
13
- gap: 0.5rem;
13
+ gap: var(--ams-top-task-link-gap);
14
14
  outline-offset: var(--ams-top-task-link-outline-offset);
15
15
  text-decoration: none;
16
16
  }
@@ -4,5 +4,11 @@
4
4
 
5
5
  Hides content from sighted users but keeps it accessible to non-visual user agents, such as screen readers.
6
6
 
7
- Note: in most cases, visually available content should be accessible to non-visual user agents and vice versa.
8
- Elaborate instructions or guidance read only by non-visual user agents can do more harm than good.
7
+ ## Class name
8
+
9
+ `ams-visually-hidden`
10
+
11
+ ## Guidelines
12
+
13
+ - In most cases, visually available content should be accessible to non-visual user agents and vice versa.
14
+ Elaborate instructions or guidance read only by non-visual user agents can do more harm than good.
@@ -1 +0,0 @@
1
- .ams-form-field-character-counter{color:var(--ams-form-field-character-counter-color);font-family:var(--ams-form-field-character-counter-font-family);font-size:var(--ams-form-field-character-counter-font-size);font-weight:var(--ams-form-field-character-counter-font-weight);line-height:var(--ams-form-field-character-counter-line-height);text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}.ams-form-field-character-counter--error{color:var(--ams-form-field-character-counter-error-color)}/*# sourceMappingURL=form-field-character-counter.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/components/form-field-character-counter/form-field-character-counter.scss","../../src/common/text-rendering.scss"],"names":[],"mappings":"AAOA,kCACE,oDACA,gEACA,4DACA,gEACA,gECFA,kCACA,2BACA,8BACA,sBDIF,yCACE","file":"form-field-character-counter.css"}
@@ -1,20 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
-
6
- @import "../../common/text-rendering";
7
-
8
- .ams-form-field-character-counter {
9
- color: var(--ams-form-field-character-counter-color);
10
- font-family: var(--ams-form-field-character-counter-font-family);
11
- font-size: var(--ams-form-field-character-counter-font-size);
12
- font-weight: var(--ams-form-field-character-counter-font-weight);
13
- line-height: var(--ams-form-field-character-counter-line-height);
14
-
15
- @include text-rendering;
16
- }
17
-
18
- .ams-form-field-character-counter--error {
19
- color: var(--ams-form-field-character-counter-error-color);
20
- }