@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,15 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
borderRadiusChip: any;
|
|
3
|
+
colorChipBackgroundStandard: any;
|
|
4
|
+
colorChipBorderStandard: any;
|
|
5
|
+
borderWidthChip: any;
|
|
6
|
+
spacingChipPaddingHorizontal: any;
|
|
7
|
+
spacingChipPaddingVertical: any;
|
|
8
|
+
colorChipBackgroundHover: any;
|
|
9
|
+
colorChipTextInactive: any;
|
|
10
|
+
colorChipBackgroundActive: any;
|
|
11
|
+
colorChipBorderActive: any;
|
|
12
|
+
colorChipTextActive: any;
|
|
13
|
+
sizingChipIconClose: any;
|
|
14
|
+
};
|
|
15
|
+
export { designTokens };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
2
|
+
var designTokens = {
|
|
3
|
+
borderRadiusChip: getToken('borderRadiusChip'),
|
|
4
|
+
// 选中的边框颜色
|
|
5
|
+
colorChipBackgroundStandard: getToken('colorChipBackgroundStandard'),
|
|
6
|
+
// 选中的label颜色
|
|
7
|
+
colorChipBorderStandard: getToken('colorChipBorderStandard'),
|
|
8
|
+
// hover label颜色
|
|
9
|
+
borderWidthChip: getToken('borderWidthChip'),
|
|
10
|
+
// active label颜色
|
|
11
|
+
spacingChipPaddingHorizontal: getToken('spacingChipPaddingHorizontal'),
|
|
12
|
+
// 默认label颜色
|
|
13
|
+
spacingChipPaddingVertical: getToken('spacingChipPaddingVertical'),
|
|
14
|
+
// 未选中的边框
|
|
15
|
+
colorChipBackgroundHover: getToken('colorChipBackgroundHover'),
|
|
16
|
+
colorChipTextInactive: getToken('colorChipTextInactive'),
|
|
17
|
+
colorChipBackgroundActive: getToken('colorChipBackgroundActive'),
|
|
18
|
+
colorChipBorderActive: getToken('colorChipBorderActive'),
|
|
19
|
+
colorChipTextActive: getToken('colorChipTextActive'),
|
|
20
|
+
sizingChipIconClose: getToken('sizingChipIconClose')
|
|
21
|
+
};
|
|
22
|
+
export { designTokens };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export interface ChipProps {
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
types?: 'textOnly' | 'removable';
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onChange?: () => void;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
declare const Chip: (props: ChipProps) => React.JSX.Element;
|
|
13
|
+
export default Chip;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import "antd/es/tag/style";
|
|
4
|
+
import _Tag from "antd/es/tag";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
+
var _excluded = ["types", "children", "prefixCls", "checked", "onChange", "onClose", "style"];
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
10
|
+
import { theme } from "../../utils/theme";
|
|
11
|
+
import { designTokens } 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 Chip = function Chip(props) {
|
|
17
|
+
var _props$types = props.types,
|
|
18
|
+
types = _props$types === void 0 ? 'textOnly' : _props$types,
|
|
19
|
+
children = props.children,
|
|
20
|
+
_props$prefixCls = props.prefixCls,
|
|
21
|
+
prefixCls = _props$prefixCls === void 0 ? 'tag' : _props$prefixCls,
|
|
22
|
+
checked = props.checked,
|
|
23
|
+
_props$onChange = props.onChange,
|
|
24
|
+
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
25
|
+
_props$onClose = props.onClose,
|
|
26
|
+
_onClose = _props$onClose === void 0 ? function () {} : _props$onClose,
|
|
27
|
+
style = props.style,
|
|
28
|
+
attr = _objectWithoutProperties(props, _excluded);
|
|
29
|
+
var borderRadiusChip = designTokens.borderRadiusChip,
|
|
30
|
+
colorChipBackgroundStandard = designTokens.colorChipBackgroundStandard,
|
|
31
|
+
colorChipBorderStandard = designTokens.colorChipBorderStandard,
|
|
32
|
+
borderWidthChip = designTokens.borderWidthChip,
|
|
33
|
+
spacingChipPaddingHorizontal = designTokens.spacingChipPaddingHorizontal,
|
|
34
|
+
spacingChipPaddingVertical = designTokens.spacingChipPaddingVertical,
|
|
35
|
+
colorChipBackgroundHover = designTokens.colorChipBackgroundHover,
|
|
36
|
+
colorChipTextInactive = designTokens.colorChipTextInactive,
|
|
37
|
+
colorChipBackgroundActive = designTokens.colorChipBackgroundActive,
|
|
38
|
+
colorChipBorderActive = designTokens.colorChipBorderActive,
|
|
39
|
+
colorChipTextActive = designTokens.colorChipTextActive,
|
|
40
|
+
sizingChipIconClose = designTokens.sizingChipIconClose;
|
|
41
|
+
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
42
|
+
var hashId = useStyleRegister({
|
|
43
|
+
theme: theme,
|
|
44
|
+
token: {
|
|
45
|
+
baseColor: 'blue'
|
|
46
|
+
},
|
|
47
|
+
path: ['tag-textonly']
|
|
48
|
+
}, function () {
|
|
49
|
+
return "\n .tag-textonly {\n color: ".concat(colorChipTextInactive, ";\n border-color: ").concat(colorChipBorderStandard, ";\n border-width: ").concat(borderWidthChip, "px;\n border-radius: ").concat(borderRadiusChip, "px;\n background-color: ").concat(colorChipBackgroundStandard, ";\n padding: ").concat(spacingChipPaddingVertical, "px ").concat(spacingChipPaddingHorizontal, "px;\n }\n .tag-textonly:hover {\n background-color: ").concat(colorChipBackgroundHover, ";\n }\n .tag-textonly:active {\n background-color: ").concat(colorChipBackgroundHover, ";\n }\n .tag-active,\n .tag-active:hover,\n .tag-active:active {\n color: ").concat(colorChipTextActive, ";\n border-color: ").concat(colorChipBorderActive, ";\n background-color: ").concat(colorChipBackgroundActive, ";\n }\n ");
|
|
50
|
+
});
|
|
51
|
+
return hashId;
|
|
52
|
+
};
|
|
53
|
+
useCustomButtonStyle();
|
|
54
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
55
|
+
prefixCls: BASE_CLASS_PREFIX,
|
|
56
|
+
theme: {
|
|
57
|
+
components: {
|
|
58
|
+
Tag: {
|
|
59
|
+
borderRadiusSM: borderRadiusChip,
|
|
60
|
+
defaultBg: colorChipBackgroundActive,
|
|
61
|
+
colorBorder: colorChipBorderActive,
|
|
62
|
+
lineWidth: borderWidthChip,
|
|
63
|
+
colorText: colorChipTextActive,
|
|
64
|
+
marginXS: 16,
|
|
65
|
+
fontSizeIcon: sizingChipIconClose
|
|
66
|
+
// spacingChipTextLinkPaddingVertical,
|
|
67
|
+
// spacingChipTextLinkPaddingHorizontal,
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
children: types === 'textOnly' ? /*#__PURE__*/_jsx("span", {
|
|
72
|
+
className: "".concat(BASE_CLASS_PREFIX, "-").concat(prefixCls, "-").concat(types, " tag-textonly ").concat(checked ? 'tag-active' : ''),
|
|
73
|
+
onClick: function onClick() {
|
|
74
|
+
return onChange();
|
|
75
|
+
},
|
|
76
|
+
style: style,
|
|
77
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
78
|
+
size: "ContentC14Regular",
|
|
79
|
+
children: children
|
|
80
|
+
})
|
|
81
|
+
}) : /*#__PURE__*/_jsx(_Tag, _objectSpread(_objectSpread({
|
|
82
|
+
className: "".concat(BASE_CLASS_PREFIX, "-").concat(prefixCls, "-").concat(types),
|
|
83
|
+
style: _objectSpread({
|
|
84
|
+
padding: "".concat(spacingChipPaddingVertical, "px ").concat(spacingChipPaddingHorizontal, "px")
|
|
85
|
+
}, style),
|
|
86
|
+
onClose: function onClose(e) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
_onClose();
|
|
89
|
+
}
|
|
90
|
+
}, attr), {}, {
|
|
91
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
92
|
+
size: "ContentC14Regular",
|
|
93
|
+
children: children
|
|
94
|
+
})
|
|
95
|
+
}))
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
export default Chip;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export interface DividerProps {
|
|
4
|
+
type?: 'solid' | 'dashed' | 'eight' | 'whiteBg' | 'grayBg' | 'vertical';
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export default class Divider extends PureComponent<DividerProps> {
|
|
11
|
+
static defaultProps: {
|
|
12
|
+
type: string;
|
|
13
|
+
prefixCls: string;
|
|
14
|
+
};
|
|
15
|
+
render(): React.JSX.Element;
|
|
16
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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", "prefixCls", "type", "style", "height"];
|
|
9
|
+
import React, { PureComponent } from 'react';
|
|
10
|
+
import { default as classNames } from 'classnames';
|
|
11
|
+
import TokenManager from "../../utils/tokenManager";
|
|
12
|
+
import { cssClasses } from "../../constants";
|
|
13
|
+
import "./style/index.less";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
var Divider = /*#__PURE__*/function (_PureComponent) {
|
|
16
|
+
_inherits(Divider, _PureComponent);
|
|
17
|
+
var _super = _createSuper(Divider);
|
|
18
|
+
function Divider() {
|
|
19
|
+
_classCallCheck(this, Divider);
|
|
20
|
+
return _super.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
_createClass(Divider, [{
|
|
23
|
+
key: "render",
|
|
24
|
+
value: function render() {
|
|
25
|
+
var _this$props = this.props,
|
|
26
|
+
children = _this$props.children,
|
|
27
|
+
className = _this$props.className,
|
|
28
|
+
prefixCls = _this$props.prefixCls,
|
|
29
|
+
type = _this$props.type,
|
|
30
|
+
style = _this$props.style,
|
|
31
|
+
height = _this$props.height,
|
|
32
|
+
attr = _objectWithoutProperties(_this$props, _excluded);
|
|
33
|
+
var baseProps = {
|
|
34
|
+
className: classNames(prefixCls, _defineProperty({}, "".concat(prefixCls, "-type-").concat(type), type), className)
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread(_objectSpread({}, baseProps), attr), {}, {
|
|
37
|
+
style: _objectSpread(_objectSpread({
|
|
38
|
+
height: height
|
|
39
|
+
}, style), {}, {
|
|
40
|
+
borderColor: TokenManager.tokenKey('colorDivider10Horizontal')
|
|
41
|
+
}),
|
|
42
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
43
|
+
children: children
|
|
44
|
+
})
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
}]);
|
|
48
|
+
return Divider;
|
|
49
|
+
}(PureComponent);
|
|
50
|
+
_defineProperty(Divider, "defaultProps", {
|
|
51
|
+
type: 'solid',
|
|
52
|
+
prefixCls: cssClasses.PREFIX + '-divider'
|
|
53
|
+
});
|
|
54
|
+
export { Divider as default };
|
|
55
|
+
;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
|
|
2
|
+
@import './variables.less';
|
|
3
|
+
|
|
4
|
+
@components: divider;
|
|
5
|
+
.@{prefix}-@{components} {
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.@{prefix}-@{components}-type-solid {
|
|
10
|
+
border-bottom: 1px solid #BFBFC7;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.@{prefix}-@{components}-type-dashed {
|
|
14
|
+
border-bottom: 1px dashed #E6E6E6;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.@{prefix}-@{components}-type-eight {
|
|
18
|
+
border-bottom: 8px solid #F5F5F8;
|
|
19
|
+
}
|
|
20
|
+
.@{prefix}-@{components}-type-whiteBg {
|
|
21
|
+
position: relative;
|
|
22
|
+
padding-top: 8px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
&::before,
|
|
25
|
+
&::after {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
display: block;
|
|
29
|
+
content: '';
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
border: 1px solid #D5D5D5;
|
|
34
|
+
background: #fff;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
&::before {
|
|
38
|
+
left: -8px;
|
|
39
|
+
}
|
|
40
|
+
&::after {
|
|
41
|
+
right: -8px;
|
|
42
|
+
}
|
|
43
|
+
> div {
|
|
44
|
+
margin-bottom: 8px;
|
|
45
|
+
border-bottom: 2px dashed #EBEBEB;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.@{prefix}-@{components}-type-grayBg {
|
|
49
|
+
position: relative;
|
|
50
|
+
padding-top: 8px;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
&::before,
|
|
53
|
+
&::after {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 0;
|
|
56
|
+
display: block;
|
|
57
|
+
content: '';
|
|
58
|
+
width: 16px;
|
|
59
|
+
height: 16px;
|
|
60
|
+
border-radius: 50%;
|
|
61
|
+
background: #F5F5F5;
|
|
62
|
+
}
|
|
63
|
+
&::before {
|
|
64
|
+
left: -8px;
|
|
65
|
+
}
|
|
66
|
+
&::after {
|
|
67
|
+
right: -8px;
|
|
68
|
+
}
|
|
69
|
+
> div {
|
|
70
|
+
margin-bottom: 8px;
|
|
71
|
+
border-bottom: 2px dashed #F2F2F2;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.@{prefix}-@{components}-type-vertical {
|
|
75
|
+
width: auto;
|
|
76
|
+
min-height: 12px;
|
|
77
|
+
border-left: 1px solid #BFBFC7;
|
|
78
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
colorDrawerBackgroundOverlay: any;
|
|
3
|
+
colorDrawerBackgroundStandard: any;
|
|
4
|
+
borderTopLeftRadius: any;
|
|
5
|
+
borderTopRightRadius: any;
|
|
6
|
+
spacingDrawerPaddingHorizontal: any;
|
|
7
|
+
spacingDrawerPaddingBottom: any;
|
|
8
|
+
spacingDrawerPaddingTop: any;
|
|
9
|
+
sizingDrawerHandle: any;
|
|
10
|
+
colorDrawerHandle: any;
|
|
11
|
+
spacingDrawerHandlePaddingTop: any;
|
|
12
|
+
spacingDrawerHandlePaddingBottom: any;
|
|
13
|
+
colorDrawerTextHeader: any;
|
|
14
|
+
spacingDrawerListOptionHorizontalGap: any;
|
|
15
|
+
};
|
|
16
|
+
export default designTokens;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import TokenManager from "../../utils/tokenManager";
|
|
2
|
+
var designTokens = {
|
|
3
|
+
colorDrawerBackgroundOverlay: TokenManager.tokenKey('colorDrawerBackgroundOverlay') || 'rgba(0, 0, 0, 0.60)',
|
|
4
|
+
// 遮罩层背景色
|
|
5
|
+
colorDrawerBackgroundStandard: TokenManager.tokenKey('colorDrawerBackgroundStandard') || '#FFF',
|
|
6
|
+
// 内容的底色
|
|
7
|
+
borderTopLeftRadius: TokenManager.tokenKey('borderRadiusDrawerTopLeft'),
|
|
8
|
+
// 弹出窗上左上圆角
|
|
9
|
+
borderTopRightRadius: TokenManager.tokenKey('borderRadiusDrawerTopRight'),
|
|
10
|
+
// 弹出窗上右上圆角
|
|
11
|
+
spacingDrawerPaddingHorizontal: TokenManager.tokenKey('spacingDrawerPaddingHorizontal'),
|
|
12
|
+
// 内部横padding
|
|
13
|
+
spacingDrawerPaddingBottom: TokenManager.tokenKey('spacingDrawerPaddingBottom'),
|
|
14
|
+
spacingDrawerPaddingTop: TokenManager.tokenKey('spacingDrawerPaddingTop'),
|
|
15
|
+
sizingDrawerHandle: TokenManager.tokenKey('sizingDrawerHandle'),
|
|
16
|
+
// 上部 小滑块的宽
|
|
17
|
+
colorDrawerHandle: TokenManager.tokenKey('colorDrawerHandle'),
|
|
18
|
+
// 上部 小滑块的背景色
|
|
19
|
+
spacingDrawerHandlePaddingTop: TokenManager.tokenKey('spacingDrawerHandlePaddingTop'),
|
|
20
|
+
// 上部 小滑块
|
|
21
|
+
spacingDrawerHandlePaddingBottom: TokenManager.tokenKey('spacingDrawerHandlePaddingBottom'),
|
|
22
|
+
// 上部 小滑块
|
|
23
|
+
colorDrawerTextHeader: TokenManager.tokenKey('colorDrawerTextHeader'),
|
|
24
|
+
// title的颜色
|
|
25
|
+
spacingDrawerListOptionHorizontalGap: TokenManager.tokenKey('spacingDrawerListOptionHorizontalGap') // 间距
|
|
26
|
+
};
|
|
27
|
+
export default designTokens;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export type DrawerType = 'DrawerTypeHandler' | 'DrawerTypeCloseBtn';
|
|
4
|
+
export declare const DrawerTypeEnum: Record<string, DrawerType>;
|
|
5
|
+
export interface BottomDrawerProps {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
title?: string;
|
|
11
|
+
drawerType: DrawerType;
|
|
12
|
+
bottomBtnText?: string;
|
|
13
|
+
bottomLinkText?: string;
|
|
14
|
+
showBottomBorder?: boolean;
|
|
15
|
+
showImage?: boolean;
|
|
16
|
+
imageSrc?: string;
|
|
17
|
+
onLinkClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
18
|
+
onBottomBtnClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
19
|
+
}
|
|
20
|
+
declare const BottomDrawer: React.FC<BottomDrawerProps>;
|
|
21
|
+
export default BottomDrawer;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
4
|
+
import designTokens from "./designTokens";
|
|
5
|
+
import { StickyFooter, Text, Image, Icon } from "../index";
|
|
6
|
+
import { cssClasses } from "../../constants";
|
|
7
|
+
import "./style/index.less";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export var DrawerTypeEnum = {
|
|
10
|
+
DrawerTypeHandler: 'DrawerTypeHandler',
|
|
11
|
+
DrawerTypeCloseBtn: 'DrawerTypeCloseBtn'
|
|
12
|
+
};
|
|
13
|
+
var BottomDrawer = function BottomDrawer(_ref) {
|
|
14
|
+
var visible = _ref.visible,
|
|
15
|
+
onClose = _ref.onClose,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
height = _ref.height,
|
|
18
|
+
title = _ref.title,
|
|
19
|
+
_ref$drawerType = _ref.drawerType,
|
|
20
|
+
drawerType = _ref$drawerType === void 0 ? DrawerTypeEnum.DrawerTypeHandler : _ref$drawerType,
|
|
21
|
+
bottomBtnText = _ref.bottomBtnText,
|
|
22
|
+
bottomLinkText = _ref.bottomLinkText,
|
|
23
|
+
showBottomBorder = _ref.showBottomBorder,
|
|
24
|
+
showImage = _ref.showImage,
|
|
25
|
+
imageSrc = _ref.imageSrc,
|
|
26
|
+
onLinkClick = _ref.onLinkClick,
|
|
27
|
+
onBottomBtnClick = _ref.onBottomBtnClick;
|
|
28
|
+
var originalBodyOverflow = useRef('');
|
|
29
|
+
var _useState = useState(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
isMounted = _useState2[0],
|
|
32
|
+
setIsMounted = _useState2[1];
|
|
33
|
+
var _useState3 = useState(0),
|
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
35
|
+
paddingBottom = _useState4[0],
|
|
36
|
+
setPaddingBottom = _useState4[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
if (visible) {
|
|
39
|
+
// 保存原始滚动状态
|
|
40
|
+
originalBodyOverflow.current = document.body.style.overflow;
|
|
41
|
+
// 禁用页面滚动
|
|
42
|
+
document.body.style.overflow = 'hidden';
|
|
43
|
+
// 兼容移动端触摸滚动
|
|
44
|
+
document.body.style.touchAction = 'none';
|
|
45
|
+
setIsMounted(true);
|
|
46
|
+
} else {
|
|
47
|
+
// 恢复原始滚动状态
|
|
48
|
+
document.body.style.overflow = originalBodyOverflow.current;
|
|
49
|
+
document.body.style.touchAction = 'auto';
|
|
50
|
+
var timer = setTimeout(function () {
|
|
51
|
+
return setIsMounted(false);
|
|
52
|
+
}, 100);
|
|
53
|
+
return function () {
|
|
54
|
+
return clearTimeout(timer);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}, [visible]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
if (!visible) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
var timer = setTimeout(function () {
|
|
63
|
+
var footer = document.querySelector(".".concat(cssClasses.PREFIX, "-stickyFooter"));
|
|
64
|
+
if (footer) {
|
|
65
|
+
var observer = new ResizeObserver(function (entries) {
|
|
66
|
+
var contentHeight = (entries === null || entries === void 0 ? void 0 : entries[0].contentRect.height) + 10;
|
|
67
|
+
var borderBoxHeight = (entries === null || entries === void 0 ? void 0 : entries[0].target.getBoundingClientRect().height) + 10;
|
|
68
|
+
setPaddingBottom(borderBoxHeight || contentHeight);
|
|
69
|
+
});
|
|
70
|
+
observer.observe(footer, {
|
|
71
|
+
box: 'border-box'
|
|
72
|
+
});
|
|
73
|
+
return function () {
|
|
74
|
+
return observer.disconnect();
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, 100);
|
|
78
|
+
return function () {
|
|
79
|
+
return clearTimeout(timer);
|
|
80
|
+
};
|
|
81
|
+
}, [visible]);
|
|
82
|
+
var colorDrawerBackgroundOverlay = designTokens.colorDrawerBackgroundOverlay,
|
|
83
|
+
colorDrawerBackgroundStandard = designTokens.colorDrawerBackgroundStandard,
|
|
84
|
+
borderTopLeftRadius = designTokens.borderTopLeftRadius,
|
|
85
|
+
borderTopRightRadius = designTokens.borderTopRightRadius,
|
|
86
|
+
spacingDrawerPaddingHorizontal = designTokens.spacingDrawerPaddingHorizontal,
|
|
87
|
+
sizingDrawerHandle = designTokens.sizingDrawerHandle,
|
|
88
|
+
colorDrawerHandle = designTokens.colorDrawerHandle,
|
|
89
|
+
spacingDrawerHandlePaddingTop = designTokens.spacingDrawerHandlePaddingTop,
|
|
90
|
+
spacingDrawerHandlePaddingBottom = designTokens.spacingDrawerHandlePaddingBottom,
|
|
91
|
+
colorDrawerTextHeader = designTokens.colorDrawerTextHeader,
|
|
92
|
+
spacingDrawerListOptionHorizontalGap = designTokens.spacingDrawerListOptionHorizontalGap,
|
|
93
|
+
spacingDrawerPaddingBottom = designTokens.spacingDrawerPaddingBottom,
|
|
94
|
+
spacingDrawerPaddingTop = designTokens.spacingDrawerPaddingTop;
|
|
95
|
+
if (!isMounted) return null;
|
|
96
|
+
var borderStyle = showBottomBorder ? {} : {
|
|
97
|
+
border: 'none'
|
|
98
|
+
};
|
|
99
|
+
var TitleCom = title ? /*#__PURE__*/_jsx("div", {
|
|
100
|
+
className: "".concat(cssClasses.PREFIX, "-drawer-header"),
|
|
101
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
102
|
+
size: "TitleT21Bold",
|
|
103
|
+
style: {
|
|
104
|
+
color: colorDrawerTextHeader,
|
|
105
|
+
marginBottom: "".concat(spacingDrawerListOptionHorizontalGap, "px"),
|
|
106
|
+
display: 'block'
|
|
107
|
+
},
|
|
108
|
+
children: title
|
|
109
|
+
})
|
|
110
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {});
|
|
111
|
+
return /*#__PURE__*/_jsx("div", {
|
|
112
|
+
className: "".concat(cssClasses.PREFIX, "-drawer-mask ").concat(visible ? 'visible' : ''),
|
|
113
|
+
style: {
|
|
114
|
+
background: colorDrawerBackgroundOverlay
|
|
115
|
+
},
|
|
116
|
+
onClick: onClose,
|
|
117
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
118
|
+
className: "".concat(cssClasses.PREFIX, "-drawer-content ").concat(visible ? 'active' : ''),
|
|
119
|
+
style: {
|
|
120
|
+
height: height,
|
|
121
|
+
background: colorDrawerBackgroundStandard,
|
|
122
|
+
borderTopLeftRadius: "".concat(borderTopLeftRadius, "px"),
|
|
123
|
+
borderTopRightRadius: "".concat(borderTopRightRadius, "px")
|
|
124
|
+
},
|
|
125
|
+
onClick: function onClick(e) {
|
|
126
|
+
return e.stopPropagation();
|
|
127
|
+
},
|
|
128
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
129
|
+
className: "".concat(cssClasses.PREFIX, "-drawer-inner"),
|
|
130
|
+
style: {
|
|
131
|
+
paddingLeft: "".concat(spacingDrawerPaddingHorizontal, "px"),
|
|
132
|
+
paddingRight: "".concat(spacingDrawerPaddingHorizontal, "px"),
|
|
133
|
+
paddingBottom: "".concat(paddingBottom, "px")
|
|
134
|
+
},
|
|
135
|
+
children: [drawerType === DrawerTypeEnum.DrawerTypeHandler && /*#__PURE__*/_jsx("div", {
|
|
136
|
+
className: "handle-bar",
|
|
137
|
+
style: {
|
|
138
|
+
width: sizingDrawerHandle ? "".concat(sizingDrawerHandle, "px") : 0,
|
|
139
|
+
background: colorDrawerHandle,
|
|
140
|
+
marginTop: "".concat(spacingDrawerHandlePaddingTop, "px"),
|
|
141
|
+
marginBottom: "".concat(spacingDrawerHandlePaddingBottom, "px")
|
|
142
|
+
}
|
|
143
|
+
}), drawerType === DrawerTypeEnum.DrawerTypeCloseBtn && /*#__PURE__*/_jsxs("div", {
|
|
144
|
+
className: "close-warp",
|
|
145
|
+
style: {
|
|
146
|
+
paddingTop: "".concat(spacingDrawerPaddingTop, "px")
|
|
147
|
+
// paddingBottom: `${spacingDrawerListOptionHorizontalGap}px`,
|
|
148
|
+
},
|
|
149
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
150
|
+
children: TitleCom
|
|
151
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
152
|
+
name: "icon-Close",
|
|
153
|
+
onClick: onClose
|
|
154
|
+
})]
|
|
155
|
+
}), showImage && /*#__PURE__*/_jsx(Image, {
|
|
156
|
+
radio: 2
|
|
157
|
+
// preview={false}
|
|
158
|
+
,
|
|
159
|
+
src: imageSrc,
|
|
160
|
+
imageSize: "100%",
|
|
161
|
+
style: {
|
|
162
|
+
marginBottom: "".concat(spacingDrawerPaddingBottom, "px")
|
|
163
|
+
}
|
|
164
|
+
}), drawerType !== DrawerTypeEnum.DrawerTypeCloseBtn && title && TitleCom, children]
|
|
165
|
+
}), (!!bottomBtnText || !!bottomLinkText) && /*#__PURE__*/_jsx(StickyFooter, {
|
|
166
|
+
onClick: onBottomBtnClick,
|
|
167
|
+
buttonText: bottomBtnText,
|
|
168
|
+
style: _objectSpread({
|
|
169
|
+
flexDirection: 'column',
|
|
170
|
+
flexShrink: 0
|
|
171
|
+
}, borderStyle),
|
|
172
|
+
children: !!bottomLinkText && /*#__PURE__*/_jsx(Text, {
|
|
173
|
+
onClick: function onClick(e) {
|
|
174
|
+
e === null || e === void 0 || e.stopPropagation();
|
|
175
|
+
if (onLinkClick) {
|
|
176
|
+
onLinkClick(e);
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
size: "ContentC14TextLink",
|
|
180
|
+
style: {
|
|
181
|
+
marginTop: "".concat(spacingDrawerListOptionHorizontalGap, "px")
|
|
182
|
+
},
|
|
183
|
+
children: bottomLinkText
|
|
184
|
+
})
|
|
185
|
+
})]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
export default BottomDrawer;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@import './variables.less';
|
|
2
|
+
|
|
3
|
+
// 添加iOS惯性滚动限制
|
|
4
|
+
.@{prefix}-drawer-content {
|
|
5
|
+
-webkit-overflow-scrolling: touch;
|
|
6
|
+
overscroll-behavior: contain;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.@{prefix}-drawer-mask {
|
|
10
|
+
touch-action: none; // 阻止移动端触摸事件
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background: rgba(0, 0, 0, 0.5);
|
|
17
|
+
opacity: 0;
|
|
18
|
+
transition: opacity @transition-duration @easing-function;
|
|
19
|
+
z-index: @mask-zindex;
|
|
20
|
+
|
|
21
|
+
&.visible {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.@{prefix}-drawer-content {
|
|
27
|
+
.transition-properties();
|
|
28
|
+
position: fixed;
|
|
29
|
+
left: 0;
|
|
30
|
+
width: 100%;
|
|
31
|
+
bottom: -100%;
|
|
32
|
+
background: white;
|
|
33
|
+
border-radius: @border-radius @border-radius 0 0;
|
|
34
|
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
|
|
35
|
+
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
|
|
40
|
+
min-height: 20vh;
|
|
41
|
+
max-height: 80vh;
|
|
42
|
+
|
|
43
|
+
&.active {
|
|
44
|
+
bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.handle-bar {
|
|
48
|
+
height: 4px;
|
|
49
|
+
margin: 0 auto;
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.@{prefix}-drawer-inner {
|
|
54
|
+
overflow: auto;
|
|
55
|
+
flex: 1;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
padding-bottom: 20px;
|
|
58
|
+
/* 防止底部遮挡 */
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.close-warp {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 混合 (Mixin)
|
|
71
|
+
.transition-properties() {
|
|
72
|
+
transition: bottom @transition-duration @easing-function;
|
|
73
|
+
}
|