@sewdn/slides-ui
v0.1.0
Published
React UI primitives, hooks and shared styles for slide tool interfaces.
Readme
@sewdn/slides-ui
Workspace package for Shadcn UI primitives only.
Role
This is the single package where the Shadcn CLI is used:
components.jsonlives here, and registry components are added with:cd packages/ui bunx shadcn@latest add <component> -yAfter init,
installDefaultUiPrimitivesCatalogruns:executeAddUiPrimitivesforprimitives-registry(Shadcn + Lloyd@storybook/<id>-story), theninstallLloydDesignSystemStories(Color, Radius, Shadow, Spacing, Typography from the@storybookregistry), theninstallThemeShowcaseBlocks(Shadcn blocksdashboard-01,login-03,signup-01plusscroll-area/resizablefor the Mail layout), then sync. Primitive stories live undersrc/components/<id>-radix.stories.tsx; theme stress-tests live undersrc/showcase/*.stories.tsx(Storybook grouptheme/showcase— Cards, Dashboard, Mail, Color palette, Typography, Login, Sign up). Librarytscexcludes*.stories.*. For additional primitives only, useadd-primitive(design-system stories are not re-run). To re-run theme blocks only:installThemeShowcaseBlocks(projectRoot)from@workspace/pkg-ui.Do not add composed or app-specific components here. Use
packages/ui-liborpackages/ui-<name>andscaffold workspace-ui add-component(orscaffold component) for those.Consumers — frontend apps,
ui-lib, and customui-*packages — import primitives and hooks from this package’s root export (e.g.import { Button, useTheme } from "@sewdn/slides-ui").syncUiPrimitivesPackageregeneratessrc/components/ui/index.tsandsrc/hooks/index.tsas barrels (oneexport *per source file) andsrc/index.tsre-exports them. Use named imports so bundlers can tree-shake unused modules;package.jsonmarks only**/*.cssas side effects.
Themes and modes
- Theme — Brand palette (
default,ocean, …). Registry:src/lib/themes.ts(THEMES,ThemeId,DEFAULT_THEME_ID,isThemeId()). Styles: one file per id undersrc/styles/themes/<id>.css, imported fromglobals.css.ThemeProvidersetsdocument.documentElement.dataset.theme(e.g.html[data-theme="ocean"]in CSS). - Mode — Color appearance for the current theme: light, dark, or system (follow OS).
ModeProvidertoggles thelight/darkclasses on<html>(same as Shadcn). - Apps — Wrap with both:
<ThemeProvider><ModeProvider>…</ModeProvider></ThemeProvider>. Storybook uses toolbar Theme (palette) + Mode (light/dark/system).
See also
Project conventions: .cursor/rules/001-project-file-structure.mdc and the scaffold-workspace-ui / scaffold-ui Cursor skills.
