Skip to content

Commit 92ac0e3

Browse files
authored
Setup new primer-primitive bundle (#2078)
* bump * add index * add storybook support * gatsby import * Create itchy-wasps-refuse.md
1 parent faa2ee3 commit 92ac0e3

File tree

9 files changed

+1588
-1174
lines changed

9 files changed

+1588
-1174
lines changed

.changeset/itchy-wasps-refuse.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Setup new `primer-primitive` bundle

docs/.storybook/main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ module.exports = {
88
'@whitespace/storybook-addon-html',
99
'storybook-addon-designs',
1010
'storybook-color-picker'
11-
]
11+
],
12+
framework: '@storybook/react',
13+
core: {
14+
builder: 'webpack5'
15+
}
1216
}

docs/.storybook/preview.js

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ import '../../src/docs.scss'
22
import '../../src/index.scss'
33
import '../../src/base/index.scss'
44
import '../src/stories/helpers/storybook-styles.scss'
5+
// temporary import until primitives moves to core bundle
6+
// importing the index from /css didn't play nice with Storybook
7+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/base/size/size.css'
8+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/base/typography/typography.css'
9+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/border.css'
10+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/breakpoints.css'
11+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-coarse.css'
12+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-fine.css'
13+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size.css'
14+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/viewport.css'
15+
import '../../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/typography/typography.css'
516
import renderToHTML from '../src/stories/helpers/code-snippet-html-helper'
617

718
const customViewports = {

docs/gatsby-browser.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// temporary import until primitives moves to core bundle
2+
// importing the index from /css didn't play nice with Gatsby
3+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/base/size/size.css'
4+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/base/typography/typography.css'
5+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/border.css'
6+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/breakpoints.css'
7+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-coarse.css'
8+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-fine.css'
9+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/size.css'
10+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/size/viewport.css'
11+
import '../node_modules/@primer/primitives/tokens-v2-private/css/tokens/functional/typography/typography.css'

docs/package.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@primer/gatsby-theme-doctocat": "3.1.1",
1616
"@primer/octicons": "17.0.0",
1717
"@primer/octicons-react": "17.0.0",
18-
"@primer/primitives": "7.3.0",
18+
"@primer/primitives": "7.8.3",
1919
"@svgr/webpack": "5.5.0",
2020
"autoprefixer": "10.4.2",
2121
"babel-preset-gatsby": "^2.11.1",
@@ -47,16 +47,18 @@
4747
},
4848
"devDependencies": {
4949
"@babel/core": "^7.16.7",
50-
"@storybook/addon-a11y": "6.4.19",
51-
"@storybook/addon-actions": "^6.4.12",
52-
"@storybook/addon-essentials": "^6.4.12",
53-
"@storybook/addon-links": "^6.4.12",
50+
"@storybook/addon-a11y": "6.5.0",
51+
"@storybook/addon-actions": "^6.5.0",
52+
"@storybook/addon-essentials": "^6.5.0",
53+
"@storybook/addon-links": "^6.5.0",
5454
"@storybook/addon-postcss": "2.0.0",
55+
"@storybook/builder-webpack5": "^6.5.0",
56+
"@storybook/manager-webpack5": "^6.5.0",
5557
"@storybook/preset-scss": "^1.0.3",
56-
"@storybook/react": "6.4.19",
58+
"@storybook/react": "6.5.0",
5759
"@whitespace/storybook-addon-html": "^5.0.0",
5860
"babel-loader": "^8.2.3",
5961
"storybook-addon-designs": "6.2.1",
60-
"storybook-color-picker": "2.3.0"
62+
"storybook-color-picker": "2.3.1"
6163
}
6264
}

docs/yarn.lock

+1,536-1,164
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"storybook": "cd docs && yarn && yarn storybook"
4242
},
4343
"dependencies": {
44-
"@primer/primitives": "^7.7.0"
44+
"@primer/primitives": "^7.8.3"
4545
},
4646
"devDependencies": {
4747
"@changesets/changelog-github": "0.4.4",

src/primitives/index.scss

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import '@primer/primitives/tokens-v2-private/css/tokens/base/size/size.css';
2+
@import '@primer/primitives/tokens-v2-private/css/tokens/base/typography/typography.css';
3+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/border.css';
4+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/breakpoints.css';
5+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-coarse.css';
6+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/size-fine.css';
7+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/size.css';
8+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/size/viewport.css';
9+
@import '@primer/primitives/tokens-v2-private/css/tokens/functional/typography/typography.css';

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@
11621162
"@nodelib/fs.scandir" "2.1.5"
11631163
fastq "^1.6.0"
11641164

1165-
"@primer/primitives@^7.7.0":
1165+
"@primer/primitives@^7.8.3":
11661166
version "7.8.3"
11671167
resolved "https://registry.yarnpkg.com/@primer/primitives/-/primitives-7.8.3.tgz#de7e03492cf977e99f2417490d76421db9715e9f"
11681168
integrity sha512-04ZwfJhpZ0QFwDrJfCuLX6iOh0BflWDTvuoRA80lQH9xk0RtIg16INbruwwtnbSgnKKXXRSykRRJ5BbxnqufRA==

0 commit comments

Comments
 (0)