@a2v2ai/uikit 0.0.38 → 0.0.39

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.
Files changed (183) hide show
  1. package/Alert/Alert.d.ts +13 -0
  2. package/Alert/Alert.js +25 -0
  3. package/AlertDialog/AlertDialog.d.ts +43 -0
  4. package/AlertDialog/AlertDialog.js +71 -0
  5. package/Avatar/Avatar.d.ts +14 -0
  6. package/Avatar/Avatar.js +25 -0
  7. package/Badge/Badge.d.ts +11 -0
  8. package/Badge/Badge.js +23 -0
  9. package/Breadcrumb/Breadcrumb.d.ts +19 -0
  10. package/Breadcrumb/Breadcrumb.js +23 -0
  11. package/Button/Button.d.ts +23 -0
  12. package/Button/Button.js +52 -0
  13. package/Calendar/Calendar.d.ts +20 -0
  14. package/Calendar/Calendar.js +78 -0
  15. package/Card/Card.d.ts +16 -0
  16. package/Card/Card.js +28 -0
  17. package/Carousel/Carousel.d.ts +37 -0
  18. package/Carousel/Carousel.js +132 -0
  19. package/ChatBubble/ChatBubble.d.ts +33 -0
  20. package/ChatBubble/ChatBubble.js +107 -0
  21. package/Checkbox/Checkbox.d.ts +12 -0
  22. package/Checkbox/Checkbox.js +20 -0
  23. package/DataTable/DataTable.d.ts +35 -0
  24. package/DataTable/DataTable.js +51 -0
  25. package/Drawer/Drawer.d.ts +33 -0
  26. package/Drawer/Drawer.js +55 -0
  27. package/DropdownMenu/DropdownMenu.d.ts +27 -0
  28. package/DropdownMenu/DropdownMenu.js +35 -0
  29. package/ErrorMessage/ErrorMessage.d.ts +27 -0
  30. package/ErrorMessage/ErrorMessage.js +14 -0
  31. package/Flex/Flex.d.ts +31 -0
  32. package/Flex/Flex.js +64 -0
  33. package/IconButton/IconButton.d.ts +23 -0
  34. package/IconButton/IconButton.js +48 -0
  35. package/Input/Input.d.ts +27 -0
  36. package/Input/Input.js +42 -0
  37. package/InputOTP/InputOTP.d.ts +20 -0
  38. package/InputOTP/InputOTP.js +44 -0
  39. package/Label/Label.d.ts +13 -0
  40. package/Label/Label.js +19 -0
  41. package/Loader/Loader.d.ts +21 -0
  42. package/Loader/Loader.js +30 -0
  43. package/Menubar/Menubar.d.ts +26 -0
  44. package/Menubar/Menubar.js +54 -0
  45. package/Menubar/index.d.ts +1 -0
  46. package/Menubar/index.js +1 -0
  47. package/Pagination/Pagination.d.ts +35 -0
  48. package/Pagination/Pagination.js +37 -0
  49. package/Popover/Popover.d.ts +7 -0
  50. package/Popover/Popover.js +10 -0
  51. package/Progress/Progress.d.ts +17 -0
  52. package/Progress/Progress.js +33 -0
  53. package/RadioGroup/RadioGroup.d.ts +13 -0
  54. package/RadioGroup/RadioGroup.js +26 -0
  55. package/ScrollArea/ScrollArea.d.ts +5 -0
  56. package/ScrollArea/ScrollArea.js +11 -0
  57. package/Select/Select.d.ts +29 -0
  58. package/Select/Select.js +50 -0
  59. package/Separator/Separator.d.ts +4 -0
  60. package/Separator/Separator.js +7 -0
  61. package/Sidebar/Sidebar.d.ts +48 -0
  62. package/Sidebar/Sidebar.js +116 -0
  63. package/Sidebar/index.d.ts +2 -0
  64. package/Sidebar/index.js +1 -0
  65. package/Skeleton/Skeleton.d.ts +4 -0
  66. package/Skeleton/Skeleton.js +7 -0
  67. package/Slider/Slider.d.ts +6 -0
  68. package/Slider/Slider.js +7 -0
  69. package/Spinner/Spinner.d.ts +19 -0
  70. package/Spinner/Spinner.js +31 -0
  71. package/Switch/Switch.d.ts +12 -0
  72. package/Switch/Switch.js +30 -0
  73. package/Table/Table.d.ts +10 -0
  74. package/Table/Table.js +20 -0
  75. package/Tabs/Tabs.d.ts +15 -0
  76. package/Tabs/Tabs.js +24 -0
  77. package/Textarea/Textarea.d.ts +19 -0
  78. package/Textarea/Textarea.js +31 -0
  79. package/Toast/Toast.d.ts +12 -0
  80. package/Toast/Toast.js +25 -0
  81. package/Tooltip/Tooltip.d.ts +17 -0
  82. package/Tooltip/Tooltip.js +29 -0
  83. package/Typography/Typography.d.ts +20 -0
  84. package/Typography/Typography.js +71 -0
  85. package/helpers.d.ts +4 -0
  86. package/helpers.js +5 -0
  87. package/icons.d.ts +1 -0
  88. package/{icons.ts → icons.js} +1 -1
  89. package/index.css +68 -0
  90. package/index.d.ts +42 -0
  91. package/index.js +45 -0
  92. package/lib/typography-types.d.ts +4 -0
  93. package/lib/typography-types.js +118 -0
  94. package/lib/utils.d.ts +3 -0
  95. package/lib/utils.js +14 -0
  96. package/package.json +1 -1
  97. package/Alert/Alert.stories.tsx +0 -121
  98. package/Alert/Alert.tsx +0 -71
  99. package/AlertDialog/AlertDialog.stories.tsx +0 -665
  100. package/AlertDialog/AlertDialog.tsx +0 -241
  101. package/Avatar/Avatar.stories.tsx +0 -128
  102. package/Avatar/Avatar.tsx +0 -71
  103. package/Badge/Badge.stories.tsx +0 -76
  104. package/Badge/Badge.tsx +0 -39
  105. package/Breadcrumb/Breadcrumb.stories.tsx +0 -231
  106. package/Breadcrumb/Breadcrumb.tsx +0 -114
  107. package/Button/Button.stories.tsx +0 -684
  108. package/Button/Button.tsx +0 -107
  109. package/Calendar/Calendar.stories.tsx +0 -291
  110. package/Calendar/Calendar.tsx +0 -246
  111. package/Card/Card.stories.tsx +0 -136
  112. package/Card/Card.tsx +0 -96
  113. package/Carousel/Carousel.stories.tsx +0 -256
  114. package/Carousel/Carousel.tsx +0 -301
  115. package/ChatBubble/ChatBubble.stories.tsx +0 -339
  116. package/ChatBubble/ChatBubble.tsx +0 -179
  117. package/Checkbox/Checkbox.stories.tsx +0 -137
  118. package/Checkbox/Checkbox.tsx +0 -53
  119. package/DataTable/DataTable.stories.tsx +0 -400
  120. package/DataTable/DataTable.tsx +0 -207
  121. package/Drawer/Drawer.stories.tsx +0 -721
  122. package/Drawer/Drawer.tsx +0 -201
  123. package/DropdownMenu/DropdownMenu.stories.tsx +0 -251
  124. package/DropdownMenu/DropdownMenu.tsx +0 -199
  125. package/ErrorMessage/ErrorMessage.stories.tsx +0 -159
  126. package/ErrorMessage/ErrorMessage.tsx +0 -55
  127. package/Flex/Flex.stories.tsx +0 -390
  128. package/Flex/Flex.tsx +0 -102
  129. package/IconButton/IconButton.stories.tsx +0 -566
  130. package/IconButton/IconButton.tsx +0 -95
  131. package/Input/Input.stories.tsx +0 -566
  132. package/Input/Input.tsx +0 -168
  133. package/InputOTP/InputOTP.stories.tsx +0 -246
  134. package/InputOTP/InputOTP.tsx +0 -127
  135. package/Label/Label.stories.tsx +0 -110
  136. package/Label/Label.tsx +0 -44
  137. package/Loader/Loader.stories.tsx +0 -170
  138. package/Loader/Loader.tsx +0 -62
  139. package/Menubar/Menubar.stories.tsx +0 -382
  140. package/Menubar/Menubar.tsx +0 -274
  141. package/Menubar/index.ts +0 -18
  142. package/Pagination/Pagination.stories.tsx +0 -196
  143. package/Pagination/Pagination.tsx +0 -122
  144. package/Popover/Popover.stories.tsx +0 -133
  145. package/Popover/Popover.tsx +0 -31
  146. package/Progress/Progress.stories.tsx +0 -146
  147. package/Progress/Progress.tsx +0 -67
  148. package/RadioGroup/RadioGroup.stories.tsx +0 -159
  149. package/RadioGroup/RadioGroup.tsx +0 -68
  150. package/ScrollArea/ScrollArea.stories.tsx +0 -136
  151. package/ScrollArea/ScrollArea.tsx +0 -46
  152. package/Select/Select.stories.tsx +0 -378
  153. package/Select/Select.tsx +0 -230
  154. package/Separator/Separator.stories.tsx +0 -110
  155. package/Separator/Separator.tsx +0 -29
  156. package/Sidebar/Sidebar.stories.tsx +0 -340
  157. package/Sidebar/Sidebar.tsx +0 -414
  158. package/Sidebar/index.ts +0 -28
  159. package/Skeleton/Skeleton.stories.tsx +0 -117
  160. package/Skeleton/Skeleton.tsx +0 -16
  161. package/Slider/Slider.stories.tsx +0 -216
  162. package/Slider/Slider.tsx +0 -29
  163. package/Spinner/Spinner.stories.tsx +0 -210
  164. package/Spinner/Spinner.tsx +0 -78
  165. package/Switch/Switch.stories.tsx +0 -146
  166. package/Switch/Switch.tsx +0 -59
  167. package/Table/Table.stories.tsx +0 -510
  168. package/Table/Table.tsx +0 -114
  169. package/Tabs/Tabs.stories.tsx +0 -197
  170. package/Tabs/Tabs.tsx +0 -74
  171. package/Textarea/Textarea.stories.tsx +0 -187
  172. package/Textarea/Textarea.tsx +0 -73
  173. package/Toast/Toast.stories.tsx +0 -285
  174. package/Toast/Toast.tsx +0 -59
  175. package/Tooltip/Tooltip.stories.tsx +0 -463
  176. package/Tooltip/Tooltip.tsx +0 -96
  177. package/Typography/Typography.stories.tsx +0 -425
  178. package/Typography/Typography.tsx +0 -106
  179. package/helpers.ts +0 -5
  180. package/index.ts +0 -217
  181. package/lib/typography-types.ts +0 -223
  182. package/lib/utils.ts +0 -15
  183. package/tsconfig.json +0 -22
package/Drawer/Drawer.tsx DELETED
@@ -1,201 +0,0 @@
1
- import * as React from "react"
2
- import { Drawer as DrawerPrimitive } from "vaul"
3
- import { cva } from "class-variance-authority"
4
-
5
- import { Loader } from "../Loader/Loader"
6
- import { cn } from "../lib/utils"
7
-
8
- type DrawerDirection = "bottom" | "top" | "left" | "right"
9
-
10
- const drawerContentVariants = cva(
11
- "group/drawer-content fixed z-50 flex h-auto flex-col bg-white",
12
- {
13
- variants: {
14
- direction: {
15
- bottom: "inset-x-0 bottom-0 mt-24 max-h-[80vh] rounded-t-[10px]",
16
- top: "inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-[10px]",
17
- left: "inset-y-0 left-0 w-3/4 sm:max-w-sm rounded-r-[10px]",
18
- right: "inset-y-0 right-0 w-3/4 sm:max-w-sm rounded-l-[10px]",
19
- },
20
- },
21
- defaultVariants: {
22
- direction: "bottom",
23
- },
24
- }
25
- )
26
-
27
- const drawerOverlayVariants = cva(
28
- "fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
29
- )
30
-
31
- export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {
32
- /** Direction the drawer slides in from */
33
- direction?: DrawerDirection
34
- /** Whether clicking outside or dragging down dismisses the drawer */
35
- dismissible?: boolean
36
- }
37
-
38
- export type DrawerContentProps = Omit<
39
- React.ComponentProps<typeof DrawerPrimitive.Content>,
40
- "direction"
41
- > & {
42
- direction?: DrawerDirection
43
- /** Whether to show the drag handle */
44
- showHandle?: boolean
45
- /** Whether the drawer content is in a loading state */
46
- loading?: boolean
47
- }
48
-
49
- function Drawer({
50
- direction = "bottom",
51
- dismissible = true,
52
- ...props
53
- }: DrawerProps) {
54
- return (
55
- <DrawerPrimitive.Root
56
- direction={direction}
57
- dismissible={dismissible}
58
- {...props}
59
- />
60
- )
61
- }
62
-
63
- function DrawerTrigger({
64
- ...props
65
- }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
66
- return <DrawerPrimitive.Trigger {...props} />
67
- }
68
-
69
- function DrawerPortal({
70
- ...props
71
- }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
72
- return <DrawerPrimitive.Portal {...props} />
73
- }
74
-
75
- function DrawerClose({
76
- ...props
77
- }: React.ComponentProps<typeof DrawerPrimitive.Close>) {
78
- return <DrawerPrimitive.Close {...props} />
79
- }
80
-
81
- function DrawerOverlay({
82
- className,
83
- ...props
84
- }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
85
- return (
86
- <DrawerPrimitive.Overlay
87
- className={cn(drawerOverlayVariants(), className)}
88
- {...props}
89
- />
90
- )
91
- }
92
-
93
- function DrawerContent({
94
- className,
95
- children,
96
- direction = "bottom",
97
- showHandle = true,
98
- loading = false,
99
- ...props
100
- }: DrawerContentProps) {
101
- const isVertical = direction === "bottom" || direction === "top"
102
-
103
- return (
104
- <DrawerPortal>
105
- <DrawerOverlay />
106
- <DrawerPrimitive.Content
107
- className={cn(
108
- drawerContentVariants({ direction }),
109
- "shadow-lg",
110
- className
111
- )}
112
- {...props}
113
- >
114
- {showHandle && isVertical && (
115
- <div
116
- className={cn(
117
- "mx-auto shrink-0 rounded-full bg-neutral-200",
118
- direction === "bottom" ? "mt-2 mb-4" : "mb-2 mt-4",
119
- "h-[3px] w-[50px]"
120
- )}
121
- />
122
- )}
123
- {loading ? (
124
- <div className="flex flex-1 items-center justify-center p-8">
125
- <Loader size="large" color="grey" />
126
- </div>
127
- ) : (
128
- children
129
- )}
130
- </DrawerPrimitive.Content>
131
- </DrawerPortal>
132
- )
133
- }
134
-
135
- function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
136
- return (
137
- <div
138
- className={cn("flex flex-col gap-1.5 p-4 text-center sm:text-left", className)}
139
- {...props}
140
- />
141
- )
142
- }
143
-
144
- function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
145
- return (
146
- <div
147
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
148
- {...props}
149
- />
150
- )
151
- }
152
-
153
- function DrawerBody({ className, ...props }: React.ComponentProps<"div">) {
154
- return (
155
- <div
156
- className={cn("flex-1 overflow-auto p-4", className)}
157
- {...props}
158
- />
159
- )
160
- }
161
-
162
- function DrawerTitle({
163
- className,
164
- ...props
165
- }: React.ComponentProps<typeof DrawerPrimitive.Title>) {
166
- return (
167
- <DrawerPrimitive.Title
168
- className={cn("text-lg font-semibold text-neutral-900", className)}
169
- {...props}
170
- />
171
- )
172
- }
173
-
174
- function DrawerDescription({
175
- className,
176
- ...props
177
- }: React.ComponentProps<typeof DrawerPrimitive.Description>) {
178
- return (
179
- <DrawerPrimitive.Description
180
- className={cn("text-sm text-neutral-500", className)}
181
- {...props}
182
- />
183
- )
184
- }
185
-
186
- export {
187
- Drawer,
188
- DrawerPortal,
189
- DrawerOverlay,
190
- DrawerTrigger,
191
- DrawerClose,
192
- DrawerContent,
193
- DrawerHeader,
194
- DrawerFooter,
195
- DrawerBody,
196
- DrawerTitle,
197
- DrawerDescription,
198
- drawerContentVariants,
199
- drawerOverlayVariants,
200
- }
201
- export type { DrawerDirection }
@@ -1,251 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import { Cloud, CreditCard, Github, Keyboard, LifeBuoy, LogOut, Mail, MessageSquare, Plus, PlusCircle, Settings, User, UserPlus, Users } from "../icons"
3
-
4
- import { Button } from "../Button/Button"
5
- import { Flex } from "../Flex/Flex"
6
- import { Typography } from "../Typography/Typography"
7
- import {
8
- DropdownMenu,
9
- DropdownMenuTrigger,
10
- DropdownMenuContent,
11
- DropdownMenuItem,
12
- DropdownMenuCheckboxItem,
13
- DropdownMenuRadioItem,
14
- DropdownMenuLabel,
15
- DropdownMenuSeparator,
16
- DropdownMenuShortcut,
17
- DropdownMenuGroup,
18
- DropdownMenuSub,
19
- DropdownMenuSubContent,
20
- DropdownMenuSubTrigger,
21
- DropdownMenuRadioGroup,
22
- } from "./DropdownMenu"
23
-
24
- const meta: Meta<typeof DropdownMenu> = {
25
- title: "Components/DropdownMenu",
26
- component: DropdownMenu,
27
- parameters: {
28
- layout: "centered",
29
- },
30
- tags: ["autodocs"],
31
- }
32
-
33
- export default meta
34
- type Story = StoryObj<typeof meta>
35
-
36
- export const Default: Story = {
37
- render: () => (
38
- <DropdownMenu>
39
- <DropdownMenuTrigger asChild>
40
- <Button variant="outline">Open Menu</Button>
41
- </DropdownMenuTrigger>
42
- <DropdownMenuContent className="w-56">
43
- <DropdownMenuLabel>My Account</DropdownMenuLabel>
44
- <DropdownMenuSeparator />
45
- <DropdownMenuGroup>
46
- <DropdownMenuItem>
47
- <User />
48
- <span>Profile</span>
49
- <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
50
- </DropdownMenuItem>
51
- <DropdownMenuItem>
52
- <CreditCard />
53
- <span>Billing</span>
54
- <DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
55
- </DropdownMenuItem>
56
- <DropdownMenuItem>
57
- <Settings />
58
- <span>Settings</span>
59
- <DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
60
- </DropdownMenuItem>
61
- <DropdownMenuItem>
62
- <Keyboard />
63
- <span>Keyboard shortcuts</span>
64
- <DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
65
- </DropdownMenuItem>
66
- </DropdownMenuGroup>
67
- <DropdownMenuSeparator />
68
- <DropdownMenuGroup>
69
- <DropdownMenuItem>
70
- <Users />
71
- <span>Team</span>
72
- </DropdownMenuItem>
73
- <DropdownMenuSub>
74
- <DropdownMenuSubTrigger>
75
- <UserPlus />
76
- <span>Invite users</span>
77
- </DropdownMenuSubTrigger>
78
- <DropdownMenuSubContent>
79
- <DropdownMenuItem>
80
- <Mail />
81
- <span>Email</span>
82
- </DropdownMenuItem>
83
- <DropdownMenuItem>
84
- <MessageSquare />
85
- <span>Message</span>
86
- </DropdownMenuItem>
87
- <DropdownMenuSeparator />
88
- <DropdownMenuItem>
89
- <PlusCircle />
90
- <span>More...</span>
91
- </DropdownMenuItem>
92
- </DropdownMenuSubContent>
93
- </DropdownMenuSub>
94
- <DropdownMenuItem>
95
- <Plus />
96
- <span>New Team</span>
97
- <DropdownMenuShortcut>⌘+T</DropdownMenuShortcut>
98
- </DropdownMenuItem>
99
- </DropdownMenuGroup>
100
- <DropdownMenuSeparator />
101
- <DropdownMenuItem>
102
- <Github />
103
- <span>GitHub</span>
104
- </DropdownMenuItem>
105
- <DropdownMenuItem>
106
- <LifeBuoy />
107
- <span>Support</span>
108
- </DropdownMenuItem>
109
- <DropdownMenuItem disabled>
110
- <Cloud />
111
- <span>API</span>
112
- </DropdownMenuItem>
113
- <DropdownMenuSeparator />
114
- <DropdownMenuItem>
115
- <LogOut />
116
- <span>Log out</span>
117
- <DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
118
- </DropdownMenuItem>
119
- </DropdownMenuContent>
120
- </DropdownMenu>
121
- ),
122
- }
123
-
124
- export const WithCheckboxItems: Story = {
125
- render: () => (
126
- <DropdownMenu>
127
- <DropdownMenuTrigger asChild>
128
- <Button variant="outline">Open</Button>
129
- </DropdownMenuTrigger>
130
- <DropdownMenuContent className="w-56">
131
- <DropdownMenuLabel>Appearance</DropdownMenuLabel>
132
- <DropdownMenuSeparator />
133
- <DropdownMenuCheckboxItem checked>
134
- Status Bar
135
- </DropdownMenuCheckboxItem>
136
- <DropdownMenuCheckboxItem checked disabled>
137
- Activity Bar
138
- </DropdownMenuCheckboxItem>
139
- <DropdownMenuCheckboxItem>Panel</DropdownMenuCheckboxItem>
140
- </DropdownMenuContent>
141
- </DropdownMenu>
142
- ),
143
- }
144
-
145
- export const WithRadioItems: Story = {
146
- render: () => (
147
- <DropdownMenu>
148
- <DropdownMenuTrigger asChild>
149
- <Button variant="outline">Open</Button>
150
- </DropdownMenuTrigger>
151
- <DropdownMenuContent className="w-56">
152
- <DropdownMenuLabel>Panel Position</DropdownMenuLabel>
153
- <DropdownMenuSeparator />
154
- <DropdownMenuRadioGroup value="bottom">
155
- <DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
156
- <DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
157
- <DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
158
- </DropdownMenuRadioGroup>
159
- </DropdownMenuContent>
160
- </DropdownMenu>
161
- ),
162
- }
163
-
164
- export const Simple: Story = {
165
- render: () => (
166
- <DropdownMenu>
167
- <DropdownMenuTrigger asChild>
168
- <Button variant="outline">Actions</Button>
169
- </DropdownMenuTrigger>
170
- <DropdownMenuContent>
171
- <DropdownMenuItem>Edit</DropdownMenuItem>
172
- <DropdownMenuItem>Duplicate</DropdownMenuItem>
173
- <DropdownMenuSeparator />
174
- <DropdownMenuItem className="text-error-600">Delete</DropdownMenuItem>
175
- </DropdownMenuContent>
176
- </DropdownMenu>
177
- ),
178
- }
179
-
180
- export const AllVariants: Story = {
181
- render: () => (
182
- <Flex gap={6}>
183
- <Typography variant="h4" className="text-white">Dropdown Menu Examples</Typography>
184
-
185
- <Flex direction="row" gap={4}>
186
- <DropdownMenu>
187
- <DropdownMenuTrigger asChild>
188
- <Button variant="outline">Simple Menu</Button>
189
- </DropdownMenuTrigger>
190
- <DropdownMenuContent>
191
- <DropdownMenuItem>New File</DropdownMenuItem>
192
- <DropdownMenuItem>Open</DropdownMenuItem>
193
- <DropdownMenuItem>Save</DropdownMenuItem>
194
- <DropdownMenuSeparator />
195
- <DropdownMenuItem>Exit</DropdownMenuItem>
196
- </DropdownMenuContent>
197
- </DropdownMenu>
198
-
199
- <DropdownMenu>
200
- <DropdownMenuTrigger asChild>
201
- <Button variant="outline">With Icons</Button>
202
- </DropdownMenuTrigger>
203
- <DropdownMenuContent className="w-48">
204
- <DropdownMenuItem>
205
- <User />
206
- <span>Profile</span>
207
- </DropdownMenuItem>
208
- <DropdownMenuItem>
209
- <Settings />
210
- <span>Settings</span>
211
- </DropdownMenuItem>
212
- <DropdownMenuSeparator />
213
- <DropdownMenuItem>
214
- <LogOut />
215
- <span>Log out</span>
216
- </DropdownMenuItem>
217
- </DropdownMenuContent>
218
- </DropdownMenu>
219
-
220
- <DropdownMenu>
221
- <DropdownMenuTrigger asChild>
222
- <Button variant="outline">With Shortcuts</Button>
223
- </DropdownMenuTrigger>
224
- <DropdownMenuContent className="w-48">
225
- <DropdownMenuItem>
226
- <span>Undo</span>
227
- <DropdownMenuShortcut>⌘Z</DropdownMenuShortcut>
228
- </DropdownMenuItem>
229
- <DropdownMenuItem>
230
- <span>Redo</span>
231
- <DropdownMenuShortcut>⇧⌘Z</DropdownMenuShortcut>
232
- </DropdownMenuItem>
233
- <DropdownMenuSeparator />
234
- <DropdownMenuItem>
235
- <span>Cut</span>
236
- <DropdownMenuShortcut>⌘X</DropdownMenuShortcut>
237
- </DropdownMenuItem>
238
- <DropdownMenuItem>
239
- <span>Copy</span>
240
- <DropdownMenuShortcut>⌘C</DropdownMenuShortcut>
241
- </DropdownMenuItem>
242
- <DropdownMenuItem>
243
- <span>Paste</span>
244
- <DropdownMenuShortcut>⌘V</DropdownMenuShortcut>
245
- </DropdownMenuItem>
246
- </DropdownMenuContent>
247
- </DropdownMenu>
248
- </Flex>
249
- </Flex>
250
- ),
251
- }
@@ -1,199 +0,0 @@
1
- import * as React from "react"
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
- import { Check, ChevronRight, Circle } from "lucide-react"
4
-
5
- import { cn } from "../lib/utils"
6
-
7
- const DropdownMenu = DropdownMenuPrimitive.Root
8
-
9
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10
-
11
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
12
-
13
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
14
-
15
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
16
-
17
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
18
-
19
- const DropdownMenuSubTrigger = React.forwardRef<
20
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
- inset?: boolean
23
- }
24
- >(({ className, inset, children, ...props }, ref) => (
25
- <DropdownMenuPrimitive.SubTrigger
26
- ref={ref}
27
- className={cn(
28
- "flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-grey-100 data-[state=open]:bg-grey-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
29
- inset && "pl-8",
30
- className
31
- )}
32
- {...props}
33
- >
34
- {children}
35
- <ChevronRight className="ml-auto" />
36
- </DropdownMenuPrimitive.SubTrigger>
37
- ))
38
- DropdownMenuSubTrigger.displayName =
39
- DropdownMenuPrimitive.SubTrigger.displayName
40
-
41
- const DropdownMenuSubContent = React.forwardRef<
42
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
- >(({ className, ...props }, ref) => (
45
- <DropdownMenuPrimitive.SubContent
46
- ref={ref}
47
- className={cn(
48
- "z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 text-main-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
49
- className
50
- )}
51
- {...props}
52
- />
53
- ))
54
- DropdownMenuSubContent.displayName =
55
- DropdownMenuPrimitive.SubContent.displayName
56
-
57
- const DropdownMenuContent = React.forwardRef<
58
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
- >(({ className, sideOffset = 4, ...props }, ref) => (
61
- <DropdownMenuPrimitive.Portal>
62
- <DropdownMenuPrimitive.Content
63
- ref={ref}
64
- sideOffset={sideOffset}
65
- className={cn(
66
- "z-50 min-w-[8rem] overflow-hidden rounded-lg border border-grey-200 bg-white p-1 text-main-950 shadow-md",
67
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
68
- className
69
- )}
70
- {...props}
71
- />
72
- </DropdownMenuPrimitive.Portal>
73
- ))
74
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
75
-
76
- const DropdownMenuItem = React.forwardRef<
77
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
78
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
79
- inset?: boolean
80
- }
81
- >(({ className, inset, ...props }, ref) => (
82
- <DropdownMenuPrimitive.Item
83
- ref={ref}
84
- className={cn(
85
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
86
- inset && "pl-8",
87
- className
88
- )}
89
- {...props}
90
- />
91
- ))
92
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
93
-
94
- const DropdownMenuCheckboxItem = React.forwardRef<
95
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
96
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
97
- >(({ className, children, checked, ...props }, ref) => (
98
- <DropdownMenuPrimitive.CheckboxItem
99
- ref={ref}
100
- className={cn(
101
- "relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
102
- className
103
- )}
104
- checked={checked}
105
- {...props}
106
- >
107
- <span className="absolute left-2 flex size-3.5 items-center justify-center">
108
- <DropdownMenuPrimitive.ItemIndicator>
109
- <Check className="size-4" />
110
- </DropdownMenuPrimitive.ItemIndicator>
111
- </span>
112
- {children}
113
- </DropdownMenuPrimitive.CheckboxItem>
114
- ))
115
- DropdownMenuCheckboxItem.displayName =
116
- DropdownMenuPrimitive.CheckboxItem.displayName
117
-
118
- const DropdownMenuRadioItem = React.forwardRef<
119
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
120
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
121
- >(({ className, children, ...props }, ref) => (
122
- <DropdownMenuPrimitive.RadioItem
123
- ref={ref}
124
- className={cn(
125
- "relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-grey-100 focus:text-main-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
126
- className
127
- )}
128
- {...props}
129
- >
130
- <span className="absolute left-2 flex size-3.5 items-center justify-center">
131
- <DropdownMenuPrimitive.ItemIndicator>
132
- <Circle className="size-2 fill-current" />
133
- </DropdownMenuPrimitive.ItemIndicator>
134
- </span>
135
- {children}
136
- </DropdownMenuPrimitive.RadioItem>
137
- ))
138
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
139
-
140
- const DropdownMenuLabel = React.forwardRef<
141
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
142
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
143
- inset?: boolean
144
- }
145
- >(({ className, inset, ...props }, ref) => (
146
- <DropdownMenuPrimitive.Label
147
- ref={ref}
148
- className={cn(
149
- "px-2 py-1.5 text-sm font-semibold text-main-950",
150
- inset && "pl-8",
151
- className
152
- )}
153
- {...props}
154
- />
155
- ))
156
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
157
-
158
- const DropdownMenuSeparator = React.forwardRef<
159
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
160
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
161
- >(({ className, ...props }, ref) => (
162
- <DropdownMenuPrimitive.Separator
163
- ref={ref}
164
- className={cn("-mx-1 my-1 h-px bg-grey-100", className)}
165
- {...props}
166
- />
167
- ))
168
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
169
-
170
- const DropdownMenuShortcut = ({
171
- className,
172
- ...props
173
- }: React.HTMLAttributes<HTMLSpanElement>) => {
174
- return (
175
- <span
176
- className={cn("ml-auto text-xs tracking-widest text-grey-400", className)}
177
- {...props}
178
- />
179
- )
180
- }
181
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
182
-
183
- export {
184
- DropdownMenu,
185
- DropdownMenuTrigger,
186
- DropdownMenuContent,
187
- DropdownMenuItem,
188
- DropdownMenuCheckboxItem,
189
- DropdownMenuRadioItem,
190
- DropdownMenuLabel,
191
- DropdownMenuSeparator,
192
- DropdownMenuShortcut,
193
- DropdownMenuGroup,
194
- DropdownMenuPortal,
195
- DropdownMenuSub,
196
- DropdownMenuSubContent,
197
- DropdownMenuSubTrigger,
198
- DropdownMenuRadioGroup,
199
- }