tfy-web-components 0.0.35 → 0.0.36
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/components/atoms/IconProvider.d.ts +4 -1
- package/dist/components/atoms/IconProvider.es.js +23 -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/index.d.ts +2 -0
- package/dist/index.es.js +18 -16
- package/dist/index.es.js.map +1 -1
- 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
|
@@ -11,12 +11,14 @@ type CustomIconMap = {
|
|
|
11
11
|
};
|
|
12
12
|
export 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, 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,7 +19,9 @@ library.add(
|
|
|
19
19
|
faChevronDown,
|
|
20
20
|
faChevronLeft,
|
|
21
21
|
faChevronRight,
|
|
22
|
+
faCircleQuestion,
|
|
22
23
|
faCircleXmark,
|
|
24
|
+
faCompressAlt,
|
|
23
25
|
faDownload,
|
|
24
26
|
faPause,
|
|
25
27
|
faPlay,
|
|
@@ -33,6 +35,7 @@ library.add(
|
|
|
33
35
|
faRotateRight,
|
|
34
36
|
faServer,
|
|
35
37
|
faTerminal,
|
|
38
|
+
faTriangleExclamation,
|
|
36
39
|
faUpDown,
|
|
37
40
|
faWrench,
|
|
38
41
|
faGlobe,
|
|
@@ -69,7 +72,9 @@ const FA_ICON_ALIAS_MAP = {
|
|
|
69
72
|
download: "download",
|
|
70
73
|
play: "play",
|
|
71
74
|
pause: "pause",
|
|
72
|
-
spinner: "spinner"
|
|
75
|
+
spinner: "spinner",
|
|
76
|
+
"fa-warning": "triangle-exclamation",
|
|
77
|
+
"compress-alt": "down-left-and-up-right-to-center"
|
|
73
78
|
};
|
|
74
79
|
registerIcons({
|
|
75
80
|
agents: SvgAgents,
|
|
@@ -81,6 +86,7 @@ registerIcons({
|
|
|
81
86
|
registerImgIcons({
|
|
82
87
|
logo
|
|
83
88
|
});
|
|
89
|
+
const ICON_SIZE_REM = { "12": 0.75, "16": 1, "24": 1.5 };
|
|
84
90
|
const DynamicIcon = ({ name, ...props }) => {
|
|
85
91
|
const IconToRender = CUSTOM_ICONS_MAP[name];
|
|
86
92
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", {}), children: /* @__PURE__ */ jsx(IconToRender, { ...props }) });
|
|
@@ -128,13 +134,16 @@ const IconProvider = ({
|
|
|
128
134
|
fallbackImgIcon = IMG_ICONS_MAP[icon[1]];
|
|
129
135
|
}
|
|
130
136
|
const faIcon = FA_ICON_ALIAS_MAP[icon] || icon;
|
|
131
|
-
const
|
|
137
|
+
const sizeRem = typeof size === "string" && size in ICON_SIZE_REM ? ICON_SIZE_REM[size] : typeof size === "number" ? size : 0.75;
|
|
138
|
+
const iconStyles = width ? { width: `${width}rem`, height: "auto" } : { height: `${sizeRem}rem`, width: "auto" };
|
|
132
139
|
const imgSrc = failedSrc === themeAwareImgIcon && fallbackImgIcon && fallbackImgIcon !== themeAwareImgIcon ? fallbackImgIcon : themeAwareImgIcon;
|
|
133
140
|
return themeAwareImgIcon ? /* @__PURE__ */ jsx(
|
|
134
141
|
"img",
|
|
135
142
|
{
|
|
136
143
|
ref: forwardedRef,
|
|
137
144
|
src: imgSrc ?? void 0,
|
|
145
|
+
alt: "",
|
|
146
|
+
"aria-hidden": true,
|
|
138
147
|
style: iconStyles,
|
|
139
148
|
className: classNames(className),
|
|
140
149
|
onClick,
|
|
@@ -144,12 +153,21 @@ const IconProvider = ({
|
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
}
|
|
147
|
-
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(
|
|
156
|
+
) : CUSTOM_ICONS_MAP[icon] ? /* @__PURE__ */ jsx(
|
|
157
|
+
DynamicIcon,
|
|
158
|
+
{
|
|
159
|
+
onClick,
|
|
160
|
+
style: { ...iconStyles, color },
|
|
161
|
+
name: String(icon),
|
|
162
|
+
className,
|
|
163
|
+
"aria-hidden": true
|
|
164
|
+
}
|
|
165
|
+
) : /* @__PURE__ */ jsx(
|
|
148
166
|
FontAwesomeIcon,
|
|
149
167
|
{
|
|
150
168
|
ref: forwardedRef,
|
|
151
169
|
icon: faIcon,
|
|
152
|
-
style: { color, fontSize: `${width ??
|
|
170
|
+
style: { color, fontSize: `${width ?? sizeRem}rem` },
|
|
153
171
|
className: classNames("text-xs", className),
|
|
154
172
|
onClick,
|
|
155
173
|
...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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rG,QAAM,SACJ,cAAc,qBAAqB,mBAAmB,oBAAoB,oBACtE,kBACA;AAEN,SAAO,oBACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,KAAK,UAAU;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
|
+
{"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 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 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,OAAO,GAAG,MAAK,GAAoB,sBAAM,cAAc,QAAQ,EAAE,GAAG,sCAAsC,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,QAAQ,EAAE,GAAG,wBAAwB,QAAQ,gBAAgB,aAAa,KAAK,eAAe,QAAO,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,GAAmB,sBAAM,cAAc,UAAU,EAAE,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,QAAQ,gBAAgB,aAAa,IAAG,CAAE,CAAC;ACA/rB,MAAM,gBAAgB,CAAC,UAA0B,sBAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,aAAa,MAAM,gBAAgB,OAAO,OAAO,QAAQ,OAAO,GAAG,MAAK,GAAoB,sBAAM,cAAc,QAAQ,EAAE,GAAG,sDAAsD,QAAQ,gBAAgB,aAAa,KAAK,gBAAgB,SAAS,GAAmB,sBAAM,cAAc,QAAQ,EAAE,GAAG,2BAA2B,QAAQ,gBAAgB,aAAa,KAAK,eAAe,SAAS,gBAAgB,QAAO,CAAE,CAAC;ACD7hB,MAAA,OA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AAO,IAAI;AAAA,MACjB;AAAA,MACA,eAAW;AAAA,IAAA;AAAA,EAAA,IAGb;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,UAAU,GAAG,SAAS,OAAO,MAAA;AAAA,MAC7C,WAAW,WAAW,WAAW,SAAS;AAAA,MAC1C;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAA,iBAAeC,eAAM;AAAA,EACnB,WAAmC,CAAC,OAAO,QAAQ,oBAAC,gBAAc,GAAG,OAAO,cAAc,KAAK,CAAE;AACnG;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
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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AAAA,MAEnF,UAAA,oBAAC,gBAAa,MAAY,MAAM,cAAc,YAAY,GAAG,WAAU,wBAAA,CAAwB;AAAA,IAAA;AAAA,EAAA;AAGrG;"}
|
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';
|
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "./components/atoms/Avatar.es.js";
|
|
2
2
|
import { default as default2 } from "./components/atoms/Badge.es.js";
|
|
3
|
-
import { default as default3 } from "./components/atoms/
|
|
3
|
+
import { default as default3 } from "./components/atoms/Logo.es.js";
|
|
4
|
+
import { default as default4 } from "./components/atoms/OutlinedRadio.es.js";
|
|
4
5
|
import { Progress, ProgressCircle, ProgressField, ProgressSteps } from "./components/atoms/Progress.es.js";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
6
|
+
import { default as default5, SpinnerMark } from "./components/atoms/Spinner.es.js";
|
|
7
|
+
import { default as default6 } from "./components/molecules/CustomDrawer.es.js";
|
|
8
|
+
import { default as default7 } from "./new-components/atoms/Checkbox.es.js";
|
|
9
|
+
import { default as default8 } from "./new-components/atoms/Chip.es.js";
|
|
9
10
|
import { P, a, b, c, d, e, f, g, h, i, j } from "./Popover-eC_vX5By.js";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
11
|
+
import { default as default9, RadioGroup } from "./new-components/atoms/Radio.es.js";
|
|
12
|
+
import { default as default10, SegmentedControlItem } from "./new-components/atoms/SegmentedControl.es.js";
|
|
13
|
+
import { default as default11 } from "./new-components/atoms/Slider.es.js";
|
|
13
14
|
import { Toggletip, ToggletipActions, ToggletipCode, ToggletipContent, ToggletipDescription, ToggletipHeader, ToggletipInlineCode, ToggletipLink, ToggletipRoot, ToggletipRow, ToggletipRows, ToggletipTitle, ToggletipTrigger } from "./new-components/atoms/Toggletip.es.js";
|
|
14
15
|
export {
|
|
15
16
|
Avatar,
|
|
@@ -19,10 +20,11 @@ export {
|
|
|
19
20
|
AvatarGroupCount,
|
|
20
21
|
AvatarImage,
|
|
21
22
|
default2 as Badge,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
default3 as
|
|
23
|
+
default7 as Checkbox,
|
|
24
|
+
default8 as Chip,
|
|
25
|
+
default6 as CustomDrawer,
|
|
26
|
+
default3 as Logo,
|
|
27
|
+
default4 as OutlinedRadio,
|
|
26
28
|
P as Popover,
|
|
27
29
|
a as PopoverArrow,
|
|
28
30
|
b as PopoverBody,
|
|
@@ -38,12 +40,12 @@ export {
|
|
|
38
40
|
ProgressCircle,
|
|
39
41
|
ProgressField,
|
|
40
42
|
ProgressSteps,
|
|
41
|
-
|
|
43
|
+
default9 as Radio,
|
|
42
44
|
RadioGroup,
|
|
43
|
-
|
|
45
|
+
default10 as SegmentedControl,
|
|
44
46
|
SegmentedControlItem,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
default11 as Slider,
|
|
48
|
+
default5 as Spinner,
|
|
47
49
|
SpinnerMark,
|
|
48
50
|
Toggletip,
|
|
49
51
|
ToggletipActions,
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|