@odx/ui 3.9.1 → 3.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @odx/ui
2
2
 
3
+ ## 3.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bb425b3: New image-card variant for card component
8
+
3
9
  ## 3.9.1
4
10
 
5
11
  ### Patch Changes
package/core-theme.css CHANGED
@@ -3144,6 +3144,8 @@ html body .odx-fs-italic {
3144
3144
  }
3145
3145
 
3146
3146
  .odx-card {
3147
+ --odx-card-main-padding: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3148
+ --odx-card-gap: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3147
3149
  transition-delay: 0ms;
3148
3150
  transition-duration: var(--odx-v-transition-duration);
3149
3151
  transition-property: box-shadow, outline-color, color;
@@ -3160,7 +3162,7 @@ html body .odx-fs-italic {
3160
3162
  behavior: button;
3161
3163
  border-radius: var(--odx-v-border-radius);
3162
3164
  display: block;
3163
- padding: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3165
+ padding: var(--odx-card-main-padding);
3164
3166
  position: relative;
3165
3167
  }
3166
3168
  .odx-card:focus-visible {
@@ -3170,14 +3172,18 @@ html body .odx-fs-italic {
3170
3172
  outline-color: transparent;
3171
3173
  pointer-events: none;
3172
3174
  }
3175
+ .odx-card--image-card {
3176
+ --odx-card-main-padding: calc(var(--odx-vertical-rythm-base-size) * 1);
3177
+ overflow: clip;
3178
+ }
3173
3179
  .odx-card.is-disabled * {
3174
3180
  color: var(--odx-c-text-disabled);
3175
3181
  }
3176
3182
  .odx-card__container {
3177
3183
  display: flex;
3178
- gap: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3184
+ gap: var(--odx-card-gap);
3179
3185
  }
3180
- .odx-card--default .odx-card__container {
3186
+ .odx-card--default .odx-card__container, .odx-card--image-card .odx-card__container {
3181
3187
  flex-direction: column;
3182
3188
  }
3183
3189
  @media (min-width: 480px) {
@@ -3185,23 +3191,6 @@ html body .odx-fs-italic {
3185
3191
  flex-direction: column;
3186
3192
  }
3187
3193
  }
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
3194
  .odx-card--launch-tile .odx-card__container, .odx-card--launch-tile-centered .odx-card__container {
3206
3195
  padding-top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3207
3196
  padding-bottom: calc(var(--odx-vertical-rythm-base-size) * 0.5);
@@ -3215,6 +3204,41 @@ html body .odx-fs-italic {
3215
3204
  gap: calc(var(--odx-vertical-rythm-base-size) * 1);
3216
3205
  }
3217
3206
  }
3207
+ .odx-card-image {
3208
+ display: block;
3209
+ margin: calc(var(--odx-card-main-padding) * -1) calc(var(--odx-card-main-padding) * -1) 0 calc(var(--odx-card-main-padding) * -1);
3210
+ max-height: var(--odx-card-image-max-height);
3211
+ max-width: -moz-max-content;
3212
+ max-width: max-content;
3213
+ overflow: clip;
3214
+ }
3215
+ .odx-card-image img {
3216
+ aspect-ratio: var(--odx-card-image-aspect-ratio);
3217
+ display: block;
3218
+ height: auto;
3219
+ max-width: 100%;
3220
+ -o-object-fit: cover;
3221
+ object-fit: cover;
3222
+ }
3223
+ .odx-card .odx-chip-list-row:has(.odx-chip) {
3224
+ left: var(--odx-card-main-padding);
3225
+ padding: calc(var(--odx-vertical-rythm-base-size) * 0.25) 0;
3226
+ position: absolute;
3227
+ top: var(--odx-card-main-padding);
3228
+ width: calc(100% - var(--odx-vertical-rythm-base-size) * 1.6667 - var(--odx-card-main-padding) - var(--odx-vertical-rythm-base-size) * 1.25);
3229
+ }
3230
+ .odx-card--default .odx-card__content {
3231
+ padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.6667);
3232
+ }
3233
+ .odx-card--launch-tile .odx-card__content, .odx-card--launch-tile-centered .odx-card__content {
3234
+ display: flex;
3235
+ flex: 1;
3236
+ flex-direction: column;
3237
+ justify-content: var(--odx-card-content-vertical-alignment);
3238
+ }
3239
+ .odx-card--default .odx-card__title {
3240
+ padding-right: calc(var(--odx-vertical-rythm-base-size) * 1.5);
3241
+ }
3218
3242
  .odx-card--launch-tile .odx-card__title, .odx-card--launch-tile-centered .odx-card__title {
3219
3243
  font-size: calc(var(--odx-vertical-rythm-base-size) * 0.8334);
3220
3244
  line-height: calc(var(--odx-vertical-rythm-base-size) * 1.25);
@@ -3233,15 +3257,17 @@ html body .odx-fs-italic {
3233
3257
  font-size: calc(var(--odx-vertical-rythm-base-size) * 1.0417);
3234
3258
  }
3235
3259
  }
3260
+ .odx-card:focus-visible, .odx-card:focus-within:has(:focus-visible) {
3261
+ box-shadow: var(--odx-v-box-shadow-layer-1);
3262
+ }
3263
+ @media (hover: hover){
3264
+ .odx-card:hover {
3265
+ box-shadow: var(--odx-v-box-shadow-layer-1);
3266
+ }
3267
+ }
3236
3268
  .odx-card--launch-tile .odx-card__subtitle, .odx-card--launch-tile-centered .odx-card__subtitle {
3237
3269
  display: block;
3238
3270
  }
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
3271
  @media (min-width: 480px) {
3246
3272
  .odx-card__content {
3247
3273
  padding-right: unset;
@@ -3281,7 +3307,10 @@ html body .odx-fs-italic {
3281
3307
  }
3282
3308
  .odx-card--default .odx-card__footer {
3283
3309
  display: block;
3284
- margin-top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3310
+ margin-top: var(--odx-card-main-padding);
3311
+ }
3312
+ .odx-card--image-card .odx-card__footer {
3313
+ display: none;
3285
3314
  }
3286
3315
  @media (min-width: 480px) {
3287
3316
  .odx-card__footer {
@@ -3297,8 +3326,8 @@ html body .odx-fs-italic {
3297
3326
  .odx-card > .odx-action-group {
3298
3327
  margin: 0;
3299
3328
  position: absolute;
3300
- right: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3301
- top: calc(var(--odx-vertical-rythm-base-size) * 0.5);
3329
+ right: var(--odx-card-main-padding);
3330
+ top: var(--odx-card-main-padding);
3302
3331
  }
3303
3332
  .odx-card.is-disabled .odx-avatar {
3304
3333
  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.2",
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;