From 62758d92b099aac1025fd289c3c5e1976294f3e0 Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:19:15 +0200 Subject: [PATCH] Storybook for the Modal component (#26798) GitOrigin-RevId: 679935722a8b8a96c55f60be16c0ac34f6e6fbcc --- .../frontend/stories/modals/modal.stories.tsx | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 services/web/frontend/stories/modals/modal.stories.tsx diff --git a/services/web/frontend/stories/modals/modal.stories.tsx b/services/web/frontend/stories/modals/modal.stories.tsx new file mode 100644 index 0000000000..2bdd9bdad8 --- /dev/null +++ b/services/web/frontend/stories/modals/modal.stories.tsx @@ -0,0 +1,152 @@ +import Button from '@/features/ui/components/bootstrap-5/button' +import type { Meta, StoryObj } from '@storybook/react' +import OLModal, { + OLModalHeader, + OLModalBody, + OLModalFooter, + OLModalTitle, +} from '@/features/ui/components/ol/ol-modal' + +type Story = StoryObj + +export const Default: Story = { + render: args => { + return ( + + + Heading + + +

+ Lorem ipsum dolor sit lorem a amet, consectetur adipiscing elit, sed + do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam. +

+
+ + + + +
+ ) + }, +} + +export const ModalWithAcknowledgment: Story = { + render: args => { + return ( + + + Acknowledgment + + +

+ System requires an acknowledgment from the user. Usually contains + only one primary button. +

+
+ + + +
+ ) + }, +} + +export const ModalWithSecondary: Story = { + render: args => { + return ( + + + Heading + + +

+ Lorem ipsum dolor sit lorem a amet, consectetur adipiscing elit, sed + do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam. +

+
+ + + +
+ ) + }, +} + +export const ModalWithTertiary: Story = { + render: args => { + return ( + + + Heading + + +

Used for destructive or irreversible actions.

+
+ + + + + +
+ ) + }, +} + +export const ModalInformative: Story = { + render: args => { + return ( + + + Informative + + +

+ Presents information for the user to be aware of and doesn’t require + any action. +

+
+
+ ) + }, +} + +export const ModalDanger: Story = { + render: args => { + return ( + + + Danger + + +

+ Lorem ipsum dolor sit lorem a amet, consectetur adipiscing elit, sed + do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam. +

+
+ + + + +
+ ) + }, +} + +const meta: Meta = { + title: 'Shared / Components / Modal', + component: OLModal, + argTypes: { + size: { + control: 'radio', + options: ['lg', 'md', 'sm'], + }, + }, +} + +export default meta