@matteusan/himig 1.4.1 → 1.5.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 (81) 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 +1 -1
  10. package/ms-card/_card-extend.scss +1 -1
  11. package/ms-card/_card-styles.scss +1 -1
  12. package/ms-form-field/_form-field-base.scss +1 -1
  13. package/ms-form-field/_form-field-extend.scss +1 -1
  14. package/ms-form-field/_form-field-styles.scss +1 -1
  15. package/ms-link/_index.scss +24 -0
  16. package/ms-link/_link-base.scss +29 -0
  17. package/ms-link/_link-extend.scss +53 -0
  18. package/ms-link/_link-styles.scss +70 -0
  19. package/ms-link/_link-theme.scss +41 -0
  20. package/ms-list/_list-base.scss +1 -1
  21. package/ms-list/_list-extend.scss +1 -1
  22. package/ms-list/_list-styles.scss +1 -1
  23. package/ms-select-field/_select-field-base.scss +1 -1
  24. package/ms-select-field/_select-field-extend.scss +1 -1
  25. package/ms-select-field/_select-field-styles.scss +1 -1
  26. package/ms-tick-field/_tick-field-base.scss +1 -1
  27. package/ms-tick-field/_tick-field-extend.scss +1 -1
  28. package/ms-tick-field/_tick-field-styles.scss +1 -1
  29. package/ms-utils/_color-utils.scss +1 -1
  30. package/ms-utils/_consts.scss +1 -1
  31. package/ms-utils/_layout-utils.scss +1 -1
  32. package/ms-utils/_struct-utils.scss +1 -1
  33. package/ms-utils/_typography-utils.scss +1 -1
  34. package/ms-utils/_util-helpers.scss +1 -1
  35. package/package.json +1 -1
  36. package/pintig/README.md +2 -0
  37. package/pintig/_index.scss +77 -0
  38. package/pintig/breakpoint/_breakpoint-sentro.scss +53 -0
  39. package/pintig/breakpoint/_index.scss +23 -0
  40. package/pintig/color/_color-constants.scss +33 -0
  41. package/pintig/color/_color-setters.scss +75 -0
  42. package/pintig/color/_color-utils.scss +62 -0
  43. package/pintig/color/_color-validators.scss +59 -0
  44. package/pintig/color/_index.scss +25 -0
  45. package/pintig/component/_component-extend.scss +56 -0
  46. package/pintig/component/_index.scss +23 -0
  47. package/pintig/component/component-base.ts +81 -0
  48. package/pintig/component/component-properties.ts +25 -0
  49. package/pintig/component/index.ts +29 -0
  50. package/pintig/component/types/ms-component.d.ts +24 -0
  51. package/pintig/index.ts +29 -0
  52. package/pintig/package.json +15 -0
  53. package/pintig/sprite/_index.scss +23 -0
  54. package/pintig/sprite/_sprite-mixins.scss +29 -0
  55. package/pintig/struct/_index.scss +24 -0
  56. package/pintig/struct/_struct-setters.scss +98 -0
  57. package/pintig/struct/_struct-utils.scss +218 -0
  58. package/pintig/struct/_struct-validators.scss +57 -0
  59. package/pintig/theme/_index.scss +30 -0
  60. package/pintig/theme/_theme-get.scss +41 -0
  61. package/pintig/theme/_theme-keys.scss +43 -0
  62. package/pintig/theme/_theme-merge.scss +46 -0
  63. package/pintig/theme/_theme-properties.scss +61 -0
  64. package/pintig/theme/_theme-setters.scss +167 -0
  65. package/pintig/theme/_theme-tokens.scss +57 -0
  66. package/pintig/tokens/_index.scss +23 -0
  67. package/pintig/tokens/_token-data.scss +249 -0
  68. package/pintig/tokens/_token-methods.scss +118 -0
  69. package/pintig/tools/_index.scss +27 -0
  70. package/pintig/tools/_tools-color.scss +79 -0
  71. package/pintig/tools/_tools-helpers.scss +30 -0
  72. package/pintig/tools/_tools-sentro.scss +52 -0
  73. package/pintig/tools/_tools-string.scss +45 -0
  74. package/pintig/tools/_tools-validation.scss +71 -0
  75. package/pintig/typography/_index.scss +24 -0
  76. package/pintig/typography/_typography-setters.scss +78 -0
  77. package/pintig/typography/_typography-utils.scss +76 -0
  78. package/pintig/typography/_typography-validators.scss +47 -0
  79. package/.yarn/cache/@matteusan-pintig-npm-1.4.0-f3aee090a2-725049469f.zip +0 -0
  80. package/.yarn/cache/@matteusan-sentro-npm-0.1.25-9dadcacaf9-2964e33fdc.zip +0 -0
  81. package/.yarn/install-state.gz +0 -0
@@ -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
+ }
@@ -0,0 +1,59 @@
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
+
25
+ /// Valid component props
26
+ /// @access private
27
+ $_valid-props: ('fill', 'ink', 'border');
28
+ $_valid-colors: (
29
+ inherit,
30
+ currentColor,
31
+ transparent,
32
+ rgba(0, 0, 0, 0),
33
+ rgba(0 0 0 / 0)
34
+ );
35
+
36
+ /// Validates a set of color props.
37
+ /// @param {map} $props
38
+ /// @access protected
39
+ @mixin validate-color-props($props) {
40
+ @each $prop in $props {
41
+ @if _is-color-prop($prop) { }
42
+ }
43
+ @content;
44
+ }
45
+
46
+ /// Validates a color query.
47
+ /// @access private
48
+ @function _is-valid-color($color) {
49
+ //
50
+ }
51
+
52
+ /// Validates a color prop.
53
+ /// @access private
54
+ @function _is-color-prop($query) {
55
+ @if not list.index($_valid-props, $query) {
56
+ @error 'Invalid color prop: #{$query}. Expecting a valid color prop: #{$_valid-props}.';
57
+ }
58
+ @return true;
59
+ }
@@ -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.0",
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';