The Shtukbase React component library
The same components as shtukbase-ui-html in React: the shadcn primitives with our classes and the Shtukbase composites; the code is placed in the project, as with shadcn, and draws with the CSS of the HTML library on the tokens of the chosen style.
Sobre el paquete
Este texto aún no está traducido. Debajo está el original en inglés.
The React side of the Shtukbase design: the same components as shtukbase-ui-html, with the same ids, levels, states and controls, the same markup and the same classes. The look is written once, in the CSS of the HTML library; the React components only draw its classes and data attributes, and add behaviour.
As with shadcn and keer-ui: sources are copied into the project, not installed as a dependency. The place action puts them in the folder from the
target: field of the page /design/shtukbase-ui-react.md (by default src/sb-ui) and runs by itself after install and update. Files the project edited are not touched by an update.
What it puts in the project:
/design/shtukbase-ui-react.md: what is inside, settings (target:,css:), what the project needs;- the library code in the
targetfolder:primitives/,composites/,blocks/,shell/,lib/,styles/index.css; every component has a header (/*--- … ---*/, the one format of the build contract) and a<id>.states.tsx; - norms SBR-R01 (the library is intact), SBR-R02 (a component has a states file), SBR-R03 (the same components as the HTML library).
Components (one per id of shtukbase-ui-html): primitives button, badge, input, select, switch, slider come from shadcn (new-york-v4) with our classes added; the rest of the shadcn set (avatar, checkbox, label, progress, radio-group, separator, skeleton, textarea, tooltip, accordion, alert, breadcrumb, command, dialog, dropdown-menu, popover, table, tabs) has the shadcn names and slots and draws the markup of the HTML library (native inputs, details and plain surfaces, so the HTML side needs no script); chip, icon-plate, kicker, swatches, status-dot, the composites card, package-card, field, record-card, property-row, details-card, empty-state, tree-item, toolbar, search-field, settings-group and the blocks area, package-grid, settings-bar and peek are ours.
The parts in shell/: Sidebar and its parts, Panel, PanelSection, Collapsible, ScrollArea,
Sheet and the layouts LayoutDocument, LayoutGrid, LayoutCatalog, LayoutCanvas (pan, zoom with the wheel and the keys, fit):
plain elements with the classes of shtukbase-ui-html. The lens layout arranges these parts.
The package does not install dependencies (react, radix-ui, class-variance-authority, cn, lucide-react, tailwindcss 4, tw-animate-css); they are requirements for the project, and the list is on the page. The tests carry their own bundled copies (test/vendor) and need no install.
Boundary: no screens and no domain components; the look of our own composites is not repeated in Tailwind classes — it is the CSS of the HTML library. A control of the HTML library is a prop here (preset="cover").
Normas 3
| ID | Norma | Nivel | Modo | Enforcer |
|---|---|---|---|---|
| SBR-R01 | The React component library is placed in the project: every file of its manifest is in its place and every relative import (code and CSS) finds its file. |
MUST | bloquea | comprobación |
| SBR-R02 | Next to every component <id>.tsx in primitives/, composites/ and blocks/ lies <id>.states.tsx, which exports meta and states. |
SHOULD | bloquea | comprobación |
| SBR-R03 | Every React component has a valid header whose id is its file name and whose level is its folder; when the project has shtukbase-ui-html, both libraries have the same ids and the same level, controls, states, statuses, uses and parts. |
MUST | bloquea | comprobación |
«Bloquea»: el enforcer detiene la infracción. «Observa»: solo la anota. El nivel MUST es obligatorio; SHOULD significa «sí, salvo que haya motivo».
Acciones 4
| Nombre | Qué hace | Archivo | Cuándo |
|---|---|---|---|
| place | Place the library in the project folder (target: on /design/shtukbase-ui-react.md); --force replaces edited files too | actions/place.ts | tras instalar tras actualizar |
| library | The library is intact: files in place, imports find their files norma SBR-R01 | checks/library.ts | comprobación |
| states | A component has a states file norma SBR-R02 | checks/states.ts | comprobación |
| same | The same components as the HTML library: valid headers, the same ids, levels and controls norma SBR-R03 | checks/same.ts | comprobación |
shtuk check ejecuta las comprobaciones; shtuk run shtukbase-ui-react <nombre> ejecuta cualquier acción. Las acciones «tras instalar» solo se ejecutan solas si el paquete viene de una fuente de confianza.
Páginas 4
Se copian al proyecto en estas rutas.
- /design/
- The Shtukbase React component library página
- /norms/rules/shtukbase-ui-react/
- The component library is intact SBR-R01
- A component has a states file SBR-R02
- The same components as the HTML library SBR-R03
Archivos del paquete 146
Van a .shtukbase/packages/shtukbase-ui-react/; las acciones se ejecutan desde ahí.