tfy-web-components 0.0.44 → 0.0.45
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/{Button-BdNaawKV.js → Button-HHEfL8b9.js} +5 -4
- package/dist/{Button-BdNaawKV.js.map → Button-HHEfL8b9.js.map} +1 -1
- package/dist/CSPContext-Cldo9QDp.js +13 -0
- package/dist/CSPContext-Cldo9QDp.js.map +1 -0
- package/dist/{CompositeItem-EOSJycCk.js → CompositeItem-GNejxLcK.js} +3 -3
- package/dist/{CompositeItem-EOSJycCk.js.map → CompositeItem-GNejxLcK.js.map} +1 -1
- package/dist/{CompositeRoot-DnijP7Jm.js → CompositeRoot-7_u1HqDT.js} +9 -47
- package/dist/CompositeRoot-7_u1HqDT.js.map +1 -0
- package/dist/DropdownMenu-Crlf-J4E.js +3304 -0
- package/dist/DropdownMenu-Crlf-J4E.js.map +1 -0
- package/dist/{Input-D0UuCXLs.js → Input-BS9fWUAf.js} +3 -3
- package/dist/{Input-D0UuCXLs.js.map → Input-BS9fWUAf.js.map} +1 -1
- package/dist/{Modal-BFnf68oS.js → Modal-DaHG8mjy.js} +10 -10
- package/dist/{Modal-BFnf68oS.js.map → Modal-DaHG8mjy.js.map} +1 -1
- package/dist/Popover-A8IyEt2w.js +400 -0
- package/dist/Popover-A8IyEt2w.js.map +1 -0
- package/dist/{Popover-B6z7exNd.js → PopoverPopup-teGm7D5T.js} +25 -498
- package/dist/PopoverPopup-teGm7D5T.js.map +1 -0
- package/dist/{PrehydrationScript--08s8Mfl.js → PrehydrationScript-B3u_PP2W.js} +5 -12
- package/dist/PrehydrationScript-B3u_PP2W.js.map +1 -0
- package/dist/Select-BtX40h2K.js +2187 -0
- package/dist/Select-BtX40h2K.js.map +1 -0
- package/dist/{useValueAsRef-BfFRcMg6.js → addEventListener-D-i9O6BG.js} +8 -8
- package/dist/addEventListener-D-i9O6BG.js.map +1 -0
- package/dist/clamp-D7_nsB8C.js +30 -0
- package/dist/clamp-D7_nsB8C.js.map +1 -0
- package/dist/components/atoms/Accordion.es.js +9 -9
- package/dist/components/atoms/Avatar.es.js +9 -9
- package/dist/components/atoms/Avatar.es.js.map +1 -1
- package/dist/components/atoms/Badge.d.ts +5 -6
- package/dist/components/atoms/Badge.es.js +80 -43
- package/dist/components/atoms/Badge.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +1 -1
- package/dist/components/atoms/Button.es.js +2 -2
- package/dist/components/atoms/ButtonGroup.es.js +1 -1
- package/dist/components/atoms/Combobox.d.ts +34 -0
- package/dist/components/atoms/Combobox.es.js +3252 -0
- package/dist/components/atoms/Combobox.es.js.map +1 -0
- package/dist/components/atoms/ContextMenu.d.ts +12 -0
- package/dist/components/atoms/ContextMenu.es.js +259 -0
- package/dist/components/atoms/ContextMenu.es.js.map +1 -0
- package/dist/components/atoms/DropdownMenu.d.ts +51 -0
- package/dist/components/atoms/DropdownMenu.es.js +31 -0
- package/dist/components/atoms/DropdownMenu.es.js.map +1 -0
- package/dist/components/atoms/IconButton.d.ts +1 -1
- package/dist/components/atoms/IconButton.es.js +3 -3
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.es.js +3 -1
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Modal.es.js +1 -1
- package/dist/components/atoms/OverflowButton.es.js +2 -2
- package/dist/components/atoms/PaginationDot.d.ts +14 -0
- package/dist/components/atoms/PaginationDot.es.js +58 -0
- package/dist/components/atoms/PaginationDot.es.js.map +1 -0
- package/dist/components/atoms/PaginationItem.d.ts +15 -0
- package/dist/components/atoms/PaginationItem.es.js +87 -0
- package/dist/components/atoms/PaginationItem.es.js.map +1 -0
- package/dist/components/atoms/Popover.d.ts +10 -0
- package/dist/components/atoms/Popover.es.js +50 -0
- package/dist/components/atoms/Popover.es.js.map +1 -0
- package/dist/components/atoms/Select.d.ts +63 -0
- package/dist/components/atoms/Select.es.js +23 -0
- package/dist/components/atoms/Select.es.js.map +1 -0
- package/dist/components/atoms/Switch.es.js +7 -6
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.es.js +14 -12
- package/dist/components/atoms/TabButton.es.js.map +1 -1
- package/dist/components/atoms/Tag.d.ts +2 -2
- package/dist/components/atoms/Tag.es.js +66 -33
- package/dist/components/atoms/Tag.es.js.map +1 -1
- package/dist/components/atoms/Tooltip.es.js +1153 -19
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/atoms/stories/OverlayThemePanels.d.ts +8 -0
- package/dist/components/molecules/Alert.es.js +3 -3
- package/dist/components/molecules/CopyField.es.js +2 -2
- package/dist/components/molecules/CustomDrawer.es.js +1 -1
- package/dist/components/molecules/Dialog.es.js +1 -1
- package/dist/components/molecules/ImagesPreview.es.js +2 -2
- package/dist/components/molecules/Input.es.js +2 -2
- package/dist/components/molecules/Markdown.es.js +1 -1
- package/dist/components/molecules/Pagination.d.ts +58 -0
- package/dist/components/molecules/Pagination.es.js +272 -0
- package/dist/components/molecules/Pagination.es.js.map +1 -0
- package/dist/components/molecules/SimpleCodeEditor.es.js +3 -3
- package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
- package/dist/components/molecules/TagGroup.d.ts +11 -0
- package/dist/components/molecules/TagGroup.es.js +59 -0
- package/dist/components/molecules/TagGroup.es.js.map +1 -0
- package/dist/components/molecules/ToggleButton.es.js +2 -2
- package/dist/components/molecules/agent-chat/AssistantMessage.d.ts +3 -1
- package/dist/components/molecules/agent-chat.es.js +4 -3
- package/dist/components/molecules/agent-chat.es.js.map +1 -1
- package/dist/composite-DnShFmi7.js +551 -0
- package/dist/composite-DnShFmi7.js.map +1 -0
- package/dist/{composite-BDBV1Jsx.js → composite-IA--dSel.js} +2 -2
- package/dist/{composite-BDBV1Jsx.js.map → composite-IA--dSel.js.map} +1 -1
- package/dist/constants-BaUKmVF_.js +103 -0
- package/dist/constants-BaUKmVF_.js.map +1 -0
- package/dist/{index-B6xFUIBK.js → element-B1vbc-LG.js} +69 -111
- package/dist/element-B1vbc-LG.js.map +1 -0
- package/dist/error-nCTLdGUr.js +6 -0
- package/dist/{error-FX4R42W-.js.map → error-nCTLdGUr.js.map} +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.es.js +61 -11
- package/dist/index.es.js.map +1 -1
- package/dist/{inertValue-IJM5NA30.js → inertValue-C1Ml1s55.js} +2 -2
- package/dist/{inertValue-IJM5NA30.js.map → inertValue-C1Ml1s55.js.map} +1 -1
- package/dist/isElementDisabled-lq1fKien.js +47 -0
- package/dist/isElementDisabled-lq1fKien.js.map +1 -0
- package/dist/new-components/atoms/Alert.d.ts +7 -1
- package/dist/new-components/atoms/Alert.es.js +23 -4
- package/dist/new-components/atoms/Alert.es.js.map +1 -1
- package/dist/new-components/atoms/Checkbox.es.js +8 -7
- package/dist/new-components/atoms/Checkbox.es.js.map +1 -1
- package/dist/new-components/atoms/EmptyState.d.ts +3 -0
- package/dist/new-components/atoms/EmptyState.es.js +9 -4
- package/dist/new-components/atoms/EmptyState.es.js.map +1 -1
- package/dist/new-components/atoms/Popover.es.js +3 -2
- package/dist/new-components/atoms/Popover.es.js.map +1 -1
- package/dist/new-components/atoms/Radio.es.js +13 -24
- package/dist/new-components/atoms/Radio.es.js.map +1 -1
- package/dist/new-components/atoms/SegmentedControl.es.js +7 -7
- package/dist/new-components/atoms/Slider.es.js +14 -43
- package/dist/new-components/atoms/Slider.es.js.map +1 -1
- package/dist/new-components/atoms/Toast.d.ts +8 -12
- package/dist/new-components/atoms/Toast.es.js +202 -145
- package/dist/new-components/atoms/Toast.es.js.map +1 -1
- package/dist/new-components/atoms/Toggletip.es.js +3 -2
- package/dist/new-components/atoms/Toggletip.es.js.map +1 -1
- package/dist/new-components/atoms/stories/ThemeComparison.d.ts +2 -1
- package/dist/serializeValue-BLvnTy3o.js +17 -0
- package/dist/serializeValue-BLvnTy3o.js.map +1 -0
- package/dist/stringifyLocale-DOx30wH1.js +13 -0
- package/dist/stringifyLocale-DOx30wH1.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tokens.css +3 -0
- package/dist/{useAnimationFrame-DwhymJoW.js → useAnimationFrame-DqvuRtgK.js} +2 -2
- package/dist/{useAnimationFrame-DwhymJoW.js.map → useAnimationFrame-DqvuRtgK.js.map} +1 -1
- package/dist/{useAriaLabelledBy-C9SDiruE.js → useAriaLabelledBy-CP4wKTYs.js} +3 -3
- package/dist/{useAriaLabelledBy-C9SDiruE.js.map → useAriaLabelledBy-CP4wKTYs.js.map} +1 -1
- package/dist/{useBaseUiId-jtgiQp--.js → useBaseUiId-CYT1vFMG.js} +57 -37
- package/dist/{useBaseUiId-jtgiQp--.js.map → useBaseUiId-CYT1vFMG.js.map} +1 -1
- package/dist/{useButton-BalOc_EL.js → useButton-BlHadUfM.js} +4 -4
- package/dist/{useButton-BalOc_EL.js.map → useButton-BlHadUfM.js.map} +1 -1
- package/dist/{CompositeList-D4xmSZ5V.js → useCompositeListItem-DlAKWsHE.js} +59 -59
- package/dist/useCompositeListItem-DlAKWsHE.js.map +1 -0
- package/dist/{useControlled-BSyYkg5C.js → useControlled-DMDWXIzj.js} +2 -2
- package/dist/{useControlled-BSyYkg5C.js.map → useControlled-DMDWXIzj.js.map} +1 -1
- package/dist/useFocus-C__7iwl1.js +137 -0
- package/dist/useFocus-C__7iwl1.js.map +1 -0
- package/dist/{useIsoLayoutEffect-e9VA-ICd.js → useIsoLayoutEffect-D2lpsB9D.js} +8 -4
- package/dist/{useIsoLayoutEffect-e9VA-ICd.js.map → useIsoLayoutEffect-D2lpsB9D.js.map} +1 -1
- package/dist/{usePopupHandleStore-DYUo-Fyk.js → usePopupHandleStore-C_Vw7xcw.js} +1966 -2002
- package/dist/usePopupHandleStore-C_Vw7xcw.js.map +1 -0
- package/dist/{Tooltip-6R-t7wt1.js → usePositioner-BmYVsMO_.js} +17 -1403
- package/dist/usePositioner-BmYVsMO_.js.map +1 -0
- package/dist/{useOpenInteractionType-BnUZ2Eio.js → useScrollLock-By-42HSc.js} +74 -58
- package/dist/useScrollLock-By-42HSc.js.map +1 -0
- package/dist/{useLabelableId-CQqNbBk1.js → useSetFieldFocused-CcdG6FNp.js} +27 -35
- package/dist/useSetFieldFocused-CcdG6FNp.js.map +1 -0
- package/dist/{useTimeout-BXf1hDIL.js → useTimeout-D1vYJgq4.js} +3 -3
- package/dist/{useTimeout-BXf1hDIL.js.map → useTimeout-D1vYJgq4.js.map} +1 -1
- package/dist/{useTransitionStatus-C9gg_XJ-.js → useTransitionStatus-CHrs3i5F.js} +3 -3
- package/dist/{useTransitionStatus-C9gg_XJ-.js.map → useTransitionStatus-CHrs3i5F.js.map} +1 -1
- package/dist/useTriggerFocusGuards-CXAhW8P6.js +100 -0
- package/dist/useTriggerFocusGuards-CXAhW8P6.js.map +1 -0
- package/dist/useValueChanged-BnlOop8k.js +16 -0
- package/dist/useValueChanged-BnlOop8k.js.map +1 -0
- package/package.json +1 -1
- package/dist/CompositeList-D4xmSZ5V.js.map +0 -1
- package/dist/CompositeRoot-DnijP7Jm.js.map +0 -1
- package/dist/Popover-B6z7exNd.js.map +0 -1
- package/dist/PrehydrationScript--08s8Mfl.js.map +0 -1
- package/dist/Tooltip-6R-t7wt1.js.map +0 -1
- package/dist/composite-rAI4IlWK.js +0 -66
- package/dist/composite-rAI4IlWK.js.map +0 -1
- package/dist/error-FX4R42W-.js +0 -6
- package/dist/index-B6xFUIBK.js.map +0 -1
- package/dist/shadowDom-CRvvf3qf.js +0 -52
- package/dist/shadowDom-CRvvf3qf.js.map +0 -1
- package/dist/useLabelableId-CQqNbBk1.js.map +0 -1
- package/dist/useOpenInteractionType-BnUZ2Eio.js.map +0 -1
- package/dist/usePopupHandleStore-DYUo-Fyk.js.map +0 -1
- package/dist/useValueAsRef-BfFRcMg6.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
|
|
2
|
+
type ContextMenuPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
3
|
+
declare const ContextMenu: typeof ContextMenuPrimitive.Root;
|
|
4
|
+
declare function ContextMenuTrigger(props: ContextMenuPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
type ContextMenuContentProps = ContextMenuPrimitive.Popup.Props & {
|
|
6
|
+
container?: ContextMenuPrimitive.Portal.Props['container'];
|
|
7
|
+
placement?: ContextMenuPlacement;
|
|
8
|
+
positionerClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
declare function ContextMenuContent({ className, container, placement, positionerClassName, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
11
|
+
export { ContextMenu, ContextMenuContent, ContextMenuTrigger };
|
|
12
|
+
export type { ContextMenuContentProps, ContextMenuPlacement };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C as ContextMenuRootContext, M as MenuRootContext, v as MenuRoot, w as useContextMenuRootContext, x as useMenuRootContext, y as findRootOwnerId, z as MenuPositioner, A as MenuPortal, B as MenuPopup, t as dropdownPanelVariants } from "../../DropdownMenu-Crlf-J4E.js";
|
|
3
|
+
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { j as useId, c as createChangeEventDetails, k as cancelOpen, t as triggerPress } from "../../useBaseUiId-CYT1vFMG.js";
|
|
6
|
+
import { a as addEventListener } from "../../addEventListener-D-i9O6BG.js";
|
|
7
|
+
import { o as ownerDocument } from "../../element-B1vbc-LG.js";
|
|
8
|
+
import { u as useTimeout } from "../../useTimeout-D1vYJgq4.js";
|
|
9
|
+
import { b as useRenderElement } from "../../useIsoLayoutEffect-D2lpsB9D.js";
|
|
10
|
+
import { p as pressableTriggerOpenStateMapping } from "../../usePopupHandleStore-C_Vw7xcw.js";
|
|
11
|
+
import { g as getTarget, c as contains } from "../../constants-BaUKmVF_.js";
|
|
12
|
+
import { s as stopEvent } from "../../composite-DnShFmi7.js";
|
|
13
|
+
function ContextMenuRoot(props) {
|
|
14
|
+
const [anchor, setAnchor] = React.useState({
|
|
15
|
+
getBoundingClientRect() {
|
|
16
|
+
return DOMRect.fromRect({
|
|
17
|
+
width: 0,
|
|
18
|
+
height: 0,
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const backdropRef = React.useRef(null);
|
|
25
|
+
const internalBackdropRef = React.useRef(null);
|
|
26
|
+
const actionsRef = React.useRef(null);
|
|
27
|
+
const positionerRef = React.useRef(null);
|
|
28
|
+
const allowMouseUpTriggerRef = React.useRef(true);
|
|
29
|
+
const initialCursorPointRef = React.useRef(null);
|
|
30
|
+
const id = useId();
|
|
31
|
+
const contextValue = React.useMemo(() => ({
|
|
32
|
+
anchor,
|
|
33
|
+
setAnchor,
|
|
34
|
+
actionsRef,
|
|
35
|
+
backdropRef,
|
|
36
|
+
internalBackdropRef,
|
|
37
|
+
positionerRef,
|
|
38
|
+
allowMouseUpTriggerRef,
|
|
39
|
+
initialCursorPointRef,
|
|
40
|
+
rootId: id
|
|
41
|
+
}), [anchor, id]);
|
|
42
|
+
return /* @__PURE__ */ jsx(ContextMenuRootContext.Provider, {
|
|
43
|
+
value: contextValue,
|
|
44
|
+
children: /* @__PURE__ */ jsx(MenuRootContext.Provider, {
|
|
45
|
+
value: void 0,
|
|
46
|
+
children: /* @__PURE__ */ jsx(MenuRoot, {
|
|
47
|
+
...props
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const LONG_PRESS_DELAY = 500;
|
|
53
|
+
const ContextMenuTrigger$1 = /* @__PURE__ */ React.forwardRef(function ContextMenuTrigger(componentProps, forwardedRef) {
|
|
54
|
+
const {
|
|
55
|
+
render,
|
|
56
|
+
className,
|
|
57
|
+
style,
|
|
58
|
+
...elementProps
|
|
59
|
+
} = componentProps;
|
|
60
|
+
const {
|
|
61
|
+
setAnchor,
|
|
62
|
+
actionsRef,
|
|
63
|
+
internalBackdropRef,
|
|
64
|
+
backdropRef,
|
|
65
|
+
positionerRef,
|
|
66
|
+
allowMouseUpTriggerRef,
|
|
67
|
+
initialCursorPointRef,
|
|
68
|
+
rootId
|
|
69
|
+
} = useContextMenuRootContext(false);
|
|
70
|
+
const {
|
|
71
|
+
store
|
|
72
|
+
} = useMenuRootContext(false);
|
|
73
|
+
const open = store.useState("open");
|
|
74
|
+
const disabled = store.useState("disabled");
|
|
75
|
+
const triggerRef = React.useRef(null);
|
|
76
|
+
const touchPositionRef = React.useRef(null);
|
|
77
|
+
const longPressTimeout = useTimeout();
|
|
78
|
+
const allowMouseUpTimeout = useTimeout();
|
|
79
|
+
const allowMouseUpRef = React.useRef(false);
|
|
80
|
+
const mouseUpAbortControllerRef = React.useRef(null);
|
|
81
|
+
function handleLongPress(x, y, event) {
|
|
82
|
+
var _a;
|
|
83
|
+
const isTouchEvent = event.type.startsWith("touch");
|
|
84
|
+
initialCursorPointRef.current = {
|
|
85
|
+
x,
|
|
86
|
+
y
|
|
87
|
+
};
|
|
88
|
+
setAnchor({
|
|
89
|
+
getBoundingClientRect() {
|
|
90
|
+
return DOMRect.fromRect({
|
|
91
|
+
width: isTouchEvent ? 10 : 0,
|
|
92
|
+
height: isTouchEvent ? 10 : 0,
|
|
93
|
+
x,
|
|
94
|
+
y
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
allowMouseUpRef.current = false;
|
|
99
|
+
(_a = actionsRef.current) == null ? void 0 : _a.setOpen(true, createChangeEventDetails(triggerPress, event));
|
|
100
|
+
allowMouseUpTimeout.start(LONG_PRESS_DELAY, () => {
|
|
101
|
+
allowMouseUpRef.current = true;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function handleContextMenu(event) {
|
|
105
|
+
var _a;
|
|
106
|
+
if (disabled) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
allowMouseUpTriggerRef.current = true;
|
|
110
|
+
stopEvent(event);
|
|
111
|
+
handleLongPress(event.clientX, event.clientY, event.nativeEvent);
|
|
112
|
+
const doc = ownerDocument(triggerRef.current);
|
|
113
|
+
(_a = mouseUpAbortControllerRef.current) == null ? void 0 : _a.abort();
|
|
114
|
+
const mouseUpAbortController = new AbortController();
|
|
115
|
+
mouseUpAbortControllerRef.current = mouseUpAbortController;
|
|
116
|
+
doc.addEventListener("mouseup", (mouseEvent) => {
|
|
117
|
+
var _a2;
|
|
118
|
+
allowMouseUpTriggerRef.current = false;
|
|
119
|
+
if (!allowMouseUpRef.current) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
allowMouseUpTimeout.clear();
|
|
123
|
+
allowMouseUpRef.current = false;
|
|
124
|
+
const mouseUpTarget = getTarget(mouseEvent);
|
|
125
|
+
if (contains(positionerRef.current, mouseUpTarget)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (rootId && mouseUpTarget && findRootOwnerId(mouseUpTarget) === rootId) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
(_a2 = actionsRef.current) == null ? void 0 : _a2.setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
|
132
|
+
}, {
|
|
133
|
+
once: true,
|
|
134
|
+
signal: mouseUpAbortController.signal
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function cancelLongPress() {
|
|
138
|
+
longPressTimeout.clear();
|
|
139
|
+
touchPositionRef.current = null;
|
|
140
|
+
}
|
|
141
|
+
function handleTouchStart(event) {
|
|
142
|
+
if (disabled) {
|
|
143
|
+
cancelLongPress();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
allowMouseUpTriggerRef.current = false;
|
|
147
|
+
if (event.touches.length !== 1) {
|
|
148
|
+
cancelLongPress();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
event.stopPropagation();
|
|
152
|
+
const touch = event.touches[0];
|
|
153
|
+
const touchPosition = {
|
|
154
|
+
x: touch.clientX,
|
|
155
|
+
y: touch.clientY
|
|
156
|
+
};
|
|
157
|
+
touchPositionRef.current = touchPosition;
|
|
158
|
+
longPressTimeout.start(LONG_PRESS_DELAY, () => {
|
|
159
|
+
handleLongPress(touchPosition.x, touchPosition.y, event.nativeEvent);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function handleTouchMove(event) {
|
|
163
|
+
if (event.touches.length !== 1) {
|
|
164
|
+
cancelLongPress();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (longPressTimeout.isStarted() && touchPositionRef.current) {
|
|
168
|
+
const touch = event.touches[0];
|
|
169
|
+
const moveThreshold = 10;
|
|
170
|
+
const deltaX = Math.abs(touch.clientX - touchPositionRef.current.x);
|
|
171
|
+
const deltaY = Math.abs(touch.clientY - touchPositionRef.current.y);
|
|
172
|
+
if (deltaX > moveThreshold || deltaY > moveThreshold) {
|
|
173
|
+
cancelLongPress();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
React.useEffect(() => () => {
|
|
178
|
+
var _a;
|
|
179
|
+
(_a = mouseUpAbortControllerRef.current) == null ? void 0 : _a.abort();
|
|
180
|
+
}, []);
|
|
181
|
+
React.useEffect(() => {
|
|
182
|
+
function handleDocumentContextMenu(event) {
|
|
183
|
+
if (disabled) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const target = getTarget(event);
|
|
187
|
+
const targetElement = target;
|
|
188
|
+
if (contains(triggerRef.current, targetElement) || contains(internalBackdropRef.current, targetElement) || contains(backdropRef.current, targetElement)) {
|
|
189
|
+
event.preventDefault();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const doc = ownerDocument(triggerRef.current);
|
|
193
|
+
return addEventListener(doc, "contextmenu", handleDocumentContextMenu);
|
|
194
|
+
}, [backdropRef, disabled, internalBackdropRef]);
|
|
195
|
+
const state = {
|
|
196
|
+
open
|
|
197
|
+
};
|
|
198
|
+
const element = useRenderElement("div", componentProps, {
|
|
199
|
+
state,
|
|
200
|
+
ref: [triggerRef, forwardedRef],
|
|
201
|
+
props: [{
|
|
202
|
+
onContextMenu: handleContextMenu,
|
|
203
|
+
onTouchStart: handleTouchStart,
|
|
204
|
+
onTouchMove: handleTouchMove,
|
|
205
|
+
onTouchEnd: cancelLongPress,
|
|
206
|
+
onTouchCancel: cancelLongPress,
|
|
207
|
+
style: {
|
|
208
|
+
WebkitTouchCallout: "none"
|
|
209
|
+
}
|
|
210
|
+
}, elementProps],
|
|
211
|
+
stateAttributesMapping: pressableTriggerOpenStateMapping
|
|
212
|
+
});
|
|
213
|
+
return element;
|
|
214
|
+
});
|
|
215
|
+
if (process.env.NODE_ENV !== "production") ContextMenuTrigger$1.displayName = "ContextMenuTrigger";
|
|
216
|
+
const ContextMenuPositioner = MenuPositioner;
|
|
217
|
+
const placementPosition = {
|
|
218
|
+
"bottom-right": { side: "bottom", align: "start" },
|
|
219
|
+
"bottom-left": { side: "bottom", align: "end" },
|
|
220
|
+
"top-right": { side: "top", align: "start" },
|
|
221
|
+
"top-left": { side: "top", align: "end" }
|
|
222
|
+
};
|
|
223
|
+
const ContextMenu = ContextMenuRoot;
|
|
224
|
+
function ContextMenuTrigger2(props) {
|
|
225
|
+
return /* @__PURE__ */ jsx(ContextMenuTrigger$1, { "data-slot": "context-menu-trigger", ...props });
|
|
226
|
+
}
|
|
227
|
+
function ContextMenuContent({
|
|
228
|
+
className,
|
|
229
|
+
container,
|
|
230
|
+
placement = "bottom-right",
|
|
231
|
+
positionerClassName,
|
|
232
|
+
...props
|
|
233
|
+
}) {
|
|
234
|
+
const { side, align } = placementPosition[placement];
|
|
235
|
+
return /* @__PURE__ */ jsx(MenuPortal, { container, children: /* @__PURE__ */ jsx(
|
|
236
|
+
ContextMenuPositioner,
|
|
237
|
+
{
|
|
238
|
+
"data-slot": "context-menu-positioner",
|
|
239
|
+
side,
|
|
240
|
+
align,
|
|
241
|
+
sideOffset: 0,
|
|
242
|
+
className: classNames("isolate z-[1600] outline-none", positionerClassName),
|
|
243
|
+
children: /* @__PURE__ */ jsx(
|
|
244
|
+
MenuPopup,
|
|
245
|
+
{
|
|
246
|
+
"data-slot": "context-menu-content",
|
|
247
|
+
className: classNames(dropdownPanelVariants({ width: "default" }), className),
|
|
248
|
+
...props
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
) });
|
|
253
|
+
}
|
|
254
|
+
export {
|
|
255
|
+
ContextMenu,
|
|
256
|
+
ContextMenuContent,
|
|
257
|
+
ContextMenuTrigger2 as ContextMenuTrigger
|
|
258
|
+
};
|
|
259
|
+
//# sourceMappingURL=ContextMenu.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.es.js","sources":["../../../node_modules/@base-ui/react/context-menu/root/ContextMenuRoot.mjs","../../../node_modules/@base-ui/react/context-menu/trigger/ContextMenuTrigger.mjs","../../../node_modules/@base-ui/react/context-menu/positioner/ContextMenuPositioner.mjs","../../../src/components/atoms/ContextMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { ContextMenuRootContext } from \"./ContextMenuRootContext.mjs\";\nimport { Menu } from \"../../menu/index.mjs\";\nimport { MenuRootContext } from \"../../menu/root/MenuRootContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A component that creates a context menu activated by right clicking or long pressing.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)\n */\nexport function ContextMenuRoot(props) {\n const [anchor, setAnchor] = React.useState({\n getBoundingClientRect() {\n return DOMRect.fromRect({\n width: 0,\n height: 0,\n x: 0,\n y: 0\n });\n }\n });\n const backdropRef = React.useRef(null);\n const internalBackdropRef = React.useRef(null);\n const actionsRef = React.useRef(null);\n const positionerRef = React.useRef(null);\n const allowMouseUpTriggerRef = React.useRef(true);\n const initialCursorPointRef = React.useRef(null);\n const id = useId();\n const contextValue = React.useMemo(() => ({\n anchor,\n setAnchor,\n actionsRef,\n backdropRef,\n internalBackdropRef,\n positionerRef,\n allowMouseUpTriggerRef,\n initialCursorPointRef,\n rootId: id\n }), [anchor, id]);\n return /*#__PURE__*/_jsx(ContextMenuRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(MenuRootContext.Provider, {\n value: undefined,\n children: /*#__PURE__*/_jsx(Menu.Root, {\n ...props\n })\n })\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { contains, getTarget, stopEvent } from \"../../floating-ui-react/utils.mjs\";\nimport { useContextMenuRootContext } from \"../root/ContextMenuRootContext.mjs\";\nimport { useMenuRootContext } from \"../../menu/root/MenuRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { findRootOwnerId } from \"../../menu/utils/findRootOwnerId.mjs\";\nconst LONG_PRESS_DELAY = 500;\n\n/**\n * An area that opens the menu on right click or long press.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)\n */\nexport const ContextMenuTrigger = /*#__PURE__*/React.forwardRef(function ContextMenuTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n setAnchor,\n actionsRef,\n internalBackdropRef,\n backdropRef,\n positionerRef,\n allowMouseUpTriggerRef,\n initialCursorPointRef,\n rootId\n } = useContextMenuRootContext(false);\n const {\n store\n } = useMenuRootContext(false);\n const open = store.useState('open');\n const disabled = store.useState('disabled');\n const triggerRef = React.useRef(null);\n const touchPositionRef = React.useRef(null);\n const longPressTimeout = useTimeout();\n const allowMouseUpTimeout = useTimeout();\n const allowMouseUpRef = React.useRef(false);\n const mouseUpAbortControllerRef = React.useRef(null);\n function handleLongPress(x, y, event) {\n const isTouchEvent = event.type.startsWith('touch');\n initialCursorPointRef.current = {\n x,\n y\n };\n setAnchor({\n getBoundingClientRect() {\n return DOMRect.fromRect({\n width: isTouchEvent ? 10 : 0,\n height: isTouchEvent ? 10 : 0,\n x,\n y\n });\n }\n });\n allowMouseUpRef.current = false;\n actionsRef.current?.setOpen(true, createChangeEventDetails(REASONS.triggerPress, event));\n allowMouseUpTimeout.start(LONG_PRESS_DELAY, () => {\n allowMouseUpRef.current = true;\n });\n }\n function handleContextMenu(event) {\n if (disabled) {\n return;\n }\n allowMouseUpTriggerRef.current = true;\n stopEvent(event);\n handleLongPress(event.clientX, event.clientY, event.nativeEvent);\n const doc = ownerDocument(triggerRef.current);\n\n // Abort a listener from a previous trigger that never saw its mouseup, and scope this\n // one to a fresh controller so it's removed on unmount if the mouseup never arrives.\n mouseUpAbortControllerRef.current?.abort();\n const mouseUpAbortController = new AbortController();\n mouseUpAbortControllerRef.current = mouseUpAbortController;\n doc.addEventListener('mouseup', mouseEvent => {\n allowMouseUpTriggerRef.current = false;\n if (!allowMouseUpRef.current) {\n return;\n }\n allowMouseUpTimeout.clear();\n allowMouseUpRef.current = false;\n const mouseUpTarget = getTarget(mouseEvent);\n if (contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n if (rootId && mouseUpTarget && findRootOwnerId(mouseUpTarget) === rootId) {\n return;\n }\n actionsRef.current?.setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }, {\n once: true,\n signal: mouseUpAbortController.signal\n });\n }\n function cancelLongPress() {\n longPressTimeout.clear();\n touchPositionRef.current = null;\n }\n function handleTouchStart(event) {\n if (disabled) {\n cancelLongPress();\n return;\n }\n allowMouseUpTriggerRef.current = false;\n if (event.touches.length !== 1) {\n cancelLongPress();\n return;\n }\n event.stopPropagation();\n const touch = event.touches[0];\n const touchPosition = {\n x: touch.clientX,\n y: touch.clientY\n };\n touchPositionRef.current = touchPosition;\n longPressTimeout.start(LONG_PRESS_DELAY, () => {\n handleLongPress(touchPosition.x, touchPosition.y, event.nativeEvent);\n });\n }\n function handleTouchMove(event) {\n if (event.touches.length !== 1) {\n cancelLongPress();\n return;\n }\n if (longPressTimeout.isStarted() && touchPositionRef.current) {\n const touch = event.touches[0];\n const moveThreshold = 10;\n const deltaX = Math.abs(touch.clientX - touchPositionRef.current.x);\n const deltaY = Math.abs(touch.clientY - touchPositionRef.current.y);\n if (deltaX > moveThreshold || deltaY > moveThreshold) {\n cancelLongPress();\n }\n }\n }\n React.useEffect(() => () => {\n // Abort a pending mouseup listener if the trigger unmounts before it fires.\n mouseUpAbortControllerRef.current?.abort();\n }, []);\n React.useEffect(() => {\n function handleDocumentContextMenu(event) {\n if (disabled) {\n return;\n }\n const target = getTarget(event);\n const targetElement = target;\n if (contains(triggerRef.current, targetElement) || contains(internalBackdropRef.current, targetElement) || contains(backdropRef.current, targetElement)) {\n event.preventDefault();\n }\n }\n const doc = ownerDocument(triggerRef.current);\n return addEventListener(doc, 'contextmenu', handleDocumentContextMenu);\n }, [backdropRef, disabled, internalBackdropRef]);\n const state = {\n open\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [triggerRef, forwardedRef],\n props: [{\n onContextMenu: handleContextMenu,\n onTouchStart: handleTouchStart,\n onTouchMove: handleTouchMove,\n onTouchEnd: cancelLongPress,\n onTouchCancel: cancelLongPress,\n style: {\n WebkitTouchCallout: 'none'\n }\n }, elementProps],\n stateAttributesMapping: pressableTriggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ContextMenuTrigger.displayName = \"ContextMenuTrigger\";","'use client';\n\nimport { MenuPositioner } from \"../../menu/positioner/MenuPositioner.mjs\";\n/**\n * Positions the context menu popup against the pointer or a custom anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)\n */\nexport const ContextMenuPositioner = MenuPositioner;","import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu'\n\nimport { dropdownPanelVariants } from '@/components/atoms/DropdownMenu'\nimport { cn } from '@/lib/utils'\n\ntype ContextMenuPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n\ntype PointerPosition = {\n side: NonNullable<ContextMenuPrimitive.Positioner.Props['side']>\n align: NonNullable<ContextMenuPrimitive.Positioner.Props['align']>\n}\n\n// Placement names the corner of the panel that sits on the pointer; Base UI flips it near screen edges.\nconst placementPosition: Record<ContextMenuPlacement, PointerPosition> = {\n 'bottom-right': { side: 'bottom', align: 'start' },\n 'bottom-left': { side: 'bottom', align: 'end' },\n 'top-right': { side: 'top', align: 'start' },\n 'top-left': { side: 'top', align: 'end' },\n}\n\nconst ContextMenu = ContextMenuPrimitive.Root\n\nfunction ContextMenuTrigger(props: ContextMenuPrimitive.Trigger.Props) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />\n}\n\ntype ContextMenuContentProps = ContextMenuPrimitive.Popup.Props & {\n container?: ContextMenuPrimitive.Portal.Props['container']\n placement?: ContextMenuPlacement\n positionerClassName?: string\n}\n\nfunction ContextMenuContent({\n className,\n container,\n placement = 'bottom-right',\n positionerClassName,\n ...props\n}: ContextMenuContentProps) {\n const { side, align } = placementPosition[placement]\n return (\n <ContextMenuPrimitive.Portal container={container}>\n <ContextMenuPrimitive.Positioner\n data-slot=\"context-menu-positioner\"\n side={side}\n align={align}\n sideOffset={0}\n className={cn('isolate z-[1600] outline-none', positionerClassName)}\n >\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-content\"\n className={cn(dropdownPanelVariants({ width: 'default' }), className)}\n {...props}\n />\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n )\n}\n\nexport { ContextMenu, ContextMenuContent, ContextMenuTrigger }\nexport type { ContextMenuContentProps, ContextMenuPlacement }\n"],"names":["_jsx","Menu.Root","ContextMenuTrigger","REASONS.triggerPress","_a","REASONS.cancelOpen","ContextMenuPrimitive.Root","ContextMenuPrimitive.Trigger","ContextMenuPrimitive.Portal","ContextMenuPrimitive.Positioner","cn","ContextMenuPrimitive.Popup"],"mappings":";;;;;;;;;;;;AAcO,SAAS,gBAAgB,OAAO;AACrC,QAAM,CAAC,QAAQ,SAAS,IAAI,MAAM,SAAS;AAAA,IACzC,wBAAwB;AACtB,aAAO,QAAQ,SAAS;AAAA,QACtB,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,GAAG;AAAA,QACH,GAAG;AAAA,MACX,CAAO;AAAA,IACH;AAAA,EACJ,CAAG;AACD,QAAM,cAAc,MAAM,OAAO,IAAI;AACrC,QAAM,sBAAsB,MAAM,OAAO,IAAI;AAC7C,QAAM,aAAa,MAAM,OAAO,IAAI;AACpC,QAAM,gBAAgB,MAAM,OAAO,IAAI;AACvC,QAAM,yBAAyB,MAAM,OAAO,IAAI;AAChD,QAAM,wBAAwB,MAAM,OAAO,IAAI;AAC/C,QAAM,KAAK,MAAK;AAChB,QAAM,eAAe,MAAM,QAAQ,OAAO;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACZ,IAAM,CAAC,QAAQ,EAAE,CAAC;AAChB,SAAoBA,oBAAK,uBAAuB,UAAU;AAAA,IACxD,OAAO;AAAA,IACP,UAAuBA,oBAAK,gBAAgB,UAAU;AAAA,MACpD,OAAO;AAAA,MACP,UAAuBA,oBAAKC,UAAW;AAAA,QACrC,GAAG;AAAA,MACX,CAAO;AAAA,IACP,CAAK;AAAA,EACL,CAAG;AACH;ACtCA,MAAM,mBAAmB;AAQlB,MAAMC,uBAAkC,sBAAM,WAAW,SAAS,mBAAmB,gBAAgB,cAAc;AACxH,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EAAE,MAAM,UAAU,OAAO,QAAA;AAAA,EACzC,eAAe,EAAE,MAAM,UAAU,OAAO,MAAA;AAAA,EACxC,aAAa,EAAE,MAAM,OAAO,OAAO,QAAA;AAAA,EACnC,YAAY,EAAE,MAAM,OAAO,OAAO,MAAA;AACpC;AAEA,MAAM,cAAcI;AAEpB,SAASJ,oBAAmB,OAA2C;AACrE,6BAAQK,sBAAA,EAA6B,aAAU,wBAAwB,GAAG,OAAO;AACnF;AAQA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,EAAE,MAAM,UAAU,kBAAkB,SAAS;AACnD,SACE,oBAACC,YAAA,EAA4B,WAC3B,UAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,WAAWC,WAAG,iCAAiC,mBAAmB;AAAA,MAElE,UAAA;AAAA,QAACC;AAAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,WAAWD,WAAG,sBAAsB,EAAE,OAAO,UAAA,CAAW,GAAG,SAAS;AAAA,UACnE,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA,GAEJ;AAEJ;","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
4
|
+
declare const dropdownPanelVariants: (props?: ({
|
|
5
|
+
motion?: "select" | "menu" | null | undefined;
|
|
6
|
+
width?: "default" | "sm" | "lg" | "trigger" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const dropdownItemVariants: (props?: ({
|
|
9
|
+
tone?: "default" | "destructive" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare const dropdownLabelVariants: (props?: ({
|
|
12
|
+
caps?: boolean | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare const dropdownSeparatorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
15
|
+
declare const dropdownListVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
16
|
+
declare const DropdownMenu: typeof MenuPrimitive.Root;
|
|
17
|
+
declare function DropdownMenuTrigger(props: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
18
|
+
type DropdownMenuContentProps = MenuPrimitive.Popup.Props & VariantProps<typeof dropdownPanelVariants> & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'anchor' | 'collisionAvoidance' | 'side' | 'sideOffset'> & {
|
|
19
|
+
container?: MenuPrimitive.Portal.Props['container'];
|
|
20
|
+
positionerClassName?: string;
|
|
21
|
+
keepMounted?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare function DropdownMenuContent({ align, alignOffset, anchor, className, collisionAvoidance, container, keepMounted, motion, positionerClassName, side, sideOffset, width, ...props }: DropdownMenuContentProps): React.JSX.Element;
|
|
24
|
+
type DropdownMenuItemProps = MenuPrimitive.Item.Props & VariantProps<typeof dropdownItemVariants>;
|
|
25
|
+
declare function DropdownMenuItem({ className, tone, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
26
|
+
type DropdownMenuItemTextProps = React.ComponentProps<'span'> & {
|
|
27
|
+
description?: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
declare function DropdownMenuItemText({ children, className, description, ...props }: DropdownMenuItemTextProps): React.JSX.Element;
|
|
30
|
+
type DropdownMenuShortcutProps = React.ComponentProps<'span'> & {
|
|
31
|
+
keys: string[];
|
|
32
|
+
};
|
|
33
|
+
declare function DropdownMenuShortcut({ className, keys, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
|
|
34
|
+
type DropdownMenuCheckboxItemProps = MenuPrimitive.CheckboxItem.Props;
|
|
35
|
+
declare function DropdownMenuCheckboxItem({ children, className, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
36
|
+
declare function DropdownMenuRadioGroup(props: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
37
|
+
type DropdownMenuRadioItemProps = MenuPrimitive.RadioItem.Props;
|
|
38
|
+
declare function DropdownMenuRadioItem({ children, className, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
|
|
39
|
+
type DropdownMenuListProps = React.ComponentProps<'div'>;
|
|
40
|
+
declare function DropdownMenuList({ className, ...props }: DropdownMenuListProps): React.JSX.Element;
|
|
41
|
+
declare function DropdownMenuGroup({ className, ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
42
|
+
type DropdownMenuLabelProps = MenuPrimitive.GroupLabel.Props & VariantProps<typeof dropdownLabelVariants>;
|
|
43
|
+
declare function DropdownMenuLabel({ caps, className, ...props }: DropdownMenuLabelProps): React.JSX.Element;
|
|
44
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
45
|
+
declare function DropdownMenuHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
46
|
+
declare function DropdownMenuFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
47
|
+
declare const DropdownMenuSub: typeof MenuPrimitive.SubmenuRoot;
|
|
48
|
+
type DropdownMenuSubTriggerProps = MenuPrimitive.SubmenuTrigger.Props;
|
|
49
|
+
declare function DropdownMenuSubTrigger({ children, className, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
|
|
50
|
+
export { dropdownItemVariants, dropdownLabelVariants, dropdownListVariants, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuList, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownPanelVariants, dropdownSeparatorVariants, };
|
|
51
|
+
export type { DropdownMenuCheckboxItemProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuItemTextProps, DropdownMenuLabelProps, DropdownMenuListProps, DropdownMenuRadioItemProps, DropdownMenuShortcutProps, DropdownMenuSubTriggerProps, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../index-DSVg79g-.js";
|
|
4
|
+
import "./IconProvider.es.js";
|
|
5
|
+
import "../../classNames-B1XpQHle.js";
|
|
6
|
+
import { D, c, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, d, a, b, t, u } from "../../DropdownMenu-Crlf-J4E.js";
|
|
7
|
+
export {
|
|
8
|
+
D as DropdownMenu,
|
|
9
|
+
c as DropdownMenuCheckboxItem,
|
|
10
|
+
e as DropdownMenuContent,
|
|
11
|
+
f as DropdownMenuFooter,
|
|
12
|
+
g as DropdownMenuGroup,
|
|
13
|
+
h as DropdownMenuHeader,
|
|
14
|
+
i as DropdownMenuItem,
|
|
15
|
+
j as DropdownMenuItemText,
|
|
16
|
+
k as DropdownMenuLabel,
|
|
17
|
+
l as DropdownMenuList,
|
|
18
|
+
m as DropdownMenuRadioGroup,
|
|
19
|
+
n as DropdownMenuRadioItem,
|
|
20
|
+
o as DropdownMenuSeparator,
|
|
21
|
+
p as DropdownMenuShortcut,
|
|
22
|
+
q as DropdownMenuSub,
|
|
23
|
+
r as DropdownMenuSubTrigger,
|
|
24
|
+
s as DropdownMenuTrigger,
|
|
25
|
+
d as dropdownItemVariants,
|
|
26
|
+
a as dropdownLabelVariants,
|
|
27
|
+
b as dropdownListVariants,
|
|
28
|
+
t as dropdownPanelVariants,
|
|
29
|
+
u as dropdownSeparatorVariants
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=DropdownMenu.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenu.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { type IconProp } from './IconProvider';
|
|
4
4
|
declare const iconButtonVariants: (props?: ({
|
|
5
|
-
variant?: "ghost" | "primary" | "
|
|
5
|
+
variant?: "ghost" | "primary" | "destructive" | "secondary" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | "md" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type IconButtonVariant = NonNullable<VariantProps<typeof iconButtonVariants>['variant']>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-DSVg79g-.js";
|
|
3
|
-
import { C as ControlButton } from "../../Button-
|
|
3
|
+
import { C as ControlButton } from "../../Button-HHEfL8b9.js";
|
|
4
4
|
import IconProvider, { iconFrame } from "./IconProvider.es.js";
|
|
5
|
-
import {
|
|
5
|
+
import { LightTooltip, DarkTooltip, tooltipTrigger } from "./Tooltip.es.js";
|
|
6
6
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
7
7
|
const iconButtonVariants = cva("", {
|
|
8
8
|
variants: {
|
|
@@ -30,7 +30,7 @@ const controlSizeMap = {
|
|
|
30
30
|
};
|
|
31
31
|
const iconFrameKey = {
|
|
32
32
|
default: "16",
|
|
33
|
-
md: "
|
|
33
|
+
md: "16",
|
|
34
34
|
sm: "12"
|
|
35
35
|
};
|
|
36
36
|
function IconButton({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.es.js","sources":["../../../src/components/atoms/IconButton.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame, type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip, tooltipTrigger } from './Tooltip'\n\nconst iconButtonVariants = cva('', {\n variants: {\n variant: {\n primary:\n 'text-button-primary-icon data-[selected=true]:text-button-primary-icon-selected [&_[data-slot=button-icon]]:text-button-primary-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-primary-icon-selected',\n secondary:\n 'text-button-secondary-icon not-disabled:not-aria-disabled:hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-secondary-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-secondary-icon-selected',\n ghost:\n 'text-button-ghost-icon data-[selected=true]:text-button-ghost-icon-selected [&_[data-slot=button-icon]]:text-button-ghost-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-ghost-icon-selected',\n destructive:\n 'text-button-destructive-icon not-disabled:not-aria-disabled:hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover',\n },\n size: {\n default: '',\n md: '',\n sm: '',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'default',\n },\n})\n\nexport type IconButtonVariant = NonNullable<VariantProps<typeof iconButtonVariants>['variant']>\nexport type IconButtonSize = NonNullable<VariantProps<typeof iconButtonVariants>['size']>\n\nconst controlSizeMap = {\n default: 'icon',\n md: 'icon-md',\n sm: 'icon-sm',\n} as const satisfies Record<IconButtonSize, NonNullable<ControlButtonProps['size']>>\n\nconst iconFrameKey = {\n default: '16',\n md: '
|
|
1
|
+
{"version":3,"file":"IconButton.es.js","sources":["../../../src/components/atoms/IconButton.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider, { iconFrame, type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip, tooltipTrigger } from './Tooltip'\n\nconst iconButtonVariants = cva('', {\n variants: {\n variant: {\n primary:\n 'text-button-primary-icon data-[selected=true]:text-button-primary-icon-selected [&_[data-slot=button-icon]]:text-button-primary-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-primary-icon-selected',\n secondary:\n 'text-button-secondary-icon not-disabled:not-aria-disabled:hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-secondary-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-secondary-icon-selected',\n ghost:\n 'text-button-ghost-icon data-[selected=true]:text-button-ghost-icon-selected [&_[data-slot=button-icon]]:text-button-ghost-icon data-[selected=true]:[&_[data-slot=button-icon]]:text-button-ghost-icon-selected',\n destructive:\n 'text-button-destructive-icon not-disabled:not-aria-disabled:hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon not-disabled:not-aria-disabled:hover:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover',\n },\n size: {\n default: '',\n md: '',\n sm: '',\n },\n },\n defaultVariants: {\n variant: 'ghost',\n size: 'default',\n },\n})\n\nexport type IconButtonVariant = NonNullable<VariantProps<typeof iconButtonVariants>['variant']>\nexport type IconButtonSize = NonNullable<VariantProps<typeof iconButtonVariants>['size']>\n\nconst controlSizeMap = {\n default: 'icon',\n md: 'icon-md',\n sm: 'icon-sm',\n} as const satisfies Record<IconButtonSize, NonNullable<ControlButtonProps['size']>>\n\n// Box / glyph per Figma: default 32/16, md 24/16, sm 16/12; md shrinks the box, not the glyph.\nconst iconFrameKey = {\n default: '16',\n md: '16',\n sm: '12',\n} as const satisfies Record<IconButtonSize, keyof typeof iconFrame>\n\ntype IconButtonCommonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick' | 'size'> & {\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n iconSize?: number\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n size?: IconButtonSize\n selected?: boolean\n loading?: boolean\n}\n\nexport type IconButtonProps = IconButtonCommonProps &\n (\n | {\n variant: 'destructive'\n icon?: IconProp\n }\n | {\n variant?: Exclude<IconButtonVariant, 'destructive'>\n icon: IconProp\n }\n )\n\nfunction IconButton({\n ref,\n icon,\n iconSize,\n onClick,\n disabled = false,\n tooltip,\n disabledTooltip,\n variant = 'ghost',\n size = 'default',\n selected = false,\n loading = false,\n className,\n type = 'button',\n 'aria-label': ariaLabel,\n ...props\n}: IconButtonProps) {\n const resolvedVariant = variant ?? 'ghost'\n const resolvedSize = size ?? 'default'\n const resolvedIcon = icon ?? (resolvedVariant === 'destructive' ? 'trash' : undefined)\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const accessibleName = ariaLabel ?? (typeof tooltip === 'string' ? tooltip : undefined)\n\n const button = (\n <ControlButton\n ref={ref}\n type=\"icon\"\n htmlType={type}\n variant={resolvedVariant}\n size={controlSizeMap[resolvedSize]}\n disabled={disabled}\n selected={selected}\n loading={loading}\n onClick={onClick}\n aria-label={accessibleName}\n className={cn(iconButtonVariants({ variant: resolvedVariant, size: resolvedSize }), className)}\n {...props}\n >\n {!loading && resolvedIcon ? (\n <span\n data-slot=\"button-icon\"\n data-icon={String(resolvedIcon)}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center',\n iconFrame[iconFrameKey[resolvedSize]].frameClass,\n )}\n >\n <IconProvider icon={resolvedIcon} size={iconSize ?? iconFrame[iconFrameKey[resolvedSize]].glyph} />\n </span>\n ) : null}\n </ControlButton>\n )\n\n if (!tooltipTitle) {\n return button\n }\n\n const TooltipWrap = disabled ? LightTooltip : DarkTooltip\n return <TooltipWrap title={tooltipTitle}>{tooltipTrigger(disabled, button)}</TooltipWrap>\n}\n\nexport default IconButton\n"],"names":["cn"],"mappings":";;;;;;AASA,MAAM,qBAAqB,IAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SACE;AAAA,MACF,WACE;AAAA,MACF,OACE;AAAA,MACF,aACE;AAAA,IAAA;AAAA,IAEJ,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV,CAAC;AAKD,MAAM,iBAAiB;AAAA,EACrB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AACN;AAwBA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA,OAAO;AAAA,EACP,cAAc;AAAA,EACd,GAAG;AACL,GAAoB;AAClB,QAAM,kBAAkB,WAAW;AACnC,QAAM,eAAe,QAAQ;AAC7B,QAAM,eAAe,SAAS,oBAAoB,gBAAgB,UAAU;AAC5E,QAAM,eAAe,WAAW,mBAAmB,UAAU;AAC7D,QAAM,iBAAiB,cAAc,OAAO,YAAY,WAAW,UAAU;AAE7E,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,MAAM,eAAe,YAAY;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACZ,WAAWA,WAAG,mBAAmB,EAAE,SAAS,iBAAiB,MAAM,cAAc,GAAG,SAAS;AAAA,MAC5F,GAAG;AAAA,MAEH,UAAA,CAAC,WAAW,eACX;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,aAAW,OAAO,YAAY;AAAA,UAC9B,WAAWA;AAAAA,YACT;AAAA,YACA,UAAU,aAAa,YAAY,CAAC,EAAE;AAAA,UAAA;AAAA,UAGxC,UAAA,oBAAC,cAAA,EAAa,MAAM,cAAc,MAAM,YAAY,UAAU,aAAa,YAAY,CAAC,EAAE,MAAA,CAAO;AAAA,QAAA;AAAA,MAAA,IAEjG;AAAA,IAAA;AAAA,EAAA;AAIR,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,WAAW,eAAe;AAC9C,6BAAQ,aAAA,EAAY,OAAO,cAAe,UAAA,eAAe,UAAU,MAAM,GAAE;AAC7E;"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import React__default, { forwardRef, useState, Suspense } from "react";
|
|
4
4
|
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
5
5
|
import { faCheckCircle as faCheckCircle$1, faClone, faFileLines } from "@fortawesome/free-regular-svg-icons";
|
|
6
|
-
import { faArrowLeft, faCheck, faCheckCircle, faChevronDown, faChevronLeft, faChevronRight, faCircleQuestion, faCircleXmark, faCompressAlt, faDownload, faEllipsisVertical, faPause, faPlay, faSpinner, faXmark, faCode, faCopy, faCube, faExpandAlt, faExternalLink, faRotateRight, faServer, faTerminal, faTriangleExclamation, faUpDown, faWrench, faGlobe, faIdBadge, faPen, faPlus, faUserSlash, faUsers } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { faArrowLeft, faCheck, faCheckCircle, faChevronDown, faChevronLeft, faChevronRight, faCircleQuestion, faCircleXmark, faCompressAlt, faDownload, faEllipsis, faEllipsisVertical, faPause, faPlay, faSpinner, faXmark, faCode, faCopy, faCube, faExpandAlt, faExternalLink, faRotateRight, faServer, faTerminal, faTriangleExclamation, faUpDown, faWrench, faGlobe, faIdBadge, faMagnifyingGlass, faPen, faPlus, faUserSlash, faUsers } from "@fortawesome/free-solid-svg-icons";
|
|
7
7
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
8
8
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
9
9
|
import { useTheme } from "../theme/useTheme.es.js";
|
|
@@ -24,6 +24,7 @@ library.add(
|
|
|
24
24
|
faCircleXmark,
|
|
25
25
|
faCompressAlt,
|
|
26
26
|
faDownload,
|
|
27
|
+
faEllipsis,
|
|
27
28
|
faEllipsisVertical,
|
|
28
29
|
faPause,
|
|
29
30
|
faPlay,
|
|
@@ -42,6 +43,7 @@ library.add(
|
|
|
42
43
|
faWrench,
|
|
43
44
|
faGlobe,
|
|
44
45
|
faIdBadge,
|
|
46
|
+
faMagnifyingGlass,
|
|
45
47
|
faPen,
|
|
46
48
|
faPlus,
|
|
47
49
|
faUserSlash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconProvider.es.js","sources":["../../../src/assets/icons/tfy/agents.svg?react","../../../src/assets/icons/tfy/guardrails.svg?react","../../../src/assets/icons/tfy/logo.svg","../../../src/assets/icons/tfy/mcp.svg?react","../../../src/assets/icons/tfy/model-gateway.svg?react","../../../src/assets/icons/trash.svg?react","../../../src/components/atoms/IconProvider.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAgents = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z\", stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M5 20a7 7 0 0 1 14 0\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 18.5, cy: 8.5, r: 2, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 5.5, cy: 8.5, r: 2, stroke: \"currentColor\", strokeWidth: 1.5 }));\nexport default SvgAgents;\n","import * as React from \"react\";\nconst SvgGuardrails = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 3 4 7v5c0 5 3.5 8.5 8 9 4.5-.5 8-4 8-9V7l-8-4Z\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M9 12.5 11 14.5 15.5 10\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgGuardrails;\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='15.5862'%20viewBox='0%200%2016%2015.5862'%20fill='none'%3e%3cg%20id='TFY%20mark'%3e%3cpath%20id='Face%201'%20d='M15.7931%202.06897L8%206.48276V11.0345L11.931%208.96552L12%2013.3793L16%2011.1724L15.7931%202.06897Z'%20fill='%231F009D'/%3e%3cpath%20id='Face%202'%20d='M0.137931%202.06897L0%2011.1724L8%2015.5862V11.0345L4%208.82759V4.27586L0.137931%202.06897Z'%20fill='%236DCAFF'/%3e%3cpath%20id='Face%203'%20d='M15.7931%202.06897L11.8621%200L4%204.27586L8%206.48276L15.7931%202.06897Z'%20fill='%235429FF'/%3e%3cpath%20id='Face%204'%20d='M4%204.27586V8.82759L8%2011.0345V6.48276L4%204.27586Z'%20fill='%232900CE'/%3e%3cpath%20id='Face%205'%20d='M11.931%208.96552L8%2011.0345V15.5862L12%2013.3793L11.931%208.96552Z'%20fill='%23B9E5FF'/%3e%3cpath%20id='Face%206'%20d='M0.137939%202.06897L4.00001%204.27586L7.58622%202.06897L4.00001%200.137931L0.137939%202.06897Z'%20fill='%2399DAFF'/%3e%3c/g%3e%3c/svg%3e\"","import * as React from \"react\";\nconst SvgMcp = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { x: 3, y: 3, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"rect\", { x: 14, y: 3, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"rect\", { x: 3, y: 14, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 17.5h7M17.5 14v7\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }));\nexport default SvgMcp;\n","import * as React from \"react\";\nconst SvgModelGateway = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 12h16M12 4v16\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 12, r: 3, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 4, cy: 12, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 20, cy: 12, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 4, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 20, r: 1.5, fill: \"currentColor\" }));\nexport default SvgModelGateway;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: \"1em\", height: \"1em\", viewBox: \"0 0 14 14\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M3.66634 1.66668V0.333344H10.333V1.66668H13.6663V3.00001H12.333V13C12.333 13.3682 12.0345 13.6667 11.6663 13.6667H2.33301C1.96482 13.6667 1.66634 13.3682 1.66634 13V3.00001H0.333008V1.66668H3.66634ZM2.99967 3.00001V12.3333H10.9997V3.00001H2.99967ZM4.99967 5.00001H6.33301V10.3333H4.99967V5.00001ZM7.66634 5.00001H8.99967V10.3333H7.66634V5.00001Z\", fill: \"currentColor\" }));\nexport default SvgTrash;\n","import React, { ForwardedRef, forwardRef, Suspense, useState } from 'react'\nimport { IconProp as FontAwesomeIconProp, library } from '@fortawesome/fontawesome-svg-core'\nimport {\n faCheckCircle as farCheckCircle,\n faClone as farClone,\n faFileLines as farFileLines,\n} from '@fortawesome/free-regular-svg-icons'\nimport {\n faArrowLeft,\n faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleQuestion,\n faCircleXmark,\n faCode,\n faCompressAlt,\n faCopy,\n faCube,\n faDownload,\n faEllipsisVertical,\n faExpandAlt,\n faExternalLink,\n faGlobe,\n faIdBadge,\n faPause,\n faPen,\n faPlay,\n faPlus,\n faRotateRight,\n faServer,\n faSpinner,\n faTerminal,\n faTriangleExclamation,\n faUpDown,\n faUsers,\n faUserSlash,\n faWrench,\n faXmark,\n} from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome'\n\nimport Agents from '@/assets/icons/tfy/agents.svg?react'\nimport Guardrails from '@/assets/icons/tfy/guardrails.svg?react'\nimport logo from '@/assets/icons/tfy/logo.svg'\nimport Mcp from '@/assets/icons/tfy/mcp.svg?react'\nimport ModelGateway from '@/assets/icons/tfy/model-gateway.svg?react'\nimport Trash from '@/assets/icons/trash.svg?react'\n\nimport classNames from '@/utils/classNames'\n\nimport useTheme from '../theme/useTheme'\n\n// Register FontAwesome icons used across agent-chat components\nlibrary.add(\n faArrowLeft,\n faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleQuestion,\n faCircleXmark,\n faCompressAlt,\n faDownload,\n faEllipsisVertical,\n faPause,\n faPlay,\n faSpinner,\n faXmark,\n faCode,\n faCopy,\n faCube,\n faExpandAlt,\n faExternalLink,\n faRotateRight,\n faServer,\n faTerminal,\n faTriangleExclamation,\n faUpDown,\n faWrench,\n faGlobe,\n faIdBadge,\n faPen,\n faPlus,\n faUserSlash,\n faUsers,\n farCheckCircle,\n farClone,\n farFileLines,\n)\n\ntype ImgIconMap = { [key: string]: string }\nconst IMG_ICONS_MAP: ImgIconMap = {}\nexport const registerImgIcons = (iconMap: ImgIconMap) => {\n Object.assign(IMG_ICONS_MAP, iconMap)\n}\n\ntype CustomIcon = React.ComponentType<CustomIconProps>\ntype CustomIconMap = {\n [key: string]: React.LazyExoticComponent<CustomIcon> | CustomIcon\n}\nconst CUSTOM_ICONS_MAP: CustomIconMap = {}\nexport const registerIcons = (iconMap: CustomIconMap) => {\n Object.assign(CUSTOM_ICONS_MAP, iconMap)\n}\n\nconst FA_ICON_ALIAS_MAP: { readonly [key: string]: string | FontAwesomeIconProp } = {\n github: 'fa-brands fa-github',\n gitlab: 'fa-brands fa-gitlab',\n bitbucket: 'fa-brands fa-bitbucket',\n jenkins: 'fa-brands fa-jenkins',\n 'angles-up-down': 'up-down',\n clone: ['far', 'clone'],\n 'file-lines': ['far', 'file-lines'],\n brain: 'brain',\n times: 'xmark',\n close: 'xmark',\n x: 'xmark',\n 'chevron-down': 'chevron-down',\n download: 'download',\n play: 'play',\n pause: 'pause',\n spinner: 'spinner',\n 'fa-warning': 'triangle-exclamation',\n 'compress-alt': 'down-left-and-up-right-to-center',\n}\n\nregisterIcons({\n agents: Agents,\n mcp: Mcp,\n 'model-gateway': ModelGateway,\n guardrails: Guardrails,\n trash: Trash,\n})\n\nregisterImgIcons({\n logo,\n})\n\nexport type IconProp = string | FontAwesomeIconProp\n\n/** Container frame and the glyph drawn inside it: 12→10, 16→14, 24→20. */\nexport const iconFrame = {\n '12': { frameClass: 'size-3', glyph: 0.625 },\n '16': { frameClass: 'size-4', glyph: 0.875 },\n '24': { frameClass: 'size-6', glyph: 1.25 },\n} as const\n\nexport type IconSize = keyof typeof iconFrame\n\ninterface IconProps {\n icon: IconProp\n color?: string\n className?: string\n onClick?: (e: React.MouseEvent) => void\n size?: number | IconSize\n width?: number\n forwardedRef?: React.Ref<HTMLElement>\n nativeProps?: Partial<FontAwesomeIconProps>\n}\n\ntype CustomIconProps = {\n onClick?: (e: React.MouseEvent) => void\n className?: string\n style?: React.CSSProperties\n 'aria-hidden'?: boolean\n}\ntype DynamicIconProps = CustomIconProps & {\n name: string\n}\n\nconst DynamicIcon = ({ name, ...props }: DynamicIconProps) => {\n const IconToRender = CUSTOM_ICONS_MAP[name]\n return (\n <Suspense fallback={<span />}>\n <IconToRender {...props} />\n </Suspense>\n )\n}\n\nfunction addDarkSuffix(url: string): string {\n const urlObj = new URL(url)\n const parts = urlObj.pathname.split('/')\n const filename = parts.pop()\n\n if (!filename) {\n return url + '-dark'\n }\n\n const dotIndex = filename.lastIndexOf('.')\n let newFilename: string\n\n if (dotIndex !== -1) {\n newFilename = filename.slice(0, dotIndex) + '-dark' + filename.slice(dotIndex)\n } else {\n newFilename = filename + '-dark'\n }\n\n parts.push(newFilename)\n urlObj.pathname = parts.join('/')\n return urlObj.toString()\n}\n\nconst IconProvider = ({\n icon,\n color,\n size = 0.75,\n width,\n className,\n onClick,\n forwardedRef,\n nativeProps = {},\n}: IconProps) => {\n const { isDark } = useTheme()\n const [failedSrc, setFailedSrc] = useState<string | null>(null)\n let themeAwareImgIcon: string | null = null\n let fallbackImgIcon: string | null = null\n\n if (typeof icon === 'string' && icon.startsWith('http')) {\n themeAwareImgIcon = isDark ? addDarkSuffix(icon) : icon\n fallbackImgIcon = icon\n } else if (typeof icon === 'string' && IMG_ICONS_MAP[icon as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon}-dark`] ?? IMG_ICONS_MAP[icon as string]\n : IMG_ICONS_MAP[icon as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon as string]\n } else if (Array.isArray(icon) && icon[1] && IMG_ICONS_MAP[icon[1] as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon[1]}-dark`] ?? IMG_ICONS_MAP[icon[1] as string]\n : IMG_ICONS_MAP[icon[1] as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon[1] as string]\n }\n\n const faIcon = FA_ICON_ALIAS_MAP[icon as string] || icon\n const frame = typeof size === 'string' && size in iconFrame ? iconFrame[size as IconSize] : undefined\n const sizeRem = frame ? frame.glyph : typeof size === 'number' ? size : 0.75\n\n const iconStyles = width ? { width: `${width}rem`, height: 'auto' } : { height: `${sizeRem}rem`, width: 'auto' }\n const imgSrc =\n failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon\n ? fallbackImgIcon\n : themeAwareImgIcon\n\n const glyph = themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={imgSrc ?? undefined}\n alt=\"\"\n aria-hidden\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n onError={() => {\n if (themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon) {\n setFailedSrc(themeAwareImgIcon)\n }\n }}\n />\n ) : CUSTOM_ICONS_MAP[icon as string] ? (\n <DynamicIcon\n onClick={onClick}\n style={{ ...iconStyles, color }}\n name={String(icon)}\n className={className}\n aria-hidden\n />\n ) : (\n <FontAwesomeIcon\n ref={forwardedRef as ForwardedRef<SVGSVGElement>}\n icon={faIcon as FontAwesomeIconProp}\n style={{ color, fontSize: `${width ?? sizeRem}rem` }}\n className={classNames('text-xs', className)}\n onClick={onClick}\n {...nativeProps}\n />\n )\n\n if (!frame) return glyph\n\n return (\n <span className={classNames('inline-flex shrink-0 items-center justify-center', frame.frameClass)}>{glyph}</span>\n )\n}\n\nexport default React.memo(\n forwardRef<HTMLElement, IconProps>((props, ref) => <IconProvider {...props} forwardedRef={ref} />),\n)\n"],"names":["farCheckCircle","farClone","farFileLines","Agents","Mcp","ModelGateway","Guardrails","Trash","React"],"mappings":";;;;;;;;;AACA,MAAM,YAAY,CAAC,UAA0B,sBAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,aAAa,MAAM,gBAAgB,OAAO,OAAO,QAAQ,OAAO,GAAG,MAAK,GAAoB,sBAAM,cAAc,QAAQ,EAAE,GAAG,sCAAsC,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,QAAQ,EAAE,GAAG,wBAAwB,QAAQ,gBAAgB,aAAa,KAAK,eAAe,QAAO,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,CAAC;ACA/rB,MAAM,gBAAgB,CAAC,UAA0B,sBAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,aAAa,MAAM,gBAAgB,OAAO,OAAO,QAAQ,OAAO,GAAG,MAAK,GAAoB,sBAAM,cAAc,QAAQ,EAAE,GAAG,sDA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AAAA,MACf,KAAI;AAAA,MACJ,eAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW,WAAW,SAAS;AAAA,MAC/B;AAAA,MACA,SAAS,MAAM;AACb,YAAI,qBAAqB,mBAAmB,oBAAoB,mBAAmB;AACjF,uBAAa,iBAAiB;AAAA,QAChC;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,IAEA,iBAAiB,IAAc,IACjC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,GAAG,YAAY,MAAA;AAAA,MACxB,MAAM,OAAO,IAAI;AAAA,MACjB;AAAA,MACA,eAAW;AAAA,IAAA;AAAA,EAAA,IAGb;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,OAAO,MAAA;AAAA,MAC7C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAIR,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,UAAK,WAAW,WAAW,oDAAoD,MAAM,UAAU,GAAI,UAAA,MAAA,CAAM;AAE9G;AAEA,MAAA,iBAAeC,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,KAAK,CAAE;AACnG;"}
|
|
1
|
+
{"version":3,"file":"IconProvider.es.js","sources":["../../../src/assets/icons/tfy/agents.svg?react","../../../src/assets/icons/tfy/guardrails.svg?react","../../../src/assets/icons/tfy/logo.svg","../../../src/assets/icons/tfy/mcp.svg?react","../../../src/assets/icons/tfy/model-gateway.svg?react","../../../src/assets/icons/trash.svg?react","../../../src/components/atoms/IconProvider.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAgents = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z\", stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M5 20a7 7 0 0 1 14 0\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 18.5, cy: 8.5, r: 2, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 5.5, cy: 8.5, r: 2, stroke: \"currentColor\", strokeWidth: 1.5 }));\nexport default SvgAgents;\n","import * as React from \"react\";\nconst SvgGuardrails = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 3 4 7v5c0 5 3.5 8.5 8 9 4.5-.5 8-4 8-9V7l-8-4Z\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M9 12.5 11 14.5 15.5 10\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgGuardrails;\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='15.5862'%20viewBox='0%200%2016%2015.5862'%20fill='none'%3e%3cg%20id='TFY%20mark'%3e%3cpath%20id='Face%201'%20d='M15.7931%202.06897L8%206.48276V11.0345L11.931%208.96552L12%2013.3793L16%2011.1724L15.7931%202.06897Z'%20fill='%231F009D'/%3e%3cpath%20id='Face%202'%20d='M0.137931%202.06897L0%2011.1724L8%2015.5862V11.0345L4%208.82759V4.27586L0.137931%202.06897Z'%20fill='%236DCAFF'/%3e%3cpath%20id='Face%203'%20d='M15.7931%202.06897L11.8621%200L4%204.27586L8%206.48276L15.7931%202.06897Z'%20fill='%235429FF'/%3e%3cpath%20id='Face%204'%20d='M4%204.27586V8.82759L8%2011.0345V6.48276L4%204.27586Z'%20fill='%232900CE'/%3e%3cpath%20id='Face%205'%20d='M11.931%208.96552L8%2011.0345V15.5862L12%2013.3793L11.931%208.96552Z'%20fill='%23B9E5FF'/%3e%3cpath%20id='Face%206'%20d='M0.137939%202.06897L4.00001%204.27586L7.58622%202.06897L4.00001%200.137931L0.137939%202.06897Z'%20fill='%2399DAFF'/%3e%3c/g%3e%3c/svg%3e\"","import * as React from \"react\";\nconst SvgMcp = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { x: 3, y: 3, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"rect\", { x: 14, y: 3, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"rect\", { x: 3, y: 14, width: 7, height: 7, rx: 1.5, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 17.5h7M17.5 14v7\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }));\nexport default SvgMcp;\n","import * as React from \"react\";\nconst SvgModelGateway = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"currentColor\", width: \"1em\", height: \"1em\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M4 12h16M12 4v16\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 12, r: 3, stroke: \"currentColor\", strokeWidth: 1.5 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 4, cy: 12, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 20, cy: 12, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 4, r: 1.5, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 12, cy: 20, r: 1.5, fill: \"currentColor\" }));\nexport default SvgModelGateway;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: \"1em\", height: \"1em\", viewBox: \"0 0 14 14\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M3.66634 1.66668V0.333344H10.333V1.66668H13.6663V3.00001H12.333V13C12.333 13.3682 12.0345 13.6667 11.6663 13.6667H2.33301C1.96482 13.6667 1.66634 13.3682 1.66634 13V3.00001H0.333008V1.66668H3.66634ZM2.99967 3.00001V12.3333H10.9997V3.00001H2.99967ZM4.99967 5.00001H6.33301V10.3333H4.99967V5.00001ZM7.66634 5.00001H8.99967V10.3333H7.66634V5.00001Z\", fill: \"currentColor\" }));\nexport default SvgTrash;\n","import React, { ForwardedRef, forwardRef, Suspense, useState } from 'react'\nimport { IconProp as FontAwesomeIconProp, library } from '@fortawesome/fontawesome-svg-core'\nimport {\n faCheckCircle as farCheckCircle,\n faClone as farClone,\n faFileLines as farFileLines,\n} from '@fortawesome/free-regular-svg-icons'\nimport {\n faArrowLeft,\n faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleQuestion,\n faCircleXmark,\n faCode,\n faCompressAlt,\n faCopy,\n faCube,\n faDownload,\n faEllipsis,\n faEllipsisVertical,\n faExpandAlt,\n faExternalLink,\n faGlobe,\n faIdBadge,\n faMagnifyingGlass,\n faPause,\n faPen,\n faPlay,\n faPlus,\n faRotateRight,\n faServer,\n faSpinner,\n faTerminal,\n faTriangleExclamation,\n faUpDown,\n faUsers,\n faUserSlash,\n faWrench,\n faXmark,\n} from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome'\n\nimport Agents from '@/assets/icons/tfy/agents.svg?react'\nimport Guardrails from '@/assets/icons/tfy/guardrails.svg?react'\nimport logo from '@/assets/icons/tfy/logo.svg'\nimport Mcp from '@/assets/icons/tfy/mcp.svg?react'\nimport ModelGateway from '@/assets/icons/tfy/model-gateway.svg?react'\nimport Trash from '@/assets/icons/trash.svg?react'\n\nimport classNames from '@/utils/classNames'\n\nimport useTheme from '../theme/useTheme'\n\n// Register FontAwesome icons used across agent-chat components\nlibrary.add(\n faArrowLeft,\n faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleQuestion,\n faCircleXmark,\n faCompressAlt,\n faDownload,\n faEllipsis,\n faEllipsisVertical,\n faPause,\n faPlay,\n faSpinner,\n faXmark,\n faCode,\n faCopy,\n faCube,\n faExpandAlt,\n faExternalLink,\n faRotateRight,\n faServer,\n faTerminal,\n faTriangleExclamation,\n faUpDown,\n faWrench,\n faGlobe,\n faIdBadge,\n faMagnifyingGlass,\n faPen,\n faPlus,\n faUserSlash,\n faUsers,\n farCheckCircle,\n farClone,\n farFileLines,\n)\n\ntype ImgIconMap = { [key: string]: string }\nconst IMG_ICONS_MAP: ImgIconMap = {}\nexport const registerImgIcons = (iconMap: ImgIconMap) => {\n Object.assign(IMG_ICONS_MAP, iconMap)\n}\n\ntype CustomIcon = React.ComponentType<CustomIconProps>\ntype CustomIconMap = {\n [key: string]: React.LazyExoticComponent<CustomIcon> | CustomIcon\n}\nconst CUSTOM_ICONS_MAP: CustomIconMap = {}\nexport const registerIcons = (iconMap: CustomIconMap) => {\n Object.assign(CUSTOM_ICONS_MAP, iconMap)\n}\n\nconst FA_ICON_ALIAS_MAP: { readonly [key: string]: string | FontAwesomeIconProp } = {\n github: 'fa-brands fa-github',\n gitlab: 'fa-brands fa-gitlab',\n bitbucket: 'fa-brands fa-bitbucket',\n jenkins: 'fa-brands fa-jenkins',\n 'angles-up-down': 'up-down',\n clone: ['far', 'clone'],\n 'file-lines': ['far', 'file-lines'],\n brain: 'brain',\n times: 'xmark',\n close: 'xmark',\n x: 'xmark',\n 'chevron-down': 'chevron-down',\n download: 'download',\n play: 'play',\n pause: 'pause',\n spinner: 'spinner',\n 'fa-warning': 'triangle-exclamation',\n 'compress-alt': 'down-left-and-up-right-to-center',\n}\n\nregisterIcons({\n agents: Agents,\n mcp: Mcp,\n 'model-gateway': ModelGateway,\n guardrails: Guardrails,\n trash: Trash,\n})\n\nregisterImgIcons({\n logo,\n})\n\nexport type IconProp = string | FontAwesomeIconProp\n\n/** Container frame and the glyph drawn inside it: 12→10, 16→14, 24→20. */\nexport const iconFrame = {\n '12': { frameClass: 'size-3', glyph: 0.625 },\n '16': { frameClass: 'size-4', glyph: 0.875 },\n '24': { frameClass: 'size-6', glyph: 1.25 },\n} as const\n\nexport type IconSize = keyof typeof iconFrame\n\ninterface IconProps {\n icon: IconProp\n color?: string\n className?: string\n onClick?: (e: React.MouseEvent) => void\n size?: number | IconSize\n width?: number\n forwardedRef?: React.Ref<HTMLElement>\n nativeProps?: Partial<FontAwesomeIconProps>\n}\n\ntype CustomIconProps = {\n onClick?: (e: React.MouseEvent) => void\n className?: string\n style?: React.CSSProperties\n 'aria-hidden'?: boolean\n}\ntype DynamicIconProps = CustomIconProps & {\n name: string\n}\n\nconst DynamicIcon = ({ name, ...props }: DynamicIconProps) => {\n const IconToRender = CUSTOM_ICONS_MAP[name]\n return (\n <Suspense fallback={<span />}>\n <IconToRender {...props} />\n </Suspense>\n )\n}\n\nfunction addDarkSuffix(url: string): string {\n const urlObj = new URL(url)\n const parts = urlObj.pathname.split('/')\n const filename = parts.pop()\n\n if (!filename) {\n return url + '-dark'\n }\n\n const dotIndex = filename.lastIndexOf('.')\n let newFilename: string\n\n if (dotIndex !== -1) {\n newFilename = filename.slice(0, dotIndex) + '-dark' + filename.slice(dotIndex)\n } else {\n newFilename = filename + '-dark'\n }\n\n parts.push(newFilename)\n urlObj.pathname = parts.join('/')\n return urlObj.toString()\n}\n\nconst IconProvider = ({\n icon,\n color,\n size = 0.75,\n width,\n className,\n onClick,\n forwardedRef,\n nativeProps = {},\n}: IconProps) => {\n const { isDark } = useTheme()\n const [failedSrc, setFailedSrc] = useState<string | null>(null)\n let themeAwareImgIcon: string | null = null\n let fallbackImgIcon: string | null = null\n\n if (typeof icon === 'string' && icon.startsWith('http')) {\n themeAwareImgIcon = isDark ? addDarkSuffix(icon) : icon\n fallbackImgIcon = icon\n } else if (typeof icon === 'string' && IMG_ICONS_MAP[icon as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon}-dark`] ?? IMG_ICONS_MAP[icon as string]\n : IMG_ICONS_MAP[icon as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon as string]\n } else if (Array.isArray(icon) && icon[1] && IMG_ICONS_MAP[icon[1] as string]) {\n themeAwareImgIcon = isDark\n ? IMG_ICONS_MAP[`${icon[1]}-dark`] ?? IMG_ICONS_MAP[icon[1] as string]\n : IMG_ICONS_MAP[icon[1] as string]\n fallbackImgIcon = IMG_ICONS_MAP[icon[1] as string]\n }\n\n const faIcon = FA_ICON_ALIAS_MAP[icon as string] || icon\n const frame = typeof size === 'string' && size in iconFrame ? iconFrame[size as IconSize] : undefined\n const sizeRem = frame ? frame.glyph : typeof size === 'number' ? size : 0.75\n\n const iconStyles = width ? { width: `${width}rem`, height: 'auto' } : { height: `${sizeRem}rem`, width: 'auto' }\n const imgSrc =\n failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon\n ? fallbackImgIcon\n : themeAwareImgIcon\n\n const glyph = themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={imgSrc ?? undefined}\n alt=\"\"\n aria-hidden\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n onError={() => {\n if (themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon) {\n setFailedSrc(themeAwareImgIcon)\n }\n }}\n />\n ) : CUSTOM_ICONS_MAP[icon as string] ? (\n <DynamicIcon\n onClick={onClick}\n style={{ ...iconStyles, color }}\n name={String(icon)}\n className={className}\n aria-hidden\n />\n ) : (\n <FontAwesomeIcon\n ref={forwardedRef as ForwardedRef<SVGSVGElement>}\n icon={faIcon as FontAwesomeIconProp}\n style={{ color, fontSize: `${width ?? sizeRem}rem` }}\n className={classNames('text-xs', className)}\n onClick={onClick}\n {...nativeProps}\n />\n )\n\n if (!frame) return glyph\n\n return (\n <span className={classNames('inline-flex shrink-0 items-center justify-center', frame.frameClass)}>{glyph}</span>\n )\n}\n\nexport default React.memo(\n forwardRef<HTMLElement, IconProps>((props, ref) => <IconProvider {...props} forwardedRef={ref} />),\n)\n"],"names":["farCheckCircle","farClone","farFileLines","Agents","Mcp","ModelGateway","Guardrails","Trash","React"],"mappings":";;;;;;;;;AACA,MAAM,YAAY,CAAC,UAA0B,sBAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,aAAa,MAAM,gBAAgB,OAAO,OAAO,QAAQ,OAAO,GAAG,MAAK,GAAoB,sBAAM,cAAc,QAAQ,EAAE,GAAG,sCAAsC,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,QAAQ,EAAE,GAAG,wBAAwB,QAAQ,gBAAgB,aAAa,KAAK,eAAe,QAAO,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,CAAC;ACA/rB,MAAM,gBAAgB,CAAC,UAA0B,sB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,OAAO,OAAA;AACxG,QAAM,SACJ,cAAc,qBAAqB,mBAAmB,oBAAoB,oBACtE,kBACA;AAEN,QAAM,QAAQ,oBACZ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,KAAK,UAAU;AAAA,MACf,KAAI;AAAA,MACJ,eAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW,WAAW,SAAS;AAAA,MAC/B;AAAA,MACA,SAAS,MAAM;AACb,YAAI,qBAAqB,mBAAmB,oBAAoB,mBAAmB;AACjF,uBAAa,iBAAiB;AAAA,QAChC;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,IAEA,iBAAiB,IAAc,IACjC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,OAAO,EAAE,GAAG,YAAY,MAAA;AAAA,MACxB,MAAM,OAAO,IAAI;AAAA,MACjB;AAAA,MACA,eAAW;AAAA,IAAA;AAAA,EAAA,IAGb;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,OAAO,MAAA;AAAA,MAC7C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAIR,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,UAAK,WAAW,WAAW,oDAAoD,MAAM,UAAU,GAAI,UAAA,MAAA,CAAM;AAE9G;AAEA,MAAA,iBAAeC,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,KAAK,CAAE;AACnG;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "./IconProvider.es.js";
|
|
3
3
|
import "../../classNames-B1XpQHle.js";
|
|
4
|
-
import { f, k, g, l, j, h, m, n, i, o, M } from "../../Modal-
|
|
4
|
+
import { f, k, g, l, j, h, m, n, i, o, M } from "../../Modal-DaHG8mjy.js";
|
|
5
5
|
export {
|
|
6
6
|
f as Dialog,
|
|
7
7
|
k as DialogClose,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { C as ControlButton } from "../../Button-
|
|
2
|
+
import { C as ControlButton } from "../../Button-HHEfL8b9.js";
|
|
3
3
|
import IconProvider, { iconFrame } from "./IconProvider.es.js";
|
|
4
|
-
import {
|
|
4
|
+
import { LightTooltip, DarkTooltip, tooltipTrigger } from "./Tooltip.es.js";
|
|
5
5
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
6
6
|
const controlSizeMap = {
|
|
7
7
|
default: "overflow",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { PaginationTone } from './PaginationItem';
|
|
4
|
+
declare const paginationDotVariants: (props?: ({
|
|
5
|
+
active?: boolean | null | undefined;
|
|
6
|
+
tone?: "brand" | "neutral" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type PaginationDotProps = React.ComponentProps<'button'> & VariantProps<typeof paginationDotVariants> & {
|
|
9
|
+
active?: boolean;
|
|
10
|
+
tone?: PaginationTone;
|
|
11
|
+
};
|
|
12
|
+
declare function PaginationDot({ ref, className, active, tone, type, ...props }: PaginationDotProps): React.JSX.Element;
|
|
13
|
+
export { PaginationDot, paginationDotVariants };
|
|
14
|
+
export default PaginationDot;
|