Skip to content

Commit

Permalink
fix: fix return types of coral
Browse files Browse the repository at this point in the history
  • Loading branch information
wwsun committed Sep 29, 2022
1 parent 9fbafc0 commit b17617d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/coral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ interface CoralOption<P> {
* @param options 自定义选项
* @returns react component
*/
export function coral<T extends As, P = {}>(component: T, initCss?: CoralProps['css'], options?: CoralOption<P>) {
export function coral<T extends As, P = {}>(
component: T,
initCss?: CoralProps['css'],
options?: CoralOption<P>,
): CoralComponent<T, P> {
const attrs = typeof options?.attrs === 'function' ? options?.attrs : () => options?.attrs;
const shouldForward = options?.shouldForwardProp || shouldForwardProp;
return styled(component as React.ComponentType<any>)
Expand All @@ -40,5 +44,5 @@ export function coral<T extends As, P = {}>(component: T, initCss?: CoralProps['
${initCss}
${allStyledProps}
${cssProps}
` as CoralComponent<T, P>;
`;
}
1 change: 1 addition & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const defaultTheme: ThemeType = {
focus: 'colors.primary.60',
hover: 'colors.primary.50',
active: 'colors.primary.70',
disabled: 'colors.primary.10',
},
background: {
normal: 'colors.gray.10',
Expand Down

0 comments on commit b17617d

Please sign in to comment.