@makinbakin/sdk 0.0.1-rc.4 → 0.0.1-rc.40
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 +248 -3
- package/_internal/app/components/agent-avatar.d.ts +2 -1
- package/_internal/app/components/conversation/attention.d.ts +56 -0
- package/_internal/app/components/conversation/fold.d.ts +3 -0
- package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
- package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
- package/_internal/app/components/conversation/thread-id.d.ts +8 -0
- package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
- package/_internal/app/components/conversation/use-conversation-attention.d.ts +61 -0
- package/_internal/app/components/drawer.d.ts +27 -0
- package/_internal/app/components/ui/button.d.ts +2 -8
- package/_internal/app/components/ui/dialog.d.ts +2 -17
- package/_internal/app/components/ui/sheet.d.ts +2 -14
- package/_internal/app/core/conversation-turns.d.ts +229 -0
- package/_internal/app/core/logger.d.ts +1 -0
- package/_internal/app/core/tool-access.d.ts +42 -0
- package/_internal/app/hooks/use-available-models.d.ts +25 -0
- package/_internal/app/hooks/use-content-store.d.ts +0 -9
- package/_internal/app/hooks/use-history-back.d.ts +5 -0
- package/_internal/app/hooks/use-horizontal-resize.d.ts +21 -0
- package/_internal/app/hooks/use-json-fetch.d.ts +36 -0
- package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
- package/_internal/app/hooks/use-plugin-event.d.ts +19 -0
- package/_internal/app/hooks/use-query-state.d.ts +3 -12
- package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
- package/_internal/app/hooks/use-runtime-status.d.ts +22 -6
- package/_internal/app/hooks/use-schedule.d.ts +47 -1
- package/_internal/app/hooks/use-search.d.ts +27 -8
- package/_internal/app/hooks/use-task-run-history.d.ts +26 -0
- package/_internal/app/hooks/use-toast.d.ts +13 -3
- package/_internal/app/lib/browser-notify.d.ts +12 -1
- package/_internal/app/types/index.d.ts +1 -105
- package/_internal/core/adapters/runtime/channels.d.ts +231 -0
- package/_internal/core/adapters/runtime/concepts.d.ts +794 -235
- package/_internal/core/adapters/runtime/errors.d.ts +105 -0
- package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
- package/_internal/core/adapters/runtime/index.d.ts +8 -2
- package/_internal/core/adapters/runtime/skill-files.d.ts +12 -0
- package/_internal/core/adapters/runtime/testing.d.ts +99 -0
- package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
- package/_internal/core/adapters/shared.d.ts +133 -12
- package/_internal/core/content-dir.d.ts +11 -0
- package/_internal/core/delivery/bridge.d.ts +36 -0
- package/_internal/core/docs/route.d.ts +1 -1
- package/_internal/core/format/structured.d.ts +44 -0
- package/_internal/core/format.d.ts +25 -1
- package/_internal/core/health/observation-builders.d.ts +42 -0
- package/_internal/core/media/downscale.d.ts +18 -0
- package/_internal/core/media/pin-data.d.ts +36 -0
- package/_internal/core/media/pin.d.ts +22 -0
- package/_internal/core/media/sharp-import.d.ts +10 -0
- package/_internal/core/media/sharp-loader.d.ts +41 -0
- package/_internal/core/media/store.d.ts +21 -0
- package/_internal/core/plugin-types.d.ts +248 -500
- package/_internal/core/routing/define.d.ts +33 -3
- package/_internal/core/routing/dispatcher.d.ts +15 -6
- package/_internal/core/routing/index.d.ts +1 -1
- package/_internal/core/routing/types.d.ts +13 -70
- package/_internal/core/storage/atomic-write.d.ts +11 -0
- package/_internal/core/tasks/store.d.ts +129 -0
- package/_internal/core/tasks/testing.d.ts +2 -0
- package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
- package/_internal/host/ui/action-status.d.ts +13 -0
- package/_internal/host/ui/modals.d.ts +5 -0
- package/_internal/host/ui/resize.d.ts +2 -0
- package/_internal/plugins/team/types.d.ts +61 -4
- package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
- package/_internal/ui/behaviors/clipboard.d.ts +10 -0
- package/_internal/ui/behaviors/resize-handle.d.ts +15 -0
- package/_internal/ui/behaviors/selection-navigation.d.ts +5 -0
- package/_internal/ui/behaviors/use-persisted-leading-edge-resize.d.ts +31 -0
- package/_internal/ui/charts/area-chart.d.ts +27 -0
- package/_internal/ui/charts/axis.d.ts +13 -0
- package/_internal/ui/charts/bar-chart.d.ts +21 -0
- package/_internal/ui/charts/chart-data-table.d.ts +61 -0
- package/_internal/ui/charts/chart-explainer.d.ts +4 -0
- package/_internal/ui/charts/chart-tooltip.d.ts +8 -0
- package/_internal/ui/charts/composition-bar.d.ts +46 -0
- package/_internal/ui/charts/index.d.ts +24 -0
- package/_internal/ui/charts/line-chart.d.ts +26 -0
- package/_internal/ui/charts/monotone-curve.d.ts +23 -0
- package/_internal/ui/charts/palette.d.ts +32 -0
- package/_internal/ui/charts/pie-chart.d.ts +80 -0
- package/_internal/ui/charts/ranked-bar-chart.d.ts +41 -0
- package/_internal/ui/charts/sparkline.d.ts +16 -0
- package/_internal/ui/charts/stacked-column-chart.d.ts +33 -0
- package/_internal/ui/content/code-block.d.ts +43 -0
- package/_internal/ui/content/index.d.ts +2 -0
- package/_internal/ui/conversation/activity-group.d.ts +27 -0
- package/_internal/ui/conversation/agent-turn.d.ts +47 -0
- package/_internal/ui/conversation/composer.d.ts +62 -0
- package/_internal/ui/conversation/context-meter.d.ts +37 -0
- package/_internal/ui/conversation/conversation-empty-state.d.ts +13 -0
- package/_internal/ui/conversation/conversation-header.d.ts +26 -0
- package/_internal/ui/conversation/conversation-panel.d.ts +61 -0
- package/_internal/ui/conversation/conversation.d.ts +37 -0
- package/_internal/ui/conversation/fold.d.ts +150 -0
- package/_internal/ui/conversation/glyphs.d.ts +30 -0
- package/_internal/ui/conversation/index.d.ts +31 -0
- package/_internal/ui/conversation/queued-message-list.d.ts +22 -0
- package/_internal/ui/conversation/relative-time.d.ts +8 -0
- package/_internal/ui/conversation/tool-call-drawer.d.ts +14 -0
- package/_internal/ui/conversation/turn-controls.d.ts +9 -0
- package/_internal/ui/conversation/turn-output.d.ts +42 -0
- package/_internal/ui/conversation/turn-usage.d.ts +16 -0
- package/_internal/ui/conversation/user-message.d.ts +13 -0
- package/_internal/ui/forms/field.d.ts +30 -0
- package/_internal/ui/forms/fieldset.d.ts +10 -0
- package/_internal/ui/forms/form.d.ts +19 -0
- package/_internal/ui/forms/index.d.ts +6 -0
- package/_internal/ui/index.d.ts +89 -0
- package/_internal/ui/layout/bounded-overflow.d.ts +42 -0
- package/_internal/ui/layout/disclosure-panel.d.ts +24 -0
- package/_internal/ui/layout/flow.d.ts +27 -0
- package/_internal/ui/layout/grid.d.ts +16 -0
- package/_internal/ui/layout/index.d.ts +14 -0
- package/_internal/ui/layout/page-shell.d.ts +11 -0
- package/_internal/ui/layout/panel.d.ts +28 -0
- package/_internal/ui/layout/section.d.ts +15 -0
- package/_internal/ui/layout/sticky-overflow-scrollbar.d.ts +11 -0
- package/_internal/ui/layout/utils.d.ts +1 -0
- package/_internal/ui/patterns/agent-filter.d.ts +21 -0
- package/_internal/ui/patterns/calendar-grid.d.ts +80 -0
- package/_internal/ui/patterns/calendar-item.d.ts +42 -0
- package/_internal/ui/patterns/calendar-nav.d.ts +21 -0
- package/_internal/ui/patterns/confirm-dialog.d.ts +29 -0
- package/_internal/ui/patterns/copy-button.d.ts +15 -0
- package/_internal/ui/patterns/danger-zone.d.ts +17 -0
- package/_internal/ui/patterns/data-table.d.ts +157 -0
- package/_internal/ui/patterns/drawer-section.d.ts +11 -0
- package/_internal/ui/patterns/facet-filter.d.ts +22 -0
- package/_internal/ui/patterns/filter-indicator.d.ts +3 -0
- package/_internal/ui/patterns/guide-card.d.ts +33 -0
- package/_internal/ui/patterns/index.d.ts +75 -0
- package/_internal/ui/patterns/inspector-panel.d.ts +39 -0
- package/_internal/ui/patterns/kanban.d.ts +70 -0
- package/_internal/ui/patterns/key-value.d.ts +35 -0
- package/_internal/ui/patterns/list-rows.d.ts +111 -0
- package/_internal/ui/patterns/nav-list.d.ts +41 -0
- package/_internal/ui/patterns/node-card.d.ts +37 -0
- package/_internal/ui/patterns/page-aside.d.ts +49 -0
- package/_internal/ui/patterns/page-body.d.ts +49 -0
- package/_internal/ui/patterns/page-canvas.d.ts +12 -0
- package/_internal/ui/patterns/page-composer.d.ts +8 -0
- package/_internal/ui/patterns/page-controls.d.ts +33 -0
- package/_internal/ui/patterns/page-header.d.ts +40 -0
- package/_internal/ui/patterns/page-timeline.d.ts +18 -0
- package/_internal/ui/patterns/page.d.ts +32 -0
- package/_internal/ui/patterns/pagination.d.ts +23 -0
- package/_internal/ui/patterns/save-bar.d.ts +21 -0
- package/_internal/ui/patterns/search-input.d.ts +20 -0
- package/_internal/ui/patterns/segmented-control.d.ts +22 -0
- package/_internal/ui/patterns/sortable-head.d.ts +13 -0
- package/_internal/ui/patterns/stat-group.d.ts +8 -0
- package/_internal/ui/patterns/stat-tile.d.ts +25 -0
- package/_internal/ui/patterns/status-badge.d.ts +15 -0
- package/_internal/ui/patterns/status-marker.d.ts +10 -0
- package/_internal/ui/patterns/timeline.d.ts +59 -0
- package/_internal/ui/patterns/unsaved-changes-dialog.d.ts +22 -0
- package/_internal/ui/patterns/workspace-page.d.ts +76 -0
- package/_internal/ui/primitives/alert.d.ts +17 -0
- package/_internal/ui/primitives/avatar.d.ts +13 -0
- package/_internal/ui/primitives/badge.d.ts +27 -0
- package/_internal/ui/primitives/button.d.ts +32 -0
- package/_internal/ui/primitives/card.d.ts +55 -0
- package/_internal/ui/primitives/checkbox.d.ts +3 -0
- package/_internal/ui/primitives/collapsible.d.ts +7 -0
- package/_internal/ui/primitives/color-input.d.ts +21 -0
- package/_internal/ui/primitives/combobox.d.ts +40 -0
- package/_internal/ui/primitives/command.d.ts +36 -0
- package/_internal/ui/primitives/control-styles.d.ts +10 -0
- package/_internal/ui/primitives/dialog.d.ts +31 -0
- package/_internal/ui/primitives/dropdown-menu.d.ts +54 -0
- package/_internal/ui/primitives/file-input.d.ts +33 -0
- package/_internal/ui/primitives/input-group.d.ts +30 -0
- package/_internal/ui/primitives/input.d.ts +10 -0
- package/_internal/ui/primitives/interactive-surface.d.ts +24 -0
- package/_internal/ui/primitives/label.d.ts +3 -0
- package/_internal/ui/primitives/modal-context.d.ts +9 -0
- package/_internal/ui/primitives/option-list.d.ts +10 -0
- package/_internal/ui/primitives/popover.d.ts +18 -0
- package/_internal/ui/primitives/portal-ownership.d.ts +11 -0
- package/_internal/ui/primitives/progress.d.ts +38 -0
- package/_internal/ui/primitives/radio-group.d.ts +12 -0
- package/_internal/ui/primitives/select.d.ts +35 -0
- package/_internal/ui/primitives/separator.d.ts +7 -0
- package/_internal/ui/primitives/sheet.d.ts +34 -0
- package/_internal/ui/primitives/shimmer-text.d.ts +13 -0
- package/_internal/ui/primitives/skeleton.d.ts +6 -0
- package/_internal/ui/primitives/spinner.d.ts +31 -0
- package/_internal/ui/primitives/switch.d.ts +6 -0
- package/_internal/{app/components/ui → ui/primitives}/tabs.d.ts +1 -1
- package/_internal/ui/primitives/text.d.ts +43 -0
- package/_internal/ui/primitives/textarea.d.ts +19 -0
- package/_internal/ui/primitives/tooltip.d.ts +14 -0
- package/_internal/ui/primitives/use-textarea-autosize.d.ts +3 -0
- package/_internal/ui/private-ui-boundary-probe.d.ts +9 -0
- package/_internal/ui/states/banner.d.ts +15 -0
- package/_internal/ui/states/index.d.ts +6 -0
- package/_internal/ui/states/system-state.d.ts +88 -0
- package/_internal/ui/states/toast.d.ts +26 -0
- package/_internal/ui/utils.d.ts +14 -0
- package/bin/bakin-plugin-test-ui.js +6854 -0
- package/charts/index.d.ts +3 -0
- package/charts/index.js +2 -0
- package/content/index.d.ts +14 -0
- package/content/index.js +38 -0
- package/content/markdown-comparison.d.ts +12 -0
- package/content/markdown-content.d.ts +18 -0
- package/content/markdown-document.d.ts +4 -0
- package/content/markdown-editor.d.ts +35 -0
- package/conversation/index.d.ts +50 -0
- package/conversation/index.js +4 -0
- package/conversation/use-conversation-thread.d.ts +73 -0
- package/hooks/index.d.ts +86 -11
- package/hooks/index.js +1 -1747
- package/hooks/router.d.ts +4 -36
- package/index.d.ts +30 -6
- package/index.js +10 -14210
- package/internal/index.d.ts +74 -0
- package/internal/index.js +2 -0
- package/internal/lazy.d.ts +58 -0
- package/internal/plugin-ownership.d.ts +18 -0
- package/internal/private-ui-boundary-probe.d.ts +2 -0
- package/layout/index.d.ts +9 -0
- package/layout/index.js +2 -0
- package/metadata/index.d.ts +14 -1
- package/metadata/index.js +1 -30
- package/navigation/history-back.d.ts +5 -0
- package/navigation/index.d.ts +23 -0
- package/navigation/index.js +2 -0
- package/navigation/plugin-link.d.ts +11 -0
- package/navigation/query-state.d.ts +7 -0
- package/navigation/router.d.ts +35 -0
- package/navigation/search-params.d.ts +7 -0
- package/navigation/unsaved-changes-guard.d.ts +35 -0
- package/package.json +63 -10
- package/patterns/agent-patterns.d.ts +81 -0
- package/patterns/asset-library-picker.d.ts +38 -0
- package/patterns/channel-patterns.d.ts +32 -0
- package/patterns/index.d.ts +40 -0
- package/patterns/index.js +47 -0
- package/patterns/picker-patterns.d.ts +108 -0
- package/patterns/plugin-settings-renderer.d.ts +41 -0
- package/patterns/presentation-color.d.ts +2 -0
- package/patterns/search-patterns.d.ts +51 -0
- package/register.d.ts +63 -9
- package/routing/index.d.ts +6 -1
- package/routing/index.js +10 -14014
- package/slots/index.d.ts +12 -24
- package/slots/index.js +1 -91
- package/slots/registry.d.ts +45 -0
- package/styles.css +2 -0
- package/testing/index.d.ts +122 -0
- package/testing/index.js +93 -0
- package/testing/ui/conformance/cli.d.ts +2 -0
- package/testing/ui/conformance/contracts.d.ts +73 -0
- package/testing/ui/conformance/index.d.ts +11 -0
- package/testing/ui/conformance/index.js +85 -0
- package/testing/ui/conformance/plugin-css.d.ts +37 -0
- package/testing/ui/conformance/plugin-id.d.ts +6 -0
- package/testing/ui/conformance/runner.d.ts +13 -0
- package/testing/ui/index.d.ts +24 -0
- package/testing/ui/index.js +2 -0
- package/testing/ui/plugin-ui-fixture-host.d.ts +36 -0
- package/testing/ui/runtime.d.ts +70 -0
- package/types/api-route.d.ts +89 -0
- package/types/context.d.ts +166 -0
- package/types/conversation-turns.d.ts +229 -0
- package/types/events.d.ts +10 -0
- package/types/health.d.ts +376 -0
- package/types/index.d.ts +19 -919
- package/types/index.js +1 -0
- package/types/manifest.d.ts +255 -0
- package/types/primitives.d.ts +33 -0
- package/types/registration.d.ts +281 -0
- package/types/runtime.d.ts +292 -0
- package/types/scheduled-events.d.ts +80 -0
- package/types/services.d.ts +599 -0
- package/ui/index.d.ts +73 -31
- package/ui/index.js +38 -28704
- package/utils/asset-id.d.ts +15 -0
- package/utils/index.d.ts +27 -7
- package/utils/index.js +4 -2098
- package/utils/plugin-fetch.d.ts +44 -0
- package/_internal/app/components/agent-filter.d.ts +0 -8
- package/_internal/app/components/agent-select.d.ts +0 -15
- package/_internal/app/components/agent-status.d.ts +0 -8
- package/_internal/app/components/bakin-drawer.d.ts +0 -23
- package/_internal/app/components/color-picker.d.ts +0 -7
- package/_internal/app/components/empty-state.d.ts +0 -10
- package/_internal/app/components/error-banner.d.ts +0 -6
- package/_internal/app/components/error-state.d.ts +0 -8
- package/_internal/app/components/facet-filter.d.ts +0 -17
- package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
- package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
- package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
- package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
- package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
- package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
- package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
- package/_internal/app/components/markdown-content.d.ts +0 -3
- package/_internal/app/components/markdown-editor.d.ts +0 -11
- package/_internal/app/components/model-select.d.ts +0 -9
- package/_internal/app/components/page-layout.d.ts +0 -9
- package/_internal/app/components/plugin-header.d.ts +0 -16
- package/_internal/app/components/plugin-settings-renderer.d.ts +0 -9
- package/_internal/app/components/sortable-head.d.ts +0 -13
- package/_internal/app/components/ui/alert.d.ts +0 -10
- package/_internal/app/components/ui/avatar.d.ts +0 -11
- package/_internal/app/components/ui/badge.d.ts +0 -7
- package/_internal/app/components/ui/card.d.ts +0 -11
- package/_internal/app/components/ui/checkbox.d.ts +0 -3
- package/_internal/app/components/ui/collapsible.d.ts +0 -5
- package/_internal/app/components/ui/command.d.ts +0 -19
- package/_internal/app/components/ui/dropdown-menu.d.ts +0 -29
- package/_internal/app/components/ui/form.d.ts +0 -23
- package/_internal/app/components/ui/input-group.d.ts +0 -18
- package/_internal/app/components/ui/input.d.ts +0 -3
- package/_internal/app/components/ui/label.d.ts +0 -3
- package/_internal/app/components/ui/popover.d.ts +0 -9
- package/_internal/app/components/ui/progress.d.ts +0 -7
- package/_internal/app/components/ui/select.d.ts +0 -15
- package/_internal/app/components/ui/separator.d.ts +0 -3
- package/_internal/app/components/ui/skeleton.d.ts +0 -2
- package/_internal/app/components/ui/switch.d.ts +0 -5
- package/_internal/app/components/ui/textarea.d.ts +0 -3
- package/_internal/app/components/ui/tooltip.d.ts +0 -6
- package/_internal/app/components/underline-tabs.d.ts +0 -15
- package/_internal/app/hooks/use-assets.d.ts +0 -25
- package/_internal/app/hooks/use-form-guard.d.ts +0 -5
- package/_internal/app/hooks/use-vertical-resize.d.ts +0 -22
- package/_internal/app/lib/utils.d.ts +0 -2
- package/_internal/plugins/workflows/hooks/channel-icon.d.ts +0 -6
- package/components/index.d.ts +0 -34
- package/components/index.js +0 -40175
- /package/_internal/{app/components/ui → ui/primitives}/table.d.ts +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ChartDatum {
|
|
3
|
+
/** Stable x-axis key. */
|
|
4
|
+
x: string;
|
|
5
|
+
/** Human-readable x-axis label; defaults to `x`. */
|
|
6
|
+
xLabel?: string;
|
|
7
|
+
/** Finite values keyed by `ChartSeries.key`. Omit a key when it is unknown. */
|
|
8
|
+
values: Record<string, number>;
|
|
9
|
+
/** Per-series labels for intentionally absent cells. */
|
|
10
|
+
missingLabels?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface ChartSeries {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
/** CSS color. Defaults to the matching fixed categorical token. */
|
|
16
|
+
color?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Everything the default exact table renders from, handed to `renderTable`. */
|
|
19
|
+
export interface ChartDataTableRenderContext {
|
|
20
|
+
caption: string;
|
|
21
|
+
data: readonly ChartDatum[];
|
|
22
|
+
series: readonly ChartSeries[];
|
|
23
|
+
formatValue: (value: number) => ReactNode;
|
|
24
|
+
missingValue: ReactNode;
|
|
25
|
+
emptyLabel: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export interface ChartDataTableProps {
|
|
28
|
+
data: readonly ChartDatum[];
|
|
29
|
+
series: readonly ChartSeries[];
|
|
30
|
+
/** Accessible table name and visible disclosure label. */
|
|
31
|
+
caption: string;
|
|
32
|
+
formatValue?: (value: number) => ReactNode;
|
|
33
|
+
/** Rendered when a series has no finite value; defaults to “Not reported”. */
|
|
34
|
+
missingValue?: ReactNode;
|
|
35
|
+
/** Rendered across the table body when there are no rows. */
|
|
36
|
+
emptyLabel?: ReactNode;
|
|
37
|
+
/** Starts the exact-data disclosure open. */
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When false, renders the table statically with no disclosure chrome —
|
|
41
|
+
* always visible, no collapse affordance. `defaultOpen` is ignored.
|
|
42
|
+
*/
|
|
43
|
+
expandable?: boolean;
|
|
44
|
+
/** Visually hide the exact table when the owning visual is intentionally compact. */
|
|
45
|
+
visuallyHidden?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Escape hatch: replaces the table region's markup when the default
|
|
48
|
+
* label-plus-series grid cannot express the dataset (derived columns, row
|
|
49
|
+
* ordering, per-row structure). The disclosure chrome, the `View {caption}`
|
|
50
|
+
* summary, and the keyboard-reachable overflow region stay kit-owned; the
|
|
51
|
+
* returned markup MUST render a table (or equivalent structure) named by
|
|
52
|
+
* `context.caption` and must not turn absent values into zeros.
|
|
53
|
+
*/
|
|
54
|
+
renderTable?: (context: ChartDataTableRenderContext) => ReactNode;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Compatibility name retained for chart implementations migrating in T33b. */
|
|
58
|
+
export declare const CHART_TOKEN_COLORS: readonly ["var(--bakin-color-data-series-1)", "var(--bakin-color-data-series-2)", "var(--bakin-color-data-series-3)", "var(--bakin-color-data-series-4)", "var(--bakin-color-data-series-5)", "var(--bakin-color-data-series-6)", "var(--bakin-color-data-series-7)", "var(--bakin-color-data-series-8)"];
|
|
59
|
+
export declare function chartSeriesColor(series: ChartSeries, index: number): string;
|
|
60
|
+
/** Exact values for visual charts, either disclosed visibly or retained for compact summaries. */
|
|
61
|
+
export declare function ChartDataTable({ data, series, caption, formatValue, missingValue, emptyLabel, defaultOpen, expandable, visuallyHidden, renderTable, className, }: ChartDataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type ChartExplainerProps = ComponentPropsWithoutRef<'p'>;
|
|
3
|
+
/** Plain-language context for what a chart means and when a user should act. */
|
|
4
|
+
export declare function ChartExplainer({ children, className, ...props }: ChartExplainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ChartTooltipProps {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
xPercent: number;
|
|
5
|
+
yPercent: number;
|
|
6
|
+
}
|
|
7
|
+
/** Shared non-animated tooltip used identically by pointer and keyboard focus. */
|
|
8
|
+
export declare function ChartTooltip({ id, text, xPercent, yPercent }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ChartTone } from './palette';
|
|
2
|
+
export interface CompositionBarSegment {
|
|
3
|
+
/** Stable entity key; palette slots are assigned against the sorted full key set. */
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Non-negative share of the whole. Non-finite or negative values count as zero. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** CSS color. Defaults to the fixed categorical slot for `key`. */
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CompositionBarProps {
|
|
12
|
+
data: readonly CompositionBarSegment[];
|
|
13
|
+
/** Accessible name for the strip and basis for its legend name. */
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* `inline` fits inside a metric row; `default` leaves room for the legend;
|
|
17
|
+
* `large` is the tall strip for a headline part-to-whole — each segment
|
|
18
|
+
* carries its label and value inside it (clipped when the segment is too
|
|
19
|
+
* narrow; the legend and the accessible summary always carry them all).
|
|
20
|
+
*/
|
|
21
|
+
size?: 'inline' | 'default' | 'large';
|
|
22
|
+
/**
|
|
23
|
+
* List legend with exact values below the strip. Defaults to true at size
|
|
24
|
+
* `default`; forced off at size `inline`, where the accessible summary
|
|
25
|
+
* carries the exact values instead.
|
|
26
|
+
*/
|
|
27
|
+
legend?: boolean;
|
|
28
|
+
formatValue?: (value: number) => string;
|
|
29
|
+
/** Accessible description when `data` is empty. */
|
|
30
|
+
emptyLabel?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Opt-in status mode for outcome strips: maps segment key → tone, and every
|
|
33
|
+
* segment wears the validated status chart-fill step for its tone (a tone
|
|
34
|
+
* entry outranks the segment's `color`; an unmapped segment falls back
|
|
35
|
+
* explicitly to its `color`, then `neutral` — never a categorical slot).
|
|
36
|
+
* Omit for categorical strips; behavior without `tones` is unchanged.
|
|
37
|
+
*/
|
|
38
|
+
tones?: Readonly<Record<string, ChartTone>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Single horizontal 100%-stacked strip for part-to-whole composition only.
|
|
42
|
+
* Zero-value segments are omitted from the strip but stay in the accessible
|
|
43
|
+
* summary and legend; the legend IS the exact data at this scale, so there is
|
|
44
|
+
* no separate exact-data table.
|
|
45
|
+
*/
|
|
46
|
+
export declare function CompositionBar({ data, label, size, legend, formatValue, emptyLabel, tones, }: CompositionBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { BarChart } from './bar-chart';
|
|
2
|
+
export type { BarChartProps } from './bar-chart';
|
|
3
|
+
export { PieChart } from './pie-chart';
|
|
4
|
+
export type { PieChartDatum, PieChartProps } from './pie-chart';
|
|
5
|
+
export { ChartDataTable, chartSeriesColor, CHART_TOKEN_COLORS } from './chart-data-table';
|
|
6
|
+
export type { ChartDataTableProps, ChartDataTableRenderContext, ChartDatum, ChartSeries } from './chart-data-table';
|
|
7
|
+
export { ChartExplainer } from './chart-explainer';
|
|
8
|
+
export type { ChartExplainerProps } from './chart-explainer';
|
|
9
|
+
export { CompositionBar } from './composition-bar';
|
|
10
|
+
export type { CompositionBarProps, CompositionBarSegment } from './composition-bar';
|
|
11
|
+
export { ChartTooltip } from './chart-tooltip';
|
|
12
|
+
export type { ChartTooltipProps } from './chart-tooltip';
|
|
13
|
+
export { LineChart } from './line-chart';
|
|
14
|
+
export type { LineChartProps } from './line-chart';
|
|
15
|
+
export { AreaChart } from './area-chart';
|
|
16
|
+
export type { AreaChartProps } from './area-chart';
|
|
17
|
+
export { RankedBarChart } from './ranked-bar-chart';
|
|
18
|
+
export type { RankedBarChartProps } from './ranked-bar-chart';
|
|
19
|
+
export { assignSeriesColors, CHART_MAX_SERIES, CHART_OTHER_COLOR, CHART_SERIES_COLORS, CHART_TONE_COLORS, chartToneColor, } from './palette';
|
|
20
|
+
export type { ChartTone } from './palette';
|
|
21
|
+
export { Sparkline } from './sparkline';
|
|
22
|
+
export type { SparklineProps } from './sparkline';
|
|
23
|
+
export { StackedColumnChart } from './stacked-column-chart';
|
|
24
|
+
export type { StackedColumnChartProps, StackedColumnDatum } from './stacked-column-chart';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ChartDatum, type ChartSeries } from './chart-data-table';
|
|
2
|
+
export interface LineChartProps {
|
|
3
|
+
data: readonly ChartDatum[];
|
|
4
|
+
series: readonly ChartSeries[];
|
|
5
|
+
/** Accessible name for the plot and basis for its exact-data caption. */
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
height?: number;
|
|
9
|
+
formatValue?: (value: number) => string;
|
|
10
|
+
emptyLabel?: string;
|
|
11
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
12
|
+
showDataTable?: boolean;
|
|
13
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
14
|
+
compactData?: boolean;
|
|
15
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
16
|
+
dataTableExpandable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Draw each contiguous segment as a monotone cubic (Fritsch–Carlson)
|
|
19
|
+
* instead of straight lines. The curve passes exactly through every data
|
|
20
|
+
* point and never overshoots, so it cannot imply values outside the data.
|
|
21
|
+
* Marks, tooltips, and the exact-data table are unaffected.
|
|
22
|
+
*/
|
|
23
|
+
smooth?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Dependency-free multi-series trend chart with exact data and focus-equivalent marks. */
|
|
26
|
+
export declare function LineChart({ data, series, label, description, height, formatValue, emptyLabel, compactData, showDataTable, dataTableExpandable, smooth, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monotone cubic interpolation (Fritsch–Carlson) for chart line paths.
|
|
3
|
+
*
|
|
4
|
+
* The smoothed curve passes exactly through every data point and never
|
|
5
|
+
* overshoots: within each segment the interpolant stays inside the y-range of
|
|
6
|
+
* its two endpoints, so a smoothed line can never imply a value outside the
|
|
7
|
+
* data. Pure math, no DOM — unit-tested directly.
|
|
8
|
+
*/
|
|
9
|
+
export interface CurvePoint {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Fritsch–Carlson tangents: secant-averaged slopes limited so each cubic
|
|
15
|
+
* Hermite segment is monotone between its endpoints (no overshoot).
|
|
16
|
+
*/
|
|
17
|
+
export declare function monotoneTangents(points: readonly CurvePoint[]): number[];
|
|
18
|
+
/**
|
|
19
|
+
* SVG path for the monotone cubic through `points` as Hermite segments in
|
|
20
|
+
* cubic Bézier form. Fewer than two points yields an empty string; exactly two
|
|
21
|
+
* yields the straight segment the linear renderer would draw.
|
|
22
|
+
*/
|
|
23
|
+
export declare function monotonePathD(points: readonly CurvePoint[]): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed categorical order validated for adjacent color-vision-deficiency
|
|
3
|
+
* separation on Bakin's dark canvas. Labels and exact values still carry
|
|
4
|
+
* meaning; these colors are reinforcement, never the only distinction.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CHART_SERIES_COLORS: readonly ["var(--bakin-color-data-series-1)", "var(--bakin-color-data-series-2)", "var(--bakin-color-data-series-3)", "var(--bakin-color-data-series-4)", "var(--bakin-color-data-series-5)", "var(--bakin-color-data-series-6)", "var(--bakin-color-data-series-7)", "var(--bakin-color-data-series-8)"];
|
|
7
|
+
/** Low-chroma slot for every entity folded into a visible “Other” group. */
|
|
8
|
+
export declare const CHART_OTHER_COLOR = "var(--bakin-color-data-other)";
|
|
9
|
+
/**
|
|
10
|
+
* Vocabulary for outcome-meaning series. A series that MEANS good/bad/warning
|
|
11
|
+
* wears a status step; a series that is merely “series 4” wears a categorical
|
|
12
|
+
* slot — never both in one chart. `neutral` is the honest step for outcome
|
|
13
|
+
* series that make no good-or-bad claim (canceled, unattributed remainder).
|
|
14
|
+
*/
|
|
15
|
+
export type ChartTone = 'success' | 'danger' | 'attention' | 'neutral';
|
|
16
|
+
/**
|
|
17
|
+
* Status chart-fill steps. The success/danger/attention trio is re-stepped in
|
|
18
|
+
* lightness from Bakin's status hues and frozen only after passing the dataviz
|
|
19
|
+
* palette validator on the dark chart surfaces (all-pairs CVD ΔE ≥ 8, normal
|
|
20
|
+
* ΔE ≥ 15, ≥ 3:1 contrast); the attention step is deliberately separated from
|
|
21
|
+
* the categorical amber slot. Changing any value requires re-validation — see
|
|
22
|
+
* tests/ui/charts/chart-status-tokens.test.ts.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CHART_TONE_COLORS: Record<ChartTone, string>;
|
|
25
|
+
/** Resolve one tone to its frozen status chart-fill step. */
|
|
26
|
+
export declare function chartToneColor(tone: ChartTone): string;
|
|
27
|
+
export declare const CHART_MAX_SERIES: 8;
|
|
28
|
+
/**
|
|
29
|
+
* Assign the full entity set, not a filtered view. Sorting once against the
|
|
30
|
+
* complete set prevents surviving series from changing color across filters.
|
|
31
|
+
*/
|
|
32
|
+
export declare function assignSeriesColors(keys: readonly string[]): Map<string, string>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ChartTone } from './palette';
|
|
2
|
+
export interface PieChartDatum {
|
|
3
|
+
/** Stable entity key; the palette slot follows this key, never the value. */
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
export interface PieChartProps {
|
|
9
|
+
data: readonly PieChartDatum[];
|
|
10
|
+
/** Accessible name for the plot and basis for its exact-data caption. */
|
|
11
|
+
label: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Ring variant with a generous inner radius. */
|
|
14
|
+
donut?: boolean;
|
|
15
|
+
formatValue?: (value: number) => string;
|
|
16
|
+
emptyLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Opt-in status mode for outcome charts: maps entity key → tone, and every
|
|
19
|
+
* slice wears the validated status chart-fill step for its tone instead of
|
|
20
|
+
* a categorical slot. A rendered key without an entry falls back explicitly
|
|
21
|
+
* to `neutral` — never to a categorical color and never to a status it did
|
|
22
|
+
* not claim. Omit for categorical charts; behavior without `tones` is
|
|
23
|
+
* unchanged. Status and categorical fills never mix in one ring.
|
|
24
|
+
*/
|
|
25
|
+
tones?: Readonly<Record<string, ChartTone>>;
|
|
26
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
27
|
+
showDataTable?: boolean;
|
|
28
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
29
|
+
compactData?: boolean;
|
|
30
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
31
|
+
dataTableExpandable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** A pie renders at most this many slices; later entities fold into Other. */
|
|
34
|
+
export declare const PIE_MAX_SLICES = 5;
|
|
35
|
+
/** Slices below this share rely on the legend and exact table instead of a direct label. */
|
|
36
|
+
export declare const PIE_DIRECT_LABEL_MIN_FRACTION = 0.12;
|
|
37
|
+
export interface PieSliceModel {
|
|
38
|
+
key: string;
|
|
39
|
+
label: string;
|
|
40
|
+
value: number;
|
|
41
|
+
color: string;
|
|
42
|
+
/** Share of the rendered whole, 0..1. */
|
|
43
|
+
fraction: number;
|
|
44
|
+
/** Turn fraction from 12 o'clock, clockwise. */
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
isOther: boolean;
|
|
48
|
+
/** Present on the Other slice: how many entities were folded. */
|
|
49
|
+
foldedCount?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface PieModel {
|
|
52
|
+
slices: PieSliceModel[];
|
|
53
|
+
/** Sum of every rendered value, including the Other fold. */
|
|
54
|
+
total: number;
|
|
55
|
+
/** Negative input is a programming error; nothing renders. */
|
|
56
|
+
hasNegative: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** Point on a circle at a clockwise turn fraction starting from 12 o'clock. */
|
|
59
|
+
export declare function polarPoint(cx: number, cy: number, radius: number, fraction: number): {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
};
|
|
63
|
+
/** Closed slice path; `innerRadius` 0 draws a pie wedge, greater an annulus segment. */
|
|
64
|
+
export declare function pieSlicePath(cx: number, cy: number, outerRadius: number, innerRadius: number, start: number, end: number): string;
|
|
65
|
+
/** Whole-percent share label that never rounds a real part to nothing or everything. */
|
|
66
|
+
export declare function formatPieShare(fraction: number): string;
|
|
67
|
+
/**
|
|
68
|
+
* Pure render model: zero and non-finite values are omitted from the ring
|
|
69
|
+
* (the exact table keeps them), any finite negative value invalidates the
|
|
70
|
+
* whole ring, colors come from the fixed palette assignment over the FULL
|
|
71
|
+
* entity set, and slices beyond the cap — the smallest by value, plus any
|
|
72
|
+
* entity beyond the palette's stable slots — fold into one Other slice.
|
|
73
|
+
* Rendered slices keep the caller's data order; they are never reordered
|
|
74
|
+
* by value. With `tones`, every slice wears its status chart-fill step
|
|
75
|
+
* (unmapped keys explicitly fall back to `neutral`) and the palette's
|
|
76
|
+
* stable-slot cap no longer forces a fold — the slice cap still does.
|
|
77
|
+
*/
|
|
78
|
+
export declare function buildPieModel(data: readonly PieChartDatum[], tones?: Readonly<Record<string, ChartTone>>): PieModel;
|
|
79
|
+
/** Part-to-whole share of at most five slices with fixed entity colors and an exact-data disclosure. */
|
|
80
|
+
export declare function PieChart({ data, label, description, donut, formatValue, emptyLabel, tones, showDataTable, compactData, dataTableExpandable, }: PieChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ChartDatum, type ChartSeries } from './chart-data-table';
|
|
2
|
+
import { type ChartTone } from './palette';
|
|
3
|
+
export interface RankedBarChartProps {
|
|
4
|
+
data: readonly ChartDatum[];
|
|
5
|
+
/** Ranked bars intentionally compare one unit at a time. */
|
|
6
|
+
series: ChartSeries;
|
|
7
|
+
/**
|
|
8
|
+
* Optional highlighted sub-segment of each bar (e.g. the failed portion of a
|
|
9
|
+
* call total). Its value is read from `datum.values[secondary.key]`, must
|
|
10
|
+
* share the primary unit, and renders as a full-opacity inset segment over a
|
|
11
|
+
* muted total; the legend, per-bar accessible label, and exact table carry
|
|
12
|
+
* both numbers. Color defaults to the second categorical slot.
|
|
13
|
+
*/
|
|
14
|
+
secondary?: ChartSeries;
|
|
15
|
+
/** Accessible name for the chart and basis for its exact-data caption. */
|
|
16
|
+
label: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Opt-in status coloring for outcome-meaning series: maps series key →
|
|
20
|
+
* tone, and that series wears the validated status chart-fill step (a tone
|
|
21
|
+
* entry outranks `ChartSeries.color`). Series without an entry keep their
|
|
22
|
+
* categorical default, so an identity bar can carry a status overlay (the
|
|
23
|
+
* failure-overlay pattern). Omit for purely categorical rankings; behavior
|
|
24
|
+
* without `tones` is unchanged.
|
|
25
|
+
*/
|
|
26
|
+
tones?: Readonly<Record<string, ChartTone>>;
|
|
27
|
+
formatValue?: (value: number) => string;
|
|
28
|
+
emptyLabel?: string;
|
|
29
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
30
|
+
showDataTable?: boolean;
|
|
31
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
32
|
+
compactData?: boolean;
|
|
33
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
34
|
+
dataTableExpandable?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Ranked single-unit comparison with full labels, visible exact values, and
|
|
38
|
+
* an exact-data disclosure. Long entity names stay readable because they are
|
|
39
|
+
* never squeezed into an x-axis.
|
|
40
|
+
*/
|
|
41
|
+
export declare function RankedBarChart({ data, series, secondary, label, description, tones, formatValue, emptyLabel, showDataTable, compactData, dataTableExpandable, }: RankedBarChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SparklineProps {
|
|
2
|
+
/** Null and non-finite values are explicit gaps, never coerced to zero. */
|
|
3
|
+
values: readonly (number | null)[];
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
stroke?: string;
|
|
7
|
+
/** Accessible description, e.g. “input tokens over the last 10 runs”. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Optional human-readable labels corresponding to `values`. */
|
|
10
|
+
labels?: readonly string[];
|
|
11
|
+
formatValue?: (value: number) => string;
|
|
12
|
+
/** Soft same-color fill under each reported segment; gaps break the fill exactly like the line. */
|
|
13
|
+
area?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Compact exact trend summary; pair it with visible current value and direction copy. */
|
|
16
|
+
export declare function Sparkline({ values, width, height, stroke, label, labels, formatValue, area, }: SparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ChartDatum, type ChartSeries } from './chart-data-table';
|
|
3
|
+
export type StackedColumnDatum = ChartDatum;
|
|
4
|
+
export interface StackedColumnChartProps {
|
|
5
|
+
data: readonly StackedColumnDatum[];
|
|
6
|
+
/** Full stable entity set; labels and explicit colors override key defaults. */
|
|
7
|
+
series?: readonly ChartSeries[];
|
|
8
|
+
/** Compatibility shorthand for a full set whose labels equal their keys. */
|
|
9
|
+
seriesKeys?: readonly string[];
|
|
10
|
+
/** Accessible name for the plot. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Accessible name for the exact-values disclosure. */
|
|
13
|
+
dataLabel?: string;
|
|
14
|
+
/** Bucket keys that are still accumulating data. */
|
|
15
|
+
partialKeys?: readonly string[];
|
|
16
|
+
/** Plot height in px, excluding legend and labels. */
|
|
17
|
+
height?: number;
|
|
18
|
+
formatValue?: (value: number) => string;
|
|
19
|
+
/** Exact-table label for an absent series value. */
|
|
20
|
+
missingValue?: ReactNode;
|
|
21
|
+
/** Plot/tooltip label for a bucket with no reported series values. */
|
|
22
|
+
missingBucketLabel?: string;
|
|
23
|
+
/** Shown when no buckets exist. */
|
|
24
|
+
emptyLabel?: string;
|
|
25
|
+
/** Disable only when an equivalent exact table is rendered beside the chart. */
|
|
26
|
+
showDataTable?: boolean;
|
|
27
|
+
/** Collapse the exact-data table behind its disclosure for space-tight contexts. */
|
|
28
|
+
compactData?: boolean;
|
|
29
|
+
/** When false, the exact-data table renders statically with no disclosure. */
|
|
30
|
+
dataTableExpandable?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Dense interactive stacked comparison with stable entities and an exact-data disclosure. */
|
|
33
|
+
export declare function StackedColumnChart({ data, series: declaredSeries, seriesKeys, label, dataLabel, partialKeys, height, formatValue, missingValue, missingBucketLabel, emptyLabel, compactData, showDataTable, dataTableExpandable, }: StackedColumnChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CodeBlockLanguage = 'json' | 'text';
|
|
3
|
+
export interface CodeBlockProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
4
|
+
/** Exact source to render. Never truncated or reflowed by this component. */
|
|
5
|
+
code: string;
|
|
6
|
+
/**
|
|
7
|
+
* `json` tokenizes keys, strings, numbers, and keyword literals. Anything
|
|
8
|
+
* else renders verbatim in the mono frame — an unknown language is shown
|
|
9
|
+
* honestly rather than mis-highlighted.
|
|
10
|
+
*/
|
|
11
|
+
language?: CodeBlockLanguage;
|
|
12
|
+
/**
|
|
13
|
+
* Names the block. A scrollable block becomes a focusable group carrying
|
|
14
|
+
* this name; a wrapped block needs no name because it has no scroll region
|
|
15
|
+
* to reach. Also used for the copy action's label.
|
|
16
|
+
*/
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Adds a copy action for the exact source. */
|
|
19
|
+
copyable?: boolean;
|
|
20
|
+
/** Wraps long lines instead of scrolling horizontally. */
|
|
21
|
+
wrap?: boolean;
|
|
22
|
+
}
|
|
23
|
+
type TokenKind = 'key' | 'string' | 'number' | 'literal' | 'plain';
|
|
24
|
+
interface Token {
|
|
25
|
+
kind: TokenKind;
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Split JSON into display tokens. Returns a single plain token when the input
|
|
30
|
+
* is not parseable, so malformed payloads still render exactly as received
|
|
31
|
+
* rather than being silently mangled by a partial highlight.
|
|
32
|
+
*/
|
|
33
|
+
export declare function tokenizeJson(source: string): Token[];
|
|
34
|
+
/**
|
|
35
|
+
* The one surface for rendering code and structured data.
|
|
36
|
+
*
|
|
37
|
+
* Highlighting is a property of this component rather than something each
|
|
38
|
+
* consumer paints, so every code surface stays legible and consistent. Colors
|
|
39
|
+
* come from the syntax token family, which is contrast-validated as normal
|
|
40
|
+
* text — highlighting must never trade readability for decoration.
|
|
41
|
+
*/
|
|
42
|
+
export declare function CodeBlock({ className, code, copyable, label, language, wrap, ...props }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConversationToolCall } from './fold';
|
|
2
|
+
/** Format a tool-call duration for compact conversation metadata. */
|
|
3
|
+
export declare function formatDuration(ms: number | undefined): string;
|
|
4
|
+
/** Human-readable group label derived from the tools that ran. */
|
|
5
|
+
export declare function humanizeActivity(calls: readonly ConversationToolCall[]): string;
|
|
6
|
+
/** Props for one exact tool call row inside an activity group. */
|
|
7
|
+
export interface ToolCallRowProps {
|
|
8
|
+
call: ConversationToolCall;
|
|
9
|
+
onOpen?: (call: ConversationToolCall) => void;
|
|
10
|
+
/** Optional compatibility formatter for runtime-specific summary envelopes. */
|
|
11
|
+
formatSummary?: (summary: string) => string;
|
|
12
|
+
}
|
|
13
|
+
/** Exact status, tool name, summary, and duration for one tool call. */
|
|
14
|
+
export declare function ToolCallRow({ call, onOpen, formatSummary }: ToolCallRowProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/** Props for a collapsible group of consecutive tool activity. */
|
|
16
|
+
export interface ActivityGroupProps {
|
|
17
|
+
calls: readonly ConversationToolCall[];
|
|
18
|
+
/** Row click-through to a consumer-owned exact-detail surface. */
|
|
19
|
+
onOpenCall?: (call: ConversationToolCall) => void;
|
|
20
|
+
/** Start expanded; defaults to collapsed so the conversation stays readable. */
|
|
21
|
+
defaultExpanded?: boolean;
|
|
22
|
+
/** Optional compatibility formatter for runtime-specific summary envelopes. */
|
|
23
|
+
formatSummary?: (summary: string) => string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Compact activity summary with a keyboard-operable exact-call disclosure. */
|
|
27
|
+
export declare function ActivityGroup({ calls, onOpenCall, defaultExpanded, formatSummary, className, }: ActivityGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ConversationTextFormat, ConversationToolCall, ConversationTurn } from './fold';
|
|
3
|
+
import { type ConversationTurnUsage } from './turn-usage';
|
|
4
|
+
/** Presentation-ready identity for a conversation author. */
|
|
5
|
+
export interface ConversationAgent {
|
|
6
|
+
id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
avatarUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ConversationAvatarRenderer = (agent: ConversationAgent) => ReactNode;
|
|
11
|
+
export type ConversationTextRenderer = (content: string, format: ConversationTextFormat) => ReactNode;
|
|
12
|
+
export type ConversationTextTransform = (text: string) => {
|
|
13
|
+
text: string;
|
|
14
|
+
extras?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/** Props for a standalone author-bound streaming indicator. */
|
|
17
|
+
export interface ThinkingIndicatorProps {
|
|
18
|
+
agent: ConversationAgent;
|
|
19
|
+
label?: string;
|
|
20
|
+
renderAvatar?: ConversationAvatarRenderer;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Author identity plus a reduced-motion-safe visible streaming label. */
|
|
24
|
+
export declare function ThinkingIndicator({ agent, label, renderAvatar, className, }: ThinkingIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/** Props for one render-ready agent turn. */
|
|
26
|
+
export interface AgentTurnProps {
|
|
27
|
+
turn: Extract<ConversationTurn, {
|
|
28
|
+
kind: 'agent';
|
|
29
|
+
}>;
|
|
30
|
+
agent: ConversationAgent;
|
|
31
|
+
onRetry?: () => void;
|
|
32
|
+
onOpenCall?: (call: ConversationToolCall) => void;
|
|
33
|
+
renderAvatar?: ConversationAvatarRenderer;
|
|
34
|
+
/** Render text formats; markdown falls back to safe pre-wrapped text. */
|
|
35
|
+
renderText?: ConversationTextRenderer;
|
|
36
|
+
/** Optional domain post-processing performed before `renderText`. */
|
|
37
|
+
transformText?: ConversationTextTransform;
|
|
38
|
+
/** Optional compatibility formatter for runtime-specific tool summaries. */
|
|
39
|
+
formatToolSummary?: (summary: string) => string;
|
|
40
|
+
/** Recorded usage for this settled turn. Unknown values remain absent. */
|
|
41
|
+
usage?: ConversationTurnUsage;
|
|
42
|
+
/** Approximate output tokens while this turn is streaming. */
|
|
43
|
+
liveOutEstimate?: number;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Ordered agent reply with visible identity, evidence, lifecycle, and actions. */
|
|
47
|
+
export declare function AgentTurn({ turn, agent, onRetry, onOpenCall, renderAvatar, renderText, transformText, formatToolSummary, usage, liveOutEstimate, className, }: AgentTurnProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type Ref, type ReactNode } from 'react';
|
|
2
|
+
/** Persist a composer draft before its surface mounts, such as after recovery. */
|
|
3
|
+
export declare function writeComposerDraft(storageKey: string, value: string): void;
|
|
4
|
+
export type ComposerAttachmentStatus = 'uploading' | 'ready' | 'error';
|
|
5
|
+
/** Presentation state for one consumer-owned attachment upload. */
|
|
6
|
+
export interface ComposerAttachmentItem {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
previewUrl?: string;
|
|
10
|
+
status?: ComposerAttachmentStatus;
|
|
11
|
+
/** Visible failure copy when status is `error`. */
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Capability and callbacks for consumer-owned attachment selection and upload. */
|
|
15
|
+
export interface ComposerAttachments {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
disabledReason?: string;
|
|
18
|
+
items: readonly ComposerAttachmentItem[];
|
|
19
|
+
/** MIME wildcards, exact MIME types, or extensions. Defaults to image files. */
|
|
20
|
+
acceptedTypes?: readonly string[];
|
|
21
|
+
multiple?: boolean;
|
|
22
|
+
onAdd: (files: File[]) => void;
|
|
23
|
+
onRemove: (id: string) => void;
|
|
24
|
+
}
|
|
25
|
+
/** Imperative draft access for queue removal and other restore flows. */
|
|
26
|
+
export interface ComposerHandle {
|
|
27
|
+
isEmpty(): boolean;
|
|
28
|
+
setText(text: string): void;
|
|
29
|
+
/** Move keyboard focus into the input (shortcut targets, post-action returns). */
|
|
30
|
+
focus(): void;
|
|
31
|
+
}
|
|
32
|
+
/** Props for the persistent, IME-safe conversation input. */
|
|
33
|
+
export interface ComposerProps {
|
|
34
|
+
/** Thread identity used only for local draft, history, and resize preferences. */
|
|
35
|
+
storageKey: string;
|
|
36
|
+
onSend: (content: string) => void | Promise<void>;
|
|
37
|
+
/** A reply is active: typing remains enabled while send waits. */
|
|
38
|
+
busy?: boolean;
|
|
39
|
+
onAbort?: () => void;
|
|
40
|
+
/** Allow send-while-busy so the consumer can queue a follow-up. */
|
|
41
|
+
queueMode?: boolean;
|
|
42
|
+
/** Pending follow-ups, used only for honest busy-state guidance. */
|
|
43
|
+
queuedCount?: number;
|
|
44
|
+
/** Restore or inspect the current draft from a queue-management surface. */
|
|
45
|
+
handleRef?: Ref<ComposerHandle>;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
inputLabel?: string;
|
|
49
|
+
maxLength?: number;
|
|
50
|
+
attachments?: ComposerAttachments;
|
|
51
|
+
leadingSlot?: ReactNode;
|
|
52
|
+
autoFocus?: boolean;
|
|
53
|
+
minHeight?: number;
|
|
54
|
+
maxHeight?: number;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Conversation input with persistent drafts/history, explicit busy behavior,
|
|
59
|
+
* keyboard resizing, and capability-gated attachment selection. Upload and
|
|
60
|
+
* send mutations remain consumer owned.
|
|
61
|
+
*/
|
|
62
|
+
export declare function Composer({ storageKey, onSend, busy, onAbort, queueMode, queuedCount, handleRef, disabled, placeholder, inputLabel, maxLength, attachments, leadingSlot, autoFocus, minHeight, maxHeight, className, }: ComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The meter's wire shape — structurally identical to the SDK's
|
|
3
|
+
* `RuntimeSessionContextStats` (the SDK type stays assignable to this one;
|
|
4
|
+
* chat pins the relationship with a type-level test).
|
|
5
|
+
*/
|
|
6
|
+
export interface ContextMeterStats {
|
|
7
|
+
/** Current context tokens; null = honestly unknown. */
|
|
8
|
+
tokens: number | null;
|
|
9
|
+
/** The model's context window; null when unknown. */
|
|
10
|
+
contextWindow: number | null;
|
|
11
|
+
/** Runtime-reported auto-compaction threshold; null when opaque. */
|
|
12
|
+
compactionThreshold: number | null;
|
|
13
|
+
lastCompaction?: {
|
|
14
|
+
at?: string;
|
|
15
|
+
tokensBefore?: number;
|
|
16
|
+
reason?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Whether the meter will render ANYTHING for these stats — the single
|
|
21
|
+
* source of truth consumers use to place content around it (a truthy
|
|
22
|
+
* stats object can still render nothing: tokens null with no known
|
|
23
|
+
* compaction — e.g. a stale store).
|
|
24
|
+
*/
|
|
25
|
+
export declare function contextMeterHasContent(stats?: ContextMeterStats | null): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The compaction bar (#737): renders ONLY runtime truth. A slim Progress
|
|
28
|
+
* bar (with a track marker for the compaction threshold) plus the exact
|
|
29
|
+
* reading when tokens + window are both known, a number-only reading when
|
|
30
|
+
* the window is unknown, an honest "context —" during a post-compaction
|
|
31
|
+
* gap, and NOTHING when there's nothing honest to show. Highlight at
|
|
32
|
+
* ≥70%, danger at ≥90%; the fill clamps at 100% — a reading can never
|
|
33
|
+
* exceed the window (misreporting runtimes fail conformance, not the UI).
|
|
34
|
+
*/
|
|
35
|
+
export declare function ContextMeter({ stats }: {
|
|
36
|
+
stats?: ContextMeterStats | null;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Props for the honest zero-message state shared by conversation surfaces. */
|
|
3
|
+
export interface ConversationEmptyStateProps {
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
suggestions?: readonly string[];
|
|
8
|
+
/** Suggestions render as actions only when their effect is provided. */
|
|
9
|
+
onSuggestion?: (suggestion: string) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Centered conversation start state with optional actionable prompts. */
|
|
13
|
+
export declare function ConversationEmptyState({ icon, title, description, suggestions, onSuggestion, className, }: ConversationEmptyStateProps): import("react/jsx-runtime").JSX.Element;
|