Skip to content

Commit ba4aaa8

Browse files
committed
Storybook warning fixes
1 parent ec1e91a commit ba4aaa8

30 files changed

+89
-89
lines changed

src/components/stories/00-docs/00-Intro.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { CommonHeader } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/01-GettingStarted.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { CommonHeader, DemoUI } from "../Utils";
33
import { CenterType, ViewPort, Fixed, Top, Right, LeftResizable, BottomResizable, Fill, Options } from "../../..";
44

src/components/stories/00-docs/02-CommonProperties.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { CommonHeader, PropsTable, StandardProps } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/03-UsefulEvents.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { CommonHeader } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/05-CustomHandles.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas } from "@storybook/addon-docs";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { action } from '@storybook/addon-actions';
44
import { ViewPort, Fill } from "../../";

src/components/stories/01-examples/00-Anchored.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";

src/components/stories/01-examples/01-Nested.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";

src/components/stories/01-examples/02-Stacked.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, LeftResizable, RightResizable, Left, Right, TopResizable, BottomResizable, Top, Bottom, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
2-
import { withKnobs } from "@storybook/addon-knobs";
3-
import { ViewPort, LeftResizable, Fill } from "../../";
4-
import { action } from '@storybook/addon-actions';
5-
import { green, red, description } from "../Utils";
6-
import { CommonHeader } from "../Utils";
7-
8-
<CommonHeader />
9-
10-
<Meta title="Basic examples/Resize events" />
11-
12-
## Resizable space with state controlled size
13-
14-
By default the size of a resizable space is uncontrolled. Therefore the initial size passed is is
15-
only the initial size of a space and React Spaces deals with any resizing. To keep the size of a
16-
space controlled in state you need to use the onResizeEnd event to set the new size of a space
17-
after a resize back to a state value.
18-
19-
<Canvas>
20-
<Story name="Controlled size">
21-
{
22-
() => {
23-
const [ size, setSize ] = React.useState("15%");
24-
return (
25-
<React.StrictMode>
26-
<ViewPort>
27-
<LeftResizable size={size} style={red} trackSize={true} onResizeEnd={(newSize) => setSize(newSize)}>
28-
{description("Left")}
29-
</LeftResizable>
30-
<Fill style={green} trackSize={true}>{description("Fill")}</Fill>
31-
</ViewPort>
32-
</React.StrictMode>
33-
)
34-
}
35-
}
36-
</Story>
37-
</Canvas>
38-
39-
## Cancelling resize with onResizeStart
40-
41-
You can cancel a resize by returning `false` from a onResizeStart event handler.
42-
43-
<Canvas>
44-
<Story name="Cancelled resize">
45-
{
46-
() => {
47-
return (
48-
<React.StrictMode>
49-
<ViewPort>
50-
<LeftResizable size="15%" style={red} trackSize={true} onResizeStart={() => false}>
51-
{description("Left")}
52-
</LeftResizable>
53-
<Fill style={green} trackSize={true}>{description("Fill")}</Fill>
54-
</ViewPort>
55-
</React.StrictMode>
56-
)
57-
}
58-
}
59-
</Story>
60-
</Canvas>
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs";
2+
import { withKnobs } from "@storybook/addon-knobs";
3+
import { ViewPort, LeftResizable, Fill } from "../../";
4+
import { action } from '@storybook/addon-actions';
5+
import { green, red, description } from "../Utils";
6+
import { CommonHeader } from "../Utils";
7+
8+
<CommonHeader />
9+
10+
<Meta title="Basic examples/Resize events" />
11+
12+
## Resizable space with state controlled size
13+
14+
By default the size of a resizable space is uncontrolled. Therefore the initial size passed is is
15+
only the initial size of a space and React Spaces deals with any resizing. To keep the size of a
16+
space controlled in state you need to use the onResizeEnd event to set the new size of a space
17+
after a resize back to a state value.
18+
19+
<Canvas>
20+
<Story name="Controlled size">
21+
{
22+
() => {
23+
const [ size, setSize ] = React.useState("15%");
24+
return (
25+
<React.StrictMode>
26+
<ViewPort>
27+
<LeftResizable size={size} style={red} trackSize={true} onResizeEnd={(newSize) => setSize(newSize)}>
28+
{description("Left")}
29+
</LeftResizable>
30+
<Fill style={green} trackSize={true}>{description("Fill")}</Fill>
31+
</ViewPort>
32+
</React.StrictMode>
33+
)
34+
}
35+
}
36+
</Story>
37+
</Canvas>
38+
39+
## Cancelling resize with onResizeStart
40+
41+
You can cancel a resize by returning `false` from a onResizeStart event handler.
42+
43+
<Canvas>
44+
<Story name="Cancelled resize">
45+
{
46+
() => {
47+
return (
48+
<React.StrictMode>
49+
<ViewPort>
50+
<LeftResizable size="15%" style={red} trackSize={true} onResizeStart={() => false}>
51+
{description("Left")}
52+
</LeftResizable>
53+
<Fill style={green} trackSize={true}>{description("Fill")}</Fill>
54+
</ViewPort>
55+
</React.StrictMode>
56+
)
57+
}
58+
}
59+
</Story>
60+
</Canvas>

src/components/stories/01-examples/05-CustomHandles.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Canvas } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas } from "@storybook/addon-docs";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { action } from '@storybook/addon-actions';
44
import { ViewPort, Fill, BottomResizable } from "../../";

0 commit comments

Comments
 (0)