dso-toolkit 79.0.1 → 80.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 (31) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/dso-icons.svg +14 -12
  3. package/dist/dso.css +917 -317
  4. package/dist/dso.css.map +1 -1
  5. package/dist/dso.min.css +1 -1
  6. package/dist/dso.min.css.map +1 -1
  7. package/dist/index.js +3 -0
  8. package/package.json +1 -1
  9. package/src/components/alert/alert.mixins.scss +73 -32
  10. package/src/components/alert/alert.scss +19 -78
  11. package/src/components/alert/alert.variables.scss +1 -0
  12. package/src/components/badge/badge.mixins.scss +18 -9
  13. package/src/components/banner/banner.mixins.scss +20 -4
  14. package/src/components/button/button.mixins.scss +8 -0
  15. package/src/components/button/button.variables.scss +1 -0
  16. package/src/components/delete/delete.mixins.scss +1 -1
  17. package/src/components/document-header/document-header.scss +3 -3
  18. package/src/components/footer/footer.scss +1 -1
  19. package/src/components/highlight-box/highlight-box.mixins.scss +9 -5
  20. package/src/components/info/info.mixins.scss +2 -11
  21. package/src/components/info/info.scss +9 -0
  22. package/src/components/insert/insert.mixins.scss +1 -1
  23. package/src/components/label/label.mixins.scss +9 -32
  24. package/src/components/label/label.scss +27 -0
  25. package/src/components/shopping-cart/shopping-cart.scss +3 -3
  26. package/src/components/table/table.scss +6 -1
  27. package/src/dso.scss +0 -1
  28. package/src/global/functions/contrast-color.functions.scss +9 -1
  29. package/src/global/mixins/set-colors.mixin.scss +51 -37
  30. package/src/components/legend-item/legend-item.scss +0 -15
  31. package/src/components/legend-item/legend-item.variables.scss +0 -7
@@ -1,4 +1,5 @@
1
1
  @use "../alert";
2
+ @use "../button";
2
3
  @use "../../di";
3
4
  @use "../../variables/units";
4
5
 
@@ -8,6 +9,24 @@
8
9
  @include alert.children();
9
10
 
10
11
  .dso-close {
12
+ @include button.element();
13
+
14
+ $inset-unit: units.$u1 * 0.5 - alert.$border-size;
15
+
16
+ position: absolute;
17
+ inset-block-start: $inset-unit;
18
+ inset-inline-end: $inset-unit;
19
+
20
+ block-size: units.$u4;
21
+ inline-size: units.$u4;
22
+
23
+ padding: 0;
24
+
25
+ background-color: transparent;
26
+
27
+ border: 0;
28
+ text-align: center;
29
+
11
30
  &::before {
12
31
  @include di.base("times-zwart");
13
32
 
@@ -26,57 +45,25 @@
26
45
  content: "";
27
46
  }
28
47
 
29
- &.dso-compact {
30
- @include alert.compact();
31
-
32
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
33
- & {
34
- min-block-size: alert.$inline-padding;
35
- }
36
- }
37
-
38
48
  &.alert-success {
39
- @include alert.status-success();
40
-
41
- &.dso-compact::before {
42
- background-color: alert.$success-compact-accent-bg;
43
- }
44
-
45
49
  &:not(.dso-compact)::before {
46
50
  @include di.base("status-success", alert.$icon-size);
47
51
  }
48
52
  }
49
53
 
50
54
  &.alert-error {
51
- @include alert.status-error();
52
-
53
- &.dso-compact::before {
54
- background-color: alert.$danger-compact-accent-bg;
55
- }
56
-
57
55
  &:not(.dso-compact)::before {
58
56
  @include di.base("status-error", alert.$icon-size);
59
57
  }
60
58
  }
61
59
 
62
60
  &.alert-warning {
63
- @include alert.status-warning();
64
-
65
- &.dso-compact::before {
66
- background-color: alert.$warning-compact-accent-bg;
67
- }
68
-
69
61
  &:not(.dso-compact)::before {
70
62
  @include di.base("status-warning", alert.$icon-size);
71
63
  }
72
64
  }
73
65
 
74
66
  &.alert-info {
75
- @include alert.status-info();
76
-
77
- &.dso-compact::before {
78
- background-color: alert.$info-compact-accent-bg;
79
- }
80
67
  &:not(.dso-compact)::before {
81
68
  @include di.base("status-info", alert.$icon-size);
82
69
  }
@@ -86,50 +73,4 @@
86
73
  // Web Component
87
74
  dso-alert {
88
75
  @include alert.children();
89
-
90
- &[status="success"] {
91
- @include alert.status-success();
92
- }
93
-
94
- &[status="error"] {
95
- @include alert.status-error();
96
- }
97
-
98
- &[status="warning"] {
99
- @include alert.status-warning();
100
- }
101
-
102
- &[status="info"] {
103
- @include alert.status-info();
104
- }
105
-
106
- &[compact]:not([compact="false"]) {
107
- @include alert.compact();
108
-
109
- position: relative;
110
- }
111
-
112
- &[status="success"][compact]:not([compact="false"]) {
113
- &::before {
114
- background-color: alert.$success-compact-accent-bg;
115
- }
116
- }
117
-
118
- &[status="error"][compact]:not([compact="false"]) {
119
- &::before {
120
- background-color: alert.$danger-compact-accent-bg;
121
- }
122
- }
123
-
124
- &[status="warning"][compact]:not([compact="false"]) {
125
- &::before {
126
- background-color: alert.$warning-compact-accent-bg;
127
- }
128
- }
129
-
130
- &[status="info"][compact]:not([compact="false"]) {
131
- &::before {
132
- background-color: alert.$info-compact-accent-bg;
133
- }
134
- }
135
76
  }
@@ -1,6 +1,7 @@
1
1
  @use "../../variables/units";
2
2
  @use "../../variables/states";
3
3
 
4
+ $border-size: 1px;
4
5
  $icon-size: units.$u3;
5
6
  $inline-padding: units.$u2;
6
7
  $block-padding: units.$u2;
@@ -5,7 +5,8 @@
5
5
  @use "badge.variables" as badge-variables;
6
6
 
7
7
  @mixin root() {
8
- border: 1px solid;
8
+ border-width: 1px;
9
+ border-style: solid;
9
10
  border-radius: 1em;
10
11
  display: inline-block;
11
12
  font-size: 0.875em;
@@ -16,34 +17,42 @@
16
17
  text-align: center;
17
18
 
18
19
  & {
19
- @include set-colors.apply(badge-variables.$default-bg-color, $icons: false, $links: false);
20
+ @include _variant(badge-variables.$default-bg-color);
20
21
  }
21
22
 
22
23
  &.badge-info {
23
- @include set-colors.apply(badge-variables.$info-bg-color, $icons: false, $links: false);
24
+ @include _variant(badge-variables.$info-bg-color);
24
25
  }
25
26
 
26
27
  &.badge-primary {
27
- @include set-colors.apply(badge-variables.$primary-bg-color, $icons: false, $links: false);
28
+ @include _variant(badge-variables.$primary-bg-color);
28
29
  }
29
30
 
30
31
  &.badge-success {
31
- @include set-colors.apply(badge-variables.$success-bg-color, $icons: false, $links: false);
32
+ @include _variant(badge-variables.$success-bg-color);
32
33
  }
33
34
 
34
35
  &.badge-warning {
35
- @include set-colors.apply(badge-variables.$warning-bg-color, $icons: false, $links: false);
36
+ @include _variant(badge-variables.$warning-bg-color);
36
37
  }
37
38
 
38
39
  &.badge-error {
39
- @include set-colors.apply(badge-variables.$error-bg-color, $icons: false, $links: false);
40
+ @include _variant(badge-variables.$error-bg-color);
40
41
  }
41
42
 
42
43
  &.badge-outline {
43
- @include set-colors.apply(colors.$wit, colors.$grijs-90, $icons: false, $links: false);
44
+ @include _variant(colors.$wit, colors.$grijs-90);
44
45
  }
45
46
 
46
47
  &.badge-attention {
47
- @include set-colors.apply(badge-variables.$attention-bg-color, $icons: false, $links: false);
48
+ @include _variant(badge-variables.$attention-bg-color);
49
+ }
50
+ }
51
+
52
+ @mixin _variant($background-color, $border-color: $background-color) {
53
+ @include set-colors.apply($background-color, "badge");
54
+
55
+ & {
56
+ border-color: $border-color;
48
57
  }
49
58
  }
@@ -79,19 +79,35 @@
79
79
  }
80
80
 
81
81
  @mixin success() {
82
- @include set-colors.apply(banner-variables.$success-bg, banner-variables.$success-border);
82
+ @include set-colors.apply(banner-variables.$success-bg, "banner");
83
+
84
+ & {
85
+ border-color: banner-variables.$success-border;
86
+ }
83
87
  }
84
88
 
85
89
  @mixin error() {
86
- @include set-colors.apply(banner-variables.$error-bg, banner-variables.$error-border);
90
+ @include set-colors.apply(banner-variables.$error-bg, "banner");
91
+
92
+ & {
93
+ border-color: banner-variables.$error-border;
94
+ }
87
95
  }
88
96
 
89
97
  @mixin info() {
90
- @include set-colors.apply(banner-variables.$info-bg, banner-variables.$info-border);
98
+ @include set-colors.apply(banner-variables.$info-bg, "banner");
99
+
100
+ & {
101
+ border-color: banner-variables.$info-border;
102
+ }
91
103
  }
92
104
 
93
105
  @mixin warning() {
94
- @include set-colors.apply(banner-variables.$warning-bg, banner-variables.$warning-border);
106
+ @include set-colors.apply(banner-variables.$warning-bg, "banner");
107
+
108
+ & {
109
+ border-color: banner-variables.$warning-border;
110
+ }
95
111
  }
96
112
 
97
113
  @mixin root() {
@@ -59,6 +59,14 @@
59
59
  @include small();
60
60
  }
61
61
 
62
+ &.dso-extra-small {
63
+ @include small();
64
+ // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
65
+ & {
66
+ padding-block: 9px;
67
+ }
68
+ }
69
+
62
70
  @if ($icon-only) {
63
71
  > span {
64
72
  @include utilities.sr-only();
@@ -24,6 +24,7 @@ $tertiary-padding-inline: $block-padding;
24
24
  $tertiary-color: colors.$grasgroen;
25
25
  $tertiary-hover-color: colors.$bosgroen;
26
26
  $tertiary-active-color: colors.$bosgroen-140;
27
+ $tertiary-disabled-color: colors.$grasgroen-40;
27
28
 
28
29
  $map-size: units.$u5;
29
30
 
@@ -4,7 +4,7 @@
4
4
  /// The root mixin to apply the correct color and strikethrough for a delete visualisation.
5
5
  /// @param {Boolean} $strikethrough - Whether to apply a strikethrough or not. Default is true. If false, only background color will be applied. Consumers are responsible for setting strikethrough styles. For example with the `delete.strikethrough()` mixin.
6
6
  @mixin root($strikethrough: true) {
7
- @include set-colors.apply(colors.$rood-20);
7
+ @include set-colors.apply(colors.$rood-20, "delete");
8
8
 
9
9
  @if ($strikethrough) {
10
10
  & {
@@ -12,7 +12,7 @@
12
12
  @use "document-header.variables" as document-header-variables;
13
13
 
14
14
  .dso-document-header {
15
- @include set-colors.apply(colors.$grijs-5);
15
+ @include set-colors.apply(colors.$grijs-5, "document-header");
16
16
 
17
17
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
18
18
  & {
@@ -50,7 +50,7 @@
50
50
 
51
51
  &.dso-variant-ontwerp {
52
52
  .dso-document-header-status {
53
- @include set-colors.apply(colors.$geel);
53
+ @include set-colors.apply(colors.$geel, "document-header");
54
54
 
55
55
  // To do: remove in #2542
56
56
  dso-icon[icon="pencil"] {
@@ -61,7 +61,7 @@
61
61
 
62
62
  &.dso-variant-besluitversie {
63
63
  .dso-document-header-status {
64
- @include set-colors.apply(colors.$bosgroen);
64
+ @include set-colors.apply(colors.$bosgroen, "document-header");
65
65
 
66
66
  // To do: remove in #2542
67
67
  dso-icon[icon="hammer"] {
@@ -12,7 +12,7 @@
12
12
  footer {
13
13
  @include css-grid.full-width-row();
14
14
 
15
- @include set-colors.apply(colors.$grijs-5);
15
+ @include set-colors.apply(colors.$grijs-5, "footer");
16
16
 
17
17
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
18
18
  & {
@@ -35,19 +35,19 @@
35
35
  $step-counter-selector
36
36
  ) {
37
37
  &:not(#{$white-selector}, #{$yellow-selector}, #{$border-selector}) {
38
- @include set-colors.apply(colors.$grijs-5);
38
+ @include set-colors.apply(colors.$grijs-5, "highlight-box");
39
39
  }
40
40
 
41
41
  &#{$grey-selector} {
42
- @include set-colors.apply(colors.$grijs-5);
42
+ @include set-colors.apply(colors.$grijs-5, "highlight-box");
43
43
  }
44
44
 
45
45
  &#{$white-selector} {
46
- @include set-colors.apply(colors.$wit);
46
+ @include set-colors.apply(colors.$wit, "highlight-box");
47
47
  }
48
48
 
49
49
  &#{$yellow-selector} {
50
- @include set-colors.apply(colors.$geel-20);
50
+ @include set-colors.apply(colors.$geel-20, "highlight-box");
51
51
  }
52
52
 
53
53
  &#{$drop-shadow-selector} {
@@ -60,7 +60,11 @@
60
60
  }
61
61
 
62
62
  &#{$border-selector}:not(#{$grey-selector}, #{$yellow-selector}) {
63
- @include set-colors.apply(colors.$wit, $border-color: colors.$grijs-20);
63
+ @include set-colors.apply(colors.$wit, "highlight-box");
64
+
65
+ & {
66
+ border-color: colors.$grijs-20;
67
+ }
64
68
  }
65
69
 
66
70
  &#{$has-counter-selector} {
@@ -8,16 +8,7 @@
8
8
  padding-inline: units.$u2 units.$u4;
9
9
  position: relative;
10
10
 
11
- @include set-colors.apply(colors.$grijs-5);
12
-
13
- > button {
14
- background-color: transparent;
15
- border-style: none;
16
- padding: 0;
17
- position: absolute;
18
- inset-inline-end: units.$u1;
19
- inset-block-start: units.$u1;
20
- }
11
+ @include set-colors.apply(colors.$grijs-5, "info");
21
12
  }
22
13
 
23
14
  @mixin richContent() {
@@ -67,5 +58,5 @@
67
58
  @include richContent();
68
59
  }
69
60
 
70
- @include set-colors.apply(colors.$grijs-5);
61
+ @include set-colors.apply(colors.$grijs-5, "info");
71
62
  }
@@ -1,3 +1,5 @@
1
+ @use "../../variables/units";
2
+
1
3
  @use "../info";
2
4
 
3
5
  @use "../../di";
@@ -8,6 +10,13 @@
8
10
  @include info.children();
9
11
 
10
12
  > button {
13
+ background-color: transparent;
14
+ border-style: none;
15
+ padding: 0;
16
+ position: absolute;
17
+ inset-inline-end: units.$u1;
18
+ inset-block-start: units.$u1;
19
+
11
20
  &::before {
12
21
  @include di.base("times-zwart");
13
22
 
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  @mixin root() {
11
- @include set-colors.apply(colors.$lime-20);
11
+ @include set-colors.apply(colors.$lime-20, "insert");
12
12
 
13
13
  & {
14
14
  box-shadow: insert-variables.$box-shadow;
@@ -19,55 +19,32 @@
19
19
  text-decoration: line-through;
20
20
  }
21
21
 
22
- button {
23
- background: none;
24
- border: 0;
25
- border-radius: 0 #{units.$u1 * 0.5} #{units.$u1 * 0.5} 0;
26
- color: inherit;
27
- float: inline-end;
28
- font-size: typography.$root-font-size-base;
29
- margin-block-end: units.$u1 * -0.5;
30
- margin-inline-start: units.$u1;
31
- margin-inline-end: units.$u1 * -0.5;
32
- margin-block-start: 0;
33
- padding: 0;
34
-
35
- &:hover {
36
- cursor: pointer;
37
- }
38
-
39
- > dso-icon,
40
- > svg.di {
41
- display: block;
42
- }
43
- }
44
-
45
22
  & {
46
- @include set-colors.apply(label-variables.$default-bg-color, $icons: false, $links: false);
23
+ @include set-colors.apply(label-variables.$default-bg-color, "label");
47
24
  }
48
25
 
49
26
  &.dso-label-info {
50
- @include set-colors.apply(label-variables.$info-bg-color, $icons: false, $links: false);
27
+ @include set-colors.apply(label-variables.$info-bg-color, "label");
51
28
  }
52
29
 
53
30
  &.dso-label-primary {
54
- @include set-colors.apply(label-variables.$primary-bg-color, $icons: false, $links: false);
31
+ @include set-colors.apply(label-variables.$primary-bg-color, "label");
55
32
  }
56
33
 
57
34
  &.dso-label-success {
58
- @include set-colors.apply(label-variables.$success-bg-color, $icons: false, $links: false);
35
+ @include set-colors.apply(label-variables.$success-bg-color, "label");
59
36
  }
60
37
 
61
38
  &.dso-label-warning {
62
- @include set-colors.apply(label-variables.$warning-bg-color, $icons: false, $links: false);
39
+ @include set-colors.apply(label-variables.$warning-bg-color, "label");
63
40
  }
64
41
 
65
42
  &.dso-label-error {
66
- @include set-colors.apply(label-variables.$error-bg-color, $icons: false, $links: false);
43
+ @include set-colors.apply(label-variables.$error-bg-color, "label");
67
44
  }
68
45
 
69
46
  &.dso-label-bright {
70
- @include set-colors.apply(label-variables.$bright-bg-color, $icons: false, $links: false);
47
+ @include set-colors.apply(label-variables.$bright-bg-color, "label");
71
48
 
72
49
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
73
50
  & {
@@ -77,11 +54,11 @@
77
54
  }
78
55
 
79
56
  &.dso-label-attention {
80
- @include set-colors.apply(label-variables.$attention-bg-color, $icons: false, $links: false);
57
+ @include set-colors.apply(label-variables.$attention-bg-color, "label");
81
58
  }
82
59
 
83
60
  &.dso-label-filter {
84
- @include set-colors.apply(label-variables.$filter-bg-color, $icons: false, $links: false);
61
+ @include set-colors.apply(label-variables.$filter-bg-color, "label");
85
62
 
86
63
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
87
64
  & {
@@ -1,6 +1,8 @@
1
1
  @use "../label";
2
2
  @use "label.variables" as label-variables;
3
3
  @use "../../global/mixins/symbol.mixins" as symbol-mixins;
4
+ @use "../../variables/units";
5
+ @use "../../variables/typography";
4
6
 
5
7
  // HTML/CSS
6
8
  .dso-label {
@@ -17,6 +19,31 @@
17
19
  @include symbol-mixins.symbol();
18
20
  }
19
21
  }
22
+
23
+ button {
24
+ line-height: 0;
25
+ background: none;
26
+ border: 0;
27
+ border-radius: 0 #{units.$u1 * 0.5} #{units.$u1 * 0.5} 0;
28
+ color: inherit;
29
+ float: inline-end;
30
+
31
+ font-size: typography.$root-font-size-base;
32
+ margin-block-end: units.$u1 * -0.5;
33
+ margin-inline-start: units.$u1;
34
+ margin-inline-end: units.$u1 * -0.5;
35
+ margin-block-start: 0;
36
+ padding: 0;
37
+
38
+ &:hover {
39
+ cursor: pointer;
40
+ }
41
+
42
+ > dso-icon,
43
+ > svg.di {
44
+ display: block;
45
+ }
46
+ }
20
47
  }
21
48
 
22
49
  // Web Component
@@ -10,7 +10,7 @@
10
10
 
11
11
  .dso-shopping-cart {
12
12
  .dso-status {
13
- @include set-colors.apply(colors.$grijs-5);
13
+ @include set-colors.apply(colors.$grijs-5, "shopping-cart");
14
14
 
15
15
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
16
16
  & {
@@ -58,7 +58,7 @@
58
58
  }
59
59
 
60
60
  .dso-contents {
61
- @include set-colors.apply(colors.$grijs-5);
61
+ @include set-colors.apply(colors.$grijs-5, "shopping-cart");
62
62
 
63
63
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
64
64
  & {
@@ -87,7 +87,7 @@
87
87
  ol {
88
88
  @include list.unstyled();
89
89
 
90
- @include set-colors.apply(colors.$grijs-5, $icons: false);
90
+ @include set-colors.apply(colors.$grijs-5, "shopping-cart");
91
91
 
92
92
  // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
93
93
  & {
@@ -41,7 +41,8 @@ table.table,
41
41
  max-inline-size: 100%;
42
42
  inline-size: 100%;
43
43
 
44
- .dso-tertiary {
44
+ .dso-tertiary,
45
+ dso-icon-button {
45
46
  position: relative;
46
47
  inset-block-start: -2px;
47
48
  white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- These actions are always accomponied by icons, we always want the icon next to the text
@@ -331,3 +332,7 @@ dso-table.dso-is-responsive {
331
332
  }
332
333
  }
333
334
  }
335
+
336
+ dso-icon-button + dso-icon-button {
337
+ margin-inline-start: units.$u2;
338
+ }
package/src/dso.scss CHANGED
@@ -56,7 +56,6 @@
56
56
  @use "components/justify-form-groups/justify-form-groups";
57
57
  @use "components/label/label";
58
58
  @use "components/label-group/label-group";
59
- @use "components/legend-item/legend-item";
60
59
  @use "components/link/link";
61
60
  @use "components/link-list/link-list";
62
61
  @use "components/list/list";
@@ -31,7 +31,6 @@
31
31
  @return re-gamma(0.2126 * $rlin + 0.7152 * $glin + 0.0722 * $blin) * 100;
32
32
  }
33
33
 
34
- // Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
35
34
  @function apply($color, $dark: colors.$contrast-dark, $light: colors.$contrast-light) {
36
35
  @if $color {
37
36
  $color-brightness: brightness($color);
@@ -47,3 +46,12 @@
47
46
 
48
47
  @return null;
49
48
  }
49
+
50
+ // Returns `true` if the given color is pure white.
51
+ // Checks the lightness channel in HSL color space.
52
+
53
+ // @param {Color} $color - The color to evaluate.
54
+ // @return {Boolean} Whether the color is pure white.
55
+ @function is-white($color) {
56
+ @return color.channel($color, "lightness", $space: hsl) == 100%;
57
+ }