@amsterdam/design-system-css 0.7.1 → 0.8.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 (103) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +21 -0
  3. package/dist/accordion/accordion.css +1 -1
  4. package/dist/accordion/accordion.css.map +1 -1
  5. package/dist/blockquote/blockquote.css +1 -1
  6. package/dist/blockquote/blockquote.css.map +1 -1
  7. package/dist/breadcrumb/breadcrumb.css +1 -1
  8. package/dist/breadcrumb/breadcrumb.css.map +1 -1
  9. package/dist/button/button.css +1 -1
  10. package/dist/button/button.css.map +1 -1
  11. package/dist/checkbox/checkbox.css +1 -1
  12. package/dist/checkbox/checkbox.css.map +1 -1
  13. package/dist/date-input/date-input.css +1 -0
  14. package/dist/date-input/date-input.css.map +1 -0
  15. package/dist/description-list/description-list.css +1 -0
  16. package/dist/description-list/description-list.css.map +1 -0
  17. package/dist/document/document.css +1 -0
  18. package/dist/document/document.css.map +1 -0
  19. package/dist/fieldset/fieldset.css +1 -1
  20. package/dist/fieldset/fieldset.css.map +1 -1
  21. package/dist/form-field-character-counter/form-field-character-counter.css +1 -1
  22. package/dist/form-field-character-counter/form-field-character-counter.css.map +1 -1
  23. package/dist/heading/heading.css +1 -1
  24. package/dist/heading/heading.css.map +1 -1
  25. package/dist/index.css +1 -1
  26. package/dist/index.css.map +1 -1
  27. package/dist/label/label.css +1 -0
  28. package/dist/label/label.css.map +1 -0
  29. package/dist/link/link.css +1 -1
  30. package/dist/link/link.css.map +1 -1
  31. package/dist/link-list/link-list.css +1 -1
  32. package/dist/link-list/link-list.css.map +1 -1
  33. package/dist/ordered-list/ordered-list.css +1 -1
  34. package/dist/ordered-list/ordered-list.css.map +1 -1
  35. package/dist/page-heading/page-heading.css +1 -1
  36. package/dist/page-heading/page-heading.css.map +1 -1
  37. package/dist/page-menu/page-menu.css +1 -1
  38. package/dist/page-menu/page-menu.css.map +1 -1
  39. package/dist/pagination/pagination.css +1 -1
  40. package/dist/pagination/pagination.css.map +1 -1
  41. package/dist/paragraph/paragraph.css +1 -1
  42. package/dist/paragraph/paragraph.css.map +1 -1
  43. package/dist/radio/radio.css +1 -1
  44. package/dist/radio/radio.css.map +1 -1
  45. package/dist/screen/screen.css +1 -1
  46. package/dist/screen/screen.css.map +1 -1
  47. package/dist/search-field/search-field.css +1 -1
  48. package/dist/search-field/search-field.css.map +1 -1
  49. package/dist/select/select.css +1 -0
  50. package/dist/select/select.css.map +1 -0
  51. package/dist/tabs/tabs.css +1 -1
  52. package/dist/tabs/tabs.css.map +1 -1
  53. package/dist/text-area/text-area.css +1 -1
  54. package/dist/text-area/text-area.css.map +1 -1
  55. package/dist/text-input/text-input.css +1 -1
  56. package/dist/text-input/text-input.css.map +1 -1
  57. package/dist/time-input/time-input.css +1 -0
  58. package/dist/time-input/time-input.css.map +1 -0
  59. package/dist/top-task-link/top-task-link.css +1 -1
  60. package/dist/top-task-link/top-task-link.css.map +1 -1
  61. package/dist/unordered-list/unordered-list.css +1 -1
  62. package/dist/unordered-list/unordered-list.css.map +1 -1
  63. package/documentation/coding-conventions.md +6 -0
  64. package/package.json +3 -6
  65. package/src/common/text-rendering.scss +15 -0
  66. package/src/components/accordion/accordion.scss +22 -14
  67. package/src/components/blockquote/blockquote.scss +2 -1
  68. package/src/components/breadcrumb/breadcrumb.scss +3 -1
  69. package/src/components/button/button.scss +7 -5
  70. package/src/components/checkbox/checkbox.scss +8 -11
  71. package/src/components/date-input/README.md +11 -0
  72. package/src/components/date-input/date-input.scss +78 -0
  73. package/src/components/description-list/README.md +18 -0
  74. package/src/components/description-list/description-list.scss +55 -0
  75. package/src/components/document/document.scss +14 -0
  76. package/src/components/fieldset/fieldset.scss +5 -4
  77. package/src/components/form-field-character-counter/form-field-character-counter.scss +2 -4
  78. package/src/components/heading/heading.scss +2 -1
  79. package/src/components/index.scss +6 -1
  80. package/src/components/{form-label → label}/README.md +1 -1
  81. package/src/components/label/label.scss +18 -0
  82. package/src/components/link/link.scss +2 -4
  83. package/src/components/link-list/link-list.scss +4 -3
  84. package/src/components/ordered-list/ordered-list.scss +5 -3
  85. package/src/components/page-heading/page-heading.scss +2 -1
  86. package/src/components/page-menu/page-menu.scss +8 -1
  87. package/src/components/pagination/pagination.scss +8 -5
  88. package/src/components/paragraph/paragraph.scss +3 -1
  89. package/src/components/radio/radio.scss +5 -8
  90. package/src/components/screen/screen.scss +6 -1
  91. package/src/components/search-field/search-field.scss +21 -5
  92. package/src/components/select/README.md +9 -0
  93. package/src/components/select/select.scss +60 -0
  94. package/src/components/tabs/tabs.scss +8 -2
  95. package/src/components/text-area/text-area.scss +5 -2
  96. package/src/components/text-input/text-input.scss +5 -2
  97. package/src/components/time-input/README.md +11 -0
  98. package/src/components/time-input/time-input.scss +79 -0
  99. package/src/components/top-task-link/top-task-link.scss +2 -1
  100. package/src/components/unordered-list/unordered-list.scss +5 -3
  101. package/dist/form-label/form-label.css +0 -1
  102. package/dist/form-label/form-label.css.map +0 -1
  103. package/src/components/form-label/form-label.scss +0 -21
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ @mixin reset {
7
+ appearance: none;
8
+ border: 0;
9
+ border-radius: 0; // Reset rounded borders for Safari on MacOS
10
+ }
11
+
12
+ .ams-select {
13
+ background-color: var(--ams-select-background-color);
14
+ box-shadow: var(--ams-select-box-shadow);
15
+ color: var(--ams-select-color);
16
+ font-family: var(--ams-select-font-family);
17
+ font-size: var(--ams-select-font-size);
18
+ font-weight: var(--ams-select-font-weight);
19
+ line-height: var(--ams-select-line-height);
20
+ max-inline-size: 100%;
21
+ outline-offset: var(--ams-select-outline-offset);
22
+ padding-block: var(--ams-select-padding-block);
23
+ padding-inline: var(--ams-select-padding-inline);
24
+ touch-action: manipulation;
25
+
26
+ &:not([multiple]) {
27
+ background-image: var(--ams-select-background-image);
28
+ background-position: var(--ams-select-background-position);
29
+ background-repeat: no-repeat;
30
+ background-size: 1em 1em;
31
+ }
32
+
33
+ &:hover {
34
+ box-shadow: var(--ams-select-hover-box-shadow);
35
+ }
36
+
37
+ @include reset;
38
+ }
39
+
40
+ .ams-select[aria-invalid="true"] {
41
+ box-shadow: var(--ams-select-invalid-box-shadow);
42
+
43
+ &:hover {
44
+ box-shadow: var(--ams-select-invalid-hover-box-shadow);
45
+ }
46
+ }
47
+
48
+ .ams-select:disabled {
49
+ box-shadow: var(--ams-select-disabled-box-shadow);
50
+ color: var(--ams-select-disabled-color);
51
+ cursor: not-allowed;
52
+
53
+ &:not([multiple]) {
54
+ background-image: var(--ams-select-disabled-background-image);
55
+ }
56
+ }
57
+
58
+ .ams-select__option:disabled {
59
+ color: var(--ams-select-option-disabled-color);
60
+ }
@@ -5,15 +5,19 @@
5
5
 
6
6
  @import "../../common/breakpoint";
7
7
 
8
+ @mixin reset-button {
9
+ background-color: transparent;
10
+ border: 0;
11
+ }
12
+
8
13
  .ams-tabs__list {
14
+ background-color: var(--ams-tabs-list-background-color);
9
15
  border-bottom: var(--ams-tabs-list-border-bottom);
10
16
  display: flex;
11
17
  overflow-x: auto;
12
18
  }
13
19
 
14
20
  .ams-tabs__button {
15
- background-color: var(--ams-tabs-button-background-color);
16
- border: var(--ams-tabs-button-border);
17
21
  color: var(--ams-tabs-button-color);
18
22
  cursor: var(--ams-tabs-button-cursor);
19
23
  font-family: var(--ams-tabs-button-font-family);
@@ -24,6 +28,8 @@
24
28
  padding-block: var(--ams-tabs-button-padding-block);
25
29
  padding-inline: var(--ams-tabs-button-padding-inline);
26
30
 
31
+ @include reset-button;
32
+
27
33
  &:disabled {
28
34
  color: var(--ams-tabs-button-disabled-color);
29
35
  cursor: var(--ams-tab-button-disabled-cursor);
@@ -3,14 +3,16 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
+ @import "../../common/text-rendering";
7
+
6
8
  @mixin reset {
7
9
  box-sizing: border-box;
8
10
  margin-block: 0;
9
- -webkit-text-size-adjust: 100%;
10
11
  }
11
12
 
12
13
  .ams-text-area {
13
- border: none;
14
+ background-color: var(--ams-text-area-background-color);
15
+ border: 0;
14
16
  box-shadow: var(--ams-text-area-box-shadow);
15
17
  color: var(--ams-text-area-color);
16
18
  font-family: var(--ams-text-area-font-family);
@@ -25,6 +27,7 @@
25
27
  touch-action: manipulation;
26
28
  width: 100%;
27
29
 
30
+ @include text-rendering;
28
31
  @include reset;
29
32
 
30
33
  &:hover {
@@ -3,14 +3,16 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
+ @import "../../common/text-rendering";
7
+
6
8
  @mixin reset {
7
9
  box-sizing: border-box;
8
10
  margin-block: 0;
9
- -webkit-text-size-adjust: 100%;
10
11
  }
11
12
 
12
13
  .ams-text-input {
13
- border: none;
14
+ background-color: var(--ams-text-input-background-color);
15
+ border: 0;
14
16
  box-shadow: var(--ams-text-input-box-shadow);
15
17
  color: var(--ams-text-input-color);
16
18
  font-family: var(--ams-text-input-font-family);
@@ -23,6 +25,7 @@
23
25
  touch-action: manipulation;
24
26
  width: 100%;
25
27
 
28
+ @include text-rendering;
26
29
  @include reset;
27
30
 
28
31
  &:hover {
@@ -0,0 +1,11 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Time Input
4
+
5
+ Helps users enter time.
6
+
7
+ ## Visual considerations
8
+
9
+ This component uses a native time input, which is styled differently in different browsers and operating systems.
10
+ Recreating the native functionality is quite difficult and prone to accessibility errors, which is why we’ve chosen not to do that.
11
+ This does mean that this component does not look identical on all browsers and operating systems.
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright Gemeente Amsterdam
4
+ */
5
+
6
+ @import "../../common/text-rendering";
7
+
8
+ @mixin reset {
9
+ // Reset native appearance, this causes issues on iOS and Android devices
10
+ -webkit-appearance: none;
11
+ appearance: none;
12
+ border: 0;
13
+ border-radius: 0; // Reset rounded borders on iOS devices
14
+ box-sizing: border-box;
15
+ margin-block: 0;
16
+ width: auto; // Reset width of 10em set by Android devices
17
+ }
18
+
19
+ .ams-time-input {
20
+ background-color: var(--ams-time-input-background-color);
21
+ box-shadow: var(--ams-time-input-box-shadow);
22
+ color: var(--ams-time-input-color);
23
+ font-family: var(--ams-time-input-font-family);
24
+ font-size: var(--ams-time-input-font-size);
25
+ font-weight: var(--ams-time-input-font-weight);
26
+ line-height: var(--ams-time-input-line-height);
27
+
28
+ // Set min height for iOS, otherwise an empty box is a lot smaller than a filled one.
29
+ min-height: calc(
30
+ (var(--ams-time-input-font-size) * var(--ams-time-input-line-height)) + 2 * var(--ams-time-input-padding-block)
31
+ );
32
+
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)));
35
+ outline-offset: var(--ams-time-input-outline-offset);
36
+ padding-block: var(--ams-time-input-padding-block);
37
+ padding-inline: var(--ams-time-input-padding-inline);
38
+ touch-action: manipulation;
39
+
40
+ @include text-rendering;
41
+ @include reset;
42
+
43
+ &:hover {
44
+ box-shadow: var(--ams-time-input-hover-box-shadow);
45
+ }
46
+ }
47
+
48
+ // This changes the default calendar icon on Chromium browsers only
49
+ .ams-time-input::-webkit-calendar-picker-indicator {
50
+ appearance: none;
51
+ background-image: var(--ams-time-input-calender-picker-indicator-background-image);
52
+ cursor: pointer;
53
+ }
54
+
55
+ .ams-time-input:hover::-webkit-calendar-picker-indicator {
56
+ background-image: var(--ams-time-input-hover-calender-picker-indicator-background-image);
57
+ }
58
+
59
+ .ams-time-input:disabled {
60
+ background-color: var(--ams-time-input-disabled-background-color);
61
+ box-shadow: var(--ams-time-input-disabled-box-shadow);
62
+ color: var(--ams-time-input-disabled-color);
63
+ cursor: not-allowed;
64
+ }
65
+
66
+ .ams-time-input:disabled::-webkit-calendar-picker-indicator {
67
+ background-image: var(--ams-time-input-disabled-calender-picker-indicator-background-image);
68
+ visibility: visible;
69
+ }
70
+
71
+ .ams-time-input:invalid,
72
+ .ams-time-input[aria-invalid="true"] {
73
+ box-shadow: var(--ams-time-input-invalid-box-shadow);
74
+
75
+ &:hover {
76
+ // TODO: this should be the (currently non-existent) dark red hover color
77
+ box-shadow: var(--ams-time-input-invalid-hover-box-shadow);
78
+ }
79
+ }
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  @import "../../common/hyphenation";
7
+ @import "../../common/text-rendering";
7
8
 
8
9
  .ams-top-task-link {
9
10
  break-inside: avoid;
@@ -16,7 +17,6 @@
16
17
 
17
18
  @mixin reset {
18
19
  box-sizing: border-box;
19
- -webkit-text-size-adjust: 100%;
20
20
  }
21
21
 
22
22
  .ams-top-task-link__label {
@@ -30,6 +30,7 @@
30
30
  text-underline-offset: var(--ams-top-task-link-label-text-underline-offset);
31
31
 
32
32
  @include hyphenation;
33
+ @include text-rendering;
33
34
  @include reset;
34
35
  }
35
36
 
@@ -3,21 +3,23 @@
3
3
  * Copyright Gemeente Amsterdam
4
4
  */
5
5
 
6
+ @import "../../common/text-rendering";
7
+
6
8
  /** Apply border box sizing, reset white space and list styles. */
7
9
  @mixin reset {
8
10
  box-sizing: border-box;
9
11
  list-style: none;
10
12
  margin-block: 0;
11
13
  padding-inline-start: 0;
12
- -webkit-text-size-adjust: 100%;
13
14
  }
14
15
 
15
16
  /** A list is a grid column with a gap between items. */
16
17
  .ams-unordered-list {
17
- @include reset;
18
-
19
18
  display: grid;
20
19
  gap: var(--ams-unordered-list-gap);
20
+
21
+ @include text-rendering;
22
+ @include reset;
21
23
  }
22
24
 
23
25
  /** A list with markers sets typography for its text content. */
@@ -1 +0,0 @@
1
- .ams-form-label{color:var(--ams-form-label-color);font-family:var(--ams-form-label-font-family);font-size:var(--ams-form-label-font-size);font-weight:var(--ams-form-label-font-weight);line-height:var(--ams-form-label-line-height);hyphenate-limit-chars:var(--ams-hyphenation-hyphenate-limit-chars);hyphens:var(--ams-hyphenation-hyphens);overflow-wrap:var(--ams-hyphenation-overflow-wrap);-webkit-text-size-adjust:100%}/*# sourceMappingURL=form-label.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/components/form-label/form-label.scss","../../src/common/hyphenation.scss"],"names":[],"mappings":"AAWA,gBACE,kCACA,8CACA,0CACA,8CACA,8CCVA,mEACA,uCACA","file":"form-label.css"}
@@ -1,21 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
-
6
- @import "../../common/hyphenation";
7
-
8
- @mixin reset {
9
- -webkit-text-size-adjust: 100%;
10
- }
11
-
12
- .ams-form-label {
13
- color: var(--ams-form-label-color);
14
- font-family: var(--ams-form-label-font-family);
15
- font-size: var(--ams-form-label-font-size);
16
- font-weight: var(--ams-form-label-font-weight);
17
- line-height: var(--ams-form-label-line-height);
18
-
19
- @include hyphenation;
20
- @include reset;
21
- }