11import type { Meta , StoryObj } from "@storybook/react" ;
2- import { Button , buttonVariant } from "./button" ;
3- import { IconAnnotationGroundTruth , IconCrossAlt } from "@humansignal/icons" ;
2+ import { Button , ButtonGroup , buttonVariant } from "./button" ;
3+ import { IconAnnotationGroundTruth , IconCrossAlt , IconChevronDown } from "@humansignal/icons" ;
4+ import { Dropdown } from "../dropdown" ;
5+ import { Space } from "../space/space" ;
6+ import { Typography } from "../typography/typography" ;
47
58const meta : Meta < typeof Button > = {
69 component : Button ,
@@ -188,13 +191,12 @@ export const StyledLink: Story = {
188191 } ,
189192} ;
190193
191- export const WithSecondaryAction = {
194+ export const WithSecondaryAction : Story = {
192195 args : {
193196 children : "Link with button style" ,
194197 } ,
195198 render ( { children, ...props } ) {
196199 return (
197- // biome-ignore lint: We don't need a real link here
198200 < Button
199201 { ...props }
200202 waiting = { props . waiting ?? true }
@@ -219,3 +221,96 @@ export const WithTooltipAndDisabledState: Story = {
219221 ) ;
220222 } ,
221223} ;
224+
225+ export const WithButtonGroup : Story = {
226+ render : ( props ) => {
227+ return (
228+ < div className = "flex flex-col gap-wider" >
229+ < div >
230+ < Typography variant = "title" size = "large" className = "mb-tight" >
231+ Button Group - Collapsed (default)
232+ </ Typography >
233+ < Typography variant = "body" size = "medium" className = "text-secondary mb-comfortable" >
234+ Buttons are visually connected with shared borders
235+ </ Typography >
236+ < ButtonGroup >
237+ < Button { ...props } size = "small" variant = "primary" look = "filled" >
238+ Label All Tasks
239+ </ Button >
240+ < Dropdown . Trigger
241+ alignment = "bottom-right"
242+ content = {
243+ < Space direction = "vertical" className = "bg-neutral-background p-tight rounded" >
244+ < Button align = "left" look = "string" size = "small" >
245+ Label tasks as displayed
246+ </ Button >
247+ < Button align = "left" look = "string" size = "small" >
248+ Skip all tasks
249+ </ Button >
250+ </ Space >
251+ }
252+ >
253+ < Button size = "small" variant = "primary" look = "filled" aria-label = "Toggle label options" >
254+ < IconChevronDown />
255+ </ Button >
256+ </ Dropdown . Trigger >
257+ </ ButtonGroup >
258+ </ div >
259+
260+ < div >
261+ < Typography variant = "title" size = "large" className = "mb-tight" >
262+ Button Group - Not Collapsed
263+ </ Typography >
264+ < Typography variant = "body" size = "medium" className = "text-secondary mb-comfortable" >
265+ Buttons maintain their individual styling with spacing between them
266+ </ Typography >
267+ < ButtonGroup collapsed = { false } >
268+ < Button { ...props } size = "small" variant = "primary" look = "outlined" >
269+ Save
270+ </ Button >
271+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
272+ Cancel
273+ </ Button >
274+ </ ButtonGroup >
275+ </ div >
276+
277+ < div >
278+ < Typography variant = "title" size = "large" className = "mb-tight" >
279+ Multiple Button Group Examples
280+ </ Typography >
281+ < Typography variant = "body" size = "medium" className = "text-secondary mb-comfortable" >
282+ Various combinations of button groups
283+ </ Typography >
284+ < div className = "flex flex-wrap gap-comfortable" >
285+ < ButtonGroup >
286+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
287+ Previous
288+ </ Button >
289+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
290+ 1
291+ </ Button >
292+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
293+ 2
294+ </ Button >
295+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
296+ 3
297+ </ Button >
298+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" >
299+ Next
300+ </ Button >
301+ </ ButtonGroup >
302+
303+ < ButtonGroup >
304+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" leading = { < IconAnnotationGroundTruth /> } >
305+ Edit
306+ </ Button >
307+ < Button { ...props } size = "small" variant = "neutral" look = "outlined" leading = { < IconCrossAlt /> } >
308+ Delete
309+ </ Button >
310+ </ ButtonGroup >
311+ </ div >
312+ </ div >
313+ </ div >
314+ ) ;
315+ } ,
316+ } ;
0 commit comments