@saar-ai/web-widget 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +209 -0
  2. package/dist/bot-avatar.d.ts +41 -0
  3. package/dist/bot-avatar.d.ts.map +1 -0
  4. package/dist/bot-face.d.ts +39 -0
  5. package/dist/bot-face.d.ts.map +1 -0
  6. package/dist/bot-state.d.ts +39 -0
  7. package/dist/bot-state.d.ts.map +1 -0
  8. package/dist/chunks/chat-ZLxYRTml.js +173 -0
  9. package/dist/chunks/esm-DSxqq2-d.js +3299 -0
  10. package/dist/chunks/host-widget-iy3qC-1p.js +7677 -0
  11. package/dist/chunks/livekit-client.esm-OPuvn_z-.js +26600 -0
  12. package/dist/chunks/schemas-Bl_6mxe4.js +4123 -0
  13. package/dist/chunks/telemetry-Bw-3F_Zk.js +290 -0
  14. package/dist/cn.d.ts +14 -0
  15. package/dist/cn.d.ts.map +1 -0
  16. package/dist/concierge-launcher.d.ts +50 -0
  17. package/dist/concierge-launcher.d.ts.map +1 -0
  18. package/dist/concierge-shell.d.ts +194 -0
  19. package/dist/concierge-shell.d.ts.map +1 -0
  20. package/dist/error-boundary.d.ts +34 -0
  21. package/dist/error-boundary.d.ts.map +1 -0
  22. package/dist/format-money.d.ts +20 -0
  23. package/dist/format-money.d.ts.map +1 -0
  24. package/dist/generated/widget-css.d.ts +2 -0
  25. package/dist/generated/widget-css.d.ts.map +1 -0
  26. package/dist/host-widget.d.ts +165 -0
  27. package/dist/host-widget.d.ts.map +1 -0
  28. package/dist/index.d.ts +28 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +583 -0
  31. package/dist/messages.d.ts +116 -0
  32. package/dist/messages.d.ts.map +1 -0
  33. package/dist/morphing-loader.d.ts +16 -0
  34. package/dist/morphing-loader.d.ts.map +1 -0
  35. package/dist/mount.d.ts +45 -0
  36. package/dist/mount.d.ts.map +1 -0
  37. package/dist/next/index.d.ts +3 -0
  38. package/dist/next/index.d.ts.map +1 -0
  39. package/dist/next/index.js +86 -0
  40. package/dist/next/use-next-bridge.d.ts +113 -0
  41. package/dist/next/use-next-bridge.d.ts.map +1 -0
  42. package/dist/position.d.ts +65 -0
  43. package/dist/position.d.ts.map +1 -0
  44. package/dist/session-log.d.ts +84 -0
  45. package/dist/session-log.d.ts.map +1 -0
  46. package/dist/session-panel.d.ts +15 -0
  47. package/dist/session-panel.d.ts.map +1 -0
  48. package/dist/sse-parser.d.ts +38 -0
  49. package/dist/sse-parser.d.ts.map +1 -0
  50. package/dist/styles.d.ts +19 -0
  51. package/dist/styles.d.ts.map +1 -0
  52. package/dist/text-direction.d.ts +49 -0
  53. package/dist/text-direction.d.ts.map +1 -0
  54. package/dist/use-chat-session.d.ts +344 -0
  55. package/dist/use-chat-session.d.ts.map +1 -0
  56. package/dist/use-voice-session.d.ts +273 -0
  57. package/dist/use-voice-session.d.ts.map +1 -0
  58. package/dist/voice-session-state.d.ts +44 -0
  59. package/dist/voice-session-state.d.ts.map +1 -0
  60. package/dist/voice-widget.d.ts +167 -0
  61. package/dist/voice-widget.d.ts.map +1 -0
  62. package/dist/widget-cards.d.ts +69 -0
  63. package/dist/widget-cards.d.ts.map +1 -0
  64. package/dist/widget-cart-summary.d.ts +66 -0
  65. package/dist/widget-cart-summary.d.ts.map +1 -0
  66. package/dist/widget-markdown.d.ts +33 -0
  67. package/dist/widget-markdown.d.ts.map +1 -0
  68. package/dist/widget.css +2 -0
  69. package/package.json +88 -0
  70. package/src/styles/concierge.css +351 -0
  71. package/src/styles/tokens.css +67 -0
  72. package/src/styles/widget-entry.css +13 -0
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Self-contained design tokens for the SHADOW-DOM build only
3
+ * (docs/WIDGET_EMBED_PLAN.md §4 Phase 3, coupling (5) — "Shadow-root mount").
4
+ *
5
+ * Copied from `packages/ui/src/theme/color-tokens.css` (the `--widget-*`
6
+ * surface roles and the `--color-brand-*` ramp steps `concierge.css`
7
+ * references) rather than imported — this package has ZERO `@wesence/*`
8
+ * dependencies by design (see AGENTS.md), and `mountConciergeWidget` sets
9
+ * `all: initial` on the shadow host specifically so a merchant page's own
10
+ * CSS custom properties (including `@wesence/ui`'s `--widget-*`/`--brand-*`
11
+ * if the SAME page happens to define them) stop inheriting into the shadow
12
+ * tree — the widget must supply every token it uses itself, not assume the
13
+ * host page defines them.
14
+ *
15
+ * `:host` is the shadow-tree equivalent of `:root` — these bind on the
16
+ * shadow host element rather than the document root. `:root` is also bound,
17
+ * harmlessly, for the (untested-in-shadow) case a caller injects this CSS
18
+ * into light DOM instead.
19
+ *
20
+ * Same duplication tradeoff as `cn.ts` / `text-direction.ts` — keep in sync
21
+ * by hand; a third copy is the signal to extract a shared package.
22
+ */
23
+
24
+ :host,
25
+ :root {
26
+ --widget-card: oklch(98.2% 0 0 / 0.97);
27
+ --widget-bubble: oklch(95% 0.006 84.6 / 0.92);
28
+ --widget-chip: oklch(92.7% 0.008 73.7 / 0.78);
29
+ --widget-foreground: oklch(30.5% 0.002 106.5);
30
+ --widget-foreground-muted: oklch(30.5% 0.002 106.5 / 0.62);
31
+ --widget-accent: oklch(46.8% 0.043 126.6);
32
+ --widget-accent-foreground: oklch(97% 0.012 125.3);
33
+ --widget-accent-ring: oklch(80% 0.05 125.3);
34
+ --widget-shadow-tint: oklch(46.8% 0.043 126.6);
35
+
36
+ --color-brand-plum-800: oklch(42% 0.19 330);
37
+ --color-brand-plum-400: oklch(69.5% 0.169 330);
38
+ --color-brand-rose-500: oklch(65% 0.22 20);
39
+ --color-brand-rose-400: oklch(71.4% 0.19 20);
40
+ --color-brand-amber-400: oklch(80% 0.16 80);
41
+ --color-brand-amber-500: oklch(70.7% 0.185 80);
42
+ --color-brand-amber-300: oklch(84.3% 0.121 80);
43
+ --color-brand-ink: oklch(21% 0.01 280);
44
+
45
+ /* Approximation of the shadcn `--background`/`--foreground` pair
46
+ `concierge.css`'s `.dark` block chains through — a merchant page has no
47
+ reason to define either, so the shadow bundle owns a reasonable
48
+ light-mode fallback directly rather than resolving to `unset`. */
49
+ --background: oklch(100% 0 0);
50
+ --foreground: oklch(21% 0.01 280);
51
+ }
52
+
53
+ :host(.dark),
54
+ .dark {
55
+ --widget-card: oklch(26% 0.012 124.8 / 0.95);
56
+ --widget-bubble: oklch(31.6% 0.023 124.8 / 0.9);
57
+ --widget-chip: oklch(31.6% 0.023 124.8 / 0.75);
58
+ --widget-foreground: oklch(97% 0.006 84.6);
59
+ --widget-foreground-muted: oklch(97% 0.006 84.6 / 0.65);
60
+ --widget-accent: oklch(80% 0.05 125.3);
61
+ --widget-accent-foreground: oklch(26% 0.012 124.8);
62
+ --widget-accent-ring: oklch(85.8% 0.037 17.9);
63
+ --widget-shadow-tint: oklch(31.6% 0.023 124.8);
64
+
65
+ --background: oklch(14% 0.01 280);
66
+ --foreground: oklch(97% 0.006 84.6);
67
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Tailwind CLI entry point for the SHADOW-DOM CSS bundle
3
+ * (docs/WIDGET_EMBED_PLAN.md §4 Phase 3, coupling (5)). Compiled by
4
+ * `pnpm --filter @saar-ai/web-widget build:css` into `dist/widget.css` and
5
+ * `src/generated/widget-css.ts`'s `WIDGET_CSS` string — never imported by a
6
+ * consuming app directly (apps/web keeps rendering this package's
7
+ * components in light DOM via its own `@source` scan of `src/**`, per
8
+ * AGENTS.md's "App CSS wiring" — this file is the OTHER, shadow-DOM path).
9
+ */
10
+ @import 'tailwindcss';
11
+ @source '../**/*.{ts,tsx}';
12
+ @import './tokens.css';
13
+ @import './concierge.css';