@apium-pro/ui
v1.1.1
Published
Apium's custom Vue 3 UI library — source-only ESM components + design tokens.
Maintainers
Readme
@apium-pro/ui
Apium's custom Vue 3 UI library — source-only ESM components + design tokens.
There is no build step: the package ships the raw .vue / CSS sources and
consumers bundle them themselves (Vite). This is intentional — see CLAUDE.md
next to this file for the why and for the full component / theming conventions.
Live examples and copy-paste-ready snippets: the brandbook app in
apps/brandbookof this repo.
Install
Published to the public npm registry, scope @apium-pro:
pnpm add @apium-pro/ui # or: npm i @apium-pro/ui / yarn add @apium-pro/uipeerDependencies: vue@^3.5.
Usage
The recommended setup is the global plugin — register once, then use every
component anywhere with a configurable prefix (default Ap) plus short aliases,
no per-file imports to maintain:
// main.js
import ApiumUI from '@apium-pro/ui';
import '@apium-pro/ui/styles'; // reset + tokens + scrollbar + transitions
app.use(ApiumUI); // <ApButton>, <ApBtn>, <ApCard>, …
// app.use(ApiumUI, { prefix: 'Apium' }); // <ApiumButton>, <ApiumBtn>, …<template>
<ApButton variant="primary">Save</ApButton>
<ApBtn /> <!-- short alias of ApButton -->
<ApCard>…</ApCard>
</template>Lab components (@apium-pro/ui/lab) are not auto-registered — import them
explicitly (they pull optional peer deps like ol).
Because the package is source (.vue + CSS), not a pre-built bundle, the
consuming project must:
- have
@vitejs/plugin-vue(or an equivalent SFC compiler) — it processes the.vuefiles; - exclude the package from Vite's dependency pre-bundling (esbuild can't parse
.vue):
// vite.config.js
import vue from '@vitejs/plugin-vue';
export default {
plugins: [vue()],
optimizeDeps: { exclude: ['@apium-pro/ui'] },
};Named imports (optional)
Prefer explicit, per-component imports? Every component is also a tree-shakable
named export — skip app.use() and import what you use:
import { Button, Modal, useToast, aurora } from '@apium-pro/ui';Theming
Switch data-theme on <html> — dark (warm dark, default) or light (warm
light). All colors/radii/spacing/gradients/shadows come from CSS custom
properties in src/styles/tokens.css (the public theming API). On theme switch,
toggle the ap-theming class on <html> for --theme-anim-duration to play
the per-component transition choreography (see useTheme in the brandbook).
Details: CLAUDE.md and the brandbook Foundations page.
IDE support
The package ships a web-types.json (referenced from package.json), so
JetBrains IDEs (WebStorm, IntelliJ — and partially VS Code) give you, right in
the template: a one-line description per component on hover, prop completion with
types, defaults and allowed values (parsed from the components' validators),
plus the available events and slots, and an "open docs" link. No TypeScript /
.d.ts needed — it's generated from the source. Regenerate after changing
props/emits/slots:
pnpm --filter @apium-pro/ui gen:web-typesPer-component one-liners live in scripts/gen-web-types.mjs (the SUMMARIES
map); everything else is extracted from the .vue files.
What's inside
≈22 components (Button, IconButton, Input, Textarea, Switch, Spinner, Badge,
Avatar/AvatarGroup, Box, Container, Columns/Column, Inline, Stack, Tabs,
EmptyState, Skeleton/SkeletonLoader, Modal, Drawer, Dropdown, Tooltip, Toast,
MessageBubble, ChatListItem), the useToast singleton, overlay/popover
composables, the deterministic aurora(seed) avatar-background generator, and
the design-token stylesheet (@apium-pro/ui/styles). Full per-component reference:
CLAUDE.md.
Releasing a new version
Releases are fully automated via semantic-release.
Push a commit to main whose message follows
Conventional Commits:
feat: …→ minor bumpfix: …→ patch bumpfeat!: …or footerBREAKING CHANGE:→ major bumpchore: …,docs: …,refactor: …,test: …,ci: …,build: …,style: …→ no release
The release:ui CI job (.gitlab-ci.yml) analyzes commits since the last tag,
bumps version in this package.json, updates CHANGELOG.md, commits the
bump back to main with [skip ci], tags vX.Y.Z, runs npm publish
--access public, and opens a GitLab Release. Auth: CI/CD variables
NPM_TOKEN and GITLAB_TOKEN (see .gitlab-ci.yml header for required
scopes).
