@icanbwell/baileyai-chat-ui 1.0.29 → 1.1.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/README.md CHANGED
@@ -444,7 +444,7 @@ Pass a stable function for `renderMessageActions`. The control renders nothing w
444
444
  - The comment is PHI-capable. It is passed to `onSubmit` only, never to the console, the trace panel or any other callback. Do not log it in your handler either.
445
445
  - Strings are overridable through the `labels` prop (`BaileyFeedbackLabels`), merged shallowly with English defaults, like `BaileyChatPanel`'s labels.
446
446
 
447
- Minimum backend: the assistant `message_id` on `response.completed` (and `X-Message-Id` for non-streaming responses) and the feedback routes from BAI-1231 (baileyai, BAI-1234). On a backend without them the buttons simply do not appear. A `503` from the feedback API means feedback is disabled for that environment; with `chat.feedback` the panel then hides the buttons for the rest of that client's use. A host rendering its own `BaileyFeedbackButtons` should hide the control itself.
447
+ Minimum backend: the assistant `message_id` on `response.completed` (and `X-Message-Id` for non-streaming responses) and the feedback routes from BAI-1231 (baileyai, BAI-1234). On a backend without them the buttons simply do not appear. A `503` from the feedback API means feedback is disabled for that environment, and a `405` means the route does not accept the method; with `chat.feedback` the panel then hides the buttons for the rest of that client's use. A `404` is one message not found, so the buttons stay. A host rendering its own `BaileyFeedbackButtons` should hide the control itself.
448
448
 
449
449
  ## Localization
450
450
 
@@ -468,25 +468,59 @@ need to supply the keys you're actually translating, the rest fall back to the E
468
468
 
469
469
  See the `BaileyChatPanelLabels` type for the full list of overridable strings.
470
470
 
471
- ## Theming
472
-
473
- The package ships CSS custom properties with sensible defaults; override any of them from your app's own CSS to match your brand:
471
+ ## Styling
472
+
473
+ Style the panel by setting CSS custom properties from your own CSS. Custom properties inherit through shadow roots, so the same approach works whether the panel renders in the page or inside a shadow DOM. Set them on `:root`, on a shadow host, or on any wrapper around the panel. Nothing is required: each token falls back to the default shown.
474
+
475
+ **Do not select `.bailey-*` classes.** They are internal and can change in any release. If you need to change something the tokens below don't cover, ask for a token or a prop instead.
476
+
477
+ Colors:
478
+
479
+ | Token | Default | Used for |
480
+ |---|---|---|
481
+ | `--color-bailey-accent` | `#4f46e5` | links, selected states, focus ring, spinners |
482
+ | `--color-bailey-bubble-bg` | `#ffffff` | user message bubble |
483
+ | `--color-bailey-text` | `#000000` | primary text |
484
+ | `--color-bailey-text-secondary` | `#6b6b6b` | secondary text, icons |
485
+ | `--color-bailey-error` | `#d32f2f` | errors, stop button |
486
+ | `--color-bailey-border` | `#e5e5e5` | borders |
487
+ | `--color-bailey-surface` | `#ffffff` | cards, input row |
488
+ | `--color-bailey-surface-muted` | `#f9fafb` | table headers, inline code, code blocks |
489
+ | `--color-bailey-page-bg` | `#eceef4` | panel background |
490
+ | `--color-bailey-heart` | `#16a34a` | send button |
491
+ | `--color-bailey-tooltip-bg` | `#000000` | tooltip background |
492
+ | `--color-bailey-tooltip-text` | `#ffffff` | tooltip text |
493
+
494
+ Typography and shape (all optional):
495
+
496
+ | Token | Default |
497
+ |---|---|
498
+ | `--bailey-font-sans` | `"Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif` |
499
+ | `--bailey-input-radius` | `9999px` |
500
+ | `--bailey-input-border-color` | `var(--color-bailey-border)` |
501
+ | `--bailey-send-fg` | `var(--color-bailey-heart)` |
502
+ | `--bailey-send-bg` | `transparent` |
503
+ | `--bailey-send-bg-hover` | `--color-bailey-heart` at 10% |
504
+ | `--bailey-stop-fg` | `var(--color-bailey-error)` |
505
+ | `--bailey-stop-bg` | `transparent` |
506
+ | `--bailey-stop-bg-hover` | `--color-bailey-error` at 10% |
507
+ | `--bailey-suggestion-radius` | `1rem` |
508
+ | `--bailey-suggestion-border` | `none` |
509
+ | `--bailey-suggestion-font-weight` | `normal` |
474
510
 
475
511
  ```css
476
- :root {
477
- --color-bailey-accent: #4f46e5;
478
- --color-bailey-bubble-bg: #e8e8e8;
479
- --color-bailey-text: #000000;
480
- --color-bailey-error: #d32f2f;
481
- --color-bailey-border: #e5e5e5;
482
- --color-bailey-surface: #ffffff;
483
- --color-bailey-surface-muted: #f9fafb;
484
- --color-bailey-text-secondary: #6b6b6b;
485
- --color-bailey-tooltip-bg: #000000;
486
- --color-bailey-tooltip-text: #ffffff;
512
+ .my-chat-wrapper {
513
+ --color-bailey-accent: #6d28d9;
514
+ --bailey-font-sans: 'Fraunces', serif;
515
+ --bailey-send-bg: #1f2937;
516
+ --bailey-send-fg: #ffffff;
487
517
  }
488
518
  ```
489
519
 
520
+ `--bailey-font-sans` is separate from `--font-sans` on purpose: a Tailwind host defines its own `--font-sans`, and the panel must not pick it up by accident.
521
+
522
+ Layout props on `BaileyChatPanel`: `suggestionsAlign` (`'start'` | `'end'`; `'end'` right-aligns the cards and anchors them to the bottom of the transcript, just above the input), an empty `labels.suggestionsTitle` (omits the title), and `hideMenuButton` (hides the "..." menu, including its "New chat" and history items, so supply your own entry points).
523
+
490
524
  The package's own `styles.css` deliberately skips Tailwind's Preflight reset, so it coexists with a host app's own base styles (e.g. MUI's `CssBaseline`) without a global collision.
491
525
 
492
526
  If your host app is itself built with Tailwind v4, import your own Tailwind stylesheet **before** `@icanbwell/baileyai-chat-ui/styles.css`: