// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { noop } from 'lodash'; import { action } from '@storybook/addon-actions'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { Button } from './Button'; import { Modal } from './Modal'; const i18n = setupI18n('en', enMessages); export default { title: 'Components/Modal', }; const onClose = action('onClose'); const LOREM_IPSUM = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.'; export const BareBonesShort = (): JSX.Element => ( Hello world! ); BareBonesShort.story = { name: 'Bare bones, short', }; export const BareBonesLong = (): JSX.Element => (

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); BareBonesLong.story = { name: 'Bare bones, long', }; export const BareBonesLongWithButton = (): JSX.Element => ( Okay} >

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); BareBonesLongWithButton.story = { name: 'Bare bones, long, with button', }; export const TitleXButtonBodyAndButtonFooter = (): JSX.Element => ( Okay} > {LOREM_IPSUM} ); TitleXButtonBodyAndButtonFooter.story = { name: 'Title, X button, body, and button footer', }; export const LotsOfButtonsInTheFooter = (): JSX.Element => ( } > Hello world! ); LotsOfButtonsInTheFooter.story = { name: 'Lots of buttons in the footer', }; export const LongBodyWithTitle = (): JSX.Element => (

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); LongBodyWithTitle.story = { name: 'Long body with title', }; export const LongBodyWithTitleAndButton = (): JSX.Element => ( Okay} >

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); LongBodyWithTitleAndButton.story = { name: 'Long body with title and button', }; export const LongBodyWithLongTitleAndXButton = (): JSX.Element => (

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); LongBodyWithLongTitleAndXButton.story = { name: 'Long body with long title and X button', }; export const WithStickyButtonsLongBody = (): JSX.Element => ( } >

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

{LOREM_IPSUM}

); WithStickyButtonsLongBody.story = { name: 'With sticky buttons long body', }; export const WithStickyButtonsShortBody = (): JSX.Element => ( } >

{LOREM_IPSUM.slice(0, 140)}

); WithStickyButtonsShortBody.story = { name: 'With sticky buttons short body', }; export const StickyFooterLotsOfButtons = (): JSX.Element => ( } >

{LOREM_IPSUM}

); StickyFooterLotsOfButtons.story = { name: 'Sticky footer, Lots of buttons', }; export const WithBackButton = (): JSX.Element => ( Hello world! ); WithBackButton.story = { name: 'Back Button', };