@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.
Files changed (82) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +19 -0
  3. package/dist/ForgeAiActionsToolbar.d.ts +57 -0
  4. package/dist/ForgeAiActionsToolbar.js +36 -0
  5. package/dist/ForgeAiArtifact.d.ts +57 -0
  6. package/dist/ForgeAiArtifact.js +18 -0
  7. package/dist/ForgeAiButton.d.ts +55 -0
  8. package/dist/ForgeAiButton.js +21 -0
  9. package/dist/ForgeAiChainOfThought.d.ts +52 -0
  10. package/dist/ForgeAiChainOfThought.js +21 -0
  11. package/dist/ForgeAiChatHeader.d.ts +85 -0
  12. package/dist/ForgeAiChatHeader.js +62 -0
  13. package/dist/ForgeAiChatInterface.d.ts +66 -0
  14. package/dist/ForgeAiChatInterface.js +30 -0
  15. package/dist/ForgeAiDialog.d.ts +80 -0
  16. package/dist/ForgeAiDialog.js +43 -0
  17. package/dist/ForgeAiDropdownMenu.d.ts +99 -0
  18. package/dist/ForgeAiDropdownMenu.js +44 -0
  19. package/dist/ForgeAiDropdownMenuItem.d.ts +89 -0
  20. package/dist/ForgeAiDropdownMenuItem.js +52 -0
  21. package/dist/ForgeAiDropdownMenuItemGroup.d.ts +53 -0
  22. package/dist/ForgeAiDropdownMenuItemGroup.js +20 -0
  23. package/dist/ForgeAiDropdownMenuSeparator.d.ts +49 -0
  24. package/dist/ForgeAiDropdownMenuSeparator.js +20 -0
  25. package/dist/ForgeAiEmbeddedChat.d.ts +76 -0
  26. package/dist/ForgeAiEmbeddedChat.js +44 -0
  27. package/dist/ForgeAiEmptyState.d.ts +53 -0
  28. package/dist/ForgeAiEmptyState.js +18 -0
  29. package/dist/ForgeAiFab.d.ts +58 -0
  30. package/dist/ForgeAiFab.js +22 -0
  31. package/dist/ForgeAiFilePicker.d.ts +77 -0
  32. package/dist/ForgeAiFilePicker.js +41 -0
  33. package/dist/ForgeAiFloatingChat.d.ts +87 -0
  34. package/dist/ForgeAiFloatingChat.js +54 -0
  35. package/dist/ForgeAiGradientContainer.d.ts +55 -0
  36. package/dist/ForgeAiGradientContainer.js +21 -0
  37. package/dist/ForgeAiIcon.d.ts +52 -0
  38. package/dist/ForgeAiIcon.js +21 -0
  39. package/dist/ForgeAiModal.d.ts +79 -0
  40. package/dist/ForgeAiModal.js +41 -0
  41. package/dist/ForgeAiOverlay.d.ts +73 -0
  42. package/dist/ForgeAiOverlay.js +25 -0
  43. package/dist/ForgeAiPopover.d.ts +73 -0
  44. package/dist/ForgeAiPopover.js +25 -0
  45. package/dist/ForgeAiPrompt.d.ts +69 -0
  46. package/dist/ForgeAiPrompt.js +36 -0
  47. package/dist/ForgeAiReasoning.d.ts +52 -0
  48. package/dist/ForgeAiReasoning.js +21 -0
  49. package/dist/ForgeAiReasoningContent.d.ts +49 -0
  50. package/dist/ForgeAiReasoningContent.js +18 -0
  51. package/dist/ForgeAiReasoningHeader.d.ts +65 -0
  52. package/dist/ForgeAiReasoningHeader.js +35 -0
  53. package/dist/ForgeAiResponseMessage.d.ts +57 -0
  54. package/dist/ForgeAiResponseMessage.js +36 -0
  55. package/dist/ForgeAiSidebar.d.ts +70 -0
  56. package/dist/ForgeAiSidebar.js +35 -0
  57. package/dist/ForgeAiSidebarChat.d.ts +87 -0
  58. package/dist/ForgeAiSidebarChat.js +54 -0
  59. package/dist/ForgeAiSuggestions.d.ts +63 -0
  60. package/dist/ForgeAiSuggestions.js +39 -0
  61. package/dist/ForgeAiThoughtBase.d.ts +57 -0
  62. package/dist/ForgeAiThoughtBase.js +21 -0
  63. package/dist/ForgeAiThoughtDetail.d.ts +49 -0
  64. package/dist/ForgeAiThoughtDetail.js +18 -0
  65. package/dist/ForgeAiThoughtImage.d.ts +52 -0
  66. package/dist/ForgeAiThoughtImage.js +21 -0
  67. package/dist/ForgeAiThoughtSearchResult.d.ts +55 -0
  68. package/dist/ForgeAiThoughtSearchResult.js +22 -0
  69. package/dist/ForgeAiThreads.d.ts +71 -0
  70. package/dist/ForgeAiThreads.js +48 -0
  71. package/dist/ForgeAiTooltip.d.ts +79 -0
  72. package/dist/ForgeAiTooltip.js +27 -0
  73. package/dist/ForgeAiUserMessage.d.ts +49 -0
  74. package/dist/ForgeAiUserMessage.js +18 -0
  75. package/dist/ForgeAiVoiceInput.d.ts +57 -0
  76. package/dist/ForgeAiVoiceInput.js +36 -0
  77. package/dist/ForgePromptButton.d.ts +52 -0
  78. package/dist/ForgePromptButton.js +21 -0
  79. package/dist/index.d.ts +38 -0
  80. package/dist/index.js +38 -0
  81. package/dist/react-utils.js +34 -0
  82. package/package.json +62 -0
@@ -0,0 +1,18 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/ai-chain-of-thought/thought-detail";
3
+
4
+ export const ForgeAiThoughtDetail = forwardRef((props, forwardedRef) => {
5
+ return React.createElement(
6
+ "forge-ai-thought-detail",
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,52 @@
1
+ import React from "react";
2
+ import { ForgeAiThoughtImage as ForgeAiThoughtImageElement } from "@tylertech/forge-ai/ai-chain-of-thought/thought-image";
3
+
4
+ export type { ForgeAiThoughtImageElement };
5
+
6
+ export interface ForgeAiThoughtImageProps
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 image */
23
+ step?: ForgeAiThoughtImageElement["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
+ export const ForgeAiThoughtImage: React.ForwardRefExoticComponent<ForgeAiThoughtImageProps>;
@@ -0,0 +1,21 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/ai-chain-of-thought/thought-image";
3
+
4
+ export const ForgeAiThoughtImage = forwardRef((props, forwardedRef) => {
5
+ const { step, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "forge-ai-thought-image",
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,55 @@
1
+ import React from "react";
2
+ import { ForgeAiThoughtSearchResult as ForgeAiThoughtSearchResultElement } from "@tylertech/forge-ai/ai-chain-of-thought/thought-search-result";
3
+
4
+ export type { ForgeAiThoughtSearchResultElement };
5
+
6
+ export interface ForgeAiThoughtSearchResultProps
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 search result */
23
+ step?: ForgeAiThoughtSearchResultElement["step"];
24
+
25
+ /** Array of sources for the search result */
26
+ sources?: ForgeAiThoughtSearchResultElement["sources"];
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
+
50
+ /**
51
+ *
52
+ * ---
53
+ *
54
+ */
55
+ export const ForgeAiThoughtSearchResult: React.ForwardRefExoticComponent<ForgeAiThoughtSearchResultProps>;
@@ -0,0 +1,22 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/ai-chain-of-thought/thought-search-result";
3
+
4
+ export const ForgeAiThoughtSearchResult = forwardRef((props, forwardedRef) => {
5
+ const { step, sources, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "forge-ai-thought-search-result",
9
+ {
10
+ ...filteredProps,
11
+ step: props.step,
12
+ sources: props.sources,
13
+ class: props.className,
14
+ exportparts: props.exportparts,
15
+ for: props.htmlFor,
16
+ part: props.part,
17
+ tabindex: props.tabIndex,
18
+ style: { ...props.style },
19
+ },
20
+ props.children,
21
+ );
22
+ });
@@ -0,0 +1,71 @@
1
+ import React from "react";
2
+ import {
3
+ ForgeAiThreads as ForgeAiThreadsElement,
4
+ CustomEvent,
5
+ } from "@tylertech/forge-ai/ai-threads";
6
+
7
+ export type { ForgeAiThreadsElement, CustomEvent };
8
+
9
+ export interface ForgeAiThreadsProps
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
+ > {
25
+ /** Array of threads to display in the navigation list */
26
+ threads?: ForgeAiThreadsElement["threads"];
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 thread is selected. */
50
+ onForgeAiThreadsSelect?: (
51
+ event: CustomEvent<CustomEvent<AiThreadsSelectEventData>>,
52
+ ) => void;
53
+
54
+ /** Fired when the new chat button is clicked. */
55
+ onForgeAiThreadsNewChat?: (event: CustomEvent) => void;
56
+
57
+ /** Fired when the clear history button is clicked. */
58
+ onForgeAiThreadsClearHistory?: (event: CustomEvent) => void;
59
+ }
60
+
61
+ /**
62
+ *
63
+ * ---
64
+ *
65
+ *
66
+ * ### **Events:**
67
+ * - **forge-ai-threads-select** - Fired when a thread is selected.
68
+ * - **forge-ai-threads-new-chat** - Fired when the new chat button is clicked.
69
+ * - **forge-ai-threads-clear-history** - Fired when the clear history button is clicked.
70
+ */
71
+ export const ForgeAiThreads: React.ForwardRefExoticComponent<ForgeAiThreadsProps>;
@@ -0,0 +1,48 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "@tylertech/forge-ai/ai-threads";
3
+ import { useEventListener } from "./react-utils.js";
4
+
5
+ export const ForgeAiThreads = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const { threads, ...filteredProps } = props;
8
+
9
+ /** Event listeners - run once */
10
+ useEventListener(
11
+ ref,
12
+ "forge-ai-threads-select",
13
+ props.onForgeAiThreadsSelect,
14
+ );
15
+ useEventListener(
16
+ ref,
17
+ "forge-ai-threads-new-chat",
18
+ props.onForgeAiThreadsNewChat,
19
+ );
20
+ useEventListener(
21
+ ref,
22
+ "forge-ai-threads-clear-history",
23
+ props.onForgeAiThreadsClearHistory,
24
+ );
25
+
26
+ return React.createElement(
27
+ "forge-ai-threads",
28
+ {
29
+ ref: (node) => {
30
+ ref.current = node;
31
+ if (typeof forwardedRef === "function") {
32
+ forwardedRef(node);
33
+ } else if (forwardedRef) {
34
+ forwardedRef.current = node;
35
+ }
36
+ },
37
+ ...filteredProps,
38
+ threads: props.threads,
39
+ class: props.className,
40
+ exportparts: props.exportparts,
41
+ for: props.htmlFor,
42
+ part: props.part,
43
+ tabindex: props.tabIndex,
44
+ style: { ...props.style },
45
+ },
46
+ props.children,
47
+ );
48
+ });
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import { ForgeAiTooltip as ForgeAiTooltipElement } from "@tylertech/forge-ai/core/tooltip";
3
+
4
+ export type { ForgeAiTooltipElement };
5
+
6
+ export interface ForgeAiTooltipProps
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 tooltip is open. */
23
+ open?: boolean;
24
+
25
+ /** The ID of the anchor element to attach the tooltip to. */
26
+ for?: ForgeAiTooltipElement["for"];
27
+
28
+ /** The text content of the tooltip (alternative to slotted content). */
29
+ text?: ForgeAiTooltipElement["text"];
30
+
31
+ /** The placement of the tooltip relative to the anchor. */
32
+ placement?: ForgeAiTooltipElement["placement"];
33
+
34
+ /** How the tooltip should be triggered. */
35
+ trigger?: ForgeAiTooltipElement["trigger"];
36
+
37
+ /** Delay in milliseconds before showing the tooltip. */
38
+ delay?: ForgeAiTooltipElement["delay"];
39
+
40
+ /** Delay in milliseconds before hiding the tooltip. */
41
+ hideDelay?: ForgeAiTooltipElement["hideDelay"];
42
+
43
+ /** 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()`. */
44
+ className?: string;
45
+
46
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
47
+ exportparts?: string;
48
+
49
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
50
+ key?: number | string;
51
+
52
+ /** 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. */
53
+ part?: string;
54
+
55
+ /** 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. */
56
+ ref?: any;
57
+
58
+ /** 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. */
59
+ tabIndex?: number;
60
+ }
61
+
62
+ /**
63
+ * A tooltip component with accessibility features and dynamic positioning.
64
+ * ---
65
+ *
66
+ *
67
+ * ### **Methods:**
68
+ * - **show(): _void_** - Show the tooltip programmatically.
69
+ * - **hide(): _void_** - Hide the tooltip programmatically.
70
+ * - **toggle(): _void_** - Toggle the tooltip programmatically.
71
+ *
72
+ * ### **Slots:**
73
+ * - _default_ - The default slot for tooltip content.
74
+ *
75
+ * ### **CSS Properties:**
76
+ * - **--ai-tooltip-max-width** - The maximum width of the tooltip. _(default: undefined)_
77
+ * - **--ai-tooltip-z-index** - The z-index of the tooltip overlay. _(default: undefined)_
78
+ */
79
+ export const ForgeAiTooltip: React.ForwardRefExoticComponent<ForgeAiTooltipProps>;
@@ -0,0 +1,27 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/core/tooltip";
3
+
4
+ export const ForgeAiTooltip = forwardRef((props, forwardedRef) => {
5
+ const { open, text, placement, trigger, delay, hideDelay, ...filteredProps } =
6
+ props;
7
+
8
+ return React.createElement(
9
+ "forge-ai-tooltip",
10
+ {
11
+ ...filteredProps,
12
+ for: props.for,
13
+ text: props.text,
14
+ placement: props.placement,
15
+ trigger: props.trigger,
16
+ delay: props.delay,
17
+ "hide-delay": props.hideDelay || props["hide-delay"],
18
+ class: props.className,
19
+ exportparts: props.exportparts,
20
+ part: props.part,
21
+ tabindex: props.tabIndex,
22
+ open: props.open ? true : undefined,
23
+ style: { ...props.style },
24
+ },
25
+ props.children,
26
+ );
27
+ });
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { ForgeAiUserMessage as ForgeAiUserMessageElement } from "@tylertech/forge-ai/ai-user-message";
3
+
4
+ export type { ForgeAiUserMessageElement };
5
+
6
+ export interface ForgeAiUserMessageProps
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 ForgeAiUserMessage: React.ForwardRefExoticComponent<ForgeAiUserMessageProps>;
@@ -0,0 +1,18 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/ai-user-message";
3
+
4
+ export const ForgeAiUserMessage = forwardRef((props, forwardedRef) => {
5
+ return React.createElement(
6
+ "forge-ai-user-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,57 @@
1
+ import React from "react";
2
+ import { ForgeAiVoiceInput as ForgeAiVoiceInputElement } from "@tylertech/forge-ai/ai-voice-input";
3
+
4
+ export type { ForgeAiVoiceInputElement };
5
+
6
+ export interface ForgeAiVoiceInputProps
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 speech recognition produces a result. The event detail contains the transcript and confidence score of the recognized speech. */
44
+ onForgeAiVoiceInputResult?: (
45
+ event: CustomEvent<CustomEvent<AiVoiceInputResultEvent>>,
46
+ ) => void;
47
+ }
48
+
49
+ /**
50
+ *
51
+ * ---
52
+ *
53
+ *
54
+ * ### **Events:**
55
+ * - **forge-ai-voice-input-result** - Fired when speech recognition produces a result. The event detail contains the transcript and confidence score of the recognized speech.
56
+ */
57
+ export const ForgeAiVoiceInput: React.ForwardRefExoticComponent<ForgeAiVoiceInputProps>;
@@ -0,0 +1,36 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "@tylertech/forge-ai/ai-voice-input";
3
+ import { useEventListener } from "./react-utils.js";
4
+
5
+ export const ForgeAiVoiceInput = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+
8
+ /** Event listeners - run once */
9
+ useEventListener(
10
+ ref,
11
+ "forge-ai-voice-input-result",
12
+ props.onForgeAiVoiceInputResult,
13
+ );
14
+
15
+ return React.createElement(
16
+ "forge-ai-voice-input",
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,52 @@
1
+ import React from "react";
2
+ import { ForgePromptButton as ForgePromptButtonElement } from "@tylertech/forge-ai/ai-prompt/prompt-button";
3
+
4
+ export type { ForgePromptButtonElement };
5
+
6
+ export interface ForgePromptButtonProps
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 button is disabled */
23
+ disabled?: 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
+
47
+ /**
48
+ *
49
+ * ---
50
+ *
51
+ */
52
+ export const ForgePromptButton: React.ForwardRefExoticComponent<ForgePromptButtonProps>;
@@ -0,0 +1,21 @@
1
+ import React, { forwardRef } from "react";
2
+ import "@tylertech/forge-ai/ai-prompt/prompt-button";
3
+
4
+ export const ForgePromptButton = forwardRef((props, forwardedRef) => {
5
+ const { disabled, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "forge-prompt-button",
9
+ {
10
+ ...filteredProps,
11
+ class: props.className,
12
+ exportparts: props.exportparts,
13
+ for: props.htmlFor,
14
+ part: props.part,
15
+ tabindex: props.tabIndex,
16
+ disabled: props.disabled ? true : undefined,
17
+ style: { ...props.style },
18
+ },
19
+ props.children,
20
+ );
21
+ });
@@ -0,0 +1,38 @@
1
+ export * from "./ForgeAiActionsToolbar.js";
2
+ export * from "./ForgeAiArtifact.js";
3
+ export * from "./ForgeAiButton.js";
4
+ export * from "./ForgeAiChatHeader.js";
5
+ export * from "./ForgeAiChainOfThought.js";
6
+ export * from "./ForgeAiDialog.js";
7
+ export * from "./ForgeAiChatInterface.js";
8
+ export * from "./ForgeAiDropdownMenuItemGroup.js";
9
+ export * from "./ForgeAiDropdownMenuItem.js";
10
+ export * from "./ForgeAiDropdownMenuSeparator.js";
11
+ export * from "./ForgeAiDropdownMenu.js";
12
+ export * from "./ForgeAiEmbeddedChat.js";
13
+ export * from "./ForgeAiEmptyState.js";
14
+ export * from "./ForgeAiFab.js";
15
+ export * from "./ForgeAiFilePicker.js";
16
+ export * from "./ForgeAiFloatingChat.js";
17
+ export * from "./ForgeAiGradientContainer.js";
18
+ export * from "./ForgeAiIcon.js";
19
+ export * from "./ForgeAiModal.js";
20
+ export * from "./ForgeAiPrompt.js";
21
+ export * from "./ForgeAiReasoning.js";
22
+ export * from "./ForgeAiReasoningHeader.js";
23
+ export * from "./ForgeAiResponseMessage.js";
24
+ export * from "./ForgeAiSidebar.js";
25
+ export * from "./ForgeAiSidebarChat.js";
26
+ export * from "./ForgeAiSuggestions.js";
27
+ export * from "./ForgeAiThreads.js";
28
+ export * from "./ForgeAiUserMessage.js";
29
+ export * from "./ForgeAiVoiceInput.js";
30
+ export * from "./ForgeAiThoughtBase.js";
31
+ export * from "./ForgeAiThoughtDetail.js";
32
+ export * from "./ForgeAiThoughtImage.js";
33
+ export * from "./ForgeAiThoughtSearchResult.js";
34
+ export * from "./ForgePromptButton.js";
35
+ export * from "./ForgeAiReasoningContent.js";
36
+ export * from "./ForgeAiOverlay.js";
37
+ export * from "./ForgeAiPopover.js";
38
+ export * from "./ForgeAiTooltip.js";