@ploykit/ui 0.1.1 → 0.4.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 (145) hide show
  1. package/README.md +183 -23
  2. package/dist/AppProviders.d.ts +15 -0
  3. package/dist/AppProviders.js +15 -0
  4. package/dist/components/ConfirmDialog.js +8 -2
  5. package/dist/components/CronInput.js +2 -2
  6. package/dist/components/DataTable.d.ts +12 -3
  7. package/dist/components/DataTable.js +7 -3
  8. package/dist/components/ErrorBoundary.js +1 -1
  9. package/dist/components/ImpersonationBanner.js +1 -1
  10. package/dist/components/NotificationBell.js +5 -5
  11. package/dist/components/OnboardingChecklist.js +3 -3
  12. package/dist/components/Page.js +1 -1
  13. package/dist/components/ReauthDialog.d.ts +15 -0
  14. package/dist/components/ReauthDialog.js +42 -0
  15. package/dist/components/SecretModal.d.ts +8 -1
  16. package/dist/components/SecretModal.js +6 -3
  17. package/dist/components/SettingsCard.js +2 -2
  18. package/dist/components/SiteBannerLayer.js +1 -1
  19. package/dist/components/StatusBadge.d.ts +4 -0
  20. package/dist/components/StatusBadge.js +7 -0
  21. package/dist/components/UserMenu.js +2 -2
  22. package/dist/components/WorkspaceSwitcher.js +4 -4
  23. package/dist/components/ui/alert-dialog.d.ts +2 -2
  24. package/dist/components/ui/alert-dialog.js +10 -9
  25. package/dist/components/ui/avatar.js +3 -2
  26. package/dist/components/ui/badge.d.ts +7 -0
  27. package/dist/components/ui/badge.js +33 -0
  28. package/dist/components/ui/breadcrumb.js +7 -7
  29. package/dist/components/ui/button.d.ts +8 -0
  30. package/dist/components/ui/button.js +34 -0
  31. package/dist/components/ui/card.d.ts +2 -4
  32. package/dist/components/ui/card.js +7 -7
  33. package/dist/components/ui/checkbox.js +3 -2
  34. package/dist/components/ui/dialog.d.ts +22 -14
  35. package/dist/components/ui/dialog.js +40 -25
  36. package/dist/components/ui/dropdown-menu.js +50 -0
  37. package/dist/components/ui/empty.d.ts +7 -9
  38. package/dist/components/ui/empty.js +6 -9
  39. package/dist/components/ui/field.js +10 -9
  40. package/dist/components/ui/input.d.ts +3 -0
  41. package/dist/components/ui/input.js +7 -0
  42. package/dist/components/ui/popover.js +3 -2
  43. package/dist/components/ui/progress.js +2 -1
  44. package/dist/components/ui/select.d.ts +20 -1
  45. package/dist/components/ui/select.js +28 -7
  46. package/dist/components/ui/separator.js +1 -0
  47. package/dist/components/ui/sheet.d.ts +9 -1
  48. package/dist/components/ui/sheet.js +11 -4
  49. package/dist/components/ui/sidebar.d.ts +2 -2
  50. package/dist/components/ui/sidebar.js +25 -34
  51. package/dist/components/ui/skeleton.d.ts +1 -2
  52. package/dist/components/ui/switch.js +1 -1
  53. package/dist/components/ui/tabs.js +3 -3
  54. package/dist/components/ui/textarea.d.ts +9 -0
  55. package/dist/components/ui/textarea.js +12 -0
  56. package/dist/components/ui/tooltip.js +1 -1
  57. package/dist/index.d.ts +10 -40
  58. package/dist/index.js +10 -26
  59. package/dist/layouts/AppShell.d.ts +1 -1
  60. package/dist/layouts/AppShell.js +23 -1
  61. package/dist/layouts/SettingsShell.d.ts +1 -1
  62. package/dist/layouts/SettingsShell.js +3 -3
  63. package/dist/pages/LandingPage.js +1 -1
  64. package/dist/pages/LoginPage.js +7 -7
  65. package/dist/pages/account/NotificationPreferencesPage.js +2 -2
  66. package/dist/pages/account/ProfileSettingsPage.js +7 -7
  67. package/dist/pages/account/SecuritySettingsPage.js +8 -8
  68. package/dist/pages/account/TokensPage.js +4 -4
  69. package/dist/pages/admin/AdminSettingsPage.js +5 -5
  70. package/dist/pages/admin/AdminShell.js +2 -2
  71. package/dist/pages/admin/AuditPage.js +3 -3
  72. package/dist/pages/admin/OrdersPage.js +4 -3
  73. package/dist/pages/admin/OverviewPage.js +4 -4
  74. package/dist/pages/admin/SSOPage.js +3 -3
  75. package/dist/pages/admin/UserDetailPage.js +6 -5
  76. package/dist/pages/admin/UsersPage.js +7 -6
  77. package/dist/pages/admin/WebhookDeliveriesPage.js +4 -3
  78. package/dist/pages/admin/WorkspaceDetailPage.js +5 -5
  79. package/dist/pages/admin/WorkspacesPage.js +4 -4
  80. package/dist/pages/admin/shared.js +1 -1
  81. package/dist/pages/auth/ForgotPasswordPage.js +3 -3
  82. package/dist/pages/auth/InviteAcceptPage.js +4 -4
  83. package/dist/pages/auth/RegisterPage.js +6 -6
  84. package/dist/pages/auth/ResetPasswordPage.js +4 -4
  85. package/dist/pages/auth/VerifyEmailPage.js +4 -4
  86. package/dist/pages/workspace/BillingPage.js +8 -7
  87. package/dist/pages/workspace/BillingSuccessPage.js +3 -3
  88. package/dist/pages/workspace/MembersPage.js +7 -6
  89. package/dist/pages/workspace/RolePermissionsPage.d.ts +3 -0
  90. package/dist/pages/workspace/RolePermissionsPage.js +118 -0
  91. package/dist/pages/workspace/SchedulesPage.js +5 -5
  92. package/dist/pages/workspace/UsagePage.d.ts +1 -1
  93. package/dist/pages/workspace/UsagePage.js +2 -2
  94. package/dist/pages/workspace/WebhooksPage.js +9 -9
  95. package/dist/pages/workspace/WorkspaceAuditPage.js +3 -3
  96. package/dist/pages/workspace/WorkspaceGeneralPage.js +7 -7
  97. package/package.json +9 -5
  98. package/dist/components/ui/Badge.d.ts +0 -13
  99. package/dist/components/ui/Badge.js +0 -21
  100. package/dist/components/ui/Button.d.ts +0 -10
  101. package/dist/components/ui/Button.js +0 -33
  102. package/dist/components/ui/Input.d.ts +0 -3
  103. package/dist/components/ui/Input.js +0 -10
  104. package/dist/components/ui/menu.js +0 -50
  105. package/dist/hooks/useApi.d.ts +0 -10
  106. package/dist/hooks/useApi.js +0 -11
  107. package/dist/hooks/useAudit.d.ts +0 -39
  108. package/dist/hooks/useAudit.js +0 -55
  109. package/dist/hooks/useAuth.d.ts +0 -1
  110. package/dist/hooks/useAuth.js +0 -4
  111. package/dist/hooks/useBilling.d.ts +0 -44
  112. package/dist/hooks/useBilling.js +0 -64
  113. package/dist/hooks/useLogin.d.ts +0 -10
  114. package/dist/hooks/useLogin.js +0 -39
  115. package/dist/hooks/useMembers.d.ts +0 -125
  116. package/dist/hooks/useMembers.js +0 -127
  117. package/dist/hooks/useNotificationPrefs.d.ts +0 -20
  118. package/dist/hooks/useNotificationPrefs.js +0 -42
  119. package/dist/hooks/usePasswordReset.d.ts +0 -5
  120. package/dist/hooks/usePasswordReset.js +0 -12
  121. package/dist/hooks/useSEO.d.ts +0 -6
  122. package/dist/hooks/useSEO.js +0 -14
  123. package/dist/hooks/useSessions.d.ts +0 -20
  124. package/dist/hooks/useSessions.js +0 -38
  125. package/dist/hooks/useSiteConfig.d.ts +0 -12
  126. package/dist/hooks/useSiteConfig.js +0 -11
  127. package/dist/hooks/useTokens.d.ts +0 -36
  128. package/dist/hooks/useTokens.js +0 -35
  129. package/dist/hooks/useUsage.d.ts +0 -20
  130. package/dist/hooks/useUsage.js +0 -21
  131. package/dist/hooks/useWorkspace.d.ts +0 -26
  132. package/dist/hooks/useWorkspace.js +0 -32
  133. package/dist/hooks/useZodForm.d.ts +0 -6
  134. package/dist/hooks/useZodForm.js +0 -6
  135. package/dist/hooks/ws.d.ts +0 -4
  136. package/dist/hooks/ws.js +0 -21
  137. package/dist/lib/perm.d.ts +0 -2
  138. package/dist/lib/perm.js +0 -7
  139. package/dist/lib/ws-query-bridge.d.ts +0 -7
  140. package/dist/lib/ws-query-bridge.js +0 -35
  141. package/dist/provider/PloykitProvider.d.ts +0 -50
  142. package/dist/provider/PloykitProvider.js +0 -240
  143. package/dist/realtime.d.ts +0 -3
  144. package/dist/realtime.js +0 -11
  145. /package/dist/components/ui/{menu.d.ts → dropdown-menu.d.ts} +0 -0
@@ -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 '../hooks/useWorkspace';
8
+ import { useWorkspaceSwitch } from '@ploykit/hooks';
9
9
  import { toast } from './toast';
10
- import { Button } from './ui/Button';
11
- import { Input } from './ui/Input';
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,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 "./Button";
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, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
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 "./Button";
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-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
+ 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-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
+ 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-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
+ 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("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
+ 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-muted-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
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, 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 }));
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 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
+ 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 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
+ 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 }));
@@ -0,0 +1,7 @@
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
7
+ export { Badge, badgeVariants };
@@ -0,0 +1,33 @@
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!", {
6
+ variants: {
7
+ variant: {
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",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
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
+ });
32
+ }
33
+ export { Badge, badgeVariants };
@@ -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("flex min-w-0 items-center", className), ...props }));
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 min-w-0 flex-nowrap items-center gap-1.5 text-sm text-muted-foreground sm:gap-2.5", className), ...props }));
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 min-w-0 items-center gap-1.5", className), ...props }));
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("truncate font-normal text-foreground", className), ...props }));
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("shrink-0 [&>svg]:size-3.5", className), ...props, children: children ?? _jsx(ChevronRight, { className: "rtl:-scale-x-100" }) }));
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(MoreHorizontal, {}), _jsx("span", { className: "sr-only", children: "More" })] }));
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, };
@@ -0,0 +1,8 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
8
+ export { Button, buttonVariants };
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
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", {
6
+ variants: {
7
+ variant: {
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",
14
+ },
15
+ size: {
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",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default",
29
+ },
30
+ });
31
+ function Button({ className, variant = "default", size = "default", ...props }) {
32
+ return (_jsx(ButtonPrimitive, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
33
+ }
34
+ export { Button, buttonVariants };
@@ -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({ as: Tag, className, ...props }: React.ComponentProps<"div"> & {
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-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 }));
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-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 }));
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({ 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 }));
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-6", className), ...props }));
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 px-6 [.border-t]:pt-6", className), ...props }));
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 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
+ 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 };
@@ -1,15 +1,23 @@
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;
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
8
+ /**
9
+ * DialogContent 内容面板。size 控制最大宽度档位(经 data-size 落到
10
+ * Tailwind data-[size=*] 变体):sm=sm:max-w-sm(默认,历史视觉)/
11
+ * md=sm:max-w-lg / lg=sm:max-w-2xl / xl=sm:max-w-4xl。
12
+ */
13
+ declare function DialogContent({ className, children, size, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
14
+ size?: "sm" | "md" | "lg" | "xl";
15
+ showCloseButton?: boolean;
10
16
  }): 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, };
17
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
18
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
19
+ showCloseButton?: boolean;
20
+ }): React.JSX.Element;
21
+ declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
22
+ declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
23
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -1,26 +1,41 @@
1
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, };
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ import { cn } from "../../lib/utils";
4
+ import { Button } from "./button";
5
+ import { XIcon } from "lucide-react";
6
+ function Dialog({ ...props }) {
7
+ return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
8
+ }
9
+ function DialogTrigger({ ...props }) {
10
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
11
+ }
12
+ function DialogPortal({ ...props }) {
13
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
14
+ }
15
+ function DialogClose({ ...props }) {
16
+ return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
17
+ }
18
+ function DialogOverlay({ className, ...props }) {
19
+ return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "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 }));
20
+ }
21
+ /**
22
+ * DialogContent 内容面板。size 控制最大宽度档位(经 data-size 落到
23
+ * Tailwind data-[size=*] 变体):sm=sm:max-w-sm(默认,历史视觉)/
24
+ * md=sm:max-w-lg / lg=sm:max-w-2xl / xl=sm:max-w-4xl。
25
+ */
26
+ function DialogContent({ className, children, size = "sm", showCloseButton = true, ...props }) {
27
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", "data-size": size, className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none 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 data-[size=md]:sm:max-w-lg data-[size=lg]:sm:max-w-2xl data-[size=xl]:sm:max-w-4xl", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-2 right-2", size: "icon-sm" }), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
28
+ }
29
+ function DialogHeader({ className, ...props }) {
30
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
31
+ }
32
+ function DialogFooter({ className, showCloseButton = false, children, ...props }) {
33
+ return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: "Close" }))] }));
34
+ }
35
+ function DialogTitle({ className, ...props }) {
36
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-base leading-none font-medium", className), ...props }));
37
+ }
38
+ function DialogDescription({ className, ...props }) {
39
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
40
+ }
41
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
3
+ import { cn } from "../../lib/utils";
4
+ import { ChevronRightIcon, CheckIcon } from "lucide-react";
5
+ function DropdownMenu({ ...props }) {
6
+ return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
7
+ }
8
+ function DropdownMenuPortal({ ...props }) {
9
+ return _jsx(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
10
+ }
11
+ function DropdownMenuTrigger({ ...props }) {
12
+ return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
13
+ }
14
+ function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
15
+ return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
16
+ }
17
+ function DropdownMenuGroup({ ...props }) {
18
+ return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
19
+ }
20
+ function DropdownMenuLabel({ className, inset, ...props }) {
21
+ return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
22
+ }
23
+ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
24
+ return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
25
+ }
26
+ function DropdownMenuSub({ ...props }) {
27
+ return _jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
28
+ }
29
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
30
+ return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
31
+ }
32
+ function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
33
+ return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-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), align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props }));
34
+ }
35
+ function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
36
+ return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
37
+ }
38
+ function DropdownMenuRadioGroup({ ...props }) {
39
+ return (_jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
40
+ }
41
+ function DropdownMenuRadioItem({ className, children, inset, ...props }) {
42
+ return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
43
+ }
44
+ function DropdownMenuSeparator({ className, ...props }) {
45
+ return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
46
+ }
47
+ function DropdownMenuShortcut({ className, ...props }) {
48
+ return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className), ...props }));
49
+ }
50
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -1,13 +1,11 @@
1
- import * as React from "react";
2
1
  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;
2
+ declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
3
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
5
4
  declare const emptyMediaVariants: (props?: ({
6
5
  variant?: "default" | "icon" | null | undefined;
7
6
  } & 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, };
7
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react").JSX.Element;
8
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
9
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
10
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
11
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
@@ -2,16 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
3
  import { cn } from "../../lib/utils";
4
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 }));
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-xl border-dashed p-6 text-center text-balance", className), ...props }));
6
6
  }
7
7
  function EmptyHeader({ className, ...props }) {
8
8
  return (_jsx("div", { "data-slot": "empty-header", className: cn("flex max-w-sm flex-col items-center gap-2", className), ...props }));
9
9
  }
10
- const emptyMediaVariants = cva("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
10
+ const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
11
11
  variants: {
12
12
  variant: {
13
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",
14
+ icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
15
15
  },
16
16
  },
17
17
  defaultVariants: {
@@ -22,15 +22,12 @@ function EmptyMedia({ className, variant = "default", ...props }) {
22
22
  return (_jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn(emptyMediaVariants({ variant, className })), ...props }));
23
23
  }
24
24
  function EmptyTitle({ className, ...props }) {
25
- return (_jsx("div", { "data-slot": "empty-title", className: cn("text-lg font-medium tracking-tight", className), ...props }));
25
+ return (_jsx("div", { "data-slot": "empty-title", className: cn("text-sm font-medium tracking-tight", className), ...props }));
26
26
  }
27
27
  function EmptyDescription({ className, ...props }) {
28
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
29
  }
30
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 }));
31
+ return (_jsx("div", { "data-slot": "empty-content", className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance", className), ...props }));
32
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, };
33
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };