import React from 'react'; import { Tearsheet } from '@carbon/ibm-products'; import { Button, Form, FormGroup, TextInput } from '@carbon/react'; // Test 1: Simple Tearsheet with title and actions function SimpleTearsheet() { return ( {}} title="Simple Tearsheet" label="Customer data" actions={[ { label: 'Cancel', onClick: () => {} }, { label: 'Submit', onClick: () => {} }, ]}>
); } // Test 2: Tearsheet with influencer function TearsheetWithInfluencer() { return ( {}} title="With Influencer" label="Data" description="This is a description" influencer={
Influencer content
} influencerWidth="narrow">
Main content
); } // Test 3: Tearsheet with navigation function TearsheetWithNavigation() { return ( {}} title="With Navigation" navigation={
Navigation tabs
} actions={[{ label: 'Close', onClick: () => {} }]}>
Content
); } // Test 4: Tearsheet with headerActions function TearsheetWithHeaderActions() { return ( {}} title="With Header Actions" label="Label" headerActions={}>
Content
); } // Test 5: Tearsheet with deprecated slug prop function TearsheetWithSlug() { return ( {}} title="With Slug" slug={
Slug content
}>
Content
); } // Test 6: Tearsheet with all features function CompleteTearsheet() { return ( {}} title="Complete Tearsheet" label="All features" description="This has everything" decorator={
Decorator
} influencer={
Influencer
} influencerWidth="wide" navigation={
Navigation
} headerActions={} actions={[ { label: 'Cancel', onClick: () => {} }, { label: 'Submit', onClick: () => {} }, ]} preventCloseOnClickOutside={true} variant="wide">
); } // Test 7: Minimal Tearsheet (no header props) function MinimalTearsheet() { return ( {}}>
Just content
); } // Test 8: Tearsheet with deprecated influencerPosition (should be removed) function TearsheetWithInfluencerPosition() { return ( {}} title="Test" influencer={
Influencer
} influencerPosition="left">
Content
); } // Test 9: Stacked Tearsheets (multiple tearsheets) function StackedTearsheets() { const [open1, setOpen1] = React.useState(false); const [open2, setOpen2] = React.useState(false); return ( <> setOpen1(false)} title="Tearsheet 1" label="First" actions={[{ label: 'Close', onClick: () => setOpen1(false) }]}>
Content 1
setOpen2(false)} title="Tearsheet 2" label="Second" actions={[{ label: 'Close', onClick: () => setOpen2(false) }]}>
Content 2
); } // Test 10: Tearsheet with spread props function TearsheetWithSpreadProps() { const commonProps = { open: true, onClose: () => {}, variant: 'wide', }; return (
Content
); } // Test 11: Tearsheet with complex children function TearsheetWithComplexChildren() { return ( {}} title="Complex Children" actions={[{ label: 'Submit', onClick: () => {} }]}>
); } // Test 12: Tearsheet with only decorator (no other header props) function TearsheetWithOnlyDecorator() { return ( {}} decorator={
Decorator
}>
Content
); }