@icanbwell/baileyai-chat-ui 0.4.4 → 0.5.1

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/chart.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { JSX } from 'react';
1
+ import { JSX as JSX_2 } from 'react';
2
2
 
3
- export declare const BaileyChart: ({ spec, isDarkMode, palette }: BaileyChartProps) => JSX.Element;
3
+ export declare const BaileyChart: ({ spec, isDarkMode, palette }: BaileyChartProps) => JSX_2.Element;
4
4
 
5
5
  declare interface BaileyChartDataset {
6
6
  label: string;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Components } from 'react-markdown';
2
- import { JSX } from 'react';
2
+ import { JSX as JSX_2 } from 'react';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  export declare function ActivityIcon({ className }: {
6
6
  className?: string;
7
- }): JSX.Element;
7
+ }): JSX_2.Element;
8
8
 
9
9
  export declare interface ActivityLine {
10
10
  key: string;
@@ -14,7 +14,7 @@ export declare interface ActivityLine {
14
14
 
15
15
  export declare function ArrowUpRightIcon({ className }: {
16
16
  className?: string;
17
- }): JSX.Element;
17
+ }): JSX_2.Element;
18
18
 
19
19
  export declare const BAILEY_CHART_PROMPT_FRAGMENT: string;
20
20
 
@@ -46,7 +46,40 @@ export declare interface BaileyChatInputMessage {
46
46
  content: string;
47
47
  }
48
48
 
49
- export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, suggestions, privacyNote, resolveActivityIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, }: BaileyChatPanelProps): JSX.Element;
49
+ export declare function BaileyChatPanel({ chat, placeholder, replyPlaceholder, emptyPlaceholder, suggestions, privacyNote, resolveActivityIcon, className, height, width, hideDeveloperDetails, renderMessageActions, renderTable, renderChart, labels: labelsProp, formatMessageTime: formatMessageTimeProp, }: BaileyChatPanelProps): JSX_2.Element;
50
+
51
+ export declare interface BaileyChatPanelLabels {
52
+ /** Visible text on the header's reset control. */
53
+ newChatButtonText: string;
54
+ /** Accessible name for the reset control — lowercase to match this component's other
55
+ * aria-labels (send/stop/dismiss), which are also lowercase by existing convention. */
56
+ newChatAriaLabel: string;
57
+ /** Heading above the suggestion cards in the empty state. */
58
+ suggestionsTitle: string;
59
+ /** Shown in the empty state when no `suggestions` prop is supplied. */
60
+ emptyStateMessage: string;
61
+ /** Name shown above a user message bubble. */
62
+ youLabel: string;
63
+ /** Shown while awaiting the first streamed token, when no more specific activity hint (tool
64
+ * call, progress event) is available yet. */
65
+ thinkingHint: string;
66
+ /** Visible text on the error banner's retry control. */
67
+ retryButtonText: string;
68
+ /** Accessible name for the error banner's dismiss control. */
69
+ dismissErrorAriaLabel: string;
70
+ /** Accessible name for the submit control. */
71
+ sendAriaLabel: string;
72
+ /** Tooltip text shown on hover for the streaming-abort control. */
73
+ stopButtonText: string;
74
+ /** Accessible name for the streaming-abort control. */
75
+ stopAriaLabel: string;
76
+ /** Accessible name for the per-message copy-as-markdown control. */
77
+ copyButtonAriaLabel: string;
78
+ /** Tooltip text before a copy action, on the per-message copy control. */
79
+ copyButtonTooltipDefault: string;
80
+ /** Tooltip text immediately after a successful copy, on the per-message copy control. */
81
+ copyButtonTooltipCopied: string;
82
+ }
50
83
 
51
84
  export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
52
85
  chat: UseBaileyChatResult;
@@ -55,6 +88,10 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
55
88
  placeholder?: string;
56
89
  /** Placeholder shown once the conversation has started; ignored if `placeholder` is set. */
57
90
  replyPlaceholder?: string;
91
+ /** Placeholder shown before the conversation has started; ignored if `placeholder` is set.
92
+ * Sibling to `replyPlaceholder` above — together they cover both states without needing the
93
+ * catch-all `placeholder` prop, which overrides both at once. */
94
+ emptyPlaceholder?: string;
58
95
  /** Suggested prompts shown ("Suggested for you") in the empty state before any message has
59
96
  * been sent. Clicking one calls chat.send(value ?? label). Omit to keep the plain
60
97
  * "Ask Bailey a question to get started." empty state. */
@@ -84,6 +121,15 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
84
121
  * Content-derived actions (e.g. baileyai-skills-service's save-as-skill artifact UI) are a
85
122
  * host-side composition around useBaileyChat, not this prop — see the Phase 4 plan. */
86
123
  renderMessageActions?: (message: BaileyMessage) => ReactNode;
124
+ /** Overrides individual UI strings for localization — merged shallowly with English
125
+ * defaults, so a host only needs to supply the keys its i18n system actually translates.
126
+ * Pass fully-resolved strings, not translation keys — this package has no opinion on which
127
+ * i18n library a host uses. */
128
+ labels?: Partial<BaileyChatPanelLabels>;
129
+ /** Formats the timestamp shown above a user message bubble. Defaults to
130
+ * `"Today HH:MM"` / `"<locale date> HH:MM"` in the browser's locale — override for a
131
+ * different locale or format. */
132
+ formatMessageTime?: (at: number) => string;
87
133
  }
88
134
 
89
135
  export declare interface BaileyChatTransport {
@@ -143,6 +189,10 @@ export declare interface BaileyMessage {
143
189
  /** When this message was created, stamped by useBaileyChat. Optional so hosts constructing
144
190
  * BaileyMessage objects by hand (e.g. tests, seed data) aren't forced to supply it. */
145
191
  createdAt?: number;
192
+ /** True for a user message created via sendHidden — never rendered in `messages`, but still
193
+ * part of `historyRef` sent to the model. Distinguishes a hidden context message from the
194
+ * user's real first question so logic like `firstUserMessagePrefix` doesn't bind to it. */
195
+ hidden?: boolean;
146
196
  }
147
197
 
148
198
  export declare interface BaileyOutputItem {
@@ -255,7 +305,7 @@ export declare type BaileyTraceEvent = {
255
305
  turnSentAt: number;
256
306
  };
257
307
 
258
- export declare function BaileyTracePanel({ events, lastRequest, onClear }: BaileyTracePanelProps): JSX.Element | null;
308
+ export declare function BaileyTracePanel({ events, lastRequest, onClear }: BaileyTracePanelProps): JSX_2.Element | null;
259
309
 
260
310
  export declare interface BaileyTracePanelProps {
261
311
  events: BaileyTraceEvent[];
@@ -263,11 +313,17 @@ export declare interface BaileyTracePanelProps {
263
313
  onClear: () => void;
264
314
  }
265
315
 
266
- export declare function CopyMarkdownButton({ markdown, className }: CopyMarkdownButtonProps): JSX.Element;
316
+ export declare function CopyMarkdownButton({ markdown, className, ariaLabel, tooltipDefaultText, tooltipCopiedText, }: CopyMarkdownButtonProps): JSX_2.Element;
267
317
 
268
318
  export declare interface CopyMarkdownButtonProps {
269
319
  markdown: string;
270
320
  className?: string;
321
+ /** Accessible name for the button. */
322
+ ariaLabel?: string;
323
+ /** Tooltip text shown before a copy action. */
324
+ tooltipDefaultText?: string;
325
+ /** Tooltip text shown immediately after a successful copy. */
326
+ tooltipCopiedText?: string;
271
327
  }
272
328
 
273
329
  export declare function createBaileyMarkdownComponents({ renderTable, renderChart }?: BaileyMarkdownRenderers): Components;
@@ -304,7 +360,7 @@ export declare function hasTraceFailure(events: BaileyTraceEvent[]): boolean;
304
360
 
305
361
  export declare function HeartIcon({ className }: {
306
362
  className?: string;
307
- }): JSX.Element;
363
+ }): JSX_2.Element;
308
364
 
309
365
  export declare const isSafeMarkdownUrl: (href: string) => boolean;
310
366
 
@@ -419,6 +475,12 @@ export declare interface UseBaileyChatResult {
419
475
  status: 'idle' | 'streaming' | 'error';
420
476
  error: string | null;
421
477
  send: (text: string) => void;
478
+ /** Like `send`, but the user's own message never enters `messages` (so it never renders) —
479
+ * only the assistant's reply does. The hidden message still becomes part of the history sent
480
+ * to the model on this and every later turn. For seeding Bailey with page/context-specific
481
+ * information a host wants answered but doesn't want cluttering the visible transcript.
482
+ * No-ops (does not start a new turn) while a turn is already in flight. */
483
+ sendHidden: (text: string) => void;
422
484
  stop: () => void;
423
485
  retryLast: () => void;
424
486
  clearTrace: () => void;
package/dist/table.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { JSX } from 'react';
1
+ import { JSX as JSX_2 } from 'react';
2
2
  import { Theme } from 'ag-grid-community';
3
3
 
4
- export declare const BaileyTable: ({ headers, rows, theme }: BaileyTableProps) => JSX.Element;
4
+ export declare const BaileyTable: ({ headers, rows, theme }: BaileyTableProps) => JSX_2.Element;
5
5
 
6
6
  declare interface BaileyTableCell {
7
7
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/baileyai-chat-ui",
3
- "version": "0.4.4",
3
+ "version": "0.5.1",
4
4
  "description": "Shared React chat UI and streaming logic for Bailey, the icanbwell AI assistant",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "packageManager": "yarn@4.14.1",
47
47
  "scripts": {
48
- "build": "vite build",
48
+ "build": "vite build && node scripts/scope-theme-vars.js",
49
49
  "dev": "vite dev/ --config vite.config.ts",
50
50
  "test": "vitest run",
51
51
  "test:watch": "vitest",
52
52
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p dev/tsconfig.json --noEmit",
53
- "lint": "eslint \"src/**/*.{ts,tsx}\" \"dev/**/*.{ts,tsx}\" \"vite.config.ts\" \"*.js\""
53
+ "lint": "eslint \"src/**/*.{ts,tsx}\" \"dev/**/*.{ts,tsx}\" \"vite.config.ts\" \"*.js\" \"scripts/**/*.js\""
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@emotion/react": "^11.0.0",
@@ -59,9 +59,9 @@
59
59
  "ag-grid-community": "^35.0.0",
60
60
  "ag-grid-react": "^35.0.0",
61
61
  "chart.js": "^4.0.0",
62
- "react": "^19.0.0",
62
+ "react": "^18.0.0 || ^19.0.0",
63
63
  "react-chartjs-2": "^5.0.0",
64
- "react-dom": "^19.0.0"
64
+ "react-dom": "^18.0.0 || ^19.0.0"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@emotion/react": {
@@ -101,8 +101,8 @@
101
101
  "@testing-library/jest-dom": "^7.0.1",
102
102
  "@testing-library/react": "^16.3.2",
103
103
  "@types/node": "^24.0.0",
104
- "@types/react": "^19.2.17",
105
- "@types/react-dom": "^19.2.3",
104
+ "@types/react": "^18.3.31",
105
+ "@types/react-dom": "^18.3.7",
106
106
  "@vitejs/plugin-react": "^4.3.4",
107
107
  "ag-grid-community": "^35.3.0",
108
108
  "ag-grid-react": "^35.3.0",
@@ -113,9 +113,9 @@
113
113
  "eslint-plugin-react-refresh": "^0.5.4",
114
114
  "jsdom": "^29.1.1",
115
115
  "postcss": "^8.5.23",
116
- "react": "^19.2.7",
116
+ "react": "^18.3.1",
117
117
  "react-chartjs-2": "^5.3.1",
118
- "react-dom": "^19.2.7",
118
+ "react-dom": "^18.3.1",
119
119
  "tailwindcss": "^4.3.1",
120
120
  "typescript": "^6.0.3",
121
121
  "typescript-eslint": "^8.67.0",