@gram-ai/elements 1.3.0 → 1.5.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.
@@ -147,20 +147,45 @@ export interface Suggestion {
147
147
  label: string;
148
148
  action: string;
149
149
  }
150
+ type ModalDimension = {
151
+ width: number | `${number}%`;
152
+ height: number | `${number}%`;
153
+ maxHeight?: number | `${number}%`;
154
+ };
155
+ export type ModalTriggerPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
150
156
  export interface ModalConfig {
151
157
  /**
152
158
  * Whether to open the modal window by default.
153
159
  */
154
160
  defaultOpen?: boolean;
161
+ /**
162
+ * The position of the modal trigger
163
+ *
164
+ * @default 'bottom-right'
165
+ */
166
+ position?: ModalTriggerPosition;
155
167
  /**
156
168
  * The icon to use for the modal window.
157
169
  * Receives the current state of the modal window.
158
170
  */
159
171
  icon?: (state: 'open' | 'closed' | undefined) => ReactNode;
160
172
  /**
161
- * A class name to apply to the modal window.
173
+ * Whether the modal can be expanded to full screen.
174
+ */
175
+ expandable?: boolean;
176
+ /**
177
+ * The dimensions for the modal window.
162
178
  */
163
- className?: string;
179
+ dimensions?: {
180
+ /**
181
+ * The default dimensions for the modal window.
182
+ */
183
+ default: ModalDimension;
184
+ /**
185
+ * The expanded dimensions for the modal window.
186
+ */
187
+ expanded?: Pick<ModalDimension, 'width' | 'height'>;
188
+ };
164
189
  }
165
190
  export interface ComposerConfig {
166
191
  /**
@@ -178,6 +203,8 @@ export type ElementsContextType = {
178
203
  config: ElementsConfig;
179
204
  setModel: (model: Model) => void;
180
205
  model: Model;
206
+ isExpanded: boolean;
207
+ setIsExpanded: (isExpanded: boolean) => void;
181
208
  };
182
209
  declare const ContentSchema: z.ZodUnion<readonly [z.ZodObject<{
183
210
  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.3.0",
5
+ "version": "1.5.0",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
8
8
  ".": {