-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/master' into HEAD
- Loading branch information
Showing
22 changed files
with
1,238 additions
and
1,354 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
103 changes: 103 additions & 0 deletions
103
src/components/BottomFixedArea/VRTBottomFixedArea.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,103 @@ | ||
import { StoryFn } from '@storybook/react' | ||
import { within } from '@storybook/testing-library' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { InformationPanel } from '../InformationPanel' | ||
|
||
import { BottomFixedArea } from './BottomFixedArea' | ||
import { _BottomFixedArea as All } from './BottomFixedArea.stories' | ||
|
||
export default { | ||
title: 'Navigation(ナビゲーション)/BottomFixedArea', | ||
component: BottomFixedArea, | ||
parameters: { | ||
withTheming: true, | ||
layout: 'fullscreen', | ||
docs: { | ||
story: { | ||
inline: false, | ||
iframeHeight: '500px', | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export const VRTHover: StoryFn = () => ( | ||
<> | ||
<VRTInformationPanel title="VRT 用の Story です" togglable={false}> | ||
通常のボタン、アンカー風のボタンすべてがhoverされた状態で表示されます | ||
</VRTInformationPanel> | ||
<All /> | ||
</> | ||
) | ||
VRTHover.parameters = { | ||
controls: { hideNoControlsWarning: true }, | ||
pseudo: { | ||
hover: ['button'], | ||
}, | ||
} | ||
|
||
export const VRTFocusVisibleButton: StoryFn = () => ( | ||
<> | ||
<VRTInformationPanel title="VRT 用の Story です" togglable={false}> | ||
通常のボタンがfocusされた状態で表示されます | ||
</VRTInformationPanel> | ||
<All /> | ||
</> | ||
) | ||
VRTFocusVisibleButton.parameters = { | ||
controls: { hideNoControlsWarning: true }, | ||
pseudo: { | ||
focusVisible: ['button'], | ||
}, | ||
} | ||
|
||
export const VRTFocusVisibleAnchor: StoryFn = () => ( | ||
<> | ||
<VRTInformationPanel title="VRT 用の Story です" togglable={false}> | ||
アンカー風のボタンの1つ目がfocusされた状態で表示されます | ||
</VRTInformationPanel> | ||
<All /> | ||
</> | ||
) | ||
VRTFocusVisibleAnchor.play = async ({ canvasElement }) => { | ||
const canvas = within(canvasElement) | ||
const button = await canvas.findByRole('button', { name: 'Tertiary_1' }) | ||
await button.focus() | ||
} | ||
|
||
export const VRTNarrow: StoryFn = () => ( | ||
<> | ||
<VRTInformationPanel title="VRT 用の Story です" togglable={false}> | ||
画面幅が狭い状態で表示されます | ||
</VRTInformationPanel> | ||
<All /> | ||
</> | ||
) | ||
VRTNarrow.parameters = { | ||
viewport: { | ||
defaultViewport: 'vrtMobile', | ||
}, | ||
chromatic: { | ||
modes: { | ||
vrtMobile: { viewport: 'vrtMobile' }, | ||
}, | ||
}, | ||
} | ||
|
||
export const VRTForcedColors: StoryFn = () => ( | ||
<> | ||
<VRTInformationPanel title="VRT 用の Story です" togglable={false}> | ||
Chromatic 上では強制カラーモードで表示されます | ||
</VRTInformationPanel> | ||
<All /> | ||
</> | ||
) | ||
VRTForcedColors.parameters = { | ||
chromatic: { forcedColors: 'active' }, | ||
} | ||
|
||
const VRTInformationPanel = styled(InformationPanel)` | ||
margin: 1rem 1rem 24px; | ||
` |
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,17 @@ | ||
import { StoryFn } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { Cluster } from '../Layout' | ||
|
||
import { Chip } from '.' | ||
|
||
export default { | ||
title: 'Data Display(データ表示)/Chip', | ||
component: Chip, | ||
} | ||
|
||
export const All: StoryFn = () => ( | ||
<Cluster> | ||
<Chip>ラベル</Chip> | ||
</Cluster> | ||
) |
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 React, { ComponentPropsWithoutRef, FC, PropsWithChildren, useMemo } from 'react' | ||
import { VariantProps, tv } from 'tailwind-variants' | ||
|
||
type Props = PropsWithChildren<VariantProps<typeof chip> & ComponentPropsWithoutRef<'span'>> | ||
|
||
const chip = tv({ | ||
base: [ | ||
'smarthr-ui-Chip', | ||
'shr-rounded-full', | ||
'shr-border', | ||
'shr-border-solid', | ||
'shr-border-default', | ||
'shr-leading-none', | ||
'contrast-more:shr-border-high-contrast', | ||
], | ||
variants: { | ||
size: { | ||
s: ['shr-text-sm', 'shr-px-0.5', 'shr-py-0.25'], | ||
}, | ||
}, | ||
}) | ||
|
||
export const Chip: FC<Props> = ({ className, size = 's', ...props }) => { | ||
const styles = useMemo(() => chip({ size, className }), [size, className]) | ||
return <span {...props} className={styles} /> | ||
} |
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 @@ | ||
export { Chip } from './Chip' |
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
Oops, something went wrong.