@ploykit/ui 0.0.0-stage → 0.1.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.
Files changed (196) hide show
  1. package/README.md +41 -3
  2. package/dist/components/ConfirmDialog.d.ts +13 -0
  3. package/dist/components/ConfirmDialog.js +29 -0
  4. package/dist/components/CronInput.d.ts +15 -0
  5. package/dist/components/CronInput.js +112 -0
  6. package/dist/components/DataTable.d.ts +22 -0
  7. package/dist/components/DataTable.js +13 -0
  8. package/dist/components/ErrorBoundary.d.ts +16 -0
  9. package/dist/components/ErrorBoundary.js +24 -0
  10. package/dist/components/FormField.d.ts +10 -0
  11. package/dist/components/FormField.js +22 -0
  12. package/dist/components/ImpersonationBanner.d.ts +3 -0
  13. package/dist/components/ImpersonationBanner.js +10 -0
  14. package/dist/components/NotificationBell.d.ts +3 -0
  15. package/dist/components/NotificationBell.js +47 -0
  16. package/dist/components/OnboardingChecklist.d.ts +12 -0
  17. package/dist/components/OnboardingChecklist.js +43 -0
  18. package/dist/components/Page.d.ts +17 -0
  19. package/dist/components/Page.js +16 -0
  20. package/dist/components/SecretModal.d.ts +16 -0
  21. package/dist/components/SecretModal.js +45 -0
  22. package/dist/components/SettingsCard.d.ts +10 -0
  23. package/dist/components/SettingsCard.js +6 -0
  24. package/dist/components/SiteBanner.d.ts +6 -0
  25. package/dist/components/SiteBanner.js +11 -0
  26. package/dist/components/SiteBannerLayer.d.ts +4 -0
  27. package/dist/components/SiteBannerLayer.js +9 -0
  28. package/dist/components/UserMenu.d.ts +13 -0
  29. package/dist/components/UserMenu.js +30 -0
  30. package/dist/components/WorkspaceSwitcher.d.ts +1 -0
  31. package/dist/components/WorkspaceSwitcher.js +53 -0
  32. package/dist/components/toast.d.ts +7 -0
  33. package/dist/components/toast.js +11 -0
  34. package/dist/components/ui/Badge.d.ts +13 -0
  35. package/dist/components/ui/Badge.js +21 -0
  36. package/dist/components/ui/Button.d.ts +10 -0
  37. package/dist/components/ui/Button.js +33 -0
  38. package/dist/components/ui/Input.d.ts +3 -0
  39. package/dist/components/ui/Input.js +10 -0
  40. package/dist/components/ui/alert-dialog.d.ts +18 -0
  41. package/dist/components/ui/alert-dialog.js +41 -0
  42. package/dist/components/ui/avatar.d.ts +11 -0
  43. package/dist/components/ui/avatar.js +22 -0
  44. package/dist/components/ui/breadcrumb.d.ts +10 -0
  45. package/dist/components/ui/breadcrumb.js +36 -0
  46. package/dist/components/ui/card.d.ts +13 -0
  47. package/dist/components/ui/card.js +24 -0
  48. package/dist/components/ui/checkbox.d.ts +3 -0
  49. package/dist/components/ui/checkbox.js +8 -0
  50. package/dist/components/ui/dialog.d.ts +15 -0
  51. package/dist/components/ui/dialog.js +26 -0
  52. package/dist/components/ui/empty.d.ts +13 -0
  53. package/dist/components/ui/empty.js +36 -0
  54. package/dist/components/ui/field.d.ts +24 -0
  55. package/dist/components/ui/field.js +67 -0
  56. package/dist/components/ui/label.d.ts +3 -0
  57. package/dist/components/ui/label.js +6 -0
  58. package/dist/components/ui/menu.d.ts +29 -0
  59. package/dist/components/ui/menu.js +50 -0
  60. package/dist/components/ui/popover.d.ts +9 -0
  61. package/dist/components/ui/popover.js +22 -0
  62. package/dist/components/ui/progress.d.ts +7 -0
  63. package/dist/components/ui/progress.js +19 -0
  64. package/dist/components/ui/select.d.ts +15 -0
  65. package/dist/components/ui/select.js +33 -0
  66. package/dist/components/ui/separator.d.ts +3 -0
  67. package/dist/components/ui/separator.js +7 -0
  68. package/dist/components/ui/sheet.d.ts +14 -0
  69. package/dist/components/ui/sheet.js +36 -0
  70. package/dist/components/ui/sidebar.d.ts +63 -0
  71. package/dist/components/ui/sidebar.js +265 -0
  72. package/dist/components/ui/skeleton.d.ts +3 -0
  73. package/dist/components/ui/skeleton.js +6 -0
  74. package/dist/components/ui/switch.d.ts +5 -0
  75. package/dist/components/ui/switch.js +7 -0
  76. package/dist/components/ui/tabs.d.ts +10 -0
  77. package/dist/components/ui/tabs.js +28 -0
  78. package/dist/components/ui/tooltip.d.ts +6 -0
  79. package/dist/components/ui/tooltip.js +16 -0
  80. package/dist/hooks/use-mobile.d.ts +1 -0
  81. package/dist/hooks/use-mobile.js +15 -0
  82. package/dist/hooks/useApi.d.ts +10 -0
  83. package/dist/hooks/useApi.js +11 -0
  84. package/dist/hooks/useAudit.d.ts +39 -0
  85. package/dist/hooks/useAudit.js +55 -0
  86. package/dist/hooks/useAuth.d.ts +1 -0
  87. package/dist/hooks/useAuth.js +4 -0
  88. package/dist/hooks/useBilling.d.ts +44 -0
  89. package/dist/hooks/useBilling.js +64 -0
  90. package/dist/hooks/useLogin.d.ts +10 -0
  91. package/dist/hooks/useLogin.js +39 -0
  92. package/dist/hooks/useMembers.d.ts +125 -0
  93. package/dist/hooks/useMembers.js +127 -0
  94. package/dist/hooks/useNotificationPrefs.d.ts +20 -0
  95. package/dist/hooks/useNotificationPrefs.js +42 -0
  96. package/dist/hooks/usePasswordReset.d.ts +5 -0
  97. package/dist/hooks/usePasswordReset.js +12 -0
  98. package/dist/hooks/useSEO.d.ts +6 -0
  99. package/dist/hooks/useSEO.js +14 -0
  100. package/dist/hooks/useSessions.d.ts +20 -0
  101. package/dist/hooks/useSessions.js +38 -0
  102. package/dist/hooks/useSiteConfig.d.ts +12 -0
  103. package/dist/hooks/useSiteConfig.js +11 -0
  104. package/dist/hooks/useTokens.d.ts +36 -0
  105. package/dist/hooks/useTokens.js +35 -0
  106. package/dist/hooks/useUsage.d.ts +20 -0
  107. package/dist/hooks/useUsage.js +21 -0
  108. package/dist/hooks/useWorkspace.d.ts +26 -0
  109. package/dist/hooks/useWorkspace.js +32 -0
  110. package/dist/hooks/useZodForm.d.ts +6 -0
  111. package/dist/hooks/useZodForm.js +6 -0
  112. package/dist/hooks/ws.d.ts +4 -0
  113. package/dist/hooks/ws.js +21 -0
  114. package/dist/index.d.ts +124 -0
  115. package/dist/index.js +94 -0
  116. package/dist/layouts/AppShell.d.ts +20 -0
  117. package/dist/layouts/AppShell.js +21 -0
  118. package/dist/layouts/AuthShell.d.ts +7 -0
  119. package/dist/layouts/AuthShell.js +4 -0
  120. package/dist/layouts/SettingsShell.d.ts +19 -0
  121. package/dist/layouts/SettingsShell.js +21 -0
  122. package/dist/lib/api-error.d.ts +1 -0
  123. package/dist/lib/api-error.js +74 -0
  124. package/dist/lib/perm.d.ts +2 -0
  125. package/dist/lib/perm.js +7 -0
  126. package/dist/lib/utils.d.ts +12 -0
  127. package/dist/lib/utils.js +84 -0
  128. package/dist/lib/ws-query-bridge.d.ts +7 -0
  129. package/dist/lib/ws-query-bridge.js +35 -0
  130. package/dist/pages/LandingPage.d.ts +22 -0
  131. package/dist/pages/LandingPage.js +5 -0
  132. package/dist/pages/LoginPage.d.ts +15 -0
  133. package/dist/pages/LoginPage.js +87 -0
  134. package/dist/pages/account/NotificationPreferencesPage.d.ts +13 -0
  135. package/dist/pages/account/NotificationPreferencesPage.js +41 -0
  136. package/dist/pages/account/ProfileSettingsPage.d.ts +4 -0
  137. package/dist/pages/account/ProfileSettingsPage.js +96 -0
  138. package/dist/pages/account/SecuritySettingsPage.d.ts +1 -0
  139. package/dist/pages/account/SecuritySettingsPage.js +134 -0
  140. package/dist/pages/account/TokensPage.d.ts +1 -0
  141. package/dist/pages/account/TokensPage.js +117 -0
  142. package/dist/pages/admin/AdminSettingsPage.d.ts +1 -0
  143. package/dist/pages/admin/AdminSettingsPage.js +210 -0
  144. package/dist/pages/admin/AdminShell.d.ts +7 -0
  145. package/dist/pages/admin/AdminShell.js +79 -0
  146. package/dist/pages/admin/AuditPage.d.ts +1 -0
  147. package/dist/pages/admin/AuditPage.js +164 -0
  148. package/dist/pages/admin/OrdersPage.d.ts +1 -0
  149. package/dist/pages/admin/OrdersPage.js +236 -0
  150. package/dist/pages/admin/OverviewPage.d.ts +1 -0
  151. package/dist/pages/admin/OverviewPage.js +200 -0
  152. package/dist/pages/admin/SSOPage.d.ts +1 -0
  153. package/dist/pages/admin/SSOPage.js +53 -0
  154. package/dist/pages/admin/UserDetailPage.d.ts +1 -0
  155. package/dist/pages/admin/UserDetailPage.js +266 -0
  156. package/dist/pages/admin/UsersPage.d.ts +4 -0
  157. package/dist/pages/admin/UsersPage.js +201 -0
  158. package/dist/pages/admin/WebhookDeliveriesPage.d.ts +1 -0
  159. package/dist/pages/admin/WebhookDeliveriesPage.js +128 -0
  160. package/dist/pages/admin/WorkspaceDetailPage.d.ts +1 -0
  161. package/dist/pages/admin/WorkspaceDetailPage.js +202 -0
  162. package/dist/pages/admin/WorkspacesPage.d.ts +1 -0
  163. package/dist/pages/admin/WorkspacesPage.js +133 -0
  164. package/dist/pages/admin/shared.d.ts +8 -0
  165. package/dist/pages/admin/shared.js +23 -0
  166. package/dist/pages/auth/ForgotPasswordPage.d.ts +6 -0
  167. package/dist/pages/auth/ForgotPasswordPage.js +32 -0
  168. package/dist/pages/auth/InviteAcceptPage.d.ts +5 -0
  169. package/dist/pages/auth/InviteAcceptPage.js +40 -0
  170. package/dist/pages/auth/RegisterPage.d.ts +15 -0
  171. package/dist/pages/auth/RegisterPage.js +80 -0
  172. package/dist/pages/auth/ResetPasswordPage.d.ts +4 -0
  173. package/dist/pages/auth/ResetPasswordPage.js +71 -0
  174. package/dist/pages/auth/VerifyEmailPage.d.ts +1 -0
  175. package/dist/pages/auth/VerifyEmailPage.js +45 -0
  176. package/dist/pages/workspace/BillingPage.d.ts +4 -0
  177. package/dist/pages/workspace/BillingPage.js +183 -0
  178. package/dist/pages/workspace/BillingSuccessPage.d.ts +4 -0
  179. package/dist/pages/workspace/BillingSuccessPage.js +72 -0
  180. package/dist/pages/workspace/MembersPage.d.ts +3 -0
  181. package/dist/pages/workspace/MembersPage.js +262 -0
  182. package/dist/pages/workspace/SchedulesPage.d.ts +4 -0
  183. package/dist/pages/workspace/SchedulesPage.js +177 -0
  184. package/dist/pages/workspace/UsagePage.d.ts +15 -0
  185. package/dist/pages/workspace/UsagePage.js +74 -0
  186. package/dist/pages/workspace/WebhooksPage.d.ts +3 -0
  187. package/dist/pages/workspace/WebhooksPage.js +242 -0
  188. package/dist/pages/workspace/WorkspaceAuditPage.d.ts +3 -0
  189. package/dist/pages/workspace/WorkspaceAuditPage.js +109 -0
  190. package/dist/pages/workspace/WorkspaceGeneralPage.d.ts +4 -0
  191. package/dist/pages/workspace/WorkspaceGeneralPage.js +101 -0
  192. package/dist/provider/PloykitProvider.d.ts +50 -0
  193. package/dist/provider/PloykitProvider.js +240 -0
  194. package/dist/realtime.d.ts +3 -0
  195. package/dist/realtime.js +11 -0
  196. package/package.json +63 -6
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SiteBanner } from './SiteBanner';
3
+ import { useSiteConfig } from '../hooks/useSiteConfig';
4
+ export function SiteBannerLayer({ maintenanceText, } = {}) {
5
+ const { data } = useSiteConfig();
6
+ if (!data)
7
+ return null;
8
+ return (_jsxs(_Fragment, { children: [data.maintenance_mode === '1' && (_jsx(SiteBanner, { text: maintenanceText ?? '维护中:系统维护中,功能可能出现短暂不可用', kind: "warn" })), _jsx(SiteBanner, { text: data.banner_text, kind: data.banner_kind === 'warn' ? 'warn' : 'info' })] }));
9
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface UserMenuExtraItem {
3
+ label: string;
4
+ onClick?: () => void;
5
+ to?: string;
6
+ icon?: ReactNode;
7
+ destructive?: boolean;
8
+ }
9
+ export interface UserMenuProps {
10
+ items?: UserMenuExtraItem[];
11
+ logoutRedirect?: string;
12
+ }
13
+ export declare function UserMenu({ items, logoutRedirect }: UserMenuProps): import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useNavigate } from 'react-router';
3
+ import { LogOut, Settings, ShieldCheck } from 'lucide-react';
4
+ import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/menu';
6
+ import { useAuth } from '../hooks/useAuth';
7
+ import { toast } from './toast';
8
+ function initialsOf(name, email) {
9
+ const src = name.trim() || email.trim();
10
+ if (!src)
11
+ return '?';
12
+ const parts = src.split(/[\s@._-]+/).filter(Boolean);
13
+ return parts.slice(0, 2).map((p) => p[0]?.toUpperCase() ?? '').join('') || src.slice(0, 2).toUpperCase();
14
+ }
15
+ export function UserMenu({ items = [], logoutRedirect = '/login' }) {
16
+ const { user, logout } = useAuth();
17
+ const navigate = useNavigate();
18
+ const name = user?.display_name || user?.email || '';
19
+ const email = user?.email ?? '';
20
+ const handleLogout = async () => {
21
+ try {
22
+ await logout();
23
+ }
24
+ catch {
25
+ toast.error('退出登录失败,请稍后在登录页重试');
26
+ }
27
+ navigate(logoutRedirect);
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\r\n transition-colors hover:bg-accent hover:text-accent-foreground\r\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
+ }
@@ -0,0 +1 @@
1
+ export declare function WorkspaceSwitcher(): import("react").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Link } from 'react-router';
4
+ import { Check, ChevronsUpDown, Plus } from 'lucide-react';
5
+ import { isApiError } from '@ploykit/client';
6
+ import { cn } from '../lib/utils';
7
+ import { apiErrorMessage } from '../lib/api-error';
8
+ import { useWorkspaceSwitch } from '../hooks/useWorkspace';
9
+ import { toast } from './toast';
10
+ import { Button } from './ui/Button';
11
+ import { Input } from './ui/Input';
12
+ import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from './ui/sidebar';
13
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './ui/menu';
14
+ const slugSuffix = (n = 4) => {
15
+ const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
16
+ let out = '';
17
+ for (let i = 0; i < n; i++)
18
+ out += alphabet[Math.floor(Math.random() * alphabet.length)];
19
+ return out;
20
+ };
21
+ const slugify = (s) => {
22
+ let slug = s
23
+ .toLowerCase()
24
+ .replace(/[^a-z0-9-]/g, '-')
25
+ .replace(/-+/g, '-')
26
+ .replace(/^-+|-+$/g, '');
27
+ if (slug.length > 40)
28
+ slug = slug.slice(0, 40).replace(/-+$/g, '');
29
+ if (slug.length < 4)
30
+ slug = `${slug || 'ws'}-${slugSuffix()}`;
31
+ return slug;
32
+ };
33
+ export function WorkspaceSwitcher() {
34
+ const { current, list, switchTo, create, creating, error } = useWorkspaceSwitch();
35
+ const [showCreate, setShowCreate] = useState(false);
36
+ const [name, setName] = useState('');
37
+ const createError = error === null ? null : apiErrorMessage(error, '创建工作区失败,请稍后重试');
38
+ const quotaExceeded = isApiError(error, 'E_QUOTA_EXCEEDED') || (isApiError(error) && error.status === 402);
39
+ const handleCreate = async () => {
40
+ if (!name.trim())
41
+ return;
42
+ const ws = await create(name.trim(), slugify(name.trim()));
43
+ if (ws) {
44
+ toast.success(`工作区「${ws.name}」已创建`);
45
+ setName('');
46
+ setShowCreate(false);
47
+ }
48
+ };
49
+ return (_jsxs("div", { className: "relative", children: [_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { render: _jsx(SidebarMenuButton, { size: "lg", className: "data-open:bg-sidebar-accent data-open:text-sidebar-accent-foreground" }), "aria-label": "\u5207\u6362\u5DE5\u4F5C\u533A", children: [_jsx("span", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sm font-bold text-sidebar-primary-foreground", children: current?.name?.[0]?.toUpperCase() ?? '?' }), _jsxs("span", { className: "grid flex-1 text-left text-sm leading-tight", children: [_jsx("span", { className: "truncate font-medium", children: current?.name ?? '选择工作区' }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: current?.plan_code ?? '—' })] }), _jsx(ChevronsUpDown, { className: "ml-auto size-4 text-muted-foreground" })] }), _jsxs(DropdownMenuContent, { className: "w-(--anchor-width) min-w-56", align: "start", side: "bottom", sideOffset: 4, children: [_jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: "\u5DE5\u4F5C\u533A" }), list.map((ws) => (_jsxs(DropdownMenuItem, { className: "gap-2 p-2", onClick: () => switchTo(ws.id), children: [_jsx("span", { className: "flex size-6 items-center justify-center rounded-md border bg-transparent text-[10px] font-bold", children: ws.name[0]?.toUpperCase() }), _jsx("span", { className: "flex-1 truncate", children: ws.name }), current?.id === ws.id && _jsx(Check, { className: "size-4" })] }, ws.id)))] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "gap-2 p-2", onClick: () => setShowCreate(true), children: [_jsx("span", { className: "flex size-6 items-center justify-center rounded-md border bg-transparent", children: _jsx(Plus, { className: "size-4" }) }), _jsx("span", { className: "whitespace-nowrap font-medium text-muted-foreground", children: "\u65B0\u5EFA\u5DE5\u4F5C\u533A" })] })] })] }) }) }), showCreate && (_jsxs("div", { className: cn('absolute left-0 top-full z-50 mt-2 w-64 rounded-lg border bg-popover p-2 shadow-lg'), children: [_jsx(Input, { autoFocus: true, value: name, onChange: (e) => setName(e.target.value), onKeyDown: (e) => {
50
+ if (e.key === 'Enter' && !creating)
51
+ handleCreate();
52
+ }, placeholder: "\u5DE5\u4F5C\u533A\u540D\u79F0", "aria-label": "\u65B0\u5DE5\u4F5C\u533A\u540D\u79F0", maxLength: 64 }), _jsxs("div", { className: "mt-2 flex gap-1", children: [_jsx(Button, { size: "sm", className: "flex-1", onClick: handleCreate, disabled: !name.trim() || creating, children: creating ? '创建中…' : '创建' }), _jsx(Button, { size: "sm", variant: "outline", className: "flex-1", onClick: () => setShowCreate(false), children: "\u53D6\u6D88" })] }), createError && (_jsxs("div", { className: "mt-2 space-y-1", children: [_jsx("p", { role: "alert", className: "text-xs text-destructive", children: createError }), quotaExceeded && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["\u5DF2\u8FBE\u5F53\u524D\u5DE5\u4F5C\u533A\u6570\u4E0A\u9650\uFF0C\u53EF\u5728", _jsx(Link, { to: "/settings/workspace/billing", className: "mx-1 text-primary underline-offset-2 hover:underline", children: "\u8BBE\u7F6E\u2192\u8BA1\u8D39" }), "\u67E5\u770B\u5957\u9910\u4E0E\u914D\u989D"] }))] }))] }))] }));
53
+ }
@@ -0,0 +1,7 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
3
+ import 'sonner/dist/styles.css';
4
+ type SonnerToast = typeof sonnerToast;
5
+ export declare const toast: SonnerToast;
6
+ export declare function Toaster(props: ComponentProps<typeof SonnerToaster>): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
3
+ import 'sonner/dist/styles.css';
4
+ const originalError = sonnerToast.error;
5
+ const errorWithLongerDuration = (message, data) => originalError(message, { duration: 8000, ...data });
6
+ export const toast = Object.assign(sonnerToast, {
7
+ error: errorWithLongerDuration,
8
+ });
9
+ export function Toaster(props) {
10
+ return _jsx(SonnerToaster, { richColors: true, position: "top-right", containerAriaLabel: "\u901A\u77E5", ...props });
11
+ }
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
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;
13
+ export { Badge, badgeVariants };
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn, statusTone, statusLabel, STATUS_TONE_CLASS } from '../../lib/utils';
4
+ const badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap', {
5
+ variants: {
6
+ variant: {
7
+ default: 'border-transparent bg-primary text-primary-foreground',
8
+ secondary: 'border-transparent bg-secondary text-secondary-foreground',
9
+ destructive: 'border-transparent bg-destructive text-destructive-foreground',
10
+ outline: 'text-foreground',
11
+ },
12
+ },
13
+ defaultVariants: { variant: 'default' },
14
+ });
15
+ function Badge({ className, variant, ...props }) {
16
+ return _jsx("span", { className: cn(badgeVariants({ variant }), className), ...props });
17
+ }
18
+ export function StatusBadge({ status, className }) {
19
+ 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) }));
20
+ }
21
+ export { Badge, badgeVariants };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | "iconSm" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ComponentPropsWithRef<'button'>, VariantProps<typeof buttonVariants> {
8
+ }
9
+ declare function Button({ className, variant, size, ref, ...props }: ButtonProps): React.JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn } from '../../lib/utils';
4
+ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors ' +
5
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ' +
6
+ 'disabled:pointer-events-none disabled:opacity-50 ' +
7
+ '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
8
+ variants: {
9
+ variant: {
10
+ default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
11
+ destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
12
+ outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
13
+ secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
14
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
15
+ link: 'text-primary underline-offset-4 hover:underline',
16
+ },
17
+ size: {
18
+ default: 'h-9 px-4 py-2',
19
+ sm: 'h-8 rounded-md px-3 text-xs',
20
+ lg: 'h-10 rounded-md px-8',
21
+ icon: 'h-9 w-9',
22
+ iconSm: 'size-8 rounded-md',
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ variant: 'default',
27
+ size: 'default',
28
+ },
29
+ });
30
+ function Button({ className, variant, size, ref, ...props }) {
31
+ return (_jsx("button", { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
32
+ }
33
+ export { Button, buttonVariants };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Input({ className, type, ref, ...props }: React.ComponentPropsWithRef<'input'>): React.JSX.Element;
3
+ export { Input };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ function Input({ className, type, ref, ...props }) {
4
+ return (_jsx("input", { type: type, "data-slot": "input", className: cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors ' +
5
+ 'file:border-0 file:bg-transparent file:text-sm file:font-medium ' +
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 }));
9
+ }
10
+ export { Input };
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
3
+ import { Button } from "./Button";
4
+ declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React.JSX.Element;
5
+ declare function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props): React.JSX.Element;
6
+ declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): React.JSX.Element;
7
+ declare function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props): React.JSX.Element;
8
+ declare function AlertDialogContent({ className, size, ...props }: AlertDialogPrimitive.Popup.Props & {
9
+ size?: "default" | "sm";
10
+ }): React.JSX.Element;
11
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
15
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
16
+ declare function AlertDialogAction({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
17
+ declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
18
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
3
+ import { cn } from "../../lib/utils";
4
+ import { Button } from "./Button";
5
+ function AlertDialog({ ...props }) {
6
+ return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
7
+ }
8
+ function AlertDialogTrigger({ ...props }) {
9
+ return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props }));
10
+ }
11
+ function AlertDialogPortal({ ...props }) {
12
+ return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props }));
13
+ }
14
+ function AlertDialogOverlay({ className, ...props }) {
15
+ 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
+ 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-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xs ring-1 ring-foreground/10 outline-none duration-100 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 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg", className), ...props })] }));
19
+ }
20
+ 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-6 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
+ 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
+ }
26
+ function AlertDialogMedia({ className, ...props }) {
27
+ return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted *:[svg:not([class*='size-'])]:size-8 sm:group-data-[size=default]/alert-dialog-content:row-span-2", className), ...props }));
28
+ }
29
+ function AlertDialogTitle({ className, ...props }) {
30
+ return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("font-heading text-lg 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
+ function AlertDialogDescription({ className, ...props }) {
33
+ return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-muted-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
34
+ }
35
+ function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
36
+ return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-action", className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
37
+ }
38
+ function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
39
+ return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-cancel", className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
40
+ }
41
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
3
+ declare function Avatar({ className, size, ...props }: AvatarPrimitive.Root.Props & {
4
+ size?: "default" | "sm" | "lg";
5
+ }): React.JSX.Element;
6
+ declare function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props): React.JSX.Element;
7
+ declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): React.JSX.Element;
8
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
9
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
3
+ import { cn } from "../../lib/utils";
4
+ 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 rounded-full 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
+ function AvatarImage({ className, ...props }) {
8
+ return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn("aspect-square size-full rounded-full object-cover", className), ...props }));
9
+ }
10
+ function AvatarFallback({ className, ...props }) {
11
+ 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
+ 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 text-primary-foreground 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
+ function AvatarGroup({ className, ...props }) {
17
+ 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 }));
18
+ }
19
+ function AvatarGroupCount({ className, ...props }) {
20
+ return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
21
+ }
22
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
4
+ declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
5
+ declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
6
+ declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
7
+ declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
8
+ declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
9
+ declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
10
+ export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { mergeProps } from "@base-ui/react/merge-props";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
5
+ import { cn } from "../../lib/utils";
6
+ function Breadcrumb({ className, ...props }) {
7
+ return (_jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn("flex min-w-0 items-center", className), ...props }));
8
+ }
9
+ function BreadcrumbList({ className, ...props }) {
10
+ return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex min-w-0 flex-nowrap items-center gap-1.5 text-sm text-muted-foreground sm:gap-2.5", className), ...props }));
11
+ }
12
+ function BreadcrumbItem({ className, ...props }) {
13
+ return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex min-w-0 items-center gap-1.5", className), ...props }));
14
+ }
15
+ function BreadcrumbLink({ className, render, ...props }) {
16
+ return useRender({
17
+ defaultTagName: "a",
18
+ props: mergeProps({
19
+ className: cn("transition-colors hover:text-foreground", className),
20
+ }, props),
21
+ render,
22
+ state: {
23
+ slot: "breadcrumb-link",
24
+ },
25
+ });
26
+ }
27
+ function BreadcrumbPage({ className, ...props }) {
28
+ return (_jsx("span", { "data-slot": "breadcrumb-page", "aria-current": "page", className: cn("truncate font-normal text-foreground", className), ...props }));
29
+ }
30
+ function BreadcrumbSeparator({ children, className, ...props }) {
31
+ return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("shrink-0 [&>svg]:size-3.5", className), ...props, children: children ?? _jsx(ChevronRight, { className: "rtl:-scale-x-100" }) }));
32
+ }
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(MoreHorizontal, {}), _jsx("span", { className: "sr-only", children: "More" })] }));
35
+ }
36
+ export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
3
+ size?: "default" | "sm";
4
+ }): React.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function CardTitle({ as: Tag, className, ...props }: React.ComponentProps<"div"> & {
7
+ as?: "div" | "h2" | "h3";
8
+ }): React.JSX.Element;
9
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/utils";
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-6 overflow-hidden rounded-xl bg-card py-6 text-card-foreground text-sm shadow-xs ring-1 ring-foreground/10 data-[size=sm]:gap-4 data-[size=sm]:py-4", className), ...props }));
5
+ }
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-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6", className), ...props }));
8
+ }
9
+ function CardTitle({ as: Tag = "div", className, ...props }) {
10
+ return (_jsx(Tag, { "data-slot": "card-title", className: cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className), ...props }));
11
+ }
12
+ function CardDescription({ className, ...props }) {
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
14
+ }
15
+ function CardAction({ className, ...props }) {
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
+ }
18
+ function CardContent({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "card-content", className: cn("px-6", className), ...props }));
20
+ }
21
+ function CardFooter({ className, ...props }) {
22
+ return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-xl px-6 [.border-t]:pt-6", className), ...props }));
23
+ }
24
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -0,0 +1,3 @@
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ declare function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props): import("react").JSX.Element;
3
+ export { Checkbox };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
3
+ import { CheckIcon } from "lucide-react";
4
+ import { cn } from "../../lib/utils";
5
+ 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 bg-transparent shadow-xs outline-none transition-shadow after:absolute after:-inset-x-3 after:-inset-y-2 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 group-has-[:focus-visible]/field-label:data-checked:border-primary disabled:cursor-not-allowed disabled:opacity-50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:aria-checked:border-primary aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 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
+ export { Checkbox };
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
3
+ declare const Dialog: <Payload>(props: BaseDialog.Root.Props<Payload>) => React.JSX.Element;
4
+ declare const DialogTrigger: BaseDialog.Trigger;
5
+ declare const DialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare function DialogOverlay({ className, ref, ...props }: React.ComponentProps<typeof BaseDialog.Backdrop>): React.JSX.Element;
8
+ declare function DialogContent({ className, children, hideClose, ref, ...props }: React.ComponentProps<typeof BaseDialog.Popup> & {
9
+ hideClose?: boolean;
10
+ }): React.JSX.Element;
11
+ declare const DialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
12
+ declare const DialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
13
+ declare function DialogTitle({ className, ref, ...props }: React.ComponentProps<typeof BaseDialog.Title>): React.JSX.Element;
14
+ declare function DialogDescription({ className, ref, ...props }: React.ComponentProps<typeof BaseDialog.Description>): React.JSX.Element;
15
+ export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
3
+ import { X } from 'lucide-react';
4
+ import { cn } from '../../lib/utils';
5
+ const Dialog = BaseDialog.Root;
6
+ const DialogTrigger = BaseDialog.Trigger;
7
+ const DialogPortal = BaseDialog.Portal;
8
+ const DialogClose = BaseDialog.Close;
9
+ function DialogOverlay({ className, ref, ...props }) {
10
+ return (_jsx(BaseDialog.Backdrop, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/80 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }));
11
+ }
12
+ function DialogContent({ className, children, hideClose, ref, ...props }) {
13
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(BaseDialog.Popup, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 ' +
14
+ 'border bg-background p-6 shadow-lg duration-200 ' +
15
+ 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 ' +
16
+ 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props, children: [children, !hideClose && (_jsxs(BaseDialog.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
17
+ }
18
+ const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
19
+ const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
20
+ function DialogTitle({ className, ref, ...props }) {
21
+ return _jsx(BaseDialog.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight', className), ...props });
22
+ }
23
+ function DialogDescription({ className, ref, ...props }) {
24
+ return _jsx(BaseDialog.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props });
25
+ }
26
+ export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
4
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
+ declare const emptyMediaVariants: (props?: ({
6
+ variant?: "default" | "icon" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): React.JSX.Element;
9
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
11
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function EmptyFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, EmptyFooter, };
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "../../lib/utils";
4
+ function Empty({ className, ...props }) {
5
+ return (_jsx("div", { "data-slot": "empty", className: cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border border-dashed p-12 text-center text-balance", className), ...props }));
6
+ }
7
+ function EmptyHeader({ className, ...props }) {
8
+ return (_jsx("div", { "data-slot": "empty-header", className: cn("flex max-w-sm flex-col items-center gap-2", className), ...props }));
9
+ }
10
+ const emptyMediaVariants = cva("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-transparent",
14
+ icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "default",
19
+ },
20
+ });
21
+ function EmptyMedia({ className, variant = "default", ...props }) {
22
+ return (_jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn(emptyMediaVariants({ variant, className })), ...props }));
23
+ }
24
+ function EmptyTitle({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "empty-title", className: cn("text-lg font-medium tracking-tight", className), ...props }));
26
+ }
27
+ function EmptyDescription({ className, ...props }) {
28
+ return (_jsx("div", { "data-slot": "empty-description", className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
29
+ }
30
+ function EmptyContent({ className, ...props }) {
31
+ return (_jsx("div", { "data-slot": "empty-content", className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className), ...props }));
32
+ }
33
+ function EmptyFooter({ className, ...props }) {
34
+ return (_jsx("div", { "data-slot": "empty-footer", className: cn("flex items-center justify-center gap-2", className), ...props }));
35
+ }
36
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, EmptyFooter, };
@@ -0,0 +1,24 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { Label } from "./label";
3
+ declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react").JSX.Element;
4
+ declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
5
+ variant?: "legend" | "label";
6
+ }): import("react").JSX.Element;
7
+ declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
8
+ declare const fieldVariants: (props?: ({
9
+ orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
12
+ declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
13
+ declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
14
+ declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
15
+ declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
16
+ declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
17
+ children?: React.ReactNode;
18
+ }): import("react").JSX.Element;
19
+ declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
20
+ errors?: Array<{
21
+ message?: string;
22
+ } | undefined>;
23
+ }): import("react").JSX.Element | null;
24
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };