Browse Source

feat: add Typography.Text type success (#26145)

* baseType & style

* update demo

* update snap

* update document

* remove type primary
pull/26259/head
llwslc 4 years ago
committed by GitHub
parent
commit
ff7aca19cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/typography/Base.tsx
  2. 10
      components/typography/__tests__/__snapshots__/demo.test.js.snap
  3. 1
      components/typography/demo/text.md
  4. 6
      components/typography/index.en-US.md
  5. 6
      components/typography/index.zh-CN.md
  6. 4
      components/typography/style/index.less

2
components/typography/Base.tsx

@ -20,7 +20,7 @@ import Typography, { TypographyProps } from './Typography';
import Editable from './Editable';
import measure from './util';
export type BaseType = 'secondary' | 'danger' | 'warning';
export type BaseType = 'secondary' | 'success' | 'warning' | 'danger';
const isLineClampSupport = isStyleSupport('webkitLineClamp');
const isTextOverflowSupport = isStyleSupport('textOverflow');

10
components/typography/__tests__/__snapshots__/demo.test.js.snap

@ -856,6 +856,16 @@ exports[`renders ./components/typography/demo/text.md correctly 1`] = `
Ant Design
</span>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-typography ant-typography-success"
>
Ant Design
</span>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"

1
components/typography/demo/text.md

@ -22,6 +22,7 @@ ReactDOM.render(
<Space direction="vertical">
<Text>Ant Design</Text>
<Text type="secondary">Ant Design</Text>
<Text type="success">Ant Design</Text>
<Text type="warning">Ant Design</Text>
<Text type="danger">Ant Design</Text>
<Text disabled>Ant Design</Text>

6
components/typography/index.en-US.md

@ -30,7 +30,7 @@ Basic text writing, including headings, body text, lists, and more.
| underline | Underlined style | boolean | false | |
| onChange | Trigger when user edits the content | function(string) | - | |
| strong | Bold style | boolean | false | |
| type | Content type | `secondary` \| `warning` \| `danger` | - | |
| type | Content type | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### Typography.Title
@ -46,7 +46,7 @@ Basic text writing, including headings, body text, lists, and more.
| mark | Marked style | boolean | false | |
| underline | Underlined style | boolean | false | |
| onChange | Trigger when user edits the content | function(string) | - | |
| type | Content type | `secondary` \| `warning` \| `danger` | - | |
| type | Content type | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### Typography.Paragraph
@ -62,7 +62,7 @@ Basic text writing, including headings, body text, lists, and more.
| underline | Underlined style | boolean | false | |
| onChange | Trigger when user edits the content | function(string) | - | |
| strong | Bold style | boolean | false | |
| type | Content type | `secondary` \| `warning` \| `danger` | - | |
| type | Content type | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### copyable

6
components/typography/index.zh-CN.md

@ -30,7 +30,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg
| keyboard | 添加键盘样式 | boolean | false | 4.3.0 |
| underline | 添加下划线样式 | boolean | false | |
| strong | 是否加粗 | boolean | false | |
| type | 文本类型 | `secondary` \| `warning` \| `danger` | - | |
| type | 文本类型 | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### Typography.Title
@ -46,7 +46,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg
| mark | 添加标记样式 | boolean | false | |
| underline | 添加下划线样式 | boolean | false | |
| onChange | 当用户提交编辑内容时触发 | function(string) | - | |
| type | 文本类型 | `secondary` \| `warning` \| `danger` | - | |
| type | 文本类型 | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### Typography.Paragraph
@ -62,7 +62,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg
| underline | 添加下划线样式 | boolean | false | |
| onChange | 当用户提交编辑内容时触发 | function(string) | - | |
| strong | 是否加粗 | boolean | false | |
| type | 文本类型 | `secondary` \| `warning` \| `danger` | - | |
| type | 文本类型 | `secondary` \| `success` \| `warning` \| `danger` | - | success: 4.6.0 |
### copyable

4
components/typography/style/index.less

@ -12,6 +12,10 @@
color: @text-color-secondary;
}
&&-success {
color: @success-color;
}
&&-warning {
color: @warning-color;
}

Loading…
Cancel
Save