@gram-ai/elements 1.11.0 → 1.12.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.
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/buttonVariants.d.ts +1 -1
- package/dist/elements.cjs +11 -11
- package/dist/elements.css +1 -1
- package/dist/elements.js +2713 -2583
- package/dist/hooks/useDensity.d.ts +45 -36
- package/dist/hooks/useExpanded.d.ts +1 -0
- package/dist/lib/humanize.d.ts +1 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/types/index.d.ts +33 -34
- package/package.json +1 -1
|
@@ -3,61 +3,70 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare const densityClasses: {
|
|
5
5
|
readonly compact: {
|
|
6
|
-
readonly 'p-
|
|
6
|
+
readonly 'p-xs': "p-1";
|
|
7
|
+
readonly 'p-sm': "p-1.5";
|
|
7
8
|
readonly 'p-md': "p-2";
|
|
8
|
-
readonly 'p-lg': "p-
|
|
9
|
-
readonly 'p-xl': "p-
|
|
10
|
-
readonly 'px-
|
|
11
|
-
readonly 'px-
|
|
12
|
-
readonly 'px-
|
|
13
|
-
readonly 'px-
|
|
14
|
-
readonly '
|
|
15
|
-
readonly 'py-
|
|
16
|
-
readonly 'py-
|
|
9
|
+
readonly 'p-lg': "p-2.5";
|
|
10
|
+
readonly 'p-xl': "p-3";
|
|
11
|
+
readonly 'px-xs': "px-1";
|
|
12
|
+
readonly 'px-sm': "px-1.5";
|
|
13
|
+
readonly 'px-md': "px-2";
|
|
14
|
+
readonly 'px-lg': "px-2.5";
|
|
15
|
+
readonly 'px-xl': "px-3";
|
|
16
|
+
readonly 'py-xs': "py-1";
|
|
17
|
+
readonly 'py-sm': "py-1.5";
|
|
18
|
+
readonly 'py-md': "py-2";
|
|
19
|
+
readonly 'py-lg': "py-2.5";
|
|
17
20
|
readonly 'py-xl': "py-3";
|
|
18
21
|
readonly 'gap-sm': "gap-1";
|
|
19
|
-
readonly 'gap-md': "gap-
|
|
20
|
-
readonly 'gap-lg': "gap-
|
|
21
|
-
readonly 'gap-xl': "gap-
|
|
22
|
+
readonly 'gap-md': "gap-1.5";
|
|
23
|
+
readonly 'gap-lg': "gap-2";
|
|
24
|
+
readonly 'gap-xl': "gap-2.5";
|
|
22
25
|
readonly 'h-header': "h-10";
|
|
23
|
-
readonly 'h-input': "min-h-
|
|
26
|
+
readonly 'h-input': "min-h-10";
|
|
24
27
|
readonly 'text-base': "text-sm";
|
|
25
28
|
readonly 'text-title': "text-xl";
|
|
26
29
|
readonly 'text-subtitle': "text-sm";
|
|
27
30
|
};
|
|
28
31
|
readonly normal: {
|
|
32
|
+
readonly 'p-xs': "p-1";
|
|
29
33
|
readonly 'p-sm': "p-2";
|
|
30
|
-
readonly 'p-md': "p-
|
|
31
|
-
readonly 'p-lg': "p-
|
|
32
|
-
readonly 'p-xl': "p-
|
|
33
|
-
readonly 'px-
|
|
34
|
-
readonly 'px-
|
|
35
|
-
readonly 'px-
|
|
36
|
-
readonly 'px-
|
|
37
|
-
readonly '
|
|
38
|
-
readonly 'py-
|
|
39
|
-
readonly 'py-
|
|
40
|
-
readonly 'py-
|
|
41
|
-
readonly '
|
|
34
|
+
readonly 'p-md': "p-3";
|
|
35
|
+
readonly 'p-lg': "p-4";
|
|
36
|
+
readonly 'p-xl': "p-6";
|
|
37
|
+
readonly 'px-xs': "px-1";
|
|
38
|
+
readonly 'px-sm': "px-2";
|
|
39
|
+
readonly 'px-md': "px-3";
|
|
40
|
+
readonly 'px-lg': "px-4";
|
|
41
|
+
readonly 'px-xl': "px-6";
|
|
42
|
+
readonly 'py-xs': "py-1";
|
|
43
|
+
readonly 'py-sm': "py-2";
|
|
44
|
+
readonly 'py-md': "py-3";
|
|
45
|
+
readonly 'py-lg': "py-4";
|
|
46
|
+
readonly 'py-xl': "py-6";
|
|
47
|
+
readonly 'gap-sm': "gap-1.5";
|
|
42
48
|
readonly 'gap-md': "gap-2";
|
|
43
49
|
readonly 'gap-lg': "gap-3";
|
|
44
|
-
readonly 'gap-xl': "gap-
|
|
50
|
+
readonly 'gap-xl': "gap-4";
|
|
45
51
|
readonly 'h-header': "h-12";
|
|
46
|
-
readonly 'h-input': "min-h-
|
|
52
|
+
readonly 'h-input': "min-h-12";
|
|
47
53
|
readonly 'text-base': "text-base";
|
|
48
54
|
readonly 'text-title': "text-2xl";
|
|
49
55
|
readonly 'text-subtitle': "text-base";
|
|
50
56
|
};
|
|
51
57
|
readonly spacious: {
|
|
58
|
+
readonly 'p-xs': "p-2";
|
|
52
59
|
readonly 'p-sm': "p-3";
|
|
53
|
-
readonly 'p-md': "p-
|
|
54
|
-
readonly 'p-lg': "p-
|
|
60
|
+
readonly 'p-md': "p-4";
|
|
61
|
+
readonly 'p-lg': "p-6";
|
|
55
62
|
readonly 'p-xl': "p-10";
|
|
56
|
-
readonly 'px-
|
|
57
|
-
readonly 'px-
|
|
58
|
-
readonly 'px-
|
|
63
|
+
readonly 'px-xs': "px-2";
|
|
64
|
+
readonly 'px-sm': "px-3";
|
|
65
|
+
readonly 'px-md': "px-4";
|
|
66
|
+
readonly 'px-lg': "px-6";
|
|
59
67
|
readonly 'px-xl': "px-10";
|
|
60
|
-
readonly 'py-
|
|
68
|
+
readonly 'py-xs': "py-2";
|
|
69
|
+
readonly 'py-sm': "py-3";
|
|
61
70
|
readonly 'py-md': "py-4";
|
|
62
71
|
readonly 'py-lg': "py-6";
|
|
63
72
|
readonly 'py-xl': "py-10";
|
|
@@ -66,7 +75,7 @@ declare const densityClasses: {
|
|
|
66
75
|
readonly 'gap-lg': "gap-4";
|
|
67
76
|
readonly 'gap-xl': "gap-6";
|
|
68
77
|
readonly 'h-header': "h-14";
|
|
69
|
-
readonly 'h-input': "min-h-
|
|
78
|
+
readonly 'h-input': "min-h-16";
|
|
70
79
|
readonly 'text-base': "text-lg";
|
|
71
80
|
readonly 'text-title': "text-3xl";
|
|
72
81
|
readonly 'text-subtitle': "text-lg";
|
|
@@ -77,5 +86,5 @@ type DensityToken = keyof (typeof densityClasses)['normal'];
|
|
|
77
86
|
* Hook to get density classes based on theme config
|
|
78
87
|
* Use: const d = useDensity(); then d('p-md') returns the appropriate padding class
|
|
79
88
|
*/
|
|
80
|
-
export declare const useDensity: () => (token: DensityToken) => "p-1" | "p-2" | "p-
|
|
89
|
+
export declare const useDensity: () => (token: DensityToken) => "p-1" | "p-1.5" | "p-2" | "p-2.5" | "p-3" | "px-1" | "px-1.5" | "px-2" | "px-2.5" | "px-3" | "py-1" | "py-1.5" | "py-2" | "py-2.5" | "py-3" | "gap-1" | "gap-1.5" | "gap-2" | "gap-2.5" | "h-10" | "min-h-10" | "text-sm" | "text-xl" | "p-4" | "p-6" | "px-4" | "px-6" | "py-4" | "py-6" | "gap-3" | "gap-4" | "h-12" | "min-h-12" | "text-base" | "text-2xl" | "p-10" | "px-10" | "py-10" | "gap-6" | "h-14" | "min-h-16" | "text-lg" | "text-3xl";
|
|
81
90
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function humanizeToolName(toolName: string): string;
|
package/dist/lib/utils.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -170,6 +170,11 @@ export interface ThemeConfig {
|
|
|
170
170
|
* }
|
|
171
171
|
*/
|
|
172
172
|
export interface ToolsConfig {
|
|
173
|
+
/**
|
|
174
|
+
* Whether individual tool calls within a group should be expanded by default.
|
|
175
|
+
* @default false
|
|
176
|
+
*/
|
|
177
|
+
expandToolGroupsByDefault?: boolean;
|
|
173
178
|
/**
|
|
174
179
|
* `components` can be used to override the default components used by the
|
|
175
180
|
* Elements library for a given tool result.
|
|
@@ -206,13 +211,34 @@ export interface Suggestion {
|
|
|
206
211
|
label: string;
|
|
207
212
|
action: string;
|
|
208
213
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
interface ExpandableDimensions {
|
|
215
|
+
default: {
|
|
216
|
+
width: number | string;
|
|
217
|
+
height: number | string;
|
|
218
|
+
maxHeight?: number | string;
|
|
219
|
+
};
|
|
220
|
+
expanded?: {
|
|
221
|
+
width: number | string;
|
|
222
|
+
height: number | string;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
interface ExpandedConfig {
|
|
226
|
+
/**
|
|
227
|
+
* Whether the modal can be expanded to full screen.
|
|
228
|
+
*/
|
|
229
|
+
expandable?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Whether the modal should be expanded by default.
|
|
232
|
+
* @default false
|
|
233
|
+
*/
|
|
234
|
+
defaultExpanded?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* The dimensions for the modal window.
|
|
237
|
+
*/
|
|
238
|
+
dimensions?: ExpandableDimensions;
|
|
239
|
+
}
|
|
214
240
|
export type ModalTriggerPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
215
|
-
export interface ModalConfig {
|
|
241
|
+
export interface ModalConfig extends ExpandedConfig {
|
|
216
242
|
/**
|
|
217
243
|
* Whether to open the modal window by default.
|
|
218
244
|
*/
|
|
@@ -233,23 +259,6 @@ export interface ModalConfig {
|
|
|
233
259
|
* Receives the current state of the modal window.
|
|
234
260
|
*/
|
|
235
261
|
icon?: (state: 'open' | 'closed' | undefined) => ReactNode;
|
|
236
|
-
/**
|
|
237
|
-
* Whether the modal can be expanded to full screen.
|
|
238
|
-
*/
|
|
239
|
-
expandable?: boolean;
|
|
240
|
-
/**
|
|
241
|
-
* The dimensions for the modal window.
|
|
242
|
-
*/
|
|
243
|
-
dimensions?: {
|
|
244
|
-
/**
|
|
245
|
-
* The default dimensions for the modal window.
|
|
246
|
-
*/
|
|
247
|
-
default: ModalDimension;
|
|
248
|
-
/**
|
|
249
|
-
* The expanded dimensions for the modal window.
|
|
250
|
-
*/
|
|
251
|
-
expanded?: Pick<ModalDimension, 'width' | 'height'>;
|
|
252
|
-
};
|
|
253
262
|
}
|
|
254
263
|
export interface ComposerConfig {
|
|
255
264
|
/**
|
|
@@ -289,22 +298,12 @@ export interface AttachmentsConfig {
|
|
|
289
298
|
*/
|
|
290
299
|
maxSize?: number;
|
|
291
300
|
}
|
|
292
|
-
export interface SidecarConfig {
|
|
301
|
+
export interface SidecarConfig extends ExpandedConfig {
|
|
293
302
|
/**
|
|
294
303
|
* The title displayed in the sidecar header.
|
|
295
304
|
* @default 'Chat'
|
|
296
305
|
*/
|
|
297
306
|
title?: string;
|
|
298
|
-
/**
|
|
299
|
-
* The width of the sidecar panel.
|
|
300
|
-
* @default '400px'
|
|
301
|
-
*/
|
|
302
|
-
width?: string | number | `${number}%`;
|
|
303
|
-
/**
|
|
304
|
-
* The width of the sidecar panel when expanded.
|
|
305
|
-
* @default '800px'
|
|
306
|
-
*/
|
|
307
|
-
expandedWidth?: string | number | `${number}%`;
|
|
308
307
|
}
|
|
309
308
|
export type ElementsContextType = {
|
|
310
309
|
config: ElementsConfig;
|
package/package.json
CHANGED