@muonic/muon 0.0.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nycrc +17 -0
- package/.versionrc +3 -0
- package/CHANGELOG.md +389 -0
- package/components/card/index.js +1 -0
- package/components/card/src/card-component.js +43 -0
- package/components/card/src/card-styles.css +25 -0
- package/components/card/src/config-tokens.json +11 -0
- package/components/card/src/design-tokens.json +34 -0
- package/components/card/story.js +52 -0
- package/components/cta/index.js +1 -0
- package/components/cta/src/config-tokens.json +11 -0
- package/components/cta/src/cta-component.js +174 -0
- package/components/cta/src/cta-styles.css +105 -0
- package/components/cta/src/design-tokens.json +132 -0
- package/components/cta/story.js +99 -0
- package/components/detail/index.js +1 -0
- package/components/detail/src/config-tokens.json +11 -0
- package/components/detail/src/design-tokens.json +102 -0
- package/components/detail/src/detail-component.js +27 -0
- package/components/detail/src/detail-styles.css +83 -0
- package/components/detail/story.js +33 -0
- package/components/form/index.js +1 -0
- package/components/form/src/config-tokens.json +11 -0
- package/components/form/src/design-tokens.json +9 -0
- package/components/form/src/form-component.js +197 -0
- package/components/form/src/form-styles.css +10 -0
- package/components/form/story.js +71 -0
- package/components/icon/index.js +1 -0
- package/components/icon/src/config-tokens.json +31 -0
- package/components/icon/src/design-tokens.json +8 -0
- package/components/icon/src/icon-component.js +91 -0
- package/components/icon/src/icon-styles.css +26 -0
- package/components/icon/story.js +26 -0
- package/components/image/index.js +1 -0
- package/components/image/src/config-tokens.json +26 -0
- package/components/image/src/image-component.js +96 -0
- package/components/image/src/image-styles.css +71 -0
- package/components/image/story.js +31 -0
- package/components/inputter/index.js +1 -0
- package/components/inputter/src/config-tokens.json +14 -0
- package/components/inputter/src/design-tokens.json +308 -0
- package/components/inputter/src/inputter-component.js +227 -0
- package/components/inputter/src/inputter-styles-detail.css +59 -0
- package/components/inputter/src/inputter-styles.css +305 -0
- package/components/inputter/src/inputter-styles.slotted.css +64 -0
- package/components/inputter/story.js +243 -0
- package/css/accessibility.css +3 -0
- package/css/default.css +9 -0
- package/css/global.css +8 -0
- package/directives/image-loader-directive.js +116 -0
- package/directives/svg-loader-directive.js +94 -0
- package/index.js +52 -0
- package/mixins/card-mixin.js +27 -0
- package/mixins/detail-mixin.js +128 -0
- package/mixins/form-associate-mixin.js +36 -0
- package/mixins/form-element-mixin.js +378 -0
- package/mixins/image-holder-mixin.js +20 -0
- package/mixins/mask-mixin.js +159 -0
- package/mixins/validation-mixin.js +272 -0
- package/muon-element/index.js +97 -0
- package/package.json +72 -0
- package/rollup.config.mjs +30 -0
- package/scripts/build/storybook/index.mjs +11 -0
- package/scripts/build/storybook/run.mjs +47 -0
- package/scripts/rollup-plugins.mjs +116 -0
- package/scripts/serve/index.mjs +11 -0
- package/scripts/serve/run.mjs +27 -0
- package/scripts/style-dictionary.mjs +64 -0
- package/scripts/utils/config.mjs +30 -0
- package/scripts/utils/index.mjs +283 -0
- package/storybook/find-stories.js +36 -0
- package/storybook/server.config.mjs +19 -0
- package/storybook/stories.js +86 -0
- package/storybook/tokens/color.js +87 -0
- package/storybook/tokens/font.js +52 -0
- package/storybook/tokens/spacer.js +48 -0
- package/tests/README.md +3 -0
- package/tests/components/card/__snapshots__/card.test.snap.js +70 -0
- package/tests/components/card/card.test.js +81 -0
- package/tests/components/cta/__snapshots__/cta.test.snap.js +246 -0
- package/tests/components/cta/cta.test.js +212 -0
- package/tests/components/form/__snapshots__/form.test.snap.js +115 -0
- package/tests/components/form/form.test.js +336 -0
- package/tests/components/icon/__snapshots__/icon.test.snap.js +95 -0
- package/tests/components/icon/icon.test.js +197 -0
- package/tests/components/image/__snapshots__/image.test.snap.js +205 -0
- package/tests/components/image/image.test.js +314 -0
- package/tests/components/image/images/15.png +0 -0
- package/tests/components/image/images/150.png +0 -0
- package/tests/components/inputter/__snapshots__/inputter.test.snap.js +357 -0
- package/tests/components/inputter/inputter.test.js +427 -0
- package/tests/helpers/index.js +30 -0
- package/tests/mixins/__snapshots__/card.test.snap.js +35 -0
- package/tests/mixins/__snapshots__/detail.test.snap.js +237 -0
- package/tests/mixins/__snapshots__/form-element.test.snap.js +137 -0
- package/tests/mixins/__snapshots__/mask.test.snap.js +53 -0
- package/tests/mixins/__snapshots__/validation.test.snap.js +297 -0
- package/tests/mixins/card.test.js +63 -0
- package/tests/mixins/detail.test.js +223 -0
- package/tests/mixins/form-element.test.js +473 -0
- package/tests/mixins/mask.test.js +261 -0
- package/tests/mixins/muon-element.test.js +52 -0
- package/tests/mixins/validation.test.js +423 -0
- package/tests/runner/commands.mjs +19 -0
- package/tests/scripts/utils/card-component.js +26 -0
- package/tests/scripts/utils/muon.config.test.json +13 -0
- package/tests/scripts/utils/single.component.config.json +5 -0
- package/tests/scripts/utils/test-runner.mjs +1 -0
- package/tests/scripts/utils/utils-test.mjs +284 -0
- package/tests/utils/validation.functions.test.js +199 -0
- package/tokens/theme/color.json +482 -0
- package/tokens/theme/font.json +61 -0
- package/tokens/theme/size.json +27 -0
- package/tokens/theme/spacer.json +73 -0
- package/tokens/utils/formats/reference.js +17 -0
- package/tokens/utils/modular-scale.js +33 -0
- package/tokens/utils/templates/font-face.css.template +30 -0
- package/tokens/utils/transforms/color.js +27 -0
- package/tokens/utils/transforms/string.js +6 -0
- package/tokens/utils/validation.json +76 -0
- package/utils/scroll/index.js +31 -0
- package/utils/validation/index.js +205 -0
- package/web-test-runner.browserstack.config.mjs +123 -0
- package/web-test-runner.config.mjs +44 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": {
|
|
3
|
+
"color": {
|
|
4
|
+
"primary": {
|
|
5
|
+
"description": "Main brand color.",
|
|
6
|
+
"value": "#644BED",
|
|
7
|
+
"attributes": {
|
|
8
|
+
"category": "color"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"secondary": {
|
|
12
|
+
"description": "Supporting brand color.",
|
|
13
|
+
"value": "orange",
|
|
14
|
+
"attributes": {
|
|
15
|
+
"category": "color"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"__private_focus": {
|
|
19
|
+
"value": "{ theme.color.primary.value }",
|
|
20
|
+
"modify": [
|
|
21
|
+
{
|
|
22
|
+
"type": "brighten",
|
|
23
|
+
"amount": 1.39
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"focus": {
|
|
28
|
+
"description": "Color used for the outline focus state. Defaults to a brightened primary color.",
|
|
29
|
+
"value": "{ theme.color.__private_focus.value }",
|
|
30
|
+
"attributes": {
|
|
31
|
+
"category": "color"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"__private_disabled": {
|
|
35
|
+
"value": "{ theme.color.darkest.value }",
|
|
36
|
+
"modify": [
|
|
37
|
+
{
|
|
38
|
+
"type": "brighten",
|
|
39
|
+
"amount": 4
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"disabled": {
|
|
44
|
+
"description": "Color used to indicate a disabled element. Defaults to a brightened version of the darkest color.",
|
|
45
|
+
"value": "{ theme.color.__private_disabled.value }",
|
|
46
|
+
"attributes": {
|
|
47
|
+
"category": "color"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"__private_placeholder": {
|
|
51
|
+
"value": "{ theme.color.darkest.value }",
|
|
52
|
+
"modify": [
|
|
53
|
+
{
|
|
54
|
+
"type": "brighten",
|
|
55
|
+
"amount": 4
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"placeholder": {
|
|
60
|
+
"description": "Color used for placeholder elements. Defaults to a brightened version of the darkest color.",
|
|
61
|
+
"value": "{ theme.color.__private_placeholder.value }",
|
|
62
|
+
"attributes": {
|
|
63
|
+
"category": "color"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"transparent": {
|
|
67
|
+
"description": "Fully transparent.",
|
|
68
|
+
"value": "transparent",
|
|
69
|
+
"attributes": {
|
|
70
|
+
"category": "color"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"current": {
|
|
74
|
+
"description": "Color inherited from parent.",
|
|
75
|
+
"value": "currentColor",
|
|
76
|
+
"attributes": {
|
|
77
|
+
"category": "color"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"lightest": {
|
|
81
|
+
"description": "The lightest color.",
|
|
82
|
+
"value": "#FFFFFF",
|
|
83
|
+
"attributes": {
|
|
84
|
+
"category": "color"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"darkest": {
|
|
88
|
+
"description": "The darkest color.",
|
|
89
|
+
"value": "#000000",
|
|
90
|
+
"attributes": {
|
|
91
|
+
"category": "color"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"base": {
|
|
95
|
+
"background": {
|
|
96
|
+
"description": "Base background color. Defaults to lightest color.",
|
|
97
|
+
"value": "{ theme.color.lightest.value }",
|
|
98
|
+
"attributes": {
|
|
99
|
+
"category": "color"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"text": {
|
|
104
|
+
"light": {
|
|
105
|
+
"description": "Light color for text. Defaults to lightest color.",
|
|
106
|
+
"value": "{ theme.color.lightest.value}",
|
|
107
|
+
"attributes": {
|
|
108
|
+
"category": "color"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"__private_dark": {
|
|
112
|
+
"value": "{ theme.color.darkest.value }",
|
|
113
|
+
"modify": [
|
|
114
|
+
{
|
|
115
|
+
"type": "brighten",
|
|
116
|
+
"amount": 1.5
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"dark": {
|
|
121
|
+
"description": "Dark color for text. Defaults to a brightened version of the darkest color.",
|
|
122
|
+
"value": "{ theme.color.text.__private_dark.value }",
|
|
123
|
+
"attributes": {
|
|
124
|
+
"category": "color"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"neutral": {
|
|
129
|
+
"light": {
|
|
130
|
+
"50": {
|
|
131
|
+
"description": "5% darkened version of the lightest color.",
|
|
132
|
+
"value": "{ theme.color.lightest.value }",
|
|
133
|
+
"modify": [{
|
|
134
|
+
"type": "darken",
|
|
135
|
+
"amount": 0.5
|
|
136
|
+
}],
|
|
137
|
+
"attributes": {
|
|
138
|
+
"category": "color"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"100": {
|
|
142
|
+
"description": "10% darkened version of the lightest color.",
|
|
143
|
+
"value": "{ theme.color.lightest.value }",
|
|
144
|
+
"modify": [{
|
|
145
|
+
"type": "darken",
|
|
146
|
+
"amount": 1
|
|
147
|
+
}],
|
|
148
|
+
"attributes": {
|
|
149
|
+
"category": "color"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"150": {
|
|
153
|
+
"description": "15% darkened version of the lightest color.",
|
|
154
|
+
"value": "{ theme.color.lightest.value }",
|
|
155
|
+
"modify": [{
|
|
156
|
+
"type": "darken",
|
|
157
|
+
"amount": 1.5
|
|
158
|
+
}],
|
|
159
|
+
"attributes": {
|
|
160
|
+
"category": "color"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"200": {
|
|
164
|
+
"description": "20% darkened version of the lightest color.",
|
|
165
|
+
"value": "{ theme.color.lightest.value }",
|
|
166
|
+
"modify": [{
|
|
167
|
+
"type": "darken",
|
|
168
|
+
"amount": 2
|
|
169
|
+
}],
|
|
170
|
+
"attributes": {
|
|
171
|
+
"category": "color"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"250": {
|
|
175
|
+
"description": "25% darkened version of the lightest color.",
|
|
176
|
+
"value": "{ theme.color.lightest.value }",
|
|
177
|
+
"modify": [{
|
|
178
|
+
"type": "darken",
|
|
179
|
+
"amount": 2.5
|
|
180
|
+
}],
|
|
181
|
+
"attributes": {
|
|
182
|
+
"category": "color"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"300": {
|
|
186
|
+
"description": "30% darkened version of the lightest color.",
|
|
187
|
+
"value": "{ theme.color.lightest.value }",
|
|
188
|
+
"modify": [{
|
|
189
|
+
"type": "darken",
|
|
190
|
+
"amount": 3
|
|
191
|
+
}],
|
|
192
|
+
"attributes": {
|
|
193
|
+
"category": "color"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"350": {
|
|
197
|
+
"description": "35% darkened version of the lightest color.",
|
|
198
|
+
"value": "{ theme.color.lightest.value }",
|
|
199
|
+
"modify": [{
|
|
200
|
+
"type": "darken",
|
|
201
|
+
"amount": 3.5
|
|
202
|
+
}],
|
|
203
|
+
"attributes": {
|
|
204
|
+
"category": "color"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"400": {
|
|
208
|
+
"description": "40% darkened version of the lightest color.",
|
|
209
|
+
"value": "{ theme.color.lightest.value }",
|
|
210
|
+
"modify": [{
|
|
211
|
+
"type": "darken",
|
|
212
|
+
"amount": 4
|
|
213
|
+
}],
|
|
214
|
+
"attributes": {
|
|
215
|
+
"category": "color"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"450": {
|
|
219
|
+
"description": "45% darkened version of the lightest color.",
|
|
220
|
+
"value": "{ theme.color.lightest.value }",
|
|
221
|
+
"modify": [{
|
|
222
|
+
"type": "darken",
|
|
223
|
+
"amount": 4.5
|
|
224
|
+
}],
|
|
225
|
+
"attributes": {
|
|
226
|
+
"category": "color"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"500": {
|
|
230
|
+
"description": "50% darkened version of the lightest color.",
|
|
231
|
+
"value": "{ theme.color.lightest.value }",
|
|
232
|
+
"modify": [{
|
|
233
|
+
"type": "darken",
|
|
234
|
+
"amount": 5
|
|
235
|
+
}],
|
|
236
|
+
"attributes": {
|
|
237
|
+
"category": "color"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"dark": {
|
|
242
|
+
"50": {
|
|
243
|
+
"description": "5% brightened version of the darkest color.",
|
|
244
|
+
"value": "{ theme.color.darkest.value }",
|
|
245
|
+
"modify": [{
|
|
246
|
+
"type": "brighten",
|
|
247
|
+
"amount": 0.5
|
|
248
|
+
}],
|
|
249
|
+
"attributes": {
|
|
250
|
+
"category": "color"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"100": {
|
|
254
|
+
"description": "10% brightened version of the darkest color.",
|
|
255
|
+
"value": "{ theme.color.darkest.value }",
|
|
256
|
+
"modify": [{
|
|
257
|
+
"type": "brighten",
|
|
258
|
+
"amount": 1
|
|
259
|
+
}],
|
|
260
|
+
"attributes": {
|
|
261
|
+
"category": "color"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"150": {
|
|
265
|
+
"description": "15% brightened version of the darkest color.",
|
|
266
|
+
"value": "{ theme.color.darkest.value }",
|
|
267
|
+
"modify": [{
|
|
268
|
+
"type": "brighten",
|
|
269
|
+
"amount": 1.5
|
|
270
|
+
}],
|
|
271
|
+
"attributes": {
|
|
272
|
+
"category": "color"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"200": {
|
|
276
|
+
"description": "20% brightened version of the darkest color.",
|
|
277
|
+
"value": "{ theme.color.darkest.value }",
|
|
278
|
+
"modify": [{
|
|
279
|
+
"type": "brighten",
|
|
280
|
+
"amount": 2
|
|
281
|
+
}],
|
|
282
|
+
"attributes": {
|
|
283
|
+
"category": "color"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"250": {
|
|
287
|
+
"description": "25% brightened version of the darkest color.",
|
|
288
|
+
"value": "{ theme.color.darkest.value }",
|
|
289
|
+
"modify": [{
|
|
290
|
+
"type": "brighten",
|
|
291
|
+
"amount": 2.5
|
|
292
|
+
}],
|
|
293
|
+
"attributes": {
|
|
294
|
+
"category": "color"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"300": {
|
|
298
|
+
"description": "30% brightened version of the darkest color.",
|
|
299
|
+
"value": "{ theme.color.darkest.value }",
|
|
300
|
+
"modify": [{
|
|
301
|
+
"type": "brighten",
|
|
302
|
+
"amount": 3
|
|
303
|
+
}],
|
|
304
|
+
"attributes": {
|
|
305
|
+
"category": "color"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"350": {
|
|
309
|
+
"description": "35% brightened version of the darkest color.",
|
|
310
|
+
"value": "{ theme.color.darkest.value }",
|
|
311
|
+
"modify": [{
|
|
312
|
+
"type": "brighten",
|
|
313
|
+
"amount": 3.5
|
|
314
|
+
}],
|
|
315
|
+
"attributes": {
|
|
316
|
+
"category": "color"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"400": {
|
|
320
|
+
"description": "40% brightened version of the darkest color.",
|
|
321
|
+
"value": "{ theme.color.darkest.value }",
|
|
322
|
+
"modify": [{
|
|
323
|
+
"type": "brighten",
|
|
324
|
+
"amount": 4
|
|
325
|
+
}]
|
|
326
|
+
},
|
|
327
|
+
"450": {
|
|
328
|
+
"description": "45% brightened version of the darkest color.",
|
|
329
|
+
"value": "{ theme.color.darkest.value }",
|
|
330
|
+
"modify": [{
|
|
331
|
+
"type": "brighten",
|
|
332
|
+
"amount": 4.5
|
|
333
|
+
}],
|
|
334
|
+
"attributes": {
|
|
335
|
+
"category": "color"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"500": {
|
|
339
|
+
"description": "50% brightened version of the darkest color.",
|
|
340
|
+
"value": "{ theme.color.darkest.value }",
|
|
341
|
+
"modify": [{
|
|
342
|
+
"type": "brighten",
|
|
343
|
+
"amount": 5
|
|
344
|
+
}],
|
|
345
|
+
"attributes": {
|
|
346
|
+
"category": "color"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"action": {
|
|
352
|
+
"@": {
|
|
353
|
+
"description": "Color used for an action.",
|
|
354
|
+
"value": "#1565C0",
|
|
355
|
+
"attributes": {
|
|
356
|
+
"category": "color"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"__private_500": {
|
|
360
|
+
"value": "{ theme.color.action.@.value }",
|
|
361
|
+
"modify": [
|
|
362
|
+
{
|
|
363
|
+
"type": "brighten",
|
|
364
|
+
"amount": 2
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
"500": {
|
|
369
|
+
"description": "20% brightened version of the color used for an action.",
|
|
370
|
+
"value": "{ theme.color.action.__private_500.value }",
|
|
371
|
+
"attributes": {
|
|
372
|
+
"category": "color"
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"error": {
|
|
377
|
+
"@": {
|
|
378
|
+
"description": "Color indicative of an error.",
|
|
379
|
+
"value": "#EB002F",
|
|
380
|
+
"attributes": {
|
|
381
|
+
"category": "color"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"__private_500": {
|
|
385
|
+
"value": "{ theme.color.error.@.value }",
|
|
386
|
+
"modify": [
|
|
387
|
+
{
|
|
388
|
+
"type": "brighten",
|
|
389
|
+
"amount": 2
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
"500": {
|
|
394
|
+
"description": "20% brightened version of the color indicative of an error.",
|
|
395
|
+
"value": "{ theme.color.error.__private_500.value }",
|
|
396
|
+
"attributes": {
|
|
397
|
+
"category": "color"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"warning": {
|
|
402
|
+
"@": {
|
|
403
|
+
"description": "Color indicative of a warning.",
|
|
404
|
+
"value": "#E3660E",
|
|
405
|
+
"attributes": {
|
|
406
|
+
"category": "color"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"__private_500": {
|
|
410
|
+
"value": "{ theme.color.warning.@.value }",
|
|
411
|
+
"modify": [
|
|
412
|
+
{
|
|
413
|
+
"type": "brighten",
|
|
414
|
+
"amount": 2
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
},
|
|
418
|
+
"500": {
|
|
419
|
+
"description": "20% brightened version of the color indicative of a warning.",
|
|
420
|
+
"value": "{ theme.color.warning.__private_500.value }",
|
|
421
|
+
"attributes": {
|
|
422
|
+
"category": "color"
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
"success": {
|
|
427
|
+
"@": {
|
|
428
|
+
"description": "Color indicative of success.",
|
|
429
|
+
"value": "#23D160",
|
|
430
|
+
"attributes": {
|
|
431
|
+
"category": "color"
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"__private_500": {
|
|
435
|
+
"value": "{ theme.color.success.@.value }",
|
|
436
|
+
"modify": [
|
|
437
|
+
{
|
|
438
|
+
"type": "brighten",
|
|
439
|
+
"amount": 2
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
"500": {
|
|
444
|
+
"description": "20% brightened version of the color indicative of success.",
|
|
445
|
+
"value": "{ theme.color.success.__private_500.value }",
|
|
446
|
+
"attributes": {
|
|
447
|
+
"category": "color"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"information": {
|
|
452
|
+
"@": {
|
|
453
|
+
"description": "Color indicative of information.",
|
|
454
|
+
"value": "#209CEE",
|
|
455
|
+
"attributes": {
|
|
456
|
+
"category": "color"
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"__private_500": {
|
|
460
|
+
"value": "{ theme.color.information.@.value }",
|
|
461
|
+
"modify": [
|
|
462
|
+
{
|
|
463
|
+
"type": "brighten",
|
|
464
|
+
"amount": 2
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
"500": {
|
|
469
|
+
"description": "20% brightened version of the color indicative of information.",
|
|
470
|
+
"value": "{ theme.color.information.__private_500.value }",
|
|
471
|
+
"modify": [{
|
|
472
|
+
"type": "brighten",
|
|
473
|
+
"amount": 2
|
|
474
|
+
}],
|
|
475
|
+
"attributes": {
|
|
476
|
+
"category": "color"
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": {
|
|
3
|
+
"font": {
|
|
4
|
+
"family": {
|
|
5
|
+
"default": {
|
|
6
|
+
"description": "The default font family.",
|
|
7
|
+
"value": "sans-serif"
|
|
8
|
+
},
|
|
9
|
+
"monospace": {
|
|
10
|
+
"description": "The monospaced font family.",
|
|
11
|
+
"value": "monospace"
|
|
12
|
+
},
|
|
13
|
+
"label": {
|
|
14
|
+
"description": "The font used for labels. Inherits theme's default font family.",
|
|
15
|
+
"value": "{ theme.font.family.default.value }"
|
|
16
|
+
},
|
|
17
|
+
"heading": {
|
|
18
|
+
"description": "The font used for headings. Inherits theme's default font family.",
|
|
19
|
+
"value": "{ theme.font.family.default.value }"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"size": {
|
|
23
|
+
"default": {
|
|
24
|
+
"description": "Default size of the font.",
|
|
25
|
+
"value": "{ theme.spacer.md.value }",
|
|
26
|
+
"attributes": {
|
|
27
|
+
"category": "size"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"label": {
|
|
31
|
+
"description": "Font used for labels.",
|
|
32
|
+
"value": "{ theme.spacer.md.value }",
|
|
33
|
+
"attributes": {
|
|
34
|
+
"category": "size"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"heading": {
|
|
38
|
+
"description": "Font size used for headings.",
|
|
39
|
+
"value": "{ theme.spacer.lg.value }",
|
|
40
|
+
"attributes": {
|
|
41
|
+
"category": "size"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"weight": {
|
|
46
|
+
"default": {
|
|
47
|
+
"description": "The default weight of the font.",
|
|
48
|
+
"value": "400"
|
|
49
|
+
},
|
|
50
|
+
"label": {
|
|
51
|
+
"description": "Weight of the font used for labels.",
|
|
52
|
+
"value": "{ theme.font.weight.heading.value }"
|
|
53
|
+
},
|
|
54
|
+
"heading": {
|
|
55
|
+
"description": "Weight of the font used for headings.",
|
|
56
|
+
"value": "600"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": {
|
|
3
|
+
"size": {
|
|
4
|
+
"sm": {
|
|
5
|
+
"description": "Small size.",
|
|
6
|
+
"value": "1",
|
|
7
|
+
"attributes": {
|
|
8
|
+
"category": "size"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"md": {
|
|
12
|
+
"description": "Medium size.",
|
|
13
|
+
"value": "1.25",
|
|
14
|
+
"attributes": {
|
|
15
|
+
"category": "size"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"lg": {
|
|
19
|
+
"description": "Large size.",
|
|
20
|
+
"value": "1.5",
|
|
21
|
+
"attributes": {
|
|
22
|
+
"category": "size"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": {
|
|
3
|
+
"spacer": {
|
|
4
|
+
"description": "A spacer is the invisible space between elements. The unit is supplied by the size transform (default rem).",
|
|
5
|
+
"zero": {
|
|
6
|
+
"description": "No space at all.",
|
|
7
|
+
"value": "0",
|
|
8
|
+
"attributes": {
|
|
9
|
+
"category": "size"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"sm": {
|
|
13
|
+
"description": "Small sized space.",
|
|
14
|
+
"value": "0.5",
|
|
15
|
+
"attributes": {
|
|
16
|
+
"category": "size"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"md": {
|
|
20
|
+
"description": "Medium sized space.",
|
|
21
|
+
"value": "1",
|
|
22
|
+
"attributes": {
|
|
23
|
+
"category": "size"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"lg": {
|
|
27
|
+
"description": "Large sized space.",
|
|
28
|
+
"value": "1.5",
|
|
29
|
+
"attributes": {
|
|
30
|
+
"category": "size"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"xl": {
|
|
34
|
+
"description": "Extra large sized space.",
|
|
35
|
+
"value": "2",
|
|
36
|
+
"attributes": {
|
|
37
|
+
"category": "size"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"negative": {
|
|
41
|
+
"description": "A negative spacer pulls.",
|
|
42
|
+
"sm": {
|
|
43
|
+
"description": "Negative version of the small space.",
|
|
44
|
+
"value": "-{ theme.spacer.sm.value }",
|
|
45
|
+
"attributes": {
|
|
46
|
+
"category": "size"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"md": {
|
|
50
|
+
"description": "Negative version of the medium space.",
|
|
51
|
+
"value": "-{ theme.spacer.md.value }",
|
|
52
|
+
"attributes": {
|
|
53
|
+
"category": "size"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"lg": {
|
|
57
|
+
"description": "Negative version of the large space.",
|
|
58
|
+
"value": "-{ theme.spacer.lg.value }",
|
|
59
|
+
"attributes": {
|
|
60
|
+
"category": "size"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"xl": {
|
|
64
|
+
"description": "Negative version of the extra large space.",
|
|
65
|
+
"value": "-{ theme.spacer.xl.value }",
|
|
66
|
+
"attributes": {
|
|
67
|
+
"category": "size"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: 'json/reference',
|
|
3
|
+
formatter: function ({ dictionary }) {
|
|
4
|
+
const tokens = dictionary.allTokens.map((token) => {
|
|
5
|
+
token.usesReference = dictionary.usesReference(token.original.value);
|
|
6
|
+
if (token.usesReference) {
|
|
7
|
+
token.references = dictionary.getReferences(token.original.value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
token.nestedName = token.path.join('.').toLowerCase();
|
|
11
|
+
|
|
12
|
+
return token;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return JSON.stringify(tokens, null, 2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// https://medium.com/swlh/how-to-round-to-a-certain-number-of-decimal-places-in-javascript-ed74c471c1b8
|
|
2
|
+
const toDecimalPlaces = (number, decimalPlaces) => Number(Math.round(number + 'e' + decimalPlaces) + 'e-' + decimalPlaces);
|
|
3
|
+
|
|
4
|
+
const ratios = {
|
|
5
|
+
// "minor-second": 1.067, // commented out are not used
|
|
6
|
+
'major-second': 1.125,
|
|
7
|
+
'minor-third': 1.2,
|
|
8
|
+
'major-third': 1.25
|
|
9
|
+
// "perfect-fourth": 1.333,
|
|
10
|
+
// "aug-fourth": 1.414,
|
|
11
|
+
// "perfect-fifth": 1.5,
|
|
12
|
+
// "minor-sixth": 1.6,
|
|
13
|
+
// "golden-section": 1.618,
|
|
14
|
+
// "major-sixth": 1.667,
|
|
15
|
+
// "minor-seventh": 1.778,
|
|
16
|
+
// "major-seventh": 1.875,
|
|
17
|
+
// "octave": 2,
|
|
18
|
+
// "major-tenth": 2.5,
|
|
19
|
+
// "major-eleventh": 2.667,
|
|
20
|
+
// "major-twelfth": 3,
|
|
21
|
+
// "double-octave": 4
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const calculate = (base, ratio, exponent) => {
|
|
25
|
+
const r = ratios[ratio];
|
|
26
|
+
const result = base * Math.pow(r, exponent);
|
|
27
|
+
|
|
28
|
+
return toDecimalPlaces(result, 3);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
calculate
|
|
33
|
+
};
|