@auto-engineer/generate-react-client 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.
- package/CHANGELOG.md +49 -0
- package/dist/starter/.storybook/main.ts +4 -1
- package/dist/starter/.storybook/manager.ts +4 -5
- package/dist/starter/codegen.ts +17 -0
- package/dist/starter/package.json +8 -4
- package/dist/starter/pnpm-lock.yaml +2643 -69
- package/dist/starter/scripts/build-component-db.ts +157 -0
- package/dist/starter/src/components/ui/Accordion.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Accordion.tsx +4 -0
- package/dist/starter/src/components/ui/Alert.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Alert.tsx +7 -0
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +2 -0
- package/dist/starter/src/components/ui/AlertDialog.tsx +15 -0
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +2 -0
- package/dist/starter/src/components/ui/AspectRatio.tsx +4 -0
- package/dist/starter/src/components/ui/Avatar.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Avatar.tsx +11 -0
- package/dist/starter/src/components/ui/Badge.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Badge.tsx +5 -0
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Breadcrumb.tsx +12 -0
- package/dist/starter/src/components/ui/Button.stories.tsx +10 -0
- package/dist/starter/src/components/ui/Button.tsx +5 -0
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ButtonGroup.tsx +6 -0
- package/dist/starter/src/components/ui/Calendar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Calendar.tsx +6 -0
- package/dist/starter/src/components/ui/Card.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Card.tsx +10 -0
- package/dist/starter/src/components/ui/Carousel.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Carousel.tsx +9 -0
- package/dist/starter/src/components/ui/Chart.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Chart.tsx +9 -0
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Checkbox.tsx +1 -0
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Collapsible.tsx +3 -0
- package/dist/starter/src/components/ui/Combobox.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Combobox.tsx +29 -0
- package/dist/starter/src/components/ui/Command.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Command.tsx +20 -0
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ContextMenu.tsx +20 -0
- package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +1 -0
- package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +1 -0
- package/dist/starter/src/components/ui/DesignSystem-Overview.stories.tsx +1 -0
- package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Dialog.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Dialog.tsx +18 -0
- package/dist/starter/src/components/ui/Direction.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Direction.tsx +6 -0
- package/dist/starter/src/components/ui/Drawer.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Drawer.tsx +18 -0
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/DropdownMenu.tsx +20 -0
- package/dist/starter/src/components/ui/Empty.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Empty.tsx +13 -0
- package/dist/starter/src/components/ui/Field.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Field.tsx +25 -0
- package/dist/starter/src/components/ui/Form.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Form.tsx +15 -3
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +2 -0
- package/dist/starter/src/components/ui/HoverCard.tsx +3 -0
- package/dist/starter/src/components/ui/Input.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Input.tsx +1 -0
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +3 -0
- package/dist/starter/src/components/ui/InputGroup.tsx +6 -0
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +2 -0
- package/dist/starter/src/components/ui/InputOTP.tsx +4 -0
- package/dist/starter/src/components/ui/Item.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Item.tsx +10 -0
- package/dist/starter/src/components/ui/Kbd.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Kbd.tsx +4 -0
- package/dist/starter/src/components/ui/Label.stories.tsx +5 -0
- package/dist/starter/src/components/ui/Label.tsx +4 -0
- package/dist/starter/src/components/ui/Menubar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Menubar.tsx +15 -0
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +3 -0
- package/dist/starter/src/components/ui/NativeSelect.tsx +6 -0
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +2 -0
- package/dist/starter/src/components/ui/NavigationMenu.tsx +10 -0
- package/dist/starter/src/components/ui/Pagination.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Pagination.tsx +8 -0
- package/dist/starter/src/components/ui/Popover.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Popover.tsx +5 -0
- package/dist/starter/src/components/ui/Progress.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Progress.tsx +1 -0
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +2 -0
- package/dist/starter/src/components/ui/RadioGroup.tsx +5 -0
- package/dist/starter/src/components/ui/Resizable.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Resizable.tsx +7 -0
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +2 -0
- package/dist/starter/src/components/ui/ScrollArea.tsx +5 -0
- package/dist/starter/src/components/ui/Select.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Select.tsx +9 -0
- package/dist/starter/src/components/ui/Separator.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Separator.tsx +1 -0
- package/dist/starter/src/components/ui/Sheet.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Sheet.tsx +8 -0
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Sidebar.tsx +20 -0
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Skeleton.tsx +4 -0
- package/dist/starter/src/components/ui/Slider.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Slider.tsx +1 -0
- package/dist/starter/src/components/ui/Sonner.stories.tsx +1 -0
- package/dist/starter/src/components/ui/Sonner.tsx +4 -0
- package/dist/starter/src/components/ui/Spinner.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Spinner.tsx +4 -0
- package/dist/starter/src/components/ui/Switch.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Switch.tsx +2 -0
- package/dist/starter/src/components/ui/Table.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Table.tsx +11 -0
- package/dist/starter/src/components/ui/Tabs.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Tabs.tsx +6 -0
- package/dist/starter/src/components/ui/Textarea.stories.tsx +3 -0
- package/dist/starter/src/components/ui/Textarea.tsx +4 -0
- package/dist/starter/src/components/ui/Toast.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Toast.tsx +9 -0
- package/dist/starter/src/components/ui/Toaster.tsx +4 -0
- package/dist/starter/src/components/ui/Toggle.stories.tsx +4 -0
- package/dist/starter/src/components/ui/Toggle.tsx +1 -0
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +3 -0
- package/dist/starter/src/components/ui/ToggleGroup.tsx +3 -0
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +2 -0
- package/dist/starter/src/components/ui/Tooltip.tsx +6 -0
- package/dist/starter/src/gql/execute.ts +11 -0
- package/dist/starter/src/gql/fragment-masking.ts +83 -0
- package/dist/starter/src/gql/gql.ts +9 -0
- package/dist/starter/src/gql/graphql.ts +182 -0
- package/dist/starter/src/gql/index.ts +2 -0
- package/dist/starter/src/graphql/mutations.ts +0 -0
- package/dist/starter/src/graphql/queries.ts +0 -0
- package/dist/starter/tsconfig.json +6 -0
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ const meta: Meta<typeof Tabs> = {
|
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Tabs>;
|
|
10
10
|
|
|
11
|
+
/** Shows the default pill-style tabs with three panels. */
|
|
11
12
|
export const Default: Story = {
|
|
12
13
|
render: () => (
|
|
13
14
|
<Tabs defaultValue="account" className="w-[400px]">
|
|
@@ -29,6 +30,7 @@ export const Default: Story = {
|
|
|
29
30
|
),
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
/** Shows the line variant where the active tab is indicated by an underline rather than a background. */
|
|
32
34
|
export const LineVariant: Story = {
|
|
33
35
|
render: () => (
|
|
34
36
|
<Tabs defaultValue="overview" className="w-[400px]">
|
|
@@ -4,6 +4,7 @@ import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
7
|
+
/** Layered content panels activated by tab triggers. Supports horizontal and vertical orientations with keyboard navigation. */
|
|
7
8
|
function Tabs({ className, orientation = 'horizontal', ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
8
9
|
return (
|
|
9
10
|
<TabsPrimitive.Root
|
|
@@ -31,6 +32,9 @@ const tabsListVariants = cva(
|
|
|
31
32
|
},
|
|
32
33
|
);
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The container for tab triggers. Supports "default" (pill background) and "line" (underline indicator) variants.
|
|
37
|
+
*/
|
|
34
38
|
function TabsList({
|
|
35
39
|
className,
|
|
36
40
|
variant = 'default',
|
|
@@ -46,6 +50,7 @@ function TabsList({
|
|
|
46
50
|
);
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
/** A clickable tab button that activates its associated TabsContent panel. */
|
|
49
54
|
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
50
55
|
return (
|
|
51
56
|
<TabsPrimitive.Trigger
|
|
@@ -62,6 +67,7 @@ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPr
|
|
|
62
67
|
);
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
/** The content panel associated with a tab trigger, shown when its corresponding trigger is active. */
|
|
65
71
|
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
66
72
|
return <TabsPrimitive.Content data-slot="tabs-content" className={cn('flex-1 outline-none', className)} {...props} />;
|
|
67
73
|
}
|
|
@@ -8,14 +8,17 @@ const meta: Meta<typeof Textarea> = {
|
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Textarea>;
|
|
10
10
|
|
|
11
|
+
/** Shows the textarea in its default empty state. */
|
|
11
12
|
export const Default: Story = {};
|
|
12
13
|
|
|
14
|
+
/** Shows the textarea with placeholder text. */
|
|
13
15
|
export const WithPlaceholder: Story = {
|
|
14
16
|
args: {
|
|
15
17
|
placeholder: 'Type your message here...',
|
|
16
18
|
},
|
|
17
19
|
};
|
|
18
20
|
|
|
21
|
+
/** Shows a disabled textarea that cannot receive input. */
|
|
19
22
|
export const Disabled: Story = {
|
|
20
23
|
args: {
|
|
21
24
|
placeholder: 'This textarea is disabled',
|
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { cn } from '@/lib/utils';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A multi-line text input that auto-sizes to its content via field-sizing-content.
|
|
7
|
+
* Supports aria-invalid styling for form validation errors.
|
|
8
|
+
*/
|
|
5
9
|
function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
|
|
6
10
|
return (
|
|
7
11
|
<textarea
|
|
@@ -40,6 +40,7 @@ function ToastDemo() {
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/** Demonstrates triggering a basic toast notification with a title and description. */
|
|
43
44
|
export const Default: Story = {
|
|
44
45
|
render: () => <ToastDemo />,
|
|
45
46
|
};
|
|
@@ -66,6 +67,7 @@ function ToastDestructiveDemo() {
|
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/** Shows a destructive-variant toast for error or warning scenarios. */
|
|
69
71
|
export const Destructive: Story = {
|
|
70
72
|
render: () => <ToastDestructiveDemo />,
|
|
71
73
|
};
|
|
@@ -92,10 +94,12 @@ function ToastWithActionDemo() {
|
|
|
92
94
|
);
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
/** Shows a toast with an action button (e.g., "Undo") alongside the message. */
|
|
95
98
|
export const WithAction: Story = {
|
|
96
99
|
render: () => <ToastWithActionDemo />,
|
|
97
100
|
};
|
|
98
101
|
|
|
102
|
+
/** Shows a toast rendered inline (always open) using the primitive subcomponents directly. */
|
|
99
103
|
export const Inline: Story = {
|
|
100
104
|
render: () => (
|
|
101
105
|
<ToastProvider>
|
|
@@ -7,10 +7,14 @@ import { Toast as ToastPrimitive } from 'radix-ui';
|
|
|
7
7
|
|
|
8
8
|
import { cn } from '@/lib/utils';
|
|
9
9
|
|
|
10
|
+
/** Temporary notification at screen edge with swipe-to-dismiss. Supports default and destructive variants. */
|
|
11
|
+
|
|
12
|
+
/** Provides the toast context for managing toast state and swipe behavior. */
|
|
10
13
|
function ToastProvider({ ...props }: React.ComponentProps<typeof ToastPrimitive.Provider>) {
|
|
11
14
|
return <ToastPrimitive.Provider data-slot="toast-provider" {...props} />;
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
/** The fixed-position viewport where toasts are rendered, positioned at bottom-right on larger screens. */
|
|
14
18
|
function ToastViewport({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Viewport>) {
|
|
15
19
|
return (
|
|
16
20
|
<ToastPrimitive.Viewport
|
|
@@ -39,6 +43,7 @@ const toastVariants = cva(
|
|
|
39
43
|
},
|
|
40
44
|
);
|
|
41
45
|
|
|
46
|
+
/** An individual toast notification with default or destructive variant styling. */
|
|
42
47
|
function Toast({
|
|
43
48
|
className,
|
|
44
49
|
variant,
|
|
@@ -47,6 +52,7 @@ function Toast({
|
|
|
47
52
|
return <ToastPrimitive.Root data-slot="toast" className={cn(toastVariants({ variant }), className)} {...props} />;
|
|
48
53
|
}
|
|
49
54
|
|
|
55
|
+
/** An action button displayed within a toast, such as "Undo" or "Retry". */
|
|
50
56
|
function ToastAction({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Action>) {
|
|
51
57
|
return (
|
|
52
58
|
<ToastPrimitive.Action
|
|
@@ -60,6 +66,7 @@ function ToastAction({ className, ...props }: React.ComponentProps<typeof ToastP
|
|
|
60
66
|
);
|
|
61
67
|
}
|
|
62
68
|
|
|
69
|
+
/** A close button positioned in the top-right corner of a toast, visible on hover. */
|
|
63
70
|
function ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Close>) {
|
|
64
71
|
return (
|
|
65
72
|
<ToastPrimitive.Close
|
|
@@ -76,6 +83,7 @@ function ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPr
|
|
|
76
83
|
);
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
/** The bold heading text of a toast notification. */
|
|
79
87
|
function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {
|
|
80
88
|
return (
|
|
81
89
|
<ToastPrimitive.Title
|
|
@@ -86,6 +94,7 @@ function ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPr
|
|
|
86
94
|
);
|
|
87
95
|
}
|
|
88
96
|
|
|
97
|
+
/** The secondary descriptive text of a toast notification. */
|
|
89
98
|
function ToastDescription({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Description>) {
|
|
90
99
|
return (
|
|
91
100
|
<ToastPrimitive.Description
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
import { useToast } from '@/hooks/use-toast';
|
|
4
4
|
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '@/components/ui/Toast';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Renders all active toasts from the useToast hook into a fixed-position viewport.
|
|
8
|
+
* Place once at the app root to enable imperative toast notifications via the useToast hook.
|
|
9
|
+
*/
|
|
6
10
|
function Toaster() {
|
|
7
11
|
const { toasts } = useToast();
|
|
8
12
|
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof Toggle> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof Toggle>;
|
|
11
11
|
|
|
12
|
+
/** Shows a toggle button with a bold icon in the default ghost variant. */
|
|
12
13
|
export const Default: Story = {
|
|
13
14
|
args: {
|
|
14
15
|
'aria-label': 'Toggle bold',
|
|
@@ -16,6 +17,7 @@ export const Default: Story = {
|
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
19
|
|
|
20
|
+
/** Shows the outline variant with a visible border. */
|
|
19
21
|
export const Outline: Story = {
|
|
20
22
|
args: {
|
|
21
23
|
variant: 'outline',
|
|
@@ -24,6 +26,7 @@ export const Outline: Story = {
|
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
|
|
29
|
+
/** Shows a toggle with a text label instead of an icon. */
|
|
27
30
|
export const WithText: Story = {
|
|
28
31
|
args: {
|
|
29
32
|
'aria-label': 'Toggle italic',
|
|
@@ -31,6 +34,7 @@ export const WithText: Story = {
|
|
|
31
34
|
},
|
|
32
35
|
};
|
|
33
36
|
|
|
37
|
+
/** Shows a toggle in its initially pressed (on) state. */
|
|
34
38
|
export const Pressed: Story = {
|
|
35
39
|
args: {
|
|
36
40
|
defaultPressed: true,
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof ToggleGroup> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof ToggleGroup>;
|
|
11
11
|
|
|
12
|
+
/** Shows a single-selection toggle group where only one item can be active at a time. */
|
|
12
13
|
export const Single: Story = {
|
|
13
14
|
render: () => (
|
|
14
15
|
<ToggleGroup type="single">
|
|
@@ -25,6 +26,7 @@ export const Single: Story = {
|
|
|
25
26
|
),
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
/** Shows a multi-selection toggle group with bold and italic pre-selected. */
|
|
28
30
|
export const Multiple: Story = {
|
|
29
31
|
render: () => (
|
|
30
32
|
<ToggleGroup type="multiple" defaultValue={['bold', 'italic']}>
|
|
@@ -41,6 +43,7 @@ export const Multiple: Story = {
|
|
|
41
43
|
),
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
/** Shows a toggle group using the outline variant with visible borders. */
|
|
44
47
|
export const Outline: Story = {
|
|
45
48
|
render: () => (
|
|
46
49
|
<ToggleGroup type="single" variant="outline">
|
|
@@ -17,10 +17,12 @@ const ToggleGroupContext = React.createContext<
|
|
|
17
17
|
spacing: 0,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
/** A group of toggles where one (`type="single"`) or multiple (`type="multiple"`) can be active. */
|
|
20
21
|
function ToggleGroup({
|
|
21
22
|
className,
|
|
22
23
|
variant,
|
|
23
24
|
size,
|
|
25
|
+
/** Controls gap between items. When 0, items are visually joined with shared borders. */
|
|
24
26
|
spacing = 0,
|
|
25
27
|
children,
|
|
26
28
|
...props
|
|
@@ -46,6 +48,7 @@ function ToggleGroup({
|
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
/** An individual toggle button within a ToggleGroup. Inherits variant and size from the parent group context. */
|
|
49
52
|
function ToggleGroupItem({
|
|
50
53
|
className,
|
|
51
54
|
children,
|
|
@@ -9,6 +9,7 @@ const meta: Meta<typeof Tooltip> = {
|
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof Tooltip>;
|
|
11
11
|
|
|
12
|
+
/** Shows a basic tooltip appearing on hover over a button. */
|
|
12
13
|
export const Default: Story = {
|
|
13
14
|
render: () => (
|
|
14
15
|
<TooltipProvider>
|
|
@@ -24,6 +25,7 @@ export const Default: Story = {
|
|
|
24
25
|
),
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
/** Shows a tooltip with additional spacing between the trigger and content via sideOffset. */
|
|
27
29
|
export const WithSideOffset: Story = {
|
|
28
30
|
render: () => (
|
|
29
31
|
<TooltipProvider>
|
|
@@ -3,18 +3,24 @@ import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
|
3
3
|
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
5
5
|
|
|
6
|
+
/** Brief descriptive popup on hover/focus. Has enter/exit animations and arrow indicator. Wrap app in TooltipProvider first. */
|
|
7
|
+
|
|
8
|
+
/** Provides shared tooltip configuration (e.g., delay duration) for all nested Tooltip instances. */
|
|
6
9
|
function TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
7
10
|
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props} />;
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/** The root component that manages open/close state for a single tooltip. */
|
|
10
14
|
function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
11
15
|
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
|
|
12
16
|
}
|
|
13
17
|
|
|
18
|
+
/** The element that triggers the tooltip on hover or focus. */
|
|
14
19
|
function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
15
20
|
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
/** The popup content panel rendered via a portal with an arrow indicator. */
|
|
18
24
|
function TooltipContent({
|
|
19
25
|
className,
|
|
20
26
|
sideOffset = 0,
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export type Maybe<T> = T | null;
|
|
3
|
+
export type InputMaybe<T> = T | null | undefined;
|
|
4
|
+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
5
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
6
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
7
|
+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
|
8
|
+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
|
9
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
10
|
+
export type Scalars = {
|
|
11
|
+
ID: { input: string; output: string; }
|
|
12
|
+
String: { input: string; output: string; }
|
|
13
|
+
Boolean: { input: boolean; output: boolean; }
|
|
14
|
+
Int: { input: number; output: number; }
|
|
15
|
+
Float: { input: number; output: number; }
|
|
16
|
+
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format. */
|
|
17
|
+
DateTimeISO: { input: any; output: any; }
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ActiveWorkoutView = {
|
|
21
|
+
__typename?: 'ActiveWorkoutView';
|
|
22
|
+
duration: Scalars['String']['output'];
|
|
23
|
+
exercises: Array<ActiveWorkoutViewExercises>;
|
|
24
|
+
sessionId: Scalars['String']['output'];
|
|
25
|
+
totalSets: Scalars['Float']['output'];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ActiveWorkoutViewExercises = {
|
|
29
|
+
__typename?: 'ActiveWorkoutViewExercises';
|
|
30
|
+
exerciseId: Scalars['String']['output'];
|
|
31
|
+
reps: Scalars['Float']['output'];
|
|
32
|
+
sets: Scalars['Float']['output'];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type CalculateWorkoutStatsInput = {
|
|
36
|
+
sessionId: Scalars['String']['input'];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type CompleteWorkoutInput = {
|
|
40
|
+
endTime: Scalars['DateTimeISO']['input'];
|
|
41
|
+
sessionId: Scalars['String']['input'];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type Mutation = {
|
|
45
|
+
__typename?: 'Mutation';
|
|
46
|
+
calculateWorkoutStats: MutationResponse;
|
|
47
|
+
completeWorkout: MutationResponse;
|
|
48
|
+
setFitnessGoal: MutationResponse;
|
|
49
|
+
startWorkout: MutationResponse;
|
|
50
|
+
updateGoalProgress: MutationResponse;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export type MutationCalculateWorkoutStatsArgs = {
|
|
55
|
+
input: CalculateWorkoutStatsInput;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export type MutationCompleteWorkoutArgs = {
|
|
60
|
+
input: CompleteWorkoutInput;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export type MutationSetFitnessGoalArgs = {
|
|
65
|
+
input: SetFitnessGoalInput;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export type MutationStartWorkoutArgs = {
|
|
70
|
+
input: StartWorkoutInput;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export type MutationUpdateGoalProgressArgs = {
|
|
75
|
+
input: UpdateGoalProgressInput;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type MutationError = {
|
|
79
|
+
__typename?: 'MutationError';
|
|
80
|
+
message?: Maybe<Scalars['String']['output']>;
|
|
81
|
+
type: Scalars['String']['output'];
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type MutationResponse = {
|
|
85
|
+
__typename?: 'MutationResponse';
|
|
86
|
+
error?: Maybe<MutationError>;
|
|
87
|
+
success: Scalars['Boolean']['output'];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type ProgressDashboardView = {
|
|
91
|
+
__typename?: 'ProgressDashboardView';
|
|
92
|
+
avgVolume: Scalars['Float']['output'];
|
|
93
|
+
goals: Array<ProgressDashboardViewGoals>;
|
|
94
|
+
totalWorkouts: Scalars['Float']['output'];
|
|
95
|
+
userId: Scalars['String']['output'];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type ProgressDashboardViewGoals = {
|
|
99
|
+
__typename?: 'ProgressDashboardViewGoals';
|
|
100
|
+
complete: Scalars['Boolean']['output'];
|
|
101
|
+
goalId: Scalars['String']['output'];
|
|
102
|
+
progress: Scalars['Float']['output'];
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type Query = {
|
|
106
|
+
__typename?: 'Query';
|
|
107
|
+
activeWorkout: Array<ActiveWorkoutView>;
|
|
108
|
+
progressDashboard: Array<ProgressDashboardView>;
|
|
109
|
+
workoutHistory: Array<WorkoutHistoryView>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
export type QueryActiveWorkoutArgs = {
|
|
114
|
+
userId?: InputMaybe<Scalars['ID']['input']>;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
export type QueryProgressDashboardArgs = {
|
|
119
|
+
userId?: InputMaybe<Scalars['ID']['input']>;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
export type QueryWorkoutHistoryArgs = {
|
|
124
|
+
input?: InputMaybe<Scalars['String']['input']>;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type SetFitnessGoalInput = {
|
|
128
|
+
goalId: Scalars['String']['input'];
|
|
129
|
+
periodStart: Scalars['DateTimeISO']['input'];
|
|
130
|
+
target: Scalars['Float']['input'];
|
|
131
|
+
type: Scalars['String']['input'];
|
|
132
|
+
userId: Scalars['String']['input'];
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type StartWorkoutExercisesInput = {
|
|
136
|
+
exerciseId: Scalars['String']['input'];
|
|
137
|
+
reps: Scalars['Float']['input'];
|
|
138
|
+
sets: Scalars['Float']['input'];
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export type StartWorkoutInput = {
|
|
142
|
+
exercises: Array<StartWorkoutExercisesInput>;
|
|
143
|
+
sessionId: Scalars['String']['input'];
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export type UpdateGoalProgressInput = {
|
|
147
|
+
addedVolume: Scalars['Float']['input'];
|
|
148
|
+
goalId: Scalars['String']['input'];
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type WorkoutHistoryView = {
|
|
152
|
+
__typename?: 'WorkoutHistoryView';
|
|
153
|
+
sessions: Array<WorkoutHistoryViewSessions>;
|
|
154
|
+
userId: Scalars['String']['output'];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type WorkoutHistoryViewSessions = {
|
|
158
|
+
__typename?: 'WorkoutHistoryViewSessions';
|
|
159
|
+
date: Scalars['DateTimeISO']['output'];
|
|
160
|
+
duration: Scalars['String']['output'];
|
|
161
|
+
sessionId: Scalars['String']['output'];
|
|
162
|
+
volume: Scalars['Float']['output'];
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export class TypedDocumentString<TResult, TVariables>
|
|
166
|
+
extends String
|
|
167
|
+
implements DocumentTypeDecoration<TResult, TVariables>
|
|
168
|
+
{
|
|
169
|
+
__apiType?: NonNullable<DocumentTypeDecoration<TResult, TVariables>['__apiType']>;
|
|
170
|
+
private value: string;
|
|
171
|
+
public __meta__?: Record<string, any> | undefined;
|
|
172
|
+
|
|
173
|
+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
|
|
174
|
+
super(value);
|
|
175
|
+
this.value = value;
|
|
176
|
+
this.__meta__ = __meta__;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
override toString(): string & DocumentTypeDecoration<TResult, TVariables> {
|
|
180
|
+
return this.value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"debug": "^4.4.1",
|
|
22
|
-
"@auto-engineer/message-bus": "1.
|
|
22
|
+
"@auto-engineer/message-bus": "1.35.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/debug": "^4.1.12"
|
|
26
26
|
},
|
|
27
|
-
"version": "1.
|
|
27
|
+
"version": "1.35.0",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp -r starter dist/",
|
|
30
30
|
"test-cli": "tsx test-cli.ts",
|