@primer/primitives 7.8.1 → 7.8.3-rc.a61b03e

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 (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build.js +534 -0
  3. package/package.json +7 -4
  4. package/tokens/base/size/size.json +57 -0
  5. package/tokens/base/typography/typography.json +20 -0
  6. package/tokens/functional/size/border.json +40 -0
  7. package/tokens/functional/size/breakpoints.json +24 -0
  8. package/tokens/functional/size/size-coarse.json +27 -0
  9. package/tokens/functional/size/size-fine.json +27 -0
  10. package/tokens/functional/size/size.json +189 -0
  11. package/tokens/functional/size/viewport.json +24 -0
  12. package/tokens/functional/typography/typography.json +214 -0
  13. package/tokens-v2-private/css/tokens/base/size/size.css +1 -1
  14. package/tokens-v2-private/css/tokens/base/typography/typography.css +1 -1
  15. package/tokens-v2-private/css/tokens/functional/size/border.css +1 -1
  16. package/tokens-v2-private/css/tokens/functional/size/breakpoints.css +1 -1
  17. package/tokens-v2-private/css/tokens/functional/size/size-coarse.css +10 -0
  18. package/tokens-v2-private/css/tokens/functional/size/size-fine.css +4 -4
  19. package/tokens-v2-private/css/tokens/functional/size/size.css +7 -7
  20. package/tokens-v2-private/css/tokens/functional/typography/typography.css +1 -1
  21. package/tokens-v2-private/js/module/tokens/base/size/size.js +1 -1
  22. package/tokens-v2-private/js/module/tokens/base/typography/typography.js +1 -1
  23. package/tokens-v2-private/js/module/tokens/functional/size/border.js +1 -1
  24. package/tokens-v2-private/js/module/tokens/functional/size/breakpoints.js +1 -1
  25. package/tokens-v2-private/js/module/tokens/functional/size/size-coarse.js +73 -0
  26. package/tokens-v2-private/js/module/tokens/functional/size/size-fine.js +1 -1
  27. package/tokens-v2-private/js/module/tokens/functional/size/size.js +103 -103
  28. package/tokens-v2-private/js/module/tokens/functional/size/viewport.js +1 -1
  29. package/tokens-v2-private/js/module/tokens/functional/typography/typography.js +1 -1
  30. package/tokens-v2-private/js/tokens/base/size/size.js +1 -1
  31. package/tokens-v2-private/js/tokens/base/typography/typography.js +1 -1
  32. package/tokens-v2-private/js/tokens/functional/size/border.js +1 -1
  33. package/tokens-v2-private/js/tokens/functional/size/breakpoints.js +1 -1
  34. package/tokens-v2-private/js/tokens/functional/size/size-coarse.js +8 -0
  35. package/tokens-v2-private/js/tokens/functional/size/size-fine.js +1 -1
  36. package/tokens-v2-private/js/tokens/functional/size/size.js +8 -8
  37. package/tokens-v2-private/js/tokens/functional/size/viewport.js +1 -1
  38. package/tokens-v2-private/js/tokens/functional/typography/typography.js +1 -1
  39. package/tokens-v2-private/ts/tokens/base/size/size.d.ts +2 -2
  40. package/tokens-v2-private/ts/tokens/base/size/size.js +1 -1
  41. package/tokens-v2-private/ts/tokens/base/typography/typography.d.ts +2 -2
  42. package/tokens-v2-private/ts/tokens/base/typography/typography.js +1 -1
  43. package/tokens-v2-private/ts/tokens/functional/size/border.d.ts +2 -2
  44. package/tokens-v2-private/ts/tokens/functional/size/border.js +1 -1
  45. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.d.ts +2 -2
  46. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.js +1 -1
  47. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.d.ts +27 -0
  48. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.js +26 -0
  49. package/tokens-v2-private/ts/tokens/functional/size/size-fine.d.ts +2 -2
  50. package/tokens-v2-private/ts/tokens/functional/size/size-fine.js +1 -1
  51. package/tokens-v2-private/ts/tokens/functional/size/size.d.ts +14 -14
  52. package/tokens-v2-private/ts/tokens/functional/size/size.js +13 -13
  53. package/tokens-v2-private/ts/tokens/functional/size/viewport.d.ts +2 -2
  54. package/tokens-v2-private/ts/tokens/functional/size/viewport.js +1 -1
  55. package/tokens-v2-private/ts/tokens/functional/typography/typography.d.ts +2 -2
  56. package/tokens-v2-private/ts/tokens/functional/typography/typography.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @primer/primitives
2
2
 
3
+ ## 7.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#326](https://github.com/primer/primitives/pull/326) [`bc75b88`](https://github.com/primer/primitives/commit/bc75b88c06bd9dc2aacd0dcdc0f52927bc527b06) Thanks [@rezrah](https://github.com/rezrah)! - export StyleDictionary for app-level extending
8
+
9
+ ## 7.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#323](https://github.com/primer/primitives/pull/323) [`40f15d5`](https://github.com/primer/primitives/commit/40f15d530a130390debb794dbc4080f58b42d49e) Thanks [@rezrah](https://github.com/rezrah)! - add self serve tooling for v2 primitives
14
+
3
15
  ## 7.8.1
4
16
 
5
17
  ### Patch Changes
package/build.js ADDED
@@ -0,0 +1,534 @@
1
+ const glob = require('fast-glob')
2
+ const StyleDictionary = require('style-dictionary')
3
+
4
+ const {fileHeader, formattedVariables} = StyleDictionary.formatHelpers
5
+
6
+ // REGISTER THE CUSTOM TRANFORMS
7
+
8
+ /**
9
+ * transform: css variable names
10
+ * example: `--namespace-item-variant-property-modifier`
11
+ */
12
+ StyleDictionary.registerTransform({
13
+ name: 'name/css',
14
+ type: 'name',
15
+ transformer: (token, options) => {
16
+ return token.path.join('-')
17
+ }
18
+ })
19
+
20
+ /**
21
+ * transform: js variable names
22
+ * example: `namespace.item.variant.property.modifier`
23
+ */
24
+ StyleDictionary.registerTransform({
25
+ name: 'name/js',
26
+ type: 'name',
27
+ transformer: (token, options) => {
28
+ return token.path.join('.')
29
+ }
30
+ })
31
+
32
+ /**
33
+ * transform: js es6 variable names
34
+ * example: `NamespaceItemVariantPropertyModifier`
35
+ */
36
+ StyleDictionary.registerTransform({
37
+ name: 'name/js/es6',
38
+ type: 'name',
39
+ transformer: (token, options) => {
40
+ const tokenPath = token.path.join(' ')
41
+ const tokenPathItems = tokenPath.split(' ')
42
+ for (var i = 0; i < tokenPathItems.length; i++) {
43
+ tokenPathItems[i] = tokenPathItems[i].charAt(0).toUpperCase() + tokenPathItems[i].slice(1)
44
+ }
45
+ const tokenName = tokenPathItems.join('')
46
+ return tokenName
47
+ }
48
+ })
49
+
50
+ // find values with px unit
51
+ function isPx(value) {
52
+ return /[\d\.]+px$/.test(value)
53
+ }
54
+
55
+ // transform: px to rem
56
+ StyleDictionary.registerTransform({
57
+ name: 'pxToRem',
58
+ type: 'value',
59
+ transformer: (token, options) => {
60
+ if (isPx(token.value)) {
61
+ const baseFontSize = 16
62
+ const floatValue = parseFloat(token.value.replace('px', ''))
63
+
64
+ if (isNaN(floatValue)) {
65
+ return token.value
66
+ }
67
+
68
+ if (floatValue === 0) {
69
+ return '0'
70
+ }
71
+
72
+ return `${floatValue / baseFontSize}rem`
73
+ }
74
+ return token.value
75
+ }
76
+ })
77
+
78
+ //-----
79
+
80
+ // ts output
81
+ StyleDictionary.registerTransform({
82
+ name: 'attribute/typescript',
83
+ type: 'attribute',
84
+ transformer: token => {
85
+ return {
86
+ typescript: {
87
+ // these transforms will need to match the ones you use for typescript
88
+ // or you can "chain" the transforms and use token.name and token.value
89
+ // like scss and less transforms do.
90
+ name: token.path.slice(1).join('.'),
91
+ value: token.value
92
+ }
93
+ }
94
+ }
95
+ })
96
+
97
+ // css output
98
+ StyleDictionary.registerTransform({
99
+ name: 'attribute/css',
100
+ type: 'attribute',
101
+ transformer: token => {
102
+ const tokenName = token.path.slice(1).join('-')
103
+ return {
104
+ css: {
105
+ name: `--${tokenName}`,
106
+ value: token.value
107
+ }
108
+ }
109
+ }
110
+ })
111
+
112
+ // transform: composite typography to shorthands
113
+ StyleDictionary.registerTransform({
114
+ name: 'typography/shorthand',
115
+ type: 'value',
116
+ transitive: true,
117
+ matcher: token => token.type === 'typography',
118
+ transformer: token => {
119
+ const {value} = token
120
+ return `${value.fontWeight} ${value.fontSize}/${value.lineHeight} ${value.fontFamily}`
121
+ }
122
+ })
123
+
124
+ // REGISTER THE CUSTOM TRANFORM GROUPS
125
+
126
+ StyleDictionary.registerTransformGroup({
127
+ name: 'css',
128
+ transforms: ['name/css', 'pxToRem', 'typography/shorthand']
129
+ })
130
+
131
+ // REGISTER A CUSTOM FORMAT
132
+
133
+ // wrap mobile tokens in media query
134
+ StyleDictionary.registerFormat({
135
+ name: 'css/touch-target-mobile',
136
+ formatter: function({dictionary, file, options}) {
137
+ const {outputReferences} = options
138
+ return (
139
+ fileHeader({file}) +
140
+ `@media (pointer: coarse) { :root {\n` +
141
+ formattedVariables({format: 'css', dictionary, outputReferences}) +
142
+ '\n}}\n'
143
+ )
144
+ }
145
+ })
146
+
147
+ // wrap desktop tokens in media query
148
+ StyleDictionary.registerFormat({
149
+ name: 'css/touch-target-desktop',
150
+ formatter: function({dictionary, file, options}) {
151
+ const {outputReferences} = options
152
+ return (
153
+ fileHeader({file}) +
154
+ `@media (pointer: fine) { :root {\n` +
155
+ formattedVariables({format: 'css', dictionary, outputReferences}) +
156
+ '\n}}\n'
157
+ )
158
+ }
159
+ })
160
+
161
+ StyleDictionary.registerFormat({
162
+ name: 'custom/format/custom-media',
163
+ formatter({dictionary}) {
164
+ return dictionary.allProperties
165
+ .map(prop => {
166
+ const {value, path, name} = prop
167
+ // const tokenPath = path
168
+ // const tokenProperty = path[path.length - 1]
169
+ return `@custom-media --${name}-viewport ${value};`
170
+ })
171
+ .join('\n')
172
+ }
173
+ })
174
+
175
+ // format docs
176
+ StyleDictionary.registerFormat({
177
+ name: 'json/docs',
178
+ formatter: function({dictionary}) {
179
+ const groupedTokens = groupBy(dictionary.allProperties, 'filePath')
180
+
181
+ return JSON.stringify(groupedTokens, null, 2)
182
+ }
183
+ })
184
+
185
+ /**
186
+ * Replacement format for javascript/module
187
+ */
188
+ StyleDictionary.registerFormat({
189
+ name: 'javascript/module-v2',
190
+ formatter: function({dictionary, file}) {
191
+ const recursiveleyFlattenDictionary = obj => {
192
+ const tree = {}
193
+ if (typeof obj !== 'object' || Array.isArray(obj)) {
194
+ return obj
195
+ }
196
+
197
+ if (obj.hasOwnProperty('value')) {
198
+ return obj.value
199
+ } else {
200
+ for (const name in obj) {
201
+ if (obj.hasOwnProperty(name)) {
202
+ tree[name] = recursiveleyFlattenDictionary(obj[name])
203
+ }
204
+ }
205
+ }
206
+ return tree
207
+ }
208
+
209
+ return (
210
+ fileHeader({file}) +
211
+ 'module.exports = ' +
212
+ JSON.stringify(recursiveleyFlattenDictionary(dictionary.tokens), null, 2)
213
+ )
214
+ }
215
+ })
216
+
217
+ /**
218
+ * Replacement format for typescript/module-declarations
219
+ * Type schema corresponds to javascript/module-v2 format
220
+ */
221
+ StyleDictionary.registerFormat({
222
+ name: 'typescript/module-declarations-v2',
223
+ formatter: function({dictionary, options, file}) {
224
+ const {moduleName = `tokens`} = options
225
+
226
+ const getType = value => {
227
+ switch (typeof value) {
228
+ case 'string':
229
+ return 'string'
230
+ case 'number':
231
+ return 'number'
232
+ default:
233
+ return 'any'
234
+ }
235
+ }
236
+
237
+ const recursiveTypeGeneration = obj => {
238
+ const tree = {}
239
+ const shortHandSizes = ['large', 'medium', 'small']
240
+ if (typeof obj !== 'object' || Array.isArray(obj)) {
241
+ return obj
242
+ }
243
+
244
+ if (obj.hasOwnProperty('value') && typeof obj.value === 'string') {
245
+ return getType(obj.value)
246
+ } else {
247
+ for (const name in obj) {
248
+ if ((obj.hasOwnProperty(name) && obj.name === 'shorthand') || shortHandSizes.includes(obj.name)) {
249
+ for (const shorthandKey in obj.value) {
250
+ tree[shorthandKey] = getType(obj.value[shorthandKey])
251
+ }
252
+ return tree
253
+ } else if (obj.hasOwnProperty(name)) {
254
+ tree[name] = recursiveTypeGeneration(obj[name])
255
+ }
256
+ }
257
+ }
258
+ return tree
259
+ }
260
+
261
+ const output =
262
+ fileHeader({file}) +
263
+ `declare const ${moduleName}: ${JSON.stringify(recursiveTypeGeneration(dictionary.tokens), null, 2)}
264
+ export default ${moduleName};`
265
+
266
+ return output
267
+ .replace(/"any"/g, 'any')
268
+ .replace(/"string"/g, 'string')
269
+ .replace(/"number"/g, 'number')
270
+ }
271
+ })
272
+
273
+ /**
274
+ * @name groupBy
275
+ * @description Equivalent to lodash _.groupBy, to avoid creating another package dependency for users
276
+ * @param {Array|Object} The collection to iterate over.
277
+ * @param {Function} The iteratee to transform keys.
278
+ * @returns {Object} Returns the composed aggregate object.
279
+ */
280
+ function groupBy(collection, iteratee = x => x) {
281
+ const current = typeof iteratee === 'function' ? iteratee : ({[iteratee]: prop}) => prop
282
+
283
+ const array = Array.isArray(collection) ? collection : Object.values(collection)
284
+
285
+ return array.reduce((acc, item) => {
286
+ const value = current(item)
287
+
288
+ acc[value] = acc[value] || []
289
+
290
+ acc[value].push(item)
291
+
292
+ return acc
293
+ }, {})
294
+ }
295
+
296
+ /**
297
+ * @name build
298
+ * @description
299
+ * Used to generate design tokens programmatically using StyleDictionary
300
+ * Called internally to build primitives and exported for self-serve use
301
+ *
302
+ * @param {Object} options
303
+ * @param {string} options.source glob or file path to a JSON object of tokens
304
+ * @param {string} options.outputPath location to write the output files
305
+ * @param {string} options.namespace a custom namespace to use for the output files
306
+ * @param {Platform} options.platforms add custom platform configurations to style-dictionary
307
+ * @example
308
+ * buildPrimitives({
309
+ * source: [`src/colors.json`],
310
+ * outputPath: 'dist',
311
+ * namespace: 'primer',
312
+ * platforms: {...}
313
+ * })
314
+ */
315
+ function buildPrimitives(
316
+ {source, outputPath = 'tokens-v2-private', include, platforms, namespace = 'primer'},
317
+ _StyleDictionary = StyleDictionary
318
+ ) {
319
+ console.log('Build started...')
320
+ console.log('\n==============================================')
321
+
322
+ const customParseConfig = {
323
+ parsers: [
324
+ {
325
+ pattern: /\.json$/,
326
+ parse: ({contents, filePath}) => {
327
+ try {
328
+ let mutableContent = JSON.stringify(contents)
329
+
330
+ if (filePath.includes('/functional/')) {
331
+ mutableContent = mutableContent.replace(/<namespace>/g, namespace)
332
+ }
333
+
334
+ const parsed = JSON.parse(mutableContent)
335
+
336
+ return JSON.parse(parsed)
337
+ } catch (error) {
338
+ console.log(error)
339
+ }
340
+ }
341
+ }
342
+ ]
343
+ }
344
+
345
+ const getConfig = files => {
346
+ const defaultPlatformConfig = {
347
+ css: {
348
+ buildPath: `${outputPath}/css/`,
349
+ transformGroup: 'css',
350
+ // map the array of token file paths to style dictionary output files
351
+ files: files.map(filePath => {
352
+ return {
353
+ format: `css/variables`,
354
+ destination: filePath.replace(`.json`, `.css`),
355
+ filter: token => token.filePath === filePath,
356
+ options: {
357
+ outputReferences: true
358
+ }
359
+ }
360
+ })
361
+ },
362
+ cssViewport: {
363
+ buildPath: `${outputPath}/css/tokens/functional/size/`,
364
+ transformGroup: 'css',
365
+ files: [
366
+ {
367
+ filter: token => token.filePath.includes('viewport'),
368
+ format: 'custom/format/custom-media',
369
+ destination: 'viewport.css'
370
+ }
371
+ ]
372
+ },
373
+ js: {
374
+ buildPath: `${outputPath}/js/`,
375
+ transforms: ['name/js/es6', 'pxToRem'],
376
+ // map the array of token file paths to style dictionary output files
377
+ files: files.map(filePath => {
378
+ return {
379
+ format: `javascript/es6`,
380
+ destination: filePath.replace(`.json`, `.js`),
381
+ filter: token => token.filePath === filePath
382
+ }
383
+ })
384
+ },
385
+ jsModule: {
386
+ buildPath: `${outputPath}/js/module/`,
387
+ transforms: ['pxToRem'],
388
+ // map the array of token file paths to style dictionary output files
389
+ files: files.map(filePath => {
390
+ return {
391
+ format: `javascript/module`,
392
+ destination: filePath.replace(`.json`, `.js`),
393
+ filter: token => token.filePath === filePath
394
+ }
395
+ })
396
+ },
397
+ tsTypes: {
398
+ buildPath: `${outputPath}/ts/`,
399
+ transforms: ['pxToRem'],
400
+ // map the array of token file paths to style dictionary output files
401
+ files: files.map(filePath => {
402
+ return {
403
+ format: `typescript/module-declarations-v2`,
404
+ destination: filePath.replace(`.json`, `.d.ts`),
405
+ filter: token => token.filePath === filePath
406
+ }
407
+ })
408
+ },
409
+ ts: {
410
+ buildPath: `${outputPath}/ts/`,
411
+ transforms: ['pxToRem'],
412
+ // map the array of token file paths to style dictionary output files
413
+ files: files.map(filePath => {
414
+ return {
415
+ format: `javascript/module-v2`,
416
+ destination: filePath.replace(`.json`, `.js`),
417
+ filter: token => token.filePath === filePath
418
+ }
419
+ })
420
+ }
421
+ }
422
+
423
+ const config = {
424
+ ...{include: include ? [include] : undefined},
425
+ source: files,
426
+ ...customParseConfig,
427
+ platforms: platforms ? platforms : defaultPlatformConfig
428
+ }
429
+ return config
430
+ }
431
+
432
+ //build all tokens
433
+ _StyleDictionary
434
+ .extend({
435
+ ...getConfig(glob.sync([...source]))
436
+ })
437
+ .buildAllPlatforms()
438
+ }
439
+
440
+ /**
441
+ * @name init
442
+ * @description
443
+ * Triggers the build for @primer/primitive default tokens
444
+ * from an npm script. Internal use only. Use `build` for self-serve.
445
+ * @private
446
+ */
447
+ function _init() {
448
+ const outputPath = 'tokens-v2-private'
449
+ //build all tokens
450
+ buildPrimitives({
451
+ source: [`tokens/**/*.json`, `!tokens/**/size-*.json`],
452
+ outputPath
453
+ })
454
+
455
+ //build size fine
456
+ buildPrimitives({
457
+ source: [`tokens/functional/size/size-fine.json`, `tokens/base/size/size.json`],
458
+ outputPath
459
+ })
460
+
461
+ //build size coarse
462
+ buildPrimitives({
463
+ source: [`tokens/functional/size/size-coarse.json`, `tokens/base/size/size.json`],
464
+ outputPath
465
+ })
466
+
467
+ buildPrimitives({
468
+ source: [`tokens/base/size/size.json`, `tokens/functional/size/size-fine.json`],
469
+ outputPath,
470
+ platforms: {
471
+ css: {
472
+ buildPath: `${outputPath}/css/`,
473
+ transformGroup: 'css',
474
+ files: [
475
+ {
476
+ destination: `tokens/functional/size/size-fine.css`,
477
+ format: `css/touch-target-desktop`,
478
+ filter: token => token.filePath.includes('fine'),
479
+ options: {
480
+ outputReferences: true
481
+ }
482
+ }
483
+ ]
484
+ }
485
+ }
486
+ })
487
+
488
+ buildPrimitives({
489
+ source: [`tokens/base/size/size.json`, `tokens/functional/size/size-coarse.json`],
490
+ platforms: {
491
+ css: {
492
+ buildPath: `${outputPath}/css/`,
493
+ transformGroup: 'css',
494
+ files: [
495
+ {
496
+ destination: `tokens/functional/size/size-coarse.css`,
497
+ format: `css/touch-target-mobile`,
498
+ filter: token => token.filePath.includes('coarse'),
499
+ options: {
500
+ outputReferences: true
501
+ }
502
+ }
503
+ ]
504
+ }
505
+ }
506
+ })
507
+
508
+ //build docs data
509
+ buildPrimitives({
510
+ source: [`tokens/**/*.json`],
511
+ outputPath,
512
+ platforms: {
513
+ docs: {
514
+ buildPath: `${outputPath}/docs/`,
515
+ transformGroup: 'css',
516
+ files: [
517
+ {
518
+ format: 'json/docs',
519
+ destination: 'docValues.json',
520
+ options: {
521
+ outputReferences: false
522
+ }
523
+ }
524
+ ]
525
+ }
526
+ }
527
+ })
528
+ }
529
+
530
+ module.exports = {
531
+ buildPrimitives,
532
+ _init,
533
+ StyleDictionary
534
+ }
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "7.8.1",
3
+ "version": "7.8.3-rc.a61b03e",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
5
  "files": [
6
6
  "dist",
7
- "tokens-v2-private"
7
+ "tokens-v2-private",
8
+ "build.js",
9
+ "tokens/"
8
10
  ],
9
11
  "main": "dist/js/index.js",
10
12
  "types": "dist/js/index.d.ts",
@@ -25,8 +27,9 @@
25
27
  "homepage": "https://github.com/primer/primitives#readme",
26
28
  "scripts": {
27
29
  "build": "ts-node ./script/build.ts && tsc",
28
- "build:tokens": "node ./build.js",
29
- "prebuild": "rm -rf dist && rm -rf tokens-v2-private",
30
+ "build:tokens": "node -e \"require('./build')._init()\"",
31
+ "prebuild": "rm -rf dist",
32
+ "prebuild:tokens": "rm -rf tokens-v2-private",
30
33
  "prepack": "yarn build && yarn build:tokens",
31
34
  "release": "changeset publish",
32
35
  "watch": "ls data/**/*.scss script/**/*.ts | entr -s 'yarn build'"
@@ -0,0 +1,57 @@
1
+ {
2
+ "base": {
3
+ "size": {
4
+ "4": {
5
+ "value": "4px"
6
+ },
7
+ "8": {
8
+ "value": "8px"
9
+ },
10
+ "12": {
11
+ "value": "12px"
12
+ },
13
+ "16": {
14
+ "value": "16px"
15
+ },
16
+ "20": {
17
+ "value": "20px"
18
+ },
19
+ "24": {
20
+ "value": "24px"
21
+ },
22
+ "28": {
23
+ "value": "28px"
24
+ },
25
+ "32": {
26
+ "value": "32px"
27
+ },
28
+ "36": {
29
+ "value": "36px"
30
+ },
31
+ "40": {
32
+ "value": "40px"
33
+ },
34
+ "44": {
35
+ "value": "44px"
36
+ },
37
+ "48": {
38
+ "value": "48px"
39
+ },
40
+ "64": {
41
+ "value": "64px"
42
+ },
43
+ "80": {
44
+ "value": "80px"
45
+ },
46
+ "96": {
47
+ "value": "96px"
48
+ },
49
+ "112": {
50
+ "value": "112px"
51
+ },
52
+ "128": {
53
+ "value": "128px"
54
+ }
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "base": {
3
+ "text": {
4
+ "weight": {
5
+ "light": {
6
+ "value": "300"
7
+ },
8
+ "normal": {
9
+ "value": "400"
10
+ },
11
+ "medium": {
12
+ "value": "500"
13
+ },
14
+ "semibold": {
15
+ "value": "600"
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "<namespace>": {
3
+ "borderInset": {
4
+ "thin": {
5
+ "value": "inset 0 0 0 {<namespace>.borderWidth.thin}"
6
+ },
7
+ "normal": {
8
+ "value": "inset 0 0 0 {<namespace>.borderWidth.normal}"
9
+ },
10
+ "thick": {
11
+ "value": "inset 0 0 0 {<namespace>.borderWidth.thick}"
12
+ }
13
+ },
14
+ "borderWidth": {
15
+ "thin": {
16
+ "value": "max(1px, 0.0625rem)"
17
+ },
18
+ "normal": {
19
+ "value": "max(2px, 0.125rem)"
20
+ },
21
+ "thick": {
22
+ "value": "max(4px, 0.25rem)"
23
+ }
24
+ },
25
+ "borderRadius": {
26
+ "small": {
27
+ "value": "3px"
28
+ },
29
+ "medium": {
30
+ "value": "6px"
31
+ },
32
+ "large": {
33
+ "value": "12px"
34
+ },
35
+ "full": {
36
+ "value": "100vh"
37
+ }
38
+ }
39
+ }
40
+ }