Commit 35ef4c9
committed
feat(dashboard/contract/shell): swap shadcn primitives from Radix to Base UI
Per directive: 'use sadcn baseui and not radix.' shadcn ships parallel
Radix-based and Base UI-based variants of the same components. This
slice swaps the dashboard shell to the Base UI variant
(@base-ui-components/react). Public component imports (@/components/ui/*)
and the v1 vocabulary are unchanged; only the primitive layer
underneath shifted.
Removed: @radix-ui/react-{slot,separator,dropdown-menu,dialog,avatar,
scroll-area,select,checkbox,label,alert-dialog}.
Added: @base-ui-components/react@1.0.0-rc.0.
Rewrites in src/components/ui/ — public component names and prop
shapes preserved by the wrappers:
- button.tsx — local Slot helper for asChild (Base UI has no Slot
primitive; uses render prop instead).
- separator.tsx — Base UI Separator.
- avatar.tsx — Avatar.Root / .Image / .Fallback.
- dropdown-menu.tsx — Menu façade (Base UI calls it Menu, not
DropdownMenu). Trigger wrapper translates asChild → render.
- alert-dialog.tsx — AlertDialog with Trigger asChild→render.
- sheet.tsx — Dialog with side variants and Trigger asChild→render.
- scroll-area.tsx — ScrollArea.Root / .Viewport / .Scrollbar / .Thumb.
- checkbox.tsx — Checkbox.Root / .Indicator. onCheckedChange unchanged.
- label.tsx — plain <label> + cva (Base UI doesn't ship Label).
card.tsx, alert.tsx, skeleton.tsx, table.tsx, input.tsx, textarea.tsx
were pure-styling primitives — no change.
Form test updated: Base UI Checkbox renders span[role=checkbox] with
a Base-generated id, so getByLabelText doesn't traverse via htmlFor.
Test now uses getByRole('checkbox').
Bundle: ~140KB gzipped JS (was ~120KB on Radix). Within the 300KB
budget. CSS unchanged at 5KB. All 23 tests + lint + Go suite green.1 parent 1a3268a commit 35ef4c9
16 files changed
Lines changed: 413 additions & 1210 deletions
File tree
- extensions/dashboard/contract
- shell
- src/components/ui
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | | - | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
| |||
0 commit comments