@matteusan/himig 1.7.3 → 1.8.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.
@@ -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' 'md'),
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' 'xl'),
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
  }
@@ -19,206 +19,242 @@
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
98
  width: 100%;
44
99
  height: 100%;
45
- max-height: 120px;
100
+ max-height: 100%;
46
101
  overflow: hidden;
47
102
  @include pintig.struct-apply('card-media', (
48
103
  radius: ($radius $radius 0 0),
49
104
  ));
50
-
51
- img {
52
- width: 100%;
53
- height: 100%;
54
- object-fit: cover;
55
- object-position: center;
56
- }
105
+ aspect-ratio: var(--ms-card-aspect-ratio, 16 / 8);
106
+ transition: all 0.4s ease;
107
+ object-fit: cover;
108
+ object-position: center;
57
109
  }
58
110
 
59
- .ms-card__header {
111
+ .ms-card__details {
112
+ height: 100%;
60
113
  display: flex;
61
- flex-flow: row nowrap;
114
+ flex-flow: column nowrap;
62
115
  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
- }
116
+ transition: all 0.8s var(--easing);
117
+ will-change: transform;
118
+ gap: pintig.key-get('card-section-gap');
84
119
 
85
- &:first-child {
86
- @include pintig.struct-bind('card-header', (
87
- radius: ($radius $radius 0 0),
120
+ .ms-card__header {
121
+ display: flex;
122
+ flex-flow: row nowrap;
123
+ justify-content: space-between;
124
+ gap: pintig.key-create('card-header-gap', pintig.primitive-token-switch('spacing.#{$header-gap}', $header-gap));
125
+ @include pintig.struct-apply('card-header', (
126
+ radius: (0),
88
127
  padding: ($padding $padding 0),
89
- border-width: ('xs' 'xs' 0),
90
- ));
91
- }
92
-
93
- &:only-child {
94
- @include pintig.struct-bind('card-header', (
95
- radius: $radius,
96
- padding: $padding,
97
- border-width: ('xs'),
98
128
  ));
99
- }
100
129
 
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
130
+ &:not(:only-child),
131
+ &:not(:last-child) {
132
+ @include pintig.struct-bind('card-header', (
133
+ padding: (auto auto #{pintig.key-get('card-section-gap')}),
108
134
  ));
109
- @include pintig.break(1);
110
135
  }
111
136
 
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
137
+ &:last-child {
138
+ @include pintig.struct-bind('card-header', (
139
+ radius: (0 0 $radius $radius),
140
+ padding: (0 $padding $padding),
118
141
  ));
119
- @include pintig.break(2);
120
142
  }
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
143
 
135
- img {
136
- height: 100%;
137
- object-fit: cover;
138
- object-position: center;
144
+ &:first-child {
145
+ @include pintig.struct-bind('card-header', (
146
+ radius: ($radius $radius 0 0),
147
+ padding: ($padding $padding 0),
148
+ ));
139
149
  }
140
- }
141
- }
142
150
 
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
- ));
151
+ &:only-child {
152
+ @include pintig.struct-bind('card-header', (
153
+ radius: $radius,
154
+ padding: $padding,
155
+ ));
156
+ }
151
157
 
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
- }
158
+ .ms-card__mast {
159
+ .ms-card__title {
160
+ @include pintig.typography-apply('card-title', (
161
+ family: $title-family,
162
+ size: $title-size,
163
+ weight: $title-weight,
164
+ line-height: $title-line-height,
165
+ squeeze: $title-squeeze
166
+ ));
167
+ @include pintig.break(1);
168
+ }
160
169
 
161
- &:not(:only-child),
162
- &:not(:last-child) {
163
- padding-bottom: pintig.key-get('card-section-gap');
170
+ .ms-card__subtitle {
171
+ @include pintig.typography-apply('card-subtitle', (
172
+ family: $subtitle-family,
173
+ size: $subtitle-size,
174
+ weight: $subtitle-weight,
175
+ line-height: $subtitle-line-height,
176
+ squeeze: $subtitle-squeeze
177
+ ));
178
+ @include pintig.break(2);
179
+ }
180
+ }
164
181
  }
165
182
 
166
- &:last-child {
167
- @include pintig.struct-bind('card', (
183
+ .ms-card__content {
184
+ @include pintig.struct-apply('card', (
168
185
  radius: (0 0 $radius $radius),
169
- padding: (0 $padding $padding),
186
+ padding: (0 $padding),
170
187
  ));
171
- }
172
188
 
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
- }
189
+ p {
190
+ @include pintig.typography-apply('card', (
191
+ family: $content-family,
192
+ size: $content-size,
193
+ weight: $content-weight,
194
+ line-height: $content-line-height,
195
+ squeeze: $content-squeeze
196
+ ));
197
+ }
180
198
 
181
- &:only-child {
182
- @include pintig.struct-bind('card', (
183
- radius: $radius,
184
- padding: $padding,
185
- border-width: 'xs'
186
- ));
187
- }
188
- }
199
+ &:not(:only-child),
200
+ &:not(:last-child) {
201
+ @include pintig.struct-bind('card', (
202
+ padding: (auto auto #{pintig.key-get('card-section-gap')}),
203
+ ));
204
+ }
189
205
 
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
- ));
206
+ &:last-child {
207
+ @include pintig.struct-bind('card', (
208
+ radius: (0 0 $radius $radius),
209
+ padding: (0 $padding $padding),
210
+ ));
211
+ }
202
212
 
203
- &:last-child {
204
- @include pintig.struct-bind('card-footer', (
205
- radius: (0 0 $radius $radius),
206
- padding: (0 $padding $padding),
207
- ));
208
- }
213
+ &:first-child {
214
+ @include pintig.struct-bind('card', (
215
+ radius: ($radius $radius 0 0),
216
+ padding: ($padding $padding 0),
217
+ ));
218
+ }
209
219
 
210
- &:first-child {
211
- @include pintig.struct-bind('card-footer', (
212
- radius: ($radius $radius 0 0),
213
- padding: ($padding $padding 0),
214
- ));
220
+ &:only-child {
221
+ @include pintig.struct-bind('card', (
222
+ radius: $radius,
223
+ padding: $padding,
224
+ ));
225
+ }
215
226
  }
216
227
 
217
- &:only-child {
218
- @include pintig.struct-bind('card-footer', (
219
- radius: $radius,
220
- padding: $padding,
228
+ .ms-card__footer {
229
+ display: flex;
230
+ flex-flow: row nowrap;
231
+ justify-content: end;
232
+ gap: pintig.key-create('card-footer-gap', pintig.primitive-token-switch('spacing.#{$footer-gap}', $footer-gap));
233
+ @include pintig.struct-apply('card-footer', (
234
+ radius: (0 0 $radius $radius),
235
+ padding: (0 $padding),
221
236
  ));
237
+
238
+ &:last-child {
239
+ @include pintig.struct-bind('card-footer', (
240
+ radius: (0 0 $radius $radius),
241
+ padding: (0 $padding $padding),
242
+ ));
243
+ }
244
+
245
+ &:first-child {
246
+ @include pintig.struct-bind('card-footer', (
247
+ radius: ($radius $radius 0 0),
248
+ padding: ($padding $padding 0),
249
+ ));
250
+ }
251
+
252
+ &:only-child {
253
+ @include pintig.struct-bind('card-footer', (
254
+ radius: $radius,
255
+ padding: $padding,
256
+ ));
257
+ }
222
258
  }
223
259
  }
224
260
  }