@thewhatmatters/wmds 0.4.8 → 0.4.9
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.
- package/CHANGELOG.md +31 -2
- package/CONSUMING.md +1 -1
- package/bin/wmds-check.mjs +8 -4
- package/dist/components/atoms/TextLink/TextLink.d.ts +9 -3
- package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/TextLink.js +22 -17
- package/dist/components/molecules/IndexList/IndexList.d.ts +6 -3
- package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -1
- package/dist/components/molecules/IndexList/IndexList.js +22 -21
- package/dist/components/molecules/LinkTile/LinkTile.d.ts.map +1 -1
- package/dist/components/molecules/LinkTile/LinkTile.js +74 -68
- package/dist/components/molecules/LinkTile/linkTileStyles.d.ts +7 -1
- package/dist/components/molecules/LinkTile/linkTileStyles.d.ts.map +1 -1
- package/dist/components/molecules/LinkTile/linkTileStyles.js +2 -2
- package/dist/components/molecules/TileGrid/tileGridStyles.d.ts +2 -2
- package/dist/lib/typography.d.ts +2 -2
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/lib/typography.js +11 -0
- package/dist/styles.css +1 -1
- package/dist/typography.css +16 -0
- package/docs/components.md +7 -7
- package/docs/exports.json +1 -1
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-filterpanel--panel.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
- package/docs/patterns/components-linktile--router-link.tsx +1 -1
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +7 -3
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +21 -4
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +13 -4
- package/docs/patterns/index.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.9 · Pattern — post page
|
|
2
2
|
// Storybook: Guides/Post page → Pattern — post page (?path=/story/guides-post-page--post-page)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
5
|
-
import { useEffect, useId, useState, type ReactNode } from "react";
|
|
5
|
+
import { useEffect, useId, useState, type ReactElement, type ReactNode } from "react";
|
|
6
6
|
import { Copy, FileText } from "lucide-react";
|
|
7
7
|
import {
|
|
8
8
|
Badge,
|
|
@@ -107,6 +107,11 @@ export interface PostPageProps {
|
|
|
107
107
|
* and tab order at every width, so pair "after" with metadataSide="end" and "before" with "start".
|
|
108
108
|
*/
|
|
109
109
|
metadataStack?: PostMetadataStack;
|
|
110
|
+
/**
|
|
111
|
+
* The router's link for the breadcrumb and the category tags, in place of a plain anchor —
|
|
112
|
+
* (link) => <Link href={link.href} />.
|
|
113
|
+
*/
|
|
114
|
+
renderLink?: (link: { label: string; href: string }) => ReactElement;
|
|
110
115
|
/** Page-level layers inside the page grid — for example a GridOverlay. */
|
|
111
116
|
overlay?: ReactNode;
|
|
112
117
|
}
|
|
@@ -118,6 +123,7 @@ export function PostPage({
|
|
|
118
123
|
metadataSide = "start",
|
|
119
124
|
metadataColumns = 4,
|
|
120
125
|
metadataStack = "after",
|
|
126
|
+
renderLink,
|
|
121
127
|
overlay,
|
|
122
128
|
}: PostPageProps) {
|
|
123
129
|
const metadataHeadingId = useId();
|
|
@@ -153,7 +159,12 @@ export function PostPage({
|
|
|
153
159
|
<DescriptionList.Item name="Reading time">{post.readingTime}</DescriptionList.Item>
|
|
154
160
|
<DescriptionList.Item name="Categories">
|
|
155
161
|
{post.categories.map((category) => (
|
|
156
|
-
<Badge
|
|
162
|
+
<Badge
|
|
163
|
+
key={category.href}
|
|
164
|
+
emphasis="outline"
|
|
165
|
+
mono
|
|
166
|
+
render={renderLink != null ? renderLink(category) : <a href={category.href} />}
|
|
167
|
+
>
|
|
157
168
|
{category.label}
|
|
158
169
|
</Badge>
|
|
159
170
|
))}
|
|
@@ -191,7 +202,13 @@ export function PostPage({
|
|
|
191
202
|
{overlay}
|
|
192
203
|
<article className="band py-6 sm:py-10 lg:py-14">
|
|
193
204
|
<header className="col-span-full mb-4 flex flex-col gap-3 sm:mb-8 lg:col-span-10">
|
|
194
|
-
<Breadcrumb
|
|
205
|
+
<Breadcrumb
|
|
206
|
+
items={post.breadcrumb}
|
|
207
|
+
variant="mono"
|
|
208
|
+
separator="slash"
|
|
209
|
+
renderLink={renderLink}
|
|
210
|
+
className="mb-3"
|
|
211
|
+
/>
|
|
195
212
|
<h1 className="type-display-2 text-balance text-fg">{post.title}</h1>
|
|
196
213
|
<p className="type-reading max-w-[40rem] text-muted">{post.description}</p>
|
|
197
214
|
{stackedAfter ? (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.9 · Pattern — editorial profile
|
|
2
2
|
// Storybook: Guides/Profile typography → Pattern — editorial profile (?path=/story/guides-profile-typography--editorial-profile)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.9 · Pattern — resource detail
|
|
2
2
|
// Storybook: Guides/Resource detail → Pattern — resource detail (?path=/story/guides-resource-detail--detail)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
5
|
-
import { useEffect, useId, type ReactNode } from "react";
|
|
5
|
+
import { useEffect, useId, type ReactElement, type ReactNode } from "react";
|
|
6
6
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7
7
|
import {
|
|
8
8
|
Badge,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Dialog,
|
|
13
13
|
IconButton,
|
|
14
14
|
type BreadcrumbItemDef,
|
|
15
|
+
type BreadcrumbLinkItem,
|
|
15
16
|
} from "@thewhatmatters/wmds";
|
|
16
17
|
|
|
17
18
|
export interface ResourceImage {
|
|
@@ -233,6 +234,8 @@ export interface ResourceDetailPageProps {
|
|
|
233
234
|
item: ResourceDetailItem;
|
|
234
235
|
/** The path to this resource, ending with it — Home, Resources, this resource. */
|
|
235
236
|
breadcrumb: BreadcrumbItemDef[];
|
|
237
|
+
/** The router's link for the breadcrumb, in place of a plain anchor — (item) => <Link href={item.href} />. */
|
|
238
|
+
renderLink?: (item: BreadcrumbLinkItem) => ReactElement;
|
|
236
239
|
/** The app's image component, in place of img — (image) => <Image {...image} sizes="…" />. */
|
|
237
240
|
renderImage?: (image: ResourceImage) => ReactNode;
|
|
238
241
|
/** Page-level layers inside the page grid — for example a GridOverlay. */
|
|
@@ -240,14 +243,20 @@ export interface ResourceDetailPageProps {
|
|
|
240
243
|
}
|
|
241
244
|
|
|
242
245
|
/** The detail as its own page: opened directly, or from a shared link. */
|
|
243
|
-
export function ResourceDetailPage({ item, breadcrumb, renderImage, overlay }: ResourceDetailPageProps) {
|
|
246
|
+
export function ResourceDetailPage({ item, breadcrumb, renderLink, renderImage, overlay }: ResourceDetailPageProps) {
|
|
244
247
|
const headingId = useId();
|
|
245
248
|
|
|
246
249
|
return (
|
|
247
250
|
<main className="grid-page bg-body">
|
|
248
251
|
{overlay}
|
|
249
252
|
<article aria-labelledby={headingId} className="band py-6 sm:py-10 lg:py-14">
|
|
250
|
-
<Breadcrumb
|
|
253
|
+
<Breadcrumb
|
|
254
|
+
items={breadcrumb}
|
|
255
|
+
variant="mono"
|
|
256
|
+
separator="slash"
|
|
257
|
+
renderLink={renderLink}
|
|
258
|
+
className="col-span-full mb-6"
|
|
259
|
+
/>
|
|
251
260
|
<div className="col-span-full lg:col-span-8">
|
|
252
261
|
<ResourceMedia item={item} renderImage={renderImage} />
|
|
253
262
|
</div>
|
package/docs/patterns/index.json
CHANGED
package/package.json
CHANGED