+
{content()}
)}
diff --git a/src/packages/badge/demos/h5/demo1.tsx b/src/packages/badge/demos/h5/demo1.tsx
index 8e542d0e10..f627259e76 100644
--- a/src/packages/badge/demos/h5/demo1.tsx
+++ b/src/packages/badge/demos/h5/demo1.tsx
@@ -1,23 +1,51 @@
-import { User } from '@nutui/icons-react'
+import { Dongdong, User } from '@nutui/icons-react'
import { Avatar, Badge, Cell } from '@nutui/nutui-react'
import React from 'react'
const Demo1 = () => {
+ const renderText = () => {
+ return (
+
+ 文字内容
+
+ )
+ }
return (
-
-
- } shape="square" />
-
-
- } shape="square" />
-
-
- } shape="square" />
-
-
- } shape="square" />
-
- |
+ <>
+
+ {renderText()}
+
+
+
+
+ } shape="square" />
+
+ |
+
+ {renderText()}
+
+
+
+
+ } shape="square" />
+
+ |
+
+
+ {renderText()}
+
+
+
+
+
+ } shape="square" />
+
+ |
+ >
)
}
export default Demo1
diff --git a/src/packages/badge/demos/h5/demo2.tsx b/src/packages/badge/demos/h5/demo2.tsx
index 12d6101cf3..b7e93fdf47 100644
--- a/src/packages/badge/demos/h5/demo2.tsx
+++ b/src/packages/badge/demos/h5/demo2.tsx
@@ -4,14 +4,14 @@ import { User } from '@nutui/icons-react'
const Demo2 = () => {
return (
-
-
+
+
} shape="square" />
-
+
} shape="square" />
-
+
} shape="square" />
|
diff --git a/src/packages/badge/demos/h5/demo3.tsx b/src/packages/badge/demos/h5/demo3.tsx
index e173df2f4d..d6be8764c5 100644
--- a/src/packages/badge/demos/h5/demo3.tsx
+++ b/src/packages/badge/demos/h5/demo3.tsx
@@ -4,34 +4,31 @@ import { User } from '@nutui/icons-react'
const Demo3 = () => {
return (
-
+
- } shape="square" />
-
-
} shape="square" />
} shape="square" />
} shape="square" />
diff --git a/src/packages/badge/demos/h5/demo4.tsx b/src/packages/badge/demos/h5/demo4.tsx
index 38eb81691b..29b41b1695 100644
--- a/src/packages/badge/demos/h5/demo4.tsx
+++ b/src/packages/badge/demos/h5/demo4.tsx
@@ -4,23 +4,14 @@ import { User, Checklist, Link as LinkIcon, Download } from '@nutui/icons-react'
const Demo4 = () => {
return (
-
- }
- >
+
+ }>
} shape="square" />
| | | |
- }
- >
+ }>
} shape="square" />
- }
- >
+ }>
} shape="square" />
|
diff --git a/src/packages/badge/demos/h5/demo5.tsx b/src/packages/badge/demos/h5/demo5.tsx
index 034634ddd4..02114f4892 100644
--- a/src/packages/badge/demos/h5/demo5.tsx
+++ b/src/packages/badge/demos/h5/demo5.tsx
@@ -6,23 +6,17 @@ const customTheme = {
nutuiBadgeBorderRadius: '12px 12px 12px 0',
}
-const customTheme2 = {
- nutuiBadgeDotWidth: '14px',
- nutuiBadgeDotHeight: '14px',
- nutuiBadgeBorder: '2px solid #fff',
-}
-
const Demo5 = () => {
return (
-
+
+
+ } shape="square" />
+
+
+ } shape="square" />
+
-
- } shape="square" />
-
-
-
-
-
+
} shape="square" />
diff --git a/src/packages/badge/demos/h5/demo6.tsx b/src/packages/badge/demos/h5/demo6.tsx
index c933a73c3a..66f7e37bbe 100644
--- a/src/packages/badge/demos/h5/demo6.tsx
+++ b/src/packages/badge/demos/h5/demo6.tsx
@@ -4,15 +4,15 @@ import React from 'react'
const Demo6 = () => {
return (
-
-
- } shape="square" />
+
+
+ } />
-
- } shape="square" />
+
+ } />
-
- } shape="square" />
+
+ } />
|
)
diff --git a/src/packages/badge/demos/h5/demo7.tsx b/src/packages/badge/demos/h5/demo7.tsx
index d8b63f6d54..7ec29a60e7 100644
--- a/src/packages/badge/demos/h5/demo7.tsx
+++ b/src/packages/badge/demos/h5/demo7.tsx
@@ -3,10 +3,10 @@ import React from 'react'
const Demo7 = () => {
return (
-
-
-
-
+
+
+
+
|
)
}
diff --git a/src/packages/badge/demos/h5/demo8.tsx b/src/packages/badge/demos/h5/demo8.tsx
index 6124b11036..548d9b12dc 100644
--- a/src/packages/badge/demos/h5/demo8.tsx
+++ b/src/packages/badge/demos/h5/demo8.tsx
@@ -4,18 +4,20 @@ import React from 'react'
const Demo8 = () => {
return (
-
-
+
+
} shape="square" />
-
+
} shape="square" />
} shape="square" />
diff --git a/src/packages/badge/demos/taro/demo1.tsx b/src/packages/badge/demos/taro/demo1.tsx
index 7f51d295ee..cdb42f65e3 100644
--- a/src/packages/badge/demos/taro/demo1.tsx
+++ b/src/packages/badge/demos/taro/demo1.tsx
@@ -1,32 +1,53 @@
-import { User } from '@nutui/icons-react-taro'
-import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
import React from 'react'
+import { Dongdong, User } from '@nutui/icons-react-taro'
+import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
+import { Text } from '@tarojs/components'
import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo1 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
+ const renderText = () => {
+ return (
+
+ 文字内容
+
+ )
}
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
- {renderChildren()}
-
-
- {renderChildren()}
-
-
- {renderChildren()}
-
-
- {renderChildren()}
-
- |
+ <>
+
+ {renderText()}
+
+
+
+
+ } shape="square" />
+
+ |
+
+ {renderText()}
+
+
+
+
+ } shape="square" />
+
+ |
+
+
+ {renderText()}
+
+
+
+
+
+ } shape="square" />
+
+ |
+ >
)
}
export default Demo1
diff --git a/src/packages/badge/demos/taro/demo2.tsx b/src/packages/badge/demos/taro/demo2.tsx
index 1bb5941275..2764308982 100644
--- a/src/packages/badge/demos/taro/demo2.tsx
+++ b/src/packages/badge/demos/taro/demo2.tsx
@@ -1,27 +1,18 @@
+import React from 'react'
import { User } from '@nutui/icons-react-taro'
import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
-import React from 'react'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo2 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
- {renderChildren()}
+
+
+ } shape="square" />
-
- {renderChildren()}
+
+ } shape="square" />
-
- {renderChildren()}
+
+ } shape="square" />
|
)
diff --git a/src/packages/badge/demos/taro/demo3.tsx b/src/packages/badge/demos/taro/demo3.tsx
index 1eafbbf3f6..4148dbb84c 100644
--- a/src/packages/badge/demos/taro/demo3.tsx
+++ b/src/packages/badge/demos/taro/demo3.tsx
@@ -1,36 +1,36 @@
+import React from 'react'
import { User } from '@nutui/icons-react-taro'
import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
-import React from 'react'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo3 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
- {renderChildren()}
-
-
- {renderChildren()}
+
+
+ } shape="square" />
-
- {renderChildren()}
+
+ } shape="square" />
- {renderChildren()}
+ } shape="square" />
|
)
diff --git a/src/packages/badge/demos/taro/demo4.tsx b/src/packages/badge/demos/taro/demo4.tsx
index e52bf7a2cd..fd4442e772 100644
--- a/src/packages/badge/demos/taro/demo4.tsx
+++ b/src/packages/badge/demos/taro/demo4.tsx
@@ -1,46 +1,19 @@
-import { Checklist, User } from '@nutui/icons-react-taro'
-import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
import React from 'react'
-import { Icon } from '@tarojs/components'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
+import { Checklist, User, Dongdong, Download } from '@nutui/icons-react-taro'
+import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
const Demo4 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
- const renderIcon = () => {
- return (
- <>
- {isRnAndHarmony ? (
-
- ) : (
-
- )}
- >
- )
- }
return (
-
-
- {renderChildren()}
+
+ }>
+ } shape="square" />
+ |
+ }>
+ } shape="square" />
|
- {/* }
- >
- {renderChildren()}
+ }>
+ } shape="square" />
|
- }
- >
- {renderChildren()}
- | */}
|
)
}
diff --git a/src/packages/badge/demos/taro/demo5.tsx b/src/packages/badge/demos/taro/demo5.tsx
index 1bab589954..06feb167d1 100644
--- a/src/packages/badge/demos/taro/demo5.tsx
+++ b/src/packages/badge/demos/taro/demo5.tsx
@@ -1,38 +1,24 @@
+import React from 'react'
import { User } from '@nutui/icons-react-taro'
import { Avatar, Badge, Cell, ConfigProvider } from '@nutui/nutui-react-taro'
-import React from 'react'
import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const customTheme = {
nutuiBadgeBorderRadius: `${pxTransform(12)} ${pxTransform(12)} ${pxTransform(12)} 0`,
}
-const customTheme2 = {
- nutuiBadgeDotWidth: pxTransform(14),
- nutuiBadgeDotHeight: pxTransform(14),
- nutuiBadgeBorder: `${pxTransform(2)} solid #000`,
-}
-
const Demo5 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
+
+
+ } shape="square" />
+
+
+ } shape="square" />
+
-
- {renderChildren()}
-
-
-
-
-
- {renderChildren()}
+
+ } shape="square" />
|
diff --git a/src/packages/badge/demos/taro/demo6.tsx b/src/packages/badge/demos/taro/demo6.tsx
index bfaf5b92ea..a245e37280 100644
--- a/src/packages/badge/demos/taro/demo6.tsx
+++ b/src/packages/badge/demos/taro/demo6.tsx
@@ -1,27 +1,18 @@
import { User } from '@nutui/icons-react-taro'
import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
import React from 'react'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo6 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
- {renderChildren()}
+
+
+ } />
-
- {renderChildren()}
+
+ } />
-
- {renderChildren()}
+
+ } />
|
)
diff --git a/src/packages/badge/demos/taro/demo7.tsx b/src/packages/badge/demos/taro/demo7.tsx
index 2aecef14b1..089388c9ae 100644
--- a/src/packages/badge/demos/taro/demo7.tsx
+++ b/src/packages/badge/demos/taro/demo7.tsx
@@ -1,18 +1,12 @@
import React from 'react'
import { Badge, Cell } from '@nutui/nutui-react-taro'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo7 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
-
-
+
+
+
+
|
)
}
diff --git a/src/packages/badge/demos/taro/demo8.tsx b/src/packages/badge/demos/taro/demo8.tsx
index 75f1be594f..48bfc0d3c5 100644
--- a/src/packages/badge/demos/taro/demo8.tsx
+++ b/src/packages/badge/demos/taro/demo8.tsx
@@ -1,27 +1,25 @@
+import React from 'react'
import { User } from '@nutui/icons-react-taro'
import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
-import React from 'react'
-import pxTransform from '@/utils/px-transform'
-import { harmonyAndRn } from '@/utils/platform-taro'
const Demo8 = () => {
- const isRnAndHarmony = harmonyAndRn()
- const renderChildren = () => {
- return } shape="square" />
- }
- const marginStyles = isRnAndHarmony
- ? { marginRight: pxTransform(40) }
- : { marginInlineEnd: '40px' }
return (
-
-
- {renderChildren()}
+
+
+ } shape="square" />
-
- {renderChildren()}
+
+ } shape="square" />
-
- {renderChildren()}
+
+ } shape="square" />
|
)
diff --git a/src/packages/badge/doc.en-US.md b/src/packages/badge/doc.en-US.md
index 90f1f32589..ca72b96ac2 100644
--- a/src/packages/badge/doc.en-US.md
+++ b/src/packages/badge/doc.en-US.md
@@ -83,9 +83,10 @@ import { Badge } from '@nutui/nutui-react'
| value | value to show, eg number、charctor and custom content | `ReactNode` | `-` |
| max | when value is number, it's the max size | `number` | `99` |
| dot | Is dotted, When `value` is a custom content, dot does not take effect | `boolean` | `false` |
-| top | Up and down offset, support unit setting, can be set to: "0" or 0, etc. | `string` \| `number` | `"0"` |
-| right | Left and right offset, support unit setting, can be set to: "5" or 5, etc. | `string` \| `number` | `"5"` |
-| color | background color,the default value is the theme primary color | `string` | `-` |
+
+| size | dot size, effective when dot is equal to `true` | `small` \| `normal` \| `large` | `large` |
+| top | Up and down offset, can be set to: "0" or 0, etc. | `string` \| `number` | `0` |
+| right | Left and right offset, can be set to: "0" or 0, etc. | `string` \| `number` | `0` |
| fill | Fill Mode | `solid` \| `outline` | `solid` |
## Theming
@@ -96,17 +97,21 @@ The component provides the following CSS variables, which can be used to customi
| Name | Description | Default |
| --- | --- | --- |
-| \--nutui-badge-height | badge height | `14px` |
-| \--nutui-badge-background-color | badge background color | `linear-gradient(135deg, $color-primary 0%, $color-primary-stop-2 100%))` |
-| \--nutui-badge-color | badge content color | `#fff` |
-| \--nutui-badge-font-size | badge content font size | `$font-size-s` |
-| \--nutui-badge-border | badge border | `0px solid $color-primary-text` |
-| \--nutui-badge-border-radius | badge border-radius | `14px` |
-| \--nutui-badge-min-width | badge min-width | `5px` |
-| \--nutui-badge-padding | badge padding value | `0 5px` |
-| \--nutui-badge-icon-padding | when badge is icon,badge padding | `2px` |
-| \--nutui-badge-icon-size | when badge is icon,badge size | `12px` |
-| \--nutui-badge-content-transform | badge content transform | `translateY(-50%) translateX(100%)` |
-| \--nutui-badge-z-index | when badge is icon, badge z-index | `1` |
-| \--nutui-badge-dot-width | when badge is dot, the dot width,height and border radius | `7px` |
-| \--nutui-badge-dot-border | when badge is dot, the dot border | `0px solid $color-primary-text` |
+| \--nutui-badge-height | The height of the badge | `14px` |
+| \--nutui-badge-background-color | badge background color | `$color-primary` |
+| \--nutui-badge-color | badge content color value | `$color-primary-text)` |
+| \--nutui-badge-font-size | badge content font size | `$font-size-xxs` |
+| \--nutui-badge-border | badge border | `1px solid $color-primary-text` |
+| \--nutui-badge-border-radius | badge border rounded corners | `14px` |
+| \--nutui-badge-min-width | badge minimum width | `6px` |
+| \--nutui-badge-padding | badge’s padding value | `1px 4px` |
+| \--nutui-badge-icon-padding | The padding value when badge is a custom icon | `2px` |
+| \--nutui-badge-icon-size | The size of badge when it is a custom icon | `10px` |
+| \--nutui-badge-content-transform | badge content position | `translate(50%, -50%)` |
+| \--nutui-badge-z-index | badge z-index when customizing the icon | `1` |
+| \--nutui-badge-dot-width | When the badge is a dot, the size is equal to the width and height of normal | `6px` |
+| \--nutui-badge-dot-small-width | When badge is a dot, size is equal to the width and height of small | `4px` |
+| \--nutui-badge-dot-large-width | When the badge is a dot, size is equal to the width and height of large | `8px` |
+| \--nutui-badge-dot-border | The border when the badge is a dot | `1px solid $color-primary-text` |
+| \--nutui-badge-outline-color | The border when badge is outline text color value | `$color-primary` |
+| \--nutui-badge-outline-border | The border when badge is outline fill mode | `1px solid $color-primary-text` |
diff --git a/src/packages/badge/doc.md b/src/packages/badge/doc.md
index a6643dfebb..17d94c954c 100644
--- a/src/packages/badge/doc.md
+++ b/src/packages/badge/doc.md
@@ -83,9 +83,9 @@ import { Badge } from '@nutui/nutui-react'
| value | 显示的内容,支持数字、字符和自定义内容 | `ReactNode` | `-` |
| max | value 为数值时,最大值 | `number` | `99` |
| dot | 是否为小点,当`value`值为自定义内容时,dot不生效 | `boolean` | `false` |
-| top | 上下偏移量,支持单位设置,可设置为:"0"或0 等 | `string` \| `number` | `"0"` |
-| right | 左右偏移量,支持单位设置,可设置为:"5"或5 等 | `string` \| `number` | `"5"` |
-| color | 徽标背景颜色,默认值为当前主题色 | `string` | `-` |
+| size | dot 尺寸,当 dot 等于 `true` 时生效 | `small` \| `normal` \| `large` | `large` |
+| top | 上下偏移量,可设置为:"0"或0 等 | `string` \| `number` | `0` |
+| right | 左右偏移量,可设置为:"0"或0 等 | `string` \| `number` | `0` |
| fill | 填充模式 | `solid` \| `outline` | `solid` |
## 主题定制
@@ -97,16 +97,20 @@ import { Badge } from '@nutui/nutui-react'
| 名称 | 说明 | 默认值 |
| --- | --- | --- |
| \--nutui-badge-height | badge 的高度 | `14px` |
-| \--nutui-badge-background-color | badge 背景色 | `linear-gradient(135deg, $color-primary 0%, $color-primary-stop-2 100%))` |
-| \--nutui-badge-color | badge 内容色值 | `#fff` |
-| \--nutui-badge-font-size | badge 内容字号 | `$font-size-s` |
-| \--nutui-badge-border | badge 边框 | `0px solid $color-primary-text` |
+| \--nutui-badge-background-color | badge 背景色 | `$color-primary` |
+| \--nutui-badge-color | badge 内容色值 | `$color-primary-text` |
+| \--nutui-badge-font-size | badge 内容字号 | `$font-size-xxs` |
+| \--nutui-badge-border | badge 边框 | `1px solid $color-primary-text` |
| \--nutui-badge-border-radius | badge 边框圆角 | `14px` |
-| \--nutui-badge-min-width | badge 最小宽度 | `5px` |
-| \--nutui-badge-padding | badge 的padding值 | `0 5px` |
+| \--nutui-badge-min-width | badge 最小宽度 | `6px` |
+| \--nutui-badge-padding | badge 的padding值 | `1px 4px` |
| \--nutui-badge-icon-padding | badge 为自定义icon时 的 padding值 | `2px` |
-| \--nutui-badge-icon-size | badge 为自定义icon时 的 size | `12px` |
-| \--nutui-badge-content-transform | badge 内容位置 | `translateY(-50%) translateX(100%)` |
+| \--nutui-badge-icon-size | badge 为自定义icon时 的 size | `10px` |
+| \--nutui-badge-content-transform | badge 内容位置 | `translate(50%, -50%)` |
| \--nutui-badge-z-index | badge 自定义icon时的z-index | `1` |
-| \--nutui-badge-dot-width | badge 为圆点时的宽度、高度、圆角 | `7px` |
-| \--nutui-badge-dot-border | badge 为圆点时的边框 | `0px solid $color-primary-text` |
+| \--nutui-badge-dot-width | badge 为圆点时,size 等于 normal 的宽高 | `6px` |
+| \--nutui-badge-dot-small-width | badge 为圆点时,size 等于 small 的宽高 | `4px` |
+| \--nutui-badge-dot-large-width | badge 为圆点时,size 等于 large 的宽高 | `8px` |
+| \--nutui-badge-dot-border | badge 为圆点时的边框 | `1px solid $color-primary-text` |
+| \--nutui-badge-outline-color | badge 为 outline 文字色值 | `$color-primary` |
+| \--nutui-badge-outline-border | badge 为 outline 填充模式时的边框 | `1px solid $color-primary-text` |
diff --git a/src/packages/badge/doc.taro.md b/src/packages/badge/doc.taro.md
index c1eb009cb6..c7aaed3911 100644
--- a/src/packages/badge/doc.taro.md
+++ b/src/packages/badge/doc.taro.md
@@ -83,9 +83,9 @@ import { Badge } from '@nutui/nutui-react-taro'
| value | 显示的内容,支持数字、字符和自定义内容 | `ReactNode` | `-` |
| max | value 为数值时,最大值 | `number` | `99` |
| dot | 是否为小点,当`value`值为自定义内容时,dot不生效 | `boolean` | `false` |
-| top | 上下偏移量,支持单位设置,可设置为:"0"或0 等 | `string` \| `number` | `"0"` |
-| right | 左右偏移量,支持单位设置,可设置为:"5"或5 等 | `string` \| `number` | `"5"` |
-| color | 徽标背景颜色 | `string` | `-` |
+| size | dot 尺寸,当 dot 等于 `true` 时生效 | `small` \| `normal` \| `large` | `large` |
+| top | 上下偏移量,可设置为:"0"或0 等 | `string` \| `number` | `"0"` |
+| right | 左右偏移量,可设置为:"0"或0 等 | `string` \| `number` | `"0"` |
| fill | 填充模式 | `solid` \| `outline` | `solid` |
## 主题定制
@@ -97,16 +97,20 @@ import { Badge } from '@nutui/nutui-react-taro'
| 名称 | 说明 | 默认值 |
| --- | --- | --- |
| \--nutui-badge-height | badge 的高度 | `14px` |
-| \--nutui-badge-background-color | badge 背景色 | `linear-gradient(135deg, $color-primary 0%, $color-primary-stop-2 100%))` |
-| \--nutui-badge-color | badge 内容色值 | `#fff` |
-| \--nutui-badge-font-size | badge 内容字号 | `$font-size-s` |
-| \--nutui-badge-border | badge 边框 | `0px solid $color-primary-text` |
+| \--nutui-badge-background-color | badge 背景色 | `$color-primary` |
+| \--nutui-badge-color | badge 内容色值 | `$color-primary-text` |
+| \--nutui-badge-font-size | badge 内容字号 | `$font-size-xxs` |
+| \--nutui-badge-border | badge 边框 | `1px solid $color-primary-text` |
| \--nutui-badge-border-radius | badge 边框圆角 | `14px` |
-| \--nutui-badge-min-width | badge 最小宽度 | `5px` |
-| \--nutui-badge-padding | badge 的padding值 | `0 5px` |
+| \--nutui-badge-min-width | badge 最小宽度 | `6px` |
+| \--nutui-badge-padding | badge 的padding值 | `1px 4px` |
| \--nutui-badge-icon-padding | badge 为自定义icon时 的 padding值 | `2px` |
-| \--nutui-badge-icon-size | badge 为自定义icon时 的 size | `12px` |
-| \--nutui-badge-content-transform | badge 内容位置 | `translateY(-50%) translateX(100%)` |
+| \--nutui-badge-icon-size | badge 为自定义icon时 的 size | `10px` |
+| \--nutui-badge-content-transform | badge 内容位置 | `translate(50%, -50%)` |
| \--nutui-badge-z-index | badge 自定义icon时的z-index | `1` |
-| \--nutui-badge-dot-width | badge 为圆点时的宽度、高度、圆角 | `7px` |
-| \--nutui-badge-dot-border | badge 为圆点时的边框 | `0px solid $color-primary-text` |
+| \--nutui-badge-dot-width | badge 为圆点时,size 等于 normal 的宽高 | `6px` |
+| \--nutui-badge-dot-small-width | badge 为圆点时,size 等于 small 的宽高 | `4px` |
+| \--nutui-badge-dot-large-width | badge 为圆点时,size 等于 large 的宽高 | `8px` |
+| \--nutui-badge-dot-border | badge 为圆点时的边框 | `1px solid $color-primary-text` |
+| \--nutui-badge-outline-color | badge 为 outline 文字色值 | `$color-primary` |
+| \--nutui-badge-outline-border | badge 为 outline 填充模式时的边框 | `1px solid $color-primary-text` |
diff --git a/src/packages/badge/doc.zh-TW.md b/src/packages/badge/doc.zh-TW.md
index 8637392947..947d9ef103 100644
--- a/src/packages/badge/doc.zh-TW.md
+++ b/src/packages/badge/doc.zh-TW.md
@@ -83,9 +83,9 @@ import { Badge } from '@nutui/nutui-react'
| value | 顯示的內容,支持數字、字符和自定義內容 | `ReactNode` | `-` |
| max | value 為數值時,最大值 | `number` | `99` |
| dot | 是否為小點,當`value`值為自定義內容時,dot不生效 | `boolean` | `false` |
-| top | 上下偏移量,支持單位設置,可設置為:"0"或0 等 | `string` \| `number` | `"0"` |
-| right | 左右偏移量,支持單位設置,可設置為:"5"或5 等 | `string` \| `number` | `"5"` |
-| color | 徽標背景顏色,默認值為當前主題色 | `string` | `-` |
+| size | dot 尺寸,當 dot 等於 `true` 時生效 | `small` \| `normal` \| `large` | `large` |
+| top | 上下偏移量,可設置為:"0"或0 等 | `string` \| `number` | `0` |
+| right | 左右偏移量,可設置為:"0"或0 等 | `string` \| `number` | `0` |
| fill | 填充模式 | `solid` \| `outline` | `solid` |
## 主題定制
@@ -97,16 +97,20 @@ import { Badge } from '@nutui/nutui-react'
| 名稱 | 說明 | 默認值 |
| --- | --- | --- |
| \--nutui-badge-height | badge 的高度 | `14px` |
-| \--nutui-badge-background-color | badge 背景色 | `linear-gradient(135deg, $color-primary 0%, $color-primary-stop-2 100%))` |
-| \--nutui-badge-color | badge 內容色值 | `#fff` |
-| \--nutui-badge-font-size | badge 內容字號 | `$font-size-s` |
-| \--nutui-badge-border | badge 邊框 | `0px solid $color-primary-text` |
+| \--nutui-badge-background-color | badge 背景色 | `$color-primary` |
+| \--nutui-badge-color | badge 內容色值 | `$color-primary-text)` |
+| \--nutui-badge-font-size | badge 內容字號 | `$font-size-xxs` |
+| \--nutui-badge-border | badge 邊框 | `1px solid $color-primary-text` |
| \--nutui-badge-border-radius | badge 邊框圓角 | `14px` |
-| \--nutui-badge-min-width | badge 最小寬度 | `5px` |
-| \--nutui-badge-padding | badge 的padding值 | `0 5px` |
+| \--nutui-badge-min-width | badge 最小寬度 | `6px` |
+| \--nutui-badge-padding | badge 的padding值 | `1px 4px` |
| \--nutui-badge-icon-padding | badge 為自定義icon時 的 padding值 | `2px` |
-| \--nutui-badge-icon-size | badge 為自定義icon時 的 size | `12px` |
-| \--nutui-badge-content-transform | badge 內容位置 | `translateY(-50%) translateX(100%)` |
+| \--nutui-badge-icon-size | badge 為自定義icon時 的 size | `10px` |
+| \--nutui-badge-content-transform | badge 內容位置 | `translate(50%, -50%)` |
| \--nutui-badge-z-index | badge 自定義icon時的z-index | `1` |
-| \--nutui-badge-dot-width | badge 為圓點時的寬度、高度、圓角 | `7px` |
-| \--nutui-badge-dot-border | badge 為圓點時的邊框 | `0px solid $color-primary-text` |
+| \--nutui-badge-dot-width | badge 為圓點時,size 等於 normal 的寬高 | `6px` |
+| \--nutui-badge-dot-small-width | badge 為圓點時,size 等於 small 的寬高 | `4px` |
+| \--nutui-badge-dot-large-width | badge 為圓點時,size 等於 large 的寬高 | `8px` |
+| \--nutui-badge-dot-border | badge 為圓點時的邊框 | `1px solid $color-primary-text` |
+| \--nutui-badge-outline-color | badge 為 outline 文字色值 | `$color-primary` |
+| \--nutui-badge-outline-border | badge 為 outline 填充模式時的邊框 | `1px solid $color-primary-text` |
diff --git a/src/packages/badge/index.taro.ts b/src/packages/badge/index.taro.ts
index 3191faeb66..3ce5d6af76 100644
--- a/src/packages/badge/index.taro.ts
+++ b/src/packages/badge/index.taro.ts
@@ -1,4 +1,4 @@
import { Badge } from './badge.taro'
-export type { BadgeFill, BadgeProps } from './badge.taro'
+export type { BadgeFill, BadgeDotSize, BadgeProps } from './types'
export default Badge
diff --git a/src/packages/badge/index.ts b/src/packages/badge/index.ts
index 89062c5a6d..77131479f3 100644
--- a/src/packages/badge/index.ts
+++ b/src/packages/badge/index.ts
@@ -1,4 +1,4 @@
import { Badge } from './badge'
-export type { BadgeFill, BadgeProps } from './badge'
+export type { BadgeFill, BadgeDotSize, BadgeProps } from './types'
export default Badge
diff --git a/src/packages/badge/types.ts b/src/packages/badge/types.ts
new file mode 100644
index 0000000000..473b24078d
--- /dev/null
+++ b/src/packages/badge/types.ts
@@ -0,0 +1,14 @@
+import { BasicComponent } from '@/utils/typings'
+
+export type BadgeFill = 'solid' | 'outline'
+export type BadgeDotSize = 'small' | 'normal' | 'large'
+
+export interface BadgeProps extends BasicComponent {
+ value: React.ReactNode
+ dot: boolean
+ max: number
+ top: string | number
+ right: string | number
+ fill: BadgeFill
+ size: BadgeDotSize
+}
diff --git a/src/packages/tabbar/__tests__/__snapshots__/tabbar.spec.tsx.snap b/src/packages/tabbar/__tests__/__snapshots__/tabbar.spec.tsx.snap
index 2c1b62f27f..e09c341b1f 100644
--- a/src/packages/tabbar/__tests__/__snapshots__/tabbar.spec.tsx.snap
+++ b/src/packages/tabbar/__tests__/__snapshots__/tabbar.spec.tsx.snap
@@ -1,5 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`should only render title 1`] = `""`;
+exports[`should only render title 1`] = `""`;
exports[`should render fixed element when using bottom prop 1`] = `""`;
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index e995510c55..1c573916cc 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -1602,26 +1602,33 @@ $tag-mark-border-radius: var(
$badge-height: var(--nutui-badge-height, 14px) !default;
$badge-background-color: var(
--nutui-badge-background-color,
- $color-primary-gradient-1
+ $color-primary
) !default;
-$badge-color: var(--nutui-badge-color, #fff) !default;
+$badge-color: var(--nutui-badge-color, $color-primary-text) !default;
$badge-font-size: var(--nutui-badge-font-size, $font-size-xxs) !default;
$badge-border: var(
--nutui-badge-border,
- 0px solid $color-primary-text
+ 1px solid $color-primary-text
) !default;
$badge-border-radius: var(--nutui-badge-border-radius, $badge-height) !default;
-$badge-min-width: var(--nutui-badge-min-width, 5px) !default;
-$badge-padding: var(--nutui-badge-padding, 0 4px) !default;
-$badge-icon-padding: var(--nutui-badge-icon-padding, 3px) !default;
-$badge-icon-size: var(--nutui-badge-icon-size, 12px) !default;
+$badge-min-width: var(--nutui-badge-min-width, 6px) !default;
+$badge-padding: var(--nutui-badge-padding, 1px 4px) !default;
+$badge-icon-padding: var(--nutui-badge-icon-padding, 2px) !default;
+$badge-icon-size: var(--nutui-badge-icon-size, 10px) !default;
$badge-content-transform: var(
--nutui-badge-content-transform,
- translateX(100%)
+ translate(50%, -50%)
) !default;
$badge-z-index: var(--nutui-badge-z-index, 1) !default;
-$badge-dot-width: var(--nutui-badge-dot-width, 7px) !default;
-$badge-dot-border: var(--nutui-badge-dot-border, 0px solid $color-primary-text);
+$badge-dot-width: var(--nutui-badge-dot-width, 6px) !default;
+$badge-dot-small-width: var(--nutui-badge-dot-width, 4px) !default;
+$badge-dot-large-width: var(--nutui-badge-dot-width, 8px) !default;
+$badge-dot-border: var(--nutui-badge-dot-border, 1px solid $color-primary-text);
+$badge-outline-color: var(--nutui-badge-outline-color, $color-primary) !default;
+$badge-outline-border: var(
+ --nutui-badge-outline-border,
+ 1px solid $color-primary
+);
//popover(✅)
$popover-border-radius: var(--nutui-popover-border-radius, 8px) !default;
| | | | | | | | |