@charcoal-ui/react 3.10.1 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts +1 -2
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +4 -4
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/core/CharcoalProvider.d.ts +1 -1
- package/dist/core/CharcoalProvider.d.ts.map +1 -1
- package/dist/index.cjs.js +123 -351
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +85 -313
- package/dist/index.esm.js.map +1 -1
- package/package.json +13 -17
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +601 -173
- package/src/components/Checkbox/index.story.tsx +57 -77
- package/src/components/Checkbox/index.tsx +7 -2
- package/src/components/DropdownSelector/Popover/index.tsx +1 -2
- package/src/components/IconButton/__snapshots__/index.story.storyshot +6 -8
- package/src/components/IconButton/index.story.tsx +14 -37
- package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +139 -1
- package/src/components/LoadingSpinner/index.story.tsx +18 -7
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/Modal/useCustomModalOverlay.tsx +5 -4
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +32 -44
- package/src/components/MultiSelect/index.story.tsx +88 -192
- package/src/components/MultiSelect/index.tsx +2 -1
- package/src/components/Radio/__snapshots__/index.story.storyshot +1 -1
- package/src/components/Radio/index.story.tsx +20 -21
- package/src/components/Radio/index.tsx +14 -13
- package/src/components/Switch/__snapshots__/index.story.storyshot +8 -9
- package/src/components/Switch/index.story.tsx +10 -18
- package/src/components/TagItem/__snapshots__/index.story.storyshot +791 -665
- package/src/components/TagItem/index.story.tsx +44 -161
- package/src/components/TextArea/TextArea.story.tsx +62 -24
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +1858 -472
- package/src/components/TextArea/index.tsx +2 -0
- package/src/components/TextField/TextField.story.tsx +77 -67
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +2004 -786
- package/src/components/TextField/index.tsx +2 -0
- package/src/components/a11y.test.tsx +1 -1
- package/src/core/CharcoalProvider.tsx +1 -1
- package/dist/components/Button/index.story.d.ts +0 -14
- package/dist/components/Button/index.story.d.ts.map +0 -1
- package/dist/components/Checkbox/index.story.d.ts +0 -8
- package/dist/components/Checkbox/index.story.d.ts.map +0 -1
- package/dist/components/Clickable/index.story.d.ts +0 -6
- package/dist/components/Clickable/index.story.d.ts.map +0 -1
- package/dist/components/DropdownSelector/ListItem/index.story.d.ts +0 -9
- package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +0 -1
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts +0 -8
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +0 -1
- package/dist/components/DropdownSelector/Popover/index.story.d.ts +0 -5
- package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +0 -1
- package/dist/components/DropdownSelector/index.story.d.ts +0 -19
- package/dist/components/DropdownSelector/index.story.d.ts.map +0 -1
- package/dist/components/Icon/index.story.d.ts +0 -6
- package/dist/components/Icon/index.story.d.ts.map +0 -1
- package/dist/components/IconButton/index.story.d.ts +0 -9
- package/dist/components/IconButton/index.story.d.ts.map +0 -1
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +0 -8
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +0 -1
- package/dist/components/LoadingSpinner/index.story.d.ts +0 -6
- package/dist/components/LoadingSpinner/index.story.d.ts.map +0 -1
- package/dist/components/Modal/index.story.d.ts +0 -21
- package/dist/components/Modal/index.story.d.ts.map +0 -1
- package/dist/components/MultiSelect/index.story.d.ts +0 -82
- package/dist/components/MultiSelect/index.story.d.ts.map +0 -1
- package/dist/components/MultiSelect/index.test.d.ts +0 -2
- package/dist/components/MultiSelect/index.test.d.ts.map +0 -1
- package/dist/components/Radio/index.story.d.ts +0 -26
- package/dist/components/Radio/index.story.d.ts.map +0 -1
- package/dist/components/Radio/index.test.d.ts +0 -2
- package/dist/components/Radio/index.test.d.ts.map +0 -1
- package/dist/components/SegmentedControl/index.story.d.ts +0 -7
- package/dist/components/SegmentedControl/index.story.d.ts.map +0 -1
- package/dist/components/Switch/index.story.d.ts +0 -9
- package/dist/components/Switch/index.story.d.ts.map +0 -1
- package/dist/components/TagItem/index.story.d.ts +0 -16
- package/dist/components/TagItem/index.story.d.ts.map +0 -1
- package/dist/components/TextArea/TextArea.story.d.ts +0 -9
- package/dist/components/TextArea/TextArea.story.d.ts.map +0 -1
- package/dist/components/TextField/TextField.story.d.ts +0 -22
- package/dist/components/TextField/TextField.story.d.ts.map +0 -1
- package/dist/components/a11y.test.d.ts +0 -2
- package/dist/components/a11y.test.d.ts.map +0 -1
- package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +0 -13
|
@@ -1,183 +1,66 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions'
|
|
2
|
-
import styled from 'styled-components'
|
|
3
1
|
import TagItem from '.'
|
|
4
2
|
import { Meta, StoryObj } from '@storybook/react'
|
|
5
3
|
|
|
6
4
|
export default {
|
|
7
5
|
title: 'TagItem',
|
|
8
6
|
component: TagItem,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
control: {
|
|
12
|
-
type: 'color',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
render: function Render(args) {
|
|
17
|
-
return <TagItem {...args} />
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
18
9
|
},
|
|
19
10
|
} as Meta<typeof TagItem>
|
|
20
11
|
|
|
21
12
|
export const Default: StoryObj<typeof TagItem> = {
|
|
22
13
|
args: {
|
|
23
14
|
label: '#女の子',
|
|
24
|
-
|
|
15
|
+
},
|
|
16
|
+
render: function Render(args) {
|
|
17
|
+
return <TagItem {...args} />
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TranslatedLabel: StoryObj<typeof TagItem> = {
|
|
22
|
+
render: function Render() {
|
|
23
|
+
return <TagItem label="#女の子" translatedLabel="girl" />
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const BGColor: StoryObj<typeof TagItem> = {
|
|
28
|
+
render: function Render() {
|
|
29
|
+
return <TagItem label="女の子" bgColor="var(--charcoal-brand)" />
|
|
25
30
|
},
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
export const
|
|
29
|
-
render: function Render(
|
|
33
|
+
export const BGImage: StoryObj<typeof TagItem> = {
|
|
34
|
+
render: function Render() {
|
|
30
35
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
label={label}
|
|
36
|
-
size="M"
|
|
37
|
-
status="default"
|
|
38
|
-
bgColor={bgColor}
|
|
39
|
-
onClick={action('click')}
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
<div />
|
|
43
|
-
<div>
|
|
44
|
-
<TagItem
|
|
45
|
-
label={label}
|
|
46
|
-
translatedLabel={translatedLabel}
|
|
47
|
-
size="M"
|
|
48
|
-
status="default"
|
|
49
|
-
bgColor={bgColor}
|
|
50
|
-
onClick={action('click')}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
<div />
|
|
54
|
-
</Container>
|
|
55
|
-
<Container>
|
|
56
|
-
<div>
|
|
57
|
-
<TagItem
|
|
58
|
-
label={label}
|
|
59
|
-
size="M"
|
|
60
|
-
status="active"
|
|
61
|
-
bgColor={bgColor}
|
|
62
|
-
onClick={action('click')}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
<div />
|
|
66
|
-
<div>
|
|
67
|
-
<TagItem
|
|
68
|
-
label={label}
|
|
69
|
-
translatedLabel={translatedLabel}
|
|
70
|
-
size="M"
|
|
71
|
-
status="active"
|
|
72
|
-
bgColor={bgColor}
|
|
73
|
-
onClick={action('click')}
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
<div />
|
|
77
|
-
</Container>
|
|
78
|
-
<Container>
|
|
79
|
-
<div>
|
|
80
|
-
<TagItem
|
|
81
|
-
label={label}
|
|
82
|
-
size="M"
|
|
83
|
-
status="inactive"
|
|
84
|
-
bgColor={bgColor}
|
|
85
|
-
onClick={action('click')}
|
|
86
|
-
/>
|
|
87
|
-
</div>
|
|
88
|
-
<div>
|
|
89
|
-
<TagItem
|
|
90
|
-
label={label}
|
|
91
|
-
size="M"
|
|
92
|
-
status="inactive"
|
|
93
|
-
disabled
|
|
94
|
-
bgColor={bgColor}
|
|
95
|
-
onClick={action('click')}
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
<div>
|
|
99
|
-
<TagItem
|
|
100
|
-
label={label}
|
|
101
|
-
translatedLabel={translatedLabel}
|
|
102
|
-
size="M"
|
|
103
|
-
status="inactive"
|
|
104
|
-
bgColor={bgColor}
|
|
105
|
-
onClick={action('click')}
|
|
106
|
-
/>
|
|
107
|
-
</div>
|
|
108
|
-
<div>
|
|
109
|
-
<TagItem
|
|
110
|
-
label={label}
|
|
111
|
-
translatedLabel={translatedLabel}
|
|
112
|
-
size="M"
|
|
113
|
-
status="inactive"
|
|
114
|
-
disabled
|
|
115
|
-
bgColor={bgColor}
|
|
116
|
-
onClick={action('click')}
|
|
117
|
-
/>
|
|
118
|
-
</div>
|
|
119
|
-
</Container>
|
|
120
|
-
<Container>
|
|
121
|
-
<div>
|
|
122
|
-
<TagItem
|
|
123
|
-
label={label}
|
|
124
|
-
size="S"
|
|
125
|
-
status="default"
|
|
126
|
-
bgColor={bgColor}
|
|
127
|
-
onClick={action('click')}
|
|
128
|
-
/>
|
|
129
|
-
</div>
|
|
130
|
-
</Container>
|
|
131
|
-
<Container>
|
|
132
|
-
<div>
|
|
133
|
-
<TagItem
|
|
134
|
-
label={label}
|
|
135
|
-
size="S"
|
|
136
|
-
status="active"
|
|
137
|
-
bgColor={bgColor}
|
|
138
|
-
onClick={action('click')}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
</Container>
|
|
142
|
-
<Container>
|
|
143
|
-
<div>
|
|
144
|
-
<TagItem
|
|
145
|
-
label={label}
|
|
146
|
-
size="S"
|
|
147
|
-
status="inactive"
|
|
148
|
-
bgColor={bgColor}
|
|
149
|
-
onClick={action('click')}
|
|
150
|
-
/>
|
|
151
|
-
</div>
|
|
152
|
-
<div>
|
|
153
|
-
<TagItem
|
|
154
|
-
label={label}
|
|
155
|
-
size="S"
|
|
156
|
-
status="inactive"
|
|
157
|
-
disabled
|
|
158
|
-
bgColor={bgColor}
|
|
159
|
-
onClick={action('click')}
|
|
160
|
-
/>
|
|
161
|
-
</div>
|
|
162
|
-
</Container>
|
|
163
|
-
</div>
|
|
36
|
+
<TagItem
|
|
37
|
+
label="#女の子"
|
|
38
|
+
bgImage="https://charcoal-web.pixiv.design/charcoal-ogp.jpg"
|
|
39
|
+
/>
|
|
164
40
|
)
|
|
165
41
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const Active: StoryObj<typeof TagItem> = {
|
|
45
|
+
render: function Render() {
|
|
46
|
+
return <TagItem label="#女の子" status="active" />
|
|
170
47
|
},
|
|
171
48
|
}
|
|
172
49
|
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
50
|
+
export const InActive: StoryObj<typeof TagItem> = {
|
|
51
|
+
render: function Render() {
|
|
52
|
+
return <TagItem label="#女の子" status="inactive" />
|
|
53
|
+
},
|
|
54
|
+
}
|
|
176
55
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
56
|
+
export const Small: StoryObj<typeof TagItem> = {
|
|
57
|
+
render: function Render() {
|
|
58
|
+
return <TagItem label="#女の子" size="S" />
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Disabled: StoryObj<typeof TagItem> = {
|
|
63
|
+
render: function Render() {
|
|
64
|
+
return <TagItem label="#女の子" disabled />
|
|
65
|
+
},
|
|
66
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions'
|
|
2
|
-
import styled from 'styled-components'
|
|
3
2
|
import Clickable from '../Clickable'
|
|
4
3
|
import TextArea from '.'
|
|
5
|
-
import { px } from '@charcoal-ui/utils'
|
|
6
4
|
import { Meta, StoryObj } from '@storybook/react'
|
|
7
5
|
|
|
8
6
|
export default {
|
|
9
7
|
title: 'TextArea',
|
|
10
8
|
component: TextArea,
|
|
11
|
-
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
} as Meta<typeof TextArea>
|
|
13
|
+
|
|
14
|
+
export const Default: StoryObj<typeof TextArea> = {
|
|
12
15
|
args: {
|
|
13
16
|
showLabel: false,
|
|
14
17
|
label: 'Label',
|
|
@@ -17,42 +20,77 @@ export default {
|
|
|
17
20
|
disabled: false,
|
|
18
21
|
required: false,
|
|
19
22
|
invalid: false,
|
|
23
|
+
readOnly: false,
|
|
20
24
|
subLabel: <Clickable onClick={action('label-click')}>Text Link</Clickable>,
|
|
21
25
|
placeholder: 'Text Area',
|
|
22
26
|
},
|
|
23
|
-
render
|
|
27
|
+
render(args) {
|
|
28
|
+
return <TextArea {...args} />
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Label: StoryObj<typeof TextArea> = {
|
|
33
|
+
render() {
|
|
34
|
+
return <TextArea showLabel label="Label" />
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Placeholder: StoryObj<typeof TextArea> = {
|
|
39
|
+
render() {
|
|
40
|
+
return <TextArea placeholder="Placeholder" label="Label" />
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const Required: StoryObj<typeof TextArea> = {
|
|
45
|
+
render() {
|
|
46
|
+
return <TextArea required label="Label" requiredText="*必須" />
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const AssistiveText: StoryObj<typeof TextArea> = {
|
|
51
|
+
render() {
|
|
52
|
+
return <TextArea label="Label" assistiveText="説明が入ります" />
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const SubLabel: StoryObj<typeof TextArea> = {
|
|
57
|
+
render: function Render() {
|
|
24
58
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
59
|
+
<TextArea
|
|
60
|
+
showLabel
|
|
61
|
+
label="Label"
|
|
62
|
+
subLabel={<Clickable>Text Link</Clickable>}
|
|
63
|
+
/>
|
|
28
64
|
)
|
|
29
65
|
},
|
|
30
|
-
}
|
|
66
|
+
}
|
|
31
67
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
68
|
+
export const ShowCount: StoryObj<typeof TextArea> = {
|
|
69
|
+
render() {
|
|
70
|
+
return <TextArea showCount maxLength={100} label="Label" />
|
|
71
|
+
},
|
|
72
|
+
}
|
|
36
73
|
|
|
37
|
-
export const
|
|
74
|
+
export const Disabled: StoryObj<typeof TextArea> = {
|
|
75
|
+
render() {
|
|
76
|
+
return <TextArea disabled label="Label" />
|
|
77
|
+
},
|
|
78
|
+
}
|
|
38
79
|
|
|
39
|
-
export const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
assistiveText: 'Assistive text',
|
|
43
|
-
required: true,
|
|
80
|
+
export const Invalid: StoryObj<typeof TextArea> = {
|
|
81
|
+
render() {
|
|
82
|
+
return <TextArea label="Label" invalid assistiveText="エラーメッセージ" />
|
|
44
83
|
},
|
|
45
84
|
}
|
|
46
85
|
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
maxLength: 100,
|
|
86
|
+
export const ReadOnly: StoryObj<typeof TextArea> = {
|
|
87
|
+
render() {
|
|
88
|
+
return <TextArea label="Label" readOnly value="読み取り専用" />
|
|
51
89
|
},
|
|
52
90
|
}
|
|
53
91
|
|
|
54
92
|
export const AutoHeight: StoryObj<typeof TextArea> = {
|
|
55
|
-
|
|
56
|
-
autoHeight
|
|
93
|
+
render: function Render() {
|
|
94
|
+
return <TextArea autoHeight label="Label" />
|
|
57
95
|
},
|
|
58
96
|
}
|