@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,516 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "@db-ux/core-foundations/build/styles/icons";
|
|
4
|
+
@use "@db-ux/core-foundations/build/styles/fonts";
|
|
5
|
+
@use "@db-ux/core-foundations/build/styles/variables";
|
|
6
|
+
@use "@db-ux/core-foundations/build/styles/colors";
|
|
7
|
+
@use "@db-ux/core-foundations/build/styles/helpers";
|
|
8
|
+
@use "component";
|
|
9
|
+
|
|
10
|
+
@forward "../visually-hidden";
|
|
11
|
+
|
|
12
|
+
$dropdown-icon-transition: transform variables.$db-transition-straight-emotional;
|
|
13
|
+
$dropdown-icon-transform: rotate(-180deg);
|
|
14
|
+
|
|
15
|
+
$font-size-height: calc(var(--db-base-font-size) * var(--db-base-line-height));
|
|
16
|
+
$icon-size-sm: var(--db-base-body-icon-font-size-sm);
|
|
17
|
+
$label-size-height-sm: calc(
|
|
18
|
+
var(--db-type-body-font-size-sm) * var(--db-type-body-line-height-sm)
|
|
19
|
+
);
|
|
20
|
+
$label-size-height-xs: calc(
|
|
21
|
+
var(--db-type-body-font-size-xs) * var(--db-type-body-line-height-xs)
|
|
22
|
+
);
|
|
23
|
+
$label-size-height-2xs: calc(
|
|
24
|
+
var(--db-type-body-font-size-2xs) * var(--db-type-body-line-height-2xs)
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
$floating-label-size-calc: calc(
|
|
28
|
+
#{variables.$db-spacing-fixed-3xs} + #{variables.$db-spacing-fixed-2xs} +
|
|
29
|
+
#{$label-size-height-2xs}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
$input-types: "button", "checkbox", "color", "date", "datetime-local", "email",
|
|
33
|
+
"file", "hidden", "image", "month", "number", "password", "radio", "range",
|
|
34
|
+
"reset", "search", "submit", "tel", "text", "time", "url", "week";
|
|
35
|
+
|
|
36
|
+
$check-border-size: min(#{variables.$db-border-height-2xs}, 2px);
|
|
37
|
+
|
|
38
|
+
%dropdown-icon {
|
|
39
|
+
@include icons.set-icon("chevron_down", "after");
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
|
|
44
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
45
|
+
transition: $dropdown-icon-transition;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
%helper-message {
|
|
51
|
+
.db-infotext {
|
|
52
|
+
margin-block-start: variables.$db-spacing-fixed-2xs;
|
|
53
|
+
|
|
54
|
+
&[data-semantic] {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@mixin placeholder-content() {
|
|
61
|
+
&::placeholder,
|
|
62
|
+
+ [id$="-placeholder"] {
|
|
63
|
+
@content;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@mixin set-floating-label-overwrites($selector) {
|
|
68
|
+
&[data-variant="floating"] {
|
|
69
|
+
label {
|
|
70
|
+
@extend %db-overwrite-font-size-md;
|
|
71
|
+
|
|
72
|
+
opacity: component.$placeholder-disabled;
|
|
73
|
+
position: absolute;
|
|
74
|
+
z-index: 2;
|
|
75
|
+
inset-block-start: calc(
|
|
76
|
+
(#{variables.$db-sizing-md} - #{$font-size-height}) / 2
|
|
77
|
+
);
|
|
78
|
+
inset-inline: var(
|
|
79
|
+
--db-form-component-padding-inline-start,
|
|
80
|
+
#{variables.$db-spacing-fixed-sm}
|
|
81
|
+
);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// icons
|
|
86
|
+
&::after,
|
|
87
|
+
&::before {
|
|
88
|
+
inset-block-start: calc(
|
|
89
|
+
#{variables.$db-sizing-md} / 2 - #{$font-size-height} / 2
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[id$="-placeholder"] {
|
|
94
|
+
@extend %db-overwrite-font-size-sm;
|
|
95
|
+
|
|
96
|
+
inset-block-start: calc(
|
|
97
|
+
50% - 0.5em + #{variables.$db-spacing-fixed-3xs}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#{$selector} {
|
|
102
|
+
@extend %db-overwrite-font-size-sm;
|
|
103
|
+
|
|
104
|
+
@include placeholder-content() {
|
|
105
|
+
transition: none;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@if ($selector == textarea) {
|
|
110
|
+
padding-block-start: $floating-label-size-calc;
|
|
111
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
112
|
+
} @else {
|
|
113
|
+
// font-size label which is 2xs + smallest spacing
|
|
114
|
+
padding-block-start: calc(
|
|
115
|
+
var(--db-type-body-font-size-2xs) +
|
|
116
|
+
#{variables.$db-spacing-fixed-3xs}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:has(
|
|
122
|
+
#{$selector}:focus-within,
|
|
123
|
+
#{$selector}:is(input, textarea):not(:placeholder-shown),
|
|
124
|
+
> select option:checked:not([hidden])
|
|
125
|
+
) {
|
|
126
|
+
label {
|
|
127
|
+
@extend %db-overwrite-font-size-2xs;
|
|
128
|
+
|
|
129
|
+
inset-block-start: variables.$db-spacing-fixed-2xs;
|
|
130
|
+
opacity: 1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
#{$selector} {
|
|
134
|
+
@include placeholder-content() {
|
|
135
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
136
|
+
transition: opacity
|
|
137
|
+
#{variables.$db-transition-straight-emotional};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
opacity: component.$placeholder-disabled;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@mixin get-validity-message($key: "valid") {
|
|
148
|
+
.db-infotext {
|
|
149
|
+
@if ($key == "valid") {
|
|
150
|
+
&[data-semantic="successful"] {
|
|
151
|
+
display: flex;
|
|
152
|
+
}
|
|
153
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
154
|
+
} @else {
|
|
155
|
+
&[data-semantic="critical"] {
|
|
156
|
+
display: flex;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:not([data-semantic]) {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@mixin get-validity-color($selector, $key: "valid") {
|
|
167
|
+
$variant: "successful";
|
|
168
|
+
|
|
169
|
+
@if ($key != "valid") {
|
|
170
|
+
$variant: "critical";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@include get-validity-message($key);
|
|
174
|
+
|
|
175
|
+
#{$selector},
|
|
176
|
+
[id$="-placeholder"] {
|
|
177
|
+
color: var(--db-#{$variant}-on-bg-basic-emphasis-100-default);
|
|
178
|
+
caret-color: var(--db-#{$variant}-on-bg-basic-emphasis-100-default);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@if ($selector != textarea) {
|
|
182
|
+
@extend %db-#{$variant}-variables;
|
|
183
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
184
|
+
} @else {
|
|
185
|
+
// this is a workaround for the textarea scrollbar
|
|
186
|
+
--db-textarea-read-only: var(--db-#{$variant}-bg-basic-level-1-default);
|
|
187
|
+
--db-adaptive-bg-basic-transparent-full-default: var(
|
|
188
|
+
--db-#{$variant}-bg-basic-transparent-full-default
|
|
189
|
+
);
|
|
190
|
+
--db-adaptive-bg-basic-transparent-semi-default: var(
|
|
191
|
+
--db-#{$variant}-bg-basic-transparent-semi-default
|
|
192
|
+
);
|
|
193
|
+
--db-adaptive-bg-basic-transparent-hovered: var(
|
|
194
|
+
--db-#{$variant}-bg-basic-transparent-hovered
|
|
195
|
+
);
|
|
196
|
+
--db-adaptive-bg-basic-transparent-pressed: var(
|
|
197
|
+
--db-#{$variant}-bg-basic-transparent-pressed
|
|
198
|
+
);
|
|
199
|
+
--db-adaptive-default: var(
|
|
200
|
+
--db-#{$variant}-on-bg-basic-emphasis-100-default
|
|
201
|
+
);
|
|
202
|
+
--db-adaptive-on-bg-basic-emphasis-60-default: var(
|
|
203
|
+
--db-#{$variant}-on-bg-basic-emphasis-60-default
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// This doesn't contain text, search and password, because they don't have an auto-validation
|
|
209
|
+
$input-valid-types: "color", "date", "datetime-local", "email", "file",
|
|
210
|
+
"hidden", "month", "number", "range", "tel", "time", "url", "week";
|
|
211
|
+
|
|
212
|
+
@function get-validations($selector, $key) {
|
|
213
|
+
$validations: ":required";
|
|
214
|
+
|
|
215
|
+
@if ($selector == input) {
|
|
216
|
+
// https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#using_built-in_form_validation
|
|
217
|
+
$validations: ":required, [minlength], [maxlength], [pattern]";
|
|
218
|
+
|
|
219
|
+
@each $type in $input-valid-types {
|
|
220
|
+
$validations: $validations + ", [type=#{$type}]";
|
|
221
|
+
}
|
|
222
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
223
|
+
} @else if($selector == textarea) {
|
|
224
|
+
$validations: ":required, [minlength], [maxlength]";
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
$has-selectors: "&:has(#{$selector}:not([data-custom-validity]):is(#{$validations}):user-#{$key}),";
|
|
228
|
+
|
|
229
|
+
@return string.unquote(string.slice($has-selectors, 1, -2));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@mixin get-validity($selector, $key: "valid") {
|
|
233
|
+
@if ($key == "valid") {
|
|
234
|
+
$boolean: "false";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
$user: "";
|
|
238
|
+
|
|
239
|
+
@if ($selector == check) {
|
|
240
|
+
$user: "user-";
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@if ($selector == check or $selector == radio) {
|
|
244
|
+
$selector: input;
|
|
245
|
+
|
|
246
|
+
&:has(
|
|
247
|
+
#{$selector}:not(
|
|
248
|
+
[data-custom-validity]
|
|
249
|
+
):required:#{$user}#{$key}
|
|
250
|
+
) {
|
|
251
|
+
@content;
|
|
252
|
+
}
|
|
253
|
+
/* stylelint-disable-next-line at-rule-empty-line-before */
|
|
254
|
+
} @else {
|
|
255
|
+
#{get-validations($selector,$key)} {
|
|
256
|
+
@content;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// If data-custom-validity is set we overwrite the selectors above
|
|
261
|
+
&:has(#{$selector}[data-custom-validity="#{$key}"]) {
|
|
262
|
+
@content;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@mixin set-required-label($selector) {
|
|
267
|
+
&:has(#{$selector}:required) {
|
|
268
|
+
&:is(label),
|
|
269
|
+
label {
|
|
270
|
+
&::after {
|
|
271
|
+
@include icons.icon-content("*");
|
|
272
|
+
|
|
273
|
+
// We're using 1px instead of a token here on purpose, as this is an edge case
|
|
274
|
+
/* stylelint-disable-next-line db-ux/use-spacings */
|
|
275
|
+
padding-inline-start: 1px;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@mixin set-default-form-component($selector) {
|
|
282
|
+
--db-form-has-before: 0;
|
|
283
|
+
|
|
284
|
+
@extend %db-overwrite-font-size-sm;
|
|
285
|
+
@extend %helper-message;
|
|
286
|
+
|
|
287
|
+
@include set-floating-label-overwrites($selector);
|
|
288
|
+
@include set-required-label($selector);
|
|
289
|
+
|
|
290
|
+
// we use absolute icons
|
|
291
|
+
position: relative;
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
|
|
295
|
+
@include get-validity($selector) {
|
|
296
|
+
@include get-validity-color($selector, "valid");
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@include get-validity($selector, "invalid") {
|
|
300
|
+
@include get-validity-color($selector, "invalid");
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#{$selector} {
|
|
304
|
+
@extend %db-overwrite-font-size-md;
|
|
305
|
+
@extend %default-interactive-component;
|
|
306
|
+
@extend %form-component-border;
|
|
307
|
+
|
|
308
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-semi-default;
|
|
309
|
+
caret-color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
|
|
310
|
+
appearance: none;
|
|
311
|
+
max-inline-size: 100%;
|
|
312
|
+
inline-size: 100%;
|
|
313
|
+
|
|
314
|
+
/* stylelint-disable-next-line db-ux/use-spacings */
|
|
315
|
+
padding-inline: var(
|
|
316
|
+
--db-form-component-padding-inline-start,
|
|
317
|
+
#{variables.$db-spacing-fixed-sm}
|
|
318
|
+
)
|
|
319
|
+
var(
|
|
320
|
+
--db-form-component-padding-inline-end,
|
|
321
|
+
#{variables.$db-spacing-fixed-sm}
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
@include placeholder-content() {
|
|
325
|
+
opacity: component.$placeholder-disabled;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@include helpers.hover {
|
|
329
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
&:is(input, textarea):not(:disabled):read-only {
|
|
333
|
+
background-color: var(
|
|
334
|
+
--db-textarea-read-only,
|
|
335
|
+
#{colors.$db-adaptive-bg-basic-level-1-default}
|
|
336
|
+
) !important;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// label
|
|
341
|
+
label {
|
|
342
|
+
@extend %db-overwrite-font-size-xs;
|
|
343
|
+
|
|
344
|
+
padding-block-end: variables.$db-spacing-fixed-xs;
|
|
345
|
+
max-inline-size: 25ch;
|
|
346
|
+
text-overflow: ellipsis;
|
|
347
|
+
white-space: nowrap;
|
|
348
|
+
overflow: hidden;
|
|
349
|
+
|
|
350
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
351
|
+
transition: font-size variables.$db-transition-straight-emotional;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
&[data-hide-label="true"] {
|
|
356
|
+
label {
|
|
357
|
+
@extend %a11y-visually-hidden;
|
|
358
|
+
|
|
359
|
+
padding: 0;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// disabled
|
|
364
|
+
&:has(#{$selector}:disabled) {
|
|
365
|
+
// Decided against cursor: not-allowed, compare to e.g. https://phabricator.wikimedia.org/T121960
|
|
366
|
+
opacity: component.$default-disabled;
|
|
367
|
+
pointer-events: none;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// icons
|
|
371
|
+
&::after,
|
|
372
|
+
&::before {
|
|
373
|
+
position: absolute;
|
|
374
|
+
pointer-events: none;
|
|
375
|
+
// 1px for border
|
|
376
|
+
inset-block-start: calc(
|
|
377
|
+
#{variables.$db-sizing-md} / 2 - #{variables.$db-spacing-fixed-xs} *
|
|
378
|
+
var(--db-label-visible-spacing, 0) + #{$label-size-height-xs} *
|
|
379
|
+
var(--db-label-visible-height, 1) - 1px
|
|
380
|
+
);
|
|
381
|
+
color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
&::before {
|
|
385
|
+
margin-inline-end: variables.$db-spacing-fixed-sm;
|
|
386
|
+
inset-inline-start: variables.$db-spacing-fixed-sm;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
&::after {
|
|
390
|
+
margin-inline-start: variables.$db-spacing-fixed-sm;
|
|
391
|
+
inset-inline-end: variables.$db-spacing-fixed-sm;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
@if ($selector == input or $selector == select) {
|
|
395
|
+
#{$selector} {
|
|
396
|
+
block-size: variables.$db-sizing-md;
|
|
397
|
+
text-overflow: ellipsis;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// CHECKBOX & RADIO
|
|
403
|
+
|
|
404
|
+
@mixin get-validity-color-check($key: "valid") {
|
|
405
|
+
$variant: successful;
|
|
406
|
+
|
|
407
|
+
@if ($key != "valid") {
|
|
408
|
+
$variant: critical;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
@include get-validity-message($key);
|
|
412
|
+
|
|
413
|
+
input {
|
|
414
|
+
--db-adaptive-bg-basic-transparent-semi: var(
|
|
415
|
+
--db-#{$variant}-bg-basic-transparent-semi-default
|
|
416
|
+
);
|
|
417
|
+
--db-adaptive-bg-basic-transparent-hovered: var(
|
|
418
|
+
--db-#{$variant}-bg-basic-transparent-hovered
|
|
419
|
+
);
|
|
420
|
+
--db-adaptive-bg-basic-transparent-pressed: var(
|
|
421
|
+
--db-#{$variant}-bg-basic-transparent-pressed
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
&:not(:checked),
|
|
425
|
+
&:is([type="radio"]) {
|
|
426
|
+
--db-check-element-border-color: var(
|
|
427
|
+
--db-#{$variant}-on-bg-basic-emphasis-70-default
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&:not([type="radio"]):checked {
|
|
432
|
+
@include colors.set-current-colors(
|
|
433
|
+
colors.$db-successful-bg-inverted-contrast-high-default,
|
|
434
|
+
colors.$db-successful-on-bg-inverted-default,
|
|
435
|
+
colors.$db-successful-bg-inverted-contrast-high-hovered,
|
|
436
|
+
colors.$db-successful-bg-inverted-contrast-high-pressed
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
&:is(label),
|
|
442
|
+
label {
|
|
443
|
+
color: var(--db-#{$variant}-on-bg-basic-emphasis-80-default);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
@mixin set-default-check-element($selector) {
|
|
448
|
+
@extend %db-overwrite-font-size-md;
|
|
449
|
+
|
|
450
|
+
@include set-required-label(input);
|
|
451
|
+
|
|
452
|
+
@include get-validity($selector) {
|
|
453
|
+
@include get-validity-color-check("valid");
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
@include get-validity($selector, "invalid") {
|
|
457
|
+
@include get-validity-color-check("invalid");
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&:has(input:disabled) {
|
|
461
|
+
opacity: component.$default-disabled;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
&:is(label),
|
|
465
|
+
label {
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: flex-start;
|
|
468
|
+
position: relative;
|
|
469
|
+
gap: variables.$db-spacing-fixed-xs;
|
|
470
|
+
|
|
471
|
+
&:not(:has(input:disabled)) {
|
|
472
|
+
@include helpers.hover;
|
|
473
|
+
@include helpers.active;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
input {
|
|
478
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
|
|
479
|
+
place-content: center center;
|
|
480
|
+
appearance: none;
|
|
481
|
+
aspect-ratio: 1;
|
|
482
|
+
/* stylelint-disable-next-line db-ux/use-border-height */
|
|
483
|
+
border: #{$check-border-size} solid
|
|
484
|
+
var(
|
|
485
|
+
--db-check-element-border-color,
|
|
486
|
+
#{colors.$db-adaptive-on-bg-basic-emphasis-100-default}
|
|
487
|
+
);
|
|
488
|
+
block-size: $font-size-height;
|
|
489
|
+
inline-size: $font-size-height;
|
|
490
|
+
padding: 0;
|
|
491
|
+
|
|
492
|
+
@include helpers.hover {
|
|
493
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
@include helpers.active {
|
|
497
|
+
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
&[data-size="small"] {
|
|
502
|
+
@extend %db-overwrite-font-size-sm;
|
|
503
|
+
|
|
504
|
+
input {
|
|
505
|
+
margin-inline-end: variables.$db-spacing-fixed-2xs;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
&[data-hide-label="true"] {
|
|
510
|
+
font-size: 0;
|
|
511
|
+
|
|
512
|
+
input {
|
|
513
|
+
margin-inline-end: 0;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use "@db-ux/core-foundations/build/styles/variables";
|
|
2
|
+
@use "@db-ux/core-foundations/build/styles/icons";
|
|
3
|
+
|
|
4
|
+
@mixin icon-passing($inline-start: variables.$db-spacing-fixed-sm) {
|
|
5
|
+
&[data-icon]:not([data-hide-icon="true"]) {
|
|
6
|
+
&::before {
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset-block-start: calc(50% - 0.5em);
|
|
9
|
+
inset-inline-start: $inline-start;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
a,
|
|
15
|
+
button,
|
|
16
|
+
label {
|
|
17
|
+
--db-padding-inline-start: calc(
|
|
18
|
+
#{$inline-start} + #{icons.$default-icon-margin-end} +
|
|
19
|
+
var(--db-base-font-size) * var(--db-base-line-height)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/* stylelint-disable-next-line db-ux/use-spacings */
|
|
23
|
+
padding-inline-start: var(--db-padding-inline-start);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use "@db-ux/core-foundations/build/styles/variables";
|
|
2
|
+
@use "@db-ux/core-foundations/build/styles/helpers";
|
|
3
|
+
@use "@db-ux/core-foundations/build/styles/colors";
|
|
4
|
+
@use "@db-ux/core-foundations/build/styles/animation";
|
|
5
|
+
@use "./component";
|
|
6
|
+
|
|
7
|
+
%db-link-height {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
block-size: variables.$db-sizing-sm;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
%db-link-default-color {
|
|
13
|
+
color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
|
|
14
|
+
|
|
15
|
+
@include helpers.hover {
|
|
16
|
+
color: color-mix(
|
|
17
|
+
in srgb,
|
|
18
|
+
transparent 25%,
|
|
19
|
+
#{colors.$db-adaptive-on-bg-basic-emphasis-100-default}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@include helpers.active {
|
|
24
|
+
color: color-mix(
|
|
25
|
+
in srgb,
|
|
26
|
+
transparent 50%,
|
|
27
|
+
#{colors.$db-adaptive-on-bg-basic-emphasis-100-default}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
%db-default-link {
|
|
33
|
+
@extend %default-fg-transition;
|
|
34
|
+
@extend %db-link-height;
|
|
35
|
+
@extend %db-link-default-color;
|
|
36
|
+
|
|
37
|
+
inline-size: fit-content;
|
|
38
|
+
|
|
39
|
+
// Link underline
|
|
40
|
+
// TODO: We should evaluate whether we could move this declaration to the @font-face declarations even already
|
|
41
|
+
text-underline-position: from-font;
|
|
42
|
+
text-decoration-thickness: helpers.px-to-rem($pxValue: 1);
|
|
43
|
+
text-decoration-line: underline;
|
|
44
|
+
|
|
45
|
+
&:not([data-variant="inline"]) {
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&[data-variant="inline"] {
|
|
50
|
+
display: inline;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:focus-visible {
|
|
54
|
+
border-radius: variables.$db-border-radius-xs;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// "disabled" links
|
|
58
|
+
&[aria-disabled="true"] {
|
|
59
|
+
opacity: component.$default-disabled;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
}
|