create-auto-app 1.33.0 → 1.35.0

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 (159) hide show
  1. package/package.json +2 -2
  2. package/templates/typical/.context/components-db.json +4006 -0
  3. package/templates/typical/.gitignore +1 -1
  4. package/templates/typical/auto.config.ts +85 -80
  5. package/templates/typical/client/.claude-auto/.claude.hooks.json +0 -28
  6. package/templates/typical/client/.gitignore +0 -4
  7. package/templates/typical/client/.storybook/main.ts +0 -66
  8. package/templates/typical/client/.storybook/manager-head.html +0 -154
  9. package/templates/typical/client/.storybook/manager.ts +0 -164
  10. package/templates/typical/client/.storybook/preview-head.html +0 -31
  11. package/templates/typical/client/.storybook/preview.tsx +0 -120
  12. package/templates/typical/client/codegen.ts +0 -17
  13. package/templates/typical/client/components.json +0 -29
  14. package/templates/typical/client/index.html +0 -12
  15. package/templates/typical/client/package.json +0 -69
  16. package/templates/typical/client/pnpm-lock.yaml +0 -7868
  17. package/templates/typical/client/public/blank.svg +0 -1
  18. package/templates/typical/client/public/mockServiceWorker.js +0 -336
  19. package/templates/typical/client/src/App.tsx +0 -29
  20. package/templates/typical/client/src/components/.gitkeep +0 -0
  21. package/templates/typical/client/src/components/ui/Accordion.stories.tsx +0 -47
  22. package/templates/typical/client/src/components/ui/Accordion.tsx +0 -51
  23. package/templates/typical/client/src/components/ui/Alert.stories.tsx +0 -27
  24. package/templates/typical/client/src/components/ui/Alert.tsx +0 -49
  25. package/templates/typical/client/src/components/ui/AlertDialog.stories.tsx +0 -65
  26. package/templates/typical/client/src/components/ui/AlertDialog.tsx +0 -163
  27. package/templates/typical/client/src/components/ui/AspectRatio.stories.tsx +0 -33
  28. package/templates/typical/client/src/components/ui/AspectRatio.tsx +0 -9
  29. package/templates/typical/client/src/components/ui/Avatar.stories.tsx +0 -42
  30. package/templates/typical/client/src/components/ui/Avatar.tsx +0 -87
  31. package/templates/typical/client/src/components/ui/Badge.stories.tsx +0 -36
  32. package/templates/typical/client/src/components/ui/Badge.tsx +0 -40
  33. package/templates/typical/client/src/components/ui/Breadcrumb.stories.tsx +0 -52
  34. package/templates/typical/client/src/components/ui/Breadcrumb.tsx +0 -92
  35. package/templates/typical/client/src/components/ui/Button.stories.tsx +0 -92
  36. package/templates/typical/client/src/components/ui/Button.tsx +0 -62
  37. package/templates/typical/client/src/components/ui/ButtonGroup.stories.tsx +0 -30
  38. package/templates/typical/client/src/components/ui/ButtonGroup.tsx +0 -75
  39. package/templates/typical/client/src/components/ui/Calendar.stories.tsx +0 -38
  40. package/templates/typical/client/src/components/ui/Calendar.tsx +0 -159
  41. package/templates/typical/client/src/components/ui/Card.stories.tsx +0 -42
  42. package/templates/typical/client/src/components/ui/Card.tsx +0 -56
  43. package/templates/typical/client/src/components/ui/Carousel.stories.tsx +0 -54
  44. package/templates/typical/client/src/components/ui/Carousel.tsx +0 -216
  45. package/templates/typical/client/src/components/ui/Chart.stories.tsx +0 -38
  46. package/templates/typical/client/src/components/ui/Chart.tsx +0 -296
  47. package/templates/typical/client/src/components/ui/Checkbox.stories.tsx +0 -31
  48. package/templates/typical/client/src/components/ui/Checkbox.tsx +0 -29
  49. package/templates/typical/client/src/components/ui/Collapsible.stories.tsx +0 -56
  50. package/templates/typical/client/src/components/ui/Collapsible.tsx +0 -15
  51. package/templates/typical/client/src/components/ui/Combobox.stories.tsx +0 -73
  52. package/templates/typical/client/src/components/ui/Combobox.tsx +0 -267
  53. package/templates/typical/client/src/components/ui/Command.stories.tsx +0 -69
  54. package/templates/typical/client/src/components/ui/Command.tsx +0 -137
  55. package/templates/typical/client/src/components/ui/ContextMenu.stories.tsx +0 -66
  56. package/templates/typical/client/src/components/ui/ContextMenu.tsx +0 -211
  57. package/templates/typical/client/src/components/ui/DesignSystem-Colors.mdx +0 -68
  58. package/templates/typical/client/src/components/ui/DesignSystem-Colors.stories.tsx +0 -117
  59. package/templates/typical/client/src/components/ui/DesignSystem-Layout.mdx +0 -64
  60. package/templates/typical/client/src/components/ui/DesignSystem-Layout.stories.tsx +0 -167
  61. package/templates/typical/client/src/components/ui/DesignSystem-Overview.stories.tsx +0 -748
  62. package/templates/typical/client/src/components/ui/DesignSystem-Typography.mdx +0 -31
  63. package/templates/typical/client/src/components/ui/DesignSystem-Typography.stories.tsx +0 -80
  64. package/templates/typical/client/src/components/ui/Dialog.stories.tsx +0 -72
  65. package/templates/typical/client/src/components/ui/Dialog.tsx +0 -136
  66. package/templates/typical/client/src/components/ui/Direction.stories.tsx +0 -36
  67. package/templates/typical/client/src/components/ui/Direction.tsx +0 -18
  68. package/templates/typical/client/src/components/ui/Drawer.stories.tsx +0 -68
  69. package/templates/typical/client/src/components/ui/Drawer.tsx +0 -106
  70. package/templates/typical/client/src/components/ui/DropdownMenu.stories.tsx +0 -72
  71. package/templates/typical/client/src/components/ui/DropdownMenu.tsx +0 -219
  72. package/templates/typical/client/src/components/ui/Empty.stories.tsx +0 -35
  73. package/templates/typical/client/src/components/ui/Empty.tsx +0 -85
  74. package/templates/typical/client/src/components/ui/Field.stories.tsx +0 -47
  75. package/templates/typical/client/src/components/ui/Field.tsx +0 -226
  76. package/templates/typical/client/src/components/ui/Form.stories.tsx +0 -44
  77. package/templates/typical/client/src/components/ui/Form.tsx +0 -136
  78. package/templates/typical/client/src/components/ui/HoverCard.stories.tsx +0 -47
  79. package/templates/typical/client/src/components/ui/HoverCard.tsx +0 -36
  80. package/templates/typical/client/src/components/ui/Input.stories.tsx +0 -38
  81. package/templates/typical/client/src/components/ui/Input.tsx +0 -21
  82. package/templates/typical/client/src/components/ui/InputGroup.stories.tsx +0 -50
  83. package/templates/typical/client/src/components/ui/InputGroup.tsx +0 -147
  84. package/templates/typical/client/src/components/ui/InputOTP.stories.tsx +0 -40
  85. package/templates/typical/client/src/components/ui/InputOTP.tsx +0 -68
  86. package/templates/typical/client/src/components/ui/Item.stories.tsx +0 -61
  87. package/templates/typical/client/src/components/ui/Item.tsx +0 -158
  88. package/templates/typical/client/src/components/ui/Kbd.stories.tsx +0 -54
  89. package/templates/typical/client/src/components/ui/Kbd.tsx +0 -18
  90. package/templates/typical/client/src/components/ui/Label.stories.tsx +0 -85
  91. package/templates/typical/client/src/components/ui/Label.tsx +0 -40
  92. package/templates/typical/client/src/components/ui/Menubar.stories.tsx +0 -76
  93. package/templates/typical/client/src/components/ui/Menubar.tsx +0 -236
  94. package/templates/typical/client/src/components/ui/NativeSelect.stories.tsx +0 -42
  95. package/templates/typical/client/src/components/ui/NativeSelect.tsx +0 -44
  96. package/templates/typical/client/src/components/ui/NavigationMenu.stories.tsx +0 -78
  97. package/templates/typical/client/src/components/ui/NavigationMenu.tsx +0 -142
  98. package/templates/typical/client/src/components/ui/Pagination.stories.tsx +0 -75
  99. package/templates/typical/client/src/components/ui/Pagination.tsx +0 -100
  100. package/templates/typical/client/src/components/ui/Popover.stories.tsx +0 -51
  101. package/templates/typical/client/src/components/ui/Popover.tsx +0 -52
  102. package/templates/typical/client/src/components/ui/Progress.stories.tsx +0 -28
  103. package/templates/typical/client/src/components/ui/Progress.tsx +0 -24
  104. package/templates/typical/client/src/components/ui/RadioGroup.stories.tsx +0 -48
  105. package/templates/typical/client/src/components/ui/RadioGroup.tsx +0 -31
  106. package/templates/typical/client/src/components/ui/Resizable.stories.tsx +0 -69
  107. package/templates/typical/client/src/components/ui/Resizable.tsx +0 -47
  108. package/templates/typical/client/src/components/ui/ScrollArea.stories.tsx +0 -43
  109. package/templates/typical/client/src/components/ui/ScrollArea.tsx +0 -46
  110. package/templates/typical/client/src/components/ui/Select.stories.tsx +0 -57
  111. package/templates/typical/client/src/components/ui/Select.tsx +0 -162
  112. package/templates/typical/client/src/components/ui/Separator.stories.tsx +0 -40
  113. package/templates/typical/client/src/components/ui/Separator.tsx +0 -26
  114. package/templates/typical/client/src/components/ui/Sheet.stories.tsx +0 -66
  115. package/templates/typical/client/src/components/ui/Sheet.tsx +0 -107
  116. package/templates/typical/client/src/components/ui/Sidebar.stories.tsx +0 -94
  117. package/templates/typical/client/src/components/ui/Sidebar.tsx +0 -675
  118. package/templates/typical/client/src/components/ui/Skeleton.stories.tsx +0 -38
  119. package/templates/typical/client/src/components/ui/Skeleton.tsx +0 -7
  120. package/templates/typical/client/src/components/ui/Slider.stories.tsx +0 -21
  121. package/templates/typical/client/src/components/ui/Slider.tsx +0 -54
  122. package/templates/typical/client/src/components/ui/Sonner.stories.tsx +0 -44
  123. package/templates/typical/client/src/components/ui/Sonner.tsx +0 -34
  124. package/templates/typical/client/src/components/ui/Spinner.stories.tsx +0 -23
  125. package/templates/typical/client/src/components/ui/Spinner.tsx +0 -9
  126. package/templates/typical/client/src/components/ui/Switch.stories.tsx +0 -35
  127. package/templates/typical/client/src/components/ui/Switch.tsx +0 -33
  128. package/templates/typical/client/src/components/ui/Table.stories.tsx +0 -65
  129. package/templates/typical/client/src/components/ui/Table.tsx +0 -75
  130. package/templates/typical/client/src/components/ui/Tabs.stories.tsx +0 -51
  131. package/templates/typical/client/src/components/ui/Tabs.tsx +0 -69
  132. package/templates/typical/client/src/components/ui/Textarea.stories.tsx +0 -24
  133. package/templates/typical/client/src/components/ui/Textarea.tsx +0 -18
  134. package/templates/typical/client/src/components/ui/Toast.stories.tsx +0 -112
  135. package/templates/typical/client/src/components/ui/Toast.tsx +0 -114
  136. package/templates/typical/client/src/components/ui/Toaster.tsx +0 -28
  137. package/templates/typical/client/src/components/ui/Toggle.stories.tsx +0 -40
  138. package/templates/typical/client/src/components/ui/Toggle.tsx +0 -41
  139. package/templates/typical/client/src/components/ui/ToggleGroup.stories.tsx +0 -58
  140. package/templates/typical/client/src/components/ui/ToggleGroup.tsx +0 -80
  141. package/templates/typical/client/src/components/ui/Tooltip.stories.tsx +0 -40
  142. package/templates/typical/client/src/components/ui/Tooltip.tsx +0 -42
  143. package/templates/typical/client/src/gql/execute.ts +0 -11
  144. package/templates/typical/client/src/gql/fragment-masking.ts +0 -83
  145. package/templates/typical/client/src/gql/gql.ts +0 -9
  146. package/templates/typical/client/src/gql/graphql.ts +0 -182
  147. package/templates/typical/client/src/gql/index.ts +0 -2
  148. package/templates/typical/client/src/graphql/mutations.ts +0 -0
  149. package/templates/typical/client/src/graphql/queries.ts +0 -0
  150. package/templates/typical/client/src/hooks/.gitkeep +0 -0
  151. package/templates/typical/client/src/hooks/use-mobile.ts +0 -19
  152. package/templates/typical/client/src/hooks/use-toast.ts +0 -186
  153. package/templates/typical/client/src/index.css +0 -121
  154. package/templates/typical/client/src/lib/utils.ts +0 -6
  155. package/templates/typical/client/src/main.tsx +0 -5
  156. package/templates/typical/client/tsconfig.app.json +0 -26
  157. package/templates/typical/client/tsconfig.json +0 -10
  158. package/templates/typical/client/tsconfig.staging.json +0 -8
  159. package/templates/typical/client/vite.config.ts +0 -50
@@ -1,31 +0,0 @@
1
- import { Meta, Stories } from '@storybook/addon-docs/blocks';
2
-
3
- <Meta title="Design System/Typography" />
4
-
5
- # Typography
6
-
7
- Typography classes used across the design system. All styles are composed from
8
- Tailwind CSS utility classes -- no custom font-size tokens are needed.
9
-
10
- ## Reference
11
-
12
- | Element | Tailwind Classes | Usage |
13
- | --- | --- | --- |
14
- | **H1** | `text-5xl font-extrabold tracking-tight` | Hero or display headings |
15
- | **H2** | `text-4xl font-bold tracking-tight` | Page-level headings |
16
- | **H3** | `text-3xl font-bold` | Section headings |
17
- | **H4** | `text-2xl font-semibold` | Subsection headings |
18
- | **H5** | `text-xl font-semibold` | Card or widget headings |
19
- | **Body (lead)** | `text-base leading-relaxed` | Long-form paragraphs where extra line-height aids readability |
20
- | **Body** | `text-base` | Default body text, UI labels |
21
- | **Muted** | `text-sm text-muted-foreground` | Descriptions, help text, secondary information |
22
- | **Small / Caption** | `text-xs text-muted-foreground` | Captions, timestamps, metadata |
23
-
24
- ## Guidelines
25
-
26
- - Prefer semantic heading order (`H1` > `H2` > `H3` ...) for accessibility.
27
- - Use **lead body** (`leading-relaxed`) only for multi-line content blocks; single-line labels should use the plain **body** style.
28
- - `text-muted-foreground` maps to the theme's muted colour and automatically adapts between light and dark modes.
29
- - Avoid mixing heading classes with body classes on the same element.
30
-
31
- <Stories />
@@ -1,80 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
-
3
- interface TypographyRowProps {
4
- label: string;
5
- className: string;
6
- sample?: string;
7
- }
8
-
9
- function TypographyRow({ label, className, sample }: TypographyRowProps) {
10
- return (
11
- <div className="flex flex-col gap-1 border-b border-border pb-4">
12
- <div className="flex items-baseline gap-3">
13
- <span className="text-xs font-mono text-muted-foreground min-w-[120px] shrink-0">{label}</span>
14
- <code className="text-xs bg-muted px-1.5 py-0.5 rounded font-mono">{className}</code>
15
- </div>
16
- <div className={className}>{sample ?? 'The quick brown fox jumps over the lazy dog'}</div>
17
- </div>
18
- );
19
- }
20
-
21
- function TypographyScale() {
22
- return (
23
- <div className="flex flex-col gap-6 max-w-3xl">
24
- <div className="flex flex-col gap-1 pb-4">
25
- <h2 className="text-2xl font-semibold">Typography Scale</h2>
26
- <p className="text-sm text-muted-foreground">
27
- Visual reference for typography classes used throughout the design system.
28
- </p>
29
- </div>
30
-
31
- <div className="flex flex-col gap-6">
32
- <h3 className="text-lg font-semibold text-muted-foreground uppercase tracking-wide">Headings</h3>
33
- <TypographyRow label="H1" className="text-5xl font-extrabold tracking-tight" sample="Display Heading" />
34
- <TypographyRow label="H2" className="text-4xl font-bold tracking-tight" sample="Page Heading" />
35
- <TypographyRow label="H3" className="text-3xl font-bold" sample="Section Heading" />
36
- <TypographyRow label="H4" className="text-2xl font-semibold" sample="Subsection Heading" />
37
- <TypographyRow label="H5" className="text-xl font-semibold" sample="Card Heading" />
38
- </div>
39
-
40
- <div className="flex flex-col gap-6 mt-4">
41
- <h3 className="text-lg font-semibold text-muted-foreground uppercase tracking-wide">Body</h3>
42
- <TypographyRow
43
- label="Body (lead)"
44
- className="text-base leading-relaxed"
45
- sample="Body text with relaxed leading for longer paragraphs. This style improves readability for multi-line content blocks."
46
- />
47
- <TypographyRow
48
- label="Body"
49
- className="text-base"
50
- sample="Default body text used for general content and UI labels."
51
- />
52
- </div>
53
-
54
- <div className="flex flex-col gap-6 mt-4">
55
- <h3 className="text-lg font-semibold text-muted-foreground uppercase tracking-wide">Muted &amp; Small</h3>
56
- <TypographyRow
57
- label="Muted"
58
- className="text-sm text-muted-foreground"
59
- sample="Secondary text for descriptions, help text, and supplementary information."
60
- />
61
- <TypographyRow
62
- label="Small / Caption"
63
- className="text-xs text-muted-foreground"
64
- sample="Captions, timestamps, and fine-print details."
65
- />
66
- </div>
67
- </div>
68
- );
69
- }
70
-
71
- const meta: Meta = {
72
- title: 'Design System/Typography',
73
- tags: ['!autodocs', '!manifest'],
74
- };
75
- export default meta;
76
- type Story = StoryObj;
77
-
78
- export const TypeScale: Story = {
79
- render: () => <TypographyScale />,
80
- };
@@ -1,72 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import {
3
- Dialog,
4
- DialogContent,
5
- DialogDescription,
6
- DialogFooter,
7
- DialogHeader,
8
- DialogTitle,
9
- DialogTrigger,
10
- } from '@/components/ui/Dialog';
11
- import { Button } from '@/components/ui/Button';
12
- import { Input } from '@/components/ui/Input';
13
- import { Label } from '@/components/ui/Label';
14
-
15
- const meta: Meta<typeof Dialog> = {
16
- title: 'UI Components/Dialog',
17
- component: Dialog,
18
- };
19
- export default meta;
20
- type Story = StoryObj<typeof Dialog>;
21
-
22
- export const Default: Story = {
23
- render: () => (
24
- <Dialog>
25
- <DialogTrigger asChild>
26
- <Button variant="outline">Edit Profile</Button>
27
- </DialogTrigger>
28
- <DialogContent className="sm:max-w-[425px]">
29
- <DialogHeader>
30
- <DialogTitle>Edit profile</DialogTitle>
31
- <DialogDescription>Make changes to your profile here. Click save when you are done.</DialogDescription>
32
- </DialogHeader>
33
- <div className="grid gap-4 py-4">
34
- <div className="grid grid-cols-4 items-center gap-4">
35
- <Label htmlFor="name" className="text-right">
36
- Name
37
- </Label>
38
- <Input id="name" defaultValue="John Doe" className="col-span-3" />
39
- </div>
40
- <div className="grid grid-cols-4 items-center gap-4">
41
- <Label htmlFor="username" className="text-right">
42
- Username
43
- </Label>
44
- <Input id="username" defaultValue="@johndoe" className="col-span-3" />
45
- </div>
46
- </div>
47
- <DialogFooter>
48
- <Button type="submit">Save changes</Button>
49
- </DialogFooter>
50
- </DialogContent>
51
- </Dialog>
52
- ),
53
- };
54
-
55
- export const WithCloseButton: Story = {
56
- render: () => (
57
- <Dialog>
58
- <DialogTrigger asChild>
59
- <Button variant="outline">Open Dialog</Button>
60
- </DialogTrigger>
61
- <DialogContent>
62
- <DialogHeader>
63
- <DialogTitle>Confirm Action</DialogTitle>
64
- <DialogDescription>Are you sure you want to proceed? This action cannot be undone.</DialogDescription>
65
- </DialogHeader>
66
- <DialogFooter showCloseButton>
67
- <Button variant="destructive">Confirm</Button>
68
- </DialogFooter>
69
- </DialogContent>
70
- </Dialog>
71
- ),
72
- };
@@ -1,136 +0,0 @@
1
- import * as React from 'react';
2
- import { XIcon } from 'lucide-react';
3
- import { Dialog as DialogPrimitive } from 'radix-ui';
4
-
5
- import { cn } from '@/lib/utils';
6
- import { Button } from '@/components/ui/Button';
7
-
8
- function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
9
- return <DialogPrimitive.Root data-slot="dialog" {...props} />;
10
- }
11
-
12
- function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
13
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
14
- }
15
-
16
- function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
17
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
18
- }
19
-
20
- function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
21
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
22
- }
23
-
24
- function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
25
- return (
26
- <DialogPrimitive.Overlay
27
- data-slot="dialog-overlay"
28
- className={cn(
29
- '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',
30
- className,
31
- )}
32
- {...props}
33
- />
34
- );
35
- }
36
-
37
- function DialogContent({
38
- className,
39
- children,
40
- showCloseButton = true,
41
- ...props
42
- }: React.ComponentProps<typeof DialogPrimitive.Content> & {
43
- showCloseButton?: boolean;
44
- }) {
45
- return (
46
- <DialogPortal data-slot="dialog-portal">
47
- <DialogOverlay />
48
- <DialogPrimitive.Content
49
- data-slot="dialog-content"
50
- className={cn(
51
- 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg',
52
- className,
53
- )}
54
- {...props}
55
- >
56
- {children}
57
- {showCloseButton && (
58
- <DialogPrimitive.Close
59
- data-slot="dialog-close"
60
- className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
61
- >
62
- <XIcon />
63
- <span className="sr-only">Close</span>
64
- </DialogPrimitive.Close>
65
- )}
66
- </DialogPrimitive.Content>
67
- </DialogPortal>
68
- );
69
- }
70
-
71
- function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
72
- return (
73
- <div
74
- data-slot="dialog-header"
75
- className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
76
- {...props}
77
- />
78
- );
79
- }
80
-
81
- function DialogFooter({
82
- className,
83
- showCloseButton = false,
84
- children,
85
- ...props
86
- }: React.ComponentProps<'div'> & {
87
- showCloseButton?: boolean;
88
- }) {
89
- return (
90
- <div
91
- data-slot="dialog-footer"
92
- className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
93
- {...props}
94
- >
95
- {children}
96
- {showCloseButton && (
97
- <DialogPrimitive.Close asChild>
98
- <Button variant="outline">Close</Button>
99
- </DialogPrimitive.Close>
100
- )}
101
- </div>
102
- );
103
- }
104
-
105
- function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
106
- return (
107
- <DialogPrimitive.Title
108
- data-slot="dialog-title"
109
- className={cn('text-lg leading-none font-semibold', className)}
110
- {...props}
111
- />
112
- );
113
- }
114
-
115
- function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {
116
- return (
117
- <DialogPrimitive.Description
118
- data-slot="dialog-description"
119
- className={cn('text-muted-foreground text-sm', className)}
120
- {...props}
121
- />
122
- );
123
- }
124
-
125
- export {
126
- Dialog,
127
- DialogClose,
128
- DialogContent,
129
- DialogDescription,
130
- DialogFooter,
131
- DialogHeader,
132
- DialogOverlay,
133
- DialogPortal,
134
- DialogTitle,
135
- DialogTrigger,
136
- };
@@ -1,36 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { DirectionProvider, useDirection } from '@/components/ui/Direction';
3
-
4
- const meta: Meta<typeof DirectionProvider> = {
5
- title: 'UI Components/Direction',
6
- component: DirectionProvider,
7
- };
8
- export default meta;
9
- type Story = StoryObj<typeof DirectionProvider>;
10
-
11
- function DirectionDisplay() {
12
- const direction = useDirection();
13
- return <p className="text-sm text-muted-foreground">Current direction: {direction ?? 'not set'}</p>;
14
- }
15
-
16
- export const LTR: Story = {
17
- render: () => (
18
- <DirectionProvider dir="ltr">
19
- <div className="space-y-2">
20
- <DirectionDisplay />
21
- <p>This content is rendered in a left-to-right context.</p>
22
- </div>
23
- </DirectionProvider>
24
- ),
25
- };
26
-
27
- export const RTL: Story = {
28
- render: () => (
29
- <DirectionProvider dir="rtl">
30
- <div className="space-y-2" dir="rtl">
31
- <DirectionDisplay />
32
- <p>This content is rendered in a right-to-left context.</p>
33
- </div>
34
- </DirectionProvider>
35
- ),
36
- };
@@ -1,18 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { Direction } from 'radix-ui';
5
-
6
- function DirectionProvider({
7
- dir,
8
- direction,
9
- children,
10
- }: React.ComponentProps<typeof Direction.DirectionProvider> & {
11
- direction?: React.ComponentProps<typeof Direction.DirectionProvider>['dir'];
12
- }) {
13
- return <Direction.DirectionProvider dir={direction ?? dir}>{children}</Direction.DirectionProvider>;
14
- }
15
-
16
- const useDirection = Direction.useDirection;
17
-
18
- export { DirectionProvider, useDirection };
@@ -1,68 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import {
3
- Drawer,
4
- DrawerTrigger,
5
- DrawerContent,
6
- DrawerHeader,
7
- DrawerFooter,
8
- DrawerTitle,
9
- DrawerDescription,
10
- DrawerClose,
11
- } from '@/components/ui/Drawer';
12
- import { Button } from '@/components/ui/Button';
13
-
14
- const meta: Meta<typeof Drawer> = {
15
- title: 'UI Components/Drawer',
16
- component: Drawer,
17
- };
18
- export default meta;
19
- type Story = StoryObj<typeof Drawer>;
20
-
21
- export const Default: Story = {
22
- render: () => (
23
- <Drawer>
24
- <DrawerTrigger asChild>
25
- <Button variant="outline">Open Drawer</Button>
26
- </DrawerTrigger>
27
- <DrawerContent>
28
- <DrawerHeader>
29
- <DrawerTitle>Move Goal</DrawerTitle>
30
- <DrawerDescription>Set your daily activity goal.</DrawerDescription>
31
- </DrawerHeader>
32
- <div className="p-4">
33
- <p className="text-muted-foreground text-sm">Adjust the settings below to configure your preferences.</p>
34
- </div>
35
- <DrawerFooter>
36
- <Button>Submit</Button>
37
- <DrawerClose asChild>
38
- <Button variant="outline">Cancel</Button>
39
- </DrawerClose>
40
- </DrawerFooter>
41
- </DrawerContent>
42
- </Drawer>
43
- ),
44
- };
45
-
46
- export const RightSide: Story = {
47
- render: () => (
48
- <Drawer direction="right">
49
- <DrawerTrigger asChild>
50
- <Button variant="outline">Open Right Drawer</Button>
51
- </DrawerTrigger>
52
- <DrawerContent>
53
- <DrawerHeader>
54
- <DrawerTitle>Side Panel</DrawerTitle>
55
- <DrawerDescription>This drawer opens from the right side.</DrawerDescription>
56
- </DrawerHeader>
57
- <div className="p-4">
58
- <p className="text-muted-foreground text-sm">Content goes here.</p>
59
- </div>
60
- <DrawerFooter>
61
- <DrawerClose asChild>
62
- <Button variant="outline">Close</Button>
63
- </DrawerClose>
64
- </DrawerFooter>
65
- </DrawerContent>
66
- </Drawer>
67
- ),
68
- };
@@ -1,106 +0,0 @@
1
- import * as React from 'react';
2
- import { Drawer as DrawerPrimitive } from 'vaul';
3
-
4
- import { cn } from '@/lib/utils';
5
-
6
- function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {
7
- return <DrawerPrimitive.Root data-slot="drawer" {...props} />;
8
- }
9
-
10
- function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
11
- return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
12
- }
13
-
14
- function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
15
- return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
16
- }
17
-
18
- function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {
19
- return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
20
- }
21
-
22
- function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
23
- return (
24
- <DrawerPrimitive.Overlay
25
- data-slot="drawer-overlay"
26
- className={cn(
27
- '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',
28
- className,
29
- )}
30
- {...props}
31
- />
32
- );
33
- }
34
-
35
- function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {
36
- return (
37
- <DrawerPortal data-slot="drawer-portal">
38
- <DrawerOverlay />
39
- <DrawerPrimitive.Content
40
- data-slot="drawer-content"
41
- className={cn(
42
- 'group/drawer-content bg-background fixed z-50 flex h-auto flex-col',
43
- 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',
44
- 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',
45
- 'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm',
46
- 'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',
47
- className,
48
- )}
49
- {...props}
50
- >
51
- <div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
52
- {children}
53
- </DrawerPrimitive.Content>
54
- </DrawerPortal>
55
- );
56
- }
57
-
58
- function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {
59
- return (
60
- <div
61
- data-slot="drawer-header"
62
- className={cn(
63
- 'flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left',
64
- className,
65
- )}
66
- {...props}
67
- />
68
- );
69
- }
70
-
71
- function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {
72
- return <div data-slot="drawer-footer" className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;
73
- }
74
-
75
- function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {
76
- return (
77
- <DrawerPrimitive.Title
78
- data-slot="drawer-title"
79
- className={cn('text-foreground font-semibold', className)}
80
- {...props}
81
- />
82
- );
83
- }
84
-
85
- function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {
86
- return (
87
- <DrawerPrimitive.Description
88
- data-slot="drawer-description"
89
- className={cn('text-muted-foreground text-sm', className)}
90
- {...props}
91
- />
92
- );
93
- }
94
-
95
- export {
96
- Drawer,
97
- DrawerPortal,
98
- DrawerOverlay,
99
- DrawerTrigger,
100
- DrawerClose,
101
- DrawerContent,
102
- DrawerHeader,
103
- DrawerFooter,
104
- DrawerTitle,
105
- DrawerDescription,
106
- };
@@ -1,72 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import {
3
- DropdownMenu,
4
- DropdownMenuTrigger,
5
- DropdownMenuContent,
6
- DropdownMenuItem,
7
- DropdownMenuLabel,
8
- DropdownMenuSeparator,
9
- DropdownMenuShortcut,
10
- DropdownMenuGroup,
11
- } from '@/components/ui/DropdownMenu';
12
- import { Button } from '@/components/ui/Button';
13
- import { UserIcon, SettingsIcon, LogOutIcon, CreditCardIcon } from 'lucide-react';
14
-
15
- const meta: Meta<typeof DropdownMenu> = {
16
- title: 'UI Components/DropdownMenu',
17
- component: DropdownMenu,
18
- };
19
- export default meta;
20
- type Story = StoryObj<typeof DropdownMenu>;
21
-
22
- export const Default: Story = {
23
- render: () => (
24
- <DropdownMenu>
25
- <DropdownMenuTrigger asChild>
26
- <Button variant="outline">Open Menu</Button>
27
- </DropdownMenuTrigger>
28
- <DropdownMenuContent className="w-56">
29
- <DropdownMenuLabel>My Account</DropdownMenuLabel>
30
- <DropdownMenuSeparator />
31
- <DropdownMenuGroup>
32
- <DropdownMenuItem>
33
- <UserIcon />
34
- <span>Profile</span>
35
- <DropdownMenuShortcut>Ctrl+P</DropdownMenuShortcut>
36
- </DropdownMenuItem>
37
- <DropdownMenuItem>
38
- <CreditCardIcon />
39
- <span>Billing</span>
40
- <DropdownMenuShortcut>Ctrl+B</DropdownMenuShortcut>
41
- </DropdownMenuItem>
42
- <DropdownMenuItem>
43
- <SettingsIcon />
44
- <span>Settings</span>
45
- <DropdownMenuShortcut>Ctrl+S</DropdownMenuShortcut>
46
- </DropdownMenuItem>
47
- </DropdownMenuGroup>
48
- <DropdownMenuSeparator />
49
- <DropdownMenuItem variant="destructive">
50
- <LogOutIcon />
51
- <span>Log out</span>
52
- </DropdownMenuItem>
53
- </DropdownMenuContent>
54
- </DropdownMenu>
55
- ),
56
- };
57
-
58
- export const Simple: Story = {
59
- render: () => (
60
- <DropdownMenu>
61
- <DropdownMenuTrigger asChild>
62
- <Button variant="outline">Actions</Button>
63
- </DropdownMenuTrigger>
64
- <DropdownMenuContent>
65
- <DropdownMenuItem>Edit</DropdownMenuItem>
66
- <DropdownMenuItem>Duplicate</DropdownMenuItem>
67
- <DropdownMenuSeparator />
68
- <DropdownMenuItem variant="destructive">Delete</DropdownMenuItem>
69
- </DropdownMenuContent>
70
- </DropdownMenu>
71
- ),
72
- };