@auto-engineer/generate-react-client 1.12.1
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.
- package/CHANGELOG.md +12 -0
- package/LICENSE +10 -0
- package/dist/src/commands/generate-react-client.d.ts +21 -0
- package/dist/src/commands/generate-react-client.d.ts.map +1 -0
- package/dist/src/commands/generate-react-client.js +62 -0
- package/dist/src/commands/generate-react-client.js.map +1 -0
- package/dist/src/copy-starter.d.ts +2 -0
- package/dist/src/copy-starter.d.ts.map +1 -0
- package/dist/src/copy-starter.js +34 -0
- package/dist/src/copy-starter.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/starter/.storybook/main.ts +33 -0
- package/dist/starter/.storybook/preview.tsx +35 -0
- package/dist/starter/components.json +29 -0
- package/dist/starter/index.html +12 -0
- package/dist/starter/package.json +60 -0
- package/dist/starter/pnpm-lock.yaml +5236 -0
- package/dist/starter/public/mockServiceWorker.js +336 -0
- package/dist/starter/src/App.tsx +15 -0
- package/dist/starter/src/components/.gitkeep +0 -0
- package/dist/starter/src/components/ui/Accordion.stories.tsx +47 -0
- package/dist/starter/src/components/ui/Accordion.tsx +51 -0
- package/dist/starter/src/components/ui/Alert.stories.tsx +27 -0
- package/dist/starter/src/components/ui/Alert.tsx +49 -0
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +65 -0
- package/dist/starter/src/components/ui/AlertDialog.tsx +163 -0
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +33 -0
- package/dist/starter/src/components/ui/AspectRatio.tsx +9 -0
- package/dist/starter/src/components/ui/Avatar.stories.tsx +42 -0
- package/dist/starter/src/components/ui/Avatar.tsx +87 -0
- package/dist/starter/src/components/ui/Badge.stories.tsx +36 -0
- package/dist/starter/src/components/ui/Badge.tsx +40 -0
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +52 -0
- package/dist/starter/src/components/ui/Breadcrumb.tsx +92 -0
- package/dist/starter/src/components/ui/Button.stories.tsx +92 -0
- package/dist/starter/src/components/ui/Button.tsx +62 -0
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +30 -0
- package/dist/starter/src/components/ui/ButtonGroup.tsx +75 -0
- package/dist/starter/src/components/ui/Calendar.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Calendar.tsx +159 -0
- package/dist/starter/src/components/ui/Card.stories.tsx +42 -0
- package/dist/starter/src/components/ui/Card.tsx +56 -0
- package/dist/starter/src/components/ui/Carousel.stories.tsx +54 -0
- package/dist/starter/src/components/ui/Carousel.tsx +216 -0
- package/dist/starter/src/components/ui/Chart.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Chart.tsx +296 -0
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +31 -0
- package/dist/starter/src/components/ui/Checkbox.tsx +29 -0
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +56 -0
- package/dist/starter/src/components/ui/Collapsible.tsx +15 -0
- package/dist/starter/src/components/ui/Combobox.stories.tsx +73 -0
- package/dist/starter/src/components/ui/Combobox.tsx +267 -0
- package/dist/starter/src/components/ui/Command.stories.tsx +69 -0
- package/dist/starter/src/components/ui/Command.tsx +137 -0
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +66 -0
- package/dist/starter/src/components/ui/ContextMenu.tsx +211 -0
- package/dist/starter/src/components/ui/DesignSystem-Colors.mdx +68 -0
- package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +116 -0
- package/dist/starter/src/components/ui/DesignSystem-Layout.mdx +64 -0
- package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +166 -0
- package/dist/starter/src/components/ui/DesignSystem-Typography.mdx +31 -0
- package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +79 -0
- package/dist/starter/src/components/ui/Dialog.stories.tsx +72 -0
- package/dist/starter/src/components/ui/Dialog.tsx +136 -0
- package/dist/starter/src/components/ui/Direction.stories.tsx +36 -0
- package/dist/starter/src/components/ui/Direction.tsx +18 -0
- package/dist/starter/src/components/ui/Drawer.stories.tsx +68 -0
- package/dist/starter/src/components/ui/Drawer.tsx +106 -0
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +72 -0
- package/dist/starter/src/components/ui/DropdownMenu.tsx +219 -0
- package/dist/starter/src/components/ui/Empty.stories.tsx +35 -0
- package/dist/starter/src/components/ui/Empty.tsx +85 -0
- package/dist/starter/src/components/ui/Field.stories.tsx +47 -0
- package/dist/starter/src/components/ui/Field.tsx +226 -0
- package/dist/starter/src/components/ui/Form.stories.tsx +44 -0
- package/dist/starter/src/components/ui/Form.tsx +136 -0
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +47 -0
- package/dist/starter/src/components/ui/HoverCard.tsx +36 -0
- package/dist/starter/src/components/ui/Input.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Input.tsx +21 -0
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +50 -0
- package/dist/starter/src/components/ui/InputGroup.tsx +147 -0
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +40 -0
- package/dist/starter/src/components/ui/InputOTP.tsx +68 -0
- package/dist/starter/src/components/ui/Item.stories.tsx +61 -0
- package/dist/starter/src/components/ui/Item.tsx +158 -0
- package/dist/starter/src/components/ui/Kbd.stories.tsx +54 -0
- package/dist/starter/src/components/ui/Kbd.tsx +18 -0
- package/dist/starter/src/components/ui/Label.stories.tsx +85 -0
- package/dist/starter/src/components/ui/Label.tsx +40 -0
- package/dist/starter/src/components/ui/Menubar.stories.tsx +76 -0
- package/dist/starter/src/components/ui/Menubar.tsx +236 -0
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +42 -0
- package/dist/starter/src/components/ui/NativeSelect.tsx +44 -0
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +78 -0
- package/dist/starter/src/components/ui/NavigationMenu.tsx +142 -0
- package/dist/starter/src/components/ui/Pagination.stories.tsx +75 -0
- package/dist/starter/src/components/ui/Pagination.tsx +100 -0
- package/dist/starter/src/components/ui/Popover.stories.tsx +51 -0
- package/dist/starter/src/components/ui/Popover.tsx +52 -0
- package/dist/starter/src/components/ui/Progress.stories.tsx +28 -0
- package/dist/starter/src/components/ui/Progress.tsx +24 -0
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +48 -0
- package/dist/starter/src/components/ui/RadioGroup.tsx +31 -0
- package/dist/starter/src/components/ui/Resizable.stories.tsx +69 -0
- package/dist/starter/src/components/ui/Resizable.tsx +47 -0
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +43 -0
- package/dist/starter/src/components/ui/ScrollArea.tsx +46 -0
- package/dist/starter/src/components/ui/Select.stories.tsx +57 -0
- package/dist/starter/src/components/ui/Select.tsx +162 -0
- package/dist/starter/src/components/ui/Separator.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Separator.tsx +26 -0
- package/dist/starter/src/components/ui/Sheet.stories.tsx +66 -0
- package/dist/starter/src/components/ui/Sheet.tsx +107 -0
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +94 -0
- package/dist/starter/src/components/ui/Sidebar.tsx +675 -0
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +38 -0
- package/dist/starter/src/components/ui/Skeleton.tsx +7 -0
- package/dist/starter/src/components/ui/Slider.stories.tsx +21 -0
- package/dist/starter/src/components/ui/Slider.tsx +54 -0
- package/dist/starter/src/components/ui/Sonner.stories.tsx +44 -0
- package/dist/starter/src/components/ui/Sonner.tsx +34 -0
- package/dist/starter/src/components/ui/Spinner.stories.tsx +23 -0
- package/dist/starter/src/components/ui/Spinner.tsx +9 -0
- package/dist/starter/src/components/ui/Switch.stories.tsx +35 -0
- package/dist/starter/src/components/ui/Switch.tsx +33 -0
- package/dist/starter/src/components/ui/Table.stories.tsx +65 -0
- package/dist/starter/src/components/ui/Table.tsx +75 -0
- package/dist/starter/src/components/ui/Tabs.stories.tsx +51 -0
- package/dist/starter/src/components/ui/Tabs.tsx +69 -0
- package/dist/starter/src/components/ui/Textarea.stories.tsx +24 -0
- package/dist/starter/src/components/ui/Textarea.tsx +18 -0
- package/dist/starter/src/components/ui/Toast.stories.tsx +112 -0
- package/dist/starter/src/components/ui/Toast.tsx +114 -0
- package/dist/starter/src/components/ui/Toaster.tsx +28 -0
- package/dist/starter/src/components/ui/Toggle.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Toggle.tsx +41 -0
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +58 -0
- package/dist/starter/src/components/ui/ToggleGroup.tsx +80 -0
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +40 -0
- package/dist/starter/src/components/ui/Tooltip.tsx +42 -0
- package/dist/starter/src/hooks/use-mobile.ts +19 -0
- package/dist/starter/src/hooks/use-toast.ts +186 -0
- package/dist/starter/src/index.css +123 -0
- package/dist/starter/src/lib/utils.ts +6 -0
- package/dist/starter/src/main.tsx +5 -0
- package/dist/starter/tsconfig.app.json +25 -0
- package/dist/starter/tsconfig.json +4 -0
- package/dist/starter/vite.config.ts +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { XIcon } from 'lucide-react';
|
|
5
|
+
import { Dialog as SheetPrimitive } from 'radix-ui';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
|
+
|
|
9
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
14
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
18
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
22
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
26
|
+
return (
|
|
27
|
+
<SheetPrimitive.Overlay
|
|
28
|
+
data-slot="sheet-overlay"
|
|
29
|
+
className={cn(
|
|
30
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function SheetContent({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
side = 'right',
|
|
42
|
+
showCloseButton = true,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
45
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
46
|
+
showCloseButton?: boolean;
|
|
47
|
+
}) {
|
|
48
|
+
return (
|
|
49
|
+
<SheetPortal>
|
|
50
|
+
<SheetOverlay />
|
|
51
|
+
<SheetPrimitive.Content
|
|
52
|
+
data-slot="sheet-content"
|
|
53
|
+
className={cn(
|
|
54
|
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
55
|
+
side === 'right' &&
|
|
56
|
+
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
57
|
+
side === 'left' &&
|
|
58
|
+
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
59
|
+
side === 'top' &&
|
|
60
|
+
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
61
|
+
side === 'bottom' &&
|
|
62
|
+
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
{showCloseButton && (
|
|
69
|
+
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
70
|
+
<XIcon className="size-4" />
|
|
71
|
+
<span className="sr-only">Close</span>
|
|
72
|
+
</SheetPrimitive.Close>
|
|
73
|
+
)}
|
|
74
|
+
</SheetPrimitive.Content>
|
|
75
|
+
</SheetPortal>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
80
|
+
return <div data-slot="sheet-header" className={cn('flex flex-col gap-1.5 p-4', className)} {...props} />;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
84
|
+
return <div data-slot="sheet-footer" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
88
|
+
return (
|
|
89
|
+
<SheetPrimitive.Title
|
|
90
|
+
data-slot="sheet-title"
|
|
91
|
+
className={cn('text-foreground font-semibold', className)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
98
|
+
return (
|
|
99
|
+
<SheetPrimitive.Description
|
|
100
|
+
data-slot="sheet-description"
|
|
101
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { HomeIcon, SettingsIcon, UsersIcon, InboxIcon } from 'lucide-react';
|
|
3
|
+
import {
|
|
4
|
+
Sidebar,
|
|
5
|
+
SidebarContent,
|
|
6
|
+
SidebarFooter,
|
|
7
|
+
SidebarGroup,
|
|
8
|
+
SidebarGroupLabel,
|
|
9
|
+
SidebarHeader,
|
|
10
|
+
SidebarMenu,
|
|
11
|
+
SidebarMenuButton,
|
|
12
|
+
SidebarMenuItem,
|
|
13
|
+
SidebarProvider,
|
|
14
|
+
SidebarTrigger,
|
|
15
|
+
} from '@/components/ui/Sidebar';
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof Sidebar> = {
|
|
18
|
+
title: 'Sidebar',
|
|
19
|
+
component: Sidebar,
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof Sidebar>;
|
|
23
|
+
|
|
24
|
+
const menuItems = [
|
|
25
|
+
{ label: 'Home', icon: HomeIcon },
|
|
26
|
+
{ label: 'Inbox', icon: InboxIcon },
|
|
27
|
+
{ label: 'Users', icon: UsersIcon },
|
|
28
|
+
{ label: 'Settings', icon: SettingsIcon },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<SidebarProvider>
|
|
34
|
+
<Sidebar>
|
|
35
|
+
<SidebarHeader>
|
|
36
|
+
<span className="px-2 text-lg font-semibold">My App</span>
|
|
37
|
+
</SidebarHeader>
|
|
38
|
+
<SidebarContent>
|
|
39
|
+
<SidebarGroup>
|
|
40
|
+
<SidebarGroupLabel>Navigation</SidebarGroupLabel>
|
|
41
|
+
<SidebarMenu>
|
|
42
|
+
{menuItems.map((item) => (
|
|
43
|
+
<SidebarMenuItem key={item.label}>
|
|
44
|
+
<SidebarMenuButton>
|
|
45
|
+
<item.icon />
|
|
46
|
+
<span>{item.label}</span>
|
|
47
|
+
</SidebarMenuButton>
|
|
48
|
+
</SidebarMenuItem>
|
|
49
|
+
))}
|
|
50
|
+
</SidebarMenu>
|
|
51
|
+
</SidebarGroup>
|
|
52
|
+
</SidebarContent>
|
|
53
|
+
<SidebarFooter>
|
|
54
|
+
<span className="px-2 text-xs text-muted-foreground">v1.0.0</span>
|
|
55
|
+
</SidebarFooter>
|
|
56
|
+
</Sidebar>
|
|
57
|
+
<main className="flex-1 p-4">
|
|
58
|
+
<SidebarTrigger />
|
|
59
|
+
<p className="mt-4 text-sm text-muted-foreground">Main content area</p>
|
|
60
|
+
</main>
|
|
61
|
+
</SidebarProvider>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const WithActiveItem: Story = {
|
|
66
|
+
render: () => (
|
|
67
|
+
<SidebarProvider>
|
|
68
|
+
<Sidebar>
|
|
69
|
+
<SidebarHeader>
|
|
70
|
+
<span className="px-2 text-lg font-semibold">My App</span>
|
|
71
|
+
</SidebarHeader>
|
|
72
|
+
<SidebarContent>
|
|
73
|
+
<SidebarGroup>
|
|
74
|
+
<SidebarGroupLabel>Navigation</SidebarGroupLabel>
|
|
75
|
+
<SidebarMenu>
|
|
76
|
+
{menuItems.map((item, index) => (
|
|
77
|
+
<SidebarMenuItem key={item.label}>
|
|
78
|
+
<SidebarMenuButton isActive={index === 0}>
|
|
79
|
+
<item.icon />
|
|
80
|
+
<span>{item.label}</span>
|
|
81
|
+
</SidebarMenuButton>
|
|
82
|
+
</SidebarMenuItem>
|
|
83
|
+
))}
|
|
84
|
+
</SidebarMenu>
|
|
85
|
+
</SidebarGroup>
|
|
86
|
+
</SidebarContent>
|
|
87
|
+
</Sidebar>
|
|
88
|
+
<main className="flex-1 p-4">
|
|
89
|
+
<SidebarTrigger />
|
|
90
|
+
<p className="mt-4 text-sm text-muted-foreground">Main content area</p>
|
|
91
|
+
</main>
|
|
92
|
+
</SidebarProvider>
|
|
93
|
+
),
|
|
94
|
+
};
|