@tylertech/forge-ai-react 0.4.1 → 0.6.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/ForgeAiActionsToolbar.d.ts +24 -16
- package/dist/ForgeAiActionsToolbar.js +8 -1
- package/dist/ForgeAiAgentInfo.d.ts +51 -0
- package/dist/ForgeAiAgentInfo.js +33 -0
- package/dist/ForgeAiArtifact.d.ts +15 -16
- package/dist/ForgeAiAttachment.d.ts +77 -0
- package/dist/ForgeAiAttachment.js +43 -0
- package/dist/ForgeAiButton.d.ts +15 -16
- package/dist/ForgeAiChainOfThought.d.ts +15 -16
- package/dist/ForgeAiChatHeader.d.ts +40 -30
- package/dist/ForgeAiChatHeader.js +19 -11
- package/dist/ForgeAiChatInterface.d.ts +16 -19
- package/dist/ForgeAiChatbot.d.ts +147 -0
- package/dist/ForgeAiChatbot.js +94 -0
- package/dist/ForgeAiChatbotToolCall.d.ts +60 -0
- package/dist/ForgeAiChatbotToolCall.js +38 -0
- package/dist/ForgeAiConfirmationPrompt.d.ts +74 -0
- package/dist/ForgeAiConfirmationPrompt.js +46 -0
- package/dist/ForgeAiDialog.d.ts +15 -16
- package/dist/ForgeAiDropdownMenu.d.ts +23 -22
- package/dist/ForgeAiDropdownMenu.js +10 -2
- package/dist/ForgeAiDropdownMenuItem.d.ts +16 -19
- package/dist/ForgeAiDropdownMenuItemGroup.d.ts +15 -16
- package/dist/ForgeAiDropdownMenuSeparator.d.ts +15 -16
- package/dist/ForgeAiEmbeddedChat.d.ts +33 -20
- package/dist/ForgeAiEmbeddedChat.js +18 -2
- package/dist/ForgeAiEmptyState.d.ts +19 -18
- package/dist/ForgeAiErrorMessage.d.ts +52 -0
- package/dist/ForgeAiErrorMessage.js +18 -0
- package/dist/ForgeAiEventStreamViewer.d.ts +48 -0
- package/dist/ForgeAiEventStreamViewer.js +18 -0
- package/dist/ForgeAiFab.d.ts +15 -16
- package/dist/ForgeAiFilePicker.d.ts +32 -24
- package/dist/ForgeAiFilePicker.js +19 -2
- package/dist/ForgeAiFloatingChat.d.ts +18 -30
- package/dist/ForgeAiGradientContainer.d.ts +15 -16
- package/dist/ForgeAiIcon.d.ts +15 -16
- package/dist/ForgeAiIconButton.d.ts +51 -0
- package/dist/ForgeAiIconButton.js +21 -0
- package/dist/ForgeAiMessageThread.d.ts +90 -0
- package/dist/ForgeAiMessageThread.js +62 -0
- package/dist/ForgeAiModal.d.ts +19 -16
- package/dist/ForgeAiOverlay.d.ts +27 -22
- package/dist/ForgeAiOverlay.js +14 -1
- package/dist/ForgeAiPaginator.d.ts +66 -0
- package/dist/ForgeAiPaginator.js +36 -0
- package/dist/ForgeAiPopover.d.ts +27 -22
- package/dist/ForgeAiPopover.js +14 -1
- package/dist/ForgeAiPrompt.d.ts +44 -22
- package/dist/ForgeAiPrompt.js +18 -1
- package/dist/ForgeAiReasoning.d.ts +15 -16
- package/dist/ForgeAiReasoningContent.d.ts +15 -16
- package/dist/ForgeAiReasoningHeader.d.ts +15 -16
- package/dist/ForgeAiResponseMessage.d.ts +46 -20
- package/dist/ForgeAiResponseMessage.js +22 -3
- package/dist/ForgeAiSidebar.d.ts +15 -16
- package/dist/ForgeAiSidebarChat.d.ts +18 -30
- package/dist/ForgeAiSlashCommandMenu.d.ts +68 -0
- package/dist/ForgeAiSlashCommandMenu.js +44 -0
- package/dist/ForgeAiSpinner.d.ts +55 -0
- package/dist/ForgeAiSpinner.js +21 -0
- package/dist/ForgeAiSuggestions.d.ts +18 -16
- package/dist/ForgeAiThinkingIndicator.d.ts +24 -16
- package/dist/ForgeAiThinkingIndicator.js +6 -1
- package/dist/ForgeAiThoughtBase.d.ts +15 -16
- package/dist/ForgeAiThoughtDetail.d.ts +15 -16
- package/dist/ForgeAiThoughtImage.d.ts +15 -16
- package/dist/ForgeAiThoughtSearchResult.d.ts +15 -16
- package/dist/ForgeAiThreads.d.ts +18 -16
- package/dist/ForgeAiToolDataTable.d.ts +51 -0
- package/dist/ForgeAiToolDataTable.js +33 -0
- package/dist/ForgeAiTooltip.d.ts +17 -18
- package/dist/ForgeAiUserMessage.d.ts +15 -16
- package/dist/ForgeAiVoiceInput.d.ts +15 -16
- package/dist/ForgePromptButton.d.ts +15 -16
- package/dist/index.d.ts +20 -7
- package/dist/index.js +20 -7
- package/package.json +31 -31
|
@@ -3,22 +3,21 @@ import { ForgeAiDropdownMenuSeparator as ForgeAiDropdownMenuSeparatorElement } f
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiDropdownMenuSeparatorElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiDropdownMenuSeparatorProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiDropdownMenuSeparatorProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** 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
22
|
className?: string;
|
|
24
23
|
|
|
@@ -3,28 +3,36 @@ import { ForgeAiEmbeddedChat as ForgeAiEmbeddedChatElement } from "@tylertech/fo
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiEmbeddedChatElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiEmbeddedChatProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiEmbeddedChatProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Controls whether the modal view is open when expanded. */
|
|
23
22
|
expanded?: boolean;
|
|
24
23
|
|
|
25
|
-
/**
|
|
24
|
+
/** Gradient variant for embedded view ('low' | 'medium' | 'high', default: 'medium') */
|
|
26
25
|
gradientVariant?: ForgeAiEmbeddedChatElement["gradientVariant"];
|
|
27
26
|
|
|
27
|
+
/** undefined */
|
|
28
|
+
threadId?: ForgeAiEmbeddedChatElement["threadId"];
|
|
29
|
+
|
|
30
|
+
/** Enable file upload functionality (default: 'off') */
|
|
31
|
+
fileUpload?: ForgeAiEmbeddedChatElement["fileUpload"];
|
|
32
|
+
|
|
33
|
+
/** Placeholder text for input (default: "Ask a question...") */
|
|
34
|
+
placeholder?: ForgeAiEmbeddedChatElement["placeholder"];
|
|
35
|
+
|
|
28
36
|
/** 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
37
|
className?: string;
|
|
30
38
|
|
|
@@ -46,6 +54,12 @@ export interface ForgeAiEmbeddedChatProps
|
|
|
46
54
|
/** 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
55
|
tabIndex?: number;
|
|
48
56
|
|
|
57
|
+
/** Required. The adapter for communication with the AI service */
|
|
58
|
+
adapter?: ForgeAiEmbeddedChatElement["adapter"];
|
|
59
|
+
|
|
60
|
+
/** Optional suggestions for empty state */
|
|
61
|
+
suggestions?: ForgeAiEmbeddedChatElement["suggestions"];
|
|
62
|
+
|
|
49
63
|
/** Fired when the chat is expanded to modal view */
|
|
50
64
|
onForgeAiEmbeddedChatExpand?: (event: CustomEvent<CustomEvent<void>>) => void;
|
|
51
65
|
|
|
@@ -69,8 +83,7 @@ export interface ForgeAiEmbeddedChatProps
|
|
|
69
83
|
* - **collapse(): _void_** - Collapses the chat from modal view back to embedded view.
|
|
70
84
|
*
|
|
71
85
|
* ### **Slots:**
|
|
72
|
-
* -
|
|
73
|
-
* - **
|
|
74
|
-
* - **prompt** - Slot for custom AI prompt component. If not provided, a default forge-ai-prompt will be used.
|
|
86
|
+
* - **header-title** - Slot for custom header title content (default: "AI Assistant")
|
|
87
|
+
* - **empty-state-heading** - Slot for custom empty state heading
|
|
75
88
|
*/
|
|
76
89
|
export const ForgeAiEmbeddedChat: React.ForwardRefExoticComponent<ForgeAiEmbeddedChatProps>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
2
|
import "@tylertech/forge-ai/ai-embedded-chat";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
3
|
+
import { useEventListener, useProperties } from "./react-utils.js";
|
|
4
4
|
|
|
5
5
|
export const ForgeAiEmbeddedChat = forwardRef((props, forwardedRef) => {
|
|
6
6
|
const ref = useRef(null);
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
expanded,
|
|
9
|
+
gradientVariant,
|
|
10
|
+
threadId,
|
|
11
|
+
fileUpload,
|
|
12
|
+
placeholder,
|
|
13
|
+
adapter,
|
|
14
|
+
suggestions,
|
|
15
|
+
...filteredProps
|
|
16
|
+
} = props;
|
|
8
17
|
|
|
9
18
|
/** Event listeners - run once */
|
|
10
19
|
useEventListener(
|
|
@@ -18,6 +27,10 @@ export const ForgeAiEmbeddedChat = forwardRef((props, forwardedRef) => {
|
|
|
18
27
|
props.onForgeAiEmbeddedChatCollapse,
|
|
19
28
|
);
|
|
20
29
|
|
|
30
|
+
/** Properties - run whenever a property has changed */
|
|
31
|
+
useProperties(ref, "adapter", props.adapter);
|
|
32
|
+
useProperties(ref, "suggestions", props.suggestions);
|
|
33
|
+
|
|
21
34
|
return React.createElement(
|
|
22
35
|
"forge-ai-embedded-chat",
|
|
23
36
|
{
|
|
@@ -31,6 +44,9 @@ export const ForgeAiEmbeddedChat = forwardRef((props, forwardedRef) => {
|
|
|
31
44
|
},
|
|
32
45
|
...filteredProps,
|
|
33
46
|
"gradient-variant": props.gradientVariant || props["gradient-variant"],
|
|
47
|
+
"thread-id": props.threadId || props["thread-id"],
|
|
48
|
+
"file-upload": props.fileUpload || props["file-upload"],
|
|
49
|
+
placeholder: props.placeholder,
|
|
34
50
|
class: props.className,
|
|
35
51
|
exportparts: props.exportparts,
|
|
36
52
|
for: props.htmlFor,
|
|
@@ -3,22 +3,21 @@ import { ForgeAiEmptyState as ForgeAiEmptyStateElement } from "@tylertech/forge-
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiEmptyStateElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiEmptyStateProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiEmptyStateProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** 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
22
|
className?: string;
|
|
24
23
|
|
|
@@ -47,8 +46,10 @@ export interface ForgeAiEmptyStateProps
|
|
|
47
46
|
*
|
|
48
47
|
*
|
|
49
48
|
* ### **Slots:**
|
|
50
|
-
* - _default_ - The welcome message content (
|
|
51
|
-
* - **icon** - The custom icon to display
|
|
49
|
+
* - _default_ - The welcome message content (overrides the default message).
|
|
50
|
+
* - **icon** - The custom icon/graphic to display.
|
|
51
|
+
* - **heading** - The custom heading/title to display.
|
|
52
|
+
* - **body** - The custom body message content.
|
|
52
53
|
* - **actions** - The actions or suggestions to display below the message.
|
|
53
54
|
*/
|
|
54
55
|
export const ForgeAiEmptyState: React.ForwardRefExoticComponent<ForgeAiEmptyStateProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiErrorMessage as ForgeAiErrorMessageElement } from "@tylertech/forge-ai/ai-error-message";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiErrorMessageElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiErrorMessageProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** 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()`. */
|
|
22
|
+
className?: string;
|
|
23
|
+
|
|
24
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
25
|
+
exportparts?: string;
|
|
26
|
+
|
|
27
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
28
|
+
htmlFor?: string;
|
|
29
|
+
|
|
30
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
31
|
+
key?: number | string;
|
|
32
|
+
|
|
33
|
+
/** 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. */
|
|
34
|
+
part?: string;
|
|
35
|
+
|
|
36
|
+
/** 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. */
|
|
37
|
+
ref?: any;
|
|
38
|
+
|
|
39
|
+
/** 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. */
|
|
40
|
+
tabIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Displays error messages using Forge inline message banner style.
|
|
45
|
+
* ---
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
* ### **Slots:**
|
|
49
|
+
* - **title** - The error title text
|
|
50
|
+
* - _default_ - The error message content
|
|
51
|
+
*/
|
|
52
|
+
export const ForgeAiErrorMessage: React.ForwardRefExoticComponent<ForgeAiErrorMessageProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-error-message";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiErrorMessage = forwardRef((props, forwardedRef) => {
|
|
5
|
+
return React.createElement(
|
|
6
|
+
"forge-ai-error-message",
|
|
7
|
+
{
|
|
8
|
+
...props,
|
|
9
|
+
class: props.className,
|
|
10
|
+
exportparts: props.exportparts,
|
|
11
|
+
for: props.htmlFor,
|
|
12
|
+
part: props.part,
|
|
13
|
+
tabindex: props.tabIndex,
|
|
14
|
+
style: { ...props.style },
|
|
15
|
+
},
|
|
16
|
+
props.children,
|
|
17
|
+
);
|
|
18
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiEventStreamViewer as ForgeAiEventStreamViewerElement } from "@tylertech/forge-ai/ai-event-stream-viewer";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiEventStreamViewerElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiEventStreamViewerProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** 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()`. */
|
|
22
|
+
className?: string;
|
|
23
|
+
|
|
24
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
25
|
+
exportparts?: string;
|
|
26
|
+
|
|
27
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
28
|
+
htmlFor?: string;
|
|
29
|
+
|
|
30
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
31
|
+
key?: number | string;
|
|
32
|
+
|
|
33
|
+
/** 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. */
|
|
34
|
+
part?: string;
|
|
35
|
+
|
|
36
|
+
/** 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. */
|
|
37
|
+
ref?: any;
|
|
38
|
+
|
|
39
|
+
/** 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. */
|
|
40
|
+
tabIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Displays a timeline of adapter events with expandable JSON data.
|
|
45
|
+
* ---
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export const ForgeAiEventStreamViewer: React.ForwardRefExoticComponent<ForgeAiEventStreamViewerProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-event-stream-viewer";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiEventStreamViewer = forwardRef((props, forwardedRef) => {
|
|
5
|
+
return React.createElement(
|
|
6
|
+
"forge-ai-event-stream-viewer",
|
|
7
|
+
{
|
|
8
|
+
...props,
|
|
9
|
+
class: props.className,
|
|
10
|
+
exportparts: props.exportparts,
|
|
11
|
+
for: props.htmlFor,
|
|
12
|
+
part: props.part,
|
|
13
|
+
tabindex: props.tabIndex,
|
|
14
|
+
style: { ...props.style },
|
|
15
|
+
},
|
|
16
|
+
props.children,
|
|
17
|
+
);
|
|
18
|
+
});
|
package/dist/ForgeAiFab.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiFab as ForgeAiFabElement } from "@tylertech/forge-ai/ai-fab";
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiFabElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiFabProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiFabProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Whether the button is disabled */
|
|
23
22
|
disabled?: boolean;
|
|
24
23
|
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
import {
|
|
3
|
+
ForgeAiFilePicker as ForgeAiFilePickerElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "@tylertech/forge-ai/ai-file-picker";
|
|
6
|
+
|
|
7
|
+
export type { ForgeAiFilePickerElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface ForgeAiFilePickerProps extends Pick<
|
|
10
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
+
| "children"
|
|
12
|
+
| "dir"
|
|
13
|
+
| "hidden"
|
|
14
|
+
| "id"
|
|
15
|
+
| "lang"
|
|
16
|
+
| "slot"
|
|
17
|
+
| "style"
|
|
18
|
+
| "title"
|
|
19
|
+
| "translate"
|
|
20
|
+
| "onClick"
|
|
21
|
+
| "onFocus"
|
|
22
|
+
| "onBlur"
|
|
23
|
+
> {
|
|
22
24
|
/** Whether the file picker is disabled. */
|
|
23
25
|
disabled?: boolean;
|
|
24
26
|
|
|
@@ -31,6 +33,9 @@ export interface ForgeAiFilePickerProps
|
|
|
31
33
|
/** Accepted file types (comma-separated MIME types or extensions). */
|
|
32
34
|
accept?: ForgeAiFilePickerElement["accept"];
|
|
33
35
|
|
|
36
|
+
/** Maximum file size in bytes. Default is 10MB. */
|
|
37
|
+
maxSize?: ForgeAiFilePickerElement["maxSize"];
|
|
38
|
+
|
|
34
39
|
/** 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()`. */
|
|
35
40
|
className?: string;
|
|
36
41
|
|
|
@@ -52,10 +57,16 @@ export interface ForgeAiFilePickerProps
|
|
|
52
57
|
/** 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. */
|
|
53
58
|
tabIndex?: number;
|
|
54
59
|
|
|
60
|
+
/** Array of currently selected file names for duplicate checking. */
|
|
61
|
+
selectedFiles?: ForgeAiFilePickerElement["selectedFiles"];
|
|
62
|
+
|
|
55
63
|
/** Fired when a file is selected via click or drag & drop. The event detail contains the selected file and timestamp. */
|
|
56
64
|
onForgeAiFilePickerChange?: (
|
|
57
65
|
event: CustomEvent<CustomEvent<ForgeAiFilePickerChangeEventData>>,
|
|
58
66
|
) => void;
|
|
67
|
+
|
|
68
|
+
/** undefined */
|
|
69
|
+
onForgeAiFilePickerError?: (event: CustomEvent) => void;
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
/**
|
|
@@ -65,13 +76,10 @@ export interface ForgeAiFilePickerProps
|
|
|
65
76
|
*
|
|
66
77
|
* ### **Events:**
|
|
67
78
|
* - **forge-ai-file-picker-change** - Fired when a file is selected via click or drag & drop. The event detail contains the selected file and timestamp.
|
|
79
|
+
* - **forge-ai-file-picker-error**
|
|
68
80
|
*
|
|
69
81
|
* ### **Slots:**
|
|
70
82
|
* - _default_ - The default slot for button content when no file is selected.
|
|
71
83
|
* - **icon** - The icon slot for icon-button variant.
|
|
72
|
-
*
|
|
73
|
-
* ### **CSS Properties:**
|
|
74
|
-
* - **--ai-file-picker-width** - The width of the file picker button. _(default: undefined)_
|
|
75
|
-
* - **--ai-file-picker-height** - The height of the file picker button. _(default: undefined)_
|
|
76
84
|
*/
|
|
77
85
|
export const ForgeAiFilePicker: React.ForwardRefExoticComponent<ForgeAiFilePickerProps>;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
2
|
import "@tylertech/forge-ai/ai-file-picker";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
3
|
+
import { useEventListener, useProperties } from "./react-utils.js";
|
|
4
4
|
|
|
5
5
|
export const ForgeAiFilePicker = forwardRef((props, forwardedRef) => {
|
|
6
6
|
const ref = useRef(null);
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
disabled,
|
|
9
|
+
multiple,
|
|
10
|
+
variant,
|
|
11
|
+
accept,
|
|
12
|
+
maxSize,
|
|
13
|
+
selectedFiles,
|
|
14
|
+
...filteredProps
|
|
15
|
+
} = props;
|
|
8
16
|
|
|
9
17
|
/** Event listeners - run once */
|
|
10
18
|
useEventListener(
|
|
@@ -12,6 +20,14 @@ export const ForgeAiFilePicker = forwardRef((props, forwardedRef) => {
|
|
|
12
20
|
"forge-ai-file-picker-change",
|
|
13
21
|
props.onForgeAiFilePickerChange,
|
|
14
22
|
);
|
|
23
|
+
useEventListener(
|
|
24
|
+
ref,
|
|
25
|
+
"forge-ai-file-picker-error",
|
|
26
|
+
props.onForgeAiFilePickerError,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/** Properties - run whenever a property has changed */
|
|
30
|
+
useProperties(ref, "selectedFiles", props.selectedFiles);
|
|
15
31
|
|
|
16
32
|
return React.createElement(
|
|
17
33
|
"forge-ai-file-picker",
|
|
@@ -27,6 +43,7 @@ export const ForgeAiFilePicker = forwardRef((props, forwardedRef) => {
|
|
|
27
43
|
...filteredProps,
|
|
28
44
|
variant: props.variant,
|
|
29
45
|
accept: props.accept,
|
|
46
|
+
"max-size": props.maxSize || props["max-size"],
|
|
30
47
|
class: props.className,
|
|
31
48
|
exportparts: props.exportparts,
|
|
32
49
|
for: props.htmlFor,
|
|
@@ -3,28 +3,25 @@ import { ForgeAiFloatingChat as ForgeAiFloatingChatElement } from "@tylertech/fo
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiFloatingChatElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiFloatingChatProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** Indicates whether the chat is open. */
|
|
6
|
+
export interface ForgeAiFloatingChatProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** undefined */
|
|
23
22
|
open?: boolean;
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
When true, the chat will have an expanded width and be centered on the screen.
|
|
27
|
-
When false, the chat will be positioned at the bottom-right corner with a fixed width. */
|
|
24
|
+
/** undefined */
|
|
28
25
|
expanded?: boolean;
|
|
29
26
|
|
|
30
27
|
/** 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()`. */
|
|
@@ -72,16 +69,7 @@ When false, the chat will be positioned at the bottom-right corner with a fixed
|
|
|
72
69
|
* - **forge-ai-floating-chat-expand** - Fired when the chat is expanded
|
|
73
70
|
* - **forge-ai-floating-chat-collapse** - Fired when the chat is collapsed
|
|
74
71
|
*
|
|
75
|
-
* ### **Methods:**
|
|
76
|
-
* - **show(): _void_** - Opens the chat.
|
|
77
|
-
* - **close(): _void_** - Closes the chat.
|
|
78
|
-
* - **toggle(): _void_** - Toggles the chat open state.
|
|
79
|
-
* - **expand(): _void_** - Expands the chat to full width.
|
|
80
|
-
* - **collapse(): _void_** - Collapses the chat to normal width.
|
|
81
|
-
*
|
|
82
72
|
* ### **Slots:**
|
|
83
|
-
* - _default_ - Default slot for
|
|
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.
|
|
73
|
+
* - _default_ - Default slot for chatbot component
|
|
86
74
|
*/
|
|
87
75
|
export const ForgeAiFloatingChat: React.ForwardRefExoticComponent<ForgeAiFloatingChatProps>;
|
|
@@ -3,22 +3,21 @@ import { ForgeAiGradientContainer as ForgeAiGradientContainerElement } from "@ty
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiGradientContainerElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiGradientContainerProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiGradientContainerProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
22
21
|
/** Gradient intensity variant */
|
|
23
22
|
variant?: ForgeAiGradientContainerElement["variant"];
|
|
24
23
|
|