@tylertech/forge-ai-react 0.4.0 → 0.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.
Files changed (66) hide show
  1. package/dist/ForgeAiActionsToolbar.d.ts +24 -16
  2. package/dist/ForgeAiActionsToolbar.js +8 -1
  3. package/dist/ForgeAiAgentInfo.d.ts +51 -0
  4. package/dist/ForgeAiAgentInfo.js +33 -0
  5. package/dist/ForgeAiArtifact.d.ts +15 -16
  6. package/dist/ForgeAiAttachment.d.ts +77 -0
  7. package/dist/ForgeAiAttachment.js +43 -0
  8. package/dist/ForgeAiButton.d.ts +15 -16
  9. package/dist/ForgeAiChainOfThought.d.ts +15 -16
  10. package/dist/ForgeAiChatHeader.d.ts +37 -30
  11. package/dist/ForgeAiChatHeader.js +19 -11
  12. package/dist/ForgeAiChatInterface.d.ts +16 -19
  13. package/dist/ForgeAiChatbot.d.ts +144 -0
  14. package/dist/ForgeAiChatbot.js +92 -0
  15. package/dist/ForgeAiChatbotToolCall.d.ts +57 -0
  16. package/dist/ForgeAiChatbotToolCall.js +36 -0
  17. package/dist/ForgeAiConfirmationPrompt.d.ts +74 -0
  18. package/dist/ForgeAiConfirmationPrompt.js +46 -0
  19. package/dist/ForgeAiDialog.d.ts +15 -16
  20. package/dist/ForgeAiDropdownMenu.d.ts +19 -16
  21. package/dist/ForgeAiDropdownMenu.js +10 -2
  22. package/dist/ForgeAiDropdownMenuItem.d.ts +15 -16
  23. package/dist/ForgeAiDropdownMenuItemGroup.d.ts +15 -16
  24. package/dist/ForgeAiDropdownMenuSeparator.d.ts +15 -16
  25. package/dist/ForgeAiEmbeddedChat.d.ts +33 -20
  26. package/dist/ForgeAiEmbeddedChat.js +18 -2
  27. package/dist/ForgeAiEmptyState.d.ts +19 -18
  28. package/dist/ForgeAiErrorMessage.d.ts +52 -0
  29. package/dist/ForgeAiErrorMessage.js +18 -0
  30. package/dist/ForgeAiFab.d.ts +15 -16
  31. package/dist/ForgeAiFilePicker.d.ts +32 -20
  32. package/dist/ForgeAiFilePicker.js +19 -2
  33. package/dist/ForgeAiFloatingChat.d.ts +18 -30
  34. package/dist/ForgeAiGradientContainer.d.ts +15 -16
  35. package/dist/ForgeAiIcon.d.ts +15 -16
  36. package/dist/ForgeAiMessageThread.d.ts +87 -0
  37. package/dist/ForgeAiMessageThread.js +55 -0
  38. package/dist/ForgeAiModal.d.ts +19 -16
  39. package/dist/ForgeAiOverlay.d.ts +23 -16
  40. package/dist/ForgeAiOverlay.js +12 -1
  41. package/dist/ForgeAiPopover.d.ts +23 -16
  42. package/dist/ForgeAiPopover.js +12 -1
  43. package/dist/ForgeAiPrompt.d.ts +15 -16
  44. package/dist/ForgeAiReasoning.d.ts +15 -16
  45. package/dist/ForgeAiReasoningContent.d.ts +15 -16
  46. package/dist/ForgeAiReasoningHeader.d.ts +15 -16
  47. package/dist/ForgeAiResponseMessage.d.ts +43 -20
  48. package/dist/ForgeAiResponseMessage.js +21 -3
  49. package/dist/ForgeAiSidebar.d.ts +15 -16
  50. package/dist/ForgeAiSidebarChat.d.ts +18 -30
  51. package/dist/ForgeAiSpinner.d.ts +55 -0
  52. package/dist/ForgeAiSpinner.js +21 -0
  53. package/dist/ForgeAiSuggestions.d.ts +15 -16
  54. package/dist/ForgeAiThinkingIndicator.d.ts +15 -16
  55. package/dist/ForgeAiThoughtBase.d.ts +15 -16
  56. package/dist/ForgeAiThoughtDetail.d.ts +15 -16
  57. package/dist/ForgeAiThoughtImage.d.ts +15 -16
  58. package/dist/ForgeAiThoughtSearchResult.d.ts +15 -16
  59. package/dist/ForgeAiThreads.d.ts +18 -16
  60. package/dist/ForgeAiTooltip.d.ts +15 -16
  61. package/dist/ForgeAiUserMessage.d.ts +15 -16
  62. package/dist/ForgeAiVoiceInput.d.ts +15 -16
  63. package/dist/ForgePromptButton.d.ts +15 -16
  64. package/dist/index.d.ts +12 -4
  65. package/dist/index.js +12 -4
  66. package/package.json +30 -30
@@ -3,22 +3,24 @@ import { ForgeAiActionsToolbar as ForgeAiActionsToolbarElement } from "@tylertec
3
3
 
4
4
  export type { ForgeAiActionsToolbarElement };
5
5
 
6
- export interface ForgeAiActionsToolbarProps
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
- > {
6
+ export interface ForgeAiActionsToolbarProps 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 */
22
+ enableReactions?: boolean;
23
+
22
24
  /** 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
25
  className?: string;
24
26
 
@@ -44,6 +46,11 @@ export interface ForgeAiActionsToolbarProps
44
46
  onForgeAiActionsToolbarAction?: (
45
47
  event: CustomEvent<CustomEvent<ForgeAiActionsToolbarActionEventData>>,
46
48
  ) => void;
49
+
50
+ /** Fired when feedback is submitted. The detail contains the action and optional feedback text. */
51
+ onForgeAiActionsToolbarFeedback?: (
52
+ event: CustomEvent<CustomEvent<ForgeAiActionsToolbarFeedbackEventData>>,
53
+ ) => void;
47
54
  }
48
55
 
49
56
  /**
@@ -53,5 +60,6 @@ export interface ForgeAiActionsToolbarProps
53
60
  *
54
61
  * ### **Events:**
55
62
  * - **forge-ai-actions-toolbar-action** - Fired when an action button is clicked. The detail contains the action type.
63
+ * - **forge-ai-actions-toolbar-feedback** - Fired when feedback is submitted. The detail contains the action and optional feedback text.
56
64
  */
57
65
  export const ForgeAiActionsToolbar: React.ForwardRefExoticComponent<ForgeAiActionsToolbarProps>;
@@ -4,6 +4,7 @@ import { useEventListener } from "./react-utils.js";
4
4
 
5
5
  export const ForgeAiActionsToolbar = forwardRef((props, forwardedRef) => {
6
6
  const ref = useRef(null);
7
+ const { enableReactions, ...filteredProps } = props;
7
8
 
8
9
  /** Event listeners - run once */
9
10
  useEventListener(
@@ -11,6 +12,11 @@ export const ForgeAiActionsToolbar = forwardRef((props, forwardedRef) => {
11
12
  "forge-ai-actions-toolbar-action",
12
13
  props.onForgeAiActionsToolbarAction,
13
14
  );
15
+ useEventListener(
16
+ ref,
17
+ "forge-ai-actions-toolbar-feedback",
18
+ props.onForgeAiActionsToolbarFeedback,
19
+ );
14
20
 
15
21
  return React.createElement(
16
22
  "forge-ai-actions-toolbar",
@@ -23,12 +29,13 @@ export const ForgeAiActionsToolbar = forwardRef((props, forwardedRef) => {
23
29
  forwardedRef.current = node;
24
30
  }
25
31
  },
26
- ...props,
32
+ ...filteredProps,
27
33
  class: props.className,
28
34
  exportparts: props.exportparts,
29
35
  for: props.htmlFor,
30
36
  part: props.part,
31
37
  tabindex: props.tabIndex,
38
+ "enable-reactions": props.enableReactions ? true : undefined,
32
39
  style: { ...props.style },
33
40
  },
34
41
  props.children,
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import { ForgeAiAgentInfo as ForgeAiAgentInfoElement } from "@tylertech/forge-ai/ai-agent-info";
3
+
4
+ export type { ForgeAiAgentInfoElement };
5
+
6
+ export interface ForgeAiAgentInfoProps 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
+ /** Agent information to display */
43
+ agentInfo?: ForgeAiAgentInfoElement["agentInfo"];
44
+ }
45
+
46
+ /**
47
+ * Displays agent information in a grid layout
48
+ * ---
49
+ *
50
+ */
51
+ export const ForgeAiAgentInfo: React.ForwardRefExoticComponent<ForgeAiAgentInfoProps>;
@@ -0,0 +1,33 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "@tylertech/forge-ai/ai-agent-info";
3
+ import { useProperties } from "./react-utils.js";
4
+
5
+ export const ForgeAiAgentInfo = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const { agentInfo, ...filteredProps } = props;
8
+
9
+ /** Properties - run whenever a property has changed */
10
+ useProperties(ref, "agentInfo", props.agentInfo);
11
+
12
+ return React.createElement(
13
+ "forge-ai-agent-info",
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
+ style: { ...props.style },
30
+ },
31
+ props.children,
32
+ );
33
+ });
@@ -3,22 +3,21 @@ import { ForgeAiArtifact as ForgeAiArtifactElement } from "@tylertech/forge-ai/a
3
3
 
4
4
  export type { ForgeAiArtifactElement };
5
5
 
6
- export interface ForgeAiArtifactProps
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
- > {
6
+ export interface ForgeAiArtifactProps 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
 
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import { ForgeAiAttachment as ForgeAiAttachmentElement } from "@tylertech/forge-ai/ai-attachment";
3
+
4
+ export type { ForgeAiAttachmentElement };
5
+
6
+ export interface ForgeAiAttachmentProps 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 */
22
+ removable?: boolean;
23
+
24
+ /** undefined */
25
+ uploading?: boolean;
26
+
27
+ /** undefined */
28
+ filename?: ForgeAiAttachmentElement["filename"];
29
+
30
+ /** undefined */
31
+ size?: ForgeAiAttachmentElement["size"];
32
+
33
+ /** undefined */
34
+ progress?: ForgeAiAttachmentElement["progress"];
35
+
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()`. */
37
+ className?: string;
38
+
39
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
40
+ exportparts?: string;
41
+
42
+ /** Used for labels to link them with their inputs (using input id). */
43
+ htmlFor?: string;
44
+
45
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
46
+ key?: number | string;
47
+
48
+ /** 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. */
49
+ part?: string;
50
+
51
+ /** 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. */
52
+ ref?: any;
53
+
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. */
55
+ tabIndex?: number;
56
+
57
+ /** Fired when the remove button is clicked */
58
+ onForgeAiAttachmentRemove?: (
59
+ event: CustomEvent<CustomEvent<ForgeAiAttachmentRemoveEventData>>,
60
+ ) => void;
61
+ }
62
+
63
+ /**
64
+ * Displays file attachment information with removal capability.
65
+ * ---
66
+ *
67
+ *
68
+ * ### **Events:**
69
+ * - **forge-ai-attachment-remove** - Fired when the remove button is clicked
70
+ *
71
+ * ### **CSS Properties:**
72
+ * - **--forge-ai-attachment-background** - Background color of the attachment _(default: undefined)_
73
+ * - **--forge-ai-attachment-border-color** - Border color of the attachment _(default: undefined)_
74
+ * - **--forge-ai-attachment-padding** - Padding inside the attachment _(default: undefined)_
75
+ * - **--forge-ai-attachment-gap** - Gap between elements _(default: undefined)_
76
+ */
77
+ export const ForgeAiAttachment: React.ForwardRefExoticComponent<ForgeAiAttachmentProps>;
@@ -0,0 +1,43 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "@tylertech/forge-ai/ai-attachment";
3
+ import { useEventListener } from "./react-utils.js";
4
+
5
+ export const ForgeAiAttachment = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const { removable, uploading, filename, size, progress, ...filteredProps } =
8
+ props;
9
+
10
+ /** Event listeners - run once */
11
+ useEventListener(
12
+ ref,
13
+ "forge-ai-attachment-remove",
14
+ props.onForgeAiAttachmentRemove,
15
+ );
16
+
17
+ return React.createElement(
18
+ "forge-ai-attachment",
19
+ {
20
+ ref: (node) => {
21
+ ref.current = node;
22
+ if (typeof forwardedRef === "function") {
23
+ forwardedRef(node);
24
+ } else if (forwardedRef) {
25
+ forwardedRef.current = node;
26
+ }
27
+ },
28
+ ...filteredProps,
29
+ filename: props.filename,
30
+ size: props.size,
31
+ progress: props.progress,
32
+ class: props.className,
33
+ exportparts: props.exportparts,
34
+ for: props.htmlFor,
35
+ part: props.part,
36
+ tabindex: props.tabIndex,
37
+ removable: props.removable ? true : undefined,
38
+ uploading: props.uploading ? true : undefined,
39
+ style: { ...props.style },
40
+ },
41
+ props.children,
42
+ );
43
+ });
@@ -3,22 +3,21 @@ import { ForgeAiButton as ForgeAiButtonElement } from "@tylertech/forge-ai/ai-bu
3
3
 
4
4
  export type { ForgeAiButtonElement };
5
5
 
6
- export interface ForgeAiButtonProps
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
- > {
6
+ export interface ForgeAiButtonProps 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
 
@@ -3,22 +3,21 @@ import { ForgeAiChainOfThought as ForgeAiChainOfThoughtElement } from "@tylertec
3
3
 
4
4
  export type { ForgeAiChainOfThoughtElement };
5
5
 
6
- export interface ForgeAiChainOfThoughtProps
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
- > {
6
+ export interface ForgeAiChainOfThoughtProps 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 chain of thought is expanded */
23
22
  expanded?: boolean;
24
23
 
@@ -6,22 +6,21 @@ import {
6
6
 
7
7
  export type { ForgeAiChatHeaderElement, CustomEvent };
8
8
 
9
- export interface ForgeAiChatHeaderProps
10
- extends Pick<
11
- React.AllHTMLAttributes<HTMLElement>,
12
- | "children"
13
- | "dir"
14
- | "hidden"
15
- | "id"
16
- | "lang"
17
- | "slot"
18
- | "style"
19
- | "title"
20
- | "translate"
21
- | "onClick"
22
- | "onFocus"
23
- | "onBlur"
24
- > {
9
+ export interface ForgeAiChatHeaderProps 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
+ > {
25
24
  /** Controls whether the expand button is visible */
26
25
  showExpandButton?: boolean;
27
26
 
@@ -31,17 +30,23 @@ export interface ForgeAiChatHeaderProps
31
30
  /** Indicates the current expanded state for displaying the appropriate expand/collapse icon */
32
31
  expanded?: boolean;
33
32
 
34
- /** Controls whether the dropdown menu is visible (default: true) */
35
- showDropdownMenu?: boolean;
33
+ /** Controls which minimize icon to display */
34
+ minimizeIcon?: ForgeAiChatHeaderElement["minimizeIcon"];
36
35
 
37
- /** Controls whether the clear chat menu item is visible (default: true) */
38
- showClearChat?: boolean;
36
+ /** Controls state of the options dropdown menu */
37
+ options?: ForgeAiChatHeaderElement["options"];
39
38
 
40
- /** Controls whether the info menu item is visible (default: true) */
41
- showInfo?: boolean;
39
+ /** Controls state of the export option */
40
+ exportOption?: ForgeAiChatHeaderElement["exportOption"];
42
41
 
43
- /** Controls which minimize icon to display ('default' | 'panel') */
44
- minimizeIcon?: ForgeAiChatHeaderElement["minimizeIcon"];
42
+ /** Controls state of the clear chat option */
43
+ clearOption?: ForgeAiChatHeaderElement["clearOption"];
44
+
45
+ /** Controls the heading level for the title content (default: 2) */
46
+ headingLevel?: ForgeAiChatHeaderElement["headingLevel"];
47
+
48
+ /** The title text to display in the header (default: 'AI Assistant') */
49
+ titleText?: ForgeAiChatHeaderElement["titleText"];
45
50
 
46
51
  /** 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()`. */
47
52
  className?: string;
@@ -64,12 +69,15 @@ export interface ForgeAiChatHeaderProps
64
69
  /** 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. */
65
70
  tabIndex?: number;
66
71
 
72
+ /** Agent information to display in the info dialog */
73
+ agentInfo?: ForgeAiChatHeaderElement["agentInfo"];
74
+
75
+ /** Fired when the export option is selected */
76
+ onForgeAiChatHeaderExport?: (event: CustomEvent) => void;
77
+
67
78
  /** Fired when the clear chat option is selected */
68
79
  onForgeAiChatHeaderClear?: (event: CustomEvent) => void;
69
80
 
70
- /** Fired when the info option is selected */
71
- onForgeAiChatHeaderInfo?: (event: CustomEvent) => void;
72
-
73
81
  /** Fired when the expand button is clicked */
74
82
  onForgeAiChatHeaderExpand?: (event: CustomEvent) => void;
75
83
 
@@ -83,13 +91,12 @@ export interface ForgeAiChatHeaderProps
83
91
  *
84
92
  *
85
93
  * ### **Events:**
86
- * - **forge-ai-chat-header-clear** - Fired when the clear chat option is selected
87
- * - **forge-ai-chat-header-info** - Fired when the info option is selected
94
+ * - **forge-ai-chat-header-export** - Fired when the export option is selected
95
+ * - **forge-ai-chat-header-clear** - Fired when the clear chat option is selected
88
96
  * - **forge-ai-chat-header-expand** - Fired when the expand button is clicked
89
97
  * - **forge-ai-chat-header-minimize** - Fired when the minimize button is clicked
90
98
  *
91
99
  * ### **Slots:**
92
100
  * - **icon** - Slot for custom icon (default: forge-ai-icon)
93
- * - **title** - Slot for custom title text (default: "AI Assistant")
94
101
  */
95
102
  export const ForgeAiChatHeader: React.ForwardRefExoticComponent<ForgeAiChatHeaderProps>;
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef, useRef, useEffect } from "react";
2
2
  import "@tylertech/forge-ai/ai-chat-header";
3
- import { useEventListener } from "./react-utils.js";
3
+ import { useEventListener, useProperties } from "./react-utils.js";
4
4
 
5
5
  export const ForgeAiChatHeader = forwardRef((props, forwardedRef) => {
6
6
  const ref = useRef(null);
@@ -8,23 +8,26 @@ export const ForgeAiChatHeader = forwardRef((props, forwardedRef) => {
8
8
  showExpandButton,
9
9
  showMinimizeButton,
10
10
  expanded,
11
- showDropdownMenu,
12
- showClearChat,
13
- showInfo,
14
11
  minimizeIcon,
12
+ options,
13
+ exportOption,
14
+ clearOption,
15
+ headingLevel,
16
+ titleText,
17
+ agentInfo,
15
18
  ...filteredProps
16
19
  } = props;
17
20
 
18
21
  /** Event listeners - run once */
19
22
  useEventListener(
20
23
  ref,
21
- "forge-ai-chat-header-clear",
22
- props.onForgeAiChatHeaderClear,
24
+ "forge-ai-chat-header-export",
25
+ props.onForgeAiChatHeaderExport,
23
26
  );
24
27
  useEventListener(
25
28
  ref,
26
- "forge-ai-chat-header-info",
27
- props.onForgeAiChatHeaderInfo,
29
+ "forge-ai-chat-header-clear",
30
+ props.onForgeAiChatHeaderClear,
28
31
  );
29
32
  useEventListener(
30
33
  ref,
@@ -37,6 +40,9 @@ export const ForgeAiChatHeader = forwardRef((props, forwardedRef) => {
37
40
  props.onForgeAiChatHeaderMinimize,
38
41
  );
39
42
 
43
+ /** Properties - run whenever a property has changed */
44
+ useProperties(ref, "agentInfo", props.agentInfo);
45
+
40
46
  return React.createElement(
41
47
  "forge-ai-chat-header",
42
48
  {
@@ -50,6 +56,11 @@ export const ForgeAiChatHeader = forwardRef((props, forwardedRef) => {
50
56
  },
51
57
  ...filteredProps,
52
58
  "minimize-icon": props.minimizeIcon || props["minimize-icon"],
59
+ options: props.options,
60
+ "export-option": props.exportOption || props["export-option"],
61
+ "clear-option": props.clearOption || props["clear-option"],
62
+ "heading-level": props.headingLevel || props["heading-level"],
63
+ "title-text": props.titleText || props["title-text"],
53
64
  class: props.className,
54
65
  exportparts: props.exportparts,
55
66
  for: props.htmlFor,
@@ -58,9 +69,6 @@ export const ForgeAiChatHeader = forwardRef((props, forwardedRef) => {
58
69
  "show-expand-button": props.showExpandButton ? true : undefined,
59
70
  "show-minimize-button": props.showMinimizeButton ? true : undefined,
60
71
  expanded: props.expanded ? true : undefined,
61
- "show-dropdown-menu": props.showDropdownMenu ? true : undefined,
62
- "show-clear-chat": props.showClearChat ? true : undefined,
63
- "show-info": props.showInfo ? true : undefined,
64
72
  style: { ...props.style },
65
73
  },
66
74
  props.children,
@@ -3,22 +3,21 @@ import { ForgeAiChatInterface as ForgeAiChatInterfaceElement } from "@tylertech/
3
3
 
4
4
  export type { ForgeAiChatInterfaceElement };
5
5
 
6
- export interface ForgeAiChatInterfaceProps
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
- > {
6
+ export interface ForgeAiChatInterfaceProps 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
 
@@ -46,13 +45,11 @@ export interface ForgeAiChatInterfaceProps
46
45
  * ---
47
46
  *
48
47
  *
49
- * ### **Methods:**
50
- * - **scrollToBottom(): _void_** - Scrolls the messages container to the bottom with smooth animation
51
- *
52
48
  * ### **Slots:**
53
49
  * - _default_ - Default slot for messages
54
50
  * - **header** - Slot for AI chat header component
55
51
  * - **suggestions** - Slot for AI suggestions component
52
+ * - **attachments** - Slot for file attachments component
56
53
  * - **prompt** - Slot for AI prompt component
57
54
  */
58
55
  export const ForgeAiChatInterface: React.ForwardRefExoticComponent<ForgeAiChatInterfaceProps>;