@miragon/mcp-toolkit-ui 2.7.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 +7 -4
- 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.js +1 -1
- 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 +21 -7
- 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 +11 -4
- 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/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 +2 -1
- package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
- package/dist/app/builder/PipelineStrip.js +26 -13
- 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 +8 -2
- package/dist/app/builder/SaveDialog.js.map +1 -1
- package/dist/app/builder/Toolbar.d.ts +12 -4
- package/dist/app/builder/Toolbar.d.ts.map +1 -1
- package/dist/app/builder/Toolbar.js +18 -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 +143 -1
- package/dist/app/builder/builder-model.d.ts.map +1 -1
- package/dist/app/builder/builder-model.js +191 -1
- package/dist/app/builder/builder-model.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/use-builder-catalogue.d.ts +4 -1
- package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
- package/dist/app/builder/use-builder-catalogue.js +44 -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/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 +13 -25
- package/dist/app/layout-builder.d.ts.map +1 -1
- package/dist/app/layout-builder.js +75 -81
- package/dist/app/layout-builder.js.map +1 -1
- package/dist/app/mcp-app-view-chrome.d.ts +12 -3
- package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
- package/dist/app/mcp-app-view-chrome.js +21 -5
- package/dist/app/mcp-app-view-chrome.js.map +1 -1
- package/dist/app/mcp-app-view-states.d.ts +11 -3
- package/dist/app/mcp-app-view-states.d.ts.map +1 -1
- package/dist/app/mcp-app-view-states.js +29 -8
- package/dist/app/mcp-app-view-states.js.map +1 -1
- package/dist/app/mcp-app-view.d.ts +33 -1
- package/dist/app/mcp-app-view.d.ts.map +1 -1
- package/dist/app/mcp-app-view.js +181 -127
- package/dist/app/mcp-app-view.js.map +1 -1
- package/dist/app/mcp-toolkit-app.d.ts +6 -1
- package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
- package/dist/app/mcp-toolkit-app.js +8 -1
- 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 +4 -0
- package/dist/app/use-view-lifecycle.d.ts.map +1 -1
- package/dist/app/use-view-lifecycle.js +2 -0
- package/dist/app/use-view-lifecycle.js.map +1 -1
- package/dist/app/view-lifecycle.d.ts +80 -4
- package/dist/app/view-lifecycle.d.ts.map +1 -1
- package/dist/app/view-lifecycle.js +90 -3
- package/dist/app/view-lifecycle.js.map +1 -1
- 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 +3 -1
- package/dist/app/widget-props-sheet.d.ts.map +1 -1
- package/dist/app/widget-props-sheet.js +22 -10
- package/dist/app/widget-props-sheet.js.map +1 -1
- package/dist/app/widget-renderer.js +1 -1
- 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 +8 -6
- package/dist/components/DrillButton.js.map +1 -1
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +4 -2
- package/dist/components/EmptyState.js.map +1 -1
- package/dist/components/ErrorState.d.ts +5 -2
- package/dist/components/ErrorState.d.ts.map +1 -1
- package/dist/components/ErrorState.js +25 -8
- package/dist/components/ErrorState.js.map +1 -1
- package/dist/components/FilterBar.d.ts +15 -4
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +11 -6
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/KpiGrid.d.ts +66 -21
- package/dist/components/KpiGrid.d.ts.map +1 -1
- package/dist/components/KpiGrid.js +101 -34
- package/dist/components/KpiGrid.js.map +1 -1
- package/dist/components/ListFooter.d.ts +31 -4
- package/dist/components/ListFooter.d.ts.map +1 -1
- package/dist/components/ListFooter.js +30 -11
- 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 +27 -7
- package/dist/components/Pills.d.ts.map +1 -1
- package/dist/components/Pills.js +21 -6
- 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 +9 -3
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +31 -16
- package/dist/components/Toast.js.map +1 -1
- 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 +47 -52
- package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
- package/dist/hooks/use-tool-result-recovery.js +58 -120
- package/dist/hooks/use-tool-result-recovery.js.map +1 -1
- package/dist/hooks/use-view-data.d.ts +52 -10
- package/dist/hooks/use-view-data.d.ts.map +1 -1
- package/dist/hooks/use-view-data.js +81 -16
- 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 +17 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -6
- 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/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 +41 -1
- package/dist/lib/toast-model.d.ts.map +1 -1
- package/dist/lib/toast-model.js +67 -1
- package/dist/lib/toast-model.js.map +1 -1
- package/dist/lib/tone-utils.d.ts +58 -6
- package/dist/lib/tone-utils.d.ts.map +1 -1
- package/dist/lib/tone-utils.js +66 -4
- 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 +1 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/locale/message-types.d.ts +117 -4
- package/dist/locale/message-types.d.ts.map +1 -1
- package/dist/locale/messages-de.d.ts.map +1 -1
- package/dist/locale/messages-de.js +44 -10
- package/dist/locale/messages-de.js.map +1 -1
- package/dist/locale/messages-en.d.ts.map +1 -1
- package/dist/locale/messages-en.js +44 -10
- package/dist/locale/messages-en.js.map +1 -1
- package/dist/locale/toolkit-messages.d.ts +19 -1
- package/dist/locale/toolkit-messages.d.ts.map +1 -1
- package/dist/locale/toolkit-messages.js +54 -1
- package/dist/locale/toolkit-messages.js.map +1 -1
- package/dist/primitives/alert.d.ts +1 -1
- package/dist/primitives/alert.d.ts.map +1 -1
- package/dist/primitives/alert.js +2 -0
- 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 +9 -4
- package/dist/primitives/badge.js.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/dialog.d.ts +1 -1
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +10 -3
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/select.js.map +1 -1
- package/dist/primitives/sheet.d.ts +1 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/sheet.js +6 -2
- package/dist/primitives/sheet.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 +30 -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/theme/create-theme.d.ts +19 -1
- package/dist/theme/create-theme.d.ts.map +1 -1
- package/dist/theme/create-theme.js +15 -0
- package/dist/theme/create-theme.js.map +1 -1
- package/package.json +5 -4
- package/src/app/adapt-data-widget.tsx +2 -42
- package/src/app/builder/BuilderBanners.tsx +1 -1
- package/src/app/builder/CanvasRow.tsx +63 -17
- package/src/app/builder/CatalogueSheet.tsx +50 -29
- package/src/app/builder/CellPropsSheet.tsx +17 -2
- package/src/app/builder/DiscardDialog.tsx +59 -0
- package/src/app/builder/LayoutSurface.tsx +206 -66
- package/src/app/builder/PipelineStrip.tsx +253 -153
- package/src/app/builder/SaveDialog.tsx +14 -2
- package/src/app/builder/Toolbar.tsx +144 -59
- package/src/app/builder/Workspace.tsx +226 -58
- package/src/app/builder/builder-model.ts +341 -2
- 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/reveal.ts +10 -0
- package/src/app/builder/use-builder-catalogue.ts +56 -19
- package/src/app/builder/use-builder-session.ts +68 -0
- package/src/app/builder/use-display-resolver.ts +24 -0
- package/src/app/index.ts +12 -2
- package/src/app/layout-builder.tsx +178 -191
- package/src/app/mcp-app-view-chrome.test.tsx +141 -1
- package/src/app/mcp-app-view-chrome.tsx +56 -6
- package/src/app/mcp-app-view-states.tsx +51 -11
- package/src/app/mcp-app-view.effects.test.tsx +292 -0
- package/src/app/mcp-app-view.test.tsx +222 -2
- package/src/app/mcp-app-view.tsx +267 -117
- package/src/app/mcp-toolkit-app.test.tsx +40 -0
- package/src/app/mcp-toolkit-app.tsx +8 -1
- 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 +6 -0
- package/src/app/view-lifecycle.test.ts +216 -0
- package/src/app/view-lifecycle.ts +165 -5
- 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 +57 -16
- package/src/app/widget-renderer.tsx +1 -1
- package/src/components/DrillButton.tsx +23 -10
- package/src/components/EmptyState.tsx +6 -4
- package/src/components/ErrorState.tsx +31 -9
- package/src/components/FilterBar.test.tsx +82 -0
- package/src/components/FilterBar.tsx +52 -26
- package/src/components/KpiGrid.test.tsx +279 -0
- package/src/components/KpiGrid.tsx +297 -90
- package/src/components/ListFooter.test.tsx +116 -0
- package/src/components/ListFooter.tsx +102 -15
- 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 +63 -10
- package/src/components/SectionHeading.tsx +9 -3
- package/src/components/Toast.tsx +37 -19
- package/src/components/WidgetHeader.test.tsx +78 -0
- package/src/components/WidgetHeader.tsx +63 -16
- package/src/components/feedback-states.test.tsx +98 -9
- package/src/components/tone-figures.test.tsx +8 -4
- 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 +3 -4
- package/src/hooks/use-tool-result-recovery.ts +84 -142
- package/src/hooks/use-view-data.test.tsx +118 -9
- package/src/hooks/use-view-data.ts +128 -18
- package/src/hooks/use-view-tool-query.ts +25 -19
- package/src/i18n-coverage.test.tsx +104 -2
- package/src/index.ts +48 -11
- package/src/lib/focus-return.test.ts +288 -0
- package/src/lib/focus-return.ts +96 -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 +166 -1
- package/src/lib/toast-model.ts +104 -2
- package/src/lib/tone-utils.test.ts +86 -10
- package/src/lib/tone-utils.ts +89 -8
- 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 +1 -0
- package/src/locale/message-types.ts +118 -2
- package/src/locale/messages-de.ts +49 -10
- package/src/locale/messages-en.ts +49 -10
- package/src/locale/toolkit-messages.test.ts +133 -0
- package/src/locale/toolkit-messages.ts +63 -2
- package/src/primitives/alert.tsx +3 -0
- package/src/primitives/badge.tsx +9 -4
- package/src/primitives/button.tsx +1 -1
- package/src/primitives/dialog.tsx +10 -1
- package/src/primitives/select.tsx +1 -1
- package/src/primitives/sheet.tsx +7 -0
- 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 +38 -6
- package/src/render-effects.tsx +96 -0
- package/src/theme/cd-tokens.test.ts +3 -1
- package/src/theme/create-theme.test.ts +10 -0
- package/src/theme/create-theme.ts +28 -0
- package/src/theme/theme-css.test.ts +51 -0
- package/src/theme.css +31 -1
- package/ui-catalog.json +448 -41
|
@@ -4,19 +4,22 @@ export interface DrillButtonProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/** Drill/navigation handler — wire to in-widget navigation (e.g. `showWidget`). */
|
|
6
6
|
onDrill: () => void;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Optional leading icon — a Lucide icon of the domain, never a typed glyph.
|
|
9
|
+
* Decorative (`aria-hidden`). The trailing arrow is always rendered.
|
|
10
|
+
*/
|
|
8
11
|
icon?: ReactNode;
|
|
9
12
|
/** `sm` for table rows, `md` for surface headers. Default `"sm"`. */
|
|
10
13
|
size?: "sm" | "md";
|
|
11
|
-
/** Accessible label when the visible text is terse. */
|
|
14
|
+
/** Accessible label when the visible text is terse; keep the visible text in it (WCAG 2.5.3). */
|
|
12
15
|
ariaLabel?: string;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* The single, deterministic in-widget navigation control: a neutral outline
|
|
16
|
-
* button with a trailing
|
|
17
|
-
* every in-app drill (row "Open", header nav) so they read identically
|
|
18
|
-
* visually quieter than primary/agentic actions. Decoupled from any
|
|
19
|
-
* an `onDrill` callback (e.g. wrapping `useHostActions().showWidget`).
|
|
19
|
+
* button with a trailing Lucide arrow that drills into a detail/sub-view. Use
|
|
20
|
+
* it for every in-app drill (row "Open", header nav) so they read identically
|
|
21
|
+
* and stay visually quieter than primary/agentic actions. Decoupled from any
|
|
22
|
+
* host — pass an `onDrill` callback (e.g. wrapping `useHostActions().showWidget`).
|
|
20
23
|
*/
|
|
21
24
|
export declare function DrillButton({ children, onDrill, icon, size, ariaLabel }: DrillButtonProps): import("react").JSX.Element;
|
|
22
25
|
//# sourceMappingURL=DrillButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrillButton.d.ts","sourceRoot":"","sources":["../../src/components/DrillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"DrillButton.d.ts","sourceRoot":"","sources":["../../src/components/DrillButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,QAAQ,EAAE,SAAS,CAAA;IACnB,mFAAmF;IACnF,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qEAAqE;IACrE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAsBhG"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowRight } from "lucide-react";
|
|
2
3
|
import { FOCUS_RING } from "../lib/focus-ring.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
3
5
|
/**
|
|
4
6
|
* The single, deterministic in-widget navigation control: a neutral outline
|
|
5
|
-
* button with a trailing
|
|
6
|
-
* every in-app drill (row "Open", header nav) so they read identically
|
|
7
|
-
* visually quieter than primary/agentic actions. Decoupled from any
|
|
8
|
-
* an `onDrill` callback (e.g. wrapping `useHostActions().showWidget`).
|
|
7
|
+
* button with a trailing Lucide arrow that drills into a detail/sub-view. Use
|
|
8
|
+
* it for every in-app drill (row "Open", header nav) so they read identically
|
|
9
|
+
* and stay visually quieter than primary/agentic actions. Decoupled from any
|
|
10
|
+
* host — pass an `onDrill` callback (e.g. wrapping `useHostActions().showWidget`).
|
|
9
11
|
*/
|
|
10
12
|
export function DrillButton({ children, onDrill, icon, size = "sm", ariaLabel }) {
|
|
11
|
-
const pad = size === "md" ? "px-3 py-1.5 text-
|
|
12
|
-
return (_jsxs("button", { type: "button", onClick: onDrill, "aria-label": ariaLabel, className:
|
|
13
|
+
const pad = size === "md" ? "px-3 py-1.5 text-dense" : "px-2.5 py-1 text-small";
|
|
14
|
+
return (_jsxs("button", { type: "button", onClick: onDrill, "aria-label": ariaLabel, className: cn("border-border text-foreground hover:border-focus hover:bg-accent hover:text-accent-foreground inline-flex items-center gap-1 rounded-md border font-medium transition-colors [&_svg:not([class*='size-'])]:size-4", FOCUS_RING, pad), children: [icon && (_jsx("span", { "aria-hidden": "true", className: "inline-flex", children: icon })), children, _jsx(ArrowRight, { "aria-hidden": "true", className: "size-4 shrink-0" })] }));
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=DrillButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrillButton.js","sourceRoot":"","sources":["../../src/components/DrillButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"DrillButton.js","sourceRoot":"","sources":["../../src/components/DrillButton.tsx"],"names":[],"mappings":";AACA,OA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CAAC,EAAE,SAAS,CAAA;IAClB,gFAAgF;IAChF,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,oFAAoF;IACpF,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAgB,EAChB,KAAK,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,OAAO,EAAE,KAAY,EACrB,SAAS,GACV,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,8FAA8F;AAC9F,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAA;AAExD,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,yFAAyF;IACzF,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC5B,2DAA2D;IAC3D,KAAK,EAAE,SAAS,CAAA;IAChB,yDAAyD;IACzD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,gFAAgF;IAChF,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,oFAAoF;IACpF,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAgB,EAChB,KAAK,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,OAAO,EAAE,KAAY,EACrB,SAAS,GACV,EAAE,eAAe,+BA+BjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TONE_ICON } from "../lib/tone-utils.js";
|
|
2
|
+
import { resolveTone, TONE_ICON } from "../lib/tone-utils.js";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
/** The icon slot in the tone's icon colour (`TONE_ICON`): quiet, or the success tone. */
|
|
5
5
|
const ICON_TONE = {
|
|
@@ -12,6 +12,8 @@ const ICON_TONE = {
|
|
|
12
12
|
* live region): it replaces content, it does not announce a change.
|
|
13
13
|
*/
|
|
14
14
|
export function EmptyState({ icon, tone = "neutral", title, description, action, secondaryAction, titleAs: Title = "h3", className, }) {
|
|
15
|
-
|
|
15
|
+
// An untyped tone resolves (`ok` → success); anything else stays quiet.
|
|
16
|
+
const iconTone = resolveTone(tone) === "success" ? "success" : "neutral";
|
|
17
|
+
return (_jsxs("div", { "data-slot": "empty-state", className: cn("flex flex-col items-center gap-2 px-4 py-8 text-center", className), children: [icon && (_jsx("div", { "aria-hidden": "true", className: cn("mb-1 flex items-center justify-center [&_svg:not([class*='size-'])]:size-6", ICON_TONE[iconTone]), children: icon })), _jsx(Title, { className: "text-foreground text-body font-semibold", children: title }), description && (_jsx("p", { className: "text-muted-foreground text-body max-w-prose text-balance", children: description })), (action || secondaryAction) && (_jsxs("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-2", children: [action, secondaryAction] }))] }));
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AA6BpC,yFAAyF;AACzF,MAAM,SAAS,GAAyD;IACtE,OAAO,EAAE,SAAS,CAAC,OAAO;IAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;CAC3B,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,OAAO,EAAE,KAAK,GAAG,IAAI,EACrB,SAAS,GACO;IAChB,wEAAwE;IACxE,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;IACxE,OAAO,CACL,4BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,wDAAwD,EAAE,SAAS,CAAC,aAEjF,IAAI,IAAI,CACP,6BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CACX,4EAA4E,EAC5E,SAAS,CAAC,QAAQ,CAAC,CACpB,YAEA,IAAI,GACD,CACP,EACD,KAAC,KAAK,IAAC,SAAS,EAAC,yCAAyC,YAAE,KAAK,GAAS,EACzE,WAAW,IAAI,CACd,YAAG,SAAS,EAAC,0DAA0D,YAAE,WAAW,GAAK,CAC1F,EACA,CAAC,MAAM,IAAI,eAAe,CAAC,IAAI,CAC9B,eAAK,SAAS,EAAC,uDAAuD,aACnE,MAAM,EACN,eAAe,IACZ,CACP,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -21,7 +21,10 @@ export interface ErrorStateProps {
|
|
|
21
21
|
retryLabel?: string;
|
|
22
22
|
/** Further actions after the retry button (e.g. a link to another view). */
|
|
23
23
|
actions?: ReactNode;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Default `"danger"`. `"warning"` for partial failures, `"info"` for
|
|
26
|
+
* notices. An untyped retired name still resolves (`error` → `danger`).
|
|
27
|
+
*/
|
|
25
28
|
tone?: ErrorStateTone;
|
|
26
29
|
/** Replace the tone's default Lucide icon. */
|
|
27
30
|
icon?: LucideIcon;
|
|
@@ -46,5 +49,5 @@ export interface ErrorStateProps {
|
|
|
46
49
|
* and a retry. `inline` is the alert form above content that still renders
|
|
47
50
|
* (failed data steps); `block` replaces a whole view or widget body.
|
|
48
51
|
*/
|
|
49
|
-
export declare function ErrorState({ title, description, details, detailsLabel, onRetry, retryLabel, actions, tone, icon, variant, role, titleAs, className, }: ErrorStateProps): import("react").JSX.Element;
|
|
52
|
+
export declare function ErrorState({ title, description, details, detailsLabel, onRetry, retryLabel, actions, tone: toneProp, icon, variant, role, titleAs, className, }: ErrorStateProps): import("react").JSX.Element;
|
|
50
53
|
//# sourceMappingURL=ErrorState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../src/components/ErrorState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAA+C,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAM3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;AAE1D,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,KAAK,EAAE,SAAS,CAAA;IAChB,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,CAAA;I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B,EACjB,IAAc,EACd,OAAO,EACP,SAAS,GACV,EAAE,eAAe,+BAoCjB"}
|
|
@@ -3,26 +3,42 @@ import { CircleAlert, Info, RefreshCw, TriangleAlert } from "lucide-react";
|
|
|
3
3
|
import { useToolkitMessages } from "../locale/locale-provider.js";
|
|
4
4
|
import { Button } from "../primitives/button.js";
|
|
5
5
|
import { FOCUS_RING } from "../lib/focus-ring.js";
|
|
6
|
-
import { TONE_BORDER, TONE_ICON, TONE_SOFT } from "../lib/tone-utils.js";
|
|
6
|
+
import { resolveTone, TONE_BORDER, TONE_ICON, TONE_SOFT } from "../lib/tone-utils.js";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
8
|
const STATE_ICON = {
|
|
9
9
|
danger: CircleAlert,
|
|
10
10
|
warning: TriangleAlert,
|
|
11
11
|
info: Info,
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The state's tone from whatever arrives: its three tones as is, a retired
|
|
15
|
+
* name through `resolveTone` (`error` → `danger`, `notice` → `info`), any
|
|
16
|
+
* other tone or unknown name as the default `danger`. A tone from untyped
|
|
17
|
+
* data (plain JS, the wire) never crashes the view on a missing icon.
|
|
18
|
+
*/
|
|
19
|
+
function stateTone(name) {
|
|
20
|
+
const tone = resolveTone(name, "danger");
|
|
21
|
+
return tone === "warning" || tone === "info" ? tone : "danger";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Per-variant geometry: `block` replaces a surface and reads as running text
|
|
25
|
+
* (16 px), `inline` is the compact alert box above content that still renders
|
|
26
|
+
* (14 px, the dense-controls exception of the type scale).
|
|
27
|
+
*/
|
|
14
28
|
const VARIANT = {
|
|
15
29
|
block: {
|
|
16
30
|
box: "gap-4 p-4",
|
|
17
31
|
icon: "size-5",
|
|
18
|
-
title: "text-
|
|
32
|
+
title: "text-body",
|
|
33
|
+
description: "text-body",
|
|
19
34
|
defaultTitleAs: "h2",
|
|
20
35
|
retry: "default",
|
|
21
36
|
},
|
|
22
37
|
inline: {
|
|
23
|
-
box: "gap-3 px-4 py-3 text-
|
|
38
|
+
box: "gap-3 px-4 py-3 text-dense",
|
|
24
39
|
icon: "size-4",
|
|
25
|
-
title: "text-
|
|
40
|
+
title: "text-dense",
|
|
41
|
+
description: "text-dense",
|
|
26
42
|
defaultTitleAs: "p",
|
|
27
43
|
retry: "outline",
|
|
28
44
|
},
|
|
@@ -33,14 +49,15 @@ const VARIANT = {
|
|
|
33
49
|
* and a retry. `inline` is the alert form above content that still renders
|
|
34
50
|
* (failed data steps); `block` replaces a whole view or widget body.
|
|
35
51
|
*/
|
|
36
|
-
export function ErrorState({ title, description, details, detailsLabel, onRetry, retryLabel, actions, tone
|
|
52
|
+
export function ErrorState({ title, description, details, detailsLabel, onRetry, retryLabel, actions, tone: toneProp, icon, variant = "block", role = "alert", titleAs, className, }) {
|
|
53
|
+
const tone = stateTone(toneProp);
|
|
37
54
|
const style = VARIANT[variant];
|
|
38
55
|
const Icon = icon ?? STATE_ICON[tone];
|
|
39
56
|
const Title = titleAs ?? style.defaultTitleAs;
|
|
40
57
|
// The status colour as rim, tint and icon; every word on the tint is the
|
|
41
58
|
// foreground (TONE_SOFT, CI §3.3). On dark the tint is transparent and the
|
|
42
59
|
// rim carries the tone.
|
|
43
|
-
return (_jsxs("div", { "data-slot": "error-state", "data-variant": variant, "data-tone": tone, role: role === "none" ? undefined : role, className: cn("flex items-start rounded-md border", style.box, TONE_SOFT[tone], TONE_BORDER[tone], className), children: [_jsx(Icon, { "aria-hidden": "true", className: cn("mt-0.5 shrink-0", style.icon, TONE_ICON[tone]) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx(Title, { className: cn("font-semibold", style.title), children: title }), description && _jsx("div", { className: "
|
|
60
|
+
return (_jsxs("div", { "data-slot": "error-state", "data-variant": variant, "data-tone": tone, role: role === "none" ? undefined : role, className: cn("flex items-start rounded-md border", style.box, TONE_SOFT[tone], TONE_BORDER[tone], className), children: [_jsx(Icon, { "aria-hidden": "true", className: cn("mt-0.5 shrink-0", style.icon, TONE_ICON[tone]) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx(Title, { className: cn("font-semibold", style.title), children: title }), description && _jsx("div", { className: cn("break-words", style.description), children: description }), details && _jsx(ErrorDetails, { label: detailsLabel, children: details }), _jsx(ErrorActions, { onRetry: onRetry, retryLabel: retryLabel, retryVariant: style.retry, actions: actions })] })] }));
|
|
44
61
|
}
|
|
45
62
|
/**
|
|
46
63
|
* The raw reason, collapsed: a native disclosure (keyboard + screen-reader
|
|
@@ -49,7 +66,7 @@ export function ErrorState({ title, description, details, detailsLabel, onRetry,
|
|
|
49
66
|
*/
|
|
50
67
|
function ErrorDetails({ label, children }) {
|
|
51
68
|
const messages = useToolkitMessages();
|
|
52
|
-
return (_jsxs("details", { className: "text-
|
|
69
|
+
return (_jsxs("details", { className: "text-small", children: [_jsx("summary", { className: `w-fit cursor-pointer rounded-sm py-0.5 select-none ${FOCUS_RING}`, children: label ?? messages.common.details }), _jsx("pre", { className: "mt-1 font-mono break-words whitespace-pre-wrap", children: children })] }));
|
|
53
70
|
}
|
|
54
71
|
function ErrorActions({ onRetry, retryLabel, retryVariant, actions, }) {
|
|
55
72
|
const messages = useToolkitMessages();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorState.js","sourceRoot":"","sources":["../../src/components/ErrorState.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+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AAE,UAAU,EACtB,YAAY,EAAE,KAAK,CAAC,KAAK,EACzB,OAAO,EAAE,OAAO,GAChB,IACE,IACF,CACP,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAsD;IAC3F,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAA;IACrC,OAAO,CACL,mBAAS,SAAS,EAAC,YAAY,aAC7B,kBAAS,SAAS,EAAE,sDAAsD,UAAU,EAAE,YACnF,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,GACzB,EACV,cAAK,SAAS,EAAC,gDAAgD,YAAE,QAAQ,GAAO,IACxE,CACX,CAAA;AACH,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,GAMR;IACC,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAA;IACrC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACrC,OAAO,CACL,eAAK,SAAS,EAAC,wCAAwC,aACpD,OAAO,IAAI,CACV,MAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,aACrE,KAAC,SAAS,mBAAa,MAAM,GAAG,EAC/B,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,IAC7B,CACV,EACA,OAAO,IACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface FilterChip {
|
|
2
2
|
/** Stable id passed back to `onChipToggle`. */
|
|
3
3
|
id: string;
|
|
4
|
-
/** Visible chip label. */
|
|
4
|
+
/** Visible chip label (its accessible name, with the count). */
|
|
5
5
|
label: string;
|
|
6
6
|
/** Optional count rendered after the label. */
|
|
7
7
|
count?: number | string;
|
|
8
|
-
/** Whether the chip is currently active. */
|
|
8
|
+
/** Whether the chip is currently active (`aria-pressed`). */
|
|
9
9
|
active?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface FilterBarProps {
|
|
@@ -13,16 +13,27 @@ export interface FilterBarProps {
|
|
|
13
13
|
search: string;
|
|
14
14
|
/** Placeholder for the search input. Default: the locale's "Filter…". */
|
|
15
15
|
searchPlaceholder?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Accessible name of the search input. Default: the locale's "Filter" — a
|
|
18
|
+
* placeholder is no label (it disappears while you type).
|
|
19
|
+
*/
|
|
20
|
+
searchAriaLabel?: string;
|
|
16
21
|
/** Called with the new search text on every keystroke. */
|
|
17
22
|
onSearchChange: (next: string) => void;
|
|
18
23
|
/** Filter chips rendered to the right of the search input. */
|
|
19
24
|
chips: FilterChip[];
|
|
20
25
|
/** Called with a chip id when it is toggled. */
|
|
21
26
|
onChipToggle: (id: string) => void;
|
|
27
|
+
/** Names the chip row (`role="group"`). Default: the locale's "Filters". */
|
|
28
|
+
chipsAriaLabel?: string;
|
|
29
|
+
className?: string;
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
24
32
|
* Search input + toggleable chip row for filtering a list/table of widget
|
|
25
|
-
* items.
|
|
33
|
+
* items. The input is labelled; every chip is a toggle button whose state is
|
|
34
|
+
* `aria-pressed`. An active chip is a selection in the CI pattern: the info
|
|
35
|
+
* tint and edge around foreground text. Pair with `useDebouncedValue` to
|
|
36
|
+
* avoid re-querying on every keystroke.
|
|
26
37
|
*/
|
|
27
|
-
export declare function FilterBar({ search, searchPlaceholder, onSearchChange, chips, onChipToggle, }: FilterBarProps): import("react").JSX.Element;
|
|
38
|
+
export declare function FilterBar({ search, searchPlaceholder, searchAriaLabel, onSearchChange, chips, onChipToggle, chipsAriaLabel, className, }: FilterBarProps): import("react").JSX.Element;
|
|
28
39
|
//# sourceMappingURL=FilterBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBar.d.ts","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterBar.d.ts","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0DAA0D;IAC1D,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,8DAA8D;IAC9D,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,gDAAgD;IAChD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,KAAK,EACL,YAAY,EACZ,cAAc,EACd,SAAS,GACV,EAAE,cAAc,+BA0ChB"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FOCUS_RING } from "../lib/focus-ring.js";
|
|
3
|
+
import { TONE_BORDER, TONE_SOFT } from "../lib/tone-utils.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
3
5
|
import { useToolkitMessages } from "../locale/locale-provider.js";
|
|
4
6
|
import { Input } from "../primitives/input.js";
|
|
5
7
|
/**
|
|
6
8
|
* Search input + toggleable chip row for filtering a list/table of widget
|
|
7
|
-
* items.
|
|
9
|
+
* items. The input is labelled; every chip is a toggle button whose state is
|
|
10
|
+
* `aria-pressed`. An active chip is a selection in the CI pattern: the info
|
|
11
|
+
* tint and edge around foreground text. Pair with `useDebouncedValue` to
|
|
12
|
+
* avoid re-querying on every keystroke.
|
|
8
13
|
*/
|
|
9
|
-
export function FilterBar({ search, searchPlaceholder, onSearchChange, chips, onChipToggle, }) {
|
|
10
|
-
const
|
|
11
|
-
return (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Input, { type: "search", value: search, onChange: (e) => onSearchChange(e.target.value), placeholder: searchPlaceholder ??
|
|
12
|
-
?
|
|
13
|
-
: "border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14
|
+
export function FilterBar({ search, searchPlaceholder, searchAriaLabel, onSearchChange, chips, onChipToggle, chipsAriaLabel, className, }) {
|
|
15
|
+
const { filterBar } = useToolkitMessages();
|
|
16
|
+
return (_jsxs("div", { "data-slot": "filter-bar", className: cn("flex flex-wrap items-center gap-2", className), children: [_jsx(Input, { type: "search", value: search, onChange: (e) => onSearchChange(e.target.value), placeholder: searchPlaceholder ?? filterBar.searchPlaceholder, "aria-label": searchAriaLabel ?? filterBar.searchLabel, className: "text-dense md:text-dense h-9 min-w-[220px] flex-1" }), chips.length > 0 && (_jsx("div", { role: "group", "aria-label": chipsAriaLabel ?? filterBar.chipsLabel, className: "flex flex-wrap gap-1.5", children: chips.map((chip) => (_jsxs("button", { type: "button", onClick: () => onChipToggle(chip.id), "aria-pressed": Boolean(chip.active), className: cn("text-small inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1 font-medium transition-colors", FOCUS_RING, chip.active
|
|
17
|
+
? cn(TONE_SOFT.info, TONE_BORDER.info, "font-semibold")
|
|
18
|
+
: "border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground"), children: [chip.label, chip.count !== undefined && chip.count !== "" && (_jsx("span", { className: "font-normal tabular-nums", children: chip.count }))] }, chip.id))) }))] }));
|
|
14
19
|
}
|
|
15
20
|
//# sourceMappingURL=FilterBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAkC9C;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,MAAM,EACN,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,KAAK,EACL,YAAY,EACZ,cAAc,EACd,SAAS,GACM;IACf,MAAM,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAC1C,OAAO,CACL,4BAAe,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC,aACvF,KAAC,KAAK,IACJ,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,WAAW,EAAE,iBAAiB,IAAI,SAAS,CAAC,iBAAiB,gBACjD,eAAe,IAAI,SAAS,CAAC,WAAW,EACpD,SAAS,EAAC,mDAAmD,GAC7D,EACD,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,cACE,IAAI,EAAC,OAAO,gBACA,cAAc,IAAI,SAAS,CAAC,UAAU,EAClD,SAAS,EAAC,wBAAwB,YAEjC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,kBACE,IAAI,EAAC,QAAQ,EAEb,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,kBACtB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,EAAE,CACX,yGAAyG,EACzG,UAAU,EACV,IAAI,CAAC,MAAM;wBACT,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,eAAe,CAAC;wBACvD,CAAC,CAAC,wFAAwF,CAC7F,aAEA,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,IAAI,CAChD,eAAM,SAAS,EAAC,0BAA0B,YAAE,IAAI,CAAC,KAAK,GAAQ,CAC/D,KAdI,IAAI,CAAC,EAAE,CAeL,CACV,CAAC,GACE,CACP,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,50 +1,95 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToneName } from "../lib/tone-utils.js";
|
|
3
|
+
type TrendDirection = "up" | "down" | "flat";
|
|
3
4
|
export interface KpiCell {
|
|
4
|
-
/** Caption shown above the value. */
|
|
5
|
+
/** Caption shown above the value. Part of the cell's accessible name. */
|
|
5
6
|
label: ReactNode;
|
|
6
7
|
/** The headline figure. Pre-format numbers for locale/currency. */
|
|
7
8
|
value: ReactNode;
|
|
8
9
|
/** Small fraction shown next to the value, e.g. ` /14`. */
|
|
9
10
|
fraction?: ReactNode;
|
|
10
|
-
/** Optional trend line under the value (e.g. `"+12% vs last week"`). */
|
|
11
|
+
/** Optional trend line under the value (e.g. `"+12% vs last week"`); its words stay neutral. */
|
|
11
12
|
trend?: ReactNode;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Draws a Lucide direction icon (TrendingUp / TrendingDown / Minus) before
|
|
15
|
+
* the trend line, in the trend's tone: `up` reads as bad (danger), `down`
|
|
16
|
+
* as good (success) unless {@link KpiCell.trendTone} says otherwise.
|
|
15
17
|
*/
|
|
16
|
-
trendDirection?:
|
|
18
|
+
trendDirection?: TrendDirection;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* Explicit tone of the trend — overrides the direction's default. Shown as
|
|
21
|
+
* the direction icon's colour, or as a dot when there is no direction.
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
trendTone?: ToneName;
|
|
24
|
+
/**
|
|
25
|
+
* The state the figure stands for (e.g. `"danger"` for a breached metric),
|
|
26
|
+
* shown as a dot next to the label (strip) or as the card's tint and edge
|
|
27
|
+
* (`variant="soft"`). The figure itself stays in the foreground colour.
|
|
28
|
+
*/
|
|
29
|
+
tone?: ToneName;
|
|
22
30
|
/** When set, the cell renders as a button — turns a metric into a nav entry point. */
|
|
23
31
|
onClick?: () => void;
|
|
24
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* What activating the cell does ("Opens the incidents dashboard"). Read as
|
|
34
|
+
* the button's DESCRIPTION (`aria-describedby`), so its accessible name
|
|
35
|
+
* stays the visible label and value (WCAG 2.5.3, label in name).
|
|
36
|
+
*/
|
|
37
|
+
actionHint?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Replaces the accessible name with text a voice-control user
|
|
40
|
+
* cannot see (WCAG 2.5.3). Say what the click does in
|
|
41
|
+
* {@link KpiCell.actionHint}; the visible label and value name the cell.
|
|
42
|
+
*/
|
|
25
43
|
ariaLabel?: string;
|
|
26
44
|
}
|
|
45
|
+
/** The responsive column classes for `count` cells (clamped to 1–6). */
|
|
46
|
+
export declare function kpiColumns(count: number): string;
|
|
27
47
|
export interface KpiGridHeader {
|
|
28
|
-
/** Group label
|
|
48
|
+
/** Group label of the strip header (13 px semibold, normal case). */
|
|
29
49
|
label: ReactNode;
|
|
30
50
|
/** Optional muted badge to the right of the label. */
|
|
31
51
|
badge?: ReactNode;
|
|
32
52
|
}
|
|
33
53
|
export interface KpiGridProps {
|
|
34
|
-
/** The metric cells, flowed as columns (1–6
|
|
54
|
+
/** The metric cells, flowed as columns (1–6; more wrap onto further rows). */
|
|
35
55
|
cells: KpiCell[];
|
|
36
56
|
/** Wrap the strip in a bordered card with an optional group `header`. Default `false`. */
|
|
37
57
|
boxed?: boolean;
|
|
38
|
-
/** Group header
|
|
58
|
+
/** Group header above the strip (strip variant), usually with `boxed`. */
|
|
39
59
|
header?: KpiGridHeader;
|
|
60
|
+
/**
|
|
61
|
+
* `"strip"` (default): one bordered strip, the tone as a dot next to the
|
|
62
|
+
* label. `"soft"`: one card per cell in its tone's tint and edge (`boxed`
|
|
63
|
+
* and `header` don't apply).
|
|
64
|
+
*/
|
|
65
|
+
variant?: "strip" | "soft";
|
|
66
|
+
/** Names the group of metrics (`role="group"`); omit when a heading right above names it. */
|
|
67
|
+
ariaLabel?: string;
|
|
68
|
+
className?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A row of headline metrics — the canonical way to show KPIs in a widget
|
|
72
|
+
* (replaces the single-metric KPICard). Cells flow as columns (1–6), falling
|
|
73
|
+
* back to 2 columns in narrow frames. A cell's `tone` shows as a dot next to
|
|
74
|
+
* its label (or as a soft card's tint and edge); figures stay in the
|
|
75
|
+
* foreground colour. A clickable cell is a button whose accessible name is
|
|
76
|
+
* its visible label and value; `actionHint` describes what the click does.
|
|
77
|
+
*/
|
|
78
|
+
export declare function KpiGrid({ cells, boxed, header, variant, ariaLabel, className, }: KpiGridProps): import("react").JSX.Element;
|
|
79
|
+
export interface KpiGridSkeletonProps {
|
|
80
|
+
/** How many cells the loaded grid will have. */
|
|
81
|
+
cells: number;
|
|
82
|
+
/** The loaded grid's variant. Default `"strip"`. */
|
|
83
|
+
variant?: "strip" | "soft";
|
|
84
|
+
/** The loaded grid's `boxed`. Default `false`. */
|
|
85
|
+
boxed?: boolean;
|
|
86
|
+
className?: string;
|
|
40
87
|
}
|
|
41
88
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* `boxed` + `header` for a labelled metric block; unboxed (default) renders the
|
|
46
|
-
* lighter `border-y` strip. A cell's `tone` shows as a status dot next to its
|
|
47
|
-
* label; figures stay in the foreground colour.
|
|
89
|
+
* Loading placeholder with {@link KpiGrid}'s geometry (same wrapper, grid and
|
|
90
|
+
* cell padding in both variants), so the layout doesn't jump when the data
|
|
91
|
+
* arrives. `aria-busy`; pair it with a status line if the wait is long.
|
|
48
92
|
*/
|
|
49
|
-
export declare function
|
|
93
|
+
export declare function KpiGridSkeleton({ cells, variant, boxed, className, }: KpiGridSkeletonProps): import("react").JSX.Element;
|
|
94
|
+
export {};
|
|
50
95
|
//# sourceMappingURL=KpiGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KpiGrid.d.ts","sourceRoot":"","sources":["../../src/components/KpiGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"KpiGrid.d.ts","sourceRoot":"","sources":["../../src/components/KpiGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG7C,OAAO,EAML,KAAK,QAAQ,EAEd,MAAM,sBAAsB,CAAA;AAK7B,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAmB5C,MAAM,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