import React from "react"; import cx from "classnames"; import { createStoryMetaSettingsDecorator } from "../../../storybook"; import Text from "../Text"; import Link from "../../Link/Link"; import Heading from "../../Heading/Heading"; import { HeadingType } from "../../Heading/HeadingConstants"; import { createComponentTemplate, StorybookLink } from "vibe-storybook-components"; import Flex from "../../Flex/Flex"; import { ONE_LINE_ELLIPSIS_TEST_ID, OVERFLOW_TEXT_CONTAINER_ID } from "../__tests__/textTestsConstants"; import { textOverflowSuite } from "../__tests__/Text.interactions"; import styles from "./Text.stories.module.scss"; const metaSettings = createStoryMetaSettingsDecorator({ component: Text, enumPropNamesArray: ["types", "weights", "colors", { propName: "align", enumName: "align" }], // List enum props here iconPropNamesArray: [], // List props that are typed as icons here actionPropsArray: [] // List the component's actions here }); export default { title: "Text/Text", component: Text, argTypes: metaSettings.argTypes, decorators: metaSettings.decorators }; const textTemplate = createComponentTemplate(Text); export const Overview = { render: textTemplate.bind({}), name: "Overview", args: { children: "Hi, I'm a text!" } }; export const SizesAndWeights = { render: () => ( This is text1 bold This is text1 medium This is text1 normal This is text2 bold This is text2 medium This is text2 normal This is text3 medium This is text3 normal ), name: "Sizes and weights" }; export const Colors = { render: () => ( Primary text Secondary text On primary text On inverted text Fixed light Fixed dark ), name: "Colors" }; export const Overflow = { render: () => ( Text with 1 line This is an example of text with overflow and a Tooltip to help or provide information about specific components when a user hovers over them. Text with 2 lines This is an example of text with ellipsis which displayed after two full lines of content this is an example of text with ellipsis which displayed after two full lines of content Text with array of elements {[ "This is an example of array of texts and ", , " that are overflowing and create a tooltip with the correct information" ]} ), name: "Overflow", play: textOverflowSuite }; export const Paragraph = { render: () => ( Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ), name: "Paragraph" }; export const LinksInsideRunningText = { render: () => ( This is the story of a{" "} link {" "} inside running text. This is the story of a{" "} link {" "} inside running text on a primary color This is the story of a{" "} link {" "} inside running text on an inverted color This is the story of a{" "} link {" "} inside running text with fixed light color This is the story of a{" "} link {" "} inside running text with fixed dark color ), name: "Links inside running text" };