@royal-voluntary-service/blocks
v0.0.22
Published
The Royal Voluntary Service Block Components — thin, themed wrappers around MUI primitives, published as `@royal-voluntary-service/blocks`.
Readme
library-blocks
The Royal Voluntary Service Block Components — thin, themed wrappers around MUI
primitives, published as @royal-voluntary-service/blocks.
Installation
pnpm add @royal-voluntary-service/blocksPeer dependencies
The package ships as ESM and treats React, MUI, Emotion and the MUI X packages as peer dependencies so the consuming app provides a single shared instance (avoiding duplicate React/MUI/Emotion bundles). Make sure these are installed in the consuming project:
react/react-dom(^19)@mui/material,@emotion/react,@emotion/styled@mui/x-charts,@mui/x-data-grid,@mui/x-date-pickers,@mui/x-tree-viewdayjsnext(optional — only required byBlockLink)
Usage
Import components from their granular subpath (tree-shaking friendly):
import { BlockButton } from '@royal-voluntary-service/blocks/BlockButton';
import { BlockBox } from '@royal-voluntary-service/blocks/BlockBox';Or from the package root:
import { BlockButton, BlockBox } from '@royal-voluntary-service/blocks';Development
pnpm build— generates the export map + barrel, bundles each component withtsup, emits declarations withtsc, and preserves"use client"directives.pnpm typecheck— type-checks the source without emitting.pnpm storybook— runs Storybook locally.
The package exports map and the root barrel (src/index.ts) are generated by
scripts/generateExports.cjs and kept in sync with src/ automatically on every
build, so they never need to be hand-edited.
