@amsterdam/design-system-css 0.15.0 → 1.0.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 (144) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +1 -1
  3. package/dist/accordion/accordion.css +1 -1
  4. package/dist/accordion/accordion.css.map +1 -1
  5. package/dist/alert/alert.css +1 -1
  6. package/dist/alert/alert.css.map +1 -1
  7. package/dist/avatar/avatar.css +1 -1
  8. package/dist/avatar/avatar.css.map +1 -1
  9. package/dist/breakout/breakout.css +1 -1
  10. package/dist/breakout/breakout.css.map +1 -1
  11. package/dist/button/button.css +1 -1
  12. package/dist/button/button.css.map +1 -1
  13. package/dist/card/card.css +1 -1
  14. package/dist/card/card.css.map +1 -1
  15. package/dist/checkbox/checkbox.css +1 -1
  16. package/dist/checkbox/checkbox.css.map +1 -1
  17. package/dist/date-input/date-input.css +1 -1
  18. package/dist/date-input/date-input.css.map +1 -1
  19. package/dist/dialog/dialog.css +1 -1
  20. package/dist/dialog/dialog.css.map +1 -1
  21. package/dist/field-set/field-set.css +1 -1
  22. package/dist/field-set/field-set.css.map +1 -1
  23. package/dist/file-input/file-input.css +1 -1
  24. package/dist/file-input/file-input.css.map +1 -1
  25. package/dist/grid/grid.css +1 -1
  26. package/dist/grid/grid.css.map +1 -1
  27. package/dist/heading/heading.css +1 -1
  28. package/dist/heading/heading.css.map +1 -1
  29. package/dist/hint/hint.css +1 -1
  30. package/dist/hint/hint.css.map +1 -1
  31. package/dist/icon/icon.css +1 -1
  32. package/dist/icon/icon.css.map +1 -1
  33. package/dist/image/image.css +1 -1
  34. package/dist/image/image.css.map +1 -1
  35. package/dist/index.css +1 -1
  36. package/dist/index.css.map +1 -1
  37. package/dist/invalid-form-alert/invalid-form-alert.css.map +1 -1
  38. package/dist/label/label.css +1 -1
  39. package/dist/label/label.css.map +1 -1
  40. package/dist/link/link.css +1 -1
  41. package/dist/link/link.css.map +1 -1
  42. package/dist/page/page.css +1 -0
  43. package/dist/page/page.css.map +1 -0
  44. package/dist/page-footer/page-footer.css +1 -0
  45. package/dist/page-footer/page-footer.css.map +1 -0
  46. package/dist/page-header/page-header.css +1 -0
  47. package/dist/page-header/page-header.css.map +1 -0
  48. package/dist/page-heading/page-heading.css +1 -1
  49. package/dist/page-heading/page-heading.css.map +1 -1
  50. package/dist/password-input/password-input.css +1 -1
  51. package/dist/password-input/password-input.css.map +1 -1
  52. package/dist/radio/radio.css +1 -1
  53. package/dist/radio/radio.css.map +1 -1
  54. package/dist/search-field/search-field.css +1 -1
  55. package/dist/search-field/search-field.css.map +1 -1
  56. package/dist/select/select.css +1 -1
  57. package/dist/select/select.css.map +1 -1
  58. package/dist/standalone-link/standalone-link.css +1 -0
  59. package/dist/standalone-link/standalone-link.css.map +1 -0
  60. package/dist/switch/switch.css +1 -1
  61. package/dist/switch/switch.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/visually-hidden/visually-hidden.css +1 -1
  69. package/dist/visually-hidden/visually-hidden.css.map +1 -1
  70. package/package.json +4 -4
  71. package/src/components/accordion/accordion.scss +1 -0
  72. package/src/components/alert/README.md +1 -1
  73. package/src/components/alert/alert.scss +6 -9
  74. package/src/components/aspect-ratio/README.md +1 -0
  75. package/src/components/avatar/avatar.scss +14 -10
  76. package/src/components/breakout/breakout.scss +19 -19
  77. package/src/components/button/README.md +6 -6
  78. package/src/components/button/button.scss +7 -18
  79. package/src/components/card/README.md +15 -14
  80. package/src/components/card/card.scss +9 -1
  81. package/src/components/checkbox/checkbox.scss +229 -125
  82. package/src/components/date-input/date-input.scss +9 -9
  83. package/src/components/dialog/README.md +3 -5
  84. package/src/components/dialog/dialog.scss +24 -1
  85. package/src/components/field-set/field-set.scss +7 -6
  86. package/src/components/file-input/file-input.scss +6 -10
  87. package/src/components/grid/README.md +9 -8
  88. package/src/components/grid/_mixins.scss +22 -22
  89. package/src/components/grid/grid.scss +19 -19
  90. package/src/components/heading/heading.scss +1 -0
  91. package/src/components/hint/hint.scss +1 -1
  92. package/src/components/icon/icon.scss +2 -1
  93. package/src/components/icon-button/README.md +6 -5
  94. package/src/components/image/image.scss +1 -2
  95. package/src/components/image-slider/README.md +1 -1
  96. package/src/components/index.scss +4 -6
  97. package/src/components/invalid-form-alert/invalid-form-alert.scss +5 -0
  98. package/src/components/label/label.scss +1 -0
  99. package/src/components/link/README.md +9 -10
  100. package/src/components/link/link.scss +6 -28
  101. package/src/components/logo/README.md +1 -1
  102. package/src/components/page/README.md +23 -0
  103. package/src/components/page/page.scss +12 -0
  104. package/src/components/{footer → page-footer}/README.md +7 -5
  105. package/src/components/page-footer/page-footer.scss +56 -0
  106. package/src/components/{header → page-header}/README.md +5 -5
  107. package/src/components/{header/header.scss → page-header/page-header.scss} +74 -57
  108. package/src/components/page-heading/README.md +1 -1
  109. package/src/components/page-heading/page-heading.scss +1 -0
  110. package/src/components/password-input/password-input.scss +13 -9
  111. package/src/components/radio/radio.scss +6 -4
  112. package/src/components/search-field/search-field.scss +5 -3
  113. package/src/components/select/select.scss +14 -8
  114. package/src/components/skip-link/README.md +3 -3
  115. package/src/components/spotlight/README.md +2 -3
  116. package/src/components/standalone-link/README.md +11 -0
  117. package/src/components/standalone-link/standalone-link.scss +53 -0
  118. package/src/components/switch/switch.scss +1 -1
  119. package/src/components/tabs/README.md +1 -1
  120. package/src/components/text-area/text-area.scss +9 -9
  121. package/src/components/text-input/text-input.scss +13 -9
  122. package/src/components/time-input/time-input.scss +9 -9
  123. package/src/components/visually-hidden/visually-hidden.scss +1 -0
  124. package/dist/footer/footer.css +0 -1
  125. package/dist/footer/footer.css.map +0 -1
  126. package/dist/header/header.css +0 -1
  127. package/dist/header/header.css.map +0 -1
  128. package/dist/mega-menu/mega-menu.css +0 -1
  129. package/dist/mega-menu/mega-menu.css.map +0 -1
  130. package/dist/page-menu/page-menu.css +0 -1
  131. package/dist/page-menu/page-menu.css.map +0 -1
  132. package/dist/screen/screen.css +0 -1
  133. package/dist/screen/screen.css.map +0 -1
  134. package/dist/top-task-link/top-task-link.css +0 -1
  135. package/dist/top-task-link/top-task-link.css.map +0 -1
  136. package/src/components/footer/footer.scss +0 -47
  137. package/src/components/mega-menu/README.md +0 -3
  138. package/src/components/mega-menu/mega-menu.scss +0 -16
  139. package/src/components/page-menu/README.md +0 -24
  140. package/src/components/page-menu/page-menu.scss +0 -65
  141. package/src/components/screen/README.md +0 -23
  142. package/src/components/screen/screen.scss +0 -23
  143. package/src/components/top-task-link/README.md +0 -27
  144. package/src/components/top-task-link/top-task-link.scss +0 -45
@@ -2,27 +2,28 @@
2
2
 
3
3
  # Card
4
4
 
5
- Use a card on an overview page to link to an article page, such as a news article, a job vacancy, or a search result.
6
- The card typically includes the title, introduction, and an image of the content.
7
- The link is mandatory.
5
+ A brief section of a heading, some text, and optionally an image, that leads to a related page.
8
6
 
9
7
  ## Guidelines
10
8
 
11
- - The title of a card is a link within a heading.
12
- The same guidelines as for regular [links](/docs/components-navigation-link--docs) and [headings](/docs/components-text-heading--docs) apply here.
13
- The link is active across the entire area of the card.
9
+ - The mandatory title of a card is a link within a Heading.
10
+ The guidelines for regular [links](/docs/components-navigation-link--docs) and [headings](/docs/components-text-heading--docs) apply.
11
+ The link is made active across the entire area of the card.
14
12
  - A card needs more content than just a title.
15
- Supplement this with textual and/or visual content.
16
- - Place the text in a regular paragraph.
17
- Only use the smallest text size for a tagline or date.
18
- - This component may not be the best option if the content does not represent a detailed page.
19
- For referencing a thematic page, use a [top task link](/docs/components-navigation-top-task-link--docs).
20
- You can also use a [regular link](/docs/components-navigation-link--docs).
13
+ Add a short text and optionally an image and metadata.
14
+ - Use the Card Heading, Card Heading Group and Card Image subcomponents.
15
+ They apply the correct spacing.
16
+ - Card Heading requires a `level`, because there is no sensible default.
17
+ Its visual size of `heading-4` can be overridden.
18
+ - Place the text in a regular [Paragraph](/docs/components-text-paragraph--docs).
19
+ Use a small Paragraph for a publication date.
20
+ - This component is not the best option if the target content does not represent an article-like page.
21
+ In that case, use a Heading, a Paragraph and a [Standalone Link](/docs/components-navigation-standalone-link--docs) instead.
21
22
 
22
23
  ### Screen readers
23
24
 
24
- With a screen reader, you can navigate using headings and links in a document.
25
- The title of a card is a link within a heading, allowing you to utilize both navigation methods.
25
+ Screen reader users may navigate a page using headings and links.
26
+ A Card works well in both approaches as its title carries a link.
26
27
  A screen reader reads the title first, followed by the rest of the content.
27
28
 
28
29
  ### Using links with routing libraries
@@ -5,7 +5,6 @@
5
5
 
6
6
  .ams-card {
7
7
  display: grid;
8
- gap: var(--ams-card-gap);
9
8
  outline-offset: var(--ams-card-outline-offset);
10
9
  position: relative; // Allows stretching the card link below.
11
10
  touch-action: manipulation;
@@ -16,12 +15,21 @@
16
15
  outline-style: auto;
17
16
  outline-width: 0.0625rem;
18
17
  }
18
+
19
+ > .ams-card__heading:has(+ *) {
20
+ margin-block-end: var(--ams-card-heading-margin-block-end);
21
+ }
22
+
23
+ > .ams-card__image:has(+ *) {
24
+ margin-block-end: var(--ams-card-image-margin-block-end);
25
+ }
19
26
  }
20
27
 
21
28
  .ams-card__heading-group {
22
29
  display: flex;
23
30
  flex-direction: column-reverse;
24
31
  gap: var(--ams-card-heading-group-gap);
32
+ margin-block-end: var(--ams-card-heading-group-margin-block-end);
25
33
  }
26
34
 
27
35
  .ams-card__link {
@@ -13,27 +13,7 @@
13
13
  @include input-label-focus;
14
14
  }
15
15
 
16
- .ams-checkbox__checkmark {
17
- align-items: center;
18
- block-size: calc(var(--ams-checkbox-font-size) * var(--ams-checkbox-line-height));
19
- display: flex;
20
- flex-shrink: 0;
21
- inline-size: 1.5rem;
22
-
23
- &::after {
24
- background-position: center;
25
- background-repeat: no-repeat;
26
- background-size: 1rem;
27
- block-size: 1.5rem;
28
- border-color: var(--ams-checkbox-checkmark-border-color);
29
- border-style: solid;
30
- border-width: var(--ams-checkbox-checkmark-border-width);
31
- box-sizing: border-box;
32
- content: "";
33
- inline-size: 100%;
34
- }
35
- }
36
-
16
+ // Default
37
17
  .ams-checkbox__label {
38
18
  color: var(--ams-checkbox-color);
39
19
  cursor: var(--ams-checkbox-cursor);
@@ -47,166 +27,290 @@
47
27
 
48
28
  @include hyphenation;
49
29
  @include text-rendering;
30
+ }
50
31
 
51
- &:hover {
52
- color: var(--ams-checkbox-hover-color);
53
- text-decoration-line: underline;
54
- text-decoration-thickness: var(--ams-checkbox-hover-text-decoration-thickness);
55
- text-underline-offset: 0.375rem;
32
+ .ams-checkbox__icon-container {
33
+ block-size: var(--ams-checkbox-icon-container-block-size);
34
+ display: flex;
35
+ flex: none;
36
+ inline-size: var(--ams-checkbox-icon-container-inline-size);
37
+ }
56
38
 
57
- .ams-checkbox__checkmark::after {
58
- border-color: var(--ams-checkbox-checkmark-hover-border-color);
59
- border-width: var(--ams-checkbox-checkmark-hover-border-width);
60
- }
39
+ .ams-checkbox__rectangle {
40
+ fill: var(--ams-checkbox-rectangle-fill);
41
+ stroke: var(--ams-checkbox-rectangle-stroke);
42
+ }
43
+
44
+ .ams-checkbox__hover-indicator {
45
+ stroke: none;
46
+ }
47
+
48
+ .ams-checkbox__checked-indicator {
49
+ display: none;
50
+ stroke: var(--ams-checkbox-checked-indicator-stroke);
51
+ }
52
+
53
+ .ams-checkbox__indeterminate-indicator {
54
+ display: none;
55
+ stroke: var(--ams-checkbox-indeterminate-indicator-stroke);
56
+ }
57
+
58
+ // Default hover
59
+ .ams-checkbox__label:hover {
60
+ color: var(--ams-checkbox-hover-color);
61
+ text-decoration-line: underline;
62
+ text-decoration-thickness: var(--ams-checkbox-hover-text-decoration-thickness);
63
+ text-underline-offset: 0.375rem;
64
+
65
+ .ams-checkbox__rectangle {
66
+ stroke: var(--ams-checkbox-rectangle-hover-stroke);
67
+ }
68
+
69
+ .ams-checkbox__hover-indicator {
70
+ stroke: var(--ams-checkbox-hover-indicator-hover-stroke);
61
71
  }
62
72
  }
63
73
 
64
- // Default checked
65
- .ams-checkbox__input:checked {
66
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
67
- background-color: var(--ams-checkbox-checkmark-checked-background-color);
68
- background-image: var(--ams-checkbox-checkmark-checked-background-image);
69
- border: none;
74
+ // Invalid
75
+ .ams-checkbox__input[aria-invalid="true"] + .ams-checkbox__label {
76
+ .ams-checkbox__rectangle {
77
+ stroke: var(--ams-checkbox-rectangle-invalid-stroke);
70
78
  }
71
79
  }
72
80
 
73
- // Default indeterminate
74
- .ams-checkbox__input:indeterminate {
75
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
76
- background-color: var(--ams-checkbox-checkmark-indeterminate-background-color);
77
- background-image: var(--ams-checkbox-checkmark-indeterminate-background-image);
78
- background-position: center;
79
- background-repeat: no-repeat;
80
- background-size: 1rem;
81
- border: none;
81
+ // Indeterminate
82
+ .ams-checkbox__input:indeterminate + .ams-checkbox__label {
83
+ .ams-checkbox__rectangle {
84
+ fill: var(--ams-checkbox-rectangle-indeterminate-fill);
85
+ }
86
+
87
+ .ams-checkbox__indeterminate-indicator {
88
+ display: block;
82
89
  }
83
90
  }
84
91
 
85
- // Invalid unchecked
86
- .ams-checkbox__input:invalid,
87
- .ams-checkbox__input[aria-invalid="true"] {
88
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
89
- border-color: var(--ams-checkbox-checkmark-invalid-border-color);
92
+ // Disabled
93
+ .ams-checkbox__input:disabled + .ams-checkbox__label {
94
+ color: var(--ams-checkbox-disabled-color);
95
+ cursor: var(--ams-checkbox-disabled-cursor);
96
+
97
+ .ams-checkbox__rectangle {
98
+ stroke: var(--ams-checkbox-rectangle-disabled-stroke);
99
+ }
100
+
101
+ .ams-checkbox__hover-indicator {
102
+ stroke: none;
90
103
  }
91
104
  }
92
105
 
93
- // Disabled unchecked
94
- .ams-checkbox__input:disabled {
95
- + .ams-checkbox__label {
96
- color: var(--ams-checkbox-disabled-color);
97
- cursor: var(--ams-checkbox-disabled-cursor);
106
+ // Checked
107
+ .ams-checkbox__input:checked:not(:indeterminate) + .ams-checkbox__label {
108
+ .ams-checkbox__rectangle {
109
+ fill: var(--ams-checkbox-rectangle-checked-fill);
110
+ }
98
111
 
99
- .ams-checkbox__checkmark::after {
100
- border-color: var(--ams-checkbox-checkmark-disabled-border-color);
101
- border-width: var(--ams-checkbox-checkmark-disabled-border-width);
102
- }
112
+ .ams-checkbox__checked-indicator {
113
+ display: block;
103
114
  }
104
115
  }
105
116
 
106
117
  // Invalid checked
107
- .ams-checkbox__input:invalid:checked,
108
- .ams-checkbox__input[aria-invalid="true"]:checked {
109
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
110
- background-color: var(--ams-checkbox-checkmark-invalid-checked-background-color);
118
+ .ams-checkbox__input[aria-invalid="true"]:checked + .ams-checkbox__label {
119
+ .ams-checkbox__rectangle {
120
+ fill: var(--ams-checkbox-rectangle-checked-invalid-fill);
111
121
  }
112
122
  }
113
123
 
114
124
  // Invalid indeterminate
115
- .ams-checkbox__input:invalid:indeterminate,
116
- .ams-checkbox__input[aria-invalid="true"]:indeterminate {
117
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
118
- background-color: var(--ams-checkbox-checkmark-invalid-indeterminate-background-color);
125
+ .ams-checkbox__input[aria-invalid="true"]:indeterminate + .ams-checkbox__label {
126
+ .ams-checkbox__rectangle {
127
+ fill: var(--ams-checkbox-rectangle-indeterminate-invalid-fill);
119
128
  }
120
129
  }
121
130
 
122
- // Disabled label
123
- .ams-checkbox__input:disabled + .ams-checkbox__label:hover {
124
- text-decoration: none;
125
- }
126
-
127
131
  // Disabled checked
128
- .ams-checkbox__input:disabled:checked {
129
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
130
- background-color: var(--ams-checkbox-checkmark-disabled-checked-background-color);
132
+ .ams-checkbox__input:disabled:checked + .ams-checkbox__label {
133
+ .ams-checkbox__rectangle {
134
+ fill: var(--ams-checkbox-rectangle-checked-disabled-fill);
131
135
  }
132
136
  }
133
137
 
134
138
  // Disabled indeterminate
135
- .ams-checkbox__input:disabled:indeterminate {
136
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
137
- background-color: var(--ams-checkbox-checkmark-disabled-indeterminate-background-color);
139
+ .ams-checkbox__input:disabled:indeterminate + .ams-checkbox__label {
140
+ .ams-checkbox__rectangle {
141
+ fill: var(--ams-checkbox-rectangle-indeterminate-disabled-fill);
138
142
  }
139
143
  }
140
144
 
141
- // Disabled invalid unchecked
142
- .ams-checkbox__input:invalid:disabled,
143
- .ams-checkbox__input[aria-invalid="true"]:disabled {
144
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
145
- // TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
146
- border-color: var(--ams-checkbox-checkmark-disabled-border-color);
145
+ // HOVER
146
+
147
+ // Checked hover
148
+ .ams-checkbox__input:checked + .ams-checkbox__label:hover {
149
+ .ams-checkbox__rectangle {
150
+ fill: var(--ams-checkbox-rectangle-checked-hover-fill);
147
151
  }
148
152
  }
149
153
 
150
- // HOVER STATES
154
+ // Indeterminate hover
155
+ .ams-checkbox__input:indeterminate + .ams-checkbox__label:hover {
156
+ .ams-checkbox__rectangle {
157
+ fill: var(--ams-checkbox-rectangle-indeterminate-hover-fill);
158
+ }
159
+ }
151
160
 
152
- // Invalid unchecked hover
153
- :is(.ams-checkbox__input:invalid, .ams-checkbox__input[aria-invalid="true"])
154
- + .ams-checkbox__label:hover
155
- .ams-checkbox__checkmark::after {
156
- border-color: var(--ams-checkbox-checkmark-invalid-hover-border-color);
161
+ // Invalid hover
162
+ .ams-checkbox__input[aria-invalid="true"] + .ams-checkbox__label:hover {
163
+ .ams-checkbox__rectangle {
164
+ stroke: var(--ams-checkbox-rectangle-invalid-hover-stroke);
165
+ }
166
+
167
+ .ams-checkbox__hover-indicator {
168
+ stroke: var(--ams-checkbox-hover-indicator-invalid-hover-stroke);
169
+ }
157
170
  }
158
171
 
159
- // Default checked hover
160
- .ams-checkbox__input:checked + .ams-checkbox__label:hover .ams-checkbox__checkmark::after {
161
- background-color: var(--ams-checkbox-checkmark-checked-hover-background-color);
172
+ // Disabled invalid hover
173
+ .ams-checkbox__input[aria-invalid="true"]:disabled + .ams-checkbox__label:hover {
174
+ .ams-checkbox__rectangle {
175
+ stroke: var(--ams-checkbox-rectangle-hover-disabled-invalid-stroke);
176
+ }
162
177
  }
163
178
 
164
- // Default indeterminate hover
165
- .ams-checkbox__input:indeterminate + .ams-checkbox__label:hover .ams-checkbox__checkmark::after {
166
- background-color: var(--ams-checkbox-checkmark-indeterminate-hover-background-color);
179
+ // Disabled checked hover
180
+ .ams-checkbox__input:disabled:checked + .ams-checkbox__label:hover {
181
+ .ams-checkbox__rectangle {
182
+ fill: var(--ams-checkbox-rectangle-checked-disabled-hover-fill);
183
+ }
184
+ }
185
+
186
+ // Disabled indeterminate hover
187
+ .ams-checkbox__input:disabled:indeterminate + .ams-checkbox__label:hover {
188
+ .ams-checkbox__rectangle {
189
+ fill: var(--ams-checkbox-rectangle-indeterminate-disabled-hover-fill);
190
+ }
191
+ }
192
+
193
+ // Disabled hover
194
+ .ams-checkbox__input:disabled + .ams-checkbox__label:hover {
195
+ text-decoration: none;
196
+
197
+ .ams-checkbox__hover-indicator {
198
+ stroke: none;
199
+ }
167
200
  }
168
201
 
169
202
  // Invalid checked hover
170
- :is(.ams-checkbox__input:invalid:checked, .ams-checkbox__input[aria-invalid="true"]:checked)
171
- + .ams-checkbox__label:hover
172
- .ams-checkbox__checkmark::after {
173
- background-color: var(--ams-checkbox-checkmark-invalid-checked-hover-background-color);
203
+ .ams-checkbox__input[aria-invalid="true"]:checked + .ams-checkbox__label:hover {
204
+ .ams-checkbox__rectangle {
205
+ fill: var(--ams-checkbox-rectangle-checked-invalid-hover-fill);
206
+ }
174
207
  }
175
208
 
176
209
  // Invalid indeterminate hover
177
- :is(.ams-checkbox__input:invalid:indeterminate, .ams-checkbox__input[aria-invalid="true"]:indeterminate)
178
- + .ams-checkbox__label:hover
179
- .ams-checkbox__checkmark::after {
180
- background-color: var(--ams-checkbox-checkmark-invalid-indeterminate-hover-background-color);
210
+ .ams-checkbox__input[aria-invalid="true"]:indeterminate + .ams-checkbox__label:hover {
211
+ .ams-checkbox__rectangle {
212
+ fill: var(--ams-checkbox-rectangle-indeterminate-invalid-hover-fill);
213
+ }
181
214
  }
182
215
 
183
- // Disabled checked hover
184
- .ams-checkbox__input:disabled:checked + .ams-checkbox__label:hover .ams-checkbox__checkmark::after {
185
- background-color: var(--ams-checkbox-checkmark-disabled-checked-hover-background-color);
216
+ // Disabled invalid checked hover
217
+ .ams-checkbox__input[aria-invalid="true"]:disabled:checked + .ams-checkbox__label:hover {
218
+ .ams-checkbox__rectangle {
219
+ fill: var(--ams-checkbox-rectangle-checked-hover-disabled-invalid-fill);
220
+ }
186
221
  }
187
222
 
188
- // Disabled indeterminate hover
189
- .ams-checkbox__input:disabled:indeterminate + .ams-checkbox__label:hover .ams-checkbox__checkmark::after {
190
- background-color: var(--ams-checkbox-checkmark-disabled-indeterminate-hover-background-color);
223
+ // Disabled invalid indeterminate hover
224
+ .ams-checkbox__input[aria-invalid="true"]:disabled:indeterminate + .ams-checkbox__label:hover {
225
+ .ams-checkbox__rectangle {
226
+ fill: var(--ams-checkbox-rectangle-indeterminate-hover-disabled-invalid-fill);
227
+ }
191
228
  }
192
229
 
193
- // Disabled invalid unchecked hover
194
- :is(.ams-checkbox__input:invalid:disabled, .ams-checkbox__input[aria-invalid="true"]:disabled)
195
- + .ams-checkbox__label:hover
196
- .ams-checkbox__checkmark::after {
197
- // TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
198
- border-color: var(--ams-checkbox-checkmark-disabled-border-color);
230
+ // FORCED COLORS
231
+
232
+ // Default
233
+ @media (forced-colors: active) {
234
+ .ams-checkbox__label,
235
+ .ams-checkbox__label:hover,
236
+ .ams-checkbox__input[aria-invalid="true"] + .ams-checkbox__label,
237
+ .ams-checkbox__input[aria-invalid="true"] + .ams-checkbox__label:hover {
238
+ .ams-checkbox__rectangle {
239
+ fill: Canvas;
240
+ stroke: FieldText;
241
+ }
242
+
243
+ .ams-checkbox__hover-indicator {
244
+ stroke: none;
245
+ }
246
+ }
199
247
  }
200
248
 
201
- // DISABLED INVALID STATES
249
+ // Checked
250
+ @media (forced-colors: active) {
251
+ .ams-checkbox__input:checked:not(:indeterminate) + .ams-checkbox__label,
252
+ .ams-checkbox__input:checked + .ams-checkbox__label:hover,
253
+ .ams-checkbox__input[aria-invalid="true"]:checked + .ams-checkbox__label,
254
+ .ams-checkbox__input[aria-invalid="true"]:checked + .ams-checkbox__label:hover {
255
+ .ams-checkbox__rectangle {
256
+ fill: ActiveText;
257
+ stroke: ActiveText;
258
+ }
202
259
 
203
- // Disabled invalid checked & indeterminate
204
- .ams-checkbox__input:invalid:disabled:checked,
205
- .ams-checkbox__input:invalid:disabled:indeterminate,
206
- .ams-checkbox__input[aria-invalid="true"]:disabled:checked,
207
- .ams-checkbox__input[aria-invalid="true"]:disabled:indeterminate {
208
- + .ams-checkbox__label .ams-checkbox__checkmark::after {
209
- // TODO: currently disabled invalid gets the same styling as disabled. This should get its own styling.
210
- background-color: var(--ams-checkbox-checkmark-disabled-checked-background-color);
260
+ .ams-checkbox__checked-indicator {
261
+ stroke: Canvas;
262
+ }
263
+ }
264
+ }
265
+
266
+ // Indeterminate
267
+ @media (forced-colors: active) {
268
+ .ams-checkbox__input:indeterminate + .ams-checkbox__label,
269
+ .ams-checkbox__input:indeterminate + .ams-checkbox__label:hover,
270
+ .ams-checkbox__input[aria-invalid="true"]:indeterminate + .ams-checkbox__label,
271
+ .ams-checkbox__input[aria-invalid="true"]:indeterminate + .ams-checkbox__label:hover {
272
+ .ams-checkbox__rectangle {
273
+ fill: ActiveText;
274
+ stroke: ActiveText;
275
+ }
276
+
277
+ .ams-checkbox__indeterminate-indicator {
278
+ stroke: Canvas;
279
+ }
280
+ }
281
+ }
282
+
283
+ // Disabled
284
+ @media (forced-colors: active) {
285
+ .ams-checkbox__input:disabled + .ams-checkbox__label,
286
+ .ams-checkbox__input:disabled + .ams-checkbox__label:hover,
287
+ .ams-checkbox__input[aria-invalid="true"]:disabled + .ams-checkbox__label,
288
+ .ams-checkbox__input[aria-invalid="true"]:disabled + .ams-checkbox__label:hover {
289
+ .ams-checkbox__rectangle {
290
+ stroke: GrayText;
291
+ }
292
+ }
293
+ }
294
+
295
+ // Disabled checked
296
+ @media (forced-colors: active) {
297
+ .ams-checkbox__input:disabled:checked + .ams-checkbox__label,
298
+ .ams-checkbox__input:disabled:checked + .ams-checkbox__label:hover,
299
+ .ams-checkbox__input[aria-invalid="true"]:disabled:checked + .ams-checkbox__label:hover {
300
+ .ams-checkbox__rectangle {
301
+ fill: GrayText;
302
+ stroke: GrayText;
303
+ }
304
+ }
305
+ }
306
+
307
+ // Disabled indeterminate
308
+ @media (forced-colors: active) {
309
+ .ams-checkbox__input:disabled:indeterminate + .ams-checkbox__label,
310
+ .ams-checkbox__input:disabled:indeterminate + .ams-checkbox__label:hover,
311
+ .ams-checkbox__input[aria-invalid="true"]:disabled:indeterminate + .ams-checkbox__label:hover {
312
+ .ams-checkbox__rectangle {
313
+ fill: GrayText;
314
+ }
211
315
  }
212
316
  }
@@ -8,14 +8,15 @@
8
8
  @mixin reset-input {
9
9
  -webkit-appearance: none; // Reset appearance for Safari < 15.4
10
10
  appearance: none; // Reset native appearance, this causes issues on iOS and Android devices
11
- border: none;
12
11
  border-radius: 0; // Reset rounded borders on iOS devices
13
12
  margin-block: 0;
14
13
  }
15
14
 
16
15
  .ams-date-input {
17
16
  background-color: var(--ams-date-input-background-color);
18
- box-shadow: var(--ams-date-input-box-shadow);
17
+ border-color: var(--ams-date-input-border-color);
18
+ border-style: var(--ams-date-input-border-style);
19
+ border-width: var(--ams-date-input-border-width);
19
20
  box-sizing: border-box;
20
21
  color: var(--ams-date-input-color);
21
22
  font-family: var(--ams-date-input-font-family);
@@ -37,10 +38,6 @@
37
38
 
38
39
  @include text-rendering;
39
40
  @include reset-input;
40
-
41
- &:hover {
42
- box-shadow: var(--ams-date-input-hover-box-shadow);
43
- }
44
41
  }
45
42
 
46
43
  // This changes the default calendar icon on Chromium browsers only
@@ -55,8 +52,6 @@
55
52
  }
56
53
 
57
54
  .ams-date-input:disabled {
58
- background-color: var(--ams-date-input-disabled-background-color);
59
- box-shadow: var(--ams-date-input-disabled-box-shadow);
60
55
  color: var(--ams-date-input-disabled-color);
61
56
  cursor: var(--ams-date-input-disabled-cursor);
62
57
  }
@@ -68,9 +63,14 @@
68
63
 
69
64
  .ams-date-input:invalid,
70
65
  .ams-date-input[aria-invalid="true"] {
71
- box-shadow: var(--ams-date-input-invalid-box-shadow);
66
+ border-color: var(--ams-date-input-invalid-border-color);
72
67
 
73
68
  &:hover {
69
+ border-color: var(--ams-date-input-invalid-hover-border-color);
74
70
  box-shadow: var(--ams-date-input-invalid-hover-box-shadow);
75
71
  }
76
72
  }
73
+
74
+ .ams-date-input:not(:disabled):hover {
75
+ box-shadow: var(--ams-date-input-hover-box-shadow);
76
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Dialog
4
4
 
5
- A Dialog allows the user to focus on one task or a piece of information by popping up and blocking the page content until the modal task is completed or until the user dismisses the action.
5
+ A popup window in which the user must perform an action to proceed.
6
6
 
7
7
  ## Guidelines
8
8
 
@@ -10,6 +10,8 @@ A Dialog allows the user to focus on one task or a piece of information by poppi
10
10
  - Use a dialog for short and non-frequent tasks.
11
11
  Consider using the main flow for regular tasks.
12
12
  - Wrap multiple buttons in an [Action Group](https://designsystem.amsterdam/?path=/docs/components-layout-action-group--docs).
13
+ - To open the Dialog, use `Dialog.open(dialogId)` from the React package.
14
+ - To close it, either call the `Dialog.close` function or add a `<form>` as in the ‘confirmation’ example.
13
15
 
14
16
  ## Keyboard support
15
17
 
@@ -19,10 +21,6 @@ A Dialog allows the user to focus on one task or a piece of information by poppi
19
21
  | Shift + Tab | Moves focus to the previous focusable element inside the dialog. |
20
22
  | Escape | Closes the dialog. |
21
23
 
22
- ## Closing Dialog without submit
23
-
24
- You can close a Dialog without submitting by using `<button type="button" onClick={Dialog.close}>`.
25
-
26
24
  ## References
27
25
 
28
26
  - [HTMLDialogElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement)
@@ -3,6 +3,8 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
+ @use "../../common/breakpoint" as *;
7
+
6
8
  @mixin reset-dialog {
7
9
  inset-block: 0;
8
10
  padding-block: 0;
@@ -13,7 +15,9 @@
13
15
  so do not apply these styles without an `open` attribute. */
14
16
  .ams-dialog:not(dialog:not([open])) {
15
17
  background-color: var(--ams-dialog-background-color);
16
- border: var(--ams-dialog-border);
18
+ border-color: var(--ams-dialog-border-color);
19
+ border-style: var(--ams-dialog-border-style);
20
+ border-width: var(--ams-dialog-border-width);
17
21
  box-sizing: border-box;
18
22
  display: flex; // We’d like to use CSS Grid here, but that doesn’t work as expected in Safari.
19
23
  flex-direction: column;
@@ -24,6 +28,11 @@ so do not apply these styles without an `open` attribute. */
24
28
 
25
29
  @include reset-dialog;
26
30
 
31
+ @media screen and (min-width: $ams-breakpoint-medium) {
32
+ inline-size: var(--ams-dialog-medium-inline-size);
33
+ max-block-size: var(--ams-dialog-medium-max-block-size);
34
+ }
35
+
27
36
  /*
28
37
  * The fallback value is for browsers where ::backdrop does not inherit from its originating element.
29
38
  * @see https://caniuse.com/mdn-css_selectors_backdrop_inherit_from_originating_element
@@ -40,6 +49,11 @@ so do not apply these styles without an `open` attribute. */
40
49
  justify-content: space-between;
41
50
  padding-block: var(--ams-dialog-header-padding-block);
42
51
  padding-inline: var(--ams-dialog-header-padding-inline);
52
+
53
+ @media screen and (min-width: $ams-breakpoint-medium) {
54
+ padding-block: var(--ams-dialog-header-medium-padding-block);
55
+ padding-inline: var(--ams-dialog-header-medium-padding-inline);
56
+ }
43
57
  }
44
58
 
45
59
  .ams-dialog__body {
@@ -47,9 +61,18 @@ so do not apply these styles without an `open` attribute. */
47
61
  overscroll-behavior-y: contain;
48
62
  padding-block: var(--ams-dialog-body-padding-block);
49
63
  padding-inline: var(--ams-dialog-body-padding-inline);
64
+
65
+ @media screen and (min-width: $ams-breakpoint-medium) {
66
+ padding-inline: var(--ams-dialog-body-medium-padding-inline);
67
+ }
50
68
  }
51
69
 
52
70
  .ams-dialog__footer {
53
71
  padding-block: var(--ams-dialog-footer-padding-block);
54
72
  padding-inline: var(--ams-dialog-footer-padding-inline);
73
+
74
+ @media screen and (min-width: $ams-breakpoint-medium) {
75
+ padding-block: var(--ams-dialog-footer-medium-padding-block);
76
+ padding-inline: var(--ams-dialog-footer-medium-padding-inline);
77
+ }
55
78
  }
@@ -30,23 +30,24 @@
30
30
  padding-inline: 0;
31
31
 
32
32
  + * {
33
- clear: both; // Reset the applied float for the legend’s first sibling
33
+ clear: both; // [2]
34
34
  }
35
35
  }
36
36
 
37
- // [1] This combination allows the fieldset border to go around the legend, instead of through it.
38
-
39
37
  .ams-field-set__legend {
40
38
  color: var(--ams-field-set-legend-color);
41
39
  font-family: var(--ams-field-set-legend-font-family);
42
40
  font-size: var(--ams-field-set-legend-font-size);
43
41
  font-weight: var(--ams-field-set-legend-font-weight);
44
42
  line-height: var(--ams-field-set-legend-line-height);
45
- margin-block-end: var(
46
- --ams-field-set-legend-margin-block-end
47
- ); /* Because of a bug in Chrome we can’t use display grid or flex for this gap */
43
+ margin-block-end: var(--ams-field-set-legend-margin-block-end); // [3]
44
+ text-wrap: var(--ams-field-set-legend-text-wrap);
48
45
 
49
46
  @include hyphenation;
50
47
  @include text-rendering;
51
48
  @include reset-legend;
52
49
  }
50
+
51
+ // [1] This combination allows the fieldset border to go around the legend, instead of through it.
52
+ // [2] Reset the applied float for the legend’s first sibling.
53
+ // [3] We can’t use grid or flex display and a gap because of a bug in Chrome.