@cocoar/vue-ui 3.3.0 → 3.4.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/menu/CoarSubFlyout.vue.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +34 -25
- package/package.json +11 -11
- package/skills/cocoar-vue-ui/SKILL.md +9 -5
- package/skills/cocoar-vue-ui/references/components/avatar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/badge.md +2 -0
- package/skills/cocoar-vue-ui/references/components/breadcrumb.md +2 -0
- package/skills/cocoar-vue-ui/references/components/button.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/time-selection.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +2 -0
- package/skills/cocoar-vue-ui/references/components/card.md +2 -0
- package/skills/cocoar-vue-ui/references/components/checkbox-group.md +2 -0
- package/skills/cocoar-vue-ui/references/components/checkbox.md +2 -0
- package/skills/cocoar-vue-ui/references/components/code-block.md +2 -0
- package/skills/cocoar-vue-ui/references/components/context-menu.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/number.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/select.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/text.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-grid.md +2 -0
- package/skills/cocoar-vue-ui/references/components/data-list.md +2 -0
- package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +2 -0
- package/skills/cocoar-vue-ui/references/components/date-picker.md +2 -0
- package/skills/cocoar-vue-ui/references/components/date-time-picker.md +2 -0
- package/skills/cocoar-vue-ui/references/components/date-views.md +2 -0
- package/skills/cocoar-vue-ui/references/components/dialog.md +2 -0
- package/skills/cocoar-vue-ui/references/components/divider.md +2 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +2 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +2 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +2 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/drag-drop.md +2 -0
- package/skills/cocoar-vue-ui/references/components/dual-listbox.md +2 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +2 -0
- package/skills/cocoar-vue-ui/references/components/link.md +2 -0
- package/skills/cocoar-vue-ui/references/components/listbox.md +2 -0
- package/skills/cocoar-vue-ui/references/components/map/editor.md +2 -0
- package/skills/cocoar-vue-ui/references/components/map/index.md +2 -0
- package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +2 -0
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +2 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +2 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +2 -0
- package/skills/cocoar-vue-ui/references/components/menu.md +2 -0
- package/skills/cocoar-vue-ui/references/components/mermaid.md +2 -0
- package/skills/cocoar-vue-ui/references/components/navbar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/note.md +2 -0
- package/skills/cocoar-vue-ui/references/components/notice.md +2 -0
- package/skills/cocoar-vue-ui/references/components/number-input.md +2 -0
- package/skills/cocoar-vue-ui/references/components/otp-input.md +2 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +2 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +2 -0
- package/skills/cocoar-vue-ui/references/components/pagination.md +2 -0
- package/skills/cocoar-vue-ui/references/components/panel-layout.md +2 -0
- package/skills/cocoar-vue-ui/references/components/password-input.md +2 -0
- package/skills/cocoar-vue-ui/references/components/popconfirm.md +2 -0
- package/skills/cocoar-vue-ui/references/components/popover.md +2 -0
- package/skills/cocoar-vue-ui/references/components/progress-bar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/radio-group.md +2 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +2 -0
- package/skills/cocoar-vue-ui/references/components/segmented-control.md +2 -0
- package/skills/cocoar-vue-ui/references/components/select.md +2 -0
- package/skills/cocoar-vue-ui/references/components/sidebar.md +2 -0
- package/skills/cocoar-vue-ui/references/components/spinner.md +2 -0
- package/skills/cocoar-vue-ui/references/components/switch.md +2 -0
- package/skills/cocoar-vue-ui/references/components/table.md +2 -0
- package/skills/cocoar-vue-ui/references/components/tabs.md +2 -0
- package/skills/cocoar-vue-ui/references/components/tag.md +2 -0
- package/skills/cocoar-vue-ui/references/components/text-input.md +2 -0
- package/skills/cocoar-vue-ui/references/components/toast.md +2 -0
- package/skills/cocoar-vue-ui/references/components/tooltip.md +2 -0
- package/skills/cocoar-vue-ui/references/components/tree.md +2 -0
- package/skills/cocoar-vue-ui/references/components/wizard.md +2 -0
- package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +2 -0
- package/skills/cocoar-vue-ui/references/foundations/design-principles.md +27 -3
- package/skills/cocoar-vue-ui/references/guide/mobile.md +219 -2
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Link
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
5
7
|
Styled anchor elements for in-page navigation, external references, and any clickable text that isn't a button action. Two equivalent APIs:
|
|
6
8
|
|
|
7
9
|
- **`<CoarLink>` SFC** (recommended) — `to` for router navigation, `href` for external links, automatic `rel="noopener"` for new-tab safety, disabled handling.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Listbox
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone planned — Multi-highlight needs Ctrl/Shift-click or keys; drag on touch needs dragEngine 'pointer' or 'auto'.
|
|
6
|
+
|
|
5
7
|
A single-column list of selectable items with grouping, search, custom renderers, and multi-select highlighting. Use it as a form control (v-model of highlighted values), as a display-only roster, or as the foundation for [`CoarDualListbox`](./dual-listbox.md).
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Map Editor (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — Map editing works on touch; the point list's drag reorder is mouse-only and nothing is phone-adapted.
|
|
6
|
+
|
|
5
7
|
A visual editor for [`<CoarMap>`](./index.md) data. `<CoarMapEditor>` is the
|
|
6
8
|
**write counterpart** of `<CoarMap>`: same `MapData` + `MapConfig`, but you can
|
|
7
9
|
**place, move, edit, reorder and delete** points directly on the map, with every
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Map (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Pan and zoom work by touch; the map's controls have no .coar-mobile presentation yet.
|
|
6
|
+
|
|
5
7
|
An interactive [Leaflet](https://leafletjs.com/) map for Vue 3. `<CoarMap>` is
|
|
6
8
|
**standalone and data-driven**: you feed it resolved `MapData` + `MapConfig` and
|
|
7
9
|
it renders pins, a route, popups and an optional legend. It has **no dependency
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Diagrams (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — With zoomable, touch zooms with the buttons but cannot pan a zoomed diagram.
|
|
6
|
+
|
|
5
7
|
Render diagrams inside markdown from a fenced code block — <code>```mermaid</code>
|
|
6
8
|
— using [`@cocoar/vue-markdown-mermaid`](https://www.npmjs.com/package/@cocoar/vue-markdown-mermaid).
|
|
7
9
|
The diagram source lives in the markdown as a normal code fence, so it
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Markdown Editor (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — Typing and the toolbar work on touch; table row/column grips and the code-block edit button need hover.
|
|
6
|
+
|
|
5
7
|
WYSIWYG Markdown editor for Vue 3 based on [Milkdown](https://milkdown.dev/) (Kit approach), styled with the Cocoar Design System. Markdown-first: lossless round-trip between text and editor state. Shares the same remark stack — and the same render registry — as `@cocoar/vue-markdown-core` and `<CoarMarkdown>`.
|
|
6
8
|
|
|
7
9
|
> **Info: Separate Package**
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Markdown Form
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Works on phones; its select and date fields still open the desktop panels.
|
|
6
|
+
|
|
5
7
|
`CoarMarkdownForm` turns a Markdown string into a form-like document. Headings,
|
|
6
8
|
labels, lists and explanatory text stay fixed; only explicit field directives
|
|
7
9
|
can be changed. Field values live in a separate object and never rewrite the
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Markdown
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Wide tables get no horizontal scroll container and can overflow narrow screens.
|
|
6
|
+
|
|
5
7
|
Render markdown content with Cocoar Design System styling. The system is split into two packages: a framework-agnostic parser and a Vue component.
|
|
6
8
|
|
|
7
9
|
> **Info: Separate Packages**
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Menu
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone planned — Touch-sized rows for phones are planned.
|
|
6
|
+
|
|
5
7
|
Build context menus, action lists, and navigation panels with full keyboard support. Menus group related actions together, making them easy to discover and interact with. They support nested submenus, icons, section headings, and danger variants for destructive actions.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Mermaid Diagram (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — With zoomable, touch zooms with the buttons but cannot pan a zoomed diagram.
|
|
6
|
+
|
|
5
7
|
A standalone [Mermaid](https://mermaid.js.org/) diagram component for Vue 3.
|
|
6
8
|
`<CoarMermaidDiagram :code>` renders a diagram from a Mermaid source **string** —
|
|
7
9
|
Cocoar-themed, lazy-loaded, with opt-in zoom/pan.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Navbar
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — No collapsed or menu layout for narrow screens; slot content must fit the phone width.
|
|
6
|
+
|
|
5
7
|
A top-level navigation bar that anchors your application layout. It provides three flexible content slots -- start, center, and end -- so you can place a logo, navigation links, and user actions exactly where they belong. By default it uses a subtle shadow for visual elevation; switch to `bordered` for a flat look with a bottom border instead.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Note
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
5
7
|
Notes call attention to supplementary information without interrupting the main content flow. Use them for tips, requirements, deprecation warnings, or any contextual message that readers should notice but shouldn't be blocked by. A colored left border and tinted background create just enough contrast to stand out.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Notice
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
5
7
|
Notices communicate short, timely status information. They are deliberately more compact than [Notes](./note.md): use a Notice for a sentence near a control or directly below an application header, and a Note for rich supporting content inside a page.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Number Input
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile sizes under .coar-mobile; the mobile presentation is still Preview.
|
|
6
|
+
|
|
5
7
|
A purpose-built input for numeric values. It enforces min/max bounds, supports configurable step increments, and offers optional stepper buttons so users can nudge values up or down without typing.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# OTP Input (New in 2.0)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Works on phones (numeric keyboard, SMS autofill) but has no .coar-mobile presentation yet.
|
|
6
|
+
|
|
5
7
|
The N-cell input for verification codes — 2FA / TOTP from authenticator apps, SMS one-time passwords, claim codes, short PINs. Auto-advances as the user types, jumps back on Backspace, spreads pasted codes across cells, and fires a `complete` event the moment the last cell fills so you can submit without a button click.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# `<CoarPageBuilder>` (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone not supported — Drag and drop works by touch; code editing uses Monaco, not made for touch; not meant for phones.
|
|
6
|
+
|
|
5
7
|
The visual-editor half of `@cocoar/vue-page-builder`. It renders a three-panel layout: the vertically split Outline and Properties inspector on the left, the canvas in the centre, and a searchable element library on the right. It emits a `PageNode` JSON tree as `v-model`; the same tree is consumed by [`<CoarPageRenderer>`](./coar-page-renderer.md) at runtime.
|
|
6
8
|
|
|
7
9
|
All three panels are resizable via drag handles and collapsible.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# `<CoarPageRenderer>` (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Responsive pages adapt to phone widths; its select and date fields still open desktop panels.
|
|
6
|
+
|
|
5
7
|
The runtime-renderer half of `@cocoar/vue-page-builder`. Takes a `PageNode` schema (produced by [`<CoarPageBuilder>`](./coar-page-builder.md) or written by hand) and renders it as live Cocoar components. This is the component you mount on the actual page that end-users see.
|
|
6
8
|
|
|
7
9
|
The renderer is also the **security boundary** — elements not in `config.allowedElements` are skipped at render time, even if they appear in hand-written or tampered JSON.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Pagination
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Works on phones with fewer maxVisiblePages, but has no .coar-mobile presentation yet.
|
|
6
|
+
|
|
5
7
|
Split large collections into digestible pages and let users navigate between them. Pagination automatically calculates page count from `totalItems` and `pageSize`, and intelligently truncates the page range with ellipses when there are too many pages to display at once.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Panel Layout (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone not supported — Resize dividers are 6 px wide and hard to hit by touch; the workbench layout is not meant for phones.
|
|
6
|
+
|
|
5
7
|
A VS-Code-style workbench: named, resizable regions you fill with whatever you like. Two pieces:
|
|
6
8
|
|
|
7
9
|
- **`CoarSplitPane`** — the primitive: two panes with a draggable divider. Nestable.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Password Input
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile sizes under .coar-mobile; the mobile presentation is still Preview.
|
|
6
|
+
|
|
5
7
|
A text input tailored for passwords. It masks characters by default and provides a built-in eye toggle so users can temporarily reveal what they typed -- reducing frustration without sacrificing security.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Popconfirm
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone planned — Opens on tap; touch-sized popovers for phones are planned.
|
|
6
|
+
|
|
5
7
|
A lightweight confirmation bubble that appears right next to the trigger element. Use it for quick "are you sure?" moments -- deleting a row, removing a team member, or publishing a change -- without pulling the user out of context with a full-screen modal dialog.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Popover
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone planned — The default hover mode relies on emulated mouse events on touch; use mode 'click' or 'both'.
|
|
6
|
+
|
|
5
7
|
Popovers display rich, interactive content anchored to a trigger element. Unlike tooltips (which are text-only and non-interactive), popovers can hold forms, menus, formatted text, and action buttons. They stay open until the user clicks away or presses Escape, giving people time to interact with the content inside.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Progress Bar
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
5
7
|
Progress bars keep users informed about ongoing operations -- file uploads, multi-step workflows, or background tasks. They reduce uncertainty by showing either a concrete completion percentage or an animated indicator when the duration is unknown.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Radio Group
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile sizes under .coar-mobile; the mobile presentation is still Preview.
|
|
6
|
+
|
|
5
7
|
When users must pick exactly one option from a small set of mutually exclusive choices, a radio group is the right tool. Each option is visible at a glance, unlike a select dropdown, which makes radios ideal when the list is short (roughly 2--5 items).
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Script Editor
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone not supported — Monaco does not support mobile browsers; touch editing has gaps and phones are out of scope.
|
|
6
|
+
|
|
5
7
|
A Monaco-based code editor for Vue 3 with Cocoar Design System theming. Supports **TypeScript, JavaScript, and JSON**, with first-class support for user-supplied type definitions (IntelliSense for your domain types).
|
|
6
8
|
|
|
7
9
|
> **Info: Separate Package**
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Segmented Control
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone planned — A .coar-mobile presentation is planned.
|
|
6
|
+
|
|
5
7
|
Switch between a small fixed set of mutually-exclusive options like view modes, filters, density, or time ranges. A segmented control reads as a button-bar for view-state — same semantics as a radio group (single selection from N options), different visual register: it belongs in toolbars and headers, not in forms.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Sidebar
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — Split-trigger flyouts open only on hover and icon-only labels are tooltips; no phone drawer.
|
|
6
|
+
|
|
5
7
|
A structured navigation sidebar with three distinct sections: a header for branding, a scrollable content area for navigation, and a footer for secondary actions. Use the dedicated sidebar components (`CoarSidebarItem`, `CoarSidebarGroup`, `CoarSidebarHeading`, `CoarSidebarDivider`, `CoarSidebarSpacer`) for full collapsed/expanded support with automatic tooltips.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Spinner
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone ready
|
|
6
|
+
|
|
5
7
|
Spinners signal that something is loading when you can't show a progress bar. They tell users "we're working on it" for network requests, lazy-loaded content, or any asynchronous operation with an unpredictable duration.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Switch
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile sizes under .coar-mobile; the mobile presentation is still Preview.
|
|
6
|
+
|
|
5
7
|
A toggle for boolean settings that take effect immediately -- think "Enable notifications" or "Dark mode". Unlike a [Checkbox](./checkbox.md), a switch signals instant action rather than a deferred choice that requires a submit button.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Table
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Wide tables need a scroll container from the host; nothing wraps them for narrow screens.
|
|
6
|
+
|
|
5
7
|
A lightweight table wrapper that provides consistent styling, alternating row colors, and proper alignment out of the box. Use it whenever you need to present structured data -- user lists, order histories, configuration settings, or comparison grids.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Tabs
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — The tab bar neither scrolls nor wraps, so many tabs overflow phone widths.
|
|
6
|
+
|
|
5
7
|
Organize related content into separate panels that users switch between without leaving the page. Tabs are ideal for settings screens, detail views, and any layout where showing everything at once would feel overwhelming. The active tab is controlled via `v-model`, so you can read or set it programmatically.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Tag
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — The close button is a 10–14 px icon without a larger touch target.
|
|
6
|
+
|
|
5
7
|
Tags label, categorize, and organize content. Use them for metadata (status labels, technology stacks), filter chips, or user-driven selections. Unlike badges, which show counts and status dots, tags convey descriptive information that users can read and often interact with.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Text Input
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Mobile sizes under .coar-mobile; the mobile presentation is still Preview.
|
|
6
|
+
|
|
5
7
|
The go-to component for collecting short text from users -- names, emails, search queries, and more. It handles labels, validation, prefix/suffix decorations, and can even stretch into a textarea when you need longer content.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Toast
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Toasts are a fixed 380 px wide and overflow 360 px phone screens.
|
|
6
|
+
|
|
5
7
|
Non-blocking notification messages that slide in, deliver a brief update, and dismiss themselves. Toasts are perfect for confirming background actions -- a file uploaded, a record saved, or a network error encountered -- without interrupting the user's current workflow.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Tooltip
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone partial — Hints show on hover or focus, so touch users may not see them; keep essential information elsewhere.
|
|
6
|
+
|
|
5
7
|
Tooltips are small, text-only hints that appear on hover or focus. They are the simplest way to add contextual labels to icon buttons, truncated text, or any element that benefits from a brief explanation. Use the `v-tooltip` directive on any element -- no wrapper component needed.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Tree
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet partial · phone not supported — Desktop-first: right-click menus, HTML5 drag and hover-revealed row actions are not tuned for touch.
|
|
6
|
+
|
|
5
7
|
A generic, keyboard-navigable, drag-drop-aware tree primitive. Identity, children and label are extracted via prop functions — render any node shape (file systems, navigation, settings, categories, …) without forcing a common base type.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Wizard (Preview)
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Works on phones and the step indicator scrolls, but there is no .coar-mobile presentation yet.
|
|
6
|
+
|
|
5
7
|
A multi-step flow shell — built to live **inside a modal** (it renders no modal of its own). Three things make it a wizard rather than a plain stepper:
|
|
6
8
|
|
|
7
9
|
- **Animated body resize.** Only the active step is mounted, and the body smoothly animates its height between steps — so the surrounding modal grows / shrinks to fit each page.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Zoned DateTime Picker
|
|
4
4
|
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone planned — A phone presentation (sheet) is planned.
|
|
6
|
+
|
|
5
7
|
The full-featured datetime picker for timezone-aware values. It captures a date, time, and IANA timezone as a single `Temporal.ZonedDateTime`, making it easy to derive UTC instants for storage while preserving the user's original intent.
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -42,11 +42,14 @@ Design for everyone. Meet WCAG AA standards at minimum. Keyboard navigation is n
|
|
|
42
42
|
|
|
43
43
|
### Touch-First
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Components are designed to work with **touch and focus** — hover is meant as an enhancement, not a requirement. This is **tablet-first** design: touch interaction with desktop-appropriate information density. Not mobile-first — mobile phones have different constraints (small screens, portrait orientation, one-handed use). Tablets have similar screen real estate to laptops but use touch instead of mouse.
|
|
46
46
|
|
|
47
|
-
-
|
|
47
|
+
- The default presentation follows the size scale of the design tokens: `xs` 27 px, `s` 32 px, `m` 40 px, `l` 48 px high
|
|
48
|
+
- The [mobile presentation](../guide/mobile.md) (`.coar-mobile`) raises the adapted controls to at least 44 px, with 44 × 44 px targets for their actions
|
|
49
|
+
- The phone presentation is an **opt-in**: tablet-first stays the default, and nothing switches by viewport width or device detection
|
|
50
|
+
- **Appearance follows the class, behaviour follows the input**: `.coar-mobile` changes sizes only; how a component reacts (hover, drag, gestures) depends on the input the browser reports, never on the class
|
|
48
51
|
- Appropriate tap spacing to prevent accidental activation
|
|
49
|
-
- No hover-only interactions — every feature is reachable via tap or keyboard
|
|
52
|
+
- No hover-only interactions — every feature is reachable via tap or keyboard; where a component does not meet this yet, the device line under its title says so
|
|
50
53
|
- Use dimmed states instead of hiding; on focus/hover elements become prominent
|
|
51
54
|
- Desktop gets additional polish (hover states) as progressive enhancement
|
|
52
55
|
|
|
@@ -74,6 +77,27 @@ Strong TypeScript types. Composable APIs. Predictable naming. The system should
|
|
|
74
77
|
|
|
75
78
|
---
|
|
76
79
|
|
|
80
|
+
## Stability promise for web apps
|
|
81
|
+
|
|
82
|
+
What runs without `.coar-mobile` keeps its look and behaviour. Mobile work does not change web apps that do not ask for it:
|
|
83
|
+
|
|
84
|
+
- **Mobile work is opt-in** — through the `.coar-mobile` class for appearance, or through a new prop or option whose default is today's behaviour. New tokens default to today's value.
|
|
85
|
+
- **It is checked, not just promised** — the playground has visual baselines of the default presentation, compared pixel for pixel on every pull request. A changed default image is merged only with the maintainer's explicit approval.
|
|
86
|
+
- **A second presentation, not a rebuilt one** — a component whose phone interaction is fundamentally different gets a second presentation next to the existing one instead of a rebuilt desktop view.
|
|
87
|
+
- **Preview first, breaking changes only in a major** — new features carry the Preview badge, and breaking changes come only with a major version.
|
|
88
|
+
- **The exception is a bug fix** — it may change what is visible, and is then listed as a fix in the release notes.
|
|
89
|
+
|
|
90
|
+
### Known legacy
|
|
91
|
+
|
|
92
|
+
A few places react today to the viewport width or the primary pointer instead of an opt-in. They stay as they are:
|
|
93
|
+
|
|
94
|
+
- `@cocoar/vue-ui/styles` (`base.css`) scales the title and heading sizes down below 1024 px and again below 768 px viewport width.
|
|
95
|
+
- The panels of `CoarPlainDatePicker`, `CoarPlainDateTimePicker` and `CoarZonedDateTimePicker` stack their parts and become scrollable below 540 px viewport width.
|
|
96
|
+
- `CoarNotice` banners wrap and reduce their padding below 640 px viewport width.
|
|
97
|
+
- `CoarCalendar` lets its view switcher take a full row below 48rem viewport width, in addition to the same rule by container width.
|
|
98
|
+
- The translations panel of `CoarPageBuilder` stacks its header and toolbar below 820 px viewport width.
|
|
99
|
+
- `useDragDrop` with `engine: 'auto'` picks the pointer engine when the primary pointer is coarse (`(pointer: coarse)`) and the native HTML5 engine otherwise. The default engine is `'native'`.
|
|
100
|
+
|
|
77
101
|
## Design Token Architecture
|
|
78
102
|
|
|
79
103
|
Cocoar uses a **two-layer token system**: raw primitives are referenced by semantic tokens. Always use semantic tokens in your components — they adapt automatically to light and dark mode.
|