-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(web): improve storybook (#952)
- Loading branch information
1 parent
59c0ff5
commit 69b054d
Showing
6 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { css } from "@emotion/react"; | ||
import { Meta, Story } from "@storybook/react"; | ||
|
||
import FloatedPanel, { Props } from "."; | ||
|
||
const meta: Meta<Props> = { | ||
component: FloatedPanel, | ||
}; | ||
|
||
export default meta; | ||
|
||
const Template: Story<Props> = args => <FloatedPanel {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
visible: true, | ||
children: "This is the content of the floated panel", | ||
}; | ||
|
||
export const Hidden = Template.bind({}); | ||
Hidden.args = { | ||
visible: false, | ||
children: "This is the content of the floated panel", | ||
}; | ||
|
||
export const CustomStyles = Template.bind({}); | ||
CustomStyles.args = { | ||
visible: true, | ||
children: "This is the content of the floated panel", | ||
styles: css` | ||
background-color: lightblue; | ||
color: white; | ||
padding: 10px; | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,36 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import InsertionBar from "."; | ||
import InsertionBar, { Props } from "."; | ||
|
||
export default { | ||
const meta: Meta<Props> = { | ||
component: InsertionBar, | ||
} as Meta; | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof InsertionBar>; | ||
|
||
export const Default: Story = {}; | ||
export const Default: Story = { | ||
args: { | ||
pos: "bottom", | ||
mode: "visible", | ||
onButtonClick: () => console.log("Button clicked"), | ||
children: "Insertion bar content", | ||
}, | ||
}; | ||
|
||
export const Hidden: Story = { | ||
args: { | ||
pos: "top", | ||
mode: "hidden", | ||
children: "Insertion bar content", | ||
}, | ||
}; | ||
|
||
export const Dragging: Story = { | ||
args: { | ||
pos: "bottom", | ||
mode: "dragging", | ||
children: "Insertion bar content", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
web/src/beta/features/Editor/SketchLayerManager/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import SketchLayerManager from "."; | ||
|
||
const meta: Meta<typeof SketchLayerManager> = { component: SketchLayerManager }; | ||
export default meta; | ||
type Story = StoryObj<typeof SketchLayerManager>; | ||
export const Default: Story = { args: {} }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters