Skip to content

Commit d1bee3e

Browse files
committed
fix sb docs
1 parent c4c2fb9 commit d1bee3e

File tree

8 files changed

+112
-572
lines changed

8 files changed

+112
-572
lines changed

.yarn/patches/@storybook-addon-docs-npm-8.6.14-12ab3f55f8.patch

Lines changed: 2 additions & 560 deletions
Large diffs are not rendered by default.

.yarn/patches/@storybook-react-npm-8.6.14-bc3fc2208a.patch

Lines changed: 45 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
"@types/node@npm:^18.0.0": "^22",
239239
"@types/node@npm:>= 8": "^22",
240240
"@storybook/addon-docs@npm:8.6.14": "patch:@storybook/addon-docs@npm%3A8.6.14#~/.yarn/patches/@storybook-addon-docs-npm-8.6.14-12ab3f55f8.patch",
241+
"@storybook/react": "patch:@storybook/react@npm%3A8.6.14#~/.yarn/patches/@storybook-react-npm-8.6.14-bc3fc2208a.patch",
241242
"micromark-extension-mdxjs": "patch:micromark-extension-mdxjs@npm%3A1.0.0#~/.yarn/patches/micromark-extension-mdxjs-npm-1.0.0-d2b6b69e4a.patch",
242243
"remark-mdx": "patch:remark-mdx@npm%3A2.0.0-rc.2#~/.yarn/patches/remark-mdx-npm-2.0.0-rc.2-7a71234e1f.patch",
243244
"remark-parse": "patch:remark-parse@npm%3A10.0.1#~/.yarn/patches/remark-parse-npm-10.0.1-e654d7df78.patch"

packages/@react-spectrum/s2/src/Icon.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,14 @@ export function createIcon(Component: ComponentType<SVGProps<SVGSVGElement>>, co
8989
let ctx;
9090
// TODO: remove this default once we release RAC and use DEFAULT_SLOT.
9191
[ctx, ref] = useSpectrumContextProps({slot: props.slot || 'icon'} as IconContextValue, ref, context);
92-
let {styles: ctxStyles} = ctx;
92+
let {render, styles: ctxStyles} = ctx;
9393
let {
9494
UNSAFE_className,
9595
UNSAFE_style,
9696
slot,
9797
'aria-label': ariaLabel,
9898
'aria-hidden': ariaHidden,
9999
styles,
100-
// props are already merged with context via rac's useContextProps in generateS2IconIndex
101-
// @ts-ignore
102-
render,
103100
...otherProps
104101
} = props;
105102

@@ -145,7 +142,7 @@ export function createIllustration(Component: ComponentType<SVGProps<SVGSVGEleme
145142
let ref = useRef<SVGElement>(null);
146143
let ctx;
147144
[ctx, ref] = useSpectrumContextProps({slot: props.slot || 'icon'} as IconContextValue, ref, IllustrationContext);
148-
let {render, styles: ctxStyles} = ctx;
145+
let {styles: ctxStyles} = ctx;
149146
let {
150147
UNSAFE_className,
151148
UNSAFE_style,
@@ -154,6 +151,8 @@ export function createIllustration(Component: ComponentType<SVGProps<SVGSVGEleme
154151
'aria-hidden': ariaHidden,
155152
size = ctx.size || 'M',
156153
styles,
154+
// @ts-ignore
155+
render,
157156
...otherProps
158157
} = props;
159158

packages/@react-spectrum/s2/stories/CardView.stories.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,26 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
import {ActionMenu, Avatar, Card, CardPreview, CardView, CardViewProps, Collection, CollectionCardPreview, Content, Heading, IllustratedMessage, Image, MenuItem, SkeletonCollection, Text} from '../src';
13+
import {
14+
ActionMenu,
15+
Avatar,
16+
Card,
17+
CardPreview,
18+
CardView,
19+
CardViewProps,
20+
Collection,
21+
CollectionCardPreview,
22+
Content,
23+
Heading,
24+
IllustratedMessage,
25+
Image,
26+
MenuItem,
27+
SkeletonCollection,
28+
Text
29+
} from '../src';
1430
import EmptyIcon from '../spectrum-illustrations/gradient/generic1/Image';
1531
import ErrorIcon from '../spectrum-illustrations/linear/AlertNotice';
32+
import {fn} from '@storybook/test';
1633
import Folder from '../s2wf-icons/S2_Icon_Folder_20_N.svg';
1734
import type {Meta} from '@storybook/react';
1835
import {style} from '../style/spectrum-theme' with {type: 'macro'};
@@ -23,7 +40,10 @@ const meta: Meta<typeof CardView> = {
2340
parameters: {
2441
layout: 'fullscreen'
2542
},
26-
tags: ['autodocs']
43+
tags: ['autodocs'],
44+
args: {
45+
onLoadMore: fn()
46+
}
2747
};
2848

2949
export default meta;

packages/@react-spectrum/s2/stories/SegmentedControl.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import AlignBottom from '../s2wf-icons/S2_Icon_AlignBottom_20_N.svg';
1414
import AlignCenter from '../s2wf-icons/S2_Icon_AlignCenter_20_N.svg';
1515
import AlignLeft from '../s2wf-icons/S2_Icon_AlignLeft_20_N.svg';
16+
import {fn} from '@storybook/test';
1617
import ListBulleted from '../s2wf-icons/S2_Icon_ListBulleted_20_N.svg';
1718
import ListMultiSelect from '../s2wf-icons/S2_Icon_ListMultiSelect_20_N.svg';
1819
import ListNumbered from '../s2wf-icons/S2_Icon_ListNumbered_20_N.svg';
@@ -27,7 +28,10 @@ const meta: Meta<typeof SegmentedControl> = {
2728
layout: 'centered'
2829
},
2930
tags: ['autodocs'],
30-
title: 'SegmentedControl'
31+
title: 'SegmentedControl',
32+
args: {
33+
onSelectionChange: fn()
34+
}
3135
};
3236

3337
export default meta;

packages/@react-spectrum/s2/stories/Tabs.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import Bell from '../s2wf-icons/S2_Icon_Bell_20_N.svg';
1414
import {Collection, Text} from '@react-spectrum/s2';
1515
import Edit from '../s2wf-icons/S2_Icon_Edit_20_N.svg';
16+
import {fn} from '@storybook/test';
1617
import Heart from '../s2wf-icons/S2_Icon_Heart_20_N.svg';
1718
import type {Meta} from '@storybook/react';
1819
import {style} from '../style' with { type: 'macro' };
@@ -24,7 +25,10 @@ const meta: Meta<typeof Tabs> = {
2425
layout: 'centered'
2526
},
2627
tags: ['autodocs'],
27-
title: 'Tabs'
28+
title: 'Tabs',
29+
args: {
30+
onSelectionChange: fn()
31+
}
2832
};
2933

3034
export default meta;

yarn.lock

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9422,7 +9422,7 @@ __metadata:
94229422

94239423
"@storybook/addon-docs@patch:@storybook/addon-docs@npm%3A8.6.14#~/.yarn/patches/@storybook-addon-docs-npm-8.6.14-12ab3f55f8.patch":
94249424
version: 8.6.14
9425-
resolution: "@storybook/addon-docs@patch:@storybook/addon-docs@npm%3A8.6.14#~/.yarn/patches/@storybook-addon-docs-npm-8.6.14-12ab3f55f8.patch::version=8.6.14&hash=c42830"
9425+
resolution: "@storybook/addon-docs@patch:@storybook/addon-docs@npm%3A8.6.14#~/.yarn/patches/@storybook-addon-docs-npm-8.6.14-12ab3f55f8.patch::version=8.6.14&hash=e4d464"
94269426
dependencies:
94279427
"@mdx-js/react": "npm:^3.0.0"
94289428
"@storybook/blocks": "npm:8.6.14"
@@ -9433,7 +9433,7 @@ __metadata:
94339433
ts-dedent: "npm:^2.0.0"
94349434
peerDependencies:
94359435
storybook: ^8.6.14
9436-
checksum: 10c0/995af4c056ad37bf9f6cd75106d7789da3f452b1b87cf08e4bfab4d1e331611d238e2f355e67f451fff5016b11712ea8edde1f7edc3fa27ff793a52f6c46cd86
9436+
checksum: 10c0/ee2fc317d21b09e24e435d60a10b0f5b2cf36205d6a85395029ff5dd1108821da6ef961bee4ee8b0030f2ebc93b53c17aa2c0b975d920594dda47a0e960b4262
94379437
languageName: node
94389438
linkType: hard
94399439

@@ -9791,7 +9791,7 @@ __metadata:
97919791
languageName: node
97929792
linkType: hard
97939793

9794-
"@storybook/react@npm:^8.6.14":
9794+
"@storybook/react@npm:8.6.14":
97959795
version: 8.6.14
97969796
resolution: "@storybook/react@npm:8.6.14"
97979797
dependencies:
@@ -9816,6 +9816,31 @@ __metadata:
98169816
languageName: node
98179817
linkType: hard
98189818

9819+
"@storybook/react@patch:@storybook/react@npm%3A8.6.14#~/.yarn/patches/@storybook-react-npm-8.6.14-bc3fc2208a.patch":
9820+
version: 8.6.14
9821+
resolution: "@storybook/react@patch:@storybook/react@npm%3A8.6.14#~/.yarn/patches/@storybook-react-npm-8.6.14-bc3fc2208a.patch::version=8.6.14&hash=9c6605"
9822+
dependencies:
9823+
"@storybook/components": "npm:8.6.14"
9824+
"@storybook/global": "npm:^5.0.0"
9825+
"@storybook/manager-api": "npm:8.6.14"
9826+
"@storybook/preview-api": "npm:8.6.14"
9827+
"@storybook/react-dom-shim": "npm:8.6.14"
9828+
"@storybook/theming": "npm:8.6.14"
9829+
peerDependencies:
9830+
"@storybook/test": 8.6.14
9831+
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
9832+
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
9833+
storybook: ^8.6.14
9834+
typescript: ">= 4.2.x"
9835+
peerDependenciesMeta:
9836+
"@storybook/test":
9837+
optional: true
9838+
typescript:
9839+
optional: true
9840+
checksum: 10c0/118e70e34eee96820995766e64a83346ce63cd8dfa9a87ca5f0603b3f52f1d6a80e3eded534afb8b3778927c8070e584aefcb756cb9fb7efc247f37a3da07141
9841+
languageName: node
9842+
linkType: hard
9843+
98199844
"@storybook/test-runner@npm:^0.22.0":
98209845
version: 0.22.0
98219846
resolution: "@storybook/test-runner@npm:0.22.0"

0 commit comments

Comments
 (0)