@thewhatmatters/wmds 0.3.0 → 0.4.1
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 +87 -0
- package/CONSUMING.md +9 -4
- package/dist/collapse.css +9 -1
- package/dist/colors.css +7 -0
- package/dist/components/atoms/Badge/Badge.d.ts +16 -4
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +54 -42
- package/dist/components/atoms/Badge/badgeStyles.d.ts +12 -2
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +24 -13
- package/dist/components/atoms/Button/Button.d.ts +11 -3
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +118 -98
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts +3 -1
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +19 -18
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts +7 -1
- package/dist/components/atoms/Button/ButtonStatusContent.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusContent.js +9 -6
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts +5 -0
- package/dist/components/atoms/Button/buttonStatusStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusStyles.js +10 -10
- package/dist/components/atoms/Button/buttonStyles.d.ts +2 -0
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +12 -12
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +86 -69
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +6 -0
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +11 -11
- package/dist/components/atoms/IconButton/IconButton.d.ts +5 -0
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +73 -68
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +5 -0
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/iconButtonStyles.js +4 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts +13 -4
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.d.ts.map +1 -1
- package/dist/components/atoms/Kbd/useKbdChoiceKeys.js +32 -13
- package/dist/components/atoms/Prose/Prose.d.ts +23 -0
- package/dist/components/atoms/Prose/Prose.d.ts.map +1 -0
- package/dist/components/atoms/Prose/Prose.js +15 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts +17 -0
- package/dist/components/atoms/Prose/proseStyles.d.ts.map +1 -0
- package/dist/components/atoms/Prose/proseStyles.js +16 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts +26 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/SectionCaption.js +25 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts +11 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.d.ts.map +1 -0
- package/dist/components/atoms/SectionCaption/sectionCaptionStyles.js +12 -0
- package/dist/components/atoms/TextLink/TextLink.d.ts +10 -2
- package/dist/components/atoms/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/TextLink.js +15 -15
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts +13 -0
- package/dist/components/atoms/TextLink/textLinkStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextLink/textLinkStyles.js +7 -3
- package/dist/components/molecules/Accordion/Accordion.d.ts +6 -1
- package/dist/components/molecules/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/Accordion.js +57 -50
- package/dist/components/molecules/Accordion/accordionStyles.d.ts +9 -0
- package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.js +2 -2
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts +5 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.d.ts.map +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroupItem.js +12 -10
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts +37 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/DescriptionList.js +50 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts +21 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.d.ts.map +1 -0
- package/dist/components/molecules/DescriptionList/descriptionListStyles.js +27 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts +58 -0
- package/dist/components/molecules/IndexList/IndexList.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/IndexList.js +96 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts +29 -0
- package/dist/components/molecules/IndexList/indexListStyles.d.ts.map +1 -0
- package/dist/components/molecules/IndexList/indexListStyles.js +24 -0
- package/dist/components/molecules/PromptBar/PromptBar.d.ts +11 -1
- package/dist/components/molecules/PromptBar/PromptBar.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/PromptBar.js +54 -43
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts +16 -0
- package/dist/components/molecules/PromptBar/promptBarStyles.d.ts.map +1 -1
- package/dist/components/molecules/PromptBar/promptBarStyles.js +5 -2
- package/dist/components/organisms/ChatDock/ChatDock.d.ts +203 -0
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/ChatDock.js +697 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts +52 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/ChatDockGate.js +161 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts +16 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockGateStyles.js +8 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts +98 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockStyles.js +21 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts +21 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.d.ts.map +1 -0
- package/dist/components/organisms/ChatDock/chatDockViewport.js +46 -0
- package/dist/components/organisms/Dialog/AlertDialog.js +11 -11
- package/dist/components/organisms/Dialog/Dialog.js +44 -44
- package/dist/components/organisms/Sheet/Sheet.js +38 -38
- package/dist/components/organisms/Toast/Toast.js +5 -5
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -110
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/typography.d.ts +2 -2
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/lib/typography.js +27 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -0
- package/dist/typography.css +34 -0
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +16 -1
- package/docs/components.md +16 -11
- package/docs/exports.json +81 -4
- package/docs/patterns/components-accordion--flush.tsx +29 -0
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +25 -0
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +39 -0
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +30 -0
- 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-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 +158 -0
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +180 -0
- 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 +19 -0
- 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 +17 -0
- package/docs/patterns/components-descriptionlist--details.tsx +21 -0
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +52 -0
- 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-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 +36 -0
- 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-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-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 +11 -0
- 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 +16 -0
- package/docs/patterns/components-sectioncaption--with-action.tsx +19 -0
- 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 +15 -0
- 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-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-index.tsx +174 -0
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +143 -0
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/index.json +137 -9
- package/package.json +1 -1
- package/docs/patterns/components-promptbar--pattern-marketing-composer.tsx +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — vertical actions
|
|
2
2
|
// Storybook: Components/Button/FloatingActionButton → Pattern — vertical actions (?path=/story/components-button-floatingactionbutton--vertical-actions)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — skip in footer
|
|
2
2
|
// Storybook: Components/CalEmbed → Pattern — skip in footer (?path=/story/components-calembed--pattern-skip-in-footer)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Example — body slot (occupancy history)
|
|
2
2
|
// Storybook: Components/Card/Card → Example — body slot (occupancy history) (?path=/story/components-card-card--body-slot-occupancy-history)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — headerless media
|
|
2
2
|
// Storybook: Components/Card/Card → Pattern — headerless media (?path=/story/components-card-card--headerless-media)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — outlined layout
|
|
2
2
|
// Storybook: Components/Card/Card → Pattern — outlined layout (?path=/story/components-card-card--outlined-layout)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — pinned height
|
|
2
2
|
// Storybook: Components/Card/Card → Pattern — pinned height (?path=/story/components-card-card--pinned-height)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — selectable cards
|
|
2
2
|
// Storybook: Components/Card/SelectableCard → Pattern — selectable cards (?path=/story/components-card-selectablecard--selectable-cards-pattern)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — matrix heatmap
|
|
2
2
|
// Storybook: Components/Chart → Pattern — matrix heatmap (?path=/story/components-chart--audience-activity-heatmap)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — Cartesian no-data gaps
|
|
2
2
|
// Storybook: Components/Chart → Pattern — Cartesian no-data gaps (?path=/story/components-chart--cartesian-no-data-gaps)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — occupancy history in Card
|
|
2
2
|
// Storybook: Components/Chart → Pattern — occupancy history in Card (?path=/story/components-chart--occupancy-history-in-card)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — occupancy KPI in Card
|
|
2
2
|
// Storybook: Components/Chart → Pattern — occupancy KPI in Card (?path=/story/components-chart--occupancy-in-card)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — distribution strip
|
|
2
2
|
// Storybook: Components/Chart → Pattern — distribution strip (?path=/story/components-chart--post-reach-distribution)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — ranked audience breakdown
|
|
2
2
|
// Storybook: Components/Chart → Pattern — ranked audience breakdown (?path=/story/components-chart--ranked-audience-breakdown)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — 100-unit composition
|
|
2
2
|
// Storybook: Components/Chart → Pattern — 100-unit composition (?path=/story/components-chart--unit-grid-composition)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — chat dock
|
|
2
|
+
// Storybook: Components/ChatDock → Pattern — chat dock (?path=/story/components-chatdock--pattern-chat-dock)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState, type ReactNode } from "react";
|
|
6
|
+
import { ArrowRight, CalendarClock, DollarSign } from "lucide-react";
|
|
7
|
+
import {
|
|
8
|
+
Avatar,
|
|
9
|
+
ChatDock,
|
|
10
|
+
ChatQa,
|
|
11
|
+
type ChatDockFeedback,
|
|
12
|
+
type ChatDockMessage,
|
|
13
|
+
type ChatDockMessageMeta,
|
|
14
|
+
type ChatDockSuggestion,
|
|
15
|
+
type ChatQaPair,
|
|
16
|
+
} from "@thewhatmatters/wmds";
|
|
17
|
+
|
|
18
|
+
const suggestions: ChatDockSuggestion[] = [
|
|
19
|
+
{
|
|
20
|
+
id: "cost",
|
|
21
|
+
label: "How much does a project cost?",
|
|
22
|
+
prompt: "How much does a project cost?",
|
|
23
|
+
icon: <DollarSign />,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "timeline",
|
|
27
|
+
label: "How long does a project take?",
|
|
28
|
+
prompt: "How long does a project take?",
|
|
29
|
+
icon: <CalendarClock />,
|
|
30
|
+
},
|
|
31
|
+
{ id: "start", label: "Start a project", icon: <ArrowRight /> },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
/** What the assistant knows when it opens Start a project — services and budget, or nothing yet. */
|
|
35
|
+
export interface StartProjectRequest {
|
|
36
|
+
services?: string[];
|
|
37
|
+
budget?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* What `ask` resolves with: the reply, or the reply with its follow-ups, its score, the text Copy
|
|
42
|
+
* copies, and a Start a project request when the assistant opens the gate.
|
|
43
|
+
*/
|
|
44
|
+
export type AskWhatMattersResult =
|
|
45
|
+
| string
|
|
46
|
+
| {
|
|
47
|
+
reply: string;
|
|
48
|
+
followUps?: ChatDockSuggestion[];
|
|
49
|
+
meta?: ChatDockMessageMeta;
|
|
50
|
+
copyText?: string;
|
|
51
|
+
startProject?: StartProjectRequest;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** What the Start a project gate gets: the request, and how to close or complete it. */
|
|
55
|
+
export interface StartProjectGateSlot {
|
|
56
|
+
request: StartProjectRequest;
|
|
57
|
+
close: () => void;
|
|
58
|
+
complete: (answers: ChatQaPair[], confirmation: string) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface AskWhatMattersProps {
|
|
62
|
+
/** The app's assistant request. Resolves with the reply, and with its follow-ups, score, copy text, or a Start a project request. */
|
|
63
|
+
ask: (prompt: string, history: ChatDockMessage[]) => Promise<AskWhatMattersResult>;
|
|
64
|
+
/** The visitor voted on a reply, or cleared their vote (`null`). */
|
|
65
|
+
onFeedback: (reply: ChatDockMessage, value: ChatDockFeedback) => void;
|
|
66
|
+
/** Start a project is open while this is set: what the assistant already knows, or `{}`. A site button can set it too. */
|
|
67
|
+
startProject: StartProjectRequest | null;
|
|
68
|
+
onStartProjectChange: (request: StartProjectRequest | null) => void;
|
|
69
|
+
/** The gate — return **Pattern — start a project gate** with the slot spread onto it. */
|
|
70
|
+
renderStartProject: (slot: StartProjectGateSlot) => ReactNode;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function AskWhatMatters({
|
|
74
|
+
ask,
|
|
75
|
+
onFeedback,
|
|
76
|
+
startProject,
|
|
77
|
+
onStartProjectChange,
|
|
78
|
+
renderStartProject,
|
|
79
|
+
}: AskWhatMattersProps) {
|
|
80
|
+
const [messages, setMessages] = useState<ChatDockMessage[]>([]);
|
|
81
|
+
const [thinking, setThinking] = useState(false);
|
|
82
|
+
const [followUps, setFollowUps] = useState<ChatDockSuggestion[]>([]);
|
|
83
|
+
|
|
84
|
+
async function handleSend(prompt: string) {
|
|
85
|
+
const question: ChatDockMessage = { id: crypto.randomUUID(), role: "user", content: prompt };
|
|
86
|
+
const history = [...messages, question];
|
|
87
|
+
setMessages(history);
|
|
88
|
+
setFollowUps([]);
|
|
89
|
+
setThinking(true);
|
|
90
|
+
try {
|
|
91
|
+
const result = await ask(prompt, history);
|
|
92
|
+
const answer: Exclude<AskWhatMattersResult, string> = typeof result === "string" ? { reply: result } : result;
|
|
93
|
+
setMessages((current) => [
|
|
94
|
+
...current,
|
|
95
|
+
{
|
|
96
|
+
id: crypto.randomUUID(),
|
|
97
|
+
role: "assistant",
|
|
98
|
+
content: answer.reply,
|
|
99
|
+
copyText: answer.copyText ?? answer.reply,
|
|
100
|
+
meta: answer.meta,
|
|
101
|
+
feedback: null,
|
|
102
|
+
},
|
|
103
|
+
]);
|
|
104
|
+
setFollowUps(answer.followUps ?? []);
|
|
105
|
+
if (answer.startProject != null) onStartProjectChange(answer.startProject);
|
|
106
|
+
} finally {
|
|
107
|
+
setThinking(false);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function handleFeedback(reply: ChatDockMessage, value: ChatDockFeedback) {
|
|
112
|
+
setMessages((current) =>
|
|
113
|
+
current.map((message) => (message.id === reply.id ? { ...message, feedback: value } : message)),
|
|
114
|
+
);
|
|
115
|
+
onFeedback(reply, value);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function completeStartProject(answers: ChatQaPair[], confirmation: string) {
|
|
119
|
+
setMessages((current) => [
|
|
120
|
+
...current,
|
|
121
|
+
{ id: crypto.randomUUID(), role: "assistant", content: <ChatQa pairs={answers} aria-label="Your project" /> },
|
|
122
|
+
{ id: crypto.randomUUID(), role: "assistant", content: confirmation },
|
|
123
|
+
]);
|
|
124
|
+
setFollowUps([]);
|
|
125
|
+
onStartProjectChange(null);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<ChatDock
|
|
130
|
+
title="WhatMatters"
|
|
131
|
+
subtitle="Ask anything"
|
|
132
|
+
mark={<Avatar name="WhatMatters" size="md" />}
|
|
133
|
+
greeting="Hi, I'm the WhatMatters assistant. Ask about our work, our process, pricing, or how to start a project."
|
|
134
|
+
messages={messages}
|
|
135
|
+
thinking={thinking}
|
|
136
|
+
suggestions={suggestions}
|
|
137
|
+
followUps={followUps}
|
|
138
|
+
onSend={(prompt) => {
|
|
139
|
+
void handleSend(prompt);
|
|
140
|
+
}}
|
|
141
|
+
onSuggestionSelect={(suggestion) => {
|
|
142
|
+
if (suggestion.id === "start") onStartProjectChange({});
|
|
143
|
+
}}
|
|
144
|
+
onMessageFeedback={handleFeedback}
|
|
145
|
+
gate={
|
|
146
|
+
startProject == null
|
|
147
|
+
? undefined
|
|
148
|
+
: renderStartProject({
|
|
149
|
+
request: startProject,
|
|
150
|
+
close: () => onStartProjectChange(null),
|
|
151
|
+
complete: completeStartProject,
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
placeholder="Ask anything about WhatMatters"
|
|
155
|
+
disclaimer="Answers may be incomplete · AI assistant by WhatMatters"
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — start a project gate
|
|
2
|
+
// Storybook: Components/ChatDock → Pattern — start a project gate (?path=/story/components-chatdock--pattern-start-project-gate)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useId, useRef, useState, type ReactNode } from "react";
|
|
6
|
+
import {
|
|
7
|
+
CalEmbed,
|
|
8
|
+
ChatDock,
|
|
9
|
+
Checkbox,
|
|
10
|
+
IntakeForm,
|
|
11
|
+
Kbd,
|
|
12
|
+
Radio,
|
|
13
|
+
intakeAboutEmpty,
|
|
14
|
+
isIntakeAboutValid,
|
|
15
|
+
useConfetti,
|
|
16
|
+
useKbdChoiceKeys,
|
|
17
|
+
type ChatQaPair,
|
|
18
|
+
type IntakeAboutValues,
|
|
19
|
+
} from "@thewhatmatters/wmds";
|
|
20
|
+
|
|
21
|
+
const services = [
|
|
22
|
+
{ value: "brand", label: "Brand identity" },
|
|
23
|
+
{ value: "web", label: "Web experiences" },
|
|
24
|
+
{ value: "mobile", label: "Mobile apps" },
|
|
25
|
+
{ value: "social", label: "Social media" },
|
|
26
|
+
{ value: "content", label: "Content and copy" },
|
|
27
|
+
{ value: "ai", label: "AI assistants" },
|
|
28
|
+
{ value: "growth", label: "Launch, growth, and care" },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const budgets = [
|
|
32
|
+
{ value: "under-10", label: "Under $10k" },
|
|
33
|
+
{ value: "10-25", label: "$10–25k" },
|
|
34
|
+
{ value: "25-50", label: "$25–50k" },
|
|
35
|
+
{ value: "50-plus", label: "$50k+" },
|
|
36
|
+
{ value: "unsure", label: "Not sure yet" },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const steps = [
|
|
40
|
+
{ title: "Name the work", subtitle: "What are we making? Choose all that apply." },
|
|
41
|
+
{ title: "What's the budget?", subtitle: "A range is enough. We can tighten it after the first call." },
|
|
42
|
+
{ title: "About you", subtitle: "A few sentences is enough. We'll reply to the email you leave here." },
|
|
43
|
+
{ title: "Book a call", subtitle: "Pick a time, or skip this and we'll write to you instead." },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
/** What the visitor told the gate — the app sends it. */
|
|
47
|
+
export interface StartProjectIntake {
|
|
48
|
+
services: string[];
|
|
49
|
+
budget: string | null;
|
|
50
|
+
about: IntakeAboutValues;
|
|
51
|
+
followUp: "call" | "email";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface StartProjectGateProps {
|
|
55
|
+
/** What the assistant already picked up from the conversation, or `{}`. */
|
|
56
|
+
request: { services?: string[]; budget?: string };
|
|
57
|
+
/** Closes the gate — Cancel, Close, or Escape. */
|
|
58
|
+
close: () => void;
|
|
59
|
+
/** Ends the gate; the conversation shows the answers and the confirmation. */
|
|
60
|
+
complete: (answers: ChatQaPair[], confirmation: string) => void;
|
|
61
|
+
/** Sends the intake. */
|
|
62
|
+
onSubmit: (intake: StartProjectIntake) => void;
|
|
63
|
+
/** The booking calendar. Call `booked` once the visitor confirms a time. Leave it out to show the empty state. */
|
|
64
|
+
renderCalendar?: (booked: () => void) => ReactNode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function StartProjectGate({ request, close, complete, onSubmit, renderCalendar }: StartProjectGateProps) {
|
|
68
|
+
const gateRef = useRef<HTMLDivElement>(null);
|
|
69
|
+
const budgetName = useId();
|
|
70
|
+
const { fire } = useConfetti();
|
|
71
|
+
const [step, setStep] = useState(1);
|
|
72
|
+
const [chosen, setChosen] = useState<string[]>(request.services ?? []);
|
|
73
|
+
const [budget, setBudget] = useState<string | null>(request.budget ?? null);
|
|
74
|
+
const [about, setAbout] = useState<IntakeAboutValues>(intakeAboutEmpty);
|
|
75
|
+
|
|
76
|
+
function toggleService(value: string) {
|
|
77
|
+
setChosen((current) =>
|
|
78
|
+
current.includes(value) ? current.filter((item) => item !== value) : [...current, value],
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Number keys pick the numbered options while focus is in the gate.
|
|
83
|
+
useKbdChoiceKeys({
|
|
84
|
+
enabled: step === 1,
|
|
85
|
+
scope: gateRef,
|
|
86
|
+
choices: Object.fromEntries(services.map((service, index) => [String(index + 1), () => toggleService(service.value)])),
|
|
87
|
+
});
|
|
88
|
+
useKbdChoiceKeys({
|
|
89
|
+
enabled: step === 2,
|
|
90
|
+
scope: gateRef,
|
|
91
|
+
choices: Object.fromEntries(budgets.map((option, index) => [String(index + 1), () => setBudget(option.value)])),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const canContinue =
|
|
95
|
+
step === 1 ? chosen.length > 0 : step === 2 ? budget != null : step === 3 ? isIntakeAboutValid(about) : true;
|
|
96
|
+
|
|
97
|
+
function finish(followUp: "call" | "email") {
|
|
98
|
+
onSubmit({ services: chosen, budget, about, followUp });
|
|
99
|
+
// The burst starts at the control the visitor used — the booking or the skip.
|
|
100
|
+
const used = document.activeElement;
|
|
101
|
+
fire(used instanceof HTMLElement ? { origin: used } : undefined);
|
|
102
|
+
const firstName = about.name.trim().split(" ")[0];
|
|
103
|
+
const email = about.email.trim();
|
|
104
|
+
complete(
|
|
105
|
+
[
|
|
106
|
+
{
|
|
107
|
+
question: "What are we making?",
|
|
108
|
+
answer: services
|
|
109
|
+
.filter((service) => chosen.includes(service.value))
|
|
110
|
+
.map((service) => service.label)
|
|
111
|
+
.join(", "),
|
|
112
|
+
},
|
|
113
|
+
{ question: "What's the budget?", answer: budgets.find((option) => option.value === budget)?.label ?? "" },
|
|
114
|
+
{ question: "About you", answer: [about.name.trim(), about.company.trim()].filter(Boolean).join(", ") },
|
|
115
|
+
{ question: "How should we follow up?", answer: followUp === "call" ? "Booked a call" : "Email me" },
|
|
116
|
+
],
|
|
117
|
+
followUp === "call"
|
|
118
|
+
? "Thanks, " + firstName + ". Your call is booked; the invite is on its way to " + email + "."
|
|
119
|
+
: "Thanks, " + firstName + ". We'll write to " + email + " within a day.",
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const copy = steps[step - 1];
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<ChatDock.Gate
|
|
127
|
+
ref={gateRef}
|
|
128
|
+
title={copy.title}
|
|
129
|
+
subtitle={copy.subtitle}
|
|
130
|
+
step={step}
|
|
131
|
+
stepCount={steps.length}
|
|
132
|
+
onPrevious={() => setStep((current) => Math.max(1, current - 1))}
|
|
133
|
+
onNext={step < steps.length ? () => setStep((current) => current + 1) : undefined}
|
|
134
|
+
canContinue={canContinue}
|
|
135
|
+
onClose={close}
|
|
136
|
+
footerStart={step === 4 ? <CalEmbed.Skip onSkip={() => finish("email")} /> : undefined}
|
|
137
|
+
>
|
|
138
|
+
{step === 1 ? (
|
|
139
|
+
<div className="flex w-full flex-col" role="group" aria-label="Services">
|
|
140
|
+
{services.map((service, index) => (
|
|
141
|
+
<div key={service.value} className="flex w-full items-center gap-3 border-b border-border py-3 last:border-b-0">
|
|
142
|
+
<Checkbox
|
|
143
|
+
className="min-w-0 flex-1"
|
|
144
|
+
size="md"
|
|
145
|
+
label={service.label}
|
|
146
|
+
checked={chosen.includes(service.value)}
|
|
147
|
+
onChange={() => toggleService(service.value)}
|
|
148
|
+
/>
|
|
149
|
+
<Kbd className="shrink-0" aria-label={"Press " + (index + 1)}>
|
|
150
|
+
{index + 1}
|
|
151
|
+
</Kbd>
|
|
152
|
+
</div>
|
|
153
|
+
))}
|
|
154
|
+
</div>
|
|
155
|
+
) : null}
|
|
156
|
+
{step === 2 ? (
|
|
157
|
+
<div className="flex w-full flex-col" role="radiogroup" aria-label="Budget">
|
|
158
|
+
{budgets.map((option, index) => (
|
|
159
|
+
<div key={option.value} className="flex w-full items-center gap-3 border-b border-border py-3 last:border-b-0">
|
|
160
|
+
<Radio
|
|
161
|
+
className="min-w-0 flex-1"
|
|
162
|
+
size="md"
|
|
163
|
+
name={budgetName}
|
|
164
|
+
value={option.value}
|
|
165
|
+
label={option.label}
|
|
166
|
+
checked={budget === option.value}
|
|
167
|
+
onChange={() => setBudget(option.value)}
|
|
168
|
+
/>
|
|
169
|
+
<Kbd className="shrink-0" aria-label={"Press " + (index + 1)}>
|
|
170
|
+
{index + 1}
|
|
171
|
+
</Kbd>
|
|
172
|
+
</div>
|
|
173
|
+
))}
|
|
174
|
+
</div>
|
|
175
|
+
) : null}
|
|
176
|
+
{step === 3 ? <IntakeForm values={about} onChange={setAbout} /> : null}
|
|
177
|
+
{step === 4 ? <CalEmbed skip={false}>{renderCalendar?.(() => finish("call"))}</CalEmbed> : null}
|
|
178
|
+
</ChatDock.Gate>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — Q&A with reply
|
|
2
2
|
// Storybook: Components/ChatQa → Pattern — Q&A with reply (?path=/story/components-chatqa--pattern-qa-with-reply)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — default
|
|
2
2
|
// Storybook: Components/Checkbox/Checkbox → Pattern — default (?path=/story/components-checkbox-checkbox--default)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — with count
|
|
2
|
+
// Storybook: Components/Checkbox/Checkbox → Pattern — with count (?path=/story/components-checkbox-checkbox--with-count)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Checkbox } from "@thewhatmatters/wmds";
|
|
7
|
+
|
|
8
|
+
export function GuidesFilter() {
|
|
9
|
+
const [checked, setChecked] = useState(false);
|
|
10
|
+
return (
|
|
11
|
+
<Checkbox
|
|
12
|
+
label="Guides"
|
|
13
|
+
count={2}
|
|
14
|
+
countLabel="2 posts"
|
|
15
|
+
checked={checked}
|
|
16
|
+
onChange={(event) => setChecked(event.target.checked)}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — with description
|
|
2
2
|
// Storybook: Components/Checkbox/Checkbox → Pattern — with description (?path=/story/components-checkbox-checkbox--with-description)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — default
|
|
2
2
|
// Storybook: Components/Checkbox/CheckboxGroup → Pattern — default (?path=/story/components-checkbox-checkboxgroup--default)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — option counts
|
|
2
|
+
// Storybook: Components/Checkbox/CheckboxGroup → Pattern — option counts (?path=/story/components-checkbox-checkboxgroup--option-counts)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { CheckboxGroup } from "@thewhatmatters/wmds";
|
|
7
|
+
|
|
8
|
+
export function TopicFilter() {
|
|
9
|
+
const [values, setValues] = useState<string[]>([]);
|
|
10
|
+
return (
|
|
11
|
+
<CheckboxGroup label="Topic" size="sm" values={values} onValuesChange={setValues}>
|
|
12
|
+
<CheckboxGroup.Item value="guides" label="Guides" count={2} countLabel="2 posts" />
|
|
13
|
+
<CheckboxGroup.Item value="notes" label="Notes" count={1} countLabel="1 post" />
|
|
14
|
+
<CheckboxGroup.Item value="news" label="News" count={1} countLabel="1 post" />
|
|
15
|
+
</CheckboxGroup>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — details
|
|
2
|
+
// Storybook: Components/DescriptionList → Pattern — details (?path=/story/components-descriptionlist--details)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { DescriptionList } from "@thewhatmatters/wmds";
|
|
6
|
+
|
|
7
|
+
export interface ProjectDetails {
|
|
8
|
+
client: string;
|
|
9
|
+
scope: string;
|
|
10
|
+
timeline: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function ProjectFacts({ project }: { project: ProjectDetails }) {
|
|
14
|
+
return (
|
|
15
|
+
<DescriptionList>
|
|
16
|
+
<DescriptionList.Item name="Client">{project.client}</DescriptionList.Item>
|
|
17
|
+
<DescriptionList.Item name="Scope">{project.scope}</DescriptionList.Item>
|
|
18
|
+
<DescriptionList.Item name="Timeline">{project.timeline}</DescriptionList.Item>
|
|
19
|
+
</DescriptionList>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — post metadata
|
|
2
|
+
// Storybook: Components/DescriptionList → Pattern — post metadata (?path=/story/components-descriptionlist--post-metadata)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { Badge, Button, DescriptionList } from "@thewhatmatters/wmds";
|
|
6
|
+
|
|
7
|
+
export interface PostMetadataProps {
|
|
8
|
+
/** ISO date, for the time element. */
|
|
9
|
+
date: string;
|
|
10
|
+
dateLabel: string;
|
|
11
|
+
author: string;
|
|
12
|
+
readingTime: string;
|
|
13
|
+
categories: { label: string; href: string }[];
|
|
14
|
+
shareUrl: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function PostMetadata({ date, dateLabel, author, readingTime, categories, shareUrl }: PostMetadataProps) {
|
|
18
|
+
const encodedUrl = encodeURIComponent(shareUrl);
|
|
19
|
+
return (
|
|
20
|
+
<DescriptionList variant="mono" rule="dotted">
|
|
21
|
+
<DescriptionList.Item name="Date">
|
|
22
|
+
<time dateTime={date}>{dateLabel}</time>
|
|
23
|
+
</DescriptionList.Item>
|
|
24
|
+
<DescriptionList.Item name="Author">
|
|
25
|
+
<Badge emphasis="outline" mono>
|
|
26
|
+
{author}
|
|
27
|
+
</Badge>
|
|
28
|
+
</DescriptionList.Item>
|
|
29
|
+
<DescriptionList.Item name="Reading time">{readingTime}</DescriptionList.Item>
|
|
30
|
+
<DescriptionList.Item name="Categories">
|
|
31
|
+
{categories.map((category) => (
|
|
32
|
+
<Badge key={category.href} emphasis="outline" mono render={<a href={category.href} />}>
|
|
33
|
+
{category.label}
|
|
34
|
+
</Badge>
|
|
35
|
+
))}
|
|
36
|
+
</DescriptionList.Item>
|
|
37
|
+
<DescriptionList.Item name="Share" layout="stacked">
|
|
38
|
+
<Button role="secondary" size="sm" external render={<a href={"https://x.com/intent/post?url=" + encodedUrl} />}>
|
|
39
|
+
Twitter/X
|
|
40
|
+
</Button>
|
|
41
|
+
<Button
|
|
42
|
+
role="secondary"
|
|
43
|
+
size="sm"
|
|
44
|
+
external
|
|
45
|
+
render={<a href={"https://www.linkedin.com/sharing/share-offsite/?url=" + encodedUrl} />}
|
|
46
|
+
>
|
|
47
|
+
LinkedIn
|
|
48
|
+
</Button>
|
|
49
|
+
</DescriptionList.Item>
|
|
50
|
+
</DescriptionList>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — alert dialog (destructive)
|
|
2
2
|
// Storybook: Components/Dialog → Pattern — alert dialog (destructive) (?path=/story/components-dialog--alert-dialog-destructive)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — dialog
|
|
2
2
|
// Storybook: Components/Dialog → Pattern — dialog (?path=/story/components-dialog--default-dialog)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — form dialog
|
|
2
2
|
// Storybook: Components/Dialog → Pattern — form dialog (?path=/story/components-dialog--form-dialog)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — page display controls
|
|
2
2
|
// Storybook: Components/DisplayControls → Pattern — page display controls (?path=/story/components-displaycontrols--page-utilities)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — horizontal input
|
|
2
2
|
// Storybook: Components/Field → Pattern — horizontal input (?path=/story/components-field--horizontal-input)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — horizontal textarea
|
|
2
2
|
// Storybook: Components/Field → Pattern — horizontal textarea (?path=/story/components-field--horizontal-text-area)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — multi-control
|
|
2
2
|
// Storybook: Components/Field → Pattern — multi-control (?path=/story/components-field--multi-control)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.1 · Pattern — marketing hero
|
|
2
2
|
// Storybook: Components/FooterReveal → Pattern — marketing hero (?path=/story/components-footerreveal--marketing-hero-pattern)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|