66import React from "react"
77import type { Meta , StoryObj } from "@storybook/react-vite"
88import { DataGridToolbar , DataGridToolbarProps } from "./index"
9+ import { Pill } from "../Pill"
10+ import { Stack } from "../Stack"
11+ import { SearchInput } from "../SearchInput"
12+ import { ComboBox } from "../ComboBox"
13+ import { ComboBoxOption } from "../ComboBoxOption"
14+ import { Button } from "../Button"
15+ import { NativeSelectOption } from "../NativeSelectOption"
16+ import { NativeSelect } from "../NativeSelect"
17+ import { InputGroup } from "../InputGroup"
918
1019const meta : Meta < typeof DataGridToolbar > = {
1120 title : "Components/DataGrid/DataGridToolbar" ,
@@ -17,12 +26,6 @@ const meta: Meta<typeof DataGridToolbar> = {
1726 type : { summary : "ReactNode" } ,
1827 } ,
1928 } ,
20- search : {
21- control : false ,
22- table : {
23- type : { summary : "ReactElement" } ,
24- } ,
25- } ,
2629 } ,
2730}
2831
@@ -32,15 +35,58 @@ type Story = StoryObj<typeof meta>
3235export const Default : Story = {
3336 render : ( args : DataGridToolbarProps ) => (
3437 < DataGridToolbar { ...args } >
35- < button > Add </ button >
38+ < Button label = "Create" / >
3639 </ DataGridToolbar >
3740 ) ,
3841 parameters : {
3942 docs : {
4043 description : {
41- story : "Optional toolbar for use in DataGrid. Use ButtonRow for multiple buttons" ,
44+ story :
45+ "Demonstrates a simple toolbar layout with children right-aligned by default. Use ButtonRow for multiple buttons." ,
46+ } ,
47+ } ,
48+ } ,
49+ }
50+
51+ export const ComplexCustomLayout : Story = {
52+ render : ( args : DataGridToolbarProps ) => (
53+ < DataGridToolbar { ...args } >
54+ < Stack direction = "horizontal" distribution = "between" >
55+ < Stack direction = "vertical" gap = "4" >
56+ < Stack alignment = "center" gap = "4" >
57+ < InputGroup >
58+ < NativeSelect name = "Filter" value = "category" wrapperClassName = "jn:w-full" >
59+ < NativeSelectOption value = "category" label = "Category" />
60+ < NativeSelectOption value = "status" label = "Status" />
61+ < NativeSelectOption value = "priority" label = "Priority" />
62+ </ NativeSelect >
63+ < ComboBox >
64+ < ComboBoxOption value = "Electronics" />
65+ < ComboBoxOption value = "Clothing" />
66+ < ComboBoxOption value = "Furniture" />
67+ </ ComboBox >
68+ </ InputGroup >
69+ < Button label = "Clear all" variant = "subdued" />
70+ </ Stack >
71+ < Stack gap = "2" wrap >
72+ < Pill pillKey = "category" pillValue = "electronics" closeable />
73+ < Pill pillKey = "status" pillValue = "active" closeable />
74+ < Pill pillKey = "priority" pillValue = "high" closeable />
75+ </ Stack >
76+ </ Stack >
77+ < SearchInput placeholder = "Search items..." />
78+ </ Stack >
79+ </ DataGridToolbar >
80+ ) ,
81+ args : {
82+ alignRight : false ,
83+ } ,
84+ parameters : {
85+ docs : {
86+ description : {
87+ story :
88+ "Demonstrates a complex toolbar layout with custom styling - children aligned left and search aligned right." ,
4289 } ,
4390 } ,
4491 } ,
45- args : { } ,
4692}
0 commit comments