-
Notifications
You must be signed in to change notification settings - Fork 980
/
Copy pathcommand.stories.tsx
104 lines (101 loc) · 2.75 KB
/
command.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import type { Meta, StoryFn } from "@storybook/react";
import {
Command as CommandComponent,
CommandFooter,
CommandGroup,
CommandGroupHeading,
CommandIcon,
CommandInput,
CommandItem,
CommandList,
} from "./command";
import { Text } from "./text";
import { InfoCircleIcon } from "@webstudio-is/icons";
import { Kbd } from "./kbd";
import { Flex } from "./flex";
import { Separator } from "./separator";
const meta: Meta = {
title: "Library/Command",
};
export default meta;
const CommandContent = () => {
return (
<>
<CommandInput />
<CommandList>
<CommandGroup
heading={<CommandGroupHeading>Suggestions</CommandGroupHeading>}
name="suggestions"
actions={["select", "edit", "delete"]}
>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Calendar</Text>
</Flex>
</CommandItem>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Search Emoji</Text>
</Flex>
</CommandItem>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Calculator</Text>
</Flex>
</CommandItem>
</CommandGroup>
<CommandGroup
heading={<CommandGroupHeading>Settings</CommandGroupHeading>}
name="settings"
actions={["open"]}
>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Profile</Text>
</Flex>
<Kbd value={["meta", "p"]} />
</CommandItem>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Billing</Text>
</Flex>
<Kbd value={["meta", "b"]} />
</CommandItem>
<CommandItem>
<Flex gap={2}>
<CommandIcon>
<InfoCircleIcon />
</CommandIcon>
<Text variant="labelsTitleCase">Settings</Text>
</Flex>
<Kbd value={["meta", "s"]} />
</CommandItem>
</CommandGroup>
</CommandList>
<Separator />
<CommandFooter />
</>
);
};
export const Command: StoryFn = () => {
return (
<CommandComponent>
<CommandContent />
</CommandComponent>
);
};