Skip to content

Commit 10a469d

Browse files
authored
Spectrum 2 (#6777)
2 parents 14f324f + c795330 commit 10a469d

File tree

760 files changed

+34141
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

760 files changed

+34141
-115
lines changed

.circleci/comment.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ async function run() {
5757
[Publish stats](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/publish.json)
5858
[Size diff since last release](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/size-diff.txt)
5959
[Docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/docs/index.html)
60-
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)`
60+
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)
61+
[S2 Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)`
6162
});
6263
}
6364
} catch (error) {
@@ -79,6 +80,7 @@ async function run() {
7980
* [View the storybook-19](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-19/index.html)
8081
* [View the storybook-17](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-17/index.html)
8182
* [View the storybook-16](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-16/index.html)
83+
* [View the S2 storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
8284
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)`
8385
});
8486
} catch (err) {

.circleci/config.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ jobs:
288288
name: test
289289
command: |
290290
make build
291-
yarn workspaces foreach --all -pt run prepublishOnly
292291
node --loader ./scripts/esm-support/loader.mjs ./scripts/esm-support/testESM.mjs
293292
294293
lint:
@@ -423,6 +422,21 @@ jobs:
423422
paths:
424423
- '*/storybook-19/'
425424

425+
storybook-s2:
426+
executor: rsp-large
427+
steps:
428+
- restore_cache:
429+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
430+
431+
- run:
432+
name: build s2 storybook
433+
command: yarn build:storybook-s2
434+
435+
- persist_to_workspace:
436+
root: dist
437+
paths:
438+
- '*/storybook-s2/'
439+
426440
docs:
427441
executor: rsp-xlarge
428442
steps:
@@ -609,6 +623,9 @@ workflows:
609623
- storybook-19:
610624
requires:
611625
- install-19
626+
- storybook-s2:
627+
requires:
628+
- install
612629
- docs:
613630
requires:
614631
- install
@@ -632,6 +649,7 @@ workflows:
632649
- storybook-16
633650
- storybook-17
634651
- storybook-19
652+
- storybook-s2
635653
- docs
636654
- deploy-verdaccio:
637655
requires:

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ packages/dev/storybook-builder-parcel/preview.js
1616
packages/dev/optimize-locales-plugin/LocalesPlugin.d.ts
1717
examples/**
1818
starters/**
19+
packages/@react-spectrum/s2/icon.d.ts

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ module.exports = {
9797
}
9898
]
9999
}
100+
},
101+
{
102+
files: ['packages/@react-spectrum/s2/**'],
103+
rules: {
104+
'react/react-in-jsx-scope': OFF
105+
}
100106
}],
101107
env: {
102108
'browser': true,

.parcelrc-build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"resolvers": ["@parcel/resolver-glob", "parcel-resolver-build", "..."],
44
"bundler": "@parcel/bundler-library",
55
"transformers": {
6+
"style-types:*.ts": ["@parcel/transformer-typescript-types"],
67
"packages/**/intl/*.json": ["parcel-transformer-intl"],
78
"bundle-text:*.svg": ["@parcel/transformer-svg", "@parcel/transformer-inline-string"],
9+
"packages/@react-spectrum/s2/s2wf-icons/*.svg": ["parcel-transformer-icon"],
10+
// Disable PostCSS from running over style macro output
11+
"packages/@react-spectrum/s2/**/*.css": ["@parcel/transformer-css"],
812
"*.svg": ["@parcel/transformer-svg-react"],
913
"*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [
1014
"@parcel/transformer-js",
1115
"@parcel/transformer-react-refresh-wrap"
1216
]
1317
},
14-
"namers": ["parcel-namer-intl", "..."]
18+
"namers": ["parcel-namer-icon", "parcel-namer-intl", "..."]
1519
}

.storybook-s2/.parcelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"resolvers": ["@parcel/resolver-glob", "parcel-resolver-storybook", "..."],
4+
"transformers": {
5+
"packages/@react-spectrum/s2/{src,stories}/*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": ["parcel-transformer-react-docgen-typescript", "..."],
6+
"packages/@react-spectrum/s2/s2wf-icons/*.svg": ["parcel-transformer-icon"],
7+
"packages/*/*/intl/*.json": ["parcel-transformer-intl"],
8+
// Disable PostCSS from running over style macro output
9+
"*.css": ["@parcel/transformer-css"],
10+
"*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [
11+
"@parcel/transformer-js",
12+
"@parcel/transformer-react-refresh-wrap"
13+
],
14+
"*.svg": ["@parcel/transformer-svg-react"],
15+
"*.{mdx,md}": ["parcel-transformer-mdx-storybook"],
16+
"raw:*": ["@parcel/transformer-raw"]
17+
}
18+
}

.storybook-s2/docs/Icons.jsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import icons from '@react-spectrum/s2/s2wf-icons/*.svg';
2+
import { style } from '../../packages/@react-spectrum/s2/style/spectrum-theme' with {type: 'macro'};
3+
import {ActionButton, Text} from '@react-spectrum/s2';
4+
import {P, Code, Pre} from './typography';
5+
import {highlight} from './highlight' with {type: 'macro'};
6+
7+
export function Icons() {
8+
return (
9+
<div className={style({maxWidth: 'lg', marginX: 'auto', fontFamily: 'sans'})}>
10+
<div className={style({marginX: 48})}>
11+
<h1 className={style({fontSize: 'heading-2xl', color: 'heading', marginBottom: 48})}>
12+
Workflow icons
13+
</h1>
14+
<P>Spectrum 2 offers a subset of the icons currently available in React Spectrum v3. These icons can be imported from <Code>@react-spectrum/s2/icons</Code>.</P>
15+
<Pre>{highlight("import Add from '@react-spectrum/s2/icons/Add';")}</Pre>
16+
<P>See below for a full list of available icons. Click to copy import statement.</P>
17+
<div className={style({display: 'flex', flexWrap: 'wrap', gap: 4, marginTop: 48})}>
18+
{Object.keys(icons).map(icon => {
19+
let Icon = icons[icon].default;
20+
let name = icon.replace(/^S2_Icon_(.*?)_2.*/, '$1');
21+
let importName = name.replace(/^(\d)/, '_$1');
22+
return (
23+
<ActionButton
24+
key={icon}
25+
onPress={() => navigator.clipboard.writeText(`import ${importName} from '@react-spectrum/s2/icons/${name}';`)}>
26+
<Icon />
27+
<Text>{name}</Text>
28+
</ActionButton>
29+
);
30+
})}
31+
</div>
32+
</div>
33+
</div>
34+
);
35+
}

0 commit comments

Comments
 (0)