@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,98 +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 '../theme';
24
- @use '../tools';
25
- @use 'sass:map';
26
- @use 'sass:list';
27
- @use 'struct-utils' as util;
28
- @use 'struct-validators' as validator;
29
-
30
- /// Base mixin for apply() and bind()
31
- /// @access private
32
- @mixin _base($component, $theme, $settings: ()) {
33
- $_init-settings: ('intent': create);
34
- $_settings: map.merge($_init-settings, $settings);
35
-
36
- /// @type string
37
- $intent: map.get($_settings, 'intent');
38
-
39
- $width: map.get($theme, 'width');
40
- $height: map.get($theme, 'height');
41
- $radius: theme.theme-get($theme, 'radius');
42
- $padding: theme.theme-get($theme, 'padding');
43
- $margin: theme.theme-get($theme, 'margin');
44
- $gap: theme.theme-get($theme, 'gap');
45
- $shadow: theme.theme-get($theme, 'shadow');
46
- $border-style: theme.theme-get($theme, 'border-style');
47
- $border-width: theme.theme-get($theme, 'border-width');
48
-
49
- @if tools.is-type($theme, 'map', $custom-error: '$theme is expecting a map. Map was not given.') {
50
- @include validator.validate-struct-props(map.keys($theme)) {
51
- @if $width {
52
- @include util.width($component, $width, $intent);
53
- }
54
- @if $height {
55
- @include util.height($component, $height, $intent);
56
- }
57
- @if $radius {
58
- @include util.radius($component, $radius, $intent);
59
- }
60
- @if $padding {
61
- @include util.padding($component, $padding, $intent);
62
- }
63
- @if $margin {
64
- @include util.margin($component, $margin, $intent);
65
- }
66
- @if $gap {
67
- @include util.gap($component, $gap, $intent);
68
- }
69
- @if $border-width {
70
- @include util.border-width($component, $border-width, $intent);
71
- }
72
- @if $border-style {
73
- @include util.border-style($component, $border-style, $intent);
74
- }
75
- @if $shadow {
76
- @include util.shadow($component, $shadow, $intent);
77
- }
78
- }
79
- }
80
- }
81
-
82
- /// Mixin that applies struct styles to a component.
83
- /// @param {string} $component
84
- /// @param {map<string, string>} $theme
85
- /// @return {void} void.
86
- @mixin apply($component, $theme) {
87
- @include _base($component, $theme);
88
- }
89
-
90
- /// Mixin that binds struct styles to a component with existing keys.
91
- /// @param {string} $component
92
- /// @param {map<string, string>} $theme
93
- /// @return {void} void.
94
- @mixin bind($component, $theme) {
95
- @include _base($component, $theme, (
96
- 'intent': bind
97
- ));
98
- }
@@ -1,218 +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 '../theme';
24
- @use '../tokens';
25
- @use '../tools';
26
- @use 'sass:map';
27
- @use 'sass:list';
28
-
29
- $_valid-arbitrary-values: (0, inherit);
30
-
31
- /// Mixin for applying width.
32
- /// @param {string} $component
33
- /// @param {map<string, any>|number|width} $width
34
- /// @param {string} $intent
35
- /// @return {void} width styles.
36
- @mixin width($component, $width, $intent: 'create') {
37
- @if tools.is-type($width, 'map', $errors: false) {
38
- $min: map.get($width, 'min');
39
- $default: map.get($width, 'default');
40
- $max: map.get($width, 'max');
41
-
42
- @if $min {
43
- @include theme.property(
44
- min-width,
45
- ('#{$component}-min-width', theme.token-switch('width.#{$min}', $min)),
46
- $intent
47
- );
48
- }
49
- @if $default {
50
- @include theme.property(
51
- width,
52
- ('#{$component}-width', theme.token-switch('width.#{$default}', $default)),
53
- $intent
54
- );
55
- }
56
- @if $max {
57
- @include theme.property(
58
- max-width,
59
- ('#{$component}-max-width', theme.token-switch('width.#{$max}', $max)),
60
- $intent
61
- );
62
- }
63
- } @else {
64
- @include theme.property(
65
- width,
66
- ('#{$component}-width', theme.token-switch('width.#{$width}', $width)),
67
- $intent
68
- );
69
- }
70
- }
71
-
72
- /// Mixin for applying height.
73
- /// @param {string} $component
74
- /// @param {map<string, any>|number|height} $height
75
- /// @param {string} $intent
76
- /// @return {void} width styles.
77
- @mixin height($component, $height, $intent: 'create') {
78
- @if tools.is-type($height, 'map', $errors: false) {
79
- $min: map.get($height, 'min');
80
- $default: map.get($height, 'default');
81
- $max: map.get($height, 'max');
82
-
83
- @if $min {
84
- @include theme.property(
85
- min-height,
86
- ('#{$component}-min-height', theme.token-switch('height.#{$min}', $min)),
87
- $intent
88
- );
89
- }
90
- @if $default {
91
- @include theme.property(
92
- height,
93
- ('#{$component}-height', theme.token-switch('height.#{$default}', $default)),
94
- $intent
95
- );
96
- }
97
- @if $max {
98
- @include theme.property(
99
- max-height,
100
- ('#{$component}-max-height', theme.token-switch('height.#{$max}', $max)),
101
- $intent
102
- );
103
- }
104
- } @else {
105
- @include theme.property(
106
- height,
107
- ('#{$component}-height', theme.token-switch('height.#{$height}', $height)),
108
- $intent
109
- );
110
- }
111
- }
112
-
113
- /// Mixin for applying radii.
114
- /// @param {string} $component
115
- /// @param {list<token|number>|token|number} $radius
116
- /// @param {string} $intent
117
- /// @return {void} radii styles.
118
- @mixin radius($component, $radius, $intent: 'create') {
119
- @include theme.property(
120
- border-radius,
121
- ('#{$component}-radius', _parse-value('radius', $radius)),
122
- $intent
123
- );
124
- }
125
-
126
- /// Mixin for applying padding.
127
- /// @param {string} $component
128
- /// @param {list<token|number>|token|number} $padding
129
- /// @param {string} $intent
130
- /// @return {void} padding styles.
131
- @mixin padding($component, $padding, $intent: 'create') {
132
- @include theme.property(
133
- padding,
134
- ('#{$component}-padding', _parse-value('padding', $padding)),
135
- $intent
136
- );
137
- }
138
-
139
- /// Mixin for applying margin.
140
- /// @param {string} $component
141
- /// @param {list<token|number>|token|number} $margin
142
- /// @param {string} $intent
143
- /// @return {void} margin styles.
144
- @mixin margin($component, $margin, $intent: 'create') {
145
- @include theme.property(
146
- margin,
147
- ('#{$component}-margin', _parse-value('margin', $margin)),
148
- $intent
149
- );
150
- }
151
-
152
- /// Mixin for applying border width.
153
- /// @param {string} $component
154
- /// @param {token|number} $border-width
155
- /// @param {string} $intent
156
- /// @return {void} border width styles.
157
- @mixin border-width($component, $border-width, $intent: 'create') {
158
- @include theme.property(
159
- border-width,
160
- ('#{$component}-border-width', _parse-value('border', $border-width)),
161
- $intent
162
- );
163
- }
164
-
165
- /// Mixin for applying border style.
166
- /// @param {string} $component
167
- /// @param {string} $border-style
168
- /// @param {string} $intent
169
- /// @return {void} border style styles.
170
- @mixin border-style($component, $border-style, $intent: 'create') {
171
- @include theme.property(
172
- border-style,
173
- ('#{$component}-border-style', $border-style),
174
- $intent
175
- );
176
- }
177
-
178
- /// Mixin for applying shadow.
179
- /// @param {string} $component
180
- /// @param {token} $shadow
181
- /// @param {string} $intent
182
- /// @return {void} shadow styles.
183
- @mixin shadow($component, $shadow, $intent: 'create') {
184
- @include theme.property(
185
- box-shadow,
186
- ('#{$component}-shadow', theme.token-switch('shadow-#{$shadow}', tokens.primitive-token-switch('shadow.#{$shadow}', $shadow))),
187
- $intent
188
- );
189
- }
190
-
191
- /// Mixin for applying gap.
192
- /// @param {string} $component
193
- /// @param {token} $gap
194
- /// @param {string} $intent
195
- /// @return {void} gap styles.
196
- @mixin gap($component, $gap, $intent: 'create') {
197
- @include theme.property(
198
- gap,
199
- ('#{$component}-gap', theme.token-switch('gap-#{$gap}', tokens.primitive-token-switch('gap.#{$gap}', $gap))),
200
- $intent
201
- );
202
- }
203
-
204
- /// Value parser for the shape setter mixins.
205
- /// @access private
206
- @function _parse-value($key, $query) {
207
- $result: ();
208
- @each $value in $query {
209
- @if theme.token-check('#{$key}-#{$value}') or tokens.primitive-token-check('#{$key}.#{$value}') {
210
- $result: list.append($result,
211
- theme.token-switch('#{$key}-#{$value}', tokens.primitive-token-switch('#{$key}.#{$value}', $value)),
212
- 'space');
213
- } @else {
214
- $result: list.append($result, $value, 'space');
215
- }
216
- }
217
- @return $result;
218
- }
@@ -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 'sass:map';
24
- @use 'sass:list';
25
-
26
- /// Valid component props
27
- /// @access private
28
- $_valid-props: (
29
- 'width',
30
- 'height',
31
- 'radius',
32
- 'padding',
33
- 'margin',
34
- 'gap',
35
- 'shadow',
36
- 'border-style',
37
- 'border-width'
38
- );
39
-
40
- /// Validates a set of structure props.
41
- /// @param {map} $props
42
- /// @access protected
43
- @mixin validate-struct-props($props) {
44
- @each $prop in $props {
45
- @if _is-struct-prop($prop) { }
46
- }
47
- @content;
48
- }
49
-
50
- /// Validates a structure prop.
51
- /// @access private
52
- @function _is-struct-prop($query) {
53
- @if not list.index($_valid-props, $query) {
54
- @error 'Invalid/unrecognized prop: #{$query}. Please use one of the following props: #{$_valid-props}.'
55
- }
56
- @return true;
57
- }
@@ -1,30 +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
- $expressive-inks: false !default;
24
-
25
- @forward 'theme-keys' as key-*;
26
- @forward 'theme-tokens' as token-*;
27
- @forward 'theme-setters' with ($expressive-inks: $expressive-inks);
28
- @forward 'theme-properties';
29
- @forward 'theme-get';
30
- @forward 'theme-merge';
@@ -1,41 +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
-
27
- /// Retrieves a value from a theme map by key.
28
- /// @param {map} $map
29
- /// @param {string} $key
30
- /// @return {*} value.
31
- @function theme-get($map, $key, $keys...) {
32
- $final-map: map.get($map, $key, $keys...);
33
- @if tools.is-type($final-map, 'map', $errors: false) {
34
- $map-keys: map.keys($final-map);
35
- @if not list.index($map-keys, 'default') {
36
- @error 'Missing `default` key in theme map. Please specify a key, or add a `default` key with a value.';
37
- }
38
- @return map.get($final-map, 'default');
39
- }
40
- @return $final-map;
41
- }
@@ -1,43 +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
-
25
- @function create($key, $value) {
26
- @return sentro.key-create($key, $value);
27
- }
28
-
29
- @function get($key) {
30
- @return sentro.key-get($key);
31
- }
32
-
33
- @function get-raw($key) {
34
- @return sentro.key-get-raw($key);
35
- }
36
-
37
- @function check($key) {
38
- @return sentro.key-check($key);
39
- }
40
-
41
- @mixin bind($key, $value) {
42
- @include sentro.key-bind($key, $value);
43
- }
@@ -1,46 +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 'sass:map';
24
- @use 'sass:list';
25
- @use 'sass:meta';
26
-
27
- /// Merges two or more Sass maps into a single map.
28
- /// @param {map} $base-map
29
- /// @param {map...} $modifying-maps
30
- /// @return {map} The merged map.
31
- @function theme-merge($base-map, $modifying-maps...) {
32
- $final-merged-map: ();
33
- @each $modifying-map in $modifying-maps {
34
- $final-merged-map: map.merge($final-merged-map, _smart-merge($base-map, $modifying-map));
35
- }
36
- @return $final-merged-map;
37
- }
38
-
39
- /// Merges two maps into one based on the GS theme map spec.
40
- /// @access private
41
- /// @param {map} $base-map
42
- /// @param {map} $modifying-map
43
- /// @return {map} The merged map.
44
- @function _smart-merge($base-map, $modifying-map) {
45
- @return map.deep-merge($base-map, $modifying-map);
46
- }
@@ -1,61 +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 '../tokens' as primitive-token;
24
- @use '../tools';
25
- @use 'sass:map';
26
- @use 'sass:list';
27
- @use 'sass:string';
28
-
29
- @use 'theme-tokens' as token;
30
- @use 'theme-keys' as key;
31
-
32
- $_valid-intents: (
33
- 'create',
34
- 'bind'
35
- );
36
-
37
- @mixin property($property, $values, $intent: 'create') {
38
- $key: list.nth($values, 1);
39
- $value: list.nth($values, 2);
40
-
41
- @if not list.index($_valid-intents, $intent) {
42
- @error 'Invalid intent: #{$intent}. Expecting a valid intent: #{$_valid-intents}.';
43
- }
44
-
45
- @if $intent == 'bind' {
46
- @include key.bind($key, _assert-value($value));
47
- } @else if $intent == 'create' {
48
- #{$property}: key.create($key, _assert-value($value));
49
- }
50
- }
51
-
52
- @function _assert-value($query) {
53
- @if tools.is-type($query, 'list', false) {
54
- @if list.length($query) == 2 and
55
- token.check(list.nth($query, 1)) or primitive-token.primitive-token-check(list.nth($query, 1)) and
56
- list.nth($query, 2) == string.unquote('!important') {
57
- @return token.switch(list.nth($query, 1), primitive-token.primitive-token-switch(list.nth($query, 1))) + ' ' + list.nth($query, 2);
58
- }
59
- }
60
- @return token.switch($query, primitive-token.primitive-token-switch($query));
61
- }