@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.
- package/CHANGELOG.md +69 -0
- package/README.md +1 -1
- package/dist/accordion/accordion.css +1 -1
- package/dist/accordion/accordion.css.map +1 -1
- package/dist/alert/alert.css +1 -1
- package/dist/alert/alert.css.map +1 -1
- package/dist/avatar/avatar.css +1 -1
- package/dist/avatar/avatar.css.map +1 -1
- package/dist/breakout/breakout.css +1 -1
- package/dist/breakout/breakout.css.map +1 -1
- package/dist/button/button.css +1 -1
- package/dist/button/button.css.map +1 -1
- package/dist/card/card.css +1 -1
- package/dist/card/card.css.map +1 -1
- package/dist/checkbox/checkbox.css +1 -1
- package/dist/checkbox/checkbox.css.map +1 -1
- package/dist/date-input/date-input.css +1 -1
- package/dist/date-input/date-input.css.map +1 -1
- package/dist/dialog/dialog.css +1 -1
- package/dist/dialog/dialog.css.map +1 -1
- package/dist/field-set/field-set.css +1 -1
- package/dist/field-set/field-set.css.map +1 -1
- package/dist/file-input/file-input.css +1 -1
- package/dist/file-input/file-input.css.map +1 -1
- package/dist/grid/grid.css +1 -1
- package/dist/grid/grid.css.map +1 -1
- package/dist/heading/heading.css +1 -1
- package/dist/heading/heading.css.map +1 -1
- package/dist/hint/hint.css +1 -1
- package/dist/hint/hint.css.map +1 -1
- package/dist/icon/icon.css +1 -1
- package/dist/icon/icon.css.map +1 -1
- package/dist/image/image.css +1 -1
- package/dist/image/image.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/invalid-form-alert/invalid-form-alert.css.map +1 -1
- package/dist/label/label.css +1 -1
- package/dist/label/label.css.map +1 -1
- package/dist/link/link.css +1 -1
- package/dist/link/link.css.map +1 -1
- package/dist/page/page.css +1 -0
- package/dist/page/page.css.map +1 -0
- package/dist/page-footer/page-footer.css +1 -0
- package/dist/page-footer/page-footer.css.map +1 -0
- package/dist/page-header/page-header.css +1 -0
- package/dist/page-header/page-header.css.map +1 -0
- package/dist/page-heading/page-heading.css +1 -1
- package/dist/page-heading/page-heading.css.map +1 -1
- package/dist/password-input/password-input.css +1 -1
- package/dist/password-input/password-input.css.map +1 -1
- package/dist/radio/radio.css +1 -1
- package/dist/radio/radio.css.map +1 -1
- package/dist/search-field/search-field.css +1 -1
- package/dist/search-field/search-field.css.map +1 -1
- package/dist/select/select.css +1 -1
- package/dist/select/select.css.map +1 -1
- package/dist/standalone-link/standalone-link.css +1 -0
- package/dist/standalone-link/standalone-link.css.map +1 -0
- package/dist/switch/switch.css +1 -1
- package/dist/switch/switch.css.map +1 -1
- package/dist/text-area/text-area.css +1 -1
- package/dist/text-area/text-area.css.map +1 -1
- package/dist/text-input/text-input.css +1 -1
- package/dist/text-input/text-input.css.map +1 -1
- package/dist/time-input/time-input.css +1 -1
- package/dist/time-input/time-input.css.map +1 -1
- package/dist/visually-hidden/visually-hidden.css +1 -1
- package/dist/visually-hidden/visually-hidden.css.map +1 -1
- package/package.json +4 -4
- package/src/components/accordion/accordion.scss +1 -0
- package/src/components/alert/README.md +1 -1
- package/src/components/alert/alert.scss +6 -9
- package/src/components/aspect-ratio/README.md +1 -0
- package/src/components/avatar/avatar.scss +14 -10
- package/src/components/breakout/breakout.scss +19 -19
- package/src/components/button/README.md +6 -6
- package/src/components/button/button.scss +7 -18
- package/src/components/card/README.md +15 -14
- package/src/components/card/card.scss +9 -1
- package/src/components/checkbox/checkbox.scss +229 -125
- package/src/components/date-input/date-input.scss +9 -9
- package/src/components/dialog/README.md +3 -5
- package/src/components/dialog/dialog.scss +24 -1
- package/src/components/field-set/field-set.scss +7 -6
- package/src/components/file-input/file-input.scss +6 -10
- package/src/components/grid/README.md +9 -8
- package/src/components/grid/_mixins.scss +22 -22
- package/src/components/grid/grid.scss +19 -19
- package/src/components/heading/heading.scss +1 -0
- package/src/components/hint/hint.scss +1 -1
- package/src/components/icon/icon.scss +2 -1
- package/src/components/icon-button/README.md +6 -5
- package/src/components/image/image.scss +1 -2
- package/src/components/image-slider/README.md +1 -1
- package/src/components/index.scss +4 -6
- package/src/components/invalid-form-alert/invalid-form-alert.scss +5 -0
- package/src/components/label/label.scss +1 -0
- package/src/components/link/README.md +9 -10
- package/src/components/link/link.scss +6 -28
- package/src/components/logo/README.md +1 -1
- package/src/components/page/README.md +23 -0
- package/src/components/page/page.scss +12 -0
- package/src/components/{footer → page-footer}/README.md +7 -5
- package/src/components/page-footer/page-footer.scss +56 -0
- package/src/components/{header → page-header}/README.md +5 -5
- package/src/components/{header/header.scss → page-header/page-header.scss} +74 -57
- package/src/components/page-heading/README.md +1 -1
- package/src/components/page-heading/page-heading.scss +1 -0
- package/src/components/password-input/password-input.scss +13 -9
- package/src/components/radio/radio.scss +6 -4
- package/src/components/search-field/search-field.scss +5 -3
- package/src/components/select/select.scss +14 -8
- package/src/components/skip-link/README.md +3 -3
- package/src/components/spotlight/README.md +2 -3
- package/src/components/standalone-link/README.md +11 -0
- package/src/components/standalone-link/standalone-link.scss +53 -0
- package/src/components/switch/switch.scss +1 -1
- package/src/components/tabs/README.md +1 -1
- package/src/components/text-area/text-area.scss +9 -9
- package/src/components/text-input/text-input.scss +13 -9
- package/src/components/time-input/time-input.scss +9 -9
- package/src/components/visually-hidden/visually-hidden.scss +1 -0
- package/dist/footer/footer.css +0 -1
- package/dist/footer/footer.css.map +0 -1
- package/dist/header/header.css +0 -1
- package/dist/header/header.css.map +0 -1
- package/dist/mega-menu/mega-menu.css +0 -1
- package/dist/mega-menu/mega-menu.css.map +0 -1
- package/dist/page-menu/page-menu.css +0 -1
- package/dist/page-menu/page-menu.css.map +0 -1
- package/dist/screen/screen.css +0 -1
- package/dist/screen/screen.css.map +0 -1
- package/dist/top-task-link/top-task-link.css +0 -1
- package/dist/top-task-link/top-task-link.css.map +0 -1
- package/src/components/footer/footer.scss +0 -47
- package/src/components/mega-menu/README.md +0 -3
- package/src/components/mega-menu/mega-menu.scss +0 -16
- package/src/components/page-menu/README.md +0 -24
- package/src/components/page-menu/page-menu.scss +0 -65
- package/src/components/screen/README.md +0 -23
- package/src/components/screen/screen.scss +0 -23
- package/src/components/top-task-link/README.md +0 -27
- package/src/components/top-task-link/top-task-link.scss +0 -45
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
# Card
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
12
|
-
The
|
|
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
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
//
|
|
65
|
-
.ams-checkbox__input
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
//
|
|
74
|
-
.ams-checkbox__input:indeterminate {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
//
|
|
86
|
-
.ams-checkbox__input:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
//
|
|
94
|
-
.ams-checkbox__input:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
100
|
-
|
|
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
|
|
108
|
-
.ams-
|
|
109
|
-
|
|
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
|
|
116
|
-
.ams-
|
|
117
|
-
|
|
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
|
-
|
|
130
|
-
|
|
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
|
-
|
|
137
|
-
|
|
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
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
//
|
|
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
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
//
|
|
160
|
-
.ams-checkbox__input:
|
|
161
|
-
|
|
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
|
-
//
|
|
165
|
-
.ams-checkbox__input:
|
|
166
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
|
185
|
-
|
|
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
|
|
190
|
-
|
|
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
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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; //
|
|
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
|
-
|
|
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.
|