oneslash-design-system 2.7.2 → 2.8.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,11 +3,13 @@ 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; it does not change the size. */
7
+ level?: 1 | 2 | 3;
6
8
  lede?: React.ReactNode;
7
9
  facts?: {
8
10
  label: string;
9
11
  value: React.ReactNode;
10
12
  }[];
11
13
  }
12
- export default function PageHeader({ eyebrow, title, lede, facts }: PageHeaderProps): React.JSX.Element;
14
+ export default function PageHeader({ eyebrow, title, level, lede, facts }: PageHeaderProps): React.JSX.Element;
13
15
  export {};
@@ -2,13 +2,14 @@ import React from 'react';
2
2
  import FactsRow from './factsRow';
3
3
  import Paragraph from './paragraph';
4
4
  export default function PageHeader(_a) {
5
- var eyebrow = _a.eyebrow, title = _a.title, lede = _a.lede, facts = _a.facts;
5
+ var eyebrow = _a.eyebrow, title = _a.title, _b = _a.level, level = _b === void 0 ? 1 : _b, lede = _a.lede, facts = _a.facts;
6
+ var Tag = "h".concat(level);
6
7
  return (<div className="flex flex-col gap-huge">
7
8
  <div className="flex flex-col gap-large">
8
9
  {eyebrow && (<Paragraph tone="secondary" size="body2" measure="none">
9
10
  {eyebrow}
10
11
  </Paragraph>)}
11
- <h1 className="text-h3 text-fg-primary md:text-h2">{title}</h1>
12
+ <Tag className="text-h3 text-fg-primary md:text-h2">{title}</Tag>
12
13
  {lede && (<Paragraph tone="secondary" measure="lede">
13
14
  {lede}
14
15
  </Paragraph>)}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import PageHeader from "../components/pageHeader";
3
+ declare const meta: Meta<typeof PageHeader>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PageHeader>;
6
+ export declare const Default: Story;
7
+ /** Renders an h2; the type style is the same as the default. */
8
+ export declare const Level2: Story;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import PageHeader from "../components/pageHeader";
3
+ var meta = {
4
+ title: "Components/PageHeader",
5
+ component: PageHeader,
6
+ args: {
7
+ eyebrow: "Design Translation · 2011",
8
+ title: "Geocentric Clock",
9
+ lede: "The arm stays still and the numbers come to it.",
10
+ },
11
+ argTypes: {
12
+ level: { control: "select", options: [1, 2, 3] },
13
+ },
14
+ decorators: [
15
+ function (Story) { return (<div style={{ padding: "16px" }}>
16
+ <Story />
17
+ </div>); },
18
+ ],
19
+ };
20
+ export default meta;
21
+ export var Default = {};
22
+ /** Renders an h2; the type style is the same as the default. */
23
+ export var Level2 = { args: { level: 2 } };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "2.7.2",
4
+ "version": "2.8.0",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",