oneslash-design-system 2.20.0 → 2.21.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.
Files changed (151) hide show
  1. package/README.md +1 -1
  2. package/dist/DESIGN.md +34 -1
  3. package/dist/cases/about-page/profile.d.ts +1 -0
  4. package/dist/cases/about-page/profile.jsx +64 -0
  5. package/dist/cases/about-page.md +114 -0
  6. package/dist/cases/admin-inbox/list.d.ts +1 -0
  7. package/dist/cases/admin-inbox/list.jsx +104 -0
  8. package/dist/cases/admin-inbox/split.d.ts +1 -0
  9. package/dist/cases/admin-inbox/split.jsx +68 -0
  10. package/dist/cases/admin-inbox.md +254 -0
  11. package/dist/cases/api-keys.md +1 -1
  12. package/dist/cases/blog-index/cards.d.ts +1 -0
  13. package/dist/cases/blog-index/cards.jsx +45 -0
  14. package/dist/cases/blog-index/list.d.ts +1 -0
  15. package/dist/cases/blog-index/list.jsx +46 -0
  16. package/dist/cases/blog-index.md +160 -0
  17. package/dist/cases/changelog/by-month.d.ts +1 -0
  18. package/dist/cases/changelog/by-month.jsx +70 -0
  19. package/dist/cases/changelog/one-page.d.ts +1 -0
  20. package/dist/cases/changelog/one-page.jsx +70 -0
  21. package/dist/cases/changelog.md +200 -0
  22. package/dist/cases/code-sample/block.d.ts +1 -0
  23. package/dist/cases/code-sample/block.jsx +19 -0
  24. package/dist/cases/code-sample/command.d.ts +1 -0
  25. package/dist/cases/code-sample/command.jsx +17 -0
  26. package/dist/cases/code-sample.md +96 -0
  27. package/dist/cases/contact-page/form.d.ts +1 -0
  28. package/dist/cases/contact-page/form.jsx +83 -0
  29. package/dist/cases/contact-page/links.d.ts +1 -0
  30. package/dist/cases/contact-page/links.jsx +19 -0
  31. package/dist/cases/contact-page.md +142 -0
  32. package/dist/cases/docs-component-page/reference.d.ts +1 -0
  33. package/dist/cases/docs-component-page/reference.jsx +93 -0
  34. package/dist/cases/docs-component-page.md +144 -0
  35. package/dist/cases/faq/accordion.d.ts +1 -0
  36. package/dist/cases/faq/accordion.jsx +25 -0
  37. package/dist/cases/faq/open-list.d.ts +1 -0
  38. package/dist/cases/faq/open-list.jsx +27 -0
  39. package/dist/cases/faq.md +110 -0
  40. package/dist/cases/feature-grid/cards.d.ts +1 -0
  41. package/dist/cases/feature-grid/cards.jsx +33 -0
  42. package/dist/cases/feature-grid/rows.d.ts +1 -0
  43. package/dist/cases/feature-grid/rows.jsx +30 -0
  44. package/dist/cases/feature-grid.md +132 -0
  45. package/dist/cases/image-viewer/gallery.d.ts +1 -0
  46. package/dist/cases/image-viewer/gallery.jsx +32 -0
  47. package/dist/cases/image-viewer/single.d.ts +1 -0
  48. package/dist/cases/image-viewer/single.jsx +25 -0
  49. package/dist/cases/image-viewer.md +123 -0
  50. package/dist/cases/landing-hero/centered.d.ts +1 -0
  51. package/dist/cases/landing-hero/centered.jsx +22 -0
  52. package/dist/cases/landing-hero/split.d.ts +1 -0
  53. package/dist/cases/landing-hero/split.jsx +30 -0
  54. package/dist/cases/landing-hero.md +114 -0
  55. package/dist/cases/legal-page/sections.d.ts +1 -0
  56. package/dist/cases/legal-page/sections.jsx +61 -0
  57. package/dist/cases/legal-page.md +96 -0
  58. package/dist/cases/long-form-page/article.d.ts +1 -0
  59. package/dist/cases/long-form-page/article.jsx +58 -0
  60. package/dist/cases/long-form-page/with-contents.d.ts +1 -0
  61. package/dist/cases/long-form-page/with-contents.jsx +41 -0
  62. package/dist/cases/long-form-page.md +170 -0
  63. package/dist/cases/message-actions/hover-toolbar.jsx +11 -8
  64. package/dist/cases/message-actions/menu.jsx +10 -7
  65. package/dist/cases/message-actions.md +19 -13
  66. package/dist/cases/message-attachments/in-composer.jsx +2 -2
  67. package/dist/cases/message-attachments/in-message.jsx +16 -11
  68. package/dist/cases/message-attachments.md +29 -17
  69. package/dist/cases/one-main-action.md +33 -0
  70. package/dist/cases/overflow-menu/in-a-header.jsx +9 -6
  71. package/dist/cases/overflow-menu/on-a-row.jsx +9 -6
  72. package/dist/cases/overflow-menu.md +16 -10
  73. package/dist/cases/page-end/cta-band.d.ts +1 -0
  74. package/dist/cases/page-end/cta-band.jsx +24 -0
  75. package/dist/cases/page-end/next-link.d.ts +1 -0
  76. package/dist/cases/page-end/next-link.jsx +18 -0
  77. package/dist/cases/page-end.md +88 -0
  78. package/dist/cases/password-gate/inline.d.ts +1 -0
  79. package/dist/cases/password-gate/inline.jsx +94 -0
  80. package/dist/cases/password-gate/modal.d.ts +1 -0
  81. package/dist/cases/password-gate/modal.jsx +81 -0
  82. package/dist/cases/password-gate/page.d.ts +1 -0
  83. package/dist/cases/password-gate/page.jsx +82 -0
  84. package/dist/cases/password-gate.md +351 -0
  85. package/dist/cases/pricing-section/cards.d.ts +1 -0
  86. package/dist/cases/pricing-section/cards.jsx +40 -0
  87. package/dist/cases/pricing-section.md +85 -0
  88. package/dist/cases/product-cards/grid.d.ts +1 -0
  89. package/dist/cases/product-cards/grid.jsx +20 -0
  90. package/dist/cases/product-cards.md +71 -0
  91. package/dist/cases/reply-feedback/thumbs.jsx +11 -8
  92. package/dist/cases/reply-feedback/with-reason.jsx +11 -8
  93. package/dist/cases/reply-feedback.md +20 -14
  94. package/dist/cases/section-index/cards.d.ts +1 -0
  95. package/dist/cases/section-index/cards.jsx +25 -0
  96. package/dist/cases/section-index/list.d.ts +1 -0
  97. package/dist/cases/section-index/list.jsx +56 -0
  98. package/dist/cases/section-index.md +140 -0
  99. package/dist/cases/site-header.md +1 -1
  100. package/dist/cases/site-search/dialog.d.ts +1 -0
  101. package/dist/cases/site-search/dialog.jsx +131 -0
  102. package/dist/cases/site-search.md +176 -0
  103. package/dist/cases/tabbed-panels/tabs.d.ts +1 -0
  104. package/dist/cases/tabbed-panels/tabs.jsx +40 -0
  105. package/dist/cases/tabbed-panels.md +81 -0
  106. package/dist/cases.json +1173 -29
  107. package/dist/components/accordion.d.ts +31 -0
  108. package/dist/components/accordion.jsx +103 -0
  109. package/dist/components/codeBlock.d.ts +26 -0
  110. package/dist/components/codeBlock.jsx +101 -0
  111. package/dist/components/lightbox.d.ts +31 -0
  112. package/dist/components/lightbox.jsx +161 -0
  113. package/dist/components/linkCard.d.ts +10 -1
  114. package/dist/components/linkCard.jsx +32 -6
  115. package/dist/components/modal.d.ts +10 -2
  116. package/dist/components/modal.jsx +17 -12
  117. package/dist/components/pageHeader.jsx +1 -1
  118. package/dist/components/searchDialog.d.ts +44 -0
  119. package/dist/components/searchDialog.jsx +152 -0
  120. package/dist/components/tab.d.ts +5 -1
  121. package/dist/components/tab.jsx +2 -2
  122. package/dist/components/tabPanel.d.ts +16 -0
  123. package/dist/components/tabPanel.jsx +12 -0
  124. package/dist/components/tabsContainer.d.ts +5 -1
  125. package/dist/components/tabsContainer.jsx +2 -2
  126. package/dist/index.d.ts +5 -0
  127. package/dist/index.js +5 -0
  128. package/dist/internal/accordion.d.ts +4 -0
  129. package/dist/internal/accordion.js +53 -0
  130. package/dist/internal/combobox.d.ts +20 -0
  131. package/dist/internal/combobox.js +28 -0
  132. package/dist/internal/highlight.d.ts +5 -0
  133. package/dist/internal/highlight.js +18 -0
  134. package/dist/native-mapping.json +31 -1
  135. package/dist/stories/Accordion.stories.d.ts +11 -0
  136. package/dist/stories/Accordion.stories.jsx +93 -0
  137. package/dist/stories/Cases.generated.stories.d.ts +34 -0
  138. package/dist/stories/Cases.generated.stories.jsx +68 -0
  139. package/dist/stories/CodeBlock.stories.d.ts +12 -0
  140. package/dist/stories/CodeBlock.stories.jsx +65 -0
  141. package/dist/stories/Lightbox.stories.d.ts +8 -0
  142. package/dist/stories/Lightbox.stories.jsx +40 -0
  143. package/dist/stories/LinkCard.stories.d.ts +6 -0
  144. package/dist/stories/LinkCard.stories.jsx +17 -0
  145. package/dist/stories/PageHeader.stories.d.ts +2 -0
  146. package/dist/stories/PageHeader.stories.jsx +13 -0
  147. package/dist/stories/SearchDialog.stories.d.ts +17 -0
  148. package/dist/stories/SearchDialog.stories.jsx +111 -0
  149. package/dist/stories/TabPanel.stories.d.ts +7 -0
  150. package/dist/stories/TabPanel.stories.jsx +31 -0
  151. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export interface AccordionItem {
3
+ /** Names the item in `open` and in the address (`#<id>-<item.id>`) */
4
+ id: string;
5
+ /** The words on the heading's button */
6
+ title: string;
7
+ content: React.ReactNode;
8
+ }
9
+ interface AccordionProps {
10
+ items: AccordionItem[];
11
+ /** More than one item can be open. `false` keeps one open: opening an item closes the other. Default true. */
12
+ multiple?: boolean;
13
+ /** The item ids open at first, when `open` is not given */
14
+ defaultOpen?: string[];
15
+ /** The item ids open now. With it the accordion is controlled: say what changed in `onOpenChange`. */
16
+ open?: string[];
17
+ onOpenChange?: (open: string[]) => void;
18
+ /** The heading element of each item, 2 to 4. Pick the one that fits the page's outline. Default 3. */
19
+ headingLevel?: 2 | 3 | 4;
20
+ /** Opens the item named by the address `#<id>-<item.id>` on load and on change, and scrolls it under a `SiteHeader` */
21
+ linkable?: boolean;
22
+ /** Prefixes the ids of the items and their panels */
23
+ id: string;
24
+ }
25
+ /**
26
+ * Headings that each hold a full-width button opening a panel under it, with hairlines between and no box.
27
+ * Closed panels are in the server HTML, `hidden`. A panel is a `region` named by its heading when there are 6 items
28
+ * or fewer. Up, Down, Home and End move between the headings.
29
+ */
30
+ export default function Accordion({ items, multiple, defaultOpen, open, onOpenChange, headingLevel, linkable, id, }: AccordionProps): React.JSX.Element;
31
+ export { Accordion };
@@ -0,0 +1,103 @@
1
+ 'use client';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ import { ChevronDown } from 'lucide-react';
4
+ import { focusRing } from './sharedStyles';
5
+ import { hashItem, nextHeading, normalizeOpen, toggleOpen } from '../internal/accordion';
6
+ // More than this many open-able regions are noise for a screen reader's landmark list
7
+ var MAX_REGIONS = 6;
8
+ /**
9
+ * Headings that each hold a full-width button opening a panel under it, with hairlines between and no box.
10
+ * Closed panels are in the server HTML, `hidden`. A panel is a `region` named by its heading when there are 6 items
11
+ * or fewer. Up, Down, Home and End move between the headings.
12
+ */
13
+ export default function Accordion(_a) {
14
+ var items = _a.items, _b = _a.multiple, multiple = _b === void 0 ? true : _b, _c = _a.defaultOpen, defaultOpen = _c === void 0 ? [] : _c, open = _a.open, onOpenChange = _a.onOpenChange, _d = _a.headingLevel, headingLevel = _d === void 0 ? 3 : _d, _e = _a.linkable, linkable = _e === void 0 ? false : _e, id = _a.id;
15
+ var ids = items.map(function (item) { return item.id; });
16
+ var _f = useState(function () { return normalizeOpen(defaultOpen, ids, multiple); }), inner = _f[0], setInner = _f[1];
17
+ var controlled = open !== undefined;
18
+ var current = normalizeOpen(controlled ? open : inner, ids, multiple);
19
+ var buttons = useRef([]);
20
+ // The effect below reads the latest values through here, so the hashchange listener is not re-bound on every render
21
+ var latest = useRef({ current: current, controlled: controlled, multiple: multiple, onOpenChange: onOpenChange });
22
+ latest.current = { current: current, controlled: controlled, multiple: multiple, onOpenChange: onOpenChange };
23
+ var change = function (next) {
24
+ var _a, _b;
25
+ if (!latest.current.controlled)
26
+ setInner(next);
27
+ (_b = (_a = latest.current).onOpenChange) === null || _b === void 0 ? void 0 : _b.call(_a, next);
28
+ };
29
+ var key = ids.join('\n');
30
+ useEffect(function () {
31
+ if (!linkable)
32
+ return;
33
+ var frame = 0;
34
+ // On mount the browser has already jumped to a server-rendered #hash, so scroll again only when the heading sits
35
+ // under the header (where that jump put it). A reload or back that restored a scroll position far from it stays.
36
+ var first = true;
37
+ var apply = function () {
38
+ var item = hashItem(window.location.hash, id, ids);
39
+ if (!item)
40
+ return;
41
+ var heading = document.getElementById("".concat(id, "-").concat(item));
42
+ var scroll = true;
43
+ if (first && heading) {
44
+ var offset = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--os-header-offset')) || 0;
45
+ var top_1 = heading.getBoundingClientRect().top;
46
+ // A client-rendered page has no jump to rely on: at the top of the page, a heading far below needs the scroll
47
+ scroll = (top_1 > -2 && top_1 <= offset + 2) || (window.scrollY === 0 && top_1 > offset + 2);
48
+ }
49
+ first = false;
50
+ var _a = latest.current, now = _a.current, many = _a.multiple;
51
+ if (!now.includes(item))
52
+ change(toggleOpen(now, item, many));
53
+ if (!scroll)
54
+ return;
55
+ // After the panels that close have left the layout, bring the heading just under the header (scroll-margin-top)
56
+ cancelAnimationFrame(frame);
57
+ frame = requestAnimationFrame(function () {
58
+ var _a;
59
+ (_a = document.getElementById("".concat(id, "-").concat(item))) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: 'start', behavior: 'instant' });
60
+ });
61
+ };
62
+ apply();
63
+ window.addEventListener('hashchange', apply);
64
+ return function () {
65
+ cancelAnimationFrame(frame);
66
+ window.removeEventListener('hashchange', apply);
67
+ };
68
+ }, [linkable, id, key]); // eslint-disable-line react-hooks/exhaustive-deps
69
+ var onKeyDown = function (e, index) {
70
+ var _a;
71
+ if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
72
+ return;
73
+ var to = nextHeading(e.key, index, items.length);
74
+ if (to < 0)
75
+ return;
76
+ e.preventDefault();
77
+ (_a = buttons.current[to]) === null || _a === void 0 ? void 0 : _a.focus();
78
+ };
79
+ var Heading = "h".concat(headingLevel);
80
+ var regions = items.length <= MAX_REGIONS;
81
+ return (<div className="w-full border-y border-misc-divider divide-y divide-misc-divider">
82
+ {items.map(function (item, index) {
83
+ var isOpen = current.includes(item.id);
84
+ var headingId = "".concat(id, "-").concat(item.id);
85
+ var buttonId = "".concat(headingId, "-button");
86
+ var panelId = "".concat(headingId, "-panel");
87
+ return (<div key={item.id}>
88
+ <Heading id={headingId} className="m-0 scroll-mt-[var(--os-header-offset,0px)]">
89
+ <button ref={function (el) {
90
+ buttons.current[index] = el;
91
+ }} id={buttonId} type="button" aria-expanded={isOpen} aria-controls={panelId} onClick={function () { return change(toggleOpen(current, item.id, multiple)); }} onKeyDown={function (e) { return onKeyDown(e, index); }} className={"flex w-full items-center justify-between gap-3 rounded-control py-3 text-left text-subtitle1 text-fg-primary ".concat(focusRing)}>
92
+ <span className="min-w-0 break-words">{item.title}</span>
93
+ <ChevronDown aria-hidden strokeWidth={2} className={"h-6 w-6 shrink-0 text-fg-secondary transition-transform duration-[var(--os-duration-fast)] ease-out motion-reduce:transition-none ".concat(isOpen ? 'rotate-180' : '')}/>
94
+ </button>
95
+ </Heading>
96
+ <div id={panelId} hidden={!isOpen} role={regions ? 'region' : undefined} aria-labelledby={regions ? buttonId : undefined} className="pb-4 text-body1 text-fg-secondary">
97
+ {item.content}
98
+ </div>
99
+ </div>);
100
+ })}
101
+ </div>);
102
+ }
103
+ export { Accordion };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ interface CodeBlockProps {
3
+ /** The text, exactly as it is copied. Line breaks stay. */
4
+ code: string;
5
+ /** Visible above the code ('Install command', 'button.tsx'); it names the scroll region and the Copy button */
6
+ label: string;
7
+ /** Shown beside the label for the reader ('tsx', 'bash'). It does not color the code. */
8
+ language?: string;
9
+ /** Wrap long lines instead of scrolling them sideways. Default false. */
10
+ wrap?: boolean;
11
+ /** The button's words. Defaults to "Copy". */
12
+ copyLabel?: string;
13
+ /** The button's words for 2 seconds after the text is on the clipboard. Defaults to "Copied". */
14
+ copiedLabel?: string;
15
+ /** Prefixes the ids of the code and the line shown when copying is blocked */
16
+ id: string;
17
+ }
18
+ /**
19
+ * Code in a figure: a visible label, a Copy button at the end of the label row, and the code on the panel
20
+ * surface. A long line scrolls inside the code, a named region a keyboard can focus and scroll; the page never
21
+ * does. "Copied" shows only after the browser accepted the text; otherwise a line says to copy by hand.
22
+ * With `wrap` the block is still a Tab stop, so use `wrap` only for short blocks.
23
+ * No highlighting and no line numbers. One line to paste is a `CopyField`.
24
+ */
25
+ export default function CodeBlock({ code, label, language, wrap, copyLabel, copiedLabel, id, }: CodeBlockProps): React.JSX.Element;
26
+ export { CodeBlock };
@@ -0,0 +1,101 @@
1
+ 'use client';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ import React, { useEffect, useRef, useState } from 'react';
39
+ import { copyText } from '../internal/copyField';
40
+ import Button from './button';
41
+ import { focusRing } from './sharedStyles';
42
+ /**
43
+ * Code in a figure: a visible label, a Copy button at the end of the label row, and the code on the panel
44
+ * surface. A long line scrolls inside the code, a named region a keyboard can focus and scroll; the page never
45
+ * does. "Copied" shows only after the browser accepted the text; otherwise a line says to copy by hand.
46
+ * With `wrap` the block is still a Tab stop, so use `wrap` only for short blocks.
47
+ * No highlighting and no line numbers. One line to paste is a `CopyField`.
48
+ */
49
+ export default function CodeBlock(_a) {
50
+ var _this = this;
51
+ var code = _a.code, label = _a.label, language = _a.language, _b = _a.wrap, wrap = _b === void 0 ? false : _b, _c = _a.copyLabel, copyLabel = _c === void 0 ? 'Copy' : _c, _d = _a.copiedLabel, copiedLabel = _d === void 0 ? 'Copied' : _d, id = _a.id;
52
+ var _e = useState(false), copied = _e[0], setCopied = _e[1];
53
+ var _f = useState(false), blocked = _f[0], setBlocked = _f[1];
54
+ var timer = useRef(undefined);
55
+ var mounted = useRef(false);
56
+ useEffect(function () {
57
+ mounted.current = true;
58
+ return function () {
59
+ mounted.current = false;
60
+ clearTimeout(timer.current);
61
+ };
62
+ }, []);
63
+ var handleCopy = function () { return __awaiter(_this, void 0, void 0, function () {
64
+ var ok;
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0: return [4 /*yield*/, copyText(typeof navigator === 'undefined' ? undefined : navigator.clipboard, code)];
68
+ case 1:
69
+ ok = _a.sent();
70
+ if (!mounted.current)
71
+ return [2 /*return*/];
72
+ clearTimeout(timer.current);
73
+ setBlocked(!ok);
74
+ setCopied(ok);
75
+ if (ok)
76
+ timer.current = setTimeout(function () { return setCopied(false); }, 2000);
77
+ return [2 /*return*/];
78
+ }
79
+ });
80
+ }); };
81
+ var blockedId = "".concat(id, "-blocked");
82
+ return (<figure className="m-0 grid w-full min-w-0 max-w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-x-2 gap-y-1">
83
+ <figcaption className="min-w-0 break-words text-caption text-fg-secondary">
84
+ {label}
85
+ {language && <span className="ml-2 text-caption text-fg-secondary">{language}</span>}
86
+ </figcaption>
87
+ <div className="flex-shrink-0">
88
+ <Button size="small" type="tertiary" state="enabled" label={copied ? copiedLabel : copyLabel} aria-label={"".concat(copied ? copiedLabel : copyLabel, " ").concat(label)} aria-describedby={blocked ? blockedId : undefined} onClickButton={handleCopy}/>
89
+ </div>
90
+ <pre id={"".concat(id, "-code")} tabIndex={0} role="region" aria-label={label} className={"col-span-2 m-0 max-w-full overflow-x-auto rounded-control bg-background-panel p-medium font-mono text-body2 text-fg-primary ".concat(wrap ? 'whitespace-pre-wrap break-words' : '', " ").concat(focusRing)}>
91
+ <code>{code}</code>
92
+ </pre>
93
+ {blocked && (<p id={blockedId} role="alert" className="col-span-2 text-error-text text-body2">
94
+ Copying is blocked here. Select the text and copy it.
95
+ </p>)}
96
+ <span role="status" className="sr-only col-span-2">
97
+ {copied ? copiedLabel : ''}
98
+ </span>
99
+ </figure>);
100
+ }
101
+ export { CodeBlock };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export interface LightboxImage {
3
+ src: string;
4
+ /** Required: it names the thumbnail, titles the viewer when there is no caption, and stands in for an image that fails. */
5
+ alt: string;
6
+ /** Shown under the image, and as the viewer's title. */
7
+ caption?: string;
8
+ }
9
+ interface LightboxProps {
10
+ images: LightboxImage[];
11
+ /** The image shown, counted from 0. */
12
+ index: number;
13
+ onIndexChange: (index: number) => void;
14
+ isOpen: boolean;
15
+ onClose: () => void;
16
+ /** Names the dialog. Defaults to 'Image viewer'. The visible title is the image's caption or alt text. */
17
+ 'aria-label'?: string;
18
+ }
19
+ /**
20
+ * Images in a full-size Modal: the image fits the viewport, its caption under it, and '2 of 5' after the title.
21
+ * 'Previous image' and 'Next image', ArrowLeft and ArrowRight, and a 40px swipe on touch step one image and stop at
22
+ * the ends; the Button at an end is disabled and focus moves to the other one, as Pagination does. Escape, the
23
+ * backdrop and Close close it, and the Modal gives focus back to what opened it. Images only: no video.
24
+ */
25
+ export default function Lightbox({ images, index, onIndexChange, isOpen, onClose, 'aria-label': ariaLabel, }: LightboxProps): React.JSX.Element | null;
26
+ /** A thumbnail that opens the Lightbox: a button named 'Open image: <alt>' around a cropped Figure. */
27
+ export declare function LightboxThumbnail({ image, onOpen }: {
28
+ image: LightboxImage;
29
+ onOpen: () => void;
30
+ }): React.JSX.Element;
31
+ export { Lightbox };
@@ -0,0 +1,161 @@
1
+ 'use client';
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
14
+ import { ChevronLeft, ChevronRight, ImageOff, X } from 'lucide-react';
15
+ import Modal from './modal';
16
+ import IconButton from './iconButton';
17
+ import Icon from './icon';
18
+ import Image from './image';
19
+ import Figure from './figure';
20
+ import { formatCount } from './formatNumber';
21
+ import { focusRing } from './sharedStyles';
22
+ // useLayoutEffect warns during server rendering on React 18
23
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
24
+ // A horizontal move this long on touch steps to the next or previous image
25
+ var SWIPE_PX = 40;
26
+ // The image in its frame, or the words that stand in for it when it fails. Mounted per image (keyed by src), so its
27
+ // layout effect attaches the error listener before the browser can report a failure.
28
+ function Frame(_a) {
29
+ var image = _a.image, broken = _a.broken, onBroken = _a.onBroken, onSwipe = _a.onSwipe;
30
+ var ref = useRef(null);
31
+ var start = useRef(null);
32
+ var onBrokenRef = useRef(onBroken);
33
+ onBrokenRef.current = onBroken;
34
+ useIsomorphicLayoutEffect(function () {
35
+ var _a;
36
+ var img = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelector('img');
37
+ if (!img)
38
+ return;
39
+ var fail = function () { return onBrokenRef.current(); };
40
+ img.addEventListener('error', fail);
41
+ return function () { return img.removeEventListener('error', fail); };
42
+ }, []);
43
+ return (<div ref={ref} className="relative min-h-0 flex-1 touch-pan-y touch-pinch-zoom [&_img]:absolute [&_img]:inset-0 [&_img]:h-full [&_img]:w-full" onPointerDown={function (e) {
44
+ start.current = e.pointerType === 'touch' ? { x: e.clientX, y: e.clientY } : null;
45
+ }} onPointerUp={function (e) {
46
+ var s = start.current;
47
+ start.current = null;
48
+ if (!s)
49
+ return;
50
+ var dx = e.clientX - s.x;
51
+ if (Math.abs(dx) < SWIPE_PX || Math.abs(dx) <= Math.abs(e.clientY - s.y))
52
+ return;
53
+ onSwipe(dx < 0 ? 'next' : 'prev');
54
+ }} onPointerCancel={function () {
55
+ start.current = null;
56
+ }}>
57
+ {broken ? (<div className="absolute inset-0 flex flex-col items-center justify-center gap-small rounded-control bg-background-panel p-large text-center">
58
+ <Icon icon={ImageOff} size="medium" color="disabled"/>
59
+ <p className="text-body1 text-fg-primary">This image could not be loaded.</p>
60
+ <p className="text-body2 text-fg-secondary">{image.alt}</p>
61
+ </div>) : (<Image src={image.src} alt={image.alt} fit="contain"/>)}
62
+ </div>);
63
+ }
64
+ /**
65
+ * Images in a full-size Modal: the image fits the viewport, its caption under it, and '2 of 5' after the title.
66
+ * 'Previous image' and 'Next image', ArrowLeft and ArrowRight, and a 40px swipe on touch step one image and stop at
67
+ * the ends; the Button at an end is disabled and focus moves to the other one, as Pagination does. Escape, the
68
+ * backdrop and Close close it, and the Modal gives focus back to what opened it. Images only: no video.
69
+ */
70
+ export default function Lightbox(_a) {
71
+ var images = _a.images, index = _a.index, onIndexChange = _a.onIndexChange, isOpen = _a.isOpen, onClose = _a.onClose, _b = _a["aria-label"], ariaLabel = _b === void 0 ? 'Image viewer' : _b;
72
+ var count = images.length;
73
+ var at = Math.min(Math.max(index, 0), Math.max(count - 1, 0));
74
+ var image = images[at];
75
+ var many = count >= 2;
76
+ var atFirst = at <= 0;
77
+ var atLast = at >= count - 1;
78
+ var viewRef = useRef(null);
79
+ var prevRef = useRef(null);
80
+ var nextRef = useRef(null);
81
+ var pending = useRef(null);
82
+ var onChange = useRef(onIndexChange);
83
+ onChange.current = onIndexChange;
84
+ var _c = useState({}), broken = _c[0], setBroken = _c[1];
85
+ var go = function (to, from) {
86
+ if (to < 0 || to > count - 1 || to === at)
87
+ return;
88
+ if (to === 0 || to === count - 1)
89
+ pending.current = { to: to, focus: from === 'prev' ? 'next' : 'prev' };
90
+ onChange.current(to);
91
+ };
92
+ var goRef = useRef(go);
93
+ goRef.current = go;
94
+ // Focus must not drop to the page when the Button it was on turns disabled at an end
95
+ useEffect(function () {
96
+ var _a, _b;
97
+ var p = pending.current;
98
+ if (!p || p.to !== at)
99
+ return;
100
+ pending.current = null;
101
+ var dialog = (_a = viewRef.current) === null || _a === void 0 ? void 0 : _a.closest('[role="dialog"]');
102
+ var disabled = p.focus === 'prev' ? nextRef.current : prevRef.current;
103
+ var active = document.activeElement;
104
+ if (active && active !== document.body && active !== disabled && (dialog === null || dialog === void 0 ? void 0 : dialog.contains(active)))
105
+ return;
106
+ (_b = (p.focus === 'prev' ? prevRef : nextRef).current) === null || _b === void 0 ? void 0 : _b.focus();
107
+ }, [at]);
108
+ // ArrowLeft and ArrowRight step while focus is in this viewer, wherever it is in the dialog
109
+ useEffect(function () {
110
+ if (!isOpen || !many)
111
+ return;
112
+ var onKey = function (e) {
113
+ var _a;
114
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
115
+ return;
116
+ if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')
117
+ return;
118
+ var dialog = (_a = viewRef.current) === null || _a === void 0 ? void 0 : _a.closest('[role="dialog"]');
119
+ if (!dialog || !(e.target instanceof Node) || !dialog.contains(e.target))
120
+ return;
121
+ e.preventDefault();
122
+ if (e.key === 'ArrowLeft')
123
+ goRef.current(at - 1, 'prev');
124
+ else
125
+ goRef.current(at + 1, 'next');
126
+ };
127
+ document.addEventListener('keydown', onKey);
128
+ return function () { return document.removeEventListener('keydown', onKey); };
129
+ }, [isOpen, many, at]);
130
+ if (!image)
131
+ return null;
132
+ var title = image.caption || image.alt;
133
+ var of = many ? "".concat(formatCount(at + 1), " of ").concat(formatCount(count)) : undefined;
134
+ return (<Modal isOpen={isOpen} onClose={onClose} size="fill" title={title} secondTitle={of} aria-label={ariaLabel} actions={<IconButton color="iconOnly" size="medium" state="enabled" icon={X} ariaLabel="Close" onClick={onClose}/>}>
135
+ <div ref={viewRef} className="flex h-full min-h-0 flex-col gap-medium">
136
+ <figure className="flex min-h-0 flex-1 flex-col gap-medium">
137
+ <Frame key={image.src} image={image} broken={!!broken[image.src]} onBroken={function () { return setBroken(function (b) {
138
+ var _a;
139
+ return (__assign(__assign({}, b), (_a = {}, _a[image.src] = true, _a)));
140
+ }); }} onSwipe={function (direction) { return (direction === 'next' ? go(at + 1, 'next') : go(at - 1, 'prev')); }}/>
141
+ {image.caption && <figcaption aria-hidden="true" className="text-body2 text-fg-secondary">{image.caption}</figcaption>}
142
+ </figure>
143
+ {many && (<div className="flex shrink-0 items-center justify-between gap-medium">
144
+ <IconButton ref={prevRef} color="tertiary" size="large" state={atFirst ? 'disabled' : 'enabled'} icon={ChevronLeft} ariaLabel="Previous image" onClick={function () { return go(at - 1, 'prev'); }}/>
145
+ {/* The count is in the title; say it when it changes, as the title is not read again */}
146
+ <span className="sr-only" aria-live="polite" aria-atomic="true">{image.caption ? "".concat(image.caption, ". ").concat(image.alt, ", ").concat(of) : "".concat(image.alt, ", ").concat(of)}</span>
147
+ <IconButton ref={nextRef} color="tertiary" size="large" state={atLast ? 'disabled' : 'enabled'} icon={ChevronRight} ariaLabel="Next image" onClick={function () { return go(at + 1, 'next'); }}/>
148
+ </div>)}
149
+ </div>
150
+ </Modal>);
151
+ }
152
+ /** A thumbnail that opens the Lightbox: a button named 'Open image: <alt>' around a cropped Figure. */
153
+ export function LightboxThumbnail(_a) {
154
+ var image = _a.image, onOpen = _a.onOpen;
155
+ return (<button type="button" aria-label={"Open image: ".concat(image.alt)} onClick={onOpen} className={"block w-full cursor-zoom-in rounded-container transition-opacity hover:opacity-90 motion-reduce:transition-none ".concat(focusRing)}>
156
+ <Figure crop={4 / 3}>
157
+ <Image src={image.src} alt=""/>
158
+ </Figure>
159
+ </button>);
160
+ }
161
+ export { Lightbox };
@@ -4,7 +4,16 @@ interface LinkCardProps {
4
4
  title: string;
5
5
  /** A small line under the title, in the mono face. */
6
6
  caption?: string;
7
+ /** A body2 line under the title that says what is there. */
8
+ description?: string;
9
+ /** An image on top of the card, cropped to 16:9. Its alt text joins the link's name: use "" when the title says it all. */
10
+ image?: {
11
+ src: string;
12
+ alt: string;
13
+ };
14
+ /** Opens the link in a new tab (`target="_blank"`, `rel="noopener noreferrer"`) and says so to a screen reader. */
15
+ external?: boolean;
7
16
  className?: string;
8
17
  }
9
- export default function LinkCard({ href, title, caption, className }: LinkCardProps): React.JSX.Element;
18
+ export default function LinkCard({ href, title, caption, description, image, external, className }: LinkCardProps): React.JSX.Element;
10
19
  export {};
@@ -2,15 +2,41 @@
2
2
  import React from 'react';
3
3
  import NextLink from 'next/link';
4
4
  import Icon from './icon';
5
+ import Figure from './figure';
6
+ import Image from './image';
5
7
  import { focusRing } from './sharedStyles';
6
8
  // A link set as a card: the title, a caption, and an arrow that moves off the corner.
7
9
  export default function LinkCard(_a) {
8
- var href = _a.href, title = _a.title, caption = _a.caption, _b = _a.className, className = _b === void 0 ? '' : _b;
9
- return (<NextLink href={href} className={"group flex items-center justify-between gap-xxlarge rounded-container bg-background-panel p-large transition-colors hover:bg-background-accent200 motion-reduce:transition-none ".concat(focusRing, " ").concat(className)}>
10
- <span className="flex flex-col gap-small">
11
- <span className="text-subtitle1 text-fg-primary">{title}</span>
12
- {caption && <span className="font-mono text-caption text-fg-secondary">{caption}</span>}
10
+ var href = _a.href, title = _a.title, caption = _a.caption, description = _a.description, image = _a.image, _b = _a.external, external = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c;
11
+ var text = (<span className="flex flex-col gap-small">
12
+ <span className="text-subtitle1 text-fg-primary">
13
+ {title}
14
+ {external && <span className="sr-only">, opens in a new tab</span>}
13
15
  </span>
14
- <Icon name="ArrowUpRight" size="small" color="secondary" className="shrink-0 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5 motion-reduce:transition-none"/>
16
+ {description && <span className="text-body2 text-fg-secondary">{description}</span>}
17
+ {caption && <span className="font-mono text-caption text-fg-secondary">{caption}</span>}
18
+ </span>);
19
+ var arrow = (<Icon name="ArrowUpRight" size="small" color="secondary" className="shrink-0 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5 motion-reduce:transition-none"/>);
20
+ var look = "rounded-container bg-background-panel p-large transition-colors hover:bg-background-accent200 motion-reduce:transition-none ".concat(focusRing, " ").concat(className);
21
+ var content = image ? (<>
22
+ <Figure crop={16 / 9} radius="control">
23
+ <Image src={image.src} alt={image.alt}/>
24
+ </Figure>
25
+ <span className="flex items-center justify-between gap-xxlarge">
26
+ {text}
27
+ {arrow}
28
+ </span>
29
+ </>) : (<>
30
+ {text}
31
+ {arrow}
32
+ </>);
33
+ var classes = image ? "group flex flex-col gap-medium ".concat(look) : "group flex items-center justify-between gap-xxlarge ".concat(look);
34
+ if (external) {
35
+ return (<a href={href} target="_blank" rel="noopener noreferrer" className={classes}>
36
+ {content}
37
+ </a>);
38
+ }
39
+ return (<NextLink href={href} className={classes}>
40
+ {content}
15
41
  </NextLink>);
16
42
  }
@@ -6,8 +6,16 @@ interface ModalProps {
6
6
  children: React.ReactNode;
7
7
  onClose: () => void;
8
8
  actions?: React.ReactNode;
9
- size?: 'small' | 'medium' | 'large';
9
+ /** `fill` is the viewport less 16px on a phone and 32px from md, for a Lightbox. */
10
+ size?: 'small' | 'medium' | 'large' | 'fill';
10
11
  initialFocus?: 'first' | 'body';
12
+ /**
13
+ * Names the dialog when it has no title (a search dialog), or in place of a title that changes as the
14
+ * dialog is used (a Lightbox, whose title is the image shown). Wins over the title for the name.
15
+ */
16
+ 'aria-label'?: string;
17
+ /** `top` sits the panel at the top below sm, so a phone keyboard does not cover a field in it. Centered from sm up. Default 'center'. */
18
+ placement?: 'center' | 'top';
11
19
  }
12
- export default function Modal({ isOpen, title, secondTitle, children, onClose, actions, size, initialFocus, }: ModalProps): React.JSX.Element | null;
20
+ export default function Modal({ isOpen, title, secondTitle, children, onClose, actions, size, initialFocus, 'aria-label': ariaLabel, placement, }: ModalProps): React.JSX.Element | null;
13
21
  export {};
@@ -5,11 +5,11 @@ import { useOverlayTransition } from './useOverlayTransition';
5
5
  import { initialFocusCandidates } from '../internal/modal';
6
6
  import { PICKABLE, claimEvent, isTopOverlay, lockScroll, popOverlay, pushOverlay, trapTab, unlockScroll } from '../internal/overlayStack';
7
7
  export default function Modal(_a) {
8
- var isOpen = _a.isOpen, title = _a.title, secondTitle = _a.secondTitle, children = _a.children, onClose = _a.onClose, actions = _a.actions, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.initialFocus, initialFocus = _c === void 0 ? 'first' : _c;
8
+ var isOpen = _a.isOpen, title = _a.title, secondTitle = _a.secondTitle, children = _a.children, onClose = _a.onClose, actions = _a.actions, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.initialFocus, initialFocus = _c === void 0 ? 'first' : _c, ariaLabel = _a["aria-label"], _d = _a.placement, placement = _d === void 0 ? 'center' : _d;
9
9
  var panelRef = useRef(null);
10
10
  var bodyRef = useRef(null);
11
11
  var titleId = useId();
12
- var _d = useOverlayTransition(isOpen), mounted = _d.mounted, visible = _d.visible;
12
+ var _e = useOverlayTransition(isOpen), mounted = _e.mounted, visible = _e.visible;
13
13
  // Keep onClose in a ref so a new function each render doesn't re-run the focus effect
14
14
  var onCloseRef = useRef(onClose);
15
15
  onCloseRef.current = onClose;
@@ -62,7 +62,14 @@ export default function Modal(_a) {
62
62
  medium: { width: 'w-[600px]', maxWidth: '600px' },
63
63
  large: { width: 'w-[1024px]', maxWidth: '1024px' },
64
64
  };
65
- var _e = sizeConfig[size], modalWidth = _e.width, maxWidth = _e.maxWidth;
65
+ var fill = size === 'fill';
66
+ var _f = fill
67
+ ? { width: 'w-[calc(100vw-16px)] h-[calc(100dvh-16px)] md:w-[calc(100vw-32px)] md:h-[calc(100dvh-32px)]', maxWidth: undefined }
68
+ : sizeConfig[size], modalWidth = _f.width, maxWidth = _f.maxWidth;
69
+ var panelStyle = fill
70
+ ? { overflow: 'hidden' }
71
+ : { maxWidth: maxWidth, width: 'calc(100vw - 64px)', maxHeight: '90vh', overflow: 'hidden' };
72
+ var align = placement === 'top' ? 'items-start pt-2 sm:items-center sm:pt-0' : 'items-center';
66
73
  // close modal by clicking elsewhere
67
74
  var handleOverlayClick = function (e) {
68
75
  if (e.target === e.currentTarget) {
@@ -72,14 +79,12 @@ export default function Modal(_a) {
72
79
  if (!mounted)
73
80
  return null;
74
81
  // dark-only edge: a ring only in dark mode, so it keeps a dark: variant (it follows whatever dark variant the app's preset/@theme defines, class-only or OS-aware)
75
- return (<div className={"fixed bg-misc-scrim/40 flex items-center justify-center z-[var(--os-z-overlay)]\n transition-opacity duration-[var(--os-duration-fast)] ease-out motion-reduce:transition-none ".concat(visible ? 'opacity-100' : 'opacity-0')} style={{ top: 0, left: 0, right: 0, bottom: 0 }} onClick={handleOverlayClick}>
76
- <div ref={panelRef} role="dialog" aria-modal="true" aria-labelledby={title ? titleId : undefined} tabIndex={-1} className={"bg-background-elevated dark:ring-1 dark:ring-misc-divider rounded-control ".concat(modalWidth, " flex flex-col outline-none\n ").concat(overlayTransition, " ").concat(visible ? overlayVisible : overlayHidden)} style={{
77
- maxWidth: maxWidth,
78
- width: 'calc(100vw - 64px)',
79
- maxHeight: '90vh',
80
- overflow: 'hidden',
81
- }}>
82
- {(title || actions) && (<div className="px-6 py-3 border-b border-misc-divider flex justify-between items-start" style={{ flexShrink: 0 }}>
82
+ return (<div className={"fixed bg-misc-scrim/40 flex ".concat(align, " justify-center z-[var(--os-z-overlay)]\n transition-opacity duration-[var(--os-duration-fast)] ease-out motion-reduce:transition-none ").concat(visible ? 'opacity-100' : 'opacity-0')} style={{ top: 0, left: 0, right: 0, bottom: 0 }} onClick={handleOverlayClick}>
83
+ <div ref={panelRef} role="dialog" aria-modal="true" aria-label={ariaLabel} aria-labelledby={title && !ariaLabel ? titleId : undefined} tabIndex={-1} className={"bg-background-elevated dark:ring-1 dark:ring-misc-divider rounded-control ".concat(modalWidth, " flex flex-col outline-none\n ").concat(overlayTransition, " ").concat(visible ? overlayVisible : overlayHidden)} style={panelStyle}>
84
+ {(title || actions) && (
85
+ // Below sm the header wraps and the actions take their own line, end-aligned, so a long action is never cut off.
86
+ // Each phone class is undone from sm up.
87
+ <div className="px-6 py-3 border-b border-misc-divider flex justify-between items-start flex-wrap gap-y-2 sm:flex-nowrap sm:gap-y-0" style={{ flexShrink: 0 }}>
83
88
  {title && (<div className="flex flex-col">
84
89
  <h2 id={titleId} className="text-h5 text-fg-primary">
85
90
  {title}
@@ -88,7 +93,7 @@ export default function Modal(_a) {
88
93
  {secondTitle}
89
94
  </span>)}
90
95
  </div>)}
91
- {actions && (<div className="flex space-x-2">
96
+ {actions && (<div className="flex space-x-2 basis-full justify-end sm:basis-auto sm:justify-start">
92
97
  {actions}
93
98
  </div>)}
94
99
  </div>)}
@@ -16,7 +16,7 @@ export default function PageHeader(_a) {
16
16
  {eyebrow && (<Paragraph tone="secondary" size="body2" measure="none">
17
17
  {eyebrow}
18
18
  </Paragraph>)}
19
- <Tag className={"".concat(sizes[level], " text-fg-primary")}>{title}</Tag>
19
+ <Tag className={"".concat(sizes[level], " break-words text-fg-primary")}>{title}</Tag>
20
20
  {lede && (<Paragraph tone="secondary" measure="lede">
21
21
  {lede}
22
22
  </Paragraph>)}