@plumile/ui
v0.1.146
Published
Shared React UI primitives and theme for Kronex applications
Maintainers
Readme
@plumile/ui
Shared React UI primitives, layouts, and theme foundations for Kronex applications.
Status
Specialized public package. This package is intended for teams adopting the Kronex design language and component conventions. It is not a generic UI kit for arbitrary React applications.
Purpose
@plumile/ui is the visual layer of the Kronex ecosystem. It provides:
- theme contracts and tokens
- low-level form and feedback primitives
- shared layouts and page shells
- data-heavy and admin-oriented widgets
- reusable backoffice visual components
It does not provide:
- application business logic
- GraphQL orchestration
- router orchestration beyond consuming router links where needed
Installation
npm install @plumile/uiPeer dependencies:
npm install react react-dom i18next react-i18nextIf you use components that depend on router links, also install
@plumile/router.
Main Public Surface
The package entry point groups exports by UI family instead of exposing a single flat mental model.
Theme and styling
ThemeProviderBackofficeThemeProvideruseTheme- theme contracts, tokens, and accessibility helpers
sprinkles,stateSprinkles, and shared style recipes such asfocusRing,controlFocusRing,disabledControl,surfaceInteractive,interactiveControlSurface,interactiveLinkSurface,ghostIconButton,pillLink,entityReferenceLink,insetFocusRing,truncate,iconBox,iconBoxCompact,loadingShimmer, andvisuallyHidden
Primitives and forms
Button,LinkButton,Input,Textarea,CheckboxLabel,Form,FormField,FormGroupErrorMessageis the field-level error text primitive. Use it for messages tied to a single control througharia-describedby.FormErroris the canonical form-level error block for submit failures and validation summaries inside form surfaces.InlineBanneris the canonical general notice/banner primitive for non-field feedback. It supports info, success, warning, and danger tones, titles, descriptions, actions, dismiss controls, and explicit live-region overrides.EmptyStateis the canonical empty-state component. Usevariant="framed"for card-backed surfaces,variant="plain"for inline backoffice-style surfaces,density="compact"for dense lists, andtonefor neutral, muted, info, success, warning, or danger emphasis.ToastProvider,ToastViewport
Layouts and shells
PageShell,AdminShellLayout,SidebarNavigationSurfaceis the canonical structured surface primitive for titled content, optional descriptions, actions, body content, and footers. It supportsdiv,section, andarticleroots plus visual variants for brand, neutral, muted, and plain surfaces.SurfaceSectionwrapsSurfacefor accessible titled sections and wiresaria-labelledbyautomatically when a title is present.ContentLayout,ResizableSplitView,PanelShellResizableSplitViewis the canonical split-view primitive for optional, resizable side panels. It supports controlled and persisted widths, pointer and keyboard resizing, stacked layouts below a breakpoint, and accessible separator semantics.Toolbar,ToolbarGroup,ToolbarSpacer,ToolbarSeparatorSettingsLayoutfor settings-oriented content with local navigationCard,PanelShell,ActionPanel, andBackofficeFormSectionremain compatible wrappers or specialized compositions on top of the canonical surface primitives.
Data-heavy and dashboard components
DataTableis the canonical high-level table for static and paginated data.DataTableRoot,DataTableHeader,DataTableBody,DataTableRow, andDataTableEmptyRowexpose the same public rendering primitives for advanced table composition without duplicating cell, header, density, breakpoint, empty state, or contained-scroll behavior.VirtualizedConnectionTableis the specialized table for virtualized connection lists and infinite loading. It shares theDataTableprimitives for table rendering while keeping virtualization and scroll-trigger behavior separate from the base table API.ResponsiveRecordListadapts the same table columns between table and mobile card layouts.BackofficeDataTablecomposes selection, bulk actions, and toolbar behavior on top ofDataTable; virtualized backoffice lists useVirtualizedConnectionTabledirectly.MetricCardandMetricTileGroupare the canonical KPI primitives. They support metric tones, compact density, copyable values, and configurable responsive tile widths without changing their default rendering.DashboardPanel,DashboardMetricGroup,DashboardQuickActions, andDashboardStatusListprovide the canonical visual widgets for dashboard panels, linked metric groups, shortcut lists, and status summaries.StatusSummaryPanelActivityFeed,TimelineEventRow,InfoTileTimelineEventRowis the reusable dashboard timeline row primitive. It uses the canonical event vocabulary (title,timeortimestamp,description,meta,metrics,details, and semantictone) while keeping relative timestamp rendering available throughRelativeTimeText.
Formatting helpers
HighlightCodeis the general code-display primitive. It supports a badge, copy action, placeholder text, highlighted HTML/React content, and a plain preformatted fallback.BackofficeJsonVieweris the canonical structured JSON viewer for backoffice surfaces. It safely stringifies unknown values, exposes copy and collapse/expand controls, and accepts max-height and label overrides.BackofficePayloadVieweris the canonical backoffice payload viewer forjson,markdown,text, andcodepayloads. Use it inside detail sections or tool output surfaces for empty states, summaries, collapsible details, copyable text/code, markdown rendering, and JSON rendering throughBackofficeJsonViewer.MoneyAmountrenders a currency amount fromamountandcurrencyprops with fixed two-decimal formatting.formatCurrencyAmount({ amount, currency })provides the same formatting for plain-text usage such as charts, table configs, and tooltips.
Backoffice visual components
Badgeis the low-level inline visual marker. It supports neutral, info, success, warning, danger, and accent tones plus a loading shimmer.StatusBadgemaps semantic status tones to badge tones and can show an optional status dot.Tagis the compact pill component for short labels and optional removable filters. Usetitle,onRemove, andremoveLabelfor accessible removable tags.EnvironmentBadgeandBackofficeIdBadgeremain specialized public badge compositions for environment labels and copyable IDs.- Detail badge/value compositions are available for backoffice entity pages:
BackofficeStatusMetaBadge,BackofficeStatusGroup,BackofficeDetailFlagTag,BackofficeDetailTaggedValue,BackofficeReferenceValue, andBackofficeEnumLabel. BackofficeKeyValueListis the canonical definition-list renderer for backoffice label/value metadata. It supports surface or plain rendering, split, stack, and grid layouts, custom empty labels, and React node values.- spinners and skeletons
BackofficeToolbaris the canonical list/table toolbar for search, filters, sorting, actions, and active chips.BackofficeListFooteris the canonical infinite-list footer for status-only and button-driven loading flows. Keep load-more status, loaded counts, spinners, and manual load buttons there rather than rebuilding list footers aroundInfiniteScrollTrigger.BackofficeEmptyStateis a compatibility wrapper aroundEmptyStatewith the plain, compact backoffice defaults.BackofficePickerShell,BackofficePickerList, andBackofficePickerRoware the canonical visual primitives for searchable backoffice pickers. They own the search input layout, listbox/option rendering, empty state, and row truncation; application integrations should pass already-resolved picker items and keep manifest, Relay, and domain behavior outside@plumile/ui.- filter drawers and confirm dialogs stay separate from picker primitives because their navigation, action, and confirmation semantics differ.
- backoffice data-table wrappers and detail visual helpers, including
BackofficeDetailFieldandBackofficeDetailSectionfor generic titled detail sections and copyable field values, plusBackofficeScopeStackandBackofficeAuditMetadataPanelfor canonical scope/context and audit metadata sections AuditTimelineis the canonical visual timeline for backoffice lifecycle and audit history. It renders orderedol/lievents with title, time, description, actor, source, meta, metrics, details, density, customrenderEvent, and neutral/info/success/warning/danger tones. Empty timelines rendernullunlessemptyStateis supplied.DetailPageTemplate,DetailPageTemplateContent, andListPageTemplateare the canonical backoffice page templates for detail and list screens.SidebarNavigation, including collapsible sections, collapsed rail mode, profile footer composition, and optional sortable sections for backoffice navigation groups
Breaking changes in this line: BackofficeTableToolbar, TableToolbar,
BackofficeFiltersBar, BackofficeLoadMore,
BackofficeInfiniteListStatus, BackofficeVirtualizedConnectionTable,
BackofficeDetailLayout, DetailPage, DetailPageContent, SegmentedNav,
and SectionNav were removed in favor of the canonical components above and
Tabs.
For the complete export list, see src/index.ts.
Quick Start
import { Button, ThemeProvider, Toolbar, ToolbarGroup } from '@plumile/ui';
export function ExampleScreen(): JSX.Element {
return (
<ThemeProvider defaultMode="light">
<Toolbar ariaLabel="Screen actions">
<ToolbarGroup>
<Button>Save</Button>
</ToolbarGroup>
<ToolbarGroup justify="end">
<Button variant="secondary">Cancel</Button>
</ToolbarGroup>
</Toolbar>
</ThemeProvider>
);
}ThemeProvider stores the public shell preference in plumile-theme-mode.
BackofficeThemeProvider stores the backoffice preference separately in
plumile-backoffice-theme-mode, so a backoffice can resolve light, dark, or
system mode independently inside a public page.
Package Layout
theme/*canonical source of shared design tokens and theme primitivesatomic/*low-level reusable React building blockscomponents/*generic cross-application layouts and widgetsbackoffice/*specialized data-heavy visual components for admin and backoffice screens
Validation Notes
- public UI behavior should be covered by targeted tests for stable components
- visual breadth is large, so documentation and examples should stay organized by component families rather than exhaustive component-by-component prose
- Storybook stories are useful for visual review, but they do not replace behavioral tests for stable public components
- styling should prefer shared sprinkles and theme style recipes; raw
vanilla-extract
style()is reserved for selectors, pseudo-elements, keyframes, container queries, CSS variables,calc(),color-mix(), or highly specific grid/layout cases - shared UI styling is sprinkles-first: add recurring token-sized values and
reusable interactive/link/icon classes to
theme/styleRecipes.css.tsbefore creating local one-offstyle()blocks
Limitations
- this package assumes Kronex theme tokens and styling conventions
- it is intentionally opinionated for backoffice and admin-style interfaces
- it does not try to be a framework-agnostic design system
- some components assume other Kronex packages, especially
@plumile/router
