Upgrade Storybook

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Jamie Kyle 2023-10-11 12:06:43 -07:00 committed by GitHub
parent 8c966dfbd8
commit 502ea174ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
328 changed files with 10863 additions and 12432 deletions

View file

@ -3,19 +3,19 @@
import React from 'react';
import { noop } from 'lodash';
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { Button } from './Button';
import type { ModalPropsType } from './Modal';
import { Modal } from './Modal';
const i18n = setupI18n('en', enMessages);
export default {
title: 'Components/Modal',
};
} satisfies Meta<ModalPropsType>;
const onClose = action('onClose');
@ -30,10 +30,6 @@ export function BareBonesShort(): JSX.Element {
);
}
BareBonesShort.story = {
name: 'Bare bones, short',
};
export function BareBonesLong(): JSX.Element {
return (
<Modal modalName="test" i18n={i18n} useFocusTrap={false}>
@ -45,10 +41,6 @@ export function BareBonesLong(): JSX.Element {
);
}
BareBonesLong.story = {
name: 'Bare bones, long',
};
export function BareBonesLongWithButton(): JSX.Element {
return (
<Modal
@ -64,10 +56,6 @@ export function BareBonesLongWithButton(): JSX.Element {
);
}
BareBonesLongWithButton.story = {
name: 'Bare bones, long, with button',
};
export function TitleXButtonBodyAndButtonFooter(): JSX.Element {
return (
<Modal
@ -83,10 +71,6 @@ export function TitleXButtonBodyAndButtonFooter(): JSX.Element {
);
}
TitleXButtonBodyAndButtonFooter.story = {
name: 'Title, X button, body, and button footer',
};
export function LotsOfButtonsInTheFooter(): JSX.Element {
return (
<Modal
@ -114,10 +98,6 @@ export function LotsOfButtonsInTheFooter(): JSX.Element {
);
}
LotsOfButtonsInTheFooter.story = {
name: 'Lots of buttons in the footer',
};
export function LongBodyWithTitle(): JSX.Element {
return (
<Modal
@ -135,10 +115,6 @@ export function LongBodyWithTitle(): JSX.Element {
);
}
LongBodyWithTitle.story = {
name: 'Long body with title',
};
export function LongBodyWithTitleAndButton(): JSX.Element {
return (
<Modal
@ -156,10 +132,6 @@ export function LongBodyWithTitleAndButton(): JSX.Element {
);
}
LongBodyWithTitleAndButton.story = {
name: 'Long body with title and button',
};
export function LongBodyWithLongTitleAndXButton(): JSX.Element {
return (
<Modal
@ -177,10 +149,6 @@ export function LongBodyWithLongTitleAndXButton(): JSX.Element {
);
}
LongBodyWithLongTitleAndXButton.story = {
name: 'Long body with long title and X button',
};
export function WithStickyButtonsLongBody(): JSX.Element {
return (
<Modal
@ -203,10 +171,6 @@ export function WithStickyButtonsLongBody(): JSX.Element {
);
}
WithStickyButtonsLongBody.story = {
name: 'With sticky buttons long body',
};
export function WithStickyButtonsShortBody(): JSX.Element {
return (
<Modal
@ -226,10 +190,6 @@ export function WithStickyButtonsShortBody(): JSX.Element {
);
}
WithStickyButtonsShortBody.story = {
name: 'With sticky buttons short body',
};
export function StickyFooterLotsOfButtons(): JSX.Element {
return (
<Modal
@ -258,10 +218,6 @@ export function StickyFooterLotsOfButtons(): JSX.Element {
);
}
StickyFooterLotsOfButtons.story = {
name: 'Sticky footer, Lots of buttons',
};
export function WithBackButton(): JSX.Element {
return (
<Modal
@ -276,7 +232,3 @@ export function WithBackButton(): JSX.Element {
</Modal>
);
}
WithBackButton.story = {
name: 'Back Button',
};