@sbb-esta/lyne-elements-dev 4.7.0-dev.1773208987 → 4.7.0-dev.1773217409

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.
@@ -107,9 +107,18 @@ $theme: 'standard' !default;
107
107
  @use '../../footer/footer.global' as footer with (
108
108
  $theme: $theme
109
109
  );
110
+ @use '../../form-field/error/error.global' as error with (
111
+ $theme: $theme
112
+ );
113
+ @use '../../form-field/form-field/form-field.global' as form-field with (
114
+ $theme: $theme
115
+ );
110
116
  @use '../../icon-sidebar/icon-sidebar/icon-sidebar.global' as icon-sidebar with (
111
117
  $theme: $theme
112
118
  );
119
+ @use '../../lead-container/lead-container.global' as lead-container with (
120
+ $theme: $theme
121
+ );
113
122
  @use '../../option/option/option.global' as option with (
114
123
  $theme: $theme
115
124
  );
@@ -176,13 +185,16 @@ $theme: 'standard' !default;
176
185
  @include dialog.base;
177
186
  @include dialog-close-button.base;
178
187
  @include divider.base;
188
+ @include error.base;
179
189
  @include expansion-panel.base;
180
190
  @include expansion-panel-content.base;
181
191
  @include expansion-panel-header.base;
182
192
  @include flip-card.base;
183
193
  @include flip-card-details.base;
184
194
  @include footer.base;
195
+ @include form-field.base;
185
196
  @include icon-sidebar.base;
197
+ @include lead-container.base;
186
198
  @include option.base;
187
199
  @include option-hint.base;
188
200
  @include optgroup.base;
@@ -203,6 +215,7 @@ $theme: 'standard' !default;
203
215
  @include card.base-forced-colors;
204
216
  @include card-badge.base-forced-colors;
205
217
  @include expansion-panel-header.base-forced-colors;
218
+ @include form-field.base-forced-colors;
206
219
  @include visual-checkbox.base-forced-colors;
207
220
  @include radio-button-common.base-forced-colors;
208
221
  }
@@ -281,6 +294,7 @@ $theme: 'standard' !default;
281
294
  @include chip-group.base-breakpoint-large;
282
295
  @include dialog.base-breakpoint-large;
283
296
  @include flip-card.base-breakpoint-large;
297
+ @include form-field.base-breakpoint-large;
284
298
 
285
299
  // TODO: Remove complete block when new lean theme is complete
286
300
  // Only render the block in standard theme as fallback for CSS class usage
@@ -303,6 +317,8 @@ $theme: 'standard' !default;
303
317
 
304
318
  @include mediaqueries.mq($from: ultra) {
305
319
  @include sbb-css-tokens.breakpoint-ultra;
320
+
321
+ @include lead-container.base-breakpoint-ultra;
306
322
  }
307
323
  }
308
324
 
@@ -315,7 +331,9 @@ $theme: 'standard' !default;
315
331
  @include dialog-content.rules;
316
332
  @include dialog-title.rules;
317
333
  @include flip-card-summary.rules;
334
+ @include form-field.rules;
318
335
  @include icon-sidebar.rules;
336
+ @include lead-container.rules;
319
337
  @include option.rules;
320
338
  @include tab-nav-bar.rules;
321
339
 
@@ -345,122 +363,6 @@ html {
345
363
  @include typo.placeholder;
346
364
  }
347
365
 
348
- :is(sbb-form-field, sbb-timetable-form-field) {
349
- :where(input, select, textarea, sbb-select, sbb-date-input, sbb-time-input) {
350
- @include typo.text-m--regular;
351
- @include helpers.ellipsis;
352
- @include inputs.input-reset;
353
-
354
- // Use !important here to not interfere with Firefox focus ring definition
355
- // which appears in normalize CSS of several frameworks.
356
- outline: none !important;
357
- overflow: var(--sbb-form-field-overflow);
358
- width: 100%;
359
- box-sizing: border-box;
360
- color: var(--sbb-form-field-text-color);
361
-
362
- // Fill color needed for Safari
363
- -webkit-text-fill-color: var(--sbb-form-field-text-color);
364
- opacity: 1;
365
- background-color: transparent;
366
-
367
- // To be more specific than the styles in normalize.scss we need to use !important
368
- // TODO: Find a better solution
369
- font-size: var(--sbb-form-field-input-text-size) !important;
370
- font-family: var(--sbb-typo-font-family) !important;
371
- line-height: var(--sbb-typo-line-height-text) !important;
372
-
373
- &::placeholder {
374
- @include typo.placeholder;
375
- }
376
- }
377
-
378
- &[floating-label] :where(input, select, textarea, sbb-select)::placeholder,
379
- // This covers the placeholder of the sbb-date-input and sbb-time-input
380
- &[floating-label] :where(sbb-date-input, sbb-time-input)::after {
381
- color: transparent !important;
382
- -webkit-text-fill-color: transparent !important;
383
-
384
- @include a11y.if-forced-colors {
385
- color: Canvas !important;
386
- -webkit-text-fill-color: Canvas !important;
387
- }
388
- }
389
-
390
- // TODO: Remove if webkit bug is resolved: https://bugs.webkit.org/show_bug.cgi?id=223814
391
- &:not([floating-label]) :where(input, select, textarea, sbb-select):disabled::placeholder {
392
- color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
393
- -webkit-text-fill-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
394
- }
395
-
396
- // Fix positioning issue for select which occurs in Safari
397
- :where(select) {
398
- vertical-align: middle;
399
- }
400
-
401
- :where(select, sbb-select) {
402
- padding-inline-end: var(--sbb-form-field-select-inline-padding-end);
403
- }
404
-
405
- &[size='s'] :where(input, sbb-date-input, sbb-time-input) {
406
- // We shrink the input's height to support all types of inputs (especially type=number).
407
- // Factor 1.25 ensures, letters are not cut.
408
- height: calc(var(--sbb-form-field-input-text-size) * 1.25);
409
-
410
- // Avoids Safari bug, where text gets misaligned with type=number
411
- line-height: 1 !important;
412
-
413
- // We add the missing block spacing to fit the line-height
414
- margin-block: calc(
415
- 0.5 * (var(--sbb-form-field-input-text-size) * (var(--sbb-typo-line-height-text) - 1.25))
416
- );
417
- }
418
-
419
- :where(textarea) {
420
- @include scrollbar.scrollbar;
421
-
422
- position: relative;
423
- resize: none;
424
-
425
- // White-space break needed for Firefox
426
- white-space: break-spaces;
427
- overflow-y: auto;
428
- min-height: calc((var(--sbb-typo-line-height-text) * 1em));
429
- height: 100%;
430
- }
431
-
432
- &[size='l'] :where(textarea) {
433
- padding-block-end: #{functions.px-to-rem-build(5.5)};
434
- }
435
-
436
- &[negative] :where(textarea) {
437
- @include scrollbar.scrollbar($negative: true);
438
- }
439
-
440
- &:has(
441
- :is(
442
- :is(input, textarea, select):user-invalid,
443
- :state(interacted):invalid,
444
- .ng-touched.ng-invalid,
445
- .sbb-invalid
446
- )
447
- ),
448
- :is(.ng-submitted, .sbb-show-errors) &:has(:is(:invalid, .ng-invalid)) {
449
- --sbb-form-field-border-color: var(--sbb-color-error);
450
- --sbb-form-field-text-color: var(--sbb-color-error);
451
-
452
- &[negative] {
453
- --sbb-form-field-border-color: var(--sbb-color-red85);
454
- --sbb-form-field-text-color: var(--sbb-color-red85);
455
- }
456
-
457
- @include a11y.if-forced-colors {
458
- --sbb-form-field-border-color: LinkText !important;
459
- --sbb-form-field-text-color: LinkText !important;
460
- }
461
- }
462
- }
463
-
464
366
  // Hiding components until they are instantiated
465
367
  :is(
466
368
  sbb-autocomplete,
@@ -530,17 +432,6 @@ img {
530
432
  object-position: var(--sbb-image-object-position);
531
433
  }
532
434
 
533
- // TODO: Move back to the sbb-lead-container components when the global CSS refactoring happens
534
- sbb-lead-container {
535
- > [slot='image']:is(sbb-image, img, picture),
536
- > [slot='image'] :is(sbb-image, img, picture):not(.sbb-figure-overlap-image) {
537
- --sbb-image-aspect-ratio: var(--sbb-lead-container-image-ratio);
538
- --sbb-image-object-fit: cover;
539
-
540
- border-radius: var(--sbb-lead-container-image-border-radius);
541
- }
542
- }
543
-
544
435
  // TODO: Move back to the sbb-message components when the global CSS refactoring happens
545
436
  sbb-message {
546
437
  > [slot='image']:is(sbb-image, img),
package/core.css CHANGED
@@ -1436,6 +1436,9 @@
1436
1436
  --sbb-divider-color: var(--sbb-background-color-4);
1437
1437
  --sbb-divider-color-negative: var(--sbb-background-color-4-negative);
1438
1438
  --sbb-divider-border-width: var(--sbb-border-width-1x);
1439
+ --sbb-error-color: var(--sbb-color-error);
1440
+ --sbb-error-icon-size: 1.0625rem;
1441
+ --sbb-error-font-size: var(--sbb-text-font-size-xs);
1439
1442
  --sbb-expansion-panel-background-color: var(--sbb-background-color-1);
1440
1443
  --sbb-expansion-panel-background-color-hover: var(--sbb-background-color-3);
1441
1444
  --sbb-expansion-panel-border-radius: var(--sbb-border-radius-4x);
@@ -1476,8 +1479,37 @@
1476
1479
  --sbb-footer-gap-horizontal: var(--sbb-grid-base-gutter-responsive);
1477
1480
  --sbb-footer-gap-vertical: var(--sbb-spacing-responsive-l);
1478
1481
  --sbb-footer-padding-block: var(--sbb-spacing-responsive-l);
1482
+ --sbb-form-field-background-color: var(--sbb-background-color-1);
1483
+ --sbb-form-field-border-color: var(--sbb-border-color-5);
1484
+ --sbb-form-field-border-style: solid;
1485
+ --sbb-form-field-border-radius: var(--sbb-border-radius-4x);
1486
+ --sbb-form-field-border-width: var(--sbb-border-width-1x);
1487
+ --sbb-form-field-color: var(--sbb-color-3);
1488
+ --sbb-form-field-label-color: var(--sbb-color-metal);
1489
+ --sbb-form-field-label-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
1490
+ --sbb-form-field-prefix-color: var(--sbb-color-metal);
1491
+ --sbb-form-field-prefix-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
1492
+ --sbb-form-field-text-color: var(--sbb-color-3);
1493
+ --sbb-form-field-arrow-color: var(--sbb-color-3);
1494
+ --sbb-form-field-gap: var(--sbb-spacing-fixed-2x);
1495
+ --sbb-form-field-icon-size: var(--sbb-size-icon-ui-small);
1496
+ --sbb-form-field-min-height: var(--sbb-size-element-m);
1497
+ --sbb-form-field-padding-inline: var(--sbb-spacing-fixed-3x);
1498
+ --sbb-form-field-input-text-size: var(--sbb-text-font-size-m);
1499
+ --sbb-form-field-label-text-size: var(--sbb-text-font-size-xs);
1500
+ --_sbb-form-field-label-to-input-overlapping: var(--sbb-spacing-fixed-1x);
1501
+ --_sbb-form-field-floating-label-transform: 0.53125rem;
1502
+ --_sbb-form-field-spacer-margin-block-end: calc(-1 * var(--_sbb-form-field-label-to-input-overlapping));
1479
1503
  --sbb-icon-sidebar-background-color: var(--sbb-background-color-1);
1480
1504
  --sbb-icon-sidebar-border-radius: var(--sbb-border-radius-8x);
1505
+ --sbb-lead-container-background-color: var(--sbb-background-color-1);
1506
+ --sbb-lead-container-image-ratio: 2 / 1;
1507
+ --sbb-lead-container-image-overlap: var(--sbb-spacing-fixed-24x);
1508
+ --sbb-lead-container-content-padding-block: var(--sbb-spacing-responsive-l);
1509
+ --sbb-lead-container-padding-block: 0 var(--sbb-spacing-responsive-l);
1510
+ --sbb-lead-container-padding-inline: var(--sbb-layout-base-offset-responsive);
1511
+ --sbb-lead-container-border-radius: var(--sbb-border-radius-6x);
1512
+ --sbb-lead-container-image-border-radius: 0;
1481
1513
  --sbb-option-color: var(--sbb-color-3);
1482
1514
  --sbb-option-background-color: inherit;
1483
1515
  --sbb-option-background-color-hover: var(--sbb-background-color-3);
@@ -1599,6 +1631,7 @@
1599
1631
  --sbb-card-badge-border-display: block;
1600
1632
  --sbb-card-badge-inline-border-display: none;
1601
1633
  --sbb-expansion-panel-header-text-color: ButtonText;
1634
+ --sbb-form-field-border-color: ButtonBorder;
1602
1635
  --sbb-visual-checkbox-selection-color: Canvas;
1603
1636
  --sbb-visual-checkbox-selection-color-negative: Canvas;
1604
1637
  --sbb-visual-checkbox-selection-color-disabled: Canvas;
@@ -1708,6 +1741,9 @@
1708
1741
  --sbb-dialog-padding-inline: var(--sbb-spacing-responsive-s);
1709
1742
  --sbb-dialog-max-height: calc(100vh - var(--sbb-spacing-fixed-16x));
1710
1743
  --sbb-flip-card-min-height: 20rem;
1744
+ --_sbb-form-field-label-to-input-overlapping: var(--sbb-spacing-fixed-1x);
1745
+ --_sbb-form-field-floating-label-transform: 0.65625rem;
1746
+ --_sbb-form-field-spacer-margin-block-end: calc(-1 * var(--_sbb-form-field-label-to-input-overlapping));
1711
1747
  }
1712
1748
  :root.sbb-lean {
1713
1749
  --sbb-title-font-size-level-6-lean: var(--sbb-typo-scale-0-875x);
@@ -1733,6 +1769,8 @@
1733
1769
  --sbb-layout-base-offset-responsive: var(--sbb-layout-base-offset-responsive-ultra);
1734
1770
  --sbb-grid-base-columns: var(--sbb-layout-base-grid-columns-ultra);
1735
1771
  --sbb-grid-base-gutter-responsive: var(--sbb-layout-base-grid-gutter-responsive-ultra);
1772
+ --sbb-lead-container-image-ratio: 21 / 9;
1773
+ --sbb-lead-container-image-border-radius: var(--sbb-lead-container-border-radius);
1736
1774
  }
1737
1775
  }
1738
1776
 
@@ -1800,70 +1838,7 @@ sbb-flip-card-summary > [slot=image] :is(sbb-image, img):not(.sbb-figure-overlap
1800
1838
  height: 100%;
1801
1839
  }
1802
1840
 
1803
- sbb-icon-sidebar-content + sbb-icon-sidebar :is(sbb-icon-sidebar-link, sbb-icon-sidebar-button) {
1804
- --sbb-icon-sidebar-button__current-border-inset-inline-start: auto;
1805
- }
1806
-
1807
- sbb-icon-sidebar-content + sbb-icon-sidebar {
1808
- border-start-end-radius: 0;
1809
- border-start-start-radius: var(--sbb-icon-sidebar-border-radius);
1810
- }
1811
-
1812
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] :where(sbb-option, sbb-autocomplete-grid-option) {
1813
- --sbb-option-min-height: var(--sbb-size-element-xxs);
1814
- --sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
1815
- --sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
1816
- }
1817
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-optgroup {
1818
- --sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
1819
- }
1820
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-option-hint {
1821
- --sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
1822
- }
1823
-
1824
- sbb-tab-nav-bar .sbb-tab-amount {
1825
- margin: 0;
1826
- color: var(--sbb-tab-label-amount-color);
1827
- font-weight: normal;
1828
- text-decoration: var(--sbb-tab-label-text-decoration);
1829
- }
1830
-
1831
- .sbb-dark {
1832
- color-scheme: dark;
1833
- }
1834
-
1835
- .sbb-light {
1836
- color-scheme: light;
1837
- }
1838
-
1839
- .sbb-light-dark {
1840
- color-scheme: light dark;
1841
- }
1842
-
1843
- html {
1844
- font-family: var(--sbb-typo-font-family);
1845
- font-weight: normal;
1846
- line-height: var(--sbb-typo-line-height-text);
1847
- letter-spacing: var(--sbb-typo-letter-spacing-text);
1848
- font-size: var(--sbb-text-font-size);
1849
- color-scheme: light dark;
1850
- color: var(--sbb-font-color-default);
1851
- background-color: var(--sbb-background-color-1);
1852
- }
1853
-
1854
- ::placeholder {
1855
- color: var(--sbb-color-5);
1856
- -webkit-text-fill-color: var(--sbb-color-5);
1857
- opacity: 1;
1858
- }
1859
-
1860
1841
  :is(sbb-form-field, sbb-timetable-form-field) :where(input, select, textarea, sbb-select, sbb-date-input, sbb-time-input) {
1861
- --sbb-text-font-size: var(--sbb-text-font-size-m);
1862
- font-family: var(--sbb-typo-font-family);
1863
- font-weight: normal;
1864
- line-height: var(--sbb-typo-line-height-text);
1865
- letter-spacing: var(--sbb-typo-letter-spacing-text);
1866
- font-size: var(--sbb-text-font-size);
1867
1842
  overflow: hidden;
1868
1843
  white-space: nowrap;
1869
1844
  text-overflow: ellipsis;
@@ -1873,7 +1848,7 @@ html {
1873
1848
  padding: 0;
1874
1849
  appearance: none;
1875
1850
  outline: none !important;
1876
- overflow: var(--sbb-form-field-overflow);
1851
+ overflow: var(--sbb-form-field-overflow, hidden);
1877
1852
  width: 100%;
1878
1853
  box-sizing: border-box;
1879
1854
  color: var(--sbb-form-field-text-color);
@@ -1881,6 +1856,7 @@ html {
1881
1856
  opacity: 1;
1882
1857
  background-color: transparent;
1883
1858
  font-size: var(--sbb-form-field-input-text-size) !important;
1859
+ letter-spacing: var(--sbb-typo-letter-spacing-text) !important;
1884
1860
  font-family: var(--sbb-typo-font-family) !important;
1885
1861
  line-height: var(--sbb-typo-line-height-text) !important;
1886
1862
  }
@@ -2031,6 +2007,70 @@ html {
2031
2007
  }
2032
2008
  }
2033
2009
 
2010
+ sbb-icon-sidebar-content + sbb-icon-sidebar :is(sbb-icon-sidebar-link, sbb-icon-sidebar-button) {
2011
+ --sbb-icon-sidebar-button__current-border-inset-inline-start: auto;
2012
+ }
2013
+
2014
+ sbb-icon-sidebar-content + sbb-icon-sidebar {
2015
+ border-start-end-radius: 0;
2016
+ border-start-start-radius: var(--sbb-icon-sidebar-border-radius);
2017
+ }
2018
+
2019
+ sbb-lead-container > [slot=image]:is(sbb-image, img, picture),
2020
+ sbb-lead-container > [slot=image] :is(sbb-image, img, picture):not(.sbb-figure-overlap-image) {
2021
+ --sbb-image-aspect-ratio: var(--sbb-lead-container-image-ratio);
2022
+ --sbb-image-object-fit: cover;
2023
+ border-radius: var(--sbb-lead-container-image-border-radius);
2024
+ }
2025
+
2026
+ :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] :where(sbb-option, sbb-autocomplete-grid-option) {
2027
+ --sbb-option-min-height: var(--sbb-size-element-xxs);
2028
+ --sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
2029
+ --sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
2030
+ }
2031
+ :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-optgroup {
2032
+ --sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
2033
+ }
2034
+ :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-option-hint {
2035
+ --sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
2036
+ }
2037
+
2038
+ sbb-tab-nav-bar .sbb-tab-amount {
2039
+ margin: 0;
2040
+ color: var(--sbb-tab-label-amount-color);
2041
+ font-weight: normal;
2042
+ text-decoration: var(--sbb-tab-label-text-decoration);
2043
+ }
2044
+
2045
+ .sbb-dark {
2046
+ color-scheme: dark;
2047
+ }
2048
+
2049
+ .sbb-light {
2050
+ color-scheme: light;
2051
+ }
2052
+
2053
+ .sbb-light-dark {
2054
+ color-scheme: light dark;
2055
+ }
2056
+
2057
+ html {
2058
+ font-family: var(--sbb-typo-font-family);
2059
+ font-weight: normal;
2060
+ line-height: var(--sbb-typo-line-height-text);
2061
+ letter-spacing: var(--sbb-typo-letter-spacing-text);
2062
+ font-size: var(--sbb-text-font-size);
2063
+ color-scheme: light dark;
2064
+ color: var(--sbb-font-color-default);
2065
+ background-color: var(--sbb-background-color-1);
2066
+ }
2067
+
2068
+ ::placeholder {
2069
+ color: var(--sbb-color-5);
2070
+ -webkit-text-fill-color: var(--sbb-color-5);
2071
+ opacity: 1;
2072
+ }
2073
+
2034
2074
  :is(sbb-autocomplete,
2035
2075
  sbb-autocomplete-grid,
2036
2076
  sbb-datepicker,
@@ -2099,13 +2139,6 @@ img {
2099
2139
  object-position: var(--sbb-image-object-position);
2100
2140
  }
2101
2141
 
2102
- sbb-lead-container > [slot=image]:is(sbb-image, img, picture),
2103
- sbb-lead-container > [slot=image] :is(sbb-image, img, picture):not(.sbb-figure-overlap-image) {
2104
- --sbb-image-aspect-ratio: var(--sbb-lead-container-image-ratio);
2105
- --sbb-image-object-fit: cover;
2106
- border-radius: var(--sbb-lead-container-image-border-radius);
2107
- }
2108
-
2109
2142
  sbb-message > [slot=image]:is(sbb-image, img),
2110
2143
  sbb-message > [slot=image] :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2111
2144
  border-radius: var(--sbb-message-image-border-radius);