@motiadev/workbench 0.0.1 → 0.0.3
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/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/middleware.d.ts +3 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +47 -0
- package/dist/src/components/app-sidebar.d.ts +2 -0
- package/dist/src/components/app-sidebar.d.ts.map +1 -0
- package/dist/src/components/app-sidebar.js +13 -0
- package/dist/src/components/log-console.d.ts +2 -0
- package/dist/src/components/log-console.d.ts.map +1 -0
- package/dist/src/components/log-console.js +20 -0
- package/dist/src/components/log-level-badge.d.ts +4 -0
- package/dist/src/components/log-level-badge.d.ts.map +1 -0
- package/dist/src/components/log-level-badge.js +11 -0
- package/dist/src/components/ui/badge.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts.map +1 -0
- package/dist/src/components/ui/badge.js +23 -0
- package/dist/src/components/ui/button.d.ts +12 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/button.js +34 -0
- package/dist/src/components/ui/collapsible.d.ts +6 -0
- package/dist/src/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/components/ui/collapsible.js +5 -0
- package/dist/src/components/ui/dialog.d.ts +20 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.js +22 -0
- package/dist/src/components/ui/input.d.ts +4 -0
- package/dist/src/components/ui/input.d.ts.map +1 -0
- package/dist/src/components/ui/input.js +8 -0
- package/dist/src/components/ui/label.d.ts +6 -0
- package/dist/src/components/ui/label.d.ts.map +1 -0
- package/dist/src/components/ui/label.js +10 -0
- package/dist/src/components/ui/select.d.ts +14 -0
- package/dist/src/components/ui/select.d.ts.map +1 -0
- package/dist/src/components/ui/select.js +26 -0
- package/dist/src/components/ui/separator.d.ts +5 -0
- package/dist/src/components/ui/separator.d.ts.map +1 -0
- package/dist/src/components/ui/separator.js +8 -0
- package/dist/src/components/ui/sheet.d.ts +26 -0
- package/dist/src/components/ui/sheet.d.ts.map +1 -0
- package/dist/src/components/ui/sheet.js +36 -0
- package/dist/src/components/ui/sidebar.d.ts +67 -0
- package/dist/src/components/ui/sidebar.d.ts.map +1 -0
- package/dist/src/components/ui/sidebar.js +221 -0
- package/dist/src/components/ui/skeleton.d.ts +3 -0
- package/dist/src/components/ui/skeleton.d.ts.map +1 -0
- package/dist/src/components/ui/skeleton.js +6 -0
- package/dist/src/components/ui/switch.d.ts +5 -0
- package/dist/src/components/ui/switch.d.ts.map +1 -0
- package/dist/src/components/ui/switch.js +7 -0
- package/dist/src/components/ui/table.d.ts +11 -0
- package/dist/src/components/ui/table.d.ts.map +1 -0
- package/dist/src/components/ui/table.js +20 -0
- package/dist/src/components/ui/textarea.d.ts +4 -0
- package/dist/src/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/components/ui/textarea.js +8 -0
- package/dist/src/components/ui/tooltip.d.ts +8 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.js +11 -0
- package/dist/src/hooks/use-list-flows.d.ts +10 -0
- package/dist/src/hooks/use-list-flows.d.ts.map +1 -0
- package/dist/src/hooks/use-list-flows.js +12 -0
- package/dist/src/hooks/use-log-listener.d.ts +6 -0
- package/dist/src/hooks/use-log-listener.d.ts.map +1 -0
- package/dist/src/hooks/use-log-listener.js +22 -0
- package/dist/src/hooks/use-mobile.d.ts +2 -0
- package/dist/src/hooks/use-mobile.d.ts.map +1 -0
- package/dist/src/hooks/use-mobile.js +15 -0
- package/dist/src/lib/utils.d.ts +3 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +5 -0
- package/dist/src/main.d.ts +9 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +15 -0
- package/dist/src/publicComponents/api-node.d.ts +8 -0
- package/dist/src/publicComponents/api-node.d.ts.map +1 -0
- package/dist/src/publicComponents/api-node.js +7 -0
- package/dist/src/publicComponents/base-handle.d.ts +8 -0
- package/dist/src/publicComponents/base-handle.d.ts.map +1 -0
- package/dist/src/publicComponents/base-handle.js +7 -0
- package/dist/src/publicComponents/base-node.d.ts +16 -0
- package/dist/src/publicComponents/base-node.d.ts.map +1 -0
- package/dist/src/publicComponents/base-node.js +20 -0
- package/dist/src/publicComponents/emits.d.ts +5 -0
- package/dist/src/publicComponents/emits.d.ts.map +1 -0
- package/dist/src/publicComponents/emits.js +6 -0
- package/dist/src/publicComponents/event-node.d.ts +9 -0
- package/dist/src/publicComponents/event-node.d.ts.map +1 -0
- package/dist/src/publicComponents/event-node.js +9 -0
- package/dist/src/publicComponents/node-props.d.ts +12 -0
- package/dist/src/publicComponents/node-props.d.ts.map +1 -0
- package/dist/src/publicComponents/node-props.js +1 -0
- package/dist/src/publicComponents/noop-node.d.ts +8 -0
- package/dist/src/publicComponents/noop-node.d.ts.map +1 -0
- package/dist/src/publicComponents/noop-node.js +5 -0
- package/dist/src/publicComponents/subscribe.d.ts +5 -0
- package/dist/src/publicComponents/subscribe.d.ts.map +1 -0
- package/dist/src/publicComponents/subscribe.js +5 -0
- package/dist/src/route-wrapper.d.ts +4 -0
- package/dist/src/route-wrapper.d.ts.map +1 -0
- package/dist/src/route-wrapper.js +4 -0
- package/dist/src/routeTree.gen.d.ts +53 -0
- package/dist/src/routeTree.gen.d.ts.map +1 -0
- package/dist/src/routeTree.gen.js +45 -0
- package/dist/src/routes/__root.d.ts +2 -0
- package/dist/src/routes/__root.d.ts.map +1 -0
- package/dist/src/routes/__root.js +15 -0
- package/dist/src/routes/flow/$id.d.ts +4 -0
- package/dist/src/routes/flow/$id.d.ts.map +1 -0
- package/dist/src/routes/flow/$id.js +15 -0
- package/dist/src/routes/index.d.ts +2 -0
- package/dist/src/routes/index.d.ts.map +1 -0
- package/dist/src/routes/index.js +8 -0
- package/dist/src/stores/use-logs.d.ts +15 -0
- package/dist/src/stores/use-logs.d.ts.map +1 -0
- package/dist/src/stores/use-logs.js +6 -0
- package/dist/src/views/flow/arrow-head.d.ts +8 -0
- package/dist/src/views/flow/arrow-head.d.ts.map +1 -0
- package/dist/src/views/flow/arrow-head.js +2 -0
- package/dist/src/views/flow/base-edge.d.ts +4 -0
- package/dist/src/views/flow/base-edge.d.ts.map +1 -0
- package/dist/src/views/flow/base-edge.js +22 -0
- package/dist/src/views/flow/flow-loader.d.ts +2 -0
- package/dist/src/views/flow/flow-loader.d.ts.map +1 -0
- package/dist/src/views/flow/flow-loader.js +4 -0
- package/dist/src/views/flow/flow-view.d.ts +8 -0
- package/dist/src/views/flow/flow-view.d.ts.map +1 -0
- package/dist/src/views/flow/flow-view.js +40 -0
- package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +40 -0
- package/dist/src/views/flow/hooks/use-get-flow-state.d.ts.map +1 -0
- package/dist/src/views/flow/hooks/use-get-flow-state.js +48 -0
- package/dist/src/views/flow/hooks/use-organize-nodes.d.ts +4 -0
- package/dist/src/views/flow/hooks/use-organize-nodes.d.ts.map +1 -0
- package/dist/src/views/flow/hooks/use-organize-nodes.js +43 -0
- package/dist/src/views/flow/legend.d.ts +4 -0
- package/dist/src/views/flow/legend.d.ts.map +1 -0
- package/dist/src/views/flow/legend.js +41 -0
- package/dist/src/views/flow/node-organizer.d.ts +6 -0
- package/dist/src/views/flow/node-organizer.d.ts.map +1 -0
- package/dist/src/views/flow/node-organizer.js +51 -0
- package/dist/src/views/flow/nodes/api-flow-node.d.ts +5 -0
- package/dist/src/views/flow/nodes/api-flow-node.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/api-flow-node.js +5 -0
- package/dist/src/views/flow/nodes/event-flow-node.d.ts +3 -0
- package/dist/src/views/flow/nodes/event-flow-node.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/event-flow-node.js +5 -0
- package/dist/src/views/flow/nodes/json-schema-form.d.ts +9 -0
- package/dist/src/views/flow/nodes/json-schema-form.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/json-schema-form.js +35 -0
- package/dist/src/views/flow/nodes/language-indicator.d.ts +8 -0
- package/dist/src/views/flow/nodes/language-indicator.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/language-indicator.js +25 -0
- package/dist/src/views/flow/nodes/nodes.types.d.ts +37 -0
- package/dist/src/views/flow/nodes/nodes.types.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/nodes.types.js +1 -0
- package/dist/src/views/flow/nodes/noop-flow-node.d.ts +5 -0
- package/dist/src/views/flow/nodes/noop-flow-node.d.ts.map +1 -0
- package/dist/src/views/flow/nodes/noop-flow-node.js +5 -0
- package/dist/tailwind.config.d.ts +4 -0
- package/dist/tailwind.config.d.ts.map +1 -0
- package/dist/tailwind.config.js +77 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -0
- package/dist/tsconfig.node.tsbuildinfo +1 -0
- package/dist/vite.config.d.ts +11 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vite.config.js +18 -0
- package/middleware.ts +3 -2
- package/package.json +5 -3
- package/postcss.config.js +1 -1
- package/src/views/flow/base-edge.tsx +7 -20
- package/src/views/flow/flow-view.tsx +1 -1
- package/src/views/flow/hooks/use-get-flow-state.tsx +18 -34
- package/src/views/flow/legend.tsx +45 -8
- package/src/views/flow/nodes/nodes.types.ts +4 -4
- package/tsconfig.app.json +7 -5
- package/tsconfig.json +1 -0
- package/tsconfig.node.json +15 -5
- package/vite.config.ts +3 -3
- package/dist/.empty +0 -0
- package/dist/assets/index-DGmArPOa.css +0 -1
- package/dist/assets/index-hQsWtfVb.js +0 -182
- package/dist/index.html +0 -20
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { PanelLeft } from 'lucide-react';
|
|
6
|
+
import { useIsMobile } from '@/hooks/use-mobile';
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
|
+
import { Button } from '@/components/ui/button';
|
|
9
|
+
import { Input } from '@/components/ui/input';
|
|
10
|
+
import { Separator } from '@/components/ui/separator';
|
|
11
|
+
import { Sheet, SheetContent } from '@/components/ui/sheet';
|
|
12
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
|
14
|
+
const SIDEBAR_COOKIE_NAME = 'sidebar:state';
|
|
15
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
16
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
17
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
18
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
19
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
20
|
+
const SidebarContext = React.createContext(null);
|
|
21
|
+
function useSidebar() {
|
|
22
|
+
const context = React.useContext(SidebarContext);
|
|
23
|
+
if (!context) {
|
|
24
|
+
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
25
|
+
}
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
const SidebarProvider = React.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {
|
|
29
|
+
const isMobile = useIsMobile();
|
|
30
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
31
|
+
// This is the internal state of the sidebar.
|
|
32
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
33
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
34
|
+
const open = openProp ?? _open;
|
|
35
|
+
const setOpen = React.useCallback((value) => {
|
|
36
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
37
|
+
if (setOpenProp) {
|
|
38
|
+
setOpenProp(openState);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
_setOpen(openState);
|
|
42
|
+
}
|
|
43
|
+
// This sets the cookie to keep the sidebar state.
|
|
44
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
45
|
+
}, [setOpenProp, open]);
|
|
46
|
+
// Helper to toggle the sidebar.
|
|
47
|
+
const toggleSidebar = React.useCallback(() => {
|
|
48
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
49
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
50
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
const handleKeyDown = (event) => {
|
|
53
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
toggleSidebar();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
59
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
60
|
+
}, [toggleSidebar]);
|
|
61
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
62
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
63
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
64
|
+
const contextValue = React.useMemo(() => ({
|
|
65
|
+
state,
|
|
66
|
+
open,
|
|
67
|
+
setOpen,
|
|
68
|
+
isMobile,
|
|
69
|
+
openMobile,
|
|
70
|
+
setOpenMobile,
|
|
71
|
+
toggleSidebar,
|
|
72
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
73
|
+
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { style: {
|
|
74
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
75
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
76
|
+
...style,
|
|
77
|
+
}, className: cn('group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar', className), ref: ref, ...props, children: children }) }) }));
|
|
78
|
+
});
|
|
79
|
+
SidebarProvider.displayName = 'SidebarProvider';
|
|
80
|
+
const Sidebar = React.forwardRef(({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {
|
|
81
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
82
|
+
if (collapsible === 'none') {
|
|
83
|
+
return (_jsx("div", { className: cn('flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground', className), ref: ref, ...props, children: children }));
|
|
84
|
+
}
|
|
85
|
+
if (isMobile) {
|
|
86
|
+
return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsx(SheetContent, { "data-sidebar": "sidebar", "data-mobile": "true", className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", style: {
|
|
87
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
88
|
+
}, side: side, children: _jsx("div", { className: "flex h-full w-full flex-col", children: children }) }) }));
|
|
89
|
+
}
|
|
90
|
+
return (_jsxs("div", { ref: ref, className: "group peer hidden md:block text-sidebar-foreground", "data-state": state, "data-collapsible": state === 'collapsed' ? collapsible : '', "data-variant": variant, "data-side": side, children: [_jsx("div", { className: cn('duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', variant === 'floating' || variant === 'inset'
|
|
91
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'
|
|
92
|
+
: 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]') }), _jsx("div", { className: cn('duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex', side === 'left'
|
|
93
|
+
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
94
|
+
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
95
|
+
// Adjust the padding for floating and inset variants.
|
|
96
|
+
variant === 'floating' || variant === 'inset'
|
|
97
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'
|
|
98
|
+
: 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l', className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow", children: children }) })] }));
|
|
99
|
+
});
|
|
100
|
+
Sidebar.displayName = 'Sidebar';
|
|
101
|
+
const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
102
|
+
const { toggleSidebar } = useSidebar();
|
|
103
|
+
return (_jsxs(Button, { ref: ref, "data-sidebar": "trigger", variant: "ghost", size: "icon", className: cn('h-7 w-7', className), onClick: (event) => {
|
|
104
|
+
onClick?.(event);
|
|
105
|
+
toggleSidebar();
|
|
106
|
+
}, ...props, children: [_jsx(PanelLeft, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
107
|
+
});
|
|
108
|
+
SidebarTrigger.displayName = 'SidebarTrigger';
|
|
109
|
+
const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
|
110
|
+
const { toggleSidebar } = useSidebar();
|
|
111
|
+
return (_jsx("button", { ref: ref, "data-sidebar": "rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn('absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', className), ...props }));
|
|
112
|
+
});
|
|
113
|
+
SidebarRail.displayName = 'SidebarRail';
|
|
114
|
+
const SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
|
|
115
|
+
return (_jsx("main", { ref: ref, className: cn('relative flex min-h-svh flex-1 flex-col bg-background', 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow', className), ...props }));
|
|
116
|
+
});
|
|
117
|
+
SidebarInset.displayName = 'SidebarInset';
|
|
118
|
+
const SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
119
|
+
return (_jsx(Input, { ref: ref, "data-sidebar": "input", className: cn('h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring', className), ...props }));
|
|
120
|
+
});
|
|
121
|
+
SidebarInput.displayName = 'SidebarInput';
|
|
122
|
+
const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
123
|
+
return _jsx("div", { ref: ref, "data-sidebar": "header", className: cn('flex flex-col gap-2 p-2', className), ...props });
|
|
124
|
+
});
|
|
125
|
+
SidebarHeader.displayName = 'SidebarHeader';
|
|
126
|
+
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
|
|
127
|
+
return _jsx("div", { ref: ref, "data-sidebar": "footer", className: cn('flex flex-col gap-2 p-2', className), ...props });
|
|
128
|
+
});
|
|
129
|
+
SidebarFooter.displayName = 'SidebarFooter';
|
|
130
|
+
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
131
|
+
return (_jsx(Separator, { ref: ref, "data-sidebar": "separator", className: cn('mx-2 w-auto bg-sidebar-border', className), ...props }));
|
|
132
|
+
});
|
|
133
|
+
SidebarSeparator.displayName = 'SidebarSeparator';
|
|
134
|
+
const SidebarContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
135
|
+
return (_jsx("div", { ref: ref, "data-sidebar": "content", className: cn('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className), ...props }));
|
|
136
|
+
});
|
|
137
|
+
SidebarContent.displayName = 'SidebarContent';
|
|
138
|
+
const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
139
|
+
return (_jsx("div", { ref: ref, "data-sidebar": "group", className: cn('relative flex w-full min-w-0 flex-col p-2', className), ...props }));
|
|
140
|
+
});
|
|
141
|
+
SidebarGroup.displayName = 'SidebarGroup';
|
|
142
|
+
const SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
143
|
+
const Comp = asChild ? Slot : 'div';
|
|
144
|
+
return (_jsx(Comp, { ref: ref, "data-sidebar": "group-label", className: cn('duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className), ...props }));
|
|
145
|
+
});
|
|
146
|
+
SidebarGroupLabel.displayName = 'SidebarGroupLabel';
|
|
147
|
+
const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
148
|
+
const Comp = asChild ? Slot : 'button';
|
|
149
|
+
return (_jsx(Comp, { ref: ref, "data-sidebar": "group-action", className: cn('absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
150
|
+
// Increases the hit area of the button on mobile.
|
|
151
|
+
'after:absolute after:-inset-2 after:md:hidden', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
152
|
+
});
|
|
153
|
+
SidebarGroupAction.displayName = 'SidebarGroupAction';
|
|
154
|
+
const SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-sidebar": "group-content", className: cn('w-full text-sm', className), ...props })));
|
|
155
|
+
SidebarGroupContent.displayName = 'SidebarGroupContent';
|
|
156
|
+
const SidebarMenu = React.forwardRef(({ className, ...props }, ref) => (_jsx("ul", { ref: ref, "data-sidebar": "menu", className: cn('flex w-full min-w-0 flex-col gap-1', className), ...props })));
|
|
157
|
+
SidebarMenu.displayName = 'SidebarMenu';
|
|
158
|
+
const SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => (_jsx("li", { ref: ref, "data-sidebar": "menu-item", className: cn('group/menu-item relative', className), ...props })));
|
|
159
|
+
SidebarMenuItem.displayName = 'SidebarMenuItem';
|
|
160
|
+
const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', {
|
|
161
|
+
variants: {
|
|
162
|
+
variant: {
|
|
163
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
164
|
+
outline: 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',
|
|
165
|
+
},
|
|
166
|
+
size: {
|
|
167
|
+
default: 'h-8 text-sm',
|
|
168
|
+
sm: 'h-7 text-xs',
|
|
169
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
defaultVariants: {
|
|
173
|
+
variant: 'default',
|
|
174
|
+
size: 'default',
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const SidebarMenuButton = React.forwardRef(({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }, ref) => {
|
|
178
|
+
const Comp = asChild ? Slot : 'button';
|
|
179
|
+
const { isMobile, state } = useSidebar();
|
|
180
|
+
const button = (_jsx(Comp, { ref: ref, "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
|
|
181
|
+
if (!tooltip) {
|
|
182
|
+
return button;
|
|
183
|
+
}
|
|
184
|
+
if (typeof tooltip === 'string') {
|
|
185
|
+
tooltip = {
|
|
186
|
+
children: tooltip,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== 'collapsed' || isMobile, ...tooltip })] }));
|
|
190
|
+
});
|
|
191
|
+
SidebarMenuButton.displayName = 'SidebarMenuButton';
|
|
192
|
+
const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
193
|
+
const Comp = asChild ? Slot : 'button';
|
|
194
|
+
return (_jsx(Comp, { ref: ref, "data-sidebar": "menu-action", className: cn('absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0',
|
|
195
|
+
// Increases the hit area of the button on mobile.
|
|
196
|
+
'after:absolute after:-inset-2 after:md:hidden', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', showOnHover &&
|
|
197
|
+
'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0', className), ...props }));
|
|
198
|
+
});
|
|
199
|
+
SidebarMenuAction.displayName = 'SidebarMenuAction';
|
|
200
|
+
const SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-sidebar": "menu-badge", className: cn('absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none', 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', className), ...props })));
|
|
201
|
+
SidebarMenuBadge.displayName = 'SidebarMenuBadge';
|
|
202
|
+
const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
|
203
|
+
// Random width between 50 to 90%.
|
|
204
|
+
const width = React.useMemo(() => {
|
|
205
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
206
|
+
}, []);
|
|
207
|
+
return (_jsxs("div", { ref: ref, "data-sidebar": "menu-skeleton", className: cn('rounded-md h-8 flex gap-2 px-2 items-center', className), ...props, children: [showIcon && _jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }), _jsx(Skeleton, { className: "h-4 flex-1 max-w-[--skeleton-width]", "data-sidebar": "menu-skeleton-text", style: {
|
|
208
|
+
'--skeleton-width': width,
|
|
209
|
+
} })] }));
|
|
210
|
+
});
|
|
211
|
+
SidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';
|
|
212
|
+
const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => (_jsx("ul", { ref: ref, "data-sidebar": "menu-sub", className: cn('mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className), ...props })));
|
|
213
|
+
SidebarMenuSub.displayName = 'SidebarMenuSub';
|
|
214
|
+
const SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => (_jsx("li", { ref: ref, ...props })));
|
|
215
|
+
SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
|
|
216
|
+
const SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {
|
|
217
|
+
const Comp = asChild ? Slot : 'a';
|
|
218
|
+
return (_jsx(Comp, { ref: ref, "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn('flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground', 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
219
|
+
});
|
|
220
|
+
SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
|
|
221
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/skeleton.tsx"],"names":[],"mappings":"AAEA,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,2CAE9E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAI1D,QAAA,MAAM,MAAM,8JAkBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) })));
|
|
6
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
7
|
+
export { Switch };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,KAAK,iHAMV,CAAA;AAGD,QAAA,MAAM,WAAW,+HAEhB,CAAA;AAGD,QAAA,MAAM,SAAS,+HAId,CAAA;AAGD,QAAA,MAAM,WAAW,+HAIhB,CAAA;AAGD,QAAA,MAAM,QAAQ,uHAQb,CAAA;AAGD,QAAA,MAAM,SAAS,2HAWd,CAAA;AAGD,QAAA,MAAM,SAAS,2HAQd,CAAA;AAGD,QAAA,MAAM,YAAY,+HAIjB,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", { ref: ref, className: cn('w-full caption-bottom text-sm', className), ...props }) })));
|
|
5
|
+
Table.displayName = 'Table';
|
|
6
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => _jsx("thead", { ref: ref, className: cn('[&_tr]:border-b', className), ...props }));
|
|
7
|
+
TableHeader.displayName = 'TableHeader';
|
|
8
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => (_jsx("tbody", { ref: ref, className: cn('[&_tr:last-child]:border-0', className), ...props })));
|
|
9
|
+
TableBody.displayName = 'TableBody';
|
|
10
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("tfoot", { ref: ref, className: cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className), ...props })));
|
|
11
|
+
TableFooter.displayName = 'TableFooter';
|
|
12
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => (_jsx("tr", { ref: ref, className: cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', className), ...props })));
|
|
13
|
+
TableRow.displayName = 'TableRow';
|
|
14
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props })));
|
|
15
|
+
TableHead.displayName = 'TableHead';
|
|
16
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => (_jsx("td", { ref: ref, className: cn('p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props })));
|
|
17
|
+
TableCell.displayName = 'TableCell';
|
|
18
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (_jsx("caption", { ref: ref, className: cn('mt-4 text-sm text-muted-foreground', className), ...props })));
|
|
19
|
+
TableCaption.displayName = 'TableCaption';
|
|
20
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
3
|
+
export { Textarea };
|
|
4
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,QAAQ,0LAcZ,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
5
|
+
return (_jsx("textarea", { className: cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ref: ref, ...props }));
|
|
6
|
+
});
|
|
7
|
+
Textarea.displayName = "Textarea";
|
|
8
|
+
export { Textarea };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
4
|
+
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
5
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
8
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAI3D,QAAA,MAAM,eAAe,iDAA4B,CAAA;AAEjD,QAAA,MAAM,OAAO,yCAAwB,CAAA;AAErC,QAAA,MAAM,cAAc,gHAA2B,CAAA;AAE/C,QAAA,MAAM,cAAc,gKAelB,CAAA;AAGF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
8
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
9
|
+
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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', className), ...props }) })));
|
|
10
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
11
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-list-flows.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-list-flows.tsx"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,eAAO,MAAM,YAAY;;;CAYxB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export const useListFlows = () => {
|
|
3
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
4
|
+
const [flows, setFlows] = useState([]);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
fetch('/flows')
|
|
7
|
+
.then((res) => res.json())
|
|
8
|
+
.then(setFlows)
|
|
9
|
+
.finally(() => setIsLoading(false));
|
|
10
|
+
}, []);
|
|
11
|
+
return { flows, isLoading };
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-log-listener.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-log-listener.tsx"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAID,eAAO,MAAM,cAAc,QAAO,kBAqBjC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useLogs } from '@/stores/use-logs';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { io } from 'socket.io-client';
|
|
4
|
+
const socket = io('/');
|
|
5
|
+
export const useLogListener = () => {
|
|
6
|
+
const [isConnected, setIsConnected] = useState(socket.connected);
|
|
7
|
+
const addLog = useLogs((state) => state.addLog);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const onConnect = () => setIsConnected(true);
|
|
10
|
+
const onDisconnect = () => setIsConnected(false);
|
|
11
|
+
const onLog = (log) => addLog(log);
|
|
12
|
+
socket.on('connect', onConnect);
|
|
13
|
+
socket.on('disconnect', onDisconnect);
|
|
14
|
+
socket.on('log', onLog);
|
|
15
|
+
return () => {
|
|
16
|
+
socket.off('connect', onConnect);
|
|
17
|
+
socket.off('disconnect', onDisconnect);
|
|
18
|
+
socket.off('log', onLog);
|
|
19
|
+
};
|
|
20
|
+
}, [addLog]);
|
|
21
|
+
return { isConnected };
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-mobile.tsx"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAc1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3
|
+
export function useIsMobile() {
|
|
4
|
+
const [isMobile, setIsMobile] = React.useState(undefined);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
+
const onChange = () => {
|
|
8
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
+
};
|
|
10
|
+
mql.addEventListener('change', onChange);
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
return () => mql.removeEventListener('change', onChange);
|
|
13
|
+
}, []);
|
|
14
|
+
return !!isMobile;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
declare const router: import("@tanstack/react-router").Router<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, import("./routeTree.gen").RootRouteChildren, import("./routeTree.gen").FileRouteTypes>, import("@tanstack/react-router").TrailingSlashOption, boolean, import("@tanstack/history").RouterHistory, Record<string, any>, Record<string, any>>;
|
|
3
|
+
declare module '@tanstack/react-router' {
|
|
4
|
+
interface Register {
|
|
5
|
+
router: typeof router;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAA;AAOpB,QAAA,MAAM,MAAM,wbAA8B,CAAA;AAG1C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,QAAQ;QAChB,MAAM,EAAE,OAAO,MAAM,CAAA;KACtB;CACF"}
|
package/dist/src/main.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StrictMode } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import { RouterProvider, createRouter } from '@tanstack/react-router';
|
|
6
|
+
// Import the generated route tree
|
|
7
|
+
import { routeTree } from './routeTree.gen';
|
|
8
|
+
// Create a new router instance
|
|
9
|
+
const router = createRouter({ routeTree });
|
|
10
|
+
// Render the app
|
|
11
|
+
const rootElement = document.getElementById('root');
|
|
12
|
+
if (!rootElement.innerHTML) {
|
|
13
|
+
const root = createRoot(rootElement);
|
|
14
|
+
root.render(_jsx(StrictMode, { children: _jsx(RouterProvider, { router: router }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ApiNodeProps } from './node-props';
|
|
3
|
+
type Props = PropsWithChildren<ApiNodeProps & {
|
|
4
|
+
excludePubsub?: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ApiNode: ({ data, children, excludePubsub }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=api-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-node.d.ts","sourceRoot":"","sources":["../../../src/publicComponents/api-node.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,KAAK,KAAK,GAAG,iBAAiB,CAAC,YAAY,GAAG;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAE1E,eAAO,MAAM,OAAO,sCAAuC,KAAK,4CAmB/D,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Webhook } from 'lucide-react';
|
|
3
|
+
import { BaseNode } from './base-node';
|
|
4
|
+
import { Emits } from './emits';
|
|
5
|
+
export const ApiNode = ({ data, children, excludePubsub }) => {
|
|
6
|
+
return (_jsxs(BaseNode, { variant: "api", title: data.name, disableSourceHandle: !data.emits?.length, disableTargetHandle: !data.subscribes?.length, children: [data.description && _jsx("div", { className: "text-sm max-w-[300px] text-white/60", children: data.description }), children, data.webhookUrl && (_jsxs("div", { className: "flex gap-1 items-center text-xs text-white/60", children: [_jsx(Webhook, { className: "w-3 h-3 text-white/40" }), _jsx("div", { className: "font-mono", children: data.webhookUrl })] })), !excludePubsub && _jsx(Emits, { emits: data.emits })] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { HandleProps } from '@xyflow/react';
|
|
3
|
+
type Props = HandleProps & Omit<HTMLAttributes<HTMLDivElement>, 'id'> & {
|
|
4
|
+
isHidden?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const BaseHandle: React.FC<Props>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=base-handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-handle.d.ts","sourceRoot":"","sources":["../../../src/publicComponents/base-handle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAgC,MAAM,eAAe,CAAA;AAGzE,KAAK,KAAK,GAAG,WAAW,GACtB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAEH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiCtC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Position, Handle as RFHandle } from '@xyflow/react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
export const BaseHandle = (props) => {
|
|
5
|
+
const { isHidden, position, ...rest } = props;
|
|
6
|
+
return (_jsx("div", { className: clsx('absolute w-1 h-1', position === Position.Top && '-top-[10px]', position === Position.Bottom && '-bottom-[10px]', 'left-1/2 -ml-[2px]', isHidden && 'hidden'), children: _jsx(RFHandle, { ...rest, position: position, className: "\n !static\n !w-1\n !h-1\n !min-w-[6px]\n !min-h-[6px]\n !p-0\n !border-none\n !bg-[#666666]\n !transform-none\n !rounded-full\n !outline-none\n !shadow-none\n " }) }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
declare const baseBackgroundVariants: (props?: ({
|
|
4
|
+
variant?: "event" | "api" | "noop" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
type Props = PropsWithChildren<{
|
|
7
|
+
variant?: VariantProps<typeof baseBackgroundVariants>['variant'];
|
|
8
|
+
title: string;
|
|
9
|
+
headerChildren?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
disableSourceHandle?: boolean;
|
|
12
|
+
disableTargetHandle?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const BaseNode: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=base-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-node.d.ts","sourceRoot":"","sources":["../../../src/publicComponents/base-node.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAKzC,QAAA,MAAM,sBAAsB;;8EAQ1B,CAAA;AAEF,KAAK,KAAK,GAAG,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC,SAAS,CAAC,CAAA;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAC,CAAA;AASF,eAAO,MAAM,QAAQ,UAAW,KAAK,4CAsBpC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
import { Position } from '@xyflow/react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { BaseHandle } from './base-handle';
|
|
6
|
+
const baseNodeVariants = cva('relative flex flex-col min-w-[300px] rounded-md overflow-hidden font-mono');
|
|
7
|
+
const baseBackgroundVariants = cva('absolute -inset-[1px] rounded-md bg-gradient-to-r', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
event: 'from-teal-500/20 to-teal-400/10',
|
|
11
|
+
api: 'from-blue-500/20 to-blue-400/10',
|
|
12
|
+
noop: 'from-white/20 to-white/10',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const HeaderBar = ({ text, children }) => (_jsxs("div", { className: "px-3 py-1 border-b border-white/20 bg-black/30 text-xs text-white/70 flex justify-between items-center", children: [_jsx("span", { children: text }), children] }));
|
|
17
|
+
export const BaseNode = (props) => {
|
|
18
|
+
const { title, variant, className, children, disableSourceHandle, disableTargetHandle, headerChildren } = props;
|
|
19
|
+
return (_jsxs("div", { className: "group relative", children: [_jsx("div", { className: cn(baseBackgroundVariants({ variant })) }), _jsxs("div", { className: cn(baseNodeVariants(), className), children: [_jsx(HeaderBar, { text: title, children: headerChildren }), _jsx("div", { className: "p-4 space-y-3", children: children })] }), !disableTargetHandle && _jsx(BaseHandle, { type: "target", position: Position.Top }), !disableSourceHandle && _jsx(BaseHandle, { type: "source", position: Position.Bottom }), _jsx("div", { className: "absolute inset-0 -z-10 translate-y-1 translate-x-1 bg-black/20 rounded-md border border-white/5" })] }));
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emits.d.ts","sourceRoot":"","sources":["../../../src/publicComponents/emits.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAK/D,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;CAAE,CAe7D,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Send } from 'lucide-react';
|
|
3
|
+
const toType = (emit) => typeof emit === 'string' ? emit : emit.type;
|
|
4
|
+
export const Emits = ({ emits }) => {
|
|
5
|
+
return (_jsx(_Fragment, { children: emits.map((emit) => (_jsxs("div", { className: "flex gap-2 items-center text-xs text-white/60", "data-testid": `emits__${toType(emit)}`, children: [_jsx(Send, { className: "w-3 h-3 text-white/40" }), _jsx("div", { className: "font-mono tracking-wider", children: toType(emit) })] }, toType(emit)))) }));
|
|
6
|
+
};
|