Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs): contained layer tokens #17215

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 113 additions & 88 deletions packages/react/src/components/Tabs/Tabs.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import RadioButtonGroup from '../RadioButtonGroup';
import RadioButton from '../RadioButton';
import { Stack } from '../Stack';
import { Grid, Column } from '../Grid';
import { Layer } from '../Layer';
import mdx from './Tabs.mdx';

import TabsSkeleton from './Tabs.Skeleton';
Expand Down Expand Up @@ -374,20 +375,22 @@ export const Contained = () => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand All @@ -410,20 +413,22 @@ export const ContainedWithIcons = () => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand All @@ -446,20 +451,22 @@ export const ContainedWithSecondaryLabels = () => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand Down Expand Up @@ -490,20 +497,22 @@ export const ContainedWithSecondaryLabelsAndIcons = () => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand All @@ -529,20 +538,22 @@ export const ContainedFullWidth = () => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<legend className={`cds--label`}>Validation example</legend>
<Checkbox id="cb" labelText="Accept privacy policy" />
<Button
style={{ marginTop: '1rem', marginBottom: '1rem' }}
type="submit">
Submit
</Button>
<TextInput
type="text"
labelText="Text input label"
helperText="Optional help text"
/>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand Down Expand Up @@ -573,24 +584,38 @@ export const Vertical = ({ ...args }) => (
<TabPanels>
<TabPanel>Tab Panel 1</TabPanel>
<TabPanel>
<form style={{ margin: '2em' }}>
<Stack gap={7}>
<TextInput id="one" labelText="First Name" />
<TextInput id="three" labelText="Middle Initial" />
<TextInput id="two" labelText="Last Name" />
<RadioButtonGroup
legendText="Radio button heading"
name="formgroup-default-radio-button-group"
defaultSelected="radio-1">
<RadioButton labelText="Option 1" value="radio-1" id="radio-1" />
<RadioButton labelText="Option 2" value="radio-2" id="radio-2" />
<RadioButton labelText="Option 3" value="radio-3" id="radio-3" />
</RadioButtonGroup>
<Checkbox labelText={`Checkbox one`} id="checkbox-label-1" />
<Checkbox labelText={`Checkbox two`} id="checkbox-label-2" />
<Button>Submit</Button>
</Stack>
</form>
<Layer>
<form style={{ margin: '2em' }}>
<Stack gap={7}>
<TextInput id="one" labelText="First Name" />
<TextInput id="three" labelText="Middle Initial" />
<TextInput id="two" labelText="Last Name" />
<RadioButtonGroup
legendText="Radio button heading"
name="formgroup-default-radio-button-group"
defaultSelected="radio-1">
<RadioButton
labelText="Option 1"
value="radio-1"
id="radio-1"
/>
<RadioButton
labelText="Option 2"
value="radio-2"
id="radio-2"
/>
<RadioButton
labelText="Option 3"
value="radio-3"
id="radio-3"
/>
</RadioButtonGroup>
<Checkbox labelText={`Checkbox one`} id="checkbox-label-1" />
<Checkbox labelText={`Checkbox two`} id="checkbox-label-2" />
<Button>Submit</Button>
</Stack>
</form>
</Layer>
</TabPanel>
<TabPanel>Tab Panel 3</TabPanel>
<TabPanel>Tab Panel 4</TabPanel>
Expand Down
4 changes: 0 additions & 4 deletions packages/styles/scss/components/tabs/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,6 @@

.#{$prefix}--tabs--contained ~ .#{$prefix}--tab-content {
background: $layer;

> * {
@include layer-tokens.emit-layer-tokens(2);
}
}

.#{$prefix}--tabs--vertical ~ .#{$prefix}--tab-content {
Expand Down
Loading