@ptsecurity/mosaic 14.10.8 → 14.10.10

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 (129) hide show
  1. package/core/formatters/date/templates/tk-TM.d.ts +2 -0
  2. package/esm2020/core/formatters/date/formatter.mjs +18 -3
  3. package/esm2020/core/formatters/date/templates/tk-TM.mjs +358 -0
  4. package/esm2020/core/version.mjs +2 -2
  5. package/fesm2015/ptsecurity-mosaic-core.mjs +429 -57
  6. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
  7. package/fesm2020/ptsecurity-mosaic-core.mjs +429 -57
  8. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
  9. package/package.json +4 -4
  10. package/design-tokens/legacy-2017/tokens/components/alert.json5 +0 -83
  11. package/design-tokens/legacy-2017/tokens/components/autocomplete.json5 +0 -11
  12. package/design-tokens/legacy-2017/tokens/components/badge.json5 +0 -174
  13. package/design-tokens/legacy-2017/tokens/components/button-toggle.json5 +0 -11
  14. package/design-tokens/legacy-2017/tokens/components/button.json5 +0 -142
  15. package/design-tokens/legacy-2017/tokens/components/card.json5 +0 -51
  16. package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +0 -106
  17. package/design-tokens/legacy-2017/tokens/components/code-block.json5 +0 -704
  18. package/design-tokens/legacy-2017/tokens/components/datepicker.json5 +0 -73
  19. package/design-tokens/legacy-2017/tokens/components/divider.json5 +0 -14
  20. package/design-tokens/legacy-2017/tokens/components/dl.json5 +0 -38
  21. package/design-tokens/legacy-2017/tokens/components/dropdown.json5 +0 -48
  22. package/design-tokens/legacy-2017/tokens/components/form-field.json5 +0 -92
  23. package/design-tokens/legacy-2017/tokens/components/forms.json5 +0 -48
  24. package/design-tokens/legacy-2017/tokens/components/icon.json5 +0 -104
  25. package/design-tokens/legacy-2017/tokens/components/input.json5 +0 -12
  26. package/design-tokens/legacy-2017/tokens/components/link.json5 +0 -56
  27. package/design-tokens/legacy-2017/tokens/components/list.json5 +0 -13
  28. package/design-tokens/legacy-2017/tokens/components/loader-overlay.json5 +0 -23
  29. package/design-tokens/legacy-2017/tokens/components/markdown.json5 +0 -294
  30. package/design-tokens/legacy-2017/tokens/components/modal.json5 +0 -81
  31. package/design-tokens/legacy-2017/tokens/components/navbar.json5 +0 -70
  32. package/design-tokens/legacy-2017/tokens/components/optgroup.json5 +0 -10
  33. package/design-tokens/legacy-2017/tokens/components/option.json5 +0 -12
  34. package/design-tokens/legacy-2017/tokens/components/popover.json5 +0 -69
  35. package/design-tokens/legacy-2017/tokens/components/popup.json5 +0 -16
  36. package/design-tokens/legacy-2017/tokens/components/progress-bar.json5 +0 -13
  37. package/design-tokens/legacy-2017/tokens/components/progress-spinner.json5 +0 -16
  38. package/design-tokens/legacy-2017/tokens/components/radio.json5 +0 -47
  39. package/design-tokens/legacy-2017/tokens/components/scrollbars.json5 +0 -52
  40. package/design-tokens/legacy-2017/tokens/components/select.json5 +0 -24
  41. package/design-tokens/legacy-2017/tokens/components/sidepanel.json5 +0 -49
  42. package/design-tokens/legacy-2017/tokens/components/table.json5 +0 -15
  43. package/design-tokens/legacy-2017/tokens/components/tabs.json5 +0 -101
  44. package/design-tokens/legacy-2017/tokens/components/tags.json5 +0 -134
  45. package/design-tokens/legacy-2017/tokens/components/textarea.json5 +0 -12
  46. package/design-tokens/legacy-2017/tokens/components/timepicker.json5 +0 -7
  47. package/design-tokens/legacy-2017/tokens/components/timezone.json5 +0 -23
  48. package/design-tokens/legacy-2017/tokens/components/toast.json5 +0 -54
  49. package/design-tokens/legacy-2017/tokens/components/toggle.json5 +0 -79
  50. package/design-tokens/legacy-2017/tokens/components/tooltip.json5 +0 -83
  51. package/design-tokens/legacy-2017/tokens/components/tree.json5 +0 -15
  52. package/design-tokens/legacy-2017/tokens/properties/aliases.json5 +0 -3
  53. package/design-tokens/legacy-2017/tokens/properties/colors.json5 +0 -119
  54. package/design-tokens/legacy-2017/tokens/properties/font.json5 +0 -12
  55. package/design-tokens/legacy-2017/tokens/properties/globals.json5 +0 -49
  56. package/design-tokens/legacy-2017/tokens/properties/md-typography.json5 +0 -103
  57. package/design-tokens/legacy-2017/tokens/properties/padding.json5 +0 -3
  58. package/design-tokens/legacy-2017/tokens/properties/palette.json5 +0 -194
  59. package/design-tokens/legacy-2017/tokens/properties/typography.json5 +0 -184
  60. package/design-tokens/pt-2022/tokens/components/alert.json5 +0 -83
  61. package/design-tokens/pt-2022/tokens/components/autocomplete.json5 +0 -11
  62. package/design-tokens/pt-2022/tokens/components/badge.json5 +0 -174
  63. package/design-tokens/pt-2022/tokens/components/button-toggle.json5 +0 -11
  64. package/design-tokens/pt-2022/tokens/components/button.json5 +0 -142
  65. package/design-tokens/pt-2022/tokens/components/card.json5 +0 -51
  66. package/design-tokens/pt-2022/tokens/components/checkbox.json5 +0 -106
  67. package/design-tokens/pt-2022/tokens/components/code-block.json5 +0 -697
  68. package/design-tokens/pt-2022/tokens/components/datepicker.json5 +0 -73
  69. package/design-tokens/pt-2022/tokens/components/divider.json5 +0 -14
  70. package/design-tokens/pt-2022/tokens/components/dl.json5 +0 -38
  71. package/design-tokens/pt-2022/tokens/components/dropdown.json5 +0 -48
  72. package/design-tokens/pt-2022/tokens/components/form-field.json5 +0 -92
  73. package/design-tokens/pt-2022/tokens/components/forms.json5 +0 -48
  74. package/design-tokens/pt-2022/tokens/components/icon.json5 +0 -104
  75. package/design-tokens/pt-2022/tokens/components/input.json5 +0 -12
  76. package/design-tokens/pt-2022/tokens/components/link.json5 +0 -56
  77. package/design-tokens/pt-2022/tokens/components/list.json5 +0 -13
  78. package/design-tokens/pt-2022/tokens/components/loader-overlay.json5 +0 -23
  79. package/design-tokens/pt-2022/tokens/components/markdown.json5 +0 -294
  80. package/design-tokens/pt-2022/tokens/components/modal.json5 +0 -81
  81. package/design-tokens/pt-2022/tokens/components/navbar.json5 +0 -70
  82. package/design-tokens/pt-2022/tokens/components/optgroup.json5 +0 -10
  83. package/design-tokens/pt-2022/tokens/components/option.json5 +0 -12
  84. package/design-tokens/pt-2022/tokens/components/popover.json5 +0 -69
  85. package/design-tokens/pt-2022/tokens/components/popup.json5 +0 -16
  86. package/design-tokens/pt-2022/tokens/components/progress-bar.json5 +0 -13
  87. package/design-tokens/pt-2022/tokens/components/progress-spinner.json5 +0 -16
  88. package/design-tokens/pt-2022/tokens/components/radio.json5 +0 -48
  89. package/design-tokens/pt-2022/tokens/components/scrollbars.json5 +0 -52
  90. package/design-tokens/pt-2022/tokens/components/select.json5 +0 -24
  91. package/design-tokens/pt-2022/tokens/components/sidepanel.json5 +0 -48
  92. package/design-tokens/pt-2022/tokens/components/table.json5 +0 -15
  93. package/design-tokens/pt-2022/tokens/components/tabs.json5 +0 -101
  94. package/design-tokens/pt-2022/tokens/components/tags.json5 +0 -137
  95. package/design-tokens/pt-2022/tokens/components/textarea.json5 +0 -12
  96. package/design-tokens/pt-2022/tokens/components/timepicker.json5 +0 -7
  97. package/design-tokens/pt-2022/tokens/components/timezone.json5 +0 -23
  98. package/design-tokens/pt-2022/tokens/components/toast.json5 +0 -54
  99. package/design-tokens/pt-2022/tokens/components/toggle.json5 +0 -79
  100. package/design-tokens/pt-2022/tokens/components/tooltip.json5 +0 -83
  101. package/design-tokens/pt-2022/tokens/components/tree.json5 +0 -15
  102. package/design-tokens/pt-2022/tokens/properties/aliases.json5 +0 -3
  103. package/design-tokens/pt-2022/tokens/properties/colors.json5 +0 -122
  104. package/design-tokens/pt-2022/tokens/properties/font.json5 +0 -15
  105. package/design-tokens/pt-2022/tokens/properties/globals.json5 +0 -49
  106. package/design-tokens/pt-2022/tokens/properties/md-typography.json5 +0 -103
  107. package/design-tokens/pt-2022/tokens/properties/padding.json5 +0 -3
  108. package/design-tokens/pt-2022/tokens/properties/palette.json5 +0 -265
  109. package/design-tokens/pt-2022/tokens/properties/typography.json5 +0 -184
  110. package/design-tokens/style-dictionary/build.js +0 -65
  111. package/design-tokens/style-dictionary/configs/css.js +0 -13
  112. package/design-tokens/style-dictionary/configs/index.js +0 -44
  113. package/design-tokens/style-dictionary/configs/js.js +0 -9
  114. package/design-tokens/style-dictionary/configs/scss.js +0 -29
  115. package/design-tokens/style-dictionary/filters/color.js +0 -9
  116. package/design-tokens/style-dictionary/filters/md-typography.js +0 -7
  117. package/design-tokens/style-dictionary/filters/palette.js +0 -7
  118. package/design-tokens/style-dictionary/filters/size.js +0 -7
  119. package/design-tokens/style-dictionary/filters/typography.js +0 -7
  120. package/design-tokens/style-dictionary/formats/palette.js +0 -25
  121. package/design-tokens/style-dictionary/formats/typography.js +0 -52
  122. package/design-tokens/style-dictionary/transformGroups/css.js +0 -13
  123. package/design-tokens/style-dictionary/transformGroups/scss.js +0 -13
  124. package/design-tokens/style-dictionary/transformGroups/ts.js +0 -11
  125. package/design-tokens/style-dictionary/transforms/attribute/md-typography.js +0 -9
  126. package/design-tokens/style-dictionary/transforms/attribute/palette.js +0 -9
  127. package/design-tokens/style-dictionary/transforms/attribute/prefix.js +0 -11
  128. package/design-tokens/style-dictionary/transforms/attribute/size.js +0 -8
  129. package/design-tokens/style-dictionary/transforms/attribute/typography.js +0 -9
@@ -1,184 +0,0 @@
1
- {
2
- "typography": {
3
- "display-1": {
4
- "font-size": { value: '56px' },
5
- "line-height": { value: '76px' },
6
- "letter-spacing": { value: 'normal' },
7
- "font-weight": { value: 'normal' },
8
- "font-family": { value: '{font.family.accent}' },
9
- "text-transform": { value: 'null' },
10
- "font-feature-settings": { value: 'initial' }
11
- },
12
- "display-2": {
13
- "font-size": { value: '45px' },
14
- "line-height": { value: '56px' },
15
- "letter-spacing": { value: 'normal' },
16
- "font-weight": { value: 'normal' },
17
- "font-family": { value: '{font.family.accent}' },
18
- "text-transform": { value: 'null' },
19
- "font-feature-settings": { value: 'initial' }
20
- },
21
- "display-3": {
22
- "font-size": { value: '34px' },
23
- "line-height": { value: '44px' },
24
- "letter-spacing": { value: 'normal' },
25
- "font-weight": { value: 'normal' },
26
- "font-family": { value: '{font.family.accent}' },
27
- "text-transform": { value: 'null' },
28
- "font-feature-settings": { value: 'initial' }
29
- },
30
- "headline": {
31
- "font-size": { value: '24px' },
32
- "line-height": { value: '32px' },
33
- "letter-spacing": { value: 'normal' },
34
- "font-weight": { value: 'normal' },
35
- "font-family": { value: '{font.family.accent}' },
36
- "text-transform": { value: 'null' },
37
- "font-feature-settings": { value: 'initial' }
38
- },
39
- "title": {
40
- "font-size": { value: '20px' },
41
- "line-height": { value: '28px' },
42
- "letter-spacing": { value: 'normal' },
43
- "font-weight": { value: '600' },
44
- "font-family": { value: '{font.family.accent}' },
45
- "text-transform": { value: 'null' },
46
- "font-feature-settings": { value: 'initial' }
47
- },
48
- "subheading": {
49
- "font-size": { value: '15px' },
50
- "line-height": { value: '20px' },
51
- "letter-spacing": { value: '-0.009em' },
52
- "font-weight": { value: '600' },
53
- "font-family": { value: '{font.family.base}' },
54
- "text-transform": { value: 'null' },
55
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
56
- },
57
- "body": {
58
- "font-size": { value: '15px' },
59
- "line-height": { value: '20px' },
60
- "letter-spacing": { value: '-0.009em' },
61
- "font-weight": { value: 'normal' },
62
- "font-family": { value: '{font.family.base}' },
63
- "text-transform": { value: 'null' },
64
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
65
- },
66
- "body-tabular": {
67
- "font-size": { value: '15px' },
68
- "line-height": { value: '20px' },
69
- "letter-spacing": { value: '-0.009em' },
70
- "font-weight": { value: 'normal' },
71
- "font-family": { value: '{font.family.base}' },
72
- "text-transform": { value: 'null' },
73
- "font-feature-settings": { value: '"tnum" on, "ss01" on, "ss04" on' }
74
- },
75
- "body-strong": {
76
- "font-size": { value: '15px' },
77
- "line-height": { value: '20px' },
78
- "letter-spacing": { value: '-0.009em' },
79
- "font-weight": { value: '500' },
80
- "font-family": { value: '{font.family.base}' },
81
- "text-transform": { value: 'null' },
82
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
83
- },
84
- "body-caps": {
85
- "font-size": { value: '15px' },
86
- "line-height": { value: '20px' },
87
- "letter-spacing": { value: '1.7px' },
88
- "font-weight": { value: 'normal' },
89
- "font-family": { value: '{font.family.base}' },
90
- "text-transform": { value: 'uppercase' },
91
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
92
- },
93
- "body-mono": {
94
- "font-size": { value: '15px' },
95
- "line-height": { value: '20px' },
96
- "letter-spacing": { value: 'normal' },
97
- "font-weight": { value: 'normal' },
98
- "font-family": { value: '{font.family.monospace}' },
99
- "text-transform": { value: 'null' },
100
- "font-feature-settings": { value: 'initial' }
101
- },
102
- "caption": {
103
- "font-size": { value: '13px' },
104
- "line-height": { value: '16px' },
105
- "letter-spacing": { value: '-0.0025em' },
106
- "font-weight": { value: 'normal' },
107
- "font-family": { value: '{font.family.base}' },
108
- "text-transform": { value: 'null' },
109
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
110
- },
111
- "caption-tabular": {
112
- "font-size": { value: '13px' },
113
- "line-height": { value: '16px' },
114
- "letter-spacing": { value: '-0.0025em' },
115
- "font-weight": { value: 'normal' },
116
- "font-family": { value: '{font.family.base}' },
117
- "text-transform": { value: 'null' },
118
- "font-feature-settings": { value: '"tnum" on, "ss01" on, "ss04" on' }
119
- },
120
- "caption-strong": {
121
- "font-size": { value: '13px' },
122
- "line-height": { value: '16px' },
123
- "letter-spacing": { value: '-0.0025em' },
124
- "font-weight": { value: '500' },
125
- "font-family": { value: '{font.family.base}' },
126
- "text-transform": { value: 'null' },
127
- "font-feature-settings": { value: '"tnum" on, "ss01" on, "ss04" on' }
128
- },
129
- "caption-caps": {
130
- "font-size": { value: '13px' },
131
- "line-height": { value: '16px' },
132
- "letter-spacing": { value: '1.5px' },
133
- "font-weight": { value: 'normal' },
134
- "font-family": { value: '{font.family.base}' },
135
- "text-transform": { value: 'uppercase' },
136
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
137
- },
138
- "caption-mono": {
139
- "font-size": { value: '13px' },
140
- "line-height": { value: '16px' },
141
- "letter-spacing": { value: 'normal' },
142
- "font-weight": { value: 'normal' },
143
- "font-family": { value: '{font.family.monospace}' },
144
- "text-transform": { value: 'null' },
145
- "font-feature-settings": { value: 'initial' }
146
- },
147
- "small-text": {
148
- "font-size": { value: '13px' },
149
- "line-height": { value: '16px' },
150
- "letter-spacing": { value: '-0.0025em' },
151
- "font-weight": { value: 'normal' },
152
- "font-family": { value: '{font.family.base}' },
153
- "text-transform": { value: 'null' },
154
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
155
- },
156
- "extra-small-text": {
157
- "font-size": { value: '11px' },
158
- "line-height": { value: '16px' },
159
- "letter-spacing": { value: '0.005em' },
160
- "font-weight": { value: 'normal' },
161
- "font-family": { value: '{font.family.base}' },
162
- "text-transform": { value: 'null' },
163
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
164
- },
165
- "extra-small-text-caps": {
166
- "font-size": { value: '11px' },
167
- "line-height": { value: '16px' },
168
- "letter-spacing": { value: '1px' },
169
- "font-weight": { value: 'normal' },
170
- "font-family": { value: '{font.family.base}' },
171
- "text-transform": { value: 'uppercase' },
172
- "font-feature-settings": { value: '"ss01" on, "ss04" on' }
173
- },
174
- "extra-small-text-mono": {
175
- "font-size": { value: '11px' },
176
- "line-height": { value: '16px' },
177
- "letter-spacing": { value: '0px' },
178
- "font-weight": { value: 'normal' },
179
- "font-family": { value: '{font.family.monospace}' },
180
- "text-transform": { value: 'null' },
181
- "font-feature-settings": { value: 'initial' }
182
- }
183
- }
184
- }
@@ -1,65 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
- const getPlatformConfig = require('./configs');
3
-
4
- // ==== Include custom transforms ====
5
- require('./transforms/attribute/md-typography')(StyleDictionary);
6
- require('./transforms/attribute/typography')(StyleDictionary);
7
- require('./transforms/attribute/palette')(StyleDictionary);
8
- require('./transforms/attribute/prefix')(StyleDictionary);
9
- require('./transforms/attribute/size')(StyleDictionary);
10
-
11
- // ==== Include custom filters ====
12
- require('./filters/palette')(StyleDictionary);
13
- require('./filters/color')(StyleDictionary);
14
- require('./filters/size')(StyleDictionary);
15
- require('./filters/typography')(StyleDictionary);
16
- require('./filters/md-typography')(StyleDictionary);
17
-
18
- // ==== Include custom transform groups ====
19
- require('./transformGroups/scss')(StyleDictionary);
20
- require('./transformGroups/css')(StyleDictionary);
21
- require('./transformGroups/ts')(StyleDictionary);
22
-
23
- // ==== Include custom formats ====
24
- require('./formats/typography')(StyleDictionary);
25
- require('./formats/palette')(StyleDictionary);
26
-
27
- // ==== Run build ====
28
- console.log('Build started...');
29
- console.log('==============================================');
30
-
31
- module.exports = (themeConfig) => {
32
- StyleDictionary.registerFileHeader({
33
- name: 'customHeader',
34
- fileHeader: () => {
35
- return [`Do not edit directly`];
36
- }
37
- });
38
- console.log('themeConfig: ', themeConfig);
39
-
40
- if (!themeConfig || themeConfig.length === 0) {
41
- console.error('Build Failed. Please set ThemeConfig, for example: ', {
42
- name: 'default-theme',
43
- buildPath: [
44
- `packages/mosaic/design-tokens/tokens/properties/**/*.json5`,
45
- `packages/mosaic/design-tokens/tokens/components/**/*.json5`
46
- ],
47
- outputPath: 'packages/mosaic/design-tokens/'
48
- }
49
- )
50
- process.exit(0);
51
- }
52
-
53
- themeConfig.map((platform) => {
54
- // APPLY THE CONFIGURATION
55
- // Very important: the registration of custom transforms
56
- // needs to be done _before_ applying the configuration
57
- const StyleDictionaryExtended = StyleDictionary.extend(getPlatformConfig(platform));
58
-
59
- // FINALLY, BUILD ALL THE PLATFORMS
60
- StyleDictionaryExtended.buildAllPlatforms();
61
- });
62
-
63
- console.log('\n==============================================');
64
- console.log('\nBuild completed!');
65
- }
@@ -1,13 +0,0 @@
1
- module.exports = {
2
- css: {
3
- transformGroup: 'mc/css',
4
- files: [
5
- {
6
- destination: 'css-tokens.css',
7
- format: 'css/variables',
8
- filter: 'size',
9
- prefix: 'mc'
10
- }
11
- ]
12
- }
13
- };
@@ -1,44 +0,0 @@
1
- const merge = require('lodash/merge');
2
- const scssConfig = require('./scss');
3
- const jsConfig = require('./js');
4
- const cssConfig = require('./css');
5
-
6
- const filterObj = {
7
- options: {
8
- showFileHeader: true,
9
- fileHeader: 'customHeader'
10
- }
11
- };
12
-
13
- function filterOptions(platforms) {
14
- const platformObj = {};
15
-
16
- platforms.map(p => Object.assign(platformObj, p));
17
-
18
- Object
19
- .keys(platformObj)
20
- .forEach((p) => {
21
- platformObj[p].files.map(f => merge(f, filterObj));
22
- });
23
-
24
- return platformObj;
25
- }
26
-
27
- function getSources(theme) {
28
- return theme.buildPath;
29
- }
30
-
31
- function getConfigs(theme) {
32
- scssConfig.scss.buildPath = theme.outputPath;
33
- jsConfig.js.buildPath = theme.outputPath;
34
- cssConfig.css.buildPath = theme.outputPath;
35
-
36
- return filterOptions([scssConfig, jsConfig, cssConfig]);
37
- }
38
-
39
- module.exports = (theme) => {
40
- return {
41
- source: [...getSources(theme)],
42
- platforms: getConfigs(theme)
43
- };
44
- };
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- js: {
3
- transformGroup: 'mc/ts',
4
- files: [{
5
- destination: 'tokens.ts',
6
- format: 'javascript/es6'
7
- }]
8
- }
9
- };
@@ -1,29 +0,0 @@
1
- module.exports = {
2
- scss: {
3
- transformGroup: 'mc/scss',
4
- files: [
5
- {
6
- destination: '_variables.scss',
7
- format: 'scss/variables',
8
- filter: 'color'
9
- },
10
- {
11
- destination: '_palette.scss',
12
- format: 'mc-scss/palette',
13
- filter: 'palette'
14
- },
15
- {
16
- destination: '_typography.scss',
17
- format: 'mc-scss/typography',
18
- mapName: 'mosaic',
19
- filter: 'typography'
20
- },
21
- {
22
- destination: '_md-typography.scss',
23
- format: 'mc-scss/typography',
24
- mapName: 'md-typography',
25
- filter: 'md-typography'
26
- }
27
- ]
28
- }
29
- };
@@ -1,9 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFilter({
4
- name: 'color',
5
- matcher: (prop) => !prop.attributes.palette &&
6
- !prop.attributes.typography &&
7
- !prop.attributes['md-typography']
8
- })
9
- }
@@ -1,7 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFilter({
4
- name: 'md-typography',
5
- matcher: (prop) => prop.attributes['md-typography']
6
- })
7
- }
@@ -1,7 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFilter({
4
- name: 'palette',
5
- matcher: (prop) => prop.attributes.palette
6
- })
7
- }
@@ -1,7 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFilter({
4
- name: 'size',
5
- matcher: (prop) => prop.attributes.size
6
- })
7
- }
@@ -1,7 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFilter({
4
- name: 'typography',
5
- matcher: (prop) => prop.attributes.typography
6
- })
7
- }
@@ -1,25 +0,0 @@
1
-
2
- module.exports = (StyleDictionary) => {
3
- StyleDictionary.registerFormat({
4
- name: 'mc-scss/palette',
5
- formatter: function (dictionary) {
6
- return dictionary.allProperties
7
- .map((prop) => `\$${prop.name}: ${getMapFromObj(prop.value)};\n`)
8
- .join('\n');
9
- }
10
- })
11
- };
12
-
13
- function getMapFromObj(object) {
14
- const result = Object.keys(object)
15
- .map((key) => {
16
- if (key === 'contrast') {
17
- return `${key}: ${getMapFromObj(object[key])}`
18
- }
19
-
20
- return `${key}: ${object[key].value},\n`
21
- })
22
- .join('');
23
-
24
- return `(\n${result}\n)`
25
- }
@@ -1,52 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerFormat({
4
- name: 'mc-scss/typography',
5
- formatter: function(dictionary) {
6
- let string;
7
-
8
- string = dictionary.allProperties
9
- .map((prop) => {
10
- let output = '';
11
-
12
- const value = prop.attributes.category === 'asset' ? `"${ prop.value }"` : prop.value;
13
-
14
- output += `$${ prop.name }: ${ value };`
15
-
16
- if (prop.comment) {
17
- output += ` // ${ prop.comment }`;
18
- }
19
-
20
- output += '\n';
21
-
22
- return output;
23
- })
24
- .join('');
25
-
26
- string += `\n$${this.mapName || 'tokens' }: ${processJsonNode(dictionary.properties, 0)};\n`;
27
-
28
- return string;
29
- }
30
- })
31
- };
32
-
33
-
34
- function processJsonNode(obj, depth) {
35
- let output = '';
36
-
37
- if (obj.hasOwnProperty('value')) {
38
- output += `$${obj.name}`;
39
- } else {
40
- output += '(\n'
41
- output += Object.keys(obj).map((newKey) => {
42
- const newProp = obj[newKey];
43
- const indent = ' '.repeat(depth+1);
44
-
45
- return `${indent}'${newKey}': ${processJsonNode(newProp, depth + 1)}`;
46
- }).join(',\n');
47
-
48
- output += '\n' + ' '.repeat(depth) + ')';
49
- }
50
-
51
- return output;
52
- }
@@ -1,13 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerTransformGroup({
4
- name: 'mc/css',
5
- transforms: [
6
- 'attribute/cti',
7
- 'mc-attribute/size',
8
- 'name/cti/kebab',
9
- 'color/css',
10
- 'mc/prefix'
11
- ]
12
- });
13
- };
@@ -1,13 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerTransformGroup({
4
- name: 'mc/scss',
5
- transforms: [
6
- 'attribute/cti',
7
- 'mc-attribute/palette',
8
- 'mc-attribute/typography',
9
- 'mc-attribute/md-typography',
10
- 'name/cti/kebab'
11
- ]
12
- });
13
- }
@@ -1,11 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
- StyleDictionary.registerTransformGroup({
3
- name: 'mc/ts',
4
- transforms: [
5
- 'attribute/cti',
6
- 'name/cti/pascal',
7
- 'size/px',
8
- 'color/hex'
9
- ]
10
- });
11
- }
@@ -1,9 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerTransform({
4
- name: 'mc-attribute/md-typography',
5
- type: 'attribute',
6
- matcher: (prop) => prop.attributes.category === 'md-typography',
7
- transformer: () => ({ 'md-typography': true })
8
- });
9
- };
@@ -1,9 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerTransform({
4
- name: 'mc-attribute/palette',
5
- type: 'attribute',
6
- matcher: (prop) => prop.name === 'palette',
7
- transformer: () => ({ palette: true })
8
- });
9
- };
@@ -1,11 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
- StyleDictionary.registerTransform({
3
- name: 'mc/prefix',
4
- type: 'attribute',
5
- transformer: (prop, options) => {
6
- const prefix = options.files[0].prefix ? `${options.files[0].prefix}-` : '';
7
-
8
- prop.name = `${prefix}${prop.name}`;
9
- }
10
- });
11
- };
@@ -1,8 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
- StyleDictionary.registerTransform({
3
- name: 'mc-attribute/size',
4
- type: 'attribute',
5
- matcher: (prop) => prop.attributes.type === 'size',
6
- transformer: () => ({ size: true })
7
- });
8
- };
@@ -1,9 +0,0 @@
1
- module.exports = (StyleDictionary) => {
2
-
3
- StyleDictionary.registerTransform({
4
- name: 'mc-attribute/typography',
5
- type: 'attribute',
6
- matcher: (prop) => prop.attributes.category === 'typography',
7
- transformer: () => ({ typography: true })
8
- });
9
- };