11import { Meta } from "@storybook/react-vite"
22import React from "react"
33import {
4- CommandItem ,
5- CommandInput ,
6- CommandList ,
4+ CommandDialog ,
75 CommandEmpty ,
86 CommandGroup ,
7+ CommandInput ,
8+ CommandItem ,
9+ CommandList ,
910 CommandSeparator ,
10- CommandShortcut ,
11- CommandDialog
11+ CommandShortcut
1212} from "./Command"
13+ import { Tab , TabList , TabTrigger } from "../tab/Tab" ;
14+ import { Button } from "../button/Button" ;
15+ import {
16+ IconBrandDiscord ,
17+ IconBrandTeams ,
18+ IconMath ,
19+ IconNumber , IconSearch ,
20+ IconSelectAll ,
21+ IconSwitch ,
22+ IconTextGrammar
23+ } from "@tabler/icons-react" ;
24+ import { Text } from "../text/Text" ;
25+ import { hashToColor } from "../../utils" ;
26+ import { ScrollArea , ScrollAreaScrollbar , ScrollAreaThumb , ScrollAreaViewport } from "../scroll-area/ScrollArea" ;
27+ import { Layout } from "../layout/Layout" ;
28+ import { Card } from "../card/Card" ;
1329
1430export default {
1531 title : "Command" ,
@@ -19,38 +35,129 @@ export default {
1935export const ExampleCommand = ( ) => {
2036
2137 return (
22- < CommandDialog open = { true } >
23- < CommandInput placeholder = "Type a command or search..." clearable />
24- < CommandSeparator />
25- < CommandList >
26- < CommandEmpty > No results found.</ CommandEmpty >
27- < CommandGroup heading = "Suggestions" >
28- < CommandItem >
29- < span > Calendar</ span >
30- </ CommandItem >
31- < CommandItem >
32- < span > Search Emoji</ span >
33- </ CommandItem >
34- < CommandItem disabled >
35- < span > Calculator</ span >
36- </ CommandItem >
37- </ CommandGroup >
38- < CommandSeparator />
39- < CommandGroup heading = "Settings" >
40- < CommandItem >
41- < span > Profile</ span >
42- < CommandShortcut > ⌘P</ CommandShortcut >
43- </ CommandItem >
44- < CommandItem >
45- < span > Billing</ span >
46- < CommandShortcut > ⌘B</ CommandShortcut >
47- </ CommandItem >
48- < CommandItem >
49- < span > Settings</ span >
50- < CommandShortcut > ⌘S</ CommandShortcut >
51- </ CommandItem >
52- </ CommandGroup >
53- </ CommandList >
38+ < CommandDialog p = { "0" } open = { true } contentProps = { { h : "75vh" } } >
39+ < Layout p = { 0.7 } layoutGap = { 0 } showLayoutSplitter = { false } bottomContent = { < Text > sd</ Text > } topContent = { < div style = { { paddingBottom : "0.35rem" } } > < CommandInput left = { < IconSearch size = { 13 } /> } placeholder = "Type a command or search..." clearable /> </ div > } >
40+ < Card mx = { - 0.5 } h = { "100%" } paddingSize = { "xxs" } >
41+ < Layout style = { { overflow : "hidden" } } leftContent = { < ScrollArea p = { 0.7 } h = { "100%" } type = { "always" } w = { "fit-content" } miw = { "25%" } >
42+ < ScrollAreaViewport h = { "100%" } w = { "100%" } >
43+ < Tab orientation = { "vertical" } defaultValue = { "all" } >
44+ < TabList >
45+ < TabTrigger value = { "all" } asChild >
46+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
47+ < IconSelectAll color = { hashToColor ( "all" ) } size = { 13 } />
48+ < Text size = { "sm" } > All</ Text >
49+ </ Button >
50+ </ TabTrigger >
51+ < TabTrigger value = { "control" } asChild >
52+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
53+ < IconMath color = { hashToColor ( "control" ) } size = { 13 } />
54+ < Text size = { "sm" } > Control</ Text >
55+ </ Button >
56+ </ TabTrigger >
57+ < TabTrigger value = { "number" } asChild >
58+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
59+ < IconNumber color = { hashToColor ( "number" ) } size = { 13 } />
60+ < Text size = { "sm" } > Number</ Text >
61+ </ Button >
62+ </ TabTrigger >
63+ < TabTrigger value = { "text" } asChild >
64+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
65+ < IconTextGrammar color = { hashToColor ( "text" ) } size = { 13 } />
66+ < Text size = { "sm" } > Text</ Text >
67+ </ Button >
68+ </ TabTrigger >
69+ < TabTrigger value = { "bool" } asChild >
70+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
71+ < IconSwitch color = { hashToColor ( "bool" ) } size = { 13 } />
72+ < Text size = { "sm" } > Boolean</ Text >
73+ </ Button >
74+ </ TabTrigger >
75+ < TabTrigger value = { "teams" } asChild >
76+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
77+ < IconBrandTeams color = { hashToColor ( "teams" ) } size = { 16 } />
78+ < Text size = { "sm" } > Teams</ Text >
79+ </ Button >
80+ </ TabTrigger >
81+ < TabTrigger value = { "discord" } asChild >
82+ < Button w = { "100%" } justify = { "start" } paddingSize = { "xxs" } variant = { "none" } >
83+ < IconBrandDiscord color = { hashToColor ( "discord" ) } size = { 16 } />
84+ < Text size = { "sm" } > Discord</ Text >
85+ </ Button >
86+ </ TabTrigger >
87+ </ TabList >
88+ </ Tab >
89+ </ ScrollAreaViewport >
90+ < ScrollAreaScrollbar orientation = { "vertical" } >
91+ < ScrollAreaThumb />
92+ </ ScrollAreaScrollbar >
93+ </ ScrollArea > } >
94+ < ScrollArea h = { "100%" } w = { "100%" } type = { "always" } >
95+ < ScrollAreaViewport >
96+ < CommandList w = { "100%" } >
97+ < CommandEmpty > No results found.</ CommandEmpty >
98+ < CommandGroup heading = "Suggestions" >
99+ < CommandItem >
100+ < span > Calendar</ span >
101+ </ CommandItem >
102+ < CommandItem >
103+ < span > Search Emoji</ span >
104+ </ CommandItem >
105+ < CommandItem disabled >
106+ < span > Calculator</ span >
107+ </ CommandItem >
108+ </ CommandGroup >
109+ < CommandSeparator />
110+ < CommandGroup heading = "Settings" >
111+ < CommandItem value = { "profile3" } >
112+ < span > Profile</ span >
113+ < CommandShortcut > ⌘P</ CommandShortcut >
114+ </ CommandItem >
115+ < CommandItem >
116+ < span > Billing</ span >
117+ < CommandShortcut > ⌘B</ CommandShortcut >
118+ </ CommandItem >
119+ < CommandItem >
120+ < span > Settings</ span >
121+ < CommandShortcut > ⌘S</ CommandShortcut >
122+ </ CommandItem >
123+ </ CommandGroup >
124+ < CommandGroup heading = "Settings2" >
125+ < CommandItem >
126+ < span > Profile</ span >
127+ < CommandShortcut > ⌘P</ CommandShortcut >
128+ </ CommandItem >
129+ < CommandItem >
130+ < span > Billing</ span >
131+ < CommandShortcut > ⌘B</ CommandShortcut >
132+ </ CommandItem >
133+ < CommandItem >
134+ < span > Settings</ span >
135+ < CommandShortcut > ⌘S</ CommandShortcut >
136+ </ CommandItem >
137+ </ CommandGroup >
138+ < CommandGroup heading = "Settings3" >
139+ < CommandItem >
140+ < span > Profile</ span >
141+ < CommandShortcut > ⌘P</ CommandShortcut >
142+ </ CommandItem >
143+ < CommandItem >
144+ < span > Billing</ span >
145+ < CommandShortcut > ⌘B</ CommandShortcut >
146+ </ CommandItem >
147+ < CommandItem >
148+ < span > Settings</ span >
149+ < CommandShortcut > ⌘S</ CommandShortcut >
150+ </ CommandItem >
151+ </ CommandGroup >
152+ </ CommandList >
153+ </ ScrollAreaViewport >
154+ < ScrollAreaScrollbar orientation = { "vertical" } >
155+ < ScrollAreaThumb />
156+ </ ScrollAreaScrollbar >
157+ </ ScrollArea >
158+ </ Layout >
159+ </ Card >
160+ </ Layout >
54161 </ CommandDialog >
55162 )
56163
0 commit comments