diff --git a/src/pages/Typography.mdx b/src/core/styles/Typography.stories.tsx similarity index 50% rename from src/pages/Typography.mdx rename to src/core/styles/Typography.stories.tsx index dd5dc424b..a525bb569 100644 --- a/src/pages/Typography.mdx +++ b/src/core/styles/Typography.stories.tsx @@ -1,90 +1,113 @@ -import { Unstyled, Meta } from "@storybook/blocks"; +import clsx from "clsx"; +import React from "react"; - +export default { + title: "CSS/Typography", +}; - -
-

Typography

-

- Type definitions do not include margin as it can be contextual. Figma - and the below list include recommended margins. -

-

- The below list is created with ui-text-* helpers which include - properties beyond the standard{" "} - font-size and{" "} - line-height that text-* - includes. -

-
-
-

- Title - this is a title -

-
-

H1 - this is an h1

-
-

H2 - this is an h2

-
-

H3 - this is an h3

-
-

H4 - this is an h4

-
-

H5 - this is an h5

-
-

Paragraph 1

-
-

Paragraph 1 (strong)

-
-

Paragraph 2

-
-

Paragraph 2 (strong)

-
-

Paragraph 3

-
-

Paragraph 3 (strong)

-
-

This is a figure caption style

-
+const styles = { + primary: [ + { label: "Title XL", className: "ui-text-title text-title-xl" }, + { label: "Title", className: "ui-text-title" }, + { label: "Title XS", className: "ui-text-title text-title-xs" }, + { label: "h1 XL", className: "ui-text-h1 text-h1-xl" }, + { label: "h1", className: "ui-text-h1" }, + { label: "h1 XS", className: "ui-text-h1 text-h1-xs" }, + { label: "h2 XL", className: "ui-text-h2 text-h2-xl" }, + { label: "h2", className: "ui-text-h2" }, + { label: "h2 XS", className: "ui-text-h2 text-h2-xs" }, + { label: "h3", className: "ui-text-h3" }, + { label: "h4", className: "ui-text-h4" }, + { label: "h5", className: "ui-text-h5" }, + { label: "p1", className: "ui-text-p1" }, + { label: "p2", className: "ui-text-p2" }, + { label: "p3", className: "ui-text-p3" }, + { label: "p4", className: "ui-text-p4" }, + ], + decorative: [ + { label: "Sub-header", className: "ui-text-sub-header" }, + { label: "Sub-header XS", className: "ui-text-sub-header" }, + { label: "Overline 1", className: "ui-text-overline1" }, + { label: "Overline 2", className: "ui-text-overline2" }, + ], + gui: [ + { label: "Button label 1", className: "ui-text-button1" }, + { label: "Button label 2", className: "ui-text-button2" }, + { label: "Button label 3", className: "ui-text-button3" }, + { label: "Button label 4", className: "ui-text-button4" }, + { label: "Menu label 1", className: "ui-text-menu1" }, + { label: "Menu label 2", className: "ui-text-menu2" }, + { label: "Menu label 3", className: "ui-text-menu3" }, + { label: "Menu label 4", className: "ui-text-menu4" }, + { label: "Link", className: "ui-text" }, + ], + code: [ + { label: "Code 1", className: "ui-text-code" }, + { label: "Code 2", className: "ui-text-code2" }, + ], +}; -

Quote

-
-

Sub-header

-
-

Overline 1

-
-

Overline 2

-
-

Menu label 1

-
-

Menu label 1 (strong)

-
-

Menu label 2

-
-

Menu label 2 (strong)

-
-

Menu label 3

-
-

Menu label 3 (strong)

-
-

Code 1 font for code blocks

-
-

Code 2 font for code blocks

-
-

- Text, then styling for{" "} - inline code, within - paragraphs. -

-
+const fontCell = (style) => ( +
+
{style.label}
+ + {style.className + .split(" ") + .map((className) => `.${className}`) + .join("")} + +
+); +export const Primary = { + render: () => ( +
+ {styles.primary.map((style) => fontCell(style))}
+ ), + parameters: { + docs: { + description: { + story: + "CSS classes for headings and paragraphs. Title, H1 and H2 have three sizes: XL, default, and XS - the default classes responsively adapt to the screen size, so the variant visible here will correspond to that.", + }, + }, + }, +}; - {" "} +export const Decorative = { + render: () => ( +
+ {styles.decorative.map((style) => fontCell(style))} +
+ ), +}; + +export const GUI = { + render: () => ( +
+ {styles.gui.map((style) => fontCell(style))} +
+ ), +}; - {" "} +export const Code = { + render: () => ( +
+ {styles.code.map((style) => fontCell(style))} +
+ ), +}; -
+export const Links = { + render: () => ( + <>

Links

The default text color is inherited from the surrounding text. @@ -94,27 +117,45 @@ import { Unstyled, Meta } from "@storybook/blocks";

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Class aptent taciti sociosqu ad litora torquent per conubia - nostra, per inceptos himenaeos. + nostra,{" "} + + {" "} + per inceptos himenaeos + + .

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Class aptent taciti sociosqu ad litora torquent per conubia - nostra, per inceptos himenaeos. + nostra,{" "} + + {" "} + per inceptos himenaeos + + .

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Class aptent taciti sociosqu ad litora torquent per conubia - nostra per inceptos himenaeos. + nostra{" "} + + per inceptos himenaeos + + .

- + + ), +}; -
+export const Lists = { + render: () => ( + <>

Lists

Note that lists support having li items and li items with children, @@ -128,8 +169,8 @@ import { Unstyled, Meta } from "@storybook/blocks"; This is the preceding paragraph sed nisl id lectus scelerisque facilisis consectetur eget nisl. Morbi scelerisque felis vel ullamcorper viverra. In id ante quis quam sodales auctor in a ante. - Maecenas faucibus, diam sit amet sollicitudin pellentesque, est - nulla pellentesque sapien. + Maecenas faucibus, diam sit amet sollicitudin pellentesque, est nulla + pellentesque sapien.

  • @@ -154,8 +195,8 @@ import { Unstyled, Meta } from "@storybook/blocks"; This is the following paragraph sed nisl id lectus scelerisque facilisis consectetur eget nisl. Morbi scelerisque felis vel ullamcorper viverra. In id ante quis quam sodales auctor in a ante. - Maecenas faucibus, diam sit amet sollicitudin pellentesque, est - nulla pellentesque sapien. + Maecenas faucibus, diam sit amet sollicitudin pellentesque, est nulla + pellentesque sapien.

@@ -165,15 +206,15 @@ import { Unstyled, Meta } from "@storybook/blocks"; This is the preceding paragraph sed nisl id lectus scelerisque facilisis consectetur eget nisl. Morbi scelerisque felis vel ullamcorper viverra. In id ante quis quam sodales auctor in a ante. - Maecenas faucibus, diam sit amet sollicitudin pellentesque, est - nulla pellentesque sapien. + Maecenas faucibus, diam sit amet sollicitudin pellentesque, est nulla + pellentesque sapien.

  1. - Pellentesque consequat elit eget tristique sagittis. Etiam et - erat et lorem elementum commodo. Aenean congue diam a nibh - accumsan tincidunt. + Pellentesque consequat elit eget tristique sagittis. Etiam et erat + et lorem elementum commodo. Aenean congue diam a nibh accumsan + tincidunt.

    1. @@ -195,12 +236,10 @@ import { Unstyled, Meta } from "@storybook/blocks"; This is the following paragraph sed nisl id lectus scelerisque facilisis consectetur eget nisl. Morbi scelerisque felis vel ullamcorper viverra. In id ante quis quam sodales auctor in a ante. - Maecenas faucibus, diam sit amet sollicitudin pellentesque, est - nulla pellentesque sapien. + Maecenas faucibus, diam sit amet sollicitudin pellentesque, est nulla + pellentesque sapien.

      - - - -
-
+ + ), +}; diff --git a/tailwind.config.js b/tailwind.config.js index 119addbac..284927569 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,5 +1,5 @@ module.exports = { - content: ["./src/**/*.{js,ts,tsx,mdx,stories.tsx,json}"], + content: ["./src/**/*.{js,ts,tsx,stories.tsx,json}"], safelist: [{ pattern: /^hljs.*/ }], theme: { screens: {