oneslash-design-system 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@ interface PageHeaderProps {
|
|
|
3
3
|
/** A small line over the title: where this page sits. */
|
|
4
4
|
eyebrow?: string;
|
|
5
5
|
title: string;
|
|
6
|
-
/** The element: h1 to h3. Pick the one that fits the page's outline
|
|
6
|
+
/** The element and the size: h1 to h3, each a step smaller than the last. Pick the one that fits the page's outline. */
|
|
7
7
|
level?: 1 | 2 | 3;
|
|
8
8
|
lede?: React.ReactNode;
|
|
9
9
|
facts?: {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import FactsRow from './factsRow';
|
|
3
3
|
import Paragraph from './paragraph';
|
|
4
|
+
// Full class names so Tailwind sees them. Each level steps down one type-scale
|
|
5
|
+
// step, on mobile and from md up.
|
|
6
|
+
var sizes = {
|
|
7
|
+
1: 'text-h3 md:text-h2',
|
|
8
|
+
2: 'text-h4 md:text-h3',
|
|
9
|
+
3: 'text-h5 md:text-h4',
|
|
10
|
+
};
|
|
4
11
|
export default function PageHeader(_a) {
|
|
5
12
|
var eyebrow = _a.eyebrow, title = _a.title, _b = _a.level, level = _b === void 0 ? 1 : _b, lede = _a.lede, facts = _a.facts;
|
|
6
13
|
var Tag = "h".concat(level);
|
|
@@ -9,7 +16,7 @@ export default function PageHeader(_a) {
|
|
|
9
16
|
{eyebrow && (<Paragraph tone="secondary" size="body2" measure="none">
|
|
10
17
|
{eyebrow}
|
|
11
18
|
</Paragraph>)}
|
|
12
|
-
<Tag className="
|
|
19
|
+
<Tag className={"".concat(sizes[level], " text-fg-primary")}>{title}</Tag>
|
|
13
20
|
{lede && (<Paragraph tone="secondary" measure="lede">
|
|
14
21
|
{lede}
|
|
15
22
|
</Paragraph>)}
|
|
@@ -4,5 +4,9 @@ declare const meta: Meta<typeof PageHeader>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof PageHeader>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
-
/**
|
|
7
|
+
/** Level 1 (the default) renders an h1 at the largest title size. */
|
|
8
|
+
export declare const Level1: Story;
|
|
9
|
+
/** Renders an h2, one type step smaller than level 1. */
|
|
8
10
|
export declare const Level2: Story;
|
|
11
|
+
/** Renders an h3, two type steps smaller than level 1. */
|
|
12
|
+
export declare const Level3: Story;
|
|
@@ -19,5 +19,9 @@ var meta = {
|
|
|
19
19
|
};
|
|
20
20
|
export default meta;
|
|
21
21
|
export var Default = {};
|
|
22
|
-
/**
|
|
22
|
+
/** Level 1 (the default) renders an h1 at the largest title size. */
|
|
23
|
+
export var Level1 = { args: { level: 1 } };
|
|
24
|
+
/** Renders an h2, one type step smaller than level 1. */
|
|
23
25
|
export var Level2 = { args: { level: 2 } };
|
|
26
|
+
/** Renders an h3, two type steps smaller than level 1. */
|
|
27
|
+
export var Level3 = { args: { level: 3 } };
|