@matteusan/himig 1.7.4 → 1.8.1

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.
@@ -45,97 +45,60 @@ $_states: ('error');
45
45
  disabled: pintig.theme-get($color, 'border', 'disabled'),
46
46
  );
47
47
 
48
- @include base.init() {
49
- @include pintig.struct-apply('button', $struct);
50
- @include pintig.typography-apply('button', $typography);
51
- @include pintig.color-apply('button', (
52
- fill: 'ms-black.800',
53
- ink: 'ms-white.200',
54
- border: 'ms-black.800',
55
- ));
56
- @include style.text(
57
- $fills: $fills,
58
- $inks: $inks,
59
- $borders: $borders,
60
- );
61
- outline-offset: 2px;
62
-
63
- &:where(:disabled) {
64
- cursor: not-allowed;
65
- }
66
-
67
- &:where(.is-icon-only) {
68
- @include pintig.struct-bind('button', (
69
- width: (min: auto),
70
- padding: list.nth(pintig.theme-get($struct, 'padding'), 1)
48
+ @layer components {
49
+ @include base.init() {
50
+ @include pintig.struct-apply('button', $struct);
51
+ @include pintig.typography-apply('button', $typography);
52
+ @include pintig.color-apply('button', (
53
+ fill: 'ms-black.800',
54
+ ink: 'ms-white.200',
55
+ border: 'ms-black.800',
71
56
  ));
57
+ @include style.text(
58
+ $fills: $fills,
59
+ $inks: $inks,
60
+ $borders: $borders,
61
+ );
62
+ outline-offset: 2px;
72
63
 
73
- > .ms-button__label {
74
- display: none;
64
+ &:where(:disabled) {
65
+ cursor: not-allowed;
75
66
  }
76
- }
77
67
 
78
- &:where(.is-small) {
79
- @include pintig.struct-bind('button', (
80
- 'padding': ('sm' 'md')
81
- ));
82
- @include pintig.typography-apply('button', (
83
- 'size': pintig.to-rem(12px)
84
- ));
85
- }
68
+ &:where(.is-icon-only) {
69
+ @include pintig.struct-bind('button', (
70
+ width: (min: auto),
71
+ padding: list.nth(pintig.theme-get($struct, 'padding'), 1)
72
+ ));
86
73
 
87
- &:where(.is-large) {
88
- @include pintig.struct-bind('button', (
89
- 'padding': ('md' 'lg')
90
- ));
91
- @include pintig.typography-apply('button', (
92
- 'size': 'md'
93
- ));
94
- }
95
-
96
- @each $state in $_states {
97
- &:where(.is-#{$state}) {
98
- @include style.text(
99
- $fills: (
100
- 'default': '#{$state}-400',
101
- 'hover': '#{$state}-300',
102
- 'focus': '#{$state}-400',
103
- 'active': '#{$state}-200',
104
- 'disabled': 'disabled-ink',
105
- ),
106
- $inks: (
107
- 'default': '#{$state}-ink',
108
- 'disabled': 'disabled-ink'
109
- ),
110
- $borders: (
111
- 'default': '#{$state}-400',
112
- 'hover': '#{$state}-300',
113
- 'focus': '#{$state}-400',
114
- 'active': '#{$state}-200',
115
- 'disabled': 'disabled-ink',
116
- )
117
- );
74
+ > .ms-button__label {
75
+ display: none;
76
+ }
118
77
  }
119
- }
120
78
 
121
- &:where(.is-fullwidth) {
122
- @include pintig.struct-width('button', (
123
- default: 100%,
124
- min: auto,
125
- max: 100%
126
- ), 'bind');
127
- }
79
+ &:where(.is-small) {
80
+ @include pintig.struct-bind('button', (
81
+ padding: 'sm',
82
+ ));
83
+ @include pintig.typography-apply('button', (
84
+ size: 'xs'
85
+ ));
86
+ }
128
87
 
129
- &:where(.is-outlined) {
130
- @include style.outlined(
131
- $fills: $fills,
132
- $inks: $inks,
133
- $borders: $borders,
134
- );
88
+ &:where(.is-large) {
89
+ @include pintig.struct-bind('button', (
90
+ padding: 'lg',
91
+ gap: 'sm',
92
+ radius: 'md'
93
+ ));
94
+ @include pintig.typography-apply('button', (
95
+ size: 'md'
96
+ ));
97
+ }
135
98
 
136
99
  @each $state in $_states {
137
100
  &:where(.is-#{$state}) {
138
- @include style.outlined(
101
+ @include style.text(
139
102
  $fills: (
140
103
  'default': '#{$state}-400',
141
104
  'hover': '#{$state}-300',
@@ -157,51 +120,92 @@ $_states: ('error');
157
120
  );
158
121
  }
159
122
  }
160
- }
161
123
 
162
- &:where(.is-filled) {
163
- @include style.filled(
164
- $fills: $fills,
165
- $inks: $inks,
166
- $borders: $borders,
167
- );
124
+ &:where(.is-fullwidth) {
125
+ @include pintig.struct-width('button', (
126
+ default: 100%,
127
+ min: auto,
128
+ max: 100%
129
+ ), 'bind');
130
+ }
168
131
 
169
- @each $state in $_states {
170
- &:where(.is-#{$state}) {
171
- @include style.filled(
172
- $fills: (
173
- 'default': '#{$state}-400',
174
- 'hover': '#{$state}-300',
175
- 'focus': '#{$state}-400',
176
- 'active': '#{$state}-200',
177
- 'disabled': 'disabled',
178
- ),
179
- $inks: (
180
- 'default': '#{$state}-ink',
181
- 'disabled': 'disabled-ink'
182
- ),
183
- $borders: (
184
- 'default': '#{$state}-400',
185
- 'hover': '#{$state}-300',
186
- 'focus': '#{$state}-400',
187
- 'active': '#{$state}-200',
188
- 'disabled': 'disabled',
189
- )
190
- );
132
+ &:where(.is-outlined) {
133
+ @include style.outlined(
134
+ $fills: $fills,
135
+ $inks: $inks,
136
+ $borders: $borders,
137
+ );
138
+
139
+ @each $state in $_states {
140
+ &:where(.is-#{$state}) {
141
+ @include style.outlined(
142
+ $fills: (
143
+ 'default': '#{$state}-400',
144
+ 'hover': '#{$state}-300',
145
+ 'focus': '#{$state}-400',
146
+ 'active': '#{$state}-200',
147
+ 'disabled': 'disabled-ink',
148
+ ),
149
+ $inks: (
150
+ 'default': '#{$state}-ink',
151
+ 'disabled': 'disabled-ink'
152
+ ),
153
+ $borders: (
154
+ 'default': '#{$state}-400',
155
+ 'hover': '#{$state}-300',
156
+ 'focus': '#{$state}-400',
157
+ 'active': '#{$state}-200',
158
+ 'disabled': 'disabled-ink',
159
+ )
160
+ );
161
+ }
191
162
  }
192
163
  }
193
164
 
194
- &:where(.is-raised) {
195
- &:not(:disabled) {
196
- @include pintig.struct-shadow('button', 'xs');
165
+ &:where(.is-filled) {
166
+ @include style.filled(
167
+ $fills: $fills,
168
+ $inks: $inks,
169
+ $borders: $borders,
170
+ );
197
171
 
198
- &:hover,
199
- &:focus {
200
- @include pintig.struct-shadow('button', 'xs');
172
+ @each $state in $_states {
173
+ &:where(.is-#{$state}) {
174
+ @include style.filled(
175
+ $fills: (
176
+ 'default': '#{$state}-400',
177
+ 'hover': '#{$state}-300',
178
+ 'focus': '#{$state}-400',
179
+ 'active': '#{$state}-200',
180
+ 'disabled': 'disabled',
181
+ ),
182
+ $inks: (
183
+ 'default': '#{$state}-ink',
184
+ 'disabled': 'disabled-ink'
185
+ ),
186
+ $borders: (
187
+ 'default': '#{$state}-400',
188
+ 'hover': '#{$state}-300',
189
+ 'focus': '#{$state}-400',
190
+ 'active': '#{$state}-200',
191
+ 'disabled': 'disabled',
192
+ )
193
+ );
201
194
  }
195
+ }
196
+
197
+ &:where(.is-raised) {
198
+ &:not(:disabled) {
199
+ @include pintig.struct-shadow('button', 'xs');
200
+
201
+ &:hover,
202
+ &:focus {
203
+ @include pintig.struct-shadow('button', 'xs');
204
+ }
202
205
 
203
- &:active {
204
- @include pintig.struct-shadow('button', 'sm');
206
+ &:active {
207
+ @include pintig.struct-shadow('button', 'sm');
208
+ }
205
209
  }
206
210
  }
207
211
  }
@@ -29,10 +29,10 @@ $init-color: (
29
29
  $init-struct: (
30
30
  width: (
31
31
  default: 100%,
32
- min: 69px,
32
+ min: 50px,
33
33
  max: max-content
34
34
  ),
35
- padding: ('md' 'lg'),
35
+ padding: 'md',
36
36
  radius: 'small',
37
37
  border-width: 'xs',
38
38
  border-style: solid,
@@ -19,206 +19,248 @@
19
19
  $title-size: pintig.theme-get($typography, 'size', 'title');
20
20
  $title-weight: pintig.theme-get($typography, 'weight', 'title');
21
21
  $title-line-height: pintig.theme-get($typography, 'line-height', 'title');
22
+ $title-squeeze: pintig.theme-get($typography, 'squeeze', 'title');
22
23
 
23
24
  $subtitle-family: pintig.theme-get($typography, 'family', 'subtitle');
24
25
  $subtitle-size: pintig.theme-get($typography, 'size', 'subtitle');
25
26
  $subtitle-weight: pintig.theme-get($typography, 'weight', 'subtitle');
26
27
  $subtitle-line-height: pintig.theme-get($typography, 'line-height', 'subtitle');
28
+ $subtitle-squeeze: pintig.theme-get($typography, 'squeeze', 'subtitle');
27
29
 
28
30
  $content-family: pintig.theme-get($typography, 'family');
29
31
  $content-size: pintig.theme-get($typography, 'size');
30
32
  $content-weight: pintig.theme-get($typography, 'weight');
31
33
  $content-line-height: pintig.theme-get($typography, 'line-height');
34
+ $content-squeeze: pintig.theme-get($typography, 'squeeze');
32
35
 
33
36
  $icon-size: pintig.theme-get($struct, 'size', 'icon');
34
37
 
35
38
  .ms-card {
36
39
  display: flex;
37
40
  flex-flow: column nowrap;
41
+ position: relative;
42
+ overflow: hidden;
43
+ transition: box-shadow 0.2s ease;
38
44
  @include pintig.struct-gap('card-section', $section-gap, 'bind');
39
45
 
40
46
  @content;
41
47
 
48
+ &:hover {
49
+ .ms-card__media {
50
+ -webkit-filter: saturate(15%) blur(5px);
51
+ filter: saturate(15%) blur(5px);
52
+ }
53
+
54
+ @include pintig.breakpoint-create('large') {
55
+ &:has(.ms-card__media img) {
56
+ .ms-card__details {
57
+ bottom: 0;
58
+ transform: translateY(0);
59
+ opacity: 1;
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ .ms-card__header {
66
+ padding-block-end: 0 !important;
67
+
68
+ .ms-card__title {
69
+ letter-spacing: pintig.to-rem(-1px);
70
+ }
71
+ }
72
+
73
+ &:has(.ms-card__media) {
74
+ .ms-card__details {
75
+ height: auto !important;
76
+ display: flex;
77
+ flex-flow: column nowrap;
78
+ justify-content: flex-start;
79
+ transform-origin: bottom;
80
+
81
+ @include pintig.breakpoint-create('large') {
82
+ position: absolute;
83
+ right: 0;
84
+ bottom: -100%;
85
+ left: 0;
86
+ opacity: 0;
87
+ transform: translateY(100%);
88
+ transition: all pintig.token-get('time-short') pintig.token-get('easing-smooth');
89
+
90
+ .ms-card__header {
91
+ padding-block-end: 0 !important;
92
+ }
93
+ }
94
+ }
95
+ }
96
+
42
97
  .ms-card__media {
43
- width: 100%;
44
- height: 100%;
45
- max-height: 120px;
98
+ height: auto;
99
+ max-height: 100%;
46
100
  overflow: hidden;
47
101
  @include pintig.struct-apply('card-media', (
48
102
  radius: ($radius $radius 0 0),
49
103
  ));
104
+ aspect-ratio: var(--ms-card-aspect-ratio, 16 / 8);
105
+ transition: all 0.4s ease;
50
106
 
51
107
  img {
52
108
  width: 100%;
53
109
  height: 100%;
110
+ aspect-ratio: var(--ms-card-aspect-ratio, 16 / 8);
111
+ transition: all 0.4s ease;
54
112
  object-fit: cover;
55
113
  object-position: center;
56
114
  }
57
115
  }
58
116
 
59
- .ms-card__header {
117
+ .ms-card__details {
118
+ height: 100%;
60
119
  display: flex;
61
- flex-flow: row nowrap;
120
+ flex-flow: column nowrap;
62
121
  justify-content: space-between;
63
- gap: pintig.key-create('card-header-gap', pintig.primitive-token-switch('spacing.#{$header-gap}', $header-gap));
64
- @include pintig.color-border('card', transparent);
65
- @include pintig.struct-apply('card-header', (
66
- radius: (0),
67
- padding: ($padding $padding 0),
68
- border-width: ('xs' 'xs' 0),
69
- border-style: 'solid',
70
- ));
71
-
72
- &:not(:only-child),
73
- &:not(:last-child) {
74
- padding-bottom: pintig.key-get('card-section-gap');
75
- }
76
-
77
- &:last-child {
78
- @include pintig.struct-bind('card-header', (
79
- radius: (0 0 $radius $radius),
80
- border-width: (0 'xs' 'xs'),
81
- padding: (0 $padding $padding),
82
- ));
83
- }
122
+ transition: all 0.8s var(--easing);
123
+ will-change: transform;
124
+ gap: pintig.key-get('card-section-gap');
84
125
 
85
- &:first-child {
86
- @include pintig.struct-bind('card-header', (
87
- radius: ($radius $radius 0 0),
126
+ .ms-card__header {
127
+ display: flex;
128
+ flex-flow: row nowrap;
129
+ justify-content: space-between;
130
+ gap: pintig.key-create('card-header-gap', pintig.primitive-token-switch('spacing.#{$header-gap}', $header-gap));
131
+ @include pintig.struct-apply('card-header', (
132
+ radius: (0),
88
133
  padding: ($padding $padding 0),
89
- border-width: ('xs' 'xs' 0),
90
134
  ));
91
- }
92
135
 
93
- &:only-child {
94
- @include pintig.struct-bind('card-header', (
95
- radius: $radius,
96
- padding: $padding,
97
- border-width: ('xs'),
98
- ));
99
- }
100
-
101
- .ms-card__mast {
102
- .ms-card__title {
103
- @include pintig.typography-apply('card-title', (
104
- family: $title-family,
105
- size: $title-size,
106
- weight: $title-weight,
107
- line-height: $title-line-height
136
+ &:not(:only-child),
137
+ &:not(:last-child) {
138
+ @include pintig.struct-bind('card-header', (
139
+ padding: (auto auto #{pintig.key-get('card-section-gap')}),
108
140
  ));
109
- @include pintig.break(1);
110
141
  }
111
142
 
112
- .ms-card__subtitle {
113
- @include pintig.typography-apply('card-subtitle', (
114
- family: $subtitle-family,
115
- size: $subtitle-size,
116
- weight: $subtitle-weight,
117
- line-height: $subtitle-line-height
143
+ &:last-child {
144
+ @include pintig.struct-bind('card-header', (
145
+ radius: (0 0 $radius $radius),
146
+ padding: (0 $padding $padding),
118
147
  ));
119
- @include pintig.break(2);
120
148
  }
121
- }
122
-
123
- .ms-card__icon {
124
- width: pintig.key-create('card-icon-size', pintig.token-switch($icon-size));
125
- height: pintig.key-create('card-icon-size', pintig.token-switch($icon-size));
126
- border-radius: 50%;
127
- @include pintig.color-apply('card-icon', (
128
- border: 'accent-400'
129
- ));
130
- @include pintig.struct-apply('card-icon', (
131
- border-width: 1px,
132
- border-style: solid
133
- ));
134
149
 
135
- img {
136
- height: 100%;
137
- object-fit: cover;
138
- object-position: center;
150
+ &:first-child {
151
+ @include pintig.struct-bind('card-header', (
152
+ radius: ($radius $radius 0 0),
153
+ padding: ($padding $padding 0),
154
+ ));
139
155
  }
140
- }
141
- }
142
156
 
143
- .ms-card__content {
144
- @include pintig.color-border('card', transparent);
145
- @include pintig.struct-apply('card', (
146
- radius: (0 0 $radius $radius),
147
- padding: (0 $padding),
148
- border-width: (0 'xs' 'xs'),
149
- border-style: 'solid',
150
- ));
157
+ &:only-child {
158
+ @include pintig.struct-bind('card-header', (
159
+ radius: $radius,
160
+ padding: $padding,
161
+ ));
162
+ }
151
163
 
152
- p {
153
- @include pintig.typography-apply('card', (
154
- family: $content-family,
155
- size: $content-size,
156
- weight: $content-weight,
157
- line-height: $content-line-height
158
- ));
159
- }
164
+ .ms-card__mast {
165
+ .ms-card__title {
166
+ @include pintig.typography-apply('card-title', (
167
+ family: $title-family,
168
+ size: $title-size,
169
+ weight: $title-weight,
170
+ line-height: $title-line-height,
171
+ squeeze: $title-squeeze
172
+ ));
173
+ @include pintig.break(1);
174
+ }
160
175
 
161
- &:not(:only-child),
162
- &:not(:last-child) {
163
- padding-bottom: pintig.key-get('card-section-gap');
176
+ .ms-card__subtitle {
177
+ @include pintig.typography-apply('card-subtitle', (
178
+ family: $subtitle-family,
179
+ size: $subtitle-size,
180
+ weight: $subtitle-weight,
181
+ line-height: $subtitle-line-height,
182
+ squeeze: $subtitle-squeeze
183
+ ));
184
+ @include pintig.break(2);
185
+ }
186
+ }
164
187
  }
165
188
 
166
- &:last-child {
167
- @include pintig.struct-bind('card', (
189
+ .ms-card__content {
190
+ @include pintig.struct-apply('card', (
168
191
  radius: (0 0 $radius $radius),
169
- padding: (0 $padding $padding),
192
+ padding: (0 $padding),
170
193
  ));
171
- }
172
194
 
173
- &:first-child {
174
- @include pintig.struct-bind('card', (
175
- radius: ($radius $radius 0 0),
176
- padding: ($padding $padding 0),
177
- border-width: ('xs' 'xs' 0),
178
- ));
179
- }
195
+ p {
196
+ @include pintig.typography-apply('card', (
197
+ family: $content-family,
198
+ size: $content-size,
199
+ weight: $content-weight,
200
+ line-height: $content-line-height,
201
+ squeeze: $content-squeeze
202
+ ));
203
+ }
180
204
 
181
- &:only-child {
182
- @include pintig.struct-bind('card', (
183
- radius: $radius,
184
- padding: $padding,
185
- border-width: 'xs'
186
- ));
187
- }
188
- }
205
+ &:not(:only-child),
206
+ &:not(:last-child) {
207
+ @include pintig.struct-bind('card', (
208
+ padding: (auto auto #{pintig.key-get('card-section-gap')}),
209
+ ));
210
+ }
189
211
 
190
- .ms-card__footer {
191
- display: flex;
192
- flex-flow: row nowrap;
193
- justify-content: end;
194
- gap: pintig.key-create('card-footer-gap', pintig.primitive-token-switch('spacing.#{$footer-gap}', $footer-gap));
195
- @include pintig.color-border('card', transparent);
196
- @include pintig.struct-apply('card-footer', (
197
- radius: (0 0 $radius $radius),
198
- padding: (0 $padding),
199
- border-width: 'xs',
200
- border-style: 'solid',
201
- ));
212
+ &:last-child {
213
+ @include pintig.struct-bind('card', (
214
+ radius: (0 0 $radius $radius),
215
+ padding: (0 $padding $padding),
216
+ ));
217
+ }
202
218
 
203
- &:last-child {
204
- @include pintig.struct-bind('card-footer', (
205
- radius: (0 0 $radius $radius),
206
- padding: (0 $padding $padding),
207
- ));
208
- }
219
+ &:first-child {
220
+ @include pintig.struct-bind('card', (
221
+ radius: ($radius $radius 0 0),
222
+ padding: ($padding $padding 0),
223
+ ));
224
+ }
209
225
 
210
- &:first-child {
211
- @include pintig.struct-bind('card-footer', (
212
- radius: ($radius $radius 0 0),
213
- padding: ($padding $padding 0),
214
- ));
226
+ &:only-child {
227
+ @include pintig.struct-bind('card', (
228
+ radius: $radius,
229
+ padding: $padding,
230
+ ));
231
+ }
215
232
  }
216
233
 
217
- &:only-child {
218
- @include pintig.struct-bind('card-footer', (
219
- radius: $radius,
220
- padding: $padding,
234
+ .ms-card__footer {
235
+ display: flex;
236
+ flex-flow: row nowrap;
237
+ justify-content: end;
238
+ gap: pintig.key-create('card-footer-gap', pintig.primitive-token-switch('spacing.#{$footer-gap}', $footer-gap));
239
+ @include pintig.struct-apply('card-footer', (
240
+ radius: (0 0 $radius $radius),
241
+ padding: (0 $padding),
221
242
  ));
243
+
244
+ &:last-child {
245
+ @include pintig.struct-bind('card-footer', (
246
+ radius: (0 0 $radius $radius),
247
+ padding: (0 $padding $padding),
248
+ ));
249
+ }
250
+
251
+ &:first-child {
252
+ @include pintig.struct-bind('card-footer', (
253
+ radius: ($radius $radius 0 0),
254
+ padding: ($padding $padding 0),
255
+ ));
256
+ }
257
+
258
+ &:only-child {
259
+ @include pintig.struct-bind('card-footer', (
260
+ radius: $radius,
261
+ padding: $padding,
262
+ ));
263
+ }
222
264
  }
223
265
  }
224
266
  }