@db-ux/core-components 1.0.0-test-13b991d
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/README.md +107 -0
- package/build/assets/fonts/OFL.txt +93 -0
- package/build/assets/fonts/OpenSans-Bold-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/build/assets/fonts/OpenSans-ExtraBold-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/build/assets/fonts/OpenSans-Light-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-Light.ttf +0 -0
- package/build/assets/fonts/OpenSans-Medium-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-Medium.ttf +0 -0
- package/build/assets/fonts/OpenSans-Regular-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/build/assets/fonts/OpenSans-SemiBold-EU.woff2 +0 -0
- package/build/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/build/assets/fonts/README.md +23 -0
- package/build/assets/fonts/generate-eu-fonts.ts +46 -0
- package/build/assets/fonts/unicode-eu.txt +14 -0
- package/build/assets/icons/DB_LICENSE +253 -0
- package/build/assets/icons/LICENCES.json +153 -0
- package/build/assets/icons/arrow_down.svg +1 -0
- package/build/assets/icons/arrow_left.svg +1 -0
- package/build/assets/icons/arrow_right.svg +1 -0
- package/build/assets/icons/arrow_up.svg +1 -0
- package/build/assets/icons/arrow_up_right.svg +1 -0
- package/build/assets/icons/brand.svg +1 -0
- package/build/assets/icons/calendar.svg +5 -0
- package/build/assets/icons/check-circle.svg +1 -0
- package/build/assets/icons/check.svg +1 -0
- package/build/assets/icons/check_circle.svg +1 -0
- package/build/assets/icons/chevron_down.svg +1 -0
- package/build/assets/icons/chevron_left.svg +1 -0
- package/build/assets/icons/chevron_right.svg +1 -0
- package/build/assets/icons/chevron_up.svg +1 -0
- package/build/assets/icons/circle.svg +1 -0
- package/build/assets/icons/clock.svg +1 -0
- package/build/assets/icons/cross.svg +1 -0
- package/build/assets/icons/cross_circle.svg +1 -0
- package/build/assets/icons/exclamation_mark_circle.svg +1 -0
- package/build/assets/icons/exclamation_mark_triangle.svg +1 -0
- package/build/assets/icons/fonts/all/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_12/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_14/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_16/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_20/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_24/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_28/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_32/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_48/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/default_64/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_12/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_14/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_16/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_20/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_24/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_28/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_32/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_48/db-ux.woff2 +0 -0
- package/build/assets/icons/fonts/filled_64/db-ux.woff2 +0 -0
- package/build/assets/icons/information_circle.svg +1 -0
- package/build/assets/icons/magnifying_glass.svg +1 -0
- package/build/assets/icons/menu.svg +1 -0
- package/build/assets/icons/minus.svg +1 -0
- package/build/assets/icons/plus.svg +1 -0
- package/build/assets/icons/resize_handle_corner.svg +1 -0
- package/build/assets/icons/x_placeholder.svg +1 -0
- package/build/components/accordion/accordion.css +78 -0
- package/build/components/accordion/accordion.scss +62 -0
- package/build/components/accordion-item/accordion-item.css +239 -0
- package/build/components/accordion-item/accordion-item.scss +73 -0
- package/build/components/badge/badge.css +253 -0
- package/build/components/badge/badge.scss +107 -0
- package/build/components/brand/brand.css +42 -0
- package/build/components/brand/brand.scss +32 -0
- package/build/components/button/button.css +165 -0
- package/build/components/button/button.scss +123 -0
- package/build/components/card/card.css +115 -0
- package/build/components/card/card.scss +56 -0
- package/build/components/checkbox/checkbox.css +476 -0
- package/build/components/checkbox/checkbox.scss +80 -0
- package/build/components/divider/divider.css +84 -0
- package/build/components/divider/divider.scss +56 -0
- package/build/components/drawer/drawer.css +303 -0
- package/build/components/drawer/drawer.scss +228 -0
- package/build/components/header/header.css +697 -0
- package/build/components/header/header.scss +246 -0
- package/build/components/icon/icon.css +24 -0
- package/build/components/icon/icon.scss +14 -0
- package/build/components/infotext/infotext.css +152 -0
- package/build/components/infotext/infotext.scss +54 -0
- package/build/components/input/input.css +712 -0
- package/build/components/input/input.scss +147 -0
- package/build/components/link/link.css +257 -0
- package/build/components/link/link.scss +60 -0
- package/build/components/navigation/navigation.css +218 -0
- package/build/components/navigation/navigation.scss +117 -0
- package/build/components/navigation-item/navigation-item.css +482 -0
- package/build/components/navigation-item/navigation-item.scss +310 -0
- package/build/components/notification/notification-grid-default.css +1 -0
- package/build/components/notification/notification-grid-default.scss +52 -0
- package/build/components/notification/notification-grid-non-overlay.css +1 -0
- package/build/components/notification/notification-grid-non-overlay.scss +66 -0
- package/build/components/notification/notification-grid-overlay.css +1 -0
- package/build/components/notification/notification-grid-overlay.scss +55 -0
- package/build/components/notification/notification.css +1173 -0
- package/build/components/notification/notification.scss +216 -0
- package/build/components/page/page.css +49 -0
- package/build/components/page/page.scss +52 -0
- package/build/components/popover/popover.css +291 -0
- package/build/components/popover/popover.scss +26 -0
- package/build/components/radio/radio.css +390 -0
- package/build/components/radio/radio.scss +49 -0
- package/build/components/section/section.css +38 -0
- package/build/components/section/section.scss +51 -0
- package/build/components/select/select.css +651 -0
- package/build/components/select/select.scss +83 -0
- package/build/components/stack/stack-web-component.css +93 -0
- package/build/components/stack/stack-web-component.scss +1 -0
- package/build/components/stack/stack.css +93 -0
- package/build/components/stack/stack.scss +5 -0
- package/build/components/switch/switch.css +901 -0
- package/build/components/switch/switch.scss +233 -0
- package/build/components/tab-item/tab-item.css +160 -0
- package/build/components/tab-item/tab-item.scss +135 -0
- package/build/components/tab-list/tab-list.css +202 -0
- package/build/components/tab-list/tab-list.scss +18 -0
- package/build/components/tab-panel/tab-panel.css +10 -0
- package/build/components/tab-panel/tab-panel.scss +5 -0
- package/build/components/tabs/tabs.css +358 -0
- package/build/components/tabs/tabs.scss +361 -0
- package/build/components/tag/tag.css +1544 -0
- package/build/components/tag/tag.scss +236 -0
- package/build/components/textarea/textarea.css +546 -0
- package/build/components/textarea/textarea.scss +86 -0
- package/build/components/tooltip/tooltip.css +346 -0
- package/build/components/tooltip/tooltip.scss +137 -0
- package/build/styles/absolute.css +1559 -0
- package/build/styles/absolute.scss +5 -0
- package/build/styles/component-animations.css +1 -0
- package/build/styles/component-animations.scss +17 -0
- package/build/styles/dialog-init.css +1 -0
- package/build/styles/dialog-init.scss +57 -0
- package/build/styles/index.css +615 -0
- package/build/styles/index.scss +32 -0
- package/build/styles/internal/_button-components.scss +8 -0
- package/build/styles/internal/_component.scss +79 -0
- package/build/styles/internal/_custom-elements.scss +7 -0
- package/build/styles/internal/_db-puls.scss +83 -0
- package/build/styles/internal/_form-components.scss +516 -0
- package/build/styles/internal/_icon-passing.scss +26 -0
- package/build/styles/internal/_link-components.scss +62 -0
- package/build/styles/internal/_popover-component.scss +213 -0
- package/build/styles/internal/_scrollbar.scss +93 -0
- package/build/styles/internal/_stack-components.scss +104 -0
- package/build/styles/internal/_tag-components.scss +234 -0
- package/build/styles/relative.css +1559 -0
- package/build/styles/relative.scss +15 -0
- package/build/styles/rollup.css +1559 -0
- package/build/styles/rollup.scss +5 -0
- package/build/styles/visually-hidden.css +1 -0
- package/build/styles/visually-hidden.scss +6 -0
- package/build/styles/wc-workarounds.css +1 -0
- package/build/styles/wc-workarounds.scss +12 -0
- package/build/styles/webpack.css +1559 -0
- package/build/styles/webpack.scss +5 -0
- package/package.json +62 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
@use "@db-ux/core-foundations/build/styles/variables";
|
|
2
|
+
@use "@db-ux/core-foundations/build/styles/colors";
|
|
3
|
+
@use "@db-ux/core-foundations/build/styles/fonts";
|
|
4
|
+
@use "@db-ux/core-foundations/build/styles/helpers";
|
|
5
|
+
@use "@db-ux/core-foundations/build/styles/icons";
|
|
6
|
+
@use "../../styles/internal/form-components";
|
|
7
|
+
|
|
8
|
+
// We need some fixed padding here to avoid layout shifts
|
|
9
|
+
/* stylelint-disable-next-line db-ux/use-spacings */
|
|
10
|
+
$switch-fixed-padding: helpers.px-to-rem(2);
|
|
11
|
+
|
|
12
|
+
$switch-inactive-thumb-size: calc(
|
|
13
|
+
#{form-components.$font-size-height} - #{$switch-fixed-padding} * 2
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
$switch-active-thumb-size: calc(#{form-components.$font-size-height});
|
|
17
|
+
|
|
18
|
+
$checked-active-transition-size: calc(
|
|
19
|
+
#{form-components.$font-size-height} - #{$switch-fixed-padding} * 2
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
%active-transition {
|
|
23
|
+
&::before {
|
|
24
|
+
inline-size: calc(
|
|
25
|
+
#{$switch-active-thumb-size} - #{$switch-fixed-padding} * 2 +
|
|
26
|
+
#{variables.$db-spacing-fixed-2xs}
|
|
27
|
+
);
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:checked {
|
|
32
|
+
&::before {
|
|
33
|
+
block-size: $checked-active-transition-size;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.db-switch {
|
|
39
|
+
@include form-components.set-default-check-element(check);
|
|
40
|
+
|
|
41
|
+
user-select: none;
|
|
42
|
+
|
|
43
|
+
// This is needed when clicking on the label instead of the input
|
|
44
|
+
@include helpers.active {
|
|
45
|
+
> input {
|
|
46
|
+
@extend %active-transition;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
> input {
|
|
51
|
+
--db-icon-margin-start: 0;
|
|
52
|
+
--thumb-offset-x: #{$switch-fixed-padding};
|
|
53
|
+
|
|
54
|
+
@extend %db-overwrite-font-size-sm;
|
|
55
|
+
|
|
56
|
+
@include icons.set-icon("cross", "after");
|
|
57
|
+
|
|
58
|
+
appearance: none;
|
|
59
|
+
inline-size: calc(
|
|
60
|
+
#{form-components.$font-size-height} * 2 + #{$switch-fixed-padding}
|
|
61
|
+
);
|
|
62
|
+
block-size: form-components.$font-size-height;
|
|
63
|
+
box-sizing: content-box;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
/* stylelint-disable-next-line db-ux/use-spacings */
|
|
67
|
+
gap: $switch-fixed-padding;
|
|
68
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
|
|
69
|
+
border-radius: variables.$db-border-radius-full;
|
|
70
|
+
|
|
71
|
+
&::after {
|
|
72
|
+
visibility: hidden;
|
|
73
|
+
align-self: center;
|
|
74
|
+
aspect-ratio: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// thumb
|
|
78
|
+
&::before {
|
|
79
|
+
content: "O";
|
|
80
|
+
text-align: center;
|
|
81
|
+
align-content: center;
|
|
82
|
+
aspect-ratio: 1;
|
|
83
|
+
block-size: $switch-inactive-thumb-size;
|
|
84
|
+
background-color: colors.$db-adaptive-bg-inverted-contrast-max-default;
|
|
85
|
+
color: colors.$db-adaptive-bg-inverted-contrast-max-default;
|
|
86
|
+
border-radius: variables.$db-border-radius-full;
|
|
87
|
+
transform: translateX(var(--thumb-offset-x));
|
|
88
|
+
margin-inline-end: calc(
|
|
89
|
+
#{$switch-active-thumb-size} - #{$switch-inactive-thumb-size}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
93
|
+
transition:
|
|
94
|
+
margin variables.$db-transition-duration-fast
|
|
95
|
+
variables.$db-transition-timing-emotional,
|
|
96
|
+
inline-size variables.$db-transition-duration-fast
|
|
97
|
+
variables.$db-transition-timing-emotional,
|
|
98
|
+
block-size variables.$db-transition-duration-fast
|
|
99
|
+
variables.$db-transition-timing-emotional,
|
|
100
|
+
transform variables.$db-transition-duration-fast
|
|
101
|
+
variables.$db-transition-timing-emotional;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* positioned at the end of the track: track length - 100% (thumb width) */
|
|
106
|
+
&:checked {
|
|
107
|
+
--thumb-offset-x: calc(100% + #{$switch-fixed-padding});
|
|
108
|
+
|
|
109
|
+
@include colors.set-current-colors(
|
|
110
|
+
colors.$db-adaptive-bg-inverted-contrast-max-default,
|
|
111
|
+
colors.$db-adaptive-on-bg-inverted-default,
|
|
112
|
+
colors.$db-adaptive-bg-inverted-contrast-max-hovered,
|
|
113
|
+
colors.$db-adaptive-bg-inverted-contrast-max-pressed
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
|
|
117
|
+
|
|
118
|
+
@include helpers.hover {
|
|
119
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-100-hovered;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@include helpers.active {
|
|
123
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-100-pressed;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&::before {
|
|
127
|
+
block-size: $switch-active-thumb-size;
|
|
128
|
+
background-color: colors.$db-adaptive-on-bg-inverted-default;
|
|
129
|
+
color: colors.$db-adaptive-on-bg-inverted-default;
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:focus-visible {
|
|
135
|
+
// Overwrite default border-radius
|
|
136
|
+
border-radius: variables.$db-border-radius-full;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&[data-aid-icon]:not(:checked)::after {
|
|
140
|
+
--db-icon-after: attr(data-aid-icon);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&[data-aid-icon-after]:checked::after {
|
|
144
|
+
--db-icon-after: attr(data-aid-icon-after);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
148
|
+
// Overwrite default transition for switch border
|
|
149
|
+
transition: none;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&[data-hide-label="true"] {
|
|
154
|
+
gap: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&[data-size="small"] {
|
|
158
|
+
gap: variables.$db-spacing-fixed-2xs;
|
|
159
|
+
|
|
160
|
+
> input {
|
|
161
|
+
@extend %db-overwrite-font-size-xs;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&[data-emphasis="strong"] {
|
|
166
|
+
> input {
|
|
167
|
+
--db-check-element-border-color: #{colors.$db-adaptive-bg-basic-transparent-full-default};
|
|
168
|
+
|
|
169
|
+
@extend %db-critical-variables;
|
|
170
|
+
|
|
171
|
+
background-color: colors.$db-adaptive-bg-inverted-contrast-low-default;
|
|
172
|
+
color: colors.$db-adaptive-on-bg-inverted-default;
|
|
173
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-70-default;
|
|
174
|
+
|
|
175
|
+
@include helpers.hover {
|
|
176
|
+
background-color: colors.$db-adaptive-bg-inverted-contrast-low-hovered;
|
|
177
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-70-hovered;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@include helpers.active {
|
|
181
|
+
background-color: colors.$db-adaptive-bg-inverted-contrast-low-pressed;
|
|
182
|
+
border-color: colors.$db-adaptive-on-bg-basic-emphasis-70-pressed;
|
|
183
|
+
|
|
184
|
+
&::before {
|
|
185
|
+
block-size: $checked-active-transition-size;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:not(:checked) {
|
|
190
|
+
--thumb-offset-x: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&:checked {
|
|
194
|
+
@extend %db-successful-variables;
|
|
195
|
+
|
|
196
|
+
&::before {
|
|
197
|
+
background-color: colors.$db-adaptive-on-bg-inverted-default;
|
|
198
|
+
color: colors.$db-adaptive-on-bg-inverted-default;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&::before {
|
|
203
|
+
background-color: colors.$db-adaptive-on-bg-inverted-default;
|
|
204
|
+
color: colors.$db-adaptive-on-bg-inverted-default;
|
|
205
|
+
block-size: $switch-active-thumb-size;
|
|
206
|
+
margin: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&[data-emphasis="strong"],
|
|
212
|
+
&[data-visual-aid="true"] {
|
|
213
|
+
> input {
|
|
214
|
+
&::after {
|
|
215
|
+
visibility: visible;
|
|
216
|
+
block-size: $switch-active-thumb-size;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:checked {
|
|
220
|
+
&:not([data-aid-icon]) {
|
|
221
|
+
@include icons.set-icon("check", "after");
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&::after {
|
|
225
|
+
transform: translateX(
|
|
226
|
+
calc(-100% - #{$switch-fixed-padding})
|
|
227
|
+
);
|
|
228
|
+
block-size: $switch-active-thumb-size;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Use sizing's for fixed heights/widths e.g. the db-button has always a fixed height */
|
|
2
|
+
/* Use fixed spacings for all kind of distances (margin, padding, ...) */
|
|
3
|
+
/* The primary use-case for responsive spacings are
|
|
4
|
+
paddings/gaps in an application e.g. the <main> should have a responsive padding. */
|
|
5
|
+
/* Elevation */
|
|
6
|
+
/* Border */
|
|
7
|
+
/* Transitions */
|
|
8
|
+
/* Variants for adaptive components like input, select, notification, ... */
|
|
9
|
+
.db-visually-hidden,
|
|
10
|
+
[data-visually-hidden=true] {
|
|
11
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
12
|
+
overflow: hidden !important;
|
|
13
|
+
white-space: nowrap !important;
|
|
14
|
+
font-size: 0 !important;
|
|
15
|
+
all: initial;
|
|
16
|
+
inset-block-start: 0 !important;
|
|
17
|
+
block-size: 1px !important;
|
|
18
|
+
position: absolute !important;
|
|
19
|
+
inline-size: 1px !important;
|
|
20
|
+
border-width: 0 !important;
|
|
21
|
+
border-style: initial !important;
|
|
22
|
+
border-color: initial !important;
|
|
23
|
+
border-image: initial !important;
|
|
24
|
+
padding: 0 !important;
|
|
25
|
+
pointer-events: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.db-tab-item input:focus-visible::before {
|
|
29
|
+
outline: var(--db-border-height-2xs) solid var(--db-focus-outline-color, var(--db-informational-on-bg-basic-emphasis-80-default));
|
|
30
|
+
outline-offset: var(--db-border-height-xs);
|
|
31
|
+
box-shadow: 0 0 0 var(--db-border-height-xs) var(--db-focus-box-shadow-bg-color, transparent);
|
|
32
|
+
}
|
|
33
|
+
.db-tab-item input:not([type=radio], [role=switch]):focus-visible::before {
|
|
34
|
+
border-radius: var(--db-border-radius-xs);
|
|
35
|
+
}
|
|
36
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
37
|
+
.db-tab-item input:focus-visible::before {
|
|
38
|
+
transition: outline var(--db-transition-duration-extra-fast), box-shadow var(--db-transition-duration-extra-fast);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
Generates 3 types of placeholders, e.g:
|
|
44
|
+
- %db-component-variables-md
|
|
45
|
+
- %db-font-size-md
|
|
46
|
+
- %db-overwrite-font-size-md
|
|
47
|
+
*/
|
|
48
|
+
.db-tab-item {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
list-style-type: "";
|
|
52
|
+
border-radius: var(--db-border-radius-sm);
|
|
53
|
+
}
|
|
54
|
+
.db-tab-item:has(input:disabled) {
|
|
55
|
+
opacity: 0.4;
|
|
56
|
+
}
|
|
57
|
+
.db-tab-item label {
|
|
58
|
+
background-color: var(--db-adaptive-bg-basic-transparent-full-default);
|
|
59
|
+
padding: var(--db-spacing-fixed-xs);
|
|
60
|
+
align-items: center;
|
|
61
|
+
display: inline-block;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
border: 0;
|
|
64
|
+
border-radius: var(--db-border-radius-sm);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
text-overflow: ellipsis;
|
|
67
|
+
/* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
|
|
68
|
+
/* stylelint-disable-next-line a11y/selector-pseudo-class-focus */
|
|
69
|
+
}
|
|
70
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]) {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input) {
|
|
74
|
+
cursor: initial;
|
|
75
|
+
}
|
|
76
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):has(:not(input:disabled)) {
|
|
80
|
+
background-color: var(--db-adaptive-bg-basic-transparent-hovered);
|
|
81
|
+
}
|
|
82
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):has(input:disabled) {
|
|
83
|
+
cursor: initial;
|
|
84
|
+
}
|
|
85
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]) {
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(textarea), .db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input) {
|
|
89
|
+
cursor: initial;
|
|
90
|
+
}
|
|
91
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input[type=checkbox]), .db-tab-item label:hover:not(:disabled, [aria-disabled=true]):is(input[type=radio]:not(:checked)) {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):has(:not(input:disabled)) {
|
|
95
|
+
background-color: var(--db-adaptive-bg-basic-transparent-hovered);
|
|
96
|
+
}
|
|
97
|
+
.db-tab-item label:hover:not(:disabled, [aria-disabled=true]):has(input:disabled) {
|
|
98
|
+
cursor: initial;
|
|
99
|
+
}
|
|
100
|
+
.db-tab-item label:has(input:checked) {
|
|
101
|
+
font-weight: 700;
|
|
102
|
+
}
|
|
103
|
+
.db-tab-item label[data-icon] {
|
|
104
|
+
padding-inline-start: calc(var(--db-spacing-fixed-xs) + var(--db-spacing-fixed-sm) + calc(var(--db-base-font-size) * var(--db-base-line-height)));
|
|
105
|
+
}
|
|
106
|
+
.db-tab-item label[data-icon]::before {
|
|
107
|
+
position: absolute;
|
|
108
|
+
transform: translateY(-50%);
|
|
109
|
+
inset-block-start: 50%;
|
|
110
|
+
inset-inline-start: calc(0% + var(--db-spacing-fixed-xs));
|
|
111
|
+
}
|
|
112
|
+
.db-tab-item label[data-icon-after] {
|
|
113
|
+
padding-inline-end: calc(var(--db-spacing-fixed-xs) + var(--db-spacing-fixed-sm) + calc(var(--db-base-font-size) * var(--db-base-line-height)));
|
|
114
|
+
}
|
|
115
|
+
.db-tab-item label[data-icon-after]::after {
|
|
116
|
+
position: absolute;
|
|
117
|
+
transform: translateY(-50%);
|
|
118
|
+
inset-block-start: 50%;
|
|
119
|
+
inset-inline-end: calc(0% + var(--db-spacing-fixed-xs));
|
|
120
|
+
}
|
|
121
|
+
.db-tab-item label:is([data-no-text], [data-no-text=true]) {
|
|
122
|
+
font-size: 0 !important;
|
|
123
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
124
|
+
padding: 0;
|
|
125
|
+
inline-size: calc(calc(var(--db-spacing-fixed-xs) + var(--db-spacing-fixed-sm) + calc(var(--db-base-font-size) * var(--db-base-line-height))) - var(--db-spacing-fixed-2xs));
|
|
126
|
+
block-size: calc(calc(var(--db-base-font-size) * var(--db-base-line-height)) + var(--db-spacing-fixed-xs));
|
|
127
|
+
}
|
|
128
|
+
.db-tab-item label:is([data-no-text], [data-no-text=true])::before {
|
|
129
|
+
--db-icon-margin-end: 0;
|
|
130
|
+
}
|
|
131
|
+
.db-tab-item label:is([data-no-text], [data-no-text=true])::before {
|
|
132
|
+
margin-inline-end: 0;
|
|
133
|
+
}
|
|
134
|
+
.db-tab-item input {
|
|
135
|
+
position: absolute;
|
|
136
|
+
appearance: none;
|
|
137
|
+
inline-size: 100%;
|
|
138
|
+
margin-inline-end: initial;
|
|
139
|
+
inset: 0;
|
|
140
|
+
background-color: var(--db-adaptive-bg-basic-transparent-full-default);
|
|
141
|
+
border-radius: var(--db-border-radius-sm);
|
|
142
|
+
z-index: -1;
|
|
143
|
+
/*
|
|
144
|
+
focus must be set on input:
|
|
145
|
+
- parent label tag may use before AND after for displaying icons
|
|
146
|
+
- placed on li.db-tab-item focus would get cut off partially by by overflow hidden (orientation vertical)
|
|
147
|
+
*/
|
|
148
|
+
}
|
|
149
|
+
.db-tab-item input:focus-visible:is(input[type=radio]) {
|
|
150
|
+
outline: none;
|
|
151
|
+
box-shadow: none;
|
|
152
|
+
}
|
|
153
|
+
.db-tab-item input:focus-visible::before {
|
|
154
|
+
content: "";
|
|
155
|
+
position: absolute;
|
|
156
|
+
inset: 0;
|
|
157
|
+
border-radius: var(--db-border-radius-sm);
|
|
158
|
+
z-index: 10;
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@use "@db-ux/core-foundations/build/styles/variables";
|
|
2
|
+
@use "@db-ux/core-foundations/build/styles/colors";
|
|
3
|
+
@use "@db-ux/core-foundations/build/styles/icons";
|
|
4
|
+
@use "@db-ux/core-foundations/build/styles/helpers";
|
|
5
|
+
@use "../../styles/internal/component";
|
|
6
|
+
@use "../../styles/internal/db-puls";
|
|
7
|
+
@use "../../styles/internal/form-components";
|
|
8
|
+
|
|
9
|
+
$with-icon-padding-calc: calc(
|
|
10
|
+
#{variables.$db-spacing-fixed-xs} + #{variables.$db-spacing-fixed-sm} +
|
|
11
|
+
#{form-components.$font-size-height}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.db-tab-item {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
list-style-type: "";
|
|
19
|
+
border-radius: variables.$db-border-radius-sm;
|
|
20
|
+
|
|
21
|
+
&:has(input:disabled) {
|
|
22
|
+
opacity: component.$default-disabled;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
label {
|
|
26
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
|
|
27
|
+
padding: variables.$db-spacing-fixed-xs;
|
|
28
|
+
align-items: center;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
border: 0;
|
|
32
|
+
border-radius: variables.$db-border-radius-sm;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
|
|
36
|
+
@include helpers.hover {
|
|
37
|
+
&:has(:not(input:disabled)) {
|
|
38
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:has(input:disabled) {
|
|
42
|
+
cursor: initial;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include helpers.hover {
|
|
47
|
+
&:has(:not(input:disabled)) {
|
|
48
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:has(input:disabled) {
|
|
52
|
+
cursor: initial;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:has(input:checked) {
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&[data-icon] {
|
|
61
|
+
padding-inline-start: $with-icon-padding-calc;
|
|
62
|
+
|
|
63
|
+
&::before {
|
|
64
|
+
position: absolute;
|
|
65
|
+
transform: translateY(-50%);
|
|
66
|
+
inset-block-start: 50%;
|
|
67
|
+
inset-inline-start: calc(
|
|
68
|
+
0% + #{variables.$db-spacing-fixed-xs}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[data-icon-after] {
|
|
74
|
+
padding-inline-end: $with-icon-padding-calc;
|
|
75
|
+
|
|
76
|
+
&::after {
|
|
77
|
+
position: absolute;
|
|
78
|
+
transform: translateY(-50%);
|
|
79
|
+
inset-block-start: 50%;
|
|
80
|
+
inset-inline-end: calc(0% + #{variables.$db-spacing-fixed-xs});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:is([data-no-text], [data-no-text="true"]) {
|
|
85
|
+
@include icons.is-icon-text-replace();
|
|
86
|
+
|
|
87
|
+
padding: 0;
|
|
88
|
+
inline-size: calc(
|
|
89
|
+
#{$with-icon-padding-calc} - #{variables.$db-spacing-fixed-2xs}
|
|
90
|
+
);
|
|
91
|
+
block-size: calc(
|
|
92
|
+
#{form-components.$font-size-height} +
|
|
93
|
+
#{variables.$db-spacing-fixed-xs}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
&::before {
|
|
97
|
+
margin-inline-end: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
input {
|
|
103
|
+
position: absolute;
|
|
104
|
+
appearance: none;
|
|
105
|
+
inline-size: 100%;
|
|
106
|
+
margin-inline-end: initial;
|
|
107
|
+
inset: 0;
|
|
108
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
|
|
109
|
+
border-radius: variables.$db-border-radius-sm;
|
|
110
|
+
z-index: -1;
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
focus must be set on input:
|
|
114
|
+
- parent label tag may use before AND after for displaying icons
|
|
115
|
+
- placed on li.db-tab-item focus would get cut off partially by by overflow hidden (orientation vertical)
|
|
116
|
+
*/
|
|
117
|
+
&:focus-visible {
|
|
118
|
+
&:is(input[type="radio"]) {
|
|
119
|
+
outline: none;
|
|
120
|
+
box-shadow: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&::before {
|
|
124
|
+
@extend %focus-placeholder;
|
|
125
|
+
|
|
126
|
+
content: "";
|
|
127
|
+
position: absolute;
|
|
128
|
+
inset: 0;
|
|
129
|
+
border-radius: variables.$db-border-radius-sm;
|
|
130
|
+
z-index: 10;
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|