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

chore: sync v11 branch with main #2344

Merged
merged 8 commits into from
May 26, 2021
Prev Previous commit
Next Next commit
add button variants to live modal preivew (#2299)
* docs(Modal): update modal live preview

* docs(Modal): add solo button example to code docs

* docs(Modal): update action handler

Co-authored-by: Josefina Mancilla <32556167+jnm2377@users.noreply.github.com>
Co-authored-by: TJ Egan <tw15egan@gmail.com>
Co-authored-by: Andrea N. Cardona <andreancardona@gmail.com>
  • Loading branch information
4 people authored and emyarod committed May 25, 2021
commit 6c6b23ec802f5eaa9ab085cd6dd8295ae8f1a419
59 changes: 59 additions & 0 deletions src/pages/components/modal/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ documentation, see the Storybooks for each framework below.
id: 'scrolling-content',
label: 'With scrolling content',
},
{
id: 'with-one-button',
label: 'With one button',
},
{
id: 'with-three-buttons',
label: 'With three buttons',
},
]}>
<ComponentVariant
id="modal"
Expand Down Expand Up @@ -128,5 +136,56 @@ documentation, see the Storybooks for each framework below.
</p>
</>
</ModalWrapper>
`}</ComponentVariant>
<ComponentVariant
id="with-one-button"
links={{
React:
'https://react.carbondesignsystem.com/?path=/story/components-modal--default',
Angular:
'https://angular.carbondesignsystem.com/?path=/story/components-modal--basic',
Vue:
'http://vue.carbondesignsystem.com/?path=/story/components-cvmodal--default',
Vanilla: 'https://the-carbon-components.netlify.com/?nav=modal',
}}>{`
<ModalWrapper
buttonTriggerText="Launch modal"
modalHeading="Modal heading"
modalLabel="Label"
secondaryButtonText={null}
>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse cursus fermentum risus, sit amet fringilla nunc pellentesque quis. Duis quis odio ultrices, cursus lacus ac, posuere felis. Donec dignissim libero in augue mattis, a molestie metus vestibulum. Aliquam placerat felis ultrices lorem condimentum, nec ullamcorper felis porttitor. </p>
</ModalWrapper>
`}</ComponentVariant>
<ComponentVariant
id="with-three-buttons"
links={{
React:
'https://react.carbondesignsystem.com/?path=/story/components-modal--default',
Angular:
'https://angular.carbondesignsystem.com/?path=/story/components-modal--basic',
Vue:
'http://vue.carbondesignsystem.com/?path=/story/components-cvmodal--default',
Vanilla: 'https://the-carbon-components.netlify.com/?nav=modal',
}}>{`
<ModalWrapper
buttonTriggerText="Launch modal"
modalHeading="Modal heading"
modalLabel="Label"
secondaryButtons={
[
{
buttonText: 'Keep both',
onClick: () => {},
},
{
buttonText: 'Rename',
onClick: () => {},
}
]
}
>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse cursus fermentum risus, sit amet fringilla nunc pellentesque quis. Duis quis odio ultrices, cursus lacus ac, posuere felis. Donec dignissim libero in augue mattis, a molestie metus vestibulum. Aliquam placerat felis ultrices lorem condimentum, nec ullamcorper felis porttitor. </p>
</ModalWrapper>
`}</ComponentVariant>
</ComponentDemo>
59 changes: 59 additions & 0 deletions src/pages/components/modal/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ destructive or irreversible then use a transactional danger modal.
id: 'scrolling-content',
label: 'With scrolling content',
},
{
id: 'with-one-button',
label: 'With one button',
},
{
id: 'with-three-buttons',
label: 'With three buttons',
},
]}>
<ComponentVariant
id="modal"
Expand Down Expand Up @@ -149,6 +157,57 @@ destructive or irreversible then use a transactional danger modal.
</p>
</>
</ModalWrapper>
`}</ComponentVariant>
<ComponentVariant
id="with-one-button"
links={{
React:
'https://react.carbondesignsystem.com/?path=/story/components-modal--default',
Angular:
'https://angular.carbondesignsystem.com/?path=/story/components-modal--basic',
Vue:
'http://vue.carbondesignsystem.com/?path=/story/components-cvmodal--default',
Vanilla: 'https://the-carbon-components.netlify.com/?nav=modal',
}}>{`
<ModalWrapper
buttonTriggerText="Launch modal"
modalHeading="Modal heading"
modalLabel="Label"
secondaryButtonText={null}
>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse cursus fermentum risus, sit amet fringilla nunc pellentesque quis. Duis quis odio ultrices, cursus lacus ac, posuere felis. Donec dignissim libero in augue mattis, a molestie metus vestibulum. Aliquam placerat felis ultrices lorem condimentum, nec ullamcorper felis porttitor. </p>
</ModalWrapper>
`}</ComponentVariant>
<ComponentVariant
id="with-three-buttons"
links={{
React:
'https://react.carbondesignsystem.com/?path=/story/components-modal--default',
Angular:
'https://angular.carbondesignsystem.com/?path=/story/components-modal--basic',
Vue:
'http://vue.carbondesignsystem.com/?path=/story/components-cvmodal--default',
Vanilla: 'https://the-carbon-components.netlify.com/?nav=modal',
}}>{`
<ModalWrapper
buttonTriggerText="Launch modal"
modalHeading="Modal heading"
modalLabel="Label"
secondaryButtons={
[
{
buttonText: 'Keep both',
onClick: () => {},
},
{
buttonText: 'Rename',
onClick: () => {},
}
]
}
>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse cursus fermentum risus, sit amet fringilla nunc pellentesque quis. Duis quis odio ultrices, cursus lacus ac, posuere felis. Donec dignissim libero in augue mattis, a molestie metus vestibulum. Aliquam placerat felis ultrices lorem condimentum, nec ullamcorper felis porttitor. </p>
</ModalWrapper>
`}</ComponentVariant>
</ComponentDemo>

Expand Down