@db-ux/core-components 4.6.1 → 4.7.0-tabs-34782eb

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 (49) hide show
  1. package/CHANGELOG.md +28 -16
  2. package/build/components/accordion-item/accordion-item.css +5 -3
  3. package/build/components/badge/badge.css +13 -7
  4. package/build/components/brand/brand.css +3 -3
  5. package/build/components/button/button.css +3 -1
  6. package/build/components/card/card.css +10 -6
  7. package/build/components/checkbox/checkbox.css +25 -21
  8. package/build/components/custom-button/custom-button.css +3 -1
  9. package/build/components/custom-select/custom-select.css +19 -15
  10. package/build/components/custom-select-dropdown/custom-select-dropdown.css +11 -3
  11. package/build/components/custom-select-form-field/custom-select-form-field.css +8 -6
  12. package/build/components/custom-select-list/custom-select-list.css +4 -2
  13. package/build/components/custom-select-list-item/custom-select-list-item.css +7 -5
  14. package/build/components/drawer/drawer.css +3 -3
  15. package/build/components/header/header.css +115 -60
  16. package/build/components/icon/icon.css +4 -2
  17. package/build/components/infotext/infotext.css +15 -15
  18. package/build/components/input/input.css +12 -10
  19. package/build/components/navigation/navigation.css +28 -12
  20. package/build/components/navigation-item/navigation-item.css +39 -19
  21. package/build/components/notification/notification.css +5 -5
  22. package/build/components/notification/notification.scss +1 -1
  23. package/build/components/page/page.css +13 -11
  24. package/build/components/popover/popover.css +25 -13
  25. package/build/components/radio/radio.css +10 -8
  26. package/build/components/section/section.css +3 -3
  27. package/build/components/select/select.css +11 -11
  28. package/build/components/select/select.scss +4 -4
  29. package/build/components/stack/stack-web-component.css +3 -3
  30. package/build/components/stack/stack.css +3 -3
  31. package/build/components/switch/switch.css +30 -20
  32. package/build/components/tab-item/tab-item.css +133 -157
  33. package/build/components/tab-item/tab-item.scss +105 -103
  34. package/build/components/tab-list/tab-list.css +46 -36
  35. package/build/components/tab-list/tab-list.scss +11 -9
  36. package/build/components/tab-panel/tab-panel.css +1 -2
  37. package/build/components/tab-panel/tab-panel.scss +2 -5
  38. package/build/components/tabs/tabs.css +227 -236
  39. package/build/components/tabs/tabs.scss +214 -234
  40. package/build/components/tag/tag.css +32 -11
  41. package/build/components/textarea/textarea.css +27 -17
  42. package/build/components/tooltip/tooltip.css +19 -9
  43. package/build/styles/absolute.css +32 -18
  44. package/build/styles/bundle.css +32 -18
  45. package/build/styles/index.css +31 -17
  46. package/build/styles/relative.css +32 -18
  47. package/build/styles/rollup.css +32 -18
  48. package/build/styles/webpack.css +32 -18
  49. package/package.json +6 -6
@@ -1,138 +1,140 @@
1
1
  @use "@db-ux/core-foundations/build/styles/variables";
2
2
  @use "@db-ux/core-foundations/build/styles/colors";
3
- @use "@db-ux/core-foundations/build/styles/icons";
4
3
  @use "@db-ux/core-foundations/build/styles/helpers";
5
- @use "../../styles/internal/component";
4
+ @use "@db-ux/core-foundations/build/styles/icons";
5
+ @use "@db-ux/core-foundations/build/styles/fonts";
6
6
  @use "../../styles/internal/db-puls";
7
- @use "../../styles/internal/form-components";
8
7
 
9
- $with-icon-padding-calc: calc(
10
- #{variables.$db-spacing-fixed-xs} + #{variables.$db-spacing-fixed-sm} +
11
- #{form-components.$font-size-height}
12
- );
8
+ db-tab-item,
9
+ dbtabitem {
10
+ display: contents;
11
+ vertical-align: top; // fallback if display: contents fails: prevents baseline gap
12
+ }
13
13
 
14
14
  .db-tab-item {
15
15
  position: relative;
16
-
17
- @include helpers.display(inline-flex);
18
-
19
- list-style-type: "";
16
+ background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
17
+ padding: variables.$db-spacing-fixed-xs;
18
+ overflow: visible;
19
+ align-items: center;
20
+ justify-content: center;
21
+ white-space: nowrap;
22
+ border: 0;
20
23
  border-radius: variables.$db-border-radius-sm;
24
+ cursor: pointer;
25
+ font: inherit;
26
+ color: inherit;
27
+ flex-shrink: 0;
28
+ z-index: 2;
29
+ max-inline-size: variables.$db-sizing-2xl;
30
+
31
+ @media screen and (forced-colors: active) {
32
+ // Windows High Contrast mode forces transparent borders to become visible,
33
+ // creating boundaries for the button when backgrounds are stripped.
34
+ border: variables.$db-border-width-xs solid transparent;
35
+ }
21
36
 
22
- &:has(input:disabled) {
23
- opacity: variables.$db-opacity-md;
37
+ @media screen and (prefers-reduced-motion: no-preference) {
38
+ transition: background-color variables.$db-transition-duration-fast;
24
39
  }
25
40
 
26
- label {
27
- background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
28
- padding: variables.$db-spacing-fixed-xs;
29
- align-items: center;
41
+ .db-tab-label {
42
+ max-inline-size: 100%;
30
43
 
31
- @include helpers.display(inline-block);
44
+ @include helpers.display(block);
32
45
 
33
- white-space: nowrap;
34
- border: 0;
35
- border-radius: variables.$db-border-radius-sm;
36
- overflow: hidden;
37
- text-overflow: ellipsis;
46
+ &:not([data-icon-trailing])::after {
47
+ content: attr(data-label);
48
+ font-weight: 700;
49
+ display: block;
50
+ block-size: 0;
51
+ font-size: 0;
52
+ line-height: 0;
53
+ padding: 0;
54
+ margin: 0;
55
+ overflow: hidden;
56
+ visibility: hidden;
57
+ }
38
58
 
39
- @include helpers.hover {
40
- &:has(:not(input:disabled)) {
41
- background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
42
- }
59
+ &[data-icon]:not([data-show-icon="false"]) {
60
+ &::before {
61
+ @extend %icon;
43
62
 
44
- &:has(input:disabled) {
45
- cursor: initial;
63
+ margin-inline-end: variables.$db-spacing-fixed-xs;
64
+ vertical-align: middle;
46
65
  }
47
66
  }
67
+ }
48
68
 
49
- @include helpers.hover {
50
- &:has(:not(input:disabled)) {
51
- background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
52
- }
53
-
54
- &:has(input:disabled) {
55
- cursor: initial;
56
- }
69
+ &[data-no-text="true"] .db-tab-label {
70
+ &[data-icon]::before {
71
+ margin-inline-end: 0;
57
72
  }
58
73
 
59
- &:has(input:checked) {
60
- font-weight: 700;
74
+ &::after {
75
+ content: none;
61
76
  }
77
+ }
78
+
79
+ [data-orientation="vertical"] & .db-tab-label {
80
+ overflow: hidden;
81
+ text-overflow: ellipsis;
82
+ white-space: nowrap;
83
+ }
62
84
 
63
- &[data-icon] {
64
- padding-inline-start: $with-icon-padding-calc;
85
+ @extend %db-puls;
86
+ @include helpers.display(flex);
65
87
 
66
- &::before {
67
- position: absolute;
68
- transform: translateY(-50%);
69
- inset-block-start: 50%;
70
- inset-inline-start: calc(
71
- 0% + #{variables.$db-spacing-fixed-xs}
72
- );
73
- }
74
- }
88
+ [data-density="functional"] & {
89
+ padding: variables.$db-spacing-fixed-2xs;
75
90
 
76
- &[data-icon-trailing] {
77
- padding-inline-end: $with-icon-padding-calc;
91
+ @extend %db-overwrite-font-size-sm;
92
+ }
78
93
 
79
- &::after {
80
- position: absolute;
81
- transform: translateY(-50%);
82
- inset-block-start: 50%;
83
- inset-inline-end: calc(0% + #{variables.$db-spacing-fixed-xs});
84
- }
85
- }
94
+ [data-density="expressive"] & {
95
+ padding: variables.$db-spacing-fixed-sm;
86
96
 
87
- &:is([data-no-text], [data-no-text="true"]) {
88
- @include icons.is-icon-text-replace;
97
+ @extend %db-overwrite-font-size-lg;
98
+ }
89
99
 
90
- padding: 0;
91
- inline-size: calc(
92
- #{$with-icon-padding-calc} - #{variables.$db-spacing-fixed-2xs}
93
- );
94
- block-size: calc(
95
- #{form-components.$font-size-height} +
96
- #{variables.$db-spacing-fixed-xs}
97
- );
100
+ &::after {
101
+ inline-size: 0;
102
+ block-size: variables.$db-border-width-xs;
98
103
 
99
- &::before {
100
- margin-inline-end: 0;
101
- }
104
+ @media screen and (prefers-reduced-motion: no-preference) {
105
+ transition:
106
+ block-size variables.$db-transition-duration-fast
107
+ variables.$db-transition-timing-emotional,
108
+ inline-size variables.$db-transition-duration-fast
109
+ variables.$db-transition-timing-emotional !important; // overrides physical `width`/`height` transition from %db-puls in _db-puls.scss
110
+ }
111
+
112
+ [data-orientation="vertical"] & {
113
+ inline-size: variables.$db-border-width-xs;
114
+ block-size: 0;
102
115
  }
103
116
  }
104
117
 
105
- input {
106
- position: absolute;
107
- appearance: none;
108
- inline-size: 100%;
109
- margin-inline-end: initial;
110
- inset: 0;
111
- background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
112
- border-radius: variables.$db-border-radius-sm;
113
- z-index: -1;
114
-
115
- /*
116
- focus must be set on input:
117
- - parent label tag may use before AND after for displaying icons
118
- - placed on li.db-tab-item focus would get cut off partially by by overflow hidden (orientation vertical)
119
- */
120
- &:focus-visible {
121
- &:is(input[type="radio"]) {
122
- outline: none;
123
- box-shadow: none;
124
- }
118
+ [data-orientation="vertical"] & {
119
+ max-inline-size: 100%;
120
+ flex-shrink: 1;
121
+ }
125
122
 
126
- &::before {
127
- @extend %focus-placeholder;
128
-
129
- content: "";
130
- position: absolute;
131
- inset: 0;
132
- border-radius: variables.$db-border-radius-sm;
133
- z-index: 10;
134
- pointer-events: none;
135
- }
136
- }
123
+ &[aria-selected="true"],
124
+ &[data-active="true"] {
125
+ font-weight: 700;
126
+ }
127
+
128
+ &:disabled {
129
+ opacity: variables.$db-opacity-md;
130
+ cursor: initial;
131
+ }
132
+
133
+ // TODO: Investigate why helpers.hover mixin doesn't work here
134
+ // Other components use @include helpers.hover directly, but for tab-item
135
+ // it doesn't apply the hover effect. Using native pseudo-classes as workaround.
136
+ &:not(:disabled):hover,
137
+ &:not(:disabled):focus-visible {
138
+ background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
137
139
  }
138
140
  }
@@ -1,4 +1,3 @@
1
- /* Variants for adaptive components like input, select, notification, ... */
2
1
  .db-visually-hidden,
3
2
  [data-visually-hidden=true] {
4
3
  clip: rect(0, 0, 0, 0) !important;
@@ -18,7 +17,15 @@
18
17
  pointer-events: none !important;
19
18
  }
20
19
 
21
- .db-tab-list > ul::-webkit-scrollbar, .db-tab-list > ul::-webkit-scrollbar-corner {
20
+ /* Variants for adaptive components like input, select, notification, ... */
21
+ .db-tab-list {
22
+ font: var(--db-type-body-md);
23
+ /* Those variables are only for components to calculate heights and change icons */
24
+ --db-icon-font-weight: var(--db-base-body-icon-weight-md);
25
+ --db-icon-font-size: var(--db-base-body-icon-font-size-md);
26
+ }
27
+
28
+ .db-tab-list::-webkit-scrollbar, .db-tab-list::-webkit-scrollbar-corner {
22
29
  transition: outline var(--db-transition-duration-extra-fast), border-color var(--db-transition-straight-emotional), background-color var(--db-transition-straight-emotional);
23
30
  }
24
31
 
@@ -39,78 +46,79 @@
39
46
  transform: rotate(1turn);
40
47
  }
41
48
  }
42
- .db-tab-list {
43
- font: var(--db-type-body-md);
44
- /* Those variables are only for components to calculate heights and change icons */
45
- --db-icon-font-weight: var(--db-base-body-icon-weight-md);
46
- --db-icon-font-size: var(--db-base-body-icon-font-size-md);
47
- }
48
-
49
- .db-tab-list > ul {
50
- /* Buttons */
51
- /* Up */
52
- /* Down */
53
- /* Left */
54
- /* Right */
55
- }
56
49
  @supports (field-sizing: content) {
57
- .db-tab-list > ul[data-field-sizing=content]:is([data-hide-resizer=true], [data-resize=none]) {
50
+ [data-field-sizing=content].db-tab-list:is([data-hide-resizer=true], [data-resize=none]) {
58
51
  /* We don't show a scrollbar if we use field-sizing: content and no resizer is available */
59
52
  scrollbar-width: none;
60
53
  }
61
54
  }
62
- .db-tab-list > ul::-webkit-scrollbar {
55
+ .db-tab-list::-webkit-scrollbar {
63
56
  z-index: 3;
64
57
  inline-size: 0.5rem;
65
58
  block-size: 0.5rem;
66
59
  background-color: var(--db-adaptive-bg-basic-level-1-default);
67
60
  border-start-end-radius: var(--db-border-radius-xs);
68
61
  }
69
- .db-tab-list > ul:is(:hover, :focus)::-webkit-scrollbar-track, .db-tab-list > ul:is(:hover, :focus)::-webkit-scrollbar-button:single-button {
62
+ .db-tab-list:is(:hover, :focus)::-webkit-scrollbar-track, .db-tab-list:is(:hover, :focus)::-webkit-scrollbar-button:single-button {
70
63
  background-color: var(--db-adaptive-bg-basic-transparent-full-hovered);
71
64
  }
72
- .db-tab-list > ul:read-only::-webkit-scrollbar-track, .db-tab-list > ul:read-only::-webkit-scrollbar-button:single-button {
65
+ .db-tab-list:read-only::-webkit-scrollbar-track, .db-tab-list:read-only::-webkit-scrollbar-button:single-button {
73
66
  background-color: var(--db-adaptive-bg-basic-level-1-default);
74
67
  }
75
- .db-tab-list > ul::-webkit-scrollbar-track {
68
+ .db-tab-list::-webkit-scrollbar-track {
76
69
  background-color: var(--db-adaptive-bg-basic-transparent-semi-default);
77
70
  }
78
- .db-tab-list > ul::-webkit-scrollbar-thumb {
71
+ .db-tab-list::-webkit-scrollbar-thumb {
79
72
  background-color: var(--db-adaptive-bg-basic-transparent-full-pressed);
80
73
  }
81
- .db-tab-list > ul::-webkit-scrollbar-button:single-button {
74
+ .db-tab-list {
75
+ /* Buttons */
76
+ }
77
+ .db-tab-list::-webkit-scrollbar-button:single-button {
82
78
  background-color: var(--db-adaptive-bg-basic-transparent-semi-default);
83
79
  background-size: 0.5rem;
84
80
  background-repeat: no-repeat;
85
81
  background-position: center;
86
82
  block-size: calc(var(--db-spacing-fixed-3xs) + var(--db-spacing-fixed-2xs) + var(--db-base-body-icon-font-size-2xs));
87
83
  }
88
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:is(:hover, :focus) {
84
+ .db-tab-list::-webkit-scrollbar-button:single-button:is(:hover, :focus) {
89
85
  background-color: var(--db-adaptive-bg-basic-transparent-full-hovered);
90
86
  }
91
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:active {
87
+ .db-tab-list::-webkit-scrollbar-button:single-button:active {
92
88
  background-color: var(--db-adaptive-bg-basic-transparent-full-pressed);
93
89
  }
94
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:vertical:decrement {
90
+ .db-tab-list {
91
+ /* Up */
92
+ }
93
+ .db-tab-list::-webkit-scrollbar-button:single-button:vertical:decrement {
95
94
  border-start-end-radius: var(--db-border-radius-xs);
96
95
  background-image: var(--db-scrollbar-button-vertical-decrement);
97
96
  }
98
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:vertical:increment {
97
+ .db-tab-list {
98
+ /* Down */
99
+ }
100
+ .db-tab-list::-webkit-scrollbar-button:single-button:vertical:increment {
99
101
  background-image: var(--db-scrollbar-button-vertical-increment);
100
102
  }
101
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:horizontal:decrement {
103
+ .db-tab-list {
104
+ /* Left */
105
+ }
106
+ .db-tab-list::-webkit-scrollbar-button:single-button:horizontal:decrement {
102
107
  background-image: var(--db-scrollbar-button-horizontal-decrement);
103
108
  }
104
- .db-tab-list > ul::-webkit-scrollbar-button:single-button:horizontal:increment {
109
+ .db-tab-list {
110
+ /* Right */
111
+ }
112
+ .db-tab-list::-webkit-scrollbar-button:single-button:horizontal:increment {
105
113
  background-image: var(--db-scrollbar-button-horizontal-increment);
106
114
  }
107
- .db-tab-list > ul[data-variant=floating]::-webkit-resizer {
115
+ [data-variant=floating].db-tab-list::-webkit-resizer {
108
116
  background-color: var(--db-adaptive-bg-basic-transparent-semi-default);
109
117
  }
110
- .db-tab-list > ul[data-variant=floating]::-webkit-scrollbar-corner {
118
+ [data-variant=floating].db-tab-list::-webkit-scrollbar-corner {
111
119
  background-color: var(--db-adaptive-bg-basic-level-1-default);
112
120
  }
113
- .db-tab-list > ul::-webkit-resizer {
121
+ .db-tab-list::-webkit-resizer {
114
122
  background-color: var(--db-adaptive-bg-basic-transparent-full-default);
115
123
  background-size: 0.5rem;
116
124
  background-repeat: no-repeat;
@@ -118,17 +126,19 @@
118
126
  background-image: var(--db-textarea-resizer-image);
119
127
  border-end-end-radius: var(--db-border-radius-xs);
120
128
  }
121
- .db-tab-list > ul::-webkit-scrollbar-corner {
129
+ .db-tab-list::-webkit-scrollbar-corner {
122
130
  border-end-end-radius: var(--db-border-radius-xs);
123
131
  }
124
132
 
125
133
  .db-tab-list {
126
134
  position: relative;
127
- }
128
- .db-tab-list > ul {
129
135
  display: flex;
130
- gap: var(--db-spacing-fixed-sm);
136
+ gap: var(--db-spacing-fixed-2xs);
131
137
  scroll-behavior: smooth;
132
138
  padding: 0;
133
139
  margin: 0;
134
140
  }
141
+ [data-orientation=vertical] .db-tab-list {
142
+ flex-direction: column;
143
+ align-items: flex-start;
144
+ }
@@ -1,18 +1,20 @@
1
1
  @use "@db-ux/core-foundations/build/styles/variables";
2
+ @use "@db-ux/core-foundations/build/styles/fonts";
2
3
  @use "../../styles/internal/scrollbar";
3
4
 
4
5
  .db-tab-list {
5
- @extend %db-overwrite-font-size-md;
6
-
7
6
  position: relative;
7
+ display: flex;
8
+ gap: variables.$db-spacing-fixed-2xs;
9
+ scroll-behavior: smooth;
10
+ padding: 0;
11
+ margin: 0;
8
12
 
9
- > ul {
10
- @extend %scrollbar;
13
+ @extend %db-overwrite-font-size-md;
14
+ @extend %scrollbar;
11
15
 
12
- display: flex;
13
- gap: variables.$db-spacing-fixed-sm;
14
- scroll-behavior: smooth;
15
- padding: 0;
16
- margin: 0;
16
+ [data-orientation="vertical"] & {
17
+ flex-direction: column;
18
+ align-items: flex-start;
17
19
  }
18
20
  }
@@ -1,4 +1,3 @@
1
- /* Variants for adaptive components like input, select, notification, ... */
2
1
  .db-tab-panel:not([hidden]) {
3
- display: none;
2
+ display: block;
4
3
  }
@@ -1,6 +1,3 @@
1
- @use "@db-ux/core-foundations/build/styles/variables";
2
- @use "@db-ux/core-foundations/build/styles/helpers";
3
-
4
- .db-tab-panel {
5
- @include helpers.display(none);
1
+ .db-tab-panel:not([hidden]) {
2
+ display: block;
6
3
  }