@mast-ai/react-ui 0.3.0 → 0.4.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.
@@ -9,11 +9,11 @@ import type { GetToolLabel } from './ToolLabelContext.js';
9
9
  */
10
10
  export interface ConversationPanelProps {
11
11
  /**
12
- * Forces a theme regardless of the user's `prefers-color-scheme` setting.
13
- * When omitted, the panel follows the OS preference via the default
14
- * stylesheet's media query.
12
+ * Selects the panel's theme. Defaults to `'light'`. Pass `'dark'` to force
13
+ * the dark palette regardless of OS preference, or `'auto'` to follow the
14
+ * user's `prefers-color-scheme` setting.
15
15
  */
16
- theme?: 'light' | 'dark';
16
+ theme?: 'light' | 'dark' | 'auto';
17
17
  /** Optional class added to the root `[data-mast-root]` element. */
18
18
  className?: string;
19
19
  /**
@@ -54,8 +54,12 @@ export interface ConversationPanelProps {
54
54
  *
55
55
  * Internally renders {@link MessageList} and {@link ChatInput} inside a
56
56
  * `[data-mast-root]` div so the default stylesheet's CSS custom properties
57
- * resolve. Sets `data-mast-theme` from the optional `theme` prop, which the
58
- * default stylesheet uses to override the OS-driven dark mode preference.
57
+ * resolve. The same div carries `mast-panel` so the bundled chrome (border,
58
+ * padding, flex column, `height: 100%`) is applied; consumers composing
59
+ * primitives manually opt into chrome by adding the class themselves (see
60
+ * USAGE.md §8). `data-mast-theme` is set from the optional `theme` prop;
61
+ * the default stylesheet uses it to select between light, dark, and an
62
+ * OS-following auto mode.
59
63
  *
60
64
  * Must be rendered inside an `<AgentProvider>`.
61
65
  */
package/dist/context.d.ts CHANGED
@@ -71,15 +71,15 @@ export interface AgentProviderProps {
71
71
  */
72
72
  onConversationChange?: (history: Message[], entries: ConversationEntry[]) => void;
73
73
  /**
74
- * Forces a theme on the auto-rendered `[data-mast-root]` wrapper. Only
74
+ * Selects the theme on the auto-rendered `[data-mast-root]` wrapper.
75
+ * Defaults to `'light'`. Pass `'dark'` to force the dark palette or
76
+ * `'auto'` to follow the OS `prefers-color-scheme` preference. Only
75
77
  * meaningful when `disableRoot` is explicitly `false` (so the provider
76
78
  * actually renders the wrapper); when omitted or `true`, this prop has no
77
79
  * effect and consumers should set `data-mast-theme` themselves on whatever
78
- * element carries `data-mast-root`. When the wrapper is rendered without a
79
- * theme set, the panel follows OS preference via the default stylesheet's
80
- * `prefers-color-scheme` media query.
80
+ * element carries `data-mast-root`.
81
81
  */
82
- theme?: 'light' | 'dark';
82
+ theme?: 'light' | 'dark' | 'auto';
83
83
  /**
84
84
  * Controls whether the provider renders an auto wrapper `<div data-mast-root>`
85
85
  * around `children`.
package/dist/index.js CHANGED
@@ -1076,7 +1076,7 @@ function ve({
1076
1076
  inputPlaceholder: i,
1077
1077
  mentions: o
1078
1078
  }) {
1079
- const m = ["mast-conversation-panel", n].filter(Boolean).join(" ");
1079
+ const m = ["mast-panel", "mast-conversation-panel", n].filter(Boolean).join(" ");
1080
1080
  return /* @__PURE__ */ w("div", { "data-mast-root": !0, "data-mast-theme": t, className: m, children: [
1081
1081
  /* @__PURE__ */ e(
1082
1082
  de,