An open source design system that's fully customizable and agent ready
TypeScript
feat(core): promote Drawer and DrawerHeader from Lab (#6071)
Xinzi Zhou86e83921910a
diff --git a/.changeset/component-prop-doc-stability.md b/.changeset/component-prop-doc-stability.mdnew file mode 100644index 0000000000..ee46e097ce--- /dev/null+++ b/.changeset/component-prop-doc-stability.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[feat] Component prop docs accept `stability: 'experimental'`, the machine-readable marker for a prop outside the stable compatibility promise, such as a component's `experimental` prop object.++@imdreamrunnerdiff --git a/.changeset/drawer-experimental-full-width.md b/.changeset/drawer-experimental-full-width.mdnew file mode 100644index 0000000000..a41027e516--- /dev/null+++ b/.changeset/drawer-experimental-full-width.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[experimental] Drawer's full-viewport mobile coverage ships as experimental: `experimental={{isFullWidthOnMobile: true}}` fills the viewport below 640px instead of keeping the 56px page reveal. Anything inside Drawer's `experimental` prop may change or be removed in a patch release; omitting it keeps the stable behavior.++@imdreamrunnerdiff --git a/.changeset/promote-drawer-to-core.md b/.changeset/promote-drawer-to-core.mdnew file mode 100644index 0000000000..8e1fc6b93e--- /dev/null+++ b/.changeset/promote-drawer-to-core.md@@ -0,0 +1,8 @@+---+'@astryxdesign/cli': patch+'@astryxdesign/core': patch+---++[component] Promote `Drawer` and `DrawerHeader` from the canary-only Lab package to Core, imported from `@astryxdesign/core/Drawer` or the package root. The stable package now ships the full-height side panel with modal and non-modal presentation, the shared dismissal stack, Dialog's `purpose` dismissal policy, a `DrawerHeader` whose close button appears when given `onOpenChange`, and Dialog-style container padding (`--spacing-4` by default, `padding` prop, or a theme's `drawer` padding), plus Core documentation and runnable examples. Canary users importing from `@astryxdesign/lab` switch to `@astryxdesign/core/Drawer`.++@imdreamrunnerdiff --git a/.github/scripts/a11y-pr-scope.test.mjs b/.github/scripts/a11y-pr-scope.test.mjsindex 8ad02f1116..af72ada768 100644--- a/.github/scripts/a11y-pr-scope.test.mjs+++ b/.github/scripts/a11y-pr-scope.test.mjs@@ -121,7 +121,7 @@ describe('fast PR accessibility scope', () => {title: 'Lab/ChatAdditions',},{id: 'lab-chatadditions--emoji-picker', title: 'Lab/ChatAdditions'},- {id: 'lab-drawer--showcase', title: 'Lab/Drawer'},+ {id: 'lab-stat--showcase', title: 'Lab/Stat'},],publicComponentsByPackage: {lab: [@@ -129,7 +129,7 @@ describe('fast PR accessibility scope', () => {'ChatReactionBar','ChatTypingIndicator','ChatUnreadDivider',- 'Drawer',+ 'Stat',],},}).map(route => ({@@ -149,14 +149,14 @@ describe('fast PR accessibility scope', () => {'lab-chatadditions--emoji-picker',]);- const drawerScope = resolvePrA11yComponents(- analysis({modifiedComponentOwners: ['lab/Drawer']}),+ const statScope = resolvePrA11yComponents(+ analysis({modifiedComponentOwners: ['lab/Stat']}),process.cwd(),routes,);- expect(drawerScope).toEqual(['lab/Drawer']);- expect(storyIdsForComponentFilters(routes, drawerScope)).toEqual([- 'lab-drawer--showcase',+ expect(statScope).toEqual(['lab/Stat']);+ expect(storyIdsForComponentFilters(routes, statScope)).toEqual([+ 'lab-stat--showcase',]);});diff --git a/.github/scripts/component-audit-scope.test.mjs b/.github/scripts/component-audit-scope.test.mjsindex 873b471cff..83273bbc45 100644--- a/.github/scripts/component-audit-scope.test.mjs+++ b/.github/scripts/component-audit-scope.test.mjs@@ -46,7 +46,7 @@ describe('component audit scope', () => {it.each([['packages/core/src/Button/Button.tsx', 'core'],- ['packages/lab/src/Drawer/Drawer.tsx', 'lab'],+ ['packages/lab/src/Stat/Stat.tsx', 'lab'],['packages/charts/src/Chart.tsx', 'charts'],['packages/richtext/src/RichTextEditor.tsx', 'richtext'],['packages/vega/src/VegaChart.tsx', 'vega'],diff --git a/.github/scripts/modal-close-visibility.js b/.github/scripts/modal-close-visibility.jsindex adca982beb..70810804ee 100644--- a/.github/scripts/modal-close-visibility.js+++ b/.github/scripts/modal-close-visibility.js@@ -62,7 +62,7 @@ const TARGETS = [},{component: 'Drawer (modal)',- story: 'lab-drawer--showcase',+ story: 'core-drawer--showcase',openButton: 'Open inspector',// Reproduces the real failure condition: after the native host releases the// top layer, this becomes the containing block for the fixed panel.@@ -72,7 +72,7 @@ const TARGETS = [},{component: 'Drawer (non-modal)',- story: 'lab-drawer--row-inspector',+ story: 'core-drawer--row-inspector',openButton: 'Open drawer',host: 'popover',transformAncestor: true,@@ -82,7 +82,7 @@ const TARGETS = [},{component: 'Drawer (stacked exit)',- story: 'lab-drawer--stacked-drawers',+ story: 'core-drawer--stacked-drawers',openButton: 'Open order',nestedButton: 'Open line item',outerLabel: 'Order details',diff --git a/.github/scripts/visual-gate/lib/plan.test.mjs b/.github/scripts/visual-gate/lib/plan.test.mjsindex 5d8d112ecb..d42e29adfb 100644--- a/.github/scripts/visual-gate/lib/plan.test.mjs+++ b/.github/scripts/visual-gate/lib/plan.test.mjs@@ -53,7 +53,7 @@ const themeOverrides = {describe('storiesInPackages', () => {const mixed = [...stories,- story({id: 'lab-drawer--default', title: 'Lab/Drawer', name: 'Default', component: 'Drawer'}, '@astryxdesign/lab', false),+ story({id: 'lab-stat--default', title: 'Lab/Stat', name: 'Default', component: 'Stat'}, '@astryxdesign/lab', false),story({id: 'charts-bar--default', title: 'Charts/Bar', name: 'Default', component: 'Bar'}, '@astryxdesign/charts', false),];@@ -110,10 +110,10 @@ describe('canonicalBaselineStories', () => {it('drops a canary component even when its story is titled under a canonical group', () => {const labInCore = story({- id: 'core-drawer--default',- title: 'Core/Drawer',+ id: 'core-stat--default',+ title: 'Core/Stat',name: 'Default',- component: 'Drawer',+ component: 'Stat',componentPackage: '@astryxdesign/lab',},'@astryxdesign/lab',diff --git a/.github/scripts/visual-scope.test.mjs b/.github/scripts/visual-scope.test.mjsindex af3a8e9fd2..0a5b41347f 100644--- a/.github/scripts/visual-scope.test.mjs+++ b/.github/scripts/visual-scope.test.mjs@@ -208,7 +208,7 @@ describe('classifyVisualScope', () => {it('excludes Lab and records its release channel from package metadata', () => {const result = classifyVisualScope(- ['packages/lab/src/Drawer/Drawer.tsx'],+ ['packages/lab/src/Stat/Stat.tsx'],root,);expect(result.hasStableVisual).toBe(false);@@ -231,7 +231,7 @@ describe('classifyVisualScope', () => {execFileSync(process.execPath,[SCRIPT, '--manifests', manifests, '--github-output', output],- {input: 'packages/lab/src/Drawer/Drawer.tsx\n'},+ {input: 'packages/lab/src/Stat/Stat.tsx\n'},),).toThrow();});diff --git a/apps/docsite/scripts/generate-data.mjs b/apps/docsite/scripts/generate-data.mjsindex 58db50a79b..cbd962eb51 100644--- a/apps/docsite/scripts/generate-data.mjs+++ b/apps/docsite/scripts/generate-data.mjs@@ -641,6 +641,7 @@ async function generateComponentRegistry() {const mod = await import(pathToFileURL(docFile).href);doc = mod.docs;if (!doc) continue;+ recordDocExampleOrder(doc);} catch (err) {console.warn(` warn: failed to import ${docFileName}: ${err.message}`,@@ -997,6 +998,8 @@ export interface PropDoc {default?: string;required?: boolean;slotElements?: ElementDescriptor[];+ /** \`'experimental'\` for a prop outside the stable compatibility promise. */+ stability?: 'experimental';/** Names of package-exported types referenced by \`type\`, resolvable* against the owning entry's \`typeDefs\`. */typeRefs?: string[];@@ -2237,6 +2240,38 @@ ${itemPathLines}// ── Main+// Example labels in authored order, per documented component or sub-component.+// A component page lists the example blocks named after those labels in the+// same order as its doc's `examples`, so the snippet list and the runnable+// demos read as one set; any other example blocks follow in name order.+const DOC_EXAMPLE_ORDER = new Map();++function recordDocExampleOrder(doc) {+ const entries = [+ doc,+ ...(Array.isArray(doc.components) ? doc.components : []),+ ];+ for (const entry of entries) {+ const name = (entry?.name || '').replace(/^XDS/, '');+ if (!name || !Array.isArray(entry.examples)) continue;+ const labels = entry.examples+ .map(example => example?.label)+ .filter(label => typeof label === 'string');+ if (labels.length > 0) DOC_EXAMPLE_ORDER.set(name, labels);+ }+}++/** Sorts one component's examples by its doc's example order (stable). */+function orderExamplesByDoc(component, examples) {+ const labels = DOC_EXAMPLE_ORDER.get(component);+ if (!labels) return examples;+ const rank = name => {+ const index = labels.indexOf(name);+ return index === -1 ? labels.length : index;+ };+ return [...examples].sort((a, b) => rank(a.name) - rank(b.name));+}+function generateExampleRegistry(blocks, availableRegistryPaths) {console.log('Generating example registry...');@@ -2304,7 +2339,7 @@ function generateExampleRegistry(blocks, availableRegistryPaths) {const componentLines = Object.entries(grouped).map(([component, examples]) => {- const exampleLines = examples+ const exampleLines = orderExamplesByDoc(component, examples).map(entry =>` {name: ${JSON.stringify(entry.name)}, description: ${JSON.stringify(entry.description)}, registryItemPath: ${JSON.stringify(entry.registryItemPath)}, source: ${JSON.stringify(entry.source)}, load: () => import('./examples/${entry.basename}')},`,diff --git a/apps/docsite/src/__tests__/data-extraction.test.ts b/apps/docsite/src/__tests__/data-extraction.test.tsindex 8941516f5b..d75ab37611 100644--- a/apps/docsite/src/__tests__/data-extraction.test.ts+++ b/apps/docsite/src/__tests__/data-extraction.test.ts@@ -5,7 +5,7 @@** Validates that the generated registries contain expected data.* @input Authored component docs and the generated docsite registries- * @output Regression coverage for catalog projections, including Lab Drawer demos+ * @output Regression coverage for catalog projections, including Drawer demos* @position Build-time docsite data verification* Run: pnpm -F @astryxdesign/docsite test*/@@ -15,8 +15,8 @@ import * as path from 'node:path';import {fileURLToPath} from 'node:url';import {describe, it, expect} from 'vitest';import {docs as chatDocs} from '../../../../packages/core/src/Chat/Chat.doc.mjs';-import {docs as drawerDocs} from '../../../../packages/lab/src/Drawer/Drawer.doc.mjs';-import {docs as drawerHeaderDocs} from '../../../../packages/lab/src/Drawer/DrawerHeader.doc.mjs';+import {docs as drawerDocs} from '../../../../packages/core/src/Drawer/Drawer.doc.mjs';+import {docs as drawerHeaderDocs} from '../../../../packages/core/src/Drawer/DrawerHeader.doc.mjs';import docsiteConfig from '../../astryx.config.mjs';import {packages} from '../generated/packageRegistry';import {@@ -1235,22 +1235,22 @@ describe('exampleRegistry', () => {expect(exampleRegistry['Dialog']).toBeDefined();});- it('projects Drawer docs into a live showcase and five example blocks', () => {+ it('projects Drawer docs into a live showcase and runnable example blocks', () => {const drawerBlocks = blocks.filter(block => block.exampleFor === 'Drawer');const labels = drawerDocs.examples!.map(example => example.label);- expect(drawerBlocks).toHaveLength(6);+ expect(drawerBlocks).toHaveLength(labels.length);expect(drawerBlocks.map(block => block.name).sort()).toEqual([...labels].sort(),);- expect(- drawerBlocks.every(block => block.sourcePackage === '@astryxdesign/lab'),- ).toBe(true);+ // Core blocks, not an integration package's.+ expect(drawerBlocks.every(block => block.sourcePackage == null)).toBe(true);const showcase = drawerBlocks.filter(block => block.isShowcase);expect(showcase.map(block => block.name)).toEqual([labels[0]]);expect(showcaseRegistry.Drawer).toBeTypeOf('function');- expect(exampleRegistry.Drawer.map(example => example.name).sort()).toEqual(- labels.slice(1).sort(),+ // The page lists the examples in the doc's priority order, not by name.+ expect(exampleRegistry.Drawer.map(example => example.name)).toEqual(+ labels.slice(1),);});@@ -1260,9 +1260,7 @@ describe('exampleRegistry', () => {);const labels = drawerHeaderDocs.examples!.map(example => example.label);expect(headerBlocks).toHaveLength(labels.length + 1);- expect(- headerBlocks.every(block => block.sourcePackage === '@astryxdesign/lab'),- ).toBe(true);+ expect(headerBlocks.every(block => block.sourcePackage == null)).toBe(true);// Like DialogHeader, the page leads with a rendered header rather than an// empty preview; every authored example also runs live.diff --git a/apps/sandbox/scripts/next-export-routes.json b/apps/sandbox/scripts/next-export-routes.jsonindex 402c2042a7..09bb9b00dc 100644--- a/apps/sandbox/scripts/next-export-routes.json+++ b/apps/sandbox/scripts/next-export-routes.json@@ -291,6 +291,14 @@"/templates/DividerShowcase/","/templates/DividerVariants/","/templates/DividerVertical/",+ "/templates/DrawerForm/",+ "/templates/DrawerHeaderShowcase/",+ "/templates/DrawerHeaderSubtitleEndContent/",+ "/templates/DrawerHeaderWithCloseButton/",+ "/templates/DrawerScrim/",+ "/templates/DrawerShowcase/",+ "/templates/DrawerStart/",+ "/templates/DrawerWidths/","/templates/DropdownMenuActions/","/templates/DropdownMenuBottomSheet/","/templates/DropdownMenuGroupShowcase/",diff --git a/apps/sandbox/src/app/(sandbox)/pages/component-scores/page.tsx b/apps/sandbox/src/app/(sandbox)/pages/component-scores/page.tsxindex 0632905d4d..a1eba5253a 100644--- a/apps/sandbox/src/app/(sandbox)/pages/component-scores/page.tsx+++ b/apps/sandbox/src/app/(sandbox)/pages/component-scores/page.tsx@@ -33,7 +33,8 @@ import {Section} from '@astryxdesign/core/Section';import {Table, proportional, pixel} from '@astryxdesign/core/Table';import type {TableColumn, TablePlugin} from '@astryxdesign/core/Table';import {colorVars, radiusVars} from '@astryxdesign/core/theme/tokens.stylex';-import {Drawer, DrawerHeader, Stat} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';+import {Stat} from '@astryxdesign/lab';import {AUDIT_PROMPT,diff --git a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/__generated__/motionAudit.ts b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/__generated__/motionAudit.tsindex db4a34a82b..ecd9198b74 100644--- a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/__generated__/motionAudit.ts+++ b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/__generated__/motionAudit.ts@@ -405,8 +405,8 @@ export const HARDCODED_SITES: ReadonlyArray<HardcodedSite> = [ms: null,},{- file: 'lab/Drawer/Drawer.tsx',- package: 'lab',+ file: 'core/Drawer/Drawer.tsx',+ package: 'core',component: 'Drawer',line: 121,kind: 'duration',@@ -415,8 +415,8 @@ export const HARDCODED_SITES: ReadonlyArray<HardcodedSite> = [ms: 10,},{- file: 'lab/Drawer/Drawer.tsx',- package: 'lab',+ file: 'core/Drawer/Drawer.tsx',+ package: 'core',component: 'Drawer',line: 194,kind: 'duration',@@ -725,8 +725,8 @@ export const DURATION_WITHOUT_CURVE: ReadonlyArray<SiteRef> = [decl: "transitionDuration: '150ms'",},{- file: 'lab/Drawer/Drawer.tsx',- package: 'lab',+ file: 'core/Drawer/Drawer.tsx',+ package: 'core',component: 'Drawer',line: 192,decl: "transitionDuration: '0.01s'",@@ -966,8 +966,8 @@ export const TRANSFORM_TRANSITIONS: ReadonlyArray<SiteRef> = [decl: "transitionProperty: 'transform'",},{- file: 'lab/Drawer/Drawer.tsx',- package: 'lab',+ file: 'core/Drawer/Drawer.tsx',+ package: 'core',component: 'Drawer',line: 117,decl: "transitionProperty: 'transform'",diff --git a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/bugs/page.tsx b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/bugs/page.tsxindex 28be4654e8..505124693a 100644--- a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/bugs/page.tsx+++ b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/bugs/page.tsx@@ -564,7 +564,7 @@ export default function MotionBugsPage() {<DemoCardtitle="The drawer exit, cut short"question="Slide 410ms, unmount at 250ms. Drag either slider: at what point does an exit stop being an exit?"- badges={<Badge variant="success" label="Resolved in Lab" />}>+ badges={<Badge variant="success" label="Resolved before Core" />}><DemoBody><Text type="supporting"><strong>This was the lab failure.</strong> The former implementation@@ -574,12 +574,12 @@ export default function MotionBugsPage() {slide never rendered.</Text><Text type="supporting" color="secondary">- Lab Drawer now waits for the actual transform transition and uses a+ Drawer now waits for the actual transform transition and uses acomputed-duration backstop in{' '}- <code>lab/Drawer/useDrawerDialogPresence.ts</code>. Theme motion can- no longer desynchronize the visual exit from native-host release;- the sliders below preserve the original failure as an interactive- explanation of why the fix matters.+ <code>core/Drawer/useDrawerDialogPresence.ts</code>. Theme motion+ can no longer desynchronize the visual exit from native-host+ release; the sliders below preserve the original failure as an+ interactive explanation of why the fix matters.</Text></DemoBody><DemoBody>diff --git a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/previewPlan.ts b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/previewPlan.tsindex f7d5a29c8c..a46433a4a1 100644--- a/apps/sandbox/src/app/(sandbox)/pages/motion-lab/previewPlan.ts+++ b/apps/sandbox/src/app/(sandbox)/pages/motion-lab/previewPlan.ts@@ -370,7 +370,7 @@ export const PREVIEW_PLAN: ReadonlyArray<PreviewRow> = [},{id: 'drawer',- component: 'Drawer (lab)',+ component: 'Drawer',group: 'Overlays & layers',verdict: 'PARTIAL',motionCost: 'idle',diff --git a/apps/sandbox/src/app/(sandbox)/templates/page.tsx b/apps/sandbox/src/app/(sandbox)/templates/page.tsxindex 2dc8480631..c36a63685c 100644--- a/apps/sandbox/src/app/(sandbox)/templates/page.tsx+++ b/apps/sandbox/src/app/(sandbox)/templates/page.tsx@@ -33,7 +33,8 @@ import {TextInput} from '@astryxdesign/core/TextInput';import {colorVars, radiusVars} from '@astryxdesign/core/theme/tokens.stylex';import {Toolbar} from '@astryxdesign/core/Toolbar';import {useToast} from '@astryxdesign/core/Toast';-import {Drawer, DrawerHeader, Stat} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';+import {Stat} from '@astryxdesign/lab';import {TEMPLATE_AUDIT_CATEGORIES,diff --git a/apps/storybook/rtl-audit/targets.json b/apps/storybook/rtl-audit/targets.jsonindex 5b6b667080..3f2beda80c 100644--- a/apps/storybook/rtl-audit/targets.json+++ b/apps/storybook/rtl-audit/targets.json@@ -500,7 +500,7 @@},{"component": "Drawer",- "storyId": "lab-drawer--sides",+ "storyId": "core-drawer--sides","dims": ["D4"],"setup": {"click": "button:has-text(\"Open from end\")"diff --git a/apps/storybook/stories/Drawer.stories.tsx b/apps/storybook/stories/Drawer.stories.tsxindex 17b0a63899..01ccbe0568 100644--- a/apps/storybook/stories/Drawer.stories.tsx+++ b/apps/storybook/stories/Drawer.stories.tsx@@ -2,7 +2,7 @@import type {Meta, StoryObj} from '@storybook/react';import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';import {Divider} from '@astryxdesign/core/Divider';@@ -14,7 +14,7 @@ import {Text} from '@astryxdesign/core/Text';import {Theme, defineTheme} from '@astryxdesign/core/theme';const meta: Meta<typeof Drawer> = {- title: 'Lab/Drawer',+ title: 'Core/Drawer',component: Drawer,tags: ['autodocs'],parameters: {@@ -30,8 +30,8 @@ const meta: Meta<typeof Drawer> = {' LTR); block-axis sheets are `BottomSheet`.','- Works on **desktop and touch**: `width` is the desktop budget',' budget, and below 640px the panel preserves a 56px reveal',- ' without exceeding that budget (`isFullWidthOnMobile` makes it',- ' edge to edge).',+ ' without exceeding that budget (the experimental',+ ' `experimental={{isFullWidthOnMobile: true}}` makes it edge to edge).','- **Scrim optional**: modal with a scrim by default, or',' `hasScrim={false}` for a non-modal overlay that leaves the page',' behind interactive.',@@ -255,8 +255,8 @@ export const Widths: Story = {/*** On touch viewports (below 640px) the drawer preserves a 56px reveal of the- * page behind without exceeding its width budget; `isFullWidthOnMobile` makes- * it edge to edge. Resize the preview below 640px to compare.+ * page behind without exceeding its width budget; the experimental+ * `experimental={{isFullWidthOnMobile: true}}` makes it edge to edge. Resize the preview below 640px to compare.*/export const MobileWidth: Story = {render: () => {@@ -322,7 +322,7 @@ export const MobileWidth: Story = {isOpen={openFull}onOpenChange={setOpenFull}label="Region filters (full width)"- isFullWidthOnMobile>+ experimental={{isFullWidthOnMobile: true}}>{filters}</Drawer></>diff --git a/docs/architecture/layer-runtime.md b/docs/architecture/layer-runtime.mdindex 05f21651e7..79852f4bc7 100644--- a/docs/architecture/layer-runtime.md+++ b/docs/architecture/layer-runtime.md@@ -14,7 +14,7 @@ applies_to:packages/core/src/Layer/,packages/core/src/Popover/,packages/core/src/Dialog/,- packages/lab/src/Drawer/,+ packages/core/src/Drawer/,packages/core/src/DropdownMenu/,packages/core/src/ContextMenu/,packages/core/src/Tooltip/,@@ -241,11 +241,11 @@ contract. The current shared stack registers present layers with `close` oractive-cycle registration sequence. `useFocusTrap` adapts an active trap with `onEscape` intothat stack.-Tooltip, HoverCard, Dialog, Lab Drawer, Popover, DropdownMenu, ContextMenu,+Tooltip, HoverCard, Dialog, Drawer, Popover, DropdownMenu, ContextMenu,Lightbox, MobileNav, BottomSheet, and BottomSheetSwitcher all register with the sharedstack. Tooltip and HoverCard report current DOM presence; Popover andDropdownMenu register through `useFocusTrap`; Dialog, Lightbox, MobileNav,-BottomSheet, BottomSheetSwitcher, and Lab Drawer additionally ask+BottomSheet, BottomSheetSwitcher, and Drawer additionally ask`shouldDismissOnCloseRequest()` before acting on native platform closerequests. Other family members still use local Escape handling as listed in`family:overlay-dismissal`.@@ -274,9 +274,9 @@ React contexts carrying surface/group membership, and named structural customproperties; structural CSS isolation covers only the channels it names.The shared private text baseline is applied in both `useLayer` renderers and the-Dialog, Lightbox, MobileNav, BottomSheetPanel, and ToastViewport content roots.-Component and caller styling remains stronger. Existing padding normalization,-hosting, theme inheritance, and writing context remain unchanged.+Dialog, Drawer, Lightbox, MobileNav, BottomSheetPanel, and ToastViewport content+roots. Component and caller styling remains stronger. Existing padding+normalization, hosting, theme inheritance, and writing context remain unchanged.`createLayerScopedContext` creates surface-scoped contexts whose complete defaultvalue is provided by `LayerContentBoundary`. Membership-owned disabled state,@@ -292,12 +292,6 @@ remount live content or discard state/focus. Existing native depth-provider seamretain their original depth values; raw Layer, sheet panels, and toast contentuse the private content boundary directly. Toast page children stay outside it.-Lab Drawer uses the equivalent package-local text baseline and retains its-existing hosting, dismissal depth, and ancestor React contexts. Whole-context-isolation for Drawer is not implemented: the private Core boundary is not-available across that package boundary. This is a remaining package-architecture-gap, not a claim of complete provider isolation.-The private structural reset sits beside the text baseline on the same contentroots and stops each structural custom property it names by setting it to`initial`. It names `--step-connector-gap`, so an inner Stepper in a layer opened@@ -466,8 +460,8 @@ be updated only as that work ships.menu-cascade parent-close chain.- Dialog families own native modal/backdrop presentation and their local channelpolicies.-- Lab Drawer owns modal `showModal()` and non-modal `showPopover()` hosting while- the shared dismissal stack owns Escape and platform close routing.+- Drawer owns modal `showModal()` and non-modal `showPopover()` hosting while the+ shared dismissal stack owns Escape and platform close routing.- `LayerProvider`, `ToastContext`, `useToast`, and `ToastViewport` own currentnotification state, dispatch, and viewport rendering; the viewport sits atthe provider's inset on each edge unless its own `toast.inset` overrides thatdiff --git a/docs/families/overlay-dismissal.md b/docs/families/overlay-dismissal.mdindex d76df7cb33..d451c22bfa 100644--- a/docs/families/overlay-dismissal.md+++ b/docs/families/overlay-dismissal.md@@ -15,7 +15,7 @@ verified_by:packages/core/src/Layer/useLayerDismissal.test.tsx,packages/core/src/Layer/layerDismissalInvariants.test.tsx,packages/core/src/Layer/layerDismissalFamilies.test.tsx,- packages/lab/src/Drawer/Drawer.test.tsx,+ packages/core/src/Drawer/Drawer.test.tsx,packages/core/src/hooks/useFocusTrap.test.tsx,packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx,packages/core/src/ContextMenu/ContextMenu.test.tsx,@@ -104,7 +104,7 @@ this record's current membership snapshot must be updated with it.- **Current members:** Dialog, AlertDialog, Popover, DropdownMenu,DropdownMenuSubMenu, MoreMenu, Tooltip, HoverCard, Lightbox, MobileNav,BottomSheet, BottomSheetSwitcher, CommandPalette, ContextMenu,- PowerSearchEditPopover, Lab Drawer, and the component-owned popup surfaces+ PowerSearchEditPopover, Drawer, and the component-owned popup surfaceslisted below.- **Component-owned input popups:** ChatComposerInput, ComplexSelector,DateInput, DateRangeInput, DateTimeInput, Selector, MultiSelector,@@ -204,7 +204,7 @@ this record's current membership snapshot must be updated with it.| Components or surface | Adoption | Current deviation or limitation || -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| Dialog, AlertDialog, Popover, DropdownMenu root, ContextMenu, MoreMenu, Lightbox, MobileNav, Lab Drawer, CommandPalette | shared owner; CommandPalette composes Dialog | none |+| Dialog, AlertDialog, Popover, DropdownMenu root, ContextMenu, MoreMenu, Lightbox, MobileNav, Drawer, CommandPalette | shared owner; CommandPalette composes Dialog | none || Tooltip, HoverCard | shared owner with DOM presence reporting | Neither provides nesting depth to descendant layers || Focus traps with `onEscape` | shared owner through `useFocusTrap` | They provide DOM containment, not descendant depth || BreadcrumbItem, ChatComposerInput, ComplexSelector, DateInput, DateRangeInput, DateTimeInput, Selector, MultiSelector, PowerSearch, BaseTypeahead, Typeahead, Tokenizer, SideNavHeading, SideNavItem, TabMenu, TopNavHeading, TopNavMenu, TopNavMegaMenu, Table, Lab TourStep, Lab ChatEmojiPicker | shared owner through `usePopover` or a composed Popover owner | Table filtering owns controlled Popover state and discards its draft on close; TourStep routes Popover close to the Tour; ChatEmojiPicker owns controlled Popover state |diff --git a/docs/specs/AST-027/spec.md b/docs/specs/AST-027/spec.mdindex c8ad700f9a..ffe60842b3 100644--- a/docs/specs/AST-027/spec.md+++ b/docs/specs/AST-027/spec.md@@ -197,7 +197,7 @@ production declarations across 40 files and these current gaps:| BottomSheet and BottomSheetSwitcher non-modal paths | Non-modal `dialog.show()` paths use static or dynamic values beginning at `1000` | **Confirmed global leaks.** A page band cannot provide dialog-layer semantics | Route non-modal hosting through Layer/native top-layer infrastructure; keep panel, handle, tint, action, and stack ordering locally isolated inside the host |Current source already routes Tooltip, HoverCard, Popover, DropdownMenu and its-submenus, ContextMenu, CommandPalette, modal Dialog, Lab Drawer, Lightbox,+submenus, ContextMenu, CommandPalette, modal Dialog, Drawer, Lightbox,MobileNav, Tour, Date-input layers, and RadialTooltip through Layer, nativePopover, or `showModal()`. Their cross-page mechanism is directionallyconforming. The confirmed exceptions are ChartTooltip and the non-modaldiff --git a/internal/shadcn-registry/routes.lock.json b/internal/shadcn-registry/routes.lock.jsonindex 818d52658b..786a241ce6 100644--- a/internal/shadcn-registry/routes.lock.json+++ b/internal/shadcn-registry/routes.lock.json@@ -346,6 +346,20 @@"path": "components/divider","aliases": []},+ {+ "name": "component-drawer",+ "path": "components/drawer",+ "aliases": [+ "components/lab/drawer"+ ]+ },+ {+ "name": "component-drawer-header",+ "path": "components/drawer-header",+ "aliases": [+ "components/lab/drawer-header"+ ]+ },{"name": "component-dropdown-menu","path": "components/dropdown-menu",@@ -581,16 +595,6 @@"path": "components/lab/diff-viewer","aliases": []},- {- "name": "component-lab-drawer",- "path": "components/lab/drawer",- "aliases": []- },- {- "name": "component-lab-drawer-header",- "path": "components/lab/drawer-header",- "aliases": []- },{"name": "component-lab-emoji-picker","path": "components/lab/emoji-picker",@@ -2051,8 +2055,8 @@"aliases": []},{- "name": "example-drawer-mobile-the-56px-page-reveal-default",- "path": "examples/drawer/mobile-the-56px-page-reveal-default",+ "name": "example-drawer-edit-form-with-footer-actions",+ "path": "examples/drawer/edit-form-with-footer-actions","aliases": []},{@@ -2065,11 +2069,6 @@"path": "examples/drawer/slide-in-from-the-start-edge","aliases": []},- {- "name": "example-drawer-wide-desktop-panel-full-width-on-mobile",- "path": "examples/drawer/wide-desktop-panel-full-width-on-mobile",- "aliases": []- },{"name": "example-drawer-width-budget-pixels-or-any-css-length","path": "examples/drawer/width-budget-pixels-or-any-css-length",diff --git a/packages/cli/api/component/component.test.mjs b/packages/cli/api/component/component.test.mjsindex 261b7535c1..8ec2cb81ab 100644--- a/packages/cli/api/component/component.test.mjs+++ b/packages/cli/api/component/component.test.mjs@@ -17,217 +17,390 @@ import {AstryxError} from '../error.mjs';import {runCli} from '../../test-utils/run-cli.mjs';// api/component/ -> up 4 = repo root (has packages/core, which findCoreDir walks to).-const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../..');+const REPO = path.resolve(+ path.dirname(fileURLToPath(import.meta.url)),+ '../../../..',+);const cwd = REPO;const SLOW = 30_000;describe('component dispatcher — routing', () => {- it('routes a bare name to component.detail', async () => {- const r = await component('Button', {cwd});- expect(r.type).toBe('component.detail');- expect(r.data.name).toBe('Button');- }, SLOW);-- it('routes no-name to the list leaf (component.list, detail=names)', async () => {- const r = await component(undefined, {cwd});- expect(r.type).toBe('component.list');- expect(r.data.detail).toBe('names');- expect(Object.keys(r.data.components).length).toBeGreaterThan(0);- }, SLOW);-- it('routes --category to the list leaf, filtered to that group', async () => {- const r = await component(undefined, {cwd, category: 'Layout'});- expect(r.type).toBe('component.list');- expect(Object.keys(r.data.components)).toContain('Layout');- }, SLOW);-- it('treats an empty-string name as a list (not a not-found error)', async () => {- const r = await component('', {cwd});- expect(r.type).toBe('component.list');- }, SLOW);+ it(+ 'routes a bare name to component.detail',+ async () => {+ const r = await component('Button', {cwd});+ expect(r.type).toBe('component.detail');+ expect(r.data.name).toBe('Button');+ },+ SLOW,+ );++ it(+ 'routes no-name to the list leaf (component.list, detail=names)',+ async () => {+ const r = await component(undefined, {cwd});+ expect(r.type).toBe('component.list');+ expect(r.data.detail).toBe('names');+ expect(Object.keys(r.data.components).length).toBeGreaterThan(0);+ },+ SLOW,+ );++ it(+ 'routes --category to the list leaf, filtered to that group',+ async () => {+ const r = await component(undefined, {cwd, category: 'Layout'});+ expect(r.type).toBe('component.list');+ expect(Object.keys(r.data.components)).toContain('Layout');+ },+ SLOW,+ );++ it(+ 'treats an empty-string name as a list (not a not-found error)',+ async () => {+ const r = await component('', {cwd});+ expect(r.type).toBe('component.list');+ },+ SLOW,+ );});describe('component dispatcher — detail levels on list', () => {- it('--detail compact lists with detail=compact', async () => {- const r = await component(undefined, {cwd, list: true, detail: 'compact'});- expect(r.type).toBe('component.list');- expect(r.data.detail).toBe('compact');- }, SLOW);-- it('--detail full lists with detail=full', async () => {- const r = await component(undefined, {cwd, list: true, detail: 'full'});- expect(r.type).toBe('component.list');- expect(r.data.detail).toBe('full');- }, SLOW);+ it(+ '--detail compact lists with detail=compact',+ async () => {+ const r = await component(undefined, {+ cwd,+ list: true,+ detail: 'compact',+ });+ expect(r.type).toBe('component.list');+ expect(r.data.detail).toBe('compact');+ },+ SLOW,+ );++ it(+ '--detail full lists with detail=full',+ async () => {+ const r = await component(undefined, {cwd, list: true, detail: 'full'});+ expect(r.type).toBe('component.list');+ expect(r.data.detail).toBe('full');+ },+ SLOW,+ );});describe('component dispatcher — projection precedence (locked)', () => {- it('--props routes to component.detail.props', async () => {- const r = await component('Button', {cwd, props: true});- expect(r.type).toBe('component.detail.props');- }, SLOW);-- it('--source routes to component.detail.source', async () => {- const r = await component('Button', {cwd, source: true});- expect(r.type).toBe('component.detail.source');- }, SLOW);-- it('--source WINS over --props when both are set (precedence lock)', async () => {- const r = await component('Button', {cwd, props: true, source: true});- expect(r.type).toBe('component.detail.source');- }, SLOW);-- it('--list WINS over a given name (list dispatch precedence lock)', async () => {- const r = await component('Button', {cwd, list: true});- expect(r.type).toBe('component.list');- }, SLOW);+ it(+ '--props routes to component.detail.props',+ async () => {+ const r = await component('Button', {cwd, props: true});+ expect(r.type).toBe('component.detail.props');+ },+ SLOW,+ );++ it(+ '--source routes to component.detail.source',+ async () => {+ const r = await component('Button', {cwd, source: true});+ expect(r.type).toBe('component.detail.source');+ },+ SLOW,+ );++ it(+ '--source WINS over --props when both are set (precedence lock)',+ async () => {+ const r = await component('Button', {cwd, props: true, source: true});+ expect(r.type).toBe('component.detail.source');+ },+ SLOW,+ );++ it(+ '--list WINS over a given name (list dispatch precedence lock)',+ async () => {+ const r = await component('Button', {cwd, list: true});+ expect(r.type).toBe('component.list');+ },+ SLOW,+ );});describe('component dispatcher — name resolution', () => {- it('strips a legacy XDS prefix (XDSButton -> Button)', async () => {- const r = await component('XDSButton', {cwd});- expect(r.type).toBe('component.detail');- expect(r.data.name).toBe('Button');- }, SLOW);-- it('is case-SENSITIVE: a lowercased name is unknown', async () => {- let err;- try {- await component('button', {cwd});- } catch (e) {- err = e;- }- expect(err).toBeDefined();- expect(err.code).toBe('ERR_UNKNOWN_COMPONENT');- }, SLOW);-- it('throws ERR_UNKNOWN_COMPONENT for a genuinely unknown name', async () => {- let err;- try {- await component('ZzzNope99', {cwd});- } catch (e) {- err = e;- }- expect(err.code).toBe('ERR_UNKNOWN_COMPONENT');- }, SLOW);-- it('throws ERR_UNKNOWN_PACKAGE when --package names a missing package', async () => {- let err;- try {- await component('Button', {cwd, package: '@nonexistent/pkg-xyz'});- } catch (e) {- err = e;- }- expect(err).toBeDefined();- expect(err.code).toBe('ERR_UNKNOWN_PACKAGE');- }, SLOW);-});+ it(+ 'strips a legacy XDS prefix (XDSButton -> Button)',+ async () => {+ const r = await component('XDSButton', {cwd});+ expect(r.type).toBe('component.detail');+ expect(r.data.name).toBe('Button');+ },+ SLOW,+ );++ it(+ 'is case-SENSITIVE: a lowercased name is unknown',+ async () => {+ let err;+ try {+ await component('button', {cwd});+ } catch (e) {+ err = e;+ }+ expect(err).toBeDefined();+ expect(err.code).toBe('ERR_UNKNOWN_COMPONENT');+ },+ SLOW,+ );+ it(+ 'throws ERR_UNKNOWN_COMPONENT for a genuinely unknown name',+ async () => {+ let err;+ try {+ await component('ZzzNope99', {cwd});+ } catch (e) {+ err = e;+ }+ expect(err.code).toBe('ERR_UNKNOWN_COMPONENT');+ },+ SLOW,+ );++ it(+ 'throws ERR_UNKNOWN_PACKAGE when --package names a missing package',+ async () => {+ let err;+ try {+ await component('Button', {cwd, package: '@nonexistent/pkg-xyz'});+ } catch (e) {+ err = e;+ }+ expect(err).toBeDefined();+ expect(err.code).toBe('ERR_UNKNOWN_PACKAGE');+ },+ SLOW,+ );+});describe('component dispatcher — scoped --package routes all projections', () => {const CORE = '@astryxdesign/core';- it('--package (core) routes --showcase like the no-scope path', async () => {- const ns = await component('Button', {cwd, showcase: true});- const sc = await component('Button', {cwd, package: CORE, showcase: true});- expect(sc.type).toBe(ns.type); // was silently component.detail before the fix- }, SLOW);-- it('--package (core) routes --blocks like the no-scope path', async () => {- const ns = await component('Button', {cwd, blocks: true});- const sc = await component('Button', {cwd, package: CORE, blocks: true});- expect(sc.type).toBe(ns.type);- expect(sc.type).toBe('component.detail.blocks');- }, SLOW);-- it('--package (core) still routes --source and --props', async () => {- expect((await component('Button', {cwd, package: CORE, source: true})).type).toBe(- 'component.detail.source',- );- expect((await component('Button', {cwd, package: CORE, props: true})).type).toBe(- 'component.detail.props',- );- }, SLOW);+ it(+ '--package (core) routes --showcase like the no-scope path',+ async () => {+ const ns = await component('Button', {cwd, showcase: true});+ const sc = await component('Button', {+ cwd,+ package: CORE,+ showcase: true,+ });+ expect(sc.type).toBe(ns.type); // was silently component.detail before the fix+ },+ SLOW,+ );++ it(+ '--package (core) routes --blocks like the no-scope path',+ async () => {+ const ns = await component('Button', {cwd, blocks: true});+ const sc = await component('Button', {cwd, package: CORE, blocks: true});+ expect(sc.type).toBe(ns.type);+ expect(sc.type).toBe('component.detail.blocks');+ },+ SLOW,+ );++ it(+ "--props carries a prop doc's stability marker (Drawer's experimental prop)",+ async () => {+ const r = await component('Drawer', {cwd, props: true});+ expect(r.type).toBe('component.detail.props');+ const experimental = r.data.find(p => p.name === 'experimental');+ expect(experimental?.stability).toBe('experimental');+ // Only the experimental prop object is marked; stable props carry no field.+ expect(+ r.data.filter(p => p.stability !== undefined).map(p => p.name),+ ).toEqual(['experimental']);+ },+ SLOW,+ );++ it(+ '--props --json and the text props table both show the stability marker',+ async () => {+ const json = await runCli(+ ['component', 'Drawer', '--props', '--json'],+ cwd,+ );+ expect(json.status).toBe(0);+ const envelope = JSON.parse(json.stdout);+ expect(envelope.type).toBe('component.detail.props');+ expect(+ envelope.data.find(p => p.name === 'experimental')?.stability,+ ).toBe('experimental');++ const text = await runCli(['component', 'Drawer', '--props'], cwd);+ expect(text.status).toBe(0);+ const rows = text.stdout+ .split('\n')+ .filter(line => line.startsWith('| `'));+ const experimentalRow = rows.find(line =>+ line.startsWith('| `experimental` |'),+ );+ expect(experimentalRow).toContain('**(experimental)**');+ expect(+ rows.filter(line => line.includes('**(experimental)**')),+ ).toHaveLength(1);+ },+ SLOW,+ );++ it(+ '--package (core) still routes --source and --props',+ async () => {+ expect(+ (await component('Button', {cwd, package: CORE, source: true})).type,+ ).toBe('component.detail.source');+ expect(+ (await component('Button', {cwd, package: CORE, props: true})).type,+ ).toBe('component.detail.props');+ },+ SLOW,+ );});describe('component dispatcher — category guard', () => {- it('a non-string category throws a coded error (not a raw TypeError)', async () => {- for (const bad of [123, {}, [1]]) {- const err = await component(undefined, {- cwd,- category: /** @type {any} */ (bad),- }).catch(e => e);- expect(err).toBeInstanceOf(AstryxError);- expect(err.code).toBe('ERR_UNKNOWN_CATEGORY');- }- }, SLOW);+ it(+ 'a non-string category throws a coded error (not a raw TypeError)',+ async () => {+ for (const bad of [123, {}, [1]]) {+ const err = await component(undefined, {+ cwd,+ category: /** @type {any} */ (bad),+ }).catch(e => e);+ expect(err).toBeInstanceOf(AstryxError);+ expect(err.code).toBe('ERR_UNKNOWN_CATEGORY');+ }+ },+ SLOW,+ );});describe('component dispatcher — detail and lang guards', () => {// `detail` and `lang` are the same controls as the CLI's --detail and --lang:// same accepted values, same error codes.- it('rejects a detail level the CLI rejects, with the same code', async () => {- const cliRun = await runCli(['--json', 'component', '--list', '--detail', 'bogus'], cwd);- expect(cliRun.code).toBe(1);- expect(JSON.parse(cliRun.stdout).code).toBe('ERR_INVALID_DETAIL');-- const bogus = /** @type {any} */ ('bogus');- for (const call of [- () => component(undefined, {cwd, list: true, detail: bogus}),- () => component('Button', {cwd, detail: bogus}),- ]) {- const err = await call().catch(e => e);- expect(err).toBeInstanceOf(AstryxError);- expect(err.code).toBe('ERR_INVALID_DETAIL');- }- }, SLOW);-- it('rejects a lang the CLI rejects, with the same code', async () => {- const cliRun = await runCli(['--json', 'component', 'Button', '--lang', 'fr'], cwd);- expect(cliRun.code).toBe(1);- expect(JSON.parse(cliRun.stdout).code).toBe('ERR_INVALID_LANG');-- for (const call of [- () => component('Button', {cwd, lang: 'fr'}),- () => component(undefined, {cwd, list: true, detail: 'compact', lang: 'fr'}),- ]) {- const err = await call().catch(e => e);- expect(err).toBeInstanceOf(AstryxError);- expect(err.code).toBe('ERR_INVALID_LANG');- }- const zh = await component('Button', {cwd, lang: 'zh'});- expect(zh.type).toBe('component.detail');- }, SLOW);+ it(+ 'rejects a detail level the CLI rejects, with the same code',+ async () => {+ const cliRun = await runCli(+ ['--json', 'component', '--list', '--detail', 'bogus'],+ cwd,+ );+ expect(cliRun.code).toBe(1);+ expect(JSON.parse(cliRun.stdout).code).toBe('ERR_INVALID_DETAIL');++ const bogus = /** @type {any} */ ('bogus');+ for (const call of [+ () => component(undefined, {cwd, list: true, detail: bogus}),+ () => component('Button', {cwd, detail: bogus}),+ ]) {+ const err = await call().catch(e => e);+ expect(err).toBeInstanceOf(AstryxError);+ expect(err.code).toBe('ERR_INVALID_DETAIL');+ }+ },+ SLOW,+ );++ it(+ 'rejects a lang the CLI rejects, with the same code',+ async () => {+ const cliRun = await runCli(+ ['--json', 'component', 'Button', '--lang', 'fr'],+ cwd,+ );+ expect(cliRun.code).toBe(1);+ expect(JSON.parse(cliRun.stdout).code).toBe('ERR_INVALID_LANG');++ for (const call of [+ () => component('Button', {cwd, lang: 'fr'}),+ () =>+ component(undefined, {+ cwd,+ list: true,+ detail: 'compact',+ lang: 'fr',+ }),+ ]) {+ const err = await call().catch(e => e);+ expect(err).toBeInstanceOf(AstryxError);+ expect(err.code).toBe('ERR_INVALID_LANG');+ }+ const zh = await component('Button', {cwd, lang: 'zh'});+ expect(zh.type).toBe('component.detail');+ },+ SLOW,+ );});describe('component dispatcher — detail levels on single component (text only)', () => {- it('--detail compact returns less text than full', async () => {- const full = await runCli(['component', 'Button'], cwd);- const compact = await runCli(['component', 'Button', '--detail', 'compact'], cwd);- expect(full.code).toBe(0);- expect(compact.code).toBe(0);- expect(compact.stdout.length).toBeLessThan(full.stdout.length);- // Compact still shows the name and import- expect(compact.stdout).toContain('Button');- expect(compact.stdout).toContain('@astryxdesign/core');- }, SLOW);-- it('--detail brief returns less text than compact', async () => {- const compact = await runCli(['component', 'Button', '--detail', 'compact'], cwd);- const brief = await runCli(['component', 'Button', '--detail', 'brief'], cwd);- expect(brief.code).toBe(0);- expect(brief.stdout.length).toBeLessThan(compact.stdout.length);- expect(brief.stdout).toContain('Button');- }, SLOW);-- it('--json --detail compact returns the same full JSON as --json (contract)', async () => {- const full = await runCli(['--json', 'component', 'Button'], cwd);- const compact = await runCli(['--json', 'component', 'Button', '--detail', 'compact'], cwd);- expect(full.code).toBe(0);- expect(compact.code).toBe(0);- const fullData = JSON.parse(full.stdout);- const compactData = JSON.parse(compact.stdout);- // JSON shape is identical — detail is a text-only projection- expect(Object.keys(compactData.data).sort()).toEqual(Object.keys(fullData.data).sort());- }, SLOW);+ it(+ '--detail compact returns less text than full',+ async () => {+ const full = await runCli(['component', 'Button'], cwd);+ const compact = await runCli(+ ['component', 'Button', '--detail', 'compact'],+ cwd,+ );+ expect(full.code).toBe(0);+ expect(compact.code).toBe(0);+ expect(compact.stdout.length).toBeLessThan(full.stdout.length);+ // Compact still shows the name and import+ expect(compact.stdout).toContain('Button');+ expect(compact.stdout).toContain('@astryxdesign/core');+ },+ SLOW,+ );++ it(+ '--detail brief returns less text than compact',+ async () => {+ const compact = await runCli(+ ['component', 'Button', '--detail', 'compact'],+ cwd,+ );+ const brief = await runCli(+ ['component', 'Button', '--detail', 'brief'],+ cwd,+ );+ expect(brief.code).toBe(0);+ expect(brief.stdout.length).toBeLessThan(compact.stdout.length);+ expect(brief.stdout).toContain('Button');+ },+ SLOW,+ );++ it(+ '--json --detail compact returns the same full JSON as --json (contract)',+ async () => {+ const full = await runCli(['--json', 'component', 'Button'], cwd);+ const compact = await runCli(+ ['--json', 'component', 'Button', '--detail', 'compact'],+ cwd,+ );+ expect(full.code).toBe(0);+ expect(compact.code).toBe(0);+ const fullData = JSON.parse(full.stdout);+ const compactData = JSON.parse(compact.stdout);+ // JSON shape is identical — detail is a text-only projection+ expect(Object.keys(compactData.data).sort()).toEqual(+ Object.keys(fullData.data).sort(),+ );+ },+ SLOW,+ );});diff --git a/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.doc.mjs b/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.doc.mjsnew file mode 100644index 0000000000..1f0bd753f0--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.doc.mjs@@ -0,0 +1,24 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Edit form with footer actions',+ displayName: 'Edit form with footer actions',+ description:+ 'Compose a Layout with DrawerHeader, the fields in LayoutContent, and Cancel and Save in a pinned LayoutFooter. purpose="form" keeps Escape but ignores scrim clicks, so a stray click outside does not discard edits.',+ exampleFor: 'Drawer',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: [+ 'Drawer',+ 'DrawerHeader',+ 'Button',+ 'Layout',+ 'LayoutContent',+ 'LayoutFooter',+ 'HStack',+ 'VStack',+ 'TextInput',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.tsx b/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.tsxnew file mode 100644index 0000000000..7515ef5cd2--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerForm.tsx@@ -0,0 +1,62 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++/**+ * @input Controlled open state and two editable fields+ * @output A form drawer with a header, scrolling fields, and pinned footer+ * actions; purpose="form" keeps Escape but ignores scrim clicks+ * @position Copyable Drawer example+ */++import {useState} from 'react';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';+import {Button} from '@astryxdesign/core/Button';+import {Layout, LayoutContent, LayoutFooter} from '@astryxdesign/core/Layout';+import {HStack, VStack} from '@astryxdesign/core/Stack';+import {TextInput} from '@astryxdesign/core/TextInput';++export default function DrawerForm() {+ const [isOpen, setIsOpen] = useState(false);+ const [name, setName] = useState('web-prod-04');+ const [owner, setOwner] = useState('Platform team');++ return (+ <>+ <Button label="Edit host" onClick={() => setIsOpen(true)} />+ <Drawer+ isOpen={isOpen}+ onOpenChange={setIsOpen}+ label="Edit host"+ purpose="form">+ <Layout+ header={<DrawerHeader title="Edit host" onOpenChange={setIsOpen} />}+ content={+ <LayoutContent>+ <VStack gap={4}>+ <TextInput label="Name" value={name} onChange={setName} />+ <TextInput label="Owner" value={owner} onChange={setOwner} />+ </VStack>+ </LayoutContent>+ }+ footer={+ <LayoutFooter>+ <HStack gap={2} hAlign="end">+ <Button+ label="Cancel"+ variant="secondary"+ onClick={() => setIsOpen(false)}+ />+ <Button+ label="Save"+ variant="primary"+ onClick={() => setIsOpen(false)}+ />+ </HStack>+ </LayoutFooter>+ }+ />+ </Drawer>+ </>+ );+}diff --git a/packages/lab/blocks/DrawerScrim.doc.mjs b/packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerScrim.doc.mjsrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.doc.mjsindex e54fb9f659..ef23ab125f 100644--- a/packages/lab/blocks/DrawerScrim.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'Modal or non-modal (hasScrim)',displayName: 'Modal or non-modal (hasScrim)',diff --git a/packages/lab/blocks/DrawerScrim.tsx b/packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.tsxsimilarity index 94%rename from packages/lab/blocks/DrawerScrim.tsxrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.tsxindex 2b9fd3f9c8..272793af95 100644--- a/packages/lab/blocks/DrawerScrim.tsx+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerScrim.tsx@@ -5,11 +5,11 @@/*** @input Separate controlled states for modal and non-modal drawers* @output A comparison of hasScrim's two presentations- * @position Copyable Lab Drawer example+ * @position Copyable Drawer example*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';import {HStack} from '@astryxdesign/core/Stack';diff --git a/packages/lab/blocks/DrawerShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerShowcase.doc.mjsrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.doc.mjsindex 7ac637de68..10a5d260d9 100644--- a/packages/lab/blocks/DrawerShowcase.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'Basic',displayName: 'Basic',diff --git a/packages/lab/blocks/DrawerShowcase.tsx b/packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.tsxsimilarity index 82%rename from packages/lab/blocks/DrawerShowcase.tsxrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.tsxindex 5189045d00..e2371e2c09 100644--- a/packages/lab/blocks/DrawerShowcase.tsx+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerShowcase.tsx@@ -4,12 +4,12 @@/*** @input Controlled open state for a modal Drawer- * @output A single-trigger drawer with a scrim and the built-in close button- * @position Lab Drawer's docsite showcase and copyable CLI block+ * @output A single-trigger drawer with a scrim and a DrawerHeader close button+ * @position Drawer's docsite showcase and copyable CLI block*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';import {Text} from '@astryxdesign/core/Text';diff --git a/packages/lab/blocks/DrawerStart.doc.mjs b/packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerStart.doc.mjsrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.doc.mjsindex abc878553b..b5c9ec4923 100644--- a/packages/lab/blocks/DrawerStart.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'Slide in from the start edge',displayName: 'Slide in from the start edge',diff --git a/packages/lab/blocks/DrawerStart.tsx b/packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.tsxsimilarity index 91%rename from packages/lab/blocks/DrawerStart.tsxrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.tsxindex 60833fd45e..04b2f61cb4 100644--- a/packages/lab/blocks/DrawerStart.tsx+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerStart.tsx@@ -5,11 +5,11 @@/*** @input Controlled open state and the logical start edge* @output A Drawer that opens from the start side of the viewport- * @position Copyable Lab Drawer example+ * @position Copyable Drawer example*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';import {Text} from '@astryxdesign/core/Text';diff --git a/packages/lab/blocks/DrawerWidths.doc.mjs b/packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerWidths.doc.mjsrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.doc.mjsindex b527c6e4a9..b5ea685380 100644--- a/packages/lab/blocks/DrawerWidths.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'Width budget: pixels or any CSS length',displayName: 'Width budget: pixels or any CSS length',diff --git a/packages/lab/blocks/DrawerWidths.tsx b/packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.tsxsimilarity index 93%rename from packages/lab/blocks/DrawerWidths.tsxrename to packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.tsxindex 7bfcef7182..4a34359e3a 100644--- a/packages/lab/blocks/DrawerWidths.tsx+++ b/packages/cli/assets/templates/blocks/components/Drawer/DrawerWidths.tsx@@ -5,11 +5,11 @@/*** @input A pixel, rem, or percentage width and controlled open state* @output A Drawer demonstrating the selected width budget- * @position Copyable Lab Drawer example+ * @position Copyable Drawer example*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';import {HStack} from '@astryxdesign/core/Stack';diff --git a/packages/lab/blocks/DrawerHeaderShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerHeaderShowcase.doc.mjsrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.doc.mjsindex 0ead01b2e0..76ebe609e0 100644--- a/packages/lab/blocks/DrawerHeaderShowcase.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'DrawerHeader',displayName: 'Drawer Header',diff --git a/packages/lab/blocks/DrawerHeaderShowcase.tsx b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.tsxsimilarity index 94%rename from packages/lab/blocks/DrawerHeaderShowcase.tsxrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.tsxindex 2da27e2813..1a05e17d5e 100644--- a/packages/lab/blocks/DrawerHeaderShowcase.tsx+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderShowcase.tsx@@ -5,13 +5,13 @@/*** @input Static header content: title, subtitle, a no-op close handler, and a divider* @output The DrawerHeader row at the top of a square-cornered, drawer-width panel, visible without opening an overlay- * @position Lab DrawerHeader's docsite showcase. Drawer has no inline mode+ * @position DrawerHeader's docsite showcase. Drawer has no inline mode* like Dialog's isInline, so a plain panel stands in for the drawer; in an* app, compose DrawerHeader in a Layout header slot inside a Drawer.*/import * as stylex from '@stylexjs/stylex';-import {DrawerHeader} from '@astryxdesign/lab';+import {DrawerHeader} from '@astryxdesign/core/Drawer';import {Layout,LayoutContent,diff --git a/packages/lab/blocks/DrawerHeaderSubtitleEndContent.doc.mjs b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerHeaderSubtitleEndContent.doc.mjsrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.doc.mjsindex 415c6d7fab..41726986a7 100644--- a/packages/lab/blocks/DrawerHeaderSubtitleEndContent.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'With subtitle and end content',displayName: 'With subtitle and end content',diff --git a/packages/lab/blocks/DrawerHeaderSubtitleEndContent.tsx b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.tsxsimilarity index 92%rename from packages/lab/blocks/DrawerHeaderSubtitleEndContent.tsxrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.tsxindex e81ca6077f..77be7756b1 100644--- a/packages/lab/blocks/DrawerHeaderSubtitleEndContent.tsx+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderSubtitleEndContent.tsx@@ -5,11 +5,11 @@/*** @input Controlled open state for a modal Drawer* @output A DrawerHeader with a subtitle, a status badge in its end slot, and a close button- * @position Copyable Lab DrawerHeader example+ * @position Copyable DrawerHeader example*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Badge} from '@astryxdesign/core/Badge';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';diff --git a/packages/lab/blocks/DrawerHeaderWithCloseButton.doc.mjs b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.doc.mjssimilarity index 96%rename from packages/lab/blocks/DrawerHeaderWithCloseButton.doc.mjsrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.doc.mjsindex 25518ff074..71eafb67b4 100644--- a/packages/lab/blocks/DrawerHeaderWithCloseButton.doc.mjs+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.doc.mjs@@ -1,7 +1,7 @@// Copyright (c) Meta Platforms, Inc. and affiliates./** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {+export const doc = {type: 'block',name: 'With close button',displayName: 'With close button',diff --git a/packages/lab/blocks/DrawerHeaderWithCloseButton.tsx b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.tsxsimilarity index 91%rename from packages/lab/blocks/DrawerHeaderWithCloseButton.tsxrename to packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.tsxindex 327fadd77a..fba3ce5c93 100644--- a/packages/lab/blocks/DrawerHeaderWithCloseButton.tsx+++ b/packages/cli/assets/templates/blocks/components/DrawerHeader/DrawerHeaderWithCloseButton.tsx@@ -5,11 +5,11 @@/*** @input Controlled open state for a modal Drawer* @output A Drawer whose DrawerHeader renders a close button because it receives onOpenChange- * @position Copyable Lab DrawerHeader example+ * @position Copyable DrawerHeader example*/import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Button} from '@astryxdesign/core/Button';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';import {Text} from '@astryxdesign/core/Text';diff --git a/packages/cli/assets/templates/pages/detail-page/page.tsx b/packages/cli/assets/templates/pages/detail-page/page.tsxindex a206ff10ed..c5d158107c 100644--- a/packages/cli/assets/templates/pages/detail-page/page.tsx+++ b/packages/cli/assets/templates/pages/detail-page/page.tsx@@ -600,9 +600,9 @@ export default function DetailPage2Template() {}end={!isNarrow && showSidePanel ? <RightPanel /> : undefined}/>- {/* Mobile: the side panel content opens as a full-screen dialog. (A- side drawer/sheet would be more idiomatic, but Astryx has no Drawer- component yet — #2575 — so we use the fullscreen Dialog variant.) */}+ {/* Mobile: the side-panel content uses the full viewport so order details+ are not squeezed beside narrow page chrome. Drawer remains available+ for side-overlay flows that intentionally preserve page context. */}<Dialogvariant="fullscreen"isOpen={isNarrow && isPanelDialogOpen}diff --git a/packages/cli/assets/templates/pages/table-inbox/page.tsx b/packages/cli/assets/templates/pages/table-inbox/page.tsxindex c1990a5450..dce203341d 100644--- a/packages/cli/assets/templates/pages/table-inbox/page.tsx+++ b/packages/cli/assets/templates/pages/table-inbox/page.tsx@@ -1652,8 +1652,8 @@ const COMPOSER_TOOLS: {/*** The compose sheet.*- * **`BottomSheet hasScrim={false}`, which is the only non-modal surface in- * core.** With the scrim off the sheet opens with `show()` rather than+ * **`BottomSheet hasScrim={false}` keeps this bottom-edge composer non-modal.**+ * With the scrim off the sheet opens with `show()` rather than* `showModal()`, so it never enters the top layer, never makes the page inert* and never locks body scroll: the inbox behind it stays live. That matters* more here than anywhere else in this template, because writing a message is@@ -1661,12 +1661,14 @@ const COMPOSER_TOOLS: {* actually said, copy an order number out of a thread. A modal composer* answers that with "close me first".*- * The trade is position, and it is worth naming. A sheet rises from the bottom- * edge, centred: its positioner is `inset-inline: 0` with- * `justify-content: center`, and there is no anchor, side or width prop. So- * this cannot be docked to the inline-end corner the way a `Dialog` can be.- * `Dialog` takes a static `position` and would put the window in that corner —- * but `Dialog` is always modal, so buying the corner costs the live inbox.+ * The trade is bottom-edge geometry, and it is worth naming. A non-modal+ * `Drawer` keeps page context live from an inline edge, but it is a full-height+ * side panel; this composer intentionally rises from the bottom. A sheet's+ * positioner is `inset-inline: 0` with `justify-content: center`, and there is+ * no anchor, side or width prop. So this cannot be docked to the inline-end+ * corner the way a `Dialog` can be. `Dialog` takes a static `position` and would+ * put the window in that corner — but `Dialog` is always modal, so buying the+ * corner costs the live inbox.* `ChatComposerDrawer` is a false friend: despite the name it is an in-flow* disclosure tray for a ChatComposer's attachments, with no positioning of its* own.diff --git a/packages/cli/authoring/doctypes/base/type.ts b/packages/cli/authoring/doctypes/base/type.tsindex d4de617954..d215962555 100644--- a/packages/cli/authoring/doctypes/base/type.ts+++ b/packages/cli/authoring/doctypes/base/type.ts@@ -383,6 +383,12 @@ export interface ComponentPropDoc {* ```*/slotElements?: ComponentSlotElement[];+ /** Lifecycle marker for a prop outside the stable compatibility promise+ * (spec:AST-017 FR21). Set `'experimental'` on a stable component's+ * optional `experimental` prop object, and say in `description` that its+ * contents may change or be removed in a patch release. Omit for stable+ * props. */+ stability?: 'experimental';}/**diff --git a/packages/cli/authoring/doctypes/component/component.doc.mjs b/packages/cli/authoring/doctypes/component/component.doc.mjsindex efbe9f57a4..5e37b5e1a2 100644--- a/packages/cli/authoring/doctypes/component/component.doc.mjs+++ b/packages/cli/authoring/doctypes/component/component.doc.mjs@@ -56,7 +56,7 @@ export const doc = {name: 'replaces',type: 'string',description:- "Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, component lists, search, `swizzle <Name>`, and issue routing; `swizzle --list` keeps listing Core names. The Core original stays reachable with `--package @astryxdesign/core`. It takes effect only when the package's peer range starts at the release that applies it, `\"@astryxdesign/cli\": \">=0.6.7\"` or later; without such a range the component keeps its own name and `doctor integration components` warns. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.",+ 'Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, component lists, search, `swizzle <Name>`, and issue routing; `swizzle --list` keeps listing Core names. The Core original stays reachable with `--package @astryxdesign/core`. It takes effect only when the package\'s peer range starts at the release that applies it, `"@astryxdesign/cli": ">=0.6.7"` or later; without such a range the component keeps its own name and `doctor integration components` warns. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.',},{name: 'keywords',@@ -181,7 +181,7 @@ export const doc = {name: 'props',type: 'ComponentPropDoc[]',description:- 'SingleComponentDoc variant (required there): all public props for the one primary component. Each prop is {name, type, description, default?, required?, slotElements?}. Skip styling props like xstyle/className/style. Also present on SubComponentDoc.',+ 'SingleComponentDoc variant (required there): all public props for the one primary component. Each prop is {name, type, description, default?, required?, slotElements?, stability?}. Skip styling props like xstyle/className/style. Also present on SubComponentDoc.',},{name: 'components',diff --git a/packages/cli/clients/cli/lib/component-format.mjs b/packages/cli/clients/cli/lib/component-format.mjsindex e4d5baf3a5..9228ea7d4b 100644--- a/packages/cli/clients/cli/lib/component-format.mjs+++ b/packages/cli/clients/cli/lib/component-format.mjs@@ -68,8 +68,12 @@ function formatPropsTable(props) {for (const p of props) {const def = p.default ? `\`${mdCell(p.default)}\`` : '-';const req = p.required ? ' **(required)**' : '';+ // The text projection of the prop doc's `stability` field: an+ // experimental prop is outside the stable compatibility promise.+ const stability =+ p.stability === 'experimental' ? ' **(experimental)**' : '';lines.push(- `| \`${mdCell(p.name)}\` | \`${mdCell(p.type)}\` | ${def} | ${mdCell(p.description)}${req} |`,+ `| \`${mdCell(p.name)}\` | \`${mdCell(p.type)}\` | ${def} | ${mdCell(p.description)}${req}${stability} |`,);}return lines.join('\n');diff --git a/packages/cli/test/doc-routes.ids.json b/packages/cli/test/doc-routes.ids.jsonindex 4a82e0495c..ff67d45c9d 100644--- a/packages/cli/test/doc-routes.ids.json+++ b/packages/cli/test/doc-routes.ids.json@@ -62,6 +62,8 @@"Dialog","DialogHeader","Divider",+ "Drawer",+ "DrawerHeader","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuDivider",@@ -540,6 +542,14 @@"DividerShowcase","DividerVariants","DividerVertical",+ "DrawerForm",+ "DrawerHeaderShowcase",+ "DrawerHeaderSubtitleEndContent",+ "DrawerHeaderWithCloseButton",+ "DrawerScrim",+ "DrawerShowcase",+ "DrawerStart",+ "DrawerWidths","DropdownMenuActions","DropdownMenuBottomSheet","DropdownMenuGroupShowcase",@@ -969,27 +979,13 @@"VStackBasic","VStackShowcase"],- "@astryxdesign/theme-butter/theme": [- "butter"- ],- "@astryxdesign/theme-chocolate/theme": [- "chocolate"- ],- "@astryxdesign/theme-gothic/theme": [- "gothic"- ],- "@astryxdesign/theme-matcha/theme": [- "matcha"- ],- "@astryxdesign/theme-neutral/theme": [- "neutral"- ],- "@astryxdesign/theme-stone/theme": [- "stone"- ],- "@astryxdesign/theme-y2k/theme": [- "y2k"- ],+ "@astryxdesign/theme-butter/theme": ["butter"],+ "@astryxdesign/theme-chocolate/theme": ["chocolate"],+ "@astryxdesign/theme-gothic/theme": ["gothic"],+ "@astryxdesign/theme-matcha/theme": ["matcha"],+ "@astryxdesign/theme-neutral/theme": ["neutral"],+ "@astryxdesign/theme-stone/theme": ["stone"],+ "@astryxdesign/theme-y2k/theme": ["y2k"],"@astryxdesign/cli/command": ["blog","build",@@ -1090,8 +1086,5 @@"template-doc","theme-doc"],- "@astryxdesign/cli/enum": [- "error-codes",- "response-types"- ]+ "@astryxdesign/cli/enum": ["error-codes", "response-types"]}diff --git a/packages/cli/test/doc-routes.json b/packages/cli/test/doc-routes.jsonindex 19433f0bcf..7b7b1c4d81 100644--- a/packages/cli/test/doc-routes.json+++ b/packages/cli/test/doc-routes.json@@ -4358,7 +4358,7 @@"kind": "component","id": "@astryxdesign/core/component","provider": "@astryxdesign/core",- "count": 177,+ "count": 179,"oldCliRoute": "astryx component <id>","oldDocsiteUrl": "/components/<id>","docsiteExceptions": {@@ -4425,7 +4425,7 @@"kind": "block","id": "@astryxdesign/core/block","provider": "@astryxdesign/core",- "count": 661,+ "count": 669,"oldCliRoute": "astryx template <id> --type block","oldDocsiteUrl": null,"placement": "generated:@astryxdesign/core/block",diff --git a/packages/core/package.json b/packages/core/package.jsonindex bbdbddcf49..f26c89ea89 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -329,6 +329,11 @@"types": "./dist/Divider/index.d.ts","default": "./dist/Divider/index.js"},+ "./Drawer": {+ "source": "./src/Drawer/index.ts",+ "types": "./dist/Drawer/index.d.ts",+ "default": "./dist/Drawer/index.js"+ },"./DropdownMenu": {"source": "./src/DropdownMenu/index.ts","types": "./dist/DropdownMenu/index.d.ts",diff --git a/packages/lab/src/Drawer/Drawer.doc.mjs b/packages/core/src/Drawer/Drawer.doc.mjssimilarity index 89%rename from packages/lab/src/Drawer/Drawer.doc.mjsrename to packages/core/src/Drawer/Drawer.doc.mjsindex ee69a8ad4b..757079e805 100644--- a/packages/lab/src/Drawer/Drawer.doc.mjs+++ b/packages/core/src/Drawer/Drawer.doc.mjs@@ -4,7 +4,7 @@* @file Drawer.doc.mjs* @input Drawer props, panel anatomy, DrawerHeader composition, overlay playground config, and story-aligned examples* @output Consumer documentation and examples for Drawer- * @position CLI and docsite metadata; runnable docsite demos live in packages/lab/blocks+ * @position CLI and docsite metadata; runnable docsite demos live in packages/cli/assets/templates/blocks/components/Drawer*//** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */@@ -40,6 +40,8 @@ const anatomy = [export const docs = {name: 'Drawer',displayName: 'Drawer',+ // Keeps the registry route Drawer had as a canary-only Lab component.+ registry: {aliases: ['lab/drawer']},group: 'Drawer',category: 'Overlay',keywords: [@@ -139,11 +141,11 @@ export const docs = {default: '400',},{- name: 'isFullWidthOnMobile',- type: 'boolean',+ name: 'experimental',+ type: '{isFullWidthOnMobile?: boolean}',+ stability: 'experimental',description:- 'Cover the full viewport width below the 640px mobile breakpoint instead of preserving the default 56px reveal of the page behind. The reveal makes the drawer read as an overlay, not a navigation.',- default: 'false',+ 'Experimental options: anything in this object may change or be removed in a patch release, and omitting it keeps the stable behavior. isFullWidthOnMobile (default false) covers the full viewport width below the 640px mobile breakpoint instead of preserving the default 56px reveal of the page behind, which makes the drawer read as an overlay, not a navigation.',},{name: 'hasScrim',@@ -248,6 +250,55 @@ export const docs = {// Modal by default: the scrim dims the page and focus is trapped. Escape, a// scrim click, or the header's close button closes it, and focus returns to// the trigger.`,+ },+ {+ label: 'Modal or non-modal (hasScrim)',+ code: `const [openModal, setOpenModal] = useState(false);+const [openPanel, setOpenPanel] = useState(false);+<>+ {/* Modal (default): the scrim dims the page, focus is trapped, and a+ scrim click closes. */}+ <Drawer isOpen={openModal} onOpenChange={setOpenModal} label="Edit details">+ <EditForm />+ </Drawer>+ {/* Non-modal: no scrim, no focus trap; the page behind stays interactive.+ With no scrim to click, the header's close button is the visible exit. */}+ <Drawer+ isOpen={openPanel}+ onOpenChange={setOpenPanel}+ label="Details"+ hasScrim={false}>+ <Layout+ header={<DrawerHeader title="Details" onOpenChange={setOpenPanel} />}+ content={<LayoutContent><DetailsPanel /></LayoutContent>}+ />+ </Drawer>+</>`,+ },+ {+ label: 'Edit form with footer actions',+ code: `const [isOpen, setIsOpen] = useState(false);+<Drawer+ isOpen={isOpen}+ onOpenChange={setIsOpen}+ label="Edit host"+ purpose="form">+ <Layout+ header={<DrawerHeader title="Edit host" onOpenChange={setIsOpen} />}+ content={<LayoutContent><HostFields /></LayoutContent>}+ footer={+ <LayoutFooter>+ <HStack gap={2} hAlign="end">+ <Button label="Cancel" variant="secondary" onClick={() => setIsOpen(false)} />+ <Button label="Save" variant="primary" onClick={save} />+ </HStack>+ </LayoutFooter>+ }+ />+</Drawer>+// purpose="form" keeps Escape but ignores scrim clicks, so a stray click+// outside does not discard edits. The footer stays pinned while the fields+// scroll.`,},{label: 'Slide in from the start edge',@@ -275,55 +326,6 @@ export const docs = {// A number is pixels (width={320}); a string is any CSS length ('32rem',// '50%'). The budget also caps the drawer on mobile.`,},- {- label: 'Mobile: the 56px page reveal (default)',- code: `const [isOpen, setIsOpen] = useState(false);-<Drawer- isOpen={isOpen}- onOpenChange={setIsOpen}- label="Filters"- width={360}>- <FilterControls />-</Drawer>-// Below 640px the panel preserves a 56px reveal of the page behind (still-// capped by width), so the drawer reads as an overlay, not a navigation.`,- },- {- label: 'Wide desktop panel, full-width on mobile',- code: `const [isOpen, setIsOpen] = useState(false);-<Drawer- isOpen={isOpen}- onOpenChange={setIsOpen}- label="Filters"- width={560}- isFullWidthOnMobile>- <FilterControls />-</Drawer>`,- },- {- label: 'Modal or non-modal (hasScrim)',- code: `const [openModal, setOpenModal] = useState(false);-const [openPanel, setOpenPanel] = useState(false);-<>- {/* Modal (default): the scrim dims the page, focus is trapped, and a- scrim click closes. */}- <Drawer isOpen={openModal} onOpenChange={setOpenModal} label="Edit details">- <EditForm />- </Drawer>- {/* Non-modal: no scrim, no focus trap; the page behind stays interactive.- With no scrim to click, the header's close button is the visible exit. */}- <Drawer- isOpen={openPanel}- onOpenChange={setOpenPanel}- label="Details"- hasScrim={false}>- <Layout- header={<DrawerHeader title="Details" onOpenChange={setOpenPanel} />}- content={<LayoutContent><DetailsPanel /></LayoutContent>}- />- </Drawer>-</>`,- },],};@@ -419,7 +421,7 @@ export const docsDense = {usage: {anatomy,description:- "Overlay side panel for inspectors and detail views; floats over content, never reflows it. width = desktop budget; 56px page reveal below 640px, capped by width (isFullWidthOnMobile for all of it). Escape closes topmost (not when purpose=required); focus restores to the opener. Siblings stack last-opened on top; never nest. Slide animation respects prefers-reduced-motion. Dialog-like container: content area inset = --spacing-4 (16px) by default, or the padding prop / a theme's drawer padding (padding={0} = full bleed). Compose like Dialog: Layout with DrawerHeader in the header slot (close button only when given onOpenChange), LayoutContent, LayoutFooter; Layout redistributes the inset so regions line up and the header is not inset twice; a lone Section escapes the inset. No built-in close button, so every drawer needs a visible exit; data-autofocus picks the focus target. purpose matches Dialog: info = Escape + scrim click, form = Escape only, required = neither (modal → alertdialog). Choose: Dialog for centered decisions/short forms, Drawer for full-height side detail, BottomSheet for block-axis sheets, docked layout column to reflow instead of float. Theming: single target astryx-drawer (data-side); scrim is its ::backdrop; DrawerHeader has astryx-drawer-header targets.",+ "Overlay side panel for inspectors and detail views; floats over content, never reflows it. width = desktop budget; 56px page reveal below 640px, capped by width. Escape closes topmost (not when purpose=required); focus restores to the opener. Siblings stack last-opened on top; never nest. Slide animation respects prefers-reduced-motion. Dialog-like container: content area inset = --spacing-4 (16px) by default, or the padding prop / a theme's drawer padding (padding={0} = full bleed). Compose like Dialog: Layout with DrawerHeader in the header slot (close button only when given onOpenChange), LayoutContent, LayoutFooter; Layout redistributes the inset so regions line up and the header is not inset twice; a lone Section escapes the inset. No built-in close button, so every drawer needs a visible exit; data-autofocus picks the focus target. purpose matches Dialog: info = Escape + scrim click, form = Escape only, required = neither (modal → alertdialog). Choose: Dialog for centered decisions/short forms, Drawer for full-height side detail, BottomSheet for block-axis sheets, docked layout column to reflow instead of float. Theming: single target astryx-drawer (data-side); scrim is its ::backdrop; DrawerHeader has astryx-drawer-header targets.",bestPractices: [{guidance: true,diff --git a/packages/lab/src/Drawer/Drawer.spec.md b/packages/core/src/Drawer/Drawer.spec.mdsimilarity index 84%rename from packages/lab/src/Drawer/Drawer.spec.mdrename to packages/core/src/Drawer/Drawer.spec.mdindex 0a352547d0..bacc47fdb7 100644--- a/packages/lab/src/Drawer/Drawer.spec.md+++ b/packages/core/src/Drawer/Drawer.spec.md@@ -12,8 +12,8 @@ owners: [cixzhang, imdreamrunner]review_triggers: [public-api, behavior, layout, theming, accessibility]verified_by:[- packages/lab/src/Drawer/Drawer.test.tsx,- packages/lab/src/Drawer/DrawerHeader.test.tsx,+ packages/core/src/Drawer/Drawer.test.tsx,+ packages/core/src/Drawer/DrawerHeader.test.tsx,packages/core/src/Layer/useLayerDismissal.test.tsx,packages/core/src/Layer/layerDismissalFamilies.test.tsx,.github/scripts/modal-close-visibility.js,@@ -41,12 +41,12 @@ system_specs: [spec:AST-027/DEC-3]| Area | Contract || ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| Current Lab surface | Public-API change aligning Drawer with Dialog (DEC-1). At this commit, the experimental `@astryxdesign/lab` root exports `Drawer`, `DrawerProps`, `DrawerHeader`, and `DrawerHeaderProps`. `DrawerProps` extends `BaseProps<HTMLDialogElement>`, separately declares `ref`, requires `isOpen`, `onOpenChange`, `label`, and `children`, accepts `purpose` (`required`, `form`, or `info`; default `info`), accepts an optional `padding` spacing step (FR16), and no longer accepts `hasCloseButton`. This records current reachability, not a stable compatibility promise. |+| Current Core surface | `@astryxdesign/core` exports `Drawer`, `DrawerProps`, `DrawerHeader`, and `DrawerHeaderProps` from the package root and the `./Drawer` subpath (DEC-3); `@astryxdesign/lab` does not export them. `DrawerProps` extends `BaseProps<HTMLDialogElement>`, separately declares `ref`, requires `isOpen`, `onOpenChange`, `label`, and `children`, accepts `purpose` (`required`, `form`, or `info`; default `info`), an optional `padding` spacing step (FR16), and an optional `experimental` object (DEC-4), and has no `hasCloseButton`. Stable API admission and compatibility belong to `architecture:public-component-api`. || Behavior | Drawer-owned visibility is controlled by the caller for a viewport-relative, full-height logical-side overlay. `hasScrim` at native open selects `showModal()` or a manual Popover API host; changing it while open is unsupported. The shared layer dismissal stack gates Escape and platform close for the full rendered lifetime, and `purpose` decides, as in Dialog, whether Escape, platform close, and scrim click request close. Drawer renders no close control of its own; `DrawerHeader` renders one only when given `onOpenChange`. The browser top layer owns paint order in both presentations, exit renders current children, and completed close returns focus to the element focused at open. |-| End-user impact | Drawers no longer paint a floating top-trailing close button; a close button appears in a `DrawerHeader` title row where the caller composes one. `form` drawers ignore scrim clicks, and `required` drawers ignore Escape, platform close, and scrim clicks; a modal `required` drawer is announced as an alert dialog. Layer behavior (shared topmost/IME Escape, top-layer paint order, one dismissal per request, focus return) is unchanged. |-| Builder impact | Remove `hasCloseButton`. For a visible close action, compose `<DrawerHeader title onOpenChange>` in a `Layout` header slot, as `DialogHeader` is composed in Dialog; set `padding={0}` for a full-bleed drawer, since the default inset is now `--spacing-4`; callers that passed `hasCloseButton={false}` need no change beyond removing the prop. Set `purpose` where Dialog would. State and content remain caller-owned; Drawer renders the caller's current children during exit. Sibling composition remains current consumer guidance, and a consumer `onKeyDown` that prevents default still cancels Escape dismissal. |-| Compatibility/readiness | Breaking Lab API change: removes `hasCloseButton` and the built-in close button, adds `purpose` and `DrawerHeader`. Drawer remains experimental in Lab, this record remains `draft`, and its candidate statements require approval. FR13–FR14 record shared-family and top-layer conformance; FR7 and FR15 record the Dialog alignment. |-| Review checks | Reject regional, docked, or block-axis models; claims that modality and scrim are currently independent; reintroduction of a Drawer-local Escape registry, a page-level z-index band, or a Drawer-owned close button; a dismissal policy that diverges from Dialog's `purpose`; claims that mixed-presentation or nested stacking is guaranteed beyond the shared stack's contract; or claims of stable API/theming compatibility. |+| End-user impact | A drawer paints no close control of its own; a close button appears in a `DrawerHeader` title row where the caller composes one. `form` drawers ignore scrim clicks, and `required` drawers ignore Escape, platform close, and scrim clicks; a modal `required` drawer is announced as an alert dialog. Shared topmost/IME Escape routing, top-layer paint order, one dismissal per request, and focus return apply in both presentations. |+| Builder impact | Import from `@astryxdesign/core/Drawer` or the Core root. For a visible close action, compose `<DrawerHeader title onOpenChange>` in a `Layout` header slot, as `DialogHeader` is composed in Dialog. The Content area is inset by `--spacing-4` by default; `padding={0}` gives a full-bleed Content area. Set `purpose` where Dialog would. State and content remain caller-owned; Drawer renders the caller's current children during exit. Sibling composition is current consumer guidance, and a consumer `onKeyDown` that prevents default cancels Escape dismissal. |+| Compatibility/readiness | Drawer is a Core component imported from `@astryxdesign/core/Drawer` (DEC-3). This record remains `draft`, and its candidate statements require approval. FR13–FR14 record shared-family and top-layer conformance; FR7 and FR15 record the Dialog alignment; FR16 records container padding. |+| Review checks | Reject regional, docked, or block-axis models; claims that modality and scrim are currently independent; reintroduction of a Drawer-local Escape registry, a page-level z-index band, or a Drawer-owned close button; a dismissal policy that diverges from Dialog's `purpose`; claims that mixed-presentation or nested stacking is guaranteed beyond the shared stack's contract; a surviving `@astryxdesign/lab` export; or claims of stable API/theming compatibility that `architecture:public-component-api` has not admitted. || Record context | `component:Drawer` FR1–FR16 and AR1–AR6 are draft candidate statements. Linked records govern only within their own declared authority and scope. |This table summarizes the draft body below; it does not change this record's declared authority.@@ -58,30 +58,31 @@ floats over the current page without reflowing it. It supports modal inspectionwith a scrim and non-modal master-detail inspection that leaves the page behindavailable.-This draft records the viewport-only Lab component after its layer-lifecycle-hardening and its alignment with Dialog's close control and dismissal policy-(DEC-1). It introduces no scope concept. In particular, it does not revive a-regional, pane-scoped, or container-targeted Drawer model.+This draft records the viewport-only Core component: its shared layer+lifecycle, its Dialog-aligned close control and dismissal policy (DEC-1), and its+container padding (DEC-2). It introduces no scope concept. In particular, it+does not revive a regional, pane-scoped, or container-targeted Drawer model.## Compatibility and migration-- Released default preserved: `not yet released`; Drawer remains in- `@astryxdesign/lab`.-- Compatibility class: breaking change inside Lab. `hasCloseButton` and the- built-in close button are removed; `purpose` and `DrawerHeader` are added. Root- element, styling inputs, and controlled ownership remain unchanged.-- Container padding (FR16, DEC-2): a new `padding` prop, and a theme's- `padding` on `drawer` insets the Content area through container tokens. With- neither set the inset is `--spacing-4`, as in Dialog, so a drawer without an- explicit `padding` is now padded; `padding={0}` keeps a full-bleed Content- area. The block-end safe-area inset is kept in every mode.+- Released default preserved: `not yet released` in Core.+- Compatibility class: additive in Core (root and `./Drawer` subpath exports);+ `@astryxdesign/lab`, which publishes only canary builds, does not export+ Drawer.+- Container padding (FR16, DEC-2): the `padding` prop or a theme's `padding` on+ `drawer` insets the Content area through container tokens. With neither set+ the inset is `--spacing-4`, as in Dialog; `padding={0}` keeps a full-bleed+ Content area. The block-end safe-area inset applies in every mode.+- Experimental surface (DEC-4): full-viewport mobile coverage is the+ `isFullWidthOnMobile` option inside the optional `experimental` prop object,+ outside the stable compatibility promise (`spec:AST-017/FR21`). Omitting+ `experimental` keeps the 56px page reveal.- Controlled/uncontrolled behavior: unchanged for Drawer-owned paths; callersprovide `isOpen`, while direct native mutation through the public dialog ref isoutside that guarantee.-- Migration decision: Drawer is unreleased Lab, so no codemod. Callers remove- `hasCloseButton`, compose `DrawerHeader` with `onOpenChange` in a `Layout`- header slot where they relied on the built-in button, and pass `padding={0}`- where they need a full-bleed Content area.+- Migration decision: no codemod, because `@astryxdesign/lab` publishes only+ canary builds. Canary callers import Drawer and DrawerHeader from+ `@astryxdesign/core/Drawer` instead of `@astryxdesign/lab`.Consumer migration instructions belong in consumer docs and release notes.@@ -122,17 +123,17 @@ Consumer migration instructions belong in consumer docs and release notes.Consumer prop syntax and examples remain in `Drawer.doc.mjs`.-| Concept | Closed values or states | Meaning | Availability by state | Default | Owner | Stability | Invalid-value behavior |-| ------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------- | ------------------ | ----------------------------------------------------- | ----------------------------------------------------- |-| visibility | open, closed | whether caller-controlled Drawer presentation is requested | all presentations | caller-controlled | `component:Drawer` | experimental Lab contract | required controlled value |-| logical edge | inline start, inline end | viewport edge from which the panel enters and exits | open and exiting | inline end | `component:Drawer` | experimental Lab contract | closed type rejects other values |-| presentation | modal with scrim, non-modal without scrim | native host mode and associated document semantics | chosen when the native host opens; live changes are unsupported | modal with scrim | `component:Drawer` | experimental Lab contract | one current boolean selects the initial mode |-| inline-size budget | pixel number or valid CSS length | desktop inline size and reveal-mode mobile cap | desktop and mobile page-reveal mode | `400px` | `component:Drawer` | experimental Lab contract | invalid CSS lengths are unsupported |-| mobile coverage | page reveal, full viewport | whether narrow viewports retain a visible page strip | viewports at or below the mobile boundary | 56px page reveal | `component:Drawer` | experimental Lab contract | closed boolean |-| dismissal purpose | info, form, required | which implicit requests close: `info` allows Escape, platform close, and scrim click; `form` allows Escape and platform close; `required` allows none | all presentations; scrim click applies to modal only | info | `component:Drawer` | experimental Lab contract matching `component:Dialog` | closed type rejects other values |-| header close action | rendered, absent | whether `DrawerHeader` renders its close button | wherever `DrawerHeader` is composed | absent unless `onOpenChange` is passed | `component:Drawer` | experimental Lab contract | an omitted callback renders no button |-| content inset | spacing step, theme `drawer` padding, or the default | container padding of the scrolling Content area, published to descendants per `architecture:container-padding` | all presentations | `--spacing-4`, as in Dialog | `component:Drawer` | experimental Lab contract matching `component:Dialog` | closed numeric type rejects other values |-| sibling order | earlier opened, later opened, exiting, closed | shared-stack Escape eligibility and browser top-layer paint order | sibling Drawers in either presentation | later opened is topmost | `component:Drawer` | experimental Lab contract | nested composition is outside the documented contract |+| Concept | Closed values or states | Meaning | Availability by state | Default | Owner | Stability | Invalid-value behavior |+| ------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------- | ------------------ | ----------------------------------------------- | ----------------------------------------------------- |+| visibility | open, closed | whether caller-controlled Drawer presentation is requested | all presentations | caller-controlled | `component:Drawer` | draft Core contract | required controlled value |+| logical edge | inline start, inline end | viewport edge from which the panel enters and exits | open and exiting | inline end | `component:Drawer` | draft Core contract | closed type rejects other values |+| presentation | modal with scrim, non-modal without scrim | native host mode and associated document semantics | chosen when the native host opens; live changes are unsupported | modal with scrim | `component:Drawer` | draft Core contract | one current boolean selects the initial mode |+| inline-size budget | pixel number or valid CSS length | desktop inline size and reveal-mode mobile cap | desktop and mobile page-reveal mode | `400px` | `component:Drawer` | draft Core contract | invalid CSS lengths are unsupported |+| mobile coverage | page reveal, full viewport | whether narrow viewports retain a visible page strip | viewports at or below the mobile boundary | 56px page reveal | `component:Drawer` | experimental (DEC-4) | closed boolean |+| dismissal purpose | info, form, required | which implicit requests close: `info` allows Escape, platform close, and scrim click; `form` allows Escape and platform close; `required` allows none | all presentations; scrim click applies to modal only | info | `component:Drawer` | draft Core contract matching `component:Dialog` | closed type rejects other values |+| header close action | rendered, absent | whether `DrawerHeader` renders its close button | wherever `DrawerHeader` is composed | absent unless `onOpenChange` is passed | `component:Drawer` | draft Core contract | an omitted callback renders no button |+| content inset | spacing step, theme `drawer` padding, or the default | container padding of the scrolling Content area, published to descendants per `architecture:container-padding` | all presentations | `--spacing-4`, as in Dialog | `component:Drawer` | draft Core contract matching `component:Dialog` | closed numeric type rejects other values |+| sibling order | earlier opened, later opened, exiting, closed | shared-stack Escape eligibility and browser top-layer paint order | sibling Drawers in either presentation | later opened is topmost | `component:Drawer` | draft Core contract | nested composition is outside the documented contract |## Behavioral and layout contract@@ -148,7 +149,7 @@ Consumer prop syntax and examples remain in `Drawer.doc.mjs`.| FR8 | Opening MUST present the native host, capture the element focused before opening, and attempt to focus the first rendered `[data-autofocus]` descendant, if any. After a completed controlled close releases the native host, Drawer MUST attempt to restore focus to the captured element. The non-modal host's synthetic `close` event MUST dispatch after that restore attempt — matching the task-queued native `dialog.close()` event — so a consumer close listener keeps the last word on final focus. | Current presence hook and focus tests | Verified for completed controlled close || FR9 | Closing MUST retain the panel host, content region, edge, and native presentation while the exit remains visible and continue rendering the caller's current `children`. The transform transition is authoritative, a computed-duration backstop prevents a lost event from stranding the host, and native release and React hiding land together so no frame paints outside the top layer. | Current lifecycle tests and browser close-visibility guard | Observable outcome verified || FR10 | Sibling Drawers MUST be composed as siblings. The last-opened present sibling owns the first Escape request through the shared stack; a closing sibling retains that ownership through its visible exit, and reopening registers a new active cycle so one request never closes two surfaces. Paint order in both presentations follows the browser top layer's chronological order. | Current docs, shared stack, and tests | Verified current behavior |-| FR11 | At this commit, `DrawerProps` extends `BaseProps<HTMLDialogElement>` and separately declares `ref`. The root filters `open`, merges `xstyle`, `className`, and `style`, forwards remaining unclaimed props, composes consumer `onClick`, forwards consumer `onKeyDown` ahead of the shared document-level Escape owner, and owns `aria-label`, `aria-modal`, `onCancel`, and, for a modal `required` drawer, `role="alertdialog"`. A consumer `onKeyDown` that prevents default cancels shared-stack Escape dismissal for the press. | Current source and focused keyboard tests | Recorded current Lab behavior; not a stable compatibility decision |+| FR11 | At this commit, `DrawerProps` extends `BaseProps<HTMLDialogElement>` and separately declares `ref`. The root filters `open`, merges `xstyle`, `className`, and `style`, forwards remaining unclaimed props, composes consumer `onClick`, forwards consumer `onKeyDown` ahead of the shared document-level Escape owner, and owns `aria-label`, `aria-modal`, `onCancel`, and, for a modal `required` drawer, `role="alertdialog"`. A consumer `onKeyDown` that prevents default cancels shared-stack Escape dismissal for the press. | Current source and focused keyboard tests | Recorded current behavior; not a stable compatibility decision || FR12 | At this commit, the painted root dialog emits the documented `drawer` target and `side` selector axis and applies the container-padding reset. `DrawerHeader` emits `drawer-header`, `drawer-header-start-content`, `drawer-header-title-block`, `drawer-header-end-content`, and `drawer-header-close-icon`, mirroring `DialogHeader`. No separate Drawer target is currently emitted for content or scrim; future target qualification remains owned by `architecture:component-theming-surface`. | Current source, docs, and structural target metadata | Current reachability only; no target-admission decision || FR13 | Drawer MUST join the shared dismissal stack for its full rendered lifetime, provide logical depth to descendant layers, route platform close through the same topmost/IME decision, and preserve consumer `preventDefault()` ownership. | Shared family contract and focused tests | Verified current conformance || FR14 | Non-modal Drawer MUST use a manual Popover API host so cross-surface order comes from the browser top layer rather than a page-level z-index band. The reduced fallback may use `dialog.show()` only below the Popover API support floor. | Current source, browser guard, and `spec:AST-027` | Verified current conformance |@@ -214,9 +215,9 @@ Consumer prop syntax and examples remain in `Drawer.doc.mjs`.- **PR2 — Presentation cleanup.** Native presentation and any active body scrolllock exist only for their active states and are released on controlled close,unmount, or hidden Activity cleanup.-- **PR3 — Viewport-relative sizing.** Drawer derives sizing from `width`,- `isFullWidthOnMobile`, and the viewport; callers do not supply a regional- measurement target.+- **PR3 — Viewport-relative sizing.** Drawer derives sizing from `width`, the+ experimental `experimental.isFullWidthOnMobile` option (DEC-4), and the+ viewport; callers do not supply a regional measurement target.## Accessibility contract@@ -266,9 +267,12 @@ decide future target qualification.lifetime and supplies logical depth to descendant layers.- `architecture:layer-runtime` owns the distinction between native modal hosting,non-modal dialog presentation, top-layer behavior, and shared layer plumbing.+ Drawer's content root applies the shared private text baseline and layer+ content boundary, as in Dialog: surface-scoped ancestor membership stops at+ the drawer, while ordinary application contexts keep flowing to its content.- `architecture:public-component-api` owns stable API admission and compatibility.- Drawer remains experimental in Lab; FR11 records current DOM/ref/event- reachability without making a stable compatibility decision.+ FR11 records current DOM/ref/event reachability without making a stable+ compatibility decision.- `architecture:react-component-runtime` owns effect/resource cleanup, native-hostsynchronization, and node/lifecycle safety. This draft records Drawer-ownedvisible close and focus-handoff outcomes.@@ -299,28 +303,37 @@ decide future target qualification.## Decision log-- **DEC-1 — Align the close control and dismissal policy with Dialog** (owner- decision, 2026-10-01). Drawer drops its built-in close button and- `hasCloseButton`, adopts Dialog's `purpose` values and default, and adds- `DrawerHeader` with `DialogHeader`'s API, so a close action lives in the header- only when `onOpenChange` is passed. A Drawer-owned header, rather than reusing- `DialogHeader`, keeps Drawer's focus entry (`data-autofocus` after native- presentation) and `label` naming and avoids `dialog-header` theme targets.- Rejected: keeping the built-in button and hiding it only for `required`;- reusing `DialogHeader`; removing the button with no header.+- **DEC-1 — The close control and dismissal policy match Dialog** (owner+ decision, 2026-10-01). Drawer renders no built-in close button and has no+ `hasCloseButton`; it takes Dialog's `purpose` values and default; and+ `DrawerHeader` has `DialogHeader`'s API, rendering a close action only when+ `onOpenChange` is passed. A Drawer-owned header, rather than `DialogHeader`,+ keeps Drawer's focus entry (`data-autofocus` after native presentation) and+ `label` naming and avoids `dialog-header` theme targets. Rejected: a built-in+ button hidden only for `required`; reusing `DialogHeader`.- **DEC-2 — Drawer is a container, like Dialog** (owner decision,- 2026-10-08). The scrolling Content area becomes a container publisher with+ 2026-10-08). The scrolling Content area is a container publisher withDialog's contract: a `padding` prop on Dialog's spacing-step scale, theme`padding` on `drawer` expanded to `--astryx-drawer-padding*` container- tokens, and a `--spacing-4` default that the edge and Layout inset chains- share, exactly as in Dialog. Headers compose as in Dialog: `DrawerHeader`- sits in a `Layout` header slot, and the Layout redistributes the inset to its- regions, so the header is not inset twice. The block-end edge adds the- home-indicator safe area on top of the inset in every mode. Rejected- candidates: padding the panel root (the panel is the overlay boundary, and- padding there bleeds under the anchored-side border); keeping the released- full-bleed default, as BottomSheet does (diverges from Dialog).+ tokens, and a `--spacing-4` default shared by the edge and Layout inset+ chains. `DrawerHeader` sits in a `Layout` header slot, and the Layout+ redistributes the inset to its regions, so the header is not inset twice. The+ block-end edge adds the home-indicator safe area on top of the inset in every+ mode. Rejected: padding the panel root (the overlay boundary); a full-bleed+ default (diverges from Dialog).++- **DEC-3 — Drawer is a Core component** (owner decision, 2026-10-08).+ `Drawer`, `DrawerHeader`, and their prop types ship from+ `@astryxdesign/core/Drawer` and the Core root, and their docsite demos are+ Core blocks. `@astryxdesign/lab` does not export them.++- **DEC-4 — Full-viewport mobile coverage is experimental** (owner decision,+ 2026-10-15). `isFullWidthOnMobile` lives inside the optional `experimental`+ prop object, marked `@experimental` in declarations and+ `stability: 'experimental'` in authored docs, so it may change or be removed in+ a patch release (`spec:AST-017/FR21`). Omitting `experimental` keeps the 56px+ page reveal. Rejected: a top-level stable `isFullWidthOnMobile` prop.## Open questions@@ -333,8 +346,7 @@ decide future target qualification.Regional placement, independent modality/scrim axes, and block-axis sheetsare outside the current component boundary. Any future proposal for them requires-fresh public-API and design authority rather than being inferred from this-current-state backfill.+fresh public-API and design authority.## Content boundarydiff --git a/packages/lab/src/Drawer/Drawer.test.tsx b/packages/core/src/Drawer/Drawer.test.tsxsimilarity index 77%rename from packages/lab/src/Drawer/Drawer.test.tsxrename to packages/core/src/Drawer/Drawer.test.tsxindex e3350f1678..6b489b7a8b 100644--- a/packages/lab/src/Drawer/Drawer.test.tsx+++ b/packages/core/src/Drawer/Drawer.test.tsx@@ -4,16 +4,21 @@* @file Drawer.test.tsx* @input Uses vitest, @testing-library/react, Drawer component* @output Unit tests for Drawer component behavior- * @position Lab testing; validates Drawer.tsx implementation+ * @position Core testing; validates Drawer.tsx implementation** SYNC: When Drawer.tsx changes, update tests to match new behavior*/import {describe, it, expect, vi, beforeEach, afterEach} from 'vitest';import {render, screen, fireEvent, act} from '@testing-library/react';-import {useState} from 'react';+import {createContext, createRef, use, useState} from 'react';+import * as stylex from '@stylexjs/stylex';import {Drawer} from './Drawer';import {DrawerHeader} from './DrawerHeader';+import {Button} from '../Button';+import {ButtonGroup} from '../ButtonGroup';+import {layerTextReset} from '../Layer/layerTextReset.stylex';+import {layerStructureReset} from '../Layer/layerStructureReset.stylex';// Mock dialog methods since they're not fully implemented in jsdombeforeEach(() => {@@ -279,6 +284,245 @@ describe('Drawer', () => {fireEvent.keyDown(screen.getByRole('dialog'), {key: 'Escape'});expect(handleOpenChange).not.toHaveBeenCalled();});++ it('hands a consumer onKeyDown the Escape press ahead of the shared stack', () => {+ // The consumer handler sits on the dialog; the stack's one listener sits+ // on the document. The press must reach the consumer first so its+ // preventDefault (above) can still stand the stack down.+ const callOrder: string[] = [];+ render(+ <Drawer+ isOpen+ onOpenChange={() => callOrder.push('dismiss')}+ label="Details"+ onKeyDown={event => callOrder.push(`consumer:${event.key}`)}>+ Content+ </Drawer>,+ );+ fireEvent.keyDown(screen.getByRole('dialog'), {key: 'Escape'});+ expect(callOrder).toEqual(['consumer:Escape', 'dismiss']);+ });+ });++ describe('API surface', () => {+ // FR11: the root filters `open`, merges `xstyle`/`className`/`style`,+ // forwards remaining unclaimed props, reaches the <dialog> through both+ // ref forms, and composes the consumer onClick with scrim dismissal.+ it('does not forward a native open prop to the dialog element', () => {+ render(+ <Drawer+ isOpen={false}+ onOpenChange={() => {}}+ label="Details"+ {...({open: true} as Record<string, unknown>)}>+ Content+ </Drawer>,+ );+ // isOpen controls the native state; a caller-passed `open` must not put+ // the closed dialog into the open state behind the presence hook's back.+ const dialog = screen.getByRole('dialog', {hidden: true});+ expect(dialog).not.toHaveAttribute('open');+ });++ it('merges a consumer className with the theme target and StyleX classes', () => {+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ className="inspector-panel">+ Content+ </Drawer>,+ );+ const dialog = screen.getByRole('dialog');+ const classes = dialog.className.split(' ');+ expect(classes).toContain('astryx-drawer');+ expect(classes).toContain('inspector-panel');+ // Drawer's own StyleX styling survives the merge.+ expect(getComputedStyle(dialog).position).toBe('fixed');+ });++ it('merges a consumer xstyle after Drawer styles so the override wins', () => {+ const overrides = stylex.create({narrow: {maxWidth: '240px'}});+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ xstyle={overrides.narrow}>+ Content+ </Drawer>,+ );+ const dialog = screen.getByRole('dialog');+ expect(getComputedStyle(dialog).maxWidth).toBe('240px');+ expect(getComputedStyle(dialog).position).toBe('fixed');+ expect(dialog.className).toContain('astryx-drawer');+ });++ it('merges a consumer style with Drawer inline styles, consumer last', () => {+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ style={{zIndex: 30}}>+ Content+ </Drawer>,+ );+ const dialog = screen.getByRole('dialog');+ expect(dialog.style.zIndex).toBe('30');+ // The width budget travels as a StyleX dynamic inline variable and must+ // survive the merge rather than be replaced by the consumer style.+ expect(dialog.getAttribute('style')).toContain('400px');+ });++ it('forwards a data attribute and an ARIA attribute to the root dialog', () => {+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ data-tracking-id="inspector"+ aria-describedby="drawer-hint">+ Content+ </Drawer>,+ );+ const dialog = screen.getByRole('dialog');+ expect(dialog).toHaveAttribute('data-tracking-id', 'inspector');+ expect(dialog).toHaveAttribute('aria-describedby', 'drawer-hint');+ });++ it('reaches the dialog element through an object ref', () => {+ const ref = createRef<HTMLDialogElement>();+ render(+ <Drawer isOpen onOpenChange={() => {}} label="Details" ref={ref}>+ Content+ </Drawer>,+ );+ expect(ref.current).toBe(screen.getByRole('dialog'));+ });++ it('reaches the dialog element through a callback ref', () => {+ let current: HTMLDialogElement | null = null;+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ ref={node => {+ current = node;+ }}>+ Content+ </Drawer>,+ );+ expect(current).toBe(screen.getByRole('dialog'));+ });++ it('runs a consumer onClick before scrim dismissal on a backdrop click', () => {+ const callOrder: string[] = [];+ const handleClick = vi.fn(() => callOrder.push('consumer'));+ const handleOpenChange = vi.fn(() => callOrder.push('dismiss'));+ render(+ <Drawer+ isOpen+ onOpenChange={handleOpenChange}+ label="Details"+ onClick={handleClick}>+ Content+ </Drawer>,+ );+ fireEvent.click(screen.getByRole('dialog'));+ expect(handleClick).toHaveBeenCalledTimes(1);+ expect(handleOpenChange).toHaveBeenCalledWith(false);+ expect(callOrder).toEqual(['consumer', 'dismiss']);+ });++ it('lets a consumer onClick preventDefault cancel the scrim dismissal', () => {+ const handleOpenChange = vi.fn();+ render(+ <Drawer+ isOpen+ onOpenChange={handleOpenChange}+ label="Details"+ onClick={event => event.preventDefault()}>+ Content+ </Drawer>,+ );+ fireEvent.click(screen.getByRole('dialog'));+ expect(handleOpenChange).not.toHaveBeenCalled();+ });+ });++ describe('layer content boundary', () => {+ // Drawer's content root uses the private layer content boundary, like+ // Dialog's: surface-scoped ancestor membership stops at the drawer while+ // ordinary application contexts keep flowing (layerScopedContext.test.tsx+ // proves the same for the other content roots).+ it('ends ancestor group membership while explicit and inner-group state hold', () => {+ const press = vi.fn();+ render(+ <ButtonGroup label="Outer" isDisabled>+ <Button label="Outer member" />+ <Drawer isOpen onOpenChange={() => {}} label="Details">+ <Button label="Independent" onClick={press} />+ <Button label="Explicit disabled" isDisabled />+ <ButtonGroup label="Inner" isDisabled>+ <Button label="Inner member" />+ </ButtonGroup>+ </Drawer>+ </ButtonGroup>,+ );+ expect(screen.getByRole('button', {name: 'Outer member'})).toBeDisabled();+ const independent = screen.getByRole('button', {name: 'Independent'});+ expect(independent).toBeEnabled();+ fireEvent.click(independent);+ expect(press).toHaveBeenCalledOnce();+ expect(+ screen.getByRole('button', {name: 'Explicit disabled'}),+ ).toBeDisabled();+ expect(screen.getByRole('button', {name: 'Inner member'})).toBeDisabled();+ });++ it('keeps unrelated application contexts flowing into drawer content', () => {+ const ServiceContext = createContext('fallback');+ ServiceContext.displayName = 'ServiceContext';+ function ReadService() {+ return <output>{use(ServiceContext)}</output>;+ }+ render(+ <ServiceContext value="live service">+ <Drawer isOpen onOpenChange={() => {}} label="Details">+ <ReadService />+ </Drawer>+ </ServiceContext>,+ );+ expect(screen.getByText('live service')).toBeInTheDocument();+ });++ it('applies the shared text baseline and structural reset on the root dialog', () => {+ render(+ <Drawer isOpen onOpenChange={() => {}} label="Details">+ Content+ </Drawer>,+ );+ const dialog = screen.getByRole('dialog');+ const classes = dialog.className.split(' ');+ // The shared resets, not a local copy, supply the layer baseline.+ for (const cls of (stylex.props(layerTextReset.reset).className ?? '')+ .split(' ')+ .filter(Boolean)) {+ expect(classes).toContain(cls);+ }+ for (const cls of (+ stylex.props(layerStructureReset.reset).className ?? ''+ )+ .split(' ')+ .filter(Boolean)) {+ expect(classes).toContain(cls);+ }+ // The baseline resolves on the root itself, not from the page.+ expect(getComputedStyle(dialog).textAlign).toBe('start');+ });});describe('scrim click', () => {@@ -537,19 +781,36 @@ describe('Drawer', () => {expect(style).toContain('min(400px, calc(100dvw - 56px))');});- it('covers the full viewport on mobile with isFullWidthOnMobile', () => {+ it('covers the full viewport on mobile with experimental.isFullWidthOnMobile', () => {render(<DrawerisOpenonOpenChange={() => {}}label="Details"- isFullWidthOnMobile>+ experimental={{isFullWidthOnMobile: true}}>Content</Drawer>,);- const style = screen.getByRole('dialog').getAttribute('style') ?? '';+ const dialog = screen.getByRole('dialog');+ const style = dialog.getAttribute('style') ?? '';expect(style).toContain('100dvw');expect(style).not.toContain('100dvw - 56px');+ // The experimental object is a prop namespace, never a DOM attribute.+ expect(dialog).not.toHaveAttribute('experimental');+ });++ it('keeps the 56px page reveal when experimental omits the option', () => {+ render(+ <Drawer+ isOpen+ onOpenChange={() => {}}+ label="Details"+ experimental={{}}>+ Content+ </Drawer>,+ );+ const style = screen.getByRole('dialog').getAttribute('style') ?? '';+ expect(style).toContain('min(400px, calc(100dvw - 56px))');});});diff --git a/packages/lab/src/Drawer/Drawer.tsx b/packages/core/src/Drawer/Drawer.tsxsimilarity index 83%rename from packages/lab/src/Drawer/Drawer.tsxrename to packages/core/src/Drawer/Drawer.tsxindex db62d84f66..0a68ec6b95 100644--- a/packages/lab/src/Drawer/Drawer.tsx+++ b/packages/core/src/Drawer/Drawer.tsx@@ -4,9 +4,9 @@/*** @file Drawer.tsx- * @input Uses React, StyleX, theme tokens and text defaults, the Dialog purpose type, shared focus/dismissal/depth primitives, container padding lowering, scroll locking/dialog presence, BaseProps, merged refs/props, themeProps+ * @input Uses React, StyleX, theme tokens, the shared layer text/structure resets and content boundary, the Dialog purpose type, shared focus/dismissal/depth primitives, container padding lowering, scroll locking/dialog presence, BaseProps, merged refs/props, themeProps* @output Exports Drawer component and DrawerProps- * @position Lab implementation; consumed by index.ts, tested by Drawer.test.tsx, demonstrated in Storybook+ * @position Core implementation; consumed by index.ts, tested by Drawer.test.tsx, demonstrated in Storybook** Overlay panel for inspectors and detail views — the "click a table row,* see its details" pattern. Slides in from the inline start or end edge and@@ -18,7 +18,8 @@** Sizing is viewport-aware: `width` is the desktop budget, and below* the mobile breakpoint it preserves a 56px reveal of the page behind, capped- * by the requested width (or fills the viewport with `isFullWidthOnMobile`).+ * by the requested width (or fills the viewport with the experimental+ * `experimental.isFullWidthOnMobile` option).** Uses the native `<dialog>` element (same precedent as Dialog/MobileNav):* - `showModal()` when `hasScrim` (default) — top-layer rendering, focus@@ -49,46 +50,40 @@* root dialog stays the overlay boundary (`overlayPaddingReset`).** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/Drawer/Drawer.doc.mjs (props table, features, usage)- * - /packages/lab/src/Drawer/Drawer.test.tsx (tests for new/changed behavior)- * - /packages/lab/src/Drawer/Drawer.spec.md (component contract)- * - /packages/lab/src/Drawer/index.ts (exports if types change)+ * - /packages/core/src/Drawer/Drawer.doc.mjs (props table, features, usage)+ * - /packages/core/src/Drawer/Drawer.test.tsx (tests for new/changed behavior)+ * - /packages/core/src/Drawer/Drawer.spec.md (component contract)+ * - /packages/core/src/Drawer/index.ts (exports if types change)+ * - /packages/cli/assets/templates/blocks/components/Drawer/ (showcase blocks)* - /apps/storybook/stories/Drawer.stories.tsx (examples and visual coverage)*/import {useCallback, useRef, useState, type ReactNode} from 'react';import * as stylex from '@stylexjs/stylex';-import type {BaseProps} from '@astryxdesign/core';+import type {BaseProps} from '../BaseProps';import {borderVars,colorVars,durationVars,easeVars,shadowVars,- typeScaleVars,- typographyVars,-} from '@astryxdesign/core/theme/tokens.stylex';-import type {DialogPurpose} from '@astryxdesign/core/Dialog';-import {- useFocusTrap,- useMergedRefs,- useScrollLock,-} from '@astryxdesign/core/hooks';-import {LayerDepthProvider, useLayerDismissal} from '@astryxdesign/core/Layer';-import {- composeEventHandlers,- mergeProps,- themeProps,-} from '@astryxdesign/core/utils';-import {container, overlayPaddingReset} from '@astryxdesign/core/Layout';+} from '../theme/tokens.stylex';+import type {DialogPurpose} from '../Dialog';+import {useFocusTrap, useMergedRefs, useScrollLock} from '../hooks';+import {LayerDepthProvider, useLayerDismissal} from '../Layer';+import {layerTextReset} from '../Layer/layerTextReset.stylex';+import {layerStructureReset} from '../Layer/layerStructureReset.stylex';+import {LayerContentBoundary} from '../Layer/layerScopedContext';+import {composeEventHandlers, mergeProps, themeProps} from '../utils';+import {container, overlayPaddingReset} from '../Layout';import {containerPaddingBlockEndVarStyles,containerPaddingBlockStartVarStyles,containerPaddingInlineVarStyles,paddingStyles,spacingStepToToken,-} from '@astryxdesign/core/Layout/padding.stylex';-import type {SpacingStep, SpacingToken} from '@astryxdesign/core/Layout';+} from '../Layout/padding.stylex';+import type {SpacingStep, SpacingToken} from '../Layout';import {useDrawerDialogPresence} from './useDrawerDialogPresence';// =============================================================================@@ -108,28 +103,14 @@ const MOBILE_WIDTH_FULL = '100dvw';const styles = stylex.create({dialog: {- // Keep the layer text boundary local rather than exposing Core styling internals.- fontFamily: typographyVars['--font-family-body'],- fontSize: typeScaleVars['--text-body-size'],- fontWeight: typeScaleVars['--text-body-weight'],- lineHeight: typeScaleVars['--text-body-leading'],- fontStyle: 'normal',- textAlign: 'start',- textAlignLast: 'auto',- textIndent: 0,- textTransform: 'none',- letterSpacing: 'normal',- wordSpacing: 'normal',- textShadow: 'none',- whiteSpace: 'normal',- wordBreak: 'normal',- overflowWrap: 'normal',- hyphens: 'manual',// Reset native <dialog> defaults — the dialog element IS the panel.+ // The layer text baseline comes from the shared `layerTextReset`, applied+ // with the structural reset ahead of these styles on the root below.position: 'fixed',margin: 0,padding: 0,- border: 'none',+ borderWidth: 0,+ borderStyle: 'none',// Square corners: the drawer is flush with the viewport edge on three// sides, so a radius would only ever cut the two edge-adjacent corners.borderRadius: 0,@@ -323,19 +304,27 @@ export interface DrawerProps extends BaseProps<HTMLDialogElement> {* Desktop width budget. A number is pixels; a string is any CSS length* (`'50%'`, `'32rem'`). Below the mobile breakpoint (640px), this* remains the maximum while the drawer preserves a 56px reveal of the page- * behind — see `isFullWidthOnMobile`.+ * behind — see `experimental.isFullWidthOnMobile`.* @default 400*/width?: number | string;/**- * Whether the drawer covers the full viewport width on mobile- * (below 640px) instead of preserving the default 56px reveal of the page- * behind. The reveal makes the drawer read as an overlay rather than a- * navigation.- * @default false+ * Experimental options, outside the stable compatibility promise: anything+ * in this object may change or be removed in a patch release. Omit it for+ * the stable behavior.+ * @experimental*/- isFullWidthOnMobile?: boolean;+ experimental?: {+ /**+ * Cover the full viewport width on mobile (below 640px) instead of+ * preserving the default 56px reveal of the page behind. The reveal makes+ * the drawer read as an overlay rather than a navigation.+ * @experimental+ * @default false+ */+ isFullWidthOnMobile?: boolean;+ };/*** Accessible label for the drawer (required — the drawer has no@@ -400,7 +389,7 @@ export interface DrawerProps extends BaseProps<HTMLDialogElement> {* non-modal overlay with `hasScrim={false}` that leaves the page behind* interactive. `width` is the desktop budget; below 640px the panel preserves* a 56px page reveal without exceeding that budget (or fills the viewport- * with `isFullWidthOnMobile`). Escape+ * with the experimental `experimental.isFullWidthOnMobile`). Escape* closes the top-most open drawer; focus returns to the element that* opened it.*@@ -433,7 +422,7 @@ export function Drawer({onOpenChange,side = 'end',width = 400,- isFullWidthOnMobile = false,+ experimental,label,hasScrim = true,purpose = 'info',@@ -525,6 +514,7 @@ export function Drawer({);const widthValue = typeof width === 'number' ? `${width}px` : width;+ const isFullWidthOnMobile = experimental?.isFullWidthOnMobile ?? false;const mobileWidth = isFullWidthOnMobile? MOBILE_WIDTH_FULL: `min(${widthValue}, calc(100dvw - ${MOBILE_PAGE_REVEAL}px))`;@@ -554,6 +544,8 @@ export function Drawer({{...mergeProps(themeProps('drawer', {side: anchoredSide}),stylex.props(+ layerTextReset.reset,+ layerStructureReset.reset,styles.dialog,overlayPaddingReset.reset,sideStyle,@@ -578,38 +570,40 @@ export function Drawer({onKeyDown={onKeyDownProp}onCancel={handleCancel}><LayerDepthProvider>- {/* Scrollable content area — tabIndex so the dialog's focusing steps- land on the panel body rather than the first button inside. */}- <div- tabIndex={-1}- {...stylex.props(- styles.content,- ...container(- usesThemePadding- ? {useThemeDefault: 'drawer'}- : {- paddingInnerX: paddingToken,- paddingInnerY: paddingToken,- paddingOuterX: paddingToken,- paddingOuterY: paddingToken,- },- ),- !usesThemePadding &&- effectivePadding !== 4 &&- paddingStyles[effectivePadding],- !usesThemePadding &&- effectivePadding !== 4 &&- containerPaddingInlineVarStyles[effectivePadding],- !usesThemePadding &&- effectivePadding !== 4 &&- containerPaddingBlockStartVarStyles[effectivePadding],- !usesThemePadding &&- effectivePadding !== 4 &&- containerPaddingBlockEndVarStyles[effectivePadding],- styles.contentSafeArea,- )}>- {children}- </div>+ <LayerContentBoundary>+ {/* Scrollable content area — tabIndex so the dialog's focusing steps+ land on the panel body rather than the first button inside. */}+ <div+ tabIndex={-1}+ {...stylex.props(+ styles.content,+ ...container(+ usesThemePadding+ ? {useThemeDefault: 'drawer'}+ : {+ paddingInnerX: paddingToken,+ paddingInnerY: paddingToken,+ paddingOuterX: paddingToken,+ paddingOuterY: paddingToken,+ },+ ),+ !usesThemePadding &&+ effectivePadding !== 4 &&+ paddingStyles[effectivePadding],+ !usesThemePadding &&+ effectivePadding !== 4 &&+ containerPaddingInlineVarStyles[effectivePadding],+ !usesThemePadding &&+ effectivePadding !== 4 &&+ containerPaddingBlockStartVarStyles[effectivePadding],+ !usesThemePadding &&+ effectivePadding !== 4 &&+ containerPaddingBlockEndVarStyles[effectivePadding],+ styles.contentSafeArea,+ )}>+ {children}+ </div>+ </LayerContentBoundary></LayerDepthProvider></dialog>);diff --git a/packages/lab/src/Drawer/DrawerHeader.doc.mjs b/packages/core/src/Drawer/DrawerHeader.doc.mjssimilarity index 95%rename from packages/lab/src/Drawer/DrawerHeader.doc.mjsrename to packages/core/src/Drawer/DrawerHeader.doc.mjsindex b65206347b..1e0e05d0b9 100644--- a/packages/lab/src/Drawer/DrawerHeader.doc.mjs+++ b/packages/core/src/Drawer/DrawerHeader.doc.mjs@@ -4,7 +4,7 @@* @file DrawerHeader.doc.mjs* @input DrawerHeader props, anatomy, theming targets, and examples* @output Consumer documentation for DrawerHeader, a sub-component of Drawer- * @position CLI and docsite metadata for the Lab Drawer header+ * @position CLI and docsite metadata for the Drawer header; runnable docsite demos live in packages/cli/assets/templates/blocks/components/DrawerHeader*//** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */@@ -13,6 +13,8 @@ export const docs = {name: 'DrawerHeader',subComponentOf: 'Drawer',displayName: 'Drawer Header',+ // Keeps the registry route DrawerHeader had as a canary-only Lab component.+ registry: {aliases: ['lab/drawer-header']},isHiddenFromOverview: true,description:'Header for drawers with a title, optional subtitle, close button, and start/end content slots. Same API as DialogHeader.',@@ -113,7 +115,7 @@ export const docs = {label: 'With close button',code: `import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';+import {Drawer, DrawerHeader} from '@astryxdesign/core/Drawer';import {Layout, LayoutContent} from '@astryxdesign/core/Layout';function Inspector() {@@ -134,7 +136,7 @@ function Inspector() {{label: 'With subtitle and end content',code: `-import {DrawerHeader} from '@astryxdesign/lab';+import {DrawerHeader} from '@astryxdesign/core/Drawer';import {Badge} from '@astryxdesign/core/Badge';<DrawerHeaderdiff --git a/packages/lab/src/Drawer/DrawerHeader.test.tsx b/packages/core/src/Drawer/DrawerHeader.test.tsxsimilarity index 97%rename from packages/lab/src/Drawer/DrawerHeader.test.tsxrename to packages/core/src/Drawer/DrawerHeader.test.tsxindex 8807acca03..9c5d43cede 100644--- a/packages/lab/src/Drawer/DrawerHeader.test.tsx+++ b/packages/core/src/Drawer/DrawerHeader.test.tsx@@ -4,7 +4,7 @@* @file DrawerHeader.test.tsx* @input Uses vitest, @testing-library/react, DrawerHeader component* @output Unit tests for DrawerHeader rendering, close action, slots, and theming targets- * @position Lab testing; validates DrawerHeader.tsx implementation+ * @position Core testing; validates DrawerHeader.tsx implementation** SYNC: When DrawerHeader.tsx changes, update tests to match new behavior*/diff --git a/packages/lab/src/Drawer/DrawerHeader.tsx b/packages/core/src/Drawer/DrawerHeader.tsxsimilarity index 88%rename from packages/lab/src/Drawer/DrawerHeader.tsxrename to packages/core/src/Drawer/DrawerHeader.tsxindex 1f20624aed..ef47ad7102 100644--- a/packages/lab/src/Drawer/DrawerHeader.tsx+++ b/packages/core/src/Drawer/DrawerHeader.tsx@@ -6,7 +6,7 @@* @file DrawerHeader.tsx* @input Uses React, StyleX, LayoutHeader, Button, Icon, Heading, Text, i18n, BaseProps, mergeProps, themeProps* @output Exports DrawerHeader component and DrawerHeaderProps- * @position Lab Drawer header; composed as the first child of Drawer, tested by DrawerHeader.test.tsx+ * @position Drawer header; composed in a Layout header slot inside Drawer, tested by DrawerHeader.test.tsx** Mirrors DialogHeader's API: a title, an optional subtitle, start/end content* slots, and a close button that renders only when `onOpenChange` is passed.@@ -16,27 +16,25 @@* - It does not name the drawer. Drawer's required `label` does.** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/Drawer/DrawerHeader.doc.mjs (props, anatomy, theming)- * - /packages/lab/src/Drawer/DrawerHeader.test.tsx (tests for new/changed behavior)- * - /packages/lab/src/Drawer/index.ts (exports if types change)+ * - /packages/core/src/Drawer/DrawerHeader.doc.mjs (props, anatomy, theming)+ * - /packages/core/src/Drawer/DrawerHeader.test.tsx (tests for new/changed behavior)+ * - /packages/core/src/Drawer/index.ts (exports if types change)+ * - /packages/cli/assets/templates/blocks/components/Drawer/ (showcase blocks)+ * - /packages/cli/assets/templates/blocks/components/DrawerHeader/ (showcase blocks)* - /apps/storybook/stories/Drawer.stories.tsx (examples and visual coverage)*/import type {ReactNode} from 'react';import * as stylex from '@stylexjs/stylex';-import type {BaseProps} from '@astryxdesign/core';-import {- sizeVars,- spacingVars,- typeScaleVars,-} from '@astryxdesign/core/theme/tokens.stylex';-import {Button} from '@astryxdesign/core/Button';-import {Heading} from '@astryxdesign/core/Heading';-import {Icon} from '@astryxdesign/core/Icon';-import {LayoutHeader} from '@astryxdesign/core/Layout';-import {Text} from '@astryxdesign/core/Text';-import {useTranslator} from '@astryxdesign/core/i18n';-import {mergeProps, themeProps} from '@astryxdesign/core/utils';+import type {BaseProps} from '../BaseProps';+import {sizeVars, spacingVars, typeScaleVars} from '../theme/tokens.stylex';+import {Button} from '../Button';+import {Heading} from '../Heading';+import {Icon} from '../Icon';+import {LayoutHeader} from '../Layout';+import {Text} from '../Text';+import {useTranslator} from '../i18n';+import {mergeProps, themeProps} from '../utils';const styles = stylex.create({container: {diff --git a/packages/lab/src/Drawer/index.ts b/packages/core/src/Drawer/index.tssimilarity index 81%rename from packages/lab/src/Drawer/index.tsrename to packages/core/src/Drawer/index.tsindex 6b0eec2750..1888123e88 100644--- a/packages/lab/src/Drawer/index.ts+++ b/packages/core/src/Drawer/index.ts@@ -4,7 +4,7 @@* @file index.ts* @input Drawer.tsx, DrawerHeader.tsx* @output Re-exports Drawer and DrawerHeader components and their prop types- * @position Lab entry point for the Drawer directory+ * @position Core entry point for the Drawer directory (`@astryxdesign/core/Drawer`)*/export {Drawer} from './Drawer';diff --git a/packages/lab/src/Drawer/useDrawerDialogPresence.ts b/packages/core/src/Drawer/useDrawerDialogPresence.tssimilarity index 98%rename from packages/lab/src/Drawer/useDrawerDialogPresence.tsrename to packages/core/src/Drawer/useDrawerDialogPresence.tsindex 78be6d3627..56b7ea34c3 100644--- a/packages/lab/src/Drawer/useDrawerDialogPresence.ts+++ b/packages/core/src/Drawer/useDrawerDialogPresence.ts@@ -20,7 +20,7 @@* the page for one frame.** SYNC: When modified, update:- * - /packages/lab/src/Drawer/Drawer.test.tsx+ * - /packages/core/src/Drawer/Drawer.test.tsx* - /.github/scripts/modal-close-visibility.js*/@@ -152,6 +152,7 @@ export function useDrawerDialogPresence({// the commit after the next paint, and that one frame is exactly the// bug — the panel paints outside the top layer. Both happen in this// task, so the browser never gets to paint between them.+ // eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the panel must stop painting in the task the native host closesflushSync(() => {setIsRendered(false);});diff --git a/packages/core/src/Layer/layerViewportInset.test.ts b/packages/core/src/Layer/layerViewportInset.test.tsindex 79360a106f..ccd25d7a48 100644--- a/packages/core/src/Layer/layerViewportInset.test.ts+++ b/packages/core/src/Layer/layerViewportInset.test.ts@@ -22,6 +22,7 @@ const GUTTER_OWNERS = new Set(['Dialog/Dialog.tsx','Toast/ToastViewport.tsx','BottomSheet/BottomSheetPanel.tsx',+ 'Drawer/Drawer.tsx','Stepper/Step.tsx','Tokenizer/useEndLaneReserve.ts',]);diff --git a/packages/core/src/Layer/useLayerDismissal.ts b/packages/core/src/Layer/useLayerDismissal.tsindex 0fdaaa7088..42ad0bc4fc 100644--- a/packages/core/src/Layer/useLayerDismissal.ts+++ b/packages/core/src/Layer/useLayerDismissal.ts@@ -98,7 +98,7 @@ export interface UseLayerDismissalReturn {* routes each Escape press to the top-most REGISTERED layer, so one press* dismisses exactly one of them. Dialog (and what is built on it, including* CommandPalette), Popover and the menus built on it, ContextMenu, Tooltip,- * HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and lab's+ * HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and* `Drawer` register today.** `DropdownMenuSubMenu` and `PowerSearchEditPopover` still run their own Escapediff --git a/packages/core/src/Layout/container.stylex.ts b/packages/core/src/Layout/container.stylex.tsindex 58963ec75a..cd7c57027a 100644--- a/packages/core/src/Layout/container.stylex.ts+++ b/packages/core/src/Layout/container.stylex.ts@@ -4,8 +4,8 @@* @file container.stylex.ts* @input Uses @stylexjs/stylex, spacing from theme* @output StyleX utility for layout container styling- * @position Layout utility; used by Card, Section, Dialog, BottomSheet, and the- * Lab Drawer+ * @position Layout utility; used by Card, Section, Dialog, BottomSheet, and+ * Drawer** ## Public API for themes*@@ -19,7 +19,7 @@* --astryx-card-padding-block-end** Read order per level: `var(--astryx-…, <next level>)`, terminating at- * `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and the Lab+ * `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and* drawer.** ```ts@@ -150,7 +150,7 @@ const bottomSheetInlineEnd = `var(--astryx-bottom-sheet-padding-inline-end, ${boconst bottomSheetBlockStart = `var(--astryx-bottom-sheet-padding-block-start, ${bottomSheetShorthand})`;const bottomSheetBlockEnd = `var(--astryx-bottom-sheet-padding-block-end, ${bottomSheetShorthand})`;-// Drawer (Lab) padding chains: --astryx-* then the next specificity level,+// Drawer padding chains: --astryx-* then the next specificity level,// terminating at --spacing-4 like Dialog. Built as chained const strings (no// function calls) so StyleX can statically analyze them; see naming.ts for the// prefix policy.@@ -522,8 +522,8 @@ export interface ContainerOptions {* This allows themes to override container padding via component-specific* public CSS custom properties without touching internal vars.*- * Used by Card, Section, Dialog, BottomSheet, and the Lab Drawer when no- * explicit padding prop is provided.+ * Used by Card, Section, Dialog, BottomSheet, and Drawer when no explicit+ * padding prop is provided.* @default undefined (uses explicit spacing token values)*/useThemeDefault?: ContainerComponent;diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 5e4a7c08a5..da746066d7 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -95,6 +95,7 @@ export * from './AlertDialog';export * from './Dialog';export * from './ContextMenu';export * from './DropdownMenu';+export * from './Drawer';export * from './MoreMenu';export * from './InteractiveRoleContext';export * from './SizeContext';diff --git a/packages/core/src/theme/derivedVarRegistry.test.ts b/packages/core/src/theme/derivedVarRegistry.test.tsindex 60a98b46d8..8127b8d568 100644--- a/packages/core/src/theme/derivedVarRegistry.test.ts+++ b/packages/core/src/theme/derivedVarRegistry.test.ts@@ -224,9 +224,6 @@ const DIR_TO_REGISTRY_KEY: Record<string, string> = {Chat: 'chat',ContextMenu: 'context-menu',Dialog: 'dialog',- // The Drawer doc file lives in packages/lab/src/Drawer, outside this- // package's scan; the mapping keeps the registry orphan check honest and- // defineTheme.test.ts pins the expansion.Drawer: 'drawer',DropdownMenu: 'dropdown-menu',Field: 'field',diff --git a/packages/core/src/theme/derivedVarRegistry.ts b/packages/core/src/theme/derivedVarRegistry.tsindex ba74058ecf..7ab9bd2b79 100644--- a/packages/core/src/theme/derivedVarRegistry.ts+++ b/packages/core/src/theme/derivedVarRegistry.ts@@ -59,9 +59,6 @@ export const derivedVarRegistry: Record<string, DerivedVarEntry[]> = {{property: 'borderRadius', vars: ['--_dialog-radius']},{property: 'padding', expand: 'container'},],- // Drawer lives in @astryxdesign/lab; its doc source of truth is- // packages/lab/src/Drawer/Drawer.doc.mjs, outside this package's consistency- // scan. defineTheme.test.ts pins the expansion instead.drawer: [{property: 'padding', expand: 'container'}],'context-menu': [{property: 'borderRadius', vars: ['--_dropdown-menu-radius']},diff --git a/packages/lab/blocks/DrawerFullWidthMobile.doc.mjs b/packages/lab/blocks/DrawerFullWidthMobile.doc.mjsdeleted file mode 100644index 613f9f277e..0000000000--- a/packages/lab/blocks/DrawerFullWidthMobile.doc.mjs+++ /dev/null@@ -1,21 +0,0 @@-// Copyright (c) Meta Platforms, Inc. and affiliates.--/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {- type: 'block',- name: 'Wide desktop panel, full-width on mobile',- displayName: 'Wide desktop panel, full-width on mobile',- description:- 'Use a 560px desktop width and isFullWidthOnMobile to fill the viewport below 640px, without the default page reveal.',- exampleFor: 'Drawer',- isReady: true,- aspectRatio: 16 / 9,- componentsUsed: [- 'Drawer',- 'Button',- 'Layout',- 'LayoutContent',- 'DrawerHeader',- 'Text',- ],-};diff --git a/packages/lab/blocks/DrawerFullWidthMobile.tsx b/packages/lab/blocks/DrawerFullWidthMobile.tsxdeleted file mode 100644index 043e7a5559..0000000000--- a/packages/lab/blocks/DrawerFullWidthMobile.tsx+++ /dev/null@@ -1,42 +0,0 @@-// Copyright (c) Meta Platforms, Inc. and affiliates.--'use client';--/**- * @input A wide desktop budget and isFullWidthOnMobile- * @output A Drawer that fills the viewport on mobile- * @position Copyable Lab Drawer example- */--import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';-import {Button} from '@astryxdesign/core/Button';-import {Layout, LayoutContent} from '@astryxdesign/core/Layout';-import {Text} from '@astryxdesign/core/Text';--export default function DrawerFullWidthMobile() {- const [isOpen, setIsOpen] = useState(false);-- return (- <>- <Button label="Open wide drawer" onClick={() => setIsOpen(true)} />- <Drawer- isOpen={isOpen}- onOpenChange={setIsOpen}- label="Wide panel"- width={560}- isFullWidthOnMobile>- <Layout- header={<DrawerHeader title="Wide panel" onOpenChange={setIsOpen} />}- content={- <LayoutContent>- <Text type="body">- A wide panel on desktop, the full viewport width on mobile.- </Text>- </LayoutContent>- }- />- </Drawer>- </>- );-}diff --git a/packages/lab/blocks/DrawerMobileReveal.doc.mjs b/packages/lab/blocks/DrawerMobileReveal.doc.mjsdeleted file mode 100644index 3f2a7573ec..0000000000--- a/packages/lab/blocks/DrawerMobileReveal.doc.mjs+++ /dev/null@@ -1,21 +0,0 @@-// Copyright (c) Meta Platforms, Inc. and affiliates.--/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */-export default {- type: 'block',- name: 'Mobile: the 56px page reveal (default)',- displayName: 'Mobile: the 56px page reveal (default)',- description:- 'Below 640px, the default drawer leaves at least 56px of the page visible while respecting its width budget. Open this example in a narrow viewport to see the reveal.',- exampleFor: 'Drawer',- isReady: true,- aspectRatio: 16 / 9,- componentsUsed: [- 'Drawer',- 'Button',- 'Layout',- 'LayoutContent',- 'DrawerHeader',- 'Text',- ],-};diff --git a/packages/lab/blocks/DrawerMobileReveal.tsx b/packages/lab/blocks/DrawerMobileReveal.tsxdeleted file mode 100644index fd702c013b..0000000000--- a/packages/lab/blocks/DrawerMobileReveal.tsx+++ /dev/null@@ -1,43 +0,0 @@-// Copyright (c) Meta Platforms, Inc. and affiliates.--'use client';--/**- * @input A 360px width budget and the default mobile sizing- * @output A Drawer preserving the page reveal on narrow viewports- * @position Copyable Lab Drawer example- */--import {useState} from 'react';-import {Drawer, DrawerHeader} from '@astryxdesign/lab';-import {Button} from '@astryxdesign/core/Button';-import {Layout, LayoutContent} from '@astryxdesign/core/Layout';-import {Text} from '@astryxdesign/core/Text';--export default function DrawerMobileReveal() {- const [isOpen, setIsOpen] = useState(false);-- return (- <>- <Button label="Open mobile drawer" onClick={() => setIsOpen(true)} />- <Drawer- isOpen={isOpen}- onOpenChange={setIsOpen}- label="Mobile reveal"- width={360}>- <Layout- header={- <DrawerHeader title="Mobile reveal" onOpenChange={setIsOpen} />- }- content={- <LayoutContent>- <Text type="body">- The page remains visible beside the drawer on mobile.- </Text>- </LayoutContent>- }- />- </Drawer>- </>- );-}diff --git a/packages/lab/src/index.ts b/packages/lab/src/index.tsindex 9e69dbc58a..fa9cd74ac3 100644--- a/packages/lab/src/index.ts+++ b/packages/lab/src/index.ts@@ -88,14 +88,6 @@ export {} from './ChatReasoning/ChatReasoning';export * from './Chat';-// Drawer — experimental overlay panel-export {- Drawer,- DrawerHeader,- type DrawerProps,- type DrawerHeaderProps,-} from './Drawer';-// Tour — guided product-tour / NUX walkthrough (facebook/astryx#4239)export {Tour,diff --git a/packages/themes/probe/src/probeTheme.ts b/packages/themes/probe/src/probeTheme.tsindex a73162d4f2..db41b74f39 100644--- a/packages/themes/probe/src/probeTheme.ts+++ b/packages/themes/probe/src/probeTheme.ts@@ -6,7 +6,7 @@// test fixture. Regenerate with: pnpm visual:probe-theme//// defineTheme takes six things and this covers all six:-// components 269 targets, 865 selectors (generated from the docs)+// components 275 targets, 874 selectors (generated from the docs)// tokens custom properties, read back off the themed element// icons every registry entry swapped for a marked glyph// indicators check / radio / checkbox swapped — the swap that reaches furthest@@ -2058,6 +2058,66 @@ export const probeTheme = defineTheme({outlineColor: 'hsl(301.2 93% 25%)',},},+ drawer: {+ base: {+ backgroundColor: 'hsl(170.3 72% 45%)',+ color: 'hsl(152.1 88% 12%)',+ borderColor: 'hsl(310.7 90% 25%)',+ outlineColor: 'hsl(100.3 90% 25%)',+ },+ 'side:start': {+ backgroundColor: 'hsl(198.3 77% 59%)',+ color: 'hsl(192.4 71% 12%)',+ borderColor: 'hsl(22.9 83% 25%)',+ outlineColor: 'hsl(185.1 80% 25%)',+ },+ 'side:end': {+ backgroundColor: 'hsl(125.4 80% 59%)',+ color: 'hsl(28.1 86% 12%)',+ borderColor: 'hsl(19.6 70% 25%)',+ outlineColor: 'hsl(274.7 92% 25%)',+ },+ },+ 'drawer-header': {+ base: {+ backgroundColor: 'hsl(97.3 85% 49%)',+ color: 'hsl(262.2 75% 12%)',+ borderColor: 'hsl(318.1 87% 25%)',+ outlineColor: 'hsl(151.1 80% 25%)',+ },+ },+ 'drawer-header-close-icon': {+ base: {+ backgroundColor: 'hsl(68.0 84% 57%)',+ color: 'hsl(249.2 76% 12%)',+ borderColor: 'hsl(276.3 79% 25%)',+ outlineColor: 'hsl(72.2 93% 25%)',+ },+ },+ 'drawer-header-end-content': {+ base: {+ backgroundColor: 'hsl(262.5 94% 60%)',+ color: 'hsl(141.8 92% 12%)',+ borderColor: 'hsl(98.2 87% 25%)',+ outlineColor: 'hsl(5.2 84% 25%)',+ },+ },+ 'drawer-header-start-content': {+ base: {+ backgroundColor: 'hsl(84.1 77% 51%)',+ color: 'hsl(71.5 80% 12%)',+ borderColor: 'hsl(160.3 70% 25%)',+ outlineColor: 'hsl(108.2 71% 25%)',+ },+ },+ 'drawer-header-title-block': {+ base: {+ backgroundColor: 'hsl(252.5 80% 48%)',+ color: 'hsl(52.3 76% 12%)',+ borderColor: 'hsl(329.0 85% 25%)',+ outlineColor: 'hsl(123.1 85% 25%)',+ },+ },'dropdown-menu': {base: {backgroundColor: 'hsl(149.6 75% 47%)',@@ -3992,6 +4052,12 @@ export const probeTheme = defineTheme({borderColor: 'hsl(168.8 88% 25%)',outlineColor: 'hsl(156.5 79% 25%)',},+ 'variant:secondary': {+ backgroundColor: 'hsl(231.6 92% 55%)',+ color: 'hsl(324.4 72% 12%)',+ borderColor: 'hsl(179.1 74% 25%)',+ outlineColor: 'hsl(21.2 83% 25%)',+ },'variant:ghost': {backgroundColor: 'hsl(205.2 71% 62%)',color: 'hsl(168.5 79% 12%)',