@miragon/mcp-toolkit-ui 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -5
- package/dist/app/adapt-data-widget.d.ts +1 -22
- package/dist/app/adapt-data-widget.d.ts.map +1 -1
- package/dist/app/adapt-data-widget.js +1 -35
- package/dist/app/adapt-data-widget.js.map +1 -1
- package/dist/app/builder/BuilderBanners.d.ts +7 -2
- package/dist/app/builder/BuilderBanners.d.ts.map +1 -1
- package/dist/app/builder/BuilderBanners.js +8 -3
- package/dist/app/builder/BuilderBanners.js.map +1 -1
- package/dist/app/builder/CanvasRow.d.ts +4 -2
- package/dist/app/builder/CanvasRow.d.ts.map +1 -1
- package/dist/app/builder/CanvasRow.js +29 -17
- package/dist/app/builder/CanvasRow.js.map +1 -1
- package/dist/app/builder/CatalogueSheet.d.ts.map +1 -1
- package/dist/app/builder/CatalogueSheet.js +14 -6
- package/dist/app/builder/CatalogueSheet.js.map +1 -1
- package/dist/app/builder/CellPropsSheet.d.ts +7 -3
- package/dist/app/builder/CellPropsSheet.d.ts.map +1 -1
- package/dist/app/builder/CellPropsSheet.js +10 -3
- package/dist/app/builder/CellPropsSheet.js.map +1 -1
- package/dist/app/builder/DiscardDialog.d.ts +18 -0
- package/dist/app/builder/DiscardDialog.d.ts.map +1 -0
- package/dist/app/builder/DiscardDialog.js +18 -0
- package/dist/app/builder/DiscardDialog.js.map +1 -0
- package/dist/app/builder/EmptyHint.d.ts +4 -0
- package/dist/app/builder/EmptyHint.d.ts.map +1 -1
- package/dist/app/builder/EmptyHint.js +6 -1
- package/dist/app/builder/EmptyHint.js.map +1 -1
- package/dist/app/builder/LayoutSurface.d.ts +33 -9
- package/dist/app/builder/LayoutSurface.d.ts.map +1 -1
- package/dist/app/builder/LayoutSurface.js +74 -23
- package/dist/app/builder/LayoutSurface.js.map +1 -1
- package/dist/app/builder/PipelineStrip.d.ts +5 -2
- package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
- package/dist/app/builder/PipelineStrip.js +33 -15
- package/dist/app/builder/PipelineStrip.js.map +1 -1
- package/dist/app/builder/SaveDialog.d.ts +9 -1
- package/dist/app/builder/SaveDialog.d.ts.map +1 -1
- package/dist/app/builder/SaveDialog.js +9 -3
- package/dist/app/builder/SaveDialog.js.map +1 -1
- package/dist/app/builder/Toolbar.d.ts +14 -4
- package/dist/app/builder/Toolbar.d.ts.map +1 -1
- package/dist/app/builder/Toolbar.js +24 -7
- package/dist/app/builder/Toolbar.js.map +1 -1
- package/dist/app/builder/Workspace.d.ts +23 -3
- package/dist/app/builder/Workspace.d.ts.map +1 -1
- package/dist/app/builder/Workspace.js +58 -8
- package/dist/app/builder/Workspace.js.map +1 -1
- package/dist/app/builder/builder-model.d.ts +146 -3
- package/dist/app/builder/builder-model.d.ts.map +1 -1
- package/dist/app/builder/builder-model.js +196 -5
- package/dist/app/builder/builder-model.js.map +1 -1
- package/dist/app/builder/labels.d.ts +13 -62
- package/dist/app/builder/labels.d.ts.map +1 -1
- package/dist/app/builder/labels.js +9 -58
- package/dist/app/builder/labels.js.map +1 -1
- package/dist/app/builder/reveal.d.ts +10 -0
- package/dist/app/builder/reveal.d.ts.map +1 -0
- package/dist/app/builder/reveal.js +10 -0
- package/dist/app/builder/reveal.js.map +1 -0
- package/dist/app/builder/status-chip.d.ts.map +1 -1
- package/dist/app/builder/status-chip.js +3 -2
- package/dist/app/builder/status-chip.js.map +1 -1
- package/dist/app/builder/use-builder-catalogue.d.ts +5 -1
- package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
- package/dist/app/builder/use-builder-catalogue.js +50 -17
- package/dist/app/builder/use-builder-catalogue.js.map +1 -1
- package/dist/app/builder/use-builder-session.d.ts +30 -0
- package/dist/app/builder/use-builder-session.d.ts.map +1 -0
- package/dist/app/builder/use-builder-session.js +58 -0
- package/dist/app/builder/use-builder-session.js.map +1 -0
- package/dist/app/builder/use-display-resolver.d.ts +17 -0
- package/dist/app/builder/use-display-resolver.d.ts.map +1 -0
- package/dist/app/builder/use-display-resolver.js +16 -0
- package/dist/app/builder/use-display-resolver.js.map +1 -0
- package/dist/app/builder/use-save-dashboard.d.ts +3 -1
- package/dist/app/builder/use-save-dashboard.d.ts.map +1 -1
- package/dist/app/builder/use-save-dashboard.js +3 -1
- package/dist/app/builder/use-save-dashboard.js.map +1 -1
- package/dist/app/index.d.ts +8 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +8 -2
- package/dist/app/index.js.map +1 -1
- package/dist/app/layout-builder.d.ts +18 -25
- package/dist/app/layout-builder.d.ts.map +1 -1
- package/dist/app/layout-builder.js +84 -78
- package/dist/app/layout-builder.js.map +1 -1
- package/dist/app/mcp-app-view-chrome.d.ts +103 -20
- package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
- package/dist/app/mcp-app-view-chrome.js +125 -40
- package/dist/app/mcp-app-view-chrome.js.map +1 -1
- package/dist/app/mcp-app-view-states.d.ts +23 -0
- package/dist/app/mcp-app-view-states.d.ts.map +1 -0
- package/dist/app/mcp-app-view-states.js +55 -0
- package/dist/app/mcp-app-view-states.js.map +1 -0
- package/dist/app/mcp-app-view.d.ts +72 -5
- package/dist/app/mcp-app-view.d.ts.map +1 -1
- package/dist/app/mcp-app-view.js +241 -141
- package/dist/app/mcp-app-view.js.map +1 -1
- package/dist/app/mcp-toolkit-app.d.ts +8 -2
- package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
- package/dist/app/mcp-toolkit-app.js +33 -4
- package/dist/app/mcp-toolkit-app.js.map +1 -1
- package/dist/app/mcp-use-host-bridge.d.ts +15 -6
- package/dist/app/mcp-use-host-bridge.d.ts.map +1 -1
- package/dist/app/mcp-use-host-bridge.js +51 -22
- package/dist/app/mcp-use-host-bridge.js.map +1 -1
- package/dist/app/model-context.d.ts +71 -0
- package/dist/app/model-context.d.ts.map +1 -0
- package/dist/app/model-context.js +101 -0
- package/dist/app/model-context.js.map +1 -0
- package/dist/app/use-build-mode-focus.d.ts +33 -0
- package/dist/app/use-build-mode-focus.d.ts.map +1 -0
- package/dist/app/use-build-mode-focus.js +59 -0
- package/dist/app/use-build-mode-focus.js.map +1 -0
- package/dist/app/use-view-actions.d.ts +31 -0
- package/dist/app/use-view-actions.d.ts.map +1 -0
- package/dist/app/use-view-actions.js +81 -0
- package/dist/app/use-view-actions.js.map +1 -0
- package/dist/app/use-view-lifecycle.d.ts +42 -0
- package/dist/app/use-view-lifecycle.d.ts.map +1 -0
- package/dist/app/use-view-lifecycle.js +81 -0
- package/dist/app/use-view-lifecycle.js.map +1 -0
- package/dist/app/view-lifecycle.d.ts +185 -0
- package/dist/app/view-lifecycle.d.ts.map +1 -0
- package/dist/app/view-lifecycle.js +207 -0
- package/dist/app/view-lifecycle.js.map +1 -0
- package/dist/app/widget-fixture.d.ts +10 -3
- package/dist/app/widget-fixture.d.ts.map +1 -1
- package/dist/app/widget-fixture.js +21 -8
- package/dist/app/widget-fixture.js.map +1 -1
- package/dist/app/widget-props-sheet.d.ts +6 -10
- package/dist/app/widget-props-sheet.d.ts.map +1 -1
- package/dist/app/widget-props-sheet.js +25 -20
- package/dist/app/widget-props-sheet.js.map +1 -1
- package/dist/app/widget-renderer.d.ts +41 -1
- package/dist/app/widget-renderer.d.ts.map +1 -1
- package/dist/app/widget-renderer.js +82 -31
- package/dist/app/widget-renderer.js.map +1 -1
- package/dist/components/DrillButton.d.ts +9 -6
- package/dist/components/DrillButton.d.ts.map +1 -1
- package/dist/components/DrillButton.js +9 -6
- package/dist/components/DrillButton.js.map +1 -1
- package/dist/components/EmptyState.d.ts +33 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState.js +19 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/ErrorState.d.ts +53 -0
- package/dist/components/ErrorState.d.ts.map +1 -0
- package/dist/components/ErrorState.js +77 -0
- package/dist/components/ErrorState.js.map +1 -0
- package/dist/components/FilterBar.d.ts +16 -5
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +13 -5
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/GroupCard.d.ts.map +1 -1
- package/dist/components/GroupCard.js +2 -1
- package/dist/components/GroupCard.js.map +1 -1
- package/dist/components/KpiGrid.d.ts +70 -18
- package/dist/components/KpiGrid.d.ts.map +1 -1
- package/dist/components/KpiGrid.js +112 -23
- package/dist/components/KpiGrid.js.map +1 -1
- package/dist/components/ListFooter.d.ts +32 -4
- package/dist/components/ListFooter.d.ts.map +1 -1
- package/dist/components/ListFooter.js +35 -6
- package/dist/components/ListFooter.js.map +1 -1
- package/dist/components/PagedListFooter.d.ts +57 -0
- package/dist/components/PagedListFooter.d.ts.map +1 -0
- package/dist/components/PagedListFooter.js +27 -0
- package/dist/components/PagedListFooter.js.map +1 -0
- package/dist/components/Pills.d.ts +36 -12
- package/dist/components/Pills.d.ts.map +1 -1
- package/dist/components/Pills.js +29 -8
- package/dist/components/Pills.js.map +1 -1
- package/dist/components/SectionHeading.d.ts +3 -1
- package/dist/components/SectionHeading.d.ts.map +1 -1
- package/dist/components/SectionHeading.js +6 -2
- package/dist/components/SectionHeading.js.map +1 -1
- package/dist/components/Toast.d.ts +43 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +106 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/WidgetHeader.d.ts +34 -10
- package/dist/components/WidgetHeader.d.ts.map +1 -1
- package/dist/components/WidgetHeader.js +11 -6
- package/dist/components/WidgetHeader.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/tool-result-recovery-model.d.ts +155 -0
- package/dist/hooks/tool-result-recovery-model.d.ts.map +1 -0
- package/dist/hooks/tool-result-recovery-model.js +273 -0
- package/dist/hooks/tool-result-recovery-model.js.map +1 -0
- package/dist/hooks/use-tool-query.d.ts +56 -14
- package/dist/hooks/use-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-tool-query.js +102 -25
- package/dist/hooks/use-tool-query.js.map +1 -1
- package/dist/hooks/use-tool-result-recovery.d.ts +61 -44
- package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
- package/dist/hooks/use-tool-result-recovery.js +62 -110
- package/dist/hooks/use-tool-result-recovery.js.map +1 -1
- package/dist/hooks/use-view-data.d.ts +55 -7
- package/dist/hooks/use-view-data.d.ts.map +1 -1
- package/dist/hooks/use-view-data.js +81 -11
- package/dist/hooks/use-view-data.js.map +1 -1
- package/dist/hooks/use-view-tool-query.d.ts +12 -7
- package/dist/hooks/use-view-tool-query.d.ts.map +1 -1
- package/dist/hooks/use-view-tool-query.js +15 -14
- package/dist/hooks/use-view-tool-query.js.map +1 -1
- package/dist/index.d.ts +27 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/focus-return.d.ts +61 -0
- package/dist/lib/focus-return.d.ts.map +1 -0
- package/dist/lib/focus-return.js +46 -0
- package/dist/lib/focus-return.js.map +1 -0
- package/dist/lib/focus-ring.d.ts +18 -0
- package/dist/lib/focus-ring.d.ts.map +1 -0
- package/dist/lib/focus-ring.js +18 -0
- package/dist/lib/focus-ring.js.map +1 -0
- package/dist/lib/icon-stroke.d.ts +12 -0
- package/dist/lib/icon-stroke.d.ts.map +1 -0
- package/dist/lib/icon-stroke.js +12 -0
- package/dist/lib/icon-stroke.js.map +1 -0
- package/dist/lib/parse-tool-result.d.ts +23 -1
- package/dist/lib/parse-tool-result.d.ts.map +1 -1
- package/dist/lib/parse-tool-result.js +38 -2
- package/dist/lib/parse-tool-result.js.map +1 -1
- package/dist/lib/toast-model.d.ts +86 -0
- package/dist/lib/toast-model.d.ts.map +1 -0
- package/dist/lib/toast-model.js +102 -0
- package/dist/lib/toast-model.js.map +1 -0
- package/dist/lib/tone-utils.d.ts +95 -9
- package/dist/lib/tone-utils.d.ts.map +1 -1
- package/dist/lib/tone-utils.js +100 -9
- package/dist/lib/tone-utils.js.map +1 -1
- package/dist/lib/tool-query.d.ts +107 -0
- package/dist/lib/tool-query.d.ts.map +1 -0
- package/dist/lib/tool-query.js +182 -0
- package/dist/lib/tool-query.js.map +1 -0
- package/dist/lib/tool-result-observer.d.ts +108 -0
- package/dist/lib/tool-result-observer.d.ts.map +1 -0
- package/dist/lib/tool-result-observer.js +158 -0
- package/dist/lib/tool-result-observer.js.map +1 -0
- package/dist/lib/typography.d.ts +37 -0
- package/dist/lib/typography.d.ts.map +1 -0
- package/dist/lib/typography.js +41 -0
- package/dist/lib/typography.js.map +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +11 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/locale/index.d.ts +3 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/locale-provider.d.ts +42 -1
- package/dist/locale/locale-provider.d.ts.map +1 -1
- package/dist/locale/locale-provider.js +44 -3
- package/dist/locale/locale-provider.js.map +1 -1
- package/dist/locale/message-types.d.ts +336 -0
- package/dist/locale/message-types.d.ts.map +1 -0
- package/dist/locale/message-types.js +7 -0
- package/dist/locale/message-types.js.map +1 -0
- package/dist/locale/messages-de.d.ts +9 -0
- package/dist/locale/messages-de.d.ts.map +1 -0
- package/dist/locale/messages-de.js +185 -0
- package/dist/locale/messages-de.js.map +1 -0
- package/dist/locale/messages-en.d.ts +8 -0
- package/dist/locale/messages-en.d.ts.map +1 -0
- package/dist/locale/messages-en.js +184 -0
- package/dist/locale/messages-en.js.map +1 -0
- package/dist/locale/toolkit-messages.d.ts +57 -0
- package/dist/locale/toolkit-messages.d.ts.map +1 -0
- package/dist/locale/toolkit-messages.js +103 -0
- package/dist/locale/toolkit-messages.js.map +1 -0
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/alert.d.ts.map +1 -1
- package/dist/primitives/alert.js +6 -2
- package/dist/primitives/alert.js.map +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.d.ts.map +1 -1
- package/dist/primitives/badge.js +19 -6
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.d.ts.map +1 -1
- package/dist/primitives/button.js +12 -8
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/card.js +4 -4
- package/dist/primitives/card.js.map +1 -1
- package/dist/primitives/dialog.d.ts +7 -3
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +22 -8
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +4 -1
- package/dist/primitives/input.js.map +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/scroll-area.js.map +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +6 -3
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/sheet.d.ts +3 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +17 -7
- package/dist/primitives/sheet.js.map +1 -1
- package/dist/primitives/skeleton.js +1 -1
- package/dist/primitives/skeleton.js.map +1 -1
- package/dist/primitives/switch.d.ts.map +1 -1
- package/dist/primitives/switch.js +2 -1
- package/dist/primitives/switch.js.map +1 -1
- package/dist/primitives/tabs.d.ts.map +1 -1
- package/dist/primitives/tabs.js +5 -3
- package/dist/primitives/tabs.js.map +1 -1
- package/dist/providers/query-provider.d.ts +32 -1
- package/dist/providers/query-provider.d.ts.map +1 -1
- package/dist/providers/query-provider.js +53 -4
- package/dist/providers/query-provider.js.map +1 -1
- package/dist/render-cases-primitives.js +1 -1
- package/dist/render-cases-primitives.js.map +1 -1
- package/dist/render-cases.d.ts.map +1 -1
- package/dist/render-cases.js +48 -6
- package/dist/render-cases.js.map +1 -1
- package/dist/render-effects.d.ts +42 -0
- package/dist/render-effects.d.ts.map +1 -0
- package/dist/render-effects.js +81 -0
- package/dist/render-effects.js.map +1 -0
- package/dist/render-scan.d.ts +25 -0
- package/dist/render-scan.d.ts.map +1 -0
- package/dist/render-scan.js +66 -0
- package/dist/render-scan.js.map +1 -0
- package/dist/theme/cd-tokens.d.ts +66 -0
- package/dist/theme/cd-tokens.d.ts.map +1 -0
- package/dist/theme/cd-tokens.js +64 -0
- package/dist/theme/cd-tokens.js.map +1 -0
- package/dist/theme/create-theme.d.ts +214 -39
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/create-theme.js +204 -13
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/fonts.d.ts +38 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +56 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/host-fonts.d.ts +39 -0
- package/dist/theme/host-fonts.d.ts.map +1 -0
- package/dist/theme/host-fonts.js +44 -0
- package/dist/theme/host-fonts.js.map +1 -0
- package/dist/theme/index.d.ts +8 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +5 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/portal-container.d.ts +16 -0
- package/dist/theme/portal-container.d.ts.map +1 -0
- package/dist/theme/portal-container.js +19 -0
- package/dist/theme/portal-container.js.map +1 -0
- package/dist/theme/presets.d.ts +24 -9
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/presets.js +44 -11
- package/dist/theme/presets.js.map +1 -1
- package/dist/theme/theme-provider.d.ts +27 -9
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +42 -20
- package/dist/theme/theme-provider.js.map +1 -1
- package/package.json +11 -5
- package/src/app/adapt-data-widget.tsx +2 -42
- package/src/app/builder/BuilderBanners.tsx +26 -13
- package/src/app/builder/CanvasRow.tsx +79 -32
- package/src/app/builder/CatalogueSheet.tsx +58 -35
- package/src/app/builder/CellPropsSheet.tsx +17 -2
- package/src/app/builder/DiscardDialog.tsx +59 -0
- package/src/app/builder/EmptyHint.tsx +16 -11
- package/src/app/builder/LayoutSurface.tsx +207 -67
- package/src/app/builder/PipelineStrip.tsx +265 -156
- package/src/app/builder/SaveDialog.tsx +25 -14
- package/src/app/builder/Toolbar.tsx +154 -57
- package/src/app/builder/Workspace.tsx +226 -56
- package/src/app/builder/builder-feedback.test.tsx +75 -0
- package/src/app/builder/builder-model.test.ts +5 -0
- package/src/app/builder/builder-model.ts +346 -6
- package/src/app/builder/builder-model.ux.test.ts +456 -0
- package/src/app/builder/builder-ux.test.tsx +844 -0
- package/src/app/builder/labels.ts +15 -121
- package/src/app/builder/reveal.ts +10 -0
- package/src/app/builder/status-chip.tsx +8 -4
- package/src/app/builder/use-builder-catalogue.ts +62 -19
- package/src/app/builder/use-builder-session.ts +68 -0
- package/src/app/builder/use-display-resolver.ts +24 -0
- package/src/app/builder/use-save-dashboard.ts +5 -0
- package/src/app/index.ts +20 -3
- package/src/app/layout-builder.tsx +193 -186
- package/src/app/mcp-app-view-chrome.test.tsx +487 -14
- package/src/app/mcp-app-view-chrome.tsx +328 -100
- package/src/app/mcp-app-view-states.tsx +140 -0
- package/src/app/mcp-app-view.effects.test.tsx +292 -0
- package/src/app/mcp-app-view.test.tsx +478 -0
- package/src/app/mcp-app-view.tsx +447 -190
- package/src/app/mcp-toolkit-app.test.tsx +40 -0
- package/src/app/mcp-toolkit-app.tsx +39 -8
- package/src/app/mcp-use-host-bridge.test.tsx +180 -0
- package/src/app/mcp-use-host-bridge.tsx +67 -24
- package/src/app/model-context.test.tsx +116 -0
- package/src/app/model-context.tsx +125 -0
- package/src/app/use-build-mode-focus.ts +62 -0
- package/src/app/use-view-actions.ts +89 -0
- package/src/app/use-view-lifecycle.ts +122 -0
- package/src/app/view-lifecycle.test.ts +443 -0
- package/src/app/view-lifecycle.ts +334 -0
- package/src/app/widget-fixture.effects.test.tsx +51 -0
- package/src/app/widget-fixture.render.test.tsx +81 -0
- package/src/app/widget-fixture.tsx +34 -11
- package/src/app/widget-props-sheet.tsx +67 -39
- package/src/app/widget-renderer.render.test.tsx +131 -0
- package/src/app/widget-renderer.tsx +136 -38
- package/src/components/DrillButton.tsx +24 -10
- package/src/components/EmptyState.tsx +83 -0
- package/src/components/ErrorState.tsx +204 -0
- package/src/components/FilterBar.test.tsx +82 -0
- package/src/components/FilterBar.tsx +56 -27
- package/src/components/GroupCard.tsx +3 -2
- package/src/components/KpiGrid.test.tsx +279 -0
- package/src/components/KpiGrid.tsx +329 -91
- package/src/components/ListFooter.test.tsx +116 -0
- package/src/components/ListFooter.tsx +110 -12
- package/src/components/PagedListFooter.test.tsx +140 -0
- package/src/components/PagedListFooter.tsx +107 -0
- package/src/components/Pills.test.tsx +77 -0
- package/src/components/Pills.tsx +78 -16
- package/src/components/SectionHeading.tsx +9 -3
- package/src/components/Toast.tsx +206 -0
- package/src/components/WidgetHeader.test.tsx +78 -0
- package/src/components/WidgetHeader.tsx +63 -16
- package/src/components/feedback-states.test.tsx +314 -0
- package/src/components/tone-figures.test.tsx +58 -0
- package/src/fonts.css +19 -0
- package/src/globals.css +9 -165
- package/src/hooks/index.ts +6 -3
- package/src/hooks/tool-result-recovery-model.test.ts +744 -0
- package/src/hooks/tool-result-recovery-model.ts +418 -0
- package/src/hooks/use-tool-query.effects.test.tsx +205 -0
- package/src/hooks/use-tool-query.ts +156 -33
- package/src/hooks/use-tool-result-recovery.effects.test.tsx +141 -0
- package/src/hooks/use-tool-result-recovery.test.ts +28 -5
- package/src/hooks/use-tool-result-recovery.ts +101 -131
- package/src/hooks/use-view-data.test.tsx +169 -0
- package/src/hooks/use-view-data.ts +131 -10
- package/src/hooks/use-view-tool-query.ts +25 -19
- package/src/i18n-coverage.test.tsx +425 -0
- package/src/index.ts +102 -13
- package/src/lib/focus-return.test.ts +288 -0
- package/src/lib/focus-return.ts +96 -0
- package/src/lib/focus-ring.ts +20 -0
- package/src/lib/icon-stroke.test.ts +59 -0
- package/src/lib/icon-stroke.ts +13 -0
- package/src/lib/parse-tool-result.test.ts +46 -1
- package/src/lib/parse-tool-result.ts +40 -2
- package/src/lib/toast-model.test.ts +233 -0
- package/src/lib/toast-model.ts +165 -0
- package/src/lib/tone-utils.test.ts +125 -16
- package/src/lib/tone-utils.ts +144 -15
- package/src/lib/tool-query.test.ts +569 -0
- package/src/lib/tool-query.ts +253 -0
- package/src/lib/tool-result-observer.test.ts +296 -0
- package/src/lib/tool-result-observer.ts +211 -0
- package/src/lib/typography.test.ts +45 -0
- package/src/lib/typography.ts +47 -0
- package/src/lib/utils.ts +12 -1
- package/src/locale/index.ts +14 -1
- package/src/locale/locale-provider.test.tsx +87 -0
- package/src/locale/locale-provider.tsx +90 -3
- package/src/locale/message-types.ts +337 -0
- package/src/locale/messages-de.ts +198 -0
- package/src/locale/messages-en.ts +196 -0
- package/src/locale/toolkit-messages.test.ts +349 -0
- package/src/locale/toolkit-messages.ts +143 -0
- package/src/no-hardcoded-copy.test.ts +432 -0
- package/src/primitives/alert.tsx +7 -2
- package/src/primitives/badge.tsx +19 -7
- package/src/primitives/button.tsx +13 -8
- package/src/primitives/card.tsx +4 -4
- package/src/primitives/dialog.tsx +42 -8
- package/src/primitives/input.tsx +5 -3
- package/src/primitives/scroll-area.tsx +1 -1
- package/src/primitives/select.tsx +7 -4
- package/src/primitives/sheet.tsx +33 -6
- package/src/primitives/skeleton.tsx +1 -1
- package/src/primitives/switch.tsx +4 -2
- package/src/primitives/tabs.tsx +9 -6
- package/src/providers/query-provider.test.tsx +154 -0
- package/src/providers/query-provider.tsx +66 -5
- package/src/render-cases-primitives.tsx +1 -1
- package/src/render-cases.tsx +82 -6
- package/src/render-effects.tsx +96 -0
- package/src/render-scan.ts +75 -0
- package/src/theme/cd-tokens.generated.css +48 -0
- package/src/theme/cd-tokens.test.ts +109 -0
- package/src/theme/cd-tokens.ts +67 -0
- package/src/theme/create-theme.test.ts +253 -5
- package/src/theme/create-theme.ts +341 -41
- package/src/theme/fonts.test.ts +85 -0
- package/src/theme/fonts.ts +72 -0
- package/src/theme/host-fonts.test.ts +135 -0
- package/src/theme/host-fonts.ts +52 -0
- package/src/theme/index.ts +15 -1
- package/src/theme/portal-container.ts +20 -0
- package/src/theme/presets.ts +44 -11
- package/src/theme/theme-css.test.ts +619 -0
- package/src/theme/theme-provider.test.tsx +82 -0
- package/src/theme/theme-provider.tsx +60 -24
- package/src/theme.css +344 -0
- package/ui-catalog.json +783 -49
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListFooterMessages } from "../locale/message-types.js";
|
|
1
2
|
export interface ListFooterProps {
|
|
2
3
|
/** How many rows are currently rendered. */
|
|
3
4
|
shown: number;
|
|
@@ -9,14 +10,41 @@ export interface ListFooterProps {
|
|
|
9
10
|
loadingMore?: boolean;
|
|
10
11
|
/** Called when the user asks for the next page. */
|
|
11
12
|
onLoadMore: () => void;
|
|
12
|
-
/** Plural noun for the count, e.g. `"instances"`. Default
|
|
13
|
+
/** Plural noun for the count, e.g. `"instances"`. Default: the locale's word for rows. */
|
|
13
14
|
noun?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A new first page is in flight while these rows stay on screen (a search,
|
|
17
|
+
* a filter, a refetch): the status line adds a visible "Updating…".
|
|
18
|
+
*/
|
|
19
|
+
refreshing?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The rows on screen are the PREVIOUS result (a changed search or filter is
|
|
22
|
+
* in flight or failed): the count and "Load more" hide, so the old count
|
|
23
|
+
* never reads as the new search's answer.
|
|
24
|
+
*/
|
|
25
|
+
stale?: boolean;
|
|
26
|
+
/** Override strings of the active catalog's `listFooter` section. */
|
|
27
|
+
labels?: Partial<ListFooterMessages>;
|
|
28
|
+
/**
|
|
29
|
+
* Make the count line a polite live region (`role="status"`). Default
|
|
30
|
+
* `true`. Set `false` only where the caller already announces the count in
|
|
31
|
+
* a live region of its own, so a screen reader hears it once.
|
|
32
|
+
*/
|
|
33
|
+
announce?: boolean;
|
|
34
|
+
className?: string;
|
|
14
35
|
}
|
|
15
36
|
/**
|
|
16
37
|
* Footer for a paginated list: an honest "Showing X of Y" total plus an
|
|
17
38
|
* explicit "Load more" control. Deliberately not infinite scroll — the user
|
|
18
|
-
* gets the total, a reachable footer, and control over fetching.
|
|
19
|
-
*
|
|
39
|
+
* gets the total, a reachable footer, and control over fetching. The count
|
|
40
|
+
* is a polite live region (`role="status"`), so a keyboard or screen-reader
|
|
41
|
+
* user hears the new total after "Load more" or a filter change; while a
|
|
42
|
+
* first page is in flight it also says "Updating…". With nothing to count and
|
|
43
|
+
* nothing in flight it shows nothing, but the live region stays mounted
|
|
44
|
+
* (visually hidden) and says "No entries": a search that finds nothing is
|
|
45
|
+
* announced too, and the region is never re-created with its news already in
|
|
46
|
+
* it (a screen reader stays silent then). Text and number format follow the
|
|
47
|
+
* active locale (`LocaleProvider`, else the host's inside `McpAppView`).
|
|
20
48
|
*/
|
|
21
|
-
export declare function ListFooter({ shown, total, hasMore, loadingMore, onLoadMore, noun, }: ListFooterProps): import("react").JSX.Element | null;
|
|
49
|
+
export declare function ListFooter({ shown, total, hasMore, loadingMore, onLoadMore, noun, refreshing, stale, labels, announce, className, }: ListFooterProps): import("react").JSX.Element | null;
|
|
22
50
|
//# sourceMappingURL=ListFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListFooter.d.ts","sourceRoot":"","sources":["../../src/components/ListFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListFooter.d.ts","sourceRoot":"","sources":["../../src/components/ListFooter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAGpE,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mDAAmD;IACnD,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACpC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAmB,EACnB,UAAU,EACV,IAAI,EACJ,UAAkB,EAClB,KAAa,EACb,MAAM,EACN,QAAe,EACf,SAAS,GACV,EAAE,eAAe,sCAwCjB"}
|
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { FOCUS_RING } from "../lib/focus-ring.js";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { useToolkitLocale, useToolkitMessages } from "../locale/locale-provider.js";
|
|
5
|
+
import { formatCount } from "../locale/toolkit-messages.js";
|
|
2
6
|
/**
|
|
3
7
|
* Footer for a paginated list: an honest "Showing X of Y" total plus an
|
|
4
8
|
* explicit "Load more" control. Deliberately not infinite scroll — the user
|
|
5
|
-
* gets the total, a reachable footer, and control over fetching.
|
|
6
|
-
*
|
|
9
|
+
* gets the total, a reachable footer, and control over fetching. The count
|
|
10
|
+
* is a polite live region (`role="status"`), so a keyboard or screen-reader
|
|
11
|
+
* user hears the new total after "Load more" or a filter change; while a
|
|
12
|
+
* first page is in flight it also says "Updating…". With nothing to count and
|
|
13
|
+
* nothing in flight it shows nothing, but the live region stays mounted
|
|
14
|
+
* (visually hidden) and says "No entries": a search that finds nothing is
|
|
15
|
+
* announced too, and the region is never re-created with its news already in
|
|
16
|
+
* it (a screen reader stays silent then). Text and number format follow the
|
|
17
|
+
* active locale (`LocaleProvider`, else the host's inside `McpAppView`).
|
|
7
18
|
*/
|
|
8
|
-
export function ListFooter({ shown, total, hasMore, loadingMore = false, onLoadMore, noun =
|
|
9
|
-
|
|
19
|
+
export function ListFooter({ shown, total, hasMore, loadingMore = false, onLoadMore, noun, refreshing = false, stale = false, labels, announce = true, className, }) {
|
|
20
|
+
const listFooter = { ...useToolkitMessages().listFooter, ...labels };
|
|
21
|
+
const counted = total > 0 && !stale;
|
|
22
|
+
const visible = counted || refreshing;
|
|
23
|
+
// Without a live region of its own there is nothing to keep mounted.
|
|
24
|
+
if (!visible && !announce)
|
|
10
25
|
return null;
|
|
11
|
-
return (_jsxs("div", {
|
|
26
|
+
return (_jsxs("div", { "data-slot": "list-footer",
|
|
27
|
+
// The same element tree in both states, so React keeps the live region.
|
|
28
|
+
className: visible ? cn(FOOTER_CLASS, className) : "sr-only", children: [_jsx("p", { role: announce ? "status" : undefined, "data-slot": "list-footer-status", className: "flex flex-wrap items-center gap-x-2", children: _jsx(StatusLine, { messages: listFooter, shown: shown, total: total, noun: noun, counted: counted, refreshing: refreshing,
|
|
29
|
+
// Zero rows, not a stale previous result (its failure the caller reports).
|
|
30
|
+
empty: !visible && !stale }) }), counted && hasMore && (_jsx("button", { type: "button", onClick: onLoadMore, disabled: loadingMore, className: `border-border text-foreground hover:border-focus hover:bg-accent hover:text-accent-foreground inline-flex items-center gap-1 rounded-md border px-3 py-1.5 font-medium transition-colors disabled:opacity-50 ${FOCUS_RING}`, children: loadingMore ? listFooter.loadingMore : listFooter.loadMore }))] }));
|
|
31
|
+
}
|
|
32
|
+
const FOOTER_CLASS = "text-small text-muted-foreground flex items-center justify-between gap-3 px-1 py-2";
|
|
33
|
+
/** What the live region says: the count, "Updating…", or "No entries" at zero rows. */
|
|
34
|
+
function StatusLine({ messages, shown, total, noun, counted, refreshing, empty, }) {
|
|
35
|
+
const locale = useToolkitLocale();
|
|
36
|
+
return (_jsxs(_Fragment, { children: [empty && _jsx("span", { children: messages.noResults }), counted && (_jsx("span", { children: messages.showing({
|
|
37
|
+
shown: formatCount(shown, locale),
|
|
38
|
+
total: formatCount(total, locale),
|
|
39
|
+
noun: noun ?? messages.defaultNoun,
|
|
40
|
+
}) })), refreshing && _jsx("span", { "data-slot": "list-footer-updating", children: messages.updating })] }));
|
|
12
41
|
}
|
|
13
42
|
//# sourceMappingURL=ListFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListFooter.js","sourceRoot":"","sources":["../../src/components/ListFooter.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ListFooter.js","sourceRoot":"","sources":["../../src/components/ListFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAqC3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,UAAU,EACV,IAAI,EACJ,UAAU,GAAG,KAAK,EAClB,KAAK,GAAG,KAAK,EACb,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,SAAS,GACO;IAChB,MAAM,UAAU,GAAG,EAAE,GAAG,kBAAkB,EAAE,CAAC,UAAU,EAAE,GAAG,MAAM,EAAE,CAAA;IACpE,MAAM,OAAO,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,CAAA;IACnC,MAAM,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,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;oBACjC,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;oBACjC,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,WAAW;iBACnC,CAAC,GACG,CACR,EACA,UAAU,IAAI,4BAAgB,sBAAsB,YAAE,QAAQ,CAAC,QAAQ,GAAQ,IAC/E,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ListFooterMessages } from "../locale/message-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* What {@link PagedListFooter} reads from a paged list — structural, so a
|
|
4
|
+
* paged-query hook's result (`items`, `total`, `loadMore`, …) passes as is.
|
|
5
|
+
*/
|
|
6
|
+
export interface PagedListState {
|
|
7
|
+
/** The rows on screen (all loaded pages); its length is the "shown" count. */
|
|
8
|
+
items: readonly unknown[];
|
|
9
|
+
/** The server's total for the rows on screen. */
|
|
10
|
+
total: number;
|
|
11
|
+
/** Whether another page exists. */
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
/** Fetch the next page (also the retry of a failed load-more). */
|
|
14
|
+
loadMore: () => void;
|
|
15
|
+
/** A next page is in flight. */
|
|
16
|
+
loadingMore?: boolean;
|
|
17
|
+
/** A first page is in flight while rows are on screen (a search, a filter, a refetch). */
|
|
18
|
+
refreshing?: boolean;
|
|
19
|
+
/** The rows on screen are the previous result: a changed search or filter is in flight or failed. */
|
|
20
|
+
stale?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The first page that is on screen, if any. A first-page {@link error} only
|
|
23
|
+
* belongs in the footer while one is shown; without rows on screen it is
|
|
24
|
+
* the load error the caller's loading guard renders.
|
|
25
|
+
*/
|
|
26
|
+
firstPage?: unknown;
|
|
27
|
+
/** The first-page failure (see {@link firstPage}). */
|
|
28
|
+
error?: Error | null;
|
|
29
|
+
/** Re-run the first page — the retry of {@link error}. */
|
|
30
|
+
retry?: () => void;
|
|
31
|
+
/** The last load-more failure; {@link loadMore} retries it, the rows above stay current. */
|
|
32
|
+
loadMoreError?: Error | null;
|
|
33
|
+
}
|
|
34
|
+
export interface PagedListFooterProps {
|
|
35
|
+
/** The paged list's state. */
|
|
36
|
+
paged: PagedListState;
|
|
37
|
+
/** Plural noun for "Showing X of Y {noun}". Default: the locale's word for rows. */
|
|
38
|
+
noun?: string;
|
|
39
|
+
/** Override strings of the active catalog's `listFooter` section. */
|
|
40
|
+
labels?: Partial<ListFooterMessages>;
|
|
41
|
+
/** Retry button label of both error lines. Default: the locale's "Try again". */
|
|
42
|
+
retryLabel?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The tail of a paged list: its failures and the honest {@link ListFooter}.
|
|
46
|
+
* Two failures stay apart because their retries differ — a failed first page
|
|
47
|
+
* over the rows still on screen ("You're seeing the previous result", its
|
|
48
|
+
* retry re-runs page 0) and a failed load-more ("The entries above are
|
|
49
|
+
* current", its retry fetches the next offset). Each is an inline
|
|
50
|
+
* `ErrorState` (role="alert") with the raw reason under "Details". The
|
|
51
|
+
* footer's count line is a polite live region that says "Updating…" while a
|
|
52
|
+
* first page is in flight, hides the count while the rows are stale, and
|
|
53
|
+
* stays mounted at zero rows ("No entries", visually hidden), so a search
|
|
54
|
+
* that finds nothing is announced.
|
|
55
|
+
*/
|
|
56
|
+
export declare function PagedListFooter({ paged, noun, labels, retryLabel }: PagedListFooterProps): import("react").JSX.Element;
|
|
57
|
+
//# sourceMappingURL=PagedListFooter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PagedListFooter.d.ts","sourceRoot":"","sources":["../../src/components/PagedListFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAIpE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;IACzB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qGAAqG;IACrG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;IACpB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,KAAK,EAAE,cAAc,CAAA;IACrB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACpC,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,oBAAoB,+BAwCxF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useToolkitMessages } from "../locale/locale-provider.js";
|
|
3
|
+
import { ErrorState } from "./ErrorState.js";
|
|
4
|
+
import { ListFooter } from "./ListFooter.js";
|
|
5
|
+
/** The raw reason of a failure, for the "Details" disclosure (never the sentence). */
|
|
6
|
+
function rawReason(error) {
|
|
7
|
+
return error.message || error.name;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The tail of a paged list: its failures and the honest {@link ListFooter}.
|
|
11
|
+
* Two failures stay apart because their retries differ — a failed first page
|
|
12
|
+
* over the rows still on screen ("You're seeing the previous result", its
|
|
13
|
+
* retry re-runs page 0) and a failed load-more ("The entries above are
|
|
14
|
+
* current", its retry fetches the next offset). Each is an inline
|
|
15
|
+
* `ErrorState` (role="alert") with the raw reason under "Details". The
|
|
16
|
+
* footer's count line is a polite live region that says "Updating…" while a
|
|
17
|
+
* first page is in flight, hides the count while the rows are stale, and
|
|
18
|
+
* stays mounted at zero rows ("No entries", visually hidden), so a search
|
|
19
|
+
* that finds nothing is announced.
|
|
20
|
+
*/
|
|
21
|
+
export function PagedListFooter({ paged, noun, labels, retryLabel }) {
|
|
22
|
+
const catalog = useToolkitMessages().listFooter;
|
|
23
|
+
const L = { ...catalog, ...labels };
|
|
24
|
+
const refreshError = paged.firstPage != null ? (paged.error ?? null) : null;
|
|
25
|
+
return (_jsxs("div", { "data-slot": "paged-list-footer", className: "flex flex-col gap-2", children: [refreshError && (_jsx(ErrorState, { variant: "inline", tone: "warning", title: L.refreshFailed, description: L.refreshFailedHint, details: rawReason(refreshError), onRetry: paged.retry, retryLabel: retryLabel })), paged.loadMoreError && (_jsx(ErrorState, { variant: "inline", title: L.loadMoreFailed, description: L.loadMoreFailedHint, details: rawReason(paged.loadMoreError), onRetry: paged.loadMore, retryLabel: retryLabel })), _jsx(ListFooter, { shown: paged.items.length, total: paged.total, hasMore: paged.hasMore, loadingMore: paged.loadingMore, onLoadMore: paged.loadMore, noun: noun, refreshing: paged.refreshing, stale: paged.stale, labels: labels })] }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=PagedListFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PagedListFooter.js","sourceRoot":"","sources":["../../src/components/PagedListFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,EAAE,UAAU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AK,CAAC,MAAM,EACzB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,UAAU,EAAE,KAAK,CAAC,QAAQ,EAC1B,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,MAAM,GACd,IACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,25 +1,49 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { type
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type ToneName } from "../lib/tone-utils.js";
|
|
3
3
|
export interface LivePillProps {
|
|
4
|
-
/** Status tone driving the dot
|
|
5
|
-
tone?:
|
|
6
|
-
/** Pill label. Defaults to
|
|
4
|
+
/** Status tone driving the dot, tint and border. Default `"info"`. */
|
|
5
|
+
tone?: ToneName;
|
|
6
|
+
/** Pill label. Defaults to the locale's "Live". */
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* Small tinted pill with a pulsing dot. Use in a widget header to signal that
|
|
11
|
-
* the data is live/real-time. Tone-based,
|
|
12
|
+
* the data is live/real-time. Tone-based (tint, border and dot in the tone,
|
|
13
|
+
* text in the foreground), so it inherits the active theme. The pulse stops
|
|
14
|
+
* under `prefers-reduced-motion`.
|
|
12
15
|
*/
|
|
13
|
-
export declare function LivePill({ tone, children }: LivePillProps): import("react").JSX.Element;
|
|
16
|
+
export declare function LivePill({ tone, children, className }: LivePillProps): import("react").JSX.Element;
|
|
17
|
+
/** The words a {@link StatusBadge} must carry: text, a number or an element — never nothing. */
|
|
18
|
+
export type StatusBadgeText = string | number | ReactElement | (string | number | ReactElement)[];
|
|
19
|
+
export interface StatusBadgeProps {
|
|
20
|
+
/** The state, in words ("Suspended", "3 open incidents"). Required: colour is never the only signal. */
|
|
21
|
+
children: StatusBadgeText;
|
|
22
|
+
/** The state's tone: tint, edge and dot. */
|
|
23
|
+
tone: ToneName;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A state in words, marked in its tone: tint, edge and a static dot next to
|
|
28
|
+
* foreground text (CI §3.3: the colour marks the state, the words say it).
|
|
29
|
+
* For a detail-page header (`WidgetHeader`'s `badge`) or a table cell. The
|
|
30
|
+
* text is required — a badge without words would make colour the only
|
|
31
|
+
* signal. The pulsing dot is {@link LivePill}'s live-data semantic.
|
|
32
|
+
*/
|
|
33
|
+
export declare function StatusBadge({ children, tone, className }: StatusBadgeProps): import("react").JSX.Element;
|
|
14
34
|
export interface CountPillProps {
|
|
15
|
-
/** Status tone driving the tint. Default `"neutral"`. */
|
|
16
|
-
tone?:
|
|
35
|
+
/** Status tone driving the tint and border. Default `"neutral"`. */
|
|
36
|
+
tone?: ToneName;
|
|
17
37
|
/** The count/value to display (tabular numbers). */
|
|
18
38
|
children: ReactNode;
|
|
39
|
+
className?: string;
|
|
19
40
|
}
|
|
20
41
|
/**
|
|
21
|
-
* Compact count badge — tabular numbers on a tinted background
|
|
22
|
-
* right-aligned indicator on a list/group row (e.g. a
|
|
42
|
+
* Compact count badge — tabular numbers on a tinted background with a border
|
|
43
|
+
* in the tone. Use as the right-aligned indicator on a list/group row (e.g. a
|
|
44
|
+
* per-group item count). The number stays in the foreground in every tone
|
|
45
|
+
* (no coloured digits): the tint and the border carry the tone. A count
|
|
46
|
+
* without a state stays `neutral`.
|
|
23
47
|
*/
|
|
24
|
-
export declare function CountPill({ tone, children }: CountPillProps): import("react").JSX.Element;
|
|
48
|
+
export declare function CountPill({ tone, children, className }: CountPillProps): import("react").JSX.Element;
|
|
25
49
|
//# sourceMappingURL=Pills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pills.d.ts","sourceRoot":"","sources":["../../src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Ac,+BAclF"}
|
package/dist/components/Pills.js
CHANGED
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useToolkitMessages } from "../locale/locale-provider.js";
|
|
3
|
+
import { resolveTone, TONE_BORDER, TONE_DOT, TONE_SOFT } from "../lib/tone-utils.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
3
5
|
/**
|
|
4
6
|
* Small tinted pill with a pulsing dot. Use in a widget header to signal that
|
|
5
|
-
* the data is live/real-time. Tone-based,
|
|
7
|
+
* the data is live/real-time. Tone-based (tint, border and dot in the tone,
|
|
8
|
+
* text in the foreground), so it inherits the active theme. The pulse stops
|
|
9
|
+
* under `prefers-reduced-motion`.
|
|
6
10
|
*/
|
|
7
|
-
export function LivePill({ tone = "info", children }) {
|
|
8
|
-
|
|
11
|
+
export function LivePill({ tone = "info", children, className }) {
|
|
12
|
+
const messages = useToolkitMessages();
|
|
13
|
+
const t = resolveTone(tone, "info");
|
|
14
|
+
return (_jsxs("span", { className: cn("text-small inline-flex items-center gap-1.5 rounded-sm border px-2 py-0.5 font-semibold", TONE_SOFT[t], TONE_BORDER[t], className), children: [_jsx("span", { "aria-hidden": "true", className: cn("size-1.5 rounded-full motion-safe:animate-pulse", TONE_DOT[t]) }), children ?? messages.pills.live] }));
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* A state in words, marked in its tone: tint, edge and a static dot next to
|
|
18
|
+
* foreground text (CI §3.3: the colour marks the state, the words say it).
|
|
19
|
+
* For a detail-page header (`WidgetHeader`'s `badge`) or a table cell. The
|
|
20
|
+
* text is required — a badge without words would make colour the only
|
|
21
|
+
* signal. The pulsing dot is {@link LivePill}'s live-data semantic.
|
|
13
22
|
*/
|
|
14
|
-
export function
|
|
15
|
-
|
|
23
|
+
export function StatusBadge({ children, tone, className }) {
|
|
24
|
+
const t = resolveTone(tone);
|
|
25
|
+
return (_jsxs("span", { "data-slot": "status-badge", "data-tone": t, className: cn("text-small inline-flex w-fit items-center gap-1.5 rounded-sm border px-2.5 py-0.5 font-semibold", TONE_SOFT[t], TONE_BORDER[t], className), children: [_jsx("span", { "aria-hidden": "true", className: cn("size-1.5 shrink-0 rounded-full", TONE_DOT[t]) }), children] }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Compact count badge — tabular numbers on a tinted background with a border
|
|
29
|
+
* in the tone. Use as the right-aligned indicator on a list/group row (e.g. a
|
|
30
|
+
* per-group item count). The number stays in the foreground in every tone
|
|
31
|
+
* (no coloured digits): the tint and the border carry the tone. A count
|
|
32
|
+
* without a state stays `neutral`.
|
|
33
|
+
*/
|
|
34
|
+
export function CountPill({ tone = "neutral", children, className }) {
|
|
35
|
+
const t = resolveTone(tone);
|
|
36
|
+
return (_jsx("span", { className: cn("text-dense inline-flex min-w-10 items-center justify-center rounded-sm border px-2.5 py-0.5 font-semibold tabular-nums", TONE_SOFT[t], TONE_BORDER[t], className), children: children }));
|
|
16
37
|
}
|
|
17
38
|
//# sourceMappingURL=Pills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pills.js","sourceRoot":"","sources":["../../src/components/Pills.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"Pills.js","sourceRoot":"","sources":["../../src/components/Pills.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAA;AACnG,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAUpC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAiB;IA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|
|
|
10
10
|
/**
|
|
11
11
|
* Section title row — a small semibold heading with an optional muted hint or
|
|
12
12
|
* control on the right. Use to label a block inside a widget body (e.g. a list
|
|
13
|
-
* or sub-table) without the visual weight of a full card header.
|
|
13
|
+
* or sub-table) without the visual weight of a full card header. The title is
|
|
14
|
+
* a caption ({@link MICRO_LABEL}: 13 px semibold, normal case); a section that
|
|
15
|
+
* needs a real heading takes `text-section` (21 px) instead.
|
|
14
16
|
*/
|
|
15
17
|
export declare function SectionHeading({ title, hint, trailing }: SectionHeadingProps): import("react").JSX.Element;
|
|
16
18
|
//# sourceMappingURL=SectionHeading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeading.d.ts","sourceRoot":"","sources":["../../src/components/SectionHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"SectionHeading.d.ts","sourceRoot":"","sources":["../../src/components/SectionHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,kFAAkF;IAClF,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAW5E"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MICRO_LABEL } from "../lib/typography.js";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
2
4
|
/**
|
|
3
5
|
* Section title row — a small semibold heading with an optional muted hint or
|
|
4
6
|
* control on the right. Use to label a block inside a widget body (e.g. a list
|
|
5
|
-
* or sub-table) without the visual weight of a full card header.
|
|
7
|
+
* or sub-table) without the visual weight of a full card header. The title is
|
|
8
|
+
* a caption ({@link MICRO_LABEL}: 13 px semibold, normal case); a section that
|
|
9
|
+
* needs a real heading takes `text-section` (21 px) instead.
|
|
6
10
|
*/
|
|
7
11
|
export function SectionHeading({ title, hint, trailing }) {
|
|
8
|
-
return (_jsxs("div", { className: "text-muted-foreground mb-3 flex items-center justify-between
|
|
12
|
+
return (_jsxs("div", { className: cn("text-muted-foreground mb-3 flex items-center justify-between", MICRO_LABEL), children: [_jsx("span", { children: title }), (hint || trailing) && (_jsx("span", { className: "text-muted-foreground text-small font-medium", children: trailing ?? hint }))] }));
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=SectionHeading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeading.js","sourceRoot":"","sources":["../../src/components/SectionHeading.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SectionHeading.js","sourceRoot":"","sources":["../../src/components/SectionHeading.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAWpC;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAuB;IAC3E,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CAAC,8DAA8D,EAAE,WAAW,CAAC,aAE1F,yBAAO,KAAK,GAAQ,EACnB,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CACrB,eAAM,SAAS,EAAC,8CAA8C,YAAE,QAAQ,IAAI,IAAI,GAAQ,CACzF,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToastItem, type ToastOptions } from "../lib/toast-model.js";
|
|
3
|
+
export type { ToastOptions, ToastTone } from "../lib/toast-model.js";
|
|
4
|
+
/** What {@link useToast} returns. */
|
|
5
|
+
export interface ToastApi {
|
|
6
|
+
/** Show a toast; returns its id (for an early {@link ToastApi.dismiss}). */
|
|
7
|
+
show: (options: ToastOptions) => number;
|
|
8
|
+
/** Remove a toast before its timer runs out. */
|
|
9
|
+
dismiss: (id: number) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Raise toasts from anywhere below a {@link ToastProvider}: `show({ tone,
|
|
13
|
+
* title })` after a write succeeded or failed, never a silent `console` line.
|
|
14
|
+
* Outside a provider it returns a no-op API, so a widget rendered in a bare
|
|
15
|
+
* fixture never crashes on feedback.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useToast(): ToastApi;
|
|
18
|
+
/**
|
|
19
|
+
* The stack of toasts — a presentational view over a list (the provider owns
|
|
20
|
+
* the state). The container is ONE persistent live region
|
|
21
|
+
* (`aria-live="polite"`, mounted before the first toast so that toast is
|
|
22
|
+
* announced, each new toast on its own: `aria-atomic="false"`), without
|
|
23
|
+
* stealing focus. Its attributes never change: a role or name that switched
|
|
24
|
+
* on with the first toast would make the browser rebuild the region in the
|
|
25
|
+
* same commit that inserts the toast, and a region created with its content
|
|
26
|
+
* already in it is not announced. So it carries no role (a generic element
|
|
27
|
+
* takes no name either): an idle stack is no second "status" next to a view's
|
|
28
|
+
* own loading status. Bottom centre, above dialogs (z 60), per CI §5/§8.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ToastViewport({ toasts, onDismiss, }: {
|
|
31
|
+
toasts: readonly ToastItem[];
|
|
32
|
+
onDismiss: (id: number) => void;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Provide toasts to a subtree and render their stack. Idempotent: nested
|
|
36
|
+
* inside another `ToastProvider` it adds nothing, so the app shell and an
|
|
37
|
+
* embedded builder share one stack and one live region. `McpAppView` mounts
|
|
38
|
+
* one for you.
|
|
39
|
+
*/
|
|
40
|
+
export declare function ToastProvider({ children }: {
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
43
|
+
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAMd,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAA;AAE9B,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEpE,qCAAqC;AACrC,MAAM,WAAW,QAAQ;IACvB,4EAA4E;IAC5E,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAA;IACvC,gDAAgD;IAChD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAOD;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAEnC;AA0BD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC,+BAmBA;AAoFD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+TAGlE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useReducer, useRef, } from "react";
|
|
3
|
+
import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from "lucide-react";
|
|
4
|
+
import { useToolkitMessages } from "../locale/locale-provider.js";
|
|
5
|
+
import { FOCUS_RING } from "../lib/focus-ring.js";
|
|
6
|
+
import { TONE_ICON } from "../lib/tone-utils.js";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
import { createToast, createToastTimer, toastReducer, } from "../lib/toast-model.js";
|
|
9
|
+
const ToastContext = createContext(null);
|
|
10
|
+
/** Outside a provider `useToast()` degrades to a no-op instead of throwing. */
|
|
11
|
+
const NOOP_TOASTS = { show: () => -1, dismiss: () => { } };
|
|
12
|
+
/**
|
|
13
|
+
* Raise toasts from anywhere below a {@link ToastProvider}: `show({ tone,
|
|
14
|
+
* title })` after a write succeeded or failed, never a silent `console` line.
|
|
15
|
+
* Outside a provider it returns a no-op API, so a widget rendered in a bare
|
|
16
|
+
* fixture never crashes on feedback.
|
|
17
|
+
*/
|
|
18
|
+
export function useToast() {
|
|
19
|
+
return useContext(ToastContext) ?? NOOP_TOASTS;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Status edge per tone — the status colour as border, never as text. Repeated
|
|
23
|
+
* under `dark:` so the card's dark 3:1 rim (`dark:border-input`, a later rule)
|
|
24
|
+
* does not paint over it.
|
|
25
|
+
*/
|
|
26
|
+
const TONE_EDGE = {
|
|
27
|
+
success: "border-l-success dark:border-l-success",
|
|
28
|
+
warning: "border-l-warning dark:border-l-warning",
|
|
29
|
+
danger: "border-l-danger dark:border-l-danger",
|
|
30
|
+
info: "border-l-info dark:border-l-info",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Lucide icon per tone, drawn in the tone colour (`TONE_ICON`, CI §3.3: status
|
|
34
|
+
* as edge and icon). The title next to it carries the message, so success and
|
|
35
|
+
* warning stay CI-exempt from 3:1 on light like every other status icon.
|
|
36
|
+
*/
|
|
37
|
+
const TOAST_ICON = {
|
|
38
|
+
success: CircleCheck,
|
|
39
|
+
warning: TriangleAlert,
|
|
40
|
+
danger: CircleAlert,
|
|
41
|
+
info: Info,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The stack of toasts — a presentational view over a list (the provider owns
|
|
45
|
+
* the state). The container is ONE persistent live region
|
|
46
|
+
* (`aria-live="polite"`, mounted before the first toast so that toast is
|
|
47
|
+
* announced, each new toast on its own: `aria-atomic="false"`), without
|
|
48
|
+
* stealing focus. Its attributes never change: a role or name that switched
|
|
49
|
+
* on with the first toast would make the browser rebuild the region in the
|
|
50
|
+
* same commit that inserts the toast, and a region created with its content
|
|
51
|
+
* already in it is not announced. So it carries no role (a generic element
|
|
52
|
+
* takes no name either): an idle stack is no second "status" next to a view's
|
|
53
|
+
* own loading status. Bottom centre, above dialogs (z 60), per CI §5/§8.
|
|
54
|
+
*/
|
|
55
|
+
export function ToastViewport({ toasts, onDismiss, }) {
|
|
56
|
+
const messages = useToolkitMessages();
|
|
57
|
+
return (_jsx("div", { "data-slot": "toast-viewport", "aria-live": "polite", "aria-atomic": "false", className: "pointer-events-none fixed inset-x-0 bottom-4 z-60 flex flex-col items-center gap-2 px-4", children: toasts.map((toast) => (_jsx(ToastCard, { toast: toast, dismissLabel: messages.common.dismiss, onDismiss: onDismiss }, toast.id))) }));
|
|
58
|
+
}
|
|
59
|
+
function ToastCard({ toast, dismissLabel, onDismiss, }) {
|
|
60
|
+
// Hover or keyboard focus holds the toast; on leave it resumes with the
|
|
61
|
+
// time that was LEFT (createToastTimer), never a fresh full duration.
|
|
62
|
+
const timer = useRef(null);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const countdown = createToastTimer(toast.duration, () => onDismiss(toast.id));
|
|
65
|
+
timer.current = countdown;
|
|
66
|
+
return () => {
|
|
67
|
+
countdown.cancel();
|
|
68
|
+
timer.current = null;
|
|
69
|
+
};
|
|
70
|
+
}, [onDismiss, toast.id, toast.duration]);
|
|
71
|
+
const releaseFocus = (event) => {
|
|
72
|
+
// Focus moving inside the toast (card → close button) keeps the hold.
|
|
73
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
74
|
+
timer.current?.release("focus");
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const Icon = TOAST_ICON[toast.tone];
|
|
78
|
+
return (_jsxs("div", { "data-slot": "toast", "data-tone": toast.tone, onMouseEnter: () => timer.current?.hold("pointer"), onMouseLeave: () => timer.current?.release("pointer"), onFocus: () => timer.current?.hold("focus"), onBlur: releaseFocus, className: cn(
|
|
79
|
+
// An overlay like Dialog/Sheet: shadow-2 on light, the 3:1 input rim on
|
|
80
|
+
// dark (shadows vanish on the ground). Its words are running text (16 px).
|
|
81
|
+
"bg-popover text-popover-foreground dark:border-input shadow-2 text-body pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-md border border-l-4 px-4 py-3", "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-bottom-2 motion-safe:duration-(--motion-base) motion-safe:ease-(--ease)", TONE_EDGE[toast.tone]), children: [_jsx(Icon, { "aria-hidden": "true", className: cn("mt-1 size-4 shrink-0", TONE_ICON[toast.tone]) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "font-medium break-words", children: toast.title }), toast.description && (_jsx("p", { className: "text-muted-foreground mt-0.5 break-words", children: toast.description }))] }), _jsx("button", { type: "button", "aria-label": dismissLabel, onClick: () => onDismiss(toast.id), className: `text-muted-foreground hover:text-foreground -mr-1 inline-flex size-6 shrink-0 items-center justify-center rounded-sm ${FOCUS_RING}`, children: _jsx(X, { "aria-hidden": "true", className: "size-4" }) })] }));
|
|
82
|
+
}
|
|
83
|
+
function ToastRoot({ children }) {
|
|
84
|
+
const [toasts, dispatch] = useReducer(toastReducer, []);
|
|
85
|
+
const nextId = useRef(0);
|
|
86
|
+
const dismiss = useCallback((id) => dispatch({ type: "dismiss", id }), []);
|
|
87
|
+
const show = useCallback((options) => {
|
|
88
|
+
nextId.current += 1;
|
|
89
|
+
const id = nextId.current;
|
|
90
|
+
dispatch({ type: "add", toast: createToast(id, options) });
|
|
91
|
+
return id;
|
|
92
|
+
}, []);
|
|
93
|
+
const api = useMemo(() => ({ show, dismiss }), [show, dismiss]);
|
|
94
|
+
return (_jsxs(ToastContext.Provider, { value: api, children: [children, _jsx(ToastViewport, { toasts: toasts, onDismiss: dismiss })] }));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Provide toasts to a subtree and render their stack. Idempotent: nested
|
|
98
|
+
* inside another `ToastProvider` it adds nothing, so the app shell and an
|
|
99
|
+
* embedded builder share one stack and one live region. `McpAppView` mounts
|
|
100
|
+
* one for you.
|
|
101
|
+
*/
|
|
102
|
+
export function ToastProvider({ children }) {
|
|
103
|
+
const parent = useContext(ToastContext);
|
|
104
|
+
return parent ? children : _jsx(ToastRoot, { children: children });
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=Toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,UAAU,EACV,MAAM,GAGP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAmB,MAAM,cAAc,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,GAKb,MAAM,uBAAuB,CAAA;AAY9B,MAAM,YAAY,GA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,OAAO,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IACzE,OAAO,CACL,MAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,aAC9B,QAAQ,EACT,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAI,IAC/B,CACzB,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAA2B;IACjE,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IACvC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,SAAS,cAAE,QAAQ,GAAa,CAAA;AAC9D,CAAC"}
|
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ToneName } from "../lib/tone-utils.js";
|
|
3
|
+
/** Heading element of a {@link WidgetHeader} title. */
|
|
4
|
+
export type WidgetHeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
3
5
|
export interface WidgetHeaderProps {
|
|
4
|
-
/** Optional icon/glyph rendered in a tinted tile above the title. */
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
/** Tone for the icon tile. Default `"neutral"`. */
|
|
7
|
-
iconTone?: ToneVariant;
|
|
8
6
|
/** The widget title. */
|
|
9
7
|
title: ReactNode;
|
|
10
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Heading element of the title. Default `"h1"`: the widget is the page.
|
|
10
|
+
* Pick the level that keeps ONE outline per view — below a toolbar title
|
|
11
|
+
* (`McpAppView` `titleMode="show"`, an h2 by default) use `"h3"`, inside a
|
|
12
|
+
* composed view under its own heading one level below it. The size follows
|
|
13
|
+
* `size`, not the level.
|
|
14
|
+
*/
|
|
15
|
+
as?: WidgetHeadingLevel;
|
|
16
|
+
/**
|
|
17
|
+
* `"default"`: the page title (28 px / 700, the CI h2 style). `"detail"`:
|
|
18
|
+
* the compact detail-page title (21 px / 600, the CI h3 style).
|
|
19
|
+
*/
|
|
20
|
+
size?: "default" | "detail";
|
|
21
|
+
/** Inline after the title inside the heading (e.g. a version chip). */
|
|
22
|
+
titleSuffix?: ReactNode;
|
|
23
|
+
/** Above the title — a `StatusBadge` that says the state in words. */
|
|
24
|
+
badge?: ReactNode;
|
|
25
|
+
/** Subtitle/meta row under the title (e.g. a live pill + counts), a 13 px caption row. */
|
|
11
26
|
sub?: ReactNode;
|
|
12
27
|
/** Right-aligned actions slot (buttons, drill controls). */
|
|
13
28
|
actions?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated A glyph in a tinted tile above every title is the icon-tile
|
|
31
|
+
* pattern the CI rules out (anti-slop U2). Say a state in words with a
|
|
32
|
+
* `StatusBadge` in {@link WidgetHeaderProps.badge}. Still rendered when set.
|
|
33
|
+
*/
|
|
34
|
+
icon?: ReactNode;
|
|
35
|
+
/** @deprecated Tone of the deprecated {@link WidgetHeaderProps.icon} tile. */
|
|
36
|
+
iconTone?: ToneName;
|
|
37
|
+
className?: string;
|
|
14
38
|
}
|
|
15
39
|
/**
|
|
16
|
-
* Page-level header
|
|
17
|
-
*
|
|
18
|
-
* Use once per widget surface to anchor it.
|
|
40
|
+
* Page-level header at the top of a widget: an optional state badge, the
|
|
41
|
+
* title (heading level per `as`, size per `size`), a subtitle/meta row and a
|
|
42
|
+
* right-aligned actions slot. Use once per widget surface to anchor it.
|
|
19
43
|
*/
|
|
20
|
-
export declare function WidgetHeader({
|
|
44
|
+
export declare function WidgetHeader({ title, as: Heading, size, titleSuffix, badge, sub, actions, icon, iconTone, className, }: WidgetHeaderProps): import("react").JSX.Element;
|
|
21
45
|
//# sourceMappingURL=WidgetHeader.d.ts.map
|