Skip to content

Commit

Permalink
chore: auto merge branches (ant-design#51093)
Browse files Browse the repository at this point in the history
chore: merge master into feature
  • Loading branch information
github-actions[bot] authored Oct 2, 2024
2 parents 91754fb + 975763d commit 2b5dfaa
Show file tree
Hide file tree
Showing 178 changed files with 3,847 additions and 3,520 deletions.
13 changes: 13 additions & 0 deletions .dumi/theme/builtins/Audio/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { SoundOutlined } from '@ant-design/icons';

const Audio: React.FC<React.PropsWithChildren<{ domId: string }>> = ({ domId, children }) => {
return (
<a onClick={() => document.querySelector<HTMLAudioElement>(`#${domId}`)?.play()}>
{children}
<SoundOutlined style={{ fontSize: 20, color: 'black' }} />
</a>
);
};

export default Audio;
38 changes: 26 additions & 12 deletions .dumi/theme/builtins/ComponentMeta/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import { EditOutlined, GithubOutlined } from '@ant-design/icons';
import { EditOutlined, GithubOutlined, HistoryOutlined } from '@ant-design/icons';
import type { GetProp } from 'antd';
import { Descriptions, theme, Tooltip, Typography } from 'antd';
import { Descriptions, Flex, theme, Tooltip, Typography } from 'antd';
import { createStyles, css } from 'antd-style';
import kebabCase from 'lodash/kebabCase';
import CopyToClipboard from 'react-copy-to-clipboard';

import useLocale from '../../../hooks/useLocale';
import ComponentChangelog from '../../common/ComponentChangelog';

const locales = {
cn: {
Expand All @@ -16,6 +17,7 @@ const locales = {
source: '源码',
docs: '文档',
edit: '编辑此页',
changelog: '更新日志',
version: '版本',
},
en: {
Expand All @@ -25,6 +27,7 @@ const locales = {
source: 'Source',
docs: 'Docs',
edit: 'Edit this page',
changelog: 'Changelog',
version: 'Version',
},
};
Expand All @@ -43,7 +46,7 @@ const useStyle = createStyles(({ token }) => ({
align-items: center;
column-gap: ${token.paddingXXS}px;
border-radius: ${token.borderRadiusSM}px;
padding-inline: ${token.paddingXXS}px;
padding-inline: ${token.paddingXXS}px !important;
transition: all ${token.motionDurationSlow} !important;
font-family: ${token.codeFamily};
color: ${token.colorTextSecondary} !important;
Expand All @@ -70,6 +73,9 @@ const useStyle = createStyles(({ token }) => ({
semicolon: css`
color: ${token.colorText};
`,
icon: css`
margin-inline-end: ${token.marginXXS}px;
`,
}));

export interface ComponentMetaProps {
Expand Down Expand Up @@ -171,22 +177,30 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
label: locale.source,
children: (
<Typography.Link className={styles.code} href={filledSource} target="_blank">
<GithubOutlined style={{ marginInlineEnd: 4 }} />
<GithubOutlined className={styles.icon} />
<span>{abbrSource}</span>
</Typography.Link>
),
},
filename && {
label: locale.docs,
children: (
<Typography.Link
className={styles.code}
href={`${branchUrl}${filename}`}
target="_blank"
>
<EditOutlined style={{ marginInlineEnd: 4 }} />
<span>{locale.edit}</span>
</Typography.Link>
<Flex justify="flex-start" align="center" gap="middle">
<Typography.Link
className={styles.code}
href={`${branchUrl}${filename}`}
target="_blank"
>
<EditOutlined className={styles.icon} />
<span>{locale.edit}</span>
</Typography.Link>
<ComponentChangelog>
<Typography.Link className={styles.code}>
<HistoryOutlined className={styles.icon} />
<span>{locale.changelog}</span>
</Typography.Link>
</ComponentChangelog>
</Flex>
),
},
isVersionNumber(version) && {
Expand Down
Loading

0 comments on commit 2b5dfaa

Please sign in to comment.