@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,24 +1,157 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The single source of truth mapping each
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The single source of truth mapping each {@link ThemeTokens} field to its real
|
|
3
|
+
* CSS variable name in `theme.css`. `tokensToVars` walks this map, so adding a
|
|
4
|
+
* field here (and to {@link ThemeTokens}) is all that is needed to extend the
|
|
5
|
+
* public theming surface.
|
|
6
6
|
*/
|
|
7
7
|
export const TOKEN_TO_CSS_VAR = {
|
|
8
8
|
primary: "--primary",
|
|
9
9
|
primaryForeground: "--primary-foreground",
|
|
10
|
+
primaryHover: "--primary-hover",
|
|
11
|
+
link: "--link",
|
|
10
12
|
accent: "--accent",
|
|
11
13
|
accentForeground: "--accent-foreground",
|
|
12
14
|
background: "--background",
|
|
13
15
|
foreground: "--foreground",
|
|
14
16
|
card: "--card",
|
|
15
17
|
cardForeground: "--card-foreground",
|
|
18
|
+
popover: "--popover",
|
|
19
|
+
muted: "--muted",
|
|
20
|
+
mutedForeground: "--muted-foreground",
|
|
21
|
+
secondary: "--secondary",
|
|
16
22
|
border: "--border",
|
|
23
|
+
input: "--input",
|
|
17
24
|
ring: "--ring",
|
|
25
|
+
focus: "--focus",
|
|
26
|
+
destructive: "--destructive",
|
|
27
|
+
destructiveForeground: "--destructive-foreground",
|
|
28
|
+
success: "--success",
|
|
29
|
+
successSoft: "--success-soft",
|
|
30
|
+
successInk: "--success-ink",
|
|
31
|
+
warning: "--warning",
|
|
32
|
+
warningSoft: "--warning-soft",
|
|
33
|
+
warningInk: "--warning-ink",
|
|
34
|
+
danger: "--danger",
|
|
35
|
+
dangerSoft: "--danger-soft",
|
|
36
|
+
dangerInk: "--danger-ink",
|
|
37
|
+
info: "--info",
|
|
38
|
+
infoSoft: "--info-soft",
|
|
39
|
+
infoInk: "--info-ink",
|
|
18
40
|
radius: "--radius",
|
|
41
|
+
radiusSm: "--radius-sm",
|
|
42
|
+
radiusMd: "--radius-md",
|
|
43
|
+
radiusLg: "--radius-lg",
|
|
44
|
+
radiusPill: "--radius-pill",
|
|
45
|
+
shadow1: "--shadow-1",
|
|
46
|
+
shadow2: "--shadow-2",
|
|
47
|
+
shadow3: "--shadow-3",
|
|
48
|
+
scrim: "--scrim",
|
|
49
|
+
motionFast: "--motion-fast",
|
|
50
|
+
motionBase: "--motion-base",
|
|
51
|
+
motionSlow: "--motion-slow",
|
|
52
|
+
ease: "--ease",
|
|
19
53
|
fontSans: "--font-sans",
|
|
54
|
+
fontMono: "--font-mono",
|
|
20
55
|
fontHeading: "--font-heading",
|
|
56
|
+
textTitle: "--text-title",
|
|
57
|
+
textSection: "--text-section",
|
|
58
|
+
textBody: "--text-body",
|
|
59
|
+
textDense: "--text-dense",
|
|
60
|
+
textSmall: "--text-small",
|
|
21
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* The role-token contract: every variable the toolkit defines for components
|
|
64
|
+
* to use (`theme.css`), in light and — for colours — dark. Components in this
|
|
65
|
+
* package, and in apps built on it, style through these names only, never
|
|
66
|
+
* through raw colours or Tailwind palette classes.
|
|
67
|
+
*/
|
|
68
|
+
export const ROLE_TOKENS = [
|
|
69
|
+
"--background",
|
|
70
|
+
"--card",
|
|
71
|
+
"--popover",
|
|
72
|
+
"--muted",
|
|
73
|
+
"--secondary",
|
|
74
|
+
"--foreground",
|
|
75
|
+
"--muted-foreground",
|
|
76
|
+
"--border",
|
|
77
|
+
"--input",
|
|
78
|
+
"--primary",
|
|
79
|
+
"--primary-foreground",
|
|
80
|
+
"--primary-hover",
|
|
81
|
+
"--link",
|
|
82
|
+
"--ring",
|
|
83
|
+
"--focus",
|
|
84
|
+
"--success",
|
|
85
|
+
"--warning",
|
|
86
|
+
"--danger",
|
|
87
|
+
"--info",
|
|
88
|
+
"--success-soft",
|
|
89
|
+
"--warning-soft",
|
|
90
|
+
"--danger-soft",
|
|
91
|
+
"--info-soft",
|
|
92
|
+
"--success-ink",
|
|
93
|
+
"--warning-ink",
|
|
94
|
+
"--danger-ink",
|
|
95
|
+
"--info-ink",
|
|
96
|
+
"--destructive",
|
|
97
|
+
"--radius-sm",
|
|
98
|
+
"--radius-md",
|
|
99
|
+
"--radius-lg",
|
|
100
|
+
"--radius-pill",
|
|
101
|
+
"--shadow-1",
|
|
102
|
+
"--shadow-2",
|
|
103
|
+
"--shadow-3",
|
|
104
|
+
"--scrim",
|
|
105
|
+
"--motion-fast",
|
|
106
|
+
"--motion-base",
|
|
107
|
+
"--motion-slow",
|
|
108
|
+
"--ease",
|
|
109
|
+
"--font-sans",
|
|
110
|
+
"--font-mono",
|
|
111
|
+
"--text-title",
|
|
112
|
+
"--text-section",
|
|
113
|
+
"--text-body",
|
|
114
|
+
"--text-dense",
|
|
115
|
+
"--text-small",
|
|
116
|
+
];
|
|
117
|
+
/**
|
|
118
|
+
* Variables whose toolkit value is the same in light and dark (theme.css
|
|
119
|
+
* declares them once, or identically in both modes). A theme's LIGHT value for
|
|
120
|
+
* one of these also applies in dark mode — a brand's button colour, radius or
|
|
121
|
+
* font does not change with the mode. Every other variable (surfaces, text,
|
|
122
|
+
* links, focus, status tones) takes its dark value from the theme's `dark`
|
|
123
|
+
* tokens or, failing that, from the toolkit's dark defaults — never from the
|
|
124
|
+
* light value, which would put light surfaces into a dark scope.
|
|
125
|
+
* Pinned against theme.css by `theme-css.test.ts`.
|
|
126
|
+
*/
|
|
127
|
+
export const MODE_INVARIANT_VARS = new Set([
|
|
128
|
+
"--primary",
|
|
129
|
+
"--primary-foreground",
|
|
130
|
+
"--primary-hover",
|
|
131
|
+
"--destructive",
|
|
132
|
+
"--destructive-foreground",
|
|
133
|
+
"--input",
|
|
134
|
+
"--radius",
|
|
135
|
+
"--radius-sm",
|
|
136
|
+
"--radius-md",
|
|
137
|
+
"--radius-lg",
|
|
138
|
+
"--radius-pill",
|
|
139
|
+
"--shadow-1",
|
|
140
|
+
"--shadow-2",
|
|
141
|
+
"--shadow-3",
|
|
142
|
+
"--motion-fast",
|
|
143
|
+
"--motion-base",
|
|
144
|
+
"--motion-slow",
|
|
145
|
+
"--ease",
|
|
146
|
+
"--font-sans",
|
|
147
|
+
"--font-mono",
|
|
148
|
+
"--font-heading",
|
|
149
|
+
"--text-title",
|
|
150
|
+
"--text-section",
|
|
151
|
+
"--text-body",
|
|
152
|
+
"--text-dense",
|
|
153
|
+
"--text-small",
|
|
154
|
+
]);
|
|
22
155
|
/**
|
|
23
156
|
* Map a {@link ThemeTokens} object to its CSS variables. Empty/partial token
|
|
24
157
|
* objects yield only the variables that were set; fields not present in
|
|
@@ -35,20 +168,21 @@ export function tokensToVars(tokens) {
|
|
|
35
168
|
return vars;
|
|
36
169
|
}
|
|
37
170
|
/**
|
|
38
|
-
* Build a serializable {@link ThemeDefinition} from a
|
|
171
|
+
* Build a serializable {@link ThemeDefinition} from a set of brand
|
|
39
172
|
* {@link ThemeTokens}. This is the one switch a white-label client flips: pass
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* `
|
|
173
|
+
* the brand's roles (and, optionally, dark overrides), and every toolkit
|
|
174
|
+
* primitive that reads the role tokens — `Card`, `Button`, `Badge`, `bg-card`,
|
|
175
|
+
* `text-link`, `rounded-md` — re-skins to match. Without a theme the toolkit
|
|
176
|
+
* renders in the Miragon theme.
|
|
43
177
|
*
|
|
44
178
|
* Pure and side-effect-free: it only maps fields to CSS-variable names. Apply
|
|
45
179
|
* the result with {@link ThemeProvider} (recommended) or by spreading
|
|
46
|
-
* `theme
|
|
180
|
+
* {@link resolveThemeVars}`(theme, mode)` onto a wrapper element.
|
|
47
181
|
*
|
|
48
182
|
* @example
|
|
49
183
|
* const brand = createTheme(
|
|
50
|
-
* { primary: "
|
|
51
|
-
* { dark: {
|
|
184
|
+
* { primary: "#0f766e", link: "#0f766e", focus: "#0f766e", radiusMd: "6px" },
|
|
185
|
+
* { dark: { link: "#5eead4", focus: "#5eead4" } },
|
|
52
186
|
* )
|
|
53
187
|
* // <ThemeProvider theme={brand}>…</ThemeProvider>
|
|
54
188
|
*/
|
|
@@ -56,10 +190,67 @@ export function createTheme(tokens, opts) {
|
|
|
56
190
|
const vars = tokensToVars(tokens);
|
|
57
191
|
const darkTokens = opts?.dark;
|
|
58
192
|
const darkVars = darkTokens ? tokensToVars(darkTokens) : undefined;
|
|
59
|
-
|
|
193
|
+
const theme = {
|
|
60
194
|
vars,
|
|
61
195
|
...(darkVars && Object.keys(darkVars).length > 0 ? { darkVars } : {}),
|
|
62
|
-
toStyle: () =>
|
|
196
|
+
toStyle: () => resolveThemeVars(theme, "light"),
|
|
63
197
|
};
|
|
198
|
+
return theme;
|
|
199
|
+
}
|
|
200
|
+
/** Whether the theme sets `name` itself, in light or in dark. */
|
|
201
|
+
function declares(theme, name) {
|
|
202
|
+
return name in theme.vars || (theme.darkVars !== undefined && name in theme.darkVars);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Fill the roles a theme written against the pre-role API leaves unset, from
|
|
206
|
+
* the knobs it does set, so it keeps ONE brand instead of half Miragon:
|
|
207
|
+
*
|
|
208
|
+
* - the base `--radius` reshapes the sm/md/lg steps (CI ratio 6 : 12 : 16);
|
|
209
|
+
* - `--primary` gives `--primary-hover` (90 %, the old `bg-primary/90`) and
|
|
210
|
+
* `--link` (the old link button was `text-primary`);
|
|
211
|
+
* - `--ring` gives `--focus` (the old focus ring).
|
|
212
|
+
*
|
|
213
|
+
* A role the theme sets itself — in either mode — is never derived, and an
|
|
214
|
+
* explicit value always wins.
|
|
215
|
+
*/
|
|
216
|
+
function withDerivedVars(vars, theme) {
|
|
217
|
+
const derived = {};
|
|
218
|
+
const radius = vars["--radius"];
|
|
219
|
+
if (radius) {
|
|
220
|
+
derived["--radius-sm"] = `calc(${radius} * 0.5)`;
|
|
221
|
+
derived["--radius-md"] = radius;
|
|
222
|
+
derived["--radius-lg"] = `calc(${radius} * 4 / 3)`;
|
|
223
|
+
}
|
|
224
|
+
const primary = vars["--primary"];
|
|
225
|
+
if (primary && !declares(theme, "--primary-hover")) {
|
|
226
|
+
derived["--primary-hover"] = `color-mix(in srgb, ${primary} 90%, transparent)`;
|
|
227
|
+
}
|
|
228
|
+
if (primary && !declares(theme, "--link"))
|
|
229
|
+
derived["--link"] = primary;
|
|
230
|
+
const ring = vars["--ring"];
|
|
231
|
+
if (ring && !declares(theme, "--focus"))
|
|
232
|
+
derived["--focus"] = ring;
|
|
233
|
+
return { ...derived, ...vars };
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The CSS variables a theme applies at its scope in `mode`. Light mode: the
|
|
237
|
+
* theme's `vars`. Dark mode: its mode-invariant light vars plus its `darkVars`
|
|
238
|
+
* — never the other light vars, which would beat the toolkit's dark defaults
|
|
239
|
+
* (mcp-toolkit#178 N35). Both modes add what the legacy knobs derive (a base
|
|
240
|
+
* `--radius` → sm/md/lg; `--primary` → hover and link; `--ring` → focus)
|
|
241
|
+
* where the theme does not set those roles itself.
|
|
242
|
+
* `null`/`undefined` yields `{}` (the toolkit defaults apply).
|
|
243
|
+
*/
|
|
244
|
+
export function resolveThemeVars(theme, mode) {
|
|
245
|
+
if (!theme)
|
|
246
|
+
return {};
|
|
247
|
+
if (mode === "light")
|
|
248
|
+
return withDerivedVars(theme.vars, theme);
|
|
249
|
+
const carried = {};
|
|
250
|
+
for (const [name, value] of Object.entries(theme.vars)) {
|
|
251
|
+
if (MODE_INVARIANT_VARS.has(name))
|
|
252
|
+
carried[name] = value;
|
|
253
|
+
}
|
|
254
|
+
return withDerivedVars({ ...carried, ...theme.darkVars }, theme);
|
|
64
255
|
}
|
|
65
256
|
//# sourceMappingURL=create-theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-theme.js","sourceRoot":"","sources":["../../src/theme/create-theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-theme.js","sourceRoot":"","sources":["../../src/theme/create-theme.ts"],"names":[],"mappings":"AA0JA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,WAAW;IACpB,iBAAiB,EAAE,sBAAsB;IACzC,YAAY,EAAE,iBAAiB;IAC/B,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,UAAU;IAClB,gBAAgB,EAAE,qBAAqB;IACvC,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,cAAc;IAC1B,IAAI,EAAE,QAAQ;IACd,cAAc,EAAE,mBAAmB;IACnC,OAAO,EAAE,WAAW;IACpB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,oBAAoB;IACrC,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,eAAe;IAC5B,qBAAqB,EAAE,0BAA0B;IACjD,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,eAAe;IAC3B,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,eAAe;IAC3B,MAAM,EAAE,UAAU;IAClB,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,aAAa;IACvB,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9B,KAAyC,EACzC,IAAsB;IAEtB,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IACrB,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC/D,MAAM,OAAO,GAAc,EAAE,CAAA;IAC7B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAA2B,EAAE,CAAC;QACjF,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;IAC1D,CAAC;IACD,OAAO,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in Geist delivery by URL. The toolkit's font tokens name "Geist" and
|
|
3
|
+
* "Geist Mono" first but load no font: an app either imports
|
|
4
|
+
* `@miragon/mcp-toolkit-ui/fonts.css` (bundled by the build) or serves the
|
|
5
|
+
* woff2 files itself and declares them with {@link fontFaces}. The second path
|
|
6
|
+
* keeps MCP App views small — the files are fetched once and cached instead of
|
|
7
|
+
* inlined as base64 into every view; allow their origin in the view's CSP
|
|
8
|
+
* `resourceDomains`. Where the fonts never load, the host's font renders (if
|
|
9
|
+
* the host sends one, see `adoptHostFontVariables`), else the system stack.
|
|
10
|
+
*/
|
|
11
|
+
/** The latin variable woff2 files, as `@fontsource-variable/geist(-mono)` ship them. */
|
|
12
|
+
export declare const GEIST_FONT_FILES: {
|
|
13
|
+
readonly sans: "geist-latin-wght-normal.woff2";
|
|
14
|
+
readonly mono: "geist-mono-latin-wght-normal.woff2";
|
|
15
|
+
};
|
|
16
|
+
/** Options for {@link fontFaces}. */
|
|
17
|
+
export interface FontFacesOptions {
|
|
18
|
+
/** Where the woff2 files are served from, e.g. `https://mcp.example.com/fonts`. */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
/** File names under `baseUrl`. Defaults to {@link GEIST_FONT_FILES}. */
|
|
21
|
+
files?: {
|
|
22
|
+
sans?: string;
|
|
23
|
+
mono?: string;
|
|
24
|
+
};
|
|
25
|
+
/** `font-display` strategy. Default `"swap"`: text renders at once in the fallback. */
|
|
26
|
+
display?: "auto" | "block" | "swap" | "fallback" | "optional";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The `@font-face` rules for Geist and Geist Mono (latin, variable weight
|
|
30
|
+
* 100–900) served from `baseUrl`. Pure — inject the string where your app
|
|
31
|
+
* builds its document, e.g. `<style>{fontFaces({ baseUrl })}</style>`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* fontFaces({ baseUrl: "https://mcp.example.com/fonts" })
|
|
35
|
+
* // @font-face { font-family: "Geist"; … src: url("https://mcp.example.com/fonts/geist-latin-wght-normal.woff2") … }
|
|
36
|
+
*/
|
|
37
|
+
export declare function fontFaces({ baseUrl, files, display }: FontFacesOptions): string;
|
|
38
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/theme/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wFAAwF;AACxF,eAAO,MAAM,gBAAgB;;;CAGnB,CAAA;AAMV,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;CAC9D;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAgB,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAOxF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in Geist delivery by URL. The toolkit's font tokens name "Geist" and
|
|
3
|
+
* "Geist Mono" first but load no font: an app either imports
|
|
4
|
+
* `@miragon/mcp-toolkit-ui/fonts.css` (bundled by the build) or serves the
|
|
5
|
+
* woff2 files itself and declares them with {@link fontFaces}. The second path
|
|
6
|
+
* keeps MCP App views small — the files are fetched once and cached instead of
|
|
7
|
+
* inlined as base64 into every view; allow their origin in the view's CSP
|
|
8
|
+
* `resourceDomains`. Where the fonts never load, the host's font renders (if
|
|
9
|
+
* the host sends one, see `adoptHostFontVariables`), else the system stack.
|
|
10
|
+
*/
|
|
11
|
+
/** The latin variable woff2 files, as `@fontsource-variable/geist(-mono)` ship them. */
|
|
12
|
+
export const GEIST_FONT_FILES = {
|
|
13
|
+
sans: "geist-latin-wght-normal.woff2",
|
|
14
|
+
mono: "geist-mono-latin-wght-normal.woff2",
|
|
15
|
+
};
|
|
16
|
+
/** The latin subset both files cover (identical to fontsource's `latin` range). */
|
|
17
|
+
const LATIN_UNICODE_RANGE = "U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD";
|
|
18
|
+
/** Characters that could break out of the CSS `url("…")` the helper writes. */
|
|
19
|
+
const UNSAFE_URL_CHARS = /["'\\()\s<>]/;
|
|
20
|
+
function fontUrl(baseUrl, file) {
|
|
21
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/${file.replace(/^\/+/, "")}`;
|
|
22
|
+
if (UNSAFE_URL_CHARS.test(url)) {
|
|
23
|
+
throw new Error(`fontFaces: refusing a font URL with quote, bracket or whitespace: ${url}`);
|
|
24
|
+
}
|
|
25
|
+
return url;
|
|
26
|
+
}
|
|
27
|
+
function face(family, url, display) {
|
|
28
|
+
return [
|
|
29
|
+
"@font-face {",
|
|
30
|
+
` font-family: "${family}";`,
|
|
31
|
+
" font-style: normal;",
|
|
32
|
+
` font-display: ${display};`,
|
|
33
|
+
" font-weight: 100 900;",
|
|
34
|
+
` src: url("${url}") format("woff2");`,
|
|
35
|
+
` unicode-range: ${LATIN_UNICODE_RANGE};`,
|
|
36
|
+
"}",
|
|
37
|
+
].join("\n");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The `@font-face` rules for Geist and Geist Mono (latin, variable weight
|
|
41
|
+
* 100–900) served from `baseUrl`. Pure — inject the string where your app
|
|
42
|
+
* builds its document, e.g. `<style>{fontFaces({ baseUrl })}</style>`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* fontFaces({ baseUrl: "https://mcp.example.com/fonts" })
|
|
46
|
+
* // @font-face { font-family: "Geist"; … src: url("https://mcp.example.com/fonts/geist-latin-wght-normal.woff2") … }
|
|
47
|
+
*/
|
|
48
|
+
export function fontFaces({ baseUrl, files, display = "swap" }) {
|
|
49
|
+
const sans = files?.sans ?? GEIST_FONT_FILES.sans;
|
|
50
|
+
const mono = files?.mono ?? GEIST_FONT_FILES.mono;
|
|
51
|
+
return [
|
|
52
|
+
face("Geist", fontUrl(baseUrl, sans), display),
|
|
53
|
+
face("Geist Mono", fontUrl(baseUrl, mono), display),
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/theme/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,+BAA+B;IACrC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C,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The host's font, demoted to the fallback slot of the font roles.
|
|
3
|
+
*
|
|
4
|
+
* SEP-1865 hosts send their fonts as the style variables `--font-sans` and
|
|
5
|
+
* `--font-mono`, the same names as the toolkit's font roles. mcp-use writes
|
|
6
|
+
* them inline on `<html>`, where they beat the role stacks in `theme.css` and
|
|
7
|
+
* replace them whole, so Geist never renders even when it is loaded. The
|
|
8
|
+
* toolkit's rule is Geist first, the host's font next, the system stack last:
|
|
9
|
+
* {@link adoptHostFontVariables} moves the host's value to
|
|
10
|
+
* `--host-font-sans` / `--host-font-mono`, which the role stacks name right
|
|
11
|
+
* after Geist. `McpToolkitApp` runs it after every host-context update; an app
|
|
12
|
+
* with its own document layer calls it after it applied the host variables.
|
|
13
|
+
*/
|
|
14
|
+
/** Each host font variable (SEP-1865 name) → where the toolkit keeps it. */
|
|
15
|
+
export declare const HOST_FONT_VARIABLES: {
|
|
16
|
+
readonly "--font-sans": "--host-font-sans";
|
|
17
|
+
readonly "--font-mono": "--host-font-mono";
|
|
18
|
+
};
|
|
19
|
+
/** The slice of `CSSStyleDeclaration` the helper touches (`element.style`). */
|
|
20
|
+
export interface InlineStyleTarget {
|
|
21
|
+
getPropertyValue(property: string): string;
|
|
22
|
+
setProperty(property: string, value: string): void;
|
|
23
|
+
removeProperty(property: string): string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Move the host's font variables off the role names on `style` (normally
|
|
27
|
+
* `document.documentElement.style`, where the host variables were applied):
|
|
28
|
+
* each non-empty `--font-sans` / `--font-mono` in `hostVariables` is written
|
|
29
|
+
* to its {@link HOST_FONT_VARIABLES} slot, and the role is cleared when it
|
|
30
|
+
* still holds exactly the host's value — an app's own inline brand font
|
|
31
|
+
* stays. Idempotent; a no-op without host variables.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* applyHostStyleVariables(vars) // the host layer writes --font-sans on <html>
|
|
35
|
+
* adoptHostFontVariables(document.documentElement.style, vars)
|
|
36
|
+
* // --font-sans: "Geist", "Geist Variable", <host font>, system-ui, sans-serif
|
|
37
|
+
*/
|
|
38
|
+
export declare function adoptHostFontVariables(style: InlineStyleTarget, hostVariables: Readonly<Record<string, string | undefined>> | null | undefined): void;
|
|
39
|
+
//# sourceMappingURL=host-fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-fonts.d.ts","sourceRoot":"","sources":["../../src/theme/host-fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB;;;CAGtB,CAAA;AAEV,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1C,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAClD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAC7E,IAAI,CAQN"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The host's font, demoted to the fallback slot of the font roles.
|
|
3
|
+
*
|
|
4
|
+
* SEP-1865 hosts send their fonts as the style variables `--font-sans` and
|
|
5
|
+
* `--font-mono`, the same names as the toolkit's font roles. mcp-use writes
|
|
6
|
+
* them inline on `<html>`, where they beat the role stacks in `theme.css` and
|
|
7
|
+
* replace them whole, so Geist never renders even when it is loaded. The
|
|
8
|
+
* toolkit's rule is Geist first, the host's font next, the system stack last:
|
|
9
|
+
* {@link adoptHostFontVariables} moves the host's value to
|
|
10
|
+
* `--host-font-sans` / `--host-font-mono`, which the role stacks name right
|
|
11
|
+
* after Geist. `McpToolkitApp` runs it after every host-context update; an app
|
|
12
|
+
* with its own document layer calls it after it applied the host variables.
|
|
13
|
+
*/
|
|
14
|
+
/** Each host font variable (SEP-1865 name) → where the toolkit keeps it. */
|
|
15
|
+
export const HOST_FONT_VARIABLES = {
|
|
16
|
+
"--font-sans": "--host-font-sans",
|
|
17
|
+
"--font-mono": "--host-font-mono",
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Move the host's font variables off the role names on `style` (normally
|
|
21
|
+
* `document.documentElement.style`, where the host variables were applied):
|
|
22
|
+
* each non-empty `--font-sans` / `--font-mono` in `hostVariables` is written
|
|
23
|
+
* to its {@link HOST_FONT_VARIABLES} slot, and the role is cleared when it
|
|
24
|
+
* still holds exactly the host's value — an app's own inline brand font
|
|
25
|
+
* stays. Idempotent; a no-op without host variables.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* applyHostStyleVariables(vars) // the host layer writes --font-sans on <html>
|
|
29
|
+
* adoptHostFontVariables(document.documentElement.style, vars)
|
|
30
|
+
* // --font-sans: "Geist", "Geist Variable", <host font>, system-ui, sans-serif
|
|
31
|
+
*/
|
|
32
|
+
export function adoptHostFontVariables(style, hostVariables) {
|
|
33
|
+
if (!hostVariables)
|
|
34
|
+
return;
|
|
35
|
+
for (const [role, slot] of Object.entries(HOST_FONT_VARIABLES)) {
|
|
36
|
+
const value = hostVariables[role]?.trim();
|
|
37
|
+
if (!value)
|
|
38
|
+
continue;
|
|
39
|
+
style.setProperty(slot, value);
|
|
40
|
+
if (style.getPropertyValue(role).trim() === value)
|
|
41
|
+
style.removeProperty(role);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=host-fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-fonts.js","sourceRoot":"","sources":["../../src/theme/host-fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,aAAa,EAAE,kBAAkB;IACjC,aAAa,EAAE,kBAAkB;CACzB,CAAA;AASV;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAwB,EACxB,aAA8E;IAE9E,IAAI,CAAC,aAAa;QAAE,OAAM;IAC1B,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC/D,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAA;QACzC,IAAI,CAAC,KAAK;YAAE,SAAQ;QACpB,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC9B,IAAI,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK;YAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC/E,CAAC;AACH,CAAC"}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
export { createTheme, tokensToVars, TOKEN_TO_CSS_VAR } from "./create-theme.js";
|
|
1
|
+
export { createTheme, tokensToVars, resolveThemeVars, TOKEN_TO_CSS_VAR, ROLE_TOKENS, MODE_INVARIANT_VARS, } from "./create-theme.js";
|
|
2
2
|
export type { ThemeTokens, ThemeDefinition, ThemeVars, CreateThemeOptions } from "./create-theme.js";
|
|
3
3
|
export { ThemeProvider, useTheme } from "./theme-provider.js";
|
|
4
4
|
export type { ThemeMode, ThemeContextValue, ThemeProviderProps } from "./theme-provider.js";
|
|
5
|
+
export { usePortalContainer } from "./portal-container.js";
|
|
5
6
|
export { themePresets } from "./presets.js";
|
|
6
7
|
export type { ThemePresetId } from "./presets.js";
|
|
8
|
+
export { CD_TOKENS, CD_TOKENS_VERSION } from "./cd-tokens.js";
|
|
9
|
+
export type { CdTokenName } from "./cd-tokens.js";
|
|
10
|
+
export { fontFaces, GEIST_FONT_FILES } from "./fonts.js";
|
|
11
|
+
export type { FontFacesOptions } from "./fonts.js";
|
|
12
|
+
export { adoptHostFontVariables, HOST_FONT_VARIABLES } from "./host-fonts.js";
|
|
13
|
+
export type { InlineStyleTarget } from "./host-fonts.js";
|
|
7
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACpG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC7D,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/theme/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// White-label theming. Browser-safe (React + DOM only, no `mcp-use/react`), so
|
|
2
2
|
// it is re-exported from the root barrel — a consumer can theme the toolkit's
|
|
3
3
|
// primitives without pulling in the host runtime.
|
|
4
|
-
export { createTheme, tokensToVars, TOKEN_TO_CSS_VAR } from "./create-theme.js";
|
|
4
|
+
export { createTheme, tokensToVars, resolveThemeVars, TOKEN_TO_CSS_VAR, ROLE_TOKENS, MODE_INVARIANT_VARS, } from "./create-theme.js";
|
|
5
5
|
export { ThemeProvider, useTheme } from "./theme-provider.js";
|
|
6
|
+
export { usePortalContainer } from "./portal-container.js";
|
|
6
7
|
export { themePresets } from "./presets.js";
|
|
8
|
+
export { CD_TOKENS, CD_TOKENS_VERSION } from "./cd-tokens.js";
|
|
9
|
+
export { fontFaces, GEIST_FONT_FILES } from "./fonts.js";
|
|
10
|
+
export { adoptHostFontVariables, HOST_FONT_VARIABLES } from "./host-fonts.js";
|
|
7
11
|
//# sourceMappingURL=index.js.map
|
package/dist/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,kDAAkD;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,kDAAkD;AAClD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAExD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The element portaled overlays (Dialog, Sheet, Select) render into. A
|
|
3
|
+
* {@link ThemeProvider} provides a node INSIDE its scope, so overlays opened
|
|
4
|
+
* from a themed subtree keep the theme's variables and its light/dark mode
|
|
5
|
+
* instead of falling back to `document.body` and the `:root` defaults
|
|
6
|
+
* (mcp-toolkit#178 N36). `null` — no provider, or before it mounted — means
|
|
7
|
+
* the overlay library's default (`document.body`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const PortalContainerContext: import("react").Context<HTMLElement | null>;
|
|
10
|
+
/**
|
|
11
|
+
* The portal container of the nearest {@link ThemeProvider}, or `null`. Pass it
|
|
12
|
+
* as `container` to a portal of your own so it stays inside the theme scope;
|
|
13
|
+
* the toolkit's Dialog, Sheet and Select already do.
|
|
14
|
+
*/
|
|
15
|
+
export declare function usePortalContainer(): HTMLElement | null;
|
|
16
|
+
//# sourceMappingURL=portal-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-container.d.ts","sourceRoot":"","sources":["../../src/theme/portal-container.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,6CAA0C,CAAA;AAE7E;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The element portaled overlays (Dialog, Sheet, Select) render into. A
|
|
4
|
+
* {@link ThemeProvider} provides a node INSIDE its scope, so overlays opened
|
|
5
|
+
* from a themed subtree keep the theme's variables and its light/dark mode
|
|
6
|
+
* instead of falling back to `document.body` and the `:root` defaults
|
|
7
|
+
* (mcp-toolkit#178 N36). `null` — no provider, or before it mounted — means
|
|
8
|
+
* the overlay library's default (`document.body`).
|
|
9
|
+
*/
|
|
10
|
+
export const PortalContainerContext = createContext(null);
|
|
11
|
+
/**
|
|
12
|
+
* The portal container of the nearest {@link ThemeProvider}, or `null`. Pass it
|
|
13
|
+
* as `container` to a portal of your own so it stays inside the theme scope;
|
|
14
|
+
* the toolkit's Dialog, Sheet and Select already do.
|
|
15
|
+
*/
|
|
16
|
+
export function usePortalContainer() {
|
|
17
|
+
return useContext(PortalContainerContext);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=portal-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-container.js","sourceRoot":"","sources":["../../src/theme/portal-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAE7E;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAC3C,CAAC"}
|
package/dist/theme/presets.d.ts
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
import { type ThemeDefinition } from "./create-theme.js";
|
|
2
2
|
/**
|
|
3
3
|
* Ready-made white-label themes — a demonstration of {@link createTheme} and a
|
|
4
|
-
* starting point a client can fork. Each preset sets
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
4
|
+
* starting point a client can fork. Each preset sets its whole interactive
|
|
5
|
+
* family from one brand hue, in light AND dark: `primary` with its
|
|
6
|
+
* `primaryForeground` and `primaryHover`, `link`, `focus` (plus the legacy
|
|
7
|
+
* `ring`), a matching `accent`, and a `radius`. The dark side brightens the
|
|
8
|
+
* brand colour for legibility on dark surfaces. Every preset meets the same
|
|
9
|
+
* contrast bar as the default theme in both modes (`theme-css.test.ts`).
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
+
* The toolkit's DEFAULT is the Miragon theme (theme.css, built on the vendored
|
|
12
|
+
* corporate-design tokens); it needs no preset. A full customer brand may set
|
|
13
|
+
* more roles than these presets do (the status `*Ink` colours); see
|
|
14
|
+
* docs/guides/white-labeling.md. Apply one with
|
|
15
|
+
* `<ThemeProvider theme={themePresets.emerald}>`.
|
|
11
16
|
*/
|
|
12
17
|
export declare const themePresets: {
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
19
|
+
* An approximation of the Miragon blue from before the toolkit shipped the
|
|
20
|
+
* Miragon corporate design.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated The Miragon theme is now the toolkit's default: render without
|
|
23
|
+
* a theme (or `<ThemeProvider>` without `theme`) to get the exact CI values.
|
|
24
|
+
* This preset is off-palette and will be removed in the next major.
|
|
16
25
|
*/
|
|
17
26
|
miragon: ThemeDefinition;
|
|
18
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A vivid violet brand with rounder corners — playful, consumer-facing.
|
|
29
|
+
*
|
|
30
|
+
* @deprecated The violet tech default is the look the Miragon design system
|
|
31
|
+
* rules out (anti-slop U9). Fork {@link createTheme} with your own brand
|
|
32
|
+
* values instead. Will be removed in the next major.
|
|
33
|
+
*/
|
|
19
34
|
violet: ThemeDefinition;
|
|
20
35
|
/** A grounded emerald brand with a crisp, near-square radius — enterprise. */
|
|
21
36
|
emerald: ThemeDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/theme/presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAErE
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/theme/presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAErE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY;IACvB;;;;;;;OAOG;;IA2BH;;;;;;OAMG;;IA2BH,8EAA8E;;CA0BrC,CAAA;AAE3C,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,YAAY,CAAA"}
|