@ploykit/ui 0.1.0 → 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/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 +3 -3
- 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 +3 -3
- 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 +67 -63
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { api } from '@ploykit/client';
|
|
4
4
|
import { apiErrorMessage } from '../lib/api-error';
|
|
5
|
-
import { Button } from './ui/
|
|
6
|
-
import { Input } from './ui/
|
|
5
|
+
import { Button } from './ui/button';
|
|
6
|
+
import { Input } from './ui/input';
|
|
7
7
|
export const FALLBACK_TIMEZONES = [
|
|
8
8
|
'UTC',
|
|
9
9
|
'Asia/Shanghai',
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { cn } from '../lib/utils';
|
|
3
3
|
import { PageEmpty } from './Page';
|
|
4
4
|
import { Skeleton } from './ui/skeleton';
|
|
5
|
-
import { Button } from './ui/
|
|
5
|
+
import { Button } from './ui/button';
|
|
6
6
|
export function DataTable({ columns, rows, rowKey, loading = false, empty, pagination }) {
|
|
7
7
|
const stalePage = !!pagination && !loading && rows.length === 0 && (pagination.total > 0 || pagination.page > 1);
|
|
8
8
|
if (!loading && rows.length === 0 && !stalePage) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TriangleAlert } from 'lucide-react';
|
|
3
|
-
import { useAuth } from '
|
|
3
|
+
import { useAuth } from '@ploykit/hooks';
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
5
|
export function ImpersonationBanner({ className }) {
|
|
6
6
|
const { user } = useAuth();
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import { api } from '@ploykit/client';
|
|
5
|
-
import { queryKeys } from '
|
|
5
|
+
import { queryKeys } from '@ploykit/hooks';
|
|
6
6
|
import { cn, formatDateTime } from '../lib/utils';
|
|
7
7
|
export function NotificationBell({ onNavigate }) {
|
|
8
8
|
const [open, setOpen] = useState(false);
|
|
@@ -40,8 +40,8 @@ export function NotificationBell({ onNavigate }) {
|
|
|
40
40
|
document.addEventListener('mousedown', onClickOutside);
|
|
41
41
|
return () => document.removeEventListener('mousedown', onClickOutside);
|
|
42
42
|
}, []);
|
|
43
|
-
return (_jsxs("div", { ref: ref, className: "relative", children: [_jsxs("button", { onClick: () => setOpen(!open), className: "relative p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-md\
|
|
44
|
-
setOpen(false); }, children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b", children: [_jsx("span", { className: "text-sm font-semibold", children: "\u901A\u77E5" }), unread > 0 && (_jsx("button", { onClick: () => markAllReadM.mutate(), disabled: markAllReadM.isPending, className: "text-xs text-blue-600 hover:underline disabled:opacity-50\
|
|
43
|
+
return (_jsxs("div", { ref: ref, className: "relative", children: [_jsxs("button", { onClick: () => setOpen(!open), className: "relative p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-md\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", "aria-label": "\u901A\u77E5", "aria-haspopup": "true", "aria-expanded": open, children: [_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" }) }), unread > 0 && (_jsx("span", { className: "absolute -top-0.5 -right-0.5 flex items-center justify-center min-w-[18px] h-[18px]\n px-1 text-xs font-bold text-white bg-red-500 rounded-full", children: unread > 99 ? '99+' : unread }))] }), open && (_jsxs("div", { className: "absolute right-0 mt-2 w-80 bg-white rounded-lg shadow-lg border z-50", role: "dialog", "aria-label": "\u901A\u77E5\u5217\u8868", onKeyDown: (e) => { if (e.key === 'Escape')
|
|
44
|
+
setOpen(false); }, children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b", children: [_jsx("span", { className: "text-sm font-semibold", children: "\u901A\u77E5" }), unread > 0 && (_jsx("button", { onClick: () => markAllReadM.mutate(), disabled: markAllReadM.isPending, className: "text-xs text-blue-600 hover:underline disabled:opacity-50\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded", children: "\u5168\u90E8\u5DF2\u8BFB" }))] }), _jsx("ul", { className: "max-h-80 overflow-y-auto list-none p-0 m-0", "data-slot": "notification-list", children: listQ.isPending ? (_jsx("li", { className: "py-8 text-center text-sm text-gray-400", "aria-live": "polite", children: "\u52A0\u8F7D\u4E2D\u2026" })) : notifications.length === 0 ? (_jsx("li", { className: "py-8 text-center text-sm text-gray-400", children: "\u6682\u65E0\u901A\u77E5" })) : notifications.map((n) => (_jsx("li", { className: "border-b last:border-0", children: _jsxs("button", { type: "button", onClick: () => { if (n.link)
|
|
45
45
|
onNavigate?.(n.link); markReadM.mutate(n.id); setOpen(false); }, className: cn('w-full text-left px-4 py-3 cursor-pointer hover:bg-gray-50 ' +
|
|
46
46
|
'focus-visible:outline-none focus-visible:bg-gray-50 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring', !n.read_at && 'bg-blue-50/50'), children: [_jsxs("span", { className: "flex items-start justify-between gap-2", children: [_jsx("span", { className: "text-sm font-medium text-gray-900", children: n.title }), n.count > 1 && (_jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-1.5 py-0.5 rounded-full shrink-0", children: ["\u00D7", n.count] }))] }), n.body && _jsx("span", { className: "block mt-0.5 text-xs text-gray-500 line-clamp-2", children: n.body }), _jsx("span", { className: "block mt-1 text-[10px] text-gray-400", children: formatDateTime(n.created_at) })] }) }, n.id))) })] }))] }));
|
|
47
47
|
}
|
|
@@ -3,8 +3,8 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { X } from 'lucide-react';
|
|
4
4
|
import { cn } from '../lib/utils';
|
|
5
5
|
import { Progress, ProgressLabel, ProgressValue } from './ui/progress';
|
|
6
|
-
import { Button } from './ui/
|
|
7
|
-
import { useAuth } from '
|
|
6
|
+
import { Button } from './ui/button';
|
|
7
|
+
import { useAuth } from '@ploykit/hooks';
|
|
8
8
|
const DISMISS_KEY = 'pk_onboarding_dismissed';
|
|
9
9
|
function defaultItems(hasWorkspaces) {
|
|
10
10
|
return [
|
|
@@ -37,7 +37,7 @@ export function OnboardingChecklist({ items, storageKey = DISMISS_KEY, title = '
|
|
|
37
37
|
}
|
|
38
38
|
setDismissed(true);
|
|
39
39
|
};
|
|
40
|
-
return (_jsxs("section", { className: "w-full rounded-xl border bg-card p-4 shadow-xs", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold", children: title }), _jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: allDone ? '全部完成,开始你的旅程吧!' : `已完成 ${doneCount}/${list.length} 项` })] }), _jsx(Button, { variant: "ghost", size: "
|
|
40
|
+
return (_jsxs("section", { className: "w-full rounded-xl border bg-card p-4 shadow-xs", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold", children: title }), _jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: allDone ? '全部完成,开始你的旅程吧!' : `已完成 ${doneCount}/${list.length} 项` })] }), _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "\u5173\u95ED\u5F15\u5BFC\u6E05\u5355", onClick: dismiss, children: _jsx(X, {}) })] }), _jsxs(Progress, { value: pct, className: "mt-3", children: [_jsx(ProgressLabel, { children: allDone ? '完成' : '进度' }), _jsx(ProgressValue, {})] }), _jsx("ul", { className: "mt-4 space-y-2", children: list.map((item) => (_jsx("li", { children: _jsxs("button", { type: "button", onClick: item.done ? undefined : item.onClick, disabled: item.done, className: cn('flex w-full items-center gap-3 rounded-lg border px-3 py-2 text-left text-sm transition-colors', item.done
|
|
41
41
|
? 'border-transparent bg-muted/50 text-muted-foreground'
|
|
42
42
|
: 'border-border hover:bg-accent hover:text-accent-foreground', !item.done && !item.onClick && 'cursor-default'), children: [_jsx("span", { "aria-hidden": "true", className: cn('flex size-5 shrink-0 items-center justify-center rounded-full border text-xs', item.done ? 'border-primary bg-primary text-primary-foreground' : 'border-input'), children: item.done ? '✓' : '' }), _jsx("span", { className: cn(item.done && 'line-through'), children: item.label })] }) }, item.key))) })] }));
|
|
43
43
|
}
|
package/dist/components/Page.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Inbox, TriangleAlert } from 'lucide-react';
|
|
3
|
-
import { Button } from './ui/
|
|
3
|
+
import { Button } from './ui/button';
|
|
4
4
|
import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent, } from './ui/empty';
|
|
5
5
|
export function PageHeader({ title, description, actions }) {
|
|
6
6
|
return (_jsxs("div", { className: "mb-6 flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "text-2xl font-bold text-foreground", children: title }), description && _jsx("p", { className: "mt-1 max-w-2xl text-sm text-muted-foreground", children: description })] }), actions && _jsx("div", { className: "flex shrink-0 gap-2", children: actions })] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, } from './ui/dialog';
|
|
4
|
-
import { Button } from './ui/
|
|
4
|
+
import { Button } from './ui/button';
|
|
5
5
|
export function SecretModal({ open, onOpenChange, secretName, secretValue, title }) {
|
|
6
6
|
const [copied, setCopied] = useState(false);
|
|
7
7
|
const [copyFailed, setCopyFailed] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../lib/utils';
|
|
3
|
-
import { Card, CardHeader,
|
|
3
|
+
import { Card, CardHeader, CardDescription, CardAction, CardContent, } from './ui/card';
|
|
4
4
|
export function SettingsCard({ title, description, cta, danger, bodyClassName, children, }) {
|
|
5
|
-
return (_jsxs(Card, { className: "my-4 w-full max-w-4xl text-left", size: "sm", children: [_jsxs(CardHeader, { children: [_jsx(
|
|
5
|
+
return (_jsxs(Card, { className: "my-4 w-full max-w-4xl text-left", size: "sm", children: [_jsxs(CardHeader, { children: [_jsx("h2", { "data-slot": "card-title", className: cn('flex items-center gap-2 font-semibold leading-none tracking-tight', danger && 'text-destructive'), children: title }), description && (_jsx(CardDescription, { className: cn(danger && 'text-destructive/80'), children: description })), cta && _jsx(CardAction, { children: cta })] }), _jsx(CardContent, { className: cn('text-left', bodyClassName), children: children })] }));
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SiteBanner } from './SiteBanner';
|
|
3
|
-
import { useSiteConfig } from '
|
|
3
|
+
import { useSiteConfig } from '@ploykit/hooks';
|
|
4
4
|
export function SiteBannerLayer({ maintenanceText, } = {}) {
|
|
5
5
|
const { data } = useSiteConfig();
|
|
6
6
|
if (!data)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, statusLabel, statusTone, STATUS_TONE_CLASS } from '../lib/utils';
|
|
3
|
+
// 业务语义件(shadcn 无对应物,按"有则用 stock、无则留业务层"规则留守):
|
|
4
|
+
// 按订阅/订单/投递等业务状态映射色调与文案的徽章,从 stock 镜像 badge.tsx 迁出。
|
|
5
|
+
export function StatusBadge({ status, className }) {
|
|
6
|
+
return (_jsx("span", { className: cn('inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium whitespace-nowrap', STATUS_TONE_CLASS[statusTone(status)], className), children: statusLabel(status) }));
|
|
7
|
+
}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useNavigate } from 'react-router';
|
|
3
3
|
import { LogOut, Settings, ShieldCheck } from 'lucide-react';
|
|
4
4
|
import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/menu';
|
|
6
|
-
import { useAuth } from '
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/dropdown-menu';
|
|
6
|
+
import { useAuth } from '@ploykit/hooks';
|
|
7
7
|
import { toast } from './toast';
|
|
8
8
|
function initialsOf(name, email) {
|
|
9
9
|
const src = name.trim() || email.trim();
|
|
@@ -26,5 +26,5 @@ export function UserMenu({ items = [], logoutRedirect = '/login' }) {
|
|
|
26
26
|
}
|
|
27
27
|
navigate(logoutRedirect);
|
|
28
28
|
};
|
|
29
|
-
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground\
|
|
29
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground\n transition-colors hover:bg-accent hover:text-accent-foreground\n aria-expanded:bg-accent", "aria-label": "\u7528\u6237\u83DC\u5355", children: [_jsxs(Avatar, { size: "sm", children: [user?.avatar_url ? _jsx(AvatarImage, { src: user.avatar_url, alt: name }) : null, _jsx(AvatarFallback, { children: initialsOf(user?.display_name ?? '', email) })] }), _jsx("span", { className: "hidden max-w-40 truncate md:inline", children: name || '未登录' })] }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [_jsx(DropdownMenuGroup, { children: _jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: _jsxs("div", { className: "flex flex-col px-2 py-1.5", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: name || '未登录' }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: email })] }) }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onClick: () => navigate('/account/profile'), children: [_jsx(Settings, {}), " \u8D26\u6237\u8BBE\u7F6E"] }), user?.is_platform_admin && (_jsxs(DropdownMenuItem, { onClick: () => navigate('/admin'), children: [_jsx(ShieldCheck, {}), " \u7BA1\u7406\u63A7\u5236\u53F0"] })), items.length > 0 && _jsx(DropdownMenuSeparator, {}), items.map((item) => (_jsxs(DropdownMenuItem, { variant: item.destructive ? 'destructive' : 'default', onClick: () => (item.to ? navigate(item.to) : item.onClick?.()), children: [item.icon, item.label] }, item.label))), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { variant: "destructive", onClick: handleLogout, children: [_jsx(LogOut, {}), " \u9000\u51FA\u767B\u5F55"] })] })] }));
|
|
30
30
|
}
|
|
@@ -5,12 +5,12 @@ import { Check, ChevronsUpDown, Plus } from 'lucide-react';
|
|
|
5
5
|
import { isApiError } from '@ploykit/client';
|
|
6
6
|
import { cn } from '../lib/utils';
|
|
7
7
|
import { apiErrorMessage } from '../lib/api-error';
|
|
8
|
-
import { useWorkspaceSwitch } from '
|
|
8
|
+
import { useWorkspaceSwitch } from '@ploykit/hooks';
|
|
9
9
|
import { toast } from './toast';
|
|
10
|
-
import { Button } from './ui/
|
|
11
|
-
import { Input } from './ui/
|
|
10
|
+
import { Button } from './ui/button';
|
|
11
|
+
import { Input } from './ui/input';
|
|
12
12
|
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from './ui/sidebar';
|
|
13
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/menu';
|
|
13
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/dropdown-menu';
|
|
14
14
|
const slugSuffix = (n = 4) => {
|
|
15
15
|
const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
16
16
|
let out = '';
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type VariantProps } from
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
|
|
9
|
-
export declare function StatusBadge({ status, className }: {
|
|
10
|
-
status: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
}): React.JSX.Element;
|
|
6
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
13
7
|
export { Badge, badgeVariants };
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
5
6
|
variants: {
|
|
6
7
|
variant: {
|
|
7
|
-
default:
|
|
8
|
-
secondary:
|
|
9
|
-
destructive:
|
|
10
|
-
outline:
|
|
8
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
9
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
10
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
11
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
11
14
|
},
|
|
12
15
|
},
|
|
13
|
-
defaultVariants: {
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
14
19
|
});
|
|
15
|
-
function Badge({ className, variant, ...props }) {
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
function Badge({ className, variant = "default", render, ...props }) {
|
|
21
|
+
return useRender({
|
|
22
|
+
defaultTagName: "span",
|
|
23
|
+
props: mergeProps({
|
|
24
|
+
className: cn(badgeVariants({ variant }), className),
|
|
25
|
+
}, props),
|
|
26
|
+
render,
|
|
27
|
+
state: {
|
|
28
|
+
slot: "badge",
|
|
29
|
+
variant,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
20
32
|
}
|
|
21
33
|
export { Badge, badgeVariants };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type VariantProps } from
|
|
1
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
5
|
-
size?: "default" | "sm" | "lg" | "icon" | "
|
|
4
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
declare function Button({ className, variant, size, ref, ...props }: ButtonProps): React.JSX.Element;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
10
8
|
export { Button, buttonVariants };
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'disabled:pointer-events-none disabled:opacity-50 ' +
|
|
7
|
-
'[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
2
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
6
|
variants: {
|
|
9
7
|
variant: {
|
|
10
|
-
default:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
link:
|
|
8
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
9
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
10
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
11
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
12
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
16
14
|
},
|
|
17
15
|
size: {
|
|
18
|
-
default:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
17
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
18
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
19
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
20
|
+
icon: "size-8",
|
|
21
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
22
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
23
|
+
"icon-lg": "size-9",
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
defaultVariants: {
|
|
26
|
-
variant:
|
|
27
|
-
size:
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default",
|
|
28
29
|
},
|
|
29
30
|
});
|
|
30
|
-
function Button({ className, variant, size
|
|
31
|
-
return (_jsx(
|
|
31
|
+
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
32
|
+
return (_jsx(ButtonPrimitive, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
32
33
|
}
|
|
33
34
|
export { Button, buttonVariants };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare function Input({ className, type,
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
3
3
|
export { Input };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'placeholder:text-muted-foreground ' +
|
|
7
|
-
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ' +
|
|
8
|
-
'disabled:cursor-not-allowed disabled:opacity-50', className), ref: ref, ...props }));
|
|
2
|
+
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
function Input({ className, type, ...props }) {
|
|
5
|
+
return (_jsx(InputPrimitive, { type: type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
9
6
|
}
|
|
10
7
|
export { Input };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
3
|
-
import { Button } from "./
|
|
3
|
+
import { Button } from "./button";
|
|
4
4
|
declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React.JSX.Element;
|
|
5
5
|
declare function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
6
|
declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): React.JSX.Element;
|
|
@@ -13,6 +13,6 @@ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps
|
|
|
13
13
|
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
14
|
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
15
15
|
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
16
|
-
declare function AlertDialogAction({ className,
|
|
16
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
17
17
|
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
18
18
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
3
4
|
import { cn } from "../../lib/utils";
|
|
4
|
-
import { Button } from "./
|
|
5
|
+
import { Button } from "./button";
|
|
5
6
|
function AlertDialog({ ...props }) {
|
|
6
7
|
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
7
8
|
}
|
|
@@ -15,25 +16,25 @@ function AlertDialogOverlay({ className, ...props }) {
|
|
|
15
16
|
return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
16
17
|
}
|
|
17
18
|
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
18
|
-
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-
|
|
19
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-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 })] }));
|
|
19
20
|
}
|
|
20
21
|
function AlertDialogHeader({ className, ...props }) {
|
|
21
|
-
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-
|
|
22
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className), ...props }));
|
|
22
23
|
}
|
|
23
24
|
function AlertDialogFooter({ className, ...props }) {
|
|
24
|
-
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
25
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
25
26
|
}
|
|
26
27
|
function AlertDialogMedia({ className, ...props }) {
|
|
27
|
-
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-
|
|
28
|
+
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className), ...props }));
|
|
28
29
|
}
|
|
29
30
|
function AlertDialogTitle({ className, ...props }) {
|
|
30
|
-
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("
|
|
31
|
+
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className), ...props }));
|
|
31
32
|
}
|
|
32
33
|
function AlertDialogDescription({ className, ...props }) {
|
|
33
|
-
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-
|
|
34
|
+
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
34
35
|
}
|
|
35
|
-
function AlertDialogAction({ className,
|
|
36
|
-
return (_jsx(
|
|
36
|
+
function AlertDialogAction({ className, ...props }) {
|
|
37
|
+
return (_jsx(Button, { "data-slot": "alert-dialog-action", className: cn(className), ...props }));
|
|
37
38
|
}
|
|
38
39
|
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
39
40
|
return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-cancel", className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
3
4
|
import { cn } from "../../lib/utils";
|
|
4
5
|
function Avatar({ className, size = "default", ...props }) {
|
|
5
|
-
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 select-none
|
|
6
|
+
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className), ...props }));
|
|
6
7
|
}
|
|
7
8
|
function AvatarImage({ className, ...props }) {
|
|
8
9
|
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full rounded-full object-cover", className), ...props }));
|
|
@@ -11,7 +12,7 @@ function AvatarFallback({ className, ...props }) {
|
|
|
11
12
|
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
|
|
12
13
|
}
|
|
13
14
|
function AvatarBadge({ className, ...props }) {
|
|
14
|
-
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary bg-blend-color
|
|
15
|
+
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
|
|
15
16
|
}
|
|
16
17
|
function AvatarGroup({ className, ...props }) {
|
|
17
18
|
return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
5
4
|
import { cn } from "../../lib/utils";
|
|
5
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
6
6
|
function Breadcrumb({ className, ...props }) {
|
|
7
|
-
return (_jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(
|
|
7
|
+
return (_jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props }));
|
|
8
8
|
}
|
|
9
9
|
function BreadcrumbList({ className, ...props }) {
|
|
10
|
-
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex
|
|
10
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground", className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function BreadcrumbItem({ className, ...props }) {
|
|
13
|
-
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex
|
|
13
|
+
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1", className), ...props }));
|
|
14
14
|
}
|
|
15
15
|
function BreadcrumbLink({ className, render, ...props }) {
|
|
16
16
|
return useRender({
|
|
@@ -25,12 +25,12 @@ function BreadcrumbLink({ className, render, ...props }) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function BreadcrumbPage({ className, ...props }) {
|
|
28
|
-
return (_jsx("span", { "data-slot": "breadcrumb-page", "aria-current": "page", className: cn("
|
|
28
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className), ...props }));
|
|
29
29
|
}
|
|
30
30
|
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
31
|
-
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("
|
|
31
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children ?? (_jsx(ChevronRightIcon, {})) }));
|
|
32
32
|
}
|
|
33
33
|
function BreadcrumbEllipsis({ className, ...props }) {
|
|
34
|
-
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className), ...props, children: [_jsx(
|
|
34
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className), ...props, children: [_jsx(MoreHorizontalIcon, {}), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
35
35
|
}
|
|
36
36
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -3,11 +3,9 @@ declare function Card({ className, size, ...props }: React.ComponentProps<"div">
|
|
|
3
3
|
size?: "default" | "sm";
|
|
4
4
|
}): React.JSX.Element;
|
|
5
5
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
-
declare function CardTitle({
|
|
7
|
-
as?: "div" | "h2" | "h3";
|
|
8
|
-
}): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
7
|
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
8
|
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
9
|
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
10
|
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../lib/utils";
|
|
3
3
|
function Card({ className, size = "default", ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col gap-
|
|
4
|
+
return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className), ...props }));
|
|
5
5
|
}
|
|
6
6
|
function CardHeader({ className, ...props }) {
|
|
7
|
-
return (_jsx("div", { "data-slot": "card-header", className: cn("grid auto-rows-min items-start gap-1 rounded-t-xl px-
|
|
7
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className), ...props }));
|
|
8
8
|
}
|
|
9
|
-
function CardTitle({
|
|
10
|
-
return (_jsx(
|
|
9
|
+
function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function CardDescription({ className, ...props }) {
|
|
13
13
|
return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
@@ -16,9 +16,9 @@ function CardAction({ className, ...props }) {
|
|
|
16
16
|
return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
|
|
17
17
|
}
|
|
18
18
|
function CardContent({ className, ...props }) {
|
|
19
|
-
return (_jsx("div", { "data-slot": "card-content", className: cn("px-
|
|
19
|
+
return (_jsx("div", { "data-slot": "card-content", className: cn("px-(--card-spacing)", className), ...props }));
|
|
20
20
|
}
|
|
21
21
|
function CardFooter({ className, ...props }) {
|
|
22
|
-
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-xl
|
|
22
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", className), ...props }));
|
|
23
23
|
}
|
|
24
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
24
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
3
|
-
import { CheckIcon } from "lucide-react";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
5
6
|
function Checkbox({ className, ...props }) {
|
|
6
|
-
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input
|
|
7
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 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 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
|
|
7
8
|
}
|
|
8
9
|
export { Checkbox };
|