@ship-it-ui/shipit 0.0.3 → 0.0.5
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/dist/index.cjs +424 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -12
- package/dist/index.d.ts +167 -12
- package/dist/index.js +416 -111
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ export { cn } from '@ship-it-ui/ui';
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { ConnectorName } from '@ship-it-ui/icons';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* AskBar — the primary "ask anything" input. The leading ✦ glyph + accent
|
|
@@ -28,6 +29,12 @@ interface AskBarProps extends Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit' |
|
|
|
28
29
|
disabled?: boolean;
|
|
29
30
|
/** Pixel max-width. Default 620. */
|
|
30
31
|
maxWidth?: number | string;
|
|
32
|
+
/**
|
|
33
|
+
* `'comfortable'` (default) renders the desktop ask bar. `'touch'` swaps to
|
|
34
|
+
* the mobile composer: larger text, 44pt send button, ⌘↵ hint hidden (no
|
|
35
|
+
* hardware keyboard), and scope chips wrap to a second row.
|
|
36
|
+
*/
|
|
37
|
+
density?: 'comfortable' | 'touch';
|
|
31
38
|
}
|
|
32
39
|
declare const AskBar: react.ForwardRefExoticComponent<AskBarProps & react.RefAttributes<HTMLFormElement>>;
|
|
33
40
|
|
|
@@ -76,6 +83,13 @@ interface CopilotMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
76
83
|
avatar?: ReactNode;
|
|
77
84
|
/** Streaming caret at the end of the body. */
|
|
78
85
|
streaming?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* `'comfortable'` (default) renders the desktop bubble. `'touch'` switches
|
|
88
|
+
* to the mobile chat layout: user bubbles right-aligned on `bg-accent`,
|
|
89
|
+
* assistant bubbles left-aligned on `bg-panel`, larger 15px text, and a
|
|
90
|
+
* max-width that keeps bubbles within 85% of the viewport.
|
|
91
|
+
*/
|
|
92
|
+
density?: 'comfortable' | 'touch';
|
|
79
93
|
}
|
|
80
94
|
declare const CopilotMessage: react.ForwardRefExoticComponent<CopilotMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
81
95
|
|
|
@@ -133,15 +147,75 @@ interface ToolCallCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
133
147
|
declare const ToolCallCard: react.ForwardRefExoticComponent<ToolCallCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
134
148
|
|
|
135
149
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
150
|
+
* ShipIt entity vocabulary. Six built-in categories — `service`, `person`,
|
|
151
|
+
* `document`, `deployment`, `incident`, `ticket` — cover the graph's core
|
|
152
|
+
* shapes. The `EntityType` type is intentionally open: consumers may pass any
|
|
153
|
+
* string and register metadata for it via {@link registerEntityType} so their
|
|
154
|
+
* domain types (Repository, Pipeline, Monitor, …) render with the right glyph,
|
|
155
|
+
* label, and tone.
|
|
156
|
+
*
|
|
157
|
+
* Unregistered types fall back to the `service` visuals so a stray value never
|
|
158
|
+
* crashes the UI; consumers can detect them via the `data-entity-type` attribute
|
|
159
|
+
* that entity components forward to the DOM.
|
|
160
|
+
*/
|
|
161
|
+
type KnownEntityType = 'service' | 'person' | 'document' | 'deployment' | 'incident' | 'ticket';
|
|
162
|
+
type EntityType = KnownEntityType | (string & {});
|
|
163
|
+
/**
|
|
164
|
+
* Variant key for the shared `Badge` component in `@ship-it-ui/ui`. Inlined here
|
|
165
|
+
* to keep `types.ts` free of cross-package value imports.
|
|
166
|
+
*/
|
|
167
|
+
type EntityBadgeVariant = 'neutral' | 'accent' | 'ok' | 'warn' | 'err' | 'purple' | 'pink';
|
|
168
|
+
interface EntityTypeMeta {
|
|
169
|
+
/** Single-character glyph rendered next to the type label. */
|
|
170
|
+
glyph: string;
|
|
171
|
+
/** Human-readable type name (e.g. `'Service'`). */
|
|
172
|
+
label: string;
|
|
173
|
+
/** Tailwind text-color class for the glyph and accent text. */
|
|
174
|
+
toneClass: string;
|
|
175
|
+
/** Tailwind background-color class for the icon plate. */
|
|
176
|
+
toneBg: string;
|
|
177
|
+
/** CSS color value used by graph chrome (node ring + legend dot). */
|
|
178
|
+
colorVar: string;
|
|
179
|
+
/** Variant for the shared `Badge` component. */
|
|
180
|
+
badgeVariant: EntityBadgeVariant;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Register or replace metadata for an entity type. Pass any string key — the
|
|
184
|
+
* built-in six can be overridden too. Returns the registered metadata.
|
|
185
|
+
*/
|
|
186
|
+
declare function registerEntityType(type: string, meta: EntityTypeMeta): EntityTypeMeta;
|
|
187
|
+
/** Bulk-register a map of entity types. */
|
|
188
|
+
declare function registerEntityTypes(map: Record<string, EntityTypeMeta>): void;
|
|
189
|
+
/**
|
|
190
|
+
* Resolve metadata for an entity type. Unknown types fall back to the `service`
|
|
191
|
+
* metadata so consumers never crash on a stray value.
|
|
138
192
|
*/
|
|
139
|
-
type EntityType
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
193
|
+
declare function getEntityTypeMeta(type: EntityType): EntityTypeMeta;
|
|
194
|
+
/**
|
|
195
|
+
* Snapshot every registered entity type as `[type, meta]` tuples. Used by
|
|
196
|
+
* downstream packages (e.g. `@ship-it-ui/cytoscape`) to enumerate types when
|
|
197
|
+
* emitting per-type styles. Cheap — just `Array.from(map)`.
|
|
198
|
+
*/
|
|
199
|
+
declare function listEntityTypes(): ReadonlyArray<readonly [string, EntityTypeMeta]>;
|
|
200
|
+
/** Test-only helper: drop all consumer registrations and re-seed the built-ins. */
|
|
201
|
+
declare function resetEntityTypeRegistry(): void;
|
|
202
|
+
/**
|
|
203
|
+
* @deprecated Prefer `getEntityTypeMeta(type).glyph`. Retained for the six
|
|
204
|
+
* built-in types so existing consumers keep working.
|
|
205
|
+
*/
|
|
206
|
+
declare const ENTITY_GLYPH: Record<KnownEntityType, string>;
|
|
207
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).label`. */
|
|
208
|
+
declare const ENTITY_LABEL: Record<KnownEntityType, string>;
|
|
209
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).toneClass`. */
|
|
210
|
+
declare const ENTITY_TONE_CLASS: Record<KnownEntityType, string>;
|
|
211
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).toneBg`. */
|
|
212
|
+
declare const ENTITY_TONE_BG: Record<KnownEntityType, string>;
|
|
144
213
|
|
|
214
|
+
/**
|
|
215
|
+
* EntityBadge — small chip identifying an entity type. Resolves the canonical
|
|
216
|
+
* glyph + label from the type, but accepts a `label` override for cases where
|
|
217
|
+
* the consumer wants to show the entity's actual name.
|
|
218
|
+
*/
|
|
145
219
|
interface EntityBadgeProps extends Omit<BadgeProps, 'variant'> {
|
|
146
220
|
type: EntityType;
|
|
147
221
|
/** Override the visible label. Defaults to the canonical type label. */
|
|
@@ -294,11 +368,18 @@ interface GraphInspectorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'titl
|
|
|
294
368
|
}
|
|
295
369
|
declare const GraphInspector: react.ForwardRefExoticComponent<GraphInspectorProps & react.RefAttributes<HTMLDivElement>>;
|
|
296
370
|
|
|
371
|
+
/**
|
|
372
|
+
* GraphLegend — translucent floating legend panel for the graph viewport.
|
|
373
|
+
* Use the `entries` prop for the canonical entity-type list, or compose
|
|
374
|
+
* children directly for a custom legend. Entry colors and labels resolve
|
|
375
|
+
* through the shared entity-type registry, so consumer-registered types
|
|
376
|
+
* appear with their own visuals.
|
|
377
|
+
*/
|
|
297
378
|
interface GraphLegendEntry {
|
|
298
379
|
/** Entity type (resolves color + label automatically) or a custom shape. */
|
|
299
380
|
type?: EntityType;
|
|
300
381
|
color?: string;
|
|
301
|
-
label
|
|
382
|
+
label?: ReactNode;
|
|
302
383
|
}
|
|
303
384
|
interface GraphLegendProps extends HTMLAttributes<HTMLDivElement> {
|
|
304
385
|
entries?: ReadonlyArray<GraphLegendEntry>;
|
|
@@ -341,9 +422,11 @@ interface GraphMinimapProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
341
422
|
declare const GraphMinimap: react.ForwardRefExoticComponent<GraphMinimapProps & react.RefAttributes<HTMLDivElement>>;
|
|
342
423
|
|
|
343
424
|
/**
|
|
344
|
-
* GraphNode — visual representation of a graph node.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
425
|
+
* GraphNode — visual representation of a graph node. Resolves color + glyph
|
|
426
|
+
* from the shared entity-type registry, so consumer-registered types render
|
|
427
|
+
* with their own visuals. Five states (default, hover, selected, on-path,
|
|
428
|
+
* dimmed). The component itself is presentation-only; pan / zoom / drag is
|
|
429
|
+
* the host's job.
|
|
347
430
|
*/
|
|
348
431
|
type GraphNodeState = 'default' | 'hover' | 'selected' | 'path' | 'dim';
|
|
349
432
|
interface GraphNodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
@@ -499,6 +582,42 @@ interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'cite' | 'r
|
|
|
499
582
|
}
|
|
500
583
|
declare const Testimonial: react.ForwardRefExoticComponent<TestimonialProps & react.RefAttributes<HTMLElement>>;
|
|
501
584
|
|
|
585
|
+
/**
|
|
586
|
+
* ConnectorCard — integration card for "connector hubs". Renders a connector
|
|
587
|
+
* logo (via `@ship-it-ui/icons` connector glyphs), the connector name, a
|
|
588
|
+
* sync-state dot, a relative last-sync timestamp, an optional summary, and a
|
|
589
|
+
* trailing action slot.
|
|
590
|
+
*
|
|
591
|
+
* When `onClick` is provided the whole card becomes a button; otherwise it
|
|
592
|
+
* renders as a plain `<div>`.
|
|
593
|
+
*/
|
|
594
|
+
type ConnectorStatus = 'connected' | 'syncing' | 'error' | 'disconnected';
|
|
595
|
+
interface ConnectorCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onClick'> {
|
|
596
|
+
/** Connector name keyed into `@ship-it-ui/icons` connectorGlyphs. */
|
|
597
|
+
connector: ConnectorName | (string & {});
|
|
598
|
+
/** Display name shown next to the logo. */
|
|
599
|
+
name: ReactNode;
|
|
600
|
+
/** Sync status. Drives the status dot tone + the default status label. */
|
|
601
|
+
status: ConnectorStatus;
|
|
602
|
+
/** Last successful sync timestamp. Formatted relative to `relativeNow`. */
|
|
603
|
+
lastSyncedAt?: Date | string | number;
|
|
604
|
+
/** Reference time for relative formatting (injectable for tests/SSR). */
|
|
605
|
+
relativeNow?: Date;
|
|
606
|
+
/** Free-text summary (e.g. "1,243 docs · 8 channels"). */
|
|
607
|
+
summary?: ReactNode;
|
|
608
|
+
/** Trailing action slot — typically a `Button` or `DropdownMenu` trigger. */
|
|
609
|
+
actions?: ReactNode;
|
|
610
|
+
/** Click handler. When provided, the card becomes a button. */
|
|
611
|
+
onClick?: () => void;
|
|
612
|
+
/**
|
|
613
|
+
* Accessible name override. Required when `onClick` is set *and* `name` is
|
|
614
|
+
* not a string — without it the button has no accessible name (axe
|
|
615
|
+
* `button-name`). Optional otherwise.
|
|
616
|
+
*/
|
|
617
|
+
accessibleName?: string;
|
|
618
|
+
}
|
|
619
|
+
declare const ConnectorCard: react.ForwardRefExoticComponent<ConnectorCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
620
|
+
|
|
502
621
|
/**
|
|
503
622
|
* EntityTable — DataTable preset with two ShipIt-aware column helpers:
|
|
504
623
|
* `entityColumn(...)` for the typed name cell and `entityTypeColumn()` for a
|
|
@@ -532,4 +651,40 @@ declare function entityTypeColumn<T extends MinimalEntity>(options?: {
|
|
|
532
651
|
header?: string;
|
|
533
652
|
}): DataTableColumn<T>;
|
|
534
653
|
|
|
535
|
-
|
|
654
|
+
/**
|
|
655
|
+
* NotifRow — single row in the mobile Inbox / notification list. Shows an
|
|
656
|
+
* unread dot (tone-colored), a tight title + body block, and a right-aligned
|
|
657
|
+
* relative time. Pair with `isFirst` / `isLast` props from a parent list
|
|
658
|
+
* wrapper to round the corners of the group like an iOS grouped list.
|
|
659
|
+
*
|
|
660
|
+
* No desktop sibling — desktop uses the standard `Notifications` flyout
|
|
661
|
+
* inside CommandPalette. This composite is mobile-only and lives under
|
|
662
|
+
* `packages/shipit/src/notifications/`.
|
|
663
|
+
*/
|
|
664
|
+
type NotifTone = 'ok' | 'warn' | 'err' | 'neutral';
|
|
665
|
+
interface NotifRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
666
|
+
/** Bold first-line summary. */
|
|
667
|
+
title: ReactNode;
|
|
668
|
+
/** One-line body underneath. Truncates to a single line for now. */
|
|
669
|
+
body?: ReactNode;
|
|
670
|
+
/** Right-aligned relative time string (e.g. `9:32`, `Mon`). */
|
|
671
|
+
time?: ReactNode;
|
|
672
|
+
/** Coloring of the unread dot. */
|
|
673
|
+
tone?: NotifTone;
|
|
674
|
+
/** When true, render the unread dot. */
|
|
675
|
+
unread?: boolean;
|
|
676
|
+
/** Round the top corners — set when this is the first row in a group. */
|
|
677
|
+
isFirst?: boolean;
|
|
678
|
+
/** Round the bottom corners — set when this is the last row in a group. */
|
|
679
|
+
isLast?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* Navigate when the row is tapped. Renders the row as an `<a>` and wins
|
|
682
|
+
* over `onClick` for the render shape — but any `onClick` you pass is
|
|
683
|
+
* still forwarded onto the anchor, which is the right place for
|
|
684
|
+
* analytics callbacks (the link still navigates).
|
|
685
|
+
*/
|
|
686
|
+
href?: string;
|
|
687
|
+
}
|
|
688
|
+
declare const NotifRow: react.ForwardRefExoticComponent<NotifRowProps & react.RefAttributes<HTMLDivElement>>;
|
|
689
|
+
|
|
690
|
+
export { AskBar, type AskBarProps, CTAStrip, type CTAStripProps, Citation, type CitationProps, ConfidenceIndicator, type ConfidenceIndicatorProps, type ConfidenceTier, ConnectorCard, type ConnectorCardProps, type ConnectorStatus, CopilotMessage, type CopilotMessageProps, type CopilotRole, ENTITY_GLYPH, ENTITY_LABEL, ENTITY_TONE_BG, ENTITY_TONE_CLASS, EntityBadge, type EntityBadgeProps, type EntityBadgeVariant, EntityCard, type EntityCardProps, EntityListRow, EntityListRowButton, type EntityListRowButtonProps, EntityListRowDiv, type EntityListRowDivProps, type EntityListRowProps, type EntityStat, EntityTable, type EntityTableProps, type EntityType, type EntityTypeMeta, type Feature, FeatureGrid, type FeatureGridProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GraphEdge, type GraphEdgeProps, type GraphEdgeStyle, GraphInspector, type GraphInspectorProps, GraphLegend, type GraphLegendEntry, type GraphLegendProps, GraphMinimap, type GraphMinimapProps, GraphNode, type GraphNodeProps, type GraphNodeState, Hero, type HeroProps, type InspectorProperty, type InspectorRelation, type KnownEntityType, type MinimapPoint, type MinimapViewport, NotifRow, type NotifRowProps, type NotifTone, PathOverlay, type PathOverlayProps, type PathPoint, PricingCard, type PricingCardProps, ReasoningBlock, type ReasoningBlockProps, ReasoningStep, type ReasoningStepProps, SuggestionChip, type SuggestionChipProps, Testimonial, type TestimonialProps, ToolCallCard, type ToolCallCardProps, entityColumn, entityTypeColumn, getEntityTypeMeta, listEntityTypes, registerEntityType, registerEntityTypes, resetEntityTypeRegistry };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { cn } from '@ship-it-ui/ui';
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { ConnectorName } from '@ship-it-ui/icons';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* AskBar — the primary "ask anything" input. The leading ✦ glyph + accent
|
|
@@ -28,6 +29,12 @@ interface AskBarProps extends Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit' |
|
|
|
28
29
|
disabled?: boolean;
|
|
29
30
|
/** Pixel max-width. Default 620. */
|
|
30
31
|
maxWidth?: number | string;
|
|
32
|
+
/**
|
|
33
|
+
* `'comfortable'` (default) renders the desktop ask bar. `'touch'` swaps to
|
|
34
|
+
* the mobile composer: larger text, 44pt send button, ⌘↵ hint hidden (no
|
|
35
|
+
* hardware keyboard), and scope chips wrap to a second row.
|
|
36
|
+
*/
|
|
37
|
+
density?: 'comfortable' | 'touch';
|
|
31
38
|
}
|
|
32
39
|
declare const AskBar: react.ForwardRefExoticComponent<AskBarProps & react.RefAttributes<HTMLFormElement>>;
|
|
33
40
|
|
|
@@ -76,6 +83,13 @@ interface CopilotMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
76
83
|
avatar?: ReactNode;
|
|
77
84
|
/** Streaming caret at the end of the body. */
|
|
78
85
|
streaming?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* `'comfortable'` (default) renders the desktop bubble. `'touch'` switches
|
|
88
|
+
* to the mobile chat layout: user bubbles right-aligned on `bg-accent`,
|
|
89
|
+
* assistant bubbles left-aligned on `bg-panel`, larger 15px text, and a
|
|
90
|
+
* max-width that keeps bubbles within 85% of the viewport.
|
|
91
|
+
*/
|
|
92
|
+
density?: 'comfortable' | 'touch';
|
|
79
93
|
}
|
|
80
94
|
declare const CopilotMessage: react.ForwardRefExoticComponent<CopilotMessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
81
95
|
|
|
@@ -133,15 +147,75 @@ interface ToolCallCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
133
147
|
declare const ToolCallCard: react.ForwardRefExoticComponent<ToolCallCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
134
148
|
|
|
135
149
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
150
|
+
* ShipIt entity vocabulary. Six built-in categories — `service`, `person`,
|
|
151
|
+
* `document`, `deployment`, `incident`, `ticket` — cover the graph's core
|
|
152
|
+
* shapes. The `EntityType` type is intentionally open: consumers may pass any
|
|
153
|
+
* string and register metadata for it via {@link registerEntityType} so their
|
|
154
|
+
* domain types (Repository, Pipeline, Monitor, …) render with the right glyph,
|
|
155
|
+
* label, and tone.
|
|
156
|
+
*
|
|
157
|
+
* Unregistered types fall back to the `service` visuals so a stray value never
|
|
158
|
+
* crashes the UI; consumers can detect them via the `data-entity-type` attribute
|
|
159
|
+
* that entity components forward to the DOM.
|
|
160
|
+
*/
|
|
161
|
+
type KnownEntityType = 'service' | 'person' | 'document' | 'deployment' | 'incident' | 'ticket';
|
|
162
|
+
type EntityType = KnownEntityType | (string & {});
|
|
163
|
+
/**
|
|
164
|
+
* Variant key for the shared `Badge` component in `@ship-it-ui/ui`. Inlined here
|
|
165
|
+
* to keep `types.ts` free of cross-package value imports.
|
|
166
|
+
*/
|
|
167
|
+
type EntityBadgeVariant = 'neutral' | 'accent' | 'ok' | 'warn' | 'err' | 'purple' | 'pink';
|
|
168
|
+
interface EntityTypeMeta {
|
|
169
|
+
/** Single-character glyph rendered next to the type label. */
|
|
170
|
+
glyph: string;
|
|
171
|
+
/** Human-readable type name (e.g. `'Service'`). */
|
|
172
|
+
label: string;
|
|
173
|
+
/** Tailwind text-color class for the glyph and accent text. */
|
|
174
|
+
toneClass: string;
|
|
175
|
+
/** Tailwind background-color class for the icon plate. */
|
|
176
|
+
toneBg: string;
|
|
177
|
+
/** CSS color value used by graph chrome (node ring + legend dot). */
|
|
178
|
+
colorVar: string;
|
|
179
|
+
/** Variant for the shared `Badge` component. */
|
|
180
|
+
badgeVariant: EntityBadgeVariant;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Register or replace metadata for an entity type. Pass any string key — the
|
|
184
|
+
* built-in six can be overridden too. Returns the registered metadata.
|
|
185
|
+
*/
|
|
186
|
+
declare function registerEntityType(type: string, meta: EntityTypeMeta): EntityTypeMeta;
|
|
187
|
+
/** Bulk-register a map of entity types. */
|
|
188
|
+
declare function registerEntityTypes(map: Record<string, EntityTypeMeta>): void;
|
|
189
|
+
/**
|
|
190
|
+
* Resolve metadata for an entity type. Unknown types fall back to the `service`
|
|
191
|
+
* metadata so consumers never crash on a stray value.
|
|
138
192
|
*/
|
|
139
|
-
type EntityType
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
193
|
+
declare function getEntityTypeMeta(type: EntityType): EntityTypeMeta;
|
|
194
|
+
/**
|
|
195
|
+
* Snapshot every registered entity type as `[type, meta]` tuples. Used by
|
|
196
|
+
* downstream packages (e.g. `@ship-it-ui/cytoscape`) to enumerate types when
|
|
197
|
+
* emitting per-type styles. Cheap — just `Array.from(map)`.
|
|
198
|
+
*/
|
|
199
|
+
declare function listEntityTypes(): ReadonlyArray<readonly [string, EntityTypeMeta]>;
|
|
200
|
+
/** Test-only helper: drop all consumer registrations and re-seed the built-ins. */
|
|
201
|
+
declare function resetEntityTypeRegistry(): void;
|
|
202
|
+
/**
|
|
203
|
+
* @deprecated Prefer `getEntityTypeMeta(type).glyph`. Retained for the six
|
|
204
|
+
* built-in types so existing consumers keep working.
|
|
205
|
+
*/
|
|
206
|
+
declare const ENTITY_GLYPH: Record<KnownEntityType, string>;
|
|
207
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).label`. */
|
|
208
|
+
declare const ENTITY_LABEL: Record<KnownEntityType, string>;
|
|
209
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).toneClass`. */
|
|
210
|
+
declare const ENTITY_TONE_CLASS: Record<KnownEntityType, string>;
|
|
211
|
+
/** @deprecated Prefer `getEntityTypeMeta(type).toneBg`. */
|
|
212
|
+
declare const ENTITY_TONE_BG: Record<KnownEntityType, string>;
|
|
144
213
|
|
|
214
|
+
/**
|
|
215
|
+
* EntityBadge — small chip identifying an entity type. Resolves the canonical
|
|
216
|
+
* glyph + label from the type, but accepts a `label` override for cases where
|
|
217
|
+
* the consumer wants to show the entity's actual name.
|
|
218
|
+
*/
|
|
145
219
|
interface EntityBadgeProps extends Omit<BadgeProps, 'variant'> {
|
|
146
220
|
type: EntityType;
|
|
147
221
|
/** Override the visible label. Defaults to the canonical type label. */
|
|
@@ -294,11 +368,18 @@ interface GraphInspectorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'titl
|
|
|
294
368
|
}
|
|
295
369
|
declare const GraphInspector: react.ForwardRefExoticComponent<GraphInspectorProps & react.RefAttributes<HTMLDivElement>>;
|
|
296
370
|
|
|
371
|
+
/**
|
|
372
|
+
* GraphLegend — translucent floating legend panel for the graph viewport.
|
|
373
|
+
* Use the `entries` prop for the canonical entity-type list, or compose
|
|
374
|
+
* children directly for a custom legend. Entry colors and labels resolve
|
|
375
|
+
* through the shared entity-type registry, so consumer-registered types
|
|
376
|
+
* appear with their own visuals.
|
|
377
|
+
*/
|
|
297
378
|
interface GraphLegendEntry {
|
|
298
379
|
/** Entity type (resolves color + label automatically) or a custom shape. */
|
|
299
380
|
type?: EntityType;
|
|
300
381
|
color?: string;
|
|
301
|
-
label
|
|
382
|
+
label?: ReactNode;
|
|
302
383
|
}
|
|
303
384
|
interface GraphLegendProps extends HTMLAttributes<HTMLDivElement> {
|
|
304
385
|
entries?: ReadonlyArray<GraphLegendEntry>;
|
|
@@ -341,9 +422,11 @@ interface GraphMinimapProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
341
422
|
declare const GraphMinimap: react.ForwardRefExoticComponent<GraphMinimapProps & react.RefAttributes<HTMLDivElement>>;
|
|
342
423
|
|
|
343
424
|
/**
|
|
344
|
-
* GraphNode — visual representation of a graph node.
|
|
345
|
-
*
|
|
346
|
-
*
|
|
425
|
+
* GraphNode — visual representation of a graph node. Resolves color + glyph
|
|
426
|
+
* from the shared entity-type registry, so consumer-registered types render
|
|
427
|
+
* with their own visuals. Five states (default, hover, selected, on-path,
|
|
428
|
+
* dimmed). The component itself is presentation-only; pan / zoom / drag is
|
|
429
|
+
* the host's job.
|
|
347
430
|
*/
|
|
348
431
|
type GraphNodeState = 'default' | 'hover' | 'selected' | 'path' | 'dim';
|
|
349
432
|
interface GraphNodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
@@ -499,6 +582,42 @@ interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'cite' | 'r
|
|
|
499
582
|
}
|
|
500
583
|
declare const Testimonial: react.ForwardRefExoticComponent<TestimonialProps & react.RefAttributes<HTMLElement>>;
|
|
501
584
|
|
|
585
|
+
/**
|
|
586
|
+
* ConnectorCard — integration card for "connector hubs". Renders a connector
|
|
587
|
+
* logo (via `@ship-it-ui/icons` connector glyphs), the connector name, a
|
|
588
|
+
* sync-state dot, a relative last-sync timestamp, an optional summary, and a
|
|
589
|
+
* trailing action slot.
|
|
590
|
+
*
|
|
591
|
+
* When `onClick` is provided the whole card becomes a button; otherwise it
|
|
592
|
+
* renders as a plain `<div>`.
|
|
593
|
+
*/
|
|
594
|
+
type ConnectorStatus = 'connected' | 'syncing' | 'error' | 'disconnected';
|
|
595
|
+
interface ConnectorCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onClick'> {
|
|
596
|
+
/** Connector name keyed into `@ship-it-ui/icons` connectorGlyphs. */
|
|
597
|
+
connector: ConnectorName | (string & {});
|
|
598
|
+
/** Display name shown next to the logo. */
|
|
599
|
+
name: ReactNode;
|
|
600
|
+
/** Sync status. Drives the status dot tone + the default status label. */
|
|
601
|
+
status: ConnectorStatus;
|
|
602
|
+
/** Last successful sync timestamp. Formatted relative to `relativeNow`. */
|
|
603
|
+
lastSyncedAt?: Date | string | number;
|
|
604
|
+
/** Reference time for relative formatting (injectable for tests/SSR). */
|
|
605
|
+
relativeNow?: Date;
|
|
606
|
+
/** Free-text summary (e.g. "1,243 docs · 8 channels"). */
|
|
607
|
+
summary?: ReactNode;
|
|
608
|
+
/** Trailing action slot — typically a `Button` or `DropdownMenu` trigger. */
|
|
609
|
+
actions?: ReactNode;
|
|
610
|
+
/** Click handler. When provided, the card becomes a button. */
|
|
611
|
+
onClick?: () => void;
|
|
612
|
+
/**
|
|
613
|
+
* Accessible name override. Required when `onClick` is set *and* `name` is
|
|
614
|
+
* not a string — without it the button has no accessible name (axe
|
|
615
|
+
* `button-name`). Optional otherwise.
|
|
616
|
+
*/
|
|
617
|
+
accessibleName?: string;
|
|
618
|
+
}
|
|
619
|
+
declare const ConnectorCard: react.ForwardRefExoticComponent<ConnectorCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
620
|
+
|
|
502
621
|
/**
|
|
503
622
|
* EntityTable — DataTable preset with two ShipIt-aware column helpers:
|
|
504
623
|
* `entityColumn(...)` for the typed name cell and `entityTypeColumn()` for a
|
|
@@ -532,4 +651,40 @@ declare function entityTypeColumn<T extends MinimalEntity>(options?: {
|
|
|
532
651
|
header?: string;
|
|
533
652
|
}): DataTableColumn<T>;
|
|
534
653
|
|
|
535
|
-
|
|
654
|
+
/**
|
|
655
|
+
* NotifRow — single row in the mobile Inbox / notification list. Shows an
|
|
656
|
+
* unread dot (tone-colored), a tight title + body block, and a right-aligned
|
|
657
|
+
* relative time. Pair with `isFirst` / `isLast` props from a parent list
|
|
658
|
+
* wrapper to round the corners of the group like an iOS grouped list.
|
|
659
|
+
*
|
|
660
|
+
* No desktop sibling — desktop uses the standard `Notifications` flyout
|
|
661
|
+
* inside CommandPalette. This composite is mobile-only and lives under
|
|
662
|
+
* `packages/shipit/src/notifications/`.
|
|
663
|
+
*/
|
|
664
|
+
type NotifTone = 'ok' | 'warn' | 'err' | 'neutral';
|
|
665
|
+
interface NotifRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
666
|
+
/** Bold first-line summary. */
|
|
667
|
+
title: ReactNode;
|
|
668
|
+
/** One-line body underneath. Truncates to a single line for now. */
|
|
669
|
+
body?: ReactNode;
|
|
670
|
+
/** Right-aligned relative time string (e.g. `9:32`, `Mon`). */
|
|
671
|
+
time?: ReactNode;
|
|
672
|
+
/** Coloring of the unread dot. */
|
|
673
|
+
tone?: NotifTone;
|
|
674
|
+
/** When true, render the unread dot. */
|
|
675
|
+
unread?: boolean;
|
|
676
|
+
/** Round the top corners — set when this is the first row in a group. */
|
|
677
|
+
isFirst?: boolean;
|
|
678
|
+
/** Round the bottom corners — set when this is the last row in a group. */
|
|
679
|
+
isLast?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* Navigate when the row is tapped. Renders the row as an `<a>` and wins
|
|
682
|
+
* over `onClick` for the render shape — but any `onClick` you pass is
|
|
683
|
+
* still forwarded onto the anchor, which is the right place for
|
|
684
|
+
* analytics callbacks (the link still navigates).
|
|
685
|
+
*/
|
|
686
|
+
href?: string;
|
|
687
|
+
}
|
|
688
|
+
declare const NotifRow: react.ForwardRefExoticComponent<NotifRowProps & react.RefAttributes<HTMLDivElement>>;
|
|
689
|
+
|
|
690
|
+
export { AskBar, type AskBarProps, CTAStrip, type CTAStripProps, Citation, type CitationProps, ConfidenceIndicator, type ConfidenceIndicatorProps, type ConfidenceTier, ConnectorCard, type ConnectorCardProps, type ConnectorStatus, CopilotMessage, type CopilotMessageProps, type CopilotRole, ENTITY_GLYPH, ENTITY_LABEL, ENTITY_TONE_BG, ENTITY_TONE_CLASS, EntityBadge, type EntityBadgeProps, type EntityBadgeVariant, EntityCard, type EntityCardProps, EntityListRow, EntityListRowButton, type EntityListRowButtonProps, EntityListRowDiv, type EntityListRowDivProps, type EntityListRowProps, type EntityStat, EntityTable, type EntityTableProps, type EntityType, type EntityTypeMeta, type Feature, FeatureGrid, type FeatureGridProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GraphEdge, type GraphEdgeProps, type GraphEdgeStyle, GraphInspector, type GraphInspectorProps, GraphLegend, type GraphLegendEntry, type GraphLegendProps, GraphMinimap, type GraphMinimapProps, GraphNode, type GraphNodeProps, type GraphNodeState, Hero, type HeroProps, type InspectorProperty, type InspectorRelation, type KnownEntityType, type MinimapPoint, type MinimapViewport, NotifRow, type NotifRowProps, type NotifTone, PathOverlay, type PathOverlayProps, type PathPoint, PricingCard, type PricingCardProps, ReasoningBlock, type ReasoningBlockProps, ReasoningStep, type ReasoningStepProps, SuggestionChip, type SuggestionChipProps, Testimonial, type TestimonialProps, ToolCallCard, type ToolCallCardProps, entityColumn, entityTypeColumn, getEntityTypeMeta, listEntityTypes, registerEntityType, registerEntityTypes, resetEntityTypeRegistry };
|