@odx/ui 3.9.1 → 3.9.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @odx/ui
2
2
 
3
+ ## 3.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 3558490: warning text color for dark theme
8
+
9
+ ## 3.9.2
10
+
11
+ ### Patch Changes
12
+
13
+ - bb425b3: New image-card variant for card component
14
+
3
15
  ## 3.9.1
4
16
 
5
17
  ### Patch Changes
package/core-theme.css CHANGED
@@ -240,6 +240,7 @@
240
240
  --odx-c-danger-text-disabled: var(--red-50);
241
241
  --odx-c-success-text: var(--cyan-50);
242
242
  --odx-c-confirmation-text: var(--cyan-50);
243
+ --odx-c-warning-text: var(--cyan-50);
243
244
  }
244
245
 
245
246
  :root {
@@ -3144,6 +3145,8 @@ html body .odx-fs-italic {
3144
3145
  }
3145
3146
 
3146
3147
  .odx-card {
3148
+ --odx-card-main-padding: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3149
+ --odx-card-gap: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3147
3150
  transition-delay: 0ms;
3148
3151
  transition-duration: var(--odx-v-transition-duration);
3149
3152
  transition-property: box-shadow, outline-color, color;
@@ -3160,7 +3163,7 @@ html body .odx-fs-italic {
3160
3163
  behavior: button;
3161
3164
  border-radius: var(--odx-v-border-radius);
3162
3165
  display: block;
3163
- padding: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3166
+ padding: var(--odx-card-main-padding);
3164
3167
  position: relative;
3165
3168
  }
3166
3169
  .odx-card:focus-visible {
@@ -3170,14 +3173,18 @@ html body .odx-fs-italic {
3170
3173
  outline-color: transparent;
3171
3174
  pointer-events: none;
3172
3175
  }
3176
+ .odx-card--image-card {
3177
+ --odx-card-main-padding: calc(var(--odx-vertical-rythm-base-size) * 1);
3178
+ overflow: clip;
3179
+ }
3173
3180
  .odx-card.is-disabled * {
3174
3181
  color: var(--odx-c-text-disabled);
3175
3182
  }
3176
3183
  .odx-card__container {
3177
3184
  display: flex;
3178
- gap: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3185
+ gap: var(--odx-card-gap);
3179
3186
  }
3180
- .odx-card--default .odx-card__container {
3187
+ .odx-card--default .odx-card__container, .odx-card--image-card .odx-card__container {
3181
3188
  flex-direction: column;
3182
3189
  }
3183
3190
  @media (min-width: 480px) {
@@ -3185,23 +3192,6 @@ html body .odx-fs-italic {
3185
3192
  flex-direction: column;
3186
3193
  }
3187
3194
  }
3188
- .odx-card__content {
3189
- padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.6667);
3190
- }
3191
- .odx-card--default .odx-card__title {
3192
- line-height: calc(var(--odx-vertical-rythm-base-size) * 1.5);
3193
- padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.5);
3194
- font-weight: var(--odx-typography-font-weight-medium);
3195
- letter-spacing: var(--odx-typography-font-weight-medium-letter-spacing);
3196
- }
3197
- .odx-card:focus-visible, .odx-card:focus-within:has(:focus-visible) {
3198
- box-shadow: var(--odx-v-box-shadow-layer-1);
3199
- }
3200
- @media (hover: hover){
3201
- .odx-card:hover {
3202
- box-shadow: var(--odx-v-box-shadow-layer-1);
3203
- }
3204
- }
3205
3195
  .odx-card--launch-tile .odx-card__container, .odx-card--launch-tile-centered .odx-card__container {
3206
3196
  padding-top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3207
3197
  padding-bottom: calc(var(--odx-vertical-rythm-base-size) * 0.5);
@@ -3215,6 +3205,41 @@ html body .odx-fs-italic {
3215
3205
  gap: calc(var(--odx-vertical-rythm-base-size) * 1);
3216
3206
  }
3217
3207
  }
3208
+ .odx-card-image {
3209
+ display: block;
3210
+ margin: calc(var(--odx-card-main-padding) * -1) calc(var(--odx-card-main-padding) * -1) 0 calc(var(--odx-card-main-padding) * -1);
3211
+ max-height: var(--odx-card-image-max-height);
3212
+ max-width: -moz-max-content;
3213
+ max-width: max-content;
3214
+ overflow: clip;
3215
+ }
3216
+ .odx-card-image img {
3217
+ aspect-ratio: var(--odx-card-image-aspect-ratio);
3218
+ display: block;
3219
+ height: auto;
3220
+ max-width: 100%;
3221
+ -o-object-fit: cover;
3222
+ object-fit: cover;
3223
+ }
3224
+ .odx-card .odx-chip-list-row:has(.odx-chip) {
3225
+ left: var(--odx-card-main-padding);
3226
+ padding: calc(var(--odx-vertical-rythm-base-size) * 0.25) 0;
3227
+ position: absolute;
3228
+ top: var(--odx-card-main-padding);
3229
+ width: calc(100% - var(--odx-vertical-rythm-base-size) * 1.6667 - var(--odx-card-main-padding) - var(--odx-vertical-rythm-base-size) * 1.25);
3230
+ }
3231
+ .odx-card--default .odx-card__content {
3232
+ padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.6667);
3233
+ }
3234
+ .odx-card--launch-tile .odx-card__content, .odx-card--launch-tile-centered .odx-card__content {
3235
+ display: flex;
3236
+ flex: 1;
3237
+ flex-direction: column;
3238
+ justify-content: var(--odx-card-content-vertical-alignment);
3239
+ }
3240
+ .odx-card--default .odx-card__title {
3241
+ padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.5);
3242
+ }
3218
3243
  .odx-card--launch-tile .odx-card__title, .odx-card--launch-tile-centered .odx-card__title {
3219
3244
  font-size: calc(var(--odx-vertical-rythm-base-size) * 0.8334);
3220
3245
  line-height: calc(var(--odx-vertical-rythm-base-size) * 1.25);
@@ -3233,15 +3258,17 @@ html body .odx-fs-italic {
3233
3258
  font-size: calc(var(--odx-vertical-rythm-base-size) * 1.0417);
3234
3259
  }
3235
3260
  }
3261
+ .odx-card:focus-visible, .odx-card:focus-within:has(:focus-visible) {
3262
+ box-shadow: var(--odx-v-box-shadow-layer-1);
3263
+ }
3264
+ @media (hover: hover){
3265
+ .odx-card:hover {
3266
+ box-shadow: var(--odx-v-box-shadow-layer-1);
3267
+ }
3268
+ }
3236
3269
  .odx-card--launch-tile .odx-card__subtitle, .odx-card--launch-tile-centered .odx-card__subtitle {
3237
3270
  display: block;
3238
3271
  }
3239
- .odx-card--launch-tile .odx-card__content, .odx-card--launch-tile-centered .odx-card__content {
3240
- display: flex;
3241
- flex: 1;
3242
- flex-direction: column;
3243
- justify-content: var(--odx-card-content-vertical-alignment);
3244
- }
3245
3272
  @media (min-width: 480px) {
3246
3273
  .odx-card__content {
3247
3274
  padding-right: unset;
@@ -3281,7 +3308,10 @@ html body .odx-fs-italic {
3281
3308
  }
3282
3309
  .odx-card--default .odx-card__footer {
3283
3310
  display: block;
3284
- margin-top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3311
+ margin-top: var(--odx-card-main-padding);
3312
+ }
3313
+ .odx-card--image-card .odx-card__footer {
3314
+ display: none;
3285
3315
  }
3286
3316
  @media (min-width: 480px) {
3287
3317
  .odx-card__footer {
@@ -3297,8 +3327,8 @@ html body .odx-fs-italic {
3297
3327
  .odx-card > .odx-action-group {
3298
3328
  margin: 0;
3299
3329
  position: absolute;
3300
- right: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3301
- top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3330
+ right: var(--odx-card-main-padding);
3331
+ top: var(--odx-card-main-padding);
3302
3332
  }
3303
3333
  .odx-card.is-disabled .odx-avatar {
3304
3334
  color: var(--odx-c-text-disabled);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odx/ui",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
4
4
  "author": "Drägerwerk AG & Co.KGaA",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "peerDependencies": {
@@ -4,6 +4,7 @@
4
4
  @use '../abstract/motion';
5
5
  @use '../abstract/typography';
6
6
  @use '../abstract/utils';
7
+ @use '../layout/typography' as *;
7
8
 
8
9
  :root {
9
10
  --odx-card-avatar-size: 64px;
@@ -17,12 +18,22 @@
17
18
 
18
19
  .odx-card {
19
20
  $root: &;
20
- $main-padding: dimensions.get-size(math.div(12, 24));
21
+
22
+ --odx-card-main-padding: #{dimensions.get-size(math.div(12, 24))};
23
+ --odx-card-gap: #{dimensions.get-size(math.div(12, 24))};
24
+
25
+ $main-padding: var(--odx-card-main-padding);
21
26
 
22
27
  @include motion.transition(box-shadow outline-color color);
23
28
  @include utils.interactive(false);
24
29
  @include utils.with-outline-bold();
25
30
 
31
+ &--image-card {
32
+ --odx-card-main-padding: #{dimensions.get-size(1)};
33
+
34
+ overflow: clip;
35
+ }
36
+
26
37
  background-color: var(--odx-c-background-content);
27
38
  behavior: button;
28
39
  border-radius: var(--odx-v-border-radius);
@@ -36,9 +47,10 @@
36
47
 
37
48
  &__container {
38
49
  display: flex;
39
- gap: $main-padding;
50
+ gap: var(--odx-card-gap);
40
51
 
41
- #{$root}--default & {
52
+ #{$root}--default &,
53
+ #{$root}--image-card & {
42
54
  flex-direction: column;
43
55
  }
44
56
 
@@ -47,30 +59,9 @@
47
59
  flex-direction: column;
48
60
  }
49
61
  }
50
- }
51
-
52
- &__content {
53
- padding-right: dimensions.get-size(math.div(40, 24));
54
- }
55
-
56
- &--default {
57
- #{$root}__title {
58
- line-height: dimensions.get-size(math.div(36, 24));
59
- padding-right: dimensions.get-size(math.div(36, 24));
60
-
61
- @include typography.font-weight(medium);
62
- }
63
- }
64
-
65
- &:focus-visible,
66
- &:hover,
67
- &:focus-within:has(:focus-visible) {
68
- box-shadow: var(--odx-v-box-shadow-layer-1);
69
- }
70
62
 
71
- &--launch-tile,
72
- &--launch-tile-centered {
73
- #{$root}__container {
63
+ #{$root}--launch-tile &,
64
+ #{$root}--launch-tile-centered & {
74
65
  @include dimensions.padding-y(0.5);
75
66
  @include dimensions.padding-x(math.div(8, 24));
76
67
 
@@ -82,8 +73,55 @@
82
73
  gap: dimensions.get-size(1);
83
74
  }
84
75
  }
76
+ }
77
+
78
+ &-image {
79
+ $img-margin: calc(#{$main-padding} * -1);
85
80
 
86
- #{$root}__title {
81
+ display: block;
82
+ margin: $img-margin $img-margin 0 $img-margin;
83
+ max-height: var(--odx-card-image-max-height);
84
+ max-width: max-content;
85
+ overflow: clip;
86
+
87
+ img {
88
+ aspect-ratio: var(--odx-card-image-aspect-ratio);
89
+ display: block;
90
+ height: auto;
91
+ max-width: 100%;
92
+ object-fit: cover;
93
+ }
94
+ }
95
+
96
+ .odx-chip-list-row:has(.odx-chip) {
97
+ left: $main-padding;
98
+ padding: dimensions.get-size(math.div(6, 24)) 0;
99
+ position: absolute;
100
+ top: $main-padding;
101
+ width: calc(100% - dimensions.get-size(math.div(40, 24)) - #{$main-padding} - dimensions.get-size(math.div(30, 24)));
102
+ }
103
+
104
+ &__content {
105
+ #{$root}--default & {
106
+ padding-right: dimensions.get-size(math.div(40, 24));
107
+ }
108
+
109
+ #{$root}--launch-tile &,
110
+ #{$root}--launch-tile-centered & {
111
+ display: flex;
112
+ flex: 1;
113
+ flex-direction: column;
114
+ justify-content: var(--odx-card-content-vertical-alignment);
115
+ }
116
+ }
117
+
118
+ &__title {
119
+ #{$root}--default & {
120
+ padding-right: dimensions.get-size(math.div(36, 24));
121
+ }
122
+
123
+ #{$root}--launch-tile &,
124
+ #{$root}--launch-tile-centered & {
87
125
  font-size: dimensions.get-size(math.div(20, 24));
88
126
  line-height: dimensions.get-size(math.div(30, 24));
89
127
  overflow-wrap: anywhere;
@@ -97,17 +135,19 @@
97
135
  font-size: dimensions.get-size(math.div(25, 24));
98
136
  }
99
137
  }
138
+ }
100
139
 
140
+ &:focus-visible,
141
+ &:hover,
142
+ &:focus-within:has(:focus-visible) {
143
+ box-shadow: var(--odx-v-box-shadow-layer-1);
144
+ }
145
+
146
+ &--launch-tile,
147
+ &--launch-tile-centered {
101
148
  #{$root}__subtitle {
102
149
  display: block;
103
150
  }
104
-
105
- #{$root}__content {
106
- display: flex;
107
- flex: 1;
108
- flex-direction: column;
109
- justify-content: var(--odx-card-content-vertical-alignment);
110
- }
111
151
  }
112
152
 
113
153
  @include breakpoints.up(phone) {
@@ -159,6 +199,10 @@
159
199
  margin-top: $main-padding;
160
200
  }
161
201
 
202
+ #{$root}--image-card & {
203
+ display: none;
204
+ }
205
+
162
206
  @include breakpoints.up(phone) {
163
207
  #{$root}--launch-tile-centered & {
164
208
  justify-content: center;
@@ -43,4 +43,6 @@
43
43
  --odx-c-success-text: var(--cyan-50);
44
44
 
45
45
  --odx-c-confirmation-text: var(--cyan-50);
46
+
47
+ --odx-c-warning-text: var(--cyan-50);
46
48
  }