@invoiceonline/ui-react
v0.2.0
Published
React components of FODS, the FakturaOnline design system, with the design tokens they are built on.
Readme
@invoiceonline/ui-react
React components of FODS, the FakturaOnline design system, with the design tokens they are
built on: from Button, TextField and Checkbox to Modal, Menu and Table (the full list is in
llms.txt). ESM only, React 19.
Install
npm install @invoiceonline/ui-reactPeer dependencies: react and react-dom ^19.0.0, @tanstack/react-table ^9.3.1.
The design tokens ship in the package, from the same commit as the components:
@invoiceonline/ui-react/tokens.css, @invoiceonline/ui-react/tokens (JS) and
@invoiceonline/ui-react/tokens.flat.json. Do not install @invoiceonline/ui-system next to it.
The package ships no fonts: load Inter, Poppins and Caveat in the app. The package has no
translations: texts come through props, and some of those props have a Czech default
(closeLabel of Modal, labels of Pagination…). An app with more than one language version
passes all of them from its translations: the full list is in docs/Consuming.mdx
(Texts and locale).
Styles
Without Tailwind, load the tokens and the compiled stylesheet after a stylesheet of your own that holds only the layer order and is imported first:
@layer properties, reset, fods; /* layers.css, imported before the two below */
@import "@invoiceonline/ui-react/tokens.css";
@import "@invoiceonline/ui-react/styles.css";An app with Tailwind 4 loads theme.css and shared.css instead and never styles.css as
well. Both recipes, the layer rules and what theme.css does to your Tailwind theme:
docs/Consuming.mdx → Styles.
Use
import { Button, FodsProvider } from '@invoiceonline/ui-react';
export function App() {
return (
<FodsProvider>
<Button>Uložit</Button>
</FodsProvider>
);
}FodsProvider goes once per React root, in every app. It mounts TooltipProvider (every
component that renders a Tooltip throws without it: Tooltip outside its toggletip mode, Chip with info, Switch with
infoIcon, ColumnHeader, StatusSummaryBar and others; Table brings its own) and
<MotionConfig reducedMotion="user"> (without it the open / closed carets of SplitButton,
DropdownButton, SelectField, FAQ and others turn even under reduced motion); the app needs
no motion dependency for it. Each component also has its own entry
(@invoiceonline/ui-react/button).
variant="primary" of Button and IconButton is the blue in-app default. The orange fill is
variant="brand": a hand-made button on --primary-solid maps to brand, not primary.
Docs
docs/Introduction.mdx: how to read the Storybook of the package (sidebar, story conventions, the Metadata block of a docs page).docs/Consuming.mdx: the consumer guide. Cascade layers and global resets, what the components inherit, providers (FodsProviderand what it contains), portals, assets and the illustrations the app passes in, Next.js server components, texts and locale, known gaps. Read it before wiring the package into an app.docs/Contributing.mdx: what one component is made of, the Definition of Done and the gates, for a person who changes the package.src/components/<folder>/<Name>.mdx: the docs page of each component, with its stories next to it.llms.txtandAGENTS.md: the component index and the rules for an AI agent working in an app that uses the package;docs/ForAgents.mdx: where an agent finds the docs, the MCP addon of the Storybook, how a docs ID is derived.CHANGELOG.md: the release notes, written by Changesets with each release.
