-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Static CSS and Flex Component for Yorkie Homepage (#145)
* Add tokens and static css * Add Flex component * Add Docs for Button `asChild` Props
- Loading branch information
Showing
16 changed files
with
668 additions
and
418 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
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,36 @@ | ||
# Flex | ||
|
||
import { Controls, Canvas, Meta } from '@storybook/blocks'; | ||
import * as FlexStories from './Flex.stories'; | ||
|
||
<Meta of={FlexStories} /> | ||
|
||
- [Import](#import) | ||
- [Overview](#overview) | ||
- [Props](#props) | ||
|
||
## Import | ||
|
||
```jsx | ||
import { Flex } from 'yorkie-ui'; | ||
``` | ||
|
||
## Overview | ||
|
||
<Canvas | ||
of={FlexStories.Overview} | ||
source={{ | ||
format: true, | ||
code: ` | ||
<Flex> | ||
<Button>1</Button> | ||
<Button>2</Button> | ||
<Button>3</Button> | ||
<Button>4</Button> | ||
</Flex>`, | ||
}} | ||
/> | ||
|
||
## Props | ||
|
||
<Controls /> |
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,62 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Flex, Button } from '@yorkie-ui/core'; | ||
|
||
const propertyHorizontal = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']; | ||
const propertyVertical = ['flex-start', 'flex-end', 'center', 'baseline', 'stretch']; | ||
|
||
const meta = { | ||
title: 'LAYOUT / Flex', | ||
component: Flex, | ||
argTypes: { | ||
direction: { | ||
options: ['row', 'row-reverse', 'column', 'column-reverse'], | ||
control: { type: 'radio' }, | ||
description: 'The direction of the flex container.', | ||
}, | ||
justifyContent: { | ||
options: propertyHorizontal, | ||
mapping: propertyHorizontal, | ||
control: { | ||
type: 'radio', | ||
labels: propertyHorizontal, | ||
}, | ||
description: 'Used to align child elements along the main axis of the container.', | ||
}, | ||
alignItems: { | ||
options: propertyVertical, | ||
mapping: propertyVertical, | ||
control: { | ||
type: 'radio', | ||
labels: propertyVertical, | ||
}, | ||
description: 'Used to align child elements along the main axis of the container.', | ||
}, | ||
gap: { | ||
control: { type: 'number' }, | ||
description: 'Controlling the gutters between grid and flexbox items.', | ||
}, | ||
}, | ||
args: { | ||
direction: 'row', | ||
gap: '0', | ||
justifyContent: 'flex-start', | ||
alignItems: 'stretch', | ||
}, | ||
} satisfies Meta<typeof Flex>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Flex>; | ||
|
||
export const Overview: Story = { | ||
render: (args) => { | ||
return ( | ||
<Flex {...args}> | ||
<Button>1</Button> | ||
<Button>2</Button> | ||
<Button>3</Button> | ||
<Button>4</Button> | ||
</Flex> | ||
); | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
export const breakpoints = { | ||
sm: '640px', | ||
md: '768px', | ||
lg: '1024px', | ||
xl: '1280px', | ||
'2xl': '1536px', | ||
} | ||
md: '1024px', | ||
lg: '1280px', | ||
xl: '1920px', | ||
}; |
Oops, something went wrong.