An open source design system that's fully customizable and agent ready
TypeScript
fix(Collapsible): refresh block examples (#5567)
Ernest592d0807462f
diff --git a/.changeset/refresh-collapsible-blocks.md b/.changeset/refresh-collapsible-blocks.mdnew file mode 100644index 0000000000..a69a291459--- /dev/null+++ b/.changeset/refresh-collapsible-blocks.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[fix] Refresh the Collapsible block templates with complete, current examples for single, multiple, controlled, divided, standalone, and grouped usage. The controlled step example keeps one valid step open so its progress label and Previous/Next actions never enter an invalid “Step 0” state.++@ernesttdiff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.doc.mjsindex 6a9956e1b0..158ac55dee 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.doc.mjs@@ -6,8 +6,16 @@ export const doc = {exampleFor: 'Collapsible',name: 'Collapsible — Controlled',displayName: 'Collapsible — Controlled',- description: 'Manage the open section from parent state. Use when the open state needs to sync with a URL param, form, or external control.',+ description:+ 'Manage the open section from parent state, so something other than a click can move it: a URL parameter, a form jumping to the step that failed validation, or the Previous/Next controls shown here. onChange hands back the whole open value.',isReady: true,aspectRatio: 16 / 9,- componentsUsed: ['Collapsible', 'Card', 'Text', 'Layout'],+ componentsUsed: [+ 'Collapsible',+ 'CollapsibleGroup',+ 'Card',+ 'Text',+ 'Button',+ 'Stack',+ ],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.tsxindex 1617e9f2df..77b339537e 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleControlledAccordion.tsx@@ -6,38 +6,82 @@ import {useState} from 'react';import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Card} from '@astryxdesign/core/Card';import {Text} from '@astryxdesign/core/Text';-import {VStack} from '@astryxdesign/core/Layout';+import {Button} from '@astryxdesign/core/Button';+import {Stack} from '@astryxdesign/core/Stack';++/**+ * Controlled: the parent owns which section is open, so something other than+ * a click can move it — a URL parameter, a validation failure jumping to the+ * offending step, or the buttons here.+ *+ * `onChange` gives back the whole open value, `string` for type="single" and+ * `string[]` for type="multiple".+ */+const STEPS = ['profile', 'security', 'billing'] as const;+type Step = (typeof STEPS)[number];export default function CollapsibleControlledAccordion() {- const [open, setOpen] = useState<string | string[]>('profile');+ const [open, setOpen] = useState<Step>('profile');+ const index = STEPS.indexOf(open);+ const handleOpenChange = (value: string | string[]) => {+ if (typeof value === 'string' && STEPS.includes(value as Step)) {+ setOpen(value as Step);+ }+ };+return (- <CollapsibleGroup type="single" value={open} onChange={setOpen}>- <VStack gap={2} style={{width: '100%', maxWidth: 400}}>- <Card>- <Collapsible trigger="Profile Information" value="profile">- <Text type="body">- Update your name, email, and profile photo. Changes are saved- automatically.- </Text>- </Collapsible>- </Card>- <Card>- <Collapsible trigger="Security" value="security">- <Text type="body">- Manage two-factor authentication, active sessions, and login- history.- </Text>- </Collapsible>- </Card>- <Card>- <Collapsible trigger="Billing" value="billing">- <Text type="body">- View invoices, update payment method, and manage your subscription- plan.- </Text>- </Collapsible>- </Card>- </VStack>- </CollapsibleGroup>+ <Stack gap={3} maxWidth={440}>+ <Stack direction="horizontal" gap={2} vAlign="center">+ <Button+ label="Previous"+ variant="secondary"+ size="sm"+ isDisabled={index <= 0}+ onClick={() => setOpen(STEPS[Math.max(0, index - 1)])}+ />+ <Button+ label="Next"+ variant="secondary"+ size="sm"+ isDisabled={index >= STEPS.length - 1}+ onClick={() => setOpen(STEPS[Math.min(STEPS.length - 1, index + 1)])}+ />+ <Text type="supporting">+ Step {index + 1} of {STEPS.length}+ </Text>+ </Stack>++ <CollapsibleGroup type="single" value={open} onChange={handleOpenChange}>+ <Stack gap={2}>+ <Card>+ <Collapsible trigger="Profile" value="profile">+ <Text type="body" color="secondary">+ Name, email, and photo. Changes save as you type; the email+ address needs confirmation from the new inbox before it takes+ effect.+ </Text>+ </Collapsible>+ </Card>++ <Card>+ <Collapsible trigger="Security" value="security">+ <Text type="body" color="secondary">+ Two-factor authentication, active sessions, and recent login+ history. Signing out of a session revokes its token immediately.+ </Text>+ </Collapsible>+ </Card>++ <Card>+ <Collapsible trigger="Billing" value="billing">+ <Text type="body" color="secondary">+ Invoices, payment method, and plan. Invoices stay downloadable+ for seven years, including after a downgrade.+ </Text>+ </Collapsible>+ </Card>+ </Stack>+ </CollapsibleGroup>+ </Stack>);}diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjsindex 5455cd9614..160fc6cb7a 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs@@ -4,10 +4,11 @@export const doc = {type: 'block',exampleFor: 'Collapsible',- name: 'Collapsible — Divided Accordion',- displayName: 'Collapsible — Divided Accordion',- description: 'FAQ-style accordion using the hasDividers prop on CollapsibleGroup: built-in row hairlines and density padding with zero custom CSS. Use for FAQs, settings lists, and nav sections.',+ name: 'Collapsible — FAQ',+ displayName: 'Collapsible — FAQ',+ description:+ "FAQ built with hasDividers: row hairlines and density padding with no custom CSS. Questions set their own type — body at semibold, not the trigger's default 17px large — so a list of questions reads as rows rather than a stack of headings, and question and answer separate on weight and color instead of size.",isReady: true,aspectRatio: 4 / 3,- componentsUsed: ['Collapsible', 'CollapsibleGroup', 'Text'],+ componentsUsed: ['Collapsible', 'CollapsibleGroup', 'Text', 'Link', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsxindex 6c7a735814..15c9161ee1 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx@@ -4,30 +4,100 @@import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Text} from '@astryxdesign/core/Text';+import {Link} from '@astryxdesign/core/Link';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * Type sizing, because an FAQ is the case that gets it wrong most often.+ *+ * The trigger's own type is `large` (17px semibold) — right for a settings+ * page where each Collapsible is a section heading, too heavy for a list of+ * ten questions, where every row would read as a heading and none would read+ * as more important than the next.+ *+ * The trigger takes a ReactNode, so a question sets its own type: body at+ * semibold. Question and answer then share one size and separate on weight+ * and color instead — the hierarchy an FAQ actually wants. Answers are+ * `secondary`, which keeps the scannable column of questions primary.+ */export default function CollapsibleDividedAccordion() {return (- <div style={{width: '100%', maxWidth: 400}}>- <CollapsibleGroup type="single" hasDividers defaultValue="reset">- <Collapsible trigger="How do I reset my password?" value="reset">- <Text type="body">- Go to Settings → Security → Change Password. You'll receive a- confirmation email within a few minutes.- </Text>+ <Stack gap={3} maxWidth={560}>+ <Text type="label">Billing and plans</Text>++ <CollapsibleGroup type="single" hasDividers defaultValue="proration">+ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ How is my bill prorated when I change plans mid-cycle?+ </Text>+ }+ value="proration">+ <Stack gap={2}>+ <Text type="body" color="secondary">+ Upgrades take effect immediately and we charge the difference for+ the days remaining in the cycle. Downgrades take effect at the+ next renewal, so you keep the higher tier until the period you+ already paid for runs out.+ </Text>+ <Text type="body" color="secondary">+ Seat changes work the same way: added seats are prorated to the+ day, removed seats free up at renewal.+ </Text>+ </Stack></Collapsible>- <Collapsible trigger="Can I change my username?" value="username">- <Text type="body">- Usernames can be changed once every 30 days from your profile- settings.++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Can I change my username?+ </Text>+ }+ value="username">+ <Text type="body" color="secondary">+ Once every 30 days, from your profile settings. Old links keep+ working — we redirect them for a year.</Text></Collapsible>- <Collapsible trigger="How do I delete my account?" value="delete">- <Text type="body">- Account deletion is permanent. Your data will be removed within 30- days.++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ What happens to my data if I cancel?+ </Text>+ }+ value="cancel">+ <Stack gap={2}>+ <Text type="body" color="secondary">+ Your workspace goes read-only at the end of the billing period.+ Nothing is deleted for 30 days, so reactivating inside that window+ restores everything exactly as it was.+ </Text>+ <Text type="body" color="secondary">+ After 30 days the workspace and its backups are permanently+ removed. Export first if you want a copy — an export covers+ documents, comments, and version history.+ </Text>+ <Link href="#export" isStandalone hasUnderline>+ How to export your workspace+ </Link>+ </Stack>+ </Collapsible>++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Do you offer discounts for non-profits or education?+ </Text>+ }+ value="discounts">+ <Text type="body" color="secondary">+ Yes — 50% off any paid plan for registered non-profits and+ accredited schools. Email your documentation and we usually apply it+ within two business days.</Text></Collapsible></CollapsibleGroup>- </div>+ </Stack>);}diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.doc.mjsindex 8d8d2da6d9..e131c1baaa 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.doc.mjs@@ -6,8 +6,9 @@ export const doc = {exampleFor: 'Collapsible',name: 'Collapsible — Multiple Mode',displayName: 'Collapsible — Multiple Mode',- description: 'Several sections open at once. Use when users need to compare content across sections, like feature lists or pricing tiers.',+ description:+ 'Several sections open at once, for comparing across them — feature lists, pricing tiers. One Collapsible per Card, so each trigger keeps its own large type: it is the heading of its surface, not a row in a list.',isReady: true,aspectRatio: 4 / 3,- componentsUsed: ['Collapsible', 'Card', 'Text', 'Layout'],+ componentsUsed: ['Collapsible', 'CollapsibleGroup', 'Card', 'Text', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.tsxindex 38434f2442..667b387598 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleMultipleAccordion.tsx@@ -5,37 +5,55 @@import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Card} from '@astryxdesign/core/Card';import {Text} from '@astryxdesign/core/Text';-import {VStack} from '@astryxdesign/core/Layout';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * One Collapsible per Card, several open at once so the reader can compare+ * across them — the case type="multiple" is for.+ *+ * Here the triggers keep their own `large` type: each is the heading of its+ * own surface, not a row in a list, so the 17px semibold is doing the job it+ * was sized for. Compare with the FAQ and Showcase examples, where the rows+ * share a surface and the questions step down to body-semibold.+ */export default function CollapsibleMultipleAccordion() {return (<CollapsibleGroup type="multiple" defaultValue={['features', 'pricing']}>- <VStack gap={2} style={{width: '100%', maxWidth: 400}}>+ <Stack gap={2} maxWidth={440}><Card><Collapsible trigger="Features" value="features">- <Text type="body">- Includes real-time collaboration, version history, and granular- permissions for teams of any size.+ <Text type="body" color="secondary">+ Real-time collaboration, full version history, and granular+ permissions. Every plan includes unlimited documents and unlimited+ guests — seats are counted for editors only.</Text></Collapsible></Card>+<Card><Collapsible trigger="Pricing" value="pricing">- <Text type="body">- Free for up to 5 users. Pro plans start at $12/user/month with- annual billing.- </Text>+ <Stack gap={2}>+ <Text type="body" color="secondary">+ Free for up to 5 editors. Pro is $12 per editor per month billed+ annually, or $15 month to month.+ </Text>+ <Text type="supporting">+ Non-profit and education pricing is 50% off any paid plan.+ </Text>+ </Stack></Collapsible></Card>+<Card><Collapsible trigger="Integrations" value="integrations">- <Text type="body">- Connect with Slack, GitHub, Jira, and 40+ other tools through our- REST API and pre-built connectors.+ <Text type="body" color="secondary">+ Slack, GitHub, Jira, Figma, and 40 more through pre-built+ connectors, plus a REST API and outbound webhooks for anything not+ on the list.</Text></Collapsible></Card>- </VStack>+ </Stack></CollapsibleGroup>);}diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjsindex 92ef11ddf9..ff4c492627 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.doc.mjs@@ -12,5 +12,5 @@ export const doc = {isReady: true,isShowcase: true,aspectRatio: 16 / 9,- componentsUsed: ['Collapsible', 'Text', 'Card'],+ componentsUsed: ['Collapsible', 'CollapsibleGroup', 'Text', 'Card', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsxindex 41f60d08fa..e4d35cb6da 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleShowcase.tsx@@ -5,29 +5,68 @@import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Text} from '@astryxdesign/core/Text';import {Card} from '@astryxdesign/core/Card';-import {VStack} from '@astryxdesign/core/Layout';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * Rows inside one card, coordinated so only one is open at a time.+ *+ * Triggers take body-semibold rather than the trigger's default `large`: three+ * rows sharing a single surface are peers, and at 17px semibold each would+ * read as its own section heading. Keep `large` for the case it is for — one+ * Collapsible per card or per Section, where the trigger really is the+ * heading of that surface (see the Multiple Mode and Controlled examples).+ */export default function CollapsibleShowcase() {return (- <Card width={400}>+ <Card width={420}><CollapsibleGroup type="single" defaultValue="notifications">- <VStack gap={6}>- <Collapsible trigger="General settings" value="general">+ <Stack gap={4}>+ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ General+ </Text>+ }+ value="general"><Text type="body" color="secondary">- Configure your display name, language, and time zone preferences.+ Display name, language, and time zone. Time zone drives every date+ shown in the product, including scheduled reports.</Text></Collapsible>- <Collapsible trigger="Notifications" value="notifications">- <Text type="body" color="secondary">- Choose which email and push notifications you want to receive.- </Text>++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Notifications+ </Text>+ }+ value="notifications">+ <Stack gap={2}>+ <Text type="body" color="secondary">+ Choose which email and push notifications you receive. Mentions+ and direct messages are always delivered — everything else can+ be turned off or batched into a daily digest.+ </Text>+ <Text type="body" color="secondary">+ Quiet hours pause push notifications overnight in your local+ time zone without affecting email.+ </Text>+ </Stack></Collapsible>- <Collapsible trigger="Privacy" value="privacy">++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Privacy+ </Text>+ }+ value="privacy"><Text type="body" color="secondary">- Manage your data sharing preferences and account visibility.+ Control who can see your profile and activity, and whether your+ workspace appears in search for people outside your organization.</Text></Collapsible>- </VStack>+ </Stack></CollapsibleGroup></Card>);diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.doc.mjsindex 93bd0d94fa..c5cb5a6299 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.doc.mjs@@ -6,8 +6,15 @@ export const doc = {exampleFor: 'Collapsible',name: 'Collapsible — Single Mode',displayName: 'Collapsible — Single Mode',- description: 'Only one section open at a time. Use for settings pages or any list where expanding one item should close the others.',+ description:+ 'Only one section open at a time, so a single body of content competes for attention. Use defaultValue to pre-expand whichever section a first-time reader needs. Each Collapsible owns a Section, so its trigger is that section heading.',isReady: true,aspectRatio: 4 / 3,- componentsUsed: ['Collapsible', 'Section', 'Text', 'Layout'],+ componentsUsed: [+ 'Collapsible',+ 'CollapsibleGroup',+ 'Section',+ 'Text',+ 'Stack',+ ],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.tsxindex f672a025ba..8075024a58 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleSingleAccordion.tsx@@ -5,36 +5,49 @@import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Section} from '@astryxdesign/core/Section';import {Text} from '@astryxdesign/core/Text';-import {VStack} from '@astryxdesign/core/Layout';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * type="single": opening one section closes the others, so only one body of+ * content competes for attention at a time. Use `defaultValue` to pre-expand+ * whichever section a first-time reader needs.+ *+ * Each Collapsible owns a Section, so the trigger is that section's heading+ * and keeps its own `large` type.+ */export default function CollapsibleSingleAccordion() {return (<CollapsibleGroup type="single" defaultValue="general">- <VStack gap={2} style={{width: '100%', maxWidth: 400}}>+ <Stack gap={2} maxWidth={440}><Section>- <Collapsible trigger="General Settings" value="general">- <Text type="body">- Configure your general preferences including language, timezone,- and display options.+ <Collapsible trigger="General" value="general">+ <Text type="body" color="secondary">+ Language, time zone, and date format. Time zone drives every+ timestamp in the product, including exports and scheduled reports.</Text></Collapsible></Section>+<Section>- <Collapsible trigger="Privacy Settings" value="privacy">- <Text type="body">- Manage who can see your profile, activity, and personal- information.+ <Collapsible trigger="Privacy" value="privacy">+ <Text type="body" color="secondary">+ Control who can see your profile and activity. Turning off+ discovery also removes you from @-mention autocomplete for people+ outside your workspace.</Text></Collapsible></Section>+<Section>- <Collapsible trigger="Notification Settings" value="notifications">- <Text type="body">- Choose which notifications you receive and how they are delivered.+ <Collapsible trigger="Notifications" value="notifications">+ <Text type="body" color="secondary">+ Choose what you are notified about and how it reaches you.+ Mentions always come through; everything else can be batched into+ a daily digest.</Text></Collapsible></Section>- </VStack>+ </Stack></CollapsibleGroup>);}diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.doc.mjs b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.doc.mjsindex 87ae016d88..fadad084b2 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.doc.mjs@@ -6,8 +6,9 @@ export const doc = {exampleFor: 'Collapsible',name: 'Collapsible — With Dividers',displayName: 'Collapsible — With Dividers',- description: 'Collapsible sections separated by dividers instead of cards. Use for inline disclosure in detail panels or sidebar content where cards would add too much weight.',+ description:+ 'A flat list on the page background with hand-placed Dividers, for detail panels and sidebars where cards would add too much weight. Rows, so the triggers step down to body-semibold and a supporting metadata line sits under each answer.',isReady: true,aspectRatio: 16 / 9,- componentsUsed: ['Collapsible', 'Divider', 'Text', 'Layout'],+ componentsUsed: ['Collapsible', 'Divider', 'Text', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsxindex fa3f79ca58..6d87a02652 100644--- a/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx+++ b/packages/cli/assets/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx@@ -2,36 +2,78 @@'use client';-import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';-import {Divider} from '@astryxdesign/core/Divider';+import {Collapsible} from '@astryxdesign/core/Collapsible';import {Text} from '@astryxdesign/core/Text';-import {VStack} from '@astryxdesign/core/Layout';+import {Divider} from '@astryxdesign/core/Divider';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * A flat list on the page background, no card and no group dividers — the+ * Dividers are placed by hand so the rows can carry different spacing than+ * `hasDividers` gives them.+ *+ * Rows, so the triggers take body-semibold rather than the default `large`:+ * these are peers in a list, not section headings. The metadata line under+ * each answer is `supporting`, the one place a third size earns its place.+ */export default function CollapsibleWithoutCard() {return (- <CollapsibleGroup type="single" defaultValue="deployment">- <VStack gap={3} style={{width: '100%', maxWidth: 400}}>- <Collapsible trigger="Deployment Details" value="deployment">- <Text type="body">- Last deployed on April 18, 2026 at 3:42 PM by Sarah Chen. Build- duration was 2m 14s with zero warnings.+ <Stack gap={3} maxWidth={480}>+ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Deployment details+ </Text>+ }+ value="deployment">+ <Stack gap={1}>+ <Text type="body" color="secondary">+ Build 4,182 shipped to production from <code>main</code>. 847+ modules compiled with no warnings, and the bundle came in at 142 KB+ gzipped — 3 KB under the budget.+ </Text>+ <Text type="supporting">+ Deployed by Sarah Chen · April 18, 3:42 PM · 2m 14s+ </Text>+ </Stack>+ </Collapsible>++ <Divider />++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Environment variables+ </Text>+ }+ value="environment">+ <Stack gap={1}>+ <Text type="body" color="secondary">+ 12 variables configured across production and preview. Secrets are+ encrypted at rest with AES-256 and are never printed in build logs.</Text>- </Collapsible>- <Divider />- <Collapsible trigger="Environment Variables" value="environment">- <Text type="body">- 12 variables configured. Last updated March 30, 2026. All secrets- are encrypted at rest with AES-256.+ <Text type="supporting">Last updated March 30 by the deploy bot</Text>+ </Stack>+ </Collapsible>++ <Divider />++ <Collapsible+ trigger={+ <Text type="body" weight="semibold">+ Rollback</Text>- </Collapsible>- <Divider />- <Collapsible trigger="Build Logs" value="logs">- <Text type="body">- Build completed successfully. 847 modules compiled, 0 errors, 0- warnings. Bundle size: 142 KB gzipped.+ }+ value="rollback">+ <Stack gap={1}>+ <Text type="body" color="secondary">+ The previous build stays warm for 24 hours, so a rollback swaps+ traffic back in a few seconds without a rebuild. After that window a+ rollback redeploys from source and takes about two minutes.</Text>- </Collapsible>- </VStack>- </CollapsibleGroup>+ <Text type="supporting">Previous build 4,181 · expires in 19h</Text>+ </Stack>+ </Collapsible>+ </Stack>);}diff --git a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjs b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjsindex 579ec717fb..4a1ee041d5 100644--- a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.doc.mjs@@ -4,11 +4,11 @@export const doc = {type: 'block',exampleFor: 'CollapsibleGroup',- name: 'CollapsibleGroup — Accordion',- displayName: 'CollapsibleGroup — Accordion',+ name: 'CollapsibleGroup — Density',+ displayName: 'CollapsibleGroup — Density',description:- 'An accordion built with type="single": opening one Collapsible automatically closes the others. Use defaultValue to pre-expand the most important section.',+ "density sets the block padding on every row in the group, so a list of sections can be tuned to the surface it sits on without touching the rows. compact for dense surfaces like sidebars and inspectors, balanced (the default) for page content, spacious for a short list that is the main thing on the page. It follows Table's scale and pairs with hasDividers, which turns it on at balanced.",isReady: true,- aspectRatio: 16 / 9,- componentsUsed: ['CollapsibleGroup', 'Collapsible', 'VStack', 'Text'],+ aspectRatio: 3 / 4,+ componentsUsed: ['CollapsibleGroup', 'Collapsible', 'Text', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsx b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsxindex 05c721dfda..453d1405ed 100644--- a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsx+++ b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupAccordion.tsx@@ -3,29 +3,81 @@'use client';import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';-import {VStack} from '@astryxdesign/core/Layout';import {Text} from '@astryxdesign/core/Text';+import {Stack} from '@astryxdesign/core/Stack';++/**+ * `density` sets the block padding on every row in the group, so a list of+ * sections can be tuned to the surface it sits on without touching the rows+ * themselves. It follows Table's scale, and pairs with `hasDividers`, which+ * turns it on at 'balanced' by default.+ *+ * - compact — dense surfaces: sidebars, inspectors, a panel of many rows+ * - balanced — the default, and right for most page content+ * - spacious — a short list that is the main thing on the page+ *+ * Rows share a surface here, so the triggers take body-semibold rather than+ * the trigger's default 'large': at 17px semibold each row would read as its+ * own section heading.+ */+const SECTIONS = [+ {+ value: 'a',+ trigger: 'Region',+ body: 'Where your data is stored and processed. Changing region migrates existing data and can take up to an hour.',+ },+ {+ value: 'b',+ trigger: 'Retention',+ body: 'How long deleted items stay recoverable before being purged.',+ },+ {+ value: 'c',+ trigger: 'Audit log',+ body: 'Who can read the log, and how far back it reaches.',+ },+];++function DensityExample({+ density,+ label,+}: {+ density: 'compact' | 'balanced' | 'spacious';+ label: string;+}) {+ return (+ <Stack gap={1}>+ <Text type="supporting">{label}</Text>+ <CollapsibleGroup+ type="single"+ hasDividers+ density={density}+ defaultValue="a">+ {SECTIONS.map(section => (+ <Collapsible+ key={section.value}+ value={section.value}+ trigger={+ <Text type="body" weight="semibold">+ {section.trigger}+ </Text>+ }>+ <Text type="body" color="secondary">+ {section.body}+ </Text>+ </Collapsible>+ ))}+ </CollapsibleGroup>+ </Stack>+ );+}export default function CollapsibleGroupAccordion() {return (- <CollapsibleGroup type="single" defaultValue="account">- <VStack gap={2} width="100%">- <Collapsible trigger="Account" value="account">- <Text type="body" color="secondary">- Manage your profile details, email address, and password.- </Text>- </Collapsible>- <Collapsible trigger="Notifications" value="notifications">- <Text type="body" color="secondary">- Choose which activity triggers email and push notifications.- </Text>- </Collapsible>- <Collapsible trigger="Billing" value="billing">- <Text type="body" color="secondary">- View invoices and update your payment method.- </Text>- </Collapsible>- </VStack>- </CollapsibleGroup>+ <Stack gap={5} maxWidth={420}>+ <DensityExample density="compact" label="compact" />+ <DensityExample density="balanced" label="balanced — the default" />+ <DensityExample density="spacious" label="spacious" />+ </Stack>);}diff --git a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.doc.mjsindex 1ada348fc0..e873b2cbd6 100644--- a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.doc.mjs@@ -7,9 +7,9 @@ export const doc = {name: 'CollapsibleGroup',displayName: 'Collapsible Group',description:- 'CollapsibleGroup coordinates multiple Collapsible components so that expanding one can automatically collapse the others, creating accordion behavior.',+ 'CollapsibleGroup coordinates its Collapsible children: with type="single", opening one closes the others. No state or handlers in the example — the group owns which value is open and each child only declares its own. One Collapsible per Card, so each trigger keeps its default large type as the heading of its own surface.',isReady: true,isShowcase: true,aspectRatio: 16 / 9,- componentsUsed: ['Collapsible', 'CollapsibleGroup'],+ componentsUsed: ['Collapsible', 'CollapsibleGroup', 'Card', 'Text', 'Stack'],};diff --git a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.tsx b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.tsxindex 719b7c699b..e596223ff5 100644--- a/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.tsx+++ b/packages/cli/assets/templates/blocks/components/CollapsibleGroup/CollapsibleGroupShowcase.tsx@@ -4,40 +4,50 @@import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';import {Card} from '@astryxdesign/core/Card';-import {VStack} from '@astryxdesign/core/Layout';-import {Center} from '@astryxdesign/core/Center';import {Text} from '@astryxdesign/core/Text';+import {Stack} from '@astryxdesign/core/Stack';+/**+ * The whole point of the group: open one section and the others close+ * themselves. Nothing here tracks that — no state, no handlers — the group+ * owns which `value` is open and the children only declare their own.+ *+ * One Collapsible per Card, so each trigger keeps its own `large` type: it is+ * the heading of its surface, not a row in a list. Compare the FAQ block,+ * where the questions share a surface and step down to body-semibold.+ */export default function CollapsibleGroupShowcase() {return (- <Center width={400}>- <CollapsibleGroup type="single" defaultValue="shipping">- <VStack gap={2} width="100%">- <Card>- <Collapsible trigger="Shipping Information" value="shipping">- <Text type="body" color="secondary">- Standard shipping takes 3–5 business days. Express shipping is- available for an additional fee.- </Text>- </Collapsible>- </Card>- <Card>- <Collapsible trigger="Return Policy" value="returns">- <Text type="body" color="secondary">- Items can be returned within 30 days of purchase. Items must be- unused and in original packaging.- </Text>- </Collapsible>- </Card>- <Card>- <Collapsible trigger="Payment Methods" value="payment">- <Text type="body" color="secondary">- We accept all major credit cards, PayPal, and bank transfers.- </Text>- </Collapsible>- </Card>- </VStack>- </CollapsibleGroup>- </Center>+ <CollapsibleGroup type="single" defaultValue="shipping">+ <Stack gap={2} width="100%" maxWidth={420}>+ <Card>+ <Collapsible trigger="Shipping" value="shipping">+ <Text type="body" color="secondary">+ Standard delivery takes 3–5 business days and is free over $50.+ Express is next business day if you order before 2pm.+ </Text>+ </Collapsible>+ </Card>++ <Card>+ <Collapsible trigger="Returns" value="returns">+ <Text type="body" color="secondary">+ 30 days from delivery, unused and in the original packaging.+ Return shipping is on us for anything that arrived damaged or was+ not what you ordered.+ </Text>+ </Collapsible>+ </Card>++ <Card>+ <Collapsible trigger="Payment" value="payment">+ <Text type="body" color="secondary">+ All major cards, PayPal, and bank transfer. Cards are charged when+ the order ships, not when it is placed.+ </Text>+ </Collapsible>+ </Card>+ </Stack>+ </CollapsibleGroup>);}