tfy-web-components 0.0.35 → 0.0.37
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-C77b7jpW.js → Button-DQboLdqL.js} +8 -6
- package/dist/Button-DQboLdqL.js.map +1 -0
- package/dist/{Input-Dhmo6L2n.js → Input-Bz1Ks8kH.js} +2 -2
- package/dist/{Input-Dhmo6L2n.js.map → Input-Bz1Ks8kH.js.map} +1 -1
- package/dist/{Popover-eC_vX5By.js → Popover-BSXGLfE0.js} +2 -2
- package/dist/{Popover-eC_vX5By.js.map → Popover-BSXGLfE0.js.map} +1 -1
- package/dist/components/atoms/Button.d.ts +1 -1
- package/dist/components/atoms/Button.es.js +1 -1
- package/dist/components/atoms/ButtonGroup.es.js +4 -5
- package/dist/components/atoms/ButtonGroup.es.js.map +1 -1
- package/dist/components/atoms/IconButton.es.js +7 -7
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.d.ts +4 -1
- package/dist/components/atoms/IconProvider.es.js +24 -5
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Logo.d.ts +18 -0
- package/dist/components/atoms/Logo.es.js +79 -0
- package/dist/components/atoms/Logo.es.js.map +1 -0
- package/dist/components/atoms/OverflowButton.d.ts +14 -0
- package/dist/components/atoms/OverflowButton.es.js +62 -0
- package/dist/components/atoms/OverflowButton.es.js.map +1 -0
- package/dist/components/molecules/Alert.es.js +2 -2
- package/dist/components/molecules/CopyField.es.js +2 -2
- package/dist/components/molecules/ImagesPreview.es.js +1 -1
- package/dist/components/molecules/Input.es.js +1 -1
- package/dist/components/molecules/Markdown.es.js +1 -1
- package/dist/components/molecules/SimpleCodeEditor.es.js +2 -2
- package/dist/components/molecules/ToggleButton.es.js +1 -1
- package/dist/components/molecules/agent-chat.es.js +2 -2
- package/dist/components/theme/utils.es.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +19 -17
- package/dist/index.es.js.map +1 -1
- package/dist/{isTypedArray-CLAk7Q1f.js → isTypedArray-B4QxT_l4.js} +10 -10
- package/dist/{isTypedArray-CLAk7Q1f.js.map → isTypedArray-B4QxT_l4.js.map} +1 -1
- package/dist/new-components/atoms/Popover.es.js +2 -2
- package/dist/new-components/atoms/Toggletip.es.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tfy-YZ5zY9Jw.js +6 -0
- package/dist/tfy-YZ5zY9Jw.js.map +1 -0
- package/dist/tokens.css +0 -12
- package/package.json +1 -1
- package/dist/Button-C77b7jpW.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
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-DQboLdqL.js";
|
|
4
4
|
import IconProvider from "./IconProvider.es.js";
|
|
5
5
|
import { L as LightTooltip, D as DarkTooltip } from "../../Tooltip-BuGLP-PU.js";
|
|
6
6
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
@@ -9,7 +9,7 @@ const iconButtonVariants = cva("focus-visible:outline-offset-2", {
|
|
|
9
9
|
variant: {
|
|
10
10
|
primary: "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",
|
|
11
11
|
secondary: "text-button-secondary-icon hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon hover:[&_[data-slot=button-icon]]:text-button-secondary-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-secondary-icon-selected",
|
|
12
|
-
ghost: "text-button-ghost-icon
|
|
12
|
+
ghost: "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",
|
|
13
13
|
destructive: "text-button-destructive-icon hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon hover:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover data-[selected=true]:[&_[data-slot=button-icon]]:text-button-destructive-icon-hover"
|
|
14
14
|
},
|
|
15
15
|
size: {
|
|
@@ -29,9 +29,9 @@ const controlSizeMap = {
|
|
|
29
29
|
sm: "icon-sm"
|
|
30
30
|
};
|
|
31
31
|
const defaultIconSizeMap = {
|
|
32
|
-
default:
|
|
33
|
-
md: 1,
|
|
34
|
-
sm: 0.
|
|
32
|
+
default: 0.75,
|
|
33
|
+
md: 1.125,
|
|
34
|
+
sm: 0.5625
|
|
35
35
|
};
|
|
36
36
|
function IconButton({
|
|
37
37
|
ref,
|
|
@@ -74,11 +74,11 @@ function IconButton({
|
|
|
74
74
|
children: !loading && resolvedIcon ? /* @__PURE__ */ jsx(
|
|
75
75
|
"span",
|
|
76
76
|
{
|
|
77
|
-
"data-slot": "
|
|
77
|
+
"data-slot": "button-icon",
|
|
78
78
|
"data-icon": String(resolvedIcon),
|
|
79
79
|
className: classNames(
|
|
80
80
|
"inline-flex shrink-0 items-center justify-center",
|
|
81
|
-
resolvedSize === "sm" ? "size-3" : "size-4"
|
|
81
|
+
resolvedSize === "sm" ? "size-3" : resolvedSize === "md" ? "size-6" : "size-4"
|
|
82
82
|
),
|
|
83
83
|
children: /* @__PURE__ */ jsx(IconProvider, { icon: resolvedIcon, size: iconSize ?? defaultIconSizeMap[resolvedSize] })
|
|
84
84
|
}
|
|
@@ -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, { type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip } from './Tooltip'\n\nconst iconButtonVariants = cva('focus-visible:outline-offset-2', {\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 hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon 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
|
|
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, { type IconProp } from './IconProvider'\nimport { DarkTooltip, LightTooltip } from './Tooltip'\n\nconst iconButtonVariants = cva('focus-visible:outline-offset-2', {\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 hover:text-button-secondary-icon-hover data-[selected=true]:text-button-secondary-icon-selected [&_[data-slot=button-icon]]:text-button-secondary-icon 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 hover:text-button-destructive-icon-hover data-[selected=true]:text-button-destructive-icon-hover [&_[data-slot=button-icon]]:text-button-destructive-icon 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 defaultIconSizeMap = {\n default: 0.75,\n md: 1.125,\n sm: 0.5625,\n} as const satisfies Record<IconButtonSize, number>\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 TooltipComponent = disabled ? LightTooltip : DarkTooltip\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 resolvedSize === 'sm' ? 'size-3' : resolvedSize === 'md' ? 'size-6' : 'size-4',\n )}\n >\n <IconProvider icon={resolvedIcon} size={iconSize ?? defaultIconSizeMap[resolvedSize]} />\n </span>\n ) : null}\n </ControlButton>\n )\n\n if (!tooltipTitle) {\n return button\n }\n\n // Disabled buttons use pointer-events-none; wrap so the tooltip can still receive hover.\n return (\n <TooltipComponent title={tooltipTitle}>\n {disabled ? <span className=\"inline-flex cursor-not-allowed\">{button}</span> : button}\n </TooltipComponent>\n )\n}\n\nexport default IconButton\n"],"names":["cn"],"mappings":";;;;;;AASA,MAAM,qBAAqB,IAAI,kCAAkC;AAAA,EAC/D,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;AAEA,MAAM,qBAAqB;AAAA,EACzB,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,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declare const registerIcons: (iconMap: CustomIconMap) => void;
|
|
13
13
|
export type IconProp = string | FontAwesomeIconProp;
|
|
14
|
+
/** Figma Size variant. Pixel frame, resolved to rem (12 → 0.75, 16 → 1, 24 → 1.5). */
|
|
15
|
+
export type IconSize = '12' | '16' | '24';
|
|
14
16
|
interface IconProps {
|
|
15
17
|
icon: IconProp;
|
|
16
18
|
color?: string;
|
|
17
19
|
className?: string;
|
|
18
20
|
onClick?: (e: React.MouseEvent) => void;
|
|
19
|
-
size?: number;
|
|
21
|
+
size?: number | IconSize;
|
|
20
22
|
width?: number;
|
|
21
23
|
forwardedRef?: React.Ref<HTMLElement>;
|
|
22
24
|
nativeProps?: Partial<FontAwesomeIconProps>;
|
|
@@ -25,6 +27,7 @@ type CustomIconProps = {
|
|
|
25
27
|
onClick?: (e: React.MouseEvent) => void;
|
|
26
28
|
className?: string;
|
|
27
29
|
style?: React.CSSProperties;
|
|
30
|
+
'aria-hidden'?: boolean;
|
|
28
31
|
};
|
|
29
32
|
declare const _default: React.NamedExoticComponent<IconProps & React.RefAttributes<HTMLElement>>;
|
|
30
33
|
export default _default;
|
|
@@ -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 { 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
|
+
import { 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";
|
|
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";
|
|
@@ -19,8 +19,11 @@ library.add(
|
|
|
19
19
|
faChevronDown,
|
|
20
20
|
faChevronLeft,
|
|
21
21
|
faChevronRight,
|
|
22
|
+
faCircleQuestion,
|
|
22
23
|
faCircleXmark,
|
|
24
|
+
faCompressAlt,
|
|
23
25
|
faDownload,
|
|
26
|
+
faEllipsisVertical,
|
|
24
27
|
faPause,
|
|
25
28
|
faPlay,
|
|
26
29
|
faSpinner,
|
|
@@ -33,6 +36,7 @@ library.add(
|
|
|
33
36
|
faRotateRight,
|
|
34
37
|
faServer,
|
|
35
38
|
faTerminal,
|
|
39
|
+
faTriangleExclamation,
|
|
36
40
|
faUpDown,
|
|
37
41
|
faWrench,
|
|
38
42
|
faGlobe,
|
|
@@ -69,7 +73,9 @@ const FA_ICON_ALIAS_MAP = {
|
|
|
69
73
|
download: "download",
|
|
70
74
|
play: "play",
|
|
71
75
|
pause: "pause",
|
|
72
|
-
spinner: "spinner"
|
|
76
|
+
spinner: "spinner",
|
|
77
|
+
"fa-warning": "triangle-exclamation",
|
|
78
|
+
"compress-alt": "down-left-and-up-right-to-center"
|
|
73
79
|
};
|
|
74
80
|
registerIcons({
|
|
75
81
|
agents: SvgAgents,
|
|
@@ -81,6 +87,7 @@ registerIcons({
|
|
|
81
87
|
registerImgIcons({
|
|
82
88
|
logo
|
|
83
89
|
});
|
|
90
|
+
const ICON_SIZE_REM = { "12": 0.75, "16": 1, "24": 1.5 };
|
|
84
91
|
const DynamicIcon = ({ name, ...props }) => {
|
|
85
92
|
const IconToRender = CUSTOM_ICONS_MAP[name];
|
|
86
93
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", {}), children: /* @__PURE__ */ jsx(IconToRender, { ...props }) });
|
|
@@ -128,13 +135,16 @@ const IconProvider = ({
|
|
|
128
135
|
fallbackImgIcon = IMG_ICONS_MAP[icon[1]];
|
|
129
136
|
}
|
|
130
137
|
const faIcon = FA_ICON_ALIAS_MAP[icon] || icon;
|
|
131
|
-
const
|
|
138
|
+
const sizeRem = typeof size === "string" && size in ICON_SIZE_REM ? ICON_SIZE_REM[size] : typeof size === "number" ? size : 0.75;
|
|
139
|
+
const iconStyles = width ? { width: `${width}rem`, height: "auto" } : { height: `${sizeRem}rem`, width: "auto" };
|
|
132
140
|
const imgSrc = failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon ? fallbackImgIcon : themeAwareImgIcon;
|
|
133
141
|
return themeAwareImgIcon ? /* @__PURE__ */ jsx(
|
|
134
142
|
"img",
|
|
135
143
|
{
|
|
136
144
|
ref: forwardedRef,
|
|
137
145
|
src: imgSrc ?? void 0,
|
|
146
|
+
alt: "",
|
|
147
|
+
"aria-hidden": true,
|
|
138
148
|
style: iconStyles,
|
|
139
149
|
className: classNames(className),
|
|
140
150
|
onClick,
|
|
@@ -144,12 +154,21 @@ const IconProvider = ({
|
|
|
144
154
|
}
|
|
145
155
|
}
|
|
146
156
|
}
|
|
147
|
-
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(
|
|
157
|
+
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(
|
|
158
|
+
DynamicIcon,
|
|
159
|
+
{
|
|
160
|
+
onClick,
|
|
161
|
+
style: { ...iconStyles, color },
|
|
162
|
+
name: String(icon),
|
|
163
|
+
className,
|
|
164
|
+
"aria-hidden": true
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ jsx(
|
|
148
167
|
FontAwesomeIcon,
|
|
149
168
|
{
|
|
150
169
|
ref: forwardedRef,
|
|
151
170
|
icon: faIcon,
|
|
152
|
-
style: { color, fontSize: `${width ??
|
|
171
|
+
style: { color, fontSize: `${width ?? sizeRem}rem` },
|
|
153
172
|
className: classNames("text-xs", className),
|
|
154
173
|
onClick,
|
|
155
174
|
...nativeProps
|
|
@@ -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 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,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,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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 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 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/** Figma Size variant. Pixel frame, resolved to rem (12 → 0.75, 16 → 1, 24 → 1.5). */\nexport type IconSize = '12' | '16' | '24'\n\nconst ICON_SIZE_REM: Record<IconSize, number> = { '12': 0.75, '16': 1, '24': 1.5 }\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 sizeRem =\n typeof size === 'string' && size in ICON_SIZE_REM ? ICON_SIZE_REM[size] : 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 return 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\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,OAA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
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
/** Figma Color: Full · Mono · On dark. */
|
|
4
|
+
export type LogoColor = 'full' | 'mono' | 'on-dark';
|
|
5
|
+
/** Figma Size. Square box in px, same literal style as IconSize. */
|
|
6
|
+
export type LogoSize = '16' | '24' | '32' | '40';
|
|
7
|
+
declare const logoVariants: (props?: ({
|
|
8
|
+
color?: "full" | "mono" | "on-dark" | null | undefined;
|
|
9
|
+
size?: "16" | "24" | "32" | "40" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
type LogoProps = Omit<React.ComponentProps<'span'>, 'color' | 'children'> & VariantProps<typeof logoVariants> & {
|
|
12
|
+
/** kebab-case brand slug, e.g. `github`, or an http(s) CDN URL. */
|
|
13
|
+
brand: string;
|
|
14
|
+
};
|
|
15
|
+
/** Requested colour, then Full, then nothing. Missing Mono and On dark repeat Full. */
|
|
16
|
+
export declare function resolveLogoIcon(brand: string, color: LogoColor, available: ReadonlySet<string>): string | null;
|
|
17
|
+
declare function Logo({ brand, color, size, className, ref, 'aria-label': ariaLabel, ...props }: LogoProps): React.JSX.Element | null;
|
|
18
|
+
export default Logo;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { c as cva } from "../../index-DSVg79g-.js";
|
|
5
|
+
import IconProvider, { registerIcons } from "./IconProvider.es.js";
|
|
6
|
+
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
7
|
+
const logoModules = /* @__PURE__ */ Object.assign({
|
|
8
|
+
"../../assets/logos/brand/tfy.svg": () => import("../../tfy-YZ5zY9Jw.js").then((m) => m["default"])
|
|
9
|
+
});
|
|
10
|
+
const LOGO_KEYS = /* @__PURE__ */ new Set();
|
|
11
|
+
const logoIcons = {};
|
|
12
|
+
for (const [path, loader] of Object.entries(logoModules)) {
|
|
13
|
+
const basename = (_a = path.split("/").pop()) == null ? void 0 : _a.replace(/\.svg$/, "").split("?")[0];
|
|
14
|
+
if (!basename) continue;
|
|
15
|
+
const key = `logo-${basename}`;
|
|
16
|
+
LOGO_KEYS.add(key);
|
|
17
|
+
logoIcons[key] = React.lazy(async () => ({ default: await loader() }));
|
|
18
|
+
}
|
|
19
|
+
registerIcons(logoIcons);
|
|
20
|
+
const COLOR_SUFFIX = {
|
|
21
|
+
full: "",
|
|
22
|
+
mono: "-mono",
|
|
23
|
+
"on-dark": "-on-dark"
|
|
24
|
+
};
|
|
25
|
+
const LOGO_SIZE_REM = {
|
|
26
|
+
"16": 1,
|
|
27
|
+
"24": 1.5,
|
|
28
|
+
"32": 2,
|
|
29
|
+
"40": 2.5
|
|
30
|
+
};
|
|
31
|
+
const logoVariants = cva("inline-flex shrink-0 items-center justify-center", {
|
|
32
|
+
variants: {
|
|
33
|
+
color: {
|
|
34
|
+
full: "",
|
|
35
|
+
mono: "text-icon-primary",
|
|
36
|
+
"on-dark": "text-icon-on-solid"
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
"16": "size-4",
|
|
40
|
+
"24": "size-6",
|
|
41
|
+
"32": "size-8",
|
|
42
|
+
"40": "size-10"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
color: "full",
|
|
47
|
+
size: "32"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
function resolveLogoIcon(brand, color, available) {
|
|
51
|
+
const requested = `logo-${brand}${COLOR_SUFFIX[color]}`;
|
|
52
|
+
if (available.has(requested)) return requested;
|
|
53
|
+
const full = `logo-${brand}`;
|
|
54
|
+
if (color !== "full" && available.has(full)) return full;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function Logo({ brand, color, size, className, ref, "aria-label": ariaLabel, ...props }) {
|
|
58
|
+
const resolvedColor = color ?? "full";
|
|
59
|
+
const resolvedSize = size ?? "32";
|
|
60
|
+
const icon = brand.startsWith("http") ? brand : resolveLogoIcon(brand, resolvedColor, LOGO_KEYS);
|
|
61
|
+
if (!icon) return null;
|
|
62
|
+
const labelled = Boolean(ariaLabel);
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
"span",
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
"data-slot": "logo",
|
|
68
|
+
...labelled ? { role: "img", "aria-label": ariaLabel } : { "aria-hidden": true },
|
|
69
|
+
...props,
|
|
70
|
+
className: classNames(logoVariants({ color: resolvedColor, size: resolvedSize }), className),
|
|
71
|
+
children: /* @__PURE__ */ jsx(IconProvider, { icon, size: LOGO_SIZE_REM[resolvedSize], className: "max-h-full max-w-full" })
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
Logo as default,
|
|
77
|
+
resolveLogoIcon
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=Logo.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.es.js","sources":["../../../src/components/atoms/Logo.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nimport IconProvider, { registerIcons } from './IconProvider'\n\n/**\n * Drop SVGs in `src/assets/logos/{brand,product}/`:\n * `<slug>.svg` (Full), `<slug>-on-dark.svg` (On dark), `<slug>-mono.svg` (Mono).\n * Token-bound fills (Mono, and the white parts of On dark) are `currentColor`.\n * One file per colour; the box scales it. Keys are `logo-<basename>` (not `-dark`,\n * so IconProvider does not swap them with the theme).\n */\nconst logoModules = import.meta.glob<React.FC<React.SVGProps<SVGSVGElement>>>('../../assets/logos/*/*.svg', {\n query: '?react',\n import: 'default',\n})\n\nconst LOGO_KEYS = new Set<string>()\n\nconst logoIcons: Parameters<typeof registerIcons>[0] = {}\nfor (const [path, loader] of Object.entries(logoModules)) {\n const basename = path\n .split('/')\n .pop()\n ?.replace(/\\.svg$/, '')\n .split('?')[0]\n if (!basename) continue\n const key = `logo-${basename}`\n LOGO_KEYS.add(key)\n logoIcons[key] = React.lazy(async () => ({ default: await loader() }))\n}\nregisterIcons(logoIcons)\n\n/** Figma Color: Full · Mono · On dark. */\nexport type LogoColor = 'full' | 'mono' | 'on-dark'\n\n/** Figma Size. Square box in px, same literal style as IconSize. */\nexport type LogoSize = '16' | '24' | '32' | '40'\n\nconst COLOR_SUFFIX: Record<LogoColor, string> = {\n full: '',\n mono: '-mono',\n 'on-dark': '-on-dark',\n}\n\nconst LOGO_SIZE_REM: Record<LogoSize, number> = {\n '16': 1,\n '24': 1.5,\n '32': 2,\n '40': 2.5,\n}\n\nconst logoVariants = cva('inline-flex shrink-0 items-center justify-center', {\n variants: {\n color: {\n full: '',\n mono: 'text-icon-primary',\n 'on-dark': 'text-icon-on-solid',\n },\n size: {\n '16': 'size-4',\n '24': 'size-6',\n '32': 'size-8',\n '40': 'size-10',\n },\n },\n defaultVariants: {\n color: 'full',\n size: '32',\n },\n})\n\ntype LogoProps = Omit<React.ComponentProps<'span'>, 'color' | 'children'> &\n VariantProps<typeof logoVariants> & {\n /** kebab-case brand slug, e.g. `github`, or an http(s) CDN URL. */\n brand: string\n }\n\n/** Requested colour, then Full, then nothing. Missing Mono and On dark repeat Full. */\nexport function resolveLogoIcon(brand: string, color: LogoColor, available: ReadonlySet<string>): string | null {\n const requested = `logo-${brand}${COLOR_SUFFIX[color]}`\n if (available.has(requested)) return requested\n const full = `logo-${brand}`\n if (color !== 'full' && available.has(full)) return full\n return null\n}\n\nfunction Logo({ brand, color, size, className, ref, 'aria-label': ariaLabel, ...props }: LogoProps) {\n const resolvedColor = color ?? 'full'\n const resolvedSize = size ?? '32'\n // CDN urls go through IconProvider, which loads `<file>-dark.<ext>` in dark mode and falls back to the original.\n const icon = brand.startsWith('http') ? brand : resolveLogoIcon(brand, resolvedColor, LOGO_KEYS)\n if (!icon) return null\n\n const labelled = Boolean(ariaLabel)\n\n return (\n <span\n ref={ref}\n data-slot=\"logo\"\n {...(labelled ? { role: 'img' as const, 'aria-label': ariaLabel } : { 'aria-hidden': true as const })}\n {...props}\n className={cn(logoVariants({ color: resolvedColor, size: resolvedSize }), className)}\n >\n <IconProvider icon={icon} size={LOGO_SIZE_REM[resolvedSize]} className=\"max-h-full max-w-full\" />\n </span>\n )\n}\n\nexport default Logo\n"],"names":["cn"],"mappings":";;;;;;AAcA,MAAM,cAAc,uBAAA,OAAA;AAAA,EAAA,oCAAA,MAAA,OAAA,uBAAA,EAAA,KAAA,OAAA,EAAA,SAAA,CAAA;AAAA,CAAA;AAKpB,MAAM,gCAAgB,IAAA;AAEtB,MAAM,YAAiD,CAAA;AACvD,WAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,WAAW,GAAG;AACxD,QAAM,YAAW,UACd,MAAM,GAAG,EACT,IAAA,MAFc,mBAGb,QAAQ,UAAU,IACnB,MAAM,KAAK;AACd,MAAI,CAAC,SAAU;AACf,QAAM,MAAM,QAAQ,QAAQ;AAC5B,YAAU,IAAI,GAAG;AACjB,YAAU,GAAG,IAAI,MAAM,KAAK,aAAa,EAAE,SAAS,MAAM,OAAA,EAAO,EAAI;AACvE;AACA,cAAc,SAAS;AAQvB,MAAM,eAA0C;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AACb;AAEA,MAAM,gBAA0C;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,eAAe,IAAI,oDAAoD;AAAA,EAC3E,UAAU;AAAA,IACR,OAAO;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,IAAA;AAAA,IAEb,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IAAA;AAAA,EACR;AAAA,EAEF,iBAAiB;AAAA,IACf,OAAO;AAAA,IACP,MAAM;AAAA,EAAA;AAEV,CAAC;AASM,SAAS,gBAAgB,OAAe,OAAkB,WAA+C;AAC9G,QAAM,YAAY,QAAQ,KAAK,GAAG,aAAa,KAAK,CAAC;AACrD,MAAI,UAAU,IAAI,SAAS,EAAG,QAAO;AACrC,QAAM,OAAO,QAAQ,KAAK;AAC1B,MAAI,UAAU,UAAU,UAAU,IAAI,IAAI,EAAG,QAAO;AACpD,SAAO;AACT;AAEA,SAAS,KAAK,EAAE,OAAO,OAAO,MAAM,WAAW,KAAK,cAAc,WAAW,GAAG,SAAoB;AAClG,QAAM,gBAAgB,SAAS;AAC/B,QAAM,eAAe,QAAQ;AAE7B,QAAM,OAAO,MAAM,WAAW,MAAM,IAAI,QAAQ,gBAAgB,OAAO,eAAe,SAAS;AAC/F,MAAI,CAAC,KAAM,QAAO;AAElB,QAAM,WAAW,QAAQ,SAAS;AAElC,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACT,GAAI,WAAW,EAAE,MAAM,OAAgB,cAAc,UAAA,IAAc,EAAE,eAAe,KAAA;AAAA,MACpF,GAAG;AAAA,MACJ,WAAWA,WAAG,aAAa,EAAE,OAAO,eAAe,MAAM,cAAc,GAAG,SAAS;AAAA,MAEnF,UAAA,oBAAC,gBAAa,MAAY,MAAM,cAAc,YAAY,GAAG,WAAU,wBAAA,CAAwB;AAAA,IAAA;AAAA,EAAA;AAGrG;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type OverflowButtonVariant = 'ghost' | 'secondary';
|
|
3
|
+
export type OverflowButtonSize = 'default' | 'md';
|
|
4
|
+
export type OverflowButtonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick'> & {
|
|
5
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
6
|
+
variant?: OverflowButtonVariant;
|
|
7
|
+
size?: OverflowButtonSize;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
tooltip?: React.ReactNode;
|
|
10
|
+
disabledTooltip?: React.ReactNode;
|
|
11
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
};
|
|
13
|
+
declare function OverflowButton({ ref, variant, size, open, disabled, tooltip, disabledTooltip, className, type, onClick, 'aria-label': ariaLabel, ...props }: OverflowButtonProps): React.JSX.Element;
|
|
14
|
+
export default OverflowButton;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { C as ControlButton } from "../../Button-DQboLdqL.js";
|
|
3
|
+
import IconProvider from "./IconProvider.es.js";
|
|
4
|
+
import { L as LightTooltip, D as DarkTooltip } from "../../Tooltip-BuGLP-PU.js";
|
|
5
|
+
const controlSizeMap = {
|
|
6
|
+
default: "overflow",
|
|
7
|
+
md: "overflow-md"
|
|
8
|
+
};
|
|
9
|
+
function OverflowButton({
|
|
10
|
+
ref,
|
|
11
|
+
variant = "ghost",
|
|
12
|
+
size = "default",
|
|
13
|
+
open = false,
|
|
14
|
+
disabled = false,
|
|
15
|
+
tooltip = "More actions",
|
|
16
|
+
disabledTooltip,
|
|
17
|
+
className,
|
|
18
|
+
type = "button",
|
|
19
|
+
onClick,
|
|
20
|
+
"aria-label": ariaLabel,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip;
|
|
24
|
+
const TooltipComponent = disabled ? LightTooltip : DarkTooltip;
|
|
25
|
+
const accessibleName = ariaLabel ?? (typeof tooltipTitle === "string" ? tooltipTitle : "More actions");
|
|
26
|
+
const button = /* @__PURE__ */ jsx(
|
|
27
|
+
ControlButton,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
type: "text",
|
|
31
|
+
htmlType: type,
|
|
32
|
+
variant,
|
|
33
|
+
size: controlSizeMap[size],
|
|
34
|
+
disabled,
|
|
35
|
+
onClick,
|
|
36
|
+
"aria-label": accessibleName,
|
|
37
|
+
"aria-haspopup": "menu",
|
|
38
|
+
"aria-expanded": open,
|
|
39
|
+
"data-open": open || void 0,
|
|
40
|
+
"data-selected": open && variant === "secondary" || void 0,
|
|
41
|
+
className,
|
|
42
|
+
...props,
|
|
43
|
+
children: /* @__PURE__ */ jsx(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "button-icon",
|
|
47
|
+
"data-icon": "ellipsis-vertical",
|
|
48
|
+
className: "inline-flex size-4 shrink-0 items-center justify-center",
|
|
49
|
+
children: /* @__PURE__ */ jsx(IconProvider, { icon: "ellipsis-vertical", size: 0.75 })
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
if (!tooltipTitle) {
|
|
55
|
+
return button;
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ jsx(TooltipComponent, { title: tooltipTitle, children: disabled ? /* @__PURE__ */ jsx("span", { className: "inline-flex cursor-not-allowed", children: button }) : button });
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
OverflowButton as default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=OverflowButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverflowButton.es.js","sources":["../../../src/components/atoms/OverflowButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { ControlButton, type ControlButtonProps } from './Button'\nimport IconProvider from './IconProvider'\nimport { DarkTooltip, LightTooltip } from './Tooltip'\n\nexport type OverflowButtonVariant = 'ghost' | 'secondary'\nexport type OverflowButtonSize = 'default' | 'md'\n\nconst controlSizeMap = {\n default: 'overflow',\n md: 'overflow-md',\n} as const satisfies Record<OverflowButtonSize, NonNullable<ControlButtonProps['size']>>\n\nexport type OverflowButtonProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick'> & {\n ref?: React.Ref<HTMLButtonElement>\n variant?: OverflowButtonVariant\n size?: OverflowButtonSize\n open?: boolean\n tooltip?: React.ReactNode\n disabledTooltip?: React.ReactNode\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n}\n\nfunction OverflowButton({\n ref,\n variant = 'ghost',\n size = 'default',\n open = false,\n disabled = false,\n tooltip = 'More actions',\n disabledTooltip,\n className,\n type = 'button',\n onClick,\n 'aria-label': ariaLabel,\n ...props\n}: OverflowButtonProps) {\n const tooltipTitle = disabled ? disabledTooltip ?? tooltip : tooltip\n const TooltipComponent = disabled ? LightTooltip : DarkTooltip\n const accessibleName = ariaLabel ?? (typeof tooltipTitle === 'string' ? tooltipTitle : 'More actions')\n\n const button = (\n <ControlButton\n ref={ref}\n type=\"text\"\n htmlType={type}\n variant={variant}\n size={controlSizeMap[size]}\n disabled={disabled}\n onClick={onClick}\n aria-label={accessibleName}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n data-open={open || undefined}\n data-selected={(open && variant === 'secondary') || undefined}\n className={className}\n {...props}\n >\n <span\n data-slot=\"button-icon\"\n data-icon=\"ellipsis-vertical\"\n className=\"inline-flex size-4 shrink-0 items-center justify-center\"\n >\n <IconProvider icon=\"ellipsis-vertical\" size={0.75} />\n </span>\n </ControlButton>\n )\n\n if (!tooltipTitle) {\n return button\n }\n\n return (\n <TooltipComponent title={tooltipTitle}>\n {disabled ? <span className=\"inline-flex cursor-not-allowed\">{button}</span> : button}\n </TooltipComponent>\n )\n}\n\nexport default OverflowButton\n"],"names":[],"mappings":";;;;AASA,MAAM,iBAAiB;AAAA,EACrB,SAAS;AAAA,EACT,IAAI;AACN;AAYA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAAwB;AACtB,QAAM,eAAe,WAAW,mBAAmB,UAAU;AAC7D,QAAM,mBAAmB,WAAW,eAAe;AACnD,QAAM,iBAAiB,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAEvF,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA,MAAM,eAAe,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA,cAAY;AAAA,MACZ,iBAAc;AAAA,MACd,iBAAe;AAAA,MACf,aAAW,QAAQ;AAAA,MACnB,iBAAgB,QAAQ,YAAY,eAAgB;AAAA,MACpD;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,UAAA,oBAAC,cAAA,EAAa,MAAK,qBAAoB,MAAM,KAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IACrD;AAAA,EAAA;AAIJ,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,kBAAA,EAAiB,OAAO,cACtB,UAAA,WAAW,oBAAC,QAAA,EAAK,WAAU,kCAAkC,UAAA,OAAA,CAAO,IAAU,QACjF;AAEJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { B as Button } from "../../Button-
|
|
3
|
+
import { B as Button } from "../../Button-DQboLdqL.js";
|
|
4
4
|
import { M as Modal } from "../../Modal-C4MUy9GD.js";
|
|
5
5
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
6
6
|
import { t as toDataTestId } from "../../conversions-CbWPvHRE.js";
|
|
7
|
-
import { I as Input } from "../../Input-
|
|
7
|
+
import { I as Input } from "../../Input-Bz1Ks8kH.js";
|
|
8
8
|
const Alert = ({
|
|
9
9
|
title,
|
|
10
10
|
message,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { b, a, C } from "../../Input-
|
|
3
|
+
import { b, a, C } from "../../Input-Bz1Ks8kH.js";
|
|
4
4
|
import "../theme/useTheme.es.js";
|
|
5
5
|
import "../../classNames-B1XpQHle.js";
|
|
6
|
-
import "../../Button-
|
|
6
|
+
import "../../Button-DQboLdqL.js";
|
|
7
7
|
import "../atoms/IconButton.es.js";
|
|
8
8
|
import "./Notify.es.js";
|
|
9
9
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback } from "react";
|
|
3
|
-
import { B as Button } from "../../Button-
|
|
3
|
+
import { B as Button } from "../../Button-DQboLdqL.js";
|
|
4
4
|
import IconButton from "../atoms/IconButton.es.js";
|
|
5
5
|
import { M as Modal } from "../../Modal-C4MUy9GD.js";
|
|
6
6
|
import Skeleton from "../atoms/Skeleton.es.js";
|
|
@@ -11,7 +11,7 @@ function lazyWithPreload(factory) {
|
|
|
11
11
|
Component.preload = factory;
|
|
12
12
|
return Component;
|
|
13
13
|
}
|
|
14
|
-
const Markdown = lazyWithPreload(() => import("../../Input-
|
|
14
|
+
const Markdown = lazyWithPreload(() => import("../../Input-Bz1Ks8kH.js").then((n) => n.c));
|
|
15
15
|
const MarkdownLazy = (props) => {
|
|
16
16
|
const { spinnerProps, ...restProps } = props;
|
|
17
17
|
const fallbackComponent = useMemo(() => /* @__PURE__ */ jsx(Spinner, { small: true, center: true, ...spinnerProps }), [spinnerProps]);
|
|
@@ -4,12 +4,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useRef, useEffect, useMemo, useContext, createContext, lazy, useState, useCallback, Suspense } from "react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
-
import { B as Button } from "../../Button-
|
|
7
|
+
import { B as Button } from "../../Button-DQboLdqL.js";
|
|
8
8
|
import Spinner from "../atoms/Spinner.es.js";
|
|
9
9
|
import { useTheme } from "../theme/useTheme.es.js";
|
|
10
10
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
11
11
|
import { t as toDataTestId } from "../../conversions-CbWPvHRE.js";
|
|
12
|
-
import { C as CopyField } from "../../Input-
|
|
12
|
+
import { C as CopyField } from "../../Input-Bz1Ks8kH.js";
|
|
13
13
|
import { CustomDrawerContext } from "./CustomDrawer.es.js";
|
|
14
14
|
import Dialog from "./Dialog.es.js";
|
|
15
15
|
import notify from "./Notify.es.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { c as cva } from "../../index-DSVg79g-.js";
|
|
4
|
-
import { B as Button } from "../../Button-
|
|
4
|
+
import { B as Button } from "../../Button-DQboLdqL.js";
|
|
5
5
|
import IconProvider from "../atoms/IconProvider.es.js";
|
|
6
6
|
import { D as DarkTooltip } from "../../Tooltip-BuGLP-PU.js";
|
|
7
7
|
import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
@@ -3,10 +3,10 @@ import { c as classNames } from "../../classNames-B1XpQHle.js";
|
|
|
3
3
|
import { t as toDataTestId } from "../../conversions-CbWPvHRE.js";
|
|
4
4
|
import IconProvider from "../atoms/IconProvider.es.js";
|
|
5
5
|
import Spinner from "../atoms/Spinner.es.js";
|
|
6
|
-
import { B as Button } from "../../Button-
|
|
6
|
+
import { B as Button } from "../../Button-DQboLdqL.js";
|
|
7
7
|
import IconButton from "../atoms/IconButton.es.js";
|
|
8
8
|
import OutlinedRadio from "../atoms/OutlinedRadio.es.js";
|
|
9
|
-
import { I as Input, M as Markdown } from "../../Input-
|
|
9
|
+
import { I as Input, M as Markdown } from "../../Input-Bz1Ks8kH.js";
|
|
10
10
|
import Badge from "../atoms/Badge.es.js";
|
|
11
11
|
import { default as default2 } from "./agent-chat/UserMessage.es.js";
|
|
12
12
|
import { default as default3 } from "./agent-chat/UserMessageEdit.es.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getNative, M as Map, r as root,
|
|
1
|
+
import { g as getNative, M as Map, r as root, h as isObject, o as overArg, i as isPrototype, j as isObjectLike, a as isArrayLike, b as baseGetTag, f as isArguments, d as isBuffer, e as isTypedArray, c as isArray, k as isFunction } from "../../isTypedArray-B4QxT_l4.js";
|
|
2
2
|
import { defaultTheme } from "./index.es.js";
|
|
3
3
|
function listCacheClear() {
|
|
4
4
|
this.__data__ = [];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, } from './components/atoms/Avatar';
|
|
2
2
|
export type { BadgeIconPosition, BadgeProps, BadgeSize, BadgeStatus, BadgeStyle } from './components/atoms/Badge';
|
|
3
3
|
export { default as Badge } from './components/atoms/Badge';
|
|
4
|
+
export type { LogoColor, LogoSize } from './components/atoms/Logo';
|
|
5
|
+
export { default as Logo } from './components/atoms/Logo';
|
|
4
6
|
export { default as OutlinedRadio } from './components/atoms/OutlinedRadio';
|
|
5
7
|
export type { ProgressCircleProps, ProgressCircleSize, ProgressFieldProps, ProgressFieldState, ProgressProps, ProgressSize, ProgressStepsProps, ProgressTone, } from './components/atoms/Progress';
|
|
6
8
|
export { default as Progress, ProgressCircle, ProgressField, ProgressSteps } from './components/atoms/Progress';
|