tfy-web-components 0.0.34 → 0.0.35
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/README.md +49 -58
- package/dist/Button-C77b7jpW.js +284 -0
- package/dist/Button-C77b7jpW.js.map +1 -0
- package/dist/CompositeItem-BGwD51jI.js +33 -0
- package/dist/CompositeItem-BGwD51jI.js.map +1 -0
- package/dist/CompositeList-D4xmSZ5V.js +291 -0
- package/dist/CompositeList-D4xmSZ5V.js.map +1 -0
- package/dist/CompositeRoot-BxrPc7F6.js +351 -0
- package/dist/CompositeRoot-BxrPc7F6.js.map +1 -0
- package/dist/DirectionContext-Pb9yafF5.js +11 -0
- package/dist/DirectionContext-Pb9yafF5.js.map +1 -0
- package/dist/FieldItemContext-DRVgx-D1.js +13 -0
- package/dist/FieldItemContext-DRVgx-D1.js.map +1 -0
- package/dist/{Input-BvwIpntS.js → Input-Dhmo6L2n.js} +100 -78
- package/dist/Input-Dhmo6L2n.js.map +1 -0
- package/dist/Modal-C4MUy9GD.js +696 -0
- package/dist/Modal-C4MUy9GD.js.map +1 -0
- package/dist/{MonacoEditorCore-xfpJ6z-E.js → MonacoEditorCore-n-df5f7I.js} +2 -2
- package/dist/{MonacoEditorCore-xfpJ6z-E.js.map → MonacoEditorCore-n-df5f7I.js.map} +1 -1
- package/dist/Popover-eC_vX5By.js +1074 -0
- package/dist/Popover-eC_vX5By.js.map +1 -0
- package/dist/ToolbarRootContext-B_HxjkNI.js +11 -0
- package/dist/ToolbarRootContext-B_HxjkNI.js.map +1 -0
- package/dist/Tooltip-BuGLP-PU.js +4096 -0
- package/dist/Tooltip-BuGLP-PU.js.map +1 -0
- package/dist/classNames-B1XpQHle.js +44 -0
- package/dist/classNames-B1XpQHle.js.map +1 -0
- package/dist/components/atoms/Accordion.d.ts +19 -37
- package/dist/components/atoms/Accordion.es.js +847 -78
- package/dist/components/atoms/Accordion.es.js.map +1 -1
- package/dist/components/atoms/AudioPlayer.es.js +9 -9
- package/dist/components/atoms/AudioPlayer.es.js.map +1 -1
- package/dist/components/atoms/Avatar.d.ts +42 -9
- package/dist/components/atoms/Avatar.es.js +491 -36
- package/dist/components/atoms/Avatar.es.js.map +1 -1
- package/dist/components/atoms/Badge.d.ts +40 -35
- package/dist/components/atoms/Badge.es.js +163 -53
- package/dist/components/atoms/Badge.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +37 -16
- package/dist/components/atoms/Button.es.js +16 -221
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/ButtonGroup.d.ts +53 -0
- package/dist/components/atoms/ButtonGroup.es.js +349 -0
- package/dist/components/atoms/ButtonGroup.es.js.map +1 -0
- package/dist/components/atoms/IconButton.d.ts +23 -9
- package/dist/components/atoms/IconButton.es.js +82 -16
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.d.ts +1 -1
- package/dist/components/atoms/IconProvider.es.js +48 -7
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Modal.d.ts +27 -3
- package/dist/components/atoms/Modal.es.js +15 -16
- package/dist/components/atoms/Modal.es.js.map +1 -1
- package/dist/components/atoms/Notification.d.ts +1 -1
- package/dist/components/atoms/Notification.es.js +26 -3
- package/dist/components/atoms/Notification.es.js.map +1 -1
- package/dist/components/atoms/OutlinedRadio.d.ts +6 -2
- package/dist/components/atoms/OutlinedRadio.es.js +12 -25
- package/dist/components/atoms/OutlinedRadio.es.js.map +1 -1
- package/dist/components/atoms/Progress.d.ts +48 -0
- package/dist/components/atoms/Progress.es.js +279 -0
- package/dist/components/atoms/Progress.es.js.map +1 -0
- package/dist/components/atoms/Skeleton.d.ts +9 -3
- package/dist/components/atoms/Skeleton.es.js +33 -3
- package/dist/components/atoms/Skeleton.es.js.map +1 -1
- package/dist/components/atoms/Spinner.d.ts +15 -4
- package/dist/components/atoms/Spinner.es.js +86 -22
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Switch.d.ts +19 -7
- package/dist/components/atoms/Switch.es.js +288 -50
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.d.ts +17 -3
- package/dist/components/atoms/TabButton.es.js +647 -25
- package/dist/components/atoms/TabButton.es.js.map +1 -1
- package/dist/components/atoms/TabPanel.es.js +1 -1
- package/dist/components/atoms/Tag.d.ts +43 -0
- package/dist/components/atoms/Tag.es.js +219 -0
- package/dist/components/atoms/Tag.es.js.map +1 -0
- package/dist/components/atoms/Tooltip.d.ts +36 -14
- package/dist/components/atoms/Tooltip.es.js +7 -114
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/Alert.d.ts +1 -1
- package/dist/components/molecules/Alert.es.js +13 -9
- package/dist/components/molecules/Alert.es.js.map +1 -1
- package/dist/components/molecules/CopyField.d.ts +2 -2
- package/dist/components/molecules/CopyField.es.js +3 -4
- package/dist/components/molecules/CopyField.es.js.map +1 -1
- package/dist/components/molecules/CustomDrawer.d.ts +5 -4
- package/dist/components/molecules/CustomDrawer.es.js +141 -82
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/molecules/Dialog.d.ts +16 -8
- package/dist/components/molecules/Dialog.es.js +33 -31
- package/dist/components/molecules/Dialog.es.js.map +1 -1
- package/dist/components/molecules/ImagesPreview.es.js +15 -11
- package/dist/components/molecules/ImagesPreview.es.js.map +1 -1
- package/dist/components/molecules/Input.d.ts +1 -1
- package/dist/components/molecules/Input.es.js +3 -5
- package/dist/components/molecules/Input.es.js.map +1 -1
- package/dist/components/molecules/Markdown/ExpandableMarkdown.d.ts +8 -8
- package/dist/components/molecules/Markdown/components.d.ts +12 -11
- package/dist/components/molecules/Markdown.es.js +26 -49
- package/dist/components/molecules/Markdown.es.js.map +1 -1
- package/dist/components/molecules/Notify.d.ts +30 -1
- package/dist/components/molecules/Notify.es.js +91 -36
- package/dist/components/molecules/Notify.es.js.map +1 -1
- package/dist/components/molecules/SimpleCodeEditor.es.js +32 -19
- package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
- package/dist/components/molecules/ToggleButton.d.ts +3 -2
- package/dist/components/molecules/ToggleButton.es.js +155 -57
- package/dist/components/molecules/ToggleButton.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessage.es.js +2 -2
- package/dist/components/molecules/agent-chat/UserMessage.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js +5 -5
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/index.d.ts +0 -6
- package/dist/components/molecules/agent-chat.es.js +76 -407
- package/dist/components/molecules/agent-chat.es.js.map +1 -1
- package/dist/components/molecules/monacoEditorCore/MonacoEditorCore.d.ts +0 -1
- package/dist/components/theme/colors.d.ts +17 -53
- package/dist/components/theme/colors.es.js +384 -180
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/components/theme/theme.d.ts +14 -11
- package/dist/components/theme/theme.es.js +3 -64
- package/dist/components/theme/theme.es.js.map +1 -1
- package/dist/components/theme/useTheme.es.js +1 -4
- package/dist/components/theme/useTheme.es.js.map +1 -1
- package/dist/composite-CrCQWAKA.js +108 -0
- package/dist/composite-CrCQWAKA.js.map +1 -0
- package/dist/composite-DCpXNxz9.js +66 -0
- package/dist/composite-DCpXNxz9.js.map +1 -0
- package/dist/conversions-CbWPvHRE.js +14 -0
- package/dist/conversions-CbWPvHRE.js.map +1 -0
- package/dist/error-FX4R42W-.js +6 -0
- package/dist/error-FX4R42W-.js.map +1 -0
- package/dist/fonts.css +7 -0
- package/dist/hooks/useContainerDimensions.d.ts +1 -1
- package/dist/index-B806bfA-.js +257 -0
- package/dist/index-B806bfA-.js.map +1 -0
- package/dist/index-DSVg79g-.js +45 -0
- package/dist/index-DSVg79g-.js.map +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/index.es.js +56 -9
- package/dist/index.es.js.map +1 -1
- package/dist/inertValue-IJM5NA30.js +11 -0
- package/dist/inertValue-IJM5NA30.js.map +1 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/markdown.css +13 -14
- package/dist/new-components/atoms/Checkbox.d.ts +6 -0
- package/dist/new-components/atoms/Checkbox.es.js +423 -0
- package/dist/new-components/atoms/Checkbox.es.js.map +1 -0
- package/dist/new-components/atoms/Chip.d.ts +38 -0
- package/dist/new-components/atoms/Chip.es.js +269 -0
- package/dist/new-components/atoms/Chip.es.js.map +1 -0
- package/dist/new-components/atoms/Popover.d.ts +87 -0
- package/dist/new-components/atoms/Popover.es.js +21 -0
- package/dist/new-components/atoms/Popover.es.js.map +1 -0
- package/dist/new-components/atoms/Radio.d.ts +14 -0
- package/dist/new-components/atoms/Radio.es.js +536 -0
- package/dist/new-components/atoms/Radio.es.js.map +1 -0
- package/dist/new-components/atoms/SegmentedControl.d.ts +28 -0
- package/dist/new-components/atoms/SegmentedControl.es.js +326 -0
- package/dist/new-components/atoms/SegmentedControl.es.js.map +1 -0
- package/dist/new-components/atoms/Slider.d.ts +8 -0
- package/dist/new-components/atoms/Slider.es.js +1415 -0
- package/dist/new-components/atoms/Slider.es.js.map +1 -0
- package/dist/new-components/atoms/Toggletip.d.ts +43 -0
- package/dist/new-components/atoms/Toggletip.es.js +216 -0
- package/dist/new-components/atoms/Toggletip.es.js.map +1 -0
- package/dist/new-components/atoms/stories/ThemeComparison.d.ts +8 -0
- package/dist/shadowDom-Bq4g0Qeu.js +52 -0
- package/dist/shadowDom-Bq4g0Qeu.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/theme.css +9 -154
- package/dist/tokens.css +1136 -0
- package/dist/useAnimationFrame-DwhymJoW.js +108 -0
- package/dist/useAnimationFrame-DwhymJoW.js.map +1 -0
- package/dist/useAriaLabelledBy-B6n92QBS.js +49 -0
- package/dist/useAriaLabelledBy-B6n92QBS.js.map +1 -0
- package/dist/useBaseUiId-Ch7ujXpo.js +281 -0
- package/dist/useBaseUiId-Ch7ujXpo.js.map +1 -0
- package/dist/useButton-PUBhT4Vo.js +235 -0
- package/dist/useButton-PUBhT4Vo.js.map +1 -0
- package/dist/useControlled-BSyYkg5C.js +65 -0
- package/dist/useControlled-BSyYkg5C.js.map +1 -0
- package/dist/useIsoLayoutEffect-e9VA-ICd.js +499 -0
- package/dist/useIsoLayoutEffect-e9VA-ICd.js.map +1 -0
- package/dist/useLabelableId-DCLzrdD-.js +241 -0
- package/dist/useLabelableId-DCLzrdD-.js.map +1 -0
- package/dist/useOpenInteractionType-DGWLoAqp.js +1086 -0
- package/dist/useOpenInteractionType-DGWLoAqp.js.map +1 -0
- package/dist/usePopupHandleStore-BdS-xYID.js +2372 -0
- package/dist/usePopupHandleStore-BdS-xYID.js.map +1 -0
- package/dist/useTimeout-BXf1hDIL.js +46 -0
- package/dist/useTimeout-BXf1hDIL.js.map +1 -0
- package/dist/useTransitionStatus-C9gg_XJ-.js +202 -0
- package/dist/useTransitionStatus-C9gg_XJ-.js.map +1 -0
- package/dist/useValueAsRef-BfFRcMg6.js +28 -0
- package/dist/useValueAsRef-BfFRcMg6.js.map +1 -0
- package/dist/utils/classNames.d.ts +3 -2
- package/dist/visuallyHidden-B6H2X3_Y.js +26 -0
- package/dist/visuallyHidden-B6H2X3_Y.js.map +1 -0
- package/dist/vite-env.d.ts +18 -0
- package/package.json +30 -22
- package/dist/Input-BvwIpntS.js.map +0 -1
- package/dist/Notification-BT4CZ69U.js +0 -39
- package/dist/Notification-BT4CZ69U.js.map +0 -1
- package/dist/RootFontSizeContext-7vgn7Y_k.js +0 -22
- package/dist/RootFontSizeContext-7vgn7Y_k.js.map +0 -1
- package/dist/classNames-Dy-RXSjS.js +0 -9
- package/dist/classNames-Dy-RXSjS.js.map +0 -1
- package/dist/components/molecules/DropdownMenu.d.ts +0 -18
- package/dist/components/molecules/DropdownMenu.es.js +0 -104
- package/dist/components/molecules/DropdownMenu.es.js.map +0 -1
- package/dist/components/molecules/ThumbsFeedback.d.ts +0 -13
- package/dist/components/molecules/ThumbsFeedback.es.js +0 -98
- package/dist/components/molecules/ThumbsFeedback.es.js.map +0 -1
- package/dist/components/molecules/agent-chat/SandboxToolCall.d.ts +0 -15
- package/dist/components/molecules/agent-chat/ToolCallCard.d.ts +0 -26
- package/dist/components/molecules/agent-chat/ToolCallContentBlock.d.ts +0 -17
- package/dist/components/theme/lightColorPlugin.d.ts +0 -1
- package/dist/components/theme/lightColorPlugin.es.js +0 -92
- package/dist/components/theme/lightColorPlugin.es.js.map +0 -1
- package/dist/tailwindPreset.d.ts +0 -144
- package/dist/tailwindPreset.es.js +0 -100
- package/dist/tailwindPreset.es.js.map +0 -1
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import React__default, { forwardRef, useState, Suspense } from "react";
|
|
3
4
|
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
4
5
|
import { faCheckCircle as faCheckCircle$1, faClone, faFileLines } from "@fortawesome/free-regular-svg-icons";
|
|
5
|
-
import { faCheck, faCheckCircle, faChevronLeft, faChevronRight, faCircleXmark, faCode, faCopy, faCube, faExpandAlt, faExternalLink, faRotateRight, faServer, faTerminal, faUpDown, faWrench } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { faCheck, faCheckCircle, faChevronDown, faChevronLeft, faChevronRight, faCircleXmark, faDownload, faPause, faPlay, faSpinner, faXmark, faCode, faCopy, faCube, faExpandAlt, faExternalLink, faRotateRight, faServer, faTerminal, faUpDown, faWrench, faGlobe, faIdBadge, faPen, faPlus, faUserSlash, faUsers } from "@fortawesome/free-solid-svg-icons";
|
|
6
7
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { c as classNames } from "../../classNames-
|
|
8
|
+
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
8
9
|
import { useTheme } from "../theme/useTheme.es.js";
|
|
10
|
+
const 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 }));
|
|
11
|
+
const 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" }));
|
|
12
|
+
const logo = "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";
|
|
13
|
+
const 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" }));
|
|
14
|
+
const 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" }));
|
|
15
|
+
const 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" }));
|
|
9
16
|
library.add(
|
|
10
17
|
faCheck,
|
|
11
18
|
faCheckCircle,
|
|
19
|
+
faChevronDown,
|
|
12
20
|
faChevronLeft,
|
|
13
21
|
faChevronRight,
|
|
14
22
|
faCircleXmark,
|
|
23
|
+
faDownload,
|
|
24
|
+
faPause,
|
|
25
|
+
faPlay,
|
|
26
|
+
faSpinner,
|
|
27
|
+
faXmark,
|
|
15
28
|
faCode,
|
|
16
29
|
faCopy,
|
|
17
30
|
faCube,
|
|
@@ -22,6 +35,12 @@ library.add(
|
|
|
22
35
|
faTerminal,
|
|
23
36
|
faUpDown,
|
|
24
37
|
faWrench,
|
|
38
|
+
faGlobe,
|
|
39
|
+
faIdBadge,
|
|
40
|
+
faPen,
|
|
41
|
+
faPlus,
|
|
42
|
+
faUserSlash,
|
|
43
|
+
faUsers,
|
|
25
44
|
faCheckCircle$1,
|
|
26
45
|
faClone,
|
|
27
46
|
faFileLines
|
|
@@ -42,8 +61,26 @@ const FA_ICON_ALIAS_MAP = {
|
|
|
42
61
|
"angles-up-down": "up-down",
|
|
43
62
|
clone: ["far", "clone"],
|
|
44
63
|
"file-lines": ["far", "file-lines"],
|
|
45
|
-
brain: "brain"
|
|
64
|
+
brain: "brain",
|
|
65
|
+
times: "xmark",
|
|
66
|
+
close: "xmark",
|
|
67
|
+
x: "xmark",
|
|
68
|
+
"chevron-down": "chevron-down",
|
|
69
|
+
download: "download",
|
|
70
|
+
play: "play",
|
|
71
|
+
pause: "pause",
|
|
72
|
+
spinner: "spinner"
|
|
46
73
|
};
|
|
74
|
+
registerIcons({
|
|
75
|
+
agents: SvgAgents,
|
|
76
|
+
mcp: SvgMcp,
|
|
77
|
+
"model-gateway": SvgModelGateway,
|
|
78
|
+
guardrails: SvgGuardrails,
|
|
79
|
+
trash: SvgTrash
|
|
80
|
+
});
|
|
81
|
+
registerImgIcons({
|
|
82
|
+
logo
|
|
83
|
+
});
|
|
47
84
|
const DynamicIcon = ({ name, ...props }) => {
|
|
48
85
|
const IconToRender = CUSTOM_ICONS_MAP[name];
|
|
49
86
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", {}), children: /* @__PURE__ */ jsx(IconToRender, { ...props }) });
|
|
@@ -77,6 +114,7 @@ const IconProvider = ({
|
|
|
77
114
|
nativeProps = {}
|
|
78
115
|
}) => {
|
|
79
116
|
const { isDark } = useTheme();
|
|
117
|
+
const [failedSrc, setFailedSrc] = useState(null);
|
|
80
118
|
let themeAwareImgIcon = null;
|
|
81
119
|
let fallbackImgIcon = null;
|
|
82
120
|
if (typeof icon === "string" && icon.startsWith("http")) {
|
|
@@ -91,16 +129,19 @@ const IconProvider = ({
|
|
|
91
129
|
}
|
|
92
130
|
const faIcon = FA_ICON_ALIAS_MAP[icon] || icon;
|
|
93
131
|
const iconStyles = width ? { width: `${width}rem`, height: "auto" } : { height: `${size}rem`, width: "auto" };
|
|
132
|
+
const imgSrc = failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon ? fallbackImgIcon : themeAwareImgIcon;
|
|
94
133
|
return themeAwareImgIcon ? /* @__PURE__ */ jsx(
|
|
95
134
|
"img",
|
|
96
135
|
{
|
|
97
136
|
ref: forwardedRef,
|
|
98
|
-
src:
|
|
137
|
+
src: imgSrc ?? void 0,
|
|
99
138
|
style: iconStyles,
|
|
100
139
|
className: classNames(className),
|
|
101
140
|
onClick,
|
|
102
|
-
onError: (
|
|
103
|
-
|
|
141
|
+
onError: () => {
|
|
142
|
+
if (themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon) {
|
|
143
|
+
setFailedSrc(themeAwareImgIcon);
|
|
144
|
+
}
|
|
104
145
|
}
|
|
105
146
|
}
|
|
106
147
|
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(DynamicIcon, { onClick, style: { ...iconStyles, color }, name: String(icon), className }) : /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconProvider.es.js","sources":["../../../src/components/atoms/IconProvider.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, Suspense } 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 faCheck,\n faCheckCircle,\n faChevronLeft,\n faChevronRight,\n faCircleXmark,\n faCode,\n faCopy,\n faCube,\n faExpandAlt,\n faExternalLink,\n faRotateRight,\n faServer,\n faTerminal,\n faUpDown,\n faWrench,\n} from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome'\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 faCheck,\n faCheckCircle,\n faChevronLeft,\n faChevronRight,\n faCircleXmark,\n faCode,\n faCopy,\n faCube,\n faExpandAlt,\n faExternalLink,\n faRotateRight,\n faServer,\n faTerminal,\n faUpDown,\n faWrench,\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}\n\nexport type IconProp = string | FontAwesomeIconProp\n\ninterface IconProps {\n icon: IconProp\n color?: string\n className?: string\n onClick?: (e: React.MouseEvent) => void\n size?: number\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}\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 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\n const iconStyles = width ? { width: `${width}rem`, height: 'auto' } : { height: `${size}rem`, width: 'auto' }\n\n return themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={themeAwareImgIcon}\n style={iconStyles}\n className={classNames(className)}\n onClick={onClick}\n onError={(e) => {\n e.currentTarget.src = fallbackImgIcon as string\n }}\n />\n ) : CUSTOM_ICONS_MAP[icon as string] ? (\n <DynamicIcon onClick={onClick} style={{ ...iconStyles, color }} name={String(icon)} className={className} />\n ) : (\n <FontAwesomeIcon\n ref={forwardedRef as ForwardedRef<SVGSVGElement>}\n icon={faIcon as FontAwesomeIconProp}\n style={{ color, fontSize: `${width ?? size}rem` }}\n className={classNames('text-xs', className)}\n onClick={onClick}\n {...nativeProps}\n />\n )\n}\n\nexport default React.memo(\n forwardRef<HTMLElement, IconProps>((props, ref) => <IconProvider {...props} forwardedRef={ref} />),\n)\n"],"names":["farCheckCircle","farClone","farFileLines","React"],"mappings":";;;;;;;;AA+BA,QAAQ;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAA;AAAAA,EACAC;AAAAA,EACAC;AACF;AAGA,MAAM,gBAA4B,CAAA;AAC3B,MAAM,mBAAmB,CAAC,YAAwB;AACvD,SAAO,OAAO,eAAe,OAAO;AACtC;AAMA,MAAM,mBAAkC,CAAA;AACjC,MAAM,gBAAgB,CAAC,YAA2B;AACvD,SAAO,OAAO,kBAAkB,OAAO;AACzC;AAEA,MAAM,oBAA8E;AAAA,EAClF,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,OAAO,CAAC,OAAO,OAAO;AAAA,EACtB,cAAc,CAAC,OAAO,YAAY;AAAA,EAClC,OAAO;AACT;AAwBA,MAAM,cAAc,CAAC,EAAE,MAAM,GAAG,YAA8B;AAC5D,QAAM,eAAe,iBAAiB,IAAI;AAC1C,SACE,oBAAC,UAAA,EAAS,UAAU,oBAAC,QAAA,CAAA,CAAK,GACxB,UAAA,oBAAC,cAAA,EAAc,GAAG,MAAA,CAAO,EAAA,CAC3B;AAEJ;AAEA,SAAS,cAAc,KAAqB;AAC1C,QAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,QAAM,QAAQ,OAAO,SAAS,MAAM,GAAG;AACvC,QAAM,WAAW,MAAM,IAAA;AAEvB,MAAI,CAAC,UAAU;AACb,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,WAAW,SAAS,YAAY,GAAG;AACzC,MAA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AAO;AAAA,MACP,WAAW,WAAW,SAAS;AAAA,MAC/B;AAAA,MACA,SAAS,CAAC,MAAM;AACd,UAAE,cAAc,MAAM;AAAA,MACxB;AAAA,IAAA;AAAA,EAAA,IAEA,iBAAiB,IAAc,IACjC,oBAAC,aAAA,EAAY,SAAkB,OAAO,EAAE,GAAG,YAAY,SAAS,MAAM,OAAO,IAAI,GAAG,WAAsB,IAE1G;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI,MAAA;AAAA,MAC1C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;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 faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleXmark,\n faCode,\n faCopy,\n faCube,\n faDownload,\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 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 faCheck,\n faCheckCircle,\n faChevronDown,\n faChevronLeft,\n faChevronRight,\n faCircleXmark,\n faDownload,\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 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}\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\ninterface IconProps {\n icon: IconProp\n color?: string\n className?: string\n onClick?: (e: React.MouseEvent) => void\n size?: number\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}\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\n const iconStyles = width ? { width: `${width}rem`, height: 'auto' } : { height: `${size}rem`, width: 'auto' }\n const imgSrc =\n failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon\n ? fallbackImgIcon\n : themeAwareImgIcon\n\n return themeAwareImgIcon ? (\n <img\n ref={forwardedRef as React.ForwardedRef<HTMLImageElement>}\n src={imgSrc ?? undefined}\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 onClick={onClick} style={{ ...iconStyles, color }} name={String(icon)} className={className} />\n ) : (\n <FontAwesomeIcon\n ref={forwardedRef as ForwardedRef<SVGSVGElement>}\n icon={faIcon as FontAwesomeIconProp}\n style={{ color, fontSize: `${width ?? size}rem` }}\n className={classNames('text-xs', className)}\n onClick={onClick}\n {...nativeProps}\n />\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,Q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AU;AAAA,MACf,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,oBAAC,aAAA,EAAY,SAAkB,OAAO,EAAE,GAAG,YAAY,SAAS,MAAM,OAAO,IAAI,GAAG,WAAsB,IAE1G;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI,MAAA;AAAA,MAC1C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAA,iBAAeC,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,KAAK,CAAE;AACnG;"}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
3
|
+
declare function Dialog(props: DialogPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger(props: DialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal(props: DialogPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DialogClose(props: DialogPrimitive.Close.Props): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showClose, ...props }: DialogPrimitive.Popup.Props & {
|
|
9
|
+
showClose?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
|
|
15
|
+
export interface ModalProps {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onClose?: (event?: object, reason?: string) => void;
|
|
4
18
|
children: JSX.Element;
|
|
19
|
+
/** Accessible name for the dialog; children supply the visible panel. */
|
|
20
|
+
ariaLabel?: string;
|
|
5
21
|
disableEnforceFocus?: boolean;
|
|
22
|
+
className?: string;
|
|
6
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Overlay-only modal: children render their own panel (Alert, ImagesPreview), so no
|
|
26
|
+
* DialogContent card/padding/max-width is applied here.
|
|
27
|
+
* Base UI fires `onOpenChange(false)` for backdrop, Escape, and programmatic close;
|
|
28
|
+
* reasons are mapped to the legacy MUI-style strings callers expect.
|
|
29
|
+
*/
|
|
7
30
|
declare const Modal: React.FC<ModalProps>;
|
|
8
31
|
export default Modal;
|
|
32
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
MuiModal,
|
|
6
|
-
{
|
|
7
|
-
...nativeProps,
|
|
8
|
-
disableEnforceFocus,
|
|
9
|
-
className: "modal modal-open",
|
|
10
|
-
"aria-labelledby": "modal-modal-title",
|
|
11
|
-
"aria-describedby": "modal-modal-description",
|
|
12
|
-
children
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "./IconProvider.es.js";
|
|
3
|
+
import "../../classNames-B1XpQHle.js";
|
|
4
|
+
import { D, k, a, l, d, b, m, n, c, o, M } from "../../Modal-C4MUy9GD.js";
|
|
16
5
|
export {
|
|
17
|
-
|
|
6
|
+
D as Dialog,
|
|
7
|
+
k as DialogClose,
|
|
8
|
+
a as DialogContent,
|
|
9
|
+
l as DialogDescription,
|
|
10
|
+
d as DialogFooter,
|
|
11
|
+
b as DialogHeader,
|
|
12
|
+
m as DialogOverlay,
|
|
13
|
+
n as DialogPortal,
|
|
14
|
+
c as DialogTitle,
|
|
15
|
+
o as DialogTrigger,
|
|
16
|
+
M as default
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=Modal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"Modal.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { t as toDataTestId } from "../../conversions-CbWPvHRE.js";
|
|
3
|
+
const Toast = ({ title, msg, icon, dataTestPrefix }) => {
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
5
|
+
icon,
|
|
6
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
"h2",
|
|
9
|
+
{
|
|
10
|
+
className: "mb-2 font-sans text-xl font-bold leading-6 text-text-primary",
|
|
11
|
+
"data-test": toDataTestId("toast-header", dataTestPrefix),
|
|
12
|
+
children: title
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: "font-sans text-base leading-5 text-text-secondary",
|
|
19
|
+
"data-test": toDataTestId("toast-subheader", dataTestPrefix),
|
|
20
|
+
children: msg
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
] })
|
|
24
|
+
] });
|
|
25
|
+
};
|
|
3
26
|
export {
|
|
4
|
-
|
|
27
|
+
Toast
|
|
5
28
|
};
|
|
6
29
|
//# sourceMappingURL=Notification.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
1
|
+
{"version":3,"file":"Notification.es.js","sources":["../../../src/components/atoms/Notification.tsx"],"sourcesContent":["import React, { type JSX } from 'react'\n\nimport { toDataTestId } from '@/utils/conversions'\n\ntype ToastProps = {\n title?: string\n msg?: string\n icon?: React.ReactNode | JSX.Element | string\n dataTestPrefix?: string\n}\n\nexport const Toast: React.FC<ToastProps> = ({ title, msg, icon, dataTestPrefix }) => {\n return (\n <div className=\"flex\">\n {icon}\n <div>\n <h2\n className=\"mb-2 font-sans text-xl font-bold leading-6 text-text-primary\"\n data-test={toDataTestId('toast-header', dataTestPrefix)}\n >\n {title}\n </h2>\n <div\n className=\"font-sans text-base leading-5 text-text-secondary\"\n data-test={toDataTestId('toast-subheader', dataTestPrefix)}\n >\n {msg}\n </div>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;AAWO,MAAM,QAA8B,CAAC,EAAE,OAAO,KAAK,MAAM,qBAAqB;AACnF,SACE,qBAAC,OAAA,EAAI,WAAU,QACZ,UAAA;AAAA,IAAA;AAAA,yBACA,OAAA,EACC,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAW,aAAa,gBAAgB,cAAc;AAAA,UAErD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEH;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAW,aAAa,mBAAmB,cAAc;AAAA,UAExD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export type OutlinedRadioProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
3
|
+
/**
|
|
4
|
+
* The dot follows the native input's `:checked` via `peer-checked`.
|
|
5
|
+
* Focus ring is applied with peer-focus-visible outline classes (not `focus-ring`,
|
|
6
|
+
* which only styles the element that has the class on its own `:focus-visible`).
|
|
7
|
+
*/
|
|
4
8
|
declare const OutlinedRadio: React.FC<OutlinedRadioProps>;
|
|
5
9
|
export default OutlinedRadio;
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
);
|
|
14
|
-
const radioSx = { p: 0, m: 0, width: "100%", height: "100%" };
|
|
15
|
-
const OutlinedRadio = (props) => /* @__PURE__ */ jsx("div", { className: "relative inline-flex shrink-0 items-start justify-start leading-none", style: wrapperStyle, children: /* @__PURE__ */ jsx(
|
|
16
|
-
Radio,
|
|
17
|
-
{
|
|
18
|
-
disableRipple: true,
|
|
19
|
-
size: "small",
|
|
20
|
-
...props,
|
|
21
|
-
icon: /* @__PURE__ */ jsx(OutlinedRadioIcon, {}),
|
|
22
|
-
checkedIcon: /* @__PURE__ */ jsx(OutlinedRadioIcon, { checked: true }),
|
|
23
|
-
sx: radioSx
|
|
24
|
-
}
|
|
25
|
-
) });
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
3
|
+
const OutlinedRadio = ({ className, ...props }) => /* @__PURE__ */ jsxs("span", { className: classNames("relative inline-flex size-4 shrink-0 items-start justify-start leading-none", className), children: [
|
|
4
|
+
/* @__PURE__ */ jsx("input", { type: "radio", className: "peer absolute inset-0 cursor-pointer opacity-0 disabled:cursor-default", ...props }),
|
|
5
|
+
/* @__PURE__ */ jsx(
|
|
6
|
+
"span",
|
|
7
|
+
{
|
|
8
|
+
"aria-hidden": true,
|
|
9
|
+
className: "inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-surface-input peer-checked:border-[0.3125rem] peer-checked:border-border-brand-bold peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-border-focus peer-disabled:opacity-50"
|
|
10
|
+
}
|
|
11
|
+
)
|
|
12
|
+
] });
|
|
26
13
|
export {
|
|
27
14
|
OutlinedRadio as default
|
|
28
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutlinedRadio.es.js","sources":["../../../src/components/atoms/OutlinedRadio.tsx"],"sourcesContent":["import React from 'react'\nimport
|
|
1
|
+
{"version":3,"file":"OutlinedRadio.es.js","sources":["../../../src/components/atoms/OutlinedRadio.tsx"],"sourcesContent":["import React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nexport type OutlinedRadioProps = React.InputHTMLAttributes<HTMLInputElement>\n\n/**\n * The dot follows the native input's `:checked` via `peer-checked`.\n * Focus ring is applied with peer-focus-visible outline classes (not `focus-ring`,\n * which only styles the element that has the class on its own `:focus-visible`).\n */\nconst OutlinedRadio: React.FC<OutlinedRadioProps> = ({ className, ...props }) => (\n <span className={cn('relative inline-flex size-4 shrink-0 items-start justify-start leading-none', className)}>\n <input type=\"radio\" className=\"peer absolute inset-0 cursor-pointer opacity-0 disabled:cursor-default\" {...props} />\n <span\n aria-hidden\n className=\"inline-flex size-4 shrink-0 rounded-full border border-border-bold bg-background-surface-input peer-checked:border-[0.3125rem] peer-checked:border-border-brand-bold peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-border-focus peer-disabled:opacity-50\"\n />\n </span>\n)\n\nexport default OutlinedRadio\n"],"names":["cn"],"mappings":";;AAWA,MAAM,gBAA8C,CAAC,EAAE,WAAW,GAAG,MAAA,MACnE,qBAAC,QAAA,EAAK,WAAWA,WAAG,+EAA+E,SAAS,GAC1G,UAAA;AAAA,EAAA,oBAAC,WAAM,MAAK,SAAQ,WAAU,0EAA0E,GAAG,OAAO;AAAA,EAClH;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAW;AAAA,MACX,WAAU;AAAA,IAAA;AAAA,EAAA;AACZ,EAAA,CACF;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
export type ProgressTone = 'brand' | 'success' | 'error';
|
|
4
|
+
export type ProgressSize = 'sm' | 'md';
|
|
5
|
+
declare const progressTrackVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export type ProgressProps = Omit<React.ComponentProps<'div'>, 'children'> & VariantProps<typeof progressTrackVariants> & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
+
value?: number;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
tone?: ProgressTone;
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function Progress({ ref, className, value, loading, tone, size, label, ...props }: ProgressProps): React.JSX.Element;
|
|
16
|
+
export type ProgressCircleSize = 'sm' | 'md' | 'lg';
|
|
17
|
+
export interface ProgressCircleProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
18
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
19
|
+
value?: number;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
tone?: ProgressTone;
|
|
22
|
+
size?: ProgressCircleSize;
|
|
23
|
+
showValue?: boolean;
|
|
24
|
+
label?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function ProgressCircle({ ref, className, value, loading, tone, size, showValue, label, ...props }: ProgressCircleProps): React.JSX.Element;
|
|
27
|
+
export interface ProgressStepsProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
28
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
29
|
+
segments?: 3 | 4 | 5;
|
|
30
|
+
completed?: number;
|
|
31
|
+
tone?: ProgressTone;
|
|
32
|
+
size?: ProgressSize;
|
|
33
|
+
label?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function ProgressSteps({ ref, className, segments, completed, tone, size, label, ...props }: ProgressStepsProps): React.JSX.Element;
|
|
36
|
+
export type ProgressFieldState = 'default' | 'success' | 'error';
|
|
37
|
+
export interface ProgressFieldProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
38
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
39
|
+
value?: number;
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
state?: ProgressFieldState;
|
|
42
|
+
label: React.ReactNode;
|
|
43
|
+
message?: React.ReactNode;
|
|
44
|
+
showValue?: boolean;
|
|
45
|
+
size?: ProgressSize;
|
|
46
|
+
}
|
|
47
|
+
export declare function ProgressField({ ref, className, value, loading, state, label, message, showValue, size, ...props }: ProgressFieldProps): React.JSX.Element;
|
|
48
|
+
export default Progress;
|