@thewhatmatters/wmds 0.4.8 → 0.4.27
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 +284 -2
- package/CONSUMING.md +1 -1
- package/README.md +1 -1
- package/bin/wmds-check.mjs +8 -4
- package/dist/components/atoms/Badge/Badge.d.ts +13 -5
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +56 -48
- package/dist/components/atoms/Badge/badgeStyles.d.ts +15 -0
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +38 -16
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +67 -48
- package/dist/components/atoms/Button/buttonStatusMotion.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusMotion.js +6 -1
- package/dist/components/atoms/Button/buttonStyles.d.ts +1 -1
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +14 -12
- package/dist/components/atoms/Input/Input.d.ts +3 -1
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +59 -59
- package/dist/components/atoms/Input/inputShellStyles.d.ts +9 -3
- package/dist/components/atoms/Input/inputShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/Input/inputShellStyles.js +38 -38
- package/dist/components/atoms/RiveHand/RiveHand.d.ts.map +1 -1
- package/dist/components/atoms/RiveHand/RiveHand.js +83 -81
- package/dist/components/atoms/Table/Table.d.ts +54 -0
- package/dist/components/atoms/Table/Table.d.ts.map +1 -0
- package/dist/components/atoms/Table/Table.js +66 -0
- package/dist/components/atoms/Table/tableStyles.d.ts +18 -0
- package/dist/components/atoms/Table/tableStyles.d.ts.map +1 -0
- package/dist/components/atoms/Table/tableStyles.js +14 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts +6 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +86 -78
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts +2 -2
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/textareaShellStyles.js +2 -2
- 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/Card/Card.d.ts +28 -6
- package/dist/components/molecules/Card/Card.d.ts.map +1 -1
- package/dist/components/molecules/Card/Card.js +83 -42
- package/dist/components/molecules/Card/cardStyles.d.ts +16 -1
- package/dist/components/molecules/Card/cardStyles.d.ts.map +1 -1
- package/dist/components/molecules/Card/cardStyles.js +18 -4
- package/dist/components/molecules/Chip/chipStyles.js +9 -9
- package/dist/components/molecules/CopyField/CopyField.d.ts +41 -0
- package/dist/components/molecules/CopyField/CopyField.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/CopyField.js +120 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts +28 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.js +7 -0
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts +16 -7
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/DisplayControls.js +41 -39
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts +21 -0
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/displayControlsState.js +46 -4
- 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/LogView/LogView.d.ts +31 -0
- package/dist/components/molecules/LogView/LogView.d.ts.map +1 -0
- package/dist/components/molecules/LogView/LogView.js +109 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts +11 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts.map +1 -0
- package/dist/components/molecules/LogView/logViewStyles.js +6 -0
- package/dist/components/molecules/NavList/NavList.d.ts +23 -4
- package/dist/components/molecules/NavList/NavList.d.ts.map +1 -1
- package/dist/components/molecules/NavList/NavList.js +65 -52
- package/dist/components/molecules/NavList/navListStyles.d.ts +2 -0
- package/dist/components/molecules/NavList/navListStyles.d.ts.map +1 -1
- package/dist/components/molecules/NavList/navListStyles.js +3 -3
- package/dist/components/molecules/PageHeader/PageHeader.js +3 -3
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.js +7 -7
- package/dist/components/molecules/Stat/Stat.d.ts +31 -5
- package/dist/components/molecules/Stat/Stat.d.ts.map +1 -1
- package/dist/components/molecules/Stat/Stat.js +83 -49
- package/dist/components/molecules/Stat/statStyles.d.ts +23 -3
- package/dist/components/molecules/Stat/statStyles.d.ts.map +1 -1
- package/dist/components/molecules/Stat/statStyles.js +29 -12
- package/dist/components/molecules/TaskRows/TaskRows.d.ts +13 -3
- package/dist/components/molecules/TaskRows/TaskRows.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/TaskRows.js +81 -57
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts +54 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts.map +1 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.js +200 -0
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts +19 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.js +7 -3
- package/dist/components/molecules/TileGrid/tileGridStyles.d.ts +2 -2
- package/dist/components/organisms/AppShell/AppShell.d.ts +82 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/AppShell.js +222 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts +18 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/appShellStyles.js +8 -0
- package/dist/components/organisms/Carousel/Carousel.d.ts +9 -1
- package/dist/components/organisms/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/Carousel.js +220 -182
- package/dist/components/organisms/Carousel/carouselMath.d.ts +5 -0
- package/dist/components/organisms/Carousel/carouselMath.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselMath.js +9 -1
- package/dist/components/organisms/Carousel/carouselStyles.d.ts +2 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselStyles.js +8 -7
- package/dist/components/organisms/Chart/Chart.d.ts +5 -1
- package/dist/components/organisms/Chart/Chart.d.ts.map +1 -1
- package/dist/components/organisms/Chart/Chart.js +126 -62
- package/dist/components/organisms/Chart/ChartLegend.d.ts +8 -1
- package/dist/components/organisms/Chart/ChartLegend.d.ts.map +1 -1
- package/dist/components/organisms/Chart/ChartLegend.js +43 -13
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts +52 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts.map +1 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.js +95 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts +32 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts.map +1 -1
- package/dist/components/organisms/Chart/chartStyles.js +15 -3
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +29 -25
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.js +1 -0
- package/dist/components/organisms/Sheet/Sheet.d.ts +3 -1
- package/dist/components/organisms/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/Sheet.js +74 -68
- package/dist/components/organisms/Sheet/sheetStyles.d.ts +8 -2
- package/dist/components/organisms/Sheet/sheetStyles.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/sheetStyles.js +16 -11
- package/dist/components/organisms/Tab/tabStyles.js +7 -7
- package/dist/index.d.ts +14 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -139
- package/dist/lib/chartTheme.d.ts +11 -0
- package/dist/lib/chartTheme.d.ts.map +1 -1
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.d.ts +7 -0
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +16 -1
- package/dist/lib/sheetParam/index.d.ts +3 -0
- package/dist/lib/sheetParam/index.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.d.ts +15 -0
- package/dist/lib/sheetParam/sheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.js +26 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts +25 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/useSheetParam.js +29 -0
- 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/README.md +1 -1
- package/docs/component-contracts.md +101 -0
- package/docs/components.md +21 -16
- package/docs/exports.json +88 -15
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-appshell--portal-dashboard-pattern.tsx +176 -0
- 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--status-pill.tsx +31 -0
- 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-card--terminal-frame.tsx +48 -0
- 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--revenue-by-line.tsx +68 -0
- package/docs/patterns/components-chart--segmented-ring-pattern.tsx +144 -0
- 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-copyfield--clipboard-blocked.tsx +9 -0
- package/docs/patterns/components-copyfield--copied.tsx +9 -0
- package/docs/patterns/components-copyfield--copy-key.tsx +9 -0
- package/docs/patterns/components-copyfield--on-navy.tsx +29 -0
- 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-displaycontrols--theme-switch.tsx +35 -0
- 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-logview--detail-pane.tsx +80 -0
- package/docs/patterns/components-logview--log-viewer.tsx +20 -0
- 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--app-sidebar.tsx +118 -0
- 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-sheet--side-sheet-header-actions.tsx +50 -0
- package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +51 -0
- package/docs/patterns/components-sheet--side-sheet.tsx +38 -0
- 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--hero-stat.tsx +54 -0
- 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-table--approvals-with-sheet.tsx +81 -0
- package/docs/patterns/components-table--approvals.tsx +223 -0
- package/docs/patterns/components-table--basic.tsx +60 -0
- 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--needs-you-table.tsx +62 -0
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textarea--save-status.tsx +32 -0
- 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 +177 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,288 @@ Every release of `@thewhatmatters/wmds` is listed here, newest first.
|
|
|
7
7
|
- **Pasted patterns:** when a release changes a **Pattern — …** story's Show code, it is named under Consumer actions so apps re-copy it.
|
|
8
8
|
- **How to add an entry** (contributors): add your change to the top entry. If that version is already on npm (`npm view @thewhatmatters/wmds versions`), start a new entry above it and bump `version` in `package.json` to match. `npm run check:changelog` enforces the format.
|
|
9
9
|
|
|
10
|
+
## 0.4.27
|
|
11
|
+
|
|
12
|
+
**An opt-in counter for the Carousel.**
|
|
13
|
+
|
|
14
|
+
- **Carousel** `counter` (new, default `false`) — a visible "1 of 6" under the row on `type-supporting`, `text-muted`, tabular figures; announced politely (`aria-live="polite"`) as the item the row rests on changes; hidden (keeping its space) while every item fits. `labels.counter(position, count)` words it.
|
|
15
|
+
- **Carousel** `onIndexChange(index, count)` (new) — 0-based; fires once the row has been still for a moment and the item it rests on has changed. At the end of the row the index is the last item.
|
|
16
|
+
- **Carousel** `activeIndex` (new) — controlled: the row moves to that item (0-based) when it changes; the first value is applied without a glide.
|
|
17
|
+
- With none of the new props, the markup and behavior are unchanged.
|
|
18
|
+
- Stories: **Carousel → Review — 390 counter** and **Reference — count outside the row**. See the ADR-0043 addendum.
|
|
19
|
+
|
|
20
|
+
### Consumer actions
|
|
21
|
+
|
|
22
|
+
None. To show the count, pass `counter`; to show it elsewhere, pass `onIndexChange`. No **Pattern — …** Show code changed.
|
|
23
|
+
|
|
24
|
+
## 0.4.26
|
|
25
|
+
|
|
26
|
+
**A side sheet with header actions, a phone layout, and URL state.**
|
|
27
|
+
|
|
28
|
+
- **Sheet** `Sheet.Content` `headerActions` (new) — controls before the close (**IconButton** `size="sm"`: previous / next, share).
|
|
29
|
+
- **Sheet** `side="end"` is **full-screen below `md`** (no inset, no radius; header and footer pinned, body scrolls, footer clears the home indicator). From `md` it is a rail over a lighter scrim (`bg-overlay/50`). The page behind is `inert` while open; closing a deep-linked sheet moves focus to `main`; reduced motion fades instead of sliding.
|
|
30
|
+
- **`useSheetParam(kind, { initialUrl? })`**, **`readSheetParam(url)`**, **`withSheetParam(url, id | null, kind)`** (new) — keep a sheet in `?sheet=<kind>&id=<id>` with the History API, no router. Back closes; a deep link opens on first render; `initialUrl` serves the open sheet from the server.
|
|
31
|
+
- New patterns: **Components/Sheet → Pattern — side sheet**, **Pattern — side sheet header actions**, **Pattern — side sheet URL deep link**; **Components/Table → Pattern — approvals with sheet**.
|
|
32
|
+
- See ADR-0049.
|
|
33
|
+
|
|
34
|
+
### Consumer actions
|
|
35
|
+
|
|
36
|
+
None required. Every `side="end"` **Sheet**, including **SiteNav**'s phone menu, is now full-screen below `md`; check a phone width. To keep a detail in the URL, wire `useSheetParam` as in **Pattern — side sheet URL deep link** (new patterns, nothing to re-copy).
|
|
37
|
+
|
|
38
|
+
## 0.4.24
|
|
39
|
+
|
|
40
|
+
**One focus ring on TextArea and Input.**
|
|
41
|
+
|
|
42
|
+
- **TextArea** and **Input** no longer show a second ring. The shell's ring sat 2px off the border behind a page-colored gap, so it read as a gray ring around the field's own edge. The ring now hugs the border, one `--color-focus-ring` (or status ring) token, for solo and validation shells.
|
|
43
|
+
- The inner field of **TextArea**, **Input**, **PromptBar** and **CopyField** drops its outline and ring with `!important`. A global `:focus-visible { outline }` rule in an app is unlayered and used to beat the component's layered `outline-none`, which painted a blue ring inside the shell.
|
|
44
|
+
- New **Components/TextArea → Focused** story.
|
|
45
|
+
|
|
46
|
+
### Consumer actions
|
|
47
|
+
|
|
48
|
+
None.
|
|
49
|
+
|
|
50
|
+
## 0.4.23
|
|
51
|
+
|
|
52
|
+
**The package loads under Node, and TextArea announces progress.**
|
|
53
|
+
|
|
54
|
+
- **Fixed:** importing `@thewhatmatters/wmds` in Node ESM (a node test runner, or vitest in a DOM environment) threw `SyntaxError: Named export 'Rive' not found`. `@rive-app/react-canvas` is CommonJS, and **RiveHand** imported it by name; Node only exposes `default` for a CommonJS module. **RiveHand** now reads the runtime from the namespace and falls back to `default`, so bundlers (Vite, Next) and Node both load it. The `motion` imports were not the cause. The build now imports `dist/index.js` in Node, and a unit test does the same.
|
|
55
|
+
- **TextArea** `liveStatus` (new) — progress text under the field, in a polite live region (`role="status"`, `aria-live="polite"`). Pass `""` when idle so the region stays mounted and "Saving…" / "Saved" are heard. It is separate from the validation `status` + `message`. `description` and `message` were already tied to the field with `aria-describedby`; tests now cover it.
|
|
56
|
+
- **Pattern — save status** is new on **Components/TextArea**.
|
|
57
|
+
|
|
58
|
+
### Consumer actions
|
|
59
|
+
|
|
60
|
+
None. To announce a save state, pass `liveStatus`. Copy **Components/TextArea → Pattern — save status** (`docs/patterns/components-textarea--save-status.tsx`) for a worked example.
|
|
61
|
+
|
|
62
|
+
## 0.4.22
|
|
63
|
+
|
|
64
|
+
**A pinned sidebar footer, and AppShell on the server.**
|
|
65
|
+
|
|
66
|
+
- **AppShell** `sidebarFooter` / **AppShell.SidebarFooter** (new) — pinned to the bottom of the sidebar column and the phone **Sheet**. The **NavList** scrolls on its own above it, so a theme switch stays visible at 1440x900 and on a phone. No new color, border, radius, or shadow.
|
|
67
|
+
- **Pattern — portal dashboard** now puts a **DisplayControls** `controls="theme"` switch in the footer.
|
|
68
|
+
- Documented: the phone toggle's accessible name is **"Menu"** (`labels.menu`), and the docs now say which parts render on the server, which need a `"use client"` boundary, that `displayThemeNoFlashScript` goes in `<head>`, and a Next.js App Router example (`docs/component-contracts.md → AppShell — server rendering`).
|
|
69
|
+
- See the ADR-0047 addendum.
|
|
70
|
+
|
|
71
|
+
### Consumer actions
|
|
72
|
+
|
|
73
|
+
None for existing shells. To pin a footer, pass `sidebarFooter`. Re-copy **Components/AppShell → Pattern — portal dashboard** (`docs/patterns/components-appshell--portal-dashboard-pattern.tsx`) to get the theme switch in the footer.
|
|
74
|
+
|
|
75
|
+
## 0.4.21
|
|
76
|
+
|
|
77
|
+
**A table.**
|
|
78
|
+
|
|
79
|
+
- **Table** (new, atom) — `Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell`, `TableCaption`. Semantic HTML in a focusable, horizontal-scroll `region`. No new color, radius, shadow, or variant.
|
|
80
|
+
- Patterns: **Components/Table → Pattern — basic table** and **Pattern — approvals queue** (Approve `primary`, Deny `outline`, an inline Confirm deny / Cancel step in the same row, then a success or failed status pill; keyboard focus follows, Escape cancels, and each button's `aria-label` carries the row name). States: deny confirm step, decided, empty, mobile 390.
|
|
81
|
+
- **Table** polish: headers use `ui-label` and the caption `body` (one step up), `sticky` on `TableHead` / `TableCell` pins a column to the start edge (existing `bg-body` surface), and a table with a `colgroup` lays out from its `col` widths (fixed layout) so an empty and a filled table match.
|
|
82
|
+
- **Pattern — approvals queue**: the row keeps one height through pending, confirm, and decided (44px decision slot); focus after a decision lands on the status pill and shows the `focus-ring` only for keyboard focus (no box after a mouse click); the Name column is sticky; a `colgroup` fixes the column widths for the filled and empty states.
|
|
83
|
+
- **Pattern — approvals queue** on a phone (below `sm`, 640px): each row stacks as an outlined **Card** — name, then type and waiting, then **Approve** and **Deny** each taking half the row, all visible without sideways scroll. The deny confirm stays inline (Confirm deny · Cancel in the same slot) and the 44px decision slot keeps the card one height through pending, confirm, and decided. From `sm` the table is unchanged. No new color, radius, shadow, or Button role.
|
|
84
|
+
- `Table` moves out of the planned list.
|
|
85
|
+
- See ADR-0048.
|
|
86
|
+
|
|
87
|
+
### Consumer actions
|
|
88
|
+
|
|
89
|
+
None for existing pages. If you pasted **Pattern — approvals queue** from an earlier draft, re-copy `docs/patterns/components-table--approvals.tsx` (**Pattern — approvals queue** changed: phone card layout; it now also imports `Card`). To adopt it, `import { Table } from "@thewhatmatters/wmds"` and paste a **Components/Table** pattern (`docs/patterns/components-table--basic.tsx`, `docs/patterns/components-table--approvals.tsx`).
|
|
90
|
+
|
|
91
|
+
## 0.4.20
|
|
92
|
+
|
|
93
|
+
**An app shell.**
|
|
94
|
+
|
|
95
|
+
- **AppShell** (new) — a sidebar on the page background and the page as an inset, raised surface with a title bar. It composes **NavList**, **PageHeader** `variant="app"`, **Sheet** (the sidebar below `lg`), and **Panel** (the optional aside). No new color, radius, shadow, or variant.
|
|
96
|
+
- `<AppShell title brand sidebar header aside>` or the slots **AppShell.Brand**, **Sidebar**, **Header**, **Aside**. A `PanelLeft` toggle collapses the sidebar, **Ctrl** / **⌘** + **B** does the same, and `useAppShell()` returns the state.
|
|
97
|
+
- Patterns: **Components/AppShell → Pattern — portal dashboard**. States: collapsed, aside open, phone, phone menu open.
|
|
98
|
+
- **PageHeader** now applies `aria-label` when `title` is also set (it used to drop it), so a page header can have a name that tells it apart from other banners.
|
|
99
|
+
- **Sheet**, **Panel**, **Dialog**, and **AlertDialog** headers carry `role="presentation"`, so an open overlay no longer adds a second `banner` landmark beside the page header.
|
|
100
|
+
- See ADR-0047.
|
|
101
|
+
|
|
102
|
+
### Consumer actions
|
|
103
|
+
|
|
104
|
+
None for existing pages. To adopt it, `import { AppShell } from "@thewhatmatters/wmds"` and paste **Components/AppShell → Pattern — portal dashboard** (`docs/patterns/components-appshell--portal-dashboard-pattern.tsx`).
|
|
105
|
+
|
|
106
|
+
## 0.4.19
|
|
107
|
+
|
|
108
|
+
**A chart beside a stat column.**
|
|
109
|
+
|
|
110
|
+
- **Pattern — revenue by line** composes **Chart.Cartesian** and a column of **Stat** inside a **Card**. No new component.
|
|
111
|
+
- The same pattern includes the unwired state: "Revenue by line is not wired". Do not draw a series until the source exists.
|
|
112
|
+
|
|
113
|
+
### Consumer actions
|
|
114
|
+
|
|
115
|
+
Paste **Components/Chart → Pattern — revenue by line** (`docs/patterns/components-chart--revenue-by-line.tsx`). Keep the unwired card until revenue by line is connected. Drop it once `data` is real.
|
|
116
|
+
|
|
117
|
+
## 0.4.18
|
|
118
|
+
|
|
119
|
+
**A log viewer, and a dark detail pane.**
|
|
120
|
+
|
|
121
|
+
- **LogView** (new) — line numbers, a tabular line count, **Copy**, and **Follow**. `follow` keeps the scroller on the last line. `loading` is a **Skeleton**. An empty log says "No log lines".
|
|
122
|
+
- **Stat** `detail` — one tabular line under the figure, for example "3 new". Hidden while `loading` or `unavailable`. Hero props (`size="lg"`, `context`, `icon`, `action`, `unavailable`) stay.
|
|
123
|
+
- Patterns: **Components/LogView → Pattern — log viewer**, **Pattern — detail pane** (prev/next, tags, a 2×2 stat grid, the log, on `data-theme="dark"`).
|
|
124
|
+
|
|
125
|
+
### Consumer actions
|
|
126
|
+
|
|
127
|
+
`import { LogView } from "@thewhatmatters/wmds"`. Paste **Components/LogView → Pattern — log viewer** (`docs/patterns/components-logview--log-viewer.tsx`) and **Pattern — detail pane** (`docs/patterns/components-logview--detail-pane.tsx`). Pass `detail` on **Stat** for the sub line. Existing hero stats keep `size`, `context`, `icon`, `action`, and `unavailable`.
|
|
128
|
+
|
|
129
|
+
## 0.4.17
|
|
130
|
+
|
|
131
|
+
**Card.Body can be a terminal frame.**
|
|
132
|
+
|
|
133
|
+
- **`Card.Body variant="terminal"`** is a dark embed. `data-theme="dark"` on the frame uses the existing dark tokens, so the surface stays dark in both page themes. No new color.
|
|
134
|
+
- `src` or `srcDoc`, `title`, `height` (`sm` | `md` | `lg` | `fill`), `readOnly` (muted **Read only** badge), `state` (`ready` | `loading` | `disconnected`).
|
|
135
|
+
- `bodyTerminal` is unchanged: it only densifies the shell bottom when Body has no Footer. A terminal frame sits flush to the bottom of a footerless card.
|
|
136
|
+
- Pattern: **Components/Card/Card → Pattern — terminal frame**.
|
|
137
|
+
|
|
138
|
+
### Consumer actions
|
|
139
|
+
|
|
140
|
+
Replace a hand-rolled iframe in **Card.Body** with `variant="terminal"`. Paste **Components/Card/Card → Pattern — terminal frame** (`docs/patterns/components-card-card--terminal-frame.tsx`). `bodyTerminal` still means footerless density — do not use it as the embed.
|
|
141
|
+
|
|
142
|
+
## 0.4.16
|
|
143
|
+
|
|
144
|
+
**DisplayControls can be a theme switch, with a no-flash snippet.**
|
|
145
|
+
|
|
146
|
+
- **DisplayControls** `controls="theme"` drops the grid button. **G** is not captured. **T** still cycles Auto → Light → Dark.
|
|
147
|
+
- `readDisplayTheme`, `persistDisplayTheme`, `applyDisplayTheme`, `commitDisplayTheme`, and `subscribeDisplayTheme` remember the choice under `wmds-theme` and set or clear `data-theme` on `<html>`. `light` clears the attribute. `dark` sets it. `auto` follows `prefers-color-scheme` and keeps listening until the next call. `useSyncExternalStore(subscribeDisplayTheme, readDisplayTheme, …)` reads the saved choice without a hydration mismatch.
|
|
148
|
+
- `displayThemeNoFlashScript` is the head snippet that reads the same key before paint. Paste it before the stylesheet.
|
|
149
|
+
- Pattern: **Components/DisplayControls → Pattern — theme switch**.
|
|
150
|
+
|
|
151
|
+
### Consumer actions
|
|
152
|
+
|
|
153
|
+
Paste `displayThemeNoFlashScript` in `<head>` before the stylesheet (a `<script>` whose text is that string). Render **DisplayControls** with `controls="theme"` and call `commitDisplayTheme` from `onThemeChange`. Paste **Components/DisplayControls → Pattern — theme switch** (`docs/patterns/components-displaycontrols--theme-switch.tsx`).
|
|
154
|
+
|
|
155
|
+
Existing grid + theme pages keep `controls` omitted. **Pattern — page display controls** is unchanged.
|
|
156
|
+
|
|
157
|
+
## 0.4.15
|
|
158
|
+
|
|
159
|
+
**TaskRows: a needs-you table.**
|
|
160
|
+
|
|
161
|
+
- **TaskRows** `variant="table"` (new) — columns of title, waiting, and metric. Not an accordion. `columns` is `{ id: "title" | "waiting" | "metric", header, align?, width? }`. Defaults are Item, Waiting, and Metric.
|
|
162
|
+
- **TaskRows.Row** (new) — `title`, `href` or `render` (a router link; `render` wins), `status` (`tone`, `label` such as "Open · 2d", `pulsing`), `waiting` (a muted **Badge** pill and a detail line), `metric` (`value` is tabular, plus `detail`).
|
|
163
|
+
- `source` — `ready` (default), `loading` (skeleton, `aria-busy`), `error` (the `note` in the destructive color), `unwired` (the `note` as a muted footer line, no fake metric).
|
|
164
|
+
- `empty` — shown when there are no rows. Defaults to "Nothing waiting".
|
|
165
|
+
- Below `md` the headers are visually hidden and each row is two lines: the title, then the status, the waiting detail, and the metric.
|
|
166
|
+
- Pattern: **Components/TaskRows → Pattern — needs you**.
|
|
167
|
+
|
|
168
|
+
### Consumer actions
|
|
169
|
+
|
|
170
|
+
None for existing **TaskRows** lists and capsules.
|
|
171
|
+
|
|
172
|
+
For a needs-you table, paste **Components/TaskRows → Pattern — needs you** (`docs/patterns/components-taskrows--needs-you-table.tsx`). Pass `source="unwired"` and `note` when a source is not connected. Do not invent a zero.
|
|
173
|
+
|
|
174
|
+
## 0.4.14
|
|
175
|
+
|
|
176
|
+
**Chart: a segmented progress ring, a tabular legend, and a SegmentedBar that renders before it is measured.**
|
|
177
|
+
|
|
178
|
+
- **Chart.SegmentedRing** (new) — radial capacity meter. `value` / `max`, `segments` (default 72), `tone`, `centerValue`, `centerLabel`, `size` (`sm` 96px, `md` 160px, `lg` 192px), `animate` (`initial` sweeps on mount, `none` holds the fill), `label`. The figure is tabular. A fixed viewBox, so the ticks are in the server HTML.
|
|
179
|
+
- Over capacity — a value above `max` fills every tick and shows "Over capacity". The arc does not grow past the ring.
|
|
180
|
+
- `unavailable` — `{ reason, label? }` empties the track and replaces the center with muted "Not connected" (or `label`) and the reason. Do not pass a zero for an unwired source.
|
|
181
|
+
- Reduced motion — no sweep. The server render is the settled fill, so hydration matches.
|
|
182
|
+
- **Chart.Legend** `variant="tabular"` (new) — one row: swatch, label, mono value, percent, delta. `config` entries take optional `value`, `percent`, and `delta` (`{ label, direction?: "up" | "down" | "flat" }`). `up` is success, `down` is destructive, `flat` is muted. The default `series` variant is unchanged.
|
|
183
|
+
- **Chart.SegmentedBar** — draws CSS ticks when the host width is still 0 (server HTML and the first client render). The measured SVG, including `fill="velocity"` and `fill="semantic"`, replaces them once the width is known. `animate="initial"` still springs that SVG.
|
|
184
|
+
- Pattern: **Components/Chart → Pattern — segmented ring**.
|
|
185
|
+
|
|
186
|
+
### Consumer actions
|
|
187
|
+
|
|
188
|
+
None for existing **Chart.Legend** rows or **Chart.SegmentedBar** props.
|
|
189
|
+
|
|
190
|
+
**Chart.SegmentedBar** now shows ticks before hydration. A client island is no longer required for the meter to appear. `animate="initial"` still springs once the bar has a width.
|
|
191
|
+
|
|
192
|
+
For a radial meter and a source breakdown, paste **Components/Chart → Pattern — segmented ring** (`docs/patterns/components-chart--segmented-ring-pattern.tsx`). Pass `unavailable={{ reason }}` when the source is unwired.
|
|
193
|
+
|
|
194
|
+
## 0.4.13
|
|
195
|
+
|
|
196
|
+
**NavList: link rows, a trailing mark, a section action, and an app sidebar.**
|
|
197
|
+
|
|
198
|
+
- **NavList** item `href` (new) — the row is an anchor, so a server-rendered app navigates without mapping `onSelect` to a router. `render={<Link href="/tasks/ikea" />}` (new) is the router link. Pass one. If both are set, `render` is used.
|
|
199
|
+
- `trailing` (new) — a **Status** dot or a **Badge** `status` pill at the end of the row. Counts stay tabular beside it.
|
|
200
|
+
- Section `action` (new) — an **IconButton** for filter or more, in the section label row.
|
|
201
|
+
- **Button** `layout="nav"` accepts `render`, the same way a pill does. A selected link sets `aria-current="page"`.
|
|
202
|
+
- Pattern: **Components/NavList → Pattern — app sidebar** — brand row, **Search**, sections, a footer slot, and below `lg` a **Sheet** `side="start"` opened from a menu **IconButton** in **PageHeader** `variant="app"`.
|
|
203
|
+
|
|
204
|
+
### Consumer actions
|
|
205
|
+
|
|
206
|
+
None for existing button rows.
|
|
207
|
+
|
|
208
|
+
To navigate from a row: pass `href` or `render`. Paste **Components/NavList → Pattern — app sidebar** (`docs/patterns/components-navlist--app-sidebar.tsx`) for the sidebar and the phone sheet.
|
|
209
|
+
|
|
210
|
+
## 0.4.12
|
|
211
|
+
|
|
212
|
+
**Badge: a status pill for run state, cadence, and freshness.**
|
|
213
|
+
|
|
214
|
+
- **Badge** `status` (new) — `active` | `idle` | `success` | `failed` | `warning`. A pill at cluster height (28px `sm`, 36px `md`) with tabular figures. `active` uses `bg-brand-tint` and `text-brand-outline` (navy `#011272` in light, the lifted navy in dark). The others use the existing muted fills. Not with `count`, `iconOnly`, or `avatar`.
|
|
215
|
+
- `dot` (new) — an 8px mark on a status pill. It pulses when `status` is `active`. Reduced motion holds it still. The mark is Badge's own dot, not the **Status** component.
|
|
216
|
+
- `icon` on a status pill leads cadence ("Every 2 days") and freshness ("Last checked 1d ago").
|
|
217
|
+
- Plain label badges stay on the 20 / 24px shell.
|
|
218
|
+
- Pattern: **Components/Badge → Pattern — status pill**.
|
|
219
|
+
|
|
220
|
+
### Consumer actions
|
|
221
|
+
|
|
222
|
+
None for existing badges.
|
|
223
|
+
|
|
224
|
+
For a routine's state: `<Badge status="active" dot>Active</Badge>`, and `<Badge status="idle" icon={<Calendar />}>Every 2 days</Badge>`. Paste **Components/Badge → Pattern — status pill** (`docs/patterns/components-badge--status-pill.tsx`).
|
|
225
|
+
|
|
226
|
+
## 0.4.11
|
|
227
|
+
|
|
228
|
+
**Stat: a hero figure with a visible "vs" line.**
|
|
229
|
+
|
|
230
|
+
- **Stat** `size="lg"` (new) — the figure is `type-display-3` with tabular numbers. The label is sentence case. `sm` and `md` are unchanged.
|
|
231
|
+
- `context` (new) — a visible secondary line under the figure, tabular, for "vs $14,850" or "of $1M goal". `trend.label` stays a tooltip on the badge.
|
|
232
|
+
- `icon` (new) — a leading Lucide glyph in a brand-tint tile (**ButtonIcon**). The glyph uses `text-brand-outline`, which is navy (`#011272`) in light and the lifted navy in dark.
|
|
233
|
+
- `action` (new) — label-row slot. Pass **Button** `size="sm"` ("View details").
|
|
234
|
+
- `unavailable` (new) — `{ reason, label? }` replaces the figure with muted "Not connected" (or `label`) and the reason. `trend` and `context` stay hidden. Do not fake a zero.
|
|
235
|
+
- `trend.direction` accepts `flat`, the same muted badge as `neutral`.
|
|
236
|
+
- `loading` still sets `aria-busy` and a **Skeleton**. `lg` adds a third bar for the context line.
|
|
237
|
+
- Pattern: **Components/Stat → Pattern — hero stat**.
|
|
238
|
+
|
|
239
|
+
### Consumer actions
|
|
240
|
+
|
|
241
|
+
None for existing **Stat** tiles.
|
|
242
|
+
|
|
243
|
+
For a hero KPI with a visible comparison: `size="lg"`, `context="vs $14,850"`, optional `icon` and `action`. Paste **Components/Stat → Pattern — hero stat** (`docs/patterns/components-stat--hero-stat.tsx`). When the source is unwired, pass `unavailable={{ reason }}` instead of a zero.
|
|
244
|
+
|
|
245
|
+
## 0.4.10
|
|
246
|
+
|
|
247
|
+
**CopyField: a read-only value with a Copy key button.** For copying an API key. See **ADR-0045**.
|
|
248
|
+
|
|
249
|
+
- **CopyField** (new) — a read-only monospace value and a **Button** `role="secondary"` `size="sm"` labeled "Copy key", seated at the trailing end of **PromptBar**'s pill. **Input** is `inline` `mono` (`type-code`) and truncates, so a long key does not run under the button. A click copies `value` and the label switches to "Copied" for `buttonStatusHoldMs` (2s), announced from the button's polite live region, then returns. The button is in the tab order (Enter and Space). Focusing the value selects it. If the Clipboard API is missing or blocked, the field selects the value, tries `execCommand('copy')`, and shows "Press Cmd/Ctrl+C to copy." in a polite status. The value is never logged.
|
|
250
|
+
- **Input** `mono` (new, optional) — the same monospace face, for a read-only key or id. Existing inputs are unchanged.
|
|
251
|
+
- `state` (`"copied"` | `"fallback"`) pins that appearance for a specimen. Omit it in the app.
|
|
252
|
+
- Patterns: **Components/CopyField → Pattern — copy key**, **Pattern — copied**, **Pattern — clipboard blocked**.
|
|
253
|
+
- **On a navy field** — `data-theme="dark"` does not belong on `bg-brand`. Dark surfaces are `#262626`, about 1:1 on `#011272`, so the pill and a secondary button disappear. The label and the clipboard hint inherit the section color instead of `text-fg` / `text-muted`. The pill stays a surface. **Button** `role="inverse-outline"` is the on-brand hairline (`--color-on-brand`, no new color). The filled action stays `role="inverse"`. See **ADR-0046**. Paste **Components/CopyField → Pattern — on a navy field**.
|
|
254
|
+
|
|
255
|
+
### Consumer actions
|
|
256
|
+
|
|
257
|
+
None for existing apps on a light surface.
|
|
258
|
+
|
|
259
|
+
On a brand-navy section: wrap it in `bg-brand text-on-brand`. Do not set `data-theme="dark"` on that section. Paste **Components/CopyField → Pattern — on a navy field** (`docs/patterns/components-copyfield--on-navy.tsx`): `<CopyField label="API key" value={apiKey} />`, **Button** `role="inverse"` for the filled action, `role="inverse-outline"` for the hairline. Do not log the key, and do not pass `state`.
|
|
260
|
+
|
|
261
|
+
To copy an API key on a light surface: `import { CopyField } from "@thewhatmatters/wmds"` and render `<CopyField label="API key" value={apiKey} />`. Paste **Components/CopyField → Pattern — copy key** (`docs/patterns/components-copyfield--copy-key.tsx`). Do not log the key, and do not pass `state`.
|
|
262
|
+
|
|
263
|
+
## 0.4.9
|
|
264
|
+
|
|
265
|
+
**Fixes from the site's 0.4.8 upgrade: router links in every page pattern, a tighter tile caption, and a checker that no longer skips files.**
|
|
266
|
+
|
|
267
|
+
- **`renderLink` on the page patterns** — one prop name everywhere, for links the app's router should handle. Without it they were plain anchors that reload the page, and swapping one in the pasted markup reads as drift.
|
|
268
|
+
- **Guides/Filter panel → Pattern — filtered index**: `renderLink={(post) => <Link href={post.href} />}` (new) — post titles.
|
|
269
|
+
- **Guides/Post page → Pattern — post page**: `renderLink={(link) => <Link href={link.href} />}` (new) — the **Breadcrumb** and the category tags. View as Markdown and the share links stay plain anchors.
|
|
270
|
+
- **Guides/Resource detail → Pattern — resource detail**: `renderLink={(item) => <Link href={item.href} />}` (new) on `ResourceDetailPage` — the **Breadcrumb**.
|
|
271
|
+
- **Pattern — filtered grid** already had it, for tiles.
|
|
272
|
+
- **IndexList.Item** `render` (new) — `render={<Link href="/blog/post" />}` in place of `href`, the same shape as **LinkTile** and **Badge**. `href` is now optional.
|
|
273
|
+
- **TextLink** `render` (new) — the same, for any text link. `href` is now optional; pass one or the other.
|
|
274
|
+
- **`type-caption`** (new type step; `typographyClass("caption-tight")`) — `type-supporting`'s size and weight on a 16px line. For a single line directly under a label; not for wrapped text, which stays on `type-supporting`. In this release it is used on **LinkTile**'s meta line only. **Foundations → Typography** lists it.
|
|
275
|
+
- **LinkTile** — the title and the meta line sit as a pair: no gap between them, and the meta line is on `type-caption`. The space between the title's text and the meta's goes from about 9px to about 5px. The 12px between the image and the title and the two-line clamp are unchanged. A tile with a meta line is 6px shorter. The `loading` placeholder's bars sit in the same 20px and 16px lines, so a placeholder is exactly as tall as a loaded tile with a one-line title.
|
|
276
|
+
- **`wmds-check`** — finds a pasted pattern's header when a `"use client"` or `"use server"` directive (or blank lines) comes before it. It read line 1 only, so such a file was skipped silently and never checked for drift. Findings name the header's line.
|
|
277
|
+
- **0.4.8 Consumer actions corrected** — they said to put `"use client"` above the pattern header. The header goes first and the directive below it, as the `use-wmds` skill says. Both orders now work with `wmds-check`.
|
|
278
|
+
- **TileGrid docs** — the space under a masonry tile is the 2rem row gap plus less than 4px (32px to just under 36px), not "within 3px". A tile's height rounds up to the next 4px row track. The behavior has not changed.
|
|
279
|
+
|
|
280
|
+
### Consumer actions
|
|
281
|
+
|
|
282
|
+
Re-copy three patterns, then pass the app's link through `renderLink`. Do the wiring in a client component (a function cannot cross from a server component), and remove any `<Link>` added to pasted markup.
|
|
283
|
+
|
|
284
|
+
1. **Re-copy Guides/Filter panel → Pattern — filtered index** (`node_modules/@thewhatmatters/wmds/docs/patterns/guides-filter-panel--filtered-index.tsx`) over `components/blog-index.tsx`, re-apply your content, data, and handlers, and pass `renderLink={(post) => <Link href={post.href} />}` to `<FilteredIndex>`.
|
|
285
|
+
2. **Re-copy Guides/Post page → Pattern — post page** (`…/docs/patterns/guides-post-page--post-page.tsx`) over `components/post-page.tsx`, re-apply your content, and pass `renderLink={(link) => <Link href={link.href} />}` to `<PostPage>`.
|
|
286
|
+
3. **Re-copy Guides/Resource detail → Pattern — resource detail** (`…/docs/patterns/guides-resource-detail--detail.tsx`) over `components/resource-detail.tsx`, re-apply your content, and pass `renderLink={(item) => <Link href={item.href} />}` to `<ResourceDetailPage>`.
|
|
287
|
+
4. **Pattern headers:** the header stays on the first lines with `"use client"` below it. A file with the directive first is now checked too, so `npx wmds-check` may report drift it skipped before. Fix the drift, or re-copy.
|
|
288
|
+
5. **LinkTile:** nothing to do. Tiles with a meta line are 6px shorter. Update a screenshot baseline or a test that measures a tile's height. **Pattern — filtered grid** did not change; no re-copy.
|
|
289
|
+
6. **`type-caption`:** do not move other text to it. It is for one line under a label.
|
|
290
|
+
7. Other apps: none. `render` on **TextLink** and **IndexList.Item** is optional.
|
|
291
|
+
|
|
10
292
|
## 0.4.8
|
|
11
293
|
|
|
12
294
|
**A filtered grid and a resource detail for a resources page.** Three new components and two page patterns: a tile that is one link, a grid that packs tiles in reading order, the filter panel as a component, and a resource's detail as a dialog over the grid or as its own page. The WhatMatters Resources page is the first use. See **ADR-0044**.
|
|
@@ -25,9 +307,9 @@ Every release of `@thewhatmatters/wmds` is listed here, newest first.
|
|
|
25
307
|
|
|
26
308
|
### Consumer actions
|
|
27
309
|
|
|
28
|
-
1. **WhatMatters site, Resources page: use the new grid.** Copy **Guides/Filter panel → Pattern — filtered grid** (`node_modules/@thewhatmatters/wmds/docs/patterns/guides-filter-panel--filtered-grid.tsx`) into `components/resource-grid.tsx`, keep its header comment, and add `"use client"`
|
|
310
|
+
1. **WhatMatters site, Resources page: use the new grid.** Copy **Guides/Filter panel → Pattern — filtered grid** (`node_modules/@thewhatmatters/wmds/docs/patterns/guides-filter-panel--filtered-grid.tsx`) into `components/resource-grid.tsx`, keep its header comment as the first lines, and add `"use client"` below it. Each item is `{ id, title, href, image: { src, alt, width, height }, meta?, tag?, facets }` with `href: "/resources/<slug>"`; give every image its real `width` and `height`. Delete the hand-built list in `app/resources/page.tsx` and its classes.
|
|
29
311
|
2. **Wire the grid in one small client file** (functions cannot cross from a server component): `components/resources.tsx` with `"use client"` renders `<FilteredGrid title="Resources" caption="Library" items={items} groups={groups} renderLink={(item) => <Link href={item.href} scroll={false} />} renderImage={(image) => <Image {...image} sizes="(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw" />} overlay={<SiteGridOverlay />} />`. `app/resources/page.tsx` loads the items and renders it. Change `sizes` if you change `columns`; allow the image hosts in `next.config.ts`. Do not edit the pasted file for any of this.
|
|
30
|
-
3. **Add the detail.** Copy **Guides/Resource detail → Pattern — resource detail** (`…/docs/patterns/guides-resource-detail--detail.tsx`) into `components/resource-detail.tsx`, keep its header comment, and add `"use client"
|
|
312
|
+
3. **Add the detail.** Copy **Guides/Resource detail → Pattern — resource detail** (`…/docs/patterns/guides-resource-detail--detail.tsx`) into `components/resource-detail.tsx`, keep its header comment as the first lines, and add `"use client"` below it. Each resource needs `{ id, title, image, video?: { src, poster, captions? }, category, tags?, meta?, note, added, addedLabel, visitHref, rows? }`.
|
|
31
313
|
4. **Pick the form by route.**
|
|
32
314
|
- The page: `app/resources/[slug]/page.tsx` renders `<ResourceDetailPage item={…} breadcrumb={[{ label: "Home", href: "/" }, { label: "Resources", href: "/resources" }, { label: item.title }]} overlay={<SiteGridOverlay />} />`. Delete `app/resources/[category]`: the categories become a filter group on the grid. No redirects.
|
|
33
315
|
- The dialog: a parallel slot with an intercepting route (`app/resources/@detail/(.)[slug]/page.tsx`, a `default.tsx` that returns `null`, and `{detail}` in `app/resources/layout.tsx`) renders a client component with `<ResourceDetailDialog item={…} open onClose={() => router.back()} onPrevious={previous ? () => router.replace("/resources/" + previous.slug, { scroll: false }) : undefined} onNext={…} position={"3 of 9"} />`. Leave `onPrevious` out on the first resource and `onNext` out on the last.
|
package/CONSUMING.md
CHANGED
|
@@ -273,7 +273,7 @@ import {
|
|
|
273
273
|
| `DescriptionList` | `layout` (`inline` \| `stacked`), `rule` (`solid` \| `dotted` \| `none`), `variant` (`sans` \| `mono`), `DescriptionList.Item` `name` / `layout` | Components/DescriptionList — **Pattern — post metadata**, **Pattern — details** |
|
|
274
274
|
| `SectionCaption` | `children`, `as`, `id`, `end`, `marker`, `rule` | Components/SectionCaption — **Pattern — column caption**, **Pattern — caption with an action** |
|
|
275
275
|
| `Prose` | `size` (`lg` \| `md`), `measure` (`reading` \| `none`), `as` | Components/Prose — **Pattern — article body**. Full page: **Guides/Post page → Pattern — post page** |
|
|
276
|
-
| `IndexList` | `captions`, `size`, `titleAs`, `empty`, `IndexList.Item` `meta` / `title` / `href` / `preview` | Components/IndexList — **Pattern — post index**. With filters: **Guides/Filter panel → Pattern — filtered index** |
|
|
276
|
+
| `IndexList` | `captions`, `size`, `titleAs`, `empty`, `IndexList.Item` `meta` / `title` / `href` or `render` / `preview` | Components/IndexList — **Pattern — post index**. With filters: **Guides/Filter panel → Pattern — filtered index** |
|
|
277
277
|
| `LinkTile` | `title`, `href` / `render`, `external`, `media`, `ratio`, `meta`, `tag`, `source`, `loading` | Components/LinkTile — **Pattern — resource tile**, **Pattern — router link** |
|
|
278
278
|
| `TileGrid` | `layout` (`masonry` / `uniform`), `columns`, `empty`, `busy`, `TileGrid.Item` | Components/TileGrid — **Pattern — tile grid**. With filters: **Guides/Filter panel → Pattern — filtered grid** |
|
|
279
279
|
| `FilterPanel` | `groups`, `selection`, `onSelectionChange`, `resultsLabel`, `labels`; `FilterPanel.Rail` / `.Trigger` / `.Sheet`; `useFilterSelection`, `matchesFilterSelection`, `countFilterOptions` | Components/FilterPanel — **Pattern — filter panel** |
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ npm run validate:composition # molecules/organisms must compose atoms (CI)
|
|
|
48
48
|
| Atoms | `Avatar`, `Badge`, `Button`, `Checkbox`, `IconButton`, `Input`, `Kbd`, `Radio`, `RiveHand`, `Skeleton`, `Status`, `Switch`, `TextArea`, `TextLink`, `Tooltip` |
|
|
49
49
|
| Molecules | `Accordion`, `CalEmbed`, `Card`, `ChatQa`, `CheckboxGroup`, `Chip`, `DisplayControls`, `Dropdown`, `Field`, `FloatingActionButton`, `HeroIntro`, `IntakeForm`, `NavList`, `PageHeader`, `PillGroup`, `PromptBar`, `RadioGroup`, `Search`, `Select`, `SelectableCard`, `SegmentedControl`, `Stat`, `StepProgress`, `TaskRows`, `TextSequence` |
|
|
50
50
|
| Organisms | `Carousel`, `Chart`, `Confetti`, `Dialog`, `FooterReveal`, `HeroTileStack`, `IntakeConfirmation`, `IntakeModal`, `MoreMenu`, `Panel`, `ScrollHorizontal`, `Sheet`, `SiteNav`, `Tab`, `Toast` |
|
|
51
|
-
| Planned, not built | `Pagination
|
|
51
|
+
| Planned, not built | `Pagination` |
|
|
52
52
|
|
|
53
53
|
The list is `src/package.manifest.ts`. `npm run build` fails when it and `src/index.ts` disagree.
|
|
54
54
|
|
package/bin/wmds-check.mjs
CHANGED
|
@@ -230,22 +230,26 @@ for (const file of files) {
|
|
|
230
230
|
});
|
|
231
231
|
|
|
232
232
|
// Pasted patterns.
|
|
233
|
-
|
|
233
|
+
// The header is the file's first comment line. A "use client" / "use server" directive or blank
|
|
234
|
+
// lines may come before it.
|
|
235
|
+
const headerIndex = lines.findIndex((line) => line.trim() !== "" && !/^\s*["']use (client|server)["'];?\s*$/.test(line));
|
|
236
|
+
const headerLine = headerIndex === -1 ? 0 : headerIndex;
|
|
237
|
+
const header = lines[headerLine]?.match(/^\/\/ @thewhatmatters\/wmds@([\w.-]+) · (.+)$/);
|
|
234
238
|
const id = source.match(/\?path=\/story\/([\w-]+)/)?.[1];
|
|
235
239
|
if (header && id && packageRoot) {
|
|
236
240
|
const shipped = path.join(packageRoot, "docs", "patterns", `${id}.tsx`);
|
|
237
241
|
if (!existsSync(shipped)) {
|
|
238
|
-
report(file, 1, "pattern-removed", "error", `pattern ${id} no longer ships in ${packageVersion} — see CHANGELOG.md`);
|
|
242
|
+
report(file, headerLine + 1, "pattern-removed", "error", `pattern ${id} no longer ships in ${packageVersion} — see CHANGELOG.md`);
|
|
239
243
|
} else {
|
|
240
244
|
if (header[1] !== packageVersion) {
|
|
241
|
-
report(file, 1, "pattern-stale", "warn", `pasted from ${header[1]}, installed ${packageVersion} — re-copy if CHANGELOG names it`);
|
|
245
|
+
report(file, headerLine + 1, "pattern-stale", "warn", `pasted from ${header[1]}, installed ${packageVersion} — re-copy if CHANGELOG names it`);
|
|
242
246
|
}
|
|
243
247
|
const shippedStructure = patternStructure(readFileSync(shipped, "utf8"));
|
|
244
248
|
const pastedStructure = patternStructure(source);
|
|
245
249
|
if (shippedStructure.join("\n") !== pastedStructure.join("\n")) {
|
|
246
250
|
report(
|
|
247
251
|
file,
|
|
248
|
-
1,
|
|
252
|
+
headerLine + 1,
|
|
249
253
|
"pattern-drift",
|
|
250
254
|
"warn",
|
|
251
255
|
`markup or classes differ from docs/patterns/${id}.tsx (${firstDifference(shippedStructure, pastedStructure)}) — allowed edits are content, data, handlers, exports`,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { type AvatarSize } from "../Avatar/Avatar";
|
|
3
|
-
import { type BadgeEmphasis, type BadgeSize, type BadgeVariant } from "./badgeStyles";
|
|
4
|
-
export type { BadgeEmphasis, BadgeSize, BadgeVariant } from "./badgeStyles";
|
|
5
|
-
export { badgeEmphases, badgeVariants } from "./badgeStyles";
|
|
3
|
+
import { type BadgeEmphasis, type BadgeSize, type BadgeStatus, type BadgeVariant } from "./badgeStyles";
|
|
4
|
+
export type { BadgeEmphasis, BadgeSize, BadgeStatus, BadgeVariant } from "./badgeStyles";
|
|
5
|
+
export { badgeEmphases, badgeStatuses, badgeVariants } from "./badgeStyles";
|
|
6
6
|
/** Layout-only — not for colors, borders, or typography overrides. */
|
|
7
7
|
export type BadgeLayoutClassName = string;
|
|
8
8
|
/** Leading round image. `alt` is the Avatar name; pass `""` when the badge label already speaks the word. */
|
|
@@ -38,6 +38,13 @@ export interface BadgeProps {
|
|
|
38
38
|
count?: number;
|
|
39
39
|
/** Leading Lucide icon — label pattern, or required for `iconOnly`. Not with `avatar`. */
|
|
40
40
|
icon?: ReactElement;
|
|
41
|
+
/**
|
|
42
|
+
* Status pill — run state (`active`), cadence, or freshness. Owns the fill:
|
|
43
|
+
* `active` is the brand-tint pill; the others are muted. Not with `count`, `iconOnly`, or `avatar`.
|
|
44
|
+
*/
|
|
45
|
+
status?: BadgeStatus;
|
|
46
|
+
/** Leading 8px dot on a status pill. Pulses when `status` is `active`. */
|
|
47
|
+
dot?: boolean;
|
|
41
48
|
/**
|
|
42
49
|
* Leading round image — renders **Avatar** at `badgeAvatarSize` for this badge's `size`.
|
|
43
50
|
* Mutually exclusive with `icon`, `iconOnly`, and `count`.
|
|
@@ -52,8 +59,9 @@ export interface BadgeProps {
|
|
|
52
59
|
}
|
|
53
60
|
/**
|
|
54
61
|
* Short status, count, or category label — solid, muted, or outline semantic fills.
|
|
62
|
+
* `status` is the pill for run state, cadence, and freshness (a dot and an optional icon).
|
|
55
63
|
* Pattern-first: label, count, icon + label, avatar + label, icon-only, muted and outline emphasis,
|
|
56
|
-
* mono caps,
|
|
64
|
+
* mono caps, links (`render`), and the status pill.
|
|
57
65
|
*/
|
|
58
|
-
export declare function Badge({ children, variant, size, emphasis, mono, render, count, icon, avatar, iconOnly, id, className, }: BadgeProps): import("react").JSX.Element;
|
|
66
|
+
export declare function Badge({ children, variant, size, emphasis, mono, render, count, icon, avatar, iconOnly, status, dot, id, className, }: BadgeProps): import("react").JSX.Element;
|
|
59
67
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAiBL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5E,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,6GAA6G;AAC7G,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAGzD,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mGAAmG;IACnG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AA0DD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,OAAmB,EACnB,IAAW,EACX,QAAkB,EAClB,IAAY,EACZ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAgB,EAChB,MAAM,EACN,GAAW,EACX,EAAE,EACF,SAAS,GACV,EAAE,UAAU,+BAmFZ"}
|
|
@@ -1,80 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { Avatar as t } from "../Avatar/Avatar.js";
|
|
4
|
-
import { badgeAvatarLabelSizeClasses as n, badgeBaseClasses as r, badgeCountSizeClasses as i, badgeEmphases as a, badgeIconGapClasses as o, badgeIconOnlySizeClasses as s, badgeInteractiveClasses as c, badgeLabelSizeClasses as l, badgeSolidClasses as u,
|
|
5
|
-
import { BadgeIcon as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useRender as
|
|
4
|
+
import { badgeAvatarLabelSizeClasses as n, badgeBaseClasses as r, badgeCountSizeClasses as i, badgeEmphases as a, badgeIconGapClasses as o, badgeIconOnlySizeClasses as s, badgeInteractiveClasses as c, badgeLabelSizeClasses as l, badgeSolidClasses as u, badgeStatusDotClasses as d, badgeStatusDotToneClasses as f, badgeStatusSizeClasses as p, badgeStatusSurfaceClasses as m, badgeStatuses as h, badgeSurfaceClasses as g, badgeVariants as _ } from "./badgeStyles.js";
|
|
5
|
+
import { BadgeIcon as v } from "./BadgeIcon.js";
|
|
6
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
import { useRender as x } from "@base-ui/react/use-render";
|
|
8
8
|
//#region src/components/atoms/Badge/Badge.tsx
|
|
9
|
-
var
|
|
9
|
+
var S = {
|
|
10
10
|
sm: "xsm",
|
|
11
11
|
md: "sm"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
if ((e.render != null || e.mono) && (e.count != null || e.iconOnly) && console.warn("[WMDS Badge] `render` and `mono` apply to label, icon, and avatar badges — not `count` or `iconOnly`."), e.avatar && (e.icon || e.iconOnly || e.count != null) && console.warn("[WMDS Badge] `avatar` is mutually exclusive with `icon`, `iconOnly`, and `count`."), e.count != null && e.icon && console.warn("[WMDS Badge] `count` is mutually exclusive with `icon`."), e.iconOnly) {
|
|
13
|
+
function C(e) {
|
|
14
|
+
if ((e.render != null || e.mono) && (e.count != null || e.iconOnly) && console.warn("[WMDS Badge] `render` and `mono` apply to label, icon, and avatar badges — not `count` or `iconOnly`."), e.avatar && (e.icon || e.iconOnly || e.count != null) && console.warn("[WMDS Badge] `avatar` is mutually exclusive with `icon`, `iconOnly`, and `count`."), e.count != null && e.icon && console.warn("[WMDS Badge] `count` is mutually exclusive with `icon`."), e.status && (e.count != null || e.iconOnly || e.avatar) && console.warn("[WMDS Badge] `status` is a label pill — not with `count`, `iconOnly`, or `avatar`."), e.dot && !e.status && console.warn("[WMDS Badge] `dot` applies to a `status` pill."), e.iconOnly) {
|
|
15
15
|
e.icon || console.warn("[WMDS Badge] `iconOnly` requires `icon`."), (e.count != null || e.children != null) && console.warn("[WMDS Badge] `iconOnly` is mutually exclusive with `children` and `count`.");
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
e.children == null && e.count == null && console.warn("[WMDS Badge] Provide `children`, `count`, or `iconOnly` + `icon`.");
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function w({ render: e, ...t }) {
|
|
21
|
+
return x({
|
|
22
22
|
render: e,
|
|
23
23
|
defaultTagName: "span",
|
|
24
24
|
props: t
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
count:
|
|
30
|
-
icon:
|
|
31
|
-
avatar:
|
|
32
|
-
iconOnly:
|
|
27
|
+
function T({ children: a, variant: h = "neutral", size: _ = "sm", emphasis: x = "solid", mono: T = !1, render: E, count: D, icon: O, avatar: k, iconOnly: A = !1, status: j, dot: M = !1, id: N, className: P }) {
|
|
28
|
+
C({
|
|
29
|
+
count: D,
|
|
30
|
+
icon: O,
|
|
31
|
+
avatar: k,
|
|
32
|
+
iconOnly: A,
|
|
33
33
|
children: a,
|
|
34
|
-
render:
|
|
35
|
-
mono:
|
|
34
|
+
render: E,
|
|
35
|
+
mono: T,
|
|
36
|
+
status: j,
|
|
37
|
+
dot: M
|
|
36
38
|
});
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
id:
|
|
40
|
-
className: e(r,
|
|
41
|
-
"data-variant":
|
|
42
|
-
"data-size":
|
|
43
|
-
"data-emphasis":
|
|
39
|
+
let F = D != null && k == null && j == null, I = A && O != null && !F && k == null && j == null, L = k != null && !F && !I && j == null, R = j != null && !F && !I && !L, z = O != null && !F && !I && !L, B = R && M, V = R ? m[j] : g(h, x);
|
|
40
|
+
return F ? /* @__PURE__ */ y("span", {
|
|
41
|
+
id: N,
|
|
42
|
+
className: e(r, V, i[_], P),
|
|
43
|
+
"data-variant": h,
|
|
44
|
+
"data-size": _,
|
|
45
|
+
"data-emphasis": x,
|
|
44
46
|
"data-pattern": "count",
|
|
45
|
-
children:
|
|
46
|
-
}) :
|
|
47
|
-
id:
|
|
48
|
-
className: e(r, u[
|
|
49
|
-
"data-variant":
|
|
47
|
+
children: D
|
|
48
|
+
}) : I ? /* @__PURE__ */ y("span", {
|
|
49
|
+
id: N,
|
|
50
|
+
className: e(r, u[h], s, P),
|
|
51
|
+
"data-variant": h,
|
|
50
52
|
"data-pattern": "icon-only",
|
|
51
53
|
"aria-hidden": !0,
|
|
52
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ y(v, {
|
|
53
55
|
size: "sm",
|
|
54
|
-
children:
|
|
56
|
+
children: O
|
|
55
57
|
})
|
|
56
|
-
}) : /* @__PURE__ */
|
|
57
|
-
render:
|
|
58
|
-
id:
|
|
59
|
-
className: e(r,
|
|
60
|
-
"data-variant":
|
|
61
|
-
"data-size":
|
|
62
|
-
"data-emphasis":
|
|
63
|
-
"data-pattern":
|
|
64
|
-
"data-mono":
|
|
58
|
+
}) : /* @__PURE__ */ b(w, {
|
|
59
|
+
render: E,
|
|
60
|
+
id: N,
|
|
61
|
+
className: e(r, V, R ? p[_] : L ? n[_] : l[_], !R && z && o[_], T && "!font-mono !text-[length:var(--font-size-sm)] !font-normal !uppercase !tracking-[0.14em]", E != null && c, E != null && x === "outline" && "hover:border-fg", P),
|
|
62
|
+
"data-variant": h,
|
|
63
|
+
"data-size": _,
|
|
64
|
+
"data-emphasis": R ? "muted" : x,
|
|
65
|
+
"data-pattern": R ? "status" : L ? "avatar" : z ? "icon" : "label",
|
|
66
|
+
"data-mono": T ? "" : void 0,
|
|
67
|
+
"data-status": R ? j : void 0,
|
|
65
68
|
children: [
|
|
66
|
-
|
|
67
|
-
name:
|
|
68
|
-
src:
|
|
69
|
-
size: _
|
|
69
|
+
L && k != null ? /* @__PURE__ */ y(t, {
|
|
70
|
+
name: k.alt,
|
|
71
|
+
src: k.src,
|
|
72
|
+
size: S[_]
|
|
70
73
|
}) : null,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
B ? /* @__PURE__ */ y("span", {
|
|
75
|
+
className: e(d, f[j], j === "active" && "animate-status-dot-pulse"),
|
|
76
|
+
"data-pulsing": j === "active" ? "" : void 0,
|
|
77
|
+
"aria-hidden": !0
|
|
78
|
+
}) : null,
|
|
79
|
+
z ? /* @__PURE__ */ y(v, {
|
|
80
|
+
size: _,
|
|
81
|
+
children: O
|
|
74
82
|
}) : null,
|
|
75
83
|
a
|
|
76
84
|
]
|
|
77
85
|
});
|
|
78
86
|
}
|
|
79
87
|
//#endregion
|
|
80
|
-
export {
|
|
88
|
+
export { T as Badge, S as badgeAvatarSize, a as badgeEmphases, h as badgeStatuses, _ as badgeVariants };
|
|
@@ -4,6 +4,21 @@ export type BadgeVariant = (typeof badgeVariants)[number];
|
|
|
4
4
|
export type BadgeSize = "sm" | "md";
|
|
5
5
|
export declare const badgeEmphases: readonly ["solid", "muted", "outline"];
|
|
6
6
|
export type BadgeEmphasis = (typeof badgeEmphases)[number];
|
|
7
|
+
/** Run state, cadence, and freshness — a pill, not a new component. */
|
|
8
|
+
export declare const badgeStatuses: readonly ["active", "idle", "success", "failed", "warning"];
|
|
9
|
+
export type BadgeStatus = (typeof badgeStatuses)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Status-pill fills. `active` is brand navy through `bg-brand-tint` / `text-brand-outline`
|
|
12
|
+
* (navy in light, the lifted navy in dark). The others reuse muted badge fills.
|
|
13
|
+
*/
|
|
14
|
+
export declare const badgeStatusSurfaceClasses: Record<BadgeStatus, string>;
|
|
15
|
+
/** 8px mark — same scale as Status `variant="dot"`, painted here so Badge stays an atom. */
|
|
16
|
+
export declare const badgeStatusDotClasses = "inline-block size-2 shrink-0 rounded-full";
|
|
17
|
+
export declare const badgeStatusDotToneClasses: Record<BadgeStatus, string>;
|
|
18
|
+
/** Pulses on `active` only. Reduced motion clears it in global.css. */
|
|
19
|
+
export declare const badgeStatusDotPulseClass = "animate-status-dot-pulse";
|
|
20
|
+
/** Cluster heights so a status pill sits with Chip, not the 20px label badge. */
|
|
21
|
+
export declare const badgeStatusSizeClasses: Record<BadgeSize, string>;
|
|
7
22
|
/** Shared shell — Astryx-style compact pill labels. */
|
|
8
23
|
export declare const badgeBaseClasses = "inline-flex shrink-0 items-center justify-center font-sans font-medium normal-case tracking-normal";
|
|
9
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badgeStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Badge/badgeStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"badgeStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Badge/badgeStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKrE,eAAO,MAAM,aAAa,mEAAoE,CAAC;AAE/F,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpC,eAAO,MAAM,aAAa,wCAAyC,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,uEAAuE;AACvE,eAAO,MAAM,aAAa,6DAA8D,CAAC;AAEzF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMjE,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,qBAAqB,8CAA8C,CAAC;AAEjF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAMjE,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG5D,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,uGACyE,CAAC;AAEvG;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAM1D,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAM1D,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAM5D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,CAG1F;AAED,sHAAsH;AACtH,eAAO,MAAM,gBAAgB,6FAC+D,CAAC;AAE7F;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAMnC,CAAC;AAEF,eAAO,MAAM,8BAA8B,oBAAoB,CAAC;AAEhE,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG3D,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAGzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAGjE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG1D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG3D,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,+DACwB,CAAC;AAE/D,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAKhE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAEnE;AAED,YAAY,EAAE,eAAe,EAAE,CAAC"}
|