@siyahi/ui 0.0.0-stage → 0.1.0-next.4
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 +174 -2
- package/THIRD_PARTY_NOTICES.md +51 -0
- package/dist/components/registry/dashboard-01/section-cards.d.ts +17 -0
- package/dist/components/registry/dashboard-01/section-cards.js +39 -0
- package/dist/components/registry/dashboardcn/bar-list.d.ts +24 -0
- package/dist/components/registry/dashboardcn/bar-list.js +71 -0
- package/dist/components/registry/heatmap/calendar-heatmap.d.ts +134 -0
- package/dist/components/registry/heatmap/calendar-heatmap.js +497 -0
- package/dist/components/registry/heatmap/status-heatmap.d.ts +120 -0
- package/dist/components/registry/heatmap/status-heatmap.js +330 -0
- package/dist/components/registry/heatmap/weekday-heatmap.d.ts +145 -0
- package/dist/components/registry/heatmap/weekday-heatmap.js +489 -0
- package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +26 -0
- package/dist/components/registry/niko-table/components/data-table-column-actions.js +32 -0
- package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +13 -0
- package/dist/components/registry/niko-table/components/data-table-column-filter.js +17 -0
- package/dist/components/registry/niko-table/components/data-table-column-header.d.ts +30 -0
- package/dist/components/registry/niko-table/components/data-table-column-header.js +35 -0
- package/dist/components/registry/niko-table/components/data-table-column-sort.d.ts +21 -0
- package/dist/components/registry/niko-table/components/data-table-column-sort.js +36 -0
- package/dist/components/registry/niko-table/components/data-table-column-title.d.ts +12 -0
- package/dist/components/registry/niko-table/components/data-table-column-title.js +18 -0
- package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +108 -0
- package/dist/components/registry/niko-table/components/data-table-empty-state.js +148 -0
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +46 -0
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.js +133 -0
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +111 -0
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.js +77 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +65 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.js +65 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +50 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.js +42 -0
- package/dist/components/registry/niko-table/components/data-table-row-menu.d.ts +51 -0
- package/dist/components/registry/niko-table/components/data-table-row-menu.js +65 -0
- package/dist/components/registry/niko-table/components/data-table-toolbar-section.d.ts +7 -0
- package/dist/components/registry/niko-table/components/data-table-toolbar-section.js +63 -0
- package/dist/components/registry/niko-table/config/data-table.d.ts +156 -0
- package/dist/components/registry/niko-table/config/data-table.js +279 -0
- package/dist/components/registry/niko-table/config/feature-detection.d.ts +39 -0
- package/dist/components/registry/niko-table/config/feature-detection.js +174 -0
- package/dist/components/registry/niko-table/core/data-table-context.d.ts +157 -0
- package/dist/components/registry/niko-table/core/data-table-context.js +326 -0
- package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +85 -0
- package/dist/components/registry/niko-table/core/data-table-error-boundary.js +116 -0
- package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +49 -0
- package/dist/components/registry/niko-table/core/data-table-grouped-row.js +112 -0
- package/dist/components/registry/niko-table/core/data-table-root.d.ts +62 -0
- package/dist/components/registry/niko-table/core/data-table-root.js +406 -0
- package/dist/components/registry/niko-table/core/data-table-structure.d.ts +153 -0
- package/dist/components/registry/niko-table/core/data-table-structure.js +370 -0
- package/dist/components/registry/niko-table/core/data-table.d.ts +30 -0
- package/dist/components/registry/niko-table/core/data-table.js +126 -0
- package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +49 -0
- package/dist/components/registry/niko-table/filters/table-column-actions.js +48 -0
- package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +51 -0
- package/dist/components/registry/niko-table/filters/table-column-sort.js +184 -0
- package/dist/components/registry/niko-table/filters/table-column-title.d.ts +17 -0
- package/dist/components/registry/niko-table/filters/table-column-title.js +20 -0
- package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +40 -0
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +210 -0
- package/dist/components/registry/niko-table/hooks/use-derived-column-title.d.ts +29 -0
- package/dist/components/registry/niko-table/hooks/use-derived-column-title.js +40 -0
- package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +49 -0
- package/dist/components/registry/niko-table/hooks/use-generated-options.js +144 -0
- package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +59 -0
- package/dist/components/registry/niko-table/lib/build-faceted-options.js +82 -0
- package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +33 -0
- package/dist/components/registry/niko-table/lib/column-resize-handle.js +175 -0
- package/dist/components/registry/niko-table/lib/constants.d.ts +128 -0
- package/dist/components/registry/niko-table/lib/constants.js +123 -0
- package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +35 -0
- package/dist/components/registry/niko-table/lib/create-scroll-handler.js +63 -0
- package/dist/components/registry/niko-table/lib/data-table-features.d.ts +218 -0
- package/dist/components/registry/niko-table/lib/data-table-features.js +127 -0
- package/dist/components/registry/niko-table/lib/filter-functions.d.ts +47 -0
- package/dist/components/registry/niko-table/lib/filter-functions.js +309 -0
- package/dist/components/registry/niko-table/lib/filter-rows.d.ts +14 -0
- package/dist/components/registry/niko-table/lib/filter-rows.js +28 -0
- package/dist/components/registry/niko-table/lib/flex-columns.d.ts +48 -0
- package/dist/components/registry/niko-table/lib/flex-columns.js +65 -0
- package/dist/components/registry/niko-table/lib/format.d.ts +33 -0
- package/dist/components/registry/niko-table/lib/format.js +99 -0
- package/dist/components/registry/niko-table/lib/render-cell-content.d.ts +17 -0
- package/dist/components/registry/niko-table/lib/render-cell-content.js +65 -0
- package/dist/components/registry/niko-table/lib/row-click.d.ts +67 -0
- package/dist/components/registry/niko-table/lib/row-click.js +28 -0
- package/dist/components/registry/niko-table/lib/styles.d.ts +6 -0
- package/dist/components/registry/niko-table/lib/styles.js +24 -0
- package/dist/components/registry/niko-table/lib/use-header-min-widths.d.ts +17 -0
- package/dist/components/registry/niko-table/lib/use-header-min-widths.js +82 -0
- package/dist/components/registry/niko-table/types/index.d.ts +141 -0
- package/dist/components/registry/niko-table/types/index.js +2 -0
- package/dist/components/registry/niko-table/ui/table.d.ts +13 -0
- package/dist/components/registry/niko-table/ui/table.js +74 -0
- package/dist/components/registry/sidebar-07/app-sidebar.d.ts +18 -0
- package/dist/components/registry/sidebar-07/app-sidebar.js +26 -0
- package/dist/components/registry/sidebar-07/nav-main.d.ts +15 -0
- package/dist/components/registry/sidebar-07/nav-main.js +25 -0
- package/dist/components/registry/sidebar-07/nav-projects.d.ts +9 -0
- package/dist/components/registry/sidebar-07/nav-projects.js +43 -0
- package/dist/components/registry/sidebar-07/nav-user.d.ts +9 -0
- package/dist/components/registry/sidebar-07/nav-user.js +70 -0
- package/dist/components/registry/sidebar-07/team-switcher.d.ts +10 -0
- package/dist/components/registry/sidebar-07/team-switcher.js +70 -0
- package/dist/components/siyahi/delta.d.ts +10 -0
- package/dist/components/siyahi/delta.js +27 -0
- package/dist/components/siyahi/local-time.d.ts +7 -0
- package/dist/components/siyahi/local-time.js +22 -0
- package/dist/components/siyahi/price-chart.d.ts +12 -0
- package/dist/components/siyahi/price-chart.js +80 -0
- package/dist/components/siyahi/siyahi-provider.d.ts +12 -0
- package/dist/components/siyahi/siyahi-provider.js +31 -0
- package/dist/components/siyahi/treemap.d.ts +14 -0
- package/dist/components/siyahi/treemap.js +58 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +43 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +29 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +72 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +44 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +107 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +56 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +149 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +24 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +88 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +79 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +15 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +55 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +43 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +36 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +97 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +89 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +385 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +66 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +52 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +41 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +71 -0
- package/dist/lib/format.d.ts +24 -0
- package/dist/lib/format.js +58 -0
- package/dist/lib/locale.d.ts +12 -0
- package/dist/lib/locale.js +8 -0
- package/dist/lib/recharts.d.ts +2 -0
- package/dist/lib/recharts.js +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +1 -0
- package/package.json +78 -3
- package/registry.lock.json +413 -0
- package/report.css +129 -0
- package/styles/shadcn.css +643 -0
- package/styles/siyahi.css +189 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { Separator } from "./separator.js";
|
|
4
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
5
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
6
|
+
import { Skeleton } from "./skeleton.js";
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
8
|
+
import * as React$1 from "react";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import { cn } from "cn";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
13
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
14
|
+
import { PanelLeftIcon } from "lucide-react";
|
|
15
|
+
//#region src/components/ui/sidebar.tsx
|
|
16
|
+
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
17
|
+
const SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
18
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
19
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
20
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
21
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
22
|
+
const SidebarContext = React$1.createContext(null);
|
|
23
|
+
function useSidebar() {
|
|
24
|
+
const context = React$1.useContext(SidebarContext);
|
|
25
|
+
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
29
|
+
const isMobile = useIsMobile();
|
|
30
|
+
const [openMobile, setOpenMobile] = React$1.useState(false);
|
|
31
|
+
const [_open, _setOpen] = React$1.useState(defaultOpen);
|
|
32
|
+
const open = openProp ?? _open;
|
|
33
|
+
const setOpen = React$1.useCallback((value) => {
|
|
34
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
35
|
+
if (setOpenProp) setOpenProp(openState);
|
|
36
|
+
else _setOpen(openState);
|
|
37
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
38
|
+
}, [setOpenProp, open]);
|
|
39
|
+
const toggleSidebar = React$1.useCallback(() => {
|
|
40
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
41
|
+
}, [
|
|
42
|
+
isMobile,
|
|
43
|
+
setOpen,
|
|
44
|
+
setOpenMobile
|
|
45
|
+
]);
|
|
46
|
+
React$1.useEffect(() => {
|
|
47
|
+
const handleKeyDown = (event) => {
|
|
48
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
toggleSidebar();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
54
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
55
|
+
}, [toggleSidebar]);
|
|
56
|
+
const state = open ? "expanded" : "collapsed";
|
|
57
|
+
const contextValue = React$1.useMemo(() => ({
|
|
58
|
+
state,
|
|
59
|
+
open,
|
|
60
|
+
setOpen,
|
|
61
|
+
isMobile,
|
|
62
|
+
openMobile,
|
|
63
|
+
setOpenMobile,
|
|
64
|
+
toggleSidebar
|
|
65
|
+
}), [
|
|
66
|
+
state,
|
|
67
|
+
open,
|
|
68
|
+
setOpen,
|
|
69
|
+
isMobile,
|
|
70
|
+
openMobile,
|
|
71
|
+
setOpenMobile,
|
|
72
|
+
toggleSidebar
|
|
73
|
+
]);
|
|
74
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, {
|
|
75
|
+
value: contextValue,
|
|
76
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
77
|
+
"data-slot": "sidebar-wrapper",
|
|
78
|
+
style: {
|
|
79
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
80
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
81
|
+
...style
|
|
82
|
+
},
|
|
83
|
+
className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
|
|
84
|
+
...props,
|
|
85
|
+
children
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, dir, ...props }) {
|
|
90
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
91
|
+
if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
|
|
92
|
+
"data-slot": "sidebar",
|
|
93
|
+
className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
|
|
94
|
+
...props,
|
|
95
|
+
children
|
|
96
|
+
});
|
|
97
|
+
if (isMobile) return /* @__PURE__ */ jsx(Sheet, {
|
|
98
|
+
open: openMobile,
|
|
99
|
+
onOpenChange: setOpenMobile,
|
|
100
|
+
...props,
|
|
101
|
+
children: /* @__PURE__ */ jsxs(SheetContent, {
|
|
102
|
+
dir,
|
|
103
|
+
"data-sidebar": "sidebar",
|
|
104
|
+
"data-slot": "sidebar",
|
|
105
|
+
"data-mobile": "true",
|
|
106
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
107
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
108
|
+
side,
|
|
109
|
+
children: [/* @__PURE__ */ jsxs(SheetHeader, {
|
|
110
|
+
className: "sr-only",
|
|
111
|
+
children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }), /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })]
|
|
112
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
113
|
+
className: "flex h-full w-full flex-col",
|
|
114
|
+
children
|
|
115
|
+
})]
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
120
|
+
"data-state": state,
|
|
121
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
122
|
+
"data-variant": variant,
|
|
123
|
+
"data-side": side,
|
|
124
|
+
"data-slot": "sidebar",
|
|
125
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
126
|
+
"data-slot": "sidebar-gap",
|
|
127
|
+
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" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
128
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
129
|
+
"data-slot": "sidebar-container",
|
|
130
|
+
"data-side": side,
|
|
131
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
132
|
+
...props,
|
|
133
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
134
|
+
"data-sidebar": "sidebar",
|
|
135
|
+
"data-slot": "sidebar-inner",
|
|
136
|
+
className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
|
|
137
|
+
children
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
143
|
+
const { toggleSidebar } = useSidebar();
|
|
144
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
145
|
+
"data-sidebar": "trigger",
|
|
146
|
+
"data-slot": "sidebar-trigger",
|
|
147
|
+
variant: "ghost",
|
|
148
|
+
size: "icon-sm",
|
|
149
|
+
className: cn(className),
|
|
150
|
+
onClick: (event) => {
|
|
151
|
+
onClick?.(event);
|
|
152
|
+
toggleSidebar();
|
|
153
|
+
},
|
|
154
|
+
...props,
|
|
155
|
+
children: [/* @__PURE__ */ jsx(PanelLeftIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
156
|
+
className: "sr-only",
|
|
157
|
+
children: "Toggle Sidebar"
|
|
158
|
+
})]
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function SidebarRail({ className, ...props }) {
|
|
162
|
+
const { toggleSidebar } = useSidebar();
|
|
163
|
+
return /* @__PURE__ */ jsx("button", {
|
|
164
|
+
"data-sidebar": "rail",
|
|
165
|
+
"data-slot": "sidebar-rail",
|
|
166
|
+
"aria-label": "Toggle Sidebar",
|
|
167
|
+
tabIndex: -1,
|
|
168
|
+
onClick: toggleSidebar,
|
|
169
|
+
title: "Toggle Sidebar",
|
|
170
|
+
className: cn("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2", "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),
|
|
171
|
+
...props
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function SidebarInset({ className, ...props }) {
|
|
175
|
+
return /* @__PURE__ */ jsx("main", {
|
|
176
|
+
"data-slot": "sidebar-inset",
|
|
177
|
+
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-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className),
|
|
178
|
+
...props
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function SidebarInput({ className, ...props }) {
|
|
182
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
183
|
+
"data-slot": "sidebar-input",
|
|
184
|
+
"data-sidebar": "input",
|
|
185
|
+
className: cn("h-8 w-full bg-background shadow-none", className),
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function SidebarHeader({ className, ...props }) {
|
|
190
|
+
return /* @__PURE__ */ jsx("div", {
|
|
191
|
+
"data-slot": "sidebar-header",
|
|
192
|
+
"data-sidebar": "header",
|
|
193
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
194
|
+
...props
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function SidebarFooter({ className, ...props }) {
|
|
198
|
+
return /* @__PURE__ */ jsx("div", {
|
|
199
|
+
"data-slot": "sidebar-footer",
|
|
200
|
+
"data-sidebar": "footer",
|
|
201
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
202
|
+
...props
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function SidebarSeparator({ className, ...props }) {
|
|
206
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
207
|
+
"data-slot": "sidebar-separator",
|
|
208
|
+
"data-sidebar": "separator",
|
|
209
|
+
className: cn("mx-2 w-auto bg-sidebar-border", className),
|
|
210
|
+
...props
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
function SidebarContent({ className, ...props }) {
|
|
214
|
+
return /* @__PURE__ */ jsx("div", {
|
|
215
|
+
"data-slot": "sidebar-content",
|
|
216
|
+
"data-sidebar": "content",
|
|
217
|
+
className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function SidebarGroup({ className, ...props }) {
|
|
222
|
+
return /* @__PURE__ */ jsx("div", {
|
|
223
|
+
"data-slot": "sidebar-group",
|
|
224
|
+
"data-sidebar": "group",
|
|
225
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
226
|
+
...props
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function SidebarGroupLabel({ className, render, ...props }) {
|
|
230
|
+
return useRender({
|
|
231
|
+
defaultTagName: "div",
|
|
232
|
+
props: mergeProps({ className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className) }, props),
|
|
233
|
+
render,
|
|
234
|
+
state: {
|
|
235
|
+
slot: "sidebar-group-label",
|
|
236
|
+
sidebar: "group-label"
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function SidebarGroupAction({ className, render, ...props }) {
|
|
241
|
+
return useRender({
|
|
242
|
+
defaultTagName: "button",
|
|
243
|
+
props: mergeProps({ className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className) }, props),
|
|
244
|
+
render,
|
|
245
|
+
state: {
|
|
246
|
+
slot: "sidebar-group-action",
|
|
247
|
+
sidebar: "group-action"
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
252
|
+
return /* @__PURE__ */ jsx("div", {
|
|
253
|
+
"data-slot": "sidebar-group-content",
|
|
254
|
+
"data-sidebar": "group-content",
|
|
255
|
+
className: cn("w-full text-sm", className),
|
|
256
|
+
...props
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
function SidebarMenu({ className, ...props }) {
|
|
260
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
261
|
+
"data-slot": "sidebar-menu",
|
|
262
|
+
"data-sidebar": "menu",
|
|
263
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
264
|
+
...props
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
268
|
+
return /* @__PURE__ */ jsx("li", {
|
|
269
|
+
"data-slot": "sidebar-menu-item",
|
|
270
|
+
"data-sidebar": "menu-item",
|
|
271
|
+
className: cn("group/menu-item relative", className),
|
|
272
|
+
...props
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
const sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
276
|
+
variants: {
|
|
277
|
+
variant: {
|
|
278
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
279
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
280
|
+
},
|
|
281
|
+
size: {
|
|
282
|
+
default: "h-8 text-sm",
|
|
283
|
+
sm: "h-7 text-xs",
|
|
284
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
defaultVariants: {
|
|
288
|
+
variant: "default",
|
|
289
|
+
size: "default"
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
function SidebarMenuButton({ render, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
293
|
+
const { isMobile, state } = useSidebar();
|
|
294
|
+
const comp = useRender({
|
|
295
|
+
defaultTagName: "button",
|
|
296
|
+
props: mergeProps({ className: cn(sidebarMenuButtonVariants({
|
|
297
|
+
variant,
|
|
298
|
+
size
|
|
299
|
+
}), className) }, props),
|
|
300
|
+
render: !tooltip ? render : /* @__PURE__ */ jsx(TooltipTrigger, { render }),
|
|
301
|
+
state: {
|
|
302
|
+
slot: "sidebar-menu-button",
|
|
303
|
+
sidebar: "menu-button",
|
|
304
|
+
size,
|
|
305
|
+
active: isActive
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
if (!tooltip) return comp;
|
|
309
|
+
if (typeof tooltip === "string") tooltip = { children: tooltip };
|
|
310
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [comp, /* @__PURE__ */ jsx(TooltipContent, {
|
|
311
|
+
side: "right",
|
|
312
|
+
align: "center",
|
|
313
|
+
hidden: state !== "collapsed" || isMobile,
|
|
314
|
+
...tooltip
|
|
315
|
+
})] });
|
|
316
|
+
}
|
|
317
|
+
function SidebarMenuAction({ className, render, showOnHover = false, ...props }) {
|
|
318
|
+
return useRender({
|
|
319
|
+
defaultTagName: "button",
|
|
320
|
+
props: mergeProps({ className: cn("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0", className) }, props),
|
|
321
|
+
render,
|
|
322
|
+
state: {
|
|
323
|
+
slot: "sidebar-menu-action",
|
|
324
|
+
sidebar: "menu-action"
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
329
|
+
return /* @__PURE__ */ jsx("div", {
|
|
330
|
+
"data-slot": "sidebar-menu-badge",
|
|
331
|
+
"data-sidebar": "menu-badge",
|
|
332
|
+
className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground", className),
|
|
333
|
+
...props
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
337
|
+
const [width] = React$1.useState(() => {
|
|
338
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
339
|
+
});
|
|
340
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
341
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
342
|
+
"data-sidebar": "menu-skeleton",
|
|
343
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
344
|
+
...props,
|
|
345
|
+
children: [showIcon && /* @__PURE__ */ jsx(Skeleton, {
|
|
346
|
+
className: "size-4 rounded-md",
|
|
347
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
348
|
+
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
349
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
350
|
+
"data-sidebar": "menu-skeleton-text",
|
|
351
|
+
style: { "--skeleton-width": width }
|
|
352
|
+
})]
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
356
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
357
|
+
"data-slot": "sidebar-menu-sub",
|
|
358
|
+
"data-sidebar": "menu-sub",
|
|
359
|
+
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),
|
|
360
|
+
...props
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
364
|
+
return /* @__PURE__ */ jsx("li", {
|
|
365
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
366
|
+
"data-sidebar": "menu-sub-item",
|
|
367
|
+
className: cn("group/menu-sub-item relative", className),
|
|
368
|
+
...props
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function SidebarMenuSubButton({ render, size = "md", isActive = false, className, ...props }) {
|
|
372
|
+
return useRender({
|
|
373
|
+
defaultTagName: "a",
|
|
374
|
+
props: mergeProps({ className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden 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 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className) }, props),
|
|
375
|
+
render,
|
|
376
|
+
state: {
|
|
377
|
+
slot: "sidebar-menu-sub-button",
|
|
378
|
+
sidebar: "menu-sub-button",
|
|
379
|
+
size,
|
|
380
|
+
active: isActive
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
//#endregion
|
|
385
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/skeleton.tsx
|
|
4
|
+
function Skeleton({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Skeleton };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
4
|
+
//#region src/components/ui/slider.tsx
|
|
5
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
6
|
+
const _values = Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max];
|
|
7
|
+
return /* @__PURE__ */ jsx(Slider$1.Root, {
|
|
8
|
+
className: cn("data-horizontal:w-full data-vertical:h-full", className),
|
|
9
|
+
"data-slot": "slider",
|
|
10
|
+
defaultValue,
|
|
11
|
+
value,
|
|
12
|
+
min,
|
|
13
|
+
max,
|
|
14
|
+
thumbAlignment: "edge",
|
|
15
|
+
...props,
|
|
16
|
+
children: /* @__PURE__ */ jsxs(Slider$1.Control, {
|
|
17
|
+
className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",
|
|
18
|
+
children: [/* @__PURE__ */ jsx(Slider$1.Track, {
|
|
19
|
+
"data-slot": "slider-track",
|
|
20
|
+
className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5",
|
|
21
|
+
children: /* @__PURE__ */ jsx(Slider$1.Indicator, {
|
|
22
|
+
"data-slot": "slider-range",
|
|
23
|
+
className: "bg-primary select-none data-horizontal:h-full data-vertical:w-full"
|
|
24
|
+
})
|
|
25
|
+
}), Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(Slider$1.Thumb, {
|
|
26
|
+
"data-slot": "slider-thumb",
|
|
27
|
+
className: "block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] select-none hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
28
|
+
}, index))]
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Slider };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/ui/table.d.ts
|
|
3
|
+
declare function Table({ className, ...props }: React$1.ComponentProps<"table">): React$1.JSX.Element;
|
|
4
|
+
declare function TableHeader({ className, ...props }: React$1.ComponentProps<"thead">): React$1.JSX.Element;
|
|
5
|
+
declare function TableBody({ className, ...props }: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
|
|
6
|
+
declare function TableFooter({ className, ...props }: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
|
|
7
|
+
declare function TableRow({ className, ...props }: React$1.ComponentProps<"tr">): React$1.JSX.Element;
|
|
8
|
+
declare function TableHead({ className, ...props }: React$1.ComponentProps<"th">): React$1.JSX.Element;
|
|
9
|
+
declare function TableCell({ className, ...props }: React$1.ComponentProps<"td">): React$1.JSX.Element;
|
|
10
|
+
declare function TableCaption({ className, ...props }: React$1.ComponentProps<"caption">): React$1.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/table.tsx
|
|
5
|
+
function Table({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "table-container",
|
|
8
|
+
className: "relative w-full overflow-x-auto",
|
|
9
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
10
|
+
"data-slot": "table",
|
|
11
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
12
|
+
...props
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function TableHeader({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("thead", {
|
|
18
|
+
"data-slot": "table-header",
|
|
19
|
+
className: cn("[&_tr]:border-b", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function TableBody({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("tbody", {
|
|
25
|
+
"data-slot": "table-body",
|
|
26
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function TableFooter({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
32
|
+
"data-slot": "table-footer",
|
|
33
|
+
className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function TableRow({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
39
|
+
"data-slot": "table-row",
|
|
40
|
+
className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function TableHead({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx("th", {
|
|
46
|
+
"data-slot": "table-head",
|
|
47
|
+
className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function TableCell({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("td", {
|
|
53
|
+
"data-slot": "table-cell",
|
|
54
|
+
className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function TableCaption({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("caption", {
|
|
60
|
+
"data-slot": "table-caption",
|
|
61
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
3
|
+
//#region src/components/ui/tabs.d.ts
|
|
4
|
+
declare function Tabs({ className, orientation, ...props }: Tabs$1.Root.Props): import("react").JSX.Element;
|
|
5
|
+
declare const tabsListVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "line" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function TabsList({ className, variant, ...props }: Tabs$1.List.Props & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
|
|
9
|
+
declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): import("react").JSX.Element;
|
|
10
|
+
declare function TabsContent({ className, ...props }: Tabs$1.Panel.Props): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
6
|
+
//#region src/components/ui/tabs.tsx
|
|
7
|
+
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
9
|
+
"data-slot": "tabs",
|
|
10
|
+
"data-orientation": orientation,
|
|
11
|
+
className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-9 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
16
|
+
variants: { variant: {
|
|
17
|
+
default: "bg-muted",
|
|
18
|
+
line: "gap-1 bg-transparent"
|
|
19
|
+
} },
|
|
20
|
+
defaultVariants: { variant: "default" }
|
|
21
|
+
});
|
|
22
|
+
function TabsList({ className, variant = "default", ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Tabs$1.List, {
|
|
24
|
+
"data-slot": "tabs-list",
|
|
25
|
+
"data-variant": variant,
|
|
26
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function TabsTrigger({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(Tabs$1.Tab, {
|
|
32
|
+
"data-slot": "tabs-trigger",
|
|
33
|
+
className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function TabsContent({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
39
|
+
"data-slot": "tabs-content",
|
|
40
|
+
className: cn("flex-1 text-sm outline-none", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/textarea.tsx
|
|
5
|
+
function Textarea({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
7
|
+
"data-slot": "textarea",
|
|
8
|
+
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Textarea };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { toggleVariants } from "./toggle.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
6
|
+
//#region src/components/ui/toggle-group.d.ts
|
|
7
|
+
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroup$1.Props & VariantProps<typeof toggleVariants> & {
|
|
8
|
+
spacing?: number;
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
}): React$1.JSX.Element;
|
|
11
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: Toggle.Props & VariantProps<typeof toggleVariants>): React$1.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ToggleGroup, ToggleGroupItem };
|