@tylertech/forge-ai-react 0.1.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/LICENSE +202 -0
- package/README.md +19 -0
- package/dist/ForgeAiActionsToolbar.d.ts +57 -0
- package/dist/ForgeAiActionsToolbar.js +36 -0
- package/dist/ForgeAiArtifact.d.ts +57 -0
- package/dist/ForgeAiArtifact.js +18 -0
- package/dist/ForgeAiButton.d.ts +55 -0
- package/dist/ForgeAiButton.js +21 -0
- package/dist/ForgeAiChainOfThought.d.ts +52 -0
- package/dist/ForgeAiChainOfThought.js +21 -0
- package/dist/ForgeAiChatHeader.d.ts +85 -0
- package/dist/ForgeAiChatHeader.js +62 -0
- package/dist/ForgeAiChatInterface.d.ts +66 -0
- package/dist/ForgeAiChatInterface.js +30 -0
- package/dist/ForgeAiDialog.d.ts +80 -0
- package/dist/ForgeAiDialog.js +43 -0
- package/dist/ForgeAiDropdownMenu.d.ts +99 -0
- package/dist/ForgeAiDropdownMenu.js +44 -0
- package/dist/ForgeAiDropdownMenuItem.d.ts +89 -0
- package/dist/ForgeAiDropdownMenuItem.js +52 -0
- package/dist/ForgeAiDropdownMenuItemGroup.d.ts +53 -0
- package/dist/ForgeAiDropdownMenuItemGroup.js +20 -0
- package/dist/ForgeAiDropdownMenuSeparator.d.ts +49 -0
- package/dist/ForgeAiDropdownMenuSeparator.js +20 -0
- package/dist/ForgeAiEmbeddedChat.d.ts +76 -0
- package/dist/ForgeAiEmbeddedChat.js +44 -0
- package/dist/ForgeAiEmptyState.d.ts +53 -0
- package/dist/ForgeAiEmptyState.js +18 -0
- package/dist/ForgeAiFab.d.ts +58 -0
- package/dist/ForgeAiFab.js +22 -0
- package/dist/ForgeAiFilePicker.d.ts +77 -0
- package/dist/ForgeAiFilePicker.js +41 -0
- package/dist/ForgeAiFloatingChat.d.ts +87 -0
- package/dist/ForgeAiFloatingChat.js +54 -0
- package/dist/ForgeAiGradientContainer.d.ts +55 -0
- package/dist/ForgeAiGradientContainer.js +21 -0
- package/dist/ForgeAiIcon.d.ts +52 -0
- package/dist/ForgeAiIcon.js +21 -0
- package/dist/ForgeAiModal.d.ts +79 -0
- package/dist/ForgeAiModal.js +41 -0
- package/dist/ForgeAiOverlay.d.ts +73 -0
- package/dist/ForgeAiOverlay.js +25 -0
- package/dist/ForgeAiPopover.d.ts +73 -0
- package/dist/ForgeAiPopover.js +25 -0
- package/dist/ForgeAiPrompt.d.ts +69 -0
- package/dist/ForgeAiPrompt.js +36 -0
- package/dist/ForgeAiReasoning.d.ts +52 -0
- package/dist/ForgeAiReasoning.js +21 -0
- package/dist/ForgeAiReasoningContent.d.ts +49 -0
- package/dist/ForgeAiReasoningContent.js +18 -0
- package/dist/ForgeAiReasoningHeader.d.ts +65 -0
- package/dist/ForgeAiReasoningHeader.js +35 -0
- package/dist/ForgeAiResponseMessage.d.ts +57 -0
- package/dist/ForgeAiResponseMessage.js +36 -0
- package/dist/ForgeAiSidebar.d.ts +70 -0
- package/dist/ForgeAiSidebar.js +35 -0
- package/dist/ForgeAiSidebarChat.d.ts +87 -0
- package/dist/ForgeAiSidebarChat.js +54 -0
- package/dist/ForgeAiSuggestions.d.ts +63 -0
- package/dist/ForgeAiSuggestions.js +39 -0
- package/dist/ForgeAiThoughtBase.d.ts +57 -0
- package/dist/ForgeAiThoughtBase.js +21 -0
- package/dist/ForgeAiThoughtDetail.d.ts +49 -0
- package/dist/ForgeAiThoughtDetail.js +18 -0
- package/dist/ForgeAiThoughtImage.d.ts +52 -0
- package/dist/ForgeAiThoughtImage.js +21 -0
- package/dist/ForgeAiThoughtSearchResult.d.ts +55 -0
- package/dist/ForgeAiThoughtSearchResult.js +22 -0
- package/dist/ForgeAiThreads.d.ts +71 -0
- package/dist/ForgeAiThreads.js +48 -0
- package/dist/ForgeAiTooltip.d.ts +79 -0
- package/dist/ForgeAiTooltip.js +27 -0
- package/dist/ForgeAiUserMessage.d.ts +49 -0
- package/dist/ForgeAiUserMessage.js +18 -0
- package/dist/ForgeAiVoiceInput.d.ts +57 -0
- package/dist/ForgeAiVoiceInput.js +36 -0
- package/dist/ForgePromptButton.d.ts +52 -0
- package/dist/ForgePromptButton.js +21 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +38 -0
- package/dist/react-utils.js +34 -0
- package/package.json +62 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiReasoningHeader as ForgeAiReasoningHeaderElement } from "@tylertech/forge-ai/ai-reasoning-header";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiReasoningHeaderElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiReasoningHeaderProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** Whether the header is expanded */
|
|
23
|
+
expanded?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Whether this is a reasoning header */
|
|
26
|
+
reasoning?: boolean;
|
|
27
|
+
|
|
28
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
29
|
+
className?: string;
|
|
30
|
+
|
|
31
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
32
|
+
exportparts?: string;
|
|
33
|
+
|
|
34
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
35
|
+
htmlFor?: string;
|
|
36
|
+
|
|
37
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
38
|
+
key?: number | string;
|
|
39
|
+
|
|
40
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
41
|
+
part?: string;
|
|
42
|
+
|
|
43
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
44
|
+
ref?: any;
|
|
45
|
+
|
|
46
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
47
|
+
tabIndex?: number;
|
|
48
|
+
|
|
49
|
+
/** Fired when the header is clicked and the expanded state changes */
|
|
50
|
+
onToggle?: (event: CustomEvent<CustomEvent<{ expanded: boolean }>>) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* ---
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
* ### **Events:**
|
|
59
|
+
* - **toggle** - Fired when the header is clicked and the expanded state changes
|
|
60
|
+
*
|
|
61
|
+
* ### **Slots:**
|
|
62
|
+
* - **title** - Content for the header when in regular (non-reasoning) state
|
|
63
|
+
* - **reasoning-title** - Content for the header when in reasoning state
|
|
64
|
+
*/
|
|
65
|
+
export const ForgeAiReasoningHeader: React.ForwardRefExoticComponent<ForgeAiReasoningHeaderProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-reasoning-header";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiReasoningHeader = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { expanded, reasoning, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "toggle", props.onToggle);
|
|
11
|
+
|
|
12
|
+
return React.createElement(
|
|
13
|
+
"forge-ai-reasoning-header",
|
|
14
|
+
{
|
|
15
|
+
ref: (node) => {
|
|
16
|
+
ref.current = node;
|
|
17
|
+
if (typeof forwardedRef === "function") {
|
|
18
|
+
forwardedRef(node);
|
|
19
|
+
} else if (forwardedRef) {
|
|
20
|
+
forwardedRef.current = node;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
...filteredProps,
|
|
24
|
+
class: props.className,
|
|
25
|
+
exportparts: props.exportparts,
|
|
26
|
+
for: props.htmlFor,
|
|
27
|
+
part: props.part,
|
|
28
|
+
tabindex: props.tabIndex,
|
|
29
|
+
expanded: props.expanded ? true : undefined,
|
|
30
|
+
reasoning: props.reasoning ? true : undefined,
|
|
31
|
+
style: { ...props.style },
|
|
32
|
+
},
|
|
33
|
+
props.children,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiResponseMessage as ForgeAiResponseMessageElement } from "@tylertech/forge-ai/ai-response-message";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiResponseMessageElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiResponseMessageProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
23
|
+
className?: string;
|
|
24
|
+
|
|
25
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
26
|
+
exportparts?: string;
|
|
27
|
+
|
|
28
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
29
|
+
htmlFor?: string;
|
|
30
|
+
|
|
31
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
32
|
+
key?: number | string;
|
|
33
|
+
|
|
34
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
35
|
+
part?: string;
|
|
36
|
+
|
|
37
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
38
|
+
ref?: any;
|
|
39
|
+
|
|
40
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
|
|
43
|
+
/** Fired when an action button is clicked. */
|
|
44
|
+
onForgeAiResponseMessageAction?: (
|
|
45
|
+
event: CustomEvent<CustomEvent<AiResponseMessageActionEventData>>,
|
|
46
|
+
) => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* ---
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* ### **Events:**
|
|
55
|
+
* - **forge-ai-response-message-action** - Fired when an action button is clicked.
|
|
56
|
+
*/
|
|
57
|
+
export const ForgeAiResponseMessage: React.ForwardRefExoticComponent<ForgeAiResponseMessageProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-response-message";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiResponseMessage = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
|
|
8
|
+
/** Event listeners - run once */
|
|
9
|
+
useEventListener(
|
|
10
|
+
ref,
|
|
11
|
+
"forge-ai-response-message-action",
|
|
12
|
+
props.onForgeAiResponseMessageAction,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return React.createElement(
|
|
16
|
+
"forge-ai-response-message",
|
|
17
|
+
{
|
|
18
|
+
ref: (node) => {
|
|
19
|
+
ref.current = node;
|
|
20
|
+
if (typeof forwardedRef === "function") {
|
|
21
|
+
forwardedRef(node);
|
|
22
|
+
} else if (forwardedRef) {
|
|
23
|
+
forwardedRef.current = node;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
...props,
|
|
27
|
+
class: props.className,
|
|
28
|
+
exportparts: props.exportparts,
|
|
29
|
+
for: props.htmlFor,
|
|
30
|
+
part: props.part,
|
|
31
|
+
tabindex: props.tabIndex,
|
|
32
|
+
style: { ...props.style },
|
|
33
|
+
},
|
|
34
|
+
props.children,
|
|
35
|
+
);
|
|
36
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiSidebar as ForgeAiSidebarElement } from "@tylertech/forge-ai/ai-sidebar";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiSidebarElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiSidebarProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** Indicates whether the sidebar is open. */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
|
|
25
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
26
|
+
className?: string;
|
|
27
|
+
|
|
28
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
29
|
+
exportparts?: string;
|
|
30
|
+
|
|
31
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
32
|
+
htmlFor?: string;
|
|
33
|
+
|
|
34
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
35
|
+
key?: number | string;
|
|
36
|
+
|
|
37
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
38
|
+
part?: string;
|
|
39
|
+
|
|
40
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
41
|
+
ref?: any;
|
|
42
|
+
|
|
43
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
44
|
+
tabIndex?: number;
|
|
45
|
+
|
|
46
|
+
/** Fired when the sidebar is opened */
|
|
47
|
+
onForgeAiSidebarOpen?: (event: CustomEvent) => void;
|
|
48
|
+
|
|
49
|
+
/** Fired when the sidebar is closed */
|
|
50
|
+
onForgeAiSidebarClose?: (event: CustomEvent) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* ---
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
* ### **Events:**
|
|
59
|
+
* - **forge-ai-sidebar-open** - Fired when the sidebar is opened
|
|
60
|
+
* - **forge-ai-sidebar-close** - Fired when the sidebar is closed
|
|
61
|
+
*
|
|
62
|
+
* ### **Methods:**
|
|
63
|
+
* - **show(): _void_** - Opens the sidebar.
|
|
64
|
+
* - **close(): _void_** - Closes the sidebar.
|
|
65
|
+
* - **toggle(): _void_** - Toggles the sidebar open state.
|
|
66
|
+
*
|
|
67
|
+
* ### **Slots:**
|
|
68
|
+
* - _default_ - Default slot for sidebar content (typically ai-chat-interface)
|
|
69
|
+
*/
|
|
70
|
+
export const ForgeAiSidebar: React.ForwardRefExoticComponent<ForgeAiSidebarProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-sidebar";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiSidebar = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { open, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "forge-ai-sidebar-open", props.onForgeAiSidebarOpen);
|
|
11
|
+
useEventListener(ref, "forge-ai-sidebar-close", props.onForgeAiSidebarClose);
|
|
12
|
+
|
|
13
|
+
return React.createElement(
|
|
14
|
+
"forge-ai-sidebar",
|
|
15
|
+
{
|
|
16
|
+
ref: (node) => {
|
|
17
|
+
ref.current = node;
|
|
18
|
+
if (typeof forwardedRef === "function") {
|
|
19
|
+
forwardedRef(node);
|
|
20
|
+
} else if (forwardedRef) {
|
|
21
|
+
forwardedRef.current = node;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
...filteredProps,
|
|
25
|
+
class: props.className,
|
|
26
|
+
exportparts: props.exportparts,
|
|
27
|
+
for: props.htmlFor,
|
|
28
|
+
part: props.part,
|
|
29
|
+
tabindex: props.tabIndex,
|
|
30
|
+
open: props.open ? true : undefined,
|
|
31
|
+
style: { ...props.style },
|
|
32
|
+
},
|
|
33
|
+
props.children,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiSidebarChat as ForgeAiSidebarChatElement } from "@tylertech/forge-ai/ai-sidebar-chat";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiSidebarChatElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiSidebarChatProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** Indicates whether the sidebar chat is open. */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Controls whether the chat is displayed in an expanded modal state.
|
|
26
|
+
When true, the chat content will be shown in a fullscreen modal.
|
|
27
|
+
When false, the chat will be displayed in the sidebar. */
|
|
28
|
+
expanded?: boolean;
|
|
29
|
+
|
|
30
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
31
|
+
className?: string;
|
|
32
|
+
|
|
33
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
34
|
+
exportparts?: string;
|
|
35
|
+
|
|
36
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
37
|
+
htmlFor?: string;
|
|
38
|
+
|
|
39
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
40
|
+
key?: number | string;
|
|
41
|
+
|
|
42
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
43
|
+
part?: string;
|
|
44
|
+
|
|
45
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
46
|
+
ref?: any;
|
|
47
|
+
|
|
48
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
49
|
+
tabIndex?: number;
|
|
50
|
+
|
|
51
|
+
/** Fired when the sidebar chat is opened */
|
|
52
|
+
onForgeAiSidebarChatOpen?: (event: CustomEvent) => void;
|
|
53
|
+
|
|
54
|
+
/** Fired when the sidebar chat is closed */
|
|
55
|
+
onForgeAiSidebarChatClose?: (event: CustomEvent) => void;
|
|
56
|
+
|
|
57
|
+
/** Fired when the sidebar chat is expanded to modal */
|
|
58
|
+
onForgeAiSidebarChatExpand?: (event: CustomEvent) => void;
|
|
59
|
+
|
|
60
|
+
/** Fired when the sidebar chat is collapsed from modal */
|
|
61
|
+
onForgeAiSidebarChatCollapse?: (event: CustomEvent) => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* ---
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* ### **Events:**
|
|
70
|
+
* - **forge-ai-sidebar-chat-open** - Fired when the sidebar chat is opened
|
|
71
|
+
* - **forge-ai-sidebar-chat-close** - Fired when the sidebar chat is closed
|
|
72
|
+
* - **forge-ai-sidebar-chat-expand** - Fired when the sidebar chat is expanded to modal
|
|
73
|
+
* - **forge-ai-sidebar-chat-collapse** - Fired when the sidebar chat is collapsed from modal
|
|
74
|
+
*
|
|
75
|
+
* ### **Methods:**
|
|
76
|
+
* - **show(): _void_** - Opens the sidebar chat.
|
|
77
|
+
* - **close(): _void_** - Closes the sidebar chat.
|
|
78
|
+
* - **toggle(): _void_** - Toggles the sidebar chat open state.
|
|
79
|
+
* - **expand(): _void_** - Expands the chat to fullscreen modal.
|
|
80
|
+
* - **collapse(): _void_** - Collapses the chat from fullscreen modal back to sidebar.
|
|
81
|
+
*
|
|
82
|
+
* ### **Slots:**
|
|
83
|
+
* - _default_ - Default slot for messages (ai-user-message, ai-response-message components)
|
|
84
|
+
* - **suggestions** - Slot for AI suggestions component
|
|
85
|
+
* - **prompt** - Slot for custom AI prompt component. If not provided, a default forge-ai-prompt will be used.
|
|
86
|
+
*/
|
|
87
|
+
export const ForgeAiSidebarChat: React.ForwardRefExoticComponent<ForgeAiSidebarChatProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-sidebar-chat";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiSidebarChat = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { open, expanded, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(
|
|
11
|
+
ref,
|
|
12
|
+
"forge-ai-sidebar-chat-open",
|
|
13
|
+
props.onForgeAiSidebarChatOpen,
|
|
14
|
+
);
|
|
15
|
+
useEventListener(
|
|
16
|
+
ref,
|
|
17
|
+
"forge-ai-sidebar-chat-close",
|
|
18
|
+
props.onForgeAiSidebarChatClose,
|
|
19
|
+
);
|
|
20
|
+
useEventListener(
|
|
21
|
+
ref,
|
|
22
|
+
"forge-ai-sidebar-chat-expand",
|
|
23
|
+
props.onForgeAiSidebarChatExpand,
|
|
24
|
+
);
|
|
25
|
+
useEventListener(
|
|
26
|
+
ref,
|
|
27
|
+
"forge-ai-sidebar-chat-collapse",
|
|
28
|
+
props.onForgeAiSidebarChatCollapse,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return React.createElement(
|
|
32
|
+
"forge-ai-sidebar-chat",
|
|
33
|
+
{
|
|
34
|
+
ref: (node) => {
|
|
35
|
+
ref.current = node;
|
|
36
|
+
if (typeof forwardedRef === "function") {
|
|
37
|
+
forwardedRef(node);
|
|
38
|
+
} else if (forwardedRef) {
|
|
39
|
+
forwardedRef.current = node;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
...filteredProps,
|
|
43
|
+
class: props.className,
|
|
44
|
+
exportparts: props.exportparts,
|
|
45
|
+
for: props.htmlFor,
|
|
46
|
+
part: props.part,
|
|
47
|
+
tabindex: props.tabIndex,
|
|
48
|
+
open: props.open ? true : undefined,
|
|
49
|
+
expanded: props.expanded ? true : undefined,
|
|
50
|
+
style: { ...props.style },
|
|
51
|
+
},
|
|
52
|
+
props.children,
|
|
53
|
+
);
|
|
54
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiSuggestions as ForgeAiSuggestionsElement } from "@tylertech/forge-ai/ai-suggestions";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiSuggestionsElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiSuggestionsProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** Array of suggestion objects to display */
|
|
23
|
+
suggestions?: ForgeAiSuggestionsElement["suggestions"];
|
|
24
|
+
|
|
25
|
+
/** Display variant for suggestions layout */
|
|
26
|
+
variant?: ForgeAiSuggestionsElement["variant"];
|
|
27
|
+
|
|
28
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
29
|
+
className?: string;
|
|
30
|
+
|
|
31
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
32
|
+
exportparts?: string;
|
|
33
|
+
|
|
34
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
35
|
+
htmlFor?: string;
|
|
36
|
+
|
|
37
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
38
|
+
key?: number | string;
|
|
39
|
+
|
|
40
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
41
|
+
part?: string;
|
|
42
|
+
|
|
43
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
44
|
+
ref?: any;
|
|
45
|
+
|
|
46
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
47
|
+
tabIndex?: number;
|
|
48
|
+
|
|
49
|
+
/** Fired when a suggestion is selected. */
|
|
50
|
+
onForgeAiSuggestionsSelect?: (
|
|
51
|
+
event: CustomEvent<CustomEvent<AiSuggestionsEventData>>,
|
|
52
|
+
) => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* ---
|
|
58
|
+
*
|
|
59
|
+
*
|
|
60
|
+
* ### **Events:**
|
|
61
|
+
* - **forge-ai-suggestions-select** - Fired when a suggestion is selected.
|
|
62
|
+
*/
|
|
63
|
+
export const ForgeAiSuggestions: React.ForwardRefExoticComponent<ForgeAiSuggestionsProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-suggestions";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiSuggestions = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { suggestions, variant, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(
|
|
11
|
+
ref,
|
|
12
|
+
"forge-ai-suggestions-select",
|
|
13
|
+
props.onForgeAiSuggestionsSelect,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
return React.createElement(
|
|
17
|
+
"forge-ai-suggestions",
|
|
18
|
+
{
|
|
19
|
+
ref: (node) => {
|
|
20
|
+
ref.current = node;
|
|
21
|
+
if (typeof forwardedRef === "function") {
|
|
22
|
+
forwardedRef(node);
|
|
23
|
+
} else if (forwardedRef) {
|
|
24
|
+
forwardedRef.current = node;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
...filteredProps,
|
|
28
|
+
suggestions: props.suggestions,
|
|
29
|
+
variant: props.variant,
|
|
30
|
+
class: props.className,
|
|
31
|
+
exportparts: props.exportparts,
|
|
32
|
+
for: props.htmlFor,
|
|
33
|
+
part: props.part,
|
|
34
|
+
tabindex: props.tabIndex,
|
|
35
|
+
style: { ...props.style },
|
|
36
|
+
},
|
|
37
|
+
props.children,
|
|
38
|
+
);
|
|
39
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiThoughtBase as ForgeAiThoughtBaseElement } from "@tylertech/forge-ai/ai-chain-of-thought/thought-base";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiThoughtBaseElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiThoughtBaseProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** The step number for this thought */
|
|
23
|
+
step?: ForgeAiThoughtBaseElement["step"];
|
|
24
|
+
|
|
25
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
26
|
+
className?: string;
|
|
27
|
+
|
|
28
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
29
|
+
exportparts?: string;
|
|
30
|
+
|
|
31
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
32
|
+
htmlFor?: string;
|
|
33
|
+
|
|
34
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
35
|
+
key?: number | string;
|
|
36
|
+
|
|
37
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
38
|
+
part?: string;
|
|
39
|
+
|
|
40
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
41
|
+
ref?: any;
|
|
42
|
+
|
|
43
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
44
|
+
tabIndex?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* ---
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* ### **Slots:**
|
|
53
|
+
* - **icon** - Icon to display in the header
|
|
54
|
+
* - **title** - Title content for the header
|
|
55
|
+
* - _default_ - Main content area
|
|
56
|
+
*/
|
|
57
|
+
export const ForgeAiThoughtBase: React.ForwardRefExoticComponent<ForgeAiThoughtBaseProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-chain-of-thought/thought-base";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiThoughtBase = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { step, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-thought-base",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
step: props.step,
|
|
12
|
+
class: props.className,
|
|
13
|
+
exportparts: props.exportparts,
|
|
14
|
+
for: props.htmlFor,
|
|
15
|
+
part: props.part,
|
|
16
|
+
tabindex: props.tabIndex,
|
|
17
|
+
style: { ...props.style },
|
|
18
|
+
},
|
|
19
|
+
props.children,
|
|
20
|
+
);
|
|
21
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiThoughtDetail as ForgeAiThoughtDetailElement } from "@tylertech/forge-ai/ai-chain-of-thought/thought-detail";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiThoughtDetailElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiThoughtDetailProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
9
|
+
| "children"
|
|
10
|
+
| "dir"
|
|
11
|
+
| "hidden"
|
|
12
|
+
| "id"
|
|
13
|
+
| "lang"
|
|
14
|
+
| "slot"
|
|
15
|
+
| "style"
|
|
16
|
+
| "title"
|
|
17
|
+
| "translate"
|
|
18
|
+
| "onClick"
|
|
19
|
+
| "onFocus"
|
|
20
|
+
| "onBlur"
|
|
21
|
+
> {
|
|
22
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
23
|
+
className?: string;
|
|
24
|
+
|
|
25
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
26
|
+
exportparts?: string;
|
|
27
|
+
|
|
28
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
29
|
+
htmlFor?: string;
|
|
30
|
+
|
|
31
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
32
|
+
key?: number | string;
|
|
33
|
+
|
|
34
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
35
|
+
part?: string;
|
|
36
|
+
|
|
37
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
38
|
+
ref?: any;
|
|
39
|
+
|
|
40
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
41
|
+
tabIndex?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* ---
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
export const ForgeAiThoughtDetail: React.ForwardRefExoticComponent<ForgeAiThoughtDetailProps>;
|