@matteusan/himig 1.2.3 → 1.3.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.
Files changed (45) hide show
  1. package/.yarn/cache/@matteusan-sentro-npm-0.1.25-9dadcacaf9-2964e33fdc.zip +0 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/_index.scss +21 -13
  4. package/ms-badge/_badge-extend.scss +3 -3
  5. package/ms-badge/_badge-styles.scss +8 -0
  6. package/ms-button/_button-extend.scss +3 -3
  7. package/ms-button/_button-mixins.scss +28 -17
  8. package/ms-button/_button-styles.scss +13 -9
  9. package/ms-button/_button-theme.scss +5 -5
  10. package/ms-card/_card-base.scss +243 -0
  11. package/{ms-surface/_surface-extend.scss → ms-card/_card-extend.scss} +6 -6
  12. package/{ms-item-card/_item-card-styles.scss → ms-card/_card-styles.scss} +28 -25
  13. package/{ms-item-card/_item-card-theme.scss → ms-card/_card-theme.scss} +27 -25
  14. package/{ms-sprite → ms-card}/_index.scss +1 -1
  15. package/ms-core/README.md +2 -0
  16. package/ms-core/_index.scss +2 -1
  17. package/{ms-sprite/_sprite-styles.scss → ms-core/component/_component-extend.scss} +28 -29
  18. package/{ms-surface → ms-core/component}/_index.scss +1 -2
  19. package/ms-core/package.json +15 -0
  20. package/ms-core/struct/_struct-utils.scss +3 -7
  21. package/ms-core/theme/_theme-merge.scss +1 -1
  22. package/ms-core/theme/_theme-properties.scss +9 -0
  23. package/ms-core/theme/_theme-setters.scss +5 -2
  24. package/ms-form-field/_form-field-base.scss +25 -22
  25. package/ms-form-field/_form-field-extend.scss +3 -3
  26. package/ms-form-field/_form-field-styles.scss +83 -72
  27. package/ms-form-field/_form-field-theme.scss +10 -8
  28. package/ms-list/_list-base.scss +1 -0
  29. package/ms-list/_list-extend.scss +3 -3
  30. package/ms-list/_list-theme.scss +2 -2
  31. package/ms-select-field/_index.scss +24 -0
  32. package/ms-select-field/_select-field-base.scss +108 -0
  33. package/ms-select-field/_select-field-extend.scss +53 -0
  34. package/ms-select-field/_select-field-styles.scss +203 -0
  35. package/{ms-surface/_surface-theme.scss → ms-select-field/_select-field-theme.scss} +29 -19
  36. package/{ms-item-card → ms-tick-field}/_index.scss +2 -2
  37. package/ms-tick-field/_tick-field-base.scss +78 -0
  38. package/{ms-item-card/_item-card-extend.scss → ms-tick-field/_tick-field-extend.scss} +6 -6
  39. package/ms-tick-field/_tick-field-styles.scss +121 -0
  40. package/ms-tick-field/_tick-field-theme.scss +77 -0
  41. package/ms-utils/_color-utils.scss +0 -1
  42. package/package.json +1 -1
  43. package/ms-item-card/_item-card-base.scss +0 -96
  44. package/ms-surface/_surface-base.scss +0 -111
  45. package/ms-surface/_surface-styles.scss +0 -88
@@ -22,24 +22,26 @@
22
22
 
23
23
  $init-color: (
24
24
  fill: (
25
- default: 'surface-200',
26
- disabled: 'undefined-300'
25
+ default: 'surface-alpha-600',
26
+ hover: 'accent-alpha-300',
27
+ disabled: 'disabled'
27
28
  ),
28
29
  ink: (
29
- default: 'surface-800',
30
+ default: 'surface-ink',
30
31
  helper: 'surface-ink',
31
- disabled: 'undefined-600'
32
+ disabled: 'disabled-ink'
32
33
  ),
33
34
  border: (
34
- default: 'surface-200',
35
- focus: 'surface-600',
36
- disabled: 'undefined-300'
35
+ default: 'surface-600',
36
+ hover: 'accent-alpha-600',
37
+ focus: 'accent-400',
38
+ disabled: 'disabled'
37
39
  ),
38
40
  );
39
41
 
40
42
  $init-struct: (
41
43
  width: 100%,
42
- padding: ('sm', 'md'),
44
+ padding: ('md', 'lg'),
43
45
  radius: 'small',
44
46
  border-width: (
45
47
  'default': 2px,
@@ -57,6 +57,7 @@
57
57
  weight: inherit,
58
58
  line-height: inherit,
59
59
  ));
60
+ @include ms-core.prefix(transition, all var(--ms-transition-time) ease);
60
61
  }
61
62
  }
62
63
  }
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-list.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('list', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -42,11 +42,11 @@ $init-struct: (
42
42
  min: 140px,
43
43
  max: max-content
44
44
  ),
45
- padding: ('sm' 'md'),
45
+ padding: 'md',
46
46
  radius: 'small',
47
47
  border-width: 'xs',
48
48
  border-style: solid,
49
- gap: 'xs'
49
+ gap: 'sm'
50
50
  );
51
51
 
52
52
  $init-typography: (
@@ -0,0 +1,24 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @forward 'select-field-styles';
24
+ @forward 'select-field-extend';
@@ -0,0 +1,108 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @use '../ms-core';
24
+
25
+ @use 'sass:math';
26
+
27
+ @mixin init($top-label-distance, $left-label-distance, $top-padding) {
28
+ .ms-select-field {
29
+ width: 100%;
30
+ display: flex;
31
+ flex-flow: column nowrap;
32
+ position: relative;
33
+
34
+ @content;
35
+
36
+ &:has(.ms-select-field__label) {
37
+ .ms-select-field__input {
38
+ padding-top: calc(#{$top-padding} + 1rem) !important;
39
+ }
40
+ }
41
+
42
+ &:has(.ms-select-field__input:focus),
43
+ &:has(.ms-select-field__input:valid), {
44
+ .ms-select-field__label {
45
+ top: math.div($top-label-distance, 2) !important;
46
+ @include ms-core.typography-bind('select-field-label', (
47
+ family: 'small',
48
+ size: 'small',
49
+ ));
50
+ }
51
+ }
52
+
53
+ .ms-select-field__label {
54
+ position: absolute;
55
+ top: calc(#{$top-label-distance});
56
+ left: calc(#{$left-label-distance} + 2px);
57
+ @include ms-core.color-apply('select-field-label', (
58
+ fill: rgba(0 0 0 / 0),
59
+ ink: inherit,
60
+ ));
61
+ @include ms-core.struct-apply('select-field-label', (
62
+ padding: ('xs' 'xs' 0 0),
63
+ ));
64
+ @include ms-core.typography-apply('select-field-label', ms-core.$type-inherit-template);
65
+ }
66
+
67
+ .ms-select-field__input {
68
+ @include ms-core.struct-apply('select-field', (
69
+ width: 100%,
70
+ margin: inherit,
71
+ radius: inherit,
72
+ border-width: 2px,
73
+ border-style: solid,
74
+ shadow: 'none',
75
+ ));
76
+ padding: ms-core.key-get('select-field-padding');
77
+ @include ms-core.color-apply('select-field', (
78
+ fill: inherit,
79
+ ink: inherit,
80
+ border: inherit
81
+ ));
82
+ @include ms-core.typography-apply('select-field', (
83
+ family: inherit,
84
+ size: inherit,
85
+ weight: inherit,
86
+ line-height: inherit,
87
+ ));
88
+ outline: none;
89
+ resize: none;
90
+ cursor: text;
91
+ -webkit-appearance: caret;
92
+ @include ms-core.prefix(transition, all var(--ms-transition-time) ease);
93
+ }
94
+
95
+ .ms-select-field__helper {
96
+ @include ms-core.color-apply('select-field-helper', (
97
+ ink: inherit,
98
+ ));
99
+ @include ms-core.typography-apply('select-field-helper', (
100
+ family: inherit,
101
+ size: inherit,
102
+ weight: inherit,
103
+ line-height: inherit,
104
+ ));
105
+ @include ms-core.prefix(transition, all var(--ms-transition-time) ease);
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,53 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @use '../ms-core';
24
+
25
+ /// Component variant maker.
26
+ /// @param {string} $variants
27
+ /// @return {*} extension class.
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('select-field', $variants) {
30
+ @content;
31
+ }
32
+ }
33
+
34
+ /// Color variant map.
35
+ /// @param {map} $color-map
36
+ /// @return {*} color styles.
37
+ @mixin color($color-map) {
38
+ @include ms-core.color-bind('select-field', $color-map);
39
+ }
40
+
41
+ /// Structure variant mixin.
42
+ /// @param {map} $struct-map
43
+ /// @return {*} struct styles.
44
+ @mixin struct($struct-map) {
45
+ @include ms-core.struct-bind('select-field', $struct-map);
46
+ }
47
+
48
+ /// Typography variant mixin.
49
+ /// @param {map} $type-map
50
+ /// @return {*} typography styles.
51
+ @mixin typography($type-map) {
52
+ @include ms-core.typography-bind('select-field', $type-map);
53
+ }
@@ -0,0 +1,203 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @use '../ms-core';
24
+ @use 'sass:list';
25
+ @use 'select-field-base' as base;
26
+ @use 'select-field-theme' as theme;
27
+
28
+ @mixin render(
29
+ $color: (),
30
+ $struct: (),
31
+ $typography: (),
32
+ $settings: ()
33
+ ) {
34
+ $color: ms-core.theme-merge(theme.$init-color, $color);
35
+ $struct: ms-core.theme-merge(theme.$init-struct, $struct);
36
+ $typography: ms-core.theme-merge(theme.$init-typography, $typography);
37
+ $settings: ms-core.theme-merge(theme.$init-settings, $settings);
38
+
39
+ $resolve-padding: if(list.length(ms-core.theme-get($struct, 'padding')) >= 2, list.nth(ms-core.theme-get($struct, 'padding'), 2), list.nth(ms-core.theme-get($struct, 'padding'), 1));
40
+
41
+ @include base.init(
42
+ ms-core.primitive-token-switch('padding.#{$resolve-padding}', $resolve-padding),
43
+ ms-core.primitive-token-switch('padding.#{$resolve-padding}', $resolve-padding),
44
+ ms-core.primitive-token-switch('padding.#{list.nth(ms-core.theme-get($struct, 'padding'), 1)}', list.nth(ms-core.theme-get($struct, 'padding'), 1)),
45
+ ) {
46
+ @include ms-core.color-bind('select-field-label', (
47
+ ink: ms-core.theme-get($color, 'ink', 'disabled'),
48
+ ));
49
+ @include ms-core.typography-bind('select-field-label', (
50
+ family: ms-core.theme-get($typography, 'family'),
51
+ size: ms-core.theme-get($typography, 'size', 'label'),
52
+ weight: ms-core.theme-get($typography, 'weight'),
53
+ line-height: ms-core.theme-get($typography, 'height'),
54
+ ));
55
+
56
+ @include ms-core.struct-bind('select-field', (
57
+ width: ms-core.theme-get($struct, 'width'),
58
+ padding: ms-core.theme-get($struct, 'padding'),
59
+ radius: ms-core.theme-get($struct, 'radius'),
60
+ border-width: ms-core.theme-get($struct, 'border-width'),
61
+ border-style: ms-core.theme-get($struct, 'border-style'),
62
+ gap: ms-core.theme-get($struct, 'gap'),
63
+ ));
64
+ @include ms-core.typography-bind('select-field', (
65
+ family: ms-core.theme-get($typography, 'family'),
66
+ size: ms-core.theme-get($typography, 'size', 'default'),
67
+ weight: ms-core.theme-get($typography, 'weight'),
68
+ line-height: ms-core.theme-get($typography, 'height'),
69
+ ));
70
+
71
+ @include ms-core.color-bind('select-field-helper', (
72
+ ink: ms-core.theme-get($color, 'ink', 'helper'),
73
+ ));
74
+ @include ms-core.typography-bind('select-field-helper', (
75
+ family: ms-core.theme-get($typography, 'family'),
76
+ size: ms-core.theme-get($typography, 'size', 'helper'),
77
+ weight: ms-core.theme-get($typography, 'weight'),
78
+ line-height: ms-core.theme-get($typography, 'height'),
79
+ ));
80
+
81
+ &:has(.ms-select-field__input:not(:read-only):not(:disabled)) {
82
+ .ms-select-field__label {
83
+ @include ms-core.color-bind('select-field-label', (
84
+ ink: ms-core.theme-get($color, 'ink'),
85
+ ));
86
+ }
87
+ }
88
+
89
+ &:has(.ms-select-field__input:read-only:disabled) {
90
+ @include ms-core.color-ink('select-field-helper', ms-core.theme-get($color, 'ink', 'disabled'), 'bind');
91
+ }
92
+
93
+ .ms-select-field__input {
94
+ &:not(:disabled),
95
+ &:not(:read-only) {
96
+ @include ms-core.color-bind('select-field', (
97
+ fill: ms-core.theme-get($color, 'fill'),
98
+ ink: ms-core.theme-get($color, 'ink'),
99
+ border: ms-core.theme-get($color, 'fill'),
100
+ ));
101
+
102
+ &:focus {
103
+ @include ms-core.color-bind('select-field', (
104
+ fill: ms-core.theme-get($color, 'fill', 'hover'),
105
+ border: ms-core.theme-get($color, 'border', 'focus'),
106
+ ));
107
+ @include ms-core.struct-bind('select-field', (
108
+ border-width: ms-core.theme-get($struct, 'border-width', 'focus'),
109
+ ));
110
+ }
111
+ }
112
+
113
+ &:disabled {
114
+ @include ms-core.color-bind('select-field', (
115
+ fill: ms-core.theme-get($color, 'fill', 'disabled'),
116
+ ink: ms-core.theme-get($color, 'ink', 'disabled'),
117
+ border: ms-core.theme-get($color, 'fill', 'disabled'),
118
+ ));
119
+ cursor: not-allowed;
120
+ }
121
+ }
122
+
123
+ .ms-select-field__helper {
124
+ padding: 0.3rem ms-core.primitive-token-switch('padding.#{$resolve-padding}', $resolve-padding) 0;
125
+ }
126
+
127
+ &:where(.is-outlined) {
128
+ .ms-select-field__input {
129
+ &:not(:disabled),
130
+ &:not(:read-only) {
131
+ @include ms-core.color-bind('select-field', (
132
+ fill: transparent,
133
+ ink: ms-core.theme-get($color, 'ink'),
134
+ border: ms-core.theme-get($color, 'fill'),
135
+ ));
136
+
137
+ &:focus {
138
+ @include ms-core.color-bind('select-field', (
139
+ border: ms-core.theme-get($color, 'border', 'focus'),
140
+ ));
141
+ @include ms-core.struct-bind('select-field', (
142
+ border-width: ms-core.theme-get($struct, 'border-width', 'focus'),
143
+ ));
144
+ }
145
+ }
146
+
147
+ &:disabled {
148
+ @include ms-core.color-bind('select-field', (
149
+ fill: transparent,
150
+ ink: ms-core.theme-get($color, 'ink', 'disabled'),
151
+ border: ms-core.theme-get($color, 'fill', 'disabled'),
152
+ ));
153
+ }
154
+ }
155
+
156
+ &:where(.is-error) {
157
+ .ms-select-field__input:not(:disabled),
158
+ .ms-select-field__input:not(:read-only) {
159
+ @include ms-core.color-bind('select-field', (
160
+ fill: rgba(0 0 0 / 0) !important,
161
+ border: 'error-alpha-400',
162
+ ));
163
+ }
164
+ }
165
+ }
166
+
167
+ &:where(.is-error) {
168
+ .ms-select-field__input:not(:disabled),
169
+ .ms-select-field__input:not(:read-only) {
170
+ @include ms-core.color-bind('select-field', (
171
+ fill: 'error-alpha-300',
172
+ ink: 'error-400',
173
+ border: 'error-alpha-400'
174
+ ));
175
+
176
+ &:focus {
177
+ @include ms-core.color-bind('select-field', (
178
+ fill: 'error-alpha-300',
179
+ border: 'error-400'
180
+ ));
181
+ }
182
+
183
+ + .ms-select-field__helper {
184
+ @include ms-core.color-bind('select-field-helper', (
185
+ ink: 'error-400',
186
+ ));
187
+ }
188
+ }
189
+
190
+ .ms-select-field__helper {
191
+ @include ms-core.color-bind('select-field-helper', (
192
+ ink: ms-core.theme-get($color, 'ink', 'helper'),
193
+ ));
194
+ }
195
+ }
196
+
197
+ &:where(.is-raised) {
198
+ @include ms-core.struct-bind('select-field', (
199
+ shadow: 'xs',
200
+ ));
201
+ }
202
+ }
203
+ }
@@ -22,34 +22,44 @@
22
22
 
23
23
  $init-color: (
24
24
  fill: (
25
- default: 'surface-400',
26
- header: 'surface-600'
25
+ default: 'surface-alpha-600',
26
+ hover: 'accent-alpha-300',
27
+ disabled: 'disabled'
28
+ ),
29
+ ink: (
30
+ default: 'surface-ink',
31
+ helper: 'surface-ink',
32
+ disabled: 'disabled-ink'
33
+ ),
34
+ border: (
35
+ default: 'surface-600',
36
+ hover: 'accent-alpha-600',
37
+ focus: 'accent-400',
38
+ disabled: 'disabled'
27
39
  ),
28
- ink: 'surface-ink',
29
- border: 'surface-400'
30
40
  );
31
41
 
32
42
  $init-struct: (
33
- width: 'full',
34
- radius: 'small',
43
+ width: 100%,
35
44
  padding: ('md' 'lg'),
36
- border-width: 'xs',
37
- border-style: 'solid'
45
+ radius: 'small',
46
+ border-width: (
47
+ 'default': 2px,
48
+ 'focus': 2px
49
+ ),
50
+ border-style: solid,
51
+ gap: 'sm'
38
52
  );
39
53
 
40
54
  $init-typography: (
41
- family: (
42
- default: 'global',
43
- header: 'subtitle'
44
- ),
55
+ family: 'global',
45
56
  size: (
46
57
  default: 'body',
47
- header: 'subtitle'
48
- ),
49
- weight: (
50
- default: 'normal',
51
- header: 'subtitle',
52
- footer: 'bold'
58
+ label: 'body',
59
+ helper: 'small'
53
60
  ),
61
+ weight: 'normal',
54
62
  line-height: 'normal'
55
- );
63
+ );
64
+
65
+ $init-settings: ();
@@ -20,5 +20,5 @@
20
20
  // SOFTWARE.
21
21
  //---------------------------------------------------
22
22
 
23
- @forward 'item-card-styles';
24
- @forward 'item-card-extend';
23
+ @forward 'tick-field-styles';
24
+ @forward 'tick-field-extend';
@@ -0,0 +1,78 @@
1
+ //---------------------------------------------------
2
+ // Copyright (c) 2024 MatteuSan
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ //---------------------------------------------------
22
+
23
+ @use '../ms-core';
24
+
25
+ @mixin init() {
26
+ .ms-tick-field {
27
+ width: 100%;
28
+ display: flex;
29
+ flex-flow: row nowrap;
30
+ align-items: center;
31
+ gap: ms-core.key-create('tick-field-gap', 0.5rem);
32
+ transition: all var(--ms-transition-time) ease;
33
+
34
+ @content;
35
+
36
+ .ms-tick-field__input {
37
+ display: grid;
38
+ place-content: center;
39
+ @include ms-core.struct-radius('tick-field-input', inherit);
40
+ @include ms-core.color-apply('tick-field-input', ms-core.$color-inherit-template);
41
+ transition: all var(--ms-transition-time) ease;
42
+ @include ms-core.prefix('appearance', none);
43
+ outline: none;
44
+
45
+ &::before {
46
+ content: '';
47
+ width: 0.65rem;
48
+ height: 0.65rem;
49
+ transform: scale(0);
50
+ transition: 120ms transform ease-in-out;
51
+ box-shadow: inset 1em 1em ms-core.key-get('tick-field-input-fill');
52
+ color: ms-core.key-get('tick-field-input-ink');
53
+ }
54
+
55
+ &:checked {
56
+ &::before {
57
+ transform: scale(1);
58
+ }
59
+ }
60
+ }
61
+
62
+ .ms-tick-field__text {
63
+ display: flex;
64
+ flex-flow: column;
65
+ align-items: center;
66
+ @include ms-core.struct-gap('tick-field-text', inherit);
67
+
68
+ .ms-tick-field__label {
69
+ user-select: none;
70
+ @include ms-core.typography-apply('tick-field', ms-core.$type-inherit-template);
71
+ }
72
+
73
+ .ms-tick-field__helper {
74
+ @include ms-core.typography-apply('tick-field-helper', ms-core.$type-inherit-template);
75
+ }
76
+ }
77
+ }
78
+ }
@@ -23,10 +23,10 @@
23
23
  @use '../ms-core';
24
24
 
25
25
  /// Component variant maker.
26
- /// @param {string} $variant
26
+ /// @param {string} $variants
27
27
  /// @return {*} extension class.
28
- @mixin extend($variant) {
29
- .ms-item-card.is-#{$variant} {
28
+ @mixin extend($variants) {
29
+ @include ms-core.component-extend('tick-field', $variants) {
30
30
  @content;
31
31
  }
32
32
  }
@@ -35,19 +35,19 @@
35
35
  /// @param {map} $color-map
36
36
  /// @return {*} color styles.
37
37
  @mixin color($color-map) {
38
- @include ms-core.color-bind('item-card', $color-map);
38
+ @include ms-core.color-bind('tick-field', $color-map);
39
39
  }
40
40
 
41
41
  /// Structure variant mixin.
42
42
  /// @param {map} $struct-map
43
43
  /// @return {*} struct styles.
44
44
  @mixin struct($struct-map) {
45
- @include ms-core.struct-bind('item-card', $struct-map);
45
+ @include ms-core.struct-bind('tick-field', $struct-map);
46
46
  }
47
47
 
48
48
  /// Typography variant mixin.
49
49
  /// @param {map} $type-map
50
50
  /// @return {*} typography styles.
51
51
  @mixin typography($type-map) {
52
- @include ms-core.typography-bind('item-card', $type-map);
52
+ @include ms-core.typography-bind('tick-field', $type-map);
53
53
  }