@thewhatmatters/wmds 0.4.9 → 0.4.28
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 +303 -0
- package/CONSUMING.md +62 -1
- package/README.md +1 -1
- package/bin/wmds-check.mjs +47 -0
- package/dist/colors.css +92 -0
- 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 +42 -20
- package/dist/components/atoms/Band/Band.d.ts +27 -0
- package/dist/components/atoms/Band/Band.d.ts.map +1 -0
- package/dist/components/atoms/Band/Band.js +22 -0
- package/dist/components/atoms/Band/bandStyles.d.ts +20 -0
- package/dist/components/atoms/Band/bandStyles.d.ts.map +1 -0
- package/dist/components/atoms/Band/bandStyles.js +23 -0
- 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/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +12 -5
- 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 +2 -2
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +16 -14
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +69 -68
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +1 -1
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +13 -12
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +2 -2
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/iconButtonStyles.js +1 -1
- package/dist/components/atoms/InlinePill/InlinePill.d.ts +42 -0
- package/dist/components/atoms/InlinePill/InlinePill.d.ts.map +1 -0
- package/dist/components/atoms/InlinePill/InlinePill.js +48 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.d.ts +27 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.d.ts.map +1 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.js +19 -0
- package/dist/components/atoms/Input/Input.d.ts +9 -4
- 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 +10 -4
- package/dist/components/atoms/Input/inputShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/Input/inputShellStyles.js +40 -40
- package/dist/components/atoms/RiveHand/RiveHand.d.ts.map +1 -1
- package/dist/components/atoms/RiveHand/RiveHand.js +83 -81
- package/dist/components/atoms/Skeleton/skeletonStyles.js +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/atoms/Switch/Switch.js +45 -44
- package/dist/components/atoms/Switch/switchStyles.d.ts +1 -1
- package/dist/components/atoms/Switch/switchStyles.d.ts.map +1 -1
- package/dist/components/atoms/Switch/switchStyles.js +1 -1
- 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 +5 -5
- package/dist/components/molecules/Accordion/accordionStyles.d.ts +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.js +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.js +80 -122
- 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 +19 -5
- package/dist/components/molecules/ChatQa/chatQaStyles.d.ts +1 -1
- package/dist/components/molecules/ChatQa/chatQaStyles.d.ts.map +1 -1
- package/dist/components/molecules/ChatQa/chatQaStyles.js +1 -1
- 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/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts +2 -2
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/DropdownItem.js +30 -27
- package/dist/components/molecules/Dropdown/dropdownStyles.js +1 -1
- package/dist/components/molecules/Dropdown/resolveOverflow.d.ts +14 -0
- package/dist/components/molecules/Dropdown/resolveOverflow.d.ts.map +1 -0
- package/dist/components/{organisms/Tab/tabOverflow.js → molecules/Dropdown/resolveOverflow.js} +2 -2
- package/dist/components/molecules/Dropdown/useDropdownMenu.d.ts +70 -0
- package/dist/components/molecules/Dropdown/useDropdownMenu.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/useDropdownMenu.js +155 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.d.ts +71 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.js +61 -0
- package/dist/components/molecules/Field/Field.d.ts.map +1 -1
- package/dist/components/molecules/Field/Field.js +11 -10
- 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/PillGroup/pillGroupStyles.js +1 -1
- package/dist/components/molecules/Search/searchStyles.js +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.d.ts +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.js +8 -8
- package/dist/components/molecules/Select/Select.d.ts +3 -1
- package/dist/components/molecules/Select/Select.d.ts.map +1 -1
- package/dist/components/molecules/Select/Select.js +75 -119
- package/dist/components/molecules/Select/selectStyles.js +3 -3
- 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 +24 -4
- package/dist/components/molecules/Stat/statStyles.d.ts.map +1 -1
- package/dist/components/molecules/Stat/statStyles.js +30 -13
- 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/TextSequence/TextSequence.d.ts.map +1 -1
- package/dist/components/molecules/TextSequence/TextSequence.js +35 -35
- package/dist/components/organisms/AppShell/AppShell.d.ts +84 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/AppShell.js +231 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts +20 -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/AlertDialog.d.ts +7 -1
- package/dist/components/organisms/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/AlertDialog.js +54 -50
- package/dist/components/organisms/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +52 -71
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.js +1 -0
- package/dist/components/organisms/Dialog/dialogStyles.d.ts +14 -1
- package/dist/components/organisms/Dialog/dialogStyles.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/dialogStyles.js +3 -3
- package/dist/components/organisms/FilterPanel/FilterPanel.d.ts.map +1 -1
- package/dist/components/organisms/FilterPanel/FilterPanel.js +52 -42
- package/dist/components/organisms/IntakeModal/IntakeModal.d.ts +6 -1
- package/dist/components/organisms/IntakeModal/IntakeModal.d.ts.map +1 -1
- package/dist/components/organisms/IntakeModal/IntakeModal.js +54 -66
- package/dist/components/organisms/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/components/organisms/MoreMenu/MoreMenu.js +45 -101
- package/dist/components/organisms/Panel/Panel.d.ts.map +1 -1
- package/dist/components/organisms/Panel/Panel.js +44 -53
- 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 +66 -81
- 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/SiteNav/SiteNav.d.ts +0 -9
- package/dist/components/organisms/SiteNav/SiteNav.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/SiteNav.js +236 -286
- package/dist/components/organisms/SiteNav/siteNavStyles.js +1 -1
- package/dist/components/organisms/Tab/Tab.d.ts.map +1 -1
- package/dist/components/organisms/Tab/Tab.js +77 -127
- package/dist/components/organisms/Tab/tabStyles.d.ts +2 -1
- package/dist/components/organisms/Tab/tabStyles.d.ts.map +1 -1
- package/dist/components/organisms/Tab/tabStyles.js +7 -7
- package/dist/fonts.css +10 -0
- package/dist/grid.css +38 -0
- package/dist/index.d.ts +16 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -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/contrast.d.ts +11 -0
- package/dist/lib/contrast.d.ts.map +1 -0
- package/dist/lib/dialogOverlay.d.ts +34 -1
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +100 -23
- 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 +1 -1
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/shape.css +24 -3
- package/dist/styles.css +1 -1
- package/dist/typography.css +55 -8
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +101 -0
- package/docs/components.md +19 -12
- package/docs/exports.json +142 -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-band--page-in-bands.tsx +39 -0
- 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--alert-dialog-typed-confirmation.tsx +54 -0
- 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 +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
- package/docs/patterns/index.json +193 -1
- package/package.json +1 -1
- package/dist/components/organisms/Tab/tabOverflow.d.ts +0 -14
- package/dist/components/organisms/Tab/tabOverflow.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — bottom sheet
|
|
2
2
|
// Storybook: Components/Sheet → Pattern — bottom sheet (?path=/story/components-sheet--bottom-sheet)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — end sheet
|
|
2
2
|
// Storybook: Components/Sheet → Pattern — end sheet (?path=/story/components-sheet--end-sheet)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — side sheet header actions
|
|
2
|
+
// Storybook: Components/Sheet → Pattern — side sheet header actions (?path=/story/components-sheet--side-sheet-header-actions)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
7
|
+
import { Button, IconButton, Sheet } from "@thewhatmatters/wmds";
|
|
8
|
+
|
|
9
|
+
export function StepThroughSheet() {
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const [index, setIndex] = useState(0);
|
|
12
|
+
const names = ["Maya Chen", "Field notes: Q4 studio update", "Dev Patel"];
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Button role="secondary" onClick={() => setOpen(true)}>
|
|
17
|
+
Review queue
|
|
18
|
+
</Button>
|
|
19
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
20
|
+
<Sheet.Content
|
|
21
|
+
side="end"
|
|
22
|
+
title={names[index]}
|
|
23
|
+
description={`${index + 1} of ${names.length}`}
|
|
24
|
+
headerActions={
|
|
25
|
+
<>
|
|
26
|
+
<IconButton
|
|
27
|
+
size="sm"
|
|
28
|
+
role="ghost"
|
|
29
|
+
icon={<ChevronUp strokeWidth={2} />}
|
|
30
|
+
aria-label="Previous"
|
|
31
|
+
disabled={index === 0}
|
|
32
|
+
onClick={() => setIndex(index - 1)}
|
|
33
|
+
/>
|
|
34
|
+
<IconButton
|
|
35
|
+
size="sm"
|
|
36
|
+
role="ghost"
|
|
37
|
+
icon={<ChevronDown strokeWidth={2} />}
|
|
38
|
+
aria-label="Next"
|
|
39
|
+
disabled={index === names.length - 1}
|
|
40
|
+
onClick={() => setIndex(index + 1)}
|
|
41
|
+
/>
|
|
42
|
+
</>
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
<p>Detail for {names[index]}.</p>
|
|
46
|
+
</Sheet.Content>
|
|
47
|
+
</Sheet>
|
|
48
|
+
</>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — side sheet URL deep link
|
|
2
|
+
// Storybook: Components/Sheet → Pattern — side sheet URL deep link (?path=/story/components-sheet--side-sheet-url-deep-link)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { TextLink, Sheet, Button, useSheetParam, withSheetParam, dialogFooterActionsClasses } from "@thewhatmatters/wmds";
|
|
6
|
+
|
|
7
|
+
interface ApprovalRow {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function ApprovalList({ rows, initialUrl }: { rows: ApprovalRow[]; initialUrl?: string }) {
|
|
13
|
+
const { open, id, onOpenChange } = useSheetParam("approval", { initialUrl });
|
|
14
|
+
const row = rows.find((item) => item.id === id);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<ul className="flex flex-col gap-2">
|
|
19
|
+
{rows.map((item) => (
|
|
20
|
+
<li key={item.id}>
|
|
21
|
+
<TextLink
|
|
22
|
+
href={withSheetParam(initialUrl ?? "/approvals", item.id, "approval")}
|
|
23
|
+
onClick={(event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
onOpenChange(true, item.id);
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
{item.name}
|
|
29
|
+
</TextLink>
|
|
30
|
+
</li>
|
|
31
|
+
))}
|
|
32
|
+
</ul>
|
|
33
|
+
<Sheet open={open && row != null} onOpenChange={(next) => onOpenChange(next)}>
|
|
34
|
+
<Sheet.Content
|
|
35
|
+
side="end"
|
|
36
|
+
title={row?.name}
|
|
37
|
+
description="Creator application"
|
|
38
|
+
footer={
|
|
39
|
+
<div className={dialogFooterActionsClasses}>
|
|
40
|
+
<Button size="sm" role="primary" onClick={() => onOpenChange(false)}>
|
|
41
|
+
Done
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
<p>Detail for {row?.name}.</p>
|
|
47
|
+
</Sheet.Content>
|
|
48
|
+
</Sheet>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — side sheet
|
|
2
|
+
// Storybook: Components/Sheet → Pattern — side sheet (?path=/story/components-sheet--side-sheet)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Button, Sheet, dialogFooterActionsClasses } from "@thewhatmatters/wmds";
|
|
7
|
+
|
|
8
|
+
export function ApprovalSheet() {
|
|
9
|
+
const [open, setOpen] = useState(false);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<Button role="primary" onClick={() => setOpen(true)}>
|
|
14
|
+
Review Maya Chen
|
|
15
|
+
</Button>
|
|
16
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
17
|
+
<Sheet.Content
|
|
18
|
+
side="end"
|
|
19
|
+
size="md"
|
|
20
|
+
title="Maya Chen"
|
|
21
|
+
description="Creator application, waiting 3 days"
|
|
22
|
+
footer={
|
|
23
|
+
<div className={dialogFooterActionsClasses}>
|
|
24
|
+
<Button size="sm" role="outline" onClick={() => setOpen(false)}>
|
|
25
|
+
Deny
|
|
26
|
+
</Button>
|
|
27
|
+
<Button size="sm" role="primary" onClick={() => setOpen(false)}>
|
|
28
|
+
Approve
|
|
29
|
+
</Button>
|
|
30
|
+
</div>
|
|
31
|
+
}
|
|
32
|
+
>
|
|
33
|
+
<p>Writes about independent studios. Two published samples attached.</p>
|
|
34
|
+
</Sheet.Content>
|
|
35
|
+
</Sheet>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — brand + CTA
|
|
2
2
|
// Storybook: Components/SiteNav → Pattern — brand + CTA (?path=/story/components-sitenav--brand-and-cta)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — centered links
|
|
2
2
|
// Storybook: Components/SiteNav → Pattern — centered links (?path=/story/components-sitenav--centered-links)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — compact (scrolled)
|
|
2
2
|
// Storybook: Components/SiteNav → Pattern — compact (scrolled) (?path=/story/components-sitenav--compact)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — marketing header
|
|
2
2
|
// Storybook: Components/SiteNav → Pattern — marketing header (?path=/story/components-sitenav--marketing-header)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — mega menu
|
|
2
2
|
// Storybook: Components/SiteNav → Pattern — mega menu (?path=/story/components-sitenav--mega-menu)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — hero stat
|
|
2
|
+
// Storybook: Components/Stat → Pattern — hero stat (?path=/story/components-stat--hero-stat)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { Button, Stat } from "@thewhatmatters/wmds";
|
|
6
|
+
import { BarChart3, Receipt, Unplug, Wallet } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
export function HeroStats() {
|
|
9
|
+
return (
|
|
10
|
+
<Stat.Group aria-label="Performance" columns={2}>
|
|
11
|
+
<Stat
|
|
12
|
+
size="lg"
|
|
13
|
+
icon={<Receipt strokeWidth={2} />}
|
|
14
|
+
label="Attributed revenue"
|
|
15
|
+
value="$18,420"
|
|
16
|
+
trend={{ value: "+24.1%", direction: "up" }}
|
|
17
|
+
context="vs $14,850"
|
|
18
|
+
action={
|
|
19
|
+
<Button role="secondary" size="sm">
|
|
20
|
+
View details
|
|
21
|
+
</Button>
|
|
22
|
+
}
|
|
23
|
+
/>
|
|
24
|
+
<Stat
|
|
25
|
+
size="lg"
|
|
26
|
+
icon={<BarChart3 strokeWidth={2} />}
|
|
27
|
+
label="Return on spend"
|
|
28
|
+
value="2.7×"
|
|
29
|
+
trend={{ value: "−0.4", direction: "down" }}
|
|
30
|
+
context="vs 3.1×"
|
|
31
|
+
/>
|
|
32
|
+
<Stat
|
|
33
|
+
size="lg"
|
|
34
|
+
icon={<Wallet strokeWidth={2} />}
|
|
35
|
+
label="Available to spend"
|
|
36
|
+
value="$14.00"
|
|
37
|
+
trend={{ value: "0.0%", direction: "flat" }}
|
|
38
|
+
context="of $1M goal"
|
|
39
|
+
/>
|
|
40
|
+
<Stat
|
|
41
|
+
size="lg"
|
|
42
|
+
icon={<Unplug strokeWidth={2} />}
|
|
43
|
+
label="Content awaiting approval"
|
|
44
|
+
value=""
|
|
45
|
+
unavailable={{ reason: "Google Analytics is not linked" }}
|
|
46
|
+
action={
|
|
47
|
+
<Button role="secondary" size="sm">
|
|
48
|
+
Connect
|
|
49
|
+
</Button>
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
</Stat.Group>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — insights row
|
|
2
2
|
// Storybook: Components/Stat → Pattern — insights row (?path=/story/components-stat--insights-row)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — step progress
|
|
2
2
|
// Storybook: Components/StepProgress → Pattern — step progress (?path=/story/components-stepprogress--step-progress-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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — default
|
|
2
2
|
// Storybook: Components/Switch → Pattern — default (?path=/story/components-switch--default)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — settings row
|
|
2
2
|
// Storybook: Components/Switch → Pattern — settings row (?path=/story/components-switch--settings-row)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — settings pages
|
|
2
2
|
// Storybook: Components/Tab → Pattern — settings pages (?path=/story/components-tab--settings-pages)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — approvals with sheet
|
|
2
|
+
// Storybook: Components/Table → Pattern — approvals with sheet (?path=/story/components-table--approvals-with-sheet)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
Sheet,
|
|
9
|
+
Table,
|
|
10
|
+
TableBody,
|
|
11
|
+
TableCaption,
|
|
12
|
+
TableCell,
|
|
13
|
+
TableHead,
|
|
14
|
+
TableHeader,
|
|
15
|
+
TableRow,
|
|
16
|
+
TextLink,
|
|
17
|
+
dialogFooterActionsClasses,
|
|
18
|
+
} from "@thewhatmatters/wmds";
|
|
19
|
+
|
|
20
|
+
interface ApprovalRow {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
kind: string;
|
|
24
|
+
waiting: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ApprovalsWithSheet({ rows }: { rows: ApprovalRow[] }) {
|
|
28
|
+
const [id, setId] = useState<string | null>(null);
|
|
29
|
+
const row = rows.find((item) => item.id === id);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<Table aria-label="Approvals waiting on you">
|
|
34
|
+
<TableCaption>{rows.length} waiting on you</TableCaption>
|
|
35
|
+
<TableHeader>
|
|
36
|
+
<TableRow>
|
|
37
|
+
<TableHead>Name</TableHead>
|
|
38
|
+
<TableHead>Kind</TableHead>
|
|
39
|
+
<TableHead align="end">Waiting</TableHead>
|
|
40
|
+
</TableRow>
|
|
41
|
+
</TableHeader>
|
|
42
|
+
<TableBody>
|
|
43
|
+
{rows.map((item) => (
|
|
44
|
+
<TableRow key={item.id} onClick={() => setId(item.id)}>
|
|
45
|
+
<TableCell>
|
|
46
|
+
<TextLink
|
|
47
|
+
variant="quiet"
|
|
48
|
+
href={`#${item.id}`}
|
|
49
|
+
onClick={(event) => event.preventDefault()}
|
|
50
|
+
>
|
|
51
|
+
{item.name}
|
|
52
|
+
</TextLink>
|
|
53
|
+
</TableCell>
|
|
54
|
+
<TableCell>{item.kind}</TableCell>
|
|
55
|
+
<TableCell align="end">{item.waiting}</TableCell>
|
|
56
|
+
</TableRow>
|
|
57
|
+
))}
|
|
58
|
+
</TableBody>
|
|
59
|
+
</Table>
|
|
60
|
+
<Sheet open={row != null} onOpenChange={(open) => setId(open ? id : null)}>
|
|
61
|
+
<Sheet.Content
|
|
62
|
+
side="end"
|
|
63
|
+
title={row?.name}
|
|
64
|
+
description={row?.kind}
|
|
65
|
+
footer={
|
|
66
|
+
<div className={dialogFooterActionsClasses}>
|
|
67
|
+
<Button size="sm" role="outline" onClick={() => setId(null)}>
|
|
68
|
+
Deny
|
|
69
|
+
</Button>
|
|
70
|
+
<Button size="sm" role="primary" onClick={() => setId(null)}>
|
|
71
|
+
Approve
|
|
72
|
+
</Button>
|
|
73
|
+
</div>
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<p>Waiting {row?.waiting}.</p>
|
|
77
|
+
</Sheet.Content>
|
|
78
|
+
</Sheet>
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — approvals queue
|
|
2
|
+
// Storybook: Components/Table → Pattern — approvals queue (?path=/story/components-table--approvals)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { useEffect, useState, type ReactNode } from "react";
|
|
8
|
+
import { Check, X } from "lucide-react";
|
|
9
|
+
import {
|
|
10
|
+
Badge,
|
|
11
|
+
Button,
|
|
12
|
+
Card,
|
|
13
|
+
Table,
|
|
14
|
+
TableBody,
|
|
15
|
+
TableCaption,
|
|
16
|
+
TableCell,
|
|
17
|
+
TableHead,
|
|
18
|
+
TableHeader,
|
|
19
|
+
TableRow,
|
|
20
|
+
} from "@thewhatmatters/wmds";
|
|
21
|
+
|
|
22
|
+
export type ApprovalDecision = "approved" | "denied";
|
|
23
|
+
|
|
24
|
+
export interface ApprovalItem {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
waiting: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ApprovalsQueueProps {
|
|
32
|
+
items: ApprovalItem[];
|
|
33
|
+
onDecision?: (item: ApprovalItem, decision: ApprovalDecision) => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ApprovalView = "table" | "card";
|
|
37
|
+
|
|
38
|
+
/** The row's buttons. `table` sits them side by side; `card` gives each half the row. */
|
|
39
|
+
function ActionGroup({
|
|
40
|
+
label,
|
|
41
|
+
view,
|
|
42
|
+
onEscape,
|
|
43
|
+
children,
|
|
44
|
+
}: {
|
|
45
|
+
label: string;
|
|
46
|
+
view: ApprovalView;
|
|
47
|
+
onEscape?: () => void;
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
}) {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
role="group"
|
|
53
|
+
aria-label={label}
|
|
54
|
+
className={view === "card" ? "grid h-11 grid-cols-2 items-center gap-2" : "flex h-11 items-center gap-2"}
|
|
55
|
+
onKeyDown={(event) => {
|
|
56
|
+
if (event.key === "Escape") onEscape?.();
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function ApprovalsQueue({ items, onDecision }: ApprovalsQueueProps) {
|
|
65
|
+
const [decisions, setDecisions] = useState<Record<string, ApprovalDecision>>({});
|
|
66
|
+
const [confirmingId, setConfirmingId] = useState<string | null>(null);
|
|
67
|
+
const [focusKey, setFocusKey] = useState<string | null>(null);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!focusKey) return;
|
|
71
|
+
const targets = document.querySelectorAll<HTMLElement>(`[data-focus="${focusKey}"]`);
|
|
72
|
+
Array.from(targets)
|
|
73
|
+
.find((target) => target.getClientRects().length > 0)
|
|
74
|
+
?.focus();
|
|
75
|
+
}, [focusKey]);
|
|
76
|
+
|
|
77
|
+
const waiting = items.filter((item) => !decisions[item.id]).length;
|
|
78
|
+
|
|
79
|
+
function decide(item: ApprovalItem, decision: ApprovalDecision) {
|
|
80
|
+
setDecisions((current) => ({ ...current, [item.id]: decision }));
|
|
81
|
+
setConfirmingId(null);
|
|
82
|
+
setFocusKey(`${item.id}-decision`);
|
|
83
|
+
onDecision?.(item, decision);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function cancel(item: ApprovalItem) {
|
|
87
|
+
setConfirmingId(null);
|
|
88
|
+
setFocusKey(`${item.id}-deny`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function renderDecision(item: ApprovalItem, view: ApprovalView) {
|
|
92
|
+
const decision = decisions[item.id];
|
|
93
|
+
const full = view === "card" ? "w-full" : undefined;
|
|
94
|
+
if (decision) {
|
|
95
|
+
return (
|
|
96
|
+
<div className="flex h-11 items-center">
|
|
97
|
+
<span
|
|
98
|
+
data-focus={`${item.id}-decision`}
|
|
99
|
+
tabIndex={-1}
|
|
100
|
+
className="inline-flex rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-body"
|
|
101
|
+
>
|
|
102
|
+
<Badge status={decision === "approved" ? "success" : "failed"} dot>
|
|
103
|
+
{decision === "approved" ? "Approved" : "Denied"}
|
|
104
|
+
</Badge>
|
|
105
|
+
</span>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
if (confirmingId === item.id) {
|
|
110
|
+
return (
|
|
111
|
+
<ActionGroup label={`Confirm denying ${item.name}`} view={view} onEscape={() => cancel(item)}>
|
|
112
|
+
<Button
|
|
113
|
+
data-focus={`${item.id}-confirm`}
|
|
114
|
+
role="primary"
|
|
115
|
+
icon={<X />}
|
|
116
|
+
className={full}
|
|
117
|
+
aria-label={`Confirm deny ${item.name}`}
|
|
118
|
+
onClick={() => decide(item, "denied")}
|
|
119
|
+
>
|
|
120
|
+
Confirm deny
|
|
121
|
+
</Button>
|
|
122
|
+
<Button role="ghost" className={full} aria-label={`Cancel deny ${item.name}`} onClick={() => cancel(item)}>
|
|
123
|
+
Cancel
|
|
124
|
+
</Button>
|
|
125
|
+
</ActionGroup>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return (
|
|
129
|
+
<ActionGroup label={`Actions for ${item.name}`} view={view}>
|
|
130
|
+
<Button
|
|
131
|
+
role="primary"
|
|
132
|
+
icon={<Check />}
|
|
133
|
+
className={full}
|
|
134
|
+
aria-label={`Approve ${item.name}`}
|
|
135
|
+
onClick={() => decide(item, "approved")}
|
|
136
|
+
>
|
|
137
|
+
Approve
|
|
138
|
+
</Button>
|
|
139
|
+
<Button
|
|
140
|
+
data-focus={`${item.id}-deny`}
|
|
141
|
+
role="outline"
|
|
142
|
+
icon={<X />}
|
|
143
|
+
className={full}
|
|
144
|
+
aria-label={`Deny ${item.name}`}
|
|
145
|
+
onClick={() => {
|
|
146
|
+
setConfirmingId(item.id);
|
|
147
|
+
setFocusKey(`${item.id}-confirm`);
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
Deny
|
|
151
|
+
</Button>
|
|
152
|
+
</ActionGroup>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<>
|
|
158
|
+
<div className="sm:hidden">
|
|
159
|
+
<p className="mb-3 text-muted">{waiting} waiting on you</p>
|
|
160
|
+
{items.length === 0 ? (
|
|
161
|
+
<Card variant="outlined" padding="md">
|
|
162
|
+
<p className="text-center">Nothing waiting on you</p>
|
|
163
|
+
</Card>
|
|
164
|
+
) : (
|
|
165
|
+
<ul aria-label="Approvals waiting on you" className="flex flex-col gap-3">
|
|
166
|
+
{items.map((item) => (
|
|
167
|
+
<li key={item.id}>
|
|
168
|
+
<Card variant="outlined" padding="md">
|
|
169
|
+
<div className="flex flex-col gap-3">
|
|
170
|
+
<div>
|
|
171
|
+
<p className="font-medium">{item.name}</p>
|
|
172
|
+
<p className="text-muted">
|
|
173
|
+
{item.kind} · Waiting {item.waiting}
|
|
174
|
+
</p>
|
|
175
|
+
</div>
|
|
176
|
+
{renderDecision(item, "card")}
|
|
177
|
+
</div>
|
|
178
|
+
</Card>
|
|
179
|
+
</li>
|
|
180
|
+
))}
|
|
181
|
+
</ul>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
<div className="hidden sm:block">
|
|
185
|
+
<Table aria-label="Approvals waiting on you">
|
|
186
|
+
<TableCaption>{waiting} waiting on you</TableCaption>
|
|
187
|
+
<colgroup>
|
|
188
|
+
<col className="w-40" />
|
|
189
|
+
<col className="w-44" />
|
|
190
|
+
<col className="w-32" />
|
|
191
|
+
<col className="w-72" />
|
|
192
|
+
</colgroup>
|
|
193
|
+
<TableHeader>
|
|
194
|
+
<TableRow>
|
|
195
|
+
<TableHead sticky>Name</TableHead>
|
|
196
|
+
<TableHead>Type</TableHead>
|
|
197
|
+
<TableHead>Waiting</TableHead>
|
|
198
|
+
<TableHead>Decision</TableHead>
|
|
199
|
+
</TableRow>
|
|
200
|
+
</TableHeader>
|
|
201
|
+
<TableBody>
|
|
202
|
+
{items.length === 0 ? (
|
|
203
|
+
<TableRow>
|
|
204
|
+
<TableCell colSpan={4} align="center">
|
|
205
|
+
Nothing waiting on you
|
|
206
|
+
</TableCell>
|
|
207
|
+
</TableRow>
|
|
208
|
+
) : (
|
|
209
|
+
items.map((item) => (
|
|
210
|
+
<TableRow key={item.id}>
|
|
211
|
+
<TableCell sticky>{item.name}</TableCell>
|
|
212
|
+
<TableCell>{item.kind}</TableCell>
|
|
213
|
+
<TableCell>{item.waiting}</TableCell>
|
|
214
|
+
<TableCell>{renderDecision(item, "table")}</TableCell>
|
|
215
|
+
</TableRow>
|
|
216
|
+
))
|
|
217
|
+
)}
|
|
218
|
+
</TableBody>
|
|
219
|
+
</Table>
|
|
220
|
+
</div>
|
|
221
|
+
</>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — basic table
|
|
2
|
+
// Storybook: Components/Table → Pattern — basic table (?path=/story/components-table--basic)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Badge,
|
|
7
|
+
Table,
|
|
8
|
+
TableBody,
|
|
9
|
+
TableCaption,
|
|
10
|
+
TableCell,
|
|
11
|
+
TableFooter,
|
|
12
|
+
TableHead,
|
|
13
|
+
TableHeader,
|
|
14
|
+
TableRow,
|
|
15
|
+
} from "@thewhatmatters/wmds";
|
|
16
|
+
|
|
17
|
+
export interface PostRow {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
author: string;
|
|
21
|
+
status: "success" | "warning" | "idle";
|
|
22
|
+
statusLabel: string;
|
|
23
|
+
words: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function RecentPosts({ posts, total }: { posts: PostRow[]; total: string }) {
|
|
27
|
+
return (
|
|
28
|
+
<Table aria-label="Recent posts">
|
|
29
|
+
<TableCaption>Posts from the last 30 days</TableCaption>
|
|
30
|
+
<TableHeader>
|
|
31
|
+
<TableRow>
|
|
32
|
+
<TableHead>Post</TableHead>
|
|
33
|
+
<TableHead>Author</TableHead>
|
|
34
|
+
<TableHead>Status</TableHead>
|
|
35
|
+
<TableHead align="end">Words</TableHead>
|
|
36
|
+
</TableRow>
|
|
37
|
+
</TableHeader>
|
|
38
|
+
<TableBody>
|
|
39
|
+
{posts.map((post) => (
|
|
40
|
+
<TableRow key={post.id}>
|
|
41
|
+
<TableCell>{post.title}</TableCell>
|
|
42
|
+
<TableCell>{post.author}</TableCell>
|
|
43
|
+
<TableCell>
|
|
44
|
+
<Badge status={post.status} dot={post.status !== "idle"}>
|
|
45
|
+
{post.statusLabel}
|
|
46
|
+
</Badge>
|
|
47
|
+
</TableCell>
|
|
48
|
+
<TableCell align="end">{post.words}</TableCell>
|
|
49
|
+
</TableRow>
|
|
50
|
+
))}
|
|
51
|
+
</TableBody>
|
|
52
|
+
<TableFooter>
|
|
53
|
+
<TableRow>
|
|
54
|
+
<TableCell colSpan={3}>Total</TableCell>
|
|
55
|
+
<TableCell align="end">{total}</TableCell>
|
|
56
|
+
</TableRow>
|
|
57
|
+
</TableFooter>
|
|
58
|
+
</Table>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — action details
|
|
2
2
|
// Storybook: Components/TaskRows → Pattern — action details (?path=/story/components-taskrows--action-details)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — capsules
|
|
2
2
|
// Storybook: Components/TaskRows → Pattern — capsules (?path=/story/components-taskrows--capsules)
|
|
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.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.28 · Pattern — card + status rows
|
|
2
2
|
// Storybook: Components/TaskRows → Pattern — card + status rows (?path=/story/components-taskrows--card-with-status-rows)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|