@cbrl/design 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -2
  3. package/dist/components/alert-dialog.d.ts +14 -0
  4. package/dist/components/alert-dialog.js +82 -0
  5. package/dist/components/app-shell.d.ts +38 -0
  6. package/dist/components/app-shell.js +72 -0
  7. package/dist/components/auth-split-screen.d.ts +30 -0
  8. package/dist/components/auth-split-screen.js +45 -0
  9. package/dist/components/avatar.d.ts +11 -0
  10. package/dist/components/avatar.js +50 -0
  11. package/dist/components/badge.d.ts +9 -0
  12. package/dist/components/badge.js +27 -0
  13. package/dist/components/breadcrumb.d.ts +11 -0
  14. package/dist/components/breadcrumb.js +69 -0
  15. package/dist/components/button.d.ts +10 -0
  16. package/dist/components/button.js +47 -0
  17. package/dist/components/calendar.d.ts +7 -0
  18. package/dist/components/calendar.js +142 -0
  19. package/dist/components/card.d.ts +13 -0
  20. package/dist/components/card.js +57 -0
  21. package/dist/components/checkbox.d.ts +4 -0
  22. package/dist/components/checkbox.js +20 -0
  23. package/dist/components/collapsible.d.ts +5 -0
  24. package/dist/components/collapsible.js +23 -0
  25. package/dist/components/date-field.d.ts +31 -0
  26. package/dist/components/date-field.js +129 -0
  27. package/dist/components/dialog.d.ts +17 -0
  28. package/dist/components/dialog.js +95 -0
  29. package/dist/components/dropdown-menu.d.ts +29 -0
  30. package/dist/components/dropdown-menu.js +127 -0
  31. package/dist/components/empty-state.d.ts +32 -0
  32. package/dist/components/empty-state.js +61 -0
  33. package/dist/components/field.d.ts +25 -0
  34. package/dist/components/field.js +121 -0
  35. package/dist/components/highlighted-textarea.d.ts +6 -0
  36. package/dist/components/highlighted-textarea.js +68 -0
  37. package/dist/components/icons/brand-icon.d.ts +6 -0
  38. package/dist/components/icons/brand-icon.js +13 -0
  39. package/dist/components/icons/google-icon.d.ts +7 -0
  40. package/dist/components/icons/google-icon.js +33 -0
  41. package/dist/components/icons/whatsapp-icon.d.ts +7 -0
  42. package/dist/components/icons/whatsapp-icon.js +18 -0
  43. package/dist/components/input-group.d.ts +8 -0
  44. package/dist/components/input-group.js +28 -0
  45. package/dist/components/input.d.ts +3 -0
  46. package/dist/components/input.js +13 -0
  47. package/dist/components/label.d.ts +4 -0
  48. package/dist/components/label.js +14 -0
  49. package/dist/components/list.d.ts +174 -0
  50. package/dist/components/list.js +281 -0
  51. package/dist/components/main.d.ts +10 -0
  52. package/dist/components/main.js +36 -0
  53. package/dist/components/pagination.d.ts +25 -0
  54. package/dist/components/pagination.js +104 -0
  55. package/dist/components/popover.d.ts +6 -0
  56. package/dist/components/popover.js +28 -0
  57. package/dist/components/radio-group.d.ts +5 -0
  58. package/dist/components/radio-group.js +27 -0
  59. package/dist/components/scroll-area.d.ts +5 -0
  60. package/dist/components/scroll-area.js +35 -0
  61. package/dist/components/select.d.ts +15 -0
  62. package/dist/components/select.js +95 -0
  63. package/dist/components/separator.d.ts +4 -0
  64. package/dist/components/separator.js +16 -0
  65. package/dist/components/setting-row.d.ts +8 -0
  66. package/dist/components/setting-row.js +36 -0
  67. package/dist/components/settings-section.d.ts +7 -0
  68. package/dist/components/settings-section.js +36 -0
  69. package/dist/components/sheet.d.ts +14 -0
  70. package/dist/components/sheet.js +89 -0
  71. package/dist/components/sidebar-core.d.ts +33 -0
  72. package/dist/components/sidebar-core.js +220 -0
  73. package/dist/components/sidebar-menu.d.ts +38 -0
  74. package/dist/components/sidebar-menu.js +168 -0
  75. package/dist/components/sidebar.d.ts +3 -0
  76. package/dist/components/skeleton.d.ts +2 -0
  77. package/dist/components/skeleton.js +11 -0
  78. package/dist/components/sonner.d.ts +3 -0
  79. package/dist/components/sonner.js +31 -0
  80. package/dist/components/stepper.d.ts +8 -0
  81. package/dist/components/stepper.js +58 -0
  82. package/dist/components/switch.d.ts +6 -0
  83. package/dist/components/switch.js +19 -0
  84. package/dist/components/table.d.ts +10 -0
  85. package/dist/components/table.js +65 -0
  86. package/dist/components/tabs.d.ts +7 -0
  87. package/dist/components/tabs.js +35 -0
  88. package/dist/components/textarea.d.ts +3 -0
  89. package/dist/components/textarea.js +12 -0
  90. package/dist/components/theme-provider.d.ts +15 -0
  91. package/dist/components/theme-provider.js +22 -0
  92. package/dist/components/tooltip.d.ts +7 -0
  93. package/dist/components/tooltip.js +35 -0
  94. package/dist/components/typography.d.ts +9 -0
  95. package/dist/components/typography.js +45 -0
  96. package/dist/components/user-menu.d.ts +27 -0
  97. package/dist/components/user-menu.js +49 -0
  98. package/dist/globals.css +60 -0
  99. package/dist/hooks/use-mobile.d.ts +1 -0
  100. package/dist/hooks/use-mobile.js +17 -0
  101. package/dist/index.d.ts +53 -0
  102. package/dist/index.js +51 -0
  103. package/dist/lib/cn.d.ts +2 -0
  104. package/dist/lib/cn.js +7 -0
  105. package/dist/lib/css-vars.js +5 -0
  106. package/dist/lib/date.js +38 -0
  107. package/dist/lib/initials.d.ts +8 -0
  108. package/dist/lib/initials.js +15 -0
  109. package/dist/lib/nav.d.ts +15 -0
  110. package/dist/lib/nav.js +11 -0
  111. package/dist/lib/toaster-theme.js +5 -0
  112. package/dist/shadcn.css +635 -0
  113. package/dist/tokens.css +160 -0
  114. package/package.json +85 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kayron Cabral
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # @cbrl/design
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Design system for React apps on Radix primitives and Tailwind CSS v4:
4
+ shadcn-style components, an app shell with sidebar navigation, and design tokens
5
+ with an overridable brand.
6
+
7
+ ```sh
8
+ pnpm add @cbrl/design next-themes react react-dom tailwindcss
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ Import the stylesheet once, in the app's global CSS. It brings Tailwind, the
14
+ tokens, and an `@source` that makes Tailwind generate the classes used inside
15
+ this package.
16
+
17
+ ```css
18
+ /* src/app/globals.css */
19
+ @import '@cbrl/design/globals.css';
20
+
21
+ /* Brand: redefine tokens, don't fork the package. */
22
+ :root {
23
+ --primary: oklch(0.48 0.092 208);
24
+ --primary-foreground: oklch(0.99 0.003 210);
25
+ }
26
+ ```
27
+
28
+ Mount `ThemeProvider` (a client wrapper over `next-themes`, same props) and
29
+ `<Toaster />` in the root layout if you use dark mode or toasts. `next-themes`
30
+ is a peer dependency so the app and the toaster share one theme state.
31
+
32
+ ```tsx
33
+ // src/app/layout.tsx
34
+ import { ThemeProvider, Toaster } from '@cbrl/design'
35
+
36
+ ;<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
37
+ {children}
38
+ <Toaster />
39
+ </ThemeProvider>
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ```tsx
45
+ import { Button, Input, Label } from '@cbrl/design'
46
+ ```
47
+
48
+ Every client component ships with its `'use client'` directive, so the package
49
+ works from Server Components; the barrel itself is server-safe.
50
+
51
+ ### Icons and helpers
52
+
53
+ `WhatsappIcon` (`currentColor`) and `GoogleIcon` (multicolor "G") are
54
+ decorative by default; pass `title` to give them an accessible name. Size them
55
+ with a class (`className="size-4"`).
56
+
57
+ `initials(primary, fallback?)` derives avatar-fallback initials: the first
58
+ letters of the first two words, or the first two characters of a single word,
59
+ or `'?'`.
60
+
61
+ ```tsx
62
+ <AvatarFallback>{initials(user.name, user.email)}</AvatarFallback>
63
+ ```
64
+
65
+ ### App shell
66
+
67
+ `AppShell` renders the whole authenticated layout (collapsible sidebar with brand,
68
+ grouped navigation and footer, sticky header, content inset). Routing stays in
69
+ the app: you render each nav link, so the package never imports `next`.
70
+
71
+ ```tsx
72
+ 'use client'
73
+
74
+ import { AppShell as BaseAppShell, type NavSection } from '@cbrl/design'
75
+ import { LayoutDashboard } from 'lucide-react'
76
+ import Link from 'next/link'
77
+ import { usePathname } from 'next/navigation'
78
+
79
+ const SECTIONS: readonly NavSection[] = [
80
+ {
81
+ label: 'Operations',
82
+ items: [{ href: '/dashboard', label: 'Dashboard', icon: LayoutDashboard, match: 'prefix' }],
83
+ },
84
+ ]
85
+
86
+ export function AppShell({ children }: { children: React.ReactNode }) {
87
+ return (
88
+ <BaseAppShell
89
+ brand={<span className="text-base font-semibold">Acme</span>}
90
+ sections={SECTIONS}
91
+ pathname={usePathname()}
92
+ renderNavLink={(item, { onNavigate, children: content }) => (
93
+ <Link href={item.href} onClick={onNavigate}>
94
+ {content}
95
+ </Link>
96
+ )}
97
+ >
98
+ {children}
99
+ </BaseAppShell>
100
+ )
101
+ }
102
+ ```
103
+
104
+ The shell handles the `<nav aria-label>` landmark, the active item, closing the
105
+ mobile drawer and tooltips when collapsed. The sidebar primitives (`Sidebar`,
106
+ `SidebarProvider`, `SidebarMenu*`, `useSidebar`, …) are exported for custom shells.
107
+
108
+ ## Compatibility contract
109
+
110
+ Breaking changes ship only as major versions (minor while `0.x`). The public
111
+ contract is:
112
+
113
+ - **Exports** of the package entry (guarded by a surface snapshot test).
114
+ - **`data-slot` attributes**: apps target them to restyle components.
115
+ - **`cva` default variants**: changing a default restyles every app.
116
+ - **Props**: new props are optional and default to the current behavior.
117
+
118
+ ## Development
119
+
120
+ New components come from the shadcn CLI and must import Radix primitives from
121
+ `radix-ui`. Each component ships with a render test and an axe check
122
+ (`expectNoA11yViolations` from `@cbrl/testing/a11y`). `pnpm check:package` also
123
+ verifies that every `'use client'` module keeps its directive in `dist/`.
124
+
125
+ `src/shadcn.css` is vendored from shadcn (MIT) so consumers don't install the CLI.
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { AlertDialog as AlertDialog$1 } from "radix-ui";
3
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialog$1.Root>): React.JSX.Element;
4
+ declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialog$1.Trigger>): React.JSX.Element;
5
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialog$1.Portal>): React.JSX.Element;
6
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Overlay>): React.JSX.Element;
7
+ declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Content>): React.JSX.Element;
8
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
9
+ declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
10
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>): React.JSX.Element;
11
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>): React.JSX.Element;
12
+ declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Action>): React.JSX.Element;
13
+ declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Cancel>): React.JSX.Element;
14
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { buttonVariants } from "./button.js";
4
+ import "react";
5
+ import { AlertDialog as AlertDialog$1 } from "radix-ui";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/components/alert-dialog.tsx
8
+ function AlertDialog({ ...props }) {
9
+ return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
10
+ "data-slot": "alert-dialog",
11
+ ...props
12
+ });
13
+ }
14
+ function AlertDialogTrigger({ ...props }) {
15
+ return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
16
+ "data-slot": "alert-dialog-trigger",
17
+ ...props
18
+ });
19
+ }
20
+ function AlertDialogPortal({ ...props }) {
21
+ return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
22
+ "data-slot": "alert-dialog-portal",
23
+ ...props
24
+ });
25
+ }
26
+ function AlertDialogOverlay({ className, ...props }) {
27
+ return /* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
28
+ "data-slot": "alert-dialog-overlay",
29
+ className: cn("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs", className),
30
+ ...props
31
+ });
32
+ }
33
+ function AlertDialogContent({ className, ...props }) {
34
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
35
+ "data-slot": "alert-dialog-content",
36
+ className: cn("bg-popover text-popover-foreground ring-foreground/10 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 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 p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm", className),
37
+ ...props
38
+ })] });
39
+ }
40
+ function AlertDialogHeader({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "alert-dialog-header",
43
+ className: cn("flex flex-col gap-2", className),
44
+ ...props
45
+ });
46
+ }
47
+ function AlertDialogFooter({ className, ...props }) {
48
+ return /* @__PURE__ */ jsx("div", {
49
+ "data-slot": "alert-dialog-footer",
50
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
51
+ ...props
52
+ });
53
+ }
54
+ function AlertDialogTitle({ className, ...props }) {
55
+ return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
56
+ "data-slot": "alert-dialog-title",
57
+ className: cn("font-heading text-base leading-none font-medium", className),
58
+ ...props
59
+ });
60
+ }
61
+ function AlertDialogDescription({ className, ...props }) {
62
+ return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
63
+ "data-slot": "alert-dialog-description",
64
+ className: cn("text-muted-foreground text-sm", className),
65
+ ...props
66
+ });
67
+ }
68
+ function AlertDialogAction({ className, ...props }) {
69
+ return /* @__PURE__ */ jsx(AlertDialog$1.Action, {
70
+ "data-slot": "alert-dialog-action",
71
+ className: cn(buttonVariants({ variant: "destructive" }), className),
72
+ ...props
73
+ });
74
+ }
75
+ function AlertDialogCancel({ className, ...props }) {
76
+ return /* @__PURE__ */ jsx(AlertDialog$1.Cancel, {
77
+ "data-slot": "alert-dialog-cancel",
78
+ className: cn(buttonVariants({ variant: "outline" }), className),
79
+ ...props
80
+ });
81
+ }
82
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
@@ -0,0 +1,38 @@
1
+ import { NavItem, NavSection } from "../lib/nav.js";
2
+ import { Sidebar } from "./sidebar-core.js";
3
+ import "./sidebar.js";
4
+ import * as React from "react";
5
+ export type AppShellNavLink = (item: NavItem, props: {
6
+ onNavigate: () => void;
7
+ children: React.ReactNode;
8
+ }) => React.ReactNode;
9
+ export type AppShellProps = {
10
+ /** Brand block at the top of the sidebar (product/tenant name, logo). */
11
+ brand: React.ReactNode;
12
+ /** Nav sections, already filtered/resolved by the consumer (RBAC, signals…). */
13
+ sections: NavSection[];
14
+ /** Current pathname — drives the active nav highlight. */
15
+ pathname: string;
16
+ /** Renders the link element wrapping an item's icon+label (keeps routing out). */
17
+ renderNavLink: AppShellNavLink;
18
+ /** Sidebar footer — typically the account/user menu (wide trigger: avatar +
19
+ * identity + chevron). Lives at the bottom of the sidebar on `md+`. */
20
+ footer?: React.ReactNode;
21
+ /** Compact account menu for the mobile header. Below `md` the sidebar (and its
22
+ * `footer`) is off-canvas, so the account/Settings/Sign-out menu is otherwise
23
+ * unreachable without opening the nav sheet (#1374). This slot surfaces the
24
+ * SAME menu in the header — but as its COMPACT trigger (a bare avatar button),
25
+ * not the wide sidebar footer, which would overflow a phone header. Rendered
26
+ * `md:hidden`; on `md+` the sidebar `footer` owns the account menu. */
27
+ account?: React.ReactNode;
28
+ /** Left of the top header, after the trigger (e.g. a context switcher). */
29
+ headerStart?: React.ReactNode;
30
+ /** Right of the top header (e.g. notifications). */
31
+ headerEnd?: React.ReactNode;
32
+ /** Sidebar collapse behavior. Defaults to `icon`. */
33
+ collapsible?: React.ComponentProps<typeof Sidebar>['collapsible'];
34
+ /** Accessible label for the nav landmark. Defaults to `Navegação principal`. */
35
+ navLabel?: string;
36
+ children: React.ReactNode;
37
+ };
38
+ export declare function AppShell({ brand, sections, pathname, renderNavLink, footer, account, headerStart, headerEnd, collapsible, navLabel, children }: AppShellProps): React.JSX.Element;
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { isActive } from "../lib/nav.js";
3
+ import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInset, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar } from "./sidebar-core.js";
4
+ import { SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "./sidebar-menu.js";
5
+ import { TooltipProvider } from "./tooltip.js";
6
+ import "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/app-shell.tsx
9
+ function AppShell({ brand, sections, pathname, renderNavLink, footer, account, headerStart, headerEnd, collapsible = "icon", navLabel = "Navegação principal", children }) {
10
+ return /* @__PURE__ */ jsx(TooltipProvider, {
11
+ delayDuration: 0,
12
+ children: /* @__PURE__ */ jsxs(SidebarProvider, { children: [/* @__PURE__ */ jsxs(Sidebar, {
13
+ collapsible,
14
+ children: [
15
+ /* @__PURE__ */ jsx(SidebarHeader, { children: /* @__PURE__ */ jsx("div", {
16
+ className: "flex items-center gap-2 px-2 py-1.5",
17
+ children: brand
18
+ }) }),
19
+ /* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(ShellNav, {
20
+ sections,
21
+ pathname,
22
+ renderNavLink,
23
+ navLabel
24
+ }) }),
25
+ footer ? /* @__PURE__ */ jsx(SidebarFooter, { children: footer }) : null,
26
+ /* @__PURE__ */ jsx(SidebarRail, {})
27
+ ]
28
+ }), /* @__PURE__ */ jsxs(SidebarInset, { children: [/* @__PURE__ */ jsx(ShellHeader, {
29
+ account,
30
+ headerStart,
31
+ headerEnd
32
+ }), /* @__PURE__ */ jsx("div", {
33
+ "data-slot": "app-scroll",
34
+ className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
35
+ children
36
+ })] })] })
37
+ });
38
+ }
39
+ function ShellHeader({ account, headerStart, headerEnd }) {
40
+ const { isMobile } = useSidebar();
41
+ return /* @__PURE__ */ jsxs("header", {
42
+ className: "border-border bg-card/60 z-30 flex h-14 shrink-0 items-center gap-3 border-b px-4 backdrop-blur md:px-6",
43
+ children: [
44
+ /* @__PURE__ */ jsx(SidebarTrigger, {}),
45
+ headerStart,
46
+ /* @__PURE__ */ jsxs("div", {
47
+ className: "ml-auto flex items-center gap-2",
48
+ children: [account && isMobile ? /* @__PURE__ */ jsx("div", {
49
+ className: "flex items-center",
50
+ children: account
51
+ }) : null, headerEnd]
52
+ })
53
+ ]
54
+ });
55
+ }
56
+ function ShellNav({ sections, pathname, renderNavLink, navLabel }) {
57
+ const { setOpenMobile } = useSidebar();
58
+ const onNavigate = () => setOpenMobile(false);
59
+ return /* @__PURE__ */ jsx("nav", {
60
+ "aria-label": navLabel,
61
+ children: sections.map((section) => /* @__PURE__ */ jsxs(SidebarGroup, { children: [section.label ? /* @__PURE__ */ jsx(SidebarGroupLabel, { children: section.label }) : null, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: section.items.map((item) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
62
+ asChild: true,
63
+ isActive: isActive(item, pathname),
64
+ tooltip: item.label,
65
+ children: renderNavLink(item, {
66
+ onNavigate,
67
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(item.icon, {}), /* @__PURE__ */ jsx("span", { children: item.label })] })
68
+ })
69
+ }) }, item.href)) }) })] }, section.label))
70
+ });
71
+ }
72
+ export { AppShell };
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ type AuthSplitScreenProps = React.ComponentProps<'div'> & {
3
+ /**
4
+ * Decorative panel rendered beside the entry column from `md` up. Purely
5
+ * visual: it is `aria-hidden`, so it must never carry information needed to
6
+ * complete the flow. Omit it to render a plain single column at every width.
7
+ */
8
+ visual?: React.ReactNode;
9
+ };
10
+ /**
11
+ * Full-screen authentication layout: an entry column (brand, copy, providers)
12
+ * next to a decorative panel.
13
+ *
14
+ * The panel is gated by CSS (`hidden md:flex`), so `md` (768px) is where the
15
+ * split turns ON — below it the entry column stands alone, centered on both
16
+ * axes. Mind the direction: the breakpoint is the split's entry point, not its
17
+ * exit. Reading it as "hide on mobile" invites `md:hidden`, which blanks the
18
+ * panel at exactly the width it should appear. jsdom cannot evaluate media
19
+ * queries, so that direction is proven by the E2E specs that drive real 390px
20
+ * and 768px viewports — not by this package's unit tests.
21
+ *
22
+ * CSS rather than `useIsMobile()` on purpose. `app-shell` gates on the JS hook
23
+ * because regression #1374 showed that at the 768px boundary `window.innerWidth`
24
+ * and the CSS media query can disagree by a pixel — there, the mismatch could
25
+ * leave a phone with no account menu at all. Here the only thing on that seam is
26
+ * decoration, so the cheaper gate wins: no `'use client'`, no post-hydration
27
+ * flash of a panel that renders server-side from the first paint.
28
+ */
29
+ declare function AuthSplitScreen({ visual, children, className, ...props }: AuthSplitScreenProps): React.JSX.Element;
30
+ export { AuthSplitScreen, type AuthSplitScreenProps };
@@ -0,0 +1,45 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ // src/components/auth-split-screen.tsx
5
+ /**
6
+ * Full-screen authentication layout: an entry column (brand, copy, providers)
7
+ * next to a decorative panel.
8
+ *
9
+ * The panel is gated by CSS (`hidden md:flex`), so `md` (768px) is where the
10
+ * split turns ON — below it the entry column stands alone, centered on both
11
+ * axes. Mind the direction: the breakpoint is the split's entry point, not its
12
+ * exit. Reading it as "hide on mobile" invites `md:hidden`, which blanks the
13
+ * panel at exactly the width it should appear. jsdom cannot evaluate media
14
+ * queries, so that direction is proven by the E2E specs that drive real 390px
15
+ * and 768px viewports — not by this package's unit tests.
16
+ *
17
+ * CSS rather than `useIsMobile()` on purpose. `app-shell` gates on the JS hook
18
+ * because regression #1374 showed that at the 768px boundary `window.innerWidth`
19
+ * and the CSS media query can disagree by a pixel — there, the mismatch could
20
+ * leave a phone with no account menu at all. Here the only thing on that seam is
21
+ * decoration, so the cheaper gate wins: no `'use client'`, no post-hydration
22
+ * flash of a panel that renders server-side from the first paint.
23
+ */
24
+ function AuthSplitScreen({ visual, children, className, ...props }) {
25
+ return /* @__PURE__ */ jsxs("div", {
26
+ "data-slot": "auth-split-screen",
27
+ className: cn("flex min-h-dvh w-full", className),
28
+ ...props,
29
+ children: [/* @__PURE__ */ jsx("main", {
30
+ "data-slot": "auth-split-screen-content",
31
+ className: "flex min-h-dvh w-full flex-col items-center justify-center overflow-y-auto px-6 py-12 md:w-1/2",
32
+ children: /* @__PURE__ */ jsx("div", {
33
+ className: "w-full max-w-sm",
34
+ children
35
+ })
36
+ }), visual ? /* @__PURE__ */ jsx("div", {
37
+ "data-slot": "auth-split-screen-visual",
38
+ "data-visible-from": "md",
39
+ "aria-hidden": "true",
40
+ className: "bg-muted relative hidden min-h-dvh w-1/2 overflow-hidden md:flex md:items-center md:justify-center",
41
+ children: visual
42
+ }) : null]
43
+ });
44
+ }
45
+ export { AuthSplitScreen };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { Avatar as Avatar$1 } from "radix-ui";
3
+ declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof Avatar$1.Root> & {
4
+ size?: 'default' | 'sm' | 'lg';
5
+ }): React.JSX.Element;
6
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>): React.JSX.Element;
7
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>): 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, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import "react";
4
+ import { Avatar as Avatar$1 } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/components/avatar.tsx
7
+ function Avatar({ className, size = "default", ...props }) {
8
+ return /* @__PURE__ */ jsx(Avatar$1.Root, {
9
+ "data-slot": "avatar",
10
+ "data-size": size,
11
+ className: cn("group/avatar after:border-border relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className),
12
+ ...props
13
+ });
14
+ }
15
+ function AvatarImage({ className, ...props }) {
16
+ return /* @__PURE__ */ jsx(Avatar$1.Image, {
17
+ "data-slot": "avatar-image",
18
+ className: cn("aspect-square size-full rounded-full object-cover", className),
19
+ ...props
20
+ });
21
+ }
22
+ function AvatarFallback({ className, ...props }) {
23
+ return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
24
+ "data-slot": "avatar-fallback",
25
+ className: cn("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs", className),
26
+ ...props
27
+ });
28
+ }
29
+ function AvatarBadge({ className, ...props }) {
30
+ return /* @__PURE__ */ jsx("span", {
31
+ "data-slot": "avatar-badge",
32
+ className: cn("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 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),
33
+ ...props
34
+ });
35
+ }
36
+ function AvatarGroup({ className, ...props }) {
37
+ return /* @__PURE__ */ jsx("div", {
38
+ "data-slot": "avatar-group",
39
+ className: cn("group/avatar-group *:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2", className),
40
+ ...props
41
+ });
42
+ }
43
+ function AvatarGroupCount({ className, ...props }) {
44
+ return /* @__PURE__ */ jsx("div", {
45
+ "data-slot": "avatar-group-count",
46
+ className: cn("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 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),
47
+ ...props
48
+ });
49
+ }
50
+ export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): React.JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,27 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { Slot } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/components/badge.tsx
7
+ const badgeVariants = cva("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 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:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!", {
8
+ variants: { variant: {
9
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
10
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
11
+ 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",
12
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
13
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
14
+ link: "text-primary underline-offset-4 hover:underline"
15
+ } },
16
+ defaultVariants: { variant: "default" }
17
+ });
18
+ function Badge({ className, variant = "default", asChild = false, ...props }) {
19
+ const Comp = asChild ? Slot.Root : "span";
20
+ return /* @__PURE__ */ jsx(Comp, {
21
+ "data-slot": "badge",
22
+ "data-variant": variant,
23
+ className: cn(badgeVariants({ variant }), className),
24
+ ...props
25
+ });
26
+ }
27
+ export { Badge, badgeVariants };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
3
+ declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
4
+ declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
5
+ declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<'a'> & {
6
+ asChild?: boolean;
7
+ }): React.JSX.Element;
8
+ declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
9
+ declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
10
+ declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
11
+ export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
@@ -0,0 +1,69 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import "react";
3
+ import { Slot } from "radix-ui";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
6
+ // src/components/breadcrumb.tsx
7
+ function Breadcrumb({ ...props }) {
8
+ return /* @__PURE__ */ jsx("nav", {
9
+ "aria-label": "breadcrumb",
10
+ "data-slot": "breadcrumb",
11
+ ...props
12
+ });
13
+ }
14
+ function BreadcrumbList({ className, ...props }) {
15
+ return /* @__PURE__ */ jsx("ol", {
16
+ "data-slot": "breadcrumb-list",
17
+ className: cn("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5", className),
18
+ ...props
19
+ });
20
+ }
21
+ function BreadcrumbItem({ className, ...props }) {
22
+ return /* @__PURE__ */ jsx("li", {
23
+ "data-slot": "breadcrumb-item",
24
+ className: cn("inline-flex items-center gap-1.5", className),
25
+ ...props
26
+ });
27
+ }
28
+ function BreadcrumbLink({ asChild, className, ...props }) {
29
+ const Comp = asChild ? Slot.Root : "a";
30
+ return /* @__PURE__ */ jsx(Comp, {
31
+ "data-slot": "breadcrumb-link",
32
+ className: cn("hover:text-foreground transition-colors", className),
33
+ ...props
34
+ });
35
+ }
36
+ function BreadcrumbPage({ className, ...props }) {
37
+ return /* @__PURE__ */ jsx("span", {
38
+ "data-slot": "breadcrumb-page",
39
+ role: "link",
40
+ "aria-disabled": "true",
41
+ "aria-current": "page",
42
+ className: cn("text-foreground font-normal", className),
43
+ ...props
44
+ });
45
+ }
46
+ function BreadcrumbSeparator({ children, className, ...props }) {
47
+ return /* @__PURE__ */ jsx("li", {
48
+ "data-slot": "breadcrumb-separator",
49
+ role: "presentation",
50
+ "aria-hidden": "true",
51
+ className: cn("[&>svg]:size-3.5", className),
52
+ ...props,
53
+ children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
54
+ });
55
+ }
56
+ function BreadcrumbEllipsis({ className, ...props }) {
57
+ return /* @__PURE__ */ jsxs("span", {
58
+ "data-slot": "breadcrumb-ellipsis",
59
+ role: "presentation",
60
+ "aria-hidden": "true",
61
+ className: cn("flex size-9 items-center justify-center", className),
62
+ ...props,
63
+ children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
64
+ className: "sr-only",
65
+ children: "More"
66
+ })]
67
+ });
68
+ }
69
+ export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | 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, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): React.JSX.Element;
10
+ export { Button, buttonVariants };