mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
Merge branch master into feature-merge-master
This commit is contained in:
commit
041e38b5e6
@ -1,4 +1,4 @@
|
||||
import classnames from 'classnames';
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import Palette from './Palette';
|
||||
|
||||
@ -80,7 +80,7 @@ const colors = [
|
||||
const ColorPalettes: React.FC<{ dark?: boolean }> = (props) => {
|
||||
const { dark } = props;
|
||||
return (
|
||||
<div className={classnames('color-palettes', { 'color-palettes-dark': dark })}>
|
||||
<div className={classNames('color-palettes', { 'color-palettes-dark': dark })}>
|
||||
{colors.map((color) => (
|
||||
<Palette key={color.name} color={color} dark={dark} showTitle />
|
||||
))}
|
||||
|
@ -12,11 +12,9 @@ demo:
|
||||
|
||||
## How to use
|
||||
|
||||
Before use icons, you need to install `@ant-design/icons` package:
|
||||
Before use icons, you need to install [@ant-design/icons](https://github.com/ant-design/ant-design-icons) package:
|
||||
|
||||
```bash
|
||||
npm install --save @ant-design/icons
|
||||
```
|
||||
<InstallDependencies npm='npm install @ant-design/icons --save' yarn='yarn add @ant-design/icons' pnpm='pnpm install @ant-design/icons --save'></InstallDependencies>
|
||||
|
||||
## List of icons
|
||||
|
||||
|
@ -13,11 +13,9 @@ demo:
|
||||
|
||||
## 使用方法
|
||||
|
||||
使用图标组件,你需要安装 `@ant-design/icons` 图标组件包:
|
||||
使用图标组件,你需要安装 [@ant-design/icons](https://github.com/ant-design/ant-design-icons) 图标组件包:
|
||||
|
||||
```bash
|
||||
npm install --save @ant-design/icons
|
||||
```
|
||||
<InstallDependencies npm='npm install @ant-design/icons --save' yarn='yarn add @ant-design/icons' pnpm='pnpm install @ant-design/icons --save'></InstallDependencies>
|
||||
|
||||
## 设计师专属
|
||||
|
||||
|
@ -20,8 +20,7 @@ export const TypeIcon = {
|
||||
loading: <LoadingOutlined />,
|
||||
};
|
||||
|
||||
export function getCloseIcon(prefixCls: string, closeIcon?: React.ReactNode) {
|
||||
if (closeIcon === null || closeIcon === false) return null;
|
||||
export function getCloseIcon(prefixCls: string, closeIcon?: React.ReactNode): React.ReactNode {
|
||||
return (
|
||||
closeIcon || (
|
||||
<span className={`${prefixCls}-close-x`}>
|
||||
|
@ -123,9 +123,9 @@ const InternalTag: React.ForwardRefRenderFunction<HTMLSpanElement, TagProps> = (
|
||||
typeof props.onClick === 'function' ||
|
||||
(children && (children as React.ReactElement<any>).type === 'a');
|
||||
|
||||
const iconNode = icon || null;
|
||||
const iconNode: React.ReactNode = icon || null;
|
||||
|
||||
const kids = iconNode ? (
|
||||
const kids: React.ReactNode = iconNode ? (
|
||||
<>
|
||||
{iconNode}
|
||||
<span>{children}</span>
|
||||
@ -134,7 +134,7 @@ const InternalTag: React.ForwardRefRenderFunction<HTMLSpanElement, TagProps> = (
|
||||
children
|
||||
);
|
||||
|
||||
const tagNode = (
|
||||
const tagNode: React.ReactNode = (
|
||||
<span {...props} ref={ref} className={tagClassName} style={tagStyle}>
|
||||
{kids}
|
||||
{mergedCloseIcon}
|
||||
|
@ -4,4 +4,4 @@
|
||||
|
||||
## en-US
|
||||
|
||||
custom mask style.
|
||||
Custom mask style.
|
||||
|
@ -20,8 +20,8 @@ Use when you want to guide users through a product.
|
||||
<code src="./demo/basic.tsx">Basic</code>
|
||||
<code src="./demo/non-modal.tsx">Non-modal</code>
|
||||
<code src="./demo/placement.tsx">Placement</code>
|
||||
<code src="./demo/mask.tsx">custom mask style</code>
|
||||
<code src="./demo/indicator.tsx">custom indicator</code>
|
||||
<code src="./demo/mask.tsx">Custom mask style</code>
|
||||
<code src="./demo/indicator.tsx">Custom indicator</code>
|
||||
<code src="./demo/render-panel.tsx" debug>\_InternalPanelDoNotUseOrYouWillBeFired</code>
|
||||
|
||||
## API
|
||||
|
Loading…
Reference in New Issue
Block a user