@digitalc/dxp-ui 0.0.4 → 0.0.5-alpha-gomo.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -11
- package/es/assets/iconFont/demo.css +539 -0
- package/es/assets/iconFont/demo_index.html +4400 -0
- package/es/assets/iconFont/iconfont.css +22 -6
- package/es/assets/iconFont/iconfont.eot +0 -0
- package/es/assets/iconFont/iconfont.json +28 -0
- package/es/assets/iconFont/iconfont.svg +8 -0
- package/es/assets/iconFont/iconfont.ttf +0 -0
- package/es/assets/iconFont/iconfont.woff +0 -0
- package/es/assets/iconFont/iconfont.woff2 +0 -0
- package/es/assets/react.svg +1 -0
- package/es/assets/token.json +902 -238
- package/es/components/Accordion/designTokens.d.ts +11 -0
- package/es/components/Accordion/designTokens.js +16 -0
- package/es/components/Accordion/index.d.ts +21 -0
- package/es/components/Accordion/index.js +77 -0
- package/es/components/Accordion/style/index.less +14 -0
- package/es/components/Accordion/style/variables.less +4 -0
- package/es/components/Amount/designTokens.d.ts +6 -0
- package/es/components/Amount/designTokens.js +9 -0
- package/es/components/Amount/index.d.ts +23 -0
- package/es/components/Amount/index.js +144 -0
- package/es/components/Amount/style/index.less +10 -0
- package/es/components/Amount/style/variables.less +4 -0
- package/es/components/Button/designTokens.js +6 -7
- package/es/components/Button/index.d.ts +17 -22
- package/es/components/Button/index.js +85 -46
- package/es/components/Button/style/{button.less → index.less} +6 -2
- package/es/components/Chip/designTokens.d.ts +15 -0
- package/es/components/Chip/designTokens.js +22 -0
- package/es/components/Chip/index.d.ts +13 -0
- package/es/components/Chip/index.js +98 -0
- package/es/components/Chip/style/index.less +9 -0
- package/es/components/Chip/style/variables.less +4 -0
- package/es/components/Divider/index.d.ts +16 -0
- package/es/components/Divider/index.js +55 -0
- package/es/components/Divider/style/index.less +78 -0
- package/es/components/Divider/style/variables.less +4 -0
- package/es/components/Drawer/designTokens.d.ts +16 -0
- package/es/components/Drawer/designTokens.js +27 -0
- package/es/components/Drawer/index.d.ts +21 -0
- package/es/components/Drawer/index.js +189 -0
- package/es/components/Drawer/style/index.less +73 -0
- package/es/components/Drawer/style/variables.less +8 -0
- package/es/components/Icon/Icon.d.ts +9 -0
- package/es/components/Icon/Icon.js +18 -0
- package/es/components/Icon/designTokens.d.ts +6 -0
- package/es/components/Icon/designTokens.js +7 -0
- package/es/components/Icon/index.d.ts +12 -0
- package/es/components/Icon/index.js +29 -0
- package/es/components/IconButton/designTokens.d.ts +21 -0
- package/es/components/IconButton/designTokens.js +39 -0
- package/es/components/IconButton/index.d.ts +24 -0
- package/es/components/IconButton/index.js +106 -0
- package/es/components/IconButton/style/index.less +59 -0
- package/es/components/IconButton/style/variables.less +5 -0
- package/es/components/IconButtonGroup/index.d.ts +15 -0
- package/es/components/IconButtonGroup/index.js +22 -0
- package/es/components/Image/index.d.ts +12 -0
- package/es/components/Image/index.js +33 -0
- package/es/components/ListItem/designTokens.d.ts +30 -0
- package/es/components/ListItem/designTokens.js +31 -0
- package/es/components/ListItem/index.d.ts +60 -0
- package/es/components/ListItem/index.js +227 -0
- package/es/components/ListItem/style/index.less +77 -0
- package/es/components/ListItem/style/variables.less +1 -0
- package/es/components/Modal/designTokens.d.ts +31 -0
- package/es/components/Modal/designTokens.js +35 -0
- package/es/components/Modal/index.d.ts +14 -0
- package/es/components/Modal/index.js +101 -0
- package/es/components/Modal/style/index.less +92 -0
- package/es/components/Modal/style/variables.less +5 -0
- package/es/components/Navigation/designTokens.d.ts +16 -0
- package/es/components/Navigation/designTokens.js +19 -0
- package/es/components/Navigation/index.d.ts +31 -0
- package/es/components/Navigation/index.js +110 -0
- package/es/components/Navigation/style/index.less +52 -0
- package/es/components/Navigation/style/variables.less +1 -0
- package/es/components/Search/designTokens.d.ts +34 -0
- package/es/components/Search/designTokens.js +51 -0
- package/es/components/Search/index.d.ts +13 -0
- package/es/components/Search/index.js +85 -0
- package/es/components/Search/style/index.less +32 -0
- package/es/components/Search/style/variables.less +5 -0
- package/es/components/Stepper/designTokens.d.ts +26 -0
- package/es/components/Stepper/designTokens.js +60 -0
- package/es/components/Stepper/index.d.ts +22 -0
- package/es/components/Stepper/index.js +153 -0
- package/es/components/Stepper/style/index.less +140 -0
- package/es/components/Stepper/style/variables.less +5 -0
- package/es/components/StickyFooter/designTokens.d.ts +10 -0
- package/es/components/StickyFooter/designTokens.js +17 -0
- package/es/components/StickyFooter/index.d.ts +17 -0
- package/es/components/StickyFooter/index.js +83 -0
- package/es/components/StickyFooter/style/index.less +18 -0
- package/es/components/StickyFooter/style/variables.less +4 -0
- package/es/components/Tabs/designTokens.d.ts +44 -0
- package/es/components/Tabs/designTokens.js +64 -0
- package/es/components/Tabs/index.d.ts +14 -0
- package/es/components/Tabs/index.js +102 -0
- package/es/components/Tabs/style/index.less +25 -0
- package/es/components/Tabs/style/variables.less +4 -0
- package/es/components/Tag/designTokens.d.ts +90 -0
- package/es/components/Tag/designTokens.js +124 -0
- package/es/components/Tag/index.d.ts +15 -0
- package/es/components/Tag/index.js +85 -0
- package/es/components/Tag/style/index.less +9 -0
- package/es/components/Tag/style/variables.less +4 -0
- package/es/components/Text/designTokens.d.ts +51 -0
- package/es/components/Text/designTokens.js +52 -0
- package/es/components/Text/index.d.ts +6 -25
- package/es/components/Text/index.js +69 -56
- package/es/components/Text/style/index.less +2 -0
- package/es/components/TextInputInside/designTokens.d.ts +38 -0
- package/es/components/TextInputInside/designTokens.js +59 -0
- package/es/components/TextInputInside/index.d.ts +10 -0
- package/es/components/TextInputInside/index.js +141 -0
- package/es/components/TextInputInside/style/index.less +36 -0
- package/es/components/TextInputInside/style/variables.less +5 -0
- package/es/components/TextInputOutside/designTokens.d.ts +41 -0
- package/es/components/TextInputOutside/designTokens.js +67 -0
- package/es/components/TextInputOutside/index.d.ts +18 -0
- package/es/components/TextInputOutside/index.js +66 -0
- package/es/components/TextInputOutside/style/index.less +4 -0
- package/es/components/TextInputOutside/style/variables.less +5 -0
- package/es/components/TextLink/designTokens.d.ts +10 -0
- package/es/components/TextLink/designTokens.js +11 -0
- package/es/components/TextLink/index.d.ts +20 -0
- package/es/components/TextLink/index.js +95 -0
- package/es/components/Toast/designTokens.d.ts +13 -0
- package/es/components/Toast/designTokens.js +20 -0
- package/es/components/Toast/index.d.ts +26 -0
- package/es/components/Toast/index.js +175 -0
- package/es/components/Toast/style/index.less +9 -0
- package/es/components/Toast/style/variables.less +12 -0
- package/es/components/Toggle/designTokens.d.ts +9 -0
- package/es/components/Toggle/designTokens.js +13 -0
- package/es/components/Toggle/index.d.ts +27 -0
- package/es/components/Toggle/index.js +21 -0
- package/es/components/index.d.ts +45 -0
- package/es/components/index.js +26 -2
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +2 -2
- package/es/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.svg +40549 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
- package/es/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
- package/es/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
- package/es/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
- package/es/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -2
- package/es/style/variables.less +53 -27
- package/es/tokens/DXPGlobal.d.ts +255 -193
- package/es/tokens/DXPGlobal.js +4 -3
- package/es/utils/noop.js +1 -2
- package/es/utils/scaleTool.d.ts +12 -0
- package/es/utils/scaleTool.js +48 -0
- package/es/utils/theme.d.ts +11 -0
- package/es/utils/theme.js +15 -0
- package/es/utils/themeContext.d.ts +35 -2
- package/es/utils/themeContext.js +27 -7
- package/es/utils/tokenHelper.js +1 -2
- package/es/utils/tokenManager.d.ts +110 -2
- package/es/utils/tokenManager.js +778 -724
- package/lib/assets/iconFont/demo.css +539 -0
- package/lib/assets/iconFont/demo_index.html +4400 -0
- package/lib/assets/iconFont/iconfont.css +750 -0
- package/lib/assets/iconFont/iconfont.eot +0 -0
- package/lib/assets/iconFont/iconfont.json +1290 -0
- package/lib/assets/iconFont/iconfont.svg +385 -0
- package/lib/assets/iconFont/iconfont.ttf +0 -0
- package/lib/assets/iconFont/iconfont.woff +0 -0
- package/lib/assets/iconFont/iconfont.woff2 +0 -0
- package/lib/assets/react.svg +1 -0
- package/lib/assets/token.json +903 -0
- package/lib/components/Accordion/designTokens.d.ts +11 -0
- package/lib/components/Accordion/designTokens.js +42 -0
- package/lib/components/Accordion/index.d.ts +21 -0
- package/lib/components/Accordion/index.js +96 -0
- package/lib/components/Accordion/style/index.less +14 -0
- package/lib/components/Accordion/style/variables.less +4 -0
- package/lib/components/Amount/designTokens.d.ts +6 -0
- package/lib/components/Amount/designTokens.js +33 -0
- package/lib/components/Amount/index.d.ts +23 -0
- package/lib/components/Amount/index.js +160 -0
- package/lib/components/Amount/style/index.less +10 -0
- package/lib/components/Amount/style/variables.less +4 -0
- package/lib/components/Button/demo/index.d.ts +3 -0
- package/lib/components/Button/demo/index.js +138 -0
- package/lib/components/Button/designTokens.d.ts +66 -0
- package/lib/components/Button/designTokens.js +139 -0
- package/lib/components/Button/index.d.ts +39 -0
- package/lib/components/Button/index.js +132 -0
- package/lib/components/Button/style/index.less +38 -0
- package/lib/components/Button/style/variables.less +5 -0
- package/lib/components/Chip/designTokens.d.ts +15 -0
- package/lib/components/Chip/designTokens.js +45 -0
- package/lib/components/Chip/index.d.ts +13 -0
- package/lib/components/Chip/index.js +178 -0
- package/lib/components/Chip/style/index.less +9 -0
- package/lib/components/Chip/style/variables.less +4 -0
- package/lib/components/Divider/index.d.ts +16 -0
- package/lib/components/Divider/index.js +111 -0
- package/lib/components/Divider/style/index.less +78 -0
- package/lib/components/Divider/style/variables.less +4 -0
- package/lib/components/Drawer/designTokens.d.ts +16 -0
- package/lib/components/Drawer/designTokens.js +62 -0
- package/lib/components/Drawer/index.d.ts +21 -0
- package/lib/components/Drawer/index.js +229 -0
- package/lib/components/Drawer/style/index.less +73 -0
- package/lib/components/Drawer/style/variables.less +8 -0
- package/lib/components/Icon/Icon.d.ts +9 -0
- package/lib/components/Icon/Icon.js +74 -0
- package/lib/components/Icon/designTokens.d.ts +6 -0
- package/lib/components/Icon/designTokens.js +41 -0
- package/lib/components/Icon/index.d.ts +12 -0
- package/lib/components/Icon/index.js +73 -0
- package/lib/components/IconButton/designTokens.d.ts +21 -0
- package/lib/components/IconButton/designTokens.js +61 -0
- package/lib/components/IconButton/index.d.ts +24 -0
- package/lib/components/IconButton/index.js +202 -0
- package/lib/components/IconButton/style/index.less +59 -0
- package/lib/components/IconButton/style/variables.less +5 -0
- package/lib/components/IconButtonGroup/index.d.ts +15 -0
- package/lib/components/IconButtonGroup/index.js +53 -0
- package/lib/components/Image/index.d.ts +12 -0
- package/lib/components/Image/index.js +102 -0
- package/lib/components/ListItem/designTokens.d.ts +30 -0
- package/lib/components/ListItem/designTokens.js +65 -0
- package/lib/components/ListItem/index.d.ts +60 -0
- package/lib/components/ListItem/index.js +348 -0
- package/lib/components/ListItem/style/index.less +77 -0
- package/lib/components/ListItem/style/variables.less +1 -0
- package/lib/components/Modal/designTokens.d.ts +31 -0
- package/lib/components/Modal/designTokens.js +88 -0
- package/lib/components/Modal/index.d.ts +14 -0
- package/lib/components/Modal/index.js +168 -0
- package/lib/components/Modal/style/index.less +92 -0
- package/lib/components/Modal/style/variables.less +5 -0
- package/lib/components/Navigation/designTokens.d.ts +16 -0
- package/lib/components/Navigation/designTokens.js +53 -0
- package/lib/components/Navigation/index.d.ts +31 -0
- package/lib/components/Navigation/index.js +174 -0
- package/lib/components/Navigation/style/index.less +52 -0
- package/lib/components/Navigation/style/variables.less +1 -0
- package/lib/components/Search/designTokens.d.ts +34 -0
- package/lib/components/Search/designTokens.js +77 -0
- package/lib/components/Search/index.d.ts +13 -0
- package/lib/components/Search/index.js +137 -0
- package/lib/components/Search/style/index.less +32 -0
- package/lib/components/Search/style/variables.less +5 -0
- package/lib/components/Stepper/designTokens.d.ts +26 -0
- package/lib/components/Stepper/designTokens.js +90 -0
- package/lib/components/Stepper/index.d.ts +22 -0
- package/lib/components/Stepper/index.js +118 -0
- package/lib/components/Stepper/style/index.less +140 -0
- package/lib/components/Stepper/style/variables.less +5 -0
- package/lib/components/StickyFooter/designTokens.d.ts +10 -0
- package/lib/components/StickyFooter/designTokens.js +41 -0
- package/lib/components/StickyFooter/index.d.ts +17 -0
- package/lib/components/StickyFooter/index.js +150 -0
- package/lib/components/StickyFooter/style/index.less +18 -0
- package/lib/components/StickyFooter/style/variables.less +4 -0
- package/lib/components/Tabs/designTokens.d.ts +44 -0
- package/lib/components/Tabs/designTokens.js +90 -0
- package/lib/components/Tabs/index.d.ts +14 -0
- package/lib/components/Tabs/index.js +145 -0
- package/lib/components/Tabs/style/index.less +25 -0
- package/lib/components/Tabs/style/variables.less +4 -0
- package/lib/components/Tag/designTokens.d.ts +90 -0
- package/lib/components/Tag/designTokens.js +181 -0
- package/lib/components/Tag/index.d.ts +15 -0
- package/lib/components/Tag/index.js +146 -0
- package/lib/components/Tag/style/index.less +9 -0
- package/lib/components/Tag/style/variables.less +4 -0
- package/lib/components/Text/designTokens.d.ts +51 -0
- package/lib/components/Text/designTokens.js +75 -0
- package/lib/components/Text/index.d.ts +13 -0
- package/lib/components/Text/index.js +432 -0
- package/lib/components/Text/style/index.less +2 -0
- package/lib/components/Text/style/variables.less +4 -0
- package/lib/components/TextInputInside/designTokens.d.ts +38 -0
- package/lib/components/TextInputInside/designTokens.js +100 -0
- package/lib/components/TextInputInside/index.d.ts +10 -0
- package/lib/components/TextInputInside/index.js +230 -0
- package/lib/components/TextInputInside/style/index.less +36 -0
- package/lib/components/TextInputInside/style/variables.less +5 -0
- package/lib/components/TextInputOutside/designTokens.d.ts +41 -0
- package/lib/components/TextInputOutside/designTokens.js +95 -0
- package/lib/components/TextInputOutside/index.d.ts +18 -0
- package/lib/components/TextInputOutside/index.js +110 -0
- package/lib/components/TextInputOutside/style/index.less +4 -0
- package/lib/components/TextInputOutside/style/variables.less +5 -0
- package/lib/components/TextLink/designTokens.d.ts +10 -0
- package/lib/components/TextLink/designTokens.js +45 -0
- package/lib/components/TextLink/index.d.ts +20 -0
- package/lib/components/TextLink/index.js +120 -0
- package/lib/components/Toast/designTokens.d.ts +13 -0
- package/lib/components/Toast/designTokens.js +40 -0
- package/lib/components/Toast/index.d.ts +26 -0
- package/lib/components/Toast/index.js +213 -0
- package/lib/components/Toast/style/index.less +9 -0
- package/lib/components/Toast/style/variables.less +12 -0
- package/lib/components/Toggle/designTokens.d.ts +9 -0
- package/lib/components/Toggle/designTokens.js +47 -0
- package/lib/components/Toggle/index.d.ts +27 -0
- package/lib/components/Toggle/index.js +67 -0
- package/lib/components/index.d.ts +49 -0
- package/lib/components/index.js +90 -0
- package/lib/constants/index.d.ts +16 -0
- package/lib/constants/index.js +42 -0
- package/lib/fonts/Poppins/Poppins-Bold.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-Italic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-Medium.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-Regular.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-Thin.ttf +0 -0
- package/lib/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/lib/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
- package/lib/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.svg +40549 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
- package/lib/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +21 -0
- package/lib/style/antdDesignToken.json +503 -0
- package/lib/style/themes/base-vars.css +6 -0
- package/lib/style/themes/colorful.css +5 -0
- package/lib/style/themes/index.css +4 -0
- package/lib/style/variables.less +60 -0
- package/lib/tokens/DXPGlobal.d.ts +302 -0
- package/lib/tokens/DXPGlobal.js +37 -0
- package/lib/utils/noop.d.ts +1 -0
- package/lib/utils/noop.js +26 -0
- package/lib/utils/scaleTool.d.ts +12 -0
- package/lib/utils/scaleTool.js +66 -0
- package/lib/utils/theme.d.ts +11 -0
- package/lib/utils/theme.js +32 -0
- package/lib/utils/themeContext.d.ts +44 -0
- package/lib/utils/themeContext.js +117 -0
- package/lib/utils/tokenHelper.d.ts +1 -0
- package/lib/utils/tokenHelper.js +38 -0
- package/lib/utils/tokenManager.d.ts +1572 -0
- package/lib/utils/tokenManager.js +833 -0
- package/package.json +29 -22
- package/umd/dxp-ui.min.css +1 -2
- package/umd/dxp-ui.min.js +1 -2
- package/umd/static/SF-Pro-Text-Bold.89d66db4.otf +0 -0
- package/umd/static/SF-Pro-Text-Regular.e042d171.ttf +0 -0
- package/umd/static/SF-Pro-Text-Regular.f09e811b.otf +0 -0
- package/umd/static/SF-Pro-Text-Semibold.a5a4b4bc.otf +0 -0
- package/umd/static/SF-Pro-Text-SemiboldItalic.ed8f4a28.otf +0 -0
- package/umd/static/iconfont.176e7470.svg +1 -0
- package/umd/static/iconfont.47a0c957.ttf +0 -0
- package/umd/static/iconfont.6f470e01.eot +0 -0
- package/umd/static/iconfont.796b49bb.woff +0 -0
- package/es/assets/iconFont/iconfont.js +0 -44
- package/es/assets/iconFont/iconfont.js.map +0 -1
- package/es/components/Button/designTokens.js.map +0 -1
- package/es/components/Button/index.js.map +0 -1
- package/es/components/Button/index_backup.d.ts +0 -72
- package/es/components/Button/index_backup.js +0 -111
- package/es/components/Button/index_backup.js.map +0 -1
- package/es/components/Text/index.js.map +0 -1
- package/es/components/Text/style/text.less +0 -116
- package/es/components/index.js.map +0 -1
- package/es/constants/index.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/tokens/DXPGlobal.js.map +0 -1
- package/es/utils/noop.js.map +0 -1
- package/es/utils/themeContext.js.map +0 -1
- package/es/utils/tokenHelper.js.map +0 -1
- package/es/utils/tokenManager.js.map +0 -1
- package/umd/dxp-ui.min.css.map +0 -1
- package/umd/dxp-ui.min.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
headerBg: string;
|
|
3
|
+
headerPadding: string;
|
|
4
|
+
contentPadding: string;
|
|
5
|
+
};
|
|
6
|
+
declare const designBorderTokens: {
|
|
7
|
+
headerBg: string;
|
|
8
|
+
headerPadding: string;
|
|
9
|
+
contentPadding: string;
|
|
10
|
+
};
|
|
11
|
+
export { designTokens, designBorderTokens };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
2
|
+
var designTokens = {
|
|
3
|
+
headerBg: 'transparent',
|
|
4
|
+
// header背景色
|
|
5
|
+
headerPadding: "".concat(getToken('spacingAccordionTitlePaddingVertical'), "px 0"),
|
|
6
|
+
// header边距
|
|
7
|
+
contentPadding: "".concat(getToken('spacingAccordionBodyPaddingBottom'), "px 0") // content边距
|
|
8
|
+
};
|
|
9
|
+
var designBorderTokens = {
|
|
10
|
+
headerBg: '#F5F5F8',
|
|
11
|
+
// header背景色
|
|
12
|
+
headerPadding: "".concat(getToken('spacingAccordionTitlePaddingVertical'), "px 16px"),
|
|
13
|
+
// header边距
|
|
14
|
+
contentPadding: "".concat(getToken('spacingAccordionBodyPaddingBottom'), "px 16px") // content边距
|
|
15
|
+
};
|
|
16
|
+
export { designTokens, designBorderTokens };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export interface ItemType {
|
|
4
|
+
key?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface AccordionProps {
|
|
10
|
+
prefixCls?: string;
|
|
11
|
+
items?: ItemType[];
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
defaultActiveKey?: string;
|
|
14
|
+
showArrow?: boolean;
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
onChange?: () => void;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
declare const Accordion: (props: AccordionProps) => React.JSX.Element;
|
|
21
|
+
export default Accordion;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import "antd/es/collapse/style";
|
|
4
|
+
import _Collapse from "antd/es/collapse";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
+
var _excluded = ["prefixCls", "bordered", "items"];
|
|
8
|
+
import React from 'react';
|
|
9
|
+
// import { useStyleRegister } from '@ant-design/cssinjs';
|
|
10
|
+
// import { theme } from '../../utils/theme';
|
|
11
|
+
import { designTokens, designBorderTokens } from "./designTokens";
|
|
12
|
+
import { BASE_CLASS_PREFIX } from "../../constants";
|
|
13
|
+
import Text from "../Text";
|
|
14
|
+
import "./style/index.less";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
var Accordion = function Accordion(props) {
|
|
17
|
+
var _props$prefixCls = props.prefixCls,
|
|
18
|
+
prefixCls = _props$prefixCls === void 0 ? BASE_CLASS_PREFIX + '-accordion' : _props$prefixCls,
|
|
19
|
+
_props$bordered = props.bordered,
|
|
20
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
21
|
+
_props$items = props.items,
|
|
22
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
23
|
+
attr = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
// const useCustomButtonStyle = () => {
|
|
25
|
+
// const hashId = useStyleRegister({
|
|
26
|
+
// theme: theme,
|
|
27
|
+
// token: { baseColor: 'blue' },
|
|
28
|
+
// path: [`${prefixCls}`],
|
|
29
|
+
// }, () => `
|
|
30
|
+
// .${prefixCls}-header {
|
|
31
|
+
// padding: ${spacingAccordionTitlePaddingVertical}px 0;
|
|
32
|
+
// }
|
|
33
|
+
// .${prefixCls}-content {
|
|
34
|
+
// padding-bottom: ${spacingAccordionBodyPaddingBottom}px;
|
|
35
|
+
// }
|
|
36
|
+
// .${prefixCls}-header .${prefixCls}-text {
|
|
37
|
+
// padding-right: ${spacingAccordionHorizontalGap}px;
|
|
38
|
+
// }
|
|
39
|
+
// `);
|
|
40
|
+
// return hashId;
|
|
41
|
+
// };
|
|
42
|
+
// useCustomButtonStyle();
|
|
43
|
+
|
|
44
|
+
// const handleAccordion = () => {
|
|
45
|
+
|
|
46
|
+
// };
|
|
47
|
+
|
|
48
|
+
var newItems = items.map(function (item) {
|
|
49
|
+
return {
|
|
50
|
+
key: item.key,
|
|
51
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
52
|
+
size: "ContentC14Bold",
|
|
53
|
+
children: item.label
|
|
54
|
+
}),
|
|
55
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
56
|
+
size: "ContentC14Regular",
|
|
57
|
+
children: item.children
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
var showBorder = bordered ? designBorderTokens : designTokens;
|
|
62
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
63
|
+
prefixCls: BASE_CLASS_PREFIX,
|
|
64
|
+
theme: {
|
|
65
|
+
components: {
|
|
66
|
+
Collapse: _objectSpread({}, showBorder)
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
children: /*#__PURE__*/_jsx(_Collapse, _objectSpread({
|
|
70
|
+
items: newItems,
|
|
71
|
+
className: "".concat(prefixCls),
|
|
72
|
+
showArrow: false,
|
|
73
|
+
bordered: bordered
|
|
74
|
+
}, attr))
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
export default Accordion;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
@import './variables.less';
|
|
3
|
+
@components: accordion;
|
|
4
|
+
@component: collapse;
|
|
5
|
+
|
|
6
|
+
.@{prefix}-@{components} .@{prefix}-@{component}-header {
|
|
7
|
+
flex-flow: row-reverse;
|
|
8
|
+
}
|
|
9
|
+
.@{prefix}-@{components}
|
|
10
|
+
>.@{prefix}-@{component}-item
|
|
11
|
+
>.@{prefix}-@{component}-header
|
|
12
|
+
>.@{prefix}-@{component}-expand-icon {
|
|
13
|
+
padding-inline-end: 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
2
|
+
var designTokens = {
|
|
3
|
+
colorCardTextTitle: getToken('colorCardTextTitle'),
|
|
4
|
+
// title颜色
|
|
5
|
+
colorCardTextPriceStrikethrough: getToken('colorCardTextPriceStrikethrough'),
|
|
6
|
+
// 划线价颜色
|
|
7
|
+
colorCardTextPrice: getToken('colorCardTextPrice') // 金额颜色
|
|
8
|
+
};
|
|
9
|
+
export { designTokens };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export type Size = 'XS' | 'S' | 'M' | 'L' | 'LG';
|
|
4
|
+
export type Position = 'up' | 'right' | 'down' | 'left';
|
|
5
|
+
export interface AmountProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: Size;
|
|
9
|
+
position?: Position;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
onClick?: React.MouseEventHandler;
|
|
12
|
+
onDropDownClick?: React.MouseEventHandler;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export default class Amount extends PureComponent<AmountProps> {
|
|
16
|
+
static defaultProps: {
|
|
17
|
+
size: string;
|
|
18
|
+
title: string;
|
|
19
|
+
position: string;
|
|
20
|
+
prefixCls: string;
|
|
21
|
+
};
|
|
22
|
+
render(): React.JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
var _excluded = ["children", "className", "size", "title", "position", "prefixCls", "priceStrikethrough", "style", "priceColor", "textColor", "colorStrikethrough", "onDropDownClick", "showIcon", "iconType"];
|
|
9
|
+
import React, { PureComponent } from 'react';
|
|
10
|
+
import { default as classNames } from 'classnames';
|
|
11
|
+
import { designTokens } from "./designTokens";
|
|
12
|
+
import { cssClasses } from "../../constants";
|
|
13
|
+
import { Text, Icon } from "../index";
|
|
14
|
+
import "./style/index.less";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
17
|
+
_inherits(Amount, _PureComponent);
|
|
18
|
+
var _super = _createSuper(Amount);
|
|
19
|
+
function Amount() {
|
|
20
|
+
_classCallCheck(this, Amount);
|
|
21
|
+
return _super.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
_createClass(Amount, [{
|
|
24
|
+
key: "render",
|
|
25
|
+
value: function render() {
|
|
26
|
+
var _this$props = this.props,
|
|
27
|
+
children = _this$props.children,
|
|
28
|
+
className = _this$props.className,
|
|
29
|
+
size = _this$props.size,
|
|
30
|
+
title = _this$props.title,
|
|
31
|
+
position = _this$props.position,
|
|
32
|
+
prefixCls = _this$props.prefixCls,
|
|
33
|
+
priceStrikethrough = _this$props.priceStrikethrough,
|
|
34
|
+
style = _this$props.style,
|
|
35
|
+
priceColor = _this$props.priceColor,
|
|
36
|
+
textColor = _this$props.textColor,
|
|
37
|
+
colorStrikethrough = _this$props.colorStrikethrough,
|
|
38
|
+
onDropDownClick = _this$props.onDropDownClick,
|
|
39
|
+
showIcon = _this$props.showIcon,
|
|
40
|
+
_this$props$iconType = _this$props.iconType,
|
|
41
|
+
iconType = _this$props$iconType === void 0 ? 'icon-a-Arrow-Down' : _this$props$iconType,
|
|
42
|
+
attr = _objectWithoutProperties(_this$props, _excluded);
|
|
43
|
+
var colorCardTextPrice = designTokens.colorCardTextPrice,
|
|
44
|
+
colorCardTextPriceStrikethrough = designTokens.colorCardTextPriceStrikethrough,
|
|
45
|
+
colorCardTextTitle = designTokens.colorCardTextTitle;
|
|
46
|
+
var baseProps = {
|
|
47
|
+
className: classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-size-").concat(size), size), "".concat(prefixCls, "-position-").concat(position), position), className),
|
|
48
|
+
style: style
|
|
49
|
+
};
|
|
50
|
+
var getSize = function getSize(fontSize) {
|
|
51
|
+
switch (fontSize) {
|
|
52
|
+
case 'S':
|
|
53
|
+
return 'ContentC14Bold';
|
|
54
|
+
case 'M':
|
|
55
|
+
return 'TitleT15Bold';
|
|
56
|
+
case 'L':
|
|
57
|
+
return 'TitleT21Bold';
|
|
58
|
+
case 'LG':
|
|
59
|
+
return 'TitleT23Bold';
|
|
60
|
+
default:
|
|
61
|
+
return 'ContentC12Bold';
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var TitleDom = function TitleDom() {
|
|
65
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
66
|
+
children: title === 'discount' ? /*#__PURE__*/_jsx(Text, {
|
|
67
|
+
size: "ContentC12Bold",
|
|
68
|
+
style: {
|
|
69
|
+
color: textColor || '#D01660'
|
|
70
|
+
},
|
|
71
|
+
children: "Discount"
|
|
72
|
+
}) : /*#__PURE__*/_jsxs(Text, {
|
|
73
|
+
size: "ContentC12Regular",
|
|
74
|
+
style: {
|
|
75
|
+
color: textColor || colorCardTextTitle
|
|
76
|
+
},
|
|
77
|
+
children: [title, showIcon && /*#__PURE__*/_jsx(Icon, {
|
|
78
|
+
size: 12,
|
|
79
|
+
name: iconType,
|
|
80
|
+
onClick: onDropDownClick
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
var PriceDom = function PriceDom() {
|
|
86
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
87
|
+
size: getSize(size),
|
|
88
|
+
style: {
|
|
89
|
+
color: priceColor || colorCardTextPrice
|
|
90
|
+
},
|
|
91
|
+
children: children
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
var PriceStrikethroughDom = function PriceStrikethroughDom() {
|
|
95
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
96
|
+
size: "ContentC12Strikethrough",
|
|
97
|
+
style: {
|
|
98
|
+
color: colorStrikethrough || colorCardTextPriceStrikethrough
|
|
99
|
+
},
|
|
100
|
+
children: priceStrikethrough
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
var positionLeft = function positionLeft() {
|
|
104
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsx(TitleDom, {}), /*#__PURE__*/_jsxs("div", {
|
|
106
|
+
children: [/*#__PURE__*/_jsx(PriceStrikethroughDom, {}), /*#__PURE__*/_jsx(PriceDom, {})]
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
var positionRight = function positionRight() {
|
|
111
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
112
|
+
children: [/*#__PURE__*/_jsx(TitleDom, {}), /*#__PURE__*/_jsxs("div", {
|
|
113
|
+
children: [/*#__PURE__*/_jsx(PriceDom, {}), /*#__PURE__*/_jsx(PriceStrikethroughDom, {})]
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
var positionUp = function positionUp() {
|
|
118
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
|
+
children: [/*#__PURE__*/_jsx(TitleDom, {}), /*#__PURE__*/_jsx(PriceStrikethroughDom, {}), /*#__PURE__*/_jsx(PriceDom, {})]
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
var positionDown = function positionDown() {
|
|
123
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
124
|
+
children: [/*#__PURE__*/_jsx(TitleDom, {}), /*#__PURE__*/_jsx(PriceDom, {}), /*#__PURE__*/_jsx(PriceStrikethroughDom, {})]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
return /*#__PURE__*/_jsxs("span", _objectSpread(_objectSpread(_objectSpread({
|
|
128
|
+
onClick: this.props.onClick
|
|
129
|
+
}, baseProps), {}, {
|
|
130
|
+
onMouseDown: this.props.onMouseDown
|
|
131
|
+
}, attr), {}, {
|
|
132
|
+
children: [position === 'left' && positionLeft(), position === 'right' && positionRight(), position === 'up' && positionUp(), position === 'down' && positionDown()]
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
}]);
|
|
136
|
+
return Amount;
|
|
137
|
+
}(PureComponent);
|
|
138
|
+
_defineProperty(Amount, "defaultProps", {
|
|
139
|
+
size: 'L',
|
|
140
|
+
title: 'Total',
|
|
141
|
+
position: 'down',
|
|
142
|
+
prefixCls: cssClasses.PREFIX + '-amount'
|
|
143
|
+
});
|
|
144
|
+
export { Amount as default };
|
|
@@ -14,7 +14,7 @@ var designTokens = {
|
|
|
14
14
|
|
|
15
15
|
// 主要按钮背景色
|
|
16
16
|
colorPrimary: getToken('colorButtonBackgroundPrimary'),
|
|
17
|
-
// 主要按钮 Hover
|
|
17
|
+
// 主要按钮 Hover
|
|
18
18
|
colorPrimaryHover: getToken('colorButtonBackgroundPrimary'),
|
|
19
19
|
colorPrimaryActive: getToken('colorButtonBackgroundPrimary'),
|
|
20
20
|
// colorPrimaryBg: getToken('colorButtonBackgroundPrimary'),
|
|
@@ -52,8 +52,8 @@ var designTokens = {
|
|
|
52
52
|
borderRadiusLG: getToken('borderRadiusButton'),
|
|
53
53
|
defaultShadow: '0 0px 0 rgba(0,0,0,0.02)',
|
|
54
54
|
primaryShadow: '0 0 0 rgba(5,145,255,0.1)',
|
|
55
|
-
//
|
|
56
|
-
//
|
|
55
|
+
// gFontFamilySecondaryBold: String = "Roboto"
|
|
56
|
+
// fontWeight700: Font.Weight = .bold 改用 text 组件实现
|
|
57
57
|
// fontWeight: getToken(''),
|
|
58
58
|
// fontfamily: getToken(''),
|
|
59
59
|
|
|
@@ -109,8 +109,8 @@ var inverseDesignTokens = {
|
|
|
109
109
|
borderRadiusLG: getToken('borderRadiusButton'),
|
|
110
110
|
defaultShadow: '0 0px 0 rgba(0,0,0,0.02)',
|
|
111
111
|
primaryShadow: '0 0 0 rgba(5,145,255,0.1)',
|
|
112
|
-
//
|
|
113
|
-
//
|
|
112
|
+
// gFontFamilySecondaryBold: String = "Roboto"
|
|
113
|
+
// fontWeight700: Font.Weight = .bold 改用 text 组件实现
|
|
114
114
|
// fontWeight: getToken(''),
|
|
115
115
|
// fontfamily: getToken(''),
|
|
116
116
|
|
|
@@ -128,5 +128,4 @@ var inverseDesignTokens = {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
// export default designTokens;
|
|
131
|
-
export { designTokens, inverseDesignTokens };
|
|
132
|
-
//# sourceMappingURL=designTokens.js.map
|
|
131
|
+
export { designTokens, inverseDesignTokens };
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import './style/
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextProps } from "../Text";
|
|
3
|
+
import './style/index.less';
|
|
4
4
|
export type HtmlType = 'button' | 'reset' | 'submit';
|
|
5
5
|
export type Size = 'middle' | 'small' | 'large';
|
|
6
6
|
export type ButtonType = 'primary' | 'default' | 'dashed' | 'link' | 'text';
|
|
7
7
|
export type ButtonColorType = 'default' | 'primary' | 'danger' | 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
|
|
8
|
-
export
|
|
8
|
+
export interface ButtonThemeConfig {
|
|
9
|
+
token?: Record<string, any>;
|
|
10
|
+
components?: {
|
|
11
|
+
Button?: Record<string, any>;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
cssVar?: boolean;
|
|
15
|
+
hashed?: boolean;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
9
18
|
export interface xDXpProps {
|
|
10
19
|
'x-dxp-prop'?: string;
|
|
11
20
|
}
|
|
@@ -16,29 +25,15 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
16
25
|
loading?: boolean;
|
|
17
26
|
htmlType?: HtmlType;
|
|
18
27
|
size?: Size;
|
|
19
|
-
fontSize?:
|
|
28
|
+
fontSize?: TextProps['size'];
|
|
20
29
|
disabled?: boolean;
|
|
21
30
|
block?: boolean;
|
|
22
31
|
style?: React.CSSProperties;
|
|
23
|
-
theme?: string;
|
|
32
|
+
theme?: string | ButtonThemeConfig;
|
|
24
33
|
prefixCls?: string;
|
|
25
34
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
26
35
|
contentClassName?: string;
|
|
27
36
|
[key: string]: any;
|
|
28
37
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
disabled: boolean;
|
|
32
|
-
size: string;
|
|
33
|
-
fontSize: string;
|
|
34
|
-
type: string;
|
|
35
|
-
theme: string;
|
|
36
|
-
htmlType: string;
|
|
37
|
-
onMouseDown: typeof noop;
|
|
38
|
-
onClick: typeof noop;
|
|
39
|
-
onMouseEnter: typeof noop;
|
|
40
|
-
onMouseLeave: typeof noop;
|
|
41
|
-
prefixCls: string;
|
|
42
|
-
};
|
|
43
|
-
render(): React.JSX.Element;
|
|
44
|
-
}
|
|
38
|
+
declare const ButtonWithContext: React.FC<ButtonProps>;
|
|
39
|
+
export default ButtonWithContext;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import "antd/es/button/style";
|
|
4
|
+
import _Button from "antd/es/button";
|
|
5
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
8
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -6,80 +10,106 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
6
10
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
11
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
8
12
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
var _excluded = ["fontSize", "theme", "inverse"];
|
|
10
|
-
import { Button as AntdBtn, ConfigProvider } from 'antd';
|
|
13
|
+
var _excluded = ["fontSize", "theme", "inverse", "parentTheme"];
|
|
11
14
|
import React, { PureComponent } from 'react';
|
|
15
|
+
import Text from "../Text";
|
|
12
16
|
import { cssClasses } from "../../constants";
|
|
13
17
|
import { noop } from "../../utils/noop";
|
|
14
|
-
import Text from "../Text";
|
|
15
18
|
import { designTokens, inverseDesignTokens } from "./designTokens";
|
|
16
19
|
|
|
17
20
|
// 这种是另一方 定制 antd 的 style 的方式; 现在使用了上面的 designTokens.ts 的方式。
|
|
18
|
-
import "./style/
|
|
21
|
+
import "./style/index.less";
|
|
19
22
|
|
|
20
23
|
// const { htmlTypes, btnTypes, sizes } = strings;
|
|
21
24
|
|
|
22
25
|
// export type Theme = 'solid' | 'borderless' | 'light' | 'outline';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
// 复用antd的Theme配置接口
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
// 实际的 Button 组件实现
|
|
30
|
+
var ButtonComponent = /*#__PURE__*/function (_PureComponent) {
|
|
31
|
+
_inherits(ButtonComponent, _PureComponent);
|
|
32
|
+
var _super = _createSuper(ButtonComponent);
|
|
33
|
+
function ButtonComponent() {
|
|
34
|
+
_classCallCheck(this, ButtonComponent);
|
|
28
35
|
return _super.apply(this, arguments);
|
|
29
36
|
}
|
|
30
|
-
_createClass(
|
|
37
|
+
_createClass(ButtonComponent, [{
|
|
31
38
|
key: "render",
|
|
32
39
|
value: function render() {
|
|
33
40
|
var _this$props = this.props,
|
|
34
41
|
children = _this$props.children,
|
|
35
|
-
style = _this$props.style,
|
|
36
42
|
inverse = _this$props.inverse,
|
|
37
|
-
fontSize = _this$props.fontSize
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// const { fontSize: _, ...filteredProps } = this.props;
|
|
43
|
+
fontSize = _this$props.fontSize,
|
|
44
|
+
theme = _this$props.theme,
|
|
45
|
+
parentTheme = _this$props.parentTheme;
|
|
41
46
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
47
|
var _this$props2 = this.props,
|
|
43
48
|
_ = _this$props2.fontSize,
|
|
44
49
|
__ = _this$props2.theme,
|
|
45
50
|
___ = _this$props2.inverse,
|
|
51
|
+
____ = _this$props2.parentTheme,
|
|
46
52
|
filteredProps = _objectWithoutProperties(_this$props2, _excluded);
|
|
47
53
|
|
|
48
|
-
//
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
// 获取基础token
|
|
55
|
+
var baseTokens = inverse ? inverseDesignTokens : designTokens;
|
|
56
|
+
|
|
57
|
+
// 处理theme属性 - 如果是对象格式,则按antd的Theme配置处理
|
|
58
|
+
var themeConfig = {
|
|
59
|
+
components: {
|
|
60
|
+
Button: baseTokens
|
|
61
|
+
},
|
|
62
|
+
token: {},
|
|
63
|
+
cssVar: true,
|
|
64
|
+
hashed: false
|
|
53
65
|
};
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
|
|
67
|
+
// 如果有父级配置,则与基础token合并
|
|
68
|
+
if (parentTheme) {
|
|
69
|
+
var _parentTheme$componen;
|
|
70
|
+
var parentButtonTokens = ((_parentTheme$componen = parentTheme.components) === null || _parentTheme$componen === void 0 ? void 0 : _parentTheme$componen.Button) || {};
|
|
71
|
+
var parentGlobalTokens = parentTheme.token || {};
|
|
72
|
+
themeConfig = _objectSpread(_objectSpread(_objectSpread({}, themeConfig), parentTheme), {}, {
|
|
73
|
+
token: _objectSpread(_objectSpread({}, themeConfig.token || {}), parentGlobalTokens),
|
|
74
|
+
components: _objectSpread(_objectSpread({}, parentTheme.components), {}, {
|
|
75
|
+
Button: _objectSpread(_objectSpread({}, baseTokens), parentButtonTokens)
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 如果用户传入了自定义theme配置(对象),则合并处理
|
|
81
|
+
if (theme && _typeof(theme) === 'object') {
|
|
82
|
+
var _theme$components, _parentTheme$componen2;
|
|
83
|
+
// 获取用户自定义的Button token
|
|
84
|
+
var userButtonTokens = ((_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Button) || {};
|
|
85
|
+
var userGlobalTokens = theme.token || {};
|
|
86
|
+
themeConfig = _objectSpread(_objectSpread(_objectSpread({}, themeConfig), theme), {}, {
|
|
87
|
+
token: _objectSpread(_objectSpread({}, themeConfig.token || {}), userGlobalTokens),
|
|
88
|
+
components: _objectSpread(_objectSpread(_objectSpread({}, themeConfig.components), theme.components), {}, {
|
|
89
|
+
Button: _objectSpread(_objectSpread(_objectSpread({}, baseTokens), (parentTheme === null || parentTheme === void 0 || (_parentTheme$componen2 = parentTheme.components) === null || _parentTheme$componen2 === void 0 ? void 0 : _parentTheme$componen2.Button) || {}), userButtonTokens)
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
56
94
|
wave: {
|
|
57
95
|
disabled: true
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
hashed: false
|
|
69
|
-
}
|
|
70
|
-
}, /*#__PURE__*/React.createElement(AntdBtn, _extends({}, filteredProps, {
|
|
71
|
-
style: btnStyle
|
|
72
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
73
|
-
size: fontSize
|
|
74
|
-
}, children))));
|
|
96
|
+
},
|
|
97
|
+
prefixCls: cssClasses.PREFIX,
|
|
98
|
+
theme: themeConfig,
|
|
99
|
+
children: /*#__PURE__*/_jsx(_Button, _objectSpread(_objectSpread({}, filteredProps), {}, {
|
|
100
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
101
|
+
size: fontSize,
|
|
102
|
+
children: children
|
|
103
|
+
})
|
|
104
|
+
}))
|
|
105
|
+
});
|
|
75
106
|
}
|
|
76
107
|
}]);
|
|
77
|
-
return
|
|
78
|
-
}(PureComponent);
|
|
79
|
-
_defineProperty(
|
|
108
|
+
return ButtonComponent;
|
|
109
|
+
}(PureComponent); // 包装器函数组件,用于获取 ConfigProvider 上下文
|
|
110
|
+
_defineProperty(ButtonComponent, "defaultProps", {
|
|
80
111
|
disabled: false,
|
|
81
112
|
size: 'large',
|
|
82
|
-
fontSize: 'bodyBold',
|
|
83
113
|
type: 'default',
|
|
84
114
|
theme: 'light',
|
|
85
115
|
htmlType: 'button',
|
|
@@ -89,5 +119,14 @@ _defineProperty(Button, "defaultProps", {
|
|
|
89
119
|
onMouseLeave: noop,
|
|
90
120
|
prefixCls: cssClasses.PREFIX + '-button'
|
|
91
121
|
});
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
var ButtonWithContext = function ButtonWithContext(props) {
|
|
123
|
+
// 使用 React 的 useContext 获取 ConfigProvider 上下文
|
|
124
|
+
var _React$useContext = React.useContext(_ConfigProvider.ConfigContext),
|
|
125
|
+
parentTheme = _React$useContext.theme;
|
|
126
|
+
return /*#__PURE__*/_jsx(ButtonComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
127
|
+
parentTheme: parentTheme
|
|
128
|
+
}));
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// 导出包装后的组件
|
|
132
|
+
export default ButtonWithContext;
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
// 使用字符串拼接
|
|
7
7
|
.@{prefix}-@{components} {
|
|
8
|
+
min-width: 128px;
|
|
9
|
+
padding-top: 8px;
|
|
10
|
+
padding-bottom: 8px;
|
|
8
11
|
|
|
9
12
|
// 按钮类型
|
|
10
13
|
// &-primary {
|
|
@@ -17,7 +20,6 @@
|
|
|
17
20
|
transform: scale(0.9);
|
|
18
21
|
transform-origin: center;
|
|
19
22
|
transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
20
|
-
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -28,7 +30,9 @@
|
|
|
28
30
|
transform: scale(0.9);
|
|
29
31
|
transform-origin: center;
|
|
30
32
|
transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
31
|
-
|
|
32
33
|
}
|
|
33
34
|
}
|
|
35
|
+
&:focus, &:focus-visible{
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
34
38
|
}
|