@db-ux/core-components 4.0.4 → 4.2.0

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 (34) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/assets/fonts/OpenSans-Bold-EU.woff2 +0 -0
  3. package/build/assets/fonts/OpenSans-ExtraBold-EU.woff2 +0 -0
  4. package/build/assets/fonts/OpenSans-Light-EU.woff2 +0 -0
  5. package/build/assets/fonts/OpenSans-Medium-EU.woff2 +0 -0
  6. package/build/assets/fonts/OpenSans-Regular-EU.woff2 +0 -0
  7. package/build/assets/fonts/OpenSans-SemiBold-EU.woff2 +0 -0
  8. package/build/assets/fonts/generate-eu-fonts.ts +1 -1
  9. package/build/assets/fonts/unicode-eu.txt +1 -0
  10. package/build/components/badge/badge.css +2 -1
  11. package/build/components/button/button.css +10 -5
  12. package/build/components/button/button.scss +10 -5
  13. package/build/components/custom-select/custom-select.css +47 -4
  14. package/build/components/custom-select/custom-select.scss +4 -0
  15. package/build/components/input/input.css +46 -5
  16. package/build/components/notification/notification-grid-default.scss +50 -0
  17. package/build/components/notification/notification-grid-non-overlay.scss +71 -57
  18. package/build/components/notification/notification-grid-overlay.scss +153 -52
  19. package/build/components/notification/notification-grid-shared.css +1 -0
  20. package/build/components/notification/notification-grid-shared.scss +80 -0
  21. package/build/components/notification/notification.css +165 -67
  22. package/build/components/notification/notification.scss +54 -66
  23. package/build/components/select/select.css +44 -4
  24. package/build/components/tag/tag.css +2 -1
  25. package/build/components/textarea/textarea.css +44 -4
  26. package/build/styles/absolute.css +6 -6
  27. package/build/styles/index.css +6 -6
  28. package/build/styles/internal/_button-components.scss +2 -1
  29. package/build/styles/internal/_form-components.scss +14 -1
  30. package/build/styles/relative.css +6 -6
  31. package/build/styles/rollup.css +6 -6
  32. package/build/styles/webpack.css +6 -6
  33. package/package.json +5 -5
  34. package/build/assets/icons/check-circle.svg +0 -1
@@ -11,8 +11,8 @@
11
11
  @use "./notification-grid-overlay";
12
12
  @use "./notification-grid-non-overlay";
13
13
 
14
- %ugly-line-height-workarounds {
15
- // resets line-height to smaller height based on timestamp
14
+ %timestamp-line-height-adjustments {
15
+ // Adjusts line-height for elements when timestamp is present
16
16
  &:has(span) {
17
17
  header,
18
18
  p,
@@ -27,7 +27,7 @@
27
27
  .db-notification {
28
28
  @extend %component-border;
29
29
  @extend %grid-layout-default;
30
- @extend %ugly-line-height-workarounds;
30
+ @extend %timestamp-line-height-adjustments;
31
31
  @include helpers.display(grid);
32
32
 
33
33
  padding: variables.$db-spacing-fixed-md;
@@ -42,9 +42,6 @@
42
42
  a {
43
43
  @extend %db-default-link;
44
44
 
45
- grid-area: link;
46
- white-space: nowrap;
47
-
48
45
  // Overwrite settings for db-link ALWAYS
49
46
  &::before,
50
47
  &::after {
@@ -92,12 +89,15 @@
92
89
  margin: 0;
93
90
  }
94
91
 
92
+ // Image styling and grid positioning
95
93
  img {
96
94
  min-block-size: variables.$db-sizing-md;
97
95
  min-inline-size: variables.$db-sizing-md;
98
96
  max-block-size: variables.$db-sizing-md;
99
97
  max-inline-size: variables.$db-sizing-md;
100
98
  border-radius: variables.$db-border-radius-xs;
99
+ object-fit: cover;
100
+ grid-area: icon;
101
101
  }
102
102
 
103
103
  // timestamp
@@ -106,22 +106,47 @@
106
106
 
107
107
  grid-area: timestamp;
108
108
  white-space: nowrap;
109
+ justify-self: end;
109
110
  }
110
111
 
111
112
  .db-button {
112
113
  grid-area: close;
113
114
  }
114
115
 
115
- &:has(img) {
116
- // we don't show a icon if we have an image
117
- ::before {
118
- content: none !important;
116
+ // Inline links stay within content flow
117
+ &[data-link-variant="inline"] a {
118
+ // 1. Assign the link to the "timestamp" area.
119
+ // All layouts (overlay and default) must recognize this area.
120
+ grid-area: timestamp;
121
+ white-space: nowrap;
122
+
123
+ // 2. Align the link at the end (right) of its grid cell
124
+ justify-self: end;
125
+
126
+ // 3. Inline links should use 'md' size (like <p>),
127
+ // not 'sm' (like <span>)
128
+ @extend %db-overwrite-font-size-md;
129
+ }
130
+
131
+ // If an inline link is present, it takes precedence over the timestamp
132
+ // Note: :has() pseudo-class has limited browser support (Firefox < 121)
133
+ // Progressive enhancement - timestamps gracefully shown in older browsers
134
+ &[data-link-variant="inline"]:has(a) {
135
+ > span {
136
+ display: none;
119
137
  }
120
138
  }
121
139
 
140
+ // Block links get placed in grid area (default behavior)
141
+ // This applies when linkVariant is "block" or not specified
142
+ &:not([data-link-variant="inline"]) a {
143
+ grid-area: link;
144
+ white-space: nowrap;
145
+ }
146
+
147
+ // Icon grid positioning
122
148
  &[data-icon]::before,
123
- &::before,
124
- img {
149
+ &::before {
125
150
  --db-icon-margin-end: 0;
126
151
 
127
152
  @include icons.to-filled-icon;
@@ -129,60 +154,18 @@
129
154
  grid-area: icon;
130
155
  }
131
156
 
132
- // has link inline or overlay
133
- &:has(a) {
134
- &[data-link-variant="inline"],
135
- &[data-variant="overlay"] {
136
- // 1. only content (min. requirement)
137
- grid-template-areas: "content link";
138
- grid-template-columns: 1fr min-content;
139
-
140
- &:has(.db-button) {
141
- grid-template-columns: 1fr min-content min-content;
142
- grid-template-areas: "content link close";
143
- }
144
-
145
- // 2. headline
146
- &:has(header) {
147
- grid-template-columns: 1fr min-content;
148
- grid-template-areas:
149
- "head link"
150
- "content content";
151
-
152
- &:has(.db-button) {
153
- grid-template-columns: 1fr min-content min-content;
154
- grid-template-areas:
155
- "head link close"
156
- "content content content";
157
- }
158
- }
157
+ // If showIcon is explicitly set to false, hide the generated icon
158
+ // pseudo-element.
159
+ &[data-show-icon="false"]::before {
160
+ /* Hidden when showIcon is explicitly false. Using `display:none`
161
+ is sufficient; avoid extra properties that don't affect layout. */
162
+ display: none;
163
+ }
159
164
 
160
- // 3. icon or img
161
- &[data-icon],
162
- &[data-semantic]:not([data-semantic="adaptive"]),
163
- &:has(img) {
164
- grid-template-areas: "icon content link";
165
- grid-template-columns: min-content 1fr min-content;
166
-
167
- &:has(.db-button) {
168
- grid-template-columns: min-content 1fr min-content min-content;
169
- grid-template-areas: "icon content link close";
170
- }
171
-
172
- &:has(header) {
173
- grid-template-columns: min-content 1fr min-content;
174
- grid-template-areas:
175
- "icon head link"
176
- "icon content content";
177
-
178
- &:has(.db-button) {
179
- grid-template-columns: min-content 1fr min-content min-content;
180
- grid-template-areas:
181
- "icon head link close"
182
- "icon content content content";
183
- }
184
- }
185
- }
165
+ &:has(img) {
166
+ // Hide icon when image is present to avoid conflicts
167
+ &::before {
168
+ content: none !important;
186
169
  }
187
170
  }
188
171
 
@@ -192,8 +175,13 @@
192
175
  box-shadow: variables.$db-elevation-md;
193
176
  }
194
177
 
178
+ // Apply non-overlay grid layout for notifications with block links
179
+ // This applies when linkVariant is "block" (explicit or default when links are present)
195
180
  &:not([data-variant="overlay"]) {
196
- @extend %grid-layout-variant-not-overlay;
181
+ &[data-link-variant="block"],
182
+ &:not([data-link-variant]):has(a) {
183
+ @extend %grid-layout-variant-not-overlay;
184
+ }
197
185
  }
198
186
 
199
187
  &[data-variant="overlay"],
@@ -668,7 +668,17 @@ input[type=radio]:checked) > label {
668
668
  [type=datetime-local],
669
669
  [type=month],
670
670
  [type=week],
671
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
671
+ [type=time]):not(:user-valid,
672
+ [value*="1"],
673
+ [value*="2"],
674
+ [value*="3"],
675
+ [value*="4"],
676
+ [value*="5"],
677
+ [value*="6"],
678
+ [value*="7"],
679
+ [value*="8"],
680
+ [value*="9"],
681
+ [value*="0"])::-webkit-datetime-edit {
672
682
  transition: none;
673
683
  opacity: 0;
674
684
  }
@@ -723,7 +733,17 @@ input[type=radio]:checked) select:is([type=date],
723
733
  [type=datetime-local],
724
734
  [type=month],
725
735
  [type=week],
726
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
736
+ [type=time]):not(:user-valid,
737
+ [value*="1"],
738
+ [value*="2"],
739
+ [value*="3"],
740
+ [value*="4"],
741
+ [value*="5"],
742
+ [value*="6"],
743
+ [value*="7"],
744
+ [value*="8"],
745
+ [value*="9"],
746
+ [value*="0"])::-webkit-datetime-edit {
727
747
  opacity: var(--db-opacity-xl);
728
748
  font-family: var(--db-font-family-sans);
729
749
  font-style: italic;
@@ -739,7 +759,17 @@ input[type=radio]:checked) select:is([type=date],
739
759
  [type=datetime-local],
740
760
  [type=month],
741
761
  [type=week],
742
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
762
+ [type=time]):not(:user-valid,
763
+ [value*="1"],
764
+ [value*="2"],
765
+ [value*="3"],
766
+ [value*="4"],
767
+ [value*="5"],
768
+ [value*="6"],
769
+ [value*="7"],
770
+ [value*="8"],
771
+ [value*="9"],
772
+ [value*="0"])::-webkit-datetime-edit {
743
773
  transition: opacity var(--db-transition-straight-emotional);
744
774
  }
745
775
  }
@@ -859,7 +889,17 @@ input[type=radio]:checked) select:is([type=date],
859
889
  [type=datetime-local],
860
890
  [type=month],
861
891
  [type=week],
862
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
892
+ [type=time]):not(:user-valid,
893
+ [value*="1"],
894
+ [value*="2"],
895
+ [value*="3"],
896
+ [value*="4"],
897
+ [value*="5"],
898
+ [value*="6"],
899
+ [value*="7"],
900
+ [value*="8"],
901
+ [value*="9"],
902
+ [value*="0"])::-webkit-datetime-edit {
863
903
  opacity: var(--db-opacity-xl);
864
904
  font-family: var(--db-font-family-sans);
865
905
  font-style: italic;
@@ -1009,7 +1009,8 @@ paddings/gaps in an application e.g. the <main> should have a responsive padding
1009
1009
 
1010
1010
  .db-tag {
1011
1011
  font-weight: 700;
1012
- white-space: nowrap;
1012
+ overflow-wrap: break-word;
1013
+ white-space: pre-line;
1013
1014
  justify-content: center;
1014
1015
  text-align: center;
1015
1016
  align-items: center;
@@ -434,7 +434,17 @@ input[type=radio]:checked) > label {
434
434
  [type=datetime-local],
435
435
  [type=month],
436
436
  [type=week],
437
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
437
+ [type=time]):not(:user-valid,
438
+ [value*="1"],
439
+ [value*="2"],
440
+ [value*="3"],
441
+ [value*="4"],
442
+ [value*="5"],
443
+ [value*="6"],
444
+ [value*="7"],
445
+ [value*="8"],
446
+ [value*="9"],
447
+ [value*="0"])::-webkit-datetime-edit {
438
448
  transition: none;
439
449
  opacity: 0;
440
450
  }
@@ -487,7 +497,17 @@ input[type=radio]:checked) textarea:is([type=date],
487
497
  [type=datetime-local],
488
498
  [type=month],
489
499
  [type=week],
490
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
500
+ [type=time]):not(:user-valid,
501
+ [value*="1"],
502
+ [value*="2"],
503
+ [value*="3"],
504
+ [value*="4"],
505
+ [value*="5"],
506
+ [value*="6"],
507
+ [value*="7"],
508
+ [value*="8"],
509
+ [value*="9"],
510
+ [value*="0"])::-webkit-datetime-edit {
491
511
  opacity: var(--db-opacity-xl);
492
512
  font-family: var(--db-font-family-sans);
493
513
  font-style: italic;
@@ -501,7 +521,17 @@ input[type=radio]:checked) textarea:is([type=date],
501
521
  [type=datetime-local],
502
522
  [type=month],
503
523
  [type=week],
504
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
524
+ [type=time]):not(:user-valid,
525
+ [value*="1"],
526
+ [value*="2"],
527
+ [value*="3"],
528
+ [value*="4"],
529
+ [value*="5"],
530
+ [value*="6"],
531
+ [value*="7"],
532
+ [value*="8"],
533
+ [value*="9"],
534
+ [value*="0"])::-webkit-datetime-edit {
505
535
  transition: opacity var(--db-transition-straight-emotional);
506
536
  }
507
537
  }
@@ -747,7 +777,17 @@ input[type=radio]:checked) textarea:is([type=date],
747
777
  [type=datetime-local],
748
778
  [type=month],
749
779
  [type=week],
750
- [type=time]):not(:user-valid)::-webkit-datetime-edit {
780
+ [type=time]):not(:user-valid,
781
+ [value*="1"],
782
+ [value*="2"],
783
+ [value*="3"],
784
+ [value*="4"],
785
+ [value*="5"],
786
+ [value*="6"],
787
+ [value*="7"],
788
+ [value*="8"],
789
+ [value*="9"],
790
+ [value*="0"])::-webkit-datetime-edit {
751
791
  opacity: var(--db-opacity-xl);
752
792
  font-family: var(--db-font-family-sans);
753
793
  font-style: italic;