@thewhatmatters/wmds 0.4.9 → 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 +253 -0
- package/README.md +1 -1
- 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/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/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/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/styles.css +1 -1
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +101 -0
- package/docs/components.md +16 -11
- 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 +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 +177 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.27 · Pattern — log viewer
|
|
2
|
+
// Storybook: Components/LogView → Pattern — log viewer (?path=/story/components-logview--log-viewer)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { LogView } from "@thewhatmatters/wmds";
|
|
7
|
+
|
|
8
|
+
const lines = [
|
|
9
|
+
"09:14:02 connected to etheris",
|
|
10
|
+
"09:14:08 walking /api/orders",
|
|
11
|
+
"09:14:21 12 findings",
|
|
12
|
+
"09:14:22 coverage 76%",
|
|
13
|
+
"09:16:14 delta +8 vs last scan",
|
|
14
|
+
"09:18:02 session closed",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export function LogViewer() {
|
|
18
|
+
const [follow, setFollow] = useState(true);
|
|
19
|
+
return <LogView label="Scan log" lines={lines} follow={follow} onFollowChange={setFollow} />;
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.27 · Pattern — action menu
|
|
2
2
|
// Storybook: Components/MoreMenu → Pattern — action menu (?path=/story/components-moremenu--action-menu)
|
|
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.27 · Pattern — Card header cluster
|
|
2
2
|
// Storybook: Components/MoreMenu → Pattern — Card header cluster (?path=/story/components-moremenu--in-card-header)
|
|
3
3
|
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
4
|
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// @thewhatmatters/wmds@0.4.27 · Pattern — app sidebar
|
|
2
|
+
// Storybook: Components/NavList → Pattern — app sidebar (?path=/story/components-navlist--app-sidebar)
|
|
3
|
+
// Show code — copy verbatim and keep this header; upgrades find pasted patterns by it.
|
|
4
|
+
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Home, ListFilter, Menu, Package, Plane, Rocket, SunMoon, Utensils } from "lucide-react";
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
ButtonIcon,
|
|
10
|
+
IconButton,
|
|
11
|
+
NavList,
|
|
12
|
+
PageHeader,
|
|
13
|
+
Search,
|
|
14
|
+
Sheet,
|
|
15
|
+
Status,
|
|
16
|
+
type NavListSectionDef,
|
|
17
|
+
} from "@thewhatmatters/wmds";
|
|
18
|
+
|
|
19
|
+
const sections: NavListSectionDef[] = [
|
|
20
|
+
{
|
|
21
|
+
label: "Pinned",
|
|
22
|
+
labelAlign: "section",
|
|
23
|
+
action: (
|
|
24
|
+
<IconButton role="ghost" size="xs" aria-label="Filter pinned" icon={<ListFilter strokeWidth={2} />} />
|
|
25
|
+
),
|
|
26
|
+
items: [
|
|
27
|
+
{ id: "melbourne", label: "Weekend in Melbourne", href: "/tasks/melbourne", icon: <Plane strokeWidth={1.75} /> },
|
|
28
|
+
{
|
|
29
|
+
id: "apartment",
|
|
30
|
+
label: "Find a new apartment",
|
|
31
|
+
href: "/tasks/apartment",
|
|
32
|
+
icon: <Home strokeWidth={1.75} />,
|
|
33
|
+
trailing: <Status variant="dot" tone="warning" label="Unread" />,
|
|
34
|
+
},
|
|
35
|
+
{ id: "dinner", label: "Plan team dinner", href: "/tasks/dinner", icon: <Utensils strokeWidth={1.75} /> },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "Recent",
|
|
40
|
+
labelAlign: "section",
|
|
41
|
+
items: [
|
|
42
|
+
{
|
|
43
|
+
id: "ikea",
|
|
44
|
+
label: "Track my IKEA order",
|
|
45
|
+
href: "/tasks/ikea",
|
|
46
|
+
icon: <Package strokeWidth={1.75} />,
|
|
47
|
+
trailing: <Status variant="dot" tone="warning" label="Unread" pulsing />,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
function SidebarBody({
|
|
54
|
+
activeId,
|
|
55
|
+
onSelect,
|
|
56
|
+
}: {
|
|
57
|
+
activeId: string;
|
|
58
|
+
onSelect: (id: string) => void;
|
|
59
|
+
}) {
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex h-full min-h-0 w-52 flex-col bg-body">
|
|
62
|
+
<div className="flex items-center gap-2 px-4 py-4">
|
|
63
|
+
<span className="inline-flex size-7 items-center justify-center rounded-lg bg-brand-tint text-brand-outline">
|
|
64
|
+
<ButtonIcon size="xs"><Rocket strokeWidth={2} /></ButtonIcon>
|
|
65
|
+
</span>
|
|
66
|
+
<span className="type-label text-fg">Orbit</span>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="px-3 pb-2">
|
|
69
|
+
<Search size="sm" actionLabel="Search" aria-label="Search tasks" placeholder="Search" />
|
|
70
|
+
</div>
|
|
71
|
+
<div className="min-h-0 flex-1 overflow-y-auto">
|
|
72
|
+
<NavList aria-label="Tasks" sections={sections} activeId={activeId} onSelect={onSelect} />
|
|
73
|
+
</div>
|
|
74
|
+
<div className="mt-auto px-2 py-2">
|
|
75
|
+
<Button role="ghost" size="sm" align="start" className="w-full" icon={<SunMoon strokeWidth={2} />}>
|
|
76
|
+
Appearance
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function AppSidebar() {
|
|
84
|
+
const [open, setOpen] = useState(false);
|
|
85
|
+
const [activeId, setActiveId] = useState("ikea");
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="flex h-full min-h-0 w-full flex-col bg-body lg:flex-row">
|
|
89
|
+
<div className="max-lg:hidden h-full lg:block">
|
|
90
|
+
<SidebarBody activeId={activeId} onSelect={setActiveId} />
|
|
91
|
+
</div>
|
|
92
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
93
|
+
<PageHeader
|
|
94
|
+
variant="app"
|
|
95
|
+
className="lg:hidden"
|
|
96
|
+
title="Overview"
|
|
97
|
+
start={
|
|
98
|
+
<IconButton
|
|
99
|
+
role="ghost"
|
|
100
|
+
size="sm"
|
|
101
|
+
aria-label="Open menu"
|
|
102
|
+
icon={<Menu strokeWidth={2} />}
|
|
103
|
+
onClick={() => setOpen(true)}
|
|
104
|
+
/>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
107
|
+
<div className="max-lg:hidden px-4 py-6 lg:block">
|
|
108
|
+
<PageHeader variant="page" title="Overview" />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
112
|
+
<Sheet.Content side="start" title="Menu">
|
|
113
|
+
<SidebarBody activeId={activeId} onSelect={setActiveId} />
|
|
114
|
+
</Sheet.Content>
|
|
115
|
+
</Sheet>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @thewhatmatters/wmds@0.4.
|
|
1
|
+
// @thewhatmatters/wmds@0.4.27 · Pattern — side nav (settings)
|
|
2
2
|
// Storybook: Components/NavList → Pattern — side nav (settings) (?path=/story/components-navlist--side-nav-settings)
|
|
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.27 · Pattern — app header
|
|
2
2
|
// Storybook: Components/PageHeader → Pattern — app header (?path=/story/components-pageheader--app-header-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.27 · Pattern — page header
|
|
2
2
|
// Storybook: Components/PageHeader → Pattern — page header (?path=/story/components-pageheader--page-section-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.27 · Pattern — toolbar header
|
|
2
2
|
// Storybook: Components/PageHeader → Pattern — toolbar header (?path=/story/components-pageheader--toolbar-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.27 · Pattern — end detail rail
|
|
2
2
|
// Storybook: Components/Panel → Pattern — end detail rail (?path=/story/components-panel--end-detail-rail)
|
|
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.27 · Pattern — pill group
|
|
2
2
|
// Storybook: Components/PillGroup → Pattern — pill group (?path=/story/components-pillgroup--pill-group-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.27 · Pattern — prompt bar
|
|
2
2
|
// Storybook: Components/PromptBar → Pattern — prompt bar (?path=/story/components-promptbar--pattern-prompt-bar)
|
|
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.27 · Pattern — article body
|
|
2
2
|
// Storybook: Components/Prose → Pattern — article body (?path=/story/components-prose--article-body)
|
|
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.27 · Pattern — vertical
|
|
2
2
|
// Storybook: Components/Radio/RadioGroup → Pattern — vertical (?path=/story/components-radio-radiogroup--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.27 · Pattern — project gallery
|
|
2
2
|
// Storybook: Components/ScrollHorizontal → Pattern — project gallery (?path=/story/components-scrollhorizontal--project-gallery-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.27 · Pattern — gallery intro
|
|
2
2
|
// Storybook: Components/ScrollHorizontal → Pattern — gallery intro (?path=/story/components-scrollhorizontal--with-intro)
|
|
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.27 · Pattern — column caption
|
|
2
2
|
// Storybook: Components/SectionCaption → Pattern — column caption (?path=/story/components-sectioncaption--column-caption)
|
|
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.27 · Pattern — caption with an action
|
|
2
2
|
// Storybook: Components/SectionCaption → Pattern — caption with an action (?path=/story/components-sectioncaption--with-action)
|
|
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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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.27 · 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
|
+
}
|