@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.
- package/core/formatters/date/templates/tk-TM.d.ts +2 -0
- package/esm2020/core/formatters/date/formatter.mjs +18 -3
- package/esm2020/core/formatters/date/templates/tk-TM.mjs +358 -0
- package/esm2020/core/version.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-core.mjs +429 -57
- package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-core.mjs +429 -57
- package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
- package/package.json +4 -4
- package/design-tokens/legacy-2017/tokens/components/alert.json5 +0 -83
- package/design-tokens/legacy-2017/tokens/components/autocomplete.json5 +0 -11
- package/design-tokens/legacy-2017/tokens/components/badge.json5 +0 -174
- package/design-tokens/legacy-2017/tokens/components/button-toggle.json5 +0 -11
- package/design-tokens/legacy-2017/tokens/components/button.json5 +0 -142
- package/design-tokens/legacy-2017/tokens/components/card.json5 +0 -51
- package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +0 -106
- package/design-tokens/legacy-2017/tokens/components/code-block.json5 +0 -704
- package/design-tokens/legacy-2017/tokens/components/datepicker.json5 +0 -73
- package/design-tokens/legacy-2017/tokens/components/divider.json5 +0 -14
- package/design-tokens/legacy-2017/tokens/components/dl.json5 +0 -38
- package/design-tokens/legacy-2017/tokens/components/dropdown.json5 +0 -48
- package/design-tokens/legacy-2017/tokens/components/form-field.json5 +0 -92
- package/design-tokens/legacy-2017/tokens/components/forms.json5 +0 -48
- package/design-tokens/legacy-2017/tokens/components/icon.json5 +0 -104
- package/design-tokens/legacy-2017/tokens/components/input.json5 +0 -12
- package/design-tokens/legacy-2017/tokens/components/link.json5 +0 -56
- package/design-tokens/legacy-2017/tokens/components/list.json5 +0 -13
- package/design-tokens/legacy-2017/tokens/components/loader-overlay.json5 +0 -23
- package/design-tokens/legacy-2017/tokens/components/markdown.json5 +0 -294
- package/design-tokens/legacy-2017/tokens/components/modal.json5 +0 -81
- package/design-tokens/legacy-2017/tokens/components/navbar.json5 +0 -70
- package/design-tokens/legacy-2017/tokens/components/optgroup.json5 +0 -10
- package/design-tokens/legacy-2017/tokens/components/option.json5 +0 -12
- package/design-tokens/legacy-2017/tokens/components/popover.json5 +0 -69
- package/design-tokens/legacy-2017/tokens/components/popup.json5 +0 -16
- package/design-tokens/legacy-2017/tokens/components/progress-bar.json5 +0 -13
- package/design-tokens/legacy-2017/tokens/components/progress-spinner.json5 +0 -16
- package/design-tokens/legacy-2017/tokens/components/radio.json5 +0 -47
- package/design-tokens/legacy-2017/tokens/components/scrollbars.json5 +0 -52
- package/design-tokens/legacy-2017/tokens/components/select.json5 +0 -24
- package/design-tokens/legacy-2017/tokens/components/sidepanel.json5 +0 -49
- package/design-tokens/legacy-2017/tokens/components/table.json5 +0 -15
- package/design-tokens/legacy-2017/tokens/components/tabs.json5 +0 -101
- package/design-tokens/legacy-2017/tokens/components/tags.json5 +0 -134
- package/design-tokens/legacy-2017/tokens/components/textarea.json5 +0 -12
- package/design-tokens/legacy-2017/tokens/components/timepicker.json5 +0 -7
- package/design-tokens/legacy-2017/tokens/components/timezone.json5 +0 -23
- package/design-tokens/legacy-2017/tokens/components/toast.json5 +0 -54
- package/design-tokens/legacy-2017/tokens/components/toggle.json5 +0 -79
- package/design-tokens/legacy-2017/tokens/components/tooltip.json5 +0 -83
- package/design-tokens/legacy-2017/tokens/components/tree.json5 +0 -15
- package/design-tokens/legacy-2017/tokens/properties/aliases.json5 +0 -3
- package/design-tokens/legacy-2017/tokens/properties/colors.json5 +0 -119
- package/design-tokens/legacy-2017/tokens/properties/font.json5 +0 -12
- package/design-tokens/legacy-2017/tokens/properties/globals.json5 +0 -49
- package/design-tokens/legacy-2017/tokens/properties/md-typography.json5 +0 -103
- package/design-tokens/legacy-2017/tokens/properties/padding.json5 +0 -3
- package/design-tokens/legacy-2017/tokens/properties/palette.json5 +0 -194
- package/design-tokens/legacy-2017/tokens/properties/typography.json5 +0 -184
- package/design-tokens/pt-2022/tokens/components/alert.json5 +0 -83
- package/design-tokens/pt-2022/tokens/components/autocomplete.json5 +0 -11
- package/design-tokens/pt-2022/tokens/components/badge.json5 +0 -174
- package/design-tokens/pt-2022/tokens/components/button-toggle.json5 +0 -11
- package/design-tokens/pt-2022/tokens/components/button.json5 +0 -142
- package/design-tokens/pt-2022/tokens/components/card.json5 +0 -51
- package/design-tokens/pt-2022/tokens/components/checkbox.json5 +0 -106
- package/design-tokens/pt-2022/tokens/components/code-block.json5 +0 -697
- package/design-tokens/pt-2022/tokens/components/datepicker.json5 +0 -73
- package/design-tokens/pt-2022/tokens/components/divider.json5 +0 -14
- package/design-tokens/pt-2022/tokens/components/dl.json5 +0 -38
- package/design-tokens/pt-2022/tokens/components/dropdown.json5 +0 -48
- package/design-tokens/pt-2022/tokens/components/form-field.json5 +0 -92
- package/design-tokens/pt-2022/tokens/components/forms.json5 +0 -48
- package/design-tokens/pt-2022/tokens/components/icon.json5 +0 -104
- package/design-tokens/pt-2022/tokens/components/input.json5 +0 -12
- package/design-tokens/pt-2022/tokens/components/link.json5 +0 -56
- package/design-tokens/pt-2022/tokens/components/list.json5 +0 -13
- package/design-tokens/pt-2022/tokens/components/loader-overlay.json5 +0 -23
- package/design-tokens/pt-2022/tokens/components/markdown.json5 +0 -294
- package/design-tokens/pt-2022/tokens/components/modal.json5 +0 -81
- package/design-tokens/pt-2022/tokens/components/navbar.json5 +0 -70
- package/design-tokens/pt-2022/tokens/components/optgroup.json5 +0 -10
- package/design-tokens/pt-2022/tokens/components/option.json5 +0 -12
- package/design-tokens/pt-2022/tokens/components/popover.json5 +0 -69
- package/design-tokens/pt-2022/tokens/components/popup.json5 +0 -16
- package/design-tokens/pt-2022/tokens/components/progress-bar.json5 +0 -13
- package/design-tokens/pt-2022/tokens/components/progress-spinner.json5 +0 -16
- package/design-tokens/pt-2022/tokens/components/radio.json5 +0 -48
- package/design-tokens/pt-2022/tokens/components/scrollbars.json5 +0 -52
- package/design-tokens/pt-2022/tokens/components/select.json5 +0 -24
- package/design-tokens/pt-2022/tokens/components/sidepanel.json5 +0 -48
- package/design-tokens/pt-2022/tokens/components/table.json5 +0 -15
- package/design-tokens/pt-2022/tokens/components/tabs.json5 +0 -101
- package/design-tokens/pt-2022/tokens/components/tags.json5 +0 -137
- package/design-tokens/pt-2022/tokens/components/textarea.json5 +0 -12
- package/design-tokens/pt-2022/tokens/components/timepicker.json5 +0 -7
- package/design-tokens/pt-2022/tokens/components/timezone.json5 +0 -23
- package/design-tokens/pt-2022/tokens/components/toast.json5 +0 -54
- package/design-tokens/pt-2022/tokens/components/toggle.json5 +0 -79
- package/design-tokens/pt-2022/tokens/components/tooltip.json5 +0 -83
- package/design-tokens/pt-2022/tokens/components/tree.json5 +0 -15
- package/design-tokens/pt-2022/tokens/properties/aliases.json5 +0 -3
- package/design-tokens/pt-2022/tokens/properties/colors.json5 +0 -122
- package/design-tokens/pt-2022/tokens/properties/font.json5 +0 -15
- package/design-tokens/pt-2022/tokens/properties/globals.json5 +0 -49
- package/design-tokens/pt-2022/tokens/properties/md-typography.json5 +0 -103
- package/design-tokens/pt-2022/tokens/properties/padding.json5 +0 -3
- package/design-tokens/pt-2022/tokens/properties/palette.json5 +0 -265
- package/design-tokens/pt-2022/tokens/properties/typography.json5 +0 -184
- package/design-tokens/style-dictionary/build.js +0 -65
- package/design-tokens/style-dictionary/configs/css.js +0 -13
- package/design-tokens/style-dictionary/configs/index.js +0 -44
- package/design-tokens/style-dictionary/configs/js.js +0 -9
- package/design-tokens/style-dictionary/configs/scss.js +0 -29
- package/design-tokens/style-dictionary/filters/color.js +0 -9
- package/design-tokens/style-dictionary/filters/md-typography.js +0 -7
- package/design-tokens/style-dictionary/filters/palette.js +0 -7
- package/design-tokens/style-dictionary/filters/size.js +0 -7
- package/design-tokens/style-dictionary/filters/typography.js +0 -7
- package/design-tokens/style-dictionary/formats/palette.js +0 -25
- package/design-tokens/style-dictionary/formats/typography.js +0 -52
- package/design-tokens/style-dictionary/transformGroups/css.js +0 -13
- package/design-tokens/style-dictionary/transformGroups/scss.js +0 -13
- package/design-tokens/style-dictionary/transformGroups/ts.js +0 -11
- package/design-tokens/style-dictionary/transforms/attribute/md-typography.js +0 -9
- package/design-tokens/style-dictionary/transforms/attribute/palette.js +0 -9
- package/design-tokens/style-dictionary/transforms/attribute/prefix.js +0 -11
- package/design-tokens/style-dictionary/transforms/attribute/size.js +0 -8
- 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,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,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,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/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,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,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
|
-
};
|