add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

26
node_modules/antd/es/avatar/Avatar.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import * as React from 'react';
import type { AvatarSize } from './AvatarContext';
export interface AvatarProps {
/** Shape of avatar, options: `circle`, `square` */
shape?: 'circle' | 'square';
size?: AvatarSize;
gap?: number;
/** Src of image avatar */
src?: React.ReactNode;
/** Srcset of image avatar */
srcSet?: string;
draggable?: boolean | 'true' | 'false';
/** Icon to be used in avatar */
icon?: React.ReactNode;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
rootClassName?: string;
children?: React.ReactNode;
alt?: string;
crossOrigin?: '' | 'anonymous' | 'use-credentials';
onClick?: (e?: React.MouseEvent<HTMLElement>) => void;
onError?: () => boolean;
}
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
export default Avatar;

166
node_modules/antd/es/avatar/Avatar.js generated vendored Normal file
View File

@@ -0,0 +1,166 @@
"use client";
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
import * as React from 'react';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import { composeRef } from "rc-util/es/ref";
import { responsiveArray } from '../_util/responsiveObserver';
import { devUseWarning } from '../_util/warning';
import { ConfigContext } from '../config-provider';
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
import useSize from '../config-provider/hooks/useSize';
import useBreakpoint from '../grid/hooks/useBreakpoint';
import AvatarContext from './AvatarContext';
import useStyle from './style';
const Avatar = /*#__PURE__*/React.forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
shape,
size: customSize,
src,
srcSet,
icon,
className,
rootClassName,
style,
alt,
draggable,
children,
crossOrigin,
gap = 4,
onError
} = props,
others = __rest(props, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "style", "alt", "draggable", "children", "crossOrigin", "gap", "onError"]);
const [scale, setScale] = React.useState(1);
const [mounted, setMounted] = React.useState(false);
const [isImgExist, setIsImgExist] = React.useState(true);
const avatarNodeRef = React.useRef(null);
const avatarChildrenRef = React.useRef(null);
const avatarNodeMergedRef = composeRef(ref, avatarNodeRef);
const {
getPrefixCls,
avatar
} = React.useContext(ConfigContext);
const avatarCtx = React.useContext(AvatarContext);
const setScaleParam = () => {
if (!avatarChildrenRef.current || !avatarNodeRef.current) {
return;
}
const childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale
const nodeWidth = avatarNodeRef.current.offsetWidth;
// denominator is 0 is no meaning
if (childrenWidth !== 0 && nodeWidth !== 0) {
if (gap * 2 < nodeWidth) {
setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
}
}
};
React.useEffect(() => {
setMounted(true);
}, []);
React.useEffect(() => {
setIsImgExist(true);
setScale(1);
}, [src]);
React.useEffect(setScaleParam, [gap]);
const handleImgLoadError = () => {
const errorFlag = onError === null || onError === void 0 ? void 0 : onError();
if (errorFlag !== false) {
setIsImgExist(false);
}
};
const size = useSize(ctxSize => {
var _a, _b;
return (_b = (_a = customSize !== null && customSize !== void 0 ? customSize : avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.size) !== null && _a !== void 0 ? _a : ctxSize) !== null && _b !== void 0 ? _b : 'default';
});
const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
const screens = useBreakpoint(needResponsive);
const responsiveSizeStyle = React.useMemo(() => {
if (typeof size !== 'object') {
return {};
}
const currentBreakpoint = responsiveArray.find(screen => screens[screen]);
const currentSize = size[currentBreakpoint];
return currentSize ? {
width: currentSize,
height: currentSize,
fontSize: currentSize && (icon || children) ? currentSize / 2 : 18
} : {};
}, [screens, size, icon, children]);
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Avatar');
process.env.NODE_ENV !== "production" ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : void 0;
}
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);
const sizeCls = classNames({
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-sm`]: size === 'small'
});
const hasImageElement = /*#__PURE__*/React.isValidElement(src);
const mergedShape = shape || (avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.shape) || 'circle';
const classString = classNames(prefixCls, sizeCls, avatar === null || avatar === void 0 ? void 0 : avatar.className, `${prefixCls}-${mergedShape}`, {
[`${prefixCls}-image`]: hasImageElement || src && isImgExist,
[`${prefixCls}-icon`]: !!icon
}, cssVarCls, rootCls, className, rootClassName, hashId);
const sizeStyle = typeof size === 'number' ? {
width: size,
height: size,
fontSize: icon ? size / 2 : 18
} : {};
let childrenToRender;
if (typeof src === 'string' && isImgExist) {
childrenToRender = /*#__PURE__*/React.createElement("img", {
src: src,
draggable: draggable,
srcSet: srcSet,
onError: handleImgLoadError,
alt: alt,
crossOrigin: crossOrigin
});
} else if (hasImageElement) {
childrenToRender = src;
} else if (icon) {
childrenToRender = icon;
} else if (mounted || scale !== 1) {
const transformString = `scale(${scale})`;
const childrenStyle = {
msTransform: transformString,
WebkitTransform: transformString,
transform: transformString
};
childrenToRender = /*#__PURE__*/React.createElement(ResizeObserver, {
onResize: setScaleParam
}, /*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-string`,
ref: avatarChildrenRef,
style: childrenStyle
}, children));
} else {
childrenToRender = /*#__PURE__*/React.createElement("span", {
className: `${prefixCls}-string`,
style: {
opacity: 0
},
ref: avatarChildrenRef
}, children);
}
return wrapCSSVar(/*#__PURE__*/React.createElement("span", Object.assign({}, others, {
style: Object.assign(Object.assign(Object.assign(Object.assign({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), style),
className: classString,
ref: avatarNodeMergedRef
}), childrenToRender));
});
if (process.env.NODE_ENV !== 'production') {
Avatar.displayName = 'Avatar';
}
export default Avatar;

9
node_modules/antd/es/avatar/AvatarContext.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import * as React from 'react';
import type { ScreenSizeMap } from '../_util/responsiveObserver';
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;
export interface AvatarContextType {
size?: AvatarSize;
shape?: 'circle' | 'square';
}
declare const AvatarContext: React.Context<AvatarContextType>;
export default AvatarContext;

3
node_modules/antd/es/avatar/AvatarContext.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import * as React from 'react';
const AvatarContext = /*#__PURE__*/React.createContext({});
export default AvatarContext;

27
node_modules/antd/es/avatar/AvatarGroup.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import * as React from 'react';
import type { PopoverProps } from '../popover';
import type { AvatarSize } from './AvatarContext';
export interface AvatarGroupProps {
className?: string;
rootClassName?: string;
children?: React.ReactNode;
style?: React.CSSProperties;
prefixCls?: string;
/** @deprecated Please use `max={{ count: number }}` */
maxCount?: number;
/** @deprecated Please use `max={{ style: CSSProperties }}` */
maxStyle?: React.CSSProperties;
/** @deprecated Please use `max={{ popover: PopoverProps }}` */
maxPopoverPlacement?: 'top' | 'bottom';
/** @deprecated Please use `max={{ popover: PopoverProps }}` */
maxPopoverTrigger?: 'hover' | 'focus' | 'click';
max?: {
count?: number;
style?: React.CSSProperties;
popover?: PopoverProps;
};
size?: AvatarSize;
shape?: 'circle' | 'square';
}
declare const AvatarGroup: React.FC<AvatarGroupProps>;
export default AvatarGroup;

103
node_modules/antd/es/avatar/AvatarGroup.js generated vendored Normal file
View File

@@ -0,0 +1,103 @@
"use client";
import * as React from 'react';
import classNames from 'classnames';
import toArray from "rc-util/es/Children/toArray";
import { cloneElement } from '../_util/reactNode';
import { devUseWarning } from '../_util/warning';
import { ConfigContext } from '../config-provider';
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
import Popover from '../popover';
import Avatar from './Avatar';
import AvatarContext from './AvatarContext';
import useStyle from './style';
const AvatarContextProvider = props => {
const {
size,
shape
} = React.useContext(AvatarContext);
const avatarContextValue = React.useMemo(() => ({
size: props.size || size,
shape: props.shape || shape
}), [props.size, props.shape, size, shape]);
return /*#__PURE__*/React.createElement(AvatarContext.Provider, {
value: avatarContextValue
}, props.children);
};
const AvatarGroup = props => {
var _a, _b, _c, _d;
const {
getPrefixCls,
direction
} = React.useContext(ConfigContext);
const {
prefixCls: customizePrefixCls,
className,
rootClassName,
style,
maxCount,
maxStyle,
size,
shape,
maxPopoverPlacement,
maxPopoverTrigger,
children,
max
} = props;
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Avatar.Group');
[['maxCount', 'max={{ count: number }}'], ['maxStyle', 'max={{ style: CSSProperties }}'], ['maxPopoverPlacement', 'max={{ popover: PopoverProps }}'], ['maxPopoverTrigger', 'max={{ popover: PopoverProps }}']].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const rootCls = useCSSVarCls(prefixCls);
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);
const cls = classNames(groupPrefixCls, {
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
}, cssVarCls, rootCls, className, rootClassName, hashId);
const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {
// eslint-disable-next-line react/no-array-index-key
key: `avatar-key-${index}`
}));
const mergeCount = (max === null || max === void 0 ? void 0 : max.count) || maxCount;
const numOfChildren = childrenWithProps.length;
if (mergeCount && mergeCount < numOfChildren) {
const childrenShow = childrenWithProps.slice(0, mergeCount);
const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);
const mergeStyle = (max === null || max === void 0 ? void 0 : max.style) || maxStyle;
const mergePopoverTrigger = ((_a = max === null || max === void 0 ? void 0 : max.popover) === null || _a === void 0 ? void 0 : _a.trigger) || maxPopoverTrigger || 'hover';
const mergePopoverPlacement = ((_b = max === null || max === void 0 ? void 0 : max.popover) === null || _b === void 0 ? void 0 : _b.placement) || maxPopoverPlacement || 'top';
const mergeProps = Object.assign(Object.assign({
content: childrenHidden
}, max === null || max === void 0 ? void 0 : max.popover), {
classNames: {
root: classNames(`${groupPrefixCls}-popover`, (_d = (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.classNames) === null || _d === void 0 ? void 0 : _d.root)
},
placement: mergePopoverPlacement,
trigger: mergePopoverTrigger
});
childrenShow.push(/*#__PURE__*/React.createElement(Popover, Object.assign({
key: "avatar-popover-key",
destroyOnHidden: true
}, mergeProps), /*#__PURE__*/React.createElement(Avatar, {
style: mergeStyle
}, `+${numOfChildren - mergeCount}`)));
return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {
shape: shape,
size: size
}, /*#__PURE__*/React.createElement("div", {
className: cls,
style: style
}, childrenShow)));
}
return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {
shape: shape,
size: size
}, /*#__PURE__*/React.createElement("div", {
className: cls,
style: style
}, childrenWithProps)));
};
export default AvatarGroup;

11
node_modules/antd/es/avatar/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import InternalAvatar from './Avatar';
import type { AvatarGroupProps } from './AvatarGroup';
import AvatarGroup from './AvatarGroup';
export type { AvatarProps } from './Avatar';
/** @deprecated Please use `AvatarGroupProps` */
export type GroupProps = AvatarGroupProps;
type CompoundedComponent = typeof InternalAvatar & {
Group: typeof AvatarGroup;
};
declare const Avatar: CompoundedComponent;
export default Avatar;

7
node_modules/antd/es/avatar/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use client";
import InternalAvatar from './Avatar';
import AvatarGroup from './AvatarGroup';
const Avatar = InternalAvatar;
Avatar.Group = AvatarGroup;
export default Avatar;

66
node_modules/antd/es/avatar/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,66 @@
import type { GetDefaultToken } from '../../theme/internal';
export interface ComponentToken {
/**
* @desc 头像尺寸
* @descEN Size of Avatar
*/
containerSize: number;
/**
* @desc 大号头像尺寸
* @descEN Size of large Avatar
*/
containerSizeLG: number;
/**
* @desc 小号头像尺寸
* @descEN Size of small Avatar
*/
containerSizeSM: number;
/**
* @desc 头像文字大小
* @descEN Font size of Avatar
*/
textFontSize: number;
/**
* @desc 大号头像文字大小
* @descEN Font size of large Avatar
*/
textFontSizeLG: number;
/**
* @desc 小号头像文字大小
* @descEN Font size of small Avatar
*/
textFontSizeSM: number;
/**
* @desc 头像图标大小
* @descEN Font size of Avatar icon
*/
iconFontSize: number;
/**
* @desc 大号头像图标大小
* @descEN Font size of large Avatar icon
*/
iconFontSizeLG: number;
/**
* @desc 小号头像图标大小
* @descEN Font size of small Avatar icon
*/
iconFontSizeSM: number;
/**
* @desc 头像组间距
* @descEN Spacing between avatars in a group
*/
groupSpace: number;
/**
* @desc 头像组重叠宽度
* @descEN Overlapping of avatars in a group
*/
groupOverlapping: number;
/**
* @desc 头像组边框颜色
* @descEN Border color of avatars in a group
*/
groupBorderColor: string;
}
export declare const prepareComponentToken: GetDefaultToken<'Avatar'>;
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
export default _default;

135
node_modules/antd/es/avatar/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,135 @@
import { unit } from '@ant-design/cssinjs';
import { resetComponent } from '../../style';
import { genStyleHooks, mergeToken } from '../../theme/internal';
const genBaseStyle = token => {
const {
antCls,
componentCls,
iconCls,
avatarBg,
avatarColor,
containerSize,
containerSizeLG,
containerSizeSM,
textFontSize,
textFontSizeLG,
textFontSizeSM,
iconFontSize,
iconFontSizeLG,
iconFontSizeSM,
borderRadius,
borderRadiusLG,
borderRadiusSM,
lineWidth,
lineType
} = token;
// Avatar size style
const avatarSizeStyle = (size, fontSize, iconFontSize, radius) => ({
width: size,
height: size,
borderRadius: '50%',
fontSize,
[`&${componentCls}-square`]: {
borderRadius: radius
},
[`&${componentCls}-icon`]: {
fontSize: iconFontSize,
[`> ${iconCls}`]: {
margin: 0
}
}
});
return {
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {
position: 'relative',
display: 'inline-flex',
justifyContent: 'center',
alignItems: 'center',
overflow: 'hidden',
color: avatarColor,
whiteSpace: 'nowrap',
textAlign: 'center',
verticalAlign: 'middle',
background: avatarBg,
border: `${unit(lineWidth)} ${lineType} transparent`,
'&-image': {
background: 'transparent'
},
[`${antCls}-image-img`]: {
display: 'block'
}
}), avatarSizeStyle(containerSize, textFontSize, iconFontSize, borderRadius)), {
'&-lg': Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, iconFontSizeLG, borderRadiusLG)),
'&-sm': Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, iconFontSizeSM, borderRadiusSM)),
'> img': {
display: 'block',
width: '100%',
height: '100%',
objectFit: 'cover'
}
})
};
};
const genGroupStyle = token => {
const {
componentCls,
groupBorderColor,
groupOverlapping,
groupSpace
} = token;
return {
[`${componentCls}-group`]: {
display: 'inline-flex',
[componentCls]: {
borderColor: groupBorderColor
},
'> *:not(:first-child)': {
marginInlineStart: groupOverlapping
}
},
[`${componentCls}-group-popover`]: {
[`${componentCls} + ${componentCls}`]: {
marginInlineStart: groupSpace
}
}
};
};
export const prepareComponentToken = token => {
const {
controlHeight,
controlHeightLG,
controlHeightSM,
fontSize,
fontSizeLG,
fontSizeXL,
fontSizeHeading3,
marginXS,
marginXXS,
colorBorderBg
} = token;
return {
containerSize: controlHeight,
containerSizeLG: controlHeightLG,
containerSizeSM: controlHeightSM,
textFontSize: fontSize,
textFontSizeLG: fontSize,
textFontSizeSM: fontSize,
iconFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),
iconFontSizeLG: fontSizeHeading3,
iconFontSizeSM: fontSize,
groupSpace: marginXXS,
groupOverlapping: -marginXS,
groupBorderColor: colorBorderBg
};
};
export default genStyleHooks('Avatar', token => {
const {
colorTextLightSolid,
colorTextPlaceholder
} = token;
const avatarToken = mergeToken(token, {
avatarBg: colorTextPlaceholder,
avatarColor: colorTextLightSolid
});
return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];
}, prepareComponentToken);