@ptsecurity/mosaic 14.7.0 → 14.7.2

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 (63) hide show
  1. package/_theming.scss +78 -54
  2. package/code-block/code-block.types.d.ts +0 -1
  3. package/datepicker/datepicker-input.directive.d.ts +1 -0
  4. package/design-tokens/style-dictionary/build.js +0 -13
  5. package/design-tokens/style-dictionary/configs/index.js +1 -3
  6. package/esm2020/autocomplete/autocomplete.component.mjs +2 -2
  7. package/esm2020/code-block/code-block.types.mjs +1 -1
  8. package/esm2020/core/version.mjs +2 -2
  9. package/esm2020/datepicker/calendar-body.component.mjs +2 -2
  10. package/esm2020/datepicker/calendar-header.component.mjs +1 -1
  11. package/esm2020/datepicker/datepicker-input.directive.mjs +12 -3
  12. package/esm2020/form-field/validate.directive.mjs +6 -7
  13. package/esm2020/popover/popover.component.mjs +6 -2
  14. package/esm2020/select/select.component.mjs +3 -3
  15. package/esm2020/timezone/timezone-select.component.mjs +2 -2
  16. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +2 -2
  17. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +1 -1
  18. package/fesm2015/ptsecurity-mosaic-core.mjs +1 -1
  19. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
  20. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +14 -5
  21. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  22. package/fesm2015/ptsecurity-mosaic-form-field.mjs +6 -6
  23. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -1
  24. package/fesm2015/ptsecurity-mosaic-popover.mjs +5 -1
  25. package/fesm2015/ptsecurity-mosaic-popover.mjs.map +1 -1
  26. package/fesm2015/ptsecurity-mosaic-select.mjs +2 -2
  27. package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -1
  28. package/fesm2015/ptsecurity-mosaic-timezone.mjs +2 -2
  29. package/fesm2015/ptsecurity-mosaic-timezone.mjs.map +1 -1
  30. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs +2 -2
  31. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +1 -1
  32. package/fesm2020/ptsecurity-mosaic-core.mjs +1 -1
  33. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
  34. package/fesm2020/ptsecurity-mosaic-datepicker.mjs +14 -5
  35. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  36. package/fesm2020/ptsecurity-mosaic-form-field.mjs +5 -6
  37. package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -1
  38. package/fesm2020/ptsecurity-mosaic-popover.mjs +5 -1
  39. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +1 -1
  40. package/fesm2020/ptsecurity-mosaic-select.mjs +2 -2
  41. package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -1
  42. package/fesm2020/ptsecurity-mosaic-timezone.mjs +2 -2
  43. package/fesm2020/ptsecurity-mosaic-timezone.mjs.map +1 -1
  44. package/form-field/validate.directive.d.ts +1 -1
  45. package/package.json +4 -4
  46. package/popover/popover.component.d.ts +1 -0
  47. package/prebuilt-themes/dark-theme.css +1 -1
  48. package/prebuilt-themes/default-theme.css +1 -1
  49. package/design-tokens/style-dictionary/configs/figma.js +0 -11
  50. package/design-tokens/style-dictionary/figma-types.js +0 -41
  51. package/design-tokens/style-dictionary/formats/figma.js +0 -104
  52. package/design-tokens/style-dictionary/transformGroups/figma.js +0 -21
  53. package/design-tokens/style-dictionary/transforms/attribute/figma-border.js +0 -18
  54. package/design-tokens/style-dictionary/transforms/attribute/figma-color.js +0 -25
  55. package/design-tokens/style-dictionary/transforms/attribute/figma-default.js +0 -10
  56. package/design-tokens/style-dictionary/transforms/attribute/figma-font.js +0 -31
  57. package/design-tokens/style-dictionary/transforms/attribute/figma-group.js +0 -17
  58. package/design-tokens/style-dictionary/transforms/attribute/figma-opacity.js +0 -10
  59. package/design-tokens/style-dictionary/transforms/attribute/figma-shadow.js +0 -66
  60. package/design-tokens/style-dictionary/transforms/attribute/figma-sizing.js +0 -16
  61. package/design-tokens/style-dictionary/transforms/attribute/figma-spacing.js +0 -15
  62. package/design-tokens/style-dictionary/transforms/attribute/figma-typography.js +0 -24
  63. package/design-tokens/style-dictionary/transforms/value/figma-values.js +0 -7
@@ -1,25 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
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
- };
@@ -1,31 +0,0 @@
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
- };
@@ -1,17 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
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
- };
@@ -1,66 +0,0 @@
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
- };
@@ -1,16 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
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
- };
@@ -1,24 +0,0 @@
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
- };
@@ -1,7 +0,0 @@
1
- module.exports = (styleDictionary) => {
2
- styleDictionary.registerTransform({
3
- name: 'mc-value/figma-values',
4
- type: 'value',
5
- transformer: ({ value }) => value === 'null' ? 'none' : value
6
- });
7
- };