Component selection and contracts
Verified ERP Vue component APIs, ownership boundaries, composition rules, and component acceptance states.
Scope of this inventory
Section titled “Scope of this inventory”The identifiers below refer to frontend/src/components/ui, inspected on 2026-09-05.
They do not imply that similarly named exports in packages/ui-shared have identical APIs.
Read the owning implementation and colocated tests before changing a call site.
These are usage contracts and review targets, not a claim that every state is tested or accessible.
Interactive specimens
Section titled “Interactive specimens”Choose by responsibility
Section titled “Choose by responsibility”| Need | Existing component | Caller responsibility |
|---|---|---|
| Execute an action | BaseButton | Label, permission, request lifecycle, result feedback |
| Edit a scalar value | BaseInput, BaseTextarea | Domain validation, parsing, persistence |
| Choose a value | BaseSelect, SearchableSelect | Authorized options and selected-label resolution |
| Blocking task | BaseModal | Task content, safe dismissal, focus after completion |
| Consequential confirmation | ConfirmGate | Consequence copy, busy state, actual mutation |
| Managed resource list | DataTable and DataTablePager | Server query, selection, bulk API, export scope |
| No records | EmptyState | Correct reason and permission-aware next action |
| Context explanation | HelpPopover, BaseTooltip | Appropriate detail and accessible trigger |
| Record state | StatusBadge | Accurate business state and any explicit tone |
| Loading structure | Skeleton | Fetch state, region announcement, eventual error |
Action contract
Section titled “Action contract”BaseButton.variant accepts primary, secondary, ghost, or danger.
size accepts sm, md, or lg; type accepts button, submit, or reset.
The default type is button: declare type="submit" for a real form submission.
loading disables the native button and sets aria-busy; it does not perform or cancel the request.
disabled and block are separate props; content belongs in the default slot.
No label, icon, or success variant was verified in this ERP contract.
Example: a save action uses type="submit", :loading="saving", and localized visible slot text.
Keep the label meaningful during loading; the spinner alone cannot explain what is happening.
Use a link for navigation rather than assuming every navigation destination is a button action.
Input and selection contract
Section titled “Input and selection contract”BaseInput accepts modelValue, label, type, placeholder, autocomplete, and list.
It also accepts required, disabled, error, hint, and info.
It emits update:modelValue and blur, and exposes focus() for deliberate focus management.
Its generated ID connects the label; a passed id is not forwarded to the inner input.
Use the exposed method rather than guessing the generated ID when focusing an invalid field.
The append slot is available; do not use it to hide a unit or mandatory instruction.
SearchableSelect options contain value, label, and optional description, keywords, and disabled.
Its fetch contract receives search, optional cursors, and pageSize, and returns options plus cursor metadata.
optionLabel resolves a selected value outside the loaded window; searchDebounce defaults to 300ms.
create, createPermission, and the created event support configured creation workflows.
Do not confuse creatable free-form values with creating a persisted master-data record.
Overlays and confirmation
Section titled “Overlays and confirmation”BaseModal uses open with update:open, plus title, subtitle, closable, and width.
It also emits close; the normal binding is v-model:open, not an invented visible prop.
The component implements focus management, but the caller must test its actual overlay composition.
closable=false is not a generic solution to unreliable networking; provide a recovery path.
ConfirmGate requires title and message, and emits confirm.
Its default slot exposes open and disabled; it owns its dialog state internally.
Optional props include confirmLabel, cancelLabel, confirmVariant, requireText, requireTextLabel, disabled, and busy.
The inspected implementation closes its dialog before emitting confirm.
Therefore busy is not evidence that the dialog stays open until a promise resolves.
The caller must retain visible progress and errors after the dialog closes.
State and help contracts
Section titled “State and help contracts”EmptyState.message is canonical; description is an existing legacy alias.
Use permission, a derived canCreate, createLabel, and either createTo or the create event as appropriate.
In the inspected implementation, canCreate=true overrides; false does not deny access when permission resolves true.
Do not use canCreate=false as a security boundary or assume it always suppresses the CTA.
StatusBadge takes value, optional tone, and size of sm or md.
Tone values are neutral, info, success, warning, and danger; state remains the source of meaning.
HelpPopover requires content; optional props include title, placement, label, and docsUrl.
docsUrl is a documentation slug used by the resolver, not a promise of arbitrary external URL support.
BaseTooltip supports content, placement, disabled, wide, and a content slot.
Skeleton supports inline, circle, width, height, and rows; it does not fetch data.
Composition rules
Section titled “Composition rules”| Do | Do not | Reason |
|---|---|---|
| Reuse an existing primitive and extend its documented contract | Fork a page-local button or modal | Avoid divergent behavior and fixes |
| Keep domain rules in a service or domain boundary | Add payroll calculations to BaseInput | Preserve single responsibility |
| Pass typed data and emit narrow events | Let a generic control fetch arbitrary module data | Keep dependencies explicit |
| Check both ownership and API | Treat shared-package and ERP components as interchangeable | Similar names are not compatibility guarantees |
| Document tested states and gaps | Call a component certified because it has a story | Evidence is state-specific |
Acceptance criteria
Section titled “Acceptance criteria”- Props, events, slots, and ownership match the current source rather than another library’s conventions.
- Default, loading, disabled, error, empty, read-only, and long-content states are considered where relevant.
- Both locales, keyboard operation, narrow layout, dark theme, and reduced motion are reviewed.
- Permission and persistence remain outside visual primitives and are enforced server-side.
- New shared behavior has colocated tests and a migration note for affected callers.
- Stories use isolated providers and clearly labeled sandbox data, never production bootstrapping.
Continue with forms, feedback, and governance for integration decisions.