@amsterdam/design-system-css 0.8.0 → 0.10.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 (127) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/accordion/accordion.css +1 -1
  3. package/dist/accordion/accordion.css.map +1 -1
  4. package/dist/avatar/avatar.css +1 -1
  5. package/dist/avatar/avatar.css.map +1 -1
  6. package/dist/badge/badge.css +1 -1
  7. package/dist/badge/badge.css.map +1 -1
  8. package/dist/breadcrumb/breadcrumb.css +1 -1
  9. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  10. package/dist/button/button.css +1 -1
  11. package/dist/button/button.css.map +1 -1
  12. package/dist/card/card.css +1 -1
  13. package/dist/card/card.css.map +1 -1
  14. package/dist/checkbox/checkbox.css +1 -1
  15. package/dist/checkbox/checkbox.css.map +1 -1
  16. package/dist/date-input/date-input.css +1 -1
  17. package/dist/date-input/date-input.css.map +1 -1
  18. package/dist/dialog/dialog.css +1 -1
  19. package/dist/dialog/dialog.css.map +1 -1
  20. package/dist/error-message/error-message.css +1 -0
  21. package/dist/error-message/error-message.css.map +1 -0
  22. package/dist/field/field.css +1 -0
  23. package/dist/field/field.css.map +1 -0
  24. package/dist/field-set/field-set.css +1 -0
  25. package/dist/field-set/field-set.css.map +1 -0
  26. package/dist/file-input/file-input.css +1 -0
  27. package/dist/file-input/file-input.css.map +1 -0
  28. package/dist/header/header.css +1 -1
  29. package/dist/header/header.css.map +1 -1
  30. package/dist/icon/icon.css +1 -1
  31. package/dist/icon/icon.css.map +1 -1
  32. package/dist/image/image.css +1 -1
  33. package/dist/image/image.css.map +1 -1
  34. package/dist/index.css +1 -1
  35. package/dist/index.css.map +1 -1
  36. package/dist/link-list/link-list.css +1 -1
  37. package/dist/link-list/link-list.css.map +1 -1
  38. package/dist/logo/logo.css +1 -1
  39. package/dist/logo/logo.css.map +1 -1
  40. package/dist/ordered-list/ordered-list.css +1 -1
  41. package/dist/ordered-list/ordered-list.css.map +1 -1
  42. package/dist/pagination/pagination.css +1 -1
  43. package/dist/pagination/pagination.css.map +1 -1
  44. package/dist/paragraph/paragraph.css +1 -1
  45. package/dist/paragraph/paragraph.css.map +1 -1
  46. package/dist/radio/radio.css +1 -1
  47. package/dist/radio/radio.css.map +1 -1
  48. package/dist/screen/screen.css +1 -1
  49. package/dist/screen/screen.css.map +1 -1
  50. package/dist/search-field/search-field.css +1 -1
  51. package/dist/search-field/search-field.css.map +1 -1
  52. package/dist/select/select.css +1 -1
  53. package/dist/select/select.css.map +1 -1
  54. package/dist/switch/switch.css +1 -1
  55. package/dist/switch/switch.css.map +1 -1
  56. package/dist/table/table.css +1 -1
  57. package/dist/table/table.css.map +1 -1
  58. package/dist/table-of-contents/table-of-contents.css +1 -0
  59. package/dist/table-of-contents/table-of-contents.css.map +1 -0
  60. package/dist/tabs/tabs.css +1 -1
  61. package/dist/tabs/tabs.css.map +1 -1
  62. package/dist/text-area/text-area.css +1 -1
  63. package/dist/text-area/text-area.css.map +1 -1
  64. package/dist/text-input/text-input.css +1 -1
  65. package/dist/text-input/text-input.css.map +1 -1
  66. package/dist/time-input/time-input.css +1 -1
  67. package/dist/time-input/time-input.css.map +1 -1
  68. package/dist/unordered-list/unordered-list.css +1 -1
  69. package/dist/unordered-list/unordered-list.css.map +1 -1
  70. package/dist/visually-hidden/visually-hidden.css +1 -1
  71. package/dist/visually-hidden/visually-hidden.css.map +1 -1
  72. package/documentation/coding-conventions.md +10 -4
  73. package/package.json +6 -3
  74. package/src/common/hide-input.scss +1 -1
  75. package/src/components/accordion/accordion.scss +2 -1
  76. package/src/components/alert/README.md +1 -1
  77. package/src/components/aspect-ratio/README.md +3 -3
  78. package/src/components/avatar/avatar.scss +32 -7
  79. package/src/components/badge/badge.scss +35 -5
  80. package/src/components/breadcrumb/breadcrumb.scss +9 -9
  81. package/src/components/button/button.scss +1 -0
  82. package/src/components/card/card.scss +1 -1
  83. package/src/components/checkbox/checkbox.scss +4 -4
  84. package/src/components/date-input/date-input.scss +6 -7
  85. package/src/components/dialog/README.md +7 -0
  86. package/src/components/dialog/dialog.scss +7 -7
  87. package/src/components/error-message/README.md +11 -0
  88. package/src/components/error-message/error-message.scss +22 -0
  89. package/src/components/field/README.md +9 -0
  90. package/src/components/field/field.scss +16 -0
  91. package/src/components/field-set/README.md +17 -0
  92. package/src/components/field-set/field-set.scss +52 -0
  93. package/src/components/file-input/README.md +9 -0
  94. package/src/components/file-input/file-input.scss +69 -0
  95. package/src/components/footer/README.md +11 -6
  96. package/src/components/form-error-list/README.md +35 -0
  97. package/src/components/header/README.md +13 -4
  98. package/src/components/header/header.scss +7 -7
  99. package/src/components/icon/README.md +4 -0
  100. package/src/components/icon/icon.scss +12 -12
  101. package/src/components/image/image.scss +3 -3
  102. package/src/components/index.scss +5 -1
  103. package/src/components/link-list/link-list.scss +2 -2
  104. package/src/components/logo/logo.scss +1 -1
  105. package/src/components/ordered-list/ordered-list.scss +5 -0
  106. package/src/components/pagination/README.md +1 -0
  107. package/src/components/pagination/pagination.scss +2 -2
  108. package/src/components/paragraph/paragraph.scss +2 -2
  109. package/src/components/radio/radio.scss +4 -4
  110. package/src/components/screen/screen.scss +3 -3
  111. package/src/components/search-field/search-field.scss +16 -6
  112. package/src/components/select/select.scss +8 -6
  113. package/src/components/switch/switch.scss +12 -9
  114. package/src/components/table/table.scss +1 -1
  115. package/src/components/table-of-contents/README.md +6 -0
  116. package/src/components/table-of-contents/table-of-contents.scss +50 -0
  117. package/src/components/tabs/tabs.scss +1 -1
  118. package/src/components/text-area/text-area.scss +9 -5
  119. package/src/components/text-input/README.md +2 -2
  120. package/src/components/text-input/text-input.scss +6 -2
  121. package/src/components/time-input/time-input.scss +7 -8
  122. package/src/components/unordered-list/unordered-list.scss +5 -0
  123. package/src/components/visually-hidden/visually-hidden.scss +2 -2
  124. package/dist/fieldset/fieldset.css +0 -1
  125. package/dist/fieldset/fieldset.css.map +0 -1
  126. package/src/components/fieldset/README.md +0 -18
  127. package/src/components/fieldset/fieldset.scss +0 -35
@@ -6,26 +6,29 @@
6
6
  @import "../../common/text-rendering";
7
7
 
8
8
  @mixin reset {
9
+ -webkit-appearance: none; // Reset appearance for Safari < 15.4
10
+ appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
11
+ border: 0;
12
+ border-radius: 0; // Reset rounded borders on iOS devices
9
13
  box-sizing: border-box;
10
14
  margin-block: 0;
11
15
  }
12
16
 
13
17
  .ams-text-area {
14
18
  background-color: var(--ams-text-area-background-color);
15
- border: 0;
16
19
  box-shadow: var(--ams-text-area-box-shadow);
17
20
  color: var(--ams-text-area-color);
18
21
  font-family: var(--ams-text-area-font-family);
19
22
  font-size: var(--ams-text-area-font-size);
20
23
  font-weight: var(--ams-text-area-font-weight);
24
+ inline-size: 100%;
21
25
  line-height: var(--ams-text-area-line-height);
22
- max-width: 100%;
23
- min-height: var(--ams-text-area-min-height);
26
+ max-inline-size: 100%; // This prevents overflow when using the `cols` prop
27
+ min-block-size: var(--ams-text-area-min-block-size);
24
28
  outline-offset: var(--ams-text-area-outline-offset);
25
29
  padding-block: var(--ams-text-area-padding-block);
26
30
  padding-inline: var(--ams-text-area-padding-inline);
27
31
  touch-action: manipulation;
28
- width: 100%;
29
32
 
30
33
  @include text-rendering;
31
34
  @include reset;
@@ -37,6 +40,7 @@
37
40
 
38
41
  .ams-text-area::placeholder {
39
42
  color: var(--ams-text-area-placeholder-color);
43
+ opacity: 100%; // This resets the lower opacity set by Firefox
40
44
  }
41
45
 
42
46
  .ams-text-area:disabled {
@@ -69,5 +73,5 @@
69
73
  }
70
74
 
71
75
  .ams-text-area--cols {
72
- width: auto;
76
+ inline-size: auto;
73
77
  }
@@ -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.
@@ -6,24 +6,27 @@
6
6
  @import "../../common/text-rendering";
7
7
 
8
8
  @mixin reset {
9
+ -webkit-appearance: none; // Reset appearance for Safari < 15.4
10
+ appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
11
+ border: 0;
12
+ border-radius: 0; // Reset rounded borders on iOS devices
9
13
  box-sizing: border-box;
10
14
  margin-block: 0;
11
15
  }
12
16
 
13
17
  .ams-text-input {
14
18
  background-color: var(--ams-text-input-background-color);
15
- border: 0;
16
19
  box-shadow: var(--ams-text-input-box-shadow);
17
20
  color: var(--ams-text-input-color);
18
21
  font-family: var(--ams-text-input-font-family);
19
22
  font-size: var(--ams-text-input-font-size);
20
23
  font-weight: var(--ams-text-input-font-weight);
24
+ inline-size: 100%;
21
25
  line-height: var(--ams-text-input-line-height);
22
26
  outline-offset: var(--ams-text-input-outline-offset);
23
27
  padding-block: var(--ams-text-input-padding-block);
24
28
  padding-inline: var(--ams-text-input-padding-inline);
25
29
  touch-action: manipulation;
26
- width: 100%;
27
30
 
28
31
  @include text-rendering;
29
32
  @include reset;
@@ -35,6 +38,7 @@
35
38
 
36
39
  .ams-text-input::placeholder {
37
40
  color: var(--ams-text-input-placeholder-color);
41
+ opacity: 100%; // This resets the lower opacity set by Firefox
38
42
  }
39
43
 
40
44
  .ams-text-input:disabled {
@@ -6,14 +6,13 @@
6
6
  @import "../../common/text-rendering";
7
7
 
8
8
  @mixin reset {
9
- // Reset native appearance, this causes issues on iOS and Android devices
10
- -webkit-appearance: none;
11
- appearance: none;
9
+ -webkit-appearance: none; // Reset appearance for Safari < 15.4
10
+ appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
12
11
  border: 0;
13
12
  border-radius: 0; // Reset rounded borders on iOS devices
14
13
  box-sizing: border-box;
14
+ inline-size: auto; // Reset inline size of 10em set by Android devices
15
15
  margin-block: 0;
16
- width: auto; // Reset width of 10em set by Android devices
17
16
  }
18
17
 
19
18
  .ams-time-input {
@@ -25,13 +24,13 @@
25
24
  font-weight: var(--ams-time-input-font-weight);
26
25
  line-height: var(--ams-time-input-line-height);
27
26
 
28
- // Set min height for iOS, otherwise an empty box is a lot smaller than a filled one.
29
- min-height: calc(
27
+ // Set min block size for iOS, otherwise an empty box is a lot smaller than a filled one.
28
+ min-block-size: calc(
30
29
  (var(--ams-time-input-font-size) * var(--ams-time-input-line-height)) + 2 * var(--ams-time-input-padding-block)
31
30
  );
32
31
 
33
- // Set min width for iOS, so the width is closer to the filled in width.
34
- min-width: calc(4ch + (2 * var(--ams-time-input-padding-inline)));
32
+ // Set min inline size for iOS, so the size is closer to the filled in size.
33
+ min-inline-size: calc(4ch + (2 * var(--ams-time-input-padding-inline)));
35
34
  outline-offset: var(--ams-time-input-outline-offset);
36
35
  padding-block: var(--ams-time-input-padding-block);
37
36
  padding-inline: var(--ams-time-input-padding-inline);
@@ -42,6 +42,11 @@
42
42
  color: var(--ams-unordered-list-inverse-color);
43
43
  }
44
44
 
45
+ .ams-unordered-list--small:not(.ams-unordered-list--no-markers) {
46
+ font-size: var(--ams-unordered-list-small-font-size);
47
+ line-height: var(--ams-unordered-list-small-line-height);
48
+ }
49
+
45
50
  /** A nested list has a different marker and less indentation for correct alignment. */
46
51
  :is(.ams-ordered-list, .ams-unordered-list) .ams-unordered-list {
47
52
  list-style-type: var(--ams-unordered-list-unordered-list-list-style-type);
@@ -5,11 +5,11 @@
5
5
 
6
6
  // Source: https://css-tricks.com/inclusively-hidden/
7
7
  .ams-visually-hidden:not(:active, :focus) {
8
+ block-size: 1px;
8
9
  clip: rect(0 0 0 0);
9
10
  clip-path: inset(50%);
10
- height: 1px;
11
+ inline-size: 1px;
11
12
  overflow: hidden;
12
13
  position: absolute;
13
14
  white-space: nowrap;
14
- width: 1px;
15
15
  }
@@ -1 +0,0 @@
1
- .ams-fieldset{border:0;margin-inline:0;padding-block:0;padding-inline:0}.ams-fieldset__legend{color:var(--ams-fieldset-legend-color);font-family:var(--ams-fieldset-legend-font-family);font-size:var(--ams-fieldset-legend-font-size);font-weight:var(--ams-fieldset-legend-font-weight);line-height:var(--ams-fieldset-legend-line-height);margin-block-end:1rem;hyphenate-limit-chars:var(--ams-hyphenation-hyphenate-limit-chars);hyphens:var(--ams-hyphenation-hyphens);overflow-wrap:var(--ams-hyphenation-overflow-wrap);text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;padding-inline:0}/*# sourceMappingURL=fieldset.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/components/fieldset/fieldset.scss","../../src/common/hyphenation.scss","../../src/common/text-rendering.scss"],"names":[],"mappings":"AAeA,cANE,SACA,gBACA,gBACA,iBAWF,sBACE,uCACA,mDACA,+CACA,mDACA,mDACA,sBCvBA,mEACA,uCACA,mDCEA,kCACA,2BACA,8BACA,sBFOA","file":"fieldset.css"}
@@ -1,18 +0,0 @@
1
- <!-- @license CC0-1.0 -->
2
-
3
- # Fieldset
4
-
5
- A component to group related form inputs.
6
-
7
- ## Guidelines
8
-
9
- - Use Fieldset when you need to show a relationship between multiple form inputs. For example, you may need to group a set of text inputs into a single fieldset when asking for an address.
10
- - When grouping radio inputs, use `role="radiogroup"` on Fieldset to have this grouping explicitly announced as a radio group. Fieldset has a default role of `group`.
11
-
12
- ## Relevant WCAG Requirements
13
-
14
- - [WCAG 1.3.5](https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html): Fieldset labels the purpose of a group of inputs.
15
-
16
- ## References
17
-
18
- - [Providing a description for groups of form controls using fieldset and legend elements](https://www.w3.org/WAI/WCAG22/Techniques/html/H71)
@@ -1,35 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
-
6
- @import "../../common/hyphenation";
7
- @import "../../common/text-rendering";
8
-
9
- @mixin reset {
10
- border: 0;
11
- margin-inline: 0;
12
- padding-block: 0;
13
- padding-inline: 0;
14
- }
15
-
16
- .ams-fieldset {
17
- @include reset;
18
- }
19
-
20
- @mixin reset-legend {
21
- padding-inline: 0;
22
- }
23
-
24
- .ams-fieldset__legend {
25
- color: var(--ams-fieldset-legend-color);
26
- font-family: var(--ams-fieldset-legend-font-family);
27
- font-size: var(--ams-fieldset-legend-font-size);
28
- font-weight: var(--ams-fieldset-legend-font-weight);
29
- line-height: var(--ams-fieldset-legend-line-height);
30
- margin-block-end: 1rem; /* Because of a bug in Chrome we can’t use display grid or flex for this gap */
31
-
32
- @include hyphenation;
33
- @include text-rendering;
34
- @include reset-legend;
35
- }