@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
package/dist/ForgeAiIcon.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiIcon as ForgeAiIconElement } from "@tylertech/forge-ai/ai-icon";
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiIconElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiIconProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiIconProps 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 to display the icon with an outline */
|
|
23
22
|
outline?: boolean;
|
|
24
23
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiIconButton as ForgeAiIconButtonElement } from "@tylertech/forge-ai/ai-icon-button";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiIconButtonElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiIconButtonProps 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
|
+
/** Whether the button is disabled */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
|
|
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()`. */
|
|
25
|
+
className?: string;
|
|
26
|
+
|
|
27
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
28
|
+
exportparts?: string;
|
|
29
|
+
|
|
30
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
31
|
+
htmlFor?: string;
|
|
32
|
+
|
|
33
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
34
|
+
key?: number | string;
|
|
35
|
+
|
|
36
|
+
/** 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. */
|
|
37
|
+
part?: string;
|
|
38
|
+
|
|
39
|
+
/** 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. */
|
|
40
|
+
ref?: any;
|
|
41
|
+
|
|
42
|
+
/** 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. */
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* ---
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export const ForgeAiIconButton: React.ForwardRefExoticComponent<ForgeAiIconButtonProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-icon-button";
|
|
3
|
+
|
|
4
|
+
export const ForgeAiIconButton = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { disabled, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"forge-ai-icon-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,90 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ForgeAiMessageThread as ForgeAiMessageThreadElement } from "@tylertech/forge-ai/ai-message-thread";
|
|
3
|
+
|
|
4
|
+
export type { ForgeAiMessageThreadElement };
|
|
5
|
+
|
|
6
|
+
export interface ForgeAiMessageThreadProps 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
|
+
|
|
24
|
+
/** undefined */
|
|
25
|
+
showThinking?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
debugMode?: boolean;
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
autoScroll?: ForgeAiMessageThreadElement["autoScroll"];
|
|
32
|
+
|
|
33
|
+
/** 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()`. */
|
|
34
|
+
className?: string;
|
|
35
|
+
|
|
36
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
37
|
+
exportparts?: string;
|
|
38
|
+
|
|
39
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
40
|
+
htmlFor?: string;
|
|
41
|
+
|
|
42
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
43
|
+
key?: number | string;
|
|
44
|
+
|
|
45
|
+
/** 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. */
|
|
46
|
+
part?: string;
|
|
47
|
+
|
|
48
|
+
/** 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. */
|
|
49
|
+
ref?: any;
|
|
50
|
+
|
|
51
|
+
/** 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. */
|
|
52
|
+
tabIndex?: number;
|
|
53
|
+
|
|
54
|
+
/** Fired when user clicks copy on a message */
|
|
55
|
+
onForgeAiMessageThreadCopy?: (
|
|
56
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadCopyEventData>>,
|
|
57
|
+
) => void;
|
|
58
|
+
|
|
59
|
+
/** Fired when user clicks refresh on a message */
|
|
60
|
+
onForgeAiMessageThreadRefresh?: (
|
|
61
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadRefreshEventData>>,
|
|
62
|
+
) => void;
|
|
63
|
+
|
|
64
|
+
/** Fired when user gives thumbs up */
|
|
65
|
+
onForgeAiMessageThreadThumbsUp?: (
|
|
66
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadThumbsEventData>>,
|
|
67
|
+
) => void;
|
|
68
|
+
|
|
69
|
+
/** Fired when user gives thumbs down */
|
|
70
|
+
onForgeAiMessageThreadThumbsDown?: (
|
|
71
|
+
event: CustomEvent<CustomEvent<ForgeAiMessageThreadThumbsEventData>>,
|
|
72
|
+
) => void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A primitive component for rendering a thread of chat messages, including user, assistant, system, and tool call messages.
|
|
77
|
+
* ---
|
|
78
|
+
*
|
|
79
|
+
*
|
|
80
|
+
* ### **Events:**
|
|
81
|
+
* - **forge-ai-message-thread-copy** - Fired when user clicks copy on a message
|
|
82
|
+
* - **forge-ai-message-thread-refresh** - Fired when user clicks refresh on a message
|
|
83
|
+
* - **forge-ai-message-thread-thumbs-up** - Fired when user gives thumbs up
|
|
84
|
+
* - **forge-ai-message-thread-thumbs-down** - Fired when user gives thumbs down
|
|
85
|
+
*
|
|
86
|
+
* ### **Slots:**
|
|
87
|
+
* - **empty-state-heading** - Slot for custom empty state heading content
|
|
88
|
+
* - **empty-state-actions** - Slot for custom empty state actions (e.g., suggestions)
|
|
89
|
+
*/
|
|
90
|
+
export const ForgeAiMessageThread: React.ForwardRefExoticComponent<ForgeAiMessageThreadProps>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/ai-message-thread";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiMessageThread = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
enableReactions,
|
|
9
|
+
showThinking,
|
|
10
|
+
debugMode,
|
|
11
|
+
autoScroll,
|
|
12
|
+
...filteredProps
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
15
|
+
/** Event listeners - run once */
|
|
16
|
+
useEventListener(
|
|
17
|
+
ref,
|
|
18
|
+
"forge-ai-message-thread-copy",
|
|
19
|
+
props.onForgeAiMessageThreadCopy,
|
|
20
|
+
);
|
|
21
|
+
useEventListener(
|
|
22
|
+
ref,
|
|
23
|
+
"forge-ai-message-thread-refresh",
|
|
24
|
+
props.onForgeAiMessageThreadRefresh,
|
|
25
|
+
);
|
|
26
|
+
useEventListener(
|
|
27
|
+
ref,
|
|
28
|
+
"forge-ai-message-thread-thumbs-up",
|
|
29
|
+
props.onForgeAiMessageThreadThumbsUp,
|
|
30
|
+
);
|
|
31
|
+
useEventListener(
|
|
32
|
+
ref,
|
|
33
|
+
"forge-ai-message-thread-thumbs-down",
|
|
34
|
+
props.onForgeAiMessageThreadThumbsDown,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return React.createElement(
|
|
38
|
+
"forge-ai-message-thread",
|
|
39
|
+
{
|
|
40
|
+
ref: (node) => {
|
|
41
|
+
ref.current = node;
|
|
42
|
+
if (typeof forwardedRef === "function") {
|
|
43
|
+
forwardedRef(node);
|
|
44
|
+
} else if (forwardedRef) {
|
|
45
|
+
forwardedRef.current = node;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
...filteredProps,
|
|
49
|
+
"auto-scroll": props.autoScroll || props["auto-scroll"],
|
|
50
|
+
class: props.className,
|
|
51
|
+
exportparts: props.exportparts,
|
|
52
|
+
for: props.htmlFor,
|
|
53
|
+
part: props.part,
|
|
54
|
+
tabindex: props.tabIndex,
|
|
55
|
+
"enable-reactions": props.enableReactions ? true : undefined,
|
|
56
|
+
"show-thinking": props.showThinking ? true : undefined,
|
|
57
|
+
"debug-mode": props.debugMode ? true : undefined,
|
|
58
|
+
style: { ...props.style },
|
|
59
|
+
},
|
|
60
|
+
props.children,
|
|
61
|
+
);
|
|
62
|
+
});
|
package/dist/ForgeAiModal.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiModal as ForgeAiModalElement } from "@tylertech/forge-ai/ai-moda
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiModalElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiModalProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiModalProps 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 is open or closed. */
|
|
23
22
|
open?: boolean;
|
|
24
23
|
|
|
@@ -75,5 +74,9 @@ When not explicitly set, this will be automatically determined based on viewport
|
|
|
75
74
|
*
|
|
76
75
|
* ### **Slots:**
|
|
77
76
|
* - _default_ - Default slot for modal content
|
|
77
|
+
*
|
|
78
|
+
* ### **CSS Properties:**
|
|
79
|
+
* - **--forge-ai-modal-width** - Width of the modal in non-fullscreen mode _(default: undefined)_
|
|
80
|
+
* - **--forge-ai-modal-height** - Height of the modal in non-fullscreen mode _(default: undefined)_
|
|
78
81
|
*/
|
|
79
82
|
export const ForgeAiModal: React.ForwardRefExoticComponent<ForgeAiModalProps>;
|
package/dist/ForgeAiOverlay.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiOverlay as ForgeAiOverlayElement } from "@tylertech/forge-ai/cor
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiOverlayElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiOverlayProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiOverlayProps 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 overlay should flip to the opposite side when there's no space. */
|
|
23
22
|
flip?: boolean;
|
|
24
23
|
|
|
@@ -34,6 +33,18 @@ export interface ForgeAiOverlayProps
|
|
|
34
33
|
/** The placement of the overlay relative to the anchor. */
|
|
35
34
|
placement?: ForgeAiOverlayElement["placement"];
|
|
36
35
|
|
|
36
|
+
/** The arrow element to position relative to the overlay. */
|
|
37
|
+
arrowElement?: ForgeAiOverlayElement["arrowElement"];
|
|
38
|
+
|
|
39
|
+
/** The offset of the overlay from the anchor element.
|
|
40
|
+
Can be a number (main axis offset) or an object with mainAxis, crossAxis, and alignmentAxis properties. */
|
|
41
|
+
offset?: ForgeAiOverlayElement["offset"];
|
|
42
|
+
|
|
43
|
+
/** The dismiss mode for the overlay.
|
|
44
|
+
- 'auto': Automatically closes on outside clicks and Escape key
|
|
45
|
+
- 'manual': Requires manual control to close */
|
|
46
|
+
dismissMode?: ForgeAiOverlayElement["dismissMode"];
|
|
47
|
+
|
|
37
48
|
/** 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
49
|
className?: string;
|
|
39
50
|
|
|
@@ -63,11 +74,5 @@ export interface ForgeAiOverlayProps
|
|
|
63
74
|
*
|
|
64
75
|
* ### **Slots:**
|
|
65
76
|
* - _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
77
|
*/
|
|
73
78
|
export const ForgeAiOverlay: React.ForwardRefExoticComponent<ForgeAiOverlayProps>;
|
package/dist/ForgeAiOverlay.js
CHANGED
|
@@ -2,7 +2,17 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import "@tylertech/forge-ai/core/overlay";
|
|
3
3
|
|
|
4
4
|
export const ForgeAiOverlay = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
flip,
|
|
7
|
+
shift,
|
|
8
|
+
open,
|
|
9
|
+
anchor,
|
|
10
|
+
placement,
|
|
11
|
+
arrowElement,
|
|
12
|
+
offset,
|
|
13
|
+
dismissMode,
|
|
14
|
+
...filteredProps
|
|
15
|
+
} = props;
|
|
6
16
|
|
|
7
17
|
return React.createElement(
|
|
8
18
|
"forge-ai-overlay",
|
|
@@ -10,6 +20,9 @@ export const ForgeAiOverlay = forwardRef((props, forwardedRef) => {
|
|
|
10
20
|
...filteredProps,
|
|
11
21
|
anchor: props.anchor,
|
|
12
22
|
placement: props.placement,
|
|
23
|
+
arrowElement: props.arrowElement,
|
|
24
|
+
offset: props.offset,
|
|
25
|
+
"dismiss-mode": props.dismissMode || props["dismiss-mode"],
|
|
13
26
|
class: props.className,
|
|
14
27
|
exportparts: props.exportparts,
|
|
15
28
|
for: props.htmlFor,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
ForgeAiPaginator as ForgeAiPaginatorElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "@tylertech/forge-ai/tools/ai-paginator";
|
|
6
|
+
|
|
7
|
+
export type { ForgeAiPaginatorElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface ForgeAiPaginatorProps 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
|
+
> {
|
|
24
|
+
/** undefined */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
currentPage?: ForgeAiPaginatorElement["currentPage"];
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
totalPages?: ForgeAiPaginatorElement["totalPages"];
|
|
32
|
+
|
|
33
|
+
/** 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()`. */
|
|
34
|
+
className?: string;
|
|
35
|
+
|
|
36
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
37
|
+
exportparts?: string;
|
|
38
|
+
|
|
39
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
40
|
+
htmlFor?: string;
|
|
41
|
+
|
|
42
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
43
|
+
key?: number | string;
|
|
44
|
+
|
|
45
|
+
/** 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. */
|
|
46
|
+
part?: string;
|
|
47
|
+
|
|
48
|
+
/** 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. */
|
|
49
|
+
ref?: any;
|
|
50
|
+
|
|
51
|
+
/** 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. */
|
|
52
|
+
tabIndex?: number;
|
|
53
|
+
|
|
54
|
+
/** undefined */
|
|
55
|
+
onPageChange?: (event: CustomEvent) => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* ---
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* ### **Events:**
|
|
64
|
+
* - **page-change**
|
|
65
|
+
*/
|
|
66
|
+
export const ForgeAiPaginator: React.ForwardRefExoticComponent<ForgeAiPaginatorProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
+
import "@tylertech/forge-ai/tools/ai-paginator";
|
|
3
|
+
import { useEventListener } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const ForgeAiPaginator = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { disabled, currentPage, totalPages, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "page-change", props.onPageChange);
|
|
11
|
+
|
|
12
|
+
return React.createElement(
|
|
13
|
+
"forge-ai-paginator",
|
|
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
|
+
"current-page": props.currentPage || props["current-page"],
|
|
25
|
+
"total-pages": props.totalPages || props["total-pages"],
|
|
26
|
+
class: props.className,
|
|
27
|
+
exportparts: props.exportparts,
|
|
28
|
+
for: props.htmlFor,
|
|
29
|
+
part: props.part,
|
|
30
|
+
tabindex: props.tabIndex,
|
|
31
|
+
disabled: props.disabled ? true : undefined,
|
|
32
|
+
style: { ...props.style },
|
|
33
|
+
},
|
|
34
|
+
props.children,
|
|
35
|
+
);
|
|
36
|
+
});
|
package/dist/ForgeAiPopover.d.ts
CHANGED
|
@@ -3,22 +3,21 @@ import { ForgeAiPopover as ForgeAiPopoverElement } from "@tylertech/forge-ai/cor
|
|
|
3
3
|
|
|
4
4
|
export type { ForgeAiPopoverElement };
|
|
5
5
|
|
|
6
|
-
export interface ForgeAiPopoverProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> {
|
|
6
|
+
export interface ForgeAiPopoverProps 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 popover should flip to the opposite side when there's no space. */
|
|
23
22
|
flip?: boolean;
|
|
24
23
|
|
|
@@ -28,12 +27,24 @@ export interface ForgeAiPopoverProps
|
|
|
28
27
|
/** Whether the popover is open. */
|
|
29
28
|
open?: boolean;
|
|
30
29
|
|
|
30
|
+
/** Whether to show an arrow pointing to the anchor element. */
|
|
31
|
+
arrow?: boolean;
|
|
32
|
+
|
|
31
33
|
/** The anchor element to position the popover relative to. */
|
|
32
34
|
anchor?: ForgeAiPopoverElement["anchor"];
|
|
33
35
|
|
|
34
36
|
/** The placement of the popover relative to the anchor. */
|
|
35
37
|
placement?: ForgeAiPopoverElement["placement"];
|
|
36
38
|
|
|
39
|
+
/** The offset of the popover from the anchor element.
|
|
40
|
+
Can be a number (main axis offset) or an object with mainAxis, crossAxis, and alignmentAxis properties. */
|
|
41
|
+
offset?: ForgeAiPopoverElement["offset"];
|
|
42
|
+
|
|
43
|
+
/** The dismiss mode for the popover.
|
|
44
|
+
- 'auto': Automatically closes on outside clicks and Escape key
|
|
45
|
+
- 'manual': Requires manual control to close */
|
|
46
|
+
dismissMode?: ForgeAiPopoverElement["dismissMode"];
|
|
47
|
+
|
|
37
48
|
/** 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
49
|
className?: string;
|
|
39
50
|
|
|
@@ -63,11 +74,5 @@ export interface ForgeAiPopoverProps
|
|
|
63
74
|
*
|
|
64
75
|
* ### **Slots:**
|
|
65
76
|
* - _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
77
|
*/
|
|
73
78
|
export const ForgeAiPopover: React.ForwardRefExoticComponent<ForgeAiPopoverProps>;
|
package/dist/ForgeAiPopover.js
CHANGED
|
@@ -2,7 +2,17 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import "@tylertech/forge-ai/core/popover";
|
|
3
3
|
|
|
4
4
|
export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
flip,
|
|
7
|
+
shift,
|
|
8
|
+
open,
|
|
9
|
+
arrow,
|
|
10
|
+
anchor,
|
|
11
|
+
placement,
|
|
12
|
+
offset,
|
|
13
|
+
dismissMode,
|
|
14
|
+
...filteredProps
|
|
15
|
+
} = props;
|
|
6
16
|
|
|
7
17
|
return React.createElement(
|
|
8
18
|
"forge-ai-popover",
|
|
@@ -10,6 +20,8 @@ export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
|
10
20
|
...filteredProps,
|
|
11
21
|
anchor: props.anchor,
|
|
12
22
|
placement: props.placement,
|
|
23
|
+
offset: props.offset,
|
|
24
|
+
"dismiss-mode": props.dismissMode || props["dismiss-mode"],
|
|
13
25
|
class: props.className,
|
|
14
26
|
exportparts: props.exportparts,
|
|
15
27
|
for: props.htmlFor,
|
|
@@ -18,6 +30,7 @@ export const ForgeAiPopover = forwardRef((props, forwardedRef) => {
|
|
|
18
30
|
flip: props.flip ? true : undefined,
|
|
19
31
|
shift: props.shift ? true : undefined,
|
|
20
32
|
open: props.open ? true : undefined,
|
|
33
|
+
arrow: props.arrow ? true : undefined,
|
|
21
34
|
style: { ...props.style },
|
|
22
35
|
},
|
|
23
36
|
props.children,
|