@cmdniels/uikit 1.1.6 → 1.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 +4 -4
- package/out/components/button/Button.js +1 -1
- package/out/components/chart/ChartContainer.d.ts +7 -0
- package/out/components/chart/ChartContainer.js +24 -0
- package/out/components/chart/ChartContext.d.ts +16 -0
- package/out/components/chart/ChartContext.js +2 -0
- package/out/components/chart/ChartLegend.d.ts +3 -0
- package/out/components/chart/ChartLegend.js +5 -0
- package/out/components/chart/ChartLegendContent.d.ts +9 -0
- package/out/components/chart/ChartLegendContent.js +19 -0
- package/out/components/chart/ChartStyle.d.ts +5 -0
- package/out/components/chart/ChartStyle.js +23 -0
- package/out/components/chart/ChartTooltip.d.ts +3 -0
- package/out/components/chart/ChartTooltip.js +17 -0
- package/out/components/chart/ChartTooltipContent.d.ts +15 -0
- package/out/components/chart/ChartTooltipContent.js +49 -0
- package/out/components/chart/getPayloadConfigFromPayload.d.ts +11 -0
- package/out/components/chart/getPayloadConfigFromPayload.js +18 -0
- package/out/components/chart/useChart.d.ts +3 -0
- package/out/components/chart/useChart.js +9 -0
- package/out/components/copy-input/CopyInput.js +2 -3
- package/out/components/error/Error.d.ts +2 -1
- package/out/components/item/ItemActions.d.ts +2 -2
- package/out/components/item/ItemContent.d.ts +2 -2
- package/out/components/item/ItemDescription.d.ts +2 -2
- package/out/components/item/ItemFooter.d.ts +2 -2
- package/out/components/item/ItemGroup.d.ts +2 -2
- package/out/components/item/ItemHeader.d.ts +2 -2
- package/out/components/item/ItemMedia.d.ts +2 -2
- package/out/components/item/ItemSeparator.d.ts +2 -2
- package/out/components/item/ItemTitle.d.ts +2 -2
- package/out/components/link-input/LinkInput.js +1 -1
- package/out/components/sheet/Sheet.d.ts +2 -0
- package/out/components/sheet/Sheet.js +18 -0
- package/out/components/sheet/SheetClose.d.ts +2 -0
- package/out/components/sheet/SheetClose.js +18 -0
- package/out/components/sheet/SheetContent.d.ts +5 -0
- package/out/components/sheet/SheetContent.js +23 -0
- package/out/components/sheet/SheetDescription.d.ts +2 -0
- package/out/components/sheet/SheetDescription.js +19 -0
- package/out/components/sheet/SheetFooter.d.ts +2 -0
- package/out/components/sheet/SheetFooter.js +18 -0
- package/out/components/sheet/SheetHeader.d.ts +2 -0
- package/out/components/sheet/SheetHeader.js +18 -0
- package/out/components/sheet/SheetOverlay.d.ts +2 -0
- package/out/components/sheet/SheetOverlay.js +19 -0
- package/out/components/sheet/SheetPortal.d.ts +2 -0
- package/out/components/sheet/SheetPortal.js +18 -0
- package/out/components/sheet/SheetTitle.d.ts +2 -0
- package/out/components/sheet/SheetTitle.js +19 -0
- package/out/components/sheet/SheetTrigger.d.ts +2 -0
- package/out/components/sheet/SheetTrigger.js +18 -0
- package/out/components/sidebar/Sidebar.d.ts +7 -0
- package/out/components/sidebar/Sidebar.js +43 -0
- package/out/components/sidebar/SidebarContent.d.ts +2 -0
- package/out/components/sidebar/SidebarContent.js +17 -0
- package/out/components/sidebar/SidebarFooter.d.ts +2 -0
- package/out/components/sidebar/SidebarFooter.js +17 -0
- package/out/components/sidebar/SidebarGroup.d.ts +2 -0
- package/out/components/sidebar/SidebarGroup.js +17 -0
- package/out/components/sidebar/SidebarGroupAction.d.ts +3 -0
- package/out/components/sidebar/SidebarGroupAction.js +28 -0
- package/out/components/sidebar/SidebarGroupContent.d.ts +2 -0
- package/out/components/sidebar/SidebarGroupContent.js +17 -0
- package/out/components/sidebar/SidebarGroupLabel.d.ts +3 -0
- package/out/components/sidebar/SidebarGroupLabel.js +28 -0
- package/out/components/sidebar/SidebarHeader.d.ts +2 -0
- package/out/components/sidebar/SidebarHeader.js +17 -0
- package/out/components/sidebar/SidebarInput.d.ts +3 -0
- package/out/components/sidebar/SidebarInput.js +18 -0
- package/out/components/sidebar/SidebarInset.d.ts +2 -0
- package/out/components/sidebar/SidebarInset.js +17 -0
- package/out/components/sidebar/SidebarMenu.d.ts +2 -0
- package/out/components/sidebar/SidebarMenu.js +17 -0
- package/out/components/sidebar/SidebarMenuAction.d.ts +5 -0
- package/out/components/sidebar/SidebarMenuAction.js +29 -0
- package/out/components/sidebar/SidebarMenuBadge.d.ts +2 -0
- package/out/components/sidebar/SidebarMenuBadge.js +17 -0
- package/out/components/sidebar/SidebarMenuButton.d.ts +9 -0
- package/out/components/sidebar/SidebarMenuButton.js +46 -0
- package/out/components/sidebar/SidebarMenuItem.d.ts +2 -0
- package/out/components/sidebar/SidebarMenuItem.js +17 -0
- package/out/components/sidebar/SidebarMenuSkeleton.d.ts +4 -0
- package/out/components/sidebar/SidebarMenuSkeleton.js +23 -0
- package/out/components/sidebar/SidebarMenuSub.d.ts +2 -0
- package/out/components/sidebar/SidebarMenuSub.js +17 -0
- package/out/components/sidebar/SidebarMenuSubButton.d.ts +6 -0
- package/out/components/sidebar/SidebarMenuSubButton.js +30 -0
- package/out/components/sidebar/SidebarMenuSubItem.d.ts +2 -0
- package/out/components/sidebar/SidebarMenuSubItem.js +17 -0
- package/out/components/sidebar/SidebarProvider.d.ts +23 -0
- package/out/components/sidebar/SidebarProvider.js +69 -0
- package/out/components/sidebar/SidebarRail.d.ts +2 -0
- package/out/components/sidebar/SidebarRail.js +20 -0
- package/out/components/sidebar/SidebarSeparator.d.ts +3 -0
- package/out/components/sidebar/SidebarSeparator.js +18 -0
- package/out/components/sidebar/SidebarTrigger.d.ts +3 -0
- package/out/components/sidebar/SidebarTrigger.js +25 -0
- package/out/components/sidebar/sidebarMenuButtonVariants.d.ts +5 -0
- package/out/components/sidebar/sidebarMenuButtonVariants.js +19 -0
- package/out/components/sidebar/useIsMobile.d.ts +1 -0
- package/out/components/sidebar/useIsMobile.js +14 -0
- package/out/components/sidebar/useSidebar.d.ts +9 -0
- package/out/components/sidebar/useSidebar.js +9 -0
- package/out/components/spinner/Spinner.d.ts +2 -1
- package/out/index.d.ts +36 -0
- package/out/index.js +37 -0
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import cn from "../../cn";
|
|
14
|
+
export default function SidebarMenuSubItem(_a) {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return (_jsx("li", Object.assign({ "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn("group/menu-sub-item relative", className) }, props)));
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
export declare const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
3
|
+
export declare const SIDEBAR_COOKIE_MAX_AGE: number;
|
|
4
|
+
export declare const SIDEBAR_WIDTH = "16rem";
|
|
5
|
+
export declare const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
6
|
+
export declare const SIDEBAR_WIDTH_ICON = "3rem";
|
|
7
|
+
export declare const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
8
|
+
type SidebarContextProps = {
|
|
9
|
+
state: "expanded" | "collapsed";
|
|
10
|
+
open: boolean;
|
|
11
|
+
setOpen: (open: boolean) => void;
|
|
12
|
+
openMobile: boolean;
|
|
13
|
+
setOpenMobile: (open: boolean) => void;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
toggleSidebar: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const SidebarContext: import("react").Context<SidebarContextProps | null>;
|
|
18
|
+
export default function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: ComponentProps<"div"> & {
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { createContext, useCallback, useEffect, useMemo, useState, } from "react";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
import useIsMobile from "./useIsMobile";
|
|
17
|
+
export const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
18
|
+
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
19
|
+
export const SIDEBAR_WIDTH = "16rem";
|
|
20
|
+
export const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
21
|
+
export const SIDEBAR_WIDTH_ICON = "3rem";
|
|
22
|
+
export const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
23
|
+
export const SidebarContext = createContext(null);
|
|
24
|
+
export default function SidebarProvider(_a) {
|
|
25
|
+
var { defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children } = _a, props = __rest(_a, ["defaultOpen", "open", "onOpenChange", "className", "style", "children"]);
|
|
26
|
+
const isMobile = useIsMobile();
|
|
27
|
+
const [openMobile, setOpenMobile] = useState(false);
|
|
28
|
+
// This is the internal state of the sidebar.
|
|
29
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
30
|
+
const [_open, _setOpen] = useState(defaultOpen);
|
|
31
|
+
const open = openProp !== null && openProp !== void 0 ? openProp : _open;
|
|
32
|
+
const setOpen = useCallback((value) => {
|
|
33
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
34
|
+
if (setOpenProp) {
|
|
35
|
+
setOpenProp(openState);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
_setOpen(openState);
|
|
39
|
+
}
|
|
40
|
+
// This sets the cookie to keep the sidebar state.
|
|
41
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
42
|
+
}, [setOpenProp, open]);
|
|
43
|
+
// Helper to toggle the sidebar.
|
|
44
|
+
const toggleSidebar = useCallback(() => (isMobile ? setOpenMobile((prev) => !prev) : setOpen((prev) => !prev)), [isMobile, setOpen, setOpenMobile]);
|
|
45
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
46
|
+
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
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
57
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
58
|
+
const state = open ? "expanded" : "collapsed";
|
|
59
|
+
const contextValue = useMemo(() => ({
|
|
60
|
+
state,
|
|
61
|
+
open,
|
|
62
|
+
setOpen,
|
|
63
|
+
isMobile,
|
|
64
|
+
openMobile,
|
|
65
|
+
setOpenMobile,
|
|
66
|
+
toggleSidebar,
|
|
67
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
68
|
+
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx("div", Object.assign({ "data-slot": "sidebar-wrapper", style: Object.assign({ "--sidebar-width": SIDEBAR_WIDTH, "--sidebar-width-icon": SIDEBAR_WIDTH_ICON }, style), className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-card", className) }, props, { children: children })) }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import cn from "../../cn";
|
|
15
|
+
import useSidebar from "./useSidebar";
|
|
16
|
+
export default function SidebarRail(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
const { toggleSidebar } = useSidebar();
|
|
19
|
+
return (_jsx("button", Object.assign({ "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 hover:after:bg-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=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full hover:group-data-[collapsible=offExamples]:bg-card", "[[data-side=left][data-collapsible=offExamples]_&]:-right-2", "[[data-side=right][data-collapsible=offExamples]_&]:-left-2", className) }, props)));
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import cn from "../../cn";
|
|
14
|
+
import Separator from "../../components/separator/Separator";
|
|
15
|
+
export default function SidebarSeparator(_a) {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (_jsx(Separator, Object.assign({ "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("mx-2 w-auto bg-border", className) }, props)));
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { IconLayoutSidebar } from "@tabler/icons-react";
|
|
15
|
+
import cn from "../../cn";
|
|
16
|
+
import Button from "../../components/button/Button";
|
|
17
|
+
import useSidebar from "./useSidebar";
|
|
18
|
+
export default function SidebarTrigger(_a) {
|
|
19
|
+
var { className, onClick } = _a, props = __rest(_a, ["className", "onClick"]);
|
|
20
|
+
const { toggleSidebar } = useSidebar();
|
|
21
|
+
return (_jsxs(Button, Object.assign({ "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), onClick: (event) => {
|
|
22
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
23
|
+
toggleSidebar();
|
|
24
|
+
} }, props, { children: [_jsx(IconLayoutSidebar, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] })));
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
2
|
+
variant?: "default" | "outline" | null | undefined;
|
|
3
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export default sidebarMenuButtonVariants;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
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-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-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-accent data-open:hover:text-accent-foreground data-active:bg-accent data-active:font-medium data-active:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
3
|
+
variants: {
|
|
4
|
+
variant: {
|
|
5
|
+
default: "hover:bg-accent hover:text-accent-foreground",
|
|
6
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--border))] hover:bg-accent hover:text-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--accent))]",
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
default: "h-8 text-sm",
|
|
10
|
+
sm: "h-7 text-xs",
|
|
11
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "default",
|
|
16
|
+
size: "default",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default sidebarMenuButtonVariants;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useIsMobile(): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
export default function useIsMobile() {
|
|
3
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const mql = window.matchMedia("(max-width: 768px)");
|
|
6
|
+
const onChange = () => {
|
|
7
|
+
setIsMobile(mql.matches);
|
|
8
|
+
};
|
|
9
|
+
mql.addEventListener("change", onChange);
|
|
10
|
+
setIsMobile(mql.matches);
|
|
11
|
+
return () => mql.removeEventListener("change", onChange);
|
|
12
|
+
}, []);
|
|
13
|
+
return isMobile;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { SidebarContext } from "./SidebarProvider";
|
|
3
|
+
export default function useSidebar() {
|
|
4
|
+
const context = useContext(SidebarContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { IconLoader } from "@tabler/icons-react";
|
|
2
|
-
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
export default function Spinner({ className, ...props }: ComponentProps<typeof IconLoader>): import("react/jsx-runtime").JSX.Element;
|
package/out/index.d.ts
CHANGED
|
@@ -33,6 +33,13 @@ export { default as CardDescription } from "./components/card/CardDescription";
|
|
|
33
33
|
export { default as CardFooter } from "./components/card/CardFooter";
|
|
34
34
|
export { default as CardHeader } from "./components/card/CardHeader";
|
|
35
35
|
export { default as CardTitle } from "./components/card/CardTitle";
|
|
36
|
+
export type { ChartConfig } from "./components/chart/ChartContext";
|
|
37
|
+
export { default as ChartContainer } from "./components/chart/ChartContainer";
|
|
38
|
+
export { default as ChartLegend } from "./components/chart/ChartLegend";
|
|
39
|
+
export { default as ChartLegendContent } from "./components/chart/ChartLegendContent";
|
|
40
|
+
export { default as ChartStyle } from "./components/chart/ChartStyle";
|
|
41
|
+
export { default as ChartTooltip } from "./components/chart/ChartTooltip";
|
|
42
|
+
export { default as ChartTooltipContent } from "./components/chart/ChartTooltipContent";
|
|
36
43
|
export { default as Checkbox } from "./components/checkbox/Checkbox";
|
|
37
44
|
export { default as Combobox } from "./components/combobox/Combobox";
|
|
38
45
|
export { default as ComboboxChip } from "./components/combobox/ComboboxChip";
|
|
@@ -134,6 +141,35 @@ export { default as SelectTrigger } from "./components/select/SelectTrigger";
|
|
|
134
141
|
export { default as SelectValue } from "./components/select/SelectValue";
|
|
135
142
|
export { default as Separator } from "./components/separator/Separator";
|
|
136
143
|
export { default as Skeleton } from "./components/skeleton/Skeleton";
|
|
144
|
+
export { default as Sheet } from "./components/sheet/Sheet";
|
|
145
|
+
export { default as SheetContent } from "./components/sheet/SheetContent";
|
|
146
|
+
export { default as SheetDescription } from "./components/sheet/SheetDescription";
|
|
147
|
+
export { default as SheetHeader } from "./components/sheet/SheetHeader";
|
|
148
|
+
export { default as SheetTitle } from "./components/sheet/SheetTitle";
|
|
149
|
+
export { default as SheetTrigger } from "./components/sheet/SheetTrigger";
|
|
150
|
+
export { default as Sidebar } from "./components/sidebar/Sidebar";
|
|
151
|
+
export { default as SidebarContent } from "./components/sidebar/SidebarContent";
|
|
152
|
+
export { default as SidebarFooter } from "./components/sidebar/SidebarFooter";
|
|
153
|
+
export { default as SidebarGroup } from "./components/sidebar/SidebarGroup";
|
|
154
|
+
export { default as SidebarGroupAction } from "./components/sidebar/SidebarGroupAction";
|
|
155
|
+
export { default as SidebarGroupContent } from "./components/sidebar/SidebarGroupContent";
|
|
156
|
+
export { default as SidebarGroupLabel } from "./components/sidebar/SidebarGroupLabel";
|
|
157
|
+
export { default as SidebarHeader } from "./components/sidebar/SidebarHeader";
|
|
158
|
+
export { default as SidebarInput } from "./components/sidebar/SidebarInput";
|
|
159
|
+
export { default as SidebarInset } from "./components/sidebar/SidebarInset";
|
|
160
|
+
export { default as SidebarMenu } from "./components/sidebar/SidebarMenu";
|
|
161
|
+
export { default as SidebarMenuAction } from "./components/sidebar/SidebarMenuAction";
|
|
162
|
+
export { default as SidebarMenuBadge } from "./components/sidebar/SidebarMenuBadge";
|
|
163
|
+
export { default as SidebarMenuButton } from "./components/sidebar/SidebarMenuButton";
|
|
164
|
+
export { default as SidebarMenuItem } from "./components/sidebar/SidebarMenuItem";
|
|
165
|
+
export { default as SidebarMenuSkeleton } from "./components/sidebar/SidebarMenuSkeleton";
|
|
166
|
+
export { default as SidebarMenuSub } from "./components/sidebar/SidebarMenuSub";
|
|
167
|
+
export { default as SidebarMenuSubButton } from "./components/sidebar/SidebarMenuSubButton";
|
|
168
|
+
export { default as SidebarMenuSubItem } from "./components/sidebar/SidebarMenuSubItem";
|
|
169
|
+
export { default as SidebarProvider } from "./components/sidebar/SidebarProvider";
|
|
170
|
+
export { default as SidebarRail } from "./components/sidebar/SidebarRail";
|
|
171
|
+
export { default as SidebarSeparator } from "./components/sidebar/SidebarSeparator";
|
|
172
|
+
export { default as SidebarTrigger } from "./components/sidebar/SidebarTrigger";
|
|
137
173
|
export { default as Toaster } from "./components/sonner/Toaster";
|
|
138
174
|
export { default as Sortable } from "./components/sortable/Sortable";
|
|
139
175
|
export { default as SortableContent } from "./components/sortable/SortableContent";
|
package/out/index.js
CHANGED
|
@@ -42,6 +42,12 @@ export { default as CardDescription } from "./components/card/CardDescription";
|
|
|
42
42
|
export { default as CardFooter } from "./components/card/CardFooter";
|
|
43
43
|
export { default as CardHeader } from "./components/card/CardHeader";
|
|
44
44
|
export { default as CardTitle } from "./components/card/CardTitle";
|
|
45
|
+
export { default as ChartContainer } from "./components/chart/ChartContainer";
|
|
46
|
+
export { default as ChartLegend } from "./components/chart/ChartLegend";
|
|
47
|
+
export { default as ChartLegendContent } from "./components/chart/ChartLegendContent";
|
|
48
|
+
export { default as ChartStyle } from "./components/chart/ChartStyle";
|
|
49
|
+
export { default as ChartTooltip } from "./components/chart/ChartTooltip";
|
|
50
|
+
export { default as ChartTooltipContent } from "./components/chart/ChartTooltipContent";
|
|
45
51
|
// Checkbox
|
|
46
52
|
export { default as Checkbox } from "./components/checkbox/Checkbox";
|
|
47
53
|
// Combobox
|
|
@@ -162,6 +168,37 @@ export { default as SelectValue } from "./components/select/SelectValue";
|
|
|
162
168
|
export { default as Separator } from "./components/separator/Separator";
|
|
163
169
|
// Skeleton
|
|
164
170
|
export { default as Skeleton } from "./components/skeleton/Skeleton";
|
|
171
|
+
// Sheet
|
|
172
|
+
export { default as Sheet } from "./components/sheet/Sheet";
|
|
173
|
+
export { default as SheetContent } from "./components/sheet/SheetContent";
|
|
174
|
+
export { default as SheetDescription } from "./components/sheet/SheetDescription";
|
|
175
|
+
export { default as SheetHeader } from "./components/sheet/SheetHeader";
|
|
176
|
+
export { default as SheetTitle } from "./components/sheet/SheetTitle";
|
|
177
|
+
export { default as SheetTrigger } from "./components/sheet/SheetTrigger";
|
|
178
|
+
// Sidebar
|
|
179
|
+
export { default as Sidebar } from "./components/sidebar/Sidebar";
|
|
180
|
+
export { default as SidebarContent } from "./components/sidebar/SidebarContent";
|
|
181
|
+
export { default as SidebarFooter } from "./components/sidebar/SidebarFooter";
|
|
182
|
+
export { default as SidebarGroup } from "./components/sidebar/SidebarGroup";
|
|
183
|
+
export { default as SidebarGroupAction } from "./components/sidebar/SidebarGroupAction";
|
|
184
|
+
export { default as SidebarGroupContent } from "./components/sidebar/SidebarGroupContent";
|
|
185
|
+
export { default as SidebarGroupLabel } from "./components/sidebar/SidebarGroupLabel";
|
|
186
|
+
export { default as SidebarHeader } from "./components/sidebar/SidebarHeader";
|
|
187
|
+
export { default as SidebarInput } from "./components/sidebar/SidebarInput";
|
|
188
|
+
export { default as SidebarInset } from "./components/sidebar/SidebarInset";
|
|
189
|
+
export { default as SidebarMenu } from "./components/sidebar/SidebarMenu";
|
|
190
|
+
export { default as SidebarMenuAction } from "./components/sidebar/SidebarMenuAction";
|
|
191
|
+
export { default as SidebarMenuBadge } from "./components/sidebar/SidebarMenuBadge";
|
|
192
|
+
export { default as SidebarMenuButton } from "./components/sidebar/SidebarMenuButton";
|
|
193
|
+
export { default as SidebarMenuItem } from "./components/sidebar/SidebarMenuItem";
|
|
194
|
+
export { default as SidebarMenuSkeleton } from "./components/sidebar/SidebarMenuSkeleton";
|
|
195
|
+
export { default as SidebarMenuSub } from "./components/sidebar/SidebarMenuSub";
|
|
196
|
+
export { default as SidebarMenuSubButton } from "./components/sidebar/SidebarMenuSubButton";
|
|
197
|
+
export { default as SidebarMenuSubItem } from "./components/sidebar/SidebarMenuSubItem";
|
|
198
|
+
export { default as SidebarProvider } from "./components/sidebar/SidebarProvider";
|
|
199
|
+
export { default as SidebarRail } from "./components/sidebar/SidebarRail";
|
|
200
|
+
export { default as SidebarSeparator } from "./components/sidebar/SidebarSeparator";
|
|
201
|
+
export { default as SidebarTrigger } from "./components/sidebar/SidebarTrigger";
|
|
165
202
|
// Sonner
|
|
166
203
|
export { default as Toaster } from "./components/sonner/Toaster";
|
|
167
204
|
// Sortable
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmdniels/uikit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@clerk/themes": "^2.4.46",
|
|
33
|
+
"recharts": "^3.6.0",
|
|
33
34
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
34
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
35
36
|
"react-dom": "^18.0.0 || ^19.0.0"
|