@matteusan/himig 1.5.1 → 1.7.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 (77) hide show
  1. package/README.md +2 -2
  2. package/_index.scss +5 -23
  3. package/ms-badge/_badge-base.scss +1 -1
  4. package/ms-badge/_badge-extend.scss +1 -1
  5. package/ms-badge/_badge-styles.scss +1 -1
  6. package/ms-button/_button-base.scss +1 -1
  7. package/ms-button/_button-extend.scss +1 -1
  8. package/ms-button/_button-mixins.scss +1 -1
  9. package/ms-button/_button-styles.scss +26 -26
  10. package/ms-card/_card-base.scss +1 -1
  11. package/ms-card/_card-extend.scss +1 -1
  12. package/ms-card/_card-styles.scss +1 -1
  13. package/ms-form-field/_form-field-base.scss +1 -1
  14. package/ms-form-field/_form-field-extend.scss +1 -1
  15. package/ms-form-field/_form-field-styles.scss +1 -1
  16. package/ms-link/_link-base.scss +1 -1
  17. package/ms-link/_link-extend.scss +1 -1
  18. package/ms-link/_link-styles.scss +1 -1
  19. package/ms-list/_list-base.scss +1 -1
  20. package/ms-list/_list-extend.scss +1 -1
  21. package/ms-list/_list-styles.scss +1 -1
  22. package/ms-select-field/_select-field-base.scss +1 -1
  23. package/ms-select-field/_select-field-extend.scss +1 -1
  24. package/ms-select-field/_select-field-styles.scss +1 -1
  25. package/ms-tick-field/_tick-field-base.scss +1 -1
  26. package/ms-tick-field/_tick-field-extend.scss +1 -1
  27. package/ms-tick-field/_tick-field-styles.scss +1 -1
  28. package/ms-utils/_color-utils.scss +1 -1
  29. package/ms-utils/_consts.scss +1 -1
  30. package/ms-utils/_layout-utils.scss +1 -1
  31. package/ms-utils/_struct-utils.scss +1 -1
  32. package/ms-utils/_typography-utils.scss +7 -24
  33. package/ms-utils/_util-helpers.scss +1 -1
  34. package/package.json +11 -3
  35. package/pintig/README.md +0 -2
  36. package/pintig/_index.scss +0 -77
  37. package/pintig/breakpoint/_breakpoint-sentro.scss +0 -53
  38. package/pintig/breakpoint/_index.scss +0 -23
  39. package/pintig/color/_color-constants.scss +0 -33
  40. package/pintig/color/_color-setters.scss +0 -75
  41. package/pintig/color/_color-utils.scss +0 -62
  42. package/pintig/color/_color-validators.scss +0 -59
  43. package/pintig/color/_index.scss +0 -25
  44. package/pintig/component/_component-extend.scss +0 -56
  45. package/pintig/component/_index.scss +0 -23
  46. package/pintig/component/component-base.ts +0 -81
  47. package/pintig/component/component-properties.ts +0 -25
  48. package/pintig/component/index.ts +0 -29
  49. package/pintig/component/types/ms-component.d.ts +0 -24
  50. package/pintig/index.ts +0 -29
  51. package/pintig/package.json +0 -15
  52. package/pintig/sprite/_index.scss +0 -23
  53. package/pintig/sprite/_sprite-mixins.scss +0 -29
  54. package/pintig/struct/_index.scss +0 -24
  55. package/pintig/struct/_struct-setters.scss +0 -98
  56. package/pintig/struct/_struct-utils.scss +0 -218
  57. package/pintig/struct/_struct-validators.scss +0 -57
  58. package/pintig/theme/_index.scss +0 -30
  59. package/pintig/theme/_theme-get.scss +0 -41
  60. package/pintig/theme/_theme-keys.scss +0 -43
  61. package/pintig/theme/_theme-merge.scss +0 -46
  62. package/pintig/theme/_theme-properties.scss +0 -61
  63. package/pintig/theme/_theme-setters.scss +0 -167
  64. package/pintig/theme/_theme-tokens.scss +0 -57
  65. package/pintig/tokens/_index.scss +0 -23
  66. package/pintig/tokens/_token-data.scss +0 -249
  67. package/pintig/tokens/_token-methods.scss +0 -118
  68. package/pintig/tools/_index.scss +0 -27
  69. package/pintig/tools/_tools-color.scss +0 -79
  70. package/pintig/tools/_tools-helpers.scss +0 -30
  71. package/pintig/tools/_tools-sentro.scss +0 -52
  72. package/pintig/tools/_tools-string.scss +0 -45
  73. package/pintig/tools/_tools-validation.scss +0 -71
  74. package/pintig/typography/_index.scss +0 -24
  75. package/pintig/typography/_typography-setters.scss +0 -78
  76. package/pintig/typography/_typography-utils.scss +0 -76
  77. package/pintig/typography/_typography-validators.scss +0 -47
@@ -1,167 +0,0 @@
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 'node_modules/@matteusan/sentro';
24
- @use '../tokens';
25
- @use '../tools';
26
- @use 'sass:map';
27
- @use 'theme-tokens' as token;
28
-
29
- $expressive-inks: false !default;
30
-
31
- @mixin theme-config(
32
- $primary: (),
33
- $accent: (),
34
- $surface: (),
35
- $background: (),
36
- $error: (),
37
- $warning: (),
38
- $success: (),
39
- $disabled: (),
40
- $radius: (),
41
- $breakpoints: (),
42
- $global: (),
43
- $supertitle: (),
44
- $title: (),
45
- $subtitle: (),
46
- $body: (),
47
- $mono: (),
48
- $small: (),
49
- $extend: ()
50
- ) {
51
-
52
- $_init-radius: (
53
- 'small': 'radius.sm',
54
- 'medium': 'radius.md',
55
- 'large': 'radius.lg',
56
- );
57
-
58
- $_init-breakpoints: (
59
- 'small': 'breakpoint.sm',
60
- 'medium': 'breakpoint.md',
61
- 'large': 'breakpoint.lg',
62
- 'xlarge': 'breakpoint.xl',
63
- );
64
-
65
- $_typography-mapper: (
66
- 'global': $global,
67
- 'supertitle': $supertitle,
68
- 'title': $title,
69
- 'subtitle': $subtitle,
70
- 'body': $body,
71
- 'mono': $mono,
72
- 'small': $small,
73
- );
74
-
75
- @include token.config($map: $extend);
76
- @include token.config(
77
- $primary: _color-theme-token-module($primary),
78
- $accent: _color-theme-token-module($accent),
79
- $surface: _color-theme-token-module($surface),
80
- $primary-alpha: _alpha-color-theme-token-module($primary),
81
- $accent-alpha: _alpha-color-theme-token-module($accent),
82
- $surface-alpha: _alpha-color-theme-token-module($surface),
83
- $background: tokens.primitive-token-switch($background),
84
- $background-ink: tools.get-ink(tokens.primitive-token-switch($background)),
85
- $error: _color-theme-token-module($error),
86
- $error-alpha: _alpha-color-theme-token-module($error),
87
- $disabled: (
88
- 'default': map.get($disabled, 'default'),
89
- 'ink': tools.prioritize(map.get($disabled, 'ink'), tools.get-ink(map.get($disabled, 'default'), $expressive-inks)),
90
- ),
91
- $radius: _shape-theme-token-module(map.merge($_init-radius, $radius)),
92
- $family: _typography-theme-token-module($_typography-mapper, 'family'),
93
- $size: _typography-theme-token-module($_typography-mapper, 'size'),
94
- $weight: _typography-theme-token-module($_typography-mapper, 'weight'),
95
- $line-height: _typography-theme-token-module($_typography-mapper, 'line-height'),
96
- );
97
-
98
- @include sentro.breakpoint-config(
99
- _shape-theme-token-module(map.merge($_init-breakpoints, $breakpoints))
100
- );
101
- }
102
-
103
- /// @access private
104
- @function _color-theme-token-module($query) {
105
- @if tools.is-type($query, 'map', $errors: false) {
106
- @return (
107
- 200: tokens.primitive-token-switch('#{map.get($query, 200)}.200', map.get($query, 200)),
108
- 300: tokens.primitive-token-switch('#{map.get($query, 300)}.300', map.get($query, 300)),
109
- 400: tokens.primitive-token-switch('#{map.get($query, 400)}.400', map.get($query, 400)),
110
- 600: tokens.primitive-token-switch('#{map.get($query, 600)}.600', map.get($query, 600)),
111
- 800: tokens.primitive-token-switch('#{map.get($query, 800)}.800', map.get($query, 800)),
112
- 'ink': tools.get-ink(tokens.primitive-token-switch('#{map.get($query, 400)}.400', map.get($query, 400)), $expressive-inks)
113
- );
114
- }
115
-
116
- @return (
117
- 200: tokens.primitive-token-get('#{$query}.200'),
118
- 300: tokens.primitive-token-get('#{$query}.300'),
119
- 400: tokens.primitive-token-get('#{$query}.400'),
120
- 600: tokens.primitive-token-get('#{$query}.600'),
121
- 800: tokens.primitive-token-get('#{$query}.800'),
122
- 'ink': tools.get-ink(tokens.primitive-token-get('#{$query}.400'), $expressive-inks)
123
- );
124
- }
125
-
126
- /// @access private
127
- @function _alpha-color-theme-token-module($query) {
128
- @if tools.is-type($query, 'map', $errors: false) {
129
- @return (
130
- 200: rgba(tokens.primitive-token-switch('#{map.get($query, 400)}.200', map.get($query, 400)), 8%),
131
- 300: rgba(tokens.primitive-token-switch('#{map.get($query, 400)}.300', map.get($query, 400)), 12%),
132
- 400: rgba(tokens.primitive-token-switch('#{map.get($query, 400)}.400', map.get($query, 400)), 20%),
133
- 600: rgba(tokens.primitive-token-switch('#{map.get($query, 400)}.600', map.get($query, 400)), 33%),
134
- 800: rgba(tokens.primitive-token-switch('#{map.get($query, 400)}.800', map.get($query, 400)), 42%),
135
- );
136
- }
137
-
138
- @return (
139
- 200: rgba(tokens.primitive-token-get('#{$query}.400'), 8%),
140
- 300: rgba(tokens.primitive-token-get('#{$query}.400'), 12%),
141
- 400: rgba(tokens.primitive-token-get('#{$query}.400'), 20%),
142
- 600: rgba(tokens.primitive-token-get('#{$query}.400'), 33%),
143
- 800: rgba(tokens.primitive-token-get('#{$query}.400'), 42%)
144
- )
145
- }
146
-
147
- /// @access private
148
- @function _shape-theme-token-module($query) {
149
- $result: ();
150
- @each $key, $value in $query {
151
- $result: map.set($result, $key, tokens.primitive-token-switch($value));
152
- }
153
- @return $result;
154
- }
155
-
156
- /// @access private
157
- @function _typography-theme-token-module($query, $property) {
158
- @return (
159
- 'global': tokens.primitive-token-switch(map.get(map.get($query, 'global'), $property)),
160
- 'supertitle': tokens.primitive-token-switch(map.get(map.get($query, 'supertitle'), $property)),
161
- 'title': tokens.primitive-token-switch(map.get(map.get($query, 'title'), $property)),
162
- 'subtitle': tokens.primitive-token-switch(map.get(map.get($query, 'subtitle'), $property)),
163
- 'body': tokens.primitive-token-switch(map.get(map.get($query, 'body'), $property)),
164
- 'mono': tokens.primitive-token-switch(map.get(map.get($query, 'mono'), $property)),
165
- 'small': tokens.primitive-token-switch(map.get(map.get($query, 'small'), $property)),
166
- );
167
- }
@@ -1,57 +0,0 @@
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 'node_modules/@matteusan/sentro';
24
- @use '../tools';
25
-
26
- @function get($query) {
27
- @return sentro.token-get($query);
28
- }
29
-
30
- @function get-raw($query) {
31
- @return sentro.token-get-raw($query);
32
- }
33
-
34
- @function switch($query, $fallback: ()) {
35
- @if not check($query) == true and not tools.is-empty($fallback) {
36
- @return $fallback;
37
- }
38
- @return sentro.token-switch($query);
39
- }
40
-
41
- @function switch-raw($query, $fallback: ()) {
42
- @if check($query) == true {
43
- @return sentro.token-get-raw($query);
44
- }
45
- @if not tools.is-empty($fallback) {
46
- @return $fallback;
47
- }
48
- @return $query;
49
- }
50
-
51
- @function check($query) {
52
- @return sentro.token-check($query);
53
- }
54
-
55
- @mixin config($map: (), $tokens...) {
56
- @include sentro.token-config($map, $tokens...);
57
- }
@@ -1,23 +0,0 @@
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 'token-methods' as primitive-token-*;
@@ -1,249 +0,0 @@
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 '../tools';
24
- @use 'sass:map';
25
-
26
- $_color-tokens: (
27
- 'ms-white': (
28
- '200': #ffffff,
29
- '300': #e7e7e7,
30
- '400': #c4c4c4,
31
- '600': #b2b2b2,
32
- '800': #a1a1a1,
33
- ),
34
- 'ms-black': (
35
- '200': #252525,
36
- '300': #202020,
37
- '400': #151515,
38
- '600': #101010,
39
- '800': #000000,
40
- ),
41
- 'ms-grey': (
42
- '200': #a1a1a1,
43
- '300': #919191,
44
- '400': #717171,
45
- '600': #545454,
46
- '800': #323232,
47
- ),
48
- 'ms-dark-grey': (
49
- '200': #505050,
50
- '300': #404040,
51
- '400': #303030,
52
- '600': #202020,
53
- '800': #101010
54
- ),
55
- 'ms-red': (
56
- '200': #ff8d8d,
57
- '300': #ec4f4f,
58
- '400': #c41b1b,
59
- '600': #8d0c0c,
60
- '800': #5b0000,
61
- ),
62
- 'ms-orange': (
63
- '200': #ffaf5e,
64
- '300': #ff9346,
65
- '400': #e16c1d,
66
- '600': #af4f0b,
67
- '800': #732f00,
68
- ),
69
- 'ms-yellow': (
70
- '200': #ffc46a,
71
- '300': #fdaa31,
72
- '400': #ff9900,
73
- '600': #c97900,
74
- '800': #935800,
75
- ),
76
- 'ms-lime': (
77
- '200': #a9d37d,
78
- '300': #87cb44,
79
- '400': #63a822,
80
- '600': #468310,
81
- '800': #26480a,
82
- ),
83
- 'ms-green': (
84
- '200': #7ed38e,
85
- '300': #45ab5b,
86
- '400': #228836,
87
- '600': #1c7a2f,
88
- '800': #0c3b16,
89
- ),
90
- 'ms-aqua': (
91
- '200': #98ebef,
92
- '300': #6dd0d3,
93
- '400': #31a9ad,
94
- '600': #1b767a,
95
- '800': #0c3133,
96
- ),
97
- 'ms-blue': (
98
- '200': #98a8c4,
99
- '300': #8396b9,
100
- '400': #496c9b,
101
- '600': #12305e,
102
- '800': #030e23,
103
- ),
104
- 'ms-purple': (
105
- '200': #c0a2ee,
106
- '300': #a173e0,
107
- '400': #6c30bd,
108
- '600': #3b1570,
109
- '800': #1b0838,
110
- ),
111
- 'ms-pink': (
112
- '200': #f5a7e8,
113
- '300': #da7ac6,
114
- '400': #c727af,
115
- '600': #8f107a,
116
- '800': #49063f,
117
- ),
118
- );
119
-
120
- $_struct-tokens: (
121
- 'spacing': (
122
- 'none': 0,
123
- 'xs': tools.to-rem(4px),
124
- 'sm': tools.to-rem(8px),
125
- 'md': tools.to-rem(16px),
126
- 'lg': tools.to-rem(24px),
127
- 'xl': tools.to-rem(32px),
128
- '2xl': tools.to-rem(48px),
129
- '3xl': tools.to-rem(64px),
130
- '4xl': tools.to-rem(80px),
131
- '5xl': tools.to-rem(96px),
132
- '6xl': tools.to-rem(112px),
133
- 'auto': auto
134
- ),
135
- 'el-spacing': (
136
- 'none': 0,
137
- 'xs': 0.1rem,
138
- 'sm': 0.3rem,
139
- 'md': 0.7rem,
140
- 'lg': 1.2rem,
141
- 'xl': 2.3rem,
142
- '2xl': 3.4rem,
143
- '3xl': 4.5rem,
144
- '4xl': 6.1rem,
145
- '5xl': 8.2rem,
146
- '6xl': 12.3rem,
147
- 'auto': auto
148
- ),
149
- 'radius': (
150
- 'none': 0,
151
- 'xs': 0.1rem,
152
- 'sm': 0.3rem,
153
- 'md': 0.5rem,
154
- 'lg': 0.7rem,
155
- 'xl': 1.2rem,
156
- '2xl': 2.3rem,
157
- '3xl': 3.4rem,
158
- '4xl': 4.5rem,
159
- '5xl': 6.1rem,
160
- '6xl': 8.2rem,
161
- 'pill': 5000px,
162
- 'circle': 50%,
163
- ),
164
- 'dimension': (
165
- 'none': 0,
166
- 'xs': tools.to-rem(277px),
167
- 'sm': tools.to-rem(320px),
168
- 'md': tools.to-rem(640px),
169
- 'lg': tools.to-rem(890px),
170
- 'xl': tools.to-rem(1077px),
171
- 'sprite': tools.to-rem(32px),
172
- 'full': 100%,
173
- ),
174
- 'breakpoint': (
175
- 'none': 0,
176
- 'xs': 277px,
177
- 'sm': 320px,
178
- 'md': 640px,
179
- 'lg': 890px,
180
- 'xl': 1077px,
181
- 'sprite': 32px,
182
- ),
183
- 'border': (
184
- 'none': 0,
185
- 'xs': 1px,
186
- 'sm': 3px,
187
- 'md': 5px,
188
- 'lg': 7px,
189
- 'xl': 11px,
190
- ),
191
- 'shadow': (
192
- 'none': 0 0 0 rgba(0 0 0 / 0),
193
- 'xs': 0 0.1rem 0.3rem var(--ms-shadow-color),
194
- 'sm': 0 0.3rem 0.5rem var(--ms-shadow-color),
195
- 'md': 0 0.7rem 1.2rem var(--ms-shadow-color),
196
- 'lg': 0 1.2rem 1.5rem var(--ms-shadow-color),
197
- 'xl': 0 1.7rem 2.1rem var(--ms-shadow-color),
198
- '2xl': 0 2.3rem 3.5rem var(--ms-shadow-color),
199
- '3xl': 0 3.5rem 4.7rem var(--ms-shadow-color),
200
- '4xl': 0 4.7rem 5.2rem var(--ms-shadow-color),
201
- '5xl': 0 5.2rem 6.5rem var(--ms-shadow-color),
202
- '6xl': 0 6.7rem 7.3rem var(--ms-shadow-color),
203
- ),
204
- );
205
-
206
- $_abstracted-struct-tokens: (
207
- 'padding': map.get($_struct-tokens, 'el-spacing'),
208
- 'margin': map.get($_struct-tokens, 'spacing'),
209
- 'width': map.get($_struct-tokens, 'dimension'),
210
- 'height': map.get($_struct-tokens, 'dimension'),
211
- 'gap': map.get($_struct-tokens, 'spacing'),
212
- );
213
-
214
- $_typography-tokens: (
215
- 'family': (
216
- 'mono': ('Jetbrains Mono', monospace),
217
- 'sans-serif': ('Inter', sans-serif),
218
- 'serif': ('Noto Serif Display', serif),
219
- ),
220
- 'size': (
221
- 'xs': clamp(#{tools.to-rem(10px)}, 2vw, #{tools.to-rem(12px)}),
222
- 'sm': clamp(#{tools.to-rem(14px)}, 4vw, #{tools.to-rem(16px)}),
223
- 'md': clamp(#{tools.to-rem(17px)}, 5vw, #{tools.to-rem(21px)}),
224
- 'lg': clamp(#{tools.to-rem(19px)}, 6vw, #{tools.to-rem(25px)}),
225
- 'xl': clamp(#{tools.to-rem(24px)}, 8vw, #{tools.to-rem(30px)}),
226
- '2xl': clamp(#{tools.to-rem(26px)}, 8vw, #{tools.to-rem(36px)}),
227
- '3xl': clamp(#{tools.to-rem(32px)}, 10vw, #{tools.to-rem(42px)}),
228
- '4xl': clamp(#{tools.to-rem(39px)}, 10vw, #{tools.to-rem(49px)}),
229
- '5xl': clamp(#{tools.to-rem(47px)}, 12vw, #{tools.to-rem(57px)}),
230
- '6xl': clamp(#{tools.to-rem(56px)}, 14vw, #{tools.to-rem(66px)}),
231
- ),
232
- 'weight': (
233
- 'light': 200,
234
- 'normal': 400,
235
- 'bold': 700,
236
- 'black': 900,
237
- ),
238
- 'line-height': (
239
- 'broad': 2,
240
- 'normal': 1.5,
241
- 'condensed': 1.25,
242
- ),
243
- );
244
-
245
- $ms-tokens: map.deep-merge(
246
- $_color-tokens, map.deep-merge(
247
- $_typography-tokens, map.deep-merge($_struct-tokens, $_abstracted-struct-tokens)
248
- )
249
- );
@@ -1,118 +0,0 @@
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 '../tools';
24
- @use 'sass:map';
25
- @use 'sass:list';
26
- @use 'sass:string';
27
- @use 'token-data' as data;
28
-
29
- $_primitive-token-registry: ();
30
- $token-keys: map.keys(data.$ms-tokens);
31
- @each $token-key in $token-keys {
32
- $variant-keys: map.keys(map.get(data.$ms-tokens, $token-key));
33
- @each $variant-key in $variant-keys {
34
- $_primitive-token-registry: list.append($_primitive-token-registry, '#{$token-key}.#{$variant-key}') !global;
35
- }
36
- }
37
-
38
- @mixin register($map: ()) {
39
- $token-keys: map.keys($map);
40
- @each $token-key in $token-keys {
41
- $variant-keys: map.keys(map.get($map, $token-key));
42
- @each $variant-key in $variant-keys {
43
- $_primitive-token-registry: list.append($_primitive-token-registry, '#{$token-key}.#{$variant-key}') !global;
44
- }
45
- }
46
- }
47
-
48
- // TODO: Look further into this function at a later time.
49
- // @function registry-get($targets: 'all') {
50
- // @if not tools.is-empty($targets) {
51
- // $targeted-tokens: ();
52
- // @each $target in $targets {
53
- // @each $key, $value in $_primitive-token-registry {
54
- // @if string.index($key, $target) == 1 {
55
- // $targeted-tokens: map.set($targeted-tokens, $key, $value);
56
- // }
57
- // }
58
- // }
59
- // @return $targeted-tokens;
60
- // }
61
- //
62
- // @if $targets == 'all' {
63
- // @return $_primitive-token-registry;
64
- // }
65
- //
66
- // @return $_primitive-token-registry;
67
- // }
68
-
69
- /// Retrieves a token from the primitive token registry based on a given query.
70
- /// @param {PrimitiveToken} $query
71
- /// @return {*} primitive token value.
72
- @function get($query) {
73
- @if _validate($query) {
74
- $keys: tools.str-split($query, '.');
75
- $token: map.get(data.$ms-tokens, list.nth($keys, 1));
76
- $value: map.get($token, list.nth($keys, 2));
77
- @return $value;
78
- }
79
- }
80
-
81
- /// Retrieves a token from the primitive token registry based on a given query.
82
- /// @param {PrimitiveToken} $query
83
- /// @param {*} $fallback
84
- /// @return {*} primitive token value.
85
- @function switch($query, $fallback: ()) {
86
- @if check($query) == true {
87
- $keys: tools.str-split($query, '.');
88
- $token: map.get(data.$ms-tokens, list.nth($keys, 1));
89
- $value: map.get($token, list.nth($keys, 2));
90
- @return $value;
91
- }
92
- @if not tools.is-empty($fallback) {
93
- @return $fallback;
94
- }
95
- @return $query;
96
- }
97
-
98
- /// Soft validates if the query is a valid primitive token.
99
- /// @param {string} $query
100
- /// @return {boolean} true if valid, false if not.
101
- @function check($query) {
102
- @return _validate($query, $errors: false);
103
- }
104
-
105
- /// Validates if the query is a valid primitive token.
106
- /// @access private
107
- /// @param {string} $query
108
- /// @return {boolean|error} true if valid, false or an error if not.
109
- @function _validate($query, $errors: true) {
110
- @if not list.index($_primitive-token-registry, $query) {
111
- @if $errors {
112
- @error 'Invalid primitive token: #{$query}. Expecting a valid primitive token.';
113
- }
114
- @return false;
115
- }
116
-
117
- @return true;
118
- }
@@ -1,27 +0,0 @@
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 'tools-color';
24
- @forward 'tools-helpers';
25
- @forward 'tools-sentro';
26
- @forward 'tools-string' as str-*;
27
- @forward 'tools-validation';