You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/base.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc <1075746765@qq.com> * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/interface.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: 栗嘉男 <lijianan@lijianandeMacBook-Pro.local>
2 years ago
import { resetComponent } from '../../style';
import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/base.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc <1075746765@qq.com> * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/interface.ts Co-authored-by: MadCcc <1075746765@qq.com> * Update components/qrcode/style/index.ts Co-authored-by: MadCcc <1075746765@qq.com> * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc <1075746765@qq.com> * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: 栗嘉男 <lijianan@lijianandeMacBook-Pro.local>
2 years ago
export interface ComponentToken {}
interface QRCodeToken extends FullToken<'QRCode'> {
QRCodeExpiredTextColor: string;
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/interface.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; Co-authored-by: 栗嘉男 &lt;lijianan@lijianandeMacBook-Pro.local&gt;
2 years ago
QRCodeMaskBackgroundColor: string;
}
const genQRCodeStyle: GenerateStyle<QRCodeToken> = (token) => {
const { componentCls } = token;
return {
[componentCls]: {
...resetComponent(token),
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
padding: token.paddingSM,
backgroundColor: token.colorWhite,
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/interface.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; Co-authored-by: 栗嘉男 &lt;lijianan@lijianandeMacBook-Pro.local&gt;
2 years ago
borderRadius: token.borderRadiusLG,
border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
position: 'relative',
width: '100%',
height: '100%',
overflow: 'hidden',
[`& > ${componentCls}-mask`]: {
position: 'absolute',
insetBlockStart: 0,
insetInlineStart: 0,
zIndex: 10,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
color: token.colorText,
lineHeight: token.lineHeight,
background: token.QRCodeMaskBackgroundColor,
textAlign: 'center',
[`& > ${componentCls}-expired`]: {
color: token.QRCodeExpiredTextColor,
},
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/interface.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; Co-authored-by: 栗嘉男 &lt;lijianan@lijianandeMacBook-Pro.local&gt;
2 years ago
},
'&-icon': {
marginBlockEnd: token.marginXS,
fontSize: token.controlHeight,
},
},
[`${componentCls}-borderless`]: {
borderColor: 'transparent',
},
};
};
export default genComponentStyleHook<'QRCode'>('QRCode', (token) =>
genQRCodeStyle(
mergeToken<QRCodeToken>(token, {
QRCodeExpiredTextColor: 'rgba(0, 0, 0, 0.88)',
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/interface.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; Co-authored-by: 栗嘉男 &lt;lijianan@lijianandeMacBook-Pro.local&gt;
2 years ago
QRCodeMaskBackgroundColor: 'rgba(255, 255, 255, 0.96)',
}),
),
);