Skip to content

Commit

Permalink
feat(modal): fix storybook controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Leotheluck authored and dpellier committed Jul 29, 2024
1 parent 101065b commit 81e459c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions packages/storybook/stories/components/modal/modal.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export default meta;

export const Demo: StoryObj = {
render: (args) => html`
<ods-modal is-open="${args.isOpen}" is-dismissible="${args.isDismissible}" color="${args.color}">
<ods-modal class="modal-demo" is-open="${args.isOpen}" is-dismissible="${args.isDismissible}" color="${args.color}">
${unsafeHTML(args.content)}
${unsafeHTML(args.actions)}
</ods-modal>
<style>
.my-text::part(text) {
.modal-demo .my-text::part(text) {
margin: 0 0 1rem 0;
}
ods-button::part(button) {
.modal-demo ods-button::part(button) {
margin-top: 1rem;
}
</style>
Expand All @@ -48,14 +48,12 @@ export const Demo: StoryObj = {
},
color: {
table: {
category: CONTROL_CATEGORY.general,
category: CONTROL_CATEGORY.design,
defaultValue: { summary: ODS_MODAL_COLOR.information },
type: { summary: ODS_MODAL_COLORS },
},
control: {
type: 'select',
options: ODS_MODAL_COLORS,
},
control: { type: 'select' },
options: ODS_MODAL_COLORS,
},
content: {
table: {
Expand Down Expand Up @@ -104,7 +102,7 @@ export const Overview: StoryObj = {
</script>
<style>
.headline::part(text) {
.modal-overview .headline::part(text) {
margin: 0 0 1rem 0;
}
</style>
Expand Down Expand Up @@ -148,7 +146,7 @@ export const CustomCSS: StoryObj = {
</script>
<style>
.my-text {
.modal-custom-css .my-text {
color: red;
}
</style>
Expand Down Expand Up @@ -234,7 +232,7 @@ export const Actions: StoryObj = {
</script>
<style>
.modal-actions-close::part(button) {
.modal-actions .modal-actions-close::part(button) {
margin-top: 1rem;
}
</style>
Expand Down

0 comments on commit 81e459c

Please sign in to comment.