@amsterdam/design-system-css 2.0.1 → 2.1.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 (85) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/accordion/accordion.css.map +1 -1
  3. package/dist/app/app.css +40 -0
  4. package/dist/app/app.css.map +1 -0
  5. package/dist/app-navigation/app-navigation.css +249 -0
  6. package/dist/app-navigation/app-navigation.css.map +1 -0
  7. package/dist/badge/badge.css.map +1 -1
  8. package/dist/blockquote/blockquote.css.map +1 -1
  9. package/dist/breadcrumb/breadcrumb.css +1 -1
  10. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  11. package/dist/breakout/breakout.css +1 -1
  12. package/dist/breakout/breakout.css.map +1 -1
  13. package/dist/button/button.css +101 -1
  14. package/dist/button/button.css.map +1 -1
  15. package/dist/call-to-action-link/call-to-action-link.css.map +1 -1
  16. package/dist/card/card.css +1 -1
  17. package/dist/card/card.css.map +1 -1
  18. package/dist/character-count/character-count.css.map +1 -1
  19. package/dist/checkbox/checkbox.css.map +1 -1
  20. package/dist/date-input/date-input.css +1 -1
  21. package/dist/date-input/date-input.css.map +1 -1
  22. package/dist/description-list/description-list.css +1 -1
  23. package/dist/description-list/description-list.css.map +1 -1
  24. package/dist/error-message/error-message.css.map +1 -1
  25. package/dist/field-set/field-set.css +1 -1
  26. package/dist/field-set/field-set.css.map +1 -1
  27. package/dist/figure/figure.css.map +1 -1
  28. package/dist/file-input/file-input.css.map +1 -1
  29. package/dist/file-list/file-list.css.map +1 -1
  30. package/dist/grid/grid.css.map +1 -1
  31. package/dist/heading/heading.css.map +1 -1
  32. package/dist/image-slider/image-slider.css.map +1 -1
  33. package/dist/index.css +4709 -1
  34. package/dist/index.css.map +1 -1
  35. package/dist/label/label.css +1 -1
  36. package/dist/label/label.css.map +1 -1
  37. package/dist/link/link.css.map +1 -1
  38. package/dist/link-list/link-list.css.map +1 -1
  39. package/dist/menu/menu.css +1 -1
  40. package/dist/menu/menu.css.map +1 -1
  41. package/dist/ordered-list/ordered-list.css.map +1 -1
  42. package/dist/page-footer/page-footer.css.map +1 -1
  43. package/dist/page-header/page-header.css +1 -1
  44. package/dist/page-header/page-header.css.map +1 -1
  45. package/dist/page-heading/page-heading.deprecated.css.map +1 -1
  46. package/dist/pagination/pagination.css.map +1 -1
  47. package/dist/paragraph/paragraph.css.map +1 -1
  48. package/dist/password-input/password-input.css.map +1 -1
  49. package/dist/radio/radio.css.map +1 -1
  50. package/dist/search-field/search-field.css.map +1 -1
  51. package/dist/standalone-link/standalone-link.css.map +1 -1
  52. package/dist/table-of-contents/table-of-contents.css.map +1 -1
  53. package/dist/tabs/tabs.css +1 -1
  54. package/dist/tabs/tabs.css.map +1 -1
  55. package/dist/text-area/text-area.css.map +1 -1
  56. package/dist/text-input/text-input.css.map +1 -1
  57. package/dist/time-input/time-input.css +1 -1
  58. package/dist/time-input/time-input.css.map +1 -1
  59. package/dist/unordered-list/unordered-list.css.map +1 -1
  60. package/dist/visually-hidden/visually-hidden.css +1 -1
  61. package/dist/visually-hidden/visually-hidden.css.map +1 -1
  62. package/documentation/coding-conventions.md +2 -0
  63. package/package.json +3 -3
  64. package/src/common/calculate-fluid-style.scss +2 -0
  65. package/src/common/hyphenation.scss +3 -0
  66. package/src/common/text-rendering.scss +3 -0
  67. package/src/components/breadcrumb/breadcrumb.scss +6 -1
  68. package/src/components/breakout/breakout.scss +9 -1
  69. package/src/components/card/card.scss +17 -8
  70. package/src/components/checkbox/checkbox.scss +2 -0
  71. package/src/components/date-input/date-input.scss +4 -4
  72. package/src/components/description-list/description-list.scss +0 -6
  73. package/src/components/field-set/field-set.scss +15 -1
  74. package/src/components/grid/_mixins.scss +2 -0
  75. package/src/components/heading/heading.scss +12 -0
  76. package/src/components/image-slider/image-slider.scss +10 -4
  77. package/src/components/label/label.scss +12 -0
  78. package/src/components/menu/README.md +16 -2
  79. package/src/components/menu/menu.scss +38 -4
  80. package/src/components/page-header/page-header.scss +14 -0
  81. package/src/components/page-heading/page-heading.deprecated.scss +2 -0
  82. package/src/components/tabs/tabs.scss +4 -0
  83. package/src/components/text-area/text-area.scss +7 -0
  84. package/src/components/time-input/time-input.scss +4 -4
  85. package/src/components/visually-hidden/visually-hidden.scss +4 -1
@@ -12,11 +12,23 @@
12
12
 
13
13
  .ams-heading {
14
14
  box-sizing: border-box;
15
+
16
+ /*
17
+ * If break-after is supported, use it to avoid a Heading from being the last item on a page when printed.
18
+ * If it is not supported, it is ignored.
19
+ */
20
+ /* stylelint-disable-next-line plugin/use-baseline */
15
21
  break-after: avoid;
16
22
  break-inside: avoid;
17
23
  color: var(--ams-heading-color);
18
24
  font-family: var(--ams-heading-font-family);
19
25
  font-weight: var(--ams-heading-font-weight);
26
+
27
+ /*
28
+ * If text-wrap is not supported, it is ignored.
29
+ * This means the wrapped text will look less balanced, which is fine.
30
+ */
31
+ /* stylelint-disable-next-line plugin/use-baseline */
20
32
  text-wrap: var(--ams-heading-text-wrap);
21
33
 
22
34
  @include hyphenation;
@@ -33,12 +33,18 @@
33
33
  overflow-x: auto;
34
34
  overscroll-behavior-x: contain;
35
35
 
36
- /**
37
- Required for the goToSlide function to work properly.
38
- Ensures that the offset of the slides is calculated relative to the scroller container.
39
- */
36
+ /*
37
+ * Required for the goToSlide function to work properly.
38
+ * Ensures that the offset of the slides is calculated relative to the scroller container.
39
+ */
40
40
  position: relative;
41
41
  scroll-snap-type: x mandatory;
42
+
43
+ /*
44
+ * Hide the scrollbar in Firefox.
45
+ * Firefox has full support for this property.
46
+ */
47
+ /* stylelint-disable-next-line plugin/use-baseline */
42
48
  scrollbar-width: none;
43
49
 
44
50
  &::-webkit-scrollbar {
@@ -12,8 +12,20 @@
12
12
  font-size: var(--ams-label-font-size);
13
13
  font-weight: var(--ams-label-font-weight);
14
14
  line-height: var(--ams-label-line-height);
15
+
16
+ /*
17
+ * If text-wrap is not supported, it is ignored.
18
+ * This means the wrapped text will look less balanced, which is fine.
19
+ */
20
+ /* stylelint-disable-next-line plugin/use-baseline */
15
21
  text-wrap: var(--ams-label-text-wrap);
16
22
 
17
23
  @include hyphenation;
18
24
  @include text-rendering;
19
25
  }
26
+
27
+ .ams-label__heading {
28
+ font-size: var(--ams-label-font-size);
29
+ font-weight: var(--ams-label-font-weight);
30
+ margin-block: 0;
31
+ }
@@ -4,5 +4,19 @@
4
4
 
5
5
  A primary navigation leading to key areas of an application or website.
6
6
 
7
- The Menu component works well in the sidebar of applications, usually on a blue background.
8
- This first iteration is a simple vertical menu with 1 level of navigation.
7
+ ## Design
8
+
9
+ - The menu has a blue background.
10
+ Links have a white icon and a label.
11
+ - In a narrow window, the menu occupies the full width.
12
+ The icon and label of the link sit next to each other.
13
+ - In a wide window, the menu has a maximum width of 8rem.
14
+ It adds whitespace at the top to align with the baseline of Page Header.
15
+ The icon is larger and positioned above the label.
16
+
17
+ ## Guidelines
18
+
19
+ - Include this component twice: one in the Page Header and one to the side of the Page.
20
+ Do not use it anywhere else.
21
+ - Set the `inWideWindow` prop to the latter to ensure only one of them is visible, and to get the correct appearance.
22
+ - Use filled icons for the links.
@@ -14,10 +14,40 @@
14
14
  }
15
15
 
16
16
  .ams-menu {
17
+ background-color: var(--ams-menu-background-color);
17
18
  font-family: var(--ams-menu-font-family);
18
19
  font-size: var(--ams-menu-font-size);
19
20
  font-weight: var(--ams-menu-font-weight);
20
21
  line-height: var(--ams-menu-line-height);
22
+
23
+ // Menu must overlap the horizontal padding of Page Header to span the entire window.
24
+ // We accept that this approach with a negative margin tightly couples the component to that context.
25
+ margin-inline: calc(var(--ams-grid-padding-inline) * -1);
26
+ padding-block: var(--ams-menu-padding-block);
27
+
28
+ // We subtract the menu link padding to align the items with surrounding content.
29
+ padding-inline: calc(var(--ams-grid-padding-inline) - var(--ams-menu-link-padding-inline));
30
+
31
+ @media screen and (min-width: $ams-breakpoint-medium) {
32
+ margin-inline: calc(var(--ams-grid-medium-padding-inline) * -1);
33
+ padding-inline: var(--ams-grid-medium-padding-inline);
34
+ }
35
+
36
+ @media screen and (min-width: $ams-breakpoint-wide) {
37
+ display: none;
38
+ margin-inline: 0; // Override negative margin above.
39
+ max-inline-size: var(--ams-menu-wide-max-inline-size);
40
+ padding-block: var(--ams-menu-wide-padding-block);
41
+ padding-inline: var(--ams-menu-wide-padding-inline);
42
+ }
43
+ }
44
+
45
+ .ams-menu--in-wide-window {
46
+ display: none;
47
+
48
+ @media screen and (min-width: $ams-breakpoint-wide) {
49
+ display: block;
50
+ }
21
51
  }
22
52
 
23
53
  .ams-menu__list {
@@ -35,7 +65,7 @@
35
65
  .ams-menu__link {
36
66
  align-items: flex-start;
37
67
  color: var(--ams-menu-link-color);
38
- display: flex;
68
+ display: inline-flex; // Inline display prevents an excessive hit area next to the link text.
39
69
  gap: var(--ams-menu-link-gap);
40
70
  outline-offset: var(--ams-menu-link-outline-offset);
41
71
  padding-block: var(--ams-menu-link-padding-block);
@@ -55,16 +85,19 @@
55
85
 
56
86
  @media screen and (min-width: $ams-breakpoint-wide) {
57
87
  align-items: center;
88
+ display: flex; // The links do stretch in the vertical layout of Menu.
58
89
  flex-direction: column;
59
- gap: 0;
90
+ gap: var(--ams-menu-link-wide-gap);
91
+ text-align: center;
60
92
 
61
93
  .ams-menu__icon {
62
- --ams-icon-font-size: var(--ams-icon-heading-3-font-size);
63
- --ams-icon-line-height: var(--ams-icon-heading-3-line-height);
94
+ --ams-icon-font-size: var(--ams-icon-heading-2-font-size);
95
+ --ams-icon-line-height: var(--ams-icon-heading-2-line-height);
64
96
  }
65
97
  }
66
98
  }
67
99
 
100
+ /** @deprecated The menu has a dark background now, so this is no longer needed. */
68
101
  .ams-menu__link--contrast {
69
102
  color: var(--ams-menu-link-contrast-color);
70
103
 
@@ -73,6 +106,7 @@
73
106
  }
74
107
  }
75
108
 
109
+ /** @deprecated The menu has a dark background now, so this is no longer needed. */
76
110
  .ams-menu__link--inverse {
77
111
  color: var(--ams-menu-link-inverse-color);
78
112
 
@@ -47,6 +47,10 @@
47
47
 
48
48
  .ams-page-header__logo-link--hidden {
49
49
  opacity: 0%;
50
+ -webkit-user-select: none;
51
+
52
+ /* Safari support is added with the prefixed property. */
53
+ /* stylelint-disable-next-line plugin/use-baseline */
50
54
  user-select: none; // The hidden logo link section should not be selectable
51
55
  }
52
56
 
@@ -65,6 +69,12 @@
65
69
  font-size: var(--ams-page-header-brand-name-font-size);
66
70
  font-weight: var(--ams-page-header-brand-name-font-weight);
67
71
  line-height: var(--ams-page-header-brand-name-line-height);
72
+
73
+ /*
74
+ * If text-wrap is not supported, it is ignored.
75
+ * This means the wrapped text will look less balanced, which is fine.
76
+ */
77
+ /* stylelint-disable-next-line plugin/use-baseline */
68
78
  text-wrap: var(--ams-page-header-brand-name-text-wrap);
69
79
  }
70
80
 
@@ -181,6 +191,10 @@
181
191
  .ams-page-header__mega-menu-button-hidden-label {
182
192
  font-weight: var(--ams-page-header-mega-menu-button-label-open-font-weight);
183
193
  pointer-events: none;
194
+ -webkit-user-select: none;
195
+
196
+ /* Safari support is added with the prefixed property. */
197
+ /* stylelint-disable-next-line plugin/use-baseline */
184
198
  user-select: none;
185
199
  visibility: hidden;
186
200
  }
@@ -13,6 +13,7 @@
13
13
  /* @deprecated We no longer use this size of headings. Use `.ams-heading.ams-heading--1` instead. */
14
14
  .ams-page-heading {
15
15
  box-sizing: border-box;
16
+ /* stylelint-disable-next-line plugin/use-baseline */
16
17
  break-after: avoid;
17
18
  break-inside: avoid;
18
19
  color: var(--ams-page-heading-color);
@@ -20,6 +21,7 @@
20
21
  font-size: var(--ams-page-heading-font-size);
21
22
  font-weight: var(--ams-page-heading-font-weight);
22
23
  line-height: var(--ams-page-heading-line-height);
24
+ /* stylelint-disable-next-line plugin/use-baseline */
23
25
  text-wrap: var(--ams-page-heading-text-wrap);
24
26
 
25
27
  @include hyphenation;
@@ -77,6 +77,10 @@
77
77
  .ams-tabs__button-label-hidden {
78
78
  font-weight: var(--ams-tabs-button-selected-font-weight);
79
79
  pointer-events: none;
80
+ -webkit-user-select: none;
81
+
82
+ /* Safari support is added with the prefixed property. */
83
+ /* stylelint-disable-next-line plugin/use-baseline */
80
84
  user-select: none;
81
85
  visibility: hidden;
82
86
  }
@@ -65,15 +65,22 @@
65
65
  box-shadow: var(--ams-text-area-invalid-hover-box-shadow);
66
66
  }
67
67
 
68
+ /*
69
+ * Resizing is not fully supported in Safari on iOS.
70
+ * This is acceptable, it is not crucial functionality.
71
+ */
68
72
  .ams-text-area--resize-none {
73
+ /* stylelint-disable-next-line plugin/use-baseline */
69
74
  resize: none;
70
75
  }
71
76
 
72
77
  .ams-text-area--resize-horizontal {
78
+ /* stylelint-disable-next-line plugin/use-baseline */
73
79
  resize: inline;
74
80
  }
75
81
 
76
82
  .ams-text-area--resize-vertical {
83
+ /* stylelint-disable-next-line plugin/use-baseline */
77
84
  resize: block;
78
85
  }
79
86
 
@@ -54,12 +54,12 @@
54
54
  // This changes the default calendar icon on Chromium browsers only
55
55
  .ams-time-input::-webkit-calendar-picker-indicator {
56
56
  appearance: none;
57
- background-image: var(--ams-time-input-calender-picker-indicator-background-image);
58
- cursor: var(--ams-time-input-calender-picker-indicator-cursor);
57
+ background-image: var(--ams-time-input-calendar-picker-indicator-background-image);
58
+ cursor: var(--ams-time-input-calendar-picker-indicator-cursor);
59
59
  }
60
60
 
61
61
  .ams-time-input:hover::-webkit-calendar-picker-indicator {
62
- background-image: var(--ams-time-input-hover-calender-picker-indicator-background-image);
62
+ background-image: var(--ams-time-input-hover-calendar-picker-indicator-background-image);
63
63
  }
64
64
 
65
65
  .ams-time-input:disabled {
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  .ams-time-input:disabled::-webkit-calendar-picker-indicator {
71
- background-image: var(--ams-time-input-disabled-calender-picker-indicator-background-image);
71
+ background-image: var(--ams-time-input-disabled-calendar-picker-indicator-background-image);
72
72
  visibility: visible;
73
73
  }
74
74
 
@@ -6,11 +6,14 @@
6
6
  // Source: https://css-tricks.com/inclusively-hidden/
7
7
  .ams-visually-hidden:not(:active, :focus) {
8
8
  block-size: 1px;
9
- clip: rect(0 0 0 0);
10
9
  clip-path: inset(50%);
11
10
  inline-size: 1px;
12
11
  overflow: hidden;
13
12
  position: absolute;
13
+ -webkit-user-select: none;
14
+
15
+ /* Safari support is added with the prefixed property. */
16
+ /* stylelint-disable-next-line plugin/use-baseline */
14
17
  user-select: none;
15
18
  white-space: nowrap;
16
19
  }