-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
145 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import { View } from "react-native"; | ||
import { HStack, LabelSmall } from "../../../src/components"; | ||
import { IOColors } from "../../../src/core"; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
const meta = { | ||
title: "Foundation/Layout/HStack", | ||
decorators: [ | ||
Story => ( | ||
<View | ||
style={{ | ||
backgroundColor: IOColors["grey-100"] | ||
}} | ||
> | ||
<Story /> | ||
</View> | ||
) | ||
], | ||
component: HStack, | ||
parameters: { | ||
// Optional parameter to center the component in the CanHas. More info: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: "centered" | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs | ||
tags: ["autodocs"] | ||
} satisfies Meta<typeof HStack>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Base: Story = { | ||
args: { | ||
space: 16, | ||
children: ( | ||
<React.Fragment> | ||
{[...Array(3)].map((_el, i) => ( | ||
<View | ||
key={`block-${i}`} | ||
style={{ | ||
height: 100, | ||
width: 32, | ||
alignItems: "center", | ||
justifyContent: "center", | ||
backgroundColor: IOColors["grey-700"] | ||
}} | ||
> | ||
<LabelSmall weight="Regular" color={"grey-200"}>{`${ | ||
i + 1 | ||
}`}</LabelSmall> | ||
</View> | ||
))} | ||
<View | ||
style={{ | ||
height: 100, | ||
flexGrow: 1, | ||
alignItems: "center", | ||
justifyContent: "center", | ||
paddingHorizontal: 16, | ||
backgroundColor: IOColors["grey-700"] | ||
}} | ||
> | ||
<LabelSmall weight="Regular" color={"grey-200"}> | ||
Growing width | ||
</LabelSmall> | ||
</View> | ||
</React.Fragment> | ||
) | ||
} | ||
}; |
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,72 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import { View } from "react-native"; | ||
import { LabelSmall, VStack } from "../../../src/components"; | ||
import { IOColors } from "../../../src/core"; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
const meta = { | ||
title: "Foundation/Layout/VStack", | ||
decorators: [ | ||
Story => ( | ||
<View | ||
style={{ | ||
backgroundColor: IOColors["grey-100"] | ||
}} | ||
> | ||
<Story /> | ||
</View> | ||
) | ||
], | ||
component: VStack, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: "centered" | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs | ||
tags: ["autodocs"] | ||
} satisfies Meta<typeof VStack>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Base: Story = { | ||
args: { | ||
space: 16, | ||
children: ( | ||
<React.Fragment> | ||
{[...Array(3)].map((_el, i) => ( | ||
<View | ||
key={`block-${i}`} | ||
style={{ | ||
height: 32, | ||
width: 320, | ||
alignItems: "center", | ||
justifyContent: "center", | ||
backgroundColor: IOColors["grey-700"] | ||
}} | ||
> | ||
<LabelSmall weight="Regular" color={"grey-200"}>{`Block n.${ | ||
i + 1 | ||
}`}</LabelSmall> | ||
</View> | ||
))} | ||
<View | ||
style={{ | ||
height: 96, | ||
width: 320, | ||
alignItems: "center", | ||
justifyContent: "center", | ||
backgroundColor: IOColors["grey-700"] | ||
}} | ||
> | ||
<LabelSmall weight="Regular" color={"grey-200"}> | ||
Different height | ||
</LabelSmall> | ||
</View> | ||
</React.Fragment> | ||
) | ||
} | ||
}; |