@db-ux/core-components 2.4.0 → 2.4.2

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.
@@ -123,12 +123,12 @@ $db-min-inline-size: var(
123
123
  }
124
124
 
125
125
  &:has(
126
- #{$selector}:focus-within,
127
- #{$selector}:is(input, textarea):not(:placeholder-shown),
128
- > select option:checked:not([hidden]),
129
- input[type="checkbox"]:checked,
130
- input[type="radio"]:checked
131
- ) {
126
+ #{$selector}:focus-within,
127
+ #{$selector}:is(input, textarea):not(:placeholder-shown),
128
+ > select option:checked:not([hidden]),
129
+ input[type="checkbox"]:checked,
130
+ input[type="radio"]:checked
131
+ ) {
132
132
  > label {
133
133
  @extend %db-overwrite-font-size-2xs;
134
134
 
@@ -227,6 +227,7 @@ $input-valid-types:
227
227
  $validations: ":required";
228
228
 
229
229
  @if ($selector == input) {
230
+ /* We use all client side form-validation for input here */
230
231
  // https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#using_built-in_form_validation
231
232
  $validations: ":required, [minlength], [maxlength], [pattern]";
232
233
 
@@ -235,6 +236,7 @@ $input-valid-types:
235
236
  }
236
237
  /* stylelint-disable-next-line at-rule-empty-line-before */
237
238
  } @else if($selector == textarea) {
239
+ /* We use all client side form-validation for textarea here */
238
240
  $validations: ":required, [minlength], [maxlength]";
239
241
  }
240
242
 
@@ -254,10 +256,8 @@ $input-valid-types:
254
256
  $selector: input;
255
257
 
256
258
  &:has(
257
- #{$selector}:not(
258
- [data-custom-validity]
259
- ):required:#{$user}#{$key}
260
- ) {
259
+ #{$selector}:not([data-custom-validity]):required:#{$user}#{$key}
260
+ ) {
261
261
  @content;
262
262
  }
263
263
  /* stylelint-disable-next-line at-rule-empty-line-before */
@@ -279,8 +279,8 @@ $input-valid-types:
279
279
  }
280
280
 
281
281
  @mixin set-required-label($selector) {
282
- &:has(#{$selector}:required):not([data-hide-asterisk="true"]),
283
- &[data-required="true"]:not([data-hide-asterisk="true"]) {
282
+ &:has(#{$selector}:required),
283
+ &[data-required="true"] {
284
284
  &:is(label),
285
285
  > label {
286
286
  &::after {
@@ -315,14 +315,17 @@ $input-valid-types:
315
315
  --db-label-visible-above: 0;
316
316
  }
317
317
 
318
+ &:not([data-hide-asterisk="true"]) {
319
+ @include set-required-label($selector);
320
+ }
321
+
318
322
  @include set-floating-label-overwrites($selector);
319
- @include set-required-label($selector);
320
323
 
321
324
  @include get-validity($selector) {
322
325
  &:has(
323
- > .db-infotext[data-semantic="successful"],
324
- > db-infotext > .db-infotext[data-semantic="successful"]
325
- ) {
326
+ > .db-infotext[data-semantic="successful"],
327
+ > db-infotext > .db-infotext[data-semantic="successful"]
328
+ ) {
326
329
  @include get-validity-color($selector, "valid");
327
330
  }
328
331
  }
@@ -407,10 +410,10 @@ $input-valid-types:
407
410
 
408
411
  // disabled
409
412
  &:has(
410
- #{$selector}:disabled,
411
- #{$selector}[data-disabled="true"],
412
- #{$selector}[aria-disabled="true"]
413
- ) {
413
+ #{$selector}:disabled,
414
+ #{$selector}[data-disabled="true"],
415
+ #{$selector}[aria-disabled="true"]
416
+ ) {
414
417
  // Decided against cursor: not-allowed, compare to e.g. https://phabricator.wikimedia.org/T121960
415
418
  opacity: variables.$db-opacity-md;
416
419
  pointer-events: none;
@@ -492,7 +495,9 @@ $input-valid-types:
492
495
  @mixin set-default-check-element() {
493
496
  @extend %db-overwrite-font-size-md;
494
497
 
495
- @include set-required-label(input);
498
+ &:not([data-hide-asterisk="true"]) {
499
+ @include set-required-label(input);
500
+ }
496
501
 
497
502
  &:has(input:disabled) {
498
503
  opacity: variables.$db-opacity-md;