Skip to content

Commit 8ed86d8

Browse files
authored
Storybook 7 (#6150)
* Storybook 7
1 parent d157bbd commit 8ed86d8

File tree

179 files changed

+3479
-4991
lines changed

Some content is hidden

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

179 files changed

+3479
-4991
lines changed

.chromatic-fc/.parcelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"resolvers": ["@parcel/resolver-glob", "parcel-resolver-storybook", "..."],
4+
"transformers": {
5+
"packages/*/*/intl/*.json": ["parcel-transformer-intl"],
6+
"*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [
7+
"@parcel/transformer-js",
8+
"@parcel/transformer-react-refresh-wrap"
9+
]
10+
}
11+
}

.chromatic-fc/custom-addons/chromatic/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expressThemes, locales, scales, themes} from '../../constants';
2-
import {makeDecorator} from '@storybook/addons';
2+
import {makeDecorator} from '@storybook/preview-api';
33
import {Provider, View} from '@adobe/react-spectrum';
44
import React, {useEffect} from 'react';
55
import './disableAnimations.css';

.chromatic-fc/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

22
module.exports = {
3-
core: {
4-
builder: "storybook-builder-parcel",
3+
framework: {
4+
name: "storybook-react-parcel",
5+
options: {},
56
},
6-
stories: ['../packages/**/chromatic/**/*.chromatic-fc.{js,jsx,ts,tsx}'],
7+
stories: ['../packages/**/chromatic-fc/**/*.stories.{js,jsx,ts,tsx}'],
78
addons: process.env.NODE_ENV === 'production' ? [] : [
89
'@storybook/addon-actions',
910
'@storybook/addon-a11y'

.chromatic-fc/manager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import addons from '@storybook/addons';
1+
import {addons} from '@storybook/manager-api';
22

33
addons.setConfig({
4-
showRoots: false,
5-
enableShortcuts: false
4+
enableShortcuts: false,
5+
sidebar: {
6+
showRoots: false,
7+
}
68
});

.chromatic-fc/preview.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ configureActions({
1212

1313
export const parameters = {
1414
options: {
15-
storySort: (a, b) =>
16-
a[1].kind === b[1].kind
15+
storySort: (a, b) => {
16+
return a.title === b.title
1717
? 0
18-
: a[1].id.localeCompare(b[1].id, undefined, {numeric: true})
18+
: a.id.localeCompare(b.id, undefined, { numeric: true });
19+
}
1920
},
2021
a11y: {},
2122
layout: 'fullscreen',

.chromatic/.parcelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"resolvers": ["@parcel/resolver-glob", "parcel-resolver-storybook", "..."],
4+
"transformers": {
5+
"packages/*/*/intl/*.json": ["parcel-transformer-intl"],
6+
"*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [
7+
"@parcel/transformer-js",
8+
"@parcel/transformer-react-refresh-wrap"
9+
]
10+
}
11+
}

.chromatic/custom-addons/chromatic/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expressThemes, locales, scales, themes} from '../../constants';
2-
import {makeDecorator} from '@storybook/addons';
2+
import {makeDecorator} from '@storybook/preview-api';
33
import {Provider, View} from '@adobe/react-spectrum';
44
import React, {useEffect} from 'react';
55
import './disableAnimations.css';

.chromatic/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

22
module.exports = {
3-
core: {
4-
builder: "storybook-builder-parcel",
3+
framework: {
4+
name: "storybook-react-parcel",
5+
options: {},
56
},
6-
stories: ['../packages/**/chromatic/**/*.chromatic.{js,jsx,ts,tsx}'],
7+
stories: ['../packages/**/chromatic/**/*.stories.@(js|jsx|ts|tsx)'],
78
addons: process.env.NODE_ENV === 'production' ? [] : [
89
'@storybook/addon-actions',
910
'@storybook/addon-a11y'

.chromatic/manager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import addons from '@storybook/addons';
1+
import {addons} from '@storybook/manager-api';
22

33
addons.setConfig({
4-
showRoots: false,
5-
enableShortcuts: false
4+
enableShortcuts: false,
5+
sidebar: {
6+
showRoots: false,
7+
}
68
});

.chromatic/preview.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ configureActions({
1212

1313
export const parameters = {
1414
options: {
15-
storySort: (a, b) => a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }),
15+
storySort: (a, b) => {
16+
return a.title === b.title
17+
? 0
18+
: a.id.localeCompare(b.id, undefined, { numeric: true });
19+
}
1620
},
1721
a11y: {},
1822
layout: 'fullscreen'

0 commit comments

Comments
 (0)