@thewhatmatters/wmds 0.2.0 → 0.3.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 (134) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/CONSUMING.md +4 -4
  3. package/README.md +3 -3
  4. package/dist/styles.css +1 -1
  5. package/docs/component-contracts.md +1 -1
  6. package/docs/components.md +6 -6
  7. package/docs/exports.json +1 -13
  8. package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
  9. package/docs/patterns/components-badge--with-avatar.tsx +1 -1
  10. package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
  11. package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
  12. package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
  13. package/docs/patterns/components-button-button--link-render.tsx +1 -1
  14. package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
  15. package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
  16. package/docs/patterns/components-button-button--primary-action.tsx +1 -1
  17. package/docs/patterns/components-button-button--row-hug.tsx +1 -1
  18. package/docs/patterns/components-button-button--row-layout.tsx +1 -1
  19. package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
  20. package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
  21. package/docs/patterns/components-button-button--with-count.tsx +1 -1
  22. package/docs/patterns/components-button-button--with-icon.tsx +1 -1
  23. package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
  24. package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
  25. package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
  26. package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
  27. package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
  28. package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
  29. package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
  30. package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
  31. package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
  32. package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
  33. package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
  34. package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
  35. package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
  36. package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
  37. package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
  38. package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
  39. package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
  40. package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
  41. package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
  42. package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
  43. package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
  44. package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
  45. package/docs/patterns/components-field--horizontal-input.tsx +1 -1
  46. package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
  47. package/docs/patterns/components-field--multi-control.tsx +1 -1
  48. package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
  49. package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
  50. package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
  51. package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
  52. package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
  53. package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
  54. package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
  55. package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
  56. package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
  57. package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
  58. package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
  59. package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
  60. package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
  61. package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
  62. package/docs/patterns/components-kbd--command-row.tsx +1 -1
  63. package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
  64. package/docs/patterns/components-kbd--shortcut.tsx +1 -1
  65. package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
  66. package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
  67. package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
  68. package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
  69. package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
  70. package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
  71. package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
  72. package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
  73. package/docs/patterns/components-promptbar--pattern-marketing-composer.tsx +3 -3
  74. package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
  75. package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
  76. package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
  77. package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
  78. package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
  79. package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
  80. package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
  81. package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
  82. package/docs/patterns/components-sitenav--compact.tsx +1 -1
  83. package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
  84. package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
  85. package/docs/patterns/components-stat--insights-row.tsx +1 -1
  86. package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
  87. package/docs/patterns/components-switch--default.tsx +1 -1
  88. package/docs/patterns/components-switch--settings-row.tsx +1 -1
  89. package/docs/patterns/components-tab--settings-pages.tsx +1 -1
  90. package/docs/patterns/components-taskrows--action-details.tsx +1 -1
  91. package/docs/patterns/components-taskrows--capsules.tsx +1 -1
  92. package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
  93. package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
  94. package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
  95. package/docs/patterns/components-taskrows--status-list.tsx +1 -1
  96. package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
  97. package/docs/patterns/components-textlink--external-destination.tsx +1 -1
  98. package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
  99. package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
  100. package/docs/patterns/components-textsequence--default.tsx +1 -1
  101. package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
  102. package/docs/patterns/components-textsequence--shapes.tsx +1 -1
  103. package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
  104. package/docs/patterns/components-tooltip--controlled.tsx +1 -1
  105. package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
  106. package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
  107. package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
  108. package/docs/patterns/components-tooltip--placement.tsx +1 -1
  109. package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
  110. package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
  111. package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
  112. package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
  113. package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
  114. package/docs/patterns/index.json +1 -153
  115. package/package.json +1 -1
  116. package/docs/patterns/sites-pitchkit-account-settings--account-settings-owner.tsx +0 -265
  117. package/docs/patterns/sites-pitchkit-creator-identity--creator-identity-owner-settings.tsx +0 -154
  118. package/docs/patterns/sites-pitchkit-creator-identity--creator-identity-public.tsx +0 -96
  119. package/docs/patterns/sites-pitchkit-insights-and-kit--creator-insights-loading.tsx +0 -1006
  120. package/docs/patterns/sites-pitchkit-insights-and-kit--creator-insights.tsx +0 -1031
  121. package/docs/patterns/sites-pitchkit-insights-and-kit--insufficient-audience-data.tsx +0 -1015
  122. package/docs/patterns/sites-pitchkit-insights-and-kit--insufficient-reach-and-audience-data.tsx +0 -1017
  123. package/docs/patterns/sites-pitchkit-insights-and-kit--insufficient-reach-data.tsx +0 -1033
  124. package/docs/patterns/sites-pitchkit-insights-and-kit--owner-pitch-kit.tsx +0 -838
  125. package/docs/patterns/sites-pitchkit-insights-and-kit--shareable-pitch-kit.tsx +0 -608
  126. package/docs/patterns/sites-pitchkit-intro--intro-owner.tsx +0 -161
  127. package/docs/patterns/sites-pitchkit-intro--intro-public.tsx +0 -111
  128. package/docs/patterns/sites-pitchkit-past-brands--past-brands-owner.tsx +0 -611
  129. package/docs/patterns/sites-pitchkit-past-brands--past-brands-public.tsx +0 -299
  130. package/docs/patterns/sites-pitchkit-theme-picker--theme-picker-owner.tsx +0 -832
  131. package/docs/patterns/sites-whatmatters-intake--start-a-project-pattern.tsx +0 -234
  132. package/docs/patterns/sites-whatmatters-marketing-landing--marketing-landing.tsx +0 -87
  133. package/docs/patterns/sites-whatmatters-prompt-chat--landing-to-chat.tsx +0 -899
  134. package/docs/patterns/sites-whatmatters-rfp-submitted--rfp-submitted.tsx +0 -302
@@ -1,299 +0,0 @@
1
- // @thewhatmatters/wmds@0.2.0 · Pattern — past brands (public)
2
- // Storybook: Sites/PitchKit/Past brands → Pattern — past brands (public) (?path=/story/sites-pitchkit-past-brands--past-brands-public)
3
- // Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
4
-
5
- import { useLayoutEffect, useRef, useState, type CSSProperties } from "react";
6
- import { Avatar, Card, Chip, cardTitleClasses } from "@thewhatmatters/wmds";
7
-
8
- const compactNumber = new Intl.NumberFormat("en", {
9
- notation: "compact",
10
- maximumFractionDigits: 1,
11
- });
12
-
13
-
14
- export interface PitchKitCreatorIdentity {
15
- displayName?: string;
16
- /** Without the @ — shown as @handle, shared as /k/[handle]. */
17
- handle: string;
18
- profilePictureUrl?: string;
19
- followersCount?: number;
20
- professionalAccount?: "Business" | "Creator";
21
- connected?: boolean;
22
- lastSyncedLabel?: string;
23
- }
24
-
25
- function CreatorIdentityStrip({
26
- identity,
27
- nameAs = "h1",
28
- showProfessionalChip = false,
29
- }: {
30
- identity: PitchKitCreatorIdentity;
31
- nameAs?: "h1" | "p";
32
- showProfessionalChip?: boolean;
33
- }) {
34
- const NameTag = nameAs;
35
- const avatarName = identity.displayName ?? identity.handle;
36
- const handleLabel = `@${identity.handle}`;
37
- const followerLabel =
38
- identity.followersCount == null
39
- ? null
40
- : `${compactNumber.format(identity.followersCount)} followers`;
41
- const meta = [handleLabel, followerLabel].filter(Boolean).join(" · ");
42
- const showTitleRow =
43
- identity.displayName != null ||
44
- (showProfessionalChip && identity.professionalAccount != null);
45
-
46
- return (
47
- <div className="flex flex-wrap items-center gap-4">
48
- <Avatar
49
- name={avatarName}
50
- src={identity.profilePictureUrl}
51
- size="lg"
52
- />
53
- <div className="flex min-w-0 flex-col gap-1">
54
- {showTitleRow ? (
55
- <div className="flex flex-wrap items-center gap-2">
56
- {identity.displayName != null ? (
57
- <NameTag className="type-heading-2 text-fg">
58
- {identity.displayName}
59
- </NameTag>
60
- ) : null}
61
- {showProfessionalChip && identity.professionalAccount != null ? (
62
- <Chip readOnly size="sm">
63
- {identity.professionalAccount}
64
- </Chip>
65
- ) : null}
66
- </div>
67
- ) : null}
68
- <p className="type-body text-fg text-muted">{meta}</p>
69
- </div>
70
- </div>
71
- );
72
- }
73
-
74
-
75
- export interface PitchKitPastBrand {
76
- id: string;
77
- name: string;
78
- /** Curated mark key — missing or unknown keys use a letter Avatar. */
79
- logo_key?: string;
80
- result_label?: string;
81
- }
82
-
83
- const PITCHKIT_BRAND_RESULT_MAX = 24;
84
- const PITCHKIT_BRAND_LOGO_LETTER = "letter";
85
-
86
- const pitchKitBrandLogoKeys = [
87
- "nike", "adidas", "apple", "google", "meta", "amazon", "spotify", "netflix",
88
- "sephora", "glossier", "nordstrom", "target", "walmart", "starbucks",
89
- "coca-cola", "pepsi", "samsung", "microsoft", "adobe", "shopify",
90
- "uber", "airbnb", "disney", "lululemon", "reebok", "puma",
91
- "dior", "chanel", "bmw", "ford", "chase", "visa",
92
- ];
93
-
94
- const pastBrandLogoKeySet = new Set(pitchKitBrandLogoKeys);
95
-
96
- function resolvePastBrandLogoKey(logoKey: string | null | undefined) {
97
- if (logoKey == null || logoKey === "" || logoKey === PITCHKIT_BRAND_LOGO_LETTER) {
98
- return undefined;
99
- }
100
- return pastBrandLogoKeySet.has(logoKey) ? logoKey : undefined;
101
- }
102
-
103
- function pastBrandLogoMonogram(logoKey: string) {
104
- const parts = logoKey.split("-");
105
- if (parts.length > 1) {
106
- return parts.map((part) => part.charAt(0).toUpperCase()).join("").slice(0, 2);
107
- }
108
- return logoKey.slice(0, 1).toUpperCase();
109
- }
110
-
111
- function normalizePastBrandResult(value: string | null | undefined) {
112
- const trimmed = value?.trim() ?? "";
113
- if (trimmed.length === 0) return undefined;
114
- return trimmed.slice(0, PITCHKIT_BRAND_RESULT_MAX);
115
- }
116
-
117
- function BrandMark({ name, logoKey }: { name: string; logoKey?: string }) {
118
- const resolved = resolvePastBrandLogoKey(logoKey);
119
- if (resolved == null) {
120
- return <Avatar name={name} size="sm" />;
121
- }
122
-
123
- return (
124
- <span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-fg type-supporting text-muted font-medium uppercase leading-none text-bg" role="img" aria-label={name}>
125
- <span aria-hidden>{pastBrandLogoMonogram(resolved)}</span>
126
- </span>
127
- );
128
- }
129
-
130
- function BrandResultChip({ label }: { label?: string }) {
131
- const result = normalizePastBrandResult(label);
132
- if (result == null) return null;
133
- return <Chip readOnly size="sm">{result}</Chip>;
134
- }
135
-
136
- function BrandLockup({ brand }: { brand: PitchKitPastBrand }) {
137
- return (
138
- <div className="flex min-w-0 items-center gap-3">
139
- <BrandMark name={brand.name} logoKey={brand.logo_key} />
140
- <h3 className="type-label text-fg">{brand.name}</h3>
141
- <BrandResultChip label={brand.result_label} />
142
- </div>
143
- );
144
- }
145
-
146
- function PastBrandCard({ brand, className }: { brand: PitchKitPastBrand; className: string }) {
147
- return (
148
- <Card variant="outlined" shape="rounded" className={className}>
149
- <Card.Header start={<BrandLockup brand={brand} />} />
150
- </Card>
151
- );
152
- }
153
-
154
- function PastBrandsRail({ brands }: { brands: readonly PitchKitPastBrand[] }) {
155
- const hostRef = useRef<HTMLDivElement>(null);
156
- const measureRef = useRef<HTMLUListElement>(null);
157
- const [overflows, setOverflows] = useState(false);
158
- const [reduceMotion, setReduceMotion] = useState(false);
159
-
160
- useLayoutEffect(() => {
161
- const media = window.matchMedia("(prefers-reduced-motion: reduce)");
162
- const updateMotion = () => setReduceMotion(media.matches);
163
- updateMotion();
164
- media.addEventListener("change", updateMotion);
165
- return () => media.removeEventListener("change", updateMotion);
166
- }, []);
167
-
168
- useLayoutEffect(() => {
169
- const host = hostRef.current;
170
- const measure = measureRef.current;
171
- if (host == null || measure == null) return;
172
-
173
- const update = () => {
174
- setOverflows(measure.scrollWidth > host.clientWidth + 1);
175
- };
176
- update();
177
- const observer = new ResizeObserver(update);
178
- observer.observe(host);
179
- observer.observe(measure);
180
- return () => observer.disconnect();
181
- }, [brands]);
182
-
183
- const duration = Math.max(16, brands.length * 4);
184
- const showMarquee = overflows && !reduceMotion;
185
-
186
- return (
187
- <div
188
- ref={hostRef}
189
- className="relative col-span-full min-w-0"
190
- data-overflow={showMarquee ? "true" : "false"}
191
- >
192
- <ul ref={measureRef} className="pointer-events-none invisible absolute flex w-max items-center gap-3" aria-hidden>
193
- {brands.map((brand) => (
194
- <li key={`${brand.id}-measure`}>
195
- <PastBrandCard brand={brand} className="w-max max-w-full shrink-0" />
196
- </li>
197
- ))}
198
- </ul>
199
- {reduceMotion ? (
200
- <ul className="flex min-w-0 flex-wrap items-center gap-3" aria-label="Past brands">
201
- {brands.map((brand) => (
202
- <li key={brand.id}>
203
- <PastBrandCard brand={brand} className="w-max max-w-full shrink-0" />
204
- </li>
205
- ))}
206
- </ul>
207
- ) : showMarquee ? (
208
- <>
209
- <ul className="sr-only" aria-label="Past brands">
210
- {brands.map((brand) => {
211
- const result = normalizePastBrandResult(brand.result_label);
212
- return (
213
- <li key={brand.id}>
214
- {result == null ? brand.name : `${brand.name}, ${result}`}
215
- </li>
216
- );
217
- })}
218
- </ul>
219
- <div className="group overflow-hidden" aria-hidden>
220
- <div
221
- className="marquee-track flex w-max items-center"
222
- style={{ "--marquee-duration": `${duration}s` } as CSSProperties}
223
- >
224
- <ul className="flex min-w-0 items-center gap-3">
225
- {brands.map((brand) => (
226
- <li key={`${brand.id}-loop-a`}>
227
- <PastBrandCard brand={brand} className="w-max max-w-full shrink-0" />
228
- </li>
229
- ))}
230
- </ul>
231
- <ul className="flex min-w-0 items-center gap-3">
232
- {brands.map((brand) => (
233
- <li key={`${brand.id}-loop-b`}>
234
- <PastBrandCard brand={brand} className="w-max max-w-full shrink-0" />
235
- </li>
236
- ))}
237
- </ul>
238
- </div>
239
- </div>
240
- </>
241
- ) : (
242
- <ul className="flex min-w-0 items-center gap-3" aria-label="Past brands">
243
- {brands.map((brand) => (
244
- <li key={brand.id}>
245
- <PastBrandCard brand={brand} className="w-max max-w-full shrink-0" />
246
- </li>
247
- ))}
248
- </ul>
249
- )}
250
- </div>
251
- );
252
- }
253
-
254
- export function PublicPastBrands({ brands }: { brands: readonly PitchKitPastBrand[] }) {
255
- if (brands.length === 0) return null;
256
-
257
- return (
258
- <section className="band min-w-0 gap-y-4">
259
- <div className="col-span-full flex flex-wrap items-end justify-between gap-3">
260
- <h2 className={cardTitleClasses}>Past brands</h2>
261
- </div>
262
- <PastBrandsRail brands={brands} />
263
- </section>
264
- );
265
- }
266
-
267
-
268
- export function PastBrandsPublicPage({
269
- identity,
270
- brands,
271
- }: {
272
- identity: PitchKitCreatorIdentity;
273
- brands: readonly PitchKitPastBrand[];
274
- }) {
275
- return (
276
- <main className="grid-page min-h-screen bg-body [--grid-column-gap:8px] [--grid-max:1140px] [padding-bottom:44px]">
277
- <div className="band pb-4">
278
- <header className="col-span-full grid grid-cols-[1fr_auto_1fr] items-center gap-3">
279
- <span className="type-heading-4 text-fg text-fg">PitchKit</span>
280
- </header>
281
- </div>
282
-
283
- <div className="band pt-6 sm:pt-8">
284
- <div className="band min-w-0 gap-y-6 sm:gap-y-8">
285
- <section className="col-span-full border-b border-border pb-6">
286
- <div className="flex min-w-0 flex-col gap-3">
287
- <CreatorIdentityStrip
288
- identity={identity}
289
- nameAs="h1"
290
- showProfessionalChip
291
- />
292
- </div>
293
- </section>
294
- <PublicPastBrands brands={brands} />
295
- </div>
296
- </div>
297
- </main>
298
- );
299
- }