ui-arreya-components 0.0.16 → 0.1.2

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 (109) hide show
  1. package/dist/index.d.mts +342 -0
  2. package/dist/index.d.ts +342 -0
  3. package/dist/index.js +1682 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +1495 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +61 -106
  8. package/.github/workflows/npm-publish.yml +0 -35
  9. package/.storybook/main.ts +0 -18
  10. package/.storybook/preview.ts +0 -16
  11. package/.storybook/vitest.setup.ts +0 -9
  12. package/README.md +0 -62
  13. package/components.json +0 -21
  14. package/dist/styles.css +0 -3
  15. package/dist/ui.cjs.js +0 -242
  16. package/dist/ui.es.js +0 -25142
  17. package/dist/ui.umd.js +0 -242
  18. package/eslint.config.js +0 -28
  19. package/postcss.config.js +0 -6
  20. package/scripts/build-index-ts.sh +0 -16
  21. package/scripts/template.sh +0 -57
  22. package/src/components/feature/graph-card.stories.tsx +0 -138
  23. package/src/components/feature/graph-card.tsx +0 -113
  24. package/src/components/feature/header.stories.tsx +0 -129
  25. package/src/components/feature/header.tsx +0 -78
  26. package/src/components/feature/login-form.stories.tsx +0 -35
  27. package/src/components/feature/login-form.tsx +0 -97
  28. package/src/components/feature/search-bar.stories.tsx +0 -35
  29. package/src/components/feature/search-bar.tsx +0 -141
  30. package/src/components/feature/wizard.stories.tsx +0 -199
  31. package/src/components/feature/wizard.tsx +0 -278
  32. package/src/components/ui/accordion.stories.tsx.disabled +0 -36
  33. package/src/components/ui/accordion.tsx +0 -55
  34. package/src/components/ui/alert-dialog.stories.tsx +0 -46
  35. package/src/components/ui/alert-dialog.tsx +0 -139
  36. package/src/components/ui/alert.stories.tsx +0 -45
  37. package/src/components/ui/alert.tsx +0 -59
  38. package/src/components/ui/aspect-ratio.stories.tsx +0 -24
  39. package/src/components/ui/aspect-ratio.tsx +0 -5
  40. package/src/components/ui/avatar.stories.tsx +0 -29
  41. package/src/components/ui/avatar.tsx +0 -48
  42. package/src/components/ui/badge.stories.tsx +0 -43
  43. package/src/components/ui/badge.tsx +0 -36
  44. package/src/components/ui/breadcrumb.stories.tsx +0 -146
  45. package/src/components/ui/breadcrumb.tsx +0 -115
  46. package/src/components/ui/button.stories.tsx +0 -87
  47. package/src/components/ui/button.tsx +0 -57
  48. package/src/components/ui/card.stories.tsx +0 -99
  49. package/src/components/ui/card.tsx +0 -76
  50. package/src/components/ui/carousel.stories.tsx +0 -47
  51. package/src/components/ui/carousel.tsx +0 -260
  52. package/src/components/ui/chart.stories.tsx.disabled +0 -44
  53. package/src/components/ui/chart.tsx +0 -363
  54. package/src/components/ui/checkbox.stories.tsx +0 -56
  55. package/src/components/ui/checkbox.tsx +0 -28
  56. package/src/components/ui/collapsible.stories.tsx +0 -58
  57. package/src/components/ui/collapsible.tsx +0 -9
  58. package/src/components/ui/context-menu.stories.tsx +0 -34
  59. package/src/components/ui/context-menu.tsx +0 -198
  60. package/src/components/ui/dialog.stories.tsx +0 -40
  61. package/src/components/ui/dialog.tsx +0 -120
  62. package/src/components/ui/drawer.stories.tsx +0 -48
  63. package/src/components/ui/drawer.tsx +0 -116
  64. package/src/components/ui/dropdown-menu.stories.tsx +0 -92
  65. package/src/components/ui/dropdown-menu.tsx +0 -199
  66. package/src/components/ui/form.tsx +0 -176
  67. package/src/components/ui/hover-card.stories.tsx +0 -31
  68. package/src/components/ui/hover-card.tsx +0 -27
  69. package/src/components/ui/input-otp.tsx +0 -69
  70. package/src/components/ui/input.stories.tsx +0 -63
  71. package/src/components/ui/input.tsx +0 -22
  72. package/src/components/ui/label.tsx +0 -24
  73. package/src/components/ui/menubar.tsx +0 -254
  74. package/src/components/ui/navigation-menu.tsx +0 -128
  75. package/src/components/ui/pagination.tsx +0 -117
  76. package/src/components/ui/popover.tsx +0 -31
  77. package/src/components/ui/progress.tsx +0 -26
  78. package/src/components/ui/radio-group.tsx +0 -42
  79. package/src/components/ui/resizable.tsx +0 -43
  80. package/src/components/ui/scroll-area.tsx +0 -46
  81. package/src/components/ui/select.tsx +0 -157
  82. package/src/components/ui/separator.tsx +0 -29
  83. package/src/components/ui/sheet.tsx +0 -138
  84. package/src/components/ui/sidebar.tsx +0 -771
  85. package/src/components/ui/skeleton.tsx +0 -15
  86. package/src/components/ui/slider.tsx +0 -26
  87. package/src/components/ui/sonner.tsx +0 -29
  88. package/src/components/ui/switch.tsx +0 -27
  89. package/src/components/ui/table.tsx +0 -120
  90. package/src/components/ui/tabs.tsx +0 -53
  91. package/src/components/ui/textarea.tsx +0 -22
  92. package/src/components/ui/toast.tsx +0 -127
  93. package/src/components/ui/toaster.tsx +0 -33
  94. package/src/components/ui/toggle-group.tsx +0 -59
  95. package/src/components/ui/toggle.tsx +0 -43
  96. package/src/components/ui/tooltip.tsx +0 -30
  97. package/src/hooks/use-mobile.tsx +0 -19
  98. package/src/hooks/use-toast.ts +0 -194
  99. package/src/index.css +0 -3633
  100. package/src/index.ts +0 -51
  101. package/src/lib/types.ts +0 -5
  102. package/src/lib/utils.ts +0 -6
  103. package/src/styles/tailwind.css +0 -100
  104. package/tailwind.config.js +0 -94
  105. package/tsconfig.app.json +0 -30
  106. package/tsconfig.json +0 -13
  107. package/tsconfig.node.json +0 -24
  108. package/vite.config.ts +0 -33
  109. package/vitest.workspace.ts +0 -32
@@ -1,198 +0,0 @@
1
- import * as React from "react"
2
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
3
- import { Check, ChevronRight, Circle } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const ContextMenu = ContextMenuPrimitive.Root
8
-
9
- const ContextMenuTrigger = ContextMenuPrimitive.Trigger
10
-
11
- const ContextMenuGroup = ContextMenuPrimitive.Group
12
-
13
- const ContextMenuPortal = ContextMenuPrimitive.Portal
14
-
15
- const ContextMenuSub = ContextMenuPrimitive.Sub
16
-
17
- const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
18
-
19
- const ContextMenuSubTrigger = React.forwardRef<
20
- React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
21
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
22
- inset?: boolean
23
- }
24
- >(({ className, inset, children, ...props }, ref) => (
25
- <ContextMenuPrimitive.SubTrigger
26
- ref={ref}
27
- className={cn(
28
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
29
- inset && "pl-8",
30
- className
31
- )}
32
- {...props}
33
- >
34
- {children}
35
- <ChevronRight className="ml-auto h-4 w-4" />
36
- </ContextMenuPrimitive.SubTrigger>
37
- ))
38
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
39
-
40
- const ContextMenuSubContent = React.forwardRef<
41
- React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
42
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
43
- >(({ className, ...props }, ref) => (
44
- <ContextMenuPrimitive.SubContent
45
- ref={ref}
46
- className={cn(
47
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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 origin-[--radix-context-menu-content-transform-origin]",
48
- className
49
- )}
50
- {...props}
51
- />
52
- ))
53
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
54
-
55
- const ContextMenuContent = React.forwardRef<
56
- React.ElementRef<typeof ContextMenuPrimitive.Content>,
57
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
58
- >(({ className, ...props }, ref) => (
59
- <ContextMenuPrimitive.Portal>
60
- <ContextMenuPrimitive.Content
61
- ref={ref}
62
- className={cn(
63
- "z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-context-menu-content-transform-origin]",
64
- className
65
- )}
66
- {...props}
67
- />
68
- </ContextMenuPrimitive.Portal>
69
- ))
70
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
71
-
72
- const ContextMenuItem = React.forwardRef<
73
- React.ElementRef<typeof ContextMenuPrimitive.Item>,
74
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
75
- inset?: boolean
76
- }
77
- >(({ className, inset, ...props }, ref) => (
78
- <ContextMenuPrimitive.Item
79
- ref={ref}
80
- className={cn(
81
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
82
- inset && "pl-8",
83
- className
84
- )}
85
- {...props}
86
- />
87
- ))
88
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
89
-
90
- const ContextMenuCheckboxItem = React.forwardRef<
91
- React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
92
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
93
- >(({ className, children, checked, ...props }, ref) => (
94
- <ContextMenuPrimitive.CheckboxItem
95
- ref={ref}
96
- className={cn(
97
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
98
- className
99
- )}
100
- checked={checked}
101
- {...props}
102
- >
103
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
104
- <ContextMenuPrimitive.ItemIndicator>
105
- <Check className="h-4 w-4" />
106
- </ContextMenuPrimitive.ItemIndicator>
107
- </span>
108
- {children}
109
- </ContextMenuPrimitive.CheckboxItem>
110
- ))
111
- ContextMenuCheckboxItem.displayName =
112
- ContextMenuPrimitive.CheckboxItem.displayName
113
-
114
- const ContextMenuRadioItem = React.forwardRef<
115
- React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
116
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
117
- >(({ className, children, ...props }, ref) => (
118
- <ContextMenuPrimitive.RadioItem
119
- ref={ref}
120
- className={cn(
121
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
122
- className
123
- )}
124
- {...props}
125
- >
126
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
127
- <ContextMenuPrimitive.ItemIndicator>
128
- <Circle className="h-4 w-4 fill-current" />
129
- </ContextMenuPrimitive.ItemIndicator>
130
- </span>
131
- {children}
132
- </ContextMenuPrimitive.RadioItem>
133
- ))
134
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
135
-
136
- const ContextMenuLabel = React.forwardRef<
137
- React.ElementRef<typeof ContextMenuPrimitive.Label>,
138
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
139
- inset?: boolean
140
- }
141
- >(({ className, inset, ...props }, ref) => (
142
- <ContextMenuPrimitive.Label
143
- ref={ref}
144
- className={cn(
145
- "px-2 py-1.5 text-sm font-semibold text-foreground",
146
- inset && "pl-8",
147
- className
148
- )}
149
- {...props}
150
- />
151
- ))
152
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
153
-
154
- const ContextMenuSeparator = React.forwardRef<
155
- React.ElementRef<typeof ContextMenuPrimitive.Separator>,
156
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
157
- >(({ className, ...props }, ref) => (
158
- <ContextMenuPrimitive.Separator
159
- ref={ref}
160
- className={cn("-mx-1 my-1 h-px bg-border", className)}
161
- {...props}
162
- />
163
- ))
164
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
165
-
166
- const ContextMenuShortcut = ({
167
- className,
168
- ...props
169
- }: React.HTMLAttributes<HTMLSpanElement>) => {
170
- return (
171
- <span
172
- className={cn(
173
- "ml-auto text-xs tracking-widest text-muted-foreground",
174
- className
175
- )}
176
- {...props}
177
- />
178
- )
179
- }
180
- ContextMenuShortcut.displayName = "ContextMenuShortcut"
181
-
182
- export {
183
- ContextMenu,
184
- ContextMenuTrigger,
185
- ContextMenuContent,
186
- ContextMenuItem,
187
- ContextMenuCheckboxItem,
188
- ContextMenuRadioItem,
189
- ContextMenuLabel,
190
- ContextMenuSeparator,
191
- ContextMenuShortcut,
192
- ContextMenuGroup,
193
- ContextMenuPortal,
194
- ContextMenuSub,
195
- ContextMenuSubContent,
196
- ContextMenuSubTrigger,
197
- ContextMenuRadioGroup,
198
- }
@@ -1,40 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react"
2
-
3
- import {
4
- Dialog,
5
- DialogTrigger,
6
- DialogContent,
7
- DialogHeader,
8
- DialogTitle,
9
- DialogDescription,
10
- } from "./dialog"
11
-
12
- const meta = {
13
- title: "Components/Dialog",
14
- component: Dialog,
15
- parameters: {
16
- layout: "centered",
17
- },
18
- tags: ["autodocs"],
19
- } satisfies Meta<typeof Dialog>
20
-
21
- export default meta
22
- type Story = StoryObj<typeof meta>
23
-
24
- export const Default: Story = {
25
- render: () => (
26
- <Dialog>
27
- <DialogTrigger>Open</DialogTrigger>
28
- <DialogContent>
29
- <DialogHeader>
30
- <DialogTitle>Are you absolutely sure?</DialogTitle>
31
- <DialogDescription>
32
- This action cannot be undone. This will permanently delete your account
33
- and remove your data from our servers.
34
- </DialogDescription>
35
- </DialogHeader>
36
- </DialogContent>
37
- </Dialog>
38
- )
39
- }
40
-
@@ -1,120 +0,0 @@
1
- import * as React from "react"
2
- import * as DialogPrimitive from "@radix-ui/react-dialog"
3
- import { X } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Dialog = DialogPrimitive.Root
8
-
9
- const DialogTrigger = DialogPrimitive.Trigger
10
-
11
- const DialogPortal = DialogPrimitive.Portal
12
-
13
- const DialogClose = DialogPrimitive.Close
14
-
15
- const DialogOverlay = React.forwardRef<
16
- React.ElementRef<typeof DialogPrimitive.Overlay>,
17
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18
- >(({ className, ...props }, ref) => (
19
- <DialogPrimitive.Overlay
20
- ref={ref}
21
- className={cn(
22
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ))
28
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
29
-
30
- const DialogContent = React.forwardRef<
31
- React.ElementRef<typeof DialogPrimitive.Content>,
32
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33
- >(({ className, children, ...props }, ref) => (
34
- <DialogPortal>
35
- <DialogOverlay />
36
- <DialogPrimitive.Content
37
- ref={ref}
38
- className={cn(
39
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40
- className
41
- )}
42
- {...props}
43
- >
44
- {children}
45
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
46
- <X className="h-4 w-4" />
47
- <span className="sr-only">Close</span>
48
- </DialogPrimitive.Close>
49
- </DialogPrimitive.Content>
50
- </DialogPortal>
51
- ))
52
- DialogContent.displayName = DialogPrimitive.Content.displayName
53
-
54
- const DialogHeader = ({
55
- className,
56
- ...props
57
- }: React.HTMLAttributes<HTMLDivElement>) => (
58
- <div
59
- className={cn(
60
- "flex flex-col space-y-1.5 text-center sm:text-left",
61
- className
62
- )}
63
- {...props}
64
- />
65
- )
66
- DialogHeader.displayName = "DialogHeader"
67
-
68
- const DialogFooter = ({
69
- className,
70
- ...props
71
- }: React.HTMLAttributes<HTMLDivElement>) => (
72
- <div
73
- className={cn(
74
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
75
- className
76
- )}
77
- {...props}
78
- />
79
- )
80
- DialogFooter.displayName = "DialogFooter"
81
-
82
- const DialogTitle = React.forwardRef<
83
- React.ElementRef<typeof DialogPrimitive.Title>,
84
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
85
- >(({ className, ...props }, ref) => (
86
- <DialogPrimitive.Title
87
- ref={ref}
88
- className={cn(
89
- "text-lg font-semibold leading-none tracking-tight",
90
- className
91
- )}
92
- {...props}
93
- />
94
- ))
95
- DialogTitle.displayName = DialogPrimitive.Title.displayName
96
-
97
- const DialogDescription = React.forwardRef<
98
- React.ElementRef<typeof DialogPrimitive.Description>,
99
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
100
- >(({ className, ...props }, ref) => (
101
- <DialogPrimitive.Description
102
- ref={ref}
103
- className={cn("text-sm text-muted-foreground", className)}
104
- {...props}
105
- />
106
- ))
107
- DialogDescription.displayName = DialogPrimitive.Description.displayName
108
-
109
- export {
110
- Dialog,
111
- DialogPortal,
112
- DialogOverlay,
113
- DialogTrigger,
114
- DialogClose,
115
- DialogContent,
116
- DialogHeader,
117
- DialogFooter,
118
- DialogTitle,
119
- DialogDescription,
120
- }
@@ -1,48 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react"
2
-
3
- import {
4
- Drawer,
5
- DrawerClose,
6
- DrawerContent,
7
- DrawerDescription,
8
- DrawerFooter,
9
- DrawerHeader,
10
- DrawerTitle,
11
- DrawerTrigger,
12
- } from "./drawer"
13
- import {
14
- Button
15
- } from './button'
16
-
17
- const meta = {
18
- title: "Components/Drawer",
19
- component: Drawer,
20
- parameters: {
21
- layout: "centered",
22
- },
23
- tags: ["autodocs"],
24
- } satisfies Meta<typeof Drawer>
25
-
26
- export default meta
27
- type Story = StoryObj<typeof meta>
28
-
29
- export const Default: Story = {
30
- render: () => (
31
- <Drawer>
32
- <DrawerTrigger>Open</DrawerTrigger>
33
- <DrawerContent>
34
- <DrawerHeader>
35
- <DrawerTitle>Are you absolutely sure?</DrawerTitle>
36
- <DrawerDescription>This action cannot be undone.</DrawerDescription>
37
- </DrawerHeader>
38
- <DrawerFooter>
39
- <Button>Submit</Button>
40
- <DrawerClose>
41
- <Button variant="outline">Cancel</Button>
42
- </DrawerClose>
43
- </DrawerFooter>
44
- </DrawerContent>
45
- </Drawer>
46
- )
47
- }
48
-
@@ -1,116 +0,0 @@
1
- import * as React from "react"
2
- import { Drawer as DrawerPrimitive } from "vaul"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Drawer = ({
7
- shouldScaleBackground = true,
8
- ...props
9
- }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
10
- <DrawerPrimitive.Root
11
- shouldScaleBackground={shouldScaleBackground}
12
- {...props}
13
- />
14
- )
15
- Drawer.displayName = "Drawer"
16
-
17
- const DrawerTrigger = DrawerPrimitive.Trigger
18
-
19
- const DrawerPortal = DrawerPrimitive.Portal
20
-
21
- const DrawerClose = DrawerPrimitive.Close
22
-
23
- const DrawerOverlay = React.forwardRef<
24
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
25
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
26
- >(({ className, ...props }, ref) => (
27
- <DrawerPrimitive.Overlay
28
- ref={ref}
29
- className={cn("fixed inset-0 z-50 bg-black/80", className)}
30
- {...props}
31
- />
32
- ))
33
- DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
34
-
35
- const DrawerContent = React.forwardRef<
36
- React.ElementRef<typeof DrawerPrimitive.Content>,
37
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
38
- >(({ className, children, ...props }, ref) => (
39
- <DrawerPortal>
40
- <DrawerOverlay />
41
- <DrawerPrimitive.Content
42
- ref={ref}
43
- className={cn(
44
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
45
- className
46
- )}
47
- {...props}
48
- >
49
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
50
- {children}
51
- </DrawerPrimitive.Content>
52
- </DrawerPortal>
53
- ))
54
- DrawerContent.displayName = "DrawerContent"
55
-
56
- const DrawerHeader = ({
57
- className,
58
- ...props
59
- }: React.HTMLAttributes<HTMLDivElement>) => (
60
- <div
61
- className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
62
- {...props}
63
- />
64
- )
65
- DrawerHeader.displayName = "DrawerHeader"
66
-
67
- const DrawerFooter = ({
68
- className,
69
- ...props
70
- }: React.HTMLAttributes<HTMLDivElement>) => (
71
- <div
72
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
73
- {...props}
74
- />
75
- )
76
- DrawerFooter.displayName = "DrawerFooter"
77
-
78
- const DrawerTitle = React.forwardRef<
79
- React.ElementRef<typeof DrawerPrimitive.Title>,
80
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
81
- >(({ className, ...props }, ref) => (
82
- <DrawerPrimitive.Title
83
- ref={ref}
84
- className={cn(
85
- "text-lg font-semibold leading-none tracking-tight",
86
- className
87
- )}
88
- {...props}
89
- />
90
- ))
91
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName
92
-
93
- const DrawerDescription = React.forwardRef<
94
- React.ElementRef<typeof DrawerPrimitive.Description>,
95
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
96
- >(({ className, ...props }, ref) => (
97
- <DrawerPrimitive.Description
98
- ref={ref}
99
- className={cn("text-sm text-muted-foreground", className)}
100
- {...props}
101
- />
102
- ))
103
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName
104
-
105
- export {
106
- Drawer,
107
- DrawerPortal,
108
- DrawerOverlay,
109
- DrawerTrigger,
110
- DrawerClose,
111
- DrawerContent,
112
- DrawerHeader,
113
- DrawerFooter,
114
- DrawerTitle,
115
- DrawerDescription,
116
- }
@@ -1,92 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react"
2
-
3
- import {
4
- DropdownMenu,
5
- DropdownMenuContent,
6
- DropdownMenuItem,
7
- DropdownMenuLabel,
8
- DropdownMenuSeparator,
9
- DropdownMenuTrigger,
10
- DropdownMenuCheckboxItem,
11
- DropdownMenuRadioItem,
12
- DropdownMenuRadioGroup
13
- } from "./dropdown-menu"
14
- import {
15
- Button
16
- } from './button'
17
-
18
- const meta = {
19
- title: "Components/DropdownMenu",
20
- component: DropdownMenu,
21
- parameters: {
22
- layout: "centered",
23
- },
24
- tags: ["autodocs"],
25
- } satisfies Meta<typeof DropdownMenu>
26
-
27
- export default meta
28
- type Story = StoryObj<typeof meta>
29
-
30
- export const Default: Story = {
31
- render: () => (
32
- <DropdownMenu>
33
- <DropdownMenuTrigger>Open</DropdownMenuTrigger>
34
- <DropdownMenuContent>
35
- <DropdownMenuLabel>My Account</DropdownMenuLabel>
36
- <DropdownMenuSeparator />
37
- <DropdownMenuItem>Profile</DropdownMenuItem>
38
- <DropdownMenuItem>Billing</DropdownMenuItem>
39
- <DropdownMenuItem>Team</DropdownMenuItem>
40
- <DropdownMenuItem>Subscription</DropdownMenuItem>
41
- </DropdownMenuContent>
42
- </DropdownMenu>
43
- )
44
- }
45
-
46
- export const Checkboxes: Story = {
47
- args: {
48
- },
49
- render: () => (
50
- <DropdownMenu>
51
- <DropdownMenuTrigger asChild>
52
- <Button variant="outline">Open</Button>
53
- </DropdownMenuTrigger>
54
- <DropdownMenuContent className="w-56">
55
- <DropdownMenuLabel>Appearance</DropdownMenuLabel>
56
- <DropdownMenuSeparator />
57
- <DropdownMenuCheckboxItem
58
- >
59
- Status Bar
60
- </DropdownMenuCheckboxItem>
61
- <DropdownMenuCheckboxItem
62
- disabled
63
- >
64
- Activity Bar
65
- </DropdownMenuCheckboxItem>
66
- <DropdownMenuCheckboxItem
67
- >
68
- Panel
69
- </DropdownMenuCheckboxItem>
70
- </DropdownMenuContent>
71
- </DropdownMenu>
72
- )
73
- }
74
-
75
- export const RadioGroup: Story = {
76
- render: () => (
77
- <DropdownMenu>
78
- <DropdownMenuTrigger asChild>
79
- <Button variant="outline">Open</Button>
80
- </DropdownMenuTrigger>
81
- <DropdownMenuContent className="w-56">
82
- <DropdownMenuLabel>Panel Position</DropdownMenuLabel>
83
- <DropdownMenuSeparator />
84
- <DropdownMenuRadioGroup onValueChange={() => { }}>
85
- <DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
86
- <DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
87
- <DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
88
- </DropdownMenuRadioGroup>
89
- </DropdownMenuContent>
90
- </DropdownMenu>
91
- )
92
- }