@maltjoy/mcp-server 0.4.0 → 0.6.0-beta.0

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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -3
  3. package/dist/doc/VJoyAdminBanner/guideline.md +284 -0
  4. package/dist/doc/VJoyAvailability/guideline.md +352 -0
  5. package/dist/doc/VJoyAvatar/guideline.md +192 -0
  6. package/dist/doc/VJoyAvatarsList/guideline.md +328 -0
  7. package/dist/doc/VJoyBadge/guideline.md +169 -0
  8. package/dist/doc/VJoyBadgeLevel/guideline.md +166 -0
  9. package/dist/doc/VJoyBlockSkeleton/guideline.md +150 -0
  10. package/dist/doc/VJoyBottomSheet/guideline.md +345 -0
  11. package/dist/doc/VJoyBottomSheetTrigger/guideline.md +156 -0
  12. package/dist/doc/VJoyButton/guideline.md +371 -0
  13. package/dist/doc/VJoyButton/metadata.json +0 -16
  14. package/dist/doc/VJoyButtonCard/guideline.md +384 -0
  15. package/dist/doc/VJoyCheckbox/guideline.md +317 -0
  16. package/dist/doc/VJoyCheckboxCard/guideline.md +381 -0
  17. package/dist/doc/VJoyCheckboxGroup/guideline.md +363 -0
  18. package/dist/doc/VJoyCheckboxGroup/metadata.json +7 -7
  19. package/dist/doc/VJoyCollapse/guideline.md +362 -0
  20. package/dist/doc/VJoyCollapseItem/guideline.md +394 -0
  21. package/dist/doc/VJoyCompanyAvatar/guideline.md +162 -0
  22. package/dist/doc/VJoyDialog/guideline.md +425 -0
  23. package/dist/doc/VJoyDialogTrigger/guideline.md +186 -0
  24. package/dist/doc/VJoyDot/guideline.md +177 -0
  25. package/dist/doc/VJoyDrawer/guideline.md +392 -0
  26. package/dist/doc/VJoyDrawerTrigger/guideline.md +145 -0
  27. package/dist/doc/VJoyDropdown/guideline.md +393 -0
  28. package/dist/doc/VJoyDropdown/metadata.json +6 -6
  29. package/dist/doc/VJoyDropdownList/guideline.md +396 -0
  30. package/dist/doc/VJoyDropdownList/metadata.json +7 -7
  31. package/dist/doc/VJoyDropzone/guideline.md +390 -0
  32. package/dist/doc/VJoyDropzone/metadata.json +36 -1
  33. package/dist/doc/VJoyFilterBar/guideline.md +419 -0
  34. package/dist/doc/VJoyFilterBarButton/guideline.md +359 -0
  35. package/dist/doc/VJoyFloatingActionsBar/guideline.md +372 -0
  36. package/dist/doc/VJoyFormError/guideline.md +325 -0
  37. package/dist/doc/VJoyFormError/metadata.json +0 -14
  38. package/dist/doc/VJoyFormFieldSkeleton/guideline.md +159 -0
  39. package/dist/doc/VJoyFormGroup/guideline.md +285 -0
  40. package/dist/doc/VJoyFunnel/guideline.md +349 -0
  41. package/dist/doc/VJoyFunnelFooter/guideline.md +178 -0
  42. package/dist/doc/VJoyFunnelHeader/guideline.md +204 -0
  43. package/dist/doc/VJoyHighlight/guideline.md +169 -0
  44. package/dist/doc/VJoyIcon/JoyIcon.types.ts +1 -1
  45. package/dist/doc/VJoyIcon/guideline.md +168 -0
  46. package/dist/doc/VJoyIcon/metadata.json +0 -1
  47. package/dist/doc/VJoyIconButton/guideline.md +169 -0
  48. package/dist/doc/VJoyIconButton/metadata.json +1 -1
  49. package/dist/doc/VJoyIndicator/guideline.md +168 -0
  50. package/dist/doc/VJoyIndicators/guideline.md +183 -0
  51. package/dist/doc/VJoyInput/JoyInput.types.ts +1 -6
  52. package/dist/doc/VJoyInput/guideline.md +401 -0
  53. package/dist/doc/VJoyInput/metadata.json +5 -14
  54. package/dist/doc/VJoyInputDigit/guideline.md +381 -0
  55. package/dist/doc/VJoyInputNumber/guideline.md +414 -0
  56. package/dist/doc/VJoyInputNumber/metadata.json +22 -17
  57. package/dist/doc/VJoyInputPassword/guideline.md +379 -0
  58. package/dist/doc/VJoyInputPassword/metadata.json +0 -14
  59. package/dist/doc/VJoyLabel/guideline.md +200 -0
  60. package/dist/doc/VJoyLink/guideline.md +360 -0
  61. package/dist/doc/VJoyListItem/guideline.md +335 -0
  62. package/dist/doc/VJoyMenu/guideline.md +304 -0
  63. package/dist/doc/VJoyMenu/metadata.json +21 -21
  64. package/dist/doc/VJoyMenuItem/guideline.md +352 -0
  65. package/dist/doc/VJoyPagination/guideline.md +355 -0
  66. package/dist/doc/VJoyPanel/guideline.md +238 -0
  67. package/dist/doc/VJoyPanelSection/guideline.md +160 -0
  68. package/dist/doc/VJoyPasswordRequirement/guideline.md +336 -0
  69. package/dist/doc/VJoyPasswordRequirement/metadata.json +1 -1
  70. package/dist/doc/VJoyProductTour/JoyProductTour.types.ts +0 -1
  71. package/dist/doc/VJoyProductTour/guideline.md +455 -0
  72. package/dist/doc/VJoyProductTour/metadata.json +1 -1
  73. package/dist/doc/VJoyProductTourTrigger/guideline.md +167 -0
  74. package/dist/doc/VJoyProgressBar/guideline.md +348 -0
  75. package/dist/doc/VJoyRadio/guideline.md +346 -0
  76. package/dist/doc/VJoyRadioGroup/guideline.md +331 -0
  77. package/dist/doc/VJoyRatingStars/guideline.md +306 -0
  78. package/dist/doc/VJoyScreenLoader/guideline.md +172 -0
  79. package/dist/doc/VJoySelect/guideline.md +396 -0
  80. package/dist/doc/VJoySelectableItem/guideline.md +351 -0
  81. package/dist/doc/VJoySelectableItemGroup/guideline.md +370 -0
  82. package/dist/doc/VJoySeparator/guideline.md +161 -0
  83. package/dist/doc/VJoySnackbar/guideline.md +402 -0
  84. package/dist/doc/VJoySpinner/guideline.md +168 -0
  85. package/dist/doc/VJoyStep/guideline.md +182 -0
  86. package/dist/doc/VJoyStepper/guideline.md +390 -0
  87. package/dist/doc/VJoyTab/guideline.md +298 -0
  88. package/dist/doc/VJoyTabs/guideline.md +353 -0
  89. package/dist/doc/VJoyTag/guideline.md +226 -0
  90. package/dist/doc/VJoyTagsInput/guideline.md +387 -0
  91. package/dist/doc/VJoyTagsList/guideline.md +311 -0
  92. package/dist/doc/VJoyTagsList/metadata.json +27 -27
  93. package/dist/doc/VJoyTemplate/guideline.md +366 -0
  94. package/dist/doc/VJoyText/guideline.md +175 -0
  95. package/dist/doc/VJoyText/metadata.json +1 -1
  96. package/dist/doc/VJoyTextarea/guideline.md +378 -0
  97. package/dist/doc/VJoyTitleBrand/guideline.md +155 -0
  98. package/dist/doc/VJoyToggle/guideline.md +327 -0
  99. package/dist/doc/VJoyTooltip/guideline.md +322 -0
  100. package/dist/doc/VJoyUserCard/guideline.md +268 -0
  101. package/dist/doc/VJoyUserCard/metadata.json +3 -17
  102. package/dist/doc/VJoyWalkthrough/guideline.md +351 -0
  103. package/dist/doc/VJoyWalkthroughTrigger/guideline.md +171 -0
  104. package/dist/doc/VJoyWrapper/guideline.md +173 -0
  105. package/dist/doc/css-classes.json +1 -15
  106. package/dist/doc/design-tokens.json +1 -0
  107. package/dist/doc/index.json +20 -30
  108. package/dist/index.js +22 -2
  109. package/dist/index.js.map +1 -1
  110. package/dist/tools/get-component-guideline.d.ts +30 -0
  111. package/dist/tools/get-component-guideline.d.ts.map +1 -0
  112. package/dist/tools/get-component-guideline.js +51 -0
  113. package/dist/tools/get-component-guideline.js.map +1 -0
  114. package/dist/tools/get-documentation-page.d.ts +22 -0
  115. package/dist/tools/get-documentation-page.d.ts.map +1 -0
  116. package/dist/tools/get-documentation-page.js +21 -0
  117. package/dist/tools/get-documentation-page.js.map +1 -0
  118. package/dist/tools/list-documentation-pages.d.ts +22 -0
  119. package/dist/tools/list-documentation-pages.d.ts.map +1 -0
  120. package/dist/tools/list-documentation-pages.js +17 -0
  121. package/dist/tools/list-documentation-pages.js.map +1 -0
  122. package/dist/tools/search-documentation.d.ts +41 -0
  123. package/dist/tools/search-documentation.d.ts.map +1 -0
  124. package/dist/tools/search-documentation.js +25 -0
  125. package/dist/tools/search-documentation.js.map +1 -0
  126. package/dist/zeroheight-parser.d.ts +27 -0
  127. package/dist/zeroheight-parser.d.ts.map +1 -0
  128. package/dist/zeroheight-parser.js +77 -0
  129. package/dist/zeroheight-parser.js.map +1 -0
  130. package/package.json +10 -10
  131. package/dist/doc/VJoyMultiCheckbox/metadata.json +0 -332
@@ -0,0 +1,362 @@
1
+ ---
2
+ component: VJoyCollapse
3
+ status: draft
4
+ language: en
5
+ dsds: JoyCollapse.dsds.json
6
+ dsdsVersion: "0.15.2"
7
+ ---
8
+
9
+ # Collapse
10
+
11
+ Use **`VJoyCollapse`** with **`VJoyCollapseItem`** children when related content should stay on the page but only expand on demand — FAQs, optional form sections, filter groups, or side-panel detail blocks.
12
+
13
+ The container coordinates open state across items, supports **accordion** mode (one open panel at a time), optional **`v-model`** for programmatic control, and a visual **`mode`** (`default` or experimental `outline`).
14
+
15
+ | | |
16
+ | --- | --- |
17
+ | **Code** | `VJoyCollapse` + `VJoyCollapseItem` from `@maltjoy/core-vue` |
18
+ | **Design** | [ZeroHeight — Collapse](https://zeroheight.com/6bf479565/) (page id `4065429`) |
19
+ | **Storybook** | [VJoyCollapse docs](https://doc.malt.tech/joy-storybook/?path=/docs/components-buttons-vjoycollapse--docs) |
20
+ | **DSDS (machine)** | [`JoyCollapse.dsds.json`](./JoyCollapse.dsds.json) |
21
+ | **Live API** | `joy_get_component_info("VJoyCollapse")` · `joy_get_component_info("VJoyCollapseItem")` |
22
+
23
+ ---
24
+
25
+ ## When to use this component
26
+
27
+ Use a collapse when users benefit from scanning **section titles first** and opening only what they need. Typical jobs: FAQ lists, advanced settings tucked under a heading, grouped filters, or dense side panels where full content would overwhelm the initial view.
28
+
29
+ Each `VJoyCollapseItem` is an independent disclosure: a clickable summary (header, optional subheader, optional icon) and a panel with the main content. Use **`accordion`** when only one section should be open at a time (classic FAQ). Leave accordion off when several sections may stay open together.
30
+
31
+ ### When not to use this component
32
+
33
+ | Need | Use instead |
34
+ | --- | --- |
35
+ | Peer sections where every label should stay visible and one panel swaps in place | `VJoyTabs` |
36
+ | A linear multi-step flow with progress | `VJoyStepper` |
37
+ | Blocking focus on one decision or form | `VJoyDialog` |
38
+ | A single show/hide block with no list of sections | A heading + conditional content, or one `VJoyCollapseItem` only when the Joy pattern is required |
39
+ | Primary app or site navigation | App shell patterns (`VJoyMenu`, sidebar, header nav) |
40
+ | Custom accordion markup / ad-hoc chevron rows | Still use `VJoyCollapse` + `VJoyCollapseItem` + Joy tokens |
41
+
42
+ > **Naming:** there is no separate `VJoyAccordion` component. Set `accordion` on `VJoyCollapse` and bind `v-model`.
43
+
44
+ ---
45
+
46
+ ## How it works
47
+
48
+ `VJoyCollapse` reads **`VJoyCollapseItem`** children from its default slot (including via `v-for`), forwards `mode`, and syncs open state either from each item’s `open` prop or from the parent’s `v-model` array.
49
+
50
+ ### Anatomy
51
+
52
+ | Part | Required? | What it is |
53
+ | --- | --- | --- |
54
+ | Collapse container | Yes | Root `.joy-collapse` — stacks items; adds dividers in `default` mode |
55
+ | Collapse item | Yes (≥1) | `VJoyCollapseItem` — one disclosure per child |
56
+ | Summary control | Yes | Clickable header row (`role="button"`) — toggles the panel |
57
+ | Header | Yes | Title text (`header` prop on each item) |
58
+ | Subheader | No | Secondary line under the header (`subheader` prop) |
59
+ | Summary icon | No | Leading `VJoyIcon` (`summaryIcon` on the item) |
60
+ | Header right slot | No | `collapse-header-right` — tags, badges, or actions before the chevron |
61
+ | Preview slot | No | `collapse-preview` — short snippet visible while collapsed (outline mode) |
62
+ | Chevron marker | Yes | `chevron-down` icon; rotates when open |
63
+ | Detail panel | Yes | Default slot content; `role="region"` when open, labelled by item `id` |
64
+ | Focus ring | Yes | Outline mode highlights border on focus — don’t remove in product CSS |
65
+
66
+ ### Default values
67
+
68
+ - `accordion` on `VJoyCollapse` defaults to **`false`**
69
+ - `modelValue` on `VJoyCollapse` defaults to **`[]`**
70
+ - `mode` on `VJoyCollapse` defaults to **`default`** (passed to every item)
71
+ - `open` on `VJoyCollapseItem` defaults to **`false`**
72
+ - `header` on `VJoyCollapseItem` is **required**
73
+
74
+ Props, events, and slots: use Joy MCP or Storybook — this page focuses on **when** and **how**, not a full API dump.
75
+
76
+ ### Open-state patterns
77
+
78
+ **Uncontrolled (per item)** — set `open` on individual items. When `modelValue` is empty, the parent respects each item’s `open` prop.
79
+
80
+ ```vue
81
+ <VJoyCollapse>
82
+ <VJoyCollapseItem header="Shipping" :open="true">…</VJoyCollapseItem>
83
+ <VJoyCollapseItem header="Billing">…</VJoyCollapseItem>
84
+ </VJoyCollapse>
85
+ ```
86
+
87
+ **Controlled (`v-model`)** — bind `v-model` to a `string[]` of open item keys. **Give each item a stable `id`**; if `id` is omitted, the **`header` string** is used as the key (fragile when copy changes).
88
+
89
+ ```vue
90
+ <VJoyCollapse v-model="openSections">
91
+ <VJoyCollapseItem id="shipping" header="Shipping">…</VJoyCollapseItem>
92
+ <VJoyCollapseItem id="billing" header="Billing">…</VJoyCollapseItem>
93
+ </VJoyCollapse>
94
+ ```
95
+
96
+ **Accordion** — set `accordion` and use `v-model`. Opening one item closes the others; closing the active item yields an empty array.
97
+
98
+ ---
99
+
100
+ ## Variants
101
+
102
+ Visual treatment is driven by **`mode`** on `VJoyCollapse` (inherited by items). Choose by layout context, not decoration.
103
+
104
+ ### `default`
105
+
106
+ Stacked rows with **bottom borders** between items (`--joy-color-neutral-30`). Use in side panels, settings stacks, and inline FAQ lists where items should read as one continuous list.
107
+
108
+ Avoid when each section should feel like a separate card (use `outline`).
109
+
110
+ ### `outline`
111
+
112
+ **Experimental** — bordered cards (`--joy-core-radius-4`), hover/focus elevation, and active border (`--joy-color-secondary-50`). Use when sections need stronger separation or when pairing with `subheader`, `summaryIcon`, or `collapse-preview`.
113
+
114
+ Design notes indicate this mode may become the default later — prefer it for new card-like layouts after checking with design.
115
+
116
+ ### Not in the API: separate item `mode`
117
+
118
+ `VJoyCollapseItem` exposes `mode`, but the parent **`VJoyCollapse` `mode` prop is the supported way** to style a group. Don’t mix modes inside one collapse unless you have an explicit design exception.
119
+
120
+ ---
121
+
122
+ ## States
123
+
124
+ | State | What the user sees / can do |
125
+ | --- | --- |
126
+ | Collapsed (default) | Summary visible; panel hidden; chevron points down |
127
+ | Expanded | Panel visible; chevron rotated 180°; `joy-collapse-item--open` on the item |
128
+ | Hover (`outline`) | Border and shadow emphasize the card (pointer devices) |
129
+ | Focus (`outline`) | Same border treatment as hover — keyboard users must see it |
130
+ | Multiple open | Default when `accordion` is false — several panels may be open |
131
+ | Accordion open | At most one panel open; previous panel closes on open |
132
+ | Controlled open | `v-model` array lists ids (or headers) of open items |
133
+ | Preview visible | `collapse-preview` slot content shown in the summary area while collapsed |
134
+
135
+ There is **no disabled API** on collapse items. Hide sections users cannot access, or explain unavailability in the panel content.
136
+
137
+ ---
138
+
139
+ ## Best practices
140
+
141
+ Rules use RFC 2119 strength (**MUST** / **SHOULD** / **MUST NOT** / **SHOULD NOT**).
142
+
143
+ ### Structure / selection
144
+
145
+ - **MUST** compose `VJoyCollapse` with **`VJoyCollapseItem`** children — not hand-rolled disclosure rows.
146
+ - **SHOULD** keep section count modest (roughly **3–8** items); beyond that, reconsider IA or use tabs/navigation.
147
+ - **SHOULD** put the most important or frequently opened section first when order is flexible.
148
+ - **MUST** use `accordion` + `v-model` when only one section may be open (FAQ pattern).
149
+ - **MUST NOT** nest collapses more than one level deep without a strong content reason.
150
+
151
+ ### Implementation
152
+
153
+ - **MUST** set a stable **`id`** on every `VJoyCollapseItem` when using `v-model` or accordion mode.
154
+ - **MUST** use only documented props and `mode` values (`default`, `outline`) from MCP or types.
155
+ - **MUST** style with Joy tokens — no custom `.joy-collapse-item` chrome overrides.
156
+ - **MUST NOT** invent props (`size`, `variant`, `disabled`, …).
157
+ - **SHOULD** prefer `v-model` over scattering `open` props when open state is shared or persisted.
158
+ - **SHOULD** set `mode="outline"` on the parent for card-style sections; keep `default` for divider lists.
159
+
160
+ ### Slots and composition
161
+
162
+ - **SHOULD** use `collapse-header-right` for status tags or counts — not for the only label of the section.
163
+ - **SHOULD** use `collapse-preview` only for **short, scannable** summaries (chips, one line) — not full panel content.
164
+ - **MUST NOT** put primary actions that belong in the page footer only inside a collapsed panel without a visible summary cue.
165
+
166
+ ### Do / don’t
167
+
168
+ | Do | Don’t |
169
+ | --- | --- |
170
+ | Stable `id` + `v-model` for controlled state | Rely on `header` text as the model key when copy may change |
171
+ | `accordion` for single-open FAQ | `accordion` without `v-model` |
172
+ | Short parallel headers across items | Long questions as headers with no subheader |
173
+ | `summaryIcon` when it reinforces category | Decorative icon on every row |
174
+ | Joy spacing / border tokens | Hardcoded borders, radii, or chevron rotation CSS |
175
+
176
+ ---
177
+
178
+ ## Content
179
+
180
+ Collapse copy lives in the **header** (always visible) and optional **subheader** / **preview**. Panel body copy follows normal page writing rules.
181
+
182
+ ### Header formula
183
+
184
+ **Short noun phrase or tight question** — parallel grammar across items in the same collapse:
185
+
186
+ - ✅ Shipping address
187
+ - ✅ Payment method
188
+ - ✅ How do I cancel my subscription?
189
+
190
+ Use **sentence case**. FAQ sets may use questions; settings stacks usually use labels.
191
+
192
+ ### Subheader formula
193
+
194
+ **One line of context** under the header — eligibility, scope, or “last updated” — not a repeat of the header:
195
+
196
+ - ✅ Header: `Notifications` · Subheader: `Email and push`
197
+ - ❌ Subheader repeats the header verbatim
198
+
199
+ ### Writing rules
200
+
201
+ | Strength | Rule |
202
+ | --- | --- |
203
+ | **MUST** | Every item has a **`header`** — the summary control has no other accessible name |
204
+ | **MUST** | Headers stay **distinct** within the set — no two items that differ only by punctuation |
205
+ | **MUST NOT** | Use “Click to expand” or “Show more” as the only header text |
206
+ | **MUST NOT** | Hide critical warnings only inside collapsed content without a clear header cue |
207
+ | **SHOULD** | Keep headers **≤ 60 characters**; move detail into subheader or panel |
208
+ | **SHOULD** | Use parallel structure across items (all questions, or all labels) |
209
+ | **SHOULD** | Put counts or status in `collapse-header-right` (`VJoyTag`) when they help scanning |
210
+ | **SHOULD** (FR) | Follow French grammar for questions and articles when localized |
211
+
212
+ ### Patterns
213
+
214
+ **FAQ** — `accordion` + `v-model`; question as `header`; answer in the default slot. Open the first item only if it is the top question.
215
+
216
+ **Advanced settings** — `default` mode; neutral headers (`Advanced options`); sensitive fields stay in the panel.
217
+
218
+ **Filter groups** — Multiple sections may stay open; use `collapse-preview` in `outline` mode to show active filter chips when collapsed.
219
+
220
+ ---
221
+
222
+ ## Accessibility
223
+
224
+ Behaviors (what must happen), not slogans.
225
+
226
+ | Behavior | Expectation |
227
+ | --- | --- |
228
+ | Summary role | `role="button"` on the summary row — not a native `<button>` |
229
+ | Panel role | `role="region"` when open, associated via `aria-labelledby` to the item’s `id` |
230
+ | Naming | Accessible name comes from **`header`** text |
231
+ | Keyboard | **Enter** on the focused summary toggles open/closed; **Tab** moves between summaries |
232
+ | Focus | Preserve visible focus styling in `outline` mode — don’t remove border/shadow on `:focus` |
233
+ | Icons | `summaryIcon` and chevron are decorative (`aria-hidden` on the leading icon) |
234
+ | `id` | **Set `id` on each item** so the open panel is correctly labelled |
235
+ | Expand state | Chevron rotation is visual only — ensure header text makes open/closed state clear in context |
236
+
237
+ Target: **WCAG 2.2 AA** where the product requires it.
238
+
239
+ ---
240
+
241
+ ## Examples
242
+
243
+ ```vue
244
+ <script setup lang="ts">
245
+ import { ref } from 'vue'
246
+ import { VJoyCollapse, VJoyCollapseItem, VJoyTag } from '@maltjoy/core-vue'
247
+
248
+ const openFaq = ref(['billing'])
249
+ const openFilters = ref(['status', 'location'])
250
+ </script>
251
+
252
+ <template>
253
+ <!-- Default list -->
254
+ <VJoyCollapse>
255
+ <VJoyCollapseItem header="General" :open="true">
256
+ General settings content
257
+ </VJoyCollapseItem>
258
+ <VJoyCollapseItem header="Security">
259
+ Security settings content
260
+ </VJoyCollapseItem>
261
+ </VJoyCollapse>
262
+
263
+ <!-- Accordion FAQ with v-model -->
264
+ <VJoyCollapse v-model="openFaq" :accordion="true">
265
+ <VJoyCollapseItem id="shipping" header="When will my order ship?">
266
+ Orders ship within 2 business days.
267
+ </VJoyCollapseItem>
268
+ <VJoyCollapseItem id="billing" header="How do I update billing?">
269
+ Open account settings → Billing.
270
+ </VJoyCollapseItem>
271
+ </VJoyCollapse>
272
+
273
+ <!-- Outline mode with header actions -->
274
+ <VJoyCollapse v-model="openFilters" mode="outline">
275
+ <VJoyCollapseItem id="status" header="Status" summary-icon="filter">
276
+ <template #collapse-header-right>
277
+ <VJoyTag label="2 active" size="small" />
278
+ </template>
279
+ Filter controls…
280
+ </VJoyCollapseItem>
281
+ <VJoyCollapseItem id="location" header="Location" summary-icon="filter">
282
+ Location filter controls…
283
+ </VJoyCollapseItem>
284
+ </VJoyCollapse>
285
+ </template>
286
+ ```
287
+
288
+ In Nuxt (or apps with auto-import), omit the import if `VJoyCollapse` and `VJoyCollapseItem` are already global.
289
+
290
+ ---
291
+
292
+ ## Related
293
+
294
+ | Component | Use when |
295
+ | --- | --- |
296
+ | `VJoyCollapseItem` | Required child — header, panel, slots, and per-item props |
297
+ | `VJoyTabs` | Peer sections with always-visible tab labels |
298
+ | `VJoyTag` | Status or count in `collapse-header-right` |
299
+ | `VJoyTagsList` | Preview chips in `collapse-preview` |
300
+ | `VJoyIcon` | Icons referenced by `summaryIcon` |
301
+ | `VJoyDialog` | Blocking confirmation or short focused task |
302
+ | `VJoyStepper` | Linear steps with progress |
303
+
304
+ ---
305
+
306
+ ## For agents
307
+
308
+ Optional for readers; **required** for vibe-coding quality. Maps to `agentDocumentBlocks` in [`JoyCollapse.dsds.json`](./JoyCollapse.dsds.json).
309
+
310
+ ### Pick the right component
311
+
312
+ | If the intent is… | Emit… | Do not emit… |
313
+ | --- | --- | --- |
314
+ | Expandable sections on one surface | `VJoyCollapse` + `VJoyCollapseItem` | Custom chevron `<motion.div>` lists |
315
+ | Only one open section (FAQ) | `VJoyCollapse` with `accordion` + `v-model` | Multiple `open` props without parent sync |
316
+ | Swap peer panels with visible tabs | `VJoyTabs` | `VJoyCollapse` for primary nav |
317
+ | Card-style expandable blocks | `VJoyCollapse` `mode="outline"` | Custom bordered accordions |
318
+ | Single inline show/hide | One `VJoyCollapseItem` or conditional `v-if` | Full collapse for one trivial line |
319
+
320
+ ### Hard rules
321
+
322
+ 1. **MUST** call `joy_get_component_info("VJoyCollapse")` and `joy_get_component_info("VJoyCollapseItem")` (or read types) before generating props.
323
+ 2. **MUST** emit **`VJoyCollapseItem`** inside **`VJoyCollapse`** default slot — one child per section.
324
+ 3. **MUST** set **`id`** on every item when using `v-model` or `accordion`.
325
+ 4. **MUST** bind `v-model` (string array) when controlling open state from the parent.
326
+ 5. **MUST** set `accordion` when only one item may be open.
327
+ 6. **MUST NOT** invent props (`size`, `variant`, `disabled`, …).
328
+ 7. **MUST NOT** override `.joy-collapse-item` borders, padding, radius, or chevron styles.
329
+ 8. **SHOULD** set `mode` on `VJoyCollapse` (not per-item) for consistent styling.
330
+ 9. **SHOULD** use `summaryIcon` only with valid Joy icon names from MCP.
331
+
332
+ ### Checklist
333
+
334
+ - [ ] `VJoyCollapse` + one `VJoyCollapseItem` per section
335
+ - [ ] Stable `id` on each item when using `v-model` or `accordion`
336
+ - [ ] `accordion` + `v-model` for single-open FAQ
337
+ - [ ] `mode` is `default` or `outline` only
338
+ - [ ] Props from MCP / types — no invented enums
339
+ - [ ] No custom collapse chrome CSS
340
+ - [ ] Headers short, parallel, and meaningful
341
+ - [ ] `collapse-preview` stays short; full content in default slot
342
+ - [ ] Critical info not hidden only inside collapsed panels without header cue
343
+
344
+ ---
345
+
346
+ ## DSDS mapping
347
+
348
+ This Markdown mirrors [`JoyCollapse.dsds.json`](./JoyCollapse.dsds.json) (DSDS **0.15.2**).
349
+
350
+ | Section here | DSDS block |
351
+ | --- | --- |
352
+ | When to use / not | `use-cases` |
353
+ | Anatomy | `anatomy` |
354
+ | Variants (`mode`) | `variants` |
355
+ | States | `states` |
356
+ | Best practices / content rules | `guidelines` (+ `content`) |
357
+ | Accessibility | `accessibility` |
358
+ | Examples | `sections` |
359
+ | For agents | `agentDocumentBlocks` |
360
+ | Props detail | `api` in JSON + Joy MCP |
361
+ | Imports | `imports` in JSON |
362
+ | Token styling | `design-specifications` in JSON (`--joy-color-neutral-30`, `--joy-core-radius-4`, spacing tokens) |