repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/DemoContext.ts | .dumi/theme/slots/DemoContext.ts | import { createContext } from 'react';
export type DemoContextProps = {
showDebug?: boolean;
codeType?: string;
};
const DemoContext = createContext<{
showDebug?: boolean;
setShowDebug?: (showDebug: boolean) => void;
codeType?: string;
setCodeType?: (codeType: string) => void;
}>({});
export default Demo... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/SiteContext.ts | .dumi/theme/slots/SiteContext.ts | import * as React from 'react';
import type { DirectionType } from 'antd/es/config-provider';
import type { ConfigComponentProps } from '../../../components/config-provider/context';
import { getBannerData } from '../../pages/index/components/util';
import type { ThemeName } from '../common/ThemeSwitch';
export type ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Footer/AdditionalInfo.tsx | .dumi/theme/slots/Footer/AdditionalInfo.tsx | import * as React from 'react';
import { removeCSS, updateCSS } from '@rc-component/util/lib/Dom/dynamicCSS';
import { createStyles } from 'antd-style';
import useLocale from '../../../hooks/useLocale';
const whereCls = 'ant-where-checker';
const locales = {
cn: {
whereNotSupport: `你的浏览器不支持现代 CSS Selector,请使用现... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Footer/index.tsx | .dumi/theme/slots/Footer/index.tsx | import React from 'react';
import { FastColor } from '@ant-design/fast-color';
import {
AntDesignOutlined,
BgColorsOutlined,
BugOutlined,
GithubOutlined,
HistoryOutlined,
IssuesCloseOutlined,
MediumOutlined,
MessageOutlined,
QuestionCircleOutlined,
UsergroupAddOutlined,
XOutlined,
ZhihuOutlined,... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/ContentTabs/index.tsx | .dumi/theme/slots/ContentTabs/index.tsx | import type { FC, ReactNode } from 'react';
import React from 'react';
import { CodeOutlined, SkinOutlined } from '@ant-design/icons';
import { Tabs } from 'antd';
import { useRouteMeta } from 'dumi';
import type { IContentTabsProps } from 'dumi/theme-default/slots/ContentTabs';
import type { TabsProps } from '@rc-comp... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/LiveError/index.tsx | .dumi/theme/slots/LiveError/index.tsx | import type { FC } from 'react';
import React from 'react';
import { Alert, theme } from 'antd';
const LiveError: FC<{ error: Error | null }> = ({ error }) => {
const { token } = theme.useToken();
return error ? (
<Alert banner type="error" message={error.toString()} style={{ color: token.colorError }} />
)... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Header/Navigation.tsx | .dumi/theme/slots/Header/Navigation.tsx | import * as React from 'react';
import { MenuOutlined } from '@ant-design/icons';
import type { MenuProps } from 'antd';
import { ConfigProvider, Menu } from 'antd';
import { createStyles } from 'antd-style';
import { FormattedMessage, useFullSidebarData, useLocation } from 'dumi';
import useLocale from '../../../hook... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Header/Logo.tsx | .dumi/theme/slots/Header/Logo.tsx | import * as React from 'react';
import { createStyles } from 'antd-style';
import { useLocation } from 'dumi';
import Link from '../../common/Link';
import * as utils from '../../utils';
const useStyle = createStyles(({ cssVar, token, css }) => {
const { headerHeight, mobileMaxWidth } = token;
const { colorTextHe... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Header/SwitchBtn.tsx | .dumi/theme/slots/Header/SwitchBtn.tsx | import React from 'react';
import { omit } from '@rc-component/util';
import { Button, Tooltip } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
export interface SwitchBtnProps {
label1: React.ReactNode;
label2: React.ReactNode;
tooltip1?: React.ReactNode;
tooltip2?: React.... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Header/interface.ts | .dumi/theme/slots/Header/interface.ts | export interface SharedProps {
isZhCN: boolean;
isRTL: boolean;
}
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Header/index.tsx | .dumi/theme/slots/Header/index.tsx | import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { GithubOutlined, MenuOutlined } from '@ant-design/icons';
import { Alert, Button, Col, ConfigProvider, Popover, Row, Select, Tooltip } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import day... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/ContributorAvatar.tsx | .dumi/theme/slots/Content/ContributorAvatar.tsx | import React from 'react';
import type { AvatarListItem } from '@qixian.cs/github-contributors-list/dist/AvatarList';
import { Avatar, Tooltip } from 'antd';
interface ContributorAvatarProps {
loading?: boolean;
item?: AvatarListItem;
}
const ContributorAvatar: React.FC<ContributorAvatarProps> = (props) => {
co... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/Contributors.tsx | .dumi/theme/slots/Content/Contributors.tsx | import React, { Suspense } from 'react';
import ContributorsList from '@qixian.cs/github-contributors-list';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import { useIntl } from 'dumi';
import SiteContext from '../SiteContext';
import ContributorAvatar from './ContributorAvatar';
const useS... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/index.tsx | .dumi/theme/slots/Content/index.tsx | import React, { Suspense, useLayoutEffect, useMemo, useState } from 'react';
import { Col, Flex, FloatButton, Skeleton, Space, Typography } from 'antd';
import { clsx } from 'clsx';
import { FormattedMessage, useRouteMeta } from 'dumi';
import useLayoutState from '../../../hooks/useLayoutState';
import useLocation fro... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/DocMeta.tsx | .dumi/theme/slots/Content/DocMeta.tsx | import React, { useLayoutEffect, useMemo, useState } from 'react';
import { CalendarOutlined } from '@ant-design/icons';
import { Avatar, Flex, Skeleton, Typography } from 'antd';
import dayjs from 'dayjs';
import { useRouteMeta } from 'dumi';
interface AuthorAvatarPoprs {
name: string;
avatar: string;
}
const Au... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/ColumnCard.tsx | .dumi/theme/slots/Content/ColumnCard.tsx | import React from 'react';
import { RightOutlined, YuqueOutlined, ZhihuOutlined } from '@ant-design/icons';
import { Button, Card, Divider } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import useLocale from '../../../hooks/useLocale';
import JuejinIcon from '../../../theme/icon... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Content/DocAnchor.tsx | .dumi/theme/slots/Content/DocAnchor.tsx | import React from 'react';
import { Anchor } from 'antd';
import { createStyles, useTheme } from 'antd-style';
import type { AnchorLinkItemProps } from 'antd/es/anchor/Anchor';
import { clsx } from 'clsx';
import { useRouteMeta, useTabMeta } from 'dumi';
export const useStyle = createStyles(({ cssVar, token, css }) =>... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/slots/Sidebar/index.tsx | .dumi/theme/slots/Sidebar/index.tsx | import React, { useEffect } from 'react';
import MobileMenu from '@rc-component/drawer';
import { Col, ConfigProvider, Menu } from 'antd';
import { createStyles, useTheme } from 'antd-style';
import { useSidebarData } from 'dumi';
import useMenu from '../../../hooks/useMenu';
import SiteContext from '../SiteContext';
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/CodePenIcon.tsx | .dumi/theme/icons/CodePenIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
const SVGIcon: React.FC = () => (
<svg viewBox="0 0 15 15" fill="currentColor">
<title>codepen icon</title>
<path d="M14.777304,4.75062256 L7.77734505,0.0839936563 C7.60939924,-0.0279665065 7.39060662,-0.0279665065 7.22266081,0.0839936563 L0.22... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/DirectionIcon.tsx | .dumi/theme/icons/DirectionIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
import type { DirectionType } from 'antd/es/config-provider';
interface SvgIconProps {
className?: string;
style?: React.CSSProperties;
ref?: React.Ref<HTMLSpanElement>;
direction?: DirectionType;
}
const DirectionSvg: React.FC<SvgIconProps> = (... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/JuejinIcon.tsx | .dumi/theme/icons/JuejinIcon.tsx | import React from 'react';
const JuejinIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="36" height="28" viewBox="0 0 36 28" fill="currentColor" {...props}>
<title>Juejin logo</title>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M17.5875 6.77268L21.8232 3.40505L17.5... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/ExternalLinkIcon.tsx | .dumi/theme/icons/ExternalLinkIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
interface SvgIconProps {
className?: string;
style?: React.CSSProperties;
ref?: React.Ref<HTMLSpanElement>;
color?: string;
}
const SVGIcon: React.FC<SvgIconProps> = ({ color = 'currentColor' }) => (
<svg viewBox="0 0 1024 1024" width="1em" he... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/ExpandIcon.tsx | .dumi/theme/icons/ExpandIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
interface SvgIconProps {
className?: string;
style?: React.CSSProperties;
ref?: React.Ref<HTMLSpanElement>;
expanded?: boolean;
}
const SVGIcon: React.FC<SvgIconProps> = ({ expanded }) => (
<svg viewBox="0 0 1024 1024" width="1em" height="1em"... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/HituIcon.tsx | .dumi/theme/icons/HituIcon.tsx | import React from 'react';
const HituIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg viewBox="0 0 399.58 443.63" fill="currentColor" {...props}>
<title>Hitu Icon</title>
<path
fill="currentColor"
d="M285.8,36c12.14,0,25.97,3,39.81,12.22,0,0,28.61,21.08,6.78,62.12,0,0-6.78,15.81... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/icons/CodeSandboxIcon.tsx | .dumi/theme/icons/CodeSandboxIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
const SVGIcon: React.FC = () => (
<svg viewBox="0 0 1024 1024" fill="currentColor">
<title>CodeSandbox Icon</title>
<path d="M755 140.3l0.5-0.3h0.3L512 0 268.3 140h-0.3l0.8 0.4L68.6 256v512L512 1024l443.4-256V256L755 140.3z m-30 506.4v171.2L548... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/utils/renderReactToHTML.tsx | .dumi/theme/utils/renderReactToHTML.tsx | import type React from 'react';
import { flushSync } from 'react-dom';
import { createRoot } from 'react-dom/client';
// 这个方法是将 React 组件转换为 HTML 字符串,作用和 renderToString API 一样
// 根据 React 官方文档的解释,不建议在客户端使用 renderToString API,所以这里使用 createRoot + innerHTML 的方式来实现
// https://zh-hans.react.dev/reference/react-dom/server/re... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/utils/index.ts | .dumi/theme/utils/index.ts | import flatten from 'lodash/flatten';
import flattenDeep from 'lodash/flattenDeep';
import semver from 'semver';
import deprecatedVersions from '../../../BUG_VERSIONS.json';
import themeConfig from '../themeConfig';
interface Meta {
skip?: boolean;
category?: any;
type?: any;
title?: any;
subtitle?: string;... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/utils/tsToJs.ts | .dumi/theme/utils/tsToJs.ts | import prettierSync from '@prettier/sync';
import * as ts from 'typescript';
/**
* 将 TypeScript 代码(含 TSX)转换为 JavaScript 代码(含 JSX)。
*
* 使用 TypeScript 编译器 API 移除类型注解和类型导入,保留 JSX 语法和注释,并将代码转换为 JavaScript。转换结果会通过 Prettier 进行格式化,提升可读性。适用于文档示例、代码展示等场景。
*
* @param tsCode - 输入的 TypeScript 代码字符串。
* @returns 转换并格式化后的 Java... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Markers.tsx | .dumi/theme/common/Markers.tsx | import * as React from 'react';
import isVisible from '@rc-component/util/lib/Dom/isVisible';
import Marker from './Marker';
export interface MarkersProps {
targetClassName: string | null;
containerRef: React.RefObject<HTMLDivElement | null>;
}
interface RectType {
left: number;
top: number;
width: number;... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/PrevAndNext.tsx | .dumi/theme/common/PrevAndNext.tsx | import type { ReactElement } from 'react';
import React, { useMemo } from 'react';
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
import type { GetProp, MenuProps } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import useMenu from '../../hooks/useMenu';
import S... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/SelectSemanticTemplate.tsx | .dumi/theme/common/SelectSemanticTemplate.tsx | import React from 'react';
import { Flex, Segmented } from 'antd';
import useLocale from '../../hooks/useLocale';
import SemanticPreview from './SemanticPreview';
export const locales = {
cn: {
root: '根元素,包含相对定位、行内 flex 布局、光标样式、过渡动画、边框等选择器容器的基础样式',
prefix: '前缀元素,包含前缀内容的布局和样式',
suffix: '后缀元素,包含后缀内容的布局和样式... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/SemanticPreview.tsx | .dumi/theme/common/SemanticPreview.tsx | import React from 'react';
import { InfoCircleOutlined, PushpinOutlined } from '@ant-design/icons';
import { get, set } from '@rc-component/util';
import { Button, Col, ConfigProvider, Flex, Popover, Row, Tag, theme, Typography } from 'antd';
import { createStyles, css } from 'antd-style';
import { clsx } from 'clsx';
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ClientOnly.tsx | .dumi/theme/common/ClientOnly.tsx | import type React from 'react';
import { useLayoutEffect, useState } from 'react';
const ClientOnly: React.FC<React.PropsWithChildren> = ({ children }) => {
const [clientReady, setClientReady] = useState<boolean>(false);
useLayoutEffect(() => {
setClientReady(true);
}, []);
return clientReady ? (children... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Link.tsx | .dumi/theme/common/Link.tsx | import type { MouseEvent, MouseEventHandler } from 'react';
import React, { useMemo } from 'react';
import { Link as DumiLink, useAppData, useLocation, useNavigate } from 'dumi';
export interface LinkProps {
to: string | { pathname?: string; search?: string; hash?: string };
style?: React.CSSProperties;
classNam... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/GlobalStyles.tsx | .dumi/theme/common/GlobalStyles.tsx | import React from 'react';
import ColorStyle from './Color/ColorStyle';
import {
Common,
Demo,
HeadingAnchor,
Highlight,
Markdown,
NProgress,
PreviewImage,
Reset,
Responsive,
SearchBar,
} from './styles';
import InlineCard from './styles/InlineCard';
const GlobalStyles: React.FC = () => (
<>
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/CommonHelmet.tsx | .dumi/theme/common/CommonHelmet.tsx | import React from 'react';
import { Helmet, useRouteMeta } from 'dumi';
const CommonHelmet: React.FC = () => {
const meta = useRouteMeta();
const [title, description] = React.useMemo<[string, string]>(() => {
let helmetTitle: string;
if (!meta.frontmatter.subtitle && !meta.frontmatter.title) {
helme... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BrowserFrame.tsx | .dumi/theme/common/BrowserFrame.tsx | import React from 'react';
import { createStyles } from 'antd-style';
const useStyle = createStyles(({ cssVar, css }) => ({
browserMockup: css`
position: relative;
border-top: 2em solid rgba(230, 230, 230, 0.7);
border-radius: ${cssVar.borderRadiusSM} ${cssVar.borderRadiusSM} 0 0;
box-shadow: 0 0.1em... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/TreeSelectSemanticTemplate.tsx | .dumi/theme/common/TreeSelectSemanticTemplate.tsx | import React from 'react';
import { Flex, Segmented } from 'antd';
import useLocale from '../../hooks/useLocale';
import SemanticPreview from './SemanticPreview';
export const locales = {
cn: {
root: '根元素,设置树选择器的基础样式、边框、圆角容器样式',
prefix: '前缀元素,设置前缀内容的布局和样式',
input: '输入框元素,设置文本输入、搜索、选择值显示等输入框的核心交互样式',
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Marker.tsx | .dumi/theme/common/Marker.tsx | import * as React from 'react';
import { createStyles, css } from 'antd-style';
import { clsx } from 'clsx';
const useStyle = createStyles(({ cssVar, cx }) => {
const duration = cssVar.motionDurationSlow;
const marker = css`
--mark-border-size: 1px;
position: absolute;
border: var(--mark-border-size) ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Loading.tsx | .dumi/theme/common/Loading.tsx | import React from 'react';
import { StyleProvider } from '@ant-design/cssinjs';
import { ConfigProvider, Flex, Skeleton, Spin } from 'antd';
import { createStyles } from 'antd-style';
import { useLocation } from 'dumi';
import { Common } from './styles';
const useStyle = createStyles(({ css, cssVar }) => {
return {... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/EditButton.tsx | .dumi/theme/common/EditButton.tsx | import React from 'react';
import { EditOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import { createStyles } from 'antd-style';
const branchUrl = 'https://github.com/ant-design/ant-design/edit/master/';
export interface EditButtonProps {
title: React.ReactNode;
filename?: string;
}
const ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/LinkButton.tsx | .dumi/theme/common/LinkButton.tsx | import React from 'react';
import { Button } from 'antd';
import type { ButtonProps } from 'antd';
import Link from './Link';
import type { LinkProps } from './Link';
type LinkButtonProps = LinkProps &
Readonly<React.PropsWithChildren<Pick<ButtonProps, 'type' | 'size'>>>;
const LinkButton: React.FC<LinkButtonProps>... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/CodePreview.tsx | .dumi/theme/common/CodePreview.tsx | import type { ComponentProps } from 'react';
import React, { useEffect, useMemo } from 'react';
import { Tabs, Typography } from 'antd';
import { createStyles } from 'antd-style';
import toReactElement from 'jsonml-to-react-element';
import JsonML from 'jsonml.js/lib/utils';
import Prism from 'prismjs';
import DemoCon... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Helmet.tsx | .dumi/theme/common/Helmet.tsx | import * as React from 'react';
import { Helmet } from 'dumi';
const WrapHelmet: React.FC<React.PropsWithChildren<Helmet['props']>> = (props) => (
<Helmet {...props} />
);
export default WrapHelmet;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/LiveCode.tsx | .dumi/theme/common/LiveCode.tsx | import type { ComponentProps, FC } from 'react';
import React from 'react';
import { createStyles } from 'antd-style';
import SourceCodeEditor from 'dumi/theme-default/slots/SourceCodeEditor';
import LiveError from '../slots/LiveError';
const useStyle = createStyles(({ cssVar, css }) => {
return {
editor: css`
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ThemeSwitch/usePromptTheme.ts | .dumi/theme/common/ThemeSwitch/usePromptTheme.ts | /* eslint-disable compat/compat */
import { useRef, useState } from 'react';
import { XStream } from '@ant-design/x';
import type { SiteContextProps } from '../../../theme/slots/SiteContext';
const fetchTheme = async (
prompt: string,
update: (currentFullContent: string) => void,
abortSignal?: AbortSignal,
) =>... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ThemeSwitch/PromptDrawer.tsx | .dumi/theme/common/ThemeSwitch/PromptDrawer.tsx | import React, { useRef, useState } from 'react';
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
import { Bubble, Sender } from '@ant-design/x';
import { Drawer, Flex, Typography } from 'antd';
import type { GetProp } from 'antd';
import useLocale from '../../../hooks/useLocale';
import type { Sit... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ThemeSwitch/index.tsx | .dumi/theme/common/ThemeSwitch/index.tsx | import React, { use, useRef, useState } from 'react';
import {
BgColorsOutlined,
LinkOutlined,
ShopOutlined,
SmileOutlined,
SunOutlined,
SyncOutlined,
} from '@ant-design/icons';
import { Badge, Button, Dropdown } from 'antd';
import type { MenuProps } from 'antd';
import { CompactTheme, DarkTheme } from 'a... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ThemeSwitch/ThemeIcon.tsx | .dumi/theme/common/ThemeSwitch/ThemeIcon.tsx | import React from 'react';
import Icon from '@ant-design/icons';
const SVGIcon: React.FC = (props) => (
<svg width={20} height={20} viewBox="0 0 24 24" fill="currentColor" {...props}>
<title>Theme icon</title>
<g fillRule="evenodd">
<g fillRule="nonzero">
<path d="M7.02 3.635l12.518 12.518a1.86... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/JSONEditor/index.tsx | .dumi/theme/common/JSONEditor/index.tsx | import React, { useEffect, useRef } from 'react';
import type { JsonEditor, JSONEditorPropsOptional } from 'vanilla-jsoneditor';
import { createJSONEditor, Mode } from 'vanilla-jsoneditor';
const Editor: React.FC<JSONEditorPropsOptional> = (props) => {
const editorRef = useRef<JsonEditor>(null);
const container = ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Demo.tsx | .dumi/theme/common/styles/Demo.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
const GlobalDemoStyles: React.FC = () => {
const token = useTheme();
const { antCls, iconCls } = token;
return (
<Global
styles={css`
.code-boxes-col-1-1 {
width: 100%;
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Highlight.tsx | .dumi/theme/common/styles/Highlight.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @auth... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Common.tsx | .dumi/theme/common/styles/Common.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { updateCSS } from '@rc-component/util/lib/Dom/dynamicCSS';
import { useTheme } from 'antd-style';
export default () => {
const { anchorTop } = useTheme();
React.useInsertionEffect(() => {
updateCSS(`@layer theme, base, global, an... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Responsive.tsx | .dumi/theme/common/styles/Responsive.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
.nav-phone-icon {
position: absolute;
bottom: 17px;
inset-inline-end: 30px;... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/PreviewImage.tsx | .dumi/theme/common/styles/PreviewImage.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
.preview-image-boxes {
display: flex;
float: right;
clear: both;
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Markdown.tsx | .dumi/theme/common/styles/Markdown.tsx | import React from 'react';
import { FastColor } from '@ant-design/fast-color';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
const GlobalStyle: React.FC = () => {
const token = useTheme();
const { antCls } = token;
const demoGridColor = token.colorPrimary;
return (
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/NProgress.tsx | .dumi/theme/common/styles/NProgress.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
#nprogress {
.bar {
background: ${token.colorPrimary};
}
.peg {... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/InlineCard.tsx | .dumi/theme/common/styles/InlineCard.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
.design-inline-cards {
display: flex;
margin: 0 -${token.marginMD}px;
}
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/HeadingAnchor.tsx | .dumi/theme/common/styles/HeadingAnchor.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
h1,
h2,
h3,
h4,
h5,
h6 {
> a[aria-hidden]:first-child {
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/SearchBar.tsx | .dumi/theme/common/styles/SearchBar.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
const THEME_PREFIX = 'dumi-default-';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
html {
.${THEME_PREFIX}search-bar {
&-input ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/index.ts | .dumi/theme/common/styles/index.ts | export { default as Common } from './Common';
export { default as Demo } from './Demo';
export { default as HeadingAnchor } from './HeadingAnchor';
export { default as Highlight } from './Highlight';
export { default as Markdown } from './Markdown';
export { default as NProgress } from './NProgress';
export { default a... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/styles/Reset.tsx | .dumi/theme/common/styles/Reset.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
@font-face {
font-family: 'AlibabaSans';
font-style: normal;
font-weight: 3... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorPalettes.tsx | .dumi/theme/common/Color/ColorPalettes.tsx | import React, { useMemo } from 'react';
import { clsx } from 'clsx';
import useLocale from '../../../hooks/useLocale';
import Palette from './Palette';
const COLOR_KEYS = [
'red',
'volcano',
'orange',
'lime',
'gold',
'yellow',
'green',
'cyan',
'blue',
'geekblue',
'purple',
'magenta',
] as cons... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/Palette.tsx | .dumi/theme/common/Color/Palette.tsx | import React, { useEffect } from 'react';
import { presetDarkPalettes } from '@ant-design/colors';
import { App } from 'antd';
import copy from 'antd/es/_util/copy';
const rgbToHex = (rgbString: string): string => {
const rgb = rgbString.match(/\d+/g);
if (!rgb) {
return '';
}
let r = Number.parseInt(rgb[0... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorPaletteTool.tsx | .dumi/theme/common/Color/ColorPaletteTool.tsx | import React from 'react';
import { ColorPicker } from 'antd';
import type { Color } from 'antd/es/color-picker';
import { FormattedMessage } from 'dumi';
import useLocale from '../../../hooks/useLocale';
import ColorPatterns from './ColorPatterns';
const primaryMinSaturation = 70; // 主色推荐最小饱和度
const primaryMinBright... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorPaletteToolDark.tsx | .dumi/theme/common/Color/ColorPaletteToolDark.tsx | import React, { useMemo, useState } from 'react';
import { Col, ColorPicker, Row } from 'antd';
import type { Color } from 'antd/es/color-picker';
import { FormattedMessage } from 'dumi';
import useLocale from '../../../hooks/useLocale';
import ColorPatterns from './ColorPatterns';
const primaryMinSaturation = 70; //... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorStyle.tsx | .dumi/theme/common/Color/ColorStyle.tsx | import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
const gray: { [key: number]: string } = {
1: '#fff',
2: '#fafafa',
3: '#f5f5f5',
4: '#f0f0f0',
5: '#d9d9d9',
6: '#bfbfbf',
7: '#8c8c8c',
8: '#595959',
9: '#434343',
10: '#262626',
11: '... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorPatterns.tsx | .dumi/theme/common/Color/ColorPatterns.tsx | import React from 'react';
import { generate } from '@ant-design/colors';
import uniq from 'lodash/uniq';
import ColorBlock from './ColorBlock';
interface ColorPatternsProps {
color?: string;
dark?: boolean;
backgroundColor?: string;
}
const ColorPatterns: React.FC<ColorPatternsProps> = ({ color = '', dark, ba... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/Color/ColorBlock.tsx | .dumi/theme/common/Color/ColorBlock.tsx | import React, { useMemo } from 'react';
import { App } from 'antd';
import copy from 'antd/es/_util/copy';
interface ColorBlockProps {
color: string;
index: number;
dark?: boolean;
}
const ColorBlock: React.FC<ColorBlockProps> = (props) => {
const { message } = App.useApp();
const { color, index, dark } = p... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/VersionUpgrade/ChangeLog.tsx | .dumi/theme/common/VersionUpgrade/ChangeLog.tsx | import React from 'react';
import { createStyles } from 'antd-style';
import useLocale from '../../../hooks/useLocale';
import EN from './en-US.md';
import CN from './zh-CN.md';
const changeLog = { cn: CN, en: EN };
const useStyle = createStyles(({ css }) => ({
container: css`
max-height: max(62vh, 500px);
... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/VersionUpgrade/index.tsx | .dumi/theme/common/VersionUpgrade/index.tsx | import React from 'react';
import { Button, Flex, Modal, version } from 'antd';
import { useLocation } from 'dumi';
import useLocale from '../../../hooks/useLocale';
import * as utils from '../../utils';
import ChangeLog from './ChangeLog';
const [major] = version.split('.');
const STORAGE_KEY = `antd${major}-version... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ComponentChangelog/index.tsx | .dumi/theme/common/ComponentChangelog/index.tsx | import React from 'react';
import ComponentChangelog from './ComponentChangelog';
const ChangeLog: React.FC<Readonly<React.PropsWithChildren>> = ({ children }) => (
<React.Suspense fallback="...">
<ComponentChangelog>{children}</ComponentChangelog>
</React.Suspense>
);
export default ChangeLog;
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx | .dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx | import React, { cloneElement, isValidElement } from 'react';
import { BugOutlined } from '@ant-design/icons';
import { Button, Drawer, Flex, Popover, Tag, Timeline, Typography } from 'antd';
import type { TimelineItemProps } from 'antd';
import { createStyles } from 'antd-style';
import useSWR from 'swr';
import useLo... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BehaviorMap/useMermaidCode.ts | .dumi/theme/common/BehaviorMap/useMermaidCode.ts | import { useMemo } from 'react';
import type { BehaviorMapItem } from './BehaviorMap';
const generateMermaidCode = (root: BehaviorMapItem) => {
const lines: string[] = [];
lines.push('graph LR');
lines.push(`classDef baseNode fill:#fff,stroke:none,stroke-width:0px,rx:5,ry:5,font-size:14px`);
const traverse... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BehaviorMap/BehaviorMap.tsx | .dumi/theme/common/BehaviorMap/BehaviorMap.tsx | import React, { useEffect, useRef } from 'react';
import { createStyles, css } from 'antd-style';
import { useRouteMeta } from 'dumi';
import useLocale from '../../../hooks/useLocale';
import { useMermaidCode } from './useMermaidCode';
export interface BehaviorMapItem {
id: string;
label: string;
targetType?: '... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BehaviorMap/index.tsx | .dumi/theme/common/BehaviorMap/index.tsx | import type { FC } from 'react';
import React, { Suspense } from 'react';
import { Skeleton } from 'antd';
import { createStyles } from 'antd-style';
import useLocale from '../../../hooks/useLocale';
import type { BehaviorMapProps } from './BehaviorMap';
const InternalBehaviorMap = React.lazy(() => import('./Behavior... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BezierVisualizer/Visualizer.tsx | .dumi/theme/common/BezierVisualizer/Visualizer.tsx | import React, { useId } from 'react';
import { theme } from 'antd';
export interface VisualizerProps {
/**
* 控制点坐标
* @description 控制点坐标范围 [0, 1]
* @example [0.78, 0.14, 0.15, 0.86]
*/
controls: [number, number, number, number];
width?: number;
height?: number;
duration?: number;
}
const Visualiz... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/common/BezierVisualizer/index.tsx | .dumi/theme/common/BezierVisualizer/index.tsx | import React, { useMemo } from 'react';
import { Button, Flex, Tooltip, Typography } from 'antd';
import useLocale from '../../../hooks/useLocale';
import ExternalLinkIcon from '../../icons/ExternalLinkIcon';
import Visualizer from './Visualizer';
export interface BezierVisualizerProps {
value: string;
}
const RE ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/GlobalLayout.tsx | .dumi/theme/layouts/GlobalLayout.tsx | import React, { useCallback, useEffect } from 'react';
import {
createCache,
extractStyle,
legacyNotSelectorLinter,
NaNLinter,
parentSelectorLinter,
StyleProvider,
} from '@ant-design/cssinjs';
import { HappyProvider } from '@ant-design/happy-work-theme';
import { getSandpackCssText } from '@codesandbox/san... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/DocLayout/index.tsx | .dumi/theme/layouts/DocLayout/index.tsx | import { clsx } from 'clsx';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import React, { useEffect, useLayoutEffect, useRef } from 'react';
import { ConfigProvider, theme } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import { Helmet, useOutlet, useSearchParams, useSiteData } from 'dumi';
import... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/IndexLayout/index.tsx | .dumi/theme/layouts/IndexLayout/index.tsx | import type { PropsWithChildren } from 'react';
import React from 'react';
import { Helmet } from 'dumi';
import Footer from '../../slots/Footer';
interface IndexLayoutProps {
title?: string;
desc?: string;
}
const IndexLayout: React.FC<PropsWithChildren<IndexLayoutProps>> = (props) => {
const { children, titl... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/SidebarLayout/index.tsx | .dumi/theme/layouts/SidebarLayout/index.tsx | import type { PropsWithChildren } from 'react';
import React from 'react';
import { createStyles } from 'antd-style';
import { useSearchParams } from 'dumi';
import CommonHelmet from '../../common/CommonHelmet';
import Content from '../../slots/Content';
import Sidebar from '../../slots/Sidebar';
const useStyle = cre... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/ResourceLayout/AffixTabs.tsx | .dumi/theme/layouts/ResourceLayout/AffixTabs.tsx | import * as React from 'react';
import { Tabs } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import throttle from 'lodash/throttle';
import scrollTo from '../../../../components/_util/scrollTo';
const listenerEvents: (keyof WindowEventMap)[] = ['scroll', 'resize'];
const useSt... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/.dumi/theme/layouts/ResourceLayout/index.tsx | .dumi/theme/layouts/ResourceLayout/index.tsx | import type { PropsWithChildren } from 'react';
import React from 'react';
import { ConfigProvider, Layout, Typography } from 'antd';
import { createStyles } from 'antd-style';
import { FormattedMessage, useRouteMeta } from 'dumi';
import CommonHelmet from '../../common/CommonHelmet';
import EditButton from '../../com... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/typings/jest.d.ts | typings/jest.d.ts | declare namespace jest {
interface Matchers<R> {
toHaveNoViolations: () => R;
}
}
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/typings/cssType.d.ts | typings/cssType.d.ts | declare namespace React {
interface CSSProperties {
[key: `--${string | number}`]: string | number | undefined; // 允许 CSS 变量
}
}
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/typings/custom-typings.d.ts | typings/custom-typings.d.ts | // https://github.com/facebook/create-react-app/blob/f09d3d3a52c1b938cecc977c2bbc0942ea0a7e70/packages/react-scripts/lib/react-app.d.ts#L42-L49
declare module '*.svg' {
import type * as React from 'react';
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
const src: string;
export default ... | typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
ant-design/ant-design | https://github.com/ant-design/ant-design/blob/283b2822e0c371d083a1eaf51cfb1120c5cc4ffe/typings/index.d.ts | typings/index.d.ts | /// <reference path="custom-typings.d.ts" />
| typescript | MIT | 283b2822e0c371d083a1eaf51cfb1120c5cc4ffe | 2026-01-04T15:25:31.760576Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/passport-example/ts/index.ts | examples/passport-example/ts/index.ts | import express = require("express");
import { createServer } from "http";
import { Server } from "socket.io";
import session from "express-session";
import { type Request, type Response } from "express";
import bodyParser = require("body-parser");
import passport = require("passport");
import { Strategy as LocalStrateg... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/app.controller.ts | examples/nestjs-example/src/app.controller.ts | import { Controller, Get, Render } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
@Render('index')
root() {
return { message: 'Hello world2!' };
}
}
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/app.module.ts | examples/nestjs-example/src/app.module.ts | import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { EventsModule } from './events/events.module';
@Module({
imports: [EventsModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/app.service.ts | examples/nestjs-example/src/app.service.ts | import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
}
}
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/main.ts | examples/nestjs-example/src/main.ts | import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'node:path';
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.setBaseViewsDir(join(... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/app.controller.spec.ts | examples/nestjs-example/src/app.controller.spec.ts | import { Test, TestingModule } from '@nestjs/testing';
import { AppController } from './app.controller';
import { AppService } from './app.service';
describe('AppController', () => {
let appController: AppController;
beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({
co... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/events/events.gateway.ts | examples/nestjs-example/src/events/events.gateway.ts | import {
MessageBody,
SubscribeMessage,
WebSocketGateway,
WebSocketServer,
} from '@nestjs/websockets';
import { Server } from 'socket.io';
@WebSocketGateway({})
export class EventsGateway {
@WebSocketServer()
io: Server;
@SubscribeMessage('hello')
handleEvent(@MessageBody() data: string): string {
... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/src/events/events.module.ts | examples/nestjs-example/src/events/events.module.ts | import { Module } from '@nestjs/common';
import { EventsGateway } from './events.gateway';
@Module({
providers: [EventsGateway],
})
export class EventsModule {}
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nestjs-example/test/app.e2e-spec.ts | examples/nestjs-example/test/app.e2e-spec.ts | import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';
describe('AppController (e2e)', () => {
let app: INestApplication;
beforeEach(async () => {
const moduleFixture: Test... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nuxt-example/nuxt.config.ts | examples/nuxt-example/nuxt.config.ts | // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {
enabled: true
},
nitro: {
experimental: {
websocket: true
},
}
})
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nuxt-example/components/socket.ts | examples/nuxt-example/components/socket.ts | import { io } from "socket.io-client";
export const socket = io();
| typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
socketio/socket.io | https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/examples/nuxt-example/server/plugins/socket.io.ts | examples/nuxt-example/server/plugins/socket.io.ts | import type { NitroApp } from "nitropack";
import { Server as Engine } from "engine.io";
import { Server } from "socket.io";
import { defineEventHandler } from "h3";
export default defineNitroPlugin((nitroApp: NitroApp) => {
const engine = new Engine();
const io = new Server();
io.bind(engine);
io.on("connec... | typescript | MIT | 9978574e4f1d4e21593497f94c40053cd0fff359 | 2026-01-04T15:28:10.329849Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.