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,112 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { Button } from '@/components/ui/Button';
3
- import {
4
- Toast,
5
- ToastAction,
6
- ToastClose,
7
- ToastDescription,
8
- ToastProvider,
9
- ToastTitle,
10
- ToastViewport,
11
- } from '@/components/ui/Toast';
12
- import { Toaster } from '@/components/ui/Toaster';
13
- import { useToast } from '@/hooks/use-toast';
14
-
15
- const meta: Meta<typeof Toast> = {
16
- title: 'UI Components/Toast',
17
- component: Toast,
18
- };
19
- export default meta;
20
- type Story = StoryObj<typeof Toast>;
21
-
22
- function ToastDemo() {
23
- const { toast } = useToast();
24
-
25
- return (
26
- <div>
27
- <Toaster />
28
- <Button
29
- variant="outline"
30
- onClick={() => {
31
- toast({
32
- title: 'UI Components/Scheduled: Catch up',
33
- description: 'Friday, February 10, 2026 at 5:57 PM',
34
- });
35
- }}
36
- >
37
- Show Toast
38
- </Button>
39
- </div>
40
- );
41
- }
42
-
43
- export const Default: Story = {
44
- render: () => <ToastDemo />,
45
- };
46
-
47
- function ToastDestructiveDemo() {
48
- const { toast } = useToast();
49
-
50
- return (
51
- <div>
52
- <Toaster />
53
- <Button
54
- variant="outline"
55
- onClick={() => {
56
- toast({
57
- variant: 'destructive',
58
- title: 'UI Components/Uh oh! Something went wrong.',
59
- description: 'There was a problem with your request.',
60
- });
61
- }}
62
- >
63
- Show Destructive Toast
64
- </Button>
65
- </div>
66
- );
67
- }
68
-
69
- export const Destructive: Story = {
70
- render: () => <ToastDestructiveDemo />,
71
- };
72
-
73
- function ToastWithActionDemo() {
74
- const { toast } = useToast();
75
-
76
- return (
77
- <div>
78
- <Toaster />
79
- <Button
80
- variant="outline"
81
- onClick={() => {
82
- toast({
83
- title: 'UI Components/Event created',
84
- description: 'Sunday, December 03, 2023 at 9:00 AM',
85
- action: <ToastAction altText="Undo">Undo</ToastAction>,
86
- });
87
- }}
88
- >
89
- Show Toast with Action
90
- </Button>
91
- </div>
92
- );
93
- }
94
-
95
- export const WithAction: Story = {
96
- render: () => <ToastWithActionDemo />,
97
- };
98
-
99
- export const Inline: Story = {
100
- render: () => (
101
- <ToastProvider>
102
- <Toast open>
103
- <div className="grid gap-1">
104
- <ToastTitle>Toast Title</ToastTitle>
105
- <ToastDescription>This is a toast description.</ToastDescription>
106
- </div>
107
- <ToastClose />
108
- </Toast>
109
- <ToastViewport />
110
- </ToastProvider>
111
- ),
112
- };
@@ -1,114 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { cva, type VariantProps } from 'class-variance-authority';
5
- import { XIcon } from 'lucide-react';
6
- import { Toast as ToastPrimitive } from 'radix-ui';
7
-
8
- import { cn } from '@/lib/utils';
9
-
10
- function ToastProvider({ ...props }: React.ComponentProps<typeof ToastPrimitive.Provider>) {
11
- return <ToastPrimitive.Provider data-slot="toast-provider" {...props} />;
12
- }
13
-
14
- function ToastViewport({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Viewport>) {
15
- return (
16
- <ToastPrimitive.Viewport
17
- data-slot="toast-viewport"
18
- className={cn(
19
- 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
20
- className,
21
- )}
22
- {...props}
23
- />
24
- );
25
- }
26
-
27
- const toastVariants = cva(
28
- 'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
29
- {
30
- variants: {
31
- variant: {
32
- default: 'border bg-background text-foreground',
33
- destructive: 'destructive group border-destructive bg-destructive text-destructive-foreground',
34
- },
35
- },
36
- defaultVariants: {
37
- variant: 'default',
38
- },
39
- },
40
- );
41
-
42
- function Toast({
43
- className,
44
- variant,
45
- ...props
46
- }: React.ComponentProps<typeof ToastPrimitive.Root> & VariantProps<typeof toastVariants>) {
47
- return <ToastPrimitive.Root data-slot="toast" className={cn(toastVariants({ variant }), className)} {...props} />;
48
- }
49
-
50
- function ToastAction({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Action>) {
51
- return (
52
- <ToastPrimitive.Action
53
- data-slot="toast-action"
54
- className={cn(
55
- 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
56
- className,
57
- )}
58
- {...props}
59
- />
60
- );
61
- }
62
-
63
- function ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Close>) {
64
- return (
65
- <ToastPrimitive.Close
66
- data-slot="toast-close"
67
- className={cn(
68
- 'absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
69
- className,
70
- )}
71
- toast-close=""
72
- {...props}
73
- >
74
- <XIcon className="h-4 w-4" />
75
- </ToastPrimitive.Close>
76
- );
77
- }
78
-
79
- function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {
80
- return (
81
- <ToastPrimitive.Title
82
- data-slot="toast-title"
83
- className={cn('text-sm font-semibold [&+div]:text-xs', className)}
84
- {...props}
85
- />
86
- );
87
- }
88
-
89
- function ToastDescription({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Description>) {
90
- return (
91
- <ToastPrimitive.Description
92
- data-slot="toast-description"
93
- className={cn('text-sm opacity-90', className)}
94
- {...props}
95
- />
96
- );
97
- }
98
-
99
- type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
100
-
101
- type ToastActionElement = React.ReactElement<typeof ToastAction>;
102
-
103
- export {
104
- type ToastProps,
105
- type ToastActionElement,
106
- ToastProvider,
107
- ToastViewport,
108
- Toast,
109
- ToastTitle,
110
- ToastDescription,
111
- ToastClose,
112
- ToastAction,
113
- toastVariants,
114
- };
@@ -1,28 +0,0 @@
1
- 'use client';
2
-
3
- import { useToast } from '@/hooks/use-toast';
4
- import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '@/components/ui/Toast';
5
-
6
- function Toaster() {
7
- const { toasts } = useToast();
8
-
9
- return (
10
- <ToastProvider>
11
- {toasts.map(function ({ id, title, description, action, ...props }) {
12
- return (
13
- <Toast key={id} {...props}>
14
- <div className="grid gap-1">
15
- {title && <ToastTitle>{title}</ToastTitle>}
16
- {description && <ToastDescription>{description}</ToastDescription>}
17
- </div>
18
- {action}
19
- <ToastClose />
20
- </Toast>
21
- );
22
- })}
23
- <ToastViewport />
24
- </ToastProvider>
25
- );
26
- }
27
-
28
- export { Toaster };
@@ -1,40 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { BoldIcon } from 'lucide-react';
3
- import { Toggle } from '@/components/ui/Toggle';
4
-
5
- const meta: Meta<typeof Toggle> = {
6
- title: 'UI Components/Toggle',
7
- component: Toggle,
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof Toggle>;
11
-
12
- export const Default: Story = {
13
- args: {
14
- 'aria-label': 'Toggle bold',
15
- children: <BoldIcon />,
16
- },
17
- };
18
-
19
- export const Outline: Story = {
20
- args: {
21
- variant: 'outline',
22
- 'aria-label': 'Toggle bold',
23
- children: <BoldIcon />,
24
- },
25
- };
26
-
27
- export const WithText: Story = {
28
- args: {
29
- 'aria-label': 'Toggle italic',
30
- children: 'Italic',
31
- },
32
- };
33
-
34
- export const Pressed: Story = {
35
- args: {
36
- defaultPressed: true,
37
- 'aria-label': 'Toggle bold',
38
- children: <BoldIcon />,
39
- },
40
- };
@@ -1,41 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { cva, type VariantProps } from 'class-variance-authority';
5
- import { Toggle as TogglePrimitive } from 'radix-ui';
6
-
7
- import { cn } from '@/lib/utils';
8
-
9
- const toggleVariants = cva(
10
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
11
- {
12
- variants: {
13
- variant: {
14
- default: 'bg-transparent',
15
- outline: 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
16
- },
17
- size: {
18
- default: 'h-9 px-2 min-w-9',
19
- sm: 'h-8 px-1.5 min-w-8',
20
- lg: 'h-10 px-2.5 min-w-10',
21
- },
22
- },
23
- defaultVariants: {
24
- variant: 'default',
25
- size: 'default',
26
- },
27
- },
28
- );
29
-
30
- function Toggle({
31
- className,
32
- variant,
33
- size,
34
- ...props
35
- }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
36
- return (
37
- <TogglePrimitive.Root data-slot="toggle" className={cn(toggleVariants({ variant, size, className }))} {...props} />
38
- );
39
- }
40
-
41
- export { Toggle, toggleVariants };
@@ -1,58 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { BoldIcon, ItalicIcon, UnderlineIcon } from 'lucide-react';
3
- import { ToggleGroup, ToggleGroupItem } from '@/components/ui/ToggleGroup';
4
-
5
- const meta: Meta<typeof ToggleGroup> = {
6
- title: 'UI Components/ToggleGroup',
7
- component: ToggleGroup,
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof ToggleGroup>;
11
-
12
- export const Single: Story = {
13
- render: () => (
14
- <ToggleGroup type="single">
15
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
16
- <BoldIcon />
17
- </ToggleGroupItem>
18
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
19
- <ItalicIcon />
20
- </ToggleGroupItem>
21
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
22
- <UnderlineIcon />
23
- </ToggleGroupItem>
24
- </ToggleGroup>
25
- ),
26
- };
27
-
28
- export const Multiple: Story = {
29
- render: () => (
30
- <ToggleGroup type="multiple" defaultValue={['bold', 'italic']}>
31
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
32
- <BoldIcon />
33
- </ToggleGroupItem>
34
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
35
- <ItalicIcon />
36
- </ToggleGroupItem>
37
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
38
- <UnderlineIcon />
39
- </ToggleGroupItem>
40
- </ToggleGroup>
41
- ),
42
- };
43
-
44
- export const Outline: Story = {
45
- render: () => (
46
- <ToggleGroup type="single" variant="outline">
47
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
48
- <BoldIcon />
49
- </ToggleGroupItem>
50
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
51
- <ItalicIcon />
52
- </ToggleGroupItem>
53
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
54
- <UnderlineIcon />
55
- </ToggleGroupItem>
56
- </ToggleGroup>
57
- ),
58
- };
@@ -1,80 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { type VariantProps } from 'class-variance-authority';
5
- import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
6
-
7
- import { cn } from '@/lib/utils';
8
- import { toggleVariants } from '@/components/ui/Toggle';
9
-
10
- const ToggleGroupContext = React.createContext<
11
- VariantProps<typeof toggleVariants> & {
12
- spacing?: number;
13
- }
14
- >({
15
- size: 'default',
16
- variant: 'default',
17
- spacing: 0,
18
- });
19
-
20
- function ToggleGroup({
21
- className,
22
- variant,
23
- size,
24
- spacing = 0,
25
- children,
26
- ...props
27
- }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
28
- VariantProps<typeof toggleVariants> & {
29
- spacing?: number;
30
- }) {
31
- return (
32
- <ToggleGroupPrimitive.Root
33
- data-slot="toggle-group"
34
- data-variant={variant}
35
- data-size={size}
36
- data-spacing={spacing}
37
- style={{ '--gap': spacing } as React.CSSProperties}
38
- className={cn(
39
- 'group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs',
40
- className,
41
- )}
42
- {...props}
43
- >
44
- <ToggleGroupContext.Provider value={{ variant, size, spacing }}>{children}</ToggleGroupContext.Provider>
45
- </ToggleGroupPrimitive.Root>
46
- );
47
- }
48
-
49
- function ToggleGroupItem({
50
- className,
51
- children,
52
- variant,
53
- size,
54
- ...props
55
- }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
56
- const context = React.useContext(ToggleGroupContext);
57
-
58
- return (
59
- <ToggleGroupPrimitive.Item
60
- data-slot="toggle-group-item"
61
- data-variant={context.variant || variant}
62
- data-size={context.size || size}
63
- data-spacing={context.spacing}
64
- className={cn(
65
- toggleVariants({
66
- variant: context.variant || variant,
67
- size: context.size || size,
68
- }),
69
- 'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10',
70
- 'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l',
71
- className,
72
- )}
73
- {...props}
74
- >
75
- {children}
76
- </ToggleGroupPrimitive.Item>
77
- );
78
- }
79
-
80
- export { ToggleGroup, ToggleGroupItem };
@@ -1,40 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { Button } from '@/components/ui/Button';
3
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/Tooltip';
4
-
5
- const meta: Meta<typeof Tooltip> = {
6
- title: 'UI Components/Tooltip',
7
- component: Tooltip,
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof Tooltip>;
11
-
12
- export const Default: Story = {
13
- render: () => (
14
- <TooltipProvider>
15
- <Tooltip>
16
- <TooltipTrigger asChild>
17
- <Button variant="outline">Hover me</Button>
18
- </TooltipTrigger>
19
- <TooltipContent>
20
- <p>This is a tooltip</p>
21
- </TooltipContent>
22
- </Tooltip>
23
- </TooltipProvider>
24
- ),
25
- };
26
-
27
- export const WithSideOffset: Story = {
28
- render: () => (
29
- <TooltipProvider>
30
- <Tooltip>
31
- <TooltipTrigger asChild>
32
- <Button variant="outline">With offset</Button>
33
- </TooltipTrigger>
34
- <TooltipContent sideOffset={8}>
35
- <p>Tooltip with side offset</p>
36
- </TooltipContent>
37
- </Tooltip>
38
- </TooltipProvider>
39
- ),
40
- };
@@ -1,42 +0,0 @@
1
- import * as React from 'react';
2
- import { Tooltip as TooltipPrimitive } from 'radix-ui';
3
-
4
- import { cn } from '@/lib/utils';
5
-
6
- function TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
7
- return <TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props} />;
8
- }
9
-
10
- function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
11
- return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
12
- }
13
-
14
- function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
15
- return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
16
- }
17
-
18
- function TooltipContent({
19
- className,
20
- sideOffset = 0,
21
- children,
22
- ...props
23
- }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
24
- return (
25
- <TooltipPrimitive.Portal>
26
- <TooltipPrimitive.Content
27
- data-slot="tooltip-content"
28
- sideOffset={sideOffset}
29
- className={cn(
30
- 'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',
31
- className,
32
- )}
33
- {...props}
34
- >
35
- {children}
36
- <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
37
- </TooltipPrimitive.Content>
38
- </TooltipPrimitive.Portal>
39
- );
40
- }
41
-
42
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,11 +0,0 @@
1
- import request from 'graphql-request';
2
- import type { TypedDocumentString } from './graphql';
3
-
4
- const GRAPHQL_ENDPOINT = 'http://localhost:4000/graphql';
5
-
6
- export async function execute<TResult, TVariables>(
7
- query: TypedDocumentString<TResult, TVariables>,
8
- ...[variables]: TVariables extends Record<string, never> ? [] : [TVariables]
9
- ): Promise<TResult> {
10
- return request(GRAPHQL_ENDPOINT, query.toString(), variables ? variables : undefined);
11
- }
@@ -1,83 +0,0 @@
1
- /* eslint-disable */
2
- import { ResultOf, DocumentTypeDecoration } from '@graphql-typed-document-node/core';
3
- import { Incremental, TypedDocumentString } from './graphql';
4
-
5
-
6
- export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
7
- infer TType,
8
- any
9
- >
10
- ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
11
- ? TKey extends string
12
- ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
13
- : never
14
- : never
15
- : never;
16
-
17
- // return non-nullable if `fragmentType` is non-nullable
18
- export function useFragment<TType>(
19
- _documentNode: DocumentTypeDecoration<TType, any>,
20
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
21
- ): TType;
22
- // return nullable if `fragmentType` is undefined
23
- export function useFragment<TType>(
24
- _documentNode: DocumentTypeDecoration<TType, any>,
25
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
26
- ): TType | undefined;
27
- // return nullable if `fragmentType` is nullable
28
- export function useFragment<TType>(
29
- _documentNode: DocumentTypeDecoration<TType, any>,
30
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
31
- ): TType | null;
32
- // return nullable if `fragmentType` is nullable or undefined
33
- export function useFragment<TType>(
34
- _documentNode: DocumentTypeDecoration<TType, any>,
35
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
36
- ): TType | null | undefined;
37
- // return array of non-nullable if `fragmentType` is array of non-nullable
38
- export function useFragment<TType>(
39
- _documentNode: DocumentTypeDecoration<TType, any>,
40
- fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
41
- ): Array<TType>;
42
- // return array of nullable if `fragmentType` is array of nullable
43
- export function useFragment<TType>(
44
- _documentNode: DocumentTypeDecoration<TType, any>,
45
- fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
46
- ): Array<TType> | null | undefined;
47
- // return readonly array of non-nullable if `fragmentType` is array of non-nullable
48
- export function useFragment<TType>(
49
- _documentNode: DocumentTypeDecoration<TType, any>,
50
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
51
- ): ReadonlyArray<TType>;
52
- // return readonly array of nullable if `fragmentType` is array of nullable
53
- export function useFragment<TType>(
54
- _documentNode: DocumentTypeDecoration<TType, any>,
55
- fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
56
- ): ReadonlyArray<TType> | null | undefined;
57
- export function useFragment<TType>(
58
- _documentNode: DocumentTypeDecoration<TType, any>,
59
- fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
60
- ): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
61
- return fragmentType as any;
62
- }
63
-
64
-
65
- export function makeFragmentData<
66
- F extends DocumentTypeDecoration<any, any>,
67
- FT extends ResultOf<F>
68
- >(data: FT, _fragment: F): FragmentType<F> {
69
- return data as FragmentType<F>;
70
- }
71
- export function isFragmentReady<TQuery, TFrag>(
72
- queryNode: TypedDocumentString<TQuery, any>,
73
- fragmentNode: TypedDocumentString<TFrag, any>,
74
- data: FragmentType<TypedDocumentString<Incremental<TFrag>, any>> | null | undefined
75
- ): data is FragmentType<typeof fragmentNode> {
76
- const deferredFields = queryNode.__meta__?.deferredFields as Record<string, (keyof TFrag)[]>;
77
- const fragName = fragmentNode.__meta__?.fragmentName as string | undefined;
78
-
79
- if (!deferredFields || !fragName) return true;
80
-
81
- const fields = deferredFields[fragName] ?? [];
82
- return fields.length > 0 && fields.every(field => data && field in data);
83
- }
@@ -1,9 +0,0 @@
1
- /* eslint-disable */
2
- import * as types from './graphql';
3
-
4
-
5
-
6
- const documents = {}
7
- export function graphql(source: string) {
8
- return (documents as any)[source] ?? {};
9
- }