@ptsecurity/mosaic 13.6.2 → 13.8.4
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/_theming.scss +289 -59
- package/_visual.scss +85 -14
- package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +4 -0
- package/design-tokens/legacy-2017/tokens/components/loader-overlay.json5 +23 -0
- package/design-tokens/legacy-2017/tokens/components/radio.json5 +11 -10
- package/design-tokens/legacy-2017/tokens/components/toast.json5 +54 -0
- package/design-tokens/legacy-2017/tokens/properties/globals.json5 +18 -18
- package/design-tokens/legacy-2017/tokens.d.ts +78 -8
- package/design-tokens/pt-2022/tokens/components/badge.json5 +1 -1
- package/design-tokens/pt-2022/tokens/components/button.json5 +1 -1
- package/design-tokens/pt-2022/tokens/components/checkbox.json5 +4 -0
- package/design-tokens/pt-2022/tokens/components/link.json5 +3 -3
- package/design-tokens/pt-2022/tokens/components/loader-overlay.json5 +23 -0
- package/design-tokens/pt-2022/tokens/components/radio.json5 +6 -3
- package/design-tokens/pt-2022/tokens/components/tags.json5 +1 -1
- package/design-tokens/pt-2022/tokens/components/toast.json5 +54 -0
- package/design-tokens/pt-2022/tokens/properties/colors.json5 +1 -1
- package/design-tokens/pt-2022/tokens/properties/globals.json5 +18 -18
- package/design-tokens/pt-2022/tokens.d.ts +85 -14
- package/design-tokens/style-dictionary/build.js +13 -0
- package/design-tokens/style-dictionary/configs/figma.js +11 -0
- package/design-tokens/style-dictionary/configs/index.js +3 -3
- package/design-tokens/style-dictionary/figma-types.js +41 -0
- package/design-tokens/style-dictionary/formats/figma.js +104 -0
- package/design-tokens/style-dictionary/transformGroups/figma.js +21 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-border.js +18 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-color.js +25 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-default.js +10 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-font.js +31 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-group.js +17 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-opacity.js +10 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-shadow.js +66 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-sizing.js +16 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-spacing.js +15 -0
- package/design-tokens/style-dictionary/transforms/attribute/figma-typography.js +24 -0
- package/design-tokens/style-dictionary/transforms/value/figma-values.js +7 -0
- package/esm2020/button/button.component.mjs +2 -2
- package/esm2020/design-tokens/legacy-2017/tokens.mjs +79 -9
- package/esm2020/design-tokens/pt-2022/tokens.mjs +86 -15
- package/esm2020/form-field/hint.mjs +18 -7
- package/esm2020/list/list-selection.component.mjs +4 -1
- package/esm2020/loader-overlay/index.mjs +2 -0
- package/esm2020/loader-overlay/loader-overlay.component.mjs +99 -0
- package/esm2020/loader-overlay/loader-overlay.module.mjs +50 -0
- package/esm2020/loader-overlay/ptsecurity-mosaic-loader-overlay.mjs +5 -0
- package/esm2020/loader-overlay/public-api.mjs +3 -0
- package/esm2020/modal/modal.component.mjs +11 -3
- package/esm2020/modal/modal.type.mjs +1 -1
- package/esm2020/navbar/navbar-item.component.mjs +29 -6
- package/esm2020/navbar/navbar.component.mjs +6 -4
- package/esm2020/navbar/vertical-navbar.component.mjs +3 -3
- package/esm2020/progress-spinner/progress-spinner.component.mjs +2 -2
- package/esm2020/radio/radio.component.mjs +3 -3
- package/esm2020/select/select.component.mjs +3 -3
- package/esm2020/toast/index.mjs +2 -0
- package/esm2020/toast/ptsecurity-mosaic-toast.mjs +5 -0
- package/esm2020/toast/public-api.mjs +6 -0
- package/esm2020/toast/toast-animations.mjs +9 -0
- package/esm2020/toast/toast-container.component.mjs +44 -0
- package/esm2020/toast/toast.component.mjs +89 -0
- package/esm2020/toast/toast.module.mjs +42 -0
- package/esm2020/toast/toast.service.mjs +178 -0
- package/esm2020/toast/toast.type.mjs +15 -0
- package/esm2020/tooltip/tooltip.component.mjs +2 -1
- package/esm2020/tree/tree-option.component.mjs +3 -2
- package/esm2020/tree/tree-selection.component.mjs +4 -2
- package/esm2020/tree-select/tree-select.component.mjs +12 -11
- package/fesm2015/ptsecurity-mosaic-button.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs +235 -24
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-form-field.mjs +16 -6
- package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-list.mjs +3 -0
- package/fesm2015/ptsecurity-mosaic-list.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-loader-overlay.mjs +155 -0
- package/fesm2015/ptsecurity-mosaic-loader-overlay.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-modal.mjs +11 -2
- package/fesm2015/ptsecurity-mosaic-modal.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-navbar.mjs +37 -11
- package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-radio.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-select.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-toast.mjs +363 -0
- package/fesm2015/ptsecurity-mosaic-toast.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs +1 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs +11 -10
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree.mjs +5 -2
- package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-button.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +235 -24
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-form-field.mjs +16 -6
- package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-list.mjs +3 -0
- package/fesm2020/ptsecurity-mosaic-list.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs +153 -0
- package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-modal.mjs +10 -2
- package/fesm2020/ptsecurity-mosaic-modal.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-navbar.mjs +34 -9
- package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-radio.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-select.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-toast.mjs +361 -0
- package/fesm2020/ptsecurity-mosaic-toast.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs +1 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs +11 -10
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-tree.mjs +5 -2
- package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -1
- package/form-field/hint.d.ts +10 -2
- package/loader-overlay/README.md +0 -0
- package/loader-overlay/index.d.ts +1 -0
- package/loader-overlay/loader-overlay.component.d.ts +33 -0
- package/loader-overlay/loader-overlay.module.d.ts +11 -0
- package/loader-overlay/package.json +10 -0
- package/loader-overlay/ptsecurity-mosaic-loader-overlay.d.ts +5 -0
- package/loader-overlay/public-api.d.ts +2 -0
- package/modal/modal.component.d.ts +3 -1
- package/modal/modal.type.d.ts +1 -0
- package/navbar/navbar-item.component.d.ts +9 -3
- package/package.json +20 -4
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
- package/toast/index.d.ts +1 -0
- package/toast/package.json +10 -0
- package/toast/ptsecurity-mosaic-toast.d.ts +5 -0
- package/toast/public-api.d.ts +5 -0
- package/toast/toast-animations.d.ts +4 -0
- package/toast/toast-container.component.d.ts +15 -0
- package/toast/toast.component.d.ts +35 -0
- package/toast/toast.module.d.ts +13 -0
- package/toast/toast.service.d.ts +49 -0
- package/toast/toast.type.d.ts +27 -0
- package/tooltip/tooltip.component.d.ts +1 -1
- package/tree/tree-selection.component.d.ts +1 -0
- package/schematics/collection.json +0 -4
- package/schematics/migration.json +0 -10
- package/schematics/ng-update/data/attribute-selectors.d.ts +0 -2
- package/schematics/ng-update/data/attribute-selectors.js +0 -5
- package/schematics/ng-update/data/attribute-selectors.js.map +0 -1
- package/schematics/ng-update/data/class-names.d.ts +0 -2
- package/schematics/ng-update/data/class-names.js +0 -5
- package/schematics/ng-update/data/class-names.js.map +0 -1
- package/schematics/ng-update/data/constructor-checks.d.ts +0 -2
- package/schematics/ng-update/data/constructor-checks.js +0 -5
- package/schematics/ng-update/data/constructor-checks.js.map +0 -1
- package/schematics/ng-update/data/css-selectors.d.ts +0 -2
- package/schematics/ng-update/data/css-selectors.js +0 -5
- package/schematics/ng-update/data/css-selectors.js.map +0 -1
- package/schematics/ng-update/data/element-selectors.d.ts +0 -2
- package/schematics/ng-update/data/element-selectors.js +0 -5
- package/schematics/ng-update/data/element-selectors.js.map +0 -1
- package/schematics/ng-update/data/index.d.ts +0 -10
- package/schematics/ng-update/data/index.js +0 -14
- package/schematics/ng-update/data/index.js.map +0 -1
- package/schematics/ng-update/data/input-names.d.ts +0 -2
- package/schematics/ng-update/data/input-names.js +0 -35
- package/schematics/ng-update/data/input-names.js.map +0 -1
- package/schematics/ng-update/data/method-call-checks.d.ts +0 -2
- package/schematics/ng-update/data/method-call-checks.js +0 -5
- package/schematics/ng-update/data/method-call-checks.js.map +0 -1
- package/schematics/ng-update/data/output-names.d.ts +0 -2
- package/schematics/ng-update/data/output-names.js +0 -5
- package/schematics/ng-update/data/output-names.js.map +0 -1
- package/schematics/ng-update/data/property-names.d.ts +0 -2
- package/schematics/ng-update/data/property-names.js +0 -5
- package/schematics/ng-update/data/property-names.js.map +0 -1
- package/schematics/ng-update/data/symbol-removal.d.ts +0 -2
- package/schematics/ng-update/data/symbol-removal.js +0 -5
- package/schematics/ng-update/data/symbol-removal.js.map +0 -1
- package/schematics/ng-update/index.d.ts +0 -2
- package/schematics/ng-update/index.js +0 -23
- package/schematics/ng-update/index.js.map +0 -1
- package/schematics/ng-update/update-9.0.0/mosaic-symbols.json +0 -255
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.d.ts +0 -7
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js +0 -154
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js.map +0 -1
- package/schematics/ng-update/upgrade-data.d.ts +0 -2
- package/schematics/ng-update/upgrade-data.js +0 -17
- package/schematics/ng-update/upgrade-data.js.map +0 -1
- package/schematics/tsconfig.json +0 -29
- package/schematics/tsconfig.lib-test.json +0 -8
- package/schematics/tsconfig.lib.json +0 -17
@@ -0,0 +1,21 @@
|
|
1
|
+
module.exports = (StyleDictionary) => {
|
2
|
+
|
3
|
+
StyleDictionary.registerTransformGroup({
|
4
|
+
name: 'mc/figma',
|
5
|
+
transforms: [
|
6
|
+
'attribute/cti',
|
7
|
+
"name/cti/kebab",
|
8
|
+
'mc-attribute/figma-group',
|
9
|
+
'mc-attribute/figma-border',
|
10
|
+
'mc-attribute/figma-typography',
|
11
|
+
'mc-attribute/figma-font',
|
12
|
+
'mc-attribute/figma-opacity',
|
13
|
+
'mc-attribute/figma-spacing',
|
14
|
+
'mc-attribute/figma-sizing',
|
15
|
+
'mc-attribute/figma-shadow',
|
16
|
+
'mc-attribute/figma-color',
|
17
|
+
'mc-attribute/figma-default',
|
18
|
+
'mc-value/figma-values',
|
19
|
+
]
|
20
|
+
});
|
21
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-border',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({ name, attributes }) => name.includes('border') && !attributes.figmaPropType,
|
8
|
+
transformer: ({ name, attributes }) => {
|
9
|
+
const props = {
|
10
|
+
width: figmaTypes.borderWidth,
|
11
|
+
radius: figmaTypes.borderRadius
|
12
|
+
};
|
13
|
+
const entry = Object.entries(props).find(([key]) => name.includes(key));
|
14
|
+
|
15
|
+
return entry ? { figmaPropType: entry[1] } : attributes;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
const COLOR_MAX_PARTS = 4;
|
4
|
+
|
5
|
+
module.exports = (styleDictionary) => {
|
6
|
+
styleDictionary.registerTransform({
|
7
|
+
name: 'mc-attribute/figma-color',
|
8
|
+
type: 'attribute',
|
9
|
+
matcher: ({name, value, attributes: { category, figmaPropType }}) => {
|
10
|
+
if (figmaPropType) {
|
11
|
+
return false;
|
12
|
+
}
|
13
|
+
|
14
|
+
const stringValue = value.toString();
|
15
|
+
const isColorValue = (
|
16
|
+
stringValue.startsWith('#') ||
|
17
|
+
stringValue.startsWith('rgba') ||
|
18
|
+
name.includes('color')
|
19
|
+
) && stringValue.split(' ').length <= COLOR_MAX_PARTS;
|
20
|
+
|
21
|
+
return isColorValue || category === 'palette';
|
22
|
+
},
|
23
|
+
transformer: () => ({ figmaPropType: figmaTypes.color })
|
24
|
+
});
|
25
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-default',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({ attributes }) => !attributes.figmaPropType,
|
8
|
+
transformer: () => ({ figmaPropType: figmaTypes.other })
|
9
|
+
});
|
10
|
+
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-font',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({ name, attributes }) => name.includes('font') && !attributes.figmaPropType,
|
8
|
+
transformer: ({ name, value }) => {
|
9
|
+
const props = {
|
10
|
+
family: figmaTypes.fontFamilies,
|
11
|
+
size: figmaTypes.fontSizes,
|
12
|
+
weight: figmaTypes.fontWeights,
|
13
|
+
height: figmaTypes.lineHeights,
|
14
|
+
spacing: figmaTypes.letterSpacing,
|
15
|
+
transform: figmaTypes.textCase,
|
16
|
+
settings: figmaTypes.fontFeatureSettings
|
17
|
+
};
|
18
|
+
const [, typeName] = Object.entries(props).find(([key]) => name.includes(key)) ?? [];
|
19
|
+
|
20
|
+
if (!typeName) {
|
21
|
+
return {
|
22
|
+
figmaPropType: 'typography',
|
23
|
+
figmaValue: `typography.${value}`,
|
24
|
+
figmaLink: true
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
return { figmaPropType: typeName };
|
29
|
+
}
|
30
|
+
});
|
31
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
const path = require('path');
|
2
|
+
|
3
|
+
const GROUP_BACK_STEP_INDEX = 2;
|
4
|
+
|
5
|
+
module.exports = (styleDictionary) => {
|
6
|
+
styleDictionary.registerTransform({
|
7
|
+
name: 'mc-attribute/figma-group',
|
8
|
+
type: 'attribute',
|
9
|
+
transformer: (prop) => {
|
10
|
+
const filePathParts = prop.filePath.split('/');
|
11
|
+
const group = filePathParts[filePathParts.length - GROUP_BACK_STEP_INDEX];
|
12
|
+
const subgroup = path.parse(prop.filePath).name;
|
13
|
+
|
14
|
+
return { group, subgroup };
|
15
|
+
}
|
16
|
+
});
|
17
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-opacity',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({ name, attributes }) => name.includes('opacity') && !attributes.figmaPropType,
|
8
|
+
transformer: () => ({ figmaPropType: figmaTypes.opacity })
|
9
|
+
});
|
10
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
const BLUR_SHADOW_INDEX = 2;
|
4
|
+
const SPREAD_SHADOW_INDEX = 3;
|
5
|
+
const X_SHADOW_INDEX = 0;
|
6
|
+
const Y_SHADOW_INDEX = 1;
|
7
|
+
const SHADOW_MIN_PARTS = 4;
|
8
|
+
|
9
|
+
function transformShadow(value) {
|
10
|
+
const isInnerShadow = value.includes('inset');
|
11
|
+
const valueParts = value.split(' ');
|
12
|
+
|
13
|
+
if (isInnerShadow) {
|
14
|
+
valueParts.shift();
|
15
|
+
}
|
16
|
+
|
17
|
+
return {
|
18
|
+
color: valueParts.pop(),
|
19
|
+
type: isInnerShadow ? 'innerShadow' : 'dropShadow',
|
20
|
+
x: valueParts[X_SHADOW_INDEX] ?? 0,
|
21
|
+
y: valueParts[Y_SHADOW_INDEX] ?? 0,
|
22
|
+
blur: valueParts[BLUR_SHADOW_INDEX] ?? 0,
|
23
|
+
spread: valueParts[SPREAD_SHADOW_INDEX] ?? 0
|
24
|
+
};
|
25
|
+
}
|
26
|
+
|
27
|
+
module.exports = (styleDictionary) => {
|
28
|
+
styleDictionary.registerTransform({
|
29
|
+
name: 'mc-attribute/figma-shadow',
|
30
|
+
type: 'attribute',
|
31
|
+
matcher: ({name, value, attributes }) => (
|
32
|
+
name.includes('shadow') &&
|
33
|
+
value.split(' ').length > SHADOW_MIN_PARTS &&
|
34
|
+
!attributes.figmaPropType
|
35
|
+
),
|
36
|
+
transformer: ({ value }) => {
|
37
|
+
const rgbaGroups = [];
|
38
|
+
let figmaValue = value;
|
39
|
+
|
40
|
+
const check = figmaValue.match(/(rgba\([\w\d\. \,]+\))/) ?? [];
|
41
|
+
|
42
|
+
for (let i = 1; i < check.length; i++) {
|
43
|
+
figmaValue = figmaValue.replace(check[i], `rgba${i - 1}`);
|
44
|
+
rgbaGroups.push(check[i]);
|
45
|
+
}
|
46
|
+
|
47
|
+
const shadowParts = figmaValue.split(',');
|
48
|
+
figmaValue = shadowParts.length > 1
|
49
|
+
? shadowParts.map(transformShadow)
|
50
|
+
: transformShadow(figmaValue);
|
51
|
+
|
52
|
+
rgbaGroups.forEach((rgbaValue, rgbaIndex) => {
|
53
|
+
if (Array.isArray(figmaValue)) {
|
54
|
+
figmaValue.forEach((shadow) => {
|
55
|
+
shadow.color = shadow.color.replace(`rgba${rgbaIndex}`, rgbaValue);
|
56
|
+
});
|
57
|
+
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
figmaValue.color = figmaValue.color.replace(`rgba${rgbaIndex}`, rgbaValue);
|
61
|
+
});
|
62
|
+
|
63
|
+
return { figmaPropType: figmaTypes.boxShadow, figmaValue };
|
64
|
+
}
|
65
|
+
});
|
66
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-sizing',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({name, attributes}) => (
|
8
|
+
(
|
9
|
+
name.includes('height') ||
|
10
|
+
name.includes('width') ||
|
11
|
+
name.includes('size')
|
12
|
+
) && !attributes.figmaPropType
|
13
|
+
),
|
14
|
+
transformer: () => ({ figmaPropType: figmaTypes.sizing })
|
15
|
+
});
|
16
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-spacing',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({name, attributes}) => (
|
8
|
+
(
|
9
|
+
name.includes('padding') ||
|
10
|
+
name.includes('margin')
|
11
|
+
) && !attributes.figmaPropType
|
12
|
+
),
|
13
|
+
transformer: (() => ({ figmaPropType: figmaTypes.spacing }))
|
14
|
+
});
|
15
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
const { figmaTypes } = require('../../figma-types');
|
2
|
+
|
3
|
+
module.exports = (styleDictionary) => {
|
4
|
+
styleDictionary.registerTransform({
|
5
|
+
name: 'mc-attribute/figma-typography',
|
6
|
+
type: 'attribute',
|
7
|
+
matcher: ({ name, attributes}) => name.includes('typography') && !attributes.figmaPropType,
|
8
|
+
transformer: ({ name, attributes }) => {
|
9
|
+
const props = {
|
10
|
+
spacing: figmaTypes.letterSpacing,
|
11
|
+
transform: figmaTypes.textCase,
|
12
|
+
settings: figmaTypes.fontFeatureSettings,
|
13
|
+
family: figmaTypes.fontFamily,
|
14
|
+
size: figmaTypes.fontSize,
|
15
|
+
weight: figmaTypes.fontWeight,
|
16
|
+
height: figmaTypes.lineHeight
|
17
|
+
};
|
18
|
+
|
19
|
+
const entry = Object.entries(props).find(([key]) => name.includes(key));
|
20
|
+
|
21
|
+
return entry ? { figmaPropType: entry[1] } : attributes;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
};
|
@@ -122,7 +122,7 @@ export class McButton extends McButtonMixinBase {
|
|
122
122
|
}
|
123
123
|
}
|
124
124
|
/** @nocollapse */ /** @nocollapse */ McButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: McButton, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
|
125
|
-
/** @nocollapse */ /** @nocollapse */ McButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: McButton, selector: "[mc-button]", inputs: { color: "color", tabIndex: "tabIndex", disabled: "disabled" }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur()" }, properties: { "attr.disabled": "disabled || null", "attr.tabIndex": "tabIndex" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"mc-button-wrapper\">\n <ng-content></ng-content>\n</div>\n<div class=\"mc-button-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: [".mc-icon-button,.mc-light-button,.mc-button{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;text-decoration:none;text-align:center;vertical-align:baseline;height:var(--mc-button-size-height, 32px);border:var(--mc-button-size-border-width, 1px) solid transparent;border-radius:var(--mc-button-size-border-radius, 4px)}.mc-icon-button::-moz-focus-inner,.mc-light-button::-moz-focus-inner,.mc-button::-moz-focus-inner{border:0}.mc-icon-button:focus,.mc-light-button:focus,.mc-button:focus{outline:none}[disabled].mc-icon-button,[disabled].mc-light-button,[disabled].mc-button{cursor:default}.cdk-focused.mc-icon-button,.cdk-focused.mc-light-button,.cdk-focused.mc-button{z-index:1}.mc-icon-button .mc-button-wrapper,.mc-light-button .mc-button-wrapper,.mc-button .mc-button-wrapper{display:flex;align-items:center}.mc-icon-button .mc-icon_left,.mc-light-button .mc-icon_left,.mc-button .mc-icon_left{margin-right:var(--mc-icon-button-size-left-icon-padding, 6px)}.mc-button{padding-left:var(--mc-button-size-horizontal-padding, 12px);padding-right:var(--mc-button-size-horizontal-padding, 12px)}.mc-icon-button{padding-left:var(--mc-icon-button-size-horizontal-padding, 8px);padding-right:var(--mc-icon-button-size-horizontal-padding, 8px)}.mc-button-overlay{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
125
|
+
/** @nocollapse */ /** @nocollapse */ McButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: McButton, selector: "[mc-button]", inputs: { color: "color", tabIndex: "tabIndex", disabled: "disabled" }, host: { listeners: { "focus": "onFocus($event)", "blur": "onBlur()" }, properties: { "attr.disabled": "disabled || null", "attr.tabIndex": "tabIndex" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"mc-button-wrapper\">\n <ng-content></ng-content>\n</div>\n<div class=\"mc-button-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: [".mc-icon-button,.mc-light-button,.mc-button{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;text-decoration:none;text-align:center;vertical-align:baseline;height:var(--mc-button-size-height, 32px);border:var(--mc-button-size-border-width, 1px) solid transparent;border-radius:var(--mc-button-size-border-radius, 4px)}.mc-icon-button::-moz-focus-inner,.mc-light-button::-moz-focus-inner,.mc-button::-moz-focus-inner{border:0}.mc-icon-button:focus,.mc-light-button:focus,.mc-button:focus{outline:none}[disabled].mc-icon-button,[disabled].mc-light-button,[disabled].mc-button{cursor:default}.cdk-focused.mc-icon-button,.cdk-focused.mc-light-button,.cdk-focused.mc-button{z-index:1}.mc-icon-button .mc-button-wrapper,.mc-light-button .mc-button-wrapper,.mc-button .mc-button-wrapper{display:flex;align-items:center}.mc-icon-button .mc-icon_left,.mc-light-button .mc-icon_left,.mc-button .mc-icon_left{margin-right:var(--mc-icon-button-size-left-icon-padding, 6px)}.mc-button{padding-left:var(--mc-button-size-horizontal-padding, 12px);padding-right:var(--mc-button-size-horizontal-padding, 12px)}.mc-icon-button{padding-left:calc(var(--mc-icon-button-size-horizontal-padding, 8px) - var(--mc-button-size-border-width, 1px));padding-right:calc(var(--mc-icon-button-size-horizontal-padding, 8px) - var(--mc-button-size-border-width, 1px))}.mc-button-overlay{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
126
126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: McButton, decorators: [{
|
127
127
|
type: Component,
|
128
128
|
args: [{ selector: '[mc-button]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['color', 'tabIndex'], host: {
|
@@ -130,7 +130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
130
130
|
'[attr.tabIndex]': 'tabIndex',
|
131
131
|
'(focus)': 'onFocus($event)',
|
132
132
|
'(blur)': 'onBlur()'
|
133
|
-
}, template: "<div class=\"mc-button-wrapper\">\n <ng-content></ng-content>\n</div>\n<div class=\"mc-button-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: [".mc-icon-button,.mc-light-button,.mc-button{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;text-decoration:none;text-align:center;vertical-align:baseline;height:var(--mc-button-size-height, 32px);border:var(--mc-button-size-border-width, 1px) solid transparent;border-radius:var(--mc-button-size-border-radius, 4px)}.mc-icon-button::-moz-focus-inner,.mc-light-button::-moz-focus-inner,.mc-button::-moz-focus-inner{border:0}.mc-icon-button:focus,.mc-light-button:focus,.mc-button:focus{outline:none}[disabled].mc-icon-button,[disabled].mc-light-button,[disabled].mc-button{cursor:default}.cdk-focused.mc-icon-button,.cdk-focused.mc-light-button,.cdk-focused.mc-button{z-index:1}.mc-icon-button .mc-button-wrapper,.mc-light-button .mc-button-wrapper,.mc-button .mc-button-wrapper{display:flex;align-items:center}.mc-icon-button .mc-icon_left,.mc-light-button .mc-icon_left,.mc-button .mc-icon_left{margin-right:var(--mc-icon-button-size-left-icon-padding, 6px)}.mc-button{padding-left:var(--mc-button-size-horizontal-padding, 12px);padding-right:var(--mc-button-size-horizontal-padding, 12px)}.mc-icon-button{padding-left:var(--mc-icon-button-size-horizontal-padding, 8px);padding-right:var(--mc-icon-button-size-horizontal-padding, 8px)}.mc-button-overlay{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:inherit}\n"] }]
|
133
|
+
}, template: "<div class=\"mc-button-wrapper\">\n <ng-content></ng-content>\n</div>\n<div class=\"mc-button-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: [".mc-icon-button,.mc-light-button,.mc-button{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;margin:0;white-space:nowrap;text-decoration:none;text-align:center;vertical-align:baseline;height:var(--mc-button-size-height, 32px);border:var(--mc-button-size-border-width, 1px) solid transparent;border-radius:var(--mc-button-size-border-radius, 4px)}.mc-icon-button::-moz-focus-inner,.mc-light-button::-moz-focus-inner,.mc-button::-moz-focus-inner{border:0}.mc-icon-button:focus,.mc-light-button:focus,.mc-button:focus{outline:none}[disabled].mc-icon-button,[disabled].mc-light-button,[disabled].mc-button{cursor:default}.cdk-focused.mc-icon-button,.cdk-focused.mc-light-button,.cdk-focused.mc-button{z-index:1}.mc-icon-button .mc-button-wrapper,.mc-light-button .mc-button-wrapper,.mc-button .mc-button-wrapper{display:flex;align-items:center}.mc-icon-button .mc-icon_left,.mc-light-button .mc-icon_left,.mc-button .mc-icon_left{margin-right:var(--mc-icon-button-size-left-icon-padding, 6px)}.mc-button{padding-left:var(--mc-button-size-horizontal-padding, 12px);padding-right:var(--mc-button-size-horizontal-padding, 12px)}.mc-icon-button{padding-left:calc(var(--mc-icon-button-size-horizontal-padding, 8px) - var(--mc-button-size-border-width, 1px));padding-right:calc(var(--mc-icon-button-size-horizontal-padding, 8px) - var(--mc-button-size-border-width, 1px))}.mc-button-overlay{position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:inherit}\n"] }]
|
134
134
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FocusMonitor }]; }, propDecorators: { disabled: [{
|
135
135
|
type: Input
|
136
136
|
}] } });
|