-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from 8845musign/feat/DSGNPB-200-migration-of-e…
…xamples Porting examples from Storybook
- Loading branch information
Showing
104 changed files
with
1,764 additions
and
62 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,12 @@ | ||
import { Accordion } from '@ubie/ubie-ui'; | ||
import type { FC } from 'react'; | ||
|
||
const Small: FC = () => { | ||
return ( | ||
<Accordion header="夏目漱石「私の個人主義」" size="small"> | ||
何は時分どうもどんな観念顔というののところを云ったいまし。とうてい今日に説明院は現にこういう反対たますくらいから思わて来るないにも撲殺なるたたて、始終にも願うただですん。 | ||
</Accordion> | ||
); | ||
}; | ||
|
||
export default Small; |
33 changes: 33 additions & 0 deletions
33
src/components/react/examples/action-half-modal/Customized.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,33 @@ | ||
import { ActionHalfModal } from '@ubie/ubie-ui'; | ||
import { useCallback, useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const Customized: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const onClose = useCallback(() => { | ||
setOpen(false); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionHalfModal | ||
header="削除します" | ||
primaryActionColor="alert" | ||
primaryActionLabel="削除" | ||
onPrimaryAction={onClose} | ||
overlayOpacity="darker" | ||
closeLabel="キャンセル" | ||
open={open} | ||
onClose={onClose} | ||
> | ||
body | ||
</ActionHalfModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Customized; |
24 changes: 24 additions & 0 deletions
24
src/components/react/examples/action-half-modal/Fullscreen.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,24 @@ | ||
import { ActionHalfModal } from '@ubie/ubie-ui'; | ||
import { useCallback, useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const Fullscreen: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const onClose = useCallback(() => { | ||
setOpen(false); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionHalfModal header="モーダル" open={open} onClose={onClose} fullscreen> | ||
body | ||
</ActionHalfModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Fullscreen; |
31 changes: 31 additions & 0 deletions
31
src/components/react/examples/action-half-modal/NoCloseButton.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,31 @@ | ||
import { ActionHalfModal } from '@ubie/ubie-ui'; | ||
import { useCallback, useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const NoCloseButton: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const onClose = useCallback(() => { | ||
setOpen(false); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionHalfModal | ||
onPrimaryAction={onClose} | ||
primaryActionLabel="確認" | ||
showClose={false} | ||
header="モーダル" | ||
open={open} | ||
onClose={onClose} | ||
> | ||
body | ||
</ActionHalfModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default NoCloseButton; |
32 changes: 32 additions & 0 deletions
32
src/components/react/examples/action-half-modal/Secondary.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,32 @@ | ||
import { ActionHalfModal } from '@ubie/ubie-ui'; | ||
import { useCallback, useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const Secondary: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const onClose = useCallback(() => { | ||
setOpen(false); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionHalfModal | ||
primaryActionLabel="アクション1" | ||
onPrimaryAction={onClose} | ||
secondaryActionLabel="アクション2" | ||
onSecondaryAction={onClose} | ||
header="モーダル" | ||
open={open} | ||
onClose={onClose} | ||
> | ||
body | ||
</ActionHalfModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Secondary; |
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,29 @@ | ||
import { ActionModal } from '@ubie/ubie-ui'; | ||
import { useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const Secondary: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionModal | ||
header="削除します" | ||
closeLabel="キャンセル" | ||
overlayOpacity="darker" | ||
primaryActionLabel="削除" | ||
primaryActionColor="alert" | ||
open={open} | ||
onPrimaryAction={() => setOpen(false)} | ||
onClose={() => setOpen(false)} | ||
> | ||
Default | ||
</ActionModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Secondary; |
26 changes: 26 additions & 0 deletions
26
src/components/react/examples/action-modal/FixedHeight.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,26 @@ | ||
import { ActionModal } from '@ubie/ubie-ui'; | ||
import { useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const FixedHeight: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionModal | ||
primaryActionLabel="回答を見る" | ||
open={open} | ||
fixedHeight | ||
onPrimaryAction={() => setOpen(false)} | ||
onClose={() => setOpen(false)} | ||
> | ||
<p>Default</p> | ||
</ActionModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default FixedHeight; |
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,28 @@ | ||
import { ActionModal } from '@ubie/ubie-ui'; | ||
import { useState } from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
const Secondary: FC = () => { | ||
const [open, setOpen] = useState(true); | ||
|
||
return ( | ||
<> | ||
<button type="button" onClick={() => setOpen(true)}> | ||
Open Modal | ||
</button> | ||
<ActionModal | ||
header="モーダル" | ||
primaryActionLabel="回答を見る" | ||
open={open} | ||
onPrimaryAction={() => setOpen(false)} | ||
secondaryActionLabel={'このまま回答を続ける'} | ||
onSecondaryAction={() => setOpen(false)} | ||
onClose={() => setOpen(false)} | ||
> | ||
Default | ||
</ActionModal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Secondary; |
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,26 @@ | ||
import { Button } from '@ubie/ubie-ui'; | ||
import type { FC } from 'react'; | ||
|
||
const Block: FC = () => { | ||
return ( | ||
<div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}> | ||
<div> | ||
<Button block size="small" variant="secondary"> | ||
ボタン | ||
</Button> | ||
</div> | ||
<div> | ||
<Button block size="medium" variant="secondary"> | ||
ボタン | ||
</Button> | ||
</div> | ||
<div> | ||
<Button block size="large" variant="secondary"> | ||
ボタン | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Block; |
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,27 @@ | ||
import { Button } from '@ubie/ubie-ui'; | ||
import type { FC } from 'react'; | ||
|
||
const Disabled: FC = () => { | ||
return ( | ||
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'flex-start', gap: '32px', flexWrap: 'wrap' }}> | ||
<Button disabled>ボタン</Button> | ||
<Button variant="secondary" disabled> | ||
ボタン | ||
</Button> | ||
<Button variant="accent" disabled> | ||
ボタン | ||
</Button> | ||
<Button variant="alert" disabled> | ||
ボタン | ||
</Button> | ||
<Button variant="text" disabled> | ||
ボタン | ||
</Button> | ||
<Button variant="textAlert" disabled> | ||
ボタン | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Disabled; |
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,16 @@ | ||
import { Button } from '@ubie/ubie-ui'; | ||
import type { FC } from 'react'; | ||
|
||
const Default: FC = () => { | ||
return ( | ||
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'flex-start', gap: '32px' }}> | ||
<Button size="small">Small</Button> | ||
|
||
<Button size="medium">Medium</Button> | ||
|
||
<Button>Large</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Default; |
Oops, something went wrong.