Skip to content

Commit b0e4245

Browse files
committed
Merge branch 'main' into datepicker-autocomplete
2 parents 3a78310 + 8e94a19 commit b0e4245

File tree

1,102 files changed

+33013
-11413
lines changed

Some content is hidden

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

1,102 files changed

+33013
-11413
lines changed

.circleci/comment.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function run() {
6060
[Publish stats](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/publish.json)
6161
[Size diff since last release](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/size-diff.txt)
6262
[Docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/docs/index.html)
63-
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)
63+
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
6464
[S2 Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)`
6565
});
6666
}
@@ -79,9 +79,10 @@ async function run() {
7979
issue_number: pr,
8080
body: `Build successful! 🎉
8181
82-
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)
82+
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
8383
* [View the S2 storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
84-
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)`
84+
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)
85+
* [View the S2 docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/s2-docs/index.html)`
8586
});
8687
} catch (err) {
8788
console.error(err)

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,21 @@ jobs:
470470
paths:
471471
- '*/docs/'
472472

473+
s2-docs:
474+
executor: rsp-xlarge
475+
steps:
476+
- restore_cache:
477+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
478+
479+
- run:
480+
name: build s2 docs
481+
command: make s2-docs
482+
483+
- persist_to_workspace:
484+
root: dist
485+
paths:
486+
- '*/s2-docs/'
487+
473488
verdaccio:
474489
executor: rsp-xlarge
475490
steps:
@@ -874,6 +889,9 @@ workflows:
874889
- docs:
875890
requires:
876891
- install
892+
- s2-docs:
893+
requires:
894+
- install
877895
- verdaccio:
878896
filters:
879897
branches:
@@ -928,6 +946,7 @@ workflows:
928946
- storybook
929947
- storybook-s2
930948
- docs
949+
- s2-docs
931950
- deploy-verdaccio:
932951
requires:
933952
- v-docs

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ test-reports.xml
1717
storage
1818
packages/dev/storybook-builder-parcel/iframe.html
1919
packages/dev/storybook-builder-parcel/preview.js
20+
starters/docs/registry
21+
starters/tailwind/registry

.storybook-s2/custom-addons/provider/index.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import React, {useEffect, useState} from 'react';
22
import {addons} from '@storybook/preview-api';
33
import {makeDecorator} from '@storybook/preview-api';
4-
import {getQueryParams} from '@storybook/preview-api';
54
// Importing from src so that HMR works.
6-
// Without this, all HMR updates will bubble through the index.ts and up
5+
// Without this, all HMR updates will bubble through the index.ts and up
76
// to the root instead of stopping at the story files.
87
import {Provider} from '../../../packages/@react-spectrum/s2/src/Provider';
98

109
document.body.style.margin = '0';
1110

12-
const providerValuesFromUrl = Object.entries(getQueryParams()).reduce((acc, [k, v]) => {
13-
if (k.includes('providerSwitcher-')) {
14-
return { ...acc, [k.replace('providerSwitcher-', '')]: v };
15-
}
16-
return acc;
17-
}, {});
18-
1911
function ProviderUpdater(props) {
20-
let [localeValue, setLocale] = useState(providerValuesFromUrl.locale || undefined);
12+
let params = new URLSearchParams(document.location.search);
13+
let localeParam = params.get('providerSwitcher-locale') || undefined;
14+
let [localeValue, setLocale] = useState(localeParam);
2115

2216
useEffect(() => {
2317
let channel = addons.getChannel();

.storybook-s2/custom-addons/provider/register.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11

22
import {addons, types} from '@storybook/manager-api';
3-
import {getQueryParams} from '@storybook/preview-api';
43
import {locales} from '../../constants';
54
import React, {useEffect, useState} from 'react';
65

7-
const providerValuesFromUrl = Object.entries(getQueryParams()).reduce((acc, [k, v]) => {
8-
if (k.includes('providerSwitcher-')) {
9-
return { ...acc, [k.replace('providerSwitcher-', '')]: v };
10-
}
11-
return acc;
12-
}, {});
13-
146
function ProviderFieldSetter({api}) {
15-
let [values, setValues] = useState({locale: providerValuesFromUrl.locale || undefined});
7+
let localeParam = api.getQueryParam('providerSwitcher-locale') || undefined;
8+
let [values, setValues] = useState({locale: localeParam});
169
let channel = addons.getChannel();
1710
let onLocaleChange = (e) => {
1811
let newValue = e.target.value || undefined;

.storybook-s2/docs/Icons.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import icons from '@react-spectrum/s2/s2wf-icons/*.svg';
1+
import icons from '../../packages/@react-spectrum/s2/s2wf-icons/*.svg';
22
import { style } from '../../packages/@react-spectrum/s2/style/spectrum-theme' with {type: 'macro'};
33
import {ActionButton, Text} from '@react-spectrum/s2';
44
import {H2, H3, P, Code, Pre, Link} from './typography';

.storybook-s2/docs/StyleMacro.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function MyComponent({variant}) {
205205
display: 'flex',
206206
alignItems: 'center',
207207
columnGap: 8
208-
};
208+
} as const;
209209
210210
const styles = style({
211211
...horizontalStack,
@@ -218,7 +218,7 @@ export function horizontalStack(gap: number) {
218218
display: 'flex',
219219
alignItems: 'center',
220220
columnGap: gap
221-
};
221+
} as const;
222222
}`)}</Pre>
223223
<P>Then, import your macro and use it in a component.</P>
224224
<Pre>{highlight(`// component.tsx

.storybook-s2/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const config: StorybookConfig = {
3131
framework: {
3232
name: "storybook-react-parcel",
3333
options: {},
34+
},
35+
core: {
36+
disableWhatsNewNotifications: true
3437
}
3538
// typescript: {
3639
// reactDocgen: 'react-docgen-typescript',

.storybook/custom-addons/descriptions/register.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
2-
import {addons, types} from '@storybook/manager-api';
1+
import {addons, types, useParameter} from '@storybook/manager-api';
32
import { AddonPanel } from '@storybook/components';
43
import React from 'react';
5-
import { useParameter } from '@storybook/api';
64

75
const ADDON_ID = 'descriptionAddon';
86
const PANEL_ID = `${ADDON_ID}/panel`;
@@ -19,10 +17,10 @@ addons.register(ADDON_ID, (api) => {
1917
addons.add(PANEL_ID, {
2018
type: types.PANEL,
2119
title: 'Description',
22-
render: ({ active }) => (
20+
render: ({active}) => (
2321
<AddonPanel active={active}>
2422
<MyPanel />
2523
</AddonPanel>
26-
),
24+
)
2725
});
2826
});

.storybook/custom-addons/provider/index.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import React, {useEffect, useState} from 'react';
22
import {addons} from '@storybook/preview-api';
33
import {makeDecorator} from '@storybook/preview-api';
4-
import {getQueryParams} from '@storybook/preview-api';
54
import {Provider} from '@react-spectrum/provider';
65
import {expressThemes, themes, defaultTheme} from '../../constants';
76

87
document.body.style.margin = '0';
98

10-
const providerValuesFromUrl = Object.entries(getQueryParams()).reduce((acc, [k, v]) => {
11-
if (k.includes('providerSwitcher-')) {
12-
return { ...acc, [k.replace('providerSwitcher-', '')]: v };
13-
}
14-
return acc;
15-
}, {});
16-
179
function ProviderUpdater(props) {
18-
let [localeValue, setLocale] = useState(providerValuesFromUrl.locale || undefined);
19-
let [themeValue, setTheme] = useState(providerValuesFromUrl.theme || undefined);
20-
let [scaleValue, setScale] = useState(providerValuesFromUrl.scale || undefined);
21-
let [expressValue, setExpress] = useState(providerValuesFromUrl.express === 'true');
10+
let params = new URLSearchParams(document.location.search);
11+
let localeParam = params.get("providerSwitcher-locale") || undefined;
12+
let [localeValue, setLocale] = useState(localeParam);
13+
let themeParam = params.get("providerSwitcher-theme") || undefined;
14+
let [themeValue, setTheme] = useState(themeParam);
15+
let scaleParam = params.get("providerSwitcher-scale") || undefined;
16+
let [scaleValue, setScale] = useState(scaleParam);
17+
let expressParam = params.get("providerSwitcher-express") || undefined;
18+
let [expressValue, setExpress] = useState(expressParam === 'true');
2219
let [storyReady, setStoryReady] = useState(window.parent === window || window.parent !== window.top); // reduce content flash because it takes a moment to get the provider details
2320
// Typically themes are provided with both light + dark, and both scales.
2421
// To build our selector to see all themes, we need to hack it a bit.

0 commit comments

Comments
 (0)