@ciridae/ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/components/agentic/agent-card.d.ts +28 -0
- package/dist/components/agentic/agent-card.js +27 -0
- package/dist/components/agentic/agent-composer.d.ts +44 -0
- package/dist/components/agentic/agent-composer.js +104 -0
- package/dist/components/agentic/agent-context.d.ts +28 -0
- package/dist/components/agentic/agent-context.js +102 -0
- package/dist/components/agentic/agent-plan.d.ts +27 -0
- package/dist/components/agentic/agent-plan.js +43 -0
- package/dist/components/agentic/agent-queue.d.ts +46 -0
- package/dist/components/agentic/agent-queue.js +53 -0
- package/dist/components/agentic/agent-task.d.ts +16 -0
- package/dist/components/agentic/agent-task.js +20 -0
- package/dist/components/agentic/approval-request.d.ts +24 -0
- package/dist/components/agentic/approval-request.js +57 -0
- package/dist/components/agentic/artifact.d.ts +24 -0
- package/dist/components/agentic/artifact.js +72 -0
- package/dist/components/agentic/attachments.d.ts +124 -0
- package/dist/components/agentic/attachments.js +595 -0
- package/dist/components/agentic/audio-player.d.ts +16 -0
- package/dist/components/agentic/audio-player.js +21 -0
- package/dist/components/agentic/canvas.d.ts +10 -0
- package/dist/components/agentic/canvas.js +22 -0
- package/dist/components/agentic/clipboard.d.ts +2 -0
- package/dist/components/agentic/clipboard.js +12 -0
- package/dist/components/agentic/code-block.d.ts +43 -0
- package/dist/components/agentic/code-block.js +92 -0
- package/dist/components/agentic/commit.d.ts +57 -0
- package/dist/components/agentic/commit.js +85 -0
- package/dist/components/agentic/connection.d.ts +3 -0
- package/dist/components/agentic/connection.js +8 -0
- package/dist/components/agentic/controls.d.ts +6 -0
- package/dist/components/agentic/controls.js +7 -0
- package/dist/components/agentic/conversation.d.ts +25 -0
- package/dist/components/agentic/conversation.js +56 -0
- package/dist/components/agentic/edge.d.ts +8 -0
- package/dist/components/agentic/edge.js +65 -0
- package/dist/components/agentic/effort-selector.d.ts +43 -0
- package/dist/components/agentic/effort-selector.js +47 -0
- package/dist/components/agentic/environment-variables.d.ts +32 -0
- package/dist/components/agentic/environment-variables.js +66 -0
- package/dist/components/agentic/file-tree.d.ts +24 -0
- package/dist/components/agentic/file-tree.js +56 -0
- package/dist/components/agentic/image.d.ts +9 -0
- package/dist/components/agentic/image.js +11 -0
- package/dist/components/agentic/inline-citation.d.ts +40 -0
- package/dist/components/agentic/inline-citation.js +111 -0
- package/dist/components/agentic/jsx-preview.d.ts +19 -0
- package/dist/components/agentic/jsx-preview.js +34 -0
- package/dist/components/agentic/message-branch.d.ts +20 -0
- package/dist/components/agentic/message-branch.js +83 -0
- package/dist/components/agentic/message-response.css +265 -0
- package/dist/components/agentic/message-response.css.d.ts +2 -0
- package/dist/components/agentic/message.d.ts +27 -0
- package/dist/components/agentic/message.js +57 -0
- package/dist/components/agentic/mic-selector.d.ts +58 -0
- package/dist/components/agentic/mic-selector.js +173 -0
- package/dist/components/agentic/model-selector.d.ts +39 -0
- package/dist/components/agentic/model-selector.js +47 -0
- package/dist/components/agentic/node.d.ts +26 -0
- package/dist/components/agentic/node.js +29 -0
- package/dist/components/agentic/open-in-chat.d.ts +9 -0
- package/dist/components/agentic/open-in-chat.js +8 -0
- package/dist/components/agentic/package-info.d.ts +30 -0
- package/dist/components/agentic/package-info.js +44 -0
- package/dist/components/agentic/panel.d.ts +6 -0
- package/dist/components/agentic/panel.js +7 -0
- package/dist/components/agentic/persona.d.ts +16 -0
- package/dist/components/agentic/persona.js +116 -0
- package/dist/components/agentic/prompt-input-action-menu.d.ts +16 -0
- package/dist/components/agentic/prompt-input-action-menu.js +22 -0
- package/dist/components/agentic/prompt-input-command.d.ts +18 -0
- package/dist/components/agentic/prompt-input-command.js +25 -0
- package/dist/components/agentic/prompt-input-hover-card.d.ts +10 -0
- package/dist/components/agentic/prompt-input-hover-card.js +13 -0
- package/dist/components/agentic/prompt-input-select.d.ts +14 -0
- package/dist/components/agentic/prompt-input-select.js +19 -0
- package/dist/components/agentic/prompt-input-tabs.d.ts +17 -0
- package/dist/components/agentic/prompt-input-tabs.js +45 -0
- package/dist/components/agentic/prompt-input.d.ts +79 -0
- package/dist/components/agentic/prompt-input.js +206 -0
- package/dist/components/agentic/reasoning.d.ts +21 -0
- package/dist/components/agentic/reasoning.js +106 -0
- package/dist/components/agentic/run-checkpoint.d.ts +13 -0
- package/dist/components/agentic/run-checkpoint.js +19 -0
- package/dist/components/agentic/run-trace.d.ts +30 -0
- package/dist/components/agentic/run-trace.js +56 -0
- package/dist/components/agentic/sandbox.d.ts +24 -0
- package/dist/components/agentic/sandbox.js +33 -0
- package/dist/components/agentic/schema-display.d.ts +39 -0
- package/dist/components/agentic/schema-display.js +56 -0
- package/dist/components/agentic/shimmer.d.ts +11 -0
- package/dist/components/agentic/shimmer.js +16 -0
- package/dist/components/agentic/snippet.d.ts +18 -0
- package/dist/components/agentic/snippet.js +35 -0
- package/dist/components/agentic/sources.d.ts +16 -0
- package/dist/components/agentic/sources.js +17 -0
- package/dist/components/agentic/speech-input.d.ts +24 -0
- package/dist/components/agentic/speech-input.js +30 -0
- package/dist/components/agentic/stack-trace.d.ts +27 -0
- package/dist/components/agentic/stack-trace.js +76 -0
- package/dist/components/agentic/suggestion.d.ts +12 -0
- package/dist/components/agentic/suggestion.js +15 -0
- package/dist/components/agentic/terminal.d.ts +24 -0
- package/dist/components/agentic/terminal.js +47 -0
- package/dist/components/agentic/test-results.d.ts +51 -0
- package/dist/components/agentic/test-results.js +83 -0
- package/dist/components/agentic/theme.d.ts +5 -0
- package/dist/components/agentic/theme.js +31 -0
- package/dist/components/agentic/tool.d.ts +25 -0
- package/dist/components/agentic/tool.js +73 -0
- package/dist/components/agentic/toolbar.d.ts +6 -0
- package/dist/components/agentic/toolbar.js +7 -0
- package/dist/components/agentic/transcription.d.ts +20 -0
- package/dist/components/agentic/transcription.js +32 -0
- package/dist/components/agentic/types.d.ts +172 -0
- package/dist/components/agentic/types.js +1 -0
- package/dist/components/agentic/use-controllable-state.d.ts +6 -0
- package/dist/components/agentic/use-controllable-state.js +13 -0
- package/dist/components/agentic/voice-selector.d.ts +69 -0
- package/dist/components/agentic/voice-selector.js +122 -0
- package/dist/components/agentic/web-preview.d.ts +25 -0
- package/dist/components/agentic/web-preview.js +33 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.js +17 -0
- package/dist/components/ui/alert-dialog.d.ts +22 -0
- package/dist/components/ui/alert-dialog.js +51 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.js +24 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.js +7 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +22 -0
- package/dist/components/ui/badge-variants.d.ts +100 -0
- package/dist/components/ui/badge-variants.js +140 -0
- package/dist/components/ui/badge.d.ts +6 -0
- package/dist/components/ui/badge.js +9 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.js +27 -0
- package/dist/components/ui/button-group-variants.d.ts +6 -0
- package/dist/components/ui/button-group-variants.js +13 -0
- package/dist/components/ui/button-group.d.ts +8 -0
- package/dist/components/ui/button-group.js +16 -0
- package/dist/components/ui/button-variants.d.ts +133 -0
- package/dist/components/ui/button-variants.js +170 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/button.js +67 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.js +99 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.js +28 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.js +104 -0
- package/dist/components/ui/chart-context.d.ts +33 -0
- package/dist/components/ui/chart-context.js +36 -0
- package/dist/components/ui/chart-panel.d.ts +11 -0
- package/dist/components/ui/chart-panel.js +6 -0
- package/dist/components/ui/chart-tooltip.d.ts +13 -0
- package/dist/components/ui/chart-tooltip.js +84 -0
- package/dist/components/ui/chart.d.ts +23 -0
- package/dist/components/ui/chart.js +52 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +9 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +12 -0
- package/dist/components/ui/combobox-anchor.d.ts +3 -0
- package/dist/components/ui/combobox-anchor.js +5 -0
- package/dist/components/ui/combobox.d.ts +23 -0
- package/dist/components/ui/combobox.js +54 -0
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/command.js +38 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.js +63 -0
- package/dist/components/ui/data-table.d.ts +17 -0
- package/dist/components/ui/data-table.js +26 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.js +48 -0
- package/dist/components/ui/direction-context.d.ts +3 -0
- package/dist/components/ui/direction-context.js +3 -0
- package/dist/components/ui/direction.d.ts +6 -0
- package/dist/components/ui/direction.js +7 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +47 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.js +63 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +33 -0
- package/dist/components/ui/expandable-data-table.d.ts +24 -0
- package/dist/components/ui/expandable-data-table.js +62 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +74 -0
- package/dist/components/ui/file-upload-field-parts.d.ts +21 -0
- package/dist/components/ui/file-upload-field-parts.js +55 -0
- package/dist/components/ui/file-upload-field.d.ts +15 -0
- package/dist/components/ui/file-upload-field.js +85 -0
- package/dist/components/ui/form-context.d.ts +23 -0
- package/dist/components/ui/form-context.js +35 -0
- package/dist/components/ui/form.d.ts +12 -0
- package/dist/components/ui/form.js +38 -0
- package/dist/components/ui/hover-card.d.ts +10 -0
- package/dist/components/ui/hover-card.js +22 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input-group.js +62 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input-otp.js +21 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +6 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.js +66 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +9 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +7 -0
- package/dist/components/ui/loading-state.d.ts +27 -0
- package/dist/components/ui/loading-state.js +44 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.js +63 -0
- package/dist/components/ui/metrics-strip.d.ts +7 -0
- package/dist/components/ui/metrics-strip.js +18 -0
- package/dist/components/ui/native-select.d.ts +7 -0
- package/dist/components/ui/native-select.js +13 -0
- package/dist/components/ui/navigation-menu-variants.d.ts +2 -0
- package/dist/components/ui/navigation-menu-variants.js +3 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +30 -0
- package/dist/components/ui/page-header.d.ts +19 -0
- package/dist/components/ui/page-header.js +36 -0
- package/dist/components/ui/pagination.d.ts +13 -0
- package/dist/components/ui/pagination.js +29 -0
- package/dist/components/ui/popover.d.ts +14 -0
- package/dist/components/ui/popover.js +34 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/property-list.d.ts +6 -0
- package/dist/components/ui/property-list.js +15 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +11 -0
- package/dist/components/ui/registry-docs-api.d.ts +11 -0
- package/dist/components/ui/registry-docs-api.js +9 -0
- package/dist/components/ui/registry-docs-code.d.ts +19 -0
- package/dist/components/ui/registry-docs-code.js +78 -0
- package/dist/components/ui/registry-docs-showcase.d.ts +11 -0
- package/dist/components/ui/registry-docs-showcase.js +27 -0
- package/dist/components/ui/registry-docs.d.ts +27 -0
- package/dist/components/ui/registry-docs.js +32 -0
- package/dist/components/ui/resizable.d.ts +7 -0
- package/dist/components/ui/resizable.js +15 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +10 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +38 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +7 -0
- package/dist/components/ui/sheet.d.ts +21 -0
- package/dist/components/ui/sheet.js +62 -0
- package/dist/components/ui/sidebar/context.d.ts +21 -0
- package/dist/components/ui/sidebar/context.js +15 -0
- package/dist/components/ui/sidebar/group.d.ts +10 -0
- package/dist/components/ui/sidebar/group.js +18 -0
- package/dist/components/ui/sidebar/layout.d.ts +17 -0
- package/dist/components/ui/sidebar/layout.js +73 -0
- package/dist/components/ui/sidebar/menu.d.ts +30 -0
- package/dist/components/ui/sidebar/menu.js +64 -0
- package/dist/components/ui/sidebar/provider.d.ts +7 -0
- package/dist/components/ui/sidebar/provider.js +53 -0
- package/dist/components/ui/sidebar/rail.d.ts +3 -0
- package/dist/components/ui/sidebar/rail.js +12 -0
- package/dist/components/ui/sidebar/trigger.d.ts +4 -0
- package/dist/components/ui/sidebar/trigger.js +16 -0
- package/dist/components/ui/sidebar-account-menu-theme.d.ts +7 -0
- package/dist/components/ui/sidebar-account-menu-theme.js +32 -0
- package/dist/components/ui/sidebar-account-menu.d.ts +14 -0
- package/dist/components/ui/sidebar-account-menu.js +51 -0
- package/dist/components/ui/sidebar.d.ts +7 -0
- package/dist/components/ui/sidebar.js +7 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +15 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +9 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +33 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.js +7 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +28 -0
- package/dist/components/ui/tabs-variants.d.ts +6 -0
- package/dist/components/ui/tabs-variants.js +13 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.js +17 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +6 -0
- package/dist/components/ui/toggle-group.d.ts +9 -0
- package/dist/components/ui/toggle-group.js +24 -0
- package/dist/components/ui/toggle-variants.d.ts +7 -0
- package/dist/components/ui/toggle-variants.js +19 -0
- package/dist/components/ui/toggle.d.ts +5 -0
- package/dist/components/ui/toggle.js +9 -0
- package/dist/components/ui/tooltip.d.ts +11 -0
- package/dist/components/ui/tooltip.js +25 -0
- package/dist/components/ui/workflow-timeline.d.ts +20 -0
- package/dist/components/ui/workflow-timeline.js +92 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +8 -0
- package/dist/styled-system/css/conditions.mjs +36 -0
- package/dist/styled-system/css/css.mjs +45 -0
- package/dist/styled-system/css/cva.mjs +87 -0
- package/dist/styled-system/css/cx.mjs +15 -0
- package/dist/styled-system/css/index.mjs +4 -0
- package/dist/styled-system/css/sva.mjs +46 -0
- package/dist/styled-system/helpers.mjs +316 -0
- package/dist/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/dist/styled-system/patterns/bleed.mjs +24 -0
- package/dist/styled-system/patterns/box.mjs +15 -0
- package/dist/styled-system/patterns/center.mjs +21 -0
- package/dist/styled-system/patterns/circle.mjs +25 -0
- package/dist/styled-system/patterns/container.mjs +21 -0
- package/dist/styled-system/patterns/cq.mjs +21 -0
- package/dist/styled-system/patterns/divider.mjs +25 -0
- package/dist/styled-system/patterns/flex.mjs +26 -0
- package/dist/styled-system/patterns/float.mjs +52 -0
- package/dist/styled-system/patterns/grid-item.mjs +25 -0
- package/dist/styled-system/patterns/grid.mjs +27 -0
- package/dist/styled-system/patterns/hstack.mjs +24 -0
- package/dist/styled-system/patterns/index.mjs +20 -0
- package/dist/styled-system/patterns/link-overlay.mjs +24 -0
- package/dist/styled-system/patterns/spacer.mjs +25 -0
- package/dist/styled-system/patterns/square.mjs +24 -0
- package/dist/styled-system/patterns/stack.mjs +24 -0
- package/dist/styled-system/patterns/visually-hidden.mjs +18 -0
- package/dist/styled-system/patterns/vstack.mjs +24 -0
- package/dist/styled-system/patterns/wrap.mjs +25 -0
- package/dist/styled-system/styles.css +1089 -0
- package/dist/styled-system/styles.css.d.ts +2 -0
- package/dist/styled-system/tokens/index.mjs +2304 -0
- package/package.json +688 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@ciridae/ui/utils";
|
|
4
|
+
import { Input } from "@ciridae/ui/input";
|
|
5
|
+
import { Separator } from "@ciridae/ui/separator";
|
|
6
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "@ciridae/ui/sheet";
|
|
7
|
+
import { SIDEBAR_WIDTH_MOBILE, useSidebar, } from "@ciridae/ui/sidebar/context";
|
|
8
|
+
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", expandOnCollapsedBlankClick = false, className, children, onClick, ...props }) {
|
|
9
|
+
const { isMobile, state, openMobile, setOpen, setOpenMobile } = useSidebar();
|
|
10
|
+
if (collapsible === "none") {
|
|
11
|
+
return (_jsx(SidebarStatic, { className: className, ...props, children: children }));
|
|
12
|
+
}
|
|
13
|
+
if (isMobile) {
|
|
14
|
+
return (_jsx(SidebarMobile, { open: openMobile, setOpen: setOpenMobile, side: side, onClick: onClick, ...props, children: children }));
|
|
15
|
+
}
|
|
16
|
+
const handleDesktopClick = (event) => {
|
|
17
|
+
onClick?.(event);
|
|
18
|
+
if (!expandOnCollapsedBlankClick || event.defaultPrevented)
|
|
19
|
+
return;
|
|
20
|
+
if (state !== "collapsed" || collapsible !== "icon")
|
|
21
|
+
return;
|
|
22
|
+
if (isInteractiveSidebarTarget(event.target))
|
|
23
|
+
return;
|
|
24
|
+
setOpen(true);
|
|
25
|
+
};
|
|
26
|
+
return (_jsx(SidebarDesktop, { className: className, collapsible: collapsible, expandOnCollapsedBlankClick: expandOnCollapsedBlankClick, onClick: handleDesktopClick, side: side, state: state, variant: variant, ...props, children: children }));
|
|
27
|
+
}
|
|
28
|
+
function SidebarStatic({ className, children, ...props }) {
|
|
29
|
+
return (_jsx("div", { "data-slot": "sidebar", className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className), ...props, children: children }));
|
|
30
|
+
}
|
|
31
|
+
function SidebarMobile({ children, open, setOpen, side, ...props }) {
|
|
32
|
+
const sidebarStyle = React.useMemo(() => ({ "--sidebar-width": SIDEBAR_WIDTH_MOBILE }), []);
|
|
33
|
+
return (_jsx(Sheet, { open: open, onOpenChange: setOpen, ...props, children: _jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", style: sidebarStyle, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
|
|
34
|
+
}
|
|
35
|
+
function SidebarDesktop({ className, children, collapsible, expandOnCollapsedBlankClick, side, state, variant, ...props }) {
|
|
36
|
+
return (_jsxs("div", { className: "group peer hidden text-sidebar-foreground md:block", "data-state": state, "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_jsx(SidebarGap, { variant: variant }), _jsx("div", { "data-slot": "sidebar-container", className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left"
|
|
37
|
+
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
|
38
|
+
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset"
|
|
39
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
40
|
+
: "border-sidebar-border group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", expandOnCollapsedBlankClick &&
|
|
41
|
+
side === "left" &&
|
|
42
|
+
"group-data-[collapsible=icon]:cursor-e-resize", expandOnCollapsedBlankClick &&
|
|
43
|
+
side === "right" &&
|
|
44
|
+
"group-data-[collapsible=icon]:cursor-w-resize", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-md group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm", children: children }) })] }));
|
|
45
|
+
}
|
|
46
|
+
function isInteractiveSidebarTarget(target) {
|
|
47
|
+
return (target instanceof Element &&
|
|
48
|
+
Boolean(target.closest("button,a,input,textarea,select,summary,[role='button'],[role='link'],[data-sidebar-no-expand]")));
|
|
49
|
+
}
|
|
50
|
+
function SidebarGap({ variant }) {
|
|
51
|
+
return (_jsx("div", { "data-slot": "sidebar-gap", className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset"
|
|
52
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
53
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }));
|
|
54
|
+
}
|
|
55
|
+
function SidebarInset({ className, ...props }) {
|
|
56
|
+
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("relative flex w-full flex-1 flex-col bg-background", "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-lg md:peer-data-[variant=inset]:shadow-xs md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className), ...props }));
|
|
57
|
+
}
|
|
58
|
+
function SidebarInput({ className, ...props }) {
|
|
59
|
+
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("h-8 w-full bg-background shadow-none", className), ...props }));
|
|
60
|
+
}
|
|
61
|
+
function SidebarHeader({ className, ...props }) {
|
|
62
|
+
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn("flex flex-col gap-(--sidebar-group-gap) p-(--sidebar-padding)", className), ...props }));
|
|
63
|
+
}
|
|
64
|
+
function SidebarFooter({ className, ...props }) {
|
|
65
|
+
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn("flex flex-col gap-(--sidebar-group-gap) p-(--sidebar-padding)", className), ...props }));
|
|
66
|
+
}
|
|
67
|
+
function SidebarSeparator({ className, ...props }) {
|
|
68
|
+
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("mx-(--sidebar-padding) w-auto bg-sidebar-border", className), ...props }));
|
|
69
|
+
}
|
|
70
|
+
function SidebarContent({ className, ...props }) {
|
|
71
|
+
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("flex min-h-0 flex-1 flex-col gap-(--sidebar-content-gap) overflow-auto group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
|
|
72
|
+
}
|
|
73
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarSeparator, };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { TooltipContent } from "@ciridae/ui/tooltip";
|
|
4
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
14
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
showOnHover?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
21
|
+
showIcon?: boolean;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
size?: "sm" | "md";
|
|
28
|
+
isActive?: boolean;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cn } from "@ciridae/ui/utils";
|
|
6
|
+
import { Skeleton } from "@ciridae/ui/skeleton";
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@ciridae/ui/tooltip";
|
|
8
|
+
import { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
9
|
+
const sidebarMenuButtonVariants = cva("peer/menu-button relative flex w-full items-center gap-(--control-gap) overflow-hidden rounded-[var(--sidebar-item-radius)] px-(--sidebar-item-padding-x) py-1 text-left text-sm text-sidebar-foreground/72 ring-sidebar-ring outline-hidden transition-[color,background-color,box-shadow,width,height,padding] before:absolute before:inset-y-1 before:left-0 before:w-(--sidebar-active-indicator-width) before:rounded-r-sm before:bg-transparent before:content-[''] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:size-(--control-height)! group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:before:hidden group-data-[collapsible=icon]:[&>span:not([data-slot=avatar])]:hidden hover:bg-sidebar-accent/65 hover:text-sidebar-accent-foreground hover:[&>svg]:text-sidebar-accent-foreground focus-visible:ring-[var(--focus-ring-width)] 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 data-[active=true]:bg-sidebar-accent/75 data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[active=true]:shadow-none data-[active=true]:before:bg-sidebar-primary data-[active=true]:[&>svg]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-(--sidebar-icon-size) [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground/52", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "hover:bg-sidebar-accent/65 hover:text-sidebar-accent-foreground",
|
|
13
|
+
outline: "bg-sidebar shadow-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-sidebar-ring-hover",
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
default: "h-(--sidebar-item-height)",
|
|
17
|
+
sm: "h-(--sidebar-item-height-sm) text-xs",
|
|
18
|
+
lg: "h-[calc(var(--sidebar-item-height)+0.625rem)] group-data-[collapsible=icon]:p-0!",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default",
|
|
23
|
+
size: "default",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
function SidebarMenu({ className, ...props }) {
|
|
27
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn("flex w-full min-w-0 flex-col gap-(--sidebar-menu-gap)", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
30
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
33
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
34
|
+
const { isMobile, state } = useSidebar();
|
|
35
|
+
const button = (_jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
|
|
36
|
+
if (!tooltip)
|
|
37
|
+
return button;
|
|
38
|
+
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
39
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltipProps })] }));
|
|
40
|
+
}
|
|
41
|
+
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
42
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
43
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn("absolute top-0.5 right-0.5 flex size-(--sidebar-item-height-sm) items-center justify-center rounded-[var(--sidebar-item-radius)] p-0 text-sidebar-foreground/60 ring-sidebar-ring outline-hidden transition-colors peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-[var(--focus-ring-width)] after:absolute after:-inset-2 md:after:hidden [&>svg]:size-(--sidebar-icon-size) [&>svg]:shrink-0", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover &&
|
|
44
|
+
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0", className), ...props }));
|
|
45
|
+
}
|
|
46
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
47
|
+
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn("pointer-events-none absolute right-1 flex h-(--sidebar-item-height-sm) min-w-(--sidebar-item-height-sm) items-center justify-center rounded-[var(--badge-radius)] px-(--badge-padding-x) text-meta text-sidebar-foreground/60 tabular-nums select-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", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
48
|
+
}
|
|
49
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
50
|
+
const width = React.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
51
|
+
const skeletonStyle = React.useMemo(() => ({ "--skeleton-width": width }), [width]);
|
|
52
|
+
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn("flex h-(--sidebar-item-height) items-center gap-(--control-gap) rounded-[var(--sidebar-item-radius)] px-(--sidebar-item-padding-x)", className), ...props, children: [showIcon && (_jsx(Skeleton, { className: "size-(--sidebar-icon-size) rounded-[var(--sidebar-item-radius)]", "data-sidebar": "menu-skeleton-icon" })), _jsx(Skeleton, { className: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text", style: skeletonStyle })] }));
|
|
53
|
+
}
|
|
54
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
55
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("ml-(--sidebar-nested-indent) flex min-w-0 flex-col gap-(--sidebar-menu-gap) border-l border-sidebar-border/80 py-0.5 pl-(--sidebar-item-padding-x)", "group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
56
|
+
}
|
|
57
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
58
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn("group/menu-sub-item relative", className), ...props }));
|
|
59
|
+
}
|
|
60
|
+
function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
|
|
61
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
62
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn("relative flex h-(--sidebar-sub-item-height) min-w-0 items-center gap-(--control-gap) overflow-hidden rounded-[var(--sidebar-item-radius)] px-(--sidebar-item-padding-x) text-sidebar-foreground/65 ring-sidebar-ring outline-hidden transition-[color,background-color,box-shadow] hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground hover:[&>svg]:text-sidebar-accent-foreground focus-visible:ring-[var(--focus-ring-width)] 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 data-[active=true]:bg-transparent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[active=true]:shadow-none data-[active=true]:[&>svg]:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-(--sidebar-icon-size) [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground/45", size === "sm" && "text-xs", size === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
63
|
+
}
|
|
64
|
+
export { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { SidebarProvider };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useIsMobile } from "@ciridae/ui/use-mobile";
|
|
4
|
+
import { cn } from "@ciridae/ui/utils";
|
|
5
|
+
import { TooltipProvider } from "@ciridae/ui/tooltip";
|
|
6
|
+
import { SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SidebarContext, } from "@ciridae/ui/sidebar/context";
|
|
7
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
8
|
+
const isMobile = useIsMobile();
|
|
9
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
10
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
11
|
+
const open = openProp ?? _open;
|
|
12
|
+
const setOpen = React.useCallback((value) => {
|
|
13
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
14
|
+
if (setOpenProp) {
|
|
15
|
+
setOpenProp(openState);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
_setOpen(openState);
|
|
19
|
+
}
|
|
20
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
21
|
+
}, [setOpenProp, open]);
|
|
22
|
+
const toggleSidebar = React.useCallback(() => (isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)), [isMobile, setOpen, setOpenMobile]);
|
|
23
|
+
useSidebarShortcut(toggleSidebar);
|
|
24
|
+
const state = open ? "expanded" : "collapsed";
|
|
25
|
+
const contextValue = React.useMemo(() => ({
|
|
26
|
+
state,
|
|
27
|
+
open,
|
|
28
|
+
setOpen,
|
|
29
|
+
isMobile,
|
|
30
|
+
openMobile,
|
|
31
|
+
setOpenMobile,
|
|
32
|
+
toggleSidebar,
|
|
33
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
34
|
+
const sidebarStyle = React.useMemo(() => ({
|
|
35
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
36
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
37
|
+
...style,
|
|
38
|
+
}), [style]);
|
|
39
|
+
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: sidebarStyle, className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className), ...props, children: children }) }) }));
|
|
40
|
+
}
|
|
41
|
+
function useSidebarShortcut(toggleSidebar) {
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const handleKeyDown = (event) => {
|
|
44
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
toggleSidebar();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
50
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
51
|
+
}, [toggleSidebar]);
|
|
52
|
+
}
|
|
53
|
+
export { SidebarProvider };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
3
|
+
import { cn } from "@ciridae/ui/utils";
|
|
4
|
+
function SidebarRail({ className, onClick, ...props }) {
|
|
5
|
+
const { toggleSidebar } = useSidebar();
|
|
6
|
+
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: (event) => {
|
|
7
|
+
onClick?.(event);
|
|
8
|
+
if (!event.defaultPrevented)
|
|
9
|
+
toggleSidebar();
|
|
10
|
+
}, title: "Toggle Sidebar", className: cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex", "in-data-[side=left]:cursor-w-resize in-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 hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
export { SidebarRail };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MenuIcon, PanelLeftCloseIcon, PanelLeftOpenIcon } from "lucide-react";
|
|
3
|
+
import { Button } from "@ciridae/ui/button";
|
|
4
|
+
import { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
5
|
+
import { cn } from "@ciridae/ui/utils";
|
|
6
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
7
|
+
const { isMobile, openMobile, state, toggleSidebar } = useSidebar();
|
|
8
|
+
const isExpanded = isMobile ? openMobile : state === "expanded";
|
|
9
|
+
const label = isExpanded ? "Collapse sidebar" : "Expand sidebar";
|
|
10
|
+
const Icon = isMobile && !isExpanded ? MenuIcon : isExpanded ? PanelLeftCloseIcon : PanelLeftOpenIcon;
|
|
11
|
+
return (_jsxs(Button, { "aria-label": label, "data-sidebar": "trigger", "data-slot": "sidebar-trigger", title: label, variant: "ghost", size: "icon", className: cn("size-7", className), onClick: (event) => {
|
|
12
|
+
onClick?.(event);
|
|
13
|
+
toggleSidebar();
|
|
14
|
+
}, ...props, children: [_jsx(Icon, {}), _jsx("span", { className: "sr-only", children: label })] }));
|
|
15
|
+
}
|
|
16
|
+
export { SidebarTrigger };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type SidebarAccountThemeMode = "light" | "dark" | "system";
|
|
2
|
+
declare function AccountThemeSection({ mode, onModeChange, }: {
|
|
3
|
+
mode?: SidebarAccountThemeMode;
|
|
4
|
+
onModeChange?: (mode: SidebarAccountThemeMode) => void;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export { AccountThemeSection };
|
|
7
|
+
export type { SidebarAccountThemeMode };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
|
|
3
|
+
import { DropdownMenuSeparator } from "@ciridae/ui/dropdown-menu";
|
|
4
|
+
import { cn } from "@ciridae/ui/utils";
|
|
5
|
+
const sidebarAccountThemeModes = ["light", "dark", "system"];
|
|
6
|
+
function AccountThemeSection({ mode, onModeChange, }) {
|
|
7
|
+
if (!mode || !onModeChange)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(AccountThemeControls, { mode: mode, onModeChange: onModeChange })] }));
|
|
10
|
+
}
|
|
11
|
+
function AccountThemeControls({ mode, onModeChange, }) {
|
|
12
|
+
return (_jsxs("div", { className: "px-(--menu-item-padding-x) py-1", children: [_jsx("div", { className: "mb-1 text-xs font-control text-muted-foreground", children: "Theme" }), _jsx("div", { className: "grid grid-cols-3 gap-0.5 rounded-[var(--sidebar-item-radius)] border border-border/70 bg-transparent p-0.5", children: sidebarAccountThemeModes.map((themeMode) => (_jsx(ThemeModeButton, { active: mode === themeMode, mode: themeMode, onModeChange: onModeChange }, themeMode))) })] }));
|
|
13
|
+
}
|
|
14
|
+
function ThemeModeButton({ active, mode, onModeChange, }) {
|
|
15
|
+
const label = getThemeModeLabel(mode);
|
|
16
|
+
return (_jsxs("button", { "aria-pressed": active, className: cn("flex h-(--sidebar-item-height-sm) items-center justify-center gap-1 rounded-sm px-2 text-xs font-control text-muted-foreground outline-hidden transition-[color,background-color,box-shadow]", "hover:bg-background hover:text-foreground focus-visible:ring-[var(--focus-ring-width)] focus-visible:ring-ring", active && "bg-muted text-foreground shadow-none"), onClick: () => onModeChange(mode), type: "button", children: [_jsx(ThemeModeIcon, { mode: mode }), _jsx("span", { children: label })] }));
|
|
17
|
+
}
|
|
18
|
+
function ThemeModeIcon({ mode }) {
|
|
19
|
+
if (mode === "light")
|
|
20
|
+
return _jsx(SunIcon, { className: "size-3.5" });
|
|
21
|
+
if (mode === "system")
|
|
22
|
+
return _jsx(MonitorIcon, { className: "size-3.5" });
|
|
23
|
+
return _jsx(MoonIcon, { className: "size-3.5" });
|
|
24
|
+
}
|
|
25
|
+
function getThemeModeLabel(mode) {
|
|
26
|
+
if (mode === "light")
|
|
27
|
+
return "Light";
|
|
28
|
+
if (mode === "system")
|
|
29
|
+
return "System";
|
|
30
|
+
return "Dark";
|
|
31
|
+
}
|
|
32
|
+
export { AccountThemeSection };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SidebarAccountThemeMode } from "@ciridae/ui/sidebar-account-menu-theme";
|
|
2
|
+
type SidebarAccountMenuProps = {
|
|
3
|
+
username?: string | null;
|
|
4
|
+
email?: string | null;
|
|
5
|
+
imageUrl?: string | null;
|
|
6
|
+
onSignOut?: () => void;
|
|
7
|
+
isSigningOut?: boolean;
|
|
8
|
+
themeMode?: SidebarAccountThemeMode;
|
|
9
|
+
onThemeModeChange?: (mode: SidebarAccountThemeMode) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function SidebarAccountMenu({ username, email, imageUrl, onSignOut, isSigningOut, themeMode, onThemeModeChange, className, }: SidebarAccountMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { SidebarAccountMenu };
|
|
14
|
+
export type { SidebarAccountMenuProps, SidebarAccountThemeMode };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronUpIcon, LogOutIcon } from "lucide-react";
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@ciridae/ui/avatar";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@ciridae/ui/dropdown-menu";
|
|
5
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "@ciridae/ui/sidebar/menu";
|
|
6
|
+
import { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
7
|
+
import { AccountThemeSection, } from "@ciridae/ui/sidebar-account-menu-theme";
|
|
8
|
+
import { Spinner } from "@ciridae/ui/spinner";
|
|
9
|
+
import { cn } from "@ciridae/ui/utils";
|
|
10
|
+
function SidebarAccountMenu({ username, email, imageUrl, onSignOut, isSigningOut = false, themeMode, onThemeModeChange, className, }) {
|
|
11
|
+
const { isMobile, state } = useSidebar();
|
|
12
|
+
const label = getAccountLabel(username, email);
|
|
13
|
+
const detail = email ?? "Signed in";
|
|
14
|
+
const accountMark = getAccountMark(label);
|
|
15
|
+
const isCollapsed = state === "collapsed" && !isMobile;
|
|
16
|
+
return (_jsx(SidebarMenu, { className: cn("group-data-[collapsible=icon]:-mx-0.5", className), children: _jsx(SidebarMenuItem, { children: _jsx(AccountDropdown, { detail: detail, imageUrl: imageUrl, accountMark: accountMark, isCollapsed: isCollapsed, isSigningOut: isSigningOut, label: label, onSignOut: onSignOut, onThemeModeChange: onThemeModeChange, themeMode: themeMode }) }) }));
|
|
17
|
+
}
|
|
18
|
+
function AccountDropdown({ accountMark, detail, imageUrl, isCollapsed, isSigningOut, label, onSignOut, onThemeModeChange, themeMode, }) {
|
|
19
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(AccountMenuTrigger, { accountMark: accountMark, detail: detail, imageUrl: imageUrl, label: label }), _jsxs(DropdownMenuContent, { align: isCollapsed ? "end" : "start", className: cn("shadow-sm", isCollapsed ? "w-44" : "w-52"), side: isCollapsed ? "right" : "top", sideOffset: 4, children: [_jsx(AccountMenuLabel, { accountMark: accountMark, detail: detail, imageUrl: imageUrl, label: label }), _jsx(AccountThemeSection, { mode: themeMode, onModeChange: onThemeModeChange }), _jsx(DropdownMenuSeparator, {}), _jsx(AccountSignOutItem, { isSigningOut: isSigningOut, onSignOut: onSignOut })] })] }));
|
|
20
|
+
}
|
|
21
|
+
function AccountMenuTrigger({ accountMark, detail, imageUrl, label, }) {
|
|
22
|
+
return (_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { "aria-label": `Open account menu for ${label}`, className: cn("h-auto min-h-(--control-height) py-1", "text-sidebar-foreground/78 hover:text-sidebar-accent-foreground", "data-[state=open]:bg-sidebar-accent/45 data-[state=open]:text-sidebar-accent-foreground", "group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0!"), tooltip: label, children: [_jsx(AccountAvatar, { accountMark: accountMark, imageUrl: imageUrl }), _jsx(AccountTriggerText, { detail: detail, label: label }), _jsx(ChevronUpIcon, { className: "ml-auto size-3.5 text-sidebar-foreground/42 group-data-[collapsible=icon]:hidden" })] }) }));
|
|
23
|
+
}
|
|
24
|
+
function AccountTriggerText({ detail, label }) {
|
|
25
|
+
return (_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 text-left group-data-[collapsible=icon]:hidden", children: [_jsx("span", { className: "truncate text-sm leading-4 font-control", children: label }), _jsx("span", { className: "truncate text-xs leading-3 text-sidebar-foreground/46", children: detail })] }));
|
|
26
|
+
}
|
|
27
|
+
function AccountMenuLabel({ accountMark, detail, imageUrl, label, }) {
|
|
28
|
+
return (_jsx(DropdownMenuLabel, { className: "p-0 normal-case tracking-normal text-popover-foreground", children: _jsxs("div", { className: "flex min-w-0 items-center gap-(--control-gap) px-(--menu-item-padding-x) py-0.5", children: [_jsx(AccountAvatar, { accountMark: accountMark, imageUrl: imageUrl }), _jsx(AccountMenuLabelText, { detail: detail, label: label })] }) }));
|
|
29
|
+
}
|
|
30
|
+
function AccountMenuLabelText({ detail, label }) {
|
|
31
|
+
return (_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 text-left", children: [_jsx("span", { className: "truncate text-sm leading-4 font-control", children: label }), _jsx("span", { className: "truncate text-xs leading-3 text-muted-foreground", children: detail })] }));
|
|
32
|
+
}
|
|
33
|
+
function AccountSignOutItem({ isSigningOut, onSignOut, }) {
|
|
34
|
+
return (_jsxs(DropdownMenuItem, { className: "min-h-(--sidebar-item-height)", disabled: !onSignOut || isSigningOut, onSelect: () => onSignOut?.(), children: [isSigningOut ? _jsx(Spinner, { "aria-hidden": "true" }) : _jsx(LogOutIcon, {}), _jsx("span", { children: "Sign out" })] }));
|
|
35
|
+
}
|
|
36
|
+
function AccountAvatar({ accountMark, imageUrl, }) {
|
|
37
|
+
return (_jsxs(Avatar, { className: "size-5 rounded-[var(--sidebar-item-radius)]", size: "sm", children: [imageUrl ? _jsx(AvatarImage, { alt: "", src: imageUrl }) : null, _jsx(AvatarFallback, { className: "rounded-[var(--sidebar-item-radius)] bg-sidebar-accent text-xs text-sidebar-accent-foreground", children: accountMark })] }));
|
|
38
|
+
}
|
|
39
|
+
function getAccountLabel(username, email) {
|
|
40
|
+
const trimmedUsername = username?.trim();
|
|
41
|
+
if (trimmedUsername)
|
|
42
|
+
return trimmedUsername;
|
|
43
|
+
const emailPrefix = email?.split("@")[0]?.trim();
|
|
44
|
+
if (emailPrefix)
|
|
45
|
+
return emailPrefix;
|
|
46
|
+
return "Account";
|
|
47
|
+
}
|
|
48
|
+
function getAccountMark(label) {
|
|
49
|
+
return label.match(/[A-Za-z0-9]/)?.[0]?.toUpperCase() ?? "U";
|
|
50
|
+
}
|
|
51
|
+
export { SidebarAccountMenu };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarSeparator, } from "@ciridae/ui/sidebar/layout";
|
|
2
|
+
export { SidebarRail } from "@ciridae/ui/sidebar/rail";
|
|
3
|
+
export { SidebarTrigger } from "@ciridae/ui/sidebar/trigger";
|
|
4
|
+
export { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, } from "@ciridae/ui/sidebar/group";
|
|
5
|
+
export { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, } from "@ciridae/ui/sidebar/menu";
|
|
6
|
+
export { SidebarProvider } from "@ciridae/ui/sidebar/provider";
|
|
7
|
+
export { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarSeparator, } from "@ciridae/ui/sidebar/layout";
|
|
2
|
+
export { SidebarRail } from "@ciridae/ui/sidebar/rail";
|
|
3
|
+
export { SidebarTrigger } from "@ciridae/ui/sidebar/trigger";
|
|
4
|
+
export { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, } from "@ciridae/ui/sidebar/group";
|
|
5
|
+
export { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, } from "@ciridae/ui/sidebar/menu";
|
|
6
|
+
export { SidebarProvider } from "@ciridae/ui/sidebar/provider";
|
|
7
|
+
export { useSidebar } from "@ciridae/ui/sidebar/context";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@ciridae/ui/utils";
|
|
3
|
+
import { css } from "@ciridae/ui/styled-system/css";
|
|
4
|
+
const skeletonClassName = css({
|
|
5
|
+
animation: "pulse",
|
|
6
|
+
backgroundColor: "accent",
|
|
7
|
+
borderRadius: "md",
|
|
8
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
9
|
+
animation: "none",
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
function Skeleton({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { "aria-hidden": "true", "data-slot": "skeleton", className: cn(skeletonClassName, className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
export { Skeleton };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
3
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "@ciridae/ui/utils";
|
|
5
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
6
|
+
const _values = React.useMemo(() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]), [value, defaultValue, min, max]);
|
|
7
|
+
return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, className: cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className), ...props, children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"), children: _jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full") }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "block size-4 shrink-0 rounded-full border border-primary bg-surface shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-[var(--focus-ring-width)] focus-visible:ring-[var(--focus-ring-width)] focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
|
|
8
|
+
}
|
|
9
|
+
export { Slider };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CircleCheckIcon, InfoIcon, OctagonXIcon, TriangleAlertIcon } from "lucide-react";
|
|
4
|
+
import { Toaster as Sonner } from "sonner";
|
|
5
|
+
import { Spinner } from "@ciridae/ui/spinner";
|
|
6
|
+
const toasterStyle = {
|
|
7
|
+
"--normal-bg": "var(--popover)",
|
|
8
|
+
"--normal-text": "var(--popover-foreground)",
|
|
9
|
+
"--normal-border": "var(--border)",
|
|
10
|
+
"--border-radius": "var(--radius)",
|
|
11
|
+
"--success-bg": "var(--success-muted)",
|
|
12
|
+
"--success-border": "var(--success)",
|
|
13
|
+
"--success-text": "var(--success)",
|
|
14
|
+
"--info-bg": "var(--info-muted)",
|
|
15
|
+
"--info-border": "var(--info)",
|
|
16
|
+
"--info-text": "var(--info)",
|
|
17
|
+
"--warning-bg": "var(--warning-muted)",
|
|
18
|
+
"--warning-border": "var(--warning)",
|
|
19
|
+
"--warning-text": "var(--warning-foreground)",
|
|
20
|
+
"--error-bg": "var(--destructive)",
|
|
21
|
+
"--error-border": "var(--destructive)",
|
|
22
|
+
"--error-text": "var(--destructive-foreground)",
|
|
23
|
+
};
|
|
24
|
+
const Toaster = ({ theme = "system", ...props }) => {
|
|
25
|
+
return (_jsx(Sonner, { theme: theme, icons: {
|
|
26
|
+
success: _jsx(CircleCheckIcon, { className: "size-4" }),
|
|
27
|
+
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
28
|
+
warning: _jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
29
|
+
error: _jsx(OctagonXIcon, { className: "size-4" }),
|
|
30
|
+
loading: _jsx(Spinner, { className: "size-4" }),
|
|
31
|
+
}, style: toasterStyle, ...props }));
|
|
32
|
+
};
|
|
33
|
+
export { Toaster };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2Icon } from "lucide-react";
|
|
3
|
+
import { cn } from "@ciridae/ui/utils";
|
|
4
|
+
import { css } from "@ciridae/ui/styled-system/css";
|
|
5
|
+
const spinnerClassName = css({
|
|
6
|
+
animation: "spin",
|
|
7
|
+
height: "icon.sm",
|
|
8
|
+
width: "icon.sm",
|
|
9
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
10
|
+
animationDuration: "1.8s",
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
function Spinner({ className, ...props }) {
|
|
14
|
+
return (_jsx(Loader2Icon, { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn(spinnerClassName, className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
export { Spinner };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3
|
+
declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
4
|
+
size?: "sm" | "default";
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Switch };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3
|
+
import { cn } from "@ciridae/ui/utils";
|
|
4
|
+
function Switch({ className, size = "default", ...props }) {
|
|
5
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[var(--focus-ring-width)] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground") }) }));
|
|
6
|
+
}
|
|
7
|
+
export { Switch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@ciridae/ui/utils";
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
6
|
+
}
|
|
7
|
+
function TableHeader({ className, ...props }) {
|
|
8
|
+
return _jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props });
|
|
9
|
+
}
|
|
10
|
+
function TableBody({ className, ...props }) {
|
|
11
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function TableFooter({ className, ...props }) {
|
|
14
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function TableRow({ className, ...props }) {
|
|
17
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn("h-(--table-row-height) border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function TableHead({ className, ...props }) {
|
|
20
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("h-(--table-row-height) px-(--table-cell-padding-x) py-(--table-cell-padding-y) text-left align-middle text-xs font-medium tracking-normal whitespace-nowrap text-table-header-foreground normal-case [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TableCell({ className, ...props }) {
|
|
23
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn("px-(--table-cell-padding-x) py-(--table-cell-padding-y) align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TableCaption({ className, ...props }) {
|
|
26
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
declare const tabsListVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "line" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
type TabsListVariantProps = VariantProps<typeof tabsListVariants>;
|
|
6
|
+
export { tabsListVariants, type TabsListVariantProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-0.5 text-muted-foreground group-data-[orientation=horizontal]/tabs:h-(--control-height) group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
3
|
+
variants: {
|
|
4
|
+
variant: {
|
|
5
|
+
default: "bg-muted",
|
|
6
|
+
line: "gap-1 bg-transparent",
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
variant: "default",
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export { tabsListVariants };
|