@db-ux/core-components 4.12.0 → 4.13.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @db-ux/core-components
2
2
 
3
+ ## 4.13.0
4
+
5
+ _version bump_
6
+
7
+ ## 4.12.1
8
+
9
+ ### Patch Changes
10
+
11
+ - fix(custom-select): dropdown with `dropdownWidth="auto"` now correctly sizes to content width and respects the trigger minimum width. Long option labels no longer get truncated: `auto` keeps them on a single line (dropdown grows to the longest option), while `fixed` and `full` wrap long labels onto new lines. - [see commit 68dedc3](https://github.com/db-ux-design-system/core-web/commit/68dedc33c324b48339d5bb73a85fdff3045ed059)
12
+
3
13
  ## 4.12.0
4
14
 
5
15
  _version bump_
@@ -57,15 +57,10 @@
57
57
  gap: variables.$db-spacing-fixed-md;
58
58
  border-radius: variables.$db-border-radius-sm;
59
59
 
60
- @include helpers.not-disabled {
61
- @include helpers.hover {
62
- background-color: colors.$db-adaptive-bg-basic-level-1-hovered;
63
- }
64
-
65
- @include helpers.active {
66
- background-color: colors.$db-adaptive-bg-basic-level-1-pressed;
67
- }
68
- }
60
+ @include helpers.interactive-bg(
61
+ colors.$db-adaptive-bg-basic-level-1-hovered,
62
+ colors.$db-adaptive-bg-basic-level-1-pressed
63
+ );
69
64
 
70
65
  &::-webkit-details-marker {
71
66
  display: none;
@@ -35,6 +35,7 @@
35
35
  @include form-components.get-state("active");
36
36
  }
37
37
 
38
+ // jscpd:ignore-start
38
39
  @include form-components.get-validity(check) {
39
40
  &:has(.db-infotext[data-semantic="successful"]) {
40
41
  @include form-components.get-validity-color-checkbox("valid");
@@ -45,6 +46,8 @@
45
46
  @include form-components.get-validity-color-checkbox("invalid");
46
47
  }
47
48
 
49
+ // jscpd:ignore-end
50
+
48
51
  input {
49
52
  @include helpers.display(flex);
50
53
 
@@ -54,6 +57,8 @@
54
57
 
55
58
  &:checked {
56
59
  --db-check-element-border-color: #{colors.$db-adaptive-on-bg-basic-emphasis-70-default};
60
+
61
+ // jscpd:ignore-start
57
62
  --db-icon-color: var(--db-adaptive-on-bg-inverted-default);
58
63
  --db-adaptive-bg-basic-transparent-full-default: var(
59
64
  --db-adaptive-bg-inverted-contrast-max-default
@@ -65,6 +70,8 @@
65
70
  --db-adaptive-bg-inverted-contrast-max-pressed
66
71
  );
67
72
 
73
+ // jscpd:ignore-end
74
+
68
75
  @extend %center-icon;
69
76
 
70
77
  // Check icon
@@ -199,6 +199,12 @@
199
199
  /* stylelint-disable-next-line db-ux/use-sizing */
200
200
  inline-size: var(--db-custom-select-dropdown-fixed-inline-size, var(--db-sizing-3xl));
201
201
  }
202
+ .db-custom-select-dropdown[data-width=auto] {
203
+ inline-size: max-content;
204
+ }
205
+ .db-custom-select-dropdown[data-width=auto] .db-custom-select-list-item-label {
206
+ white-space: nowrap;
207
+ }
202
208
  .db-custom-select-dropdown[data-width=full] {
203
209
  inline-size: 100%;
204
210
  }
@@ -24,6 +24,15 @@
24
24
  );
25
25
  }
26
26
 
27
+ &[data-width="auto"] {
28
+ inline-size: max-content;
29
+
30
+ // Auto width grows to the longest option, so labels must not wrap.
31
+ .db-custom-select-list-item-label {
32
+ white-space: nowrap;
33
+ }
34
+ }
35
+
27
36
  &[data-width="full"] {
28
37
  inline-size: 100%;
29
38
  }
@@ -111,6 +111,11 @@ db-custom-select-list-item:not(:last-of-type) .db-custom-select-list-item[data-d
111
111
  --db-check-element-label-color: var(--db-adaptive-on-bg-basic-emphasis-100-default);
112
112
  inline-size: 100%;
113
113
  }
114
+ .db-custom-select-list-item > label .db-custom-select-list-item-label {
115
+ min-inline-size: 0;
116
+ overflow-wrap: anywhere;
117
+ color: inherit;
118
+ }
114
119
  .db-custom-select-list-item > label:has(input:checked) {
115
120
  font-weight: 700;
116
121
  }
@@ -25,15 +25,10 @@ db-custom-select-list-item:not(:last-of-type) {
25
25
 
26
26
  &:has(> label) {
27
27
  &:not(:has(input[type="radio"]:checked)) {
28
- @include helpers.not-disabled {
29
- @include helpers.hover {
30
- background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
31
- }
32
-
33
- @include helpers.active {
34
- background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
35
- }
36
- }
28
+ @include helpers.interactive-bg(
29
+ colors.$db-adaptive-bg-basic-transparent-full-hovered,
30
+ colors.$db-adaptive-bg-basic-transparent-full-pressed
31
+ );
37
32
  }
38
33
  }
39
34
 
@@ -57,6 +52,17 @@ db-custom-select-list-item:not(:last-of-type) {
57
52
 
58
53
  inline-size: 100%;
59
54
 
55
+ .db-custom-select-list-item-label {
56
+ // Long labels wrap onto new lines by default (fixed/full dropdowns).
57
+ // The auto-width dropdown overrides this to stay single-line
58
+ // (see custom-select-dropdown.scss [data-width="auto"]).
59
+ // min-inline-size: 0 lets the label shrink inside the flex label so
60
+ // the text wraps instead of overflowing.
61
+ min-inline-size: 0;
62
+ overflow-wrap: anywhere;
63
+ color: inherit;
64
+ }
65
+
60
66
  &:has(input:checked) {
61
67
  font-weight: 700;
62
68
  }
@@ -73,16 +73,10 @@
73
73
  justify-content: space-between;
74
74
 
75
75
  @include helpers.display(inline-flex);
76
-
77
- @include helpers.not-disabled {
78
- @include helpers.hover {
79
- background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
80
- }
81
-
82
- @include helpers.active {
83
- background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
84
- }
85
- }
76
+ @include helpers.interactive-bg(
77
+ colors.$db-adaptive-bg-basic-transparent-full-hovered,
78
+ colors.$db-adaptive-bg-basic-transparent-full-pressed
79
+ );
86
80
 
87
81
  &:has(~ .db-sub-navigation:is(:hover, :focus)) {
88
82
  background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
@@ -3,6 +3,7 @@
3
3
  @use "@db-ux/core-foundations/build/styles/helpers";
4
4
  @use "../../styles/internal/form-components";
5
5
 
6
+ // jscpd:ignore-start
6
7
  @mixin get-radio-validity-colors($variant: "successful") {
7
8
  --db-check-element-border-color: var(
8
9
  --db-#{$variant}-on-bg-basic-emphasis-70-default
@@ -27,6 +28,8 @@
27
28
  );
28
29
  }
29
30
 
31
+ // jscpd:ignore-end
32
+
30
33
  .db-radio {
31
34
  @include form-components.set-default-check-element;
32
35
 
@@ -47,6 +47,7 @@ $switch-inline-size: calc(2lh + #{$switch-fixed-padding});
47
47
  }
48
48
  }
49
49
 
50
+ // jscpd:ignore-start
50
51
  @include form-components.get-validity(check) {
51
52
  &:has(.db-infotext[data-semantic="successful"]) {
52
53
  @include form-components.get-validity-color-checkbox("valid");
@@ -57,6 +58,8 @@ $switch-inline-size: calc(2lh + #{$switch-fixed-padding});
57
58
  @include form-components.get-validity-color-checkbox("invalid");
58
59
  }
59
60
 
61
+ // jscpd:ignore-end
62
+
60
63
  input {
61
64
  --db-icon-margin-start: 0;
62
65
  --thumb-offset-x: #{$switch-fixed-padding};
@@ -131,6 +134,8 @@ $switch-inline-size: calc(2lh + #{$switch-fixed-padding});
131
134
  /* positioned at the end of the track: track length - 100% (thumb width) */
132
135
  &:checked {
133
136
  --thumb-offset-x: calc(100% + #{$switch-fixed-padding});
137
+
138
+ // jscpd:ignore-start
134
139
  --db-icon-color: var(--db-adaptive-on-bg-inverted-default);
135
140
  --db-adaptive-bg-basic-transparent-full-default: var(
136
141
  --db-adaptive-bg-inverted-contrast-max-default
@@ -142,6 +147,8 @@ $switch-inline-size: calc(2lh + #{$switch-fixed-padding});
142
147
  --db-adaptive-bg-inverted-contrast-max-pressed
143
148
  );
144
149
 
150
+ // jscpd:ignore-end
151
+
145
152
  &::after {
146
153
  --db-icon-color: #{colors.$db-adaptive-on-bg-inverted-default};
147
154
  }
@@ -40,15 +40,10 @@ $with-icon-padding-calc: calc(
40
40
  --db-overwrite-cursor: initial;
41
41
  }
42
42
 
43
- @include helpers.not-disabled {
44
- @include helpers.hover {
45
- background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
46
- }
47
-
48
- @include helpers.active {
49
- background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
50
- }
51
- }
43
+ @include helpers.interactive-bg(
44
+ colors.$db-adaptive-bg-basic-transparent-full-hovered,
45
+ colors.$db-adaptive-bg-basic-transparent-full-pressed
46
+ );
52
47
 
53
48
  &:has(input:checked) {
54
49
  font-weight: 700;
@@ -68,6 +68,7 @@ $interactive-child: ":is(#{$interactive-row-action}:is(#{helpers.$interactive-el
68
68
  }
69
69
  }
70
70
 
71
+ // jscpd:ignore-start
71
72
  @include table-row-interactive-state {
72
73
  background-color: colors.$db-adaptive-bg-basic-level-2-hovered;
73
74
  }
@@ -76,6 +77,8 @@ $interactive-child: ":is(#{$interactive-row-action}:is(#{helpers.$interactive-el
76
77
  background-color: colors.$db-adaptive-bg-basic-level-2-pressed;
77
78
  }
78
79
 
80
+ // jscpd:ignore-end
81
+
79
82
  &:has(#{$interactive-child}:focus-visible) {
80
83
  &::after {
81
84
  @extend %focus-placeholder;