Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WakuWakuButton を追加 #5018

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/smarthr-ui/src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import styled from 'styled-components'

import { Base } from '../Base'
import { Button } from '../Button'
import { FaPencilIcon } from '../Icon'
import { Cluster } from '../Layout'
import { Text } from '../Text'

import { TdCheckbox } from './TdCheckbox'
import { ThCheckbox } from './ThCheckbox'
import { WakuWakuButton } from './WakuWakuButton'

import { BulkActionRow, EmptyTableBody, Table, TableReel, Td, Th } from '.'

Expand Down Expand Up @@ -277,7 +279,15 @@ export const All: StoryFn = () => (
<Th>Protein (g)</Th>
<Th>Button</Th>
</tr>
<BulkActionRow>Bulk action area</BulkActionRow>
<BulkActionRow>
<Cluster align="center">
<p>50件のオブジェクトが選択されています。</p>
<WakuWakuButton>一覧のオブジェクト9,999件をすべて選択</WakuWakuButton>
<Button size="s" prefix={<FaPencilIcon />}>
一括操作
</Button>
</Cluster>
</BulkActionRow>
</thead>
<tbody>
{data.map(({ name, calories, fat, carbs, protein }, i) => (
Expand Down
9 changes: 9 additions & 0 deletions packages/smarthr-ui/src/components/Table/WakuWakuButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

import { Button } from '../Button'

type Props = Omit<React.ComponentProps<typeof Button>, 'variant' | 'size'>

export const WakuWakuButton: React.FC<Props> = (props) => (
<Button {...props} variant="text" size="s" className="shr-text-link-darken" />
)
1 change: 1 addition & 0 deletions packages/smarthr-ui/src/components/Table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export { TdCheckbox } from './TdCheckbox'
export { BulkActionRow } from './BulkActionRow'
export { EmptyTableBody } from './EmptyTableBody'
export { TableReel } from './TableReel'
export { WakuWakuButton } from './WakuWakuButton'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一応単体で利用できるコンポーネントということになるので、RSC対応チェックの方に追加してもらえると助かります!(ベースが Button なので多分クライアントコンポーネント)

/**
* サーバーコンポーネントでは利用できないコンポーネント一覧(アルファベット順)
*/
const CLIENT_COMPONENTS = [
'AccordionPanel',
'AccordionPanelContent',
'AccordionPanelItem',
'AccordionPanelTrigger',
'ActionDialog',
'ActionDialogContent',
'ActionDialogWithTrigger',
'AppLauncher',
'AppNavi',
'AppNaviDropdown',
'AppNaviDropdownMenuButton',
'Article',
'Aside',
'Base',
'BaseColumn',
'BottomFixedArea',
'BulkActionRow',
'Button',
'Calendar',
'Center',
'CheckBox',
'Cluster',
'CompactInformationPanel',
'CurrencyInput',
'DatePicker',
'DefinitionList',
'Dialog',
'DialogCloser',
'DialogContent',
'DialogTrigger',
'DialogWrapper',
'DropZone',
'Dropdown',
'DropdownCloser',
'DropdownContent',
'DropdownMenuButton',
'DropdownTrigger',
'EmptyTableBody',
'ErrorScreen',
'Fieldset',
'FilterDropdown',
'FlashMessage',
'FloatArea',
'FormControl',
'FormDialog',
'FormDialogContent',
'Header',
'HeaderDropdownMenuButton',
'Heading',
'InformationPanel',
'InputFile',
'LanguageSwitcher',
'LineClamp',
'MessageDialog',
'MessageDialogContent',
'MessageScreen',
'ModelessDialog',
'MultiComboBox',
'Nav',
'NotificationBar',
'PageCounter',
'PageHeading',
'Pagination',
'RadioButton',
'RadioButtonPanel',
'Reel',
'RemoteDialogTrigger',
'RemoteTriggerActionDialog',
'RemoteTriggerFormDialog',
'RemoteTriggerMessageDialog',
'SearchInput',
'Section',
'SegmentedControl',
'Select',
'SideNav',
'Sidebar',
'SingleComboBox',
'SortDropdown',
'Stack',
'Stepper',
'Switch',
'TabBar',
'TabItem',
'TableReel',
'TdCheckbox',
'Textarea',
'ThCheckbox',
'Tooltip',
]

11 changes: 1 addition & 10 deletions packages/smarthr-ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,7 @@ export { StatusLabel } from './components/StatusLabel'
export { Base, BaseColumn } from './components/Base'
export * from './components/Icon'
export { SmartHRLogo } from './components/SmartHRLogo'
export {
Table,
TableReel,
Th,
Td,
ThCheckbox,
TdCheckbox,
BulkActionRow,
EmptyTableBody,
} from './components/Table'
export * from './components/Table'
export * from './components/AppNavi'
export { TabBar, TabItem } from './components/TabBar'
export { Heading, PageHeading } from './components/Heading'
Expand Down
7 changes: 5 additions & 2 deletions packages/smarthr-ui/src/smarthr-ui-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default {
black: defaultColor.GREY_100,
white: defaultColor.WHITE,
'white-darken': theme('colors.white-darken'),
link: defaultColor.TEXT_LINK,
background: defaultColor.BACKGROUND,
border: theme('colors.grey.20'),
brand: theme('colors.brand'),
Expand Down Expand Up @@ -112,6 +111,7 @@ export default {
'white-darken': darkenColor(defaultColor.WHITE),
main: defaultColor.MAIN,
'main-darken': darkenColor(defaultColor.MAIN),
link: defaultColor.TEXT_LINK,
brand: defaultColor.BRAND,
outline: defaultColor.OUTLINE,
danger: defaultColor.DANGER,
Expand Down Expand Up @@ -185,7 +185,9 @@ export default {
white: theme('colors.white'),
'white-darken': theme('colors.white-darken'),
disabled: theme('colors.grey.30'),
link: defaultColor.TEXT_LINK,
link: theme('colors.link'),
// ACTION_BACKGROUND とコントラスト比 4.5 を達成するために調整
'link-darken': darkenColor(theme('colors.link'), 0.062),
grey: theme('colors.grey.65'),
danger: theme('colors.danger'),
'color-inherit': 'inherit',
Expand All @@ -212,6 +214,7 @@ export default {
disabled: theme('colors.grey.20 / 50%'),
darken: darkenColor(theme('colors.grey.20')),
'high-contrast': theme('colors.grey.100'),
link: theme('colors.link'),
}),
strokeWidth: {
'0.5': '0.5',
Expand Down