@motiadev/workbench 0.0.6 → 0.0.7-build.20250529212805
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/LICENSE +21 -0
- package/README.md +95 -40
- package/dist/README.md +105 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.html +31 -0
- package/dist/index.js +0 -1
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +10 -17
- package/dist/postcss.config.mjs +9 -0
- package/dist/src/components/app-sidebar.d.ts +0 -1
- package/dist/src/components/app-sidebar.js +15 -8
- package/dist/src/components/endpoints/endpoint-badge.d.ts +10 -0
- package/dist/src/components/endpoints/endpoint-badge.js +22 -0
- package/dist/src/components/endpoints/endpoint-call.d.ts +8 -0
- package/dist/src/components/endpoints/endpoint-call.js +57 -0
- package/dist/src/components/endpoints/endpoints.d.ts +1 -0
- package/dist/src/components/endpoints/endpoints.js +34 -0
- package/dist/src/components/endpoints/hooks/use-get-endpoints.d.ts +15 -0
- package/dist/src/components/endpoints/hooks/use-get-endpoints.js +8 -0
- package/dist/src/components/endpoints/hooks/use-json-schema-to-json.d.ts +4 -0
- package/dist/src/components/endpoints/hooks/use-json-schema-to-json.js +11 -0
- package/dist/src/components/endpoints/hooks/use-path-params.d.ts +1 -0
- package/dist/src/components/endpoints/hooks/use-path-params.js +4 -0
- package/dist/src/components/endpoints/hooks/use-state-stream.d.ts +4 -0
- package/dist/src/components/endpoints/hooks/use-state-stream.js +8 -0
- package/dist/src/components/endpoints/hooks/utils.d.ts +1 -0
- package/dist/src/components/endpoints/hooks/utils.js +29 -0
- package/dist/src/components/endpoints/response-body.d.ts +7 -0
- package/dist/src/components/endpoints/response-body.js +6 -0
- package/dist/src/components/endpoints/selected-endpoint.d.ts +7 -0
- package/dist/src/components/endpoints/selected-endpoint.js +7 -0
- package/dist/src/components/{log-console.d.ts → logs/log-console.d.ts} +0 -1
- package/dist/src/components/logs/log-console.js +69 -0
- package/dist/src/components/logs/log-detail.d.ts +8 -0
- package/dist/src/components/logs/log-detail.js +15 -0
- package/dist/src/components/logs/log-field.d.ts +8 -0
- package/dist/src/components/logs/log-field.js +20 -0
- package/dist/src/components/{log-level-badge.d.ts → logs/log-level-badge.d.ts} +2 -1
- package/dist/src/components/{log-level-badge.js → logs/log-level-badge.js} +2 -2
- package/dist/src/components/logs/log-level-dot.d.ts +4 -0
- package/dist/src/components/logs/log-level-dot.js +17 -0
- package/dist/src/components/logs/logs.d.ts +1 -0
- package/dist/src/components/logs/logs.js +18 -0
- package/dist/src/components/root-motia.d.ts +2 -0
- package/dist/src/components/root-motia.js +5 -0
- package/dist/src/components/states/hooks/states-hooks.d.ts +3 -0
- package/dist/src/components/states/hooks/states-hooks.js +36 -0
- package/dist/src/components/states/state-detail.d.ts +7 -0
- package/dist/src/components/states/state-detail.js +12 -0
- package/dist/src/components/states/state-value.d.ts +8 -0
- package/dist/src/components/states/state-value.js +51 -0
- package/dist/src/components/states/states.d.ts +1 -0
- package/dist/src/components/states/states.js +21 -0
- package/dist/src/components/ui/badge.d.ts +3 -4
- package/dist/src/components/ui/badge.js +4 -4
- package/dist/src/components/ui/button.d.ts +2 -3
- package/dist/src/components/ui/button.js +2 -3
- package/dist/src/components/ui/collapsible.d.ts +1 -2
- package/dist/src/components/ui/collapsible.js +1 -1
- package/dist/src/components/ui/dialog.d.ts +2 -3
- package/dist/src/components/ui/dialog.js +12 -12
- package/dist/src/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/src/components/ui/dropdown-menu.js +50 -0
- package/dist/src/components/ui/input.d.ts +0 -1
- package/dist/src/components/ui/label.d.ts +3 -4
- package/dist/src/components/ui/label.js +6 -6
- package/dist/src/components/ui/select.d.ts +2 -3
- package/dist/src/components/ui/select.js +14 -15
- package/dist/src/components/ui/separator.d.ts +0 -1
- package/dist/src/components/ui/sheet.d.ts +1 -2
- package/dist/src/components/ui/sheet.js +2 -2
- package/dist/src/components/ui/sidebar.d.ts +12 -67
- package/dist/src/components/ui/sidebar.js +14 -219
- package/dist/src/components/ui/skeleton.d.ts +1 -1
- package/dist/src/components/ui/switch.d.ts +2 -3
- package/dist/src/components/ui/switch.js +4 -4
- package/dist/src/components/ui/table.d.ts +0 -1
- package/dist/src/components/ui/table.js +1 -1
- package/dist/src/components/ui/textarea.d.ts +1 -2
- package/dist/src/components/ui/textarea.js +4 -4
- package/dist/src/components/ui/theme-toggle.d.ts +2 -0
- package/dist/src/components/ui/theme-toggle.js +11 -0
- package/dist/src/components/ui/tooltip.d.ts +0 -1
- package/dist/src/hooks/use-debounced.d.ts +1 -0
- package/dist/src/hooks/use-debounced.js +18 -0
- package/dist/src/hooks/use-list-flows.d.ts +0 -2
- package/dist/src/hooks/use-list-flows.js +6 -10
- package/dist/src/hooks/use-log-listener.d.ts +1 -6
- package/dist/src/hooks/use-log-listener.js +3 -18
- package/dist/src/hooks/use-mobile.d.ts +0 -1
- package/dist/src/hooks/use-theme.d.ts +6 -0
- package/dist/src/hooks/use-theme.js +28 -0
- package/dist/src/index.css +169 -0
- package/dist/src/lib/utils.d.ts +0 -1
- package/dist/src/main.d.ts +0 -8
- package/dist/src/main.js +11 -7
- package/dist/src/publicComponents/api-node.d.ts +2 -5
- package/dist/src/publicComponents/api-node.js +3 -3
- package/dist/src/publicComponents/base-handle.d.ts +1 -1
- package/dist/src/publicComponents/base-handle.js +5 -2
- package/dist/src/publicComponents/base-node.d.ts +5 -5
- package/dist/src/publicComponents/base-node.js +13 -8
- package/dist/src/publicComponents/colorMap.d.ts +6 -0
- package/dist/src/publicComponents/colorMap.js +6 -0
- package/dist/src/publicComponents/components/header-bar.d.ts +11 -0
- package/dist/src/publicComponents/components/header-bar.js +15 -0
- package/dist/src/publicComponents/cron-node.d.ts +2 -0
- package/dist/src/publicComponents/cron-node.js +7 -0
- package/dist/src/publicComponents/emits.d.ts +1 -1
- package/dist/src/publicComponents/emits.js +2 -2
- package/dist/src/publicComponents/event-node.d.ts +0 -2
- package/dist/src/publicComponents/event-node.js +3 -5
- package/dist/src/publicComponents/node-details.d.ts +17 -0
- package/dist/src/publicComponents/node-details.js +19 -0
- package/dist/src/publicComponents/node-props.d.ts +5 -3
- package/dist/src/publicComponents/noop-node.d.ts +0 -1
- package/dist/src/publicComponents/noop-node.js +1 -1
- package/dist/src/publicComponents/subscribe.d.ts +2 -3
- package/dist/src/publicComponents/subscribe.js +2 -2
- package/dist/src/route-wrapper.d.ts +2 -4
- package/dist/src/route-wrapper.js +2 -2
- package/dist/src/routes/endpoints-page.d.ts +1 -0
- package/dist/src/routes/endpoints-page.js +5 -0
- package/dist/src/routes/flow.d.ts +1 -0
- package/dist/src/routes/flow.js +22 -0
- package/dist/src/routes/index.d.ts +1 -2
- package/dist/src/routes/index.js +5 -8
- package/dist/src/routes/logs-page.d.ts +1 -0
- package/dist/src/routes/logs-page.js +12 -0
- package/dist/src/routes/states-page.d.ts +1 -0
- package/dist/src/routes/states-page.js +5 -0
- package/dist/src/stores/use-logs.d.ts +3 -2
- package/dist/src/stores/use-logs.js +52 -6
- package/dist/src/views/flow/arrow-head.d.ts +2 -2
- package/dist/src/views/flow/arrow-head.js +5 -1
- package/dist/src/views/flow/base-edge.d.ts +0 -1
- package/dist/src/views/flow/base-edge.js +25 -10
- package/dist/src/views/flow/flow-loader.d.ts +0 -1
- package/dist/src/views/flow/flow-loader.js +1 -1
- package/dist/src/views/flow/flow-view.d.ts +7 -2
- package/dist/src/views/flow/flow-view.js +44 -20
- package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +14 -5
- package/dist/src/views/flow/hooks/use-get-flow-state.js +17 -8
- package/dist/src/views/flow/hooks/use-organize-nodes.d.ts +0 -1
- package/dist/src/views/flow/hooks/use-save-workflow-config.d.ts +9 -0
- package/dist/src/views/flow/hooks/use-save-workflow-config.js +23 -0
- package/dist/src/views/flow/legend.d.ts +3 -3
- package/dist/src/views/flow/legend.js +49 -39
- package/dist/src/views/flow/node-organizer.d.ts +1 -1
- package/dist/src/views/flow/node-organizer.js +4 -2
- package/dist/src/views/flow/nodes/api-flow-node.d.ts +0 -1
- package/dist/src/views/flow/nodes/event-flow-node.d.ts +0 -1
- package/dist/src/views/flow/nodes/language-indicator.d.ts +0 -1
- package/dist/src/views/flow/nodes/language-indicator.js +7 -7
- package/dist/src/views/flow/nodes/nodes.types.d.ts +39 -6
- package/dist/src/views/flow/nodes/noop-flow-node.d.ts +0 -1
- package/dist/tailwind.config.js +9 -77
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/tsconfig.node.tsbuildinfo +1 -1
- package/package.json +36 -42
- package/postcss.config.mjs +9 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/middleware.d.ts.map +0 -1
- package/dist/src/components/app-sidebar.d.ts.map +0 -1
- package/dist/src/components/log-console.d.ts.map +0 -1
- package/dist/src/components/log-console.js +0 -20
- package/dist/src/components/log-level-badge.d.ts.map +0 -1
- package/dist/src/components/ui/badge.d.ts.map +0 -1
- package/dist/src/components/ui/button.d.ts.map +0 -1
- package/dist/src/components/ui/collapsible.d.ts.map +0 -1
- package/dist/src/components/ui/dialog.d.ts.map +0 -1
- package/dist/src/components/ui/input.d.ts.map +0 -1
- package/dist/src/components/ui/label.d.ts.map +0 -1
- package/dist/src/components/ui/select.d.ts.map +0 -1
- package/dist/src/components/ui/separator.d.ts.map +0 -1
- package/dist/src/components/ui/sheet.d.ts.map +0 -1
- package/dist/src/components/ui/sidebar.d.ts.map +0 -1
- package/dist/src/components/ui/skeleton.d.ts.map +0 -1
- package/dist/src/components/ui/switch.d.ts.map +0 -1
- package/dist/src/components/ui/table.d.ts.map +0 -1
- package/dist/src/components/ui/textarea.d.ts.map +0 -1
- package/dist/src/components/ui/tooltip.d.ts.map +0 -1
- package/dist/src/hooks/use-list-flows.d.ts.map +0 -1
- package/dist/src/hooks/use-log-listener.d.ts.map +0 -1
- package/dist/src/hooks/use-mobile.d.ts.map +0 -1
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/main.d.ts.map +0 -1
- package/dist/src/publicComponents/api-node.d.ts.map +0 -1
- package/dist/src/publicComponents/base-handle.d.ts.map +0 -1
- package/dist/src/publicComponents/base-node.d.ts.map +0 -1
- package/dist/src/publicComponents/emits.d.ts.map +0 -1
- package/dist/src/publicComponents/event-node.d.ts.map +0 -1
- package/dist/src/publicComponents/node-props.d.ts.map +0 -1
- package/dist/src/publicComponents/noop-node.d.ts.map +0 -1
- package/dist/src/publicComponents/subscribe.d.ts.map +0 -1
- package/dist/src/route-wrapper.d.ts.map +0 -1
- package/dist/src/routeTree.gen.d.ts +0 -53
- package/dist/src/routeTree.gen.d.ts.map +0 -1
- package/dist/src/routeTree.gen.js +0 -45
- package/dist/src/routes/__root.d.ts +0 -2
- package/dist/src/routes/__root.d.ts.map +0 -1
- package/dist/src/routes/__root.js +0 -15
- package/dist/src/routes/flow/$id.d.ts +0 -4
- package/dist/src/routes/flow/$id.d.ts.map +0 -1
- package/dist/src/routes/flow/$id.js +0 -15
- package/dist/src/routes/index.d.ts.map +0 -1
- package/dist/src/stores/use-logs.d.ts.map +0 -1
- package/dist/src/views/flow/arrow-head.d.ts.map +0 -1
- package/dist/src/views/flow/base-edge.d.ts.map +0 -1
- package/dist/src/views/flow/flow-loader.d.ts.map +0 -1
- package/dist/src/views/flow/flow-view.d.ts.map +0 -1
- package/dist/src/views/flow/hooks/use-get-flow-state.d.ts.map +0 -1
- package/dist/src/views/flow/hooks/use-organize-nodes.d.ts.map +0 -1
- package/dist/src/views/flow/legend.d.ts.map +0 -1
- package/dist/src/views/flow/node-organizer.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/api-flow-node.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/event-flow-node.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/json-schema-form.d.ts +0 -9
- package/dist/src/views/flow/nodes/json-schema-form.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/json-schema-form.js +0 -35
- package/dist/src/views/flow/nodes/language-indicator.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/nodes.types.d.ts.map +0 -1
- package/dist/src/views/flow/nodes/noop-flow-node.d.ts.map +0 -1
- package/dist/tailwind.config.d.ts +0 -4
- package/dist/tailwind.config.d.ts.map +0 -1
- package/dist/vite.config.d.ts +0 -11
- package/dist/vite.config.d.ts.map +0 -1
- package/dist/vite.config.js +0 -18
- package/eslint.config.js +0 -28
- package/index.html +0 -19
- package/index.tsx +0 -10
- package/middleware.ts +0 -48
- package/postcss.config.js +0 -6
- package/src/assets/.empty +0 -0
- package/src/components/app-sidebar.tsx +0 -55
- package/src/components/log-console.tsx +0 -76
- package/src/components/log-level-badge.tsx +0 -12
- package/src/components/ui/badge.tsx +0 -31
- package/src/components/ui/button.tsx +0 -47
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/dialog.tsx +0 -120
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -26
- package/src/components/ui/select.tsx +0 -157
- package/src/components/ui/separator.tsx +0 -22
- package/src/components/ui/sheet.tsx +0 -106
- package/src/components/ui/sidebar.tsx +0 -637
- package/src/components/ui/skeleton.tsx +0 -7
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -76
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/hooks/use-list-flows.tsx +0 -20
- package/src/hooks/use-log-listener.tsx +0 -32
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/index.css +0 -190
- package/src/lib/utils.ts +0 -6
- package/src/main.tsx +0 -28
- package/src/publicComponents/api-node.tsx +0 -28
- package/src/publicComponents/base-handle.tsx +0 -43
- package/src/publicComponents/base-node.tsx +0 -57
- package/src/publicComponents/emits.tsx +0 -22
- package/src/publicComponents/event-node.tsx +0 -36
- package/src/publicComponents/node-props.tsx +0 -15
- package/src/publicComponents/noop-node.tsx +0 -21
- package/src/publicComponents/subscribe.tsx +0 -19
- package/src/route-wrapper.tsx +0 -9
- package/src/routeTree.gen.ts +0 -109
- package/src/routes/__root.tsx +0 -26
- package/src/routes/flow/$id.tsx +0 -21
- package/src/routes/index.tsx +0 -13
- package/src/stores/use-logs.ts +0 -22
- package/src/views/flow/arrow-head.tsx +0 -13
- package/src/views/flow/base-edge.tsx +0 -31
- package/src/views/flow/flow-loader.tsx +0 -3
- package/src/views/flow/flow-view.tsx +0 -72
- package/src/views/flow/hooks/use-get-flow-state.tsx +0 -93
- package/src/views/flow/hooks/use-organize-nodes.ts +0 -60
- package/src/views/flow/legend.tsx +0 -96
- package/src/views/flow/node-organizer.tsx +0 -70
- package/src/views/flow/nodes/api-flow-node.tsx +0 -6
- package/src/views/flow/nodes/event-flow-node.tsx +0 -6
- package/src/views/flow/nodes/json-schema-form.tsx +0 -110
- package/src/views/flow/nodes/language-indicator.tsx +0 -74
- package/src/views/flow/nodes/nodes.types.ts +0 -36
- package/src/views/flow/nodes/noop-flow-node.tsx +0 -6
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.ts +0 -75
- package/tsconfig.app.json +0 -32
- package/tsconfig.json +0 -14
- package/tsconfig.node.json +0 -32
- package/tsconfig.node.tsbuildinfo +0 -1
- package/vite.config.ts +0 -14
- /package/{components.json → dist/components.json} +0 -0
- /package/{public → dist/public}/.empty +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
function DropdownMenu({ ...props }) {
|
|
6
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DropdownMenuPortal({ ...props }) {
|
|
9
|
+
return _jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
12
|
+
return _jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
15
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md', className), ...props }) }));
|
|
16
|
+
}
|
|
17
|
+
function DropdownMenuGroup({ ...props }) {
|
|
18
|
+
return _jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
21
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
24
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
27
|
+
return _jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
28
|
+
}
|
|
29
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
30
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
31
|
+
}
|
|
32
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
33
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
36
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('bg-border -mx-1 my-1 h-px', className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
39
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuSub({ ...props }) {
|
|
42
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
43
|
+
}
|
|
44
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
45
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn('focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8', className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
46
|
+
}
|
|
47
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
48
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg', className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export { Input };
|
|
4
|
-
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as LabelPrimitive from
|
|
3
|
-
import { type VariantProps } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
4
|
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
5
|
export { Label };
|
|
6
|
-
//# sourceMappingURL=label.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as LabelPrimitive from
|
|
5
|
-
import { cva } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
const labelVariants = cva(
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
const labelVariants = cva('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70');
|
|
8
8
|
const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn(labelVariants(), className), ...props })));
|
|
9
9
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
10
10
|
export { Label };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SelectPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
3
|
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -11,4 +11,3 @@ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.
|
|
|
11
11
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
14
|
-
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from
|
|
3
|
-
import * as SelectPrimitive from
|
|
4
|
-
import { Check, ChevronDown, ChevronUp } from
|
|
5
|
-
import { cn } from
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
+
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
6
|
const Select = SelectPrimitive.Root;
|
|
7
7
|
const SelectGroup = SelectPrimitive.Group;
|
|
8
8
|
const SelectValue = SelectPrimitive.Value;
|
|
9
|
-
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn(
|
|
9
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn('flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })] })));
|
|
10
10
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
11
|
-
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn(
|
|
11
|
+
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
12
12
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
13
|
-
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn(
|
|
14
|
-
SelectScrollDownButton.displayName =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
|
|
13
|
+
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronDown, { className: "h-4 w-4" }) })));
|
|
14
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
15
|
+
const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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', position === 'popper' &&
|
|
16
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' &&
|
|
17
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
|
|
19
18
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
20
|
-
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn(
|
|
19
|
+
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', className), ...props })));
|
|
21
20
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
22
|
-
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn(
|
|
21
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
|
|
23
22
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
24
|
-
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn(
|
|
23
|
+
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-muted', className), ...props })));
|
|
25
24
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
26
25
|
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
@@ -2,4 +2,3 @@ import * as React from 'react';
|
|
|
2
2
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
3
|
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export { Separator };
|
|
5
|
-
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -7,7 +7,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|
|
@@ -23,4 +23,3 @@ declare const SheetFooter: {
|
|
|
23
23
|
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
24
24
|
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
25
|
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
26
|
-
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -15,8 +15,8 @@ const sheetVariants = cva('fixed z-50 gap-4 bg-background p-6 shadow-lg transiti
|
|
|
15
15
|
side: {
|
|
16
16
|
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
17
17
|
bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
18
|
-
left: 'inset-y-0 left-0 h-full w-
|
|
19
|
-
right: 'inset-y-0 right-0 h-full w-3
|
|
18
|
+
left: 'inset-y-0 left-0 h-full w-1/2 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
19
|
+
right: 'inset-y-0 right-0 h-full w-1/3 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
defaultVariants: {
|
|
@@ -1,67 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
declare const SidebarContext: React.Context<SidebarContext | null>;
|
|
14
|
-
declare function useSidebar(): SidebarContext;
|
|
15
|
-
declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
16
|
-
defaultOpen?: boolean;
|
|
17
|
-
open?: boolean;
|
|
18
|
-
onOpenChange?: (open: boolean) => void;
|
|
19
|
-
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
-
declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
21
|
-
side?: "left" | "right";
|
|
22
|
-
variant?: "sidebar" | "floating" | "inset";
|
|
23
|
-
collapsible?: "offcanvas" | "icon" | "none";
|
|
24
|
-
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("@/components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
-
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
-
declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
-
declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
-
declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
-
declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
-
declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
35
|
-
asChild?: boolean;
|
|
36
|
-
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
declare const SidebarGroupAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
38
|
-
asChild?: boolean;
|
|
39
|
-
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
40
|
-
declare const SidebarGroupContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
-
declare const SidebarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
42
|
-
declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
43
|
-
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
44
|
-
asChild?: boolean;
|
|
45
|
-
isActive?: boolean;
|
|
46
|
-
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
47
|
-
} & VariantProps<(props?: ({
|
|
48
|
-
variant?: "default" | "outline" | null | undefined;
|
|
49
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
50
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
51
|
-
declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
52
|
-
asChild?: boolean;
|
|
53
|
-
showOnHover?: boolean;
|
|
54
|
-
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
-
declare const SidebarMenuBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
-
declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
57
|
-
showIcon?: boolean;
|
|
58
|
-
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
-
declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
60
|
-
declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
61
|
-
declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
62
|
-
asChild?: boolean;
|
|
63
|
-
size?: "sm" | "md";
|
|
64
|
-
isActive?: boolean;
|
|
65
|
-
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
66
|
-
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, };
|
|
67
|
-
//# sourceMappingURL=sidebar.d.ts.map
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
export declare const Sidebar: React.FC<PropsWithChildren>;
|
|
3
|
+
export declare const SidebarGroup: React.FC<PropsWithChildren<{
|
|
4
|
+
title: string;
|
|
5
|
+
testId?: string;
|
|
6
|
+
}>>;
|
|
7
|
+
type SidebarButtonProps = PropsWithChildren<{
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
icon: React.ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const SidebarButton: React.FC<SidebarButtonProps>;
|
|
12
|
+
export {};
|
|
@@ -1,221 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
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';
|
|
2
|
+
import { useState } from 'react';
|
|
7
3
|
import { cn } from '@/lib/utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
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, };
|
|
4
|
+
import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
|
5
|
+
import { Button } from './button';
|
|
6
|
+
import { ThemeToggle } from './theme-toggle';
|
|
7
|
+
export const Sidebar = ({ children }) => {
|
|
8
|
+
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
9
|
+
return (_jsxs("div", { className: cn('max-h-screen overflow-y-auto transition-[width] duration-300 border-r border-sidebar-border bg-sidebar text-sidebar-foreground border-solid overflow-hidden', isCollapsed ? 'w-[50px]' : 'w-[250px]'), children: [_jsxs("div", { className: "flex items-center justify-between gap-2 px-4 py-3", children: [!isCollapsed && _jsx(ThemeToggle, {}), _jsx(Button, { variant: "ghost", size: "icon", onClick: () => setIsCollapsed(!isCollapsed), children: isCollapsed ? _jsx(PanelLeftOpen, { className: "w-4 h-4" }) : _jsx(PanelLeftClose, { className: "w-4 h-4" }) })] }), !isCollapsed && _jsx("div", { className: "overflow-y-auto w-[250px]", children: children })] }));
|
|
10
|
+
};
|
|
11
|
+
export const SidebarGroup = ({ children, title, testId, }) => {
|
|
12
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsx("h2", { className: "text-xs font-bold text-muted-foreground px-4 py-2 uppercase", "data-testid": testId, children: title }), children] }));
|
|
13
|
+
};
|
|
14
|
+
export const SidebarButton = ({ children, isActive, icon }) => {
|
|
15
|
+
return (_jsxs("div", { className: cn('flex text-sm font-medium items-center gap-2 px-4 py-3 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground transition-colors cursor-pointer', isActive && 'bg-sidebar-accent text-sidebar-accent-foreground'), children: [_jsx("div", { className: "text-sidebar-foreground/70", children: icon }), children] }));
|
|
16
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SwitchPrimitives from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
3
|
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export { Switch };
|
|
5
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from
|
|
3
|
-
import * as SwitchPrimitives from
|
|
4
|
-
import { cn } from
|
|
5
|
-
const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn(
|
|
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
6
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
7
7
|
export { Switch };
|
|
@@ -8,4 +8,3 @@ declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<
|
|
|
8
8
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
9
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
10
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
11
|
-
//# sourceMappingURL=table.d.ts.map
|
|
@@ -11,7 +11,7 @@ const TableFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("tf
|
|
|
11
11
|
TableFooter.displayName = 'TableFooter';
|
|
12
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
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 })));
|
|
14
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (_jsx("th", { ref: ref, className: cn('h-10 px-2 text-left align-middle text-md font-medium bg-muted text-muted-foreground first:rounded-l-lg last:rounded-r-lg [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props })));
|
|
15
15
|
TableHead.displayName = 'TableHead';
|
|
16
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
17
|
TableCell.displayName = 'TableCell';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
3
3
|
export { Textarea };
|
|
4
|
-
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
4
|
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
5
|
-
return (_jsx("textarea", { className: cn(
|
|
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
6
|
});
|
|
7
|
-
Textarea.displayName =
|
|
7
|
+
Textarea.displayName = 'Textarea';
|
|
8
8
|
export { Textarea };
|