@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,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-gradient-container";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiGradientContainer = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { variant, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-gradient-container",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
variant: props.variant,
|
|
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,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiIcon as ForgeAiIconElement } from "@tylertech/forge-ai/ai-icon";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiIconElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiIconProps
|
|
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 to display the icon with an outline */
|
|
23
|
+
outline?: 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 ForgeAiIcon: React.ForwardRefExoticComponent<ForgeAiIconProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-icon";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiIcon = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { outline, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-icon",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
class: props.className,
|
|
12
|
+
exportparts: props.exportparts,
|
|
13
|
+
for: props.htmlFor,
|
|
14
|
+
part: props.part,
|
|
15
|
+
tabindex: props.tabIndex,
|
|
16
|
+
outline: props.outline ? true : undefined,
|
|
17
|
+
style: { ...props.style },
|
|
18
|
+
},
|
|
19
|
+
props.children,
|
|
20
|
+
);
|
|
21
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiModal as ForgeAiModalElement } from "@tylertech/forge-ai/ai-modal";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiModalElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiModalProps
|
|
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
|
+
/** Controls whether the modal is open or closed. */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Controls whether the modal is displayed in fullscreen mode.
|
|
26
|
+
When not explicitly set, this will be automatically determined based on viewport size. */
|
|
27
|
+
fullscreen?: boolean | undefined;
|
|
28
|
+
|
|
29
|
+
/** 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()`. */
|
|
30
|
+
className?: string;
|
|
31
|
+
|
|
32
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
33
|
+
exportparts?: string;
|
|
34
|
+
|
|
35
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
36
|
+
htmlFor?: string;
|
|
37
|
+
|
|
38
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
39
|
+
key?: number | string;
|
|
40
|
+
|
|
41
|
+
/** 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. */
|
|
42
|
+
part?: string;
|
|
43
|
+
|
|
44
|
+
/** 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. */
|
|
45
|
+
ref?: any;
|
|
46
|
+
|
|
47
|
+
/** 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. */
|
|
48
|
+
tabIndex?: number;
|
|
49
|
+
|
|
50
|
+
/** Fired when the modal is opened */
|
|
51
|
+
onForgeAiModalOpen?: (event: CustomEvent<CustomEvent<void>>) => void;
|
|
52
|
+
|
|
53
|
+
/** Fired when the modal is closed */
|
|
54
|
+
onForgeAiModalClose?: (event: CustomEvent<CustomEvent<void>>) => void;
|
|
55
|
+
|
|
56
|
+
/** Fired when the fullscreen state changes */
|
|
57
|
+
onForgeAiModalFullscreenChange?: (
|
|
58
|
+
event: CustomEvent<CustomEvent<{ isFullscreen: boolean }>>,
|
|
59
|
+
) => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* ---
|
|
65
|
+
*
|
|
66
|
+
*
|
|
67
|
+
* ### **Events:**
|
|
68
|
+
* - **forge-ai-modal-open** - Fired when the modal is opened
|
|
69
|
+
* - **forge-ai-modal-close** - Fired when the modal is closed
|
|
70
|
+
* - **forge-ai-modal-fullscreen-change** - Fired when the fullscreen state changes
|
|
71
|
+
*
|
|
72
|
+
* ### **Methods:**
|
|
73
|
+
* - **show(): _void_** - Shows the modal dialog.
|
|
74
|
+
* - **close(): _void_** - Closes the modal dialog.
|
|
75
|
+
*
|
|
76
|
+
* ### **Slots:**
|
|
77
|
+
* - _default_ - Default slot for modal content
|
|
78
|
+
*/
|
|
79
|
+
export const ForgeAiModal: React.ForwardRefExoticComponent<ForgeAiModalProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-modal";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiModal = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { open, fullscreen, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "forge-ai-modal-open", props.onForgeAiModalOpen);
|
|
11
|
+
useEventListener(ref, "forge-ai-modal-close", props.onForgeAiModalClose);
|
|
12
|
+
useEventListener(
|
|
13
|
+
ref,
|
|
14
|
+
"forge-ai-modal-fullscreen-change",
|
|
15
|
+
props.onForgeAiModalFullscreenChange,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
return React.createElement(
|
|
19
|
+
"forge-ai-modal",
|
|
20
|
+
{
|
|
21
|
+
ref: (node) => {
|
|
22
|
+
ref.current = node;
|
|
23
|
+
if (typeof forwardedRef === "function") {
|
|
24
|
+
forwardedRef(node);
|
|
25
|
+
} else if (forwardedRef) {
|
|
26
|
+
forwardedRef.current = node;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
...filteredProps,
|
|
30
|
+
class: props.className,
|
|
31
|
+
exportparts: props.exportparts,
|
|
32
|
+
for: props.htmlFor,
|
|
33
|
+
part: props.part,
|
|
34
|
+
tabindex: props.tabIndex,
|
|
35
|
+
open: props.open ? true : undefined,
|
|
36
|
+
fullscreen: props.fullscreen ? true : undefined,
|
|
37
|
+
style: { ...props.style },
|
|
38
|
+
},
|
|
39
|
+
props.children,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiOverlay as ForgeAiOverlayElement } from "@tylertech/forge-ai/core/overlay";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiOverlayElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiOverlayProps
|
|
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 overlay should flip to the opposite side when there's no space. */
|
|
23
|
+
flip?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Whether the overlay should shift to stay in view. */
|
|
26
|
+
shift?: boolean;
|
|
27
|
+
|
|
28
|
+
/** Whether the overlay is open. */
|
|
29
|
+
open?: boolean;
|
|
30
|
+
|
|
31
|
+
/** The anchor element to position the overlay relative to. */
|
|
32
|
+
anchor?: ForgeAiOverlayElement["anchor"];
|
|
33
|
+
|
|
34
|
+
/** The placement of the overlay relative to the anchor. */
|
|
35
|
+
placement?: ForgeAiOverlayElement["placement"];
|
|
36
|
+
|
|
37
|
+
/** 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()`. */
|
|
38
|
+
className?: string;
|
|
39
|
+
|
|
40
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
41
|
+
exportparts?: string;
|
|
42
|
+
|
|
43
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
44
|
+
htmlFor?: string;
|
|
45
|
+
|
|
46
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
47
|
+
key?: number | string;
|
|
48
|
+
|
|
49
|
+
/** 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. */
|
|
50
|
+
part?: string;
|
|
51
|
+
|
|
52
|
+
/** 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. */
|
|
53
|
+
ref?: any;
|
|
54
|
+
|
|
55
|
+
/** 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. */
|
|
56
|
+
tabIndex?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A low-level overlay component for internal use within AI components.
|
|
61
|
+
* ---
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* ### **Slots:**
|
|
65
|
+
* - _default_ - The default slot for overlay content.
|
|
66
|
+
*
|
|
67
|
+
* ### **CSS Properties:**
|
|
68
|
+
* - **--ai-overlay-max-width** - The maximum width of the overlay. _(default: undefined)_
|
|
69
|
+
* - **--ai-overlay-max-height** - The maximum height of the overlay. _(default: undefined)_
|
|
70
|
+
* - **--ai-overlay-min-width** - The minimum width of the overlay. _(default: undefined)_
|
|
71
|
+
* - **--ai-overlay-min-height** - The minimum height of the overlay. _(default: undefined)_
|
|
72
|
+
*/
|
|
73
|
+
export const ForgeAiOverlay: React.ForwardRefExoticComponent<ForgeAiOverlayProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/core/overlay";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiOverlay = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { flip, shift, open, anchor, placement, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-overlay",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
anchor: props.anchor,
|
|
12
|
+
placement: props.placement,
|
|
13
|
+
class: props.className,
|
|
14
|
+
exportparts: props.exportparts,
|
|
15
|
+
for: props.htmlFor,
|
|
16
|
+
part: props.part,
|
|
17
|
+
tabindex: props.tabIndex,
|
|
18
|
+
flip: props.flip ? true : undefined,
|
|
19
|
+
shift: props.shift ? true : undefined,
|
|
20
|
+
open: props.open ? true : undefined,
|
|
21
|
+
style: { ...props.style },
|
|
22
|
+
},
|
|
23
|
+
props.children,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiPopover as ForgeAiPopoverElement } from "@tylertech/forge-ai/core/popover";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiPopoverElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiPopoverProps
|
|
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 popover should flip to the opposite side when there's no space. */
|
|
23
|
+
flip?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Whether the popover should shift to stay in view. */
|
|
26
|
+
shift?: boolean;
|
|
27
|
+
|
|
28
|
+
/** Whether the popover is open. */
|
|
29
|
+
open?: boolean;
|
|
30
|
+
|
|
31
|
+
/** The anchor element to position the popover relative to. */
|
|
32
|
+
anchor?: ForgeAiPopoverElement["anchor"];
|
|
33
|
+
|
|
34
|
+
/** The placement of the popover relative to the anchor. */
|
|
35
|
+
placement?: ForgeAiPopoverElement["placement"];
|
|
36
|
+
|
|
37
|
+
/** 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()`. */
|
|
38
|
+
className?: string;
|
|
39
|
+
|
|
40
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
41
|
+
exportparts?: string;
|
|
42
|
+
|
|
43
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
44
|
+
htmlFor?: string;
|
|
45
|
+
|
|
46
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
47
|
+
key?: number | string;
|
|
48
|
+
|
|
49
|
+
/** 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. */
|
|
50
|
+
part?: string;
|
|
51
|
+
|
|
52
|
+
/** 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. */
|
|
53
|
+
ref?: any;
|
|
54
|
+
|
|
55
|
+
/** 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. */
|
|
56
|
+
tabIndex?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A popover component that provides styled overlay functionality.
|
|
61
|
+
* ---
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* ### **Slots:**
|
|
65
|
+
* - _default_ - The default slot for popover content.
|
|
66
|
+
*
|
|
67
|
+
* ### **CSS Properties:**
|
|
68
|
+
* - **--ai-popover-max-width** - The maximum width of the popover. _(default: undefined)_
|
|
69
|
+
* - **--ai-popover-max-height** - The maximum height of the popover. _(default: undefined)_
|
|
70
|
+
* - **--ai-popover-min-width** - The minimum width of the popover. _(default: undefined)_
|
|
71
|
+
* - **--ai-popover-min-height** - The minimum height of the popover. _(default: undefined)_
|
|
72
|
+
*/
|
|
73
|
+
export const ForgeAiPopover: React.ForwardRefExoticComponent<ForgeAiPopoverProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/core/popover";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { flip, shift, open, anchor, placement, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-popover",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
anchor: props.anchor,
|
|
12
|
+
placement: props.placement,
|
|
13
|
+
class: props.className,
|
|
14
|
+
exportparts: props.exportparts,
|
|
15
|
+
for: props.htmlFor,
|
|
16
|
+
part: props.part,
|
|
17
|
+
tabindex: props.tabIndex,
|
|
18
|
+
flip: props.flip ? true : undefined,
|
|
19
|
+
shift: props.shift ? true : undefined,
|
|
20
|
+
open: props.open ? true : undefined,
|
|
21
|
+
style: { ...props.style },
|
|
22
|
+
},
|
|
23
|
+
props.children,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiPrompt as ForgeAiPromptElement } from "@tylertech/forge-ai/ai-prompt";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiPromptElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiPromptProps
|
|
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
|
+
/** Placeholder text for the input field */
|
|
23
|
+
placeholder?: ForgeAiPromptElement["placeholder"];
|
|
24
|
+
|
|
25
|
+
/** Current value of the input field */
|
|
26
|
+
value?: ForgeAiPromptElement["value"];
|
|
27
|
+
|
|
28
|
+
/** Layout variant for the prompt component */
|
|
29
|
+
variant?: ForgeAiPromptElement["variant"];
|
|
30
|
+
|
|
31
|
+
/** 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()`. */
|
|
32
|
+
className?: string;
|
|
33
|
+
|
|
34
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
35
|
+
exportparts?: string;
|
|
36
|
+
|
|
37
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
38
|
+
htmlFor?: string;
|
|
39
|
+
|
|
40
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
41
|
+
key?: number | string;
|
|
42
|
+
|
|
43
|
+
/** 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. */
|
|
44
|
+
part?: string;
|
|
45
|
+
|
|
46
|
+
/** 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. */
|
|
47
|
+
ref?: any;
|
|
48
|
+
|
|
49
|
+
/** 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. */
|
|
50
|
+
tabIndex?: number;
|
|
51
|
+
|
|
52
|
+
/** Fired when the send button is clicked or Enter is pressed. */
|
|
53
|
+
onForgeAiPromptSend?: (
|
|
54
|
+
event: CustomEvent<CustomEvent<AiPromptSendEventData>>,
|
|
55
|
+
) => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* ---
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* ### **Events:**
|
|
64
|
+
* - **forge-ai-prompt-send** - Fired when the send button is clicked or Enter is pressed.
|
|
65
|
+
*
|
|
66
|
+
* ### **Slots:**
|
|
67
|
+
* - **actions** - Slot for action components like dropdown menus, voice input, buttons, etc.
|
|
68
|
+
*/
|
|
69
|
+
export const ForgeAiPrompt: React.ForwardRefExoticComponent<ForgeAiPromptProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-prompt";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiPrompt = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { placeholder, value, variant, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "forge-ai-prompt-send", props.onForgeAiPromptSend);
|
|
11
|
+
|
|
12
|
+
return React.createElement(
|
|
13
|
+
"forge-ai-prompt",
|
|
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
|
+
placeholder: props.placeholder,
|
|
25
|
+
value: props.value,
|
|
26
|
+
variant: props.variant,
|
|
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 { ForgeAiReasoning as ForgeAiReasoningElement } from "@tylertech/forge-ai/ai-reasoning";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiReasoningElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiReasoningProps
|
|
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 reasoning is expanded */
|
|
23
|
+
expanded?: 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 ForgeAiReasoning: React.ForwardRefExoticComponent<ForgeAiReasoningProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-reasoning";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiReasoning = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { expanded, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-reasoning",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
class: props.className,
|
|
12
|
+
exportparts: props.exportparts,
|
|
13
|
+
for: props.htmlFor,
|
|
14
|
+
part: props.part,
|
|
15
|
+
tabindex: props.tabIndex,
|
|
16
|
+
expanded: props.expanded ? true : undefined,
|
|
17
|
+
style: { ...props.style },
|
|
18
|
+
},
|
|
19
|
+
props.children,
|
|
20
|
+
);
|
|
21
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiReasoningContent as ForgeAiReasoningContentElement } from "@tylertech/forge-ai/ai-reasoning/reasoning-content";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiReasoningContentElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiReasoningContentProps
|
|
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 ForgeAiReasoningContent: React.ForwardRefExoticComponent<ForgeAiReasoningContentProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-reasoning/reasoning-content";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiReasoningContent = forwardRef((props, forwardedRef) => {
|
|
5
|
+
return React.createElement(
|
|
6
|
+
"forge-ai-reasoning-content",
|
|
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
|
+
});
|