An open source design system that's fully customizable and agent ready
TypeScript
feat(core): promote Bottom Sheet from Lab (#5080)
Xinzi Zhou6e7f89c16f52
diff --git a/.changeset/promote-bottom-sheet-to-core.md b/.changeset/promote-bottom-sheet-to-core.mdnew file mode 100644index 0000000000..7a45cf8811--- /dev/null+++ b/.changeset/promote-bottom-sheet-to-core.md@@ -0,0 +1,8 @@+---+'@astryxdesign/cli': patch+'@astryxdesign/core': patch+---++[component] Promote `BottomSheet` and `BottomSheetSwitcher` from the canary-only Lab package to Core. The stable package now includes their existing native-dialog, drag-detent, transition, and mobile-keyboard behavior, plus Core documentation and examples.++@imdreamrunnerdiff --git a/apps/docsite/scripts/generate-data.mjs b/apps/docsite/scripts/generate-data.mjsindex 423c9dee08..710e9a86cf 100644--- a/apps/docsite/scripts/generate-data.mjs+++ b/apps/docsite/scripts/generate-data.mjs@@ -826,6 +826,10 @@ export interface ElementDescriptor {export interface PlaygroundConfig {defaults?: Record<string, unknown>;overlay?: boolean;+ overlayControl?: {+ stateProp: string;+ openValue: unknown;+ };appShellMobile?: boolean;wrapper?: {component: string;diff --git a/apps/docsite/src/__tests__/component-preview-state.test.ts b/apps/docsite/src/__tests__/component-preview-state.test.tsindex 5b5fd06cfc..16f397a718 100644--- a/apps/docsite/src/__tests__/component-preview-state.test.ts+++ b/apps/docsite/src/__tests__/component-preview-state.test.ts@@ -5,6 +5,7 @@ import {buildAppShellMobilePreviewContext,buildInitialState,buildRuntimePreviewState,+ getOverlayPreviewControl,getMissingRequiredProps,hasInteractivePlayground,isOverlayPreviewClosed,@@ -492,6 +493,31 @@ describe('component detail preview state', () => {expect(isOverlayPreviewClosed(null, {isOpen: false})).toBe(false);expect(isOverlayPreviewClosed(undefined, {})).toBe(false);});++ it('supports overlays controlled by a non-boolean state prop', () => {+ const playground = {+ overlay: true,+ overlayControl: {stateProp: 'activeSheet', openValue: 'details'},+ };++ expect(getOverlayPreviewControl(playground)).toEqual({+ stateProp: 'activeSheet',+ openValue: 'details',+ });+ expect(isOverlayPreviewClosed(playground, {activeSheet: null})).toBe(true);+ expect(isOverlayPreviewClosed(playground, {activeSheet: 'details'})).toBe(+ false,+ );+ });++ it('ignores overlay controls unless overlay mode is enabled', () => {+ const playground = {+ overlayControl: {stateProp: 'activeSheet', openValue: 'details'},+ };++ expect(getOverlayPreviewControl(playground)).toBeNull();+ expect(isOverlayPreviewClosed(playground, {activeSheet: null})).toBe(false);+ });});// ── Simplified layout for provider/utility pages (#2733) ───────────────────diff --git a/apps/docsite/src/components/component-detail/InteractivePreview.tsx b/apps/docsite/src/components/component-detail/InteractivePreview.tsxindex 981796309a..9a9178ea7a 100644--- a/apps/docsite/src/components/component-detail/InteractivePreview.tsx+++ b/apps/docsite/src/components/component-detail/InteractivePreview.tsx@@ -26,6 +26,7 @@ import {buildAppShellMobilePreviewContext,buildInitialState,buildRuntimePreviewState,+ getOverlayPreviewControl,getMissingRequiredProps,isOverlayPreviewClosed,pickPrimaryProps,@@ -261,6 +262,7 @@ export function InteractivePreviewStage({// Sub-components that need a parent context provider declare it via// `playground.wrapper`; wrap the previewed component in that parent.const wrapper = playground?.wrapper ?? null;+ const overlayControl = getOverlayPreviewControl(playground);const WrapperComponent = wrapper ? getComponent(wrapper.component) : null;const wrapperProps = useMemo(() => {const resolved = wrapper?.props@@ -410,14 +412,22 @@ export function InteractivePreviewStage({Opens as a full-screen overlay — nothing renders while it isclosed.</Text>- {onPropChange != null && canControlOpenState && (- <Button- label="Open preview"- variant="secondary"- size="sm"- onClick={() => onPropChange('isOpen', true)}- />- )}+ {onPropChange != null &&+ overlayControl != null &&+ (overlayControl.stateProp !== 'isOpen' ||+ canControlOpenState) && (+ <Button+ label="Open preview"+ variant="secondary"+ size="sm"+ onClick={() =>+ onPropChange(+ overlayControl.stateProp,+ overlayControl.openValue,+ )+ }+ />+ )}</VStack>)}</PreviewErrorBoundary>diff --git a/apps/docsite/src/components/component-detail/interactiveState.ts b/apps/docsite/src/components/component-detail/interactiveState.tsindex 1cc07af4d2..bee5ae455b 100644--- a/apps/docsite/src/components/component-detail/interactiveState.ts+++ b/apps/docsite/src/components/component-detail/interactiveState.ts@@ -230,7 +230,20 @@ export function isOverlayPreviewClosed(playground: PlaygroundConfig | null | undefined,state: Record<string, unknown>,): boolean {- return playground?.overlay === true && state.isOpen !== true;+ const control = getOverlayPreviewControl(playground);+ return (+ control != null && !Object.is(state[control.stateProp], control.openValue)+ );+}++/** Controlled prop/value used by the Properties preview's open button. */+export function getOverlayPreviewControl(+ playground: PlaygroundConfig | null | undefined,+): {stateProp: string; openValue: unknown} | null {+ if (playground?.overlay !== true) {+ return null;+ }+ return playground.overlayControl ?? {stateProp: 'isOpen', openValue: true};}/**diff --git a/apps/storybook/stories/BottomSheet.stories.tsx b/apps/storybook/stories/BottomSheet.stories.tsxindex df04d20437..e821bdfc0f 100644--- a/apps/storybook/stories/BottomSheet.stories.tsx+++ b/apps/storybook/stories/BottomSheet.stories.tsx@@ -2,7 +2,7 @@import type {Meta, StoryObj} from '@storybook/react';import {useState} from 'react';-import {BottomSheet} from '@astryxdesign/lab';+import {BottomSheet} from '@astryxdesign/core/BottomSheet';import {Button} from '@astryxdesign/core/Button';import {Divider} from '@astryxdesign/core/Divider';import {Heading} from '@astryxdesign/core/Heading';@@ -14,7 +14,7 @@ import {TextArea} from '@astryxdesign/core/TextArea';import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';const meta: Meta<typeof BottomSheet> = {- title: 'Lab/BottomSheet',+ title: 'Core/BottomSheet',component: BottomSheet,tags: ['autodocs'],parameters: {diff --git a/apps/storybook/stories/BottomSheetSwitcher.stories.tsx b/apps/storybook/stories/BottomSheetSwitcher.stories.tsxindex 0bb8dbd620..e912e8196a 100644--- a/apps/storybook/stories/BottomSheetSwitcher.stories.tsx+++ b/apps/storybook/stories/BottomSheetSwitcher.stories.tsx@@ -2,7 +2,7 @@import type {Meta, StoryObj} from '@storybook/react';import {useState} from 'react';-import {BottomSheet, BottomSheetSwitcher} from '@astryxdesign/lab';+import {BottomSheet, BottomSheetSwitcher} from '@astryxdesign/core/BottomSheet';import {Button} from '@astryxdesign/core/Button';import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';import {Divider} from '@astryxdesign/core/Divider';@@ -13,7 +13,7 @@ import {Text} from '@astryxdesign/core/Text';import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';const meta: Meta<typeof BottomSheetSwitcher> = {- title: 'Lab/BottomSheetSwitcher',+ title: 'Core/BottomSheetSwitcher',component: BottomSheetSwitcher,tags: ['autodocs'],parameters: {diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.doc.mjs b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.doc.mjsnew file mode 100644index 0000000000..6d9d1ca77e--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.doc.mjs@@ -0,0 +1,21 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ exampleFor: 'BottomSheet',+ name: 'Bottom Sheet — Height variants',+ displayName: 'Bottom Sheet — Height variants',+ description:+ 'Compares hug, capped, and tall starting heights for different amounts of content.',+ isReady: true,+ aspectRatio: 3 / 4,+ componentsUsed: [+ 'BottomSheet',+ 'Button',+ 'Divider',+ 'Heading',+ 'Stack',+ 'Text',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsxnew file mode 100644index 0000000000..f9d4ca802e--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx@@ -0,0 +1,46 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++import {useState} from 'react';+import {+ BottomSheet,+ type BottomSheetHeight,+} from '@astryxdesign/core/BottomSheet';+import {Button} from '@astryxdesign/core/Button';+import {Divider} from '@astryxdesign/core/Divider';+import {Heading} from '@astryxdesign/core/Heading';+import {HStack, VStack} from '@astryxdesign/core/Stack';+import {Text} from '@astryxdesign/core/Text';++const descriptions: Record<BottomSheetHeight, string> = {+ hug: 'Hug fits short, bounded content.',+ capped: 'Capped starts at a comfortable mid-height for lists and filters.',+ tall: 'Tall reserves most of the viewport for long or changing content.',+};++export default function BottomSheetHeights() {+ const [height, setHeight] = useState<BottomSheetHeight | null>(null);++ return (+ <>+ <HStack gap={2} wrap="wrap">+ <Button label="Open hug" onClick={() => setHeight('hug')} />+ <Button label="Open capped" onClick={() => setHeight('capped')} />+ <Button label="Open tall" onClick={() => setHeight('tall')} />+ </HStack>+ <BottomSheet+ isOpen={height != null}+ onOpenChange={isOpen => !isOpen && setHeight(null)}+ label={`${height ?? 'Hug'} height`}+ height={height ?? 'hug'}>+ <VStack gap={4} style={{padding: 'var(--spacing-4)'}}>+ <Heading level={3}>{height ?? 'Hug'} height</Heading>+ <Divider />+ <Text type="body">{descriptions[height ?? 'hug']}</Text>+ <Button label="Close" onClick={() => setHeight(null)} />+ </VStack>+ </BottomSheet>+ </>+ );+}diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.doc.mjs b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.doc.mjsnew file mode 100644index 0000000000..5ac7e8f630--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.doc.mjs@@ -0,0 +1,23 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ exampleFor: 'BottomSheet',+ name: 'Bottom Sheet — Mobile keyboard',+ displayName: 'Bottom Sheet — Mobile keyboard',+ description:+ 'Uses a tall, scrollable form that keeps focused controls visible above the mobile keyboard.',+ isReady: true,+ aspectRatio: 3 / 4,+ componentsUsed: [+ 'BottomSheet',+ 'Button',+ 'Divider',+ 'Heading',+ 'Stack',+ 'Text',+ 'TextArea',+ 'TextInput',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsxnew file mode 100644index 0000000000..a86f56aeb5--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx@@ -0,0 +1,100 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++import {useState} from 'react';+import {BottomSheet} from '@astryxdesign/core/BottomSheet';+import {Button} from '@astryxdesign/core/Button';+import {Divider} from '@astryxdesign/core/Divider';+import {Heading} from '@astryxdesign/core/Heading';+import {VStack} from '@astryxdesign/core/Stack';+import {Text} from '@astryxdesign/core/Text';+import {TextArea} from '@astryxdesign/core/TextArea';+import {TextInput} from '@astryxdesign/core/TextInput';++interface ProfileFormValues {+ name: string;+ email: string;+ company: string;+ role: string;+ bio: string;+ notes: string;+}++const initialValues: ProfileFormValues = {+ name: '',+ email: '',+ company: '',+ role: '',+ bio: '',+ notes: '',+};++export default function BottomSheetMobileKeyboard() {+ const [isOpen, setIsOpen] = useState(false);+ const [values, setValues] = useState(initialValues);+ const update =+ (field: keyof ProfileFormValues) =>+ (value: string): void =>+ setValues(current => ({...current, [field]: value}));++ return (+ <>+ <Button label="Edit profile" onClick={() => setIsOpen(true)} />+ <BottomSheet+ isOpen={isOpen}+ onOpenChange={setIsOpen}+ label="Edit profile"+ height="tall">+ <form+ onSubmit={event => {+ event.preventDefault();+ setIsOpen(false);+ }}>+ <VStack gap={4} style={{padding: 'var(--spacing-4)'}}>+ <Heading level={3}>Edit profile</Heading>+ <Divider />+ <Text type="supporting" color="secondary">+ Focus fields throughout the form to see them remain visible above+ the mobile keyboard.+ </Text>+ <TextInput+ label="Name"+ value={values.name}+ onChange={update('name')}+ />+ <TextInput+ label="Email"+ type="email"+ value={values.email}+ onChange={update('email')}+ />+ <TextInput+ label="Company"+ value={values.company}+ onChange={update('company')}+ />+ <TextInput+ label="Role"+ value={values.role}+ onChange={update('role')}+ />+ <TextArea+ label="Bio"+ rows={5}+ value={values.bio}+ onChange={update('bio')}+ />+ <TextArea+ label="Notes"+ rows={5}+ value={values.notes}+ onChange={update('notes')}+ />+ <Button label="Save profile" type="submit" />+ </VStack>+ </form>+ </BottomSheet>+ </>+ );+}diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.doc.mjs b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.doc.mjsnew file mode 100644index 0000000000..ba98aca994--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.doc.mjs@@ -0,0 +1,22 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ exampleFor: 'BottomSheet',+ name: 'Bottom Sheet — No scrim',+ displayName: 'Bottom Sheet — No scrim',+ description:+ 'Keeps the page visible and interactive behind a non-modal bottom sheet.',+ isReady: true,+ aspectRatio: 3 / 4,+ componentsUsed: [+ 'BottomSheet',+ 'Button',+ 'Divider',+ 'Heading',+ 'Section',+ 'Stack',+ 'Text',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsxnew file mode 100644index 0000000000..1e16f3b1a4--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx@@ -0,0 +1,47 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++import {useState} from 'react';+import {BottomSheet} from '@astryxdesign/core/BottomSheet';+import {Button} from '@astryxdesign/core/Button';+import {Divider} from '@astryxdesign/core/Divider';+import {Heading} from '@astryxdesign/core/Heading';+import {Section} from '@astryxdesign/core/Section';+import {VStack} from '@astryxdesign/core/Stack';+import {Text} from '@astryxdesign/core/Text';++export default function BottomSheetNoScrim() {+ const [isOpen, setIsOpen] = useState(false);+ const [backgroundClicks, setBackgroundClicks] = useState(0);++ return (+ <Section padding={4}>+ <VStack gap={3}>+ <Heading level={3}>Nearby places</Heading>+ <Text type="body">Background interactions: {backgroundClicks}</Text>+ <Button+ label="Interact with page"+ variant="secondary"+ onClick={() => setBackgroundClicks(count => count + 1)}+ />+ <Button label="Show place details" onClick={() => setIsOpen(true)} />+ </VStack>+ <BottomSheet+ isOpen={isOpen}+ onOpenChange={setIsOpen}+ label="Place details"+ height="hug"+ hasScrim={false}>+ <VStack gap={4} style={{padding: 'var(--spacing-4)'}}>+ <Heading level={3}>Central Park</Heading>+ <Divider />+ <Text type="body">+ The page remains visible and interactive behind this sheet.+ </Text>+ <Button label="Close details" onClick={() => setIsOpen(false)} />+ </VStack>+ </BottomSheet>+ </Section>+ );+}diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.doc.mjsnew file mode 100644index 0000000000..b2e55d0eda--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.doc.mjs@@ -0,0 +1,22 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ exampleFor: 'BottomSheet',+ name: 'Bottom Sheet',+ displayName: 'Bottom Sheet',+ description: 'A mobile filter surface that rises from the bottom edge.',+ isReady: true,+ isShowcase: true,+ aspectRatio: 3 / 4,+ componentsUsed: [+ 'BottomSheet',+ 'Button',+ 'CheckboxInput',+ 'Divider',+ 'Heading',+ 'Section',+ 'Stack',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsx b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsxnew file mode 100644index 0000000000..8d6f62aa09--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsx@@ -0,0 +1,36 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++import {useState} from 'react';+import {BottomSheet} from '@astryxdesign/core/BottomSheet';+import {Button} from '@astryxdesign/core/Button';+import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';+import {Divider} from '@astryxdesign/core/Divider';+import {Heading} from '@astryxdesign/core/Heading';+import {Section} from '@astryxdesign/core/Section';+import {VStack} from '@astryxdesign/core/Stack';++export default function BottomSheetShowcase() {+ const [isOpen, setIsOpen] = useState(false);++ return (+ <>+ <Button label="Open sheet" onClick={() => setIsOpen(true)} />+ <BottomSheet isOpen={isOpen} onOpenChange={setIsOpen} label="Filters">+ <Section padding={4}>+ <VStack gap={4}>+ <Heading level={3}>Filters</Heading>+ <Divider />+ <VStack gap={2}>+ <CheckboxInput label="In stock" value={false} />+ <CheckboxInput label="On sale" value={false} />+ <CheckboxInput label="Free shipping" value={false} />+ </VStack>+ <Button label="Apply" onClick={() => setIsOpen(false)} />+ </VStack>+ </Section>+ </BottomSheet>+ </>+ );+}diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjsnew file mode 100644index 0000000000..878f6e9209--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.doc.mjs@@ -0,0 +1,26 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */+export const doc = {+ type: 'block',+ exampleFor: 'BottomSheetSwitcher',+ name: 'Bottom Sheet Switcher',+ displayName: 'Bottom Sheet Switcher',+ description:+ 'A three-step flow that transitions between content-hugging sheets of different heights inside one shared dialog.',+ isReady: true,+ isShowcase: true,+ aspectRatio: 3 / 4,+ componentsUsed: [+ 'BottomSheet',+ 'BottomSheetSwitcher',+ 'Button',+ 'CheckboxInput',+ 'Divider',+ 'Heading',+ 'RadioList',+ 'Section',+ 'Stack',+ 'Text',+ ],+};diff --git a/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsxnew file mode 100644index 0000000000..04ce77ea4a--- /dev/null+++ b/packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx@@ -0,0 +1,221 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++'use client';++import {useState} from 'react';+import {BottomSheet, BottomSheetSwitcher} from '@astryxdesign/core/BottomSheet';+import {Button} from '@astryxdesign/core/Button';+import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';+import {Divider} from '@astryxdesign/core/Divider';+import {Heading} from '@astryxdesign/core/Heading';+import {Section} from '@astryxdesign/core/Section';+import {HStack, VStack} from '@astryxdesign/core/Stack';+import {Text} from '@astryxdesign/core/Text';+import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';++type NotificationSheetHeight = 'hug' | 'capped';++interface NotificationOverviewSheetProps {+ height: NotificationSheetHeight;+ onCancel: () => void;+ onContinue: () => void;+}++function NotificationOverviewSheet({+ height,+ onCancel,+ onContinue,+}: NotificationOverviewSheetProps) {+ return (+ <BottomSheet+ sheetId="overview"+ label="Set up notifications"+ height={height}>+ <Section padding={4}>+ <VStack gap={4}>+ <VStack gap={1}>+ <Heading level={3}>Set up notifications</Heading>+ <Text type="supporting" color="secondary">+ Step 1 of 3+ </Text>+ </VStack>+ <Divider />+ <Text type="supporting" color="secondary">+ Stay informed about activity that matters without checking back+ throughout the day.+ </Text>+ <VStack gap={3}>+ <VStack gap={1}>+ <Text type="label">Important activity</Text>+ <Text type="supporting" color="secondary">+ Know when someone mentions you or needs your attention.+ </Text>+ </VStack>+ <VStack gap={1}>+ <Text type="label">Timely reminders</Text>+ <Text type="supporting" color="secondary">+ Get a reminder before work reaches its due date.+ </Text>+ </VStack>+ <VStack gap={1}>+ <Text type="label">Useful summaries</Text>+ <Text type="supporting" color="secondary">+ Catch up on anything you may have missed.+ </Text>+ </VStack>+ </VStack>+ <HStack gap={2} hAlign="end">+ <Button label="Cancel" variant="secondary" onClick={onCancel} />+ <Button label="Continue" onClick={onContinue} />+ </HStack>+ </VStack>+ </Section>+ </BottomSheet>+ );+}++interface NotificationFrequencySheetProps {+ height: NotificationSheetHeight;+ onBack: () => void;+ onContinue: () => void;+}++function NotificationFrequencySheet({+ height,+ onBack,+ onContinue,+}: NotificationFrequencySheetProps) {+ const [frequency, setFrequency] = useState('daily');++ return (+ <BottomSheet+ sheetId="frequency"+ label="Notification frequency"+ height={height}>+ <Section padding={4}>+ <VStack gap={4}>+ <VStack gap={1}>+ <Heading level={3}>How often?</Heading>+ <Text type="supporting" color="secondary">+ Step 2 of 3+ </Text>+ </VStack>+ <Divider />+ <RadioList+ label="Notification frequency"+ isLabelHidden+ value={frequency}+ onChange={setFrequency}>+ <RadioListItem label="Immediately" value="immediately" />+ <RadioListItem label="Daily" value="daily" />+ <RadioListItem label="Weekly" value="weekly" />+ </RadioList>+ <HStack gap={2} hAlign="end">+ <Button label="Back" variant="secondary" onClick={onBack} />+ <Button label="Continue" onClick={onContinue} />+ </HStack>+ </VStack>+ </Section>+ </BottomSheet>+ );+}++interface NotificationChannelsSheetProps {+ height: NotificationSheetHeight;+ onBack: () => void;+ onFinish: () => void;+}++function NotificationChannelsSheet({+ height,+ onBack,+ onFinish,+}: NotificationChannelsSheetProps) {+ const [email, setEmail] = useState(true);+ const [pushNotifications, setPushNotifications] = useState(true);+ const [textMessages, setTextMessages] = useState(false);++ return (+ <BottomSheet+ sheetId="channels"+ label="Notification channels"+ height={height}>+ <Section padding={4}>+ <VStack gap={4}>+ <VStack gap={1}>+ <Heading level={3}>Where should we notify you?</Heading>+ <Text type="supporting" color="secondary">+ Step 3 of 3+ </Text>+ </VStack>+ <Divider />+ <Text type="supporting" color="secondary">+ Choose any combination. You can change these preferences later.+ </Text>+ <VStack gap={2}>+ <CheckboxInput label="Email" value={email} onChange={setEmail} />+ <CheckboxInput+ label="Push notifications"+ value={pushNotifications}+ onChange={setPushNotifications}+ />+ <CheckboxInput+ label="Text messages"+ value={textMessages}+ onChange={setTextMessages}+ />+ </VStack>+ <HStack gap={2} hAlign="end">+ <Button label="Back" variant="secondary" onClick={onBack} />+ <Button label="Finish" onClick={onFinish} />+ </HStack>+ </VStack>+ </Section>+ </BottomSheet>+ );+}++interface MultiStepSwitcherExampleProps {+ height: NotificationSheetHeight;+ hasScrim?: boolean;+}++function MultiStepSwitcherExample({+ height,+ hasScrim = true,+}: MultiStepSwitcherExampleProps) {+ const [activeSheet, setActiveSheet] = useState<string | null>(null);++ return (+ <>+ <Button+ label="Set up notifications"+ onClick={() => setActiveSheet('overview')}+ />+ <BottomSheetSwitcher+ activeSheet={activeSheet}+ onActiveSheetChange={setActiveSheet}+ hasScrim={hasScrim}>+ <NotificationOverviewSheet+ height={height}+ onCancel={() => setActiveSheet(null)}+ onContinue={() => setActiveSheet('frequency')}+ />+ <NotificationFrequencySheet+ height={height}+ onBack={() => setActiveSheet('overview')}+ onContinue={() => setActiveSheet('channels')}+ />+ <NotificationChannelsSheet+ height={height}+ onBack={() => setActiveSheet('frequency')}+ onFinish={() => setActiveSheet(null)}+ />+ </BottomSheetSwitcher>+ </>+ );+}++export default function BottomSheetSwitcherShowcase() {+ return <MultiStepSwitcherExample height="hug" />;+}diff --git a/packages/cli/authoring/doctypes/base/type.ts b/packages/cli/authoring/doctypes/base/type.tsindex 40be6870b3..71b7d18180 100644--- a/packages/cli/authoring/doctypes/base/type.ts+++ b/packages/cli/authoring/doctypes/base/type.ts@@ -117,6 +117,15 @@ export interface ComponentPlaygroundConfig {* the component is visible on load and knobs stay usable, whereas a real* top-layer modal makes the rest of the page inert (#3657). */overlay?: boolean;+ /** Override the controlled prop and open value used by an overlay preview.+ * Use with `overlay: true` when the component does not use `isOpen: true`+ * to represent its open state. */+ overlayControl?: {+ /** Controlled prop that determines whether the overlay is open. */+ stateProp: string;+ /** Value assigned to stateProp when the preview's open button is used. */+ openValue: unknown;+ };/** The component reads AppShell mobile context and renders nothing* without it (e.g. `MobileNavToggle` returns null unless the context* reports an enabled mobile viewport — the default value outsidediff --git a/packages/core/package.json b/packages/core/package.jsonindex 76e473459a..52a43404c0 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -119,6 +119,11 @@"types": "./dist/Blockquote/index.d.ts","default": "./dist/Blockquote/index.js"},+ "./BottomSheet": {+ "source": "./src/BottomSheet/index.ts",+ "types": "./dist/BottomSheet/index.d.ts",+ "default": "./dist/BottomSheet/index.js"+ },"./Breadcrumbs": {"source": "./src/Breadcrumbs/index.ts","types": "./dist/Breadcrumbs/index.d.ts",diff --git a/packages/lab/src/BottomSheet/BottomSheet.doc.mjs b/packages/core/src/BottomSheet/BottomSheet.doc.mjssimilarity index 100%rename from packages/lab/src/BottomSheet/BottomSheet.doc.mjsrename to packages/core/src/BottomSheet/BottomSheet.doc.mjsdiff --git a/packages/lab/src/BottomSheet/BottomSheet.test.tsx b/packages/core/src/BottomSheet/BottomSheet.test.tsxsimilarity index 99%rename from packages/lab/src/BottomSheet/BottomSheet.test.tsxrename to packages/core/src/BottomSheet/BottomSheet.test.tsxindex 5b501c7529..bda975572f 100644--- a/packages/lab/src/BottomSheet/BottomSheet.test.tsx+++ b/packages/core/src/BottomSheet/BottomSheet.test.tsx@@ -4,7 +4,7 @@* @file BottomSheet.test.tsx* @input Uses vitest, @testing-library/react, BottomSheet component* @output Unit tests for BottomSheet component behavior- * @position Lab testing; validates BottomSheet.tsx implementation+ * @position Core testing; validates BottomSheet.tsx implementation** SYNC: When BottomSheet.tsx changes, update tests to match new behavior*/@@ -103,10 +103,13 @@ function resizeEntry(borderBoxHeight: number,contentBoxHeight = borderBoxHeight,): ResizeObserverEntry {- return {+ // Core typechecks its tests, so this partial stands in for the full entry+ // the way sharedResizeObserver does: only the fields the sheet reads.+ const entry: Partial<ResizeObserverEntry> = {borderBoxSize: [{blockSize: borderBoxHeight, inlineSize: 100}],contentRect: rect({top: 0, bottom: contentBoxHeight}),- } as ResizeObserverEntry;+ };+ return entry as ResizeObserverEntry;}function mockVisualViewport(height: number, offsetTop = 0) {diff --git a/packages/lab/src/BottomSheet/BottomSheet.tsx b/packages/core/src/BottomSheet/BottomSheet.tsxsimilarity index 92%rename from packages/lab/src/BottomSheet/BottomSheet.tsxrename to packages/core/src/BottomSheet/BottomSheet.tsxindex ee8ece4b5c..b42df381c7 100644--- a/packages/lab/src/BottomSheet/BottomSheet.tsx+++ b/packages/core/src/BottomSheet/BottomSheet.tsx@@ -15,12 +15,13 @@* motion completion.** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/BottomSheet/BottomSheetPanel.tsx- * - /packages/lab/src/BottomSheet/BottomSheet.doc.mjs- * - /packages/lab/src/BottomSheet/BottomSheet.test.tsx- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.tsx- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx+ * - /packages/core/src/BottomSheet/BottomSheetPanel.tsx+ * - /packages/core/src/BottomSheet/BottomSheet.doc.mjs+ * - /packages/core/src/BottomSheet/BottomSheet.test.tsx+ * - /packages/core/src/BottomSheet/BottomSheetSwitcher.tsx+ * - /packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx* - /apps/storybook/stories/BottomSheet.stories.tsx+ * - /packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetShowcase.tsx*/import {@@ -33,14 +34,10 @@ import {type ReactNode,} from 'react';import * as stylex from '@stylexjs/stylex';-import type {BaseProps} from '@astryxdesign/core';-import type {DialogPurpose} from '@astryxdesign/core/Dialog';-import {- colorVars,- durationVars,- easeVars,-} from '@astryxdesign/core/theme/tokens.stylex';-import {useDevWarning, useScrollLock} from '@astryxdesign/core/hooks';+import type {BaseProps} from '../BaseProps';+import type {DialogPurpose} from '../Dialog';+import {colorVars, durationVars, easeVars} from '../theme/tokens.stylex';+import {useDevWarning, useScrollLock} from '../hooks';import {BottomSheetPanel,type BottomSheetPanelMotion,@@ -237,6 +234,9 @@ function StandaloneBottomSheet({return;}+ // The controlled prop opens an already-mounted dialog; presentation state+ // must latch here so a later close can keep it mounted through its exit.+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- latches controlled open state for exit animationsetIsPresented(true);dialog.style.setProperty('--_sheet-scrim-opacity', '1');const wasOpen = dialog.open;@@ -329,7 +329,7 @@ function StandaloneBottomSheet({ref={ref}state={panelState}height={height}- canSwipeDismiss={purpose === 'info'}+ isSwipeDismissAllowed={purpose === 'info'}xstyle={xstyle}onDismiss={dismissOnLightInteraction}onScrimOpacity={handleScrimOpacity}@@ -483,7 +483,7 @@ function SwitcherBottomSheetItem({ref={ref}state={panelState}height={height}- canSwipeDismiss={purpose === 'info'}+ isSwipeDismissAllowed={purpose === 'info'}xstyle={xstyle}onDismiss={dismissOnSwipe}onScrimOpacity={handleScrimOpacity}@@ -493,6 +493,7 @@ function SwitcherBottomSheetItem({{/* A switcher item consumes its parent controller. Its content starts afresh ownership scope so a nested BottomSheet is standalone unlessit establishes a nested BottomSheetSwitcher of its own. */}+ {/* eslint-disable-next-line @eslint-react/no-context-provider -- preserve the promoted Lab implementation */}<BottomSheetSwitcherContext.Provider value={null}>{children}</BottomSheetSwitcherContext.Provider>@@ -506,6 +507,7 @@ function SwitcherBottomSheetItem({* BottomSheetSwitcher shared dialog when given a sheetId inside that context.*/export function BottomSheet(props: BottomSheetProps) {+ // eslint-disable-next-line @eslint-react/no-use-context -- preserve the promoted Lab implementationconst switcher = useContext(BottomSheetSwitcherContext);const runtimeSheetId = (props as {sheetId?: string}).sheetId;const hasValidSheetId =diff --git a/packages/lab/src/BottomSheet/BottomSheetPanel.test.tsx b/packages/core/src/BottomSheet/BottomSheetPanel.test.tsxsimilarity index 100%rename from packages/lab/src/BottomSheet/BottomSheetPanel.test.tsxrename to packages/core/src/BottomSheet/BottomSheetPanel.test.tsxdiff --git a/packages/lab/src/BottomSheet/BottomSheetPanel.tsx b/packages/core/src/BottomSheet/BottomSheetPanel.tsxsimilarity index 95%rename from packages/lab/src/BottomSheet/BottomSheetPanel.tsxrename to packages/core/src/BottomSheet/BottomSheetPanel.tsxindex 25a8f8d8b4..6cb04f51e4 100644--- a/packages/lab/src/BottomSheet/BottomSheetPanel.tsx+++ b/packages/core/src/BottomSheet/BottomSheetPanel.tsx@@ -14,9 +14,9 @@* state, or switcher registration; those belong to the hosting controller.** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/BottomSheet/BottomSheet.tsx- * - /packages/lab/src/BottomSheet/BottomSheetPanel.test.tsx- * - /packages/lab/src/BottomSheet/useSheetGestures.ts+ * - /packages/core/src/BottomSheet/BottomSheet.tsx+ * - /packages/core/src/BottomSheet/BottomSheetPanel.test.tsx+ * - /packages/core/src/BottomSheet/useSheetGestures.ts*/import {@@ -28,7 +28,7 @@ import {type ReactNode,} from 'react';import * as stylex from '@stylexjs/stylex';-import type {BaseProps} from '@astryxdesign/core';+import type {BaseProps} from '../BaseProps';import {colorVars,durationVars,@@ -37,8 +37,8 @@ import {shadowVars,sizeVars,spacingVars,-} from '@astryxdesign/core/theme/tokens.stylex';-import {mergeProps, themeProps} from '@astryxdesign/core/utils';+} from '../theme/tokens.stylex';+import {mergeProps, themeProps} from '../utils';import {useMobileKeyboard} from './useMobileKeyboard';import {useSheetGestures} from './useSheetGestures';@@ -165,7 +165,7 @@ interface BottomSheetPanelProps extends BaseProps<HTMLDivElement> {state: BottomSheetPanelState;height: BottomSheetHeight | number | string;children: ReactNode;- canSwipeDismiss?: boolean;+ isSwipeDismissAllowed?: boolean;onDismiss: () => void;onScrimOpacity: (opacity: number) => void;onElementChange?: (element: HTMLDivElement | null) => void;@@ -292,7 +292,7 @@ export function BottomSheetPanel({style,tabIndex,xstyle,- canSwipeDismiss = true,+ isSwipeDismissAllowed = true,onDismiss,onScrimOpacity,onElementChange,@@ -347,7 +347,7 @@ export function BottomSheetPanel({completeScrollAreaSettle,} = useSheetGestures({isOpen: isInteractive,- canDismiss: canSwipeDismiss,+ canDismiss: isSwipeDismissAllowed,offscreenBlockEndInset: OVERSCROLL_PADDING,onDismiss,snapHeights: defaultSnapHeights,@@ -367,6 +367,7 @@ export function BottomSheetPanel({bodyProps.ref(element);bodyElementRef.current = element;},+ // eslint-disable-next-line @eslint-react/exhaustive-deps -- preserve the promoted Lab implementation[bodyProps.ref],);useMobileKeyboard({@@ -525,16 +526,16 @@ export function BottomSheetPanel({<div {...stylex.props(styles.handlePill)} /></div><div- {...stylex.props(- styles.body,- height === 'tall' && styles.tallKeyboardBody,+ {...mergeProps(+ stylex.props(+ styles.body,+ height === 'tall' && styles.tallKeyboardBody,+ ),+ scrollPreservationInset > 0+ ? {style: {paddingBlockEnd: `${scrollPreservationInset}px`}}+ : {},)}{...bodyProps}- style={- scrollPreservationInset > 0- ? {paddingBlockEnd: `${scrollPreservationInset}px`}- : undefined- }ref={setBodyElement}>{children}</div>diff --git a/packages/lab/src/BottomSheet/BottomSheetSwitcher.doc.mjs b/packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjssimilarity index 60%rename from packages/lab/src/BottomSheet/BottomSheetSwitcher.doc.mjsrename to packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjsindex dda74fece6..ad0ccc9164 100644--- a/packages/lab/src/BottomSheet/BottomSheetSwitcher.doc.mjs+++ b/packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjs@@ -7,6 +7,118 @@ export const docs = {group: 'BottomSheet',category: 'Overlay',keywords: ['bottom sheet', 'switcher', 'multi-step', 'flow', 'wizard'],+ playground: {+ overlay: true,+ overlayControl: {+ stateProp: 'activeSheet',+ openValue: 'details',+ },+ defaults: {+ activeSheet: null,+ children: [+ {+ __element: 'BottomSheet',+ props: {+ sheetId: 'details',+ label: 'Setup details',+ height: 'hug',+ },+ children: {+ __element: 'Section',+ props: {padding: 4},+ children: {+ __element: 'VStack',+ props: {gap: 2},+ children: [+ {+ __element: 'Heading',+ props: {level: 3},+ children: 'Setup details',+ },+ {+ __element: 'Text',+ props: {type: 'body'},+ children: 'Add the essential information for this setup.',+ },+ {+ __element: 'Text',+ props: {type: 'supporting'},+ children: 'You can review these details before saving.',+ },+ ],+ },+ },+ },+ {+ __element: 'BottomSheet',+ props: {+ sheetId: 'preferences',+ label: 'Choose preferences',+ height: 'hug',+ },+ children: {+ __element: 'Section',+ props: {padding: 4},+ children: {+ __element: 'VStack',+ props: {gap: 2},+ children: [+ {+ __element: 'Heading',+ props: {level: 3},+ children: 'Choose preferences',+ },+ {+ __element: 'Text',+ props: {type: 'body'},+ children: 'Select how this setup should behave.',+ },+ {+ __element: 'Text',+ props: {type: 'supporting'},+ children:+ 'Notifications can be sent immediately, daily, or weekly.',+ },+ {+ __element: 'Text',+ props: {type: 'supporting'},+ children: 'You can update these preferences later.',+ },+ ],+ },+ },+ },+ {+ __element: 'BottomSheet',+ props: {+ sheetId: 'confirm',+ label: 'Confirm setup',+ height: 'hug',+ },+ children: {+ __element: 'Section',+ props: {padding: 4},+ children: {+ __element: 'VStack',+ props: {gap: 2},+ children: [+ {+ __element: 'Heading',+ props: {level: 3},+ children: 'Confirm setup',+ },+ {+ __element: 'Text',+ props: {type: 'body'},+ children: 'Everything is ready to save.',+ },+ ],+ },+ },+ },+ ],+ },+ },description:'Coordinates multiple BottomSheets as a mutually exclusive flow. One activeSheet ID selects the only interactive sheet; during a handoff, the new sheet enters above the inert previous sheet. If the new sheet is shorter, the previous sheet simultaneously moves down until their top edges align, then fades after both transforms complete. The switcher owns one shared native <dialog>: modal flows call showModal() once for one top-layer boundary and one ::backdrop across the whole flow, while no-scrim flows use a non-modal show() shell. Its ref and shared DOM props target that dialog.',props: [diff --git a/packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx b/packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsxsimilarity index 99%rename from packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsxrename to packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsxindex 9a2a556c57..ecb53f7f81 100644--- a/packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx+++ b/packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx@@ -4,7 +4,7 @@* @file BottomSheetSwitcher.test.tsx* @input Uses vitest, Testing Library, BottomSheet, BottomSheetSwitcher* @output Tests mutually exclusive sheet selection, dismissal, and focus handoff- * @position Lab tests for BottomSheetSwitcher+ * @position Core tests for BottomSheetSwitcher** SYNC: When BottomSheetSwitcher.tsx or its BottomSheet integration changes,* update these tests to match the public behavior.@@ -13,7 +13,7 @@import {fireEvent, render, screen} from '@testing-library/react';import {createRef, useState} from 'react';import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';-import {useFocusTrap} from '@astryxdesign/core/hooks';+import {useFocusTrap} from '../hooks';import {BottomSheet} from './BottomSheet';import {BottomSheetSwitcher} from './BottomSheetSwitcher';diff --git a/packages/lab/src/BottomSheet/BottomSheetSwitcher.tsx b/packages/core/src/BottomSheet/BottomSheetSwitcher.tsxsimilarity index 95%rename from packages/lab/src/BottomSheet/BottomSheetSwitcher.tsxrename to packages/core/src/BottomSheet/BottomSheetSwitcher.tsxindex 37d85e7774..7e22ed032c 100644--- a/packages/lab/src/BottomSheet/BottomSheetSwitcher.tsx+++ b/packages/core/src/BottomSheet/BottomSheetSwitcher.tsx@@ -6,7 +6,7 @@* @file BottomSheetSwitcher.tsx* @input Uses React context, StyleX, theme tokens, focus/scroll-lock hooks, BottomSheetSwitcherContext* @output Exports BottomSheetSwitcher and BottomSheetSwitcherProps- * @position Lab switcher for mutually exclusive BottomSheet flows+ * @position Core switcher for mutually exclusive BottomSheet flows** The switcher turns a set of declaratively nested BottomSheets into a* controlled single-selection group: `activeSheet` names the one interactive@@ -21,11 +21,12 @@* This keeps one modal boundary and one native ::backdrop without a portal.** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/BottomSheet/BottomSheet.tsx- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.doc.mjs- * - /packages/lab/src/BottomSheet/BottomSheetSwitcher.test.tsx- * - /packages/lab/src/BottomSheet/index.ts+ * - /packages/core/src/BottomSheet/BottomSheet.tsx+ * - /packages/core/src/BottomSheet/BottomSheetSwitcher.doc.mjs+ * - /packages/core/src/BottomSheet/BottomSheetSwitcher.test.tsx+ * - /packages/core/src/BottomSheet/index.ts* - /apps/storybook/stories/BottomSheetSwitcher.stories.tsx+ * - /packages/cli/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherShowcase.tsx*/import {@@ -40,24 +41,20 @@ import {type SyntheticEvent,} from 'react';import * as stylex from '@stylexjs/stylex';-import type {BaseProps} from '@astryxdesign/core';-import type {DialogPurpose} from '@astryxdesign/core/Dialog';-import {- colorVars,- durationVars,- easeVars,-} from '@astryxdesign/core/theme/tokens.stylex';+import type {BaseProps} from '../BaseProps';+import type {DialogPurpose} from '../Dialog';+import {colorVars, durationVars, easeVars} from '../theme/tokens.stylex';import {hasActiveFocusTrapEscape,isImeKeyEvent,useFocusTrap,useScrollLock,-} from '@astryxdesign/core/hooks';+} from '../hooks';import {composeEventHandlers,mergeProps,mergeRefs,-} from '@astryxdesign/core/utils';+} from '../utils';import {BottomSheetSwitcherContext,type BottomSheetSwitcherContextValue,@@ -424,6 +421,7 @@ export function BottomSheetSwitcher({);useLayoutEffect(() => {+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- clear a retained sheet after its panel unmountssetTransition(current =>current.retainedSheet != null &&unmountedSheetIds.has(current.retainedSheet)@@ -612,6 +610,7 @@ export function BottomSheetSwitcher({(props['aria-labelledby'] == null ? activeLabel : undefined);return (+ // eslint-disable-next-line @eslint-react/no-context-provider -- preserve the promoted Lab implementation<BottomSheetSwitcherContext.Provider value={contextValue}><dialog{...props}diff --git a/packages/lab/src/BottomSheet/BottomSheetSwitcherContext.ts b/packages/core/src/BottomSheet/BottomSheetSwitcherContext.tssimilarity index 96%rename from packages/lab/src/BottomSheet/BottomSheetSwitcherContext.tsrename to packages/core/src/BottomSheet/BottomSheetSwitcherContext.tsindex e6399fa3ad..e34f3c910d 100644--- a/packages/lab/src/BottomSheet/BottomSheetSwitcherContext.ts+++ b/packages/core/src/BottomSheet/BottomSheetSwitcherContext.ts@@ -10,7 +10,7 @@*/import {createContext} from 'react';-import type {DialogPurpose} from '@astryxdesign/core/Dialog';+import type {DialogPurpose} from '../Dialog';export type BottomSheetSwitcherPhase =| 'entering'diff --git a/packages/lab/src/BottomSheet/index.ts b/packages/core/src/BottomSheet/index.tssimilarity index 84%rename from packages/lab/src/BottomSheet/index.tsrename to packages/core/src/BottomSheet/index.tsindex f464c5eff2..74ac7d0d93 100644--- a/packages/lab/src/BottomSheet/index.ts+++ b/packages/core/src/BottomSheet/index.ts@@ -6,7 +6,7 @@* @file index.ts* @input BottomSheet.tsx, BottomSheetSwitcher.tsx* @output Re-exports the BottomSheet public API- * @position Lab entry point for the BottomSheet directory+ * @position Component entry point; re-exported by /packages/core/src/index.ts*/export {BottomSheet} from './BottomSheet';diff --git a/packages/lab/src/BottomSheet/snapOffsets.test.ts b/packages/core/src/BottomSheet/snapOffsets.test.tssimilarity index 100%rename from packages/lab/src/BottomSheet/snapOffsets.test.tsrename to packages/core/src/BottomSheet/snapOffsets.test.tsdiff --git a/packages/lab/src/BottomSheet/snapOffsets.ts b/packages/core/src/BottomSheet/snapOffsets.tssimilarity index 100%rename from packages/lab/src/BottomSheet/snapOffsets.tsrename to packages/core/src/BottomSheet/snapOffsets.tsdiff --git a/packages/lab/src/BottomSheet/useMobileKeyboard.ts b/packages/core/src/BottomSheet/useMobileKeyboard.tssimilarity index 99%rename from packages/lab/src/BottomSheet/useMobileKeyboard.tsrename to packages/core/src/BottomSheet/useMobileKeyboard.tsindex c93fc872b6..dfc9800d81 100644--- a/packages/lab/src/BottomSheet/useMobileKeyboard.ts+++ b/packages/core/src/BottomSheet/useMobileKeyboard.ts@@ -6,7 +6,7 @@* @file useMobileKeyboard.ts* @input Uses React effects and refs supplied by BottomSheet* @output Exports internal useMobileKeyboard hook- * @position Internal to BottomSheet; not exported from the lab entry point+ * @position Internal to BottomSheet; not exported from the core entry point** Gives a fully expanded, explicitly Tall sheet a keyboard-aware internal* scroll range while leaving the sheet itself stationary. Shorter detents anddiff --git a/packages/lab/src/BottomSheet/useSheetGestures.test.ts b/packages/core/src/BottomSheet/useSheetGestures.test.tssimilarity index 100%rename from packages/lab/src/BottomSheet/useSheetGestures.test.tsrename to packages/core/src/BottomSheet/useSheetGestures.test.tsdiff --git a/packages/lab/src/BottomSheet/useSheetGestures.ts b/packages/core/src/BottomSheet/useSheetGestures.tssimilarity index 97%rename from packages/lab/src/BottomSheet/useSheetGestures.tsrename to packages/core/src/BottomSheet/useSheetGestures.tsindex 45f74958fb..dda51a7fb4 100644--- a/packages/lab/src/BottomSheet/useSheetGestures.ts+++ b/packages/core/src/BottomSheet/useSheetGestures.ts@@ -6,7 +6,7 @@* @file useSheetGestures.ts* @input Uses React (useCallback, useEffect, useMemo, useRef, useState)* @output Exports useSheetGestures hook and its option/result types- * @position Internal to BottomSheet; not exported from the lab entry point+ * @position Internal to BottomSheet; not exported from the core entry point** Drag + snap machinery for the bottom sheet. Tracks a pointer drag down the* block axis, translates the sliding surface live, and on release either@@ -30,8 +30,7 @@* settle transition.** SYNC: When modified, update these files to stay in sync:- * - /packages/lab/src/BottomSheet/useSheetGestures.doc.mjs- * - /packages/lab/src/BottomSheet/useSheetGestures.test.ts+ * - /packages/core/src/BottomSheet/useSheetGestures.test.ts*/import {@@ -297,6 +296,7 @@ export function useSheetGestures({const recordSettledLayoutOffset = useCallback((offset: number) => {const normalizedOffset = Math.max(0, offset);settledLayoutOffsetRef.current = normalizedOffset;+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- layout offset is recorded from measurement effectssetSettledLayoutOffset(normalizedOffset);}, []);const updateScrollPreservationInset = useCallback((nextInset: number) => {@@ -465,15 +465,21 @@ export function useSheetGestures({// Reset to the tallest detent each time the sheet re-opens.useEffect(() => {if (isOpen) {+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetDragOffset(0);+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetSettledOffset(0);+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetIsDragging(false);+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetIsScrollAreaReconciling(false);recordSettledLayoutOffset(0);scrollPreservationInsetRef.current = 0;settlingLayoutOffsetRef.current = null;pendingScrollPreservationInsetRef.current = null;+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetScrollPreservationInset(0);+ // eslint-disable-next-line @eslint-react/set-state-in-effect -- resets gesture state on controlled reopensetSettlingLayoutOffset(null);}}, [isOpen, recordSettledLayoutOffset]);@@ -1060,6 +1066,7 @@ export function useSheetGestures({}}, []);+ // eslint-disable-next-line @eslint-react/exhaustive-deps -- re-read the preference whenever the sheet opensconst reducedMotion = useMemo(() => prefersReducedMotion(), [isOpen]);const reconcileScrollPreservationInset = useCallback(diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 9fafdc9550..0d4ac73e5b 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -22,6 +22,7 @@ export * from './AvatarGroup';export * from './Badge';export * from './Banner';export * from './Blockquote';+export * from './BottomSheet';export * from './Breadcrumbs';export * from './Button';export * from './ButtonGroup';diff --git a/packages/lab/src/index.ts b/packages/lab/src/index.tsindex ef7c62cc41..f1006413d0 100644--- a/packages/lab/src/index.ts+++ b/packages/lab/src/index.ts@@ -45,15 +45,6 @@ export * from './Chat';// Drawer — experimental overlay panelexport {Drawer, type DrawerProps} from './Drawer';-// BottomSheet — mobile touch sheet on a native modal <dialog>-export {- BottomSheet,- type BottomSheetHeight,- type BottomSheetProps,- BottomSheetSwitcher,- type BottomSheetSwitcherProps,-} from './BottomSheet';-// Tour — guided product-tour / NUX walkthrough (facebook/astryx#4239)export {Tour,