@poodle64/ui
Household shared shadcn-svelte component primitives (bits-ui), extracted from
the estate's most conformant consuming app's frontend — the best-looking,
most battle-tested implementation of each primitive — plus alert/popover/
progress/tabs from the first app that migrated onto this package (WP-51
Lane WP) and needed them.
bits-ui is a required peerDependency: components share compound-component
context across the package, so a duplicated bits-ui instance is a real
functional bug (mismatched types at best). mode-watcher and svelte-sonner
are optional peers (peerDependenciesMeta), needed only if the consuming app
uses @poodle64/ui/sonner (a single dark-mode store for mode-watcher, one
toast queue for svelte-sonner's toast() + Toaster pair — a duplicated
instance there means a Toaster that never sees the app's own toast()
calls). Declare whichever peers you use directly in your own package.json:
pnpm auto-installs missing peers, but an explicit dependency is what lets
Renovate track the version and pnpm ls show it.
Every app previously vendored its own copy of these primitives and restyled them
through its @poodle64/design-tokens alias layer. That let apps differ by palette,
but a fix (an accessibility bug, a focus-trap issue) had to be applied once per app.
This package is the same restyling mechanism: components consume shadcn's standard
CSS variable names (bg-primary, text-foreground, --radius, …), and both the
component code and the mapping those names resolve through now live once, here.
Apps differ by palette and nothing else. Override --ds-color-* and the whole
shadcn surface follows; a consuming app writes no alias layer of its own.
The look is the household's skin, not shadcn's stock one (app-factory#171): the
stock look is what the AI app builders generate, and every app read as machine-made
in it. Sections are open, a heading over a hairline, never a bordered card each
(Panel, StatList, StatCard); a surface is a tonal step with no ring or shadow
(Card, DetailPanel). Labels and column heads are sentence case (.ds-label),
never small caps. Status is its own glyph in its own colour, and a word. An icon in
the content, a section's or a figure's mark, takes the accent in its tone layer.
Tabs are underlined, the page ground is plain, corners are tight (--ds-radius-lg
0.5rem) and icons are the household set (§Icons). A change that brings a stock
default back is a regression of that issue.
What is here
src/lib/
utils.ts cn() (clsx + tailwind-merge) and the shared TS helper types
format.ts the Australian value formatters: money, dates, percentages,
numbers — en-AU, AUD, Australia/Brisbane
telemetry.ts browser telemetry: one initBrowserTelemetry() call, one Faro
instance, one session id (see below)
styles.css the component stylesheet: scale keys, .ds-label, .ds-chip/.ds-status-icon,
the icon tone, the dialogue-section divider rule
icon-props.ts the household icons' props (icons/ is generated at build, gitignored)
components/ui/ one directory per component: the shadcn-svelte primitives
(bits-ui behaviour + shadcn markup/variants) and the composed
page-chrome components built on top of them
components/feedback/ ReportWidget: the "report a problem" dialogue every app
mounts; the shell draws its trigger (see below)
components/alerts/ AlertBell: the top-bar bell over the app factory's alerts
routes (see below)
dist/ generated by `pnpm build` (@sveltejs/package); never edit
Primitives (27 — battle-tested implementations pulled from whichever app had
them first, not an invented "ideal" list): alert, alert-dialog, avatar,
badge, button, card, checkbox, command, data-table, dialog,
dropdown-menu, input, input-group, label, password-input, popover,
progress, select, separator, sheet, skeleton, sonner, switch,
table, tabs, textarea, tooltip.
avatar is root, image and fallback only; the group and badge variants in the
upstream registry had no consumer in any surveyed app. It is here because
AppShell's identity slot needs one, and a consumer filling a slot the shell
itself defines should not have to keep a private copy of a primitive to do it.
sheet is shadcn's API (Sheet.Root, Trigger, Content side=…, Header,
Title, Description, Footer, Close) plus Sheet.Body, the part that
scrolls between a fixed header and footer. It is a panel over the page, for a
task beside what you are reading (comments on a chapter, a cited record on a
phone); it is never a second navigation column, which the shell has no slot
for. It stands on the kit's hairline depth, not a shadow, and inside an
element's <Overlays> it portals into the shadow root like the dialogue does.
Deliberately not here: chart and form. Two apps keep local copies of each,
and both stay local for reasons that are about coupling rather than effort.
form in the upstream registry is a Formsnap wrapper over Superforms. Adding it
would make a form library a peer of the whole design system and decide, for every
app, how validation and submission work — which is an application-architecture
choice, not a design one. An app that uses Superforms already gets its markup from
input, label, input-group and button here; what it keeps locally is the
binding layer, which is where it belongs.
chart is a LayerChart wrapper, and it needs the chart-1…chart-5 colour keys
this stylesheet deliberately does not register — chart hue is the one part of the
shadcn surface the estate genuinely disagrees on, and registering it here would
claim a key no app can then override without a stylesheet-order coin toss (see
the one-owner-per-key note below). It becomes a candidate the day two apps want
the same chart palette; until then a shared chart component would be a shared
disagreement.
Composed components. Primitives are not what makes an app look like an
app — the page chrome is. These are the cross-cutting surfaces every route
composes from, so a household app gets its layout language from the package
rather than rebuilding it: