Skip to content

Commit ba5df40

Browse files
authoredOct 22, 2024··
feat: WakuWakuButton を追加 (#5018)
1 parent 950b06b commit ba5df40

File tree

7 files changed

+38
-13
lines changed

7 files changed

+38
-13
lines changed
 

‎packages/smarthr-ui/src/components/Table/Table.stories.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import styled from 'styled-components'
55

66
import { Base } from '../Base'
77
import { Button } from '../Button'
8+
import { FaPencilIcon } from '../Icon'
89
import { Cluster } from '../Layout'
910
import { Text } from '../Text'
1011

1112
import { TdCheckbox } from './TdCheckbox'
1213
import { ThCheckbox } from './ThCheckbox'
14+
import { WakuWakuButton } from './WakuWakuButton'
1315

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

@@ -277,7 +279,15 @@ export const All: StoryFn = () => (
277279
<Th>Protein (g)</Th>
278280
<Th>Button</Th>
279281
</tr>
280-
<BulkActionRow>Bulk action area</BulkActionRow>
282+
<BulkActionRow>
283+
<Cluster align="center">
284+
<p>50件のオブジェクトが選択されています。</p>
285+
<WakuWakuButton>一覧のオブジェクト9,999件をすべて選択</WakuWakuButton>
286+
<Button size="s" prefix={<FaPencilIcon />}>
287+
一括操作
288+
</Button>
289+
</Cluster>
290+
</BulkActionRow>
281291
</thead>
282292
<tbody>
283293
{data.map(({ name, calories, fat, carbs, protein }, i) => (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
3+
import { Button } from '../Button'
4+
5+
type Props = Omit<React.ComponentProps<typeof Button>, 'variant' | 'size'>
6+
7+
export const WakuWakuButton: React.FC<Props> = (props) => (
8+
<Button {...props} variant="text" size="s" className="shr-text-link-darken" />
9+
)

‎packages/smarthr-ui/src/components/Table/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export { TdCheckbox } from './TdCheckbox'
66
export { BulkActionRow } from './BulkActionRow'
77
export { EmptyTableBody } from './EmptyTableBody'
88
export { TableReel } from './TableReel'
9+
export { WakuWakuButton } from './WakuWakuButton'

‎packages/smarthr-ui/src/index.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,7 @@ export { StatusLabel } from './components/StatusLabel'
4646
export { Base, BaseColumn } from './components/Base'
4747
export * from './components/Icon'
4848
export { SmartHRLogo } from './components/SmartHRLogo'
49-
export {
50-
Table,
51-
TableReel,
52-
Th,
53-
Td,
54-
ThCheckbox,
55-
TdCheckbox,
56-
BulkActionRow,
57-
EmptyTableBody,
58-
} from './components/Table'
49+
export * from './components/Table'
5950
export * from './components/AppNavi'
6051
export { TabBar, TabItem } from './components/TabBar'
6152
export { Heading, PageHeading } from './components/Heading'

‎packages/smarthr-ui/src/smarthr-ui-preset.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export default {
6161
black: defaultColor.GREY_100,
6262
white: defaultColor.WHITE,
6363
'white-darken': theme('colors.white-darken'),
64-
link: defaultColor.TEXT_LINK,
6564
background: defaultColor.BACKGROUND,
6665
border: theme('colors.grey.20'),
6766
brand: theme('colors.brand'),
@@ -112,6 +111,7 @@ export default {
112111
'white-darken': darkenColor(defaultColor.WHITE),
113112
main: defaultColor.MAIN,
114113
'main-darken': darkenColor(defaultColor.MAIN),
114+
link: defaultColor.TEXT_LINK,
115115
brand: defaultColor.BRAND,
116116
outline: defaultColor.OUTLINE,
117117
danger: defaultColor.DANGER,
@@ -185,7 +185,9 @@ export default {
185185
white: theme('colors.white'),
186186
'white-darken': theme('colors.white-darken'),
187187
disabled: theme('colors.grey.30'),
188-
link: defaultColor.TEXT_LINK,
188+
link: theme('colors.link'),
189+
// ACTION_BACKGROUND とコントラスト比 4.5 を達成するために調整
190+
'link-darken': darkenColor(theme('colors.link'), 0.062),
189191
grey: theme('colors.grey.65'),
190192
danger: theme('colors.danger'),
191193
'color-inherit': 'inherit',
@@ -212,6 +214,7 @@ export default {
212214
disabled: theme('colors.grey.20 / 50%'),
213215
darken: darkenColor(theme('colors.grey.20')),
214216
'high-contrast': theme('colors.grey.100'),
217+
link: theme('colors.link'),
215218
}),
216219
strokeWidth: {
217220
'0.5': '0.5',

‎sandbox/next/e2e/rsc.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const CLIENT_COMPONENTS = [
123123
'Textarea',
124124
'ThCheckbox',
125125
'Tooltip',
126+
'WakuWakuButton',
126127
]
127128

128129
test.describe('RSC対応コンポーネントがRSCで利用できること', () => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { WakuWakuButton } from 'smarthr-ui'
3+
export default function WakuWakuButtonPage() {
4+
return (
5+
<>
6+
<div>Success: Button</div>
7+
<WakuWakuButton />
8+
</>
9+
)
10+
}

0 commit comments

Comments
 (0)
Please sign in to comment.