@gram-ai/elements 1.2.6 → 1.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.
@@ -38,8 +38,7 @@ export interface ElementsConfig {
38
38
  /**
39
39
  * Custom environment variable overrides for the Elements library.
40
40
  * Will be used to override the environment variables for the MCP server.
41
- *
42
- * TODO: Not yet functional
41
+ * For more documentation on passing through different kinds of environment variables, including bearer tokens, see the [Gram documentation](https://www.speakeasy.com/docs/gram/host-mcp/public-private-servers#pass-through-authentication).
43
42
  */
44
43
  environment?: Record<string, unknown>;
45
44
  /**
@@ -148,6 +147,11 @@ export interface Suggestion {
148
147
  label: string;
149
148
  action: string;
150
149
  }
150
+ type ModalDimension = {
151
+ width: number | `${number}%`;
152
+ height: number | `${number}%`;
153
+ maxHeight?: number | `${number}%`;
154
+ };
151
155
  export interface ModalConfig {
152
156
  /**
153
157
  * Whether to open the modal window by default.
@@ -159,9 +163,16 @@ export interface ModalConfig {
159
163
  */
160
164
  icon?: (state: 'open' | 'closed' | undefined) => ReactNode;
161
165
  /**
162
- * A class name to apply to the modal window.
166
+ * Whether the modal can be expanded to full screen.
167
+ */
168
+ expandable?: boolean;
169
+ /**
170
+ * The dimensions for the modal window.
163
171
  */
164
- className?: string;
172
+ dimensions?: {
173
+ default: ModalDimension;
174
+ expanded?: Pick<ModalDimension, 'width' | 'height'>;
175
+ };
165
176
  }
166
177
  export interface ComposerConfig {
167
178
  /**
@@ -179,6 +190,8 @@ export type ElementsContextType = {
179
190
  config: ElementsConfig;
180
191
  setModel: (model: Model) => void;
181
192
  model: Model;
193
+ isExpanded: boolean;
194
+ setIsExpanded: (isExpanded: boolean) => void;
182
195
  };
183
196
  declare const ContentSchema: z.ZodUnion<readonly [z.ZodObject<{
184
197
  type: z.ZodLiteral<"text">;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gram-ai/elements",
3
3
  "description": "Gram Elements is a library of UI primitives for building chat-like experiences for MCP Servers.",
4
4
  "type": "module",
5
- "version": "1.2.6",
5
+ "version": "1.4.0",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
8
8
  ".": {