@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.
Files changed (158) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/CONSUMING.md +1 -1
  3. package/bin/wmds-check.mjs +8 -4
  4. package/dist/components/atoms/TextLink/TextLink.d.ts +9 -3
  5. package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
  6. package/dist/components/atoms/TextLink/TextLink.js +22 -17
  7. package/dist/components/molecules/IndexList/IndexList.d.ts +6 -3
  8. package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -1
  9. package/dist/components/molecules/IndexList/IndexList.js +22 -21
  10. package/dist/components/molecules/LinkTile/LinkTile.d.ts.map +1 -1
  11. package/dist/components/molecules/LinkTile/LinkTile.js +74 -68
  12. package/dist/components/molecules/LinkTile/linkTileStyles.d.ts +7 -1
  13. package/dist/components/molecules/LinkTile/linkTileStyles.d.ts.map +1 -1
  14. package/dist/components/molecules/LinkTile/linkTileStyles.js +2 -2
  15. package/dist/components/molecules/TileGrid/tileGridStyles.d.ts +2 -2
  16. package/dist/lib/typography.d.ts +2 -2
  17. package/dist/lib/typography.d.ts.map +1 -1
  18. package/dist/lib/typography.js +11 -0
  19. package/dist/styles.css +1 -1
  20. package/dist/typography.css +16 -0
  21. package/docs/components.md +7 -7
  22. package/docs/exports.json +1 -1
  23. package/docs/patterns/components-accordion--flush.tsx +1 -1
  24. package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
  25. package/docs/patterns/components-badge--outline-tags.tsx +1 -1
  26. package/docs/patterns/components-badge--with-avatar.tsx +1 -1
  27. package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
  28. package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
  29. package/docs/patterns/components-breadcrumb--path.tsx +1 -1
  30. package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
  31. package/docs/patterns/components-button-button--copy-button.tsx +1 -1
  32. package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
  33. package/docs/patterns/components-button-button--external-link.tsx +1 -1
  34. package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
  35. package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
  36. package/docs/patterns/components-button-button--link-render.tsx +1 -1
  37. package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
  38. package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
  39. package/docs/patterns/components-button-button--primary-action.tsx +1 -1
  40. package/docs/patterns/components-button-button--row-hug.tsx +1 -1
  41. package/docs/patterns/components-button-button--row-layout.tsx +1 -1
  42. package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
  43. package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
  44. package/docs/patterns/components-button-button--with-count.tsx +1 -1
  45. package/docs/patterns/components-button-button--with-icon.tsx +1 -1
  46. package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
  47. package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
  48. package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
  49. package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
  50. package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
  51. package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
  52. package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
  53. package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
  54. package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
  55. package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
  56. package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
  57. package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
  58. package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
  59. package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
  60. package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
  61. package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
  62. package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
  63. package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
  64. package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
  65. package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
  66. package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
  67. package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
  68. package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
  69. package/docs/patterns/components-descriptionlist--details.tsx +1 -1
  70. package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
  71. package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
  72. package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
  73. package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
  74. package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
  75. package/docs/patterns/components-field--horizontal-input.tsx +1 -1
  76. package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
  77. package/docs/patterns/components-field--multi-control.tsx +1 -1
  78. package/docs/patterns/components-filterpanel--panel.tsx +1 -1
  79. package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
  80. package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
  81. package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
  82. package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
  83. package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
  84. package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
  85. package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
  86. package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
  87. package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
  88. package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
  89. package/docs/patterns/components-indexlist--post-index.tsx +1 -1
  90. package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
  91. package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
  92. package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
  93. package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
  94. package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
  95. package/docs/patterns/components-kbd--command-row.tsx +1 -1
  96. package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
  97. package/docs/patterns/components-kbd--shortcut.tsx +1 -1
  98. package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
  99. package/docs/patterns/components-linktile--router-link.tsx +1 -1
  100. package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
  101. package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
  102. package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
  103. package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
  104. package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
  105. package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
  106. package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
  107. package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
  108. package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
  109. package/docs/patterns/components-prose--article-body.tsx +1 -1
  110. package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
  111. package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
  112. package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
  113. package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
  114. package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
  115. package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
  116. package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
  117. package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
  118. package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
  119. package/docs/patterns/components-sitenav--compact.tsx +1 -1
  120. package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
  121. package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
  122. package/docs/patterns/components-stat--insights-row.tsx +1 -1
  123. package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
  124. package/docs/patterns/components-switch--default.tsx +1 -1
  125. package/docs/patterns/components-switch--settings-row.tsx +1 -1
  126. package/docs/patterns/components-tab--settings-pages.tsx +1 -1
  127. package/docs/patterns/components-taskrows--action-details.tsx +1 -1
  128. package/docs/patterns/components-taskrows--capsules.tsx +1 -1
  129. package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
  130. package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
  131. package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
  132. package/docs/patterns/components-taskrows--status-list.tsx +1 -1
  133. package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
  134. package/docs/patterns/components-textlink--external-destination.tsx +1 -1
  135. package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
  136. package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
  137. package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
  138. package/docs/patterns/components-textsequence--default.tsx +1 -1
  139. package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
  140. package/docs/patterns/components-textsequence--shapes.tsx +1 -1
  141. package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
  142. package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
  143. package/docs/patterns/components-tooltip--controlled.tsx +1 -1
  144. package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
  145. package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
  146. package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
  147. package/docs/patterns/components-tooltip--placement.tsx +1 -1
  148. package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
  149. package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
  150. package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
  151. package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
  152. package/docs/patterns/guides-filter-panel--filtered-index.tsx +7 -3
  153. package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
  154. package/docs/patterns/guides-post-page--post-page.tsx +21 -4
  155. package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
  156. package/docs/patterns/guides-resource-detail--detail.tsx +13 -4
  157. package/docs/patterns/index.json +1 -1
  158. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- // @thewhatmatters/wmds@0.4.8 · Pattern — post page
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 key={category.href} emphasis="outline" mono render={<a href={category.href} />}>
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 items={post.breadcrumb} variant="mono" separator="slash" className="mb-3" />
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.8 · Pattern — editorial profile
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.8 · Pattern — resource detail
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 items={breadcrumb} variant="mono" separator="slash" className="col-span-full mb-6" />
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>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@thewhatmatters/wmds",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "patterns": [
5
5
  {
6
6
  "id": "components-accordion--flush",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thewhatmatters/wmds",
3
3
  "description": "WhatMatters Design System — React components, Tailwind v4 theme, and Storybook patterns",
4
- "version": "0.4.8",
4
+ "version": "0.4.9",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {