Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 13, 2023
2 parents 691bc1c + 3aa3771 commit 4bf27b8
Show file tree
Hide file tree
Showing 22 changed files with 1,238 additions and 1,354 deletions.
49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,44 @@
"tailwindcss": "^3.3.6"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@storybook/addon-a11y": "^7.5.3",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-interactions": "^7.5.3",
"@storybook/addon-storysource": "^7.5.3",
"@storybook/addon-a11y": "^7.6.4",
"@storybook/addon-essentials": "^7.6.4",
"@storybook/addon-interactions": "^7.6.4",
"@storybook/addon-storysource": "^7.6.4",
"@storybook/addon-styling": "^1.3.7",
"@storybook/addons": "^7.5.3",
"@storybook/cli": "^7.5.3",
"@storybook/addons": "^7.6.4",
"@storybook/cli": "^7.6.4",
"@storybook/jest": "^0.2.3",
"@storybook/react": "^7.5.3",
"@storybook/react-webpack5": "^7.5.3",
"@storybook/react": "^7.6.4",
"@storybook/react-webpack5": "^7.6.4",
"@storybook/source-loader": "^7.6.4",
"@storybook/test-runner": "^0.16.0",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.5.3",
"@storybook/theming": "^7.6.4",
"@swc/core": "^1.3.100",
"@swc/jest": "^0.2.29",
"@testing-library/react": "^14.1.2",
"@types/jest": "^29.5.11",
"@types/lodash.merge": "^4.6.9",
"@types/lodash.range": "^3.2.9",
"@types/node": "^14.18.63",
"@types/react": "^18.2.42",
"@types/node": "^20.10.4",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@types/react-test-renderer": "^17.0.9",
"@types/react-transition-group": "^4.4.10",
"@types/styled-components": "^5.1.32",
"@types/styled-components": "^5.1.34",
"autoprefixer": "^10.4.16",
"axe-playwright": "^1.2.3",
"babel-loader": "^9.1.3",
"babel-plugin-polyfill-corejs2": "^0.4.6",
"babel-plugin-polyfill-regenerator": "^0.5.3",
"chromatic": "^10.0.0",
"babel-plugin-polyfill-corejs2": "^0.4.7",
"babel-plugin-polyfill-regenerator": "^0.5.4",
"chromatic": "^10.1.0",
"ecma-version-validator-webpack-plugin": "^1.2.1",
"eslint": "^8.55.0",
"eslint-config-smarthr": "^6.14.0",
Expand All @@ -71,29 +72,29 @@
"postcss": "^8.4.32",
"postcss-styled-syntax": "^0.5.0",
"postcss-syntax": "^0.36.2",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"prettier-config-smarthr": "^1.0.0",
"prettier-plugin-tailwindcss": "^0.5.9",
"puppeteer": "^21.5.2",
"puppeteer": "^21.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"smarthr-normalize-css": "^1.1.0",
"standard-version": "^9.3.2",
"storybook": "^7.5.3",
"storybook": "^7.6.4",
"storybook-addon-pseudo-states": "^2.1.2",
"styled-components": "^5.3.11",
"styled-reset": "^4.5.1",
"stylelint": "^15.11.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-smarthr": "^2.0.1",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard": "^35.0.0",
"stylelint-config-styled-components": "^0.1.1",
"testcafe": "3.4.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"ttypescript": "^1.5.15",
"typescript": "^5.3.2",
"typescript": "^5.3.3",
"typescript-plugin-styled-components": "^3.0.0",
"wait-on": "^7.2.0",
"webpack": "^5.89.0"
Expand Down Expand Up @@ -177,7 +178,7 @@
"typings": "lib/index.d.ts",
"resolutions": {
"@babel/helper-compilation-targets": "^7.22.15",
"@types/react": "^18.2.42",
"@types/react": "^18.2.45",
"minimist": "1.2.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
103 changes: 103 additions & 0 deletions src/components/BottomFixedArea/VRTBottomFixedArea.stories.tsx
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;
`
2 changes: 1 addition & 1 deletion src/components/Button/ButtonWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const button = tv({
'shr-bg-white',
'shr-text-black',
'focus-visible:shr-border-darken',
'focus-visible:bg-white-darken',
'focus-visible:shr-bg-white-darken',
'focus-visible:constrast-more:shr-border-high-contrast',
'hover:shr-border-darken',
'hover:shr-bg-white-darken',
Expand Down
17 changes: 17 additions & 0 deletions src/components/Chip/Chip.stories.tsx
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>
)
26 changes: 26 additions & 0 deletions src/components/Chip/Chip.tsx
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} />
}
1 change: 1 addition & 0 deletions src/components/Chip/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Chip } from './Chip'
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DropdownMenuButton } from './DropdownMenuButton'
const meta = {
title: 'Buttons(ボタン)/Dropdown',
component: DropdownMenuButton,
excludeStories: ['Render'],
} satisfies Meta<typeof DropdownMenuButton>
export default meta

Expand Down Expand Up @@ -64,30 +65,32 @@ const Template: React.FC<Omit<ComponentProps<typeof DropdownMenuButton>, 'childr
</DropdownMenuButton>
)

export const Render: React.FC = () => (
<Cluster align="center" justify="flex-end">
<Template label="その他の操作" />
<Template disabled label="その他の操作" />
<Template onlyIconTrigger label="その他の操作" />
<Template triggerSize="s" label="操作" />
<Template triggerSize="s" label={<span>操作</span>} disabled />
<Template triggerSize="s" onlyIconTrigger label="操作" />
<RemoteTriggerActionDialog
id="hoge"
title="Triggerのテスト"
actionText="保存"
onClickAction={(close) => {
close()
}}
>
Remote Trigger Action Dialog.
</RemoteTriggerActionDialog>
</Cluster>
)

export const DropdownMenuStory: Story = {
name: 'DropdownMenuButton',
args: {
label: '',
children: null,
},
render: () => (
<Cluster align="center" justify="flex-end">
<Template label="その他の操作" />
<Template disabled label="その他の操作" />
<Template onlyIconTrigger label="その他の操作" />
<Template triggerSize="s" label="操作" />
<Template triggerSize="s" label={<span>操作</span>} disabled />
<Template triggerSize="s" onlyIconTrigger label="操作" />
<RemoteTriggerActionDialog
id="hoge"
title="Triggerのテスト"
actionText="保存"
onClickAction={(close) => {
close()
}}
>
Remote Trigger Action Dialog.
</RemoteTriggerActionDialog>
</Cluster>
),
render: () => <Render />,
}
Loading

0 comments on commit 4bf27b8

Please sign in to comment.