Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(design & ui): TS type error for component token #132

Merged
merged 5 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/design/src/button/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const genButtonStyle: GenerateStyle<ButtonToken> = (token: ButtonToken) =

export default (prefixCls: string) => {
const useStyle = genComponentStyleHook('Button', token => {
return [genButtonStyle(token)];
return [genButtonStyle(token as ButtonToken)];
});
return useStyle(prefixCls);
};
2 changes: 1 addition & 1 deletion packages/design/src/card/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const genCardStyle: GenerateStyle<CardToken> = (token: CardToken): CSSObj
...token,
componentCls: tabsComponentCls,
prefixCls: tabsPrefixCls,
}),
} as CardToken),
},
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/descriptions/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default (prefixCls: string, typographyPrefixCls: string) => {
...token,
typographyPrefixCls,
typographyComponentCls: `.${typographyPrefixCls}`,
}),
} as DescriptionsToken),
];
});
return useStyle(prefixCls);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,36 +192,36 @@ exports[`Modal.Progress render with progress.percent 1`] = `
<svg
class="ant-progress-circle"
role="presentation"
viewBox="-50 -50 100 100"
viewBox="0 0 100 100"
>
<circle
class="ant-progress-circle-trail"
cx="0"
cy="0"
cx="50"
cy="50"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="1"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 121.12388377497624; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 121.12388377497624; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="0"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
</svg>
<span
Expand Down Expand Up @@ -334,36 +334,36 @@ exports[`Modal.Progress render with progress.status 1`] = `
<svg
class="ant-progress-circle"
role="presentation"
viewBox="-50 -50 100 100"
viewBox="0 0 100 100"
>
<circle
class="ant-progress-circle-trail"
cx="0"
cy="0"
cx="50"
cy="50"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="0"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="0"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
</svg>
<span
Expand Down Expand Up @@ -494,36 +494,36 @@ exports[`Modal.Progress render without description 1`] = `
<svg
class="ant-progress-circle"
role="presentation"
viewBox="-50 -50 100 100"
viewBox="0 0 100 100"
>
<circle
class="ant-progress-circle-trail"
cx="0"
cy="0"
cx="50"
cy="50"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="0"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
<circle
class="ant-progress-circle-path"
cx="0"
cy="0"
cx="50"
cy="50"
opacity="0"
r="47"
stroke-linecap="round"
stroke-width="6"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 0 0; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
style="stroke: #52C41A; stroke-dasharray: 295.3097094374406px 295.3097094374406; stroke-dashoffset: 295.2997094374406; transform: rotate(-90deg); transform-origin: 50px 50px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s; fill-opacity: 0; transition-duration: 0s, 0s;"
/>
</svg>
<span
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const genTableStyle: GenerateStyle<TableToken> = (token: TableToken): CSS

export default (prefixCls: string) => {
const useStyle = genComponentStyleHook('Table', token => {
return [genTableStyle(token)];
return [genTableStyle(token as TableToken)];
});
return useStyle(prefixCls);
};
2 changes: 1 addition & 1 deletion packages/ui/src/BasicLayout/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const genBasicLayoutStyle: GenerateStyle<BasicLayoutToken> = (

export default (prefixCls: string) => {
const useStyle = genComponentStyleHook('BasicLayout', token => {
return [genBasicLayoutStyle(token)];
return [genBasicLayoutStyle(token as BasicLayoutToken)];
});
return useStyle(prefixCls);
};
2 changes: 1 addition & 1 deletion packages/ui/src/PageContainer/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const genPageContainerStyle: GenerateStyle<PageContainerToken> = (

export default (prefixCls: string) => {
const useStyle = genComponentStyleHook('PageContainer', token => {
return [genPageContainerStyle(token)];
return [genPageContainerStyle(token as PageContainerToken)];
});
return useStyle(prefixCls);
};
Loading