import React from "react"; /* eslint react/prop-types: 0 */ import { AlertBanner } from "./AlertBanner"; import { styled } from "../theme"; import type { Meta, StoryFn } from "@storybook/react"; export default { title: "Alert banner", component: AlertBanner.Root, subcomponents: { Trigger: AlertBanner.Trigger, Content: AlertBanner.Content, }, parameters: { layout: "fullscreen", }, argTypes: { onClick: { action: "clicked" }, position: { options: ["fixed", "sticky", "absolute", "relative"], control: "select", }, shadow: { options: [true, false], control: "boolean", }, variant: { options: ["error", "warning", "success", "information"], }, dismissable: { options: [true, false], control: "boolean", }, }, } as Meta; const Column = styled("div", { display: "flex", flexDirection: "row", gap: "$100", alignItems: "center", width: "100%", }); const Stack = styled("div", { width: "100%", display: "flex", flexDirection: "column", gap: "$100", alignItems: "center", borderRadius: "$075", }); const Template: StoryFn = ({ children, ...args }) => ( {children} {children} {children} {children} ); export const Play = { render: Template, args: { children: ( <> Information: This alert banner ), css: { zIndex: "$shell", top: 0, left: 0, }, }, decorators: [ (Story) => ( ), ], name: "Alert banner", }; const Decorator = styled("div", { display: "flex", flexDirection: "column", width: "100%", height: "calc(100vh * 3);", px: "$100", }); const SpacingTemplate: StoryFn = ({ ...args }) => ( This is a single line of text This is multiple lines of text that should wrap. Lorem ipsum dolor sit amet, consectetur adipiscing elit. ); export const Spacing = { render: SpacingTemplate, };