@octanejs/shadcn 0.0.1

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/package.json +63 -0
  4. package/src/hooks/use-mobile.ts +23 -0
  5. package/src/index.ts +263 -0
  6. package/src/lib/types.ts +10 -0
  7. package/src/lib/utils.ts +8 -0
  8. package/src/styles/theme.css +104 -0
  9. package/src/ui/accordion.tsrx +72 -0
  10. package/src/ui/alert-dialog.tsrx +161 -0
  11. package/src/ui/alert.tsrx +69 -0
  12. package/src/ui/aspect-ratio.tsrx +10 -0
  13. package/src/ui/avatar.tsrx +79 -0
  14. package/src/ui/badge.tsrx +50 -0
  15. package/src/ui/breadcrumb.tsrx +89 -0
  16. package/src/ui/button.tsrx +71 -0
  17. package/src/ui/card.tsrx +75 -0
  18. package/src/ui/checkbox.tsrx +31 -0
  19. package/src/ui/collapsible.tsrx +21 -0
  20. package/src/ui/context-menu.tsrx +179 -0
  21. package/src/ui/dialog.tsrx +133 -0
  22. package/src/ui/dropdown-menu.tsrx +189 -0
  23. package/src/ui/empty.tsrx +86 -0
  24. package/src/ui/field.tsrx +188 -0
  25. package/src/ui/hover-card.tsrx +48 -0
  26. package/src/ui/input.tsrx +18 -0
  27. package/src/ui/item.tsrx +171 -0
  28. package/src/ui/kbd.tsrx +26 -0
  29. package/src/ui/label.tsrx +21 -0
  30. package/src/ui/menubar.tsrx +198 -0
  31. package/src/ui/native-select.tsrx +55 -0
  32. package/src/ui/navigation-menu.tsrx +116 -0
  33. package/src/ui/pagination.tsrx +113 -0
  34. package/src/ui/popover.tsrx +73 -0
  35. package/src/ui/progress.tsrx +27 -0
  36. package/src/ui/radio-group.tsrx +37 -0
  37. package/src/ui/scroll-area.tsrx +43 -0
  38. package/src/ui/select.tsrx +165 -0
  39. package/src/ui/separator.tsrx +30 -0
  40. package/src/ui/sheet.tsrx +114 -0
  41. package/src/ui/sidebar.tsrx +661 -0
  42. package/src/ui/skeleton.tsrx +14 -0
  43. package/src/ui/slider.tsrx +69 -0
  44. package/src/ui/sonner.tsrx +45 -0
  45. package/src/ui/spinner.tsrx +23 -0
  46. package/src/ui/switch.tsrx +30 -0
  47. package/src/ui/table.tsrx +80 -0
  48. package/src/ui/tabs.tsrx +69 -0
  49. package/src/ui/textarea.tsrx +20 -0
  50. package/src/ui/toggle-group.tsrx +100 -0
  51. package/src/ui/toggle.tsrx +47 -0
  52. package/src/ui/tooltip.tsrx +65 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dominic Gannaway
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 ADDED
@@ -0,0 +1,43 @@
1
+ # @octanejs/shadcn
2
+
3
+ shadcn/ui for the [octane](https://github.com/octanejs/octane) renderer — a port
4
+ of the **Radix base** of [shadcn-ui/ui](https://github.com/shadcn-ui/ui) onto
5
+ octane's hooks and native events, built on
6
+ [`@octanejs/radix`](../radix).
7
+
8
+ Upstream pin: `shadcn-ui/ui@4baadbc6` + CLI `shadcn@4.14.1`.
9
+
10
+ ## What ships
11
+
12
+ - **40 component families (~185 exports)**: the full Tier-1 static set, all 24
13
+ radix-backed Tier-2 components, and the first Tier-3 composites (Sidebar with
14
+ `useSidebar`/`useIsMobile`, Field), plus `cn()` and the default neutral theme
15
+ tokens (`@octanejs/shadcn/theme.css`).
16
+ - **Two consumption modes**: import from the package entry, or install
17
+ components AS SOURCE with the upstream shadcn CLI against the generated
18
+ registry (`registry/`, 47 items — `pnpm registry:build` / `registry:check`).
19
+ - **Styling flavors**: components are migrating to the default-Tailwind
20
+ (utilities-inlined) flavor — class strings work against any Tailwind v4 build
21
+ with the shadcn theme tokens. The not-yet-migrated families still carry the
22
+ upstream `cn-*` semantic hooks and need a shadcn style sheet (e.g.
23
+ `style-nova`). `status.json` lists exactly which families are which.
24
+
25
+ ```tsx
26
+ import { Button, Dialog, Tabs } from '@octanejs/shadcn';
27
+ import '@octanejs/shadcn/theme.css';
28
+ ```
29
+
30
+ Octane adaptations are uniform and documented per file: no `"use client"`,
31
+ refs as props, native events (`onInput` per keystroke), `asChild` and Portal
32
+ children composed as element descriptors, and children forwarding through the
33
+ compiler's `{props.children}` lowering.
34
+
35
+ ## Evidence
36
+
37
+ Behavioral (jsdom), SSR, hydration-adoption, and differential suites — the
38
+ differential rig byte-compares fixtures against the vendored pinned upstream
39
+ React sources running real `radix-ui`. The full ledger (supported surface,
40
+ divergences, SSR status, flavor migration state) lives in
41
+ [status.json](./status.json) and the generated
42
+ [bindings status table](../../docs/bindings-status.md); scope and phase history
43
+ in [docs/shadcn-port-plan.md](../../docs/shadcn-port-plan.md).
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@octanejs/shadcn",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=22"
8
+ },
9
+ "description": "shadcn/ui for the octane renderer — the Radix-base shadcn component distribution ported onto octane: cva-variant components preserving the upstream data-slot/class contract, built on @octanejs/radix, published as importable source with a shadcn-CLI-compatible registry planned.",
10
+ "author": {
11
+ "name": "Dominic Gannaway",
12
+ "email": "dg@domgan.com"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/octanejs/octane.git",
20
+ "directory": "packages/shadcn"
21
+ },
22
+ "main": "src/index.ts",
23
+ "module": "src/index.ts",
24
+ "types": "src/index.ts",
25
+ "files": [
26
+ "src",
27
+ "README.md"
28
+ ],
29
+ "sideEffects": [
30
+ "./src/styles/theme.css"
31
+ ],
32
+ "exports": {
33
+ ".": "./src/index.ts",
34
+ "./theme.css": "./src/styles/theme.css"
35
+ },
36
+ "dependencies": {
37
+ "@octanejs/lucide": "0.1.8",
38
+ "@octanejs/radix": "0.1.12",
39
+ "@octanejs/sonner": "0.1.8",
40
+ "class-variance-authority": "0.7.1",
41
+ "clsx": "^2.1.1",
42
+ "tailwind-merge": "3.6.0"
43
+ },
44
+ "peerDependencies": {
45
+ "octane": "0.1.16"
46
+ },
47
+ "devDependencies": {
48
+ "@tsrx/react": "^0.2.50",
49
+ "esbuild": "^0.28.1",
50
+ "lucide-react": "1.24.0",
51
+ "radix-ui": "^1.6.4",
52
+ "react": "^19.2.7",
53
+ "react-dom": "^19.2.7",
54
+ "vitest": "^4.1.10",
55
+ "octane": "0.1.16"
56
+ },
57
+ "scripts": {
58
+ "test": "vitest run",
59
+ "registry:build": "node scripts/build-registry.mjs",
60
+ "registry:check": "node scripts/build-registry.mjs --check",
61
+ "typecheck": "node scripts/typecheck.mjs"
62
+ }
63
+ }
@@ -0,0 +1,23 @@
1
+ // Ported from shadcn-ui/ui@4baadbc6517070ae8f8feb2c97037adc2b305544
2
+ // apps/v4/registry/bases/radix/hooks/use-mobile.ts. React hooks map onto
3
+ // octane's; the explicit `[]` dependency array is retained from upstream
4
+ // (subscribe once on mount). SSR-safe: `window` is only touched in the effect.
5
+ import { useEffect, useState } from 'octane';
6
+
7
+ const MOBILE_BREAKPOINT = 768;
8
+
9
+ export function useIsMobile() {
10
+ const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined);
11
+
12
+ useEffect(() => {
13
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
14
+ const onChange = () => {
15
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
16
+ };
17
+ mql.addEventListener('change', onChange);
18
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
19
+ return () => mql.removeEventListener('change', onChange);
20
+ }, []);
21
+
22
+ return !!isMobile;
23
+ }
package/src/index.ts ADDED
@@ -0,0 +1,263 @@
1
+ // @octanejs/shadcn — shadcn/ui (Radix base) for the octane renderer.
2
+ //
3
+ // Upstream pin: shadcn-ui/ui@4baadbc6517070ae8f8feb2c97037adc2b305544 (main,
4
+ // 2026-07-24) + CLI shadcn@4.14.1. Components are authored in `.tsrx` so the
5
+ // octane compiler owns templates and hook slots; the cva variant maps, class
6
+ // strings, and data-slot attributes are preserved byte-for-byte from the
7
+ // pinned upstream sources (the public styling contract). See
8
+ // docs/shadcn-port-plan.md.
9
+ export { cn } from './lib/utils';
10
+
11
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './ui/accordion.tsrx';
12
+ export { Alert, AlertTitle, AlertDescription, AlertAction, alertVariants } from './ui/alert.tsrx';
13
+ export {
14
+ AlertDialog,
15
+ AlertDialogAction,
16
+ AlertDialogCancel,
17
+ AlertDialogContent,
18
+ AlertDialogDescription,
19
+ AlertDialogFooter,
20
+ AlertDialogHeader,
21
+ AlertDialogMedia,
22
+ AlertDialogOverlay,
23
+ AlertDialogPortal,
24
+ AlertDialogTitle,
25
+ AlertDialogTrigger,
26
+ } from './ui/alert-dialog.tsrx';
27
+ export { AspectRatio } from './ui/aspect-ratio.tsrx';
28
+ export {
29
+ Avatar,
30
+ AvatarImage,
31
+ AvatarFallback,
32
+ AvatarBadge,
33
+ AvatarGroup,
34
+ AvatarGroupCount,
35
+ } from './ui/avatar.tsrx';
36
+ export { Badge, badgeVariants, type BadgeProps } from './ui/badge.tsrx';
37
+ export {
38
+ Breadcrumb,
39
+ BreadcrumbList,
40
+ BreadcrumbItem,
41
+ BreadcrumbLink,
42
+ BreadcrumbPage,
43
+ BreadcrumbSeparator,
44
+ BreadcrumbEllipsis,
45
+ } from './ui/breadcrumb.tsrx';
46
+ export { Button, buttonVariants, type ButtonProps } from './ui/button.tsrx';
47
+ export { Checkbox } from './ui/checkbox.tsrx';
48
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible.tsrx';
49
+ export {
50
+ ContextMenu,
51
+ ContextMenuTrigger,
52
+ ContextMenuContent,
53
+ ContextMenuItem,
54
+ ContextMenuCheckboxItem,
55
+ ContextMenuRadioItem,
56
+ ContextMenuLabel,
57
+ ContextMenuSeparator,
58
+ ContextMenuShortcut,
59
+ ContextMenuGroup,
60
+ ContextMenuPortal,
61
+ ContextMenuSub,
62
+ ContextMenuSubContent,
63
+ ContextMenuSubTrigger,
64
+ ContextMenuRadioGroup,
65
+ } from './ui/context-menu.tsrx';
66
+ export {
67
+ Dialog,
68
+ DialogClose,
69
+ DialogContent,
70
+ DialogDescription,
71
+ DialogFooter,
72
+ DialogHeader,
73
+ DialogOverlay,
74
+ DialogPortal,
75
+ DialogTitle,
76
+ DialogTrigger,
77
+ } from './ui/dialog.tsrx';
78
+ export {
79
+ DropdownMenu,
80
+ DropdownMenuPortal,
81
+ DropdownMenuTrigger,
82
+ DropdownMenuContent,
83
+ DropdownMenuGroup,
84
+ DropdownMenuLabel,
85
+ DropdownMenuItem,
86
+ DropdownMenuCheckboxItem,
87
+ DropdownMenuRadioGroup,
88
+ DropdownMenuRadioItem,
89
+ DropdownMenuSeparator,
90
+ DropdownMenuShortcut,
91
+ DropdownMenuSub,
92
+ DropdownMenuSubTrigger,
93
+ DropdownMenuSubContent,
94
+ } from './ui/dropdown-menu.tsrx';
95
+ export {
96
+ Card,
97
+ CardHeader,
98
+ CardFooter,
99
+ CardTitle,
100
+ CardAction,
101
+ CardDescription,
102
+ CardContent,
103
+ } from './ui/card.tsrx';
104
+ export {
105
+ Empty,
106
+ EmptyHeader,
107
+ EmptyTitle,
108
+ EmptyDescription,
109
+ EmptyContent,
110
+ EmptyMedia,
111
+ emptyMediaVariants,
112
+ } from './ui/empty.tsrx';
113
+ export {
114
+ Field,
115
+ FieldContent,
116
+ FieldDescription,
117
+ FieldError,
118
+ FieldGroup,
119
+ FieldLabel,
120
+ FieldLegend,
121
+ FieldSeparator,
122
+ FieldSet,
123
+ FieldTitle,
124
+ } from './ui/field.tsrx';
125
+ export { HoverCard, HoverCardTrigger, HoverCardContent } from './ui/hover-card.tsrx';
126
+ export { useIsMobile } from './hooks/use-mobile';
127
+ export { Input, type InputProps } from './ui/input.tsrx';
128
+ export {
129
+ Item,
130
+ ItemMedia,
131
+ ItemContent,
132
+ ItemActions,
133
+ ItemGroup,
134
+ ItemSeparator,
135
+ ItemTitle,
136
+ ItemDescription,
137
+ ItemHeader,
138
+ ItemFooter,
139
+ itemVariants,
140
+ itemMediaVariants,
141
+ } from './ui/item.tsrx';
142
+ export { Kbd, KbdGroup } from './ui/kbd.tsrx';
143
+ export { Label } from './ui/label.tsrx';
144
+ export {
145
+ Menubar,
146
+ MenubarPortal,
147
+ MenubarMenu,
148
+ MenubarTrigger,
149
+ MenubarContent,
150
+ MenubarGroup,
151
+ MenubarSeparator,
152
+ MenubarLabel,
153
+ MenubarItem,
154
+ MenubarShortcut,
155
+ MenubarCheckboxItem,
156
+ MenubarRadioGroup,
157
+ MenubarRadioItem,
158
+ MenubarSub,
159
+ MenubarSubTrigger,
160
+ MenubarSubContent,
161
+ } from './ui/menubar.tsrx';
162
+ export { NativeSelect, NativeSelectOption, NativeSelectOptGroup } from './ui/native-select.tsrx';
163
+ export {
164
+ NavigationMenu,
165
+ NavigationMenuList,
166
+ NavigationMenuItem,
167
+ NavigationMenuContent,
168
+ NavigationMenuTrigger,
169
+ NavigationMenuLink,
170
+ NavigationMenuIndicator,
171
+ NavigationMenuViewport,
172
+ navigationMenuTriggerStyle,
173
+ } from './ui/navigation-menu.tsrx';
174
+ export {
175
+ Pagination,
176
+ PaginationContent,
177
+ PaginationEllipsis,
178
+ PaginationItem,
179
+ PaginationLink,
180
+ PaginationNext,
181
+ PaginationPrevious,
182
+ } from './ui/pagination.tsrx';
183
+ export {
184
+ Popover,
185
+ PopoverAnchor,
186
+ PopoverContent,
187
+ PopoverDescription,
188
+ PopoverHeader,
189
+ PopoverTitle,
190
+ PopoverTrigger,
191
+ } from './ui/popover.tsrx';
192
+ export { Progress } from './ui/progress.tsrx';
193
+ export { RadioGroup, RadioGroupItem } from './ui/radio-group.tsrx';
194
+ export { ScrollArea, ScrollBar } from './ui/scroll-area.tsrx';
195
+ export {
196
+ Select,
197
+ SelectContent,
198
+ SelectGroup,
199
+ SelectItem,
200
+ SelectLabel,
201
+ SelectScrollDownButton,
202
+ SelectScrollUpButton,
203
+ SelectSeparator,
204
+ SelectTrigger,
205
+ SelectValue,
206
+ } from './ui/select.tsrx';
207
+ export { Separator } from './ui/separator.tsrx';
208
+ export {
209
+ Sheet,
210
+ SheetTrigger,
211
+ SheetClose,
212
+ SheetContent,
213
+ SheetHeader,
214
+ SheetFooter,
215
+ SheetTitle,
216
+ SheetDescription,
217
+ } from './ui/sheet.tsrx';
218
+ export {
219
+ Sidebar,
220
+ SidebarContent,
221
+ SidebarFooter,
222
+ SidebarGroup,
223
+ SidebarGroupAction,
224
+ SidebarGroupContent,
225
+ SidebarGroupLabel,
226
+ SidebarHeader,
227
+ SidebarInput,
228
+ SidebarInset,
229
+ SidebarMenu,
230
+ SidebarMenuAction,
231
+ SidebarMenuBadge,
232
+ SidebarMenuButton,
233
+ SidebarMenuItem,
234
+ SidebarMenuSkeleton,
235
+ SidebarMenuSub,
236
+ SidebarMenuSubButton,
237
+ SidebarMenuSubItem,
238
+ SidebarProvider,
239
+ SidebarRail,
240
+ SidebarSeparator,
241
+ SidebarTrigger,
242
+ useSidebar,
243
+ } from './ui/sidebar.tsrx';
244
+ export { Slider } from './ui/slider.tsrx';
245
+ export { Skeleton } from './ui/skeleton.tsrx';
246
+ export { Toaster } from './ui/sonner.tsrx';
247
+ export { Spinner } from './ui/spinner.tsrx';
248
+ export { Switch } from './ui/switch.tsrx';
249
+ export {
250
+ Table,
251
+ TableHeader,
252
+ TableBody,
253
+ TableFooter,
254
+ TableHead,
255
+ TableRow,
256
+ TableCell,
257
+ TableCaption,
258
+ } from './ui/table.tsrx';
259
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants } from './ui/tabs.tsrx';
260
+ export { Textarea } from './ui/textarea.tsrx';
261
+ export { Toggle, toggleVariants } from './ui/toggle.tsrx';
262
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip.tsrx';
263
+ export { ToggleGroup, ToggleGroupItem } from './ui/toggle-group.tsrx';
@@ -0,0 +1,10 @@
1
+ // Host-element prop bases for the ported components. Octane exposes the same
2
+ // per-tag prop tables React does (`JSX.IntrinsicElements`), so a component that
3
+ // spreads onto a `<button>` types its rest props as that tag's real props —
4
+ // misspellings and wrong-typed handlers are caught at the call site.
5
+ import type { JSX } from 'octane/jsx-runtime';
6
+
7
+ export type HostProps<T extends keyof JSX.IntrinsicElements> = JSX.IntrinsicElements[T];
8
+
9
+ /** Props for a component whose host is a `<div>` (the common wrapper shape). */
10
+ export type DivProps = HostProps<'div'>;
@@ -0,0 +1,8 @@
1
+ // Ported from shadcn-ui/ui@4baadbc6517070ae8f8feb2c97037adc2b305544
2
+ // apps/v4/registry/bases/radix/lib/utils.ts — unchanged (framework-free).
3
+ import { clsx, type ClassValue } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+
6
+ export function cn(...inputs: ClassValue[]) {
7
+ return twMerge(clsx(inputs));
8
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * shadcn default theme tokens (neutral base color) for octane apps.
3
+ * Ported from shadcn-ui/ui@4baadbc6517070ae8f8feb2c97037adc2b305544
4
+ * apps/v4/app/globals.css (:root / .dark blocks) — values unchanged; the
5
+ * site-only tokens (--surface, --code-*, --selection*) and the Tailwind-scale
6
+ * chart references are omitted: --chart-1..5 get concrete oklch values here
7
+ * because this file must stand alone without a Tailwind build.
8
+ *
9
+ * Dark mode follows the upstream contract: a `.dark` class on an ancestor
10
+ * overrides the same custom properties.
11
+ */
12
+ :root {
13
+ --radius: 0.625rem;
14
+ --background: oklch(1 0 0);
15
+ --foreground: oklch(0% 0 0);
16
+ --card: oklch(1 0 0);
17
+ --card-foreground: oklch(0% 0 0);
18
+ --popover: oklch(1 0 0);
19
+ --popover-foreground: oklch(0% 0 0);
20
+ --primary: oklch(0% 0 0);
21
+ --primary-foreground: oklch(0.985 0 0);
22
+ --secondary: oklch(0.97 0 0);
23
+ --secondary-foreground: oklch(0.205 0 0);
24
+ --muted: oklch(0.97 0 0);
25
+ --muted-foreground: oklch(0.556 0 0);
26
+ --accent: oklch(0.97 0 0);
27
+ --accent-foreground: oklch(0.205 0 0);
28
+ --destructive: oklch(0.577 0.245 27.325);
29
+ --destructive-foreground: oklch(0.97 0.01 17);
30
+ --border: oklch(0.922 0 0);
31
+ --input: oklch(0.922 0 0);
32
+ --ring: oklch(0.708 0 0);
33
+ --chart-1: oklch(0.809 0.096 251.813);
34
+ --chart-2: oklch(0.623 0.214 259.815);
35
+ --chart-3: oklch(0.546 0.245 262.881);
36
+ --chart-4: oklch(0.488 0.243 264.376);
37
+ --chart-5: oklch(0.424 0.199 265.638);
38
+ --sidebar: oklch(0.985 0 0);
39
+ --sidebar-foreground: oklch(0% 0 0);
40
+ --sidebar-primary: oklch(0.205 0 0);
41
+ --sidebar-primary-foreground: oklch(0.985 0 0);
42
+ --sidebar-accent: oklch(0.97 0 0);
43
+ --sidebar-accent-foreground: oklch(0.205 0 0);
44
+ --sidebar-border: oklch(0.922 0 0);
45
+ --sidebar-ring: oklch(0.708 0 0);
46
+ }
47
+
48
+ .dark {
49
+ --background: oklch(0.145 0 0);
50
+ --foreground: oklch(0.985 0 0);
51
+ --card: oklch(0.205 0 0);
52
+ --card-foreground: oklch(0.985 0 0);
53
+ --popover: oklch(0.205 0 0);
54
+ --popover-foreground: oklch(0.985 0 0);
55
+ --primary: oklch(0.922 0 0);
56
+ --primary-foreground: oklch(0.205 0 0);
57
+ --secondary: oklch(0.269 0 0);
58
+ --secondary-foreground: oklch(0.985 0 0);
59
+ --muted: oklch(0.269 0 0);
60
+ --muted-foreground: oklch(0.708 0 0);
61
+ --accent: oklch(0.371 0 0);
62
+ --accent-foreground: oklch(0.985 0 0);
63
+ --destructive: oklch(0.704 0.191 22.216);
64
+ --destructive-foreground: oklch(0.58 0.22 27);
65
+ --border: oklch(1 0 0 / 10%);
66
+ --input: oklch(1 0 0 / 15%);
67
+ --ring: oklch(0.556 0 0);
68
+ --chart-1: oklch(0.809 0.096 251.813);
69
+ --chart-2: oklch(0.623 0.214 259.815);
70
+ --chart-3: oklch(0.546 0.245 262.881);
71
+ --chart-4: oklch(0.488 0.243 264.376);
72
+ --chart-5: oklch(0.424 0.199 265.638);
73
+ --sidebar: oklch(0.205 0 0);
74
+ --sidebar-foreground: oklch(0.985 0 0);
75
+ --sidebar-primary: oklch(0.488 0.243 264.376);
76
+ --sidebar-primary-foreground: oklch(0.985 0 0);
77
+ --sidebar-accent: oklch(0.269 0 0);
78
+ --sidebar-accent-foreground: oklch(0.985 0 0);
79
+ --sidebar-border: oklch(1 0 0 / 10%);
80
+ --sidebar-ring: oklch(0.439 0 0);
81
+ }
82
+
83
+ /*
84
+ * The three semantic hooks that survive in otherwise utilities-inlined
85
+ * components, because they appear verbatim in the upstream sources: upstream
86
+ * defines them in its style layer, so a package that ships those class strings
87
+ * must ship their definitions too or they are inert. Kept framework-free (no
88
+ * Tailwind @apply) so this file stands alone.
89
+ */
90
+ .cn-font-heading {
91
+ font-family: var(--font-heading, inherit);
92
+ }
93
+
94
+ /* Directional icons (chevrons, arrows) mirror in RTL. */
95
+ [dir='rtl'] .cn-rtl-flip {
96
+ transform: scaleX(-1);
97
+ }
98
+
99
+ /* Sonner's toast host: the Toaster wrapper tags every toast with this class so
100
+ * consumers have one stable selector; the toast's own visual styling comes
101
+ * from sonner and the theme tokens above. */
102
+ .cn-toast {
103
+ border-radius: calc(var(--radius) * 0.8);
104
+ }
@@ -0,0 +1,72 @@
1
+ // App-owned accordion (the shadcn registry-mode ownership model): a custom
2
+ // utilities-inlined flavor. Octane adaptations from the shared React source:
3
+ // "use client" dropped, lucide-react → @octanejs/lucide, radix-ui →
4
+ // @octanejs/radix. Children forwarding uses the compiler's `{props.children}`
5
+ // lowering (the syntactic form is load-bearing — a destructured `children`
6
+ // local is not recognized as a forwardable hole), so the markup reads exactly
7
+ // like the React source.
8
+ import { Accordion as AccordionPrimitive } from '@octanejs/radix';
9
+ import { ChevronDownIcon, ChevronUpIcon } from '@octanejs/lucide';
10
+ import type { OctaneNode } from 'octane';
11
+
12
+ import { cn } from '../lib/utils';
13
+
14
+ type Props = { className?: string; children?: OctaneNode } & Record<string, unknown>;
15
+
16
+ export function Accordion({ className, ...props }: Props) @{
17
+ <AccordionPrimitive.Root
18
+ data-slot="accordion"
19
+ className={cn('flex w-full flex-col', className)}
20
+ {...props}
21
+ />
22
+ }
23
+
24
+ export function AccordionItem({ className, ...props }: Props) @{
25
+ <AccordionPrimitive.Item
26
+ data-slot="accordion-item"
27
+ className={cn('not-last:border-b', className)}
28
+ {...props}
29
+ />
30
+ }
31
+
32
+ export function AccordionTrigger(props: Props) @{
33
+ const { className, children: _children, ...rest } = props;
34
+
35
+ <AccordionPrimitive.Header className="flex">
36
+ <AccordionPrimitive.Trigger
37
+ data-slot="accordion-trigger"
38
+ className={cn(
39
+ 'group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground',
40
+ className,
41
+ )}
42
+ {...rest}
43
+ >
44
+ {props.children}
45
+ <ChevronDownIcon
46
+ data-slot="accordion-trigger-icon"
47
+ className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
48
+ />
49
+ <ChevronUpIcon
50
+ data-slot="accordion-trigger-icon"
51
+ className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
52
+ />
53
+ </AccordionPrimitive.Trigger>
54
+ </AccordionPrimitive.Header>
55
+ }
56
+
57
+ export function AccordionContent(props: Props) @{
58
+ const { className, children: _children, ...rest } = props;
59
+
60
+ <AccordionPrimitive.Content
61
+ data-slot="accordion-content"
62
+ className="overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
63
+ {...rest}
64
+ >
65
+ <div
66
+ className={cn(
67
+ 'h-(--radix-accordion-content-height) pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4',
68
+ className,
69
+ )}
70
+ >{props.children}</div>
71
+ </AccordionPrimitive.Content>
72
+ }