@matteusan/himig 1.0.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.
Files changed (82) hide show
  1. package/README.md +29 -0
  2. package/_index.scss +219 -0
  3. package/_init-font-pack.scss +809 -0
  4. package/ms-badge/_badge-base.scss +45 -0
  5. package/ms-badge/_badge-extend.scss +53 -0
  6. package/ms-badge/_badge-styles.scss +43 -0
  7. package/ms-badge/_badge-theme.scss +47 -0
  8. package/ms-badge/_index.scss +24 -0
  9. package/ms-button/_button-base.scss +76 -0
  10. package/ms-button/_button-extend.scss +53 -0
  11. package/ms-button/_button-mixins.scss +191 -0
  12. package/ms-button/_button-styles.scss +210 -0
  13. package/ms-button/_button-theme.scss +67 -0
  14. package/ms-button/_index.scss +24 -0
  15. package/ms-core/_index.scss +76 -0
  16. package/ms-core/breakpoint/_breakpoint-sentro.scss +53 -0
  17. package/ms-core/breakpoint/_index.scss +23 -0
  18. package/ms-core/color/_color-constants.scss +33 -0
  19. package/ms-core/color/_color-setters.scss +75 -0
  20. package/ms-core/color/_color-utils.scss +62 -0
  21. package/ms-core/color/_color-validators.scss +59 -0
  22. package/ms-core/color/_index.scss +25 -0
  23. package/ms-core/component/component-base.ts +81 -0
  24. package/ms-core/component/component-properties.ts +25 -0
  25. package/ms-core/component/index.ts +29 -0
  26. package/ms-core/component/types/ms-component.d.ts +24 -0
  27. package/ms-core/index.ts +29 -0
  28. package/ms-core/sprite/_index.scss +23 -0
  29. package/ms-core/sprite/_sprite-mixins.scss +29 -0
  30. package/ms-core/struct/_index.scss +24 -0
  31. package/ms-core/struct/_struct-setters.scss +98 -0
  32. package/ms-core/struct/_struct-utils.scss +222 -0
  33. package/ms-core/struct/_struct-validators.scss +57 -0
  34. package/ms-core/theme/_index.scss +30 -0
  35. package/ms-core/theme/_theme-get.scss +41 -0
  36. package/ms-core/theme/_theme-keys.scss +43 -0
  37. package/ms-core/theme/_theme-merge.scss +46 -0
  38. package/ms-core/theme/_theme-properties.scss +52 -0
  39. package/ms-core/theme/_theme-setters.scss +139 -0
  40. package/ms-core/theme/_theme-tokens.scss +57 -0
  41. package/ms-core/tokens/_index.scss +23 -0
  42. package/ms-core/tokens/_token-data.scss +242 -0
  43. package/ms-core/tokens/_token-methods.scss +98 -0
  44. package/ms-core/tools/_index.scss +26 -0
  45. package/ms-core/tools/_tools-color.scss +79 -0
  46. package/ms-core/tools/_tools-sentro.scss +52 -0
  47. package/ms-core/tools/_tools-string.scss +45 -0
  48. package/ms-core/tools/_tools-validation.scss +71 -0
  49. package/ms-core/typography/_index.scss +24 -0
  50. package/ms-core/typography/_typography-setters.scss +78 -0
  51. package/ms-core/typography/_typography-utils.scss +76 -0
  52. package/ms-core/typography/_typography-validators.scss +47 -0
  53. package/ms-form-field/_form-field-base.scss +113 -0
  54. package/ms-form-field/_form-field-extend.scss +53 -0
  55. package/ms-form-field/_form-field-styles.scss +212 -0
  56. package/ms-form-field/_form-field-theme.scss +63 -0
  57. package/ms-form-field/_index.scss +24 -0
  58. package/ms-item-card/_index.scss +24 -0
  59. package/ms-item-card/_item-card-base.scss +96 -0
  60. package/ms-item-card/_item-card-extend.scss +53 -0
  61. package/ms-item-card/_item-card-styles.scss +64 -0
  62. package/ms-item-card/_item-card-theme.scss +66 -0
  63. package/ms-list/_index.scss +24 -0
  64. package/ms-list/_list-base.scss +62 -0
  65. package/ms-list/_list-extend.scss +53 -0
  66. package/ms-list/_list-styles.scss +77 -0
  67. package/ms-list/_list-theme.scss +59 -0
  68. package/ms-sprite/_index.scss +23 -0
  69. package/ms-sprite/_sprite-styles.scss +57 -0
  70. package/ms-surface/_index.scss +24 -0
  71. package/ms-surface/_surface-base.scss +111 -0
  72. package/ms-surface/_surface-extend.scss +53 -0
  73. package/ms-surface/_surface-styles.scss +88 -0
  74. package/ms-surface/_surface-theme.scss +55 -0
  75. package/ms-utils/_color-utils.scss +99 -0
  76. package/ms-utils/_consts.scss +25 -0
  77. package/ms-utils/_index.scss +26 -0
  78. package/ms-utils/_layout-utils.scss +307 -0
  79. package/ms-utils/_struct-utils.scss +322 -0
  80. package/ms-utils/_typography-utils.scss +167 -0
  81. package/ms-utils/_util-helpers.scss +54 -0
  82. package/package.json +15 -0
@@ -0,0 +1,210 @@
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 'button-base' as base;
26
+ @use 'button-theme' as theme;
27
+ @use 'button-mixins' as style;
28
+
29
+ $_states: (
30
+ 'success',
31
+ 'warning',
32
+ 'error'
33
+ );
34
+
35
+ @mixin render(
36
+ $color: (),
37
+ $struct: (),
38
+ $typography: (),
39
+ $settings: ()
40
+ ) {
41
+ $color: ms-core.theme-merge(theme.$init-color, $color);
42
+ $struct: ms-core.theme-merge(theme.$init-struct, $struct);
43
+ $typography: ms-core.theme-merge(theme.$init-typography, $typography);
44
+ $settings: ms-core.theme-merge(theme.$init-settings, $settings);
45
+
46
+ $fills: (
47
+ default: ms-core.theme-get($color, 'fill'),
48
+ hover: ms-core.theme-get($color, 'fill', 'hover'),
49
+ focus: ms-core.theme-get($color, 'fill', 'focus'),
50
+ active: ms-core.theme-get($color, 'fill', 'active'),
51
+ disabled: ms-core.theme-get($color, 'fill', 'disabled'),
52
+ );
53
+
54
+ $inks: (
55
+ default: ms-core.theme-get($color, 'ink'),
56
+ hover: ms-core.theme-get($color, 'ink', 'hover'),
57
+ focus: ms-core.theme-get($color, 'ink', 'focus'),
58
+ active: ms-core.theme-get($color, 'ink', 'active'),
59
+ disabled: ms-core.theme-get($color, 'ink', 'disabled'),
60
+ );
61
+
62
+ $borders: (
63
+ default: ms-core.theme-get($color, 'border'),
64
+ hover: ms-core.theme-get($color, 'border', 'hover'),
65
+ focus: ms-core.theme-get($color, 'border', 'focus'),
66
+ active: ms-core.theme-get($color, 'border', 'active'),
67
+ disabled: ms-core.theme-get($color, 'border', 'disabled'),
68
+ );
69
+
70
+ @include base.init() {
71
+ @include ms-core.struct-apply('button', $struct);
72
+ @include ms-core.typography-apply('button', $typography);
73
+ @include ms-core.color-apply('button', (
74
+ fill: 'ms-grey.400',
75
+ ink: 'ms-grey.800',
76
+ border: 'ms-grey.400',
77
+ ));
78
+ @include style.text(
79
+ $fills: $fills,
80
+ $inks: $inks,
81
+ $borders: $borders,
82
+ );
83
+ outline-offset: 2px;
84
+
85
+ &:where(.is-icon-only) {
86
+ @include ms-core.struct-bind('button', (
87
+ width: (min: auto),
88
+ padding: list.nth(ms-core.theme-get($struct, 'padding'), 1)
89
+ ));
90
+
91
+ > .ms-button__label {
92
+ display: none;
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': '#{$state}-800',
105
+ ),
106
+ $inks: (
107
+ 'default': '#{$state}-ink',
108
+ 'disabled': '#{$state}-800'
109
+ ),
110
+ $borders: (
111
+ 'default': '#{$state}-400',
112
+ 'hover': '#{$state}-300',
113
+ 'focus': '#{$state}-400',
114
+ 'active': '#{$state}-200',
115
+ 'disabled': '#{$state}-800',
116
+ )
117
+ );
118
+ }
119
+ }
120
+
121
+ &:where(.is-fullwidth) {
122
+ @include ms-core.struct-width('button', (
123
+ default: 100%,
124
+ min: auto,
125
+ max: 100%
126
+ ), 'bind');
127
+ }
128
+
129
+ &:where(.is-outlined) {
130
+ @include style.outlined(
131
+ $fills: $fills,
132
+ $inks: $inks,
133
+ $borders: $borders,
134
+ );
135
+
136
+ @each $state in $_states {
137
+ &:where(.is-#{$state}) {
138
+ @include style.outlined(
139
+ $fills: (
140
+ 'default': '#{$state}-400',
141
+ 'hover': '#{$state}-300',
142
+ 'focus': '#{$state}-400',
143
+ 'active': '#{$state}-200',
144
+ 'disabled': '#{$state}-800',
145
+ ),
146
+ $inks: (
147
+ 'default': '#{$state}-ink',
148
+ 'disabled': '#{$state}-800'
149
+ ),
150
+ $borders: (
151
+ 'default': '#{$state}-400',
152
+ 'hover': '#{$state}-300',
153
+ 'focus': '#{$state}-400',
154
+ 'active': '#{$state}-200',
155
+ 'disabled': '#{$state}-800',
156
+ )
157
+ );
158
+ }
159
+ }
160
+ }
161
+
162
+ &:where(.is-filled) {
163
+ @include style.filled(
164
+ $fills: $fills,
165
+ $inks: $inks,
166
+ $borders: $borders,
167
+ );
168
+
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': '#{$state}-800',
178
+ ),
179
+ $inks: (
180
+ 'default': '#{$state}-ink',
181
+ 'disabled': '#{$state}-600'
182
+ ),
183
+ $borders: (
184
+ 'default': '#{$state}-400',
185
+ 'hover': '#{$state}-300',
186
+ 'focus': '#{$state}-400',
187
+ 'active': '#{$state}-200',
188
+ 'disabled': '#{$state}-800',
189
+ )
190
+ );
191
+ }
192
+ }
193
+
194
+ &:where(.is-raised) {
195
+ &:not(:disabled) {
196
+ @include ms-core.struct-shadow('button', 'xs');
197
+
198
+ &:hover,
199
+ &:focus {
200
+ @include ms-core.struct-shadow('button', 'xs');
201
+ }
202
+
203
+ &:active {
204
+ @include ms-core.struct-shadow('button', 'sm');
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,67 @@
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
+ $init-color: (
24
+ fill: (
25
+ default: 'accent-400',
26
+ hover: 'accent-300',
27
+ active: 'accent-200',
28
+ focus: 'accent-400',
29
+ disabled: 'undefined-300',
30
+ ),
31
+ ink: (
32
+ default: 'accent-ink',
33
+ hover: 'accent-ink',
34
+ active: 'accent-ink',
35
+ focus: 'accent-ink',
36
+ disabled: 'undefined-600',
37
+ ),
38
+ border: (
39
+ default: 'accent-400',
40
+ hover: 'accent-300',
41
+ active: 'accent-200',
42
+ focus: 'accent-400',
43
+ disabled: 'undefined-300',
44
+ ),
45
+ );
46
+
47
+ $init-struct: (
48
+ width: (
49
+ default: 100%,
50
+ min: 69px,
51
+ max: max-content
52
+ ),
53
+ padding: ('sm' 'md'),
54
+ radius: 'small',
55
+ border-width: 'xs',
56
+ border-style: solid,
57
+ gap: 'xs'
58
+ );
59
+
60
+ $init-typography: (
61
+ family: 'global',
62
+ size: 'body',
63
+ weight: 'bold',
64
+ line-height: 'condensed'
65
+ );
66
+
67
+ $init-settings: ();
@@ -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 'button-styles';
24
+ @forward 'button-extend';
@@ -0,0 +1,76 @@
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
+ $module-mode: false !default;
24
+ $test-mode: $module-mode !default;
25
+ $vue-mode: $test-mode !default;
26
+ $validation: if($vue-mode == true, false, true);
27
+ $expressive-inks: false !default;
28
+
29
+ /// @type map
30
+ /// @description helper variable for inheriting values for all color properties
31
+ $color-inherit-template: (
32
+ fill: inherit,
33
+ ink: inherit,
34
+ border: inherit
35
+ );
36
+
37
+ /// @type map
38
+ /// @description helper variable for inheriting values for all struct properties
39
+ $struct-inherit-template: (
40
+ width: inherit,
41
+ height: inherit,
42
+ radius: inherit,
43
+ padding: inherit,
44
+ margin: inherit,
45
+ gap: inherit,
46
+ border-width: inherit,
47
+ border-style: inherit,
48
+ shadow: inherit
49
+ );
50
+
51
+ /// @type map
52
+ /// @description helper variable for inheriting values for all typography properties
53
+ $type-inherit-template: (
54
+ family: inherit,
55
+ size: inherit,
56
+ weight: inherit,
57
+ line-height: inherit
58
+ );
59
+
60
+ @use 'node_modules/@matteusan/sentro' with (
61
+ $prefix: 'ms',
62
+ $context: 'theme',
63
+ $token-validation: $validation,
64
+ $key-validation: $validation,
65
+ $breakpoint-validation: $validation,
66
+ );
67
+
68
+ @forward 'tokens';
69
+ @forward 'theme' with ($expressive-inks: $expressive-inks);
70
+ @forward 'tools';
71
+ @forward 'breakpoint' as breakpoint-*;
72
+
73
+ @forward 'color' as color-*;
74
+ @forward 'struct' as struct-*;
75
+ @forward 'sprite' as sprite-*;
76
+ @forward 'typography' as typography-*;
@@ -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 '../tools';
24
+ @use 'node_modules/@matteusan/sentro';
25
+ @use 'sass:map';
26
+ @use 'sass:meta';
27
+
28
+ $_registry: ();
29
+
30
+ @mixin config($map: (), $breakpoints...) {
31
+ @if not tools.is-empty($map) {
32
+ @each $key, $value in $map {
33
+ $_registry: map.set($_registry, $key, $value) !global;
34
+ }
35
+ }
36
+ @if meta.keywords($breakpoints) {
37
+ @each $key, $value in meta.keywords($breakpoints) {
38
+ $_registry: map.set($_registry, $key, $value) !global;
39
+ }
40
+ }
41
+ @include sentro.breakpoint-config($map, $breakpoints...);
42
+ }
43
+
44
+ @mixin create($query) {
45
+ @include sentro.breakpoint-create($query) {
46
+ @content;
47
+ }
48
+ }
49
+
50
+ /// @access protected
51
+ @function registry-get() {
52
+ @return $_registry;
53
+ }
@@ -0,0 +1,23 @@
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 'breakpoint-sentro';
@@ -0,0 +1,33 @@
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
+ $fill-default-opacity: 0%;
24
+ $fill-hover-opacity: 20%;
25
+ $fill-focus-opacity: 20%;
26
+ $fill-active-opacity: 33%;
27
+
28
+ $border-default-opacity: 0%;
29
+ $border-hover-opacity: 2%;
30
+ $border-focus-opacity: 2%;
31
+ $border-active-opacity: 3.3%;
32
+
33
+ $outline-focus-opacity: 50%;
@@ -0,0 +1,75 @@
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
+
28
+ @use 'color-utils' as util;
29
+ @use 'color-validators' as validator;
30
+
31
+ @mixin _base($component, $theme, $settings: ()) {
32
+ $_init-settings: (intent: 'create');
33
+ $_settings: map.merge($_init-settings, $settings);
34
+
35
+ /// @type string
36
+ $intent: map.get($_settings, 'intent');
37
+
38
+ $fill: theme.theme-get($theme, 'fill');
39
+ $ink: theme.theme-get($theme, 'ink');
40
+ $border: theme.theme-get($theme, 'border');
41
+
42
+ @if not tools.is-type($theme, 'map') {
43
+ @error '$theme is expecting a map. Map was not given.';
44
+ } @else {
45
+ @include validator.validate-color-props(map.keys($theme)) {
46
+ @if $fill {
47
+ @include util.fill($component, $fill, $intent);
48
+ }
49
+ @if $ink {
50
+ @include util.ink($component, $ink, $intent);
51
+ }
52
+ @if $border {
53
+ @include util.border($component, $border, $intent);
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ /// Mixin that applies color styles to a component.
60
+ /// @param {string} $component
61
+ /// @param {map<string, string>} $theme
62
+ /// @return {void} void.
63
+ @mixin apply($component, $theme) {
64
+ @include _base($component, $theme);
65
+ }
66
+
67
+ /// Mixin that binds color styles to a component with existing keys.
68
+ /// @param {string} $component
69
+ /// @param {map<string, string>} $theme
70
+ /// @return {void} void.
71
+ @mixin bind($component, $theme) {
72
+ @include _base($component, $theme, (
73
+ 'intent': bind
74
+ ));
75
+ }
@@ -0,0 +1,62 @@
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
+
25
+ /// Mixin for applying background colors.
26
+ /// @param {string} $component
27
+ /// @param {token|color} $color
28
+ /// @param {string} $intent
29
+ /// @return {void} background color styles.
30
+ @mixin fill($component, $color, $intent: 'create') {
31
+ @include theme.property(
32
+ background-color,
33
+ ('#{$component}-fill', $color),
34
+ $intent
35
+ );
36
+ }
37
+
38
+ /// Mixin for applying text colors.
39
+ /// @param {string} $component
40
+ /// @param {token|color} $color
41
+ /// @param {string} $intent
42
+ /// @return {void} text color styles.
43
+ @mixin ink($component, $color, $intent: 'create') {
44
+ @include theme.property(
45
+ color,
46
+ ('#{$component}-ink', $color),
47
+ $intent
48
+ );
49
+ }
50
+
51
+ /// Mixin for applying border colors.
52
+ /// @param {string} $component
53
+ /// @param {token|color} $color
54
+ /// @param {string} $intent
55
+ /// @return {void} border color styles.
56
+ @mixin border($component, $color, $intent: 'create') {
57
+ @include theme.property(
58
+ border-color,
59
+ ('#{$component}-border', $color),
60
+ $intent
61
+ );
62
+ }