@cocoar/vue-ui 3.2.0-beta.6 → 3.2.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/bin/cli.mjs +53 -0
- package/package.json +6 -2
- package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +19 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +3 -1
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +16 -5
- package/skills/cocoar-vue-ui/references/guide/getting-started.md +10 -13
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `npx @cocoar/vue-ui skill` — install the Agent Skill that ships in this package.
|
|
3
|
+
//
|
|
4
|
+
// The skill sits in skills/cocoar-vue-ui/ at the package root. The skills CLI (npx skills,
|
|
5
|
+
// https://github.com/vercel-labs/skills) installs skills from git repos and local folders but
|
|
6
|
+
// has no npm source, so the plain command would be `npx skills add ./node_modules/@cocoar/vue-ui`.
|
|
7
|
+
// This bin resolves that path for the caller and hands everything else — agent detection,
|
|
8
|
+
// install directories, lockfile, `npx skills update` — to the skills CLI. Extra arguments pass
|
|
9
|
+
// through (`-g`, `-a claude-code`, `--copy`, `-y`, …).
|
|
10
|
+
|
|
11
|
+
import { spawnSync } from 'node:child_process';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
const packageDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
17
|
+
const skillDir = path.join(packageDir, 'skills', 'cocoar-vue-ui');
|
|
18
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
19
|
+
|
|
20
|
+
if (command !== 'skill' || rest.includes('--help') || rest.includes('-h')) {
|
|
21
|
+
console.log(`Usage: npx @cocoar/vue-ui skill [skills-cli options]
|
|
22
|
+
|
|
23
|
+
Installs the Cocoar UI Vue Agent Skill for Claude Code, Cursor, Codex, Copilot and other
|
|
24
|
+
agents via the skills CLI (npx skills add). Options are passed through, for example:
|
|
25
|
+
|
|
26
|
+
npx @cocoar/vue-ui skill interactive: pick agents
|
|
27
|
+
npx @cocoar/vue-ui skill -y accept defaults
|
|
28
|
+
npx @cocoar/vue-ui skill -g install user-wide instead of into the project
|
|
29
|
+
npx @cocoar/vue-ui skill -a claude-code target one agent
|
|
30
|
+
|
|
31
|
+
Skill source: ${skillDir}`);
|
|
32
|
+
process.exit(command === 'skill' ? 0 : 1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!existsSync(path.join(skillDir, 'SKILL.md'))) {
|
|
36
|
+
console.error(`No skill found at ${skillDir} — this build of @cocoar/vue-ui does not ship one.`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// npx is a .cmd shim on Windows, which Node only runs through a shell; quote the path for it.
|
|
41
|
+
const windows = process.platform === 'win32';
|
|
42
|
+
const quote = (arg) => (windows && /[\s"]/.test(arg) ? `"${arg.replace(/"/g, '\\"')}"` : arg);
|
|
43
|
+
const result = spawnSync('npx', ['--yes', 'skills', 'add', packageDir, ...rest].map(quote), {
|
|
44
|
+
stdio: 'inherit',
|
|
45
|
+
shell: windows,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (result.error) {
|
|
49
|
+
console.error(`Could not run the skills CLI (${result.error.message}).`);
|
|
50
|
+
console.error(`Install it by hand instead: npx skills add ${packageDir}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocoar/vue-ui",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.8",
|
|
4
4
|
"description": "Cocoar Design System — a touch-first Vue 3 component library with 30+ accessible, themeable components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,11 @@
|
|
|
38
38
|
"types": "./dist/fonts.d.ts"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
"bin": {
|
|
42
|
+
"cocoar-vue-ui": "./bin/cli.mjs"
|
|
43
|
+
},
|
|
41
44
|
"files": [
|
|
45
|
+
"bin",
|
|
42
46
|
"dist",
|
|
43
47
|
"styles",
|
|
44
48
|
"skills"
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
"typecheck": "vue-tsc --noEmit"
|
|
52
56
|
},
|
|
53
57
|
"dependencies": {
|
|
54
|
-
"@cocoar/vue-localization": "3.2.0-beta.
|
|
58
|
+
"@cocoar/vue-localization": "3.2.0-beta.8",
|
|
55
59
|
"@fontsource/cascadia-code": "^5.2.3",
|
|
56
60
|
"@fontsource/inter": "^5.2.8",
|
|
57
61
|
"@fontsource/poppins": "^5.2.7",
|
|
@@ -351,3 +351,22 @@ interface CalendarApi<TMeta> {
|
|
|
351
351
|
| `event` | `{ event, item }` | Per-row renderer. `item` is the full `AgendaEventItem` (event + `isContinuation` flag). |
|
|
352
352
|
| `dayGroupHeader` | `{ date, item, isToday }` | Per-day header renderer (same component renders the inline + floating overlay). |
|
|
353
353
|
| `empty` | — | Empty state. Shown only when the list draws nothing — no events in the window, `showEmptyDays` off — and no load is in flight. No default; without the slot the surface stays blank. Rendered as a non-interactive overlay so the list stays mounted. Inside `<CoarCalendar>` use the `agendaEmpty` slot. |
|
|
354
|
+
| `weekStripStart` | `WeekStripSlotScope` | Day agenda only. Content at the start of the seven-day week strip, e.g. a previous-week button. |
|
|
355
|
+
| `weekStripEnd` | `WeekStripSlotScope` | Day agenda only. Content at the end of the week strip, e.g. a next-week button. |
|
|
356
|
+
|
|
357
|
+
### Day agenda week strip
|
|
358
|
+
|
|
359
|
+
`view="dayAgenda"` renders a seven-day strip above the list; tapping a day moves the builder cursor. The strip has two slots for host controls at either end. Both receive the same `WeekStripSlotScope`: `cursor` (selected day), `weekStart` / `weekEnd` (the strip's window), `goTo(date)` and `shiftWeek(n)` — `-1` pages to the previous week, `1` to the next. The slot content sizes itself; the seven day buttons take the remaining width.
|
|
360
|
+
|
|
361
|
+
```vue
|
|
362
|
+
<CoarAgendaView :builder="builder" view="dayAgenda">
|
|
363
|
+
<template #weekStripStart="{ shiftWeek }">
|
|
364
|
+
<button type="button" aria-label="Vorige Woche" @click="shiftWeek(-1)">‹</button>
|
|
365
|
+
</template>
|
|
366
|
+
<template #weekStripEnd="{ shiftWeek }">
|
|
367
|
+
<button type="button" aria-label="Nächste Woche" @click="shiftWeek(1)">›</button>
|
|
368
|
+
</template>
|
|
369
|
+
</CoarAgendaView>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Inside `<CoarCalendar>` the same slots exist under the same names and reach the day agenda when it is the active view.
|
|
@@ -1558,7 +1558,8 @@ The builder is **flat** — every setter lives directly on it. There are no sub-
|
|
|
1558
1558
|
| `dayColumnCount(n)` | `MaybeRefOrGetter<number>` | Minimum complete columns in Multi-day mode. Clamped to `1…7`. |
|
|
1559
1559
|
| `dayColumnMinWidth(px)` | `MaybeRefOrGetter<number>` | Target width used to derive extra Multi-day columns. |
|
|
1560
1560
|
| `density(d)` | `MaybeRefOrGetter<'comfortable' \| 'compact'>` | Row / padding tightness. |
|
|
1561
|
-
| `maxEventsPerCell(n)` | `MaybeRefOrGetter<number>` |
|
|
1561
|
+
| `maxEventsPerCell(n)` | `MaybeRefOrGetter<number>` | Single-day pills a Details month cell shows before the rest fold into `+N`. Default `2`, like iOS. |
|
|
1562
|
+
| `monthMaxVisibleLanes(n)` | `MaybeRefOrGetter<number \| null>` | Multi-day lanes a month week row shows before the remaining bars fold into the covered days' `+N`. Default `2`; `null` = the row grows with every lane. |
|
|
1562
1563
|
| `agendaLengthDays(n)` | `MaybeRefOrGetter<number>` | Days the agenda window covers. Default `30`. |
|
|
1563
1564
|
| `showEmptyDays(b)` | `MaybeRefOrGetter<boolean>` | Render headers for empty days (agenda). |
|
|
1564
1565
|
| `availableViews(v)` | `MaybeRefOrGetter<readonly CalendarView[]>` | Filter the view-switcher. |
|
|
@@ -1630,6 +1631,7 @@ Variant-specific slots (`pill`, `multiDayBar`, `allDayEvent`) still exist on the
|
|
|
1630
1631
|
| `allDayEvent` | `{ event, layout }` | All-day band renderer (week / day). |
|
|
1631
1632
|
| `pill` | `{ event, pill }` | Month single-day pill. |
|
|
1632
1633
|
| `agendaEmpty` | — | Agenda empty state (forwarded to `<CoarAgendaView>`'s `empty` slot). Shown only when the agenda draws nothing and no load is in flight; no default. |
|
|
1634
|
+
| `weekStripStart` / `weekStripEnd` | `WeekStripSlotScope` | Day agenda: host controls at either end of the seven-day week strip (e.g. previous / next week via `shiftWeek(±1)`). Forwarded to `<CoarAgendaView>`. |
|
|
1633
1635
|
| `multiDayBar` | `{ event, bar }` | Month multi-day bar. |
|
|
1634
1636
|
| `dayHeader` | `{ date, isToday, isWeekend }` | Per-day column header (week / day). |
|
|
1635
1637
|
|
|
@@ -8,7 +8,7 @@ The shell's Month view follows the iOS structure: months scroll continuously and
|
|
|
8
8
|
|---|---|
|
|
9
9
|
| Compact | 52 px base week rows; per-day events combine into a segmented colour capsule. |
|
|
10
10
|
| Stacked | 68 px base rows; compact individual event marks. |
|
|
11
|
-
| Details | 94 px base rows; titles, assignees, multi-day bars and row
|
|
11
|
+
| Details | 94 px base rows; titles, assignees, multi-day bars and a `+N` row for whatever does not fit. |
|
|
12
12
|
| List | Compact month selector plus the selected day's event list; stacked in narrow containers and side-by-side from 720 px. |
|
|
13
13
|
|
|
14
14
|
The regular Month choices use `<CoarContinuousMonthView>`. `<CoarMonthView>` remains exported as the lower-level single-month section for widgets and custom compositions.
|
|
@@ -426,15 +426,26 @@ Full reference: see [the composer's API reference](./coar-calendar.md#api-refere
|
|
|
426
426
|
| `firstDayOfWeek(d)` | `0..6 \| undefined` | locale-aware | `0` = Sunday, `1` = Monday, … |
|
|
427
427
|
| `monthDensity(d)` | `'compact' \| 'stacked' \| 'details'` | `'details'` | Presentation used by continuous Month. |
|
|
428
428
|
| `shadeWeekends(b)` | `MaybeRefOrGetter<boolean>` | `true` | Shades Saturday / Sunday cells and weekday headers. Set `false` for an unshaded appearance. |
|
|
429
|
-
| `maxEventsPerCell(n)` | `MaybeRefOrGetter<number>` | `
|
|
429
|
+
| `maxEventsPerCell(n)` | `MaybeRefOrGetter<number>` | `2` | Single-day pills a **Details** cell shows before the rest fold into the `+N` row. Stacked and Compact use fixed limits (2 marks / 6 capsule segments) like iOS. |
|
|
430
|
+
| `monthMaxVisibleLanes(n)` | `MaybeRefOrGetter<number \| null>` | `2` | Multi-day lanes a week row shows. Bars past the cap leave the band and count into the `+N` of every day they cover; `null` lets the row grow with every lane. |
|
|
430
431
|
| `eventRenderer(r)` | `EventRenderer<TMeta>` | — | Universal renderer. Branch on `ctx.layout?.kind === 'monthPill' \| 'monthBar'` for variant-specific rendering — see the example above. |
|
|
431
432
|
| `dayHeaderRenderer(r)` | `DayHeaderRenderer` | — | Weekday-strip header (Mon / Tue / ...). |
|
|
432
433
|
|
|
433
|
-
##
|
|
434
|
+
## Overflow — the `+N` row
|
|
434
435
|
|
|
435
|
-
|
|
436
|
+
Month rows have a fixed height per density plus the height of the week's multi-day lane band, and that band is capped too: a row shows at most `monthMaxVisibleLanes` lanes (default **2**). A multi-day bar past the cap leaves the band entirely — it is never clipped mid-row — and counts into the `+N` of every day it covers. `null` restores the unbounded band of the iOS port, where a week grows with every lane.
|
|
436
437
|
|
|
437
|
-
|
|
438
|
+
A Details cell renders its first `maxEventsPerCell` single-day pills (default **2**) and folds the rest, together with the folded bars covering the day, into one `+N` row in the subtle text colour. Stacked shows 2 marks and Compact 6 capsule segments and, like iOS, cap silently — their marks carry no titles, so the day has to be opened either way. Cells never scroll, and there is no per-cell menu or row expansion.
|
|
439
|
+
|
|
440
|
+
On the web the `+N` row is a button (accessible name "N more events", `aria-haspopup="dialog"`). It opens a **day sheet** over that one cell: a small dialog aligned to the cell's top-left edge that lists every event of the day — the multi-day events covering it first (visible lanes, then folded ones), then the single-day pills — and scrolls when the list is long. The sheet opens downward and flips upward when the space below inside the scroll container is short; it never expands the row or the grid. Every pill in the sheet is a live pill with the grid's own wiring — drag it onto any other day, move it with the keyboard, double-click it for `onEventDoubleClick`. The sheet closes on Escape, its close control, a pointerdown outside it, another `+N`, or when the month changes; focus returns to the `+N` button.
|
|
441
|
+
|
|
442
|
+
A tap on the cell body still fires `onDateClick` (the `+N` button does not), so a host that prefers its own day surface keeps working unchanged.
|
|
443
|
+
|
|
444
|
+
In the grid itself hidden events are not in the DOM, so keyboard focus and drag-and-drop there reach only the visible pills; the sheet is where the rest become reachable. Drop onto a full cell works either way: a drag preview takes the last visible slot so the target is always visible.
|
|
445
|
+
|
|
446
|
+
```ts
|
|
447
|
+
builder.monthDensity('details').maxEventsPerCell(3); // three titles, then +N
|
|
448
|
+
```
|
|
438
449
|
|
|
439
450
|
## Drag and drop
|
|
440
451
|
|
|
@@ -91,26 +91,23 @@ in your project knows the library's API and the mistakes it would otherwise make
|
|
|
91
91
|
`skills/` folder at the package root and takes no part in your build: nothing is loaded unless you
|
|
92
92
|
install it.
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
Cursor, Codex, Copilot and others):
|
|
94
|
+
Once `@cocoar/vue-ui` is installed, one command installs the skill of exactly that version:
|
|
96
95
|
|
|
97
96
|
```bash
|
|
98
|
-
|
|
99
|
-
npx skills add ./node_modules/@cocoar/vue-ui
|
|
100
|
-
|
|
101
|
-
# Or straight from GitHub — the latest docs
|
|
102
|
-
npx skills add cocoar-dev/cocoar-ui-vue
|
|
97
|
+
npx @cocoar/vue-ui skill
|
|
103
98
|
```
|
|
104
99
|
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
It hands the package's skill folder to the [skills CLI](https://github.com/vercel-labs/skills),
|
|
101
|
+
which detects the agents in your project (Claude Code, Cursor, Codex, Copilot and others) and
|
|
102
|
+
asks where to install. Its options pass through: `-y` accepts the defaults, `-g` installs
|
|
103
|
+
user-wide instead of into the project, `-a claude-code` targets one agent.
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
agentskills-cli
|
|
110
|
-
|
|
105
|
+
Two alternatives: `npx skills add cocoar-dev/cocoar-ui-vue` takes the latest docs straight from
|
|
106
|
+
GitHub, and [agentskills-cli](https://mysticmind.github.io/agentskills-cli/) (a .NET tool that
|
|
107
|
+
also reads npm packages) installs it with `agentskills-cli add @cocoar/vue-ui`.
|
|
111
108
|
|
|
112
109
|
Either places the skill in `.claude/skills/` for Claude Code and `.agents/skills/` for the
|
|
113
|
-
agents that read the standard
|
|
110
|
+
agents that read the standard. Without a tool, copy
|
|
114
111
|
`node_modules/@cocoar/vue-ui/skills/cocoar-vue-ui/` into the same folder by hand.
|
|
115
112
|
|
|
116
113
|
The skill is generated from these docs, so it says what the docs say for the version you
|