@ploykit/ui 0.1.1 → 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 +41 -41
- package/dist/components/CronInput.js +2 -2
- package/dist/components/DataTable.js +1 -1
- package/dist/components/ImpersonationBanner.js +1 -1
- package/dist/components/NotificationBell.js +1 -1
- package/dist/components/OnboardingChecklist.js +3 -3
- package/dist/components/Page.js +1 -1
- package/dist/components/SecretModal.js +1 -1
- package/dist/components/SettingsCard.js +2 -2
- package/dist/components/SiteBannerLayer.js +1 -1
- package/dist/components/StatusBadge.d.ts +4 -0
- package/dist/components/StatusBadge.js +7 -0
- package/dist/components/UserMenu.js +2 -2
- package/dist/components/WorkspaceSwitcher.js +4 -4
- package/dist/components/ui/Badge.d.ts +4 -10
- package/dist/components/ui/Badge.js +26 -14
- package/dist/components/ui/Button.d.ts +5 -7
- package/dist/components/ui/Button.js +22 -21
- package/dist/components/ui/Input.d.ts +2 -2
- package/dist/components/ui/Input.js +4 -7
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog.js +10 -9
- package/dist/components/ui/avatar.js +3 -2
- package/dist/components/ui/breadcrumb.js +7 -7
- package/dist/components/ui/card.d.ts +2 -4
- package/dist/components/ui/card.js +7 -7
- package/dist/components/ui/checkbox.js +3 -2
- package/dist/components/ui/dialog.d.ts +16 -14
- package/dist/components/ui/dialog.js +35 -25
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.js +50 -0
- package/dist/components/ui/empty.d.ts +7 -9
- package/dist/components/ui/empty.js +6 -9
- package/dist/components/ui/field.js +10 -9
- package/dist/components/ui/popover.js +3 -2
- package/dist/components/ui/progress.js +2 -1
- package/dist/components/ui/select.js +6 -6
- package/dist/components/ui/separator.js +1 -0
- package/dist/components/ui/sheet.js +3 -3
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +25 -34
- package/dist/components/ui/skeleton.d.ts +1 -2
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/index.d.ts +5 -39
- package/dist/index.js +5 -25
- package/dist/layouts/AppShell.d.ts +1 -1
- package/dist/layouts/AppShell.js +23 -1
- package/dist/layouts/SettingsShell.d.ts +1 -1
- package/dist/layouts/SettingsShell.js +3 -3
- package/dist/pages/LoginPage.js +5 -5
- package/dist/pages/account/NotificationPreferencesPage.js +2 -2
- package/dist/pages/account/ProfileSettingsPage.js +6 -6
- package/dist/pages/account/SecuritySettingsPage.js +7 -7
- package/dist/pages/account/TokensPage.js +4 -4
- package/dist/pages/admin/AdminSettingsPage.js +5 -5
- package/dist/pages/admin/AdminShell.js +2 -2
- package/dist/pages/admin/AuditPage.js +3 -3
- package/dist/pages/admin/OrdersPage.js +4 -3
- package/dist/pages/admin/OverviewPage.js +4 -4
- package/dist/pages/admin/SSOPage.js +3 -3
- package/dist/pages/admin/UserDetailPage.js +6 -5
- package/dist/pages/admin/UsersPage.js +7 -6
- package/dist/pages/admin/WebhookDeliveriesPage.js +4 -3
- package/dist/pages/admin/WorkspaceDetailPage.js +5 -5
- package/dist/pages/admin/WorkspacesPage.js +4 -4
- package/dist/pages/admin/shared.js +1 -1
- package/dist/pages/auth/ForgotPasswordPage.js +3 -3
- package/dist/pages/auth/InviteAcceptPage.js +3 -3
- package/dist/pages/auth/RegisterPage.js +6 -6
- package/dist/pages/auth/ResetPasswordPage.js +3 -3
- package/dist/pages/auth/VerifyEmailPage.js +3 -3
- package/dist/pages/workspace/BillingPage.js +8 -7
- package/dist/pages/workspace/BillingSuccessPage.js +3 -3
- package/dist/pages/workspace/MembersPage.js +7 -6
- package/dist/pages/workspace/SchedulesPage.js +5 -5
- package/dist/pages/workspace/UsagePage.d.ts +1 -1
- package/dist/pages/workspace/UsagePage.js +2 -2
- package/dist/pages/workspace/WebhooksPage.js +9 -9
- package/dist/pages/workspace/WorkspaceAuditPage.js +3 -3
- package/dist/pages/workspace/WorkspaceGeneralPage.js +7 -7
- package/package.json +8 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
@@ -5,8 +6,8 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
5
6
|
import { cva } from "class-variance-authority";
|
|
6
7
|
import { cn } from "../../lib/utils";
|
|
7
8
|
import { useIsMobile } from "../../hooks/use-mobile";
|
|
8
|
-
import { Button } from "./
|
|
9
|
-
import { Input } from "./
|
|
9
|
+
import { Button } from "./button";
|
|
10
|
+
import { Input } from "./input";
|
|
10
11
|
import { Separator } from "./separator";
|
|
11
12
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./sheet";
|
|
12
13
|
import { Skeleton } from "./skeleton";
|
|
@@ -18,16 +19,6 @@ const SIDEBAR_WIDTH = "16rem";
|
|
|
18
19
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
19
20
|
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
20
21
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
21
|
-
function readSidebarCookie() {
|
|
22
|
-
if (typeof document === "undefined")
|
|
23
|
-
return undefined;
|
|
24
|
-
const match = document.cookie
|
|
25
|
-
.split("; ")
|
|
26
|
-
.find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`));
|
|
27
|
-
if (!match)
|
|
28
|
-
return undefined;
|
|
29
|
-
return match.split("=")[1] === "false" ? false : true;
|
|
30
|
-
}
|
|
31
22
|
const SidebarContext = React.createContext(null);
|
|
32
23
|
function useSidebar() {
|
|
33
24
|
const context = React.useContext(SidebarContext);
|
|
@@ -36,14 +27,12 @@ function useSidebar() {
|
|
|
36
27
|
}
|
|
37
28
|
return context;
|
|
38
29
|
}
|
|
39
|
-
function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
30
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
40
31
|
const isMobile = useIsMobile();
|
|
41
32
|
const [openMobile, setOpenMobile] = React.useState(false);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return readSidebarCookie() ?? true;
|
|
46
|
-
});
|
|
33
|
+
// This is the internal state of the sidebar.
|
|
34
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
35
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
47
36
|
const open = openProp ?? _open;
|
|
48
37
|
const setOpen = React.useCallback((value) => {
|
|
49
38
|
const openState = typeof value === "function" ? value(open) : value;
|
|
@@ -53,21 +42,18 @@ function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenPro
|
|
|
53
42
|
else {
|
|
54
43
|
_setOpen(openState);
|
|
55
44
|
}
|
|
45
|
+
// This sets the cookie to keep the sidebar state.
|
|
56
46
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
57
47
|
}, [setOpenProp, open]);
|
|
48
|
+
// Helper to toggle the sidebar.
|
|
58
49
|
const toggleSidebar = React.useCallback(() => {
|
|
59
50
|
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
60
51
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
52
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
61
53
|
React.useEffect(() => {
|
|
62
54
|
const handleKeyDown = (event) => {
|
|
63
55
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
64
56
|
(event.metaKey || event.ctrlKey)) {
|
|
65
|
-
const target = event.target;
|
|
66
|
-
if (target?.isContentEditable ||
|
|
67
|
-
(target && typeof target.matches === "function" &&
|
|
68
|
-
target.matches("input, textarea, select"))) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
57
|
event.preventDefault();
|
|
72
58
|
toggleSidebar();
|
|
73
59
|
}
|
|
@@ -75,6 +61,8 @@ function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenPro
|
|
|
75
61
|
window.addEventListener("keydown", handleKeyDown);
|
|
76
62
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
77
63
|
}, [toggleSidebar]);
|
|
64
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
65
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
78
66
|
const state = open ? "expanded" : "collapsed";
|
|
79
67
|
const contextValue = React.useMemo(() => ({
|
|
80
68
|
state,
|
|
@@ -101,25 +89,27 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
101
89
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
102
90
|
}, 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 })] }) }));
|
|
103
91
|
}
|
|
104
|
-
return (_jsxs("div", { className: "group peer hidden text-sidebar-foreground md:block", "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_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"
|
|
92
|
+
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("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"
|
|
105
93
|
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
106
|
-
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), _jsx("div", { "data-slot": "sidebar-container", "data-side": side, 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",
|
|
94
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), _jsx("div", { "data-slot": "sidebar-container", "data-side": side, 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",
|
|
95
|
+
// Adjust the padding for floating and inset variants.
|
|
96
|
+
variant === "floating" || variant === "inset"
|
|
107
97
|
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
108
98
|
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", 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", children: children }) })] }));
|
|
109
99
|
}
|
|
110
100
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
111
101
|
const { toggleSidebar } = useSidebar();
|
|
112
|
-
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "
|
|
102
|
+
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), onClick: (event) => {
|
|
113
103
|
onClick?.(event);
|
|
114
104
|
toggleSidebar();
|
|
115
105
|
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
116
106
|
}
|
|
117
107
|
function SidebarRail({ className, ...props }) {
|
|
118
108
|
const { toggleSidebar } = useSidebar();
|
|
119
|
-
return (_jsx("button", { "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 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-
|
|
109
|
+
return (_jsx("button", { "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 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), ...props }));
|
|
120
110
|
}
|
|
121
111
|
function SidebarInset({ className, ...props }) {
|
|
122
|
-
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-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[
|
|
112
|
+
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-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className), ...props }));
|
|
123
113
|
}
|
|
124
114
|
function SidebarInput({ className, ...props }) {
|
|
125
115
|
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("h-8 w-full bg-background shadow-none", className), ...props }));
|
|
@@ -134,7 +124,7 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
134
124
|
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("mx-2 w-auto bg-sidebar-border", className), ...props }));
|
|
135
125
|
}
|
|
136
126
|
function SidebarContent({ className, ...props }) {
|
|
137
|
-
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-
|
|
127
|
+
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
|
|
138
128
|
}
|
|
139
129
|
function SidebarGroup({ className, ...props }) {
|
|
140
130
|
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("relative flex w-full min-w-0 flex-col p-2", className), ...props }));
|
|
@@ -169,7 +159,7 @@ function SidebarGroupContent({ className, ...props }) {
|
|
|
169
159
|
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn("w-full text-sm", className), ...props }));
|
|
170
160
|
}
|
|
171
161
|
function SidebarMenu({ className, ...props }) {
|
|
172
|
-
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn("flex w-full min-w-0 flex-col gap-
|
|
162
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn("flex w-full min-w-0 flex-col gap-0", className), ...props }));
|
|
173
163
|
}
|
|
174
164
|
function SidebarMenuItem({ className, ...props }) {
|
|
175
165
|
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
|
|
@@ -234,9 +224,10 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
234
224
|
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", 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), ...props }));
|
|
235
225
|
}
|
|
236
226
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
227
|
+
// Random width between 50 to 90%.
|
|
228
|
+
const [width] = React.useState(() => {
|
|
229
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
230
|
+
});
|
|
240
231
|
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn("flex h-8 items-center gap-2 rounded-md px-2", className), ...props, children: [showIcon && (_jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" })), _jsx(Skeleton, { className: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text", style: {
|
|
241
232
|
"--skeleton-width": width,
|
|
242
233
|
} })] }));
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
3
3
|
import { cn } from "../../lib/utils";
|
|
4
4
|
function Switch({ className, size = "default", ...props }) {
|
|
5
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent
|
|
5
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "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 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground" }) }));
|
|
6
6
|
}
|
|
7
7
|
export { Switch };
|
|
@@ -3,9 +3,9 @@ import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
6
|
-
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn("group/tabs flex gap-2 data-
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className), ...props }));
|
|
7
7
|
}
|
|
8
|
-
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground h-
|
|
8
|
+
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-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default: "bg-muted",
|
|
@@ -20,7 +20,7 @@ function TabsList({ className, variant = "default", ...props }) {
|
|
|
20
20
|
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
21
21
|
}
|
|
22
22
|
function TabsTrigger({ className, ...props }) {
|
|
23
|
-
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5
|
|
23
|
+
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 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 has-data-[icon=inline-start]:pl-1 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), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function TabsContent({ className, ...props }) {
|
|
26
26
|
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
|
|
@@ -11,6 +11,6 @@ function TooltipTrigger({ ...props }) {
|
|
|
11
11
|
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
12
12
|
}
|
|
13
13
|
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
|
|
14
|
-
return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
14
|
+
return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
15
15
|
}
|
|
16
16
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export { PloykitProvider, queryKeys } from './provider/PloykitProvider';
|
|
2
|
-
export type { PKUser, PKWorkspace, PKSubscription, PKOrder, PKPlan } from './provider/PloykitProvider';
|
|
3
|
-
export { useAuth } from './hooks/useAuth';
|
|
4
|
-
export { useLogin } from './hooks/useLogin';
|
|
5
|
-
export { useWorkspace, useWorkspaceSwitch } from './hooks/useWorkspace';
|
|
6
|
-
export { useBilling, useUsagePreview, PlanGate } from './hooks/useBilling';
|
|
7
|
-
export { useApi, ApiError } from './hooks/useApi';
|
|
8
|
-
export type { ApiFetchOptions } from './hooks/useApi';
|
|
9
|
-
export { useSEO } from './hooks/useSEO';
|
|
10
|
-
export type { SeoMeta } from './hooks/useSEO';
|
|
11
|
-
export { useWsStatus, useWsScope, useWsFrame } from './hooks/ws';
|
|
12
|
-
export { createWsClient, defaultWsUrl } from './realtime';
|
|
13
|
-
export { bridgeWsToQuery } from './lib/ws-query-bridge';
|
|
14
|
-
export type { WsInvalidationRule } from './lib/ws-query-bridge';
|
|
15
1
|
export { AppShell } from './layouts/AppShell';
|
|
16
2
|
export type { NavItem } from './layouts/AppShell';
|
|
17
3
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, } from './components/ui/sidebar';
|
|
@@ -23,10 +9,9 @@ export { LoginPage } from './pages/LoginPage';
|
|
|
23
9
|
export type { OAuthProviderOption, LoginPageProps } from './pages/LoginPage';
|
|
24
10
|
export { LandingPage } from './pages/LandingPage';
|
|
25
11
|
export type { Feature as LandingFeature, Plan as LandingPlan } from './pages/LandingPage';
|
|
26
|
-
export { Button, buttonVariants } from './components/ui/
|
|
27
|
-
export
|
|
28
|
-
export {
|
|
29
|
-
export { Badge, badgeVariants, StatusBadge } from './components/ui/Badge';
|
|
12
|
+
export { Button, buttonVariants } from './components/ui/button';
|
|
13
|
+
export { Input } from './components/ui/input';
|
|
14
|
+
export { StatusBadge } from './components/StatusBadge';
|
|
30
15
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, } from './components/ui/dialog';
|
|
31
16
|
export { PageHeader, PageLoading, PageEmpty, PageError } from './components/Page';
|
|
32
17
|
export { ConfirmProvider, useConfirm } from './components/ConfirmDialog';
|
|
@@ -35,9 +20,6 @@ export { WorkspaceSwitcher } from './components/WorkspaceSwitcher';
|
|
|
35
20
|
export { SecretModal, ImpactConfirmation } from './components/SecretModal';
|
|
36
21
|
export { cn, statusTone, statusLabel, STATUS_TONE_CLASS, STATUS_LABEL, formatDate, formatDateTime, shortID } from './lib/utils';
|
|
37
22
|
export type { StatusTone } from './lib/utils';
|
|
38
|
-
export { roleSatisfies } from './lib/perm';
|
|
39
|
-
export type { Perm } from './lib/perm';
|
|
40
|
-
export { usePasswordReset } from './hooks/usePasswordReset';
|
|
41
23
|
export { ForgotPasswordPage } from './pages/auth/ForgotPasswordPage';
|
|
42
24
|
export type { ForgotPasswordPageProps } from './pages/auth/ForgotPasswordPage';
|
|
43
25
|
export { ResetPasswordPage } from './pages/auth/ResetPasswordPage';
|
|
@@ -46,8 +28,6 @@ export { VerifyEmailPage } from './pages/auth/VerifyEmailPage';
|
|
|
46
28
|
export { ErrorBoundary } from './components/ErrorBoundary';
|
|
47
29
|
export type { ErrorBoundaryProps } from './components/ErrorBoundary';
|
|
48
30
|
export { toast, Toaster } from './components/toast';
|
|
49
|
-
export { useZodForm } from './hooks/useZodForm';
|
|
50
|
-
export type { ZodFormOptions } from './hooks/useZodForm';
|
|
51
31
|
export { FormField } from './components/FormField';
|
|
52
32
|
export type { FormFieldProps } from './components/FormField';
|
|
53
33
|
export { DataTable } from './components/DataTable';
|
|
@@ -57,7 +37,7 @@ export { Label } from './components/ui/label';
|
|
|
57
37
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from './components/ui/tabs';
|
|
58
38
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/ui/alert-dialog';
|
|
59
39
|
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, } from './components/ui/avatar';
|
|
60
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './components/ui/menu';
|
|
40
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './components/ui/dropdown-menu';
|
|
61
41
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './components/ui/select';
|
|
62
42
|
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from './components/ui/popover';
|
|
63
43
|
export { Switch } from './components/ui/switch';
|
|
@@ -65,7 +45,7 @@ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValu
|
|
|
65
45
|
export { Checkbox } from './components/ui/checkbox';
|
|
66
46
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
|
|
67
47
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './components/ui/breadcrumb';
|
|
68
|
-
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia,
|
|
48
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, } from './components/ui/empty';
|
|
69
49
|
export { SettingsShell } from './layouts/SettingsShell';
|
|
70
50
|
export type { SettingsNavItem, SettingsNavGroup, SettingsShellProps } from './layouts/SettingsShell';
|
|
71
51
|
export { AuthShell } from './layouts/AuthShell';
|
|
@@ -90,26 +70,12 @@ export { UsagePage } from './pages/workspace/UsagePage';
|
|
|
90
70
|
export { BillingPage } from './pages/workspace/BillingPage';
|
|
91
71
|
export { BillingSuccessPage } from './pages/workspace/BillingSuccessPage';
|
|
92
72
|
export { WebhooksPage } from './pages/workspace/WebhooksPage';
|
|
93
|
-
export { useSessions, useRevokeSession, useRevokeAllSessions } from './hooks/useSessions';
|
|
94
|
-
export type { SessionInfo } from './hooks/useSessions';
|
|
95
|
-
export { useTokens, useCreateToken, useRevokeToken } from './hooks/useTokens';
|
|
96
|
-
export type { PAT, CreatePATResult } from './hooks/useTokens';
|
|
97
|
-
export { useNotificationPrefs, useSetNotificationPref } from './hooks/useNotificationPrefs';
|
|
98
|
-
export type { NotificationPreference } from './hooks/useNotificationPrefs';
|
|
99
|
-
export { useMembers, useMemberMutations, useMyInvitations, ASSIGNABLE_ROLES } from './hooks/useMembers';
|
|
100
|
-
export type { PKMember, PKInvitation, PKShareLink, PKInvitationWithWorkspace, CreateShareLinkResult, } from './hooks/useMembers';
|
|
101
|
-
export { useAudit, exportAuditCsv, auditQueryString, EMPTY_AUDIT_FILTERS } from './hooks/useAudit';
|
|
102
|
-
export type { AuditFilters, PKAuditEvent } from './hooks/useAudit';
|
|
103
|
-
export { useUsage } from './hooks/useUsage';
|
|
104
|
-
export type { PKUsageResp, PKUsageItem } from './hooks/useUsage';
|
|
105
73
|
export { apiErrorMessage } from './lib/api-error';
|
|
106
74
|
export { CronInput } from './components/CronInput';
|
|
107
75
|
export { SchedulesPage } from './pages/workspace/SchedulesPage';
|
|
108
76
|
export { SiteBanner } from './components/SiteBanner';
|
|
109
77
|
export { SiteBannerLayer } from './components/SiteBannerLayer';
|
|
110
78
|
export type { SiteBannerLayerProps } from './components/SiteBannerLayer';
|
|
111
|
-
export { useSiteConfig, SITE_CONFIG_QUERY_KEY } from './hooks/useSiteConfig';
|
|
112
|
-
export type { SiteConfig } from './hooks/useSiteConfig';
|
|
113
79
|
export { ImpersonationBanner } from './components/ImpersonationBanner';
|
|
114
80
|
export { AdminShell } from './pages/admin/AdminShell';
|
|
115
81
|
export { OverviewPage } from './pages/admin/OverviewPage';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export { PloykitProvider, queryKeys } from './provider/PloykitProvider';
|
|
2
|
-
export { useAuth } from './hooks/useAuth';
|
|
3
|
-
export { useLogin } from './hooks/useLogin';
|
|
4
|
-
export { useWorkspace, useWorkspaceSwitch } from './hooks/useWorkspace';
|
|
5
|
-
export { useBilling, useUsagePreview, PlanGate } from './hooks/useBilling';
|
|
6
|
-
export { useApi, ApiError } from './hooks/useApi';
|
|
7
|
-
export { useSEO } from './hooks/useSEO';
|
|
8
|
-
export { useWsStatus, useWsScope, useWsFrame } from './hooks/ws';
|
|
9
|
-
export { createWsClient, defaultWsUrl } from './realtime';
|
|
10
|
-
export { bridgeWsToQuery } from './lib/ws-query-bridge';
|
|
11
1
|
export { AppShell } from './layouts/AppShell';
|
|
12
2
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, } from './components/ui/sidebar';
|
|
13
3
|
export { Separator } from './components/ui/separator';
|
|
@@ -16,9 +6,9 @@ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './comp
|
|
|
16
6
|
export { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './components/ui/sheet';
|
|
17
7
|
export { LoginPage } from './pages/LoginPage';
|
|
18
8
|
export { LandingPage } from './pages/LandingPage';
|
|
19
|
-
export { Button, buttonVariants } from './components/ui/
|
|
20
|
-
export { Input } from './components/ui/
|
|
21
|
-
export {
|
|
9
|
+
export { Button, buttonVariants } from './components/ui/button';
|
|
10
|
+
export { Input } from './components/ui/input';
|
|
11
|
+
export { StatusBadge } from './components/StatusBadge';
|
|
22
12
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, } from './components/ui/dialog';
|
|
23
13
|
export { PageHeader, PageLoading, PageEmpty, PageError } from './components/Page';
|
|
24
14
|
export { ConfirmProvider, useConfirm } from './components/ConfirmDialog';
|
|
@@ -26,14 +16,11 @@ export { NotificationBell } from './components/NotificationBell';
|
|
|
26
16
|
export { WorkspaceSwitcher } from './components/WorkspaceSwitcher';
|
|
27
17
|
export { SecretModal, ImpactConfirmation } from './components/SecretModal';
|
|
28
18
|
export { cn, statusTone, statusLabel, STATUS_TONE_CLASS, STATUS_LABEL, formatDate, formatDateTime, shortID } from './lib/utils';
|
|
29
|
-
export { roleSatisfies } from './lib/perm';
|
|
30
|
-
export { usePasswordReset } from './hooks/usePasswordReset';
|
|
31
19
|
export { ForgotPasswordPage } from './pages/auth/ForgotPasswordPage';
|
|
32
20
|
export { ResetPasswordPage } from './pages/auth/ResetPasswordPage';
|
|
33
21
|
export { VerifyEmailPage } from './pages/auth/VerifyEmailPage';
|
|
34
22
|
export { ErrorBoundary } from './components/ErrorBoundary';
|
|
35
23
|
export { toast, Toaster } from './components/toast';
|
|
36
|
-
export { useZodForm } from './hooks/useZodForm';
|
|
37
24
|
export { FormField } from './components/FormField';
|
|
38
25
|
export { DataTable } from './components/DataTable';
|
|
39
26
|
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, } from './components/ui/field';
|
|
@@ -41,7 +28,7 @@ export { Label } from './components/ui/label';
|
|
|
41
28
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from './components/ui/tabs';
|
|
42
29
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from './components/ui/alert-dialog';
|
|
43
30
|
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, } from './components/ui/avatar';
|
|
44
|
-
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './components/ui/menu';
|
|
31
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './components/ui/dropdown-menu';
|
|
45
32
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './components/ui/select';
|
|
46
33
|
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, } from './components/ui/popover';
|
|
47
34
|
export { Switch } from './components/ui/switch';
|
|
@@ -49,7 +36,7 @@ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValu
|
|
|
49
36
|
export { Checkbox } from './components/ui/checkbox';
|
|
50
37
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
|
|
51
38
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './components/ui/breadcrumb';
|
|
52
|
-
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia,
|
|
39
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, } from './components/ui/empty';
|
|
53
40
|
export { SettingsShell } from './layouts/SettingsShell';
|
|
54
41
|
export { AuthShell } from './layouts/AuthShell';
|
|
55
42
|
export { SettingsCard } from './components/SettingsCard';
|
|
@@ -68,18 +55,11 @@ export { UsagePage } from './pages/workspace/UsagePage';
|
|
|
68
55
|
export { BillingPage } from './pages/workspace/BillingPage';
|
|
69
56
|
export { BillingSuccessPage } from './pages/workspace/BillingSuccessPage';
|
|
70
57
|
export { WebhooksPage } from './pages/workspace/WebhooksPage';
|
|
71
|
-
export { useSessions, useRevokeSession, useRevokeAllSessions } from './hooks/useSessions';
|
|
72
|
-
export { useTokens, useCreateToken, useRevokeToken } from './hooks/useTokens';
|
|
73
|
-
export { useNotificationPrefs, useSetNotificationPref } from './hooks/useNotificationPrefs';
|
|
74
|
-
export { useMembers, useMemberMutations, useMyInvitations, ASSIGNABLE_ROLES } from './hooks/useMembers';
|
|
75
|
-
export { useAudit, exportAuditCsv, auditQueryString, EMPTY_AUDIT_FILTERS } from './hooks/useAudit';
|
|
76
|
-
export { useUsage } from './hooks/useUsage';
|
|
77
58
|
export { apiErrorMessage } from './lib/api-error';
|
|
78
59
|
export { CronInput } from './components/CronInput';
|
|
79
60
|
export { SchedulesPage } from './pages/workspace/SchedulesPage';
|
|
80
61
|
export { SiteBanner } from './components/SiteBanner';
|
|
81
62
|
export { SiteBannerLayer } from './components/SiteBannerLayer';
|
|
82
|
-
export { useSiteConfig, SITE_CONFIG_QUERY_KEY } from './hooks/useSiteConfig';
|
|
83
63
|
export { ImpersonationBanner } from './components/ImpersonationBanner';
|
|
84
64
|
export { AdminShell } from './pages/admin/AdminShell';
|
|
85
65
|
export { OverviewPage } from './pages/admin/OverviewPage';
|
package/dist/layouts/AppShell.js
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useLocation, useNavigate } from 'react-router';
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import { FolderKanban } from 'lucide-react';
|
|
4
5
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, } from '../components/ui/sidebar';
|
|
5
6
|
import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbPage, BreadcrumbSeparator, } from '../components/ui/breadcrumb';
|
|
6
7
|
import { UserMenu } from '../components/UserMenu';
|
|
7
8
|
import { ImpersonationBanner } from '../components/ImpersonationBanner';
|
|
9
|
+
// stock SidebarProvider 只写不读 sidebar_state cookie(写入供 SSR 框架回传 defaultOpen)。
|
|
10
|
+
// CSR 产品在组合层回读,保持跨会话折叠状态(P2-17,自 stock 镜像化后上提至此)。
|
|
11
|
+
function readSidebarCookieOpen() {
|
|
12
|
+
if (typeof document === 'undefined')
|
|
13
|
+
return true; // SSR 安全
|
|
14
|
+
return !document.cookie.split('; ').includes('sidebar_state=false');
|
|
15
|
+
}
|
|
8
16
|
export function AppShell({ children, nav, brand, logo, logoDark, sidebarFooter, headerRight, breadcrumbTail = null, settingsContent }) {
|
|
9
17
|
const location = useLocation();
|
|
10
18
|
const navigate = useNavigate();
|
|
19
|
+
// 输入焦点时不劫持 Ctrl/Cmd+B(P3-1,自 stock 镜像化后上提至此):
|
|
20
|
+
// 捕获阶段拦截可编辑目标上的快捷键,阻断 stock SidebarProvider 的全局监听。
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const guard = (e) => {
|
|
23
|
+
if (!(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== 'b')
|
|
24
|
+
return;
|
|
25
|
+
const t = e.target;
|
|
26
|
+
if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) {
|
|
27
|
+
e.stopImmediatePropagation();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
window.addEventListener('keydown', guard, true);
|
|
31
|
+
return () => window.removeEventListener('keydown', guard, true);
|
|
32
|
+
}, []);
|
|
11
33
|
const items = nav ?? [
|
|
12
34
|
{ path: '/app', label: '概览', icon: _jsx(FolderKanban, { size: 17, "aria-hidden": "true" }) },
|
|
13
35
|
];
|
|
14
36
|
const selected = items.find((item) => location.pathname.startsWith(item.path));
|
|
15
37
|
const isSettingsMode = settingsContent !== undefined &&
|
|
16
38
|
(location.pathname.startsWith('/settings') || location.pathname.startsWith('/account'));
|
|
17
|
-
return (_jsxs(SidebarProvider, { children: [_jsxs(Sidebar, { collapsible: "icon", children: [_jsx(SidebarHeader, { children: _jsxs("div", { className: "flex items-center gap-2 px-2 pb-1 pt-1 group-data-[collapsible=icon]:justify-center", children: [logo && (_jsxs("picture", { children: [_jsx("source", { media: "(prefers-color-scheme: dark)", srcSet: logoDark ?? logo }), _jsx("img", { src: logo, alt: `${brand ?? 'App'} logo`, className: "h-7 w-auto group-data-[collapsible=icon]:w-7 group-data-[collapsible=icon]:object-contain" })] })), _jsx("div", { className: "text-lg font-bold text-foreground group-data-[collapsible=icon]:hidden", children: brand ?? 'App' })] }) }), _jsx(SidebarContent, { children: isSettingsMode ? (settingsContent) : (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: items.map((item) => {
|
|
39
|
+
return (_jsxs(SidebarProvider, { defaultOpen: readSidebarCookieOpen(), children: [_jsxs(Sidebar, { collapsible: "icon", children: [_jsx(SidebarHeader, { children: _jsxs("div", { className: "flex items-center gap-2 px-2 pb-1 pt-1 group-data-[collapsible=icon]:justify-center", children: [logo && (_jsxs("picture", { children: [_jsx("source", { media: "(prefers-color-scheme: dark)", srcSet: logoDark ?? logo }), _jsx("img", { src: logo, alt: `${brand ?? 'App'} logo`, className: "h-7 w-auto group-data-[collapsible=icon]:w-7 group-data-[collapsible=icon]:object-contain" })] })), _jsx("div", { className: "text-lg font-bold text-foreground group-data-[collapsible=icon]:hidden", children: brand ?? 'App' })] }) }), _jsx(SidebarContent, { children: isSettingsMode ? (settingsContent) : (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: items.map((item) => {
|
|
18
40
|
const active = selected?.path === item.path;
|
|
19
41
|
return (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: active, "aria-current": active ? 'page' : undefined, tooltip: item.label, onClick: () => navigate(item.path), children: [item.icon, _jsx("span", { className: "truncate", children: item.label })] }) }, item.path));
|
|
20
42
|
}) }) }) })) }), _jsx(SidebarFooter, { className: "group-data-[collapsible=icon]:hidden", children: sidebarFooter })] }), _jsxs(SidebarInset, { children: [_jsx(ImpersonationBanner, {}), _jsxs("header", { className: "flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-4", children: [_jsx(SidebarTrigger, {}), breadcrumbTail !== null ? (_jsx(Breadcrumb, { children: _jsxs(BreadcrumbList, { children: [selected && (_jsxs(_Fragment, { children: [_jsx(BreadcrumbItem, { children: _jsx(BreadcrumbPage, { children: selected.label }) }), _jsx(BreadcrumbSeparator, {})] })), _jsx(BreadcrumbItem, { children: _jsx(BreadcrumbPage, { children: breadcrumbTail }) })] }) })) : null, _jsx("div", { className: "flex-1" }), headerRight, _jsx(UserMenu, {})] }), _jsx("div", { className: "flex-1 overflow-auto p-6", children: children })] })] }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Link, useLocation, useNavigate } from 'react-router';
|
|
3
3
|
import { cn } from '../lib/utils';
|
|
4
|
-
import { roleSatisfies } from '
|
|
5
|
-
import { useWorkspace } from '
|
|
6
|
-
import { buttonVariants } from '../components/ui/
|
|
4
|
+
import { roleSatisfies } from '@ploykit/hooks';
|
|
5
|
+
import { useWorkspace } from '@ploykit/hooks';
|
|
6
|
+
import { buttonVariants } from '../components/ui/button';
|
|
7
7
|
import { Separator } from '../components/ui/separator';
|
|
8
8
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from '../components/ui/select';
|
|
9
9
|
export function SettingsShell({ nav, children, title = '设置', description }) {
|
package/dist/pages/LoginPage.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { useLocation } from 'react-router';
|
|
4
|
-
import { useLogin } from '
|
|
5
|
-
import { useApi } from '
|
|
6
|
-
import { useAuth } from '
|
|
4
|
+
import { useLogin } from '@ploykit/hooks';
|
|
5
|
+
import { useApi } from '@ploykit/hooks';
|
|
6
|
+
import { useAuth } from '@ploykit/hooks';
|
|
7
7
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/ui/tabs';
|
|
8
|
-
import { Button } from '../components/ui/
|
|
9
|
-
import { Input } from '../components/ui/
|
|
8
|
+
import { Button } from '../components/ui/button';
|
|
9
|
+
import { Input } from '../components/ui/input';
|
|
10
10
|
import { FormField } from '../components/FormField';
|
|
11
11
|
import { apiErrorMessage } from '../lib/api-error';
|
|
12
12
|
const SEND_COOLDOWN_S = 60;
|
|
@@ -3,8 +3,8 @@ import { useId } from 'react';
|
|
|
3
3
|
import { PageHeader, PageLoading, PageError, PageEmpty } from '../../components/Page';
|
|
4
4
|
import { Switch } from '../../components/ui/switch';
|
|
5
5
|
import { toast } from '../../components/toast';
|
|
6
|
-
import { useSEO } from '
|
|
7
|
-
import { useNotificationPrefs, useSetNotificationPref, } from '
|
|
6
|
+
import { useSEO } from '@ploykit/hooks';
|
|
7
|
+
import { useNotificationPrefs, useSetNotificationPref, } from '@ploykit/hooks';
|
|
8
8
|
export function NotificationPreferencesPage({ types, title = '通知偏好', description = '选择每种通知的接收渠道;未显示的类型默认全部开启', siteName, emailChannelNote, }) {
|
|
9
9
|
const { prefs, loading, error, refetch } = useNotificationPrefs();
|
|
10
10
|
const { setPref } = useSetNotificationPref();
|
|
@@ -4,15 +4,15 @@ import { z } from 'zod';
|
|
|
4
4
|
import { PageHeader, PageLoading, PageError } from '../../components/Page';
|
|
5
5
|
import { SettingsCard } from '../../components/SettingsCard';
|
|
6
6
|
import { FormField } from '../../components/FormField';
|
|
7
|
-
import { Button } from '../../components/ui/
|
|
8
|
-
import { Input } from '../../components/ui/
|
|
9
|
-
import { Badge } from '../../components/ui/
|
|
7
|
+
import { Button } from '../../components/ui/button';
|
|
8
|
+
import { Input } from '../../components/ui/input';
|
|
9
|
+
import { Badge } from '../../components/ui/badge';
|
|
10
10
|
import { ImpactConfirmation } from '../../components/SecretModal';
|
|
11
11
|
import { toast } from '../../components/toast';
|
|
12
12
|
import { apiErrorMessage } from '../../lib/api-error';
|
|
13
|
-
import { useApi } from '
|
|
14
|
-
import { useAuth } from '
|
|
15
|
-
import { useZodForm } from '
|
|
13
|
+
import { useApi } from '@ploykit/hooks';
|
|
14
|
+
import { useAuth } from '@ploykit/hooks';
|
|
15
|
+
import { useZodForm } from '@ploykit/hooks';
|
|
16
16
|
const profileSchema = z.object({
|
|
17
17
|
display_name: z.string().trim().min(1, '请输入昵称').max(100, '昵称最多 100 字符'),
|
|
18
18
|
avatar_url: z.string()
|
|
@@ -4,17 +4,17 @@ import { z } from 'zod';
|
|
|
4
4
|
import { PageHeader, PageError } from '../../components/Page';
|
|
5
5
|
import { SettingsCard } from '../../components/SettingsCard';
|
|
6
6
|
import { FormField } from '../../components/FormField';
|
|
7
|
-
import { Button } from '../../components/ui/
|
|
8
|
-
import { Input } from '../../components/ui/
|
|
9
|
-
import { Badge } from '../../components/ui/
|
|
7
|
+
import { Button } from '../../components/ui/button';
|
|
8
|
+
import { Input } from '../../components/ui/input';
|
|
9
|
+
import { Badge } from '../../components/ui/badge';
|
|
10
10
|
import { DataTable } from '../../components/DataTable';
|
|
11
11
|
import { ImpactConfirmation } from '../../components/SecretModal';
|
|
12
12
|
import { useConfirm } from '../../components/ConfirmDialog';
|
|
13
13
|
import { toast } from '../../components/toast';
|
|
14
|
-
import { useApi } from '
|
|
15
|
-
import { useAuth } from '
|
|
16
|
-
import { useZodForm } from '
|
|
17
|
-
import { useSessions, useRevokeSession, useRevokeAllSessions } from '
|
|
14
|
+
import { useApi } from '@ploykit/hooks';
|
|
15
|
+
import { useAuth } from '@ploykit/hooks';
|
|
16
|
+
import { useZodForm } from '@ploykit/hooks';
|
|
17
|
+
import { useSessions, useRevokeSession, useRevokeAllSessions } from '@ploykit/hooks';
|
|
18
18
|
import { passwordSchema } from '../auth/RegisterPage';
|
|
19
19
|
import { apiErrorMessage } from '../../lib/api-error';
|
|
20
20
|
import { formatDateTime, shortID } from '../../lib/utils';
|
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { PageHeader, PageEmpty } from '../../components/Page';
|
|
4
4
|
import { FormField } from '../../components/FormField';
|
|
5
|
-
import { Button } from '../../components/ui/
|
|
6
|
-
import { Input } from '../../components/ui/
|
|
7
|
-
import { Badge } from '../../components/ui/
|
|
5
|
+
import { Button } from '../../components/ui/button';
|
|
6
|
+
import { Input } from '../../components/ui/input';
|
|
7
|
+
import { Badge } from '../../components/ui/badge';
|
|
8
8
|
import { DataTable } from '../../components/DataTable';
|
|
9
9
|
import { SecretModal } from '../../components/SecretModal';
|
|
10
10
|
import { useConfirm } from '../../components/ConfirmDialog';
|
|
11
11
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, } from '../../components/ui/dialog';
|
|
12
12
|
import { toast } from '../../components/toast';
|
|
13
|
-
import { useTokens, useCreateToken, useRevokeToken } from '
|
|
13
|
+
import { useTokens, useCreateToken, useRevokeToken } from '@ploykit/hooks';
|
|
14
14
|
import { apiErrorMessage } from '../../lib/api-error';
|
|
15
15
|
import { formatDateTime } from '../../lib/utils';
|
|
16
16
|
const NAME_MAX_BYTES = 64;
|