@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,110 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["hideBorder", "className", "rightIcons", "rightLink", "title", "goBack", "isInverse", "titleIconBadge", "imgBackground", "noRight", "leftIconName", "leftIconSize"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import designTokens from "./designTokens";
|
|
6
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
7
|
+
import { isEmpty } from 'lodash';
|
|
8
|
+
import { theme } from "../../utils/theme";
|
|
9
|
+
import { IconButton, Text, IconButtonGroup, TextLink, TextLinkEnum, Icon } from "../index";
|
|
10
|
+
import { cssClasses } from "../../constants";
|
|
11
|
+
import "./style/index.less";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Navigation = function Navigation(_ref) {
|
|
14
|
+
var _rightIcons$slice;
|
|
15
|
+
var hideBorder = _ref.hideBorder,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
rightIcons = _ref.rightIcons,
|
|
18
|
+
rightLink = _ref.rightLink,
|
|
19
|
+
title = _ref.title,
|
|
20
|
+
goBack = _ref.goBack,
|
|
21
|
+
isInverse = _ref.isInverse,
|
|
22
|
+
titleIconBadge = _ref.titleIconBadge,
|
|
23
|
+
imgBackground = _ref.imgBackground,
|
|
24
|
+
_ref$noRight = _ref.noRight,
|
|
25
|
+
noRight = _ref$noRight === void 0 ? false : _ref$noRight,
|
|
26
|
+
leftIconName = _ref.leftIconName,
|
|
27
|
+
leftIconSize = _ref.leftIconSize,
|
|
28
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var spacingTopNavigationPaddingHorizontal = designTokens.spacingTopNavigationPaddingHorizontal,
|
|
30
|
+
spacingTopNavigationPaddingBottom = designTokens.spacingTopNavigationPaddingBottom,
|
|
31
|
+
colorTopNavigationBorderBottom = designTokens.colorTopNavigationBorderBottom,
|
|
32
|
+
spacingTopNavigationTextLinkPaddingRight = designTokens.spacingTopNavigationTextLinkPaddingRight,
|
|
33
|
+
colorTopNavigationBackgroundInverse = designTokens.colorTopNavigationBackgroundInverse,
|
|
34
|
+
colorTopNavigationBackground = designTokens.colorTopNavigationBackground,
|
|
35
|
+
colorTopNavigationTitleStandard = designTokens.colorTopNavigationTitleStandard,
|
|
36
|
+
colorTopNavigationTitleInverse = designTokens.colorTopNavigationTitleInverse,
|
|
37
|
+
colorTopNavigationGradient = designTokens.colorTopNavigationGradient;
|
|
38
|
+
console.log('designTokens', designTokens);
|
|
39
|
+
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
40
|
+
var hashId = useStyleRegister({
|
|
41
|
+
theme: theme,
|
|
42
|
+
token: {},
|
|
43
|
+
path: ["".concat(cssClasses.PREFIX, "-header")]
|
|
44
|
+
}, function () {
|
|
45
|
+
return "\n .".concat(cssClasses.PREFIX, "-header {\n padding-left: ").concat(spacingTopNavigationPaddingHorizontal, "px;\n padding-right: ").concat(spacingTopNavigationPaddingHorizontal, "px;\n padding-bottom: ").concat(spacingTopNavigationPaddingBottom, "px;\n padding-top: ").concat(spacingTopNavigationPaddingBottom, "px; // TODO\uFF1A\u8BBE\u8BA1\u7A3F\u4E0A\u6CA1\u6709\u6682\u65F6\u52A0\u7684\n border-bottom: 1px solid ").concat(colorTopNavigationBorderBottom, ";\n background-color:").concat(colorTopNavigationBackground, ";\n &.inverse {\n background-color:").concat(colorTopNavigationBackgroundInverse, ";\n }\n &.imgBackground {\n background:").concat(colorTopNavigationGradient, ";\n }\n &.hideBorder {\n border-bottom:none;\n box-shadow: 0px -2px 10px 0px rgba(26, 24, 134, 0.1);\n }\n &.noRight{\n justify-content:center !important;\n .dxp-title-warp{\n line-height:41px;\n }\n .").concat(cssClasses.PREFIX, "-header-back {\n position:absolute;\n left: ").concat(spacingTopNavigationPaddingHorizontal, "px;\n }\n }\n }\n .").concat(cssClasses.PREFIX, "-title {\n color:").concat(colorTopNavigationTitleStandard, ";\n &.inverse {\n color:").concat(colorTopNavigationTitleInverse, ";\n }\n }\n .").concat(cssClasses.PREFIX, "-right-link {\n padding-right: ").concat(spacingTopNavigationTextLinkPaddingRight, "px;\n }\n ");
|
|
46
|
+
});
|
|
47
|
+
return hashId;
|
|
48
|
+
};
|
|
49
|
+
useCustomButtonStyle();
|
|
50
|
+
var onGoBack = function onGoBack() {
|
|
51
|
+
if (goBack) {
|
|
52
|
+
goBack();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/_jsxs("header", _objectSpread(_objectSpread({
|
|
56
|
+
className: "".concat(cssClasses.PREFIX, "-header ").concat(hideBorder ? 'hideBorder' : '', " ").concat(isInverse ? 'inverse' : '', " ").concat(imgBackground ? 'imgBackground' : '', " ").concat(noRight ? 'noRight' : '', " ").concat(className || '')
|
|
57
|
+
}, restProps), {}, {
|
|
58
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
59
|
+
className: "".concat(cssClasses.PREFIX, "-header-back"),
|
|
60
|
+
customeIconSize: leftIconSize,
|
|
61
|
+
inverse: isInverse,
|
|
62
|
+
size: "medium",
|
|
63
|
+
name: leftIconName || "icon-a-Backarrow-copy",
|
|
64
|
+
onClick: onGoBack
|
|
65
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: "\n ".concat(cssClasses.PREFIX, "-title-warp\n "),
|
|
67
|
+
children: !isEmpty(titleIconBadge) ? /*#__PURE__*/_jsxs("div", {
|
|
68
|
+
className: "".concat(cssClasses.PREFIX, "-title-badge"),
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
inverse: isInverse,
|
|
71
|
+
size: 24,
|
|
72
|
+
style: {
|
|
73
|
+
marginRight: '4px'
|
|
74
|
+
},
|
|
75
|
+
name: titleIconBadge.iconName
|
|
76
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
77
|
+
inverse: isInverse,
|
|
78
|
+
size: "ContentC14Bold",
|
|
79
|
+
className: "".concat(cssClasses.PREFIX, "-title ").concat(isInverse ? 'inverse' : '', " "),
|
|
80
|
+
children: titleIconBadge.title
|
|
81
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
82
|
+
className: "".concat(cssClasses.PREFIX, "-badge"),
|
|
83
|
+
children: +titleIconBadge.badge > 99 ? '99+' : titleIconBadge.badge
|
|
84
|
+
})]
|
|
85
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
86
|
+
inverse: isInverse,
|
|
87
|
+
size: "ContentC14Bold",
|
|
88
|
+
className: "".concat(cssClasses.PREFIX, "-title ").concat(isInverse ? 'inverse' : '', " "),
|
|
89
|
+
children: title
|
|
90
|
+
})
|
|
91
|
+
}), !noRight && /*#__PURE__*/_jsxs(IconButtonGroup, {
|
|
92
|
+
className: "".concat(cssClasses.PREFIX, "-rightWarp"),
|
|
93
|
+
children: [rightIcons === null || rightIcons === void 0 || (_rightIcons$slice = rightIcons.slice(0, 3)) === null || _rightIcons$slice === void 0 ? void 0 : _rightIcons$slice.map(function (i, index) {
|
|
94
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
|
95
|
+
inverse: isInverse,
|
|
96
|
+
name: i.iconName,
|
|
97
|
+
size: "medium",
|
|
98
|
+
onClick: i.onIconClick
|
|
99
|
+
}, index);
|
|
100
|
+
}), !isEmpty(rightLink) && /*#__PURE__*/_jsx(TextLink, {
|
|
101
|
+
inverse: isInverse,
|
|
102
|
+
className: "".concat(cssClasses.PREFIX, "-right-link"),
|
|
103
|
+
type: TextLinkEnum.default,
|
|
104
|
+
text: rightLink.linkText,
|
|
105
|
+
onClick: rightLink.onLinkClick
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
export default Navigation;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import './variables.less';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.@{prefix}-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
position: fixed;
|
|
9
|
+
left: 0;
|
|
10
|
+
top: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
z-index: 999;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
.@{prefix}-title-warp {
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.@{prefix}-title {
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.@{prefix}-title-badge {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: flex;
|
|
31
|
+
|
|
32
|
+
.@{prefix}-badge {
|
|
33
|
+
position: absolute;
|
|
34
|
+
right: -36px;
|
|
35
|
+
top: -2px;
|
|
36
|
+
background-color: #FA2C2C;
|
|
37
|
+
color: #FFF;
|
|
38
|
+
height: 18px;
|
|
39
|
+
width: 38px;
|
|
40
|
+
border-radius: 18px;
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
text-align: center;
|
|
43
|
+
line-height: 18px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.@{prefix}-rightWarp {
|
|
49
|
+
flex: 0 0 auto;
|
|
50
|
+
/* 关键!禁止伸缩 */
|
|
51
|
+
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../../style/variables.less';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const otherDesignTokens: {
|
|
2
|
+
spacingSearchInputIconPaddingRight: any;
|
|
3
|
+
spacingSearchInputPaddingHorizontal: any;
|
|
4
|
+
colorSearchInputIconStandard: any;
|
|
5
|
+
spacingSearchInputVerticalGap: any;
|
|
6
|
+
colorSearchInputBackground: any;
|
|
7
|
+
colorSearchInputBackgroundHover: any;
|
|
8
|
+
colorSearchInputBorderStandard: any;
|
|
9
|
+
colorSearchInputTextPlaceholder: any;
|
|
10
|
+
colorSearchInputTextLabel: any;
|
|
11
|
+
colorSearchInputTextResults: any;
|
|
12
|
+
spacingSearchInputResultPaddingVertical: any;
|
|
13
|
+
spacingSearchInputResultListPaddingLeft: any;
|
|
14
|
+
spacingSearchInputResultListPaddingRight: any;
|
|
15
|
+
};
|
|
16
|
+
declare const designTokens: {
|
|
17
|
+
borderRadius: any;
|
|
18
|
+
paddingBlock: number;
|
|
19
|
+
paddingInline: any;
|
|
20
|
+
colorText: any;
|
|
21
|
+
hoverBorderColor: any;
|
|
22
|
+
activeBorderColor: any;
|
|
23
|
+
activeShadow: string;
|
|
24
|
+
colorBgContainer: any;
|
|
25
|
+
borderWidthInputStandard: any;
|
|
26
|
+
colorBorder: any;
|
|
27
|
+
colorInputTextPlaceholder: any;
|
|
28
|
+
fontSize: any;
|
|
29
|
+
lineHeight: number;
|
|
30
|
+
};
|
|
31
|
+
declare const styleToken: {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
};
|
|
34
|
+
export { designTokens, otherDesignTokens, styleToken };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
3
|
+
// import { wSacle } from '@/utils/scaleTool';
|
|
4
|
+
import { cssClasses } from "../../constants";
|
|
5
|
+
var prefixCls = cssClasses.PREFIX + '-input-outside';
|
|
6
|
+
var otherDesignTokens = {
|
|
7
|
+
spacingSearchInputIconPaddingRight: getToken('spacingSearchInputIconPaddingRight'),
|
|
8
|
+
spacingSearchInputPaddingHorizontal: getToken('spacingSearchInputPaddingHorizontal'),
|
|
9
|
+
colorSearchInputIconStandard: getToken('colorSearchInputIconStandard'),
|
|
10
|
+
// 搜索图标颜色
|
|
11
|
+
spacingSearchInputVerticalGap: getToken('spacingSearchInputVerticalGap'),
|
|
12
|
+
colorSearchInputBackground: getToken('colorSearchInputBackground'),
|
|
13
|
+
colorSearchInputBackgroundHover: getToken('colorSearchInputBackgroundHover'),
|
|
14
|
+
colorSearchInputBorderStandard: getToken('colorSearchInputBorderStandard'),
|
|
15
|
+
colorSearchInputTextPlaceholder: getToken('colorSearchInputTextPlaceholder'),
|
|
16
|
+
colorSearchInputTextLabel: getToken('colorSearchInputTextLabel'),
|
|
17
|
+
colorSearchInputTextResults: getToken('colorSearchInputTextResults'),
|
|
18
|
+
spacingSearchInputResultPaddingVertical: getToken('spacingSearchInputResultPaddingVertical'),
|
|
19
|
+
spacingSearchInputResultListPaddingLeft: getToken('spacingSearchInputResultListPaddingLeft'),
|
|
20
|
+
spacingSearchInputResultListPaddingRight: getToken('spacingSearchInputResultListPaddingRight')
|
|
21
|
+
};
|
|
22
|
+
var designTokens = {
|
|
23
|
+
borderRadius: getToken('borderRadiusInput'),
|
|
24
|
+
// 圆角
|
|
25
|
+
paddingBlock: 10,
|
|
26
|
+
// 纵向内边距
|
|
27
|
+
paddingInline: otherDesignTokens.spacingSearchInputPaddingHorizontal + 16 + otherDesignTokens.spacingSearchInputIconPaddingRight,
|
|
28
|
+
// 横向内边距
|
|
29
|
+
colorText: getToken('colorInputTextActive'),
|
|
30
|
+
// 内容文本颜色
|
|
31
|
+
hoverBorderColor: getToken('colorInputBorderActive'),
|
|
32
|
+
// hover边框颜色
|
|
33
|
+
activeBorderColor: getToken('colorInputBorderActive'),
|
|
34
|
+
// active边框颜色
|
|
35
|
+
activeShadow: 'none',
|
|
36
|
+
// activeShadow: '0px 0px 0px 2px #180C8E33', // 边框shadow颜色
|
|
37
|
+
colorBgContainer: getToken('colorInputBackground'),
|
|
38
|
+
// 背景颜色
|
|
39
|
+
borderWidthInputStandard: getToken('borderWidthInputStandard'),
|
|
40
|
+
// 标准边框宽度
|
|
41
|
+
colorBorder: getToken('colorInputBorderStandard'),
|
|
42
|
+
// 标准边框颜色
|
|
43
|
+
colorInputTextPlaceholder: getToken('colorInputTextPlaceholder'),
|
|
44
|
+
// placeholder文本颜色
|
|
45
|
+
fontSize: getToken('ContentC14Regular'),
|
|
46
|
+
// 字体大小
|
|
47
|
+
lineHeight: 1.5
|
|
48
|
+
// colorBgContainerDisabled: getToken('colorInputBackgroundHaze'), // 背景颜色
|
|
49
|
+
};
|
|
50
|
+
var styleToken = _defineProperty({}, "--".concat(prefixCls, "-color-error-border-hover"), getToken('colorInputBorderError'));
|
|
51
|
+
export { designTokens, otherDesignTokens, styleToken };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export interface SearchProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
resultList?: ReactNode;
|
|
6
|
+
onSearch?: (value: string) => void;
|
|
7
|
+
onEnter?: (value: string) => void;
|
|
8
|
+
showResult?: boolean;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
declare const Search: (props: SearchProps) => React.JSX.Element;
|
|
13
|
+
export default Search;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import "antd/es/input/style";
|
|
4
|
+
import _Input from "antd/es/input";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
8
|
+
import { theme } from "../../utils/theme";
|
|
9
|
+
import { cssClasses } from "../../constants";
|
|
10
|
+
import { designTokens, otherDesignTokens } from "./designTokens";
|
|
11
|
+
import Icon from "../Icon";
|
|
12
|
+
import "./style/index.less";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var Search = function Search(props) {
|
|
15
|
+
var placeholder = props.placeholder,
|
|
16
|
+
resultList = props.resultList,
|
|
17
|
+
_props$onSearch = props.onSearch,
|
|
18
|
+
onSearch = _props$onSearch === void 0 ? function () {} : _props$onSearch,
|
|
19
|
+
_props$onEnter = props.onEnter,
|
|
20
|
+
onEnter = _props$onEnter === void 0 ? function () {} : _props$onEnter,
|
|
21
|
+
showResult = props.showResult;
|
|
22
|
+
var prefix = "".concat(cssClasses.PREFIX, "-search");
|
|
23
|
+
var colorSearchInputIconStandard = otherDesignTokens.colorSearchInputIconStandard,
|
|
24
|
+
spacingSearchInputPaddingHorizontal = otherDesignTokens.spacingSearchInputPaddingHorizontal,
|
|
25
|
+
spacingSearchInputVerticalGap = otherDesignTokens.spacingSearchInputVerticalGap,
|
|
26
|
+
colorSearchInputBackground = otherDesignTokens.colorSearchInputBackground,
|
|
27
|
+
spacingSearchInputResultPaddingVertical = otherDesignTokens.spacingSearchInputResultPaddingVertical,
|
|
28
|
+
colorSearchInputTextResults = otherDesignTokens.colorSearchInputTextResults,
|
|
29
|
+
spacingSearchInputResultListPaddingLeft = otherDesignTokens.spacingSearchInputResultListPaddingLeft,
|
|
30
|
+
spacingSearchInputResultListPaddingRight = otherDesignTokens.spacingSearchInputResultListPaddingRight,
|
|
31
|
+
colorSearchInputBackgroundHover = otherDesignTokens.colorSearchInputBackgroundHover,
|
|
32
|
+
colorSearchInputBorderStandard = otherDesignTokens.colorSearchInputBorderStandard;
|
|
33
|
+
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
34
|
+
var hashId = useStyleRegister({
|
|
35
|
+
theme: theme,
|
|
36
|
+
token: {
|
|
37
|
+
baseColor: 'blue'
|
|
38
|
+
},
|
|
39
|
+
path: ["".concat(prefix)]
|
|
40
|
+
}, function () {
|
|
41
|
+
return "\n .".concat(prefix, "-icon {\n color: ").concat(colorSearchInputIconStandard, ";\n top: 15px;\n left: ").concat(spacingSearchInputPaddingHorizontal, "px;\n }\n .").concat(prefix, "-result {\n margin-top: ").concat(spacingSearchInputVerticalGap, "px;\n padding: ").concat(spacingSearchInputResultPaddingVertical, "px 0;\n border: 1px solid ").concat(colorSearchInputBorderStandard, ";\n background: ").concat(colorSearchInputBackground, ";\n border-radius: ").concat(designTokens.borderRadius, "px;\n color: ").concat(colorSearchInputTextResults, ";\n }\n .").concat(prefix, "-result li {\n padding: ").concat(spacingSearchInputResultPaddingVertical, "px ").concat(spacingSearchInputResultListPaddingRight, "px ").concat(spacingSearchInputResultPaddingVertical, "px ").concat(spacingSearchInputResultListPaddingLeft, "px;\n line-height: 24px;\n }\n .").concat(prefix, "-result li:hover {\n background: ").concat(colorSearchInputBackgroundHover, ";\n }\n .").concat(prefix, "-result li a {\n color: ").concat(colorSearchInputTextResults, ";\n }\n ");
|
|
42
|
+
});
|
|
43
|
+
return hashId;
|
|
44
|
+
};
|
|
45
|
+
useCustomButtonStyle();
|
|
46
|
+
|
|
47
|
+
// const customStyle = styleToken as React.CSSProperties;
|
|
48
|
+
|
|
49
|
+
// const formDesign = layout === 'vertical' ? designFormTokens : designFormHorizontalTokens;
|
|
50
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
51
|
+
wave: {
|
|
52
|
+
disabled: true
|
|
53
|
+
},
|
|
54
|
+
prefixCls: prefix,
|
|
55
|
+
theme: {
|
|
56
|
+
components: {
|
|
57
|
+
Input: _objectSpread({}, designTokens)
|
|
58
|
+
},
|
|
59
|
+
cssVar: true,
|
|
60
|
+
hashed: false
|
|
61
|
+
},
|
|
62
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
63
|
+
className: prefix,
|
|
64
|
+
children: [/*#__PURE__*/_jsx(_Input, {
|
|
65
|
+
placeholder: placeholder,
|
|
66
|
+
onChange: function onChange(e) {
|
|
67
|
+
var val = e.target.value || '';
|
|
68
|
+
onSearch(val);
|
|
69
|
+
},
|
|
70
|
+
onPressEnter: function onPressEnter(e) {
|
|
71
|
+
var val = e.target.value || '';
|
|
72
|
+
onEnter(val);
|
|
73
|
+
}
|
|
74
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
75
|
+
className: "".concat(prefix, "-icon"),
|
|
76
|
+
size: 16,
|
|
77
|
+
name: "icon-Search"
|
|
78
|
+
}), resultList && /*#__PURE__*/_jsx("div", {
|
|
79
|
+
className: showResult ? "".concat(prefix, "-result ").concat(prefix, "-result-show") : "".concat(prefix, "-result"),
|
|
80
|
+
children: resultList
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
export default Search;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@import './variables.less';
|
|
2
|
+
|
|
3
|
+
// 基础按钮样式
|
|
4
|
+
@components: search;
|
|
5
|
+
|
|
6
|
+
.@{prefix}-@{components} {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.@{prefix}-@{components}-icon {
|
|
11
|
+
position: absolute;
|
|
12
|
+
line-height: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{prefix}-@{components}-result {
|
|
16
|
+
display: none;
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 0;
|
|
19
|
+
top: 46px;
|
|
20
|
+
width: 100%;
|
|
21
|
+
z-index: 9;
|
|
22
|
+
ul {
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
li {
|
|
26
|
+
list-style: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.@{prefix}-@{components}-result-show {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
colorText: any;
|
|
3
|
+
colorTextDescription: any;
|
|
4
|
+
colorTextLightSolid: any;
|
|
5
|
+
colorPrimary: any;
|
|
6
|
+
colorBorderBg: any;
|
|
7
|
+
colorBorderSecondary: any;
|
|
8
|
+
colorSplit: any;
|
|
9
|
+
};
|
|
10
|
+
declare const otherDesignTokens: {
|
|
11
|
+
[x: string]: string;
|
|
12
|
+
'--ant-steps-icon-size': string;
|
|
13
|
+
'--ant-steps-icon-size-sm': string;
|
|
14
|
+
'--dxp-steps-icon-size': string;
|
|
15
|
+
'--dxp-steps-icon-size-sm': string;
|
|
16
|
+
};
|
|
17
|
+
declare const mobileDesignTokens: {
|
|
18
|
+
colorStepperBackgroundActiveWeak: any;
|
|
19
|
+
'--dxp-steps-color-neutral': any;
|
|
20
|
+
'--dxp-steps-color-secondary': any;
|
|
21
|
+
'--dxp-steps-color-label2': any;
|
|
22
|
+
'--dxp-steps-background-active': any;
|
|
23
|
+
'--dxp-steps-background-activeWeak': any;
|
|
24
|
+
};
|
|
25
|
+
export { otherDesignTokens, mobileDesignTokens, };
|
|
26
|
+
export default designTokens;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
var _otherDesignTokens;
|
|
3
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
4
|
+
import { cssClasses } from "../../constants";
|
|
5
|
+
/*
|
|
6
|
+
这里是 dxp 的 UI token,缓存在本地的内置变量;
|
|
7
|
+
通过antd 提供的 ConfigProvider 注入了组件级 token 变量来实现 gomo 风格的UI组件;
|
|
8
|
+
|
|
9
|
+
理论上可以通过2种方式来实现 antd 的样式定制:
|
|
10
|
+
1. 直接写 /components/Button/style/button.less 文件通过 less 覆盖antd的样式,可控细节更多(相当于把 dxp 的 UI token 通过 less 的方式覆盖antd的样式);
|
|
11
|
+
2. 通过 ConfigProvider 注入组件级别的 token 变量,这种不用写 less 文件,但是可控细节更少,只能antd 提供了哪些 token,才能覆盖对应的值;
|
|
12
|
+
目前优先选择第二种,因为第一种需要写 less 文件,要知道对应组件的dom结构,才能覆盖;而第二种只需要对齐 变量值,就能覆盖;
|
|
13
|
+
*/
|
|
14
|
+
var prefixCls = cssClasses.PREFIX + '-stepper';
|
|
15
|
+
var designTokens = {
|
|
16
|
+
// 算法配置
|
|
17
|
+
// algorithm: true,
|
|
18
|
+
|
|
19
|
+
// 当前 高亮步骤 text描述|| 已完成步骤的 text 色都是它
|
|
20
|
+
colorText: getToken('colorStepperTextInactive'),
|
|
21
|
+
// 深灰
|
|
22
|
+
// 未开始的步骤text色 \ text描述色
|
|
23
|
+
colorTextDescription: getToken('colorStepperTextInactive'),
|
|
24
|
+
// 当前 高亮步骤 icon的 text 色
|
|
25
|
+
colorTextLightSolid: getToken('colorStepperTextActive'),
|
|
26
|
+
// 白色
|
|
27
|
+
|
|
28
|
+
// 高亮步骤 background色
|
|
29
|
+
colorPrimary: getToken('colorStepperBackgroundActive'),
|
|
30
|
+
// 蓝色
|
|
31
|
+
// 高亮步骤 分割线的颜色 此颜色和 colorPrimary 的颜色一致(自动的)
|
|
32
|
+
|
|
33
|
+
// 已完成 background 颜色 无此token 通过less 变量覆盖
|
|
34
|
+
// colorSuccess: getToken('colorStepperBackgroundSuccess'),
|
|
35
|
+
|
|
36
|
+
// 未开始 状态 background 颜色 无此token 通过less 变量覆盖
|
|
37
|
+
// processIconBgColor: getToken('colorStepperBackgroundInactive'),
|
|
38
|
+
|
|
39
|
+
// 进行中状态 线条颜色
|
|
40
|
+
colorBorderBg: getToken('colorStepperBorderActive'),
|
|
41
|
+
colorBorderSecondary: getToken('colorStepperConnectorInactive'),
|
|
42
|
+
// colorSplit 未开始 分割线的颜色,此颜色和 colorBorderSecondary 的颜色一致
|
|
43
|
+
colorSplit: getToken('colorStepperConnectorInactive') // 灰色
|
|
44
|
+
|
|
45
|
+
// color.stepper.icon.success
|
|
46
|
+
// fontSize: '14px',
|
|
47
|
+
// fontSizeSM: '14px',
|
|
48
|
+
};
|
|
49
|
+
var otherDesignTokens = (_otherDesignTokens = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_otherDesignTokens, "--".concat(cssClasses.PREFIX, "-progress-default-color"), "".concat(getToken('colorStepperBorderActive'))), "--".concat(prefixCls, "-progress-default-color"), "".concat(getToken('colorStepperBorderActive'))), "--".concat(prefixCls, "-progress-border-width"), "".concat(getToken('borderWidthStepperActive'))), "--".concat(prefixCls, "-progress-border-connector"), "".concat(getToken('borderWidthStepperConnector'))), "--".concat(prefixCls, "-finish-icon-bg-color"), "".concat(getToken('colorStepperBackgroundSuccess'))), "--".concat(prefixCls, "-finish-icon-border-color"), "".concat(getToken('colorStepperBackgroundSuccess'))), "--".concat(prefixCls, "-finish-icon-success"), "".concat(getToken('colorStepperIconSuccess'))), "--".concat(prefixCls, "-finish-line-color"), "".concat(getToken('colorStepperConnectorSuccess'))), "--".concat(prefixCls, "-wait-icon-bg-color"), "".concat(getToken('colorStepperBackgroundInactive'))), "--".concat(prefixCls, "-wait-icon-border-color"), "".concat(getToken('colorStepperBackgroundInactive'))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_otherDesignTokens, "--".concat(prefixCls, "-wait-icon-color"), "".concat(getToken('colorStepperTextLabel'))), '--ant-steps-icon-size', getToken('sizingStepperOuter') + 'px'), '--ant-steps-icon-size-sm', getToken('sizingStepperInner') + 'px'), '--dxp-steps-icon-size', getToken('sizingStepperOuter') + 'px'), '--dxp-steps-icon-size-sm', getToken('sizingStepperInner') + 'px'));
|
|
50
|
+
var mobileDesignTokens = {
|
|
51
|
+
colorStepperBackgroundActiveWeak: getToken('colorStepperBackgroundActiveWeak'),
|
|
52
|
+
// moblie
|
|
53
|
+
'--dxp-steps-color-neutral': getToken('colorStepperTextNeutral'),
|
|
54
|
+
'--dxp-steps-color-secondary': getToken('colorStepperTextLabel'),
|
|
55
|
+
'--dxp-steps-color-label2': getToken('colorStepperTextLabel2'),
|
|
56
|
+
'--dxp-steps-background-active': getToken('colorStepperBackgroundActive'),
|
|
57
|
+
'--dxp-steps-background-activeWeak': getToken('colorStepperBackgroundActiveWeak')
|
|
58
|
+
};
|
|
59
|
+
export { otherDesignTokens, mobileDesignTokens };
|
|
60
|
+
export default designTokens;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StepsProps } from 'antd';
|
|
2
|
+
import React, { PureComponent } from 'react';
|
|
3
|
+
import './style/index.less';
|
|
4
|
+
export interface StepperProps extends Omit<StepsProps, 'description'> {
|
|
5
|
+
description?: string;
|
|
6
|
+
prefixCls?: string;
|
|
7
|
+
breakpoint?: 'desktop' | 'mobile';
|
|
8
|
+
percent?: number;
|
|
9
|
+
title?: string;
|
|
10
|
+
labelPlacement?: 'horizontal' | 'vertical';
|
|
11
|
+
nextStepText?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export default class Stepper extends PureComponent<StepperProps> {
|
|
15
|
+
static defaultProps: {
|
|
16
|
+
prefixCls: string;
|
|
17
|
+
breakpoint: string;
|
|
18
|
+
labelPlacement: string;
|
|
19
|
+
};
|
|
20
|
+
descriptionText: (content: React.ReactNode) => React.JSX.Element;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import "antd/es/steps/style";
|
|
4
|
+
import _Steps from "antd/es/steps";
|
|
5
|
+
import "antd/es/progress/style";
|
|
6
|
+
import _Progress from "antd/es/progress";
|
|
7
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
8
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
9
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
10
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
11
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
12
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
13
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
14
|
+
import React, { PureComponent } from 'react';
|
|
15
|
+
import { cssClasses } from "../../constants";
|
|
16
|
+
import Text from "../Text";
|
|
17
|
+
import designTokens, { mobileDesignTokens, otherDesignTokens } from "./designTokens";
|
|
18
|
+
import "./style/index.less";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
var Stepper = /*#__PURE__*/function (_PureComponent) {
|
|
21
|
+
_inherits(Stepper, _PureComponent);
|
|
22
|
+
var _super = _createSuper(Stepper);
|
|
23
|
+
function Stepper() {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, Stepper);
|
|
26
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
|
+
args[_key] = arguments[_key];
|
|
28
|
+
}
|
|
29
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "descriptionText", function (content) {
|
|
31
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
32
|
+
className: cssClasses.PREFIX + '-stepper-description',
|
|
33
|
+
size: "ContentC12Bold",
|
|
34
|
+
children: content
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
_createClass(Stepper, [{
|
|
40
|
+
key: "render",
|
|
41
|
+
value: function render() {
|
|
42
|
+
var _this2 = this;
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
style = _this$props.style,
|
|
45
|
+
items = _this$props.items,
|
|
46
|
+
children = _this$props.children,
|
|
47
|
+
breakpoint = _this$props.breakpoint,
|
|
48
|
+
percent = _this$props.percent,
|
|
49
|
+
current = _this$props.current,
|
|
50
|
+
_this$props$nextStepT = _this$props.nextStepText,
|
|
51
|
+
nextStepText = _this$props$nextStepT === void 0 ? 'Next Step:' : _this$props$nextStepT;
|
|
52
|
+
|
|
53
|
+
// 处理 items 方式
|
|
54
|
+
var processedItems = items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
55
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
56
|
+
description: _this2.descriptionText(item.description)
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// 处理 children 方式
|
|
61
|
+
var processedChildren = children && React.Children.map(children, function (child) {
|
|
62
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
63
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
64
|
+
description: _this2.descriptionText(child.props.description)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return child;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// 计算总步骤数
|
|
71
|
+
var totalSteps = (items === null || items === void 0 ? void 0 : items.length) || React.Children.count(children) || 0;
|
|
72
|
+
// 优化获取步骤信息的逻辑
|
|
73
|
+
var getStepInfo = function getStepInfo(items, current) {
|
|
74
|
+
var _items$current, _items;
|
|
75
|
+
var hasNextStep = items && current !== undefined && current < items.length - 1;
|
|
76
|
+
return {
|
|
77
|
+
title: hasNextStep ? ((_items$current = items[current]) === null || _items$current === void 0 ? void 0 : _items$current.title) || '' : '',
|
|
78
|
+
nextStep: hasNextStep ? ((_items = items[current + 1]) === null || _items === void 0 ? void 0 : _items.title) || '' : ''
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// 在 render 方法中使用
|
|
83
|
+
var _getStepInfo = getStepInfo(items, current),
|
|
84
|
+
title = _getStepInfo.title,
|
|
85
|
+
nextStep = _getStepInfo.nextStep;
|
|
86
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
87
|
+
prefixCls: cssClasses.PREFIX,
|
|
88
|
+
theme: {
|
|
89
|
+
components: {
|
|
90
|
+
Steps: _objectSpread({}, designTokens)
|
|
91
|
+
},
|
|
92
|
+
cssVar: true,
|
|
93
|
+
hashed: false
|
|
94
|
+
},
|
|
95
|
+
children: breakpoint === 'mobile' ? /*#__PURE__*/_jsx("div", {
|
|
96
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m"),
|
|
97
|
+
style: _objectSpread(_objectSpread({}, mobileDesignTokens), style),
|
|
98
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
99
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-header"),
|
|
100
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
101
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-count"),
|
|
102
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
103
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-neutral"),
|
|
104
|
+
breakpoint: "mobile",
|
|
105
|
+
size: "TitleT41Bold",
|
|
106
|
+
children: String(current !== undefined ? current + 1 : 1).padStart(2, '0')
|
|
107
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
108
|
+
breakpoint: "mobile",
|
|
109
|
+
size: "TitleT15Bold",
|
|
110
|
+
children: "/"
|
|
111
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
112
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-secondary"),
|
|
113
|
+
breakpoint: "mobile",
|
|
114
|
+
size: "TitleT23Bold",
|
|
115
|
+
children: totalSteps
|
|
116
|
+
})]
|
|
117
|
+
}), /*#__PURE__*/_jsx(_Progress, {
|
|
118
|
+
percent: percent,
|
|
119
|
+
status: "active",
|
|
120
|
+
strokeColor: designTokens.colorPrimary,
|
|
121
|
+
trailColor: mobileDesignTokens.colorStepperBackgroundActiveWeak,
|
|
122
|
+
showInfo: false,
|
|
123
|
+
size: ['100%', 8]
|
|
124
|
+
}), title && /*#__PURE__*/_jsx(Text, {
|
|
125
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-title"),
|
|
126
|
+
breakpoint: "mobile",
|
|
127
|
+
size: "TitleT15Bold",
|
|
128
|
+
children: title
|
|
129
|
+
}), nextStep && /*#__PURE__*/_jsx("div", {
|
|
130
|
+
className: "".concat(cssClasses.PREFIX, "-stepper-m-next"),
|
|
131
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
132
|
+
type: "secondary",
|
|
133
|
+
size: "ContentC12Regular",
|
|
134
|
+
children: [nextStepText, " ", nextStep]
|
|
135
|
+
})
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
}) : /*#__PURE__*/_jsx(_Steps, _objectSpread(_objectSpread({}, this.props), {}, {
|
|
139
|
+
items: processedItems,
|
|
140
|
+
style: _objectSpread(_objectSpread({}, otherDesignTokens), style),
|
|
141
|
+
children: processedChildren
|
|
142
|
+
}))
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}]);
|
|
146
|
+
return Stepper;
|
|
147
|
+
}(PureComponent);
|
|
148
|
+
_defineProperty(Stepper, "defaultProps", {
|
|
149
|
+
prefixCls: cssClasses.PREFIX + '-stepper',
|
|
150
|
+
breakpoint: 'desktop',
|
|
151
|
+
labelPlacement: 'vertical'
|
|
152
|
+
});
|
|
153
|
+
export { Stepper as default };
|