import React from "react"; import { createStoryMetaSettingsDecorator } from "../../../storybook"; import Flex from "../../Flex/Flex"; import { createComponentTemplate } from "vibe-storybook-components"; import Heading from "../Heading"; import { ONE_LINE_ELLIPSIS_TEST_ID, OVERFLOW_TITLE_CONTAINER_ID } from "../__tests__/headingTestsConstants"; import { headingOverflowSuite } from "../__tests__/Heading.interactions"; import Divider from "../../Divider/Divider"; import Search from "../../Search/Search"; import Checkbox from "../../Checkbox/Checkbox"; import Button from "../../Button/Button"; import { Custom } from "../../Icon/Icons"; import styles from "./Heading.stories.module.scss"; const metaSettings = createStoryMetaSettingsDecorator({ component: Heading, iconPropNamesArray: [], // List props that are typed as icons here actionPropsArray: [] // List the component's actions here }); const textTemplate = createComponentTemplate(Heading); export default { title: "Text/Heading", component: Heading, argTypes: metaSettings.argTypes, decorators: metaSettings.decorators }; export const Overview = { render: textTemplate.bind({}), name: "Overview", args: { children: "Title" } }; export const TypesAndWeights = { render: () => ( Bold H1 title Medium H1 title Normal H1 title Light H1 title Bold H2 title Medium H2 title Normal H2 title Light H2 title Bold H3 title Medium H3 title Normal H3 title Light H3 title ), name: "Types and weights" }; export const Colors = { render: () => ( Primary title Secondary title On primary title On inverted title ), name: "Colors" }; export const Overflow = { render: () => ( Heading without overflow Heading with ellipsis and tooltip when hovering
Heading with two lines overflow and a tooltip. Heading with two lines overflow and a tooltip. Heading with two lines overflow and a tooltip.
), name: "Overflow", play: headingOverflowSuite }; export const BuiltInPageHeaderNotEditable = { render: () => (
My work
), name: "Built-in page header (not editable)" };