@matteusan/himig 1.4.1 → 1.5.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 (85) hide show
  1. package/_index.scss +2 -2
  2. package/ms-badge/_badge-base.scss +1 -1
  3. package/ms-badge/_badge-extend.scss +1 -1
  4. package/ms-badge/_badge-styles.scss +1 -1
  5. package/ms-button/_button-base.scss +1 -1
  6. package/ms-button/_button-extend.scss +1 -1
  7. package/ms-button/_button-mixins.scss +1 -1
  8. package/ms-button/_button-styles.scss +1 -1
  9. package/ms-card/_card-base.scss +3 -3
  10. package/ms-card/_card-extend.scss +1 -1
  11. package/ms-card/_card-styles.scss +6 -1
  12. package/ms-card/_card-theme.scss +8 -3
  13. package/ms-form-field/_form-field-base.scss +6 -2
  14. package/ms-form-field/_form-field-extend.scss +1 -1
  15. package/ms-form-field/_form-field-styles.scss +15 -11
  16. package/ms-form-field/_form-field-theme.scss +20 -8
  17. package/ms-link/_index.scss +24 -0
  18. package/ms-link/_link-base.scss +29 -0
  19. package/ms-link/_link-extend.scss +53 -0
  20. package/ms-link/_link-styles.scss +70 -0
  21. package/ms-link/_link-theme.scss +41 -0
  22. package/ms-list/_list-base.scss +1 -1
  23. package/ms-list/_list-extend.scss +1 -1
  24. package/ms-list/_list-styles.scss +1 -1
  25. package/ms-select-field/_select-field-base.scss +1 -1
  26. package/ms-select-field/_select-field-extend.scss +1 -1
  27. package/ms-select-field/_select-field-styles.scss +18 -10
  28. package/ms-select-field/_select-field-theme.scss +16 -8
  29. package/ms-tick-field/_tick-field-base.scss +1 -1
  30. package/ms-tick-field/_tick-field-extend.scss +1 -1
  31. package/ms-tick-field/_tick-field-styles.scss +3 -14
  32. package/ms-tick-field/_tick-field-theme.scss +5 -0
  33. package/ms-utils/_color-utils.scss +1 -1
  34. package/ms-utils/_consts.scss +1 -1
  35. package/ms-utils/_layout-utils.scss +1 -1
  36. package/ms-utils/_struct-utils.scss +1 -1
  37. package/ms-utils/_typography-utils.scss +1 -1
  38. package/ms-utils/_util-helpers.scss +1 -1
  39. package/package.json +1 -1
  40. package/pintig/README.md +2 -0
  41. package/pintig/_index.scss +77 -0
  42. package/pintig/breakpoint/_breakpoint-sentro.scss +53 -0
  43. package/pintig/breakpoint/_index.scss +23 -0
  44. package/pintig/color/_color-constants.scss +33 -0
  45. package/pintig/color/_color-setters.scss +75 -0
  46. package/pintig/color/_color-utils.scss +62 -0
  47. package/pintig/color/_color-validators.scss +59 -0
  48. package/pintig/color/_index.scss +25 -0
  49. package/pintig/component/_component-extend.scss +56 -0
  50. package/pintig/component/_index.scss +23 -0
  51. package/pintig/component/component-base.ts +81 -0
  52. package/pintig/component/component-properties.ts +25 -0
  53. package/pintig/component/index.ts +29 -0
  54. package/pintig/component/types/ms-component.d.ts +24 -0
  55. package/pintig/index.ts +29 -0
  56. package/pintig/package.json +15 -0
  57. package/pintig/sprite/_index.scss +23 -0
  58. package/pintig/sprite/_sprite-mixins.scss +29 -0
  59. package/pintig/struct/_index.scss +24 -0
  60. package/pintig/struct/_struct-setters.scss +98 -0
  61. package/pintig/struct/_struct-utils.scss +218 -0
  62. package/pintig/struct/_struct-validators.scss +57 -0
  63. package/pintig/theme/_index.scss +30 -0
  64. package/pintig/theme/_theme-get.scss +41 -0
  65. package/pintig/theme/_theme-keys.scss +43 -0
  66. package/pintig/theme/_theme-merge.scss +46 -0
  67. package/pintig/theme/_theme-properties.scss +61 -0
  68. package/pintig/theme/_theme-setters.scss +167 -0
  69. package/pintig/theme/_theme-tokens.scss +57 -0
  70. package/pintig/tokens/_index.scss +23 -0
  71. package/pintig/tokens/_token-data.scss +249 -0
  72. package/pintig/tokens/_token-methods.scss +118 -0
  73. package/pintig/tools/_index.scss +27 -0
  74. package/pintig/tools/_tools-color.scss +79 -0
  75. package/pintig/tools/_tools-helpers.scss +30 -0
  76. package/pintig/tools/_tools-sentro.scss +52 -0
  77. package/pintig/tools/_tools-string.scss +45 -0
  78. package/pintig/tools/_tools-validation.scss +71 -0
  79. package/pintig/typography/_index.scss +24 -0
  80. package/pintig/typography/_typography-setters.scss +78 -0
  81. package/pintig/typography/_typography-utils.scss +76 -0
  82. package/pintig/typography/_typography-validators.scss +47 -0
  83. package/.yarn/cache/@matteusan-pintig-npm-1.4.0-f3aee090a2-725049469f.zip +0 -0
  84. package/.yarn/cache/@matteusan-sentro-npm-0.1.25-9dadcacaf9-2964e33fdc.zip +0 -0
  85. package/.yarn/install-state.gz +0 -0
@@ -0,0 +1,25 @@
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 'color-constants';
24
+ @forward 'color-setters';
25
+ @forward 'color-utils';
@@ -0,0 +1,56 @@
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:list';
24
+ @use 'sass:string';
25
+ @use '../tools';
26
+
27
+ @mixin extend($component-name, $extension) {
28
+ $_extensions: tools.str-split($extension, '.');
29
+ $_sanitized-extension: '';
30
+
31
+ @each $ext in $_extensions {
32
+ @if list.index($_extensions, $ext) == 1 {
33
+ @if string.slice($ext, 1, 3) == 'is-' {
34
+ $_sanitized-extension: $_sanitized-extension + string.slice($ext, 4);
35
+ } @else {
36
+ $_sanitized-extension: $_sanitized-extension + $ext;
37
+ }
38
+ } @else if list.index($_extensions, $ext) == list.length($_extensions) {
39
+ @if string.slice($ext, 1, 3) == 'is-' {
40
+ $_sanitized-extension: $_sanitized-extension + '.#{$ext}';
41
+ } @else {
42
+ $_sanitized-extension: $_sanitized-extension + '.is-#{$ext}';
43
+ }
44
+ } @else {
45
+ @if string.slice($ext, 1, 3) == 'is-' {
46
+ $_sanitized-extension: $_sanitized-extension + '.#{$ext}';
47
+ } @else {
48
+ $_sanitized-extension: $_sanitized-extension + '.is-#{$ext}';
49
+ }
50
+ }
51
+ }
52
+
53
+ .ms-#{$component-name}.is-#{$_sanitized-extension} {
54
+ @content;
55
+ }
56
+ }
@@ -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 'component-extend';
@@ -0,0 +1,81 @@
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
+ import { MSComponent } from './types/ms-component';
24
+ import { accessProperty } from './component-properties';
25
+
26
+ export class MSComponentBase {
27
+
28
+ protected GS_TARGET_COMPONENT: Element | HTMLElement | null;
29
+ protected GS_REFERENCE_COMPONENT: MSComponent;
30
+ protected GS_CUSTOM_PROPERTIES: string[];
31
+ private readonly GS_COMPONENT_NAME: string;
32
+
33
+ constructor(
34
+ targetComponent: Element | HTMLElement | null,
35
+ referenceComponent: MSComponent,
36
+ customProperties: string[],
37
+ ) {
38
+ this.GS_TARGET_COMPONENT = targetComponent;
39
+ this.GS_REFERENCE_COMPONENT = referenceComponent;
40
+ this.GS_CUSTOM_PROPERTIES = customProperties;
41
+ this.GS_COMPONENT_NAME = this.GS_REFERENCE_COMPONENT.substring(3);
42
+ }
43
+
44
+ addClass(className: string): void {
45
+ this.GS_TARGET_COMPONENT?.classList.add(className);
46
+ }
47
+
48
+ removeClass(className: string): void {
49
+ this.GS_TARGET_COMPONENT?.classList.remove(className);
50
+ }
51
+
52
+ hasClass(className: string): boolean {
53
+ return this.GS_TARGET_COMPONENT?.classList.contains(className) ?? false;
54
+ }
55
+
56
+ getClasses(): DOMTokenList|undefined {
57
+ return this.GS_TARGET_COMPONENT?.classList;
58
+ }
59
+
60
+ getComponent(): Element|HTMLElement|null {
61
+ return this.GS_TARGET_COMPONENT;
62
+ }
63
+
64
+ getReference(): MSComponent {
65
+ return this.GS_REFERENCE_COMPONENT;
66
+ }
67
+
68
+ getCustomProperty(query: string): string {
69
+ const prop: string = this.GS_CUSTOM_PROPERTIES[this.GS_CUSTOM_PROPERTIES.indexOf(query)];
70
+ return accessProperty(`${this.GS_COMPONENT_NAME}-${prop}`);
71
+ }
72
+
73
+ getCustomProperties(): string[] {
74
+ return this.GS_CUSTOM_PROPERTIES;
75
+ }
76
+
77
+ getId(): string|undefined {
78
+ return this.GS_TARGET_COMPONENT?.id;
79
+ }
80
+
81
+ }
@@ -0,0 +1,25 @@
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
+ export function accessProperty(customProperty: string): string {
24
+ return `--ms-${customProperty}`;
25
+ }
@@ -0,0 +1,29 @@
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
+ import { MSComponentBase } from './component-base';
24
+ import { accessProperty } from './component-properties';
25
+
26
+ export {
27
+ MSComponentBase,
28
+ accessProperty
29
+ };
@@ -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
+ type Component = 'button' | 'card' | 'dialog' | 'overview' | 'form-field' | 'select-field' | 'tag' | 'button-group' | 'profile' | 'title-bar';
24
+ export type MSComponent = `ms-${Component}`;
@@ -0,0 +1,29 @@
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
+ import { MSComponent } from './component/types/ms-component';
24
+ import { MSComponentBase } from './component';
25
+
26
+ export {
27
+ MSComponent,
28
+ MSComponentBase
29
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@matteusan/pintig",
3
+ "version": "1.5.1",
4
+ "description": "The core library for the Himig Design System. Portable to any design system.",
5
+ "main": "_index.scss",
6
+ "repository": "https://github.com/MatteuSan/himig",
7
+ "author": "Matteu <matteugt@gmail.com>",
8
+ "license": "MIT",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "dependencies": {
13
+ "@matteusan/sentro": "0.1.25"
14
+ }
15
+ }
@@ -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 'sprite-mixins';
@@ -0,0 +1,29 @@
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 styles() {
26
+ width: theme.key-create('sprite-width', var(--ms-sprite-size));
27
+ height: theme.key-create('sprite-height', var(--ms-sprite-size));
28
+ user-select: none;
29
+ }
@@ -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 'struct-utils';
24
+ @forward 'struct-setters';
@@ -0,0 +1,98 @@
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
+ }