@matteusan/himig 1.5.0 → 1.7.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.
- package/README.md +2 -2
- package/_index.scss +5 -23
- package/ms-badge/_badge-base.scss +1 -1
- package/ms-badge/_badge-extend.scss +1 -1
- package/ms-badge/_badge-styles.scss +1 -1
- package/ms-button/_button-base.scss +1 -1
- package/ms-button/_button-extend.scss +1 -1
- package/ms-button/_button-mixins.scss +1 -1
- package/ms-button/_button-styles.scss +26 -26
- package/ms-card/_card-base.scss +3 -3
- package/ms-card/_card-extend.scss +1 -1
- package/ms-card/_card-styles.scss +6 -1
- package/ms-card/_card-theme.scss +8 -3
- package/ms-form-field/_form-field-base.scss +6 -2
- package/ms-form-field/_form-field-extend.scss +1 -1
- package/ms-form-field/_form-field-styles.scss +15 -11
- package/ms-form-field/_form-field-theme.scss +20 -8
- package/ms-link/_link-base.scss +1 -1
- package/ms-link/_link-extend.scss +1 -1
- package/ms-link/_link-styles.scss +1 -1
- package/ms-link/_link-theme.scss +4 -4
- package/ms-list/_list-base.scss +1 -1
- package/ms-list/_list-extend.scss +1 -1
- package/ms-list/_list-styles.scss +1 -1
- package/ms-select-field/_select-field-base.scss +1 -1
- package/ms-select-field/_select-field-extend.scss +1 -1
- package/ms-select-field/_select-field-styles.scss +18 -10
- package/ms-select-field/_select-field-theme.scss +16 -8
- package/ms-tick-field/_tick-field-base.scss +1 -1
- package/ms-tick-field/_tick-field-extend.scss +1 -1
- package/ms-tick-field/_tick-field-styles.scss +3 -14
- package/ms-tick-field/_tick-field-theme.scss +5 -0
- package/ms-utils/_color-utils.scss +1 -1
- package/ms-utils/_consts.scss +1 -1
- package/ms-utils/_layout-utils.scss +1 -1
- package/ms-utils/_struct-utils.scss +1 -1
- package/ms-utils/_typography-utils.scss +1 -1
- package/ms-utils/_util-helpers.scss +1 -1
- package/package.json +11 -3
- package/pintig/README.md +0 -2
- package/pintig/_index.scss +0 -77
- package/pintig/breakpoint/_breakpoint-sentro.scss +0 -53
- package/pintig/breakpoint/_index.scss +0 -23
- package/pintig/color/_color-constants.scss +0 -33
- package/pintig/color/_color-setters.scss +0 -75
- package/pintig/color/_color-utils.scss +0 -62
- package/pintig/color/_color-validators.scss +0 -59
- package/pintig/color/_index.scss +0 -25
- package/pintig/component/_component-extend.scss +0 -56
- package/pintig/component/_index.scss +0 -23
- package/pintig/component/component-base.ts +0 -81
- package/pintig/component/component-properties.ts +0 -25
- package/pintig/component/index.ts +0 -29
- package/pintig/component/types/ms-component.d.ts +0 -24
- package/pintig/index.ts +0 -29
- package/pintig/package.json +0 -15
- package/pintig/sprite/_index.scss +0 -23
- package/pintig/sprite/_sprite-mixins.scss +0 -29
- package/pintig/struct/_index.scss +0 -24
- package/pintig/struct/_struct-setters.scss +0 -98
- package/pintig/struct/_struct-utils.scss +0 -218
- package/pintig/struct/_struct-validators.scss +0 -57
- package/pintig/theme/_index.scss +0 -30
- package/pintig/theme/_theme-get.scss +0 -41
- package/pintig/theme/_theme-keys.scss +0 -43
- package/pintig/theme/_theme-merge.scss +0 -46
- package/pintig/theme/_theme-properties.scss +0 -61
- package/pintig/theme/_theme-setters.scss +0 -167
- package/pintig/theme/_theme-tokens.scss +0 -57
- package/pintig/tokens/_index.scss +0 -23
- package/pintig/tokens/_token-data.scss +0 -249
- package/pintig/tokens/_token-methods.scss +0 -118
- package/pintig/tools/_index.scss +0 -27
- package/pintig/tools/_tools-color.scss +0 -79
- package/pintig/tools/_tools-helpers.scss +0 -30
- package/pintig/tools/_tools-sentro.scss +0 -52
- package/pintig/tools/_tools-string.scss +0 -45
- package/pintig/tools/_tools-validation.scss +0 -71
- package/pintig/typography/_index.scss +0 -24
- package/pintig/typography/_typography-setters.scss +0 -78
- package/pintig/typography/_typography-utils.scss +0 -76
- package/pintig/typography/_typography-validators.scss +0 -47
|
@@ -1,81 +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
|
-
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
|
-
}
|
|
@@ -1,25 +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
|
-
export function accessProperty(customProperty: string): string {
|
|
24
|
-
return `--ms-${customProperty}`;
|
|
25
|
-
}
|
|
@@ -1,29 +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
|
-
import { MSComponentBase } from './component-base';
|
|
24
|
-
import { accessProperty } from './component-properties';
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
MSComponentBase,
|
|
28
|
-
accessProperty
|
|
29
|
-
};
|
|
@@ -1,24 +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
|
-
type Component = 'button' | 'card' | 'dialog' | 'overview' | 'form-field' | 'select-field' | 'tag' | 'button-group' | 'profile' | 'title-bar';
|
|
24
|
-
export type MSComponent = `ms-${Component}`;
|
package/pintig/index.ts
DELETED
|
@@ -1,29 +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
|
-
import { MSComponent } from './component/types/ms-component';
|
|
24
|
-
import { MSComponentBase } from './component';
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
MSComponent,
|
|
28
|
-
MSComponentBase
|
|
29
|
-
}
|
package/pintig/package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//---------------------------------------------------
|
|
2
|
-
// Copyright (c) 2024 MatteuSan
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
// in the Software without restriction, including without limitation the rights
|
|
7
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
// furnished to do so, subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
// copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
// SOFTWARE.
|
|
21
|
-
//---------------------------------------------------
|
|
22
|
-
|
|
23
|
-
@forward 'sprite-mixins';
|
|
@@ -1,29 +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
|
-
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//---------------------------------------------------
|
|
2
|
-
// Copyright (c) 2024 MatteuSan
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
// in the Software without restriction, including without limitation the rights
|
|
7
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
// furnished to do so, subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
// copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
// SOFTWARE.
|
|
21
|
-
//---------------------------------------------------
|
|
22
|
-
|
|
23
|
-
@forward 'struct-utils';
|
|
24
|
-
@forward 'struct-setters';
|
|
@@ -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
|
-
}
|