@charcoal-ui/react 3.10.1-beta.1 → 3.11.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/DropdownSelector/index.d.ts +1 -1
- package/dist/components/DropdownSelector/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 +129 -351
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -317
- package/dist/index.esm.js.map +1 -1
- package/package.json +13 -17
- package/src/components/Button/__snapshots__/index.story.storyshot +91 -939
- package/src/components/Button/index.story.tsx +14 -161
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +560 -154
- package/src/components/Checkbox/index.story.tsx +46 -74
- package/src/components/Checkbox/index.tsx +1 -0
- package/src/components/DropdownSelector/Popover/index.tsx +1 -2
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +15 -0
- package/src/components/DropdownSelector/index.tsx +19 -4
- 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/__snapshots__/index.story.storyshot +2 -0
- 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 -19
- 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,190 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ClickableElement } from '../Clickable'
|
|
3
|
-
import Button, { ButtonProps } from '.'
|
|
1
|
+
import Button from '.'
|
|
4
2
|
import { Meta, StoryObj } from '@storybook/react'
|
|
5
3
|
|
|
6
4
|
export default {
|
|
7
5
|
title: 'Button',
|
|
8
6
|
component: Button,
|
|
9
|
-
argTypes: {
|
|
10
|
-
variant: {
|
|
11
|
-
control: {
|
|
12
|
-
type: 'inline-radio',
|
|
13
|
-
options: ['Primary', 'Default', 'Overlay', 'Danger', 'Navigation'],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
control: {
|
|
18
|
-
type: 'inline-radio',
|
|
19
|
-
options: ['S', 'M'],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
render: (args) => <Button {...args}>Button</Button>,
|
|
24
7
|
} as Meta<typeof Button>
|
|
25
8
|
|
|
26
|
-
export const Default: StoryObj<typeof Button> = {
|
|
9
|
+
export const Default: StoryObj<typeof Button> = {
|
|
10
|
+
render: (args) => <Button {...args}>Button</Button>,
|
|
11
|
+
}
|
|
27
12
|
|
|
28
13
|
export const Primary: StoryObj<typeof Button> = {
|
|
29
|
-
|
|
30
|
-
variant: 'Primary',
|
|
31
|
-
},
|
|
14
|
+
render: () => <Button variant="Primary">Primary</Button>,
|
|
32
15
|
}
|
|
33
16
|
|
|
34
17
|
export const Navigation: StoryObj<typeof Button> = {
|
|
35
|
-
|
|
36
|
-
variant: 'Navigation',
|
|
37
|
-
},
|
|
18
|
+
render: () => <Button variant="Navigation">Navigation</Button>,
|
|
38
19
|
}
|
|
39
20
|
|
|
40
21
|
export const Overlay: StoryObj<typeof Button> = {
|
|
41
|
-
|
|
42
|
-
variant: 'Overlay',
|
|
43
|
-
},
|
|
22
|
+
render: () => <Button variant="Overlay">Overlay</Button>,
|
|
44
23
|
}
|
|
45
24
|
|
|
46
25
|
export const Danger: StoryObj<typeof Button> = {
|
|
47
|
-
|
|
48
|
-
variant: 'Danger',
|
|
49
|
-
},
|
|
26
|
+
render: () => <Button variant="Danger">Danger</Button>,
|
|
50
27
|
}
|
|
51
28
|
|
|
52
29
|
export const Small: StoryObj<typeof Button> = {
|
|
53
|
-
|
|
54
|
-
size: 'S',
|
|
55
|
-
},
|
|
30
|
+
render: () => <Button size="S">Small</Button>,
|
|
56
31
|
}
|
|
57
32
|
|
|
58
|
-
export const
|
|
59
|
-
|
|
60
|
-
fullWidth: true,
|
|
61
|
-
},
|
|
33
|
+
export const FullWidth: StoryObj<typeof Button> = {
|
|
34
|
+
render: () => <Button fullWidth>Full width</Button>,
|
|
62
35
|
}
|
|
63
36
|
|
|
64
37
|
export const Disabled: StoryObj<typeof Button> = {
|
|
65
|
-
|
|
66
|
-
disabled: true,
|
|
67
|
-
},
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const Active: StoryObj<typeof Button> = {
|
|
71
|
-
args: {
|
|
72
|
-
isActive: true,
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const Link: StoryObj<typeof Button> = {
|
|
77
|
-
args: {
|
|
78
|
-
to: '#',
|
|
79
|
-
},
|
|
38
|
+
render: () => <Button disabled>Disabled</Button>,
|
|
80
39
|
}
|
|
81
40
|
|
|
82
|
-
export const
|
|
83
|
-
render: (
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const Focus: StoryObj<typeof Button> = {
|
|
87
|
-
render: function Render(args) {
|
|
88
|
-
const ref = useRef<ClickableElement>(null)
|
|
89
|
-
const focus = () => ref.current?.focus()
|
|
90
|
-
return (
|
|
91
|
-
<Button {...args} onMouseOver={focus} ref={ref}>
|
|
92
|
-
Mouse over to focus
|
|
93
|
-
</Button>
|
|
94
|
-
)
|
|
95
|
-
},
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export const LayoutExample: StoryObj<typeof Button> = {
|
|
99
|
-
render: (args: ButtonProps) => (
|
|
100
|
-
<div
|
|
101
|
-
css={`
|
|
102
|
-
display: grid;
|
|
103
|
-
gap: 24px;
|
|
104
|
-
`}
|
|
105
|
-
>
|
|
106
|
-
<div
|
|
107
|
-
css={`
|
|
108
|
-
display: grid;
|
|
109
|
-
grid: auto / auto-flow min-content;
|
|
110
|
-
gap: 8px;
|
|
111
|
-
`}
|
|
112
|
-
>
|
|
113
|
-
<Button {...args}>Grid</Button>
|
|
114
|
-
<Button {...args} variant="Navigation">
|
|
115
|
-
Layout
|
|
116
|
-
</Button>
|
|
117
|
-
<Button {...args} variant="Danger">
|
|
118
|
-
Sample
|
|
119
|
-
</Button>
|
|
120
|
-
</div>
|
|
121
|
-
<div
|
|
122
|
-
css={`
|
|
123
|
-
display: grid;
|
|
124
|
-
grid: auto-flow auto / 392px;
|
|
125
|
-
gap: 8px;
|
|
126
|
-
`}
|
|
127
|
-
>
|
|
128
|
-
<Button {...args} variant="Primary" fullWidth>
|
|
129
|
-
Submit
|
|
130
|
-
</Button>
|
|
131
|
-
<Button {...args} variant="Default" fullWidth>
|
|
132
|
-
Cancel
|
|
133
|
-
</Button>
|
|
134
|
-
</div>
|
|
135
|
-
<div
|
|
136
|
-
css={`
|
|
137
|
-
display: flex;
|
|
138
|
-
|
|
139
|
-
& > * + * {
|
|
140
|
-
margin-left: 8px;
|
|
141
|
-
}
|
|
142
|
-
`}
|
|
143
|
-
>
|
|
144
|
-
<Button {...args}>Flex</Button>
|
|
145
|
-
<Button {...args} variant="Navigation">
|
|
146
|
-
Layout
|
|
147
|
-
</Button>
|
|
148
|
-
<Button {...args} variant="Danger">
|
|
149
|
-
Sample
|
|
150
|
-
</Button>
|
|
151
|
-
</div>
|
|
152
|
-
<div
|
|
153
|
-
css={`
|
|
154
|
-
display: flex;
|
|
155
|
-
flex-direction: column;
|
|
156
|
-
width: 392px;
|
|
157
|
-
|
|
158
|
-
& > * + * {
|
|
159
|
-
margin-top: 8px;
|
|
160
|
-
}
|
|
161
|
-
`}
|
|
162
|
-
>
|
|
163
|
-
<Button {...args} variant="Primary" fullWidth>
|
|
164
|
-
Submit
|
|
165
|
-
</Button>
|
|
166
|
-
<Button {...args} variant="Default" fullWidth>
|
|
167
|
-
Cancel
|
|
168
|
-
</Button>
|
|
169
|
-
</div>
|
|
170
|
-
<div
|
|
171
|
-
css={`
|
|
172
|
-
display: flex;
|
|
173
|
-
flex-direction: column;
|
|
174
|
-
width: 392px;
|
|
175
|
-
|
|
176
|
-
& > * + * {
|
|
177
|
-
margin-top: 8px;
|
|
178
|
-
}
|
|
179
|
-
`}
|
|
180
|
-
>
|
|
181
|
-
<Button {...args} variant="Primary" fullWidth>
|
|
182
|
-
すべて見る
|
|
183
|
-
</Button>
|
|
184
|
-
<Button {...args} variant="Default">
|
|
185
|
-
作品を投稿
|
|
186
|
-
</Button>
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
),
|
|
41
|
+
export const IsActive: StoryObj<typeof Button> = {
|
|
42
|
+
render: () => <Button isActive>Active</Button>,
|
|
190
43
|
}
|