diff --git a/package.json b/package.json index 1701cc0..fcd17b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zens", - "version": "0.0.12", + "version": "0.0.14", "description": "MarkFlowy's ui component library.", "keywords": [], "homepage": "https://github.com/drl990114/zens#readme", diff --git a/src/Button/demo/btnType.tsx b/src/Button/demo/btnType.tsx new file mode 100644 index 0000000..edcf79c --- /dev/null +++ b/src/Button/demo/btnType.tsx @@ -0,0 +1,9 @@ +import { Button, Space } from 'zens'; + +export default () => { + + return + + + +} diff --git a/src/Button/index.md b/src/Button/index.md index b144f91..2dae74c 100644 --- a/src/Button/index.md +++ b/src/Button/index.md @@ -15,3 +15,7 @@ group: ### 基本用法 + +### 按钮类型 + + diff --git a/src/Button/index.ts b/src/Button/index.ts index b920264..405315e 100644 --- a/src/Button/index.ts +++ b/src/Button/index.ts @@ -36,7 +36,9 @@ const Button: IStyledComponent<'web', ButtonProps> = styled(AkButton).attrs ({ ...props, }), -)` +).withConfig({ + shouldForwardProp: (propName: string) => propName !== 'btnType' && propName !== 'size', +})` display: flex; user-select: none; align-items: center; diff --git a/src/Theme/ThemeProvider.tsx b/src/Theme/ThemeProvider.tsx index f5693f0..f26e32b 100644 --- a/src/Theme/ThemeProvider.tsx +++ b/src/Theme/ThemeProvider.tsx @@ -37,8 +37,8 @@ export const ThemeProvider: React.FC = ({ theme, children }: Props) => { function shouldForwardProp(propName: string, target: any) { if (typeof target === 'string') { // For HTML elements, forward the prop if it is a valid HTML attribute - return isPropValid(propName); + return isPropValid(propName) } // For other elements, forward all props - return true; + return true } diff --git a/src/Theme/dark.ts b/src/Theme/dark.ts index 6552cb9..24b99f9 100644 --- a/src/Theme/dark.ts +++ b/src/Theme/dark.ts @@ -1,7 +1,7 @@ export const styledDarkTheme = { primaryFontColor: '#c8d1d9', labelFontColor: 'rgba(255, 255, 255, 0.5)', - accentColor: '#1c78aa', + accentColor: '#016ab3', borderColor: '#363b41', bgColor: '#05010d', hoverColor: '#1f2225', diff --git a/src/Theme/light.ts b/src/Theme/light.ts index e706431..6c58562 100644 --- a/src/Theme/light.ts +++ b/src/Theme/light.ts @@ -1,7 +1,7 @@ export const styledLightTheme = { primaryFontColor: '#000000', labelFontColor: '#9ca3af', - accentColor: '#0369a1', + accentColor: '#007acc', borderColor: '#d7d7dc', bgColor: '#fdfdfd', hoverColor: '#d7d7dc',