@primer/primitives 8.2.4-rc.e3ccaf09 → 8.2.4-rc.fba4a4ab

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/README.md CHANGED
@@ -27,7 +27,7 @@ Data is served from the `dist/` folder:
27
27
 
28
28
  All available imports:
29
29
 
30
- ```
30
+ ```css
31
31
  /* size/typography */
32
32
  @import '@primer/primitives/dist/css/base/size/size.css';
33
33
  @import '@primer/primitives/dist/css/base/typography/typography.css';
@@ -70,13 +70,13 @@ In the individual files, e.g. `light.high-contrast.json5` you can now add tokens
70
70
  You can create color tokens that inherit a color but have a different alpha value by adding the `alpha` property.
71
71
  **Note:** The original alpha value will be replaced by your value. If you add `alpha: 0.4` to a color, it doesn't matter if the color you reference has no `alpha` or `alpha: 0.7`, the new token will always have newly the defined value of `alpha: 0.4`.
72
72
 
73
- ```js
73
+ ```json5
74
74
  {
75
75
  muted: {
76
76
  $value: '{base.color.blue.3}',
77
77
  alpha: 0.4, // the opacity value of the color === 40% opaque
78
78
  $type: 'color',
79
- }
79
+ },
80
80
  }
81
81
  ```
82
82
 
@@ -88,17 +88,17 @@ The `mix` proeprty mixes the color it gets into the main color from the `$value`
88
88
 
89
89
  A `mix` proprty must always have a `color` and a `weight` child. `color` can be a `hex` value or a reference to a valid color. The `weight` property must receive a value between `0.0` and `1`.
90
90
 
91
- ```js
91
+ ```json5
92
92
  {
93
93
  control: {
94
- $value: '{base.color.gray.4}', // main color
95
- $type: 'color',
96
- mix: {
97
- color: '{base.color.gray.5}', // color to mix into the main color
98
- weight: 0.2, // amount of the mix color that is added === 20% of gray.5 is mix into gray.4
94
+ $value: '{base.color.gray.4}', // main color
95
+ $type: 'color',
96
+ mix: {
97
+ color: '{base.color.gray.5}', // color to mix into the main color
98
+ weight: 0.2, // amount of the mix color that is added === 20% of gray.5 is mix into gray.4
99
+ },
99
100
  },
100
101
  }
101
- }
102
102
  ```
103
103
 
104
104
  #### Extensions property
@@ -113,7 +113,7 @@ For our Figma export we use the following meta data:
113
113
 
114
114
  Code example
115
115
 
116
- ```js
116
+ ```json5
117
117
  bgColor: {
118
118
  $value: '{borderColor.accent.muted}',
119
119
  $type: 'color',
@@ -133,18 +133,18 @@ Token names have to be in camelCase or kebab-case and may only include letters,
133
133
  The only acception is the `@`-hack. This is used when you want to have a default value and sub-values, e.g. `bgColor.accent` and `bgColor.accent.muted`.
134
134
  In this case you can create the follwing structure. The `@` will be removed from the name and act as the default value.
135
135
 
136
- ```js
136
+ ```json5
137
137
  {
138
138
  bgColor: {
139
139
  accent: {
140
- "@": {
140
+ '@': {
141
141
  // values for accent (default)
142
142
  },
143
- "muted": {
143
+ muted: {
144
144
  // values for accent-muted
145
- }
146
- }
147
- }
145
+ },
146
+ },
147
+ },
148
148
  }
149
149
  ```
150
150
 
@@ -155,4 +155,3 @@ In this case you can create the follwing structure. The `@` will be removed from
155
155
  [primer]: https://github.com/primer/primer
156
156
  [npm]: https://www.npmjs.com/
157
157
  [install-npm]: https://docs.npmjs.com/getting-started/installing-node
158
- [scss]: https://sass-lang.com/
@@ -9,6 +9,7 @@
9
9
  --borderRadius-medium: 0.375rem;
10
10
  --borderRadius-large: 0.75rem;
11
11
  --borderRadius-full: 624.9375rem;
12
+ --borderRadius-default: 0.375rem;
12
13
  --outline-focus-offset: -0.125rem;
13
14
  --outline-focus-width: 0.125rem;
14
15
  }
@@ -41,6 +41,7 @@
41
41
  --borderRadius-medium: 0.375rem;
42
42
  --borderRadius-large: 0.75rem;
43
43
  --borderRadius-full: 624.9375rem;
44
+ --borderRadius-default: 0.375rem;
44
45
  --outline-focus-offset: -0.125rem;
45
46
  --outline-focus-width: 0.125rem;
46
47
  }
@@ -205,6 +205,37 @@
205
205
  "attributes": {},
206
206
  "path": ["borderRadius", "full"]
207
207
  },
208
+ "borderRadius-default": {
209
+ "value": "0.375rem",
210
+ "$type": "dimension",
211
+ "$extensions": {
212
+ "org.primer.figma": {
213
+ "collection": "functional/size",
214
+ "scopes": ["radius"],
215
+ "codeSyntax": {
216
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
217
+ }
218
+ }
219
+ },
220
+ "filePath": "src/tokens/functional/size/border.json",
221
+ "isSource": true,
222
+ "original": {
223
+ "value": "{borderRadius.medium}",
224
+ "$type": "dimension",
225
+ "$extensions": {
226
+ "org.primer.figma": {
227
+ "collection": "functional/size",
228
+ "scopes": ["radius"],
229
+ "codeSyntax": {
230
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
231
+ }
232
+ }
233
+ }
234
+ },
235
+ "name": "borderRadius-default",
236
+ "attributes": {},
237
+ "path": ["borderRadius", "default"]
238
+ },
208
239
  "outline-focus-offset": {
209
240
  "value": "-0.125rem",
210
241
  "$type": "dimension",
@@ -9,6 +9,7 @@
9
9
  "--borderRadius-medium": "0.375rem",
10
10
  "--borderRadius-large": "0.75rem",
11
11
  "--borderRadius-full": "624.9375rem",
12
+ "--borderRadius-default": "0.375rem",
12
13
  "--outline-focus-offset": "-0.125rem",
13
14
  "--outline-focus-width": "0.125rem"
14
15
  }
@@ -462,6 +462,20 @@
462
462
  "group": "base/size",
463
463
  "scopes": ["WIDTH_HEIGHT"]
464
464
  },
465
+ {
466
+ "name": "borderRadius/default",
467
+ "value": 6,
468
+ "type": "FLOAT",
469
+ "refId": "functional/size/borderRadius/default",
470
+ "reference": "functional/size/borderRadius/medium",
471
+ "collection": "functional/size",
472
+ "mode": "default",
473
+ "group": "functional/size",
474
+ "scopes": ["CORNER_RADIUS"],
475
+ "codeSyntax": {
476
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
477
+ }
478
+ },
465
479
  {
466
480
  "name": "overlay/borderRadius",
467
481
  "value": 6,
@@ -205,6 +205,37 @@
205
205
  "attributes": {},
206
206
  "path": ["borderRadius", "full"]
207
207
  },
208
+ "borderRadius-default": {
209
+ "value": ["0.0234375rem", "0.375px"],
210
+ "$type": "dimension",
211
+ "$extensions": {
212
+ "org.primer.figma": {
213
+ "collection": "functional/size",
214
+ "scopes": ["radius"],
215
+ "codeSyntax": {
216
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
217
+ }
218
+ }
219
+ },
220
+ "filePath": "src/tokens/functional/size/border.json",
221
+ "isSource": true,
222
+ "original": {
223
+ "value": "{borderRadius.medium}",
224
+ "$type": "dimension",
225
+ "$extensions": {
226
+ "org.primer.figma": {
227
+ "collection": "functional/size",
228
+ "scopes": ["radius"],
229
+ "codeSyntax": {
230
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
231
+ }
232
+ }
233
+ }
234
+ },
235
+ "name": "borderRadius-default",
236
+ "attributes": {},
237
+ "path": ["borderRadius", "default"]
238
+ },
208
239
  "outline-focus-offset": {
209
240
  "value": ["-0.125rem", "-2px"],
210
241
  "$type": "dimension",
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "8.2.4-rc.e3ccaf09",
3
+ "version": "8.2.4-rc.fba4a4ab",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
+ "engines": {
6
+ "node": ">=18.18.0 <18.19.0"
7
+ },
5
8
  "files": [
6
9
  "dist",
7
10
  "src/**/*",
@@ -25,17 +28,17 @@
25
28
  "scripts": {
26
29
  "build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma",
27
30
  "build:next": "echo '\\033[31m 🛑 Use npm run build instead of npm run build:next\\033[0m'",
28
- "build:v8": "ts-node ./scripts/buildTokens.ts",
29
- "build:fallbacks": "ts-node ./scripts/buildFallbacks.ts",
30
- "build:figma": "ts-node scripts/buildFigma.ts",
31
- "tokenJson:check": "ts-node scripts/diffThemes.ts && ts-node scripts/diffTokenProps.ts",
32
- "contrast:check": "ts-node scripts/color-contrast.ts",
31
+ "build:v8": "tsx ./scripts/buildTokens.ts",
32
+ "build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
33
+ "build:figma": "tsx scripts/buildFigma.ts",
34
+ "tokenJson:check": "tsx scripts/diffThemes.ts && tsx scripts/diffTokenProps.ts",
35
+ "contrast:check": "tsx scripts/color-contrast.ts",
33
36
  "format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
34
37
  "format:check": "prettier --check '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
35
38
  "install:storybook": "cd docs/storybook && npm ci --legacy-peer-deps --no-audit --no-fund",
36
- "lint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0 --config .eslintrc.cjs && npm run lint:tokens",
39
+ "lint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{js,ts,tsx,md,mdx}' --config .eslintrc.cjs && npm run lint:tokens",
37
40
  "lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.cjs",
38
- "lint:tokens": "ts-node ./scripts/validateTokenJson.ts",
41
+ "lint:tokens": "tsx ./scripts/validateTokenJson.ts",
39
42
  "prebuild": "rm -rf dist",
40
43
  "prepack": "npm run build",
41
44
  "release": "changeset publish",
@@ -71,7 +74,7 @@
71
74
  "markdown-table-ts": "^1.0.3",
72
75
  "prettier": "3.3",
73
76
  "style-dictionary": "^3.9.2",
74
- "ts-node": "^10.9.2",
77
+ "tsx": "^4.16.2",
75
78
  "typescript": "5.5",
76
79
  "vitest": "^2.0.1",
77
80
  "zod": "3.23",
@@ -81,6 +81,19 @@
81
81
  }
82
82
  }
83
83
  }
84
+ },
85
+ "default": {
86
+ "$value": "{borderRadius.medium}",
87
+ "$type": "dimension",
88
+ "$extensions": {
89
+ "org.primer.figma": {
90
+ "collection": "functional/size",
91
+ "scopes": ["radius"],
92
+ "codeSyntax": {
93
+ "web": "var(--borderRadius-default) /* utility class: .rounded-2 */"
94
+ }
95
+ }
96
+ }
84
97
  }
85
98
  },
86
99
  "outline": {