Skip to content

Commit

Permalink
chore: auto merge branches (ant-design#46229)
Browse files Browse the repository at this point in the history
Feature merge master
  • Loading branch information
github-actions[bot] authored Dec 4, 2023
2 parents 82781bd + 71bd883 commit f97cbff
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .dumi/theme/common/Color/ColorPaletteToolDark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ColorPaletteTool: React.FC = () => {
text += locale.saturation((s * 100).toFixed(2));
}
if (b * 100 < primaryMinBrightness) {
text += locale.brightness((s * 100).toFixed(2));
text += locale.brightness((b * 100).toFixed(2));
}
}
return (
Expand Down
6 changes: 3 additions & 3 deletions .dumi/theme/slots/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const RESPONSIVE_SM = 1200;

const locales = {
cn: {
message: 'Galacean Effects · 所见即所得的动效新方案。',
shortMessage: 'Galacean Effects · 所见即所得的动效新方案。',
message: '语雀征文 · 说说你和开源的故事,赢取 Ant Design 精美周边 🎁',
shortMessage: '语雀征文 · 说说你和开源的故事,赢取 Ant Design 精美周边 🎁',
more: '前往了解',
link: 'https://galacean.antgroup.com/effects/',
link: 'https://www.yuque.com/opensource2023',
},
en: {
message: '',
Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ An enterprise-class UI design language and React UI library.
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
[dumi-url]: https://github.com/umijs/dumi

<!-- Copy-paste in your Readme.md file -->

<a href="https://next.ossinsight.io/widgets/official/compose-last-28-days-stats?repo_id=34526884" target="_blank" style="display: block" align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-last-28-days-stats/thumbnail.png?repo_id=34526884&image_size=auto&color_scheme=dark" width="655" height="auto">
<img alt="Performance Stats of ant-design/ant-design - Last 28 days" src="https://next.ossinsight.io/widgets/official/compose-last-28-days-stats/thumbnail.png?repo_id=34526884&image_size=auto&color_scheme=light" width="655" height="auto">
</picture>
</a>

<!-- Made with [OSS Insight](https://ossinsight.io/) -->

</div>

[![](https://user-images.githubusercontent.com/507615/209472919-6f7e8561-be8c-4b0b-9976-eb3c692aa20a.png)](https://ant.design)
Expand Down Expand Up @@ -83,27 +94,16 @@ pnpm add antd
## 🔨 Usage

```tsx
import React from 'react';
import { Button, DatePicker } from 'antd';

const App = () => (
export default () => (
<>
<Button type="primary">PRESS ME</Button>
<DatePicker placeholder="select date" />
</>
);

export default App;
```

### TypeScript

`antd` is written in TypeScript with complete definitions, check [Usage with create-react-app](https://ant.design/docs/react/use-with-create-react-app) to get started.

## 🌍 Internationalization

Dozens of languages are supported in `antd`, see [i18n](https://ant.design/docs/react/i18n).

## 🔗 Links

- [Home page](https://ant.design/)
Expand Down Expand Up @@ -146,6 +146,17 @@ Open your browser and visit http://127.0.0.1:8001 , see more at [Development](ht

## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

<!-- Copy-paste in your Readme.md file -->

<a href="https://next.ossinsight.io/widgets/official/compose-recent-active-contributors?repo_id=34526884&limit=30" target="_blank" style="display: block" align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-recent-active-contributors/thumbnail.png?repo_id=34526884&limit=30&image_size=auto&color_scheme=dark" width="655" height="auto">
<img alt="Active Contributors of ant-design/ant-design - Last 28 days" src="https://next.ossinsight.io/widgets/official/compose-recent-active-contributors/thumbnail.png?repo_id=34526884&limit=30&image_size=auto&color_scheme=light" width="655" height="auto">
</picture>
</a>

<!-- Made with [OSS Insight](https://ossinsight.io/) -->

Let's build a better antd together.

We welcome all contributions. Please read our [Contributing Guide](https://ant.design/docs/react/contributing) first. You can submit any ideas as [Pull Requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub Issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :)
Expand Down
1 change: 1 addition & 0 deletions antd-image-snapshots-main/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# antd-image-snapshots
33 changes: 33 additions & 0 deletions components/button/__tests__/__snapshots__/demo-extend.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,39 @@ Array [

exports[`renders components/button/demo/legacy-group.tsx extend context correctly 2`] = `[]`;

exports[`renders components/button/demo/linear-gradient.tsx extend context correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Primary Button
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
Default Button
</span>
</button>
</div>
</div>
`;

exports[`renders components/button/demo/linear-gradient.tsx extend context correctly 2`] = `[]`;

exports[`renders components/button/demo/loading.tsx extend context correctly 1`] = `
<div
class="ant-flex ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
Expand Down
31 changes: 31 additions & 0 deletions components/button/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,37 @@ Array [
]
`;

exports[`renders components/button/demo/linear-gradient.tsx correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Primary Button
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
Default Button
</span>
</button>
</div>
</div>
`;

exports[`renders components/button/demo/loading.tsx correctly 1`] = `
<div
class="ant-flex ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
Expand Down
7 changes: 7 additions & 0 deletions components/button/demo/linear-gradient.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## zh-CN

自定义为渐变背景按钮。

## en-US

Buttons with gradient background.
26 changes: 26 additions & 0 deletions components/button/demo/linear-gradient.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import { Button, ConfigProvider, Space } from 'antd';

const App: React.FC = () => (
<ConfigProvider
theme={{
components: {
Button: {
colorPrimary: 'linear-gradient(90deg, #FF4E50, #F9D423) !important',
primaryShadow: 'none',
defaultBg: 'linear-gradient(90deg, #aea4e3, #d3ffe8) !important',
defaultShadow: 'none',
defaultColor: '#fff !important',
lineWidth: 0,
},
},
}}
>
<Space>
<Button type="primary">Primary Button</Button>
<Button>Default Button</Button>
</Space>
</ConfigProvider>
);

export default App;
1 change: 1 addition & 0 deletions components/button/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ And 4 other properties additionally.
<code src="./demo/legacy-group.tsx" debug>Deprecated Button Group</code>
<code src="./demo/chinese-chars-loading.tsx" debug>Loading style bug</code>
<code src="./demo/component-token.tsx" debug>Component Token</code>
<code src="./demo/linear-gradient.tsx" debug>Gradient Button</code>

## API

Expand Down
1 change: 1 addition & 0 deletions components/button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ group:
<code src="./demo/legacy-group.tsx" debug>废弃的 Block 组</code>
<code src="./demo/chinese-chars-loading.tsx" debug>加载中状态 bug 还原</code>
<code src="./demo/component-token.tsx" debug>组件 Token</code>
<code src="./demo/linear-gradient.tsx" debug>渐变按钮</code>

## API

Expand Down
34 changes: 17 additions & 17 deletions components/button/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const genSharedButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token): CSS
whiteSpace: 'nowrap',
textAlign: 'center',
backgroundImage: 'none',
backgroundColor: 'transparent',
background: 'transparent',
border: `${unit(token.lineWidth)} ${token.lineType} transparent`,
cursor: 'pointer',
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
Expand Down Expand Up @@ -258,7 +258,7 @@ const genDisabledStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
cursor: 'not-allowed',
borderColor: token.borderColorDisabled,
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled,
background: token.colorBgContainerDisabled,
boxShadow: 'none',
});

Expand All @@ -274,18 +274,18 @@ const genGhostButtonStyle = (
): CSSObject => ({
[`&${btnCls}-background-ghost`]: {
color: textColor || undefined,
backgroundColor: background,
background,
borderColor: borderColor || undefined,
boxShadow: 'none',

...genHoverActiveButtonStyle(
btnCls,
{
backgroundColor: background,
background,
...hoverStyle,
},
{
backgroundColor: background,
background,
...activeStyle,
},
),
Expand Down Expand Up @@ -319,7 +319,7 @@ const genPureDisabledButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token
const genDefaultButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
...genSolidButtonStyle(token),

backgroundColor: token.defaultBg,
background: token.defaultBg,
borderColor: token.defaultBorderColor,
color: token.defaultColor,

Expand Down Expand Up @@ -379,19 +379,19 @@ const genPrimaryButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) =>
...genSolidButtonStyle(token),

color: token.primaryColor,
backgroundColor: token.colorPrimary,
background: token.colorPrimary,

boxShadow: token.primaryShadow,

...genHoverActiveButtonStyle(
token.componentCls,
{
color: token.colorTextLightSolid,
backgroundColor: token.colorPrimaryHover,
background: token.colorPrimaryHover,
},
{
color: token.colorTextLightSolid,
backgroundColor: token.colorPrimaryActive,
background: token.colorPrimaryActive,
},
),

Expand All @@ -413,17 +413,17 @@ const genPrimaryButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) =>
),

[`&${token.componentCls}-dangerous`]: {
backgroundColor: token.colorError,
background: token.colorError,
boxShadow: token.dangerShadow,
color: token.dangerColor,

...genHoverActiveButtonStyle(
token.componentCls,
{
backgroundColor: token.colorErrorHover,
background: token.colorErrorHover,
},
{
backgroundColor: token.colorErrorActive,
background: token.colorErrorActive,
},
),

Expand Down Expand Up @@ -461,7 +461,7 @@ const genLinkButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
token.componentCls,
{
color: token.colorLinkHover,
backgroundColor: token.linkHoverBg,
background: token.linkHoverBg,
},
{
color: token.colorLinkActive,
Expand Down Expand Up @@ -493,11 +493,11 @@ const genTextButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
token.componentCls,
{
color: token.colorText,
backgroundColor: token.textHoverBg,
background: token.textHoverBg,
},
{
color: token.colorText,
backgroundColor: token.colorBgTextActive,
background: token.colorBgTextActive,
},
),

Expand All @@ -511,11 +511,11 @@ const genTextButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token) => ({
token.componentCls,
{
color: token.colorErrorHover,
backgroundColor: token.colorErrorBg,
background: token.colorErrorBg,
},
{
color: token.colorErrorHover,
backgroundColor: token.colorErrorBg,
background: token.colorErrorBg,
},
),
},
Expand Down
Loading

0 comments on commit f97cbff

Please sign in to comment.