react-jupiter 5.12.0 → 6.0.0-beta.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/.babelrc +12 -0
- package/.env +3 -0
- package/.eslintignore +2 -0
- package/.eslintrc +18 -0
- package/.eslintrc.js +47 -0
- package/.eslintrc.json +16 -0
- package/.flowconfig +0 -0
- package/.storybook/main.js +27 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.js +30 -0
- package/.storybook/style.css +9 -0
- package/.vscode/settings.json +4 -0
- package/__mocks__/fileMock.js +1 -0
- package/config-overrides.js +34 -0
- package/dist/App.js +13 -0
- package/dist/components/accordion/index.js +25 -0
- package/dist/components/accordion/index.stories.js +82 -0
- package/dist/components/accordion/index.styles.js +52 -0
- package/dist/components/accordion/panel.js +41 -0
- package/dist/components/avatar/index.js +41 -0
- package/dist/components/avatar/index.stories.js +59 -0
- package/dist/components/avatar/index.styles.js +17 -0
- package/dist/components/avatar/index.test.js +10 -0
- package/dist/components/avatar/theme.js +13 -0
- package/dist/components/button/__snapshots__/index.test.js.snap +489 -0
- package/dist/components/button/index.js +209 -0
- package/dist/components/button/index.stories.js +304 -0
- package/dist/components/button/index.styles.js +104 -0
- package/dist/components/button/theme.js +58 -0
- package/dist/components/button/utils.js +12 -0
- package/dist/components/card/card-template/index.js +74 -0
- package/dist/components/card/card-template/index.stories.js +110 -0
- package/dist/components/card/card-template/index.style.js +25 -0
- package/dist/components/card/card-template/index.test.js +85 -0
- package/dist/components/card/event-card/constants.js +3 -0
- package/dist/components/card/event-card/event-card-label/index.js +24 -0
- package/dist/components/card/event-card/event-card-label/index.style.js +10 -0
- package/dist/components/card/event-card/event-card-label/index.test.js +23 -0
- package/dist/components/card/event-card/index.js +227 -0
- package/dist/components/card/event-card/index.stories.js +166 -0
- package/dist/components/card/event-card/index.style.js +129 -0
- package/dist/components/card/event-card/index.test.js +79 -0
- package/dist/components/card/index.js +16 -0
- package/dist/components/card/organization-card/index.js +59 -0
- package/dist/components/card/organization-card/index.stories.js +49 -0
- package/dist/components/card/organization-card/index.style.js +10 -0
- package/dist/components/card/organization-card/index.test.js +25 -0
- package/dist/components/card/orgnizer-card/buttons.js +48 -0
- package/dist/components/card/orgnizer-card/index.js +179 -0
- package/dist/components/card/orgnizer-card/index.stories.js +81 -0
- package/dist/components/card/orgnizer-card/index.style.js +58 -0
- package/dist/components/cover/index.js +74 -0
- package/dist/components/cover/index.style.js +48 -0
- package/dist/components/cover/index.test.js +25 -0
- package/dist/components/display/index.js +42 -0
- package/dist/components/display/index.style.js +79 -0
- package/dist/components/file-item/fileImgIcon.js +37 -0
- package/dist/components/file-item/fileImgsFont.js +800 -0
- package/dist/components/file-item/index.js +101 -0
- package/dist/components/file-item/index.stories.js +71 -0
- package/dist/components/file-item/index.style.js +31 -0
- package/dist/components/file-item/index.test.js +106 -0
- package/dist/components/file-item/theme.js +12 -0
- package/dist/components/file-item/utils.js +3 -0
- package/dist/components/form/captcha/index.js +86 -0
- package/dist/components/form/captcha/index.stories.js +42 -0
- package/dist/components/form/captcha/index.style.js +38 -0
- package/dist/components/form/captcha/index.test.js +31 -0
- package/dist/components/form/checkbox/checkbox-option.js +41 -0
- package/dist/components/form/checkbox/checkbox.js +54 -0
- package/dist/components/form/checkbox/index.js +10 -0
- package/dist/components/form/checkbox/index.stories.js +121 -0
- package/dist/components/form/checkbox/index.style.js +62 -0
- package/dist/components/form/dropdown/index.js +10 -0
- package/dist/components/form/dropdown/index.stories.js +119 -0
- package/dist/components/form/dropdown/index.style.js +57 -0
- package/dist/components/form/dropdown/index.test.js +20 -0
- package/dist/components/form/dropdown/option.js +22 -0
- package/dist/components/form/dropdown/select.js +68 -0
- package/dist/components/form/errorMsg.js +21 -0
- package/dist/components/form/index.js +22 -0
- package/dist/components/form/radio/index.js +10 -0
- package/dist/components/form/radio/index.stories.js +119 -0
- package/dist/components/form/radio/index.style.js +61 -0
- package/dist/components/form/radio/radio-option.js +45 -0
- package/dist/components/form/radio/radio.js +56 -0
- package/dist/components/form/text-input/index.js +92 -0
- package/dist/components/form/text-input/index.stories.js +77 -0
- package/dist/components/form/text-input/index.style.js +57 -0
- package/dist/components/form/text-input/index.test.js +63 -0
- package/dist/components/form/textarea/index.js +59 -0
- package/dist/components/form/textarea/index.stories.js +90 -0
- package/dist/components/form/textarea/index.style.js +25 -0
- package/dist/components/form/theme.js +16 -0
- package/dist/components/form-v7/captcha/index.js +101 -0
- package/dist/components/form-v7/captcha/index.stories.js +60 -0
- package/dist/components/form-v7/captcha/index.style.js +38 -0
- package/dist/components/form-v7/captcha/index.test.js +31 -0
- package/dist/components/form-v7/checkbox/checkbox-option.js +44 -0
- package/dist/components/form-v7/checkbox/checkbox.js +70 -0
- package/dist/components/form-v7/checkbox/index.js +10 -0
- package/dist/components/form-v7/checkbox/index.stories.js +113 -0
- package/dist/components/form-v7/checkbox/index.style.js +62 -0
- package/dist/components/form-v7/dropdown/index.js +10 -0
- package/dist/components/form-v7/dropdown/index.stories.js +130 -0
- package/dist/components/form-v7/dropdown/index.style.js +57 -0
- package/dist/components/form-v7/dropdown/index.test.js +20 -0
- package/dist/components/form-v7/dropdown/option.js +18 -0
- package/dist/components/form-v7/dropdown/select.js +85 -0
- package/dist/components/form-v7/errorMsg.js +21 -0
- package/dist/components/form-v7/file-input/index.js +73 -0
- package/dist/components/form-v7/file-input/index.stories.js +73 -0
- package/dist/components/form-v7/file-input/index.style.js +62 -0
- package/dist/components/form-v7/file-input/index.test.js +63 -0
- package/dist/components/form-v7/form/index.stories.js +276 -0
- package/dist/components/form-v7/index.js +25 -0
- package/dist/components/form-v7/index.style.js +11 -0
- package/dist/components/form-v7/label/index.js +31 -0
- package/dist/components/form-v7/label/index.style.js +12 -0
- package/dist/components/form-v7/radio/index.js +10 -0
- package/dist/components/form-v7/radio/index.stories.js +117 -0
- package/dist/components/form-v7/radio/index.style.js +61 -0
- package/dist/components/form-v7/radio/radio-option.js +45 -0
- package/dist/components/form-v7/radio/radio.js +75 -0
- package/dist/components/form-v7/text-input/index.js +132 -0
- package/dist/components/form-v7/text-input/index.stories.js +96 -0
- package/dist/components/form-v7/text-input/index.style.js +49 -0
- package/dist/components/form-v7/text-input/index.test.js +63 -0
- package/dist/components/form-v7/textarea/index.js +71 -0
- package/dist/components/form-v7/textarea/index.stories.js +91 -0
- package/dist/components/form-v7/textarea/index.style.js +25 -0
- package/dist/components/form-v7/theme.js +20 -0
- package/dist/components/globalStyle.js +28 -0
- package/dist/components/grid/index.js +83 -0
- package/dist/components/icon/iconFont.js +806 -0
- package/dist/components/icon/index.js +116 -0
- package/dist/components/icon/index.stories.js +45 -0
- package/dist/components/icon/index.styles.js +12 -0
- package/dist/components/icon/index.test.js +66 -0
- package/dist/components/icon/theme.js +23 -0
- package/dist/components/index.js +75 -0
- package/dist/components/modal/index.js +100 -0
- package/dist/components/modal/index.stories.js +86 -0
- package/dist/components/modal/index.style.js +40 -0
- package/dist/components/modal/theme.js +11 -0
- package/dist/components/numeric-summery-report/index.js +28 -0
- package/dist/components/numeric-summery-report/index.stories.js +37 -0
- package/dist/components/numeric-summery-report/index.style.js +16 -0
- package/dist/components/numeric-summery-report/index.test.js +22 -0
- package/dist/components/product-menu/index.js +10 -0
- package/dist/components/product-menu/index.stories.js +33 -0
- package/dist/components/product-menu/index.style.js +38 -0
- package/dist/components/product-menu/index.test.js +27 -0
- package/dist/components/product-menu/menu-item.js +23 -0
- package/dist/components/product-menu/menu.js +88 -0
- package/dist/components/product-menu/theme.js +16 -0
- package/dist/components/product-owner/index.js +85 -0
- package/dist/components/product-owner/index.style.js +16 -0
- package/dist/components/product-owner/index.test.js +75 -0
- package/dist/components/product-properties/index.js +65 -0
- package/dist/components/product-properties/index.stories.js +52 -0
- package/dist/components/product-properties/index.style.js +14 -0
- package/dist/components/product-properties/index.test.js +31 -0
- package/dist/components/product-properties/product-property/index.js +49 -0
- package/dist/components/product-properties/product-property/index.style.js +9 -0
- package/dist/components/progress-bar/index.js +46 -0
- package/dist/components/progress-bar/index.stories.js +33 -0
- package/dist/components/progress-bar/index.styles.js +65 -0
- package/dist/components/responsive/index.js +44 -0
- package/dist/components/show-date/index.js +25 -0
- package/dist/components/show-date/index.stories.js +51 -0
- package/dist/components/show-date/index.test.js +24 -0
- package/dist/components/spacing/core.js +106 -0
- package/dist/components/spacing/index.js +10 -0
- package/dist/components/spacing/margin/index.js +26 -0
- package/dist/components/spacing/padding/index.js +26 -0
- package/dist/components/storybook.css +54 -0
- package/dist/components/table/actionCell.js +57 -0
- package/dist/components/table/index.js +56 -0
- package/dist/components/table/index.stories.js +188 -0
- package/dist/components/table/index.style.js +107 -0
- package/dist/components/table/index.test.js +119 -0
- package/dist/components/table/tableHeaderRow.js +28 -0
- package/dist/components/table/tableRow.js +60 -0
- package/dist/components/table/theme.js +8 -0
- package/dist/components/tabs/index.js +10 -0
- package/dist/components/tabs/index.stories.js +61 -0
- package/dist/components/tabs/index.style.js +35 -0
- package/dist/components/tabs/index.test.js +30 -0
- package/dist/components/tabs/tabPanel.js +17 -0
- package/dist/components/tabs/tabs.js +71 -0
- package/dist/components/tabs/theme.js +10 -0
- package/dist/components/themes.js +97 -0
- package/dist/components/titled-avatar/index.js +48 -0
- package/dist/components/titled-avatar/index.stories.js +52 -0
- package/dist/components/titled-avatar/index.style.js +30 -0
- package/dist/components/titled-avatar/index.test.js +25 -0
- package/dist/components/typography/heading/index.js +59 -0
- package/dist/components/typography/heading/index.stories.js +94 -0
- package/dist/components/typography/heading/index.styles.js +69 -0
- package/dist/components/typography/heading/index.test.js +122 -0
- package/dist/components/typography/index.js +16 -0
- package/dist/components/typography/link/index.js +82 -0
- package/dist/components/typography/link/index.stories.js +70 -0
- package/dist/components/typography/link/index.styles.js +8 -0
- package/dist/components/typography/link/index.test.js +60 -0
- package/dist/components/typography/paragraph/index.js +37 -0
- package/dist/components/typography/paragraph/index.stories.js +56 -0
- package/dist/components/typography/paragraph/index.styles.js +12 -0
- package/dist/components/typography/paragraph/index.test.js +47 -0
- package/dist/components/typography/text/index.js +156 -0
- package/dist/components/typography/text/index.stories.js +196 -0
- package/dist/components/typography/text/index.styles.js +73 -0
- package/dist/components/typography/text/index.test.js +333 -0
- package/dist/components/typography/theme.js +66 -0
- package/dist/components/typography/utils.js +53 -0
- package/dist/components/typography/utils.test.js +188 -0
- package/dist/components/utils/date.js +7 -0
- package/dist/components/utils/date.test.js +15 -0
- package/dist/components/utils/detectMobile.js +15 -0
- package/dist/components/utils/index.js +7 -0
- package/dist/components/utils/media-query.js +12 -0
- package/dist/components/utils/numbers.js +25 -0
- package/dist/components/utils/test.js +6 -0
- package/dist/components/utils/theme.js +67 -0
- package/dist/docs/App.css +33 -0
- package/dist/docs/App.js +52 -0
- package/dist/docs/assets/ads-label.svg +13 -0
- package/dist/docs/assets/avatar-sample.jpeg +0 -0
- package/dist/docs/assets/cover-sample.png +0 -0
- package/dist/docs/assets/fonts/filesImgs.woff +0 -0
- package/dist/docs/assets/fonts/icomoon.woff +0 -0
- package/dist/docs/assets/fonts/iransharp_bold_web.woff +0 -0
- package/dist/docs/assets/fonts/iransharp_bold_web.woff2 +0 -0
- package/dist/docs/assets/fonts/iransharp_regular_web.woff +0 -0
- package/dist/docs/assets/fonts/iransharp_regular_web.woff2 +0 -0
- package/dist/docs/assets/fonts/wer6t7890- +0 -0
- package/dist/docs/assets/logo.svg +7 -0
- package/dist/docs/components/header/index.js +10 -0
- package/dist/docs/components/header/index.styles.js +10 -0
- package/dist/docs/components/side-navigation/index.js +167 -0
- package/dist/docs/components/side-navigation/index.styles.js +46 -0
- package/dist/docs/containers/avatar/index.js +92 -0
- package/dist/docs/containers/button/index.js +295 -0
- package/dist/docs/containers/card/index.js +153 -0
- package/dist/docs/containers/cover/index.js +77 -0
- package/dist/docs/containers/form/index.js +41 -0
- package/dist/docs/containers/home/index.js +41 -0
- package/dist/docs/containers/icon/index.js +56 -0
- package/dist/docs/containers/icons/index.js +1488 -0
- package/dist/docs/containers/product/index.js +123 -0
- package/dist/docs/containers/typography/index.js +138 -0
- package/dist/docs/globalStyle.js +58 -0
- package/dist/index.css +3 -0
- package/dist/index.js +18 -0
- package/dist/playground/index.js +144 -0
- package/dist/playground.css +26 -0
- package/dist/serviceWorker.js +135 -0
- package/dist/setupTests.js +24 -0
- package/dist/stories/Page.js +67 -0
- package/dist/storybook.css +58 -0
- package/dist/styles.css +3 -0
- package/dist/test-utils.js +21 -0
- package/doctor-storybook.log +25 -0
- package/migration-storybook.log +329 -0
- package/package.json +3 -5
- package/package.lib.json +47 -0
- package/postcss.config.js +6 -0
- package/public/assets/fonts/iransharp_bold_web.woff2 +0 -0
- package/public/assets/fonts/iransharp_light_web.woff2 +0 -0
- package/public/assets/fonts/iransharp_regular_web.woff2 +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo.svg +1 -0
- package/public/logo142.svg +1 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +2 -0
- package/src/App.js +13 -0
- package/src/components/accordion/index.js +25 -0
- package/src/components/accordion/index.stories.js +82 -0
- package/src/components/accordion/index.styles.js +52 -0
- package/src/components/accordion/panel.js +41 -0
- package/src/components/avatar/index.js +41 -0
- package/src/components/avatar/index.stories.js +59 -0
- package/src/components/avatar/index.styles.js +17 -0
- package/src/components/avatar/index.test.js +10 -0
- package/src/components/avatar/theme.js +13 -0
- package/src/components/button/__snapshots__/index.test.js.snap +489 -0
- package/src/components/button/index.js +209 -0
- package/src/components/button/index.stories.js +304 -0
- package/src/components/button/index.styles.js +104 -0
- package/src/components/button/theme.js +60 -0
- package/src/components/button/utils.js +12 -0
- package/src/components/card/card-template/index.js +74 -0
- package/src/components/card/card-template/index.stories.js +110 -0
- package/src/components/card/card-template/index.style.js +25 -0
- package/src/components/card/card-template/index.test.js +85 -0
- package/src/components/card/event-card/constants.js +3 -0
- package/src/components/card/event-card/event-card-label/index.js +24 -0
- package/src/components/card/event-card/event-card-label/index.style.js +10 -0
- package/src/components/card/event-card/event-card-label/index.test.js +23 -0
- package/src/components/card/event-card/index.js +227 -0
- package/src/components/card/event-card/index.stories.js +166 -0
- package/src/components/card/event-card/index.style.js +129 -0
- package/src/components/card/event-card/index.test.js +79 -0
- package/src/components/card/index.js +16 -0
- package/src/components/card/organization-card/index.js +59 -0
- package/src/components/card/organization-card/index.stories.js +49 -0
- package/src/components/card/organization-card/index.style.js +10 -0
- package/src/components/card/organization-card/index.test.js +25 -0
- package/src/components/card/orgnizer-card/buttons.js +48 -0
- package/src/components/card/orgnizer-card/index.js +179 -0
- package/src/components/card/orgnizer-card/index.stories.js +81 -0
- package/src/components/card/orgnizer-card/index.style.js +58 -0
- package/src/components/cover/index.js +74 -0
- package/src/components/cover/index.style.js +48 -0
- package/src/components/cover/index.test.js +25 -0
- package/src/components/display/index.js +42 -0
- package/src/components/display/index.style.js +80 -0
- package/src/components/file-item/fileImgIcon.js +37 -0
- package/src/components/file-item/fileImgsFont.js +800 -0
- package/src/components/file-item/index.js +101 -0
- package/src/components/file-item/index.stories.js +71 -0
- package/src/components/file-item/index.style.js +31 -0
- package/src/components/file-item/index.test.js +106 -0
- package/src/components/file-item/theme.js +12 -0
- package/src/components/file-item/utils.js +3 -0
- package/src/components/form/captcha/index.js +86 -0
- package/src/components/form/captcha/index.stories.js +42 -0
- package/src/components/form/captcha/index.style.js +38 -0
- package/src/components/form/captcha/index.test.js +31 -0
- package/src/components/form/checkbox/checkbox-option.js +41 -0
- package/src/components/form/checkbox/checkbox.js +54 -0
- package/src/components/form/checkbox/index.js +10 -0
- package/src/components/form/checkbox/index.stories.js +121 -0
- package/src/components/form/checkbox/index.style.js +62 -0
- package/src/components/form/dropdown/index.js +10 -0
- package/src/components/form/dropdown/index.stories.js +119 -0
- package/src/components/form/dropdown/index.style.js +57 -0
- package/src/components/form/dropdown/index.test.js +20 -0
- package/src/components/form/dropdown/option.js +22 -0
- package/src/components/form/dropdown/select.js +68 -0
- package/src/components/form/errorMsg.js +21 -0
- package/src/components/form/index.js +22 -0
- package/src/components/form/radio/index.js +10 -0
- package/src/components/form/radio/index.stories.js +119 -0
- package/src/components/form/radio/index.style.js +61 -0
- package/src/components/form/radio/radio-option.js +45 -0
- package/src/components/form/radio/radio.js +56 -0
- package/src/components/form/text-input/index.js +92 -0
- package/src/components/form/text-input/index.stories.js +77 -0
- package/src/components/form/text-input/index.style.js +57 -0
- package/src/components/form/text-input/index.test.js +63 -0
- package/src/components/form/textarea/index.js +59 -0
- package/src/components/form/textarea/index.stories.js +90 -0
- package/src/components/form/textarea/index.style.js +25 -0
- package/src/components/form/theme.js +16 -0
- package/src/components/form-v7/captcha/index.js +101 -0
- package/src/components/form-v7/captcha/index.stories.js +60 -0
- package/src/components/form-v7/captcha/index.style.js +38 -0
- package/src/components/form-v7/captcha/index.test.js +31 -0
- package/src/components/form-v7/checkbox/checkbox-option.js +44 -0
- package/src/components/form-v7/checkbox/checkbox.js +70 -0
- package/src/components/form-v7/checkbox/index.js +10 -0
- package/src/components/form-v7/checkbox/index.stories.js +113 -0
- package/src/components/form-v7/checkbox/index.style.js +62 -0
- package/src/components/form-v7/dropdown/index.js +10 -0
- package/src/components/form-v7/dropdown/index.stories.js +130 -0
- package/src/components/form-v7/dropdown/index.style.js +57 -0
- package/src/components/form-v7/dropdown/index.test.js +20 -0
- package/src/components/form-v7/dropdown/option.js +18 -0
- package/src/components/form-v7/dropdown/select.js +85 -0
- package/src/components/form-v7/errorMsg.js +21 -0
- package/src/components/form-v7/file-input/index.js +73 -0
- package/src/components/form-v7/file-input/index.stories.js +73 -0
- package/src/components/form-v7/file-input/index.style.js +62 -0
- package/src/components/form-v7/file-input/index.test.js +63 -0
- package/src/components/form-v7/form/index.stories.js +276 -0
- package/src/components/form-v7/index.js +25 -0
- package/src/components/form-v7/index.style.js +11 -0
- package/src/components/form-v7/label/index.js +31 -0
- package/src/components/form-v7/label/index.style.js +12 -0
- package/src/components/form-v7/radio/index.js +10 -0
- package/src/components/form-v7/radio/index.stories.js +117 -0
- package/src/components/form-v7/radio/index.style.js +61 -0
- package/src/components/form-v7/radio/radio-option.js +45 -0
- package/src/components/form-v7/radio/radio.js +75 -0
- package/src/components/form-v7/text-input/index.js +132 -0
- package/src/components/form-v7/text-input/index.stories.js +96 -0
- package/src/components/form-v7/text-input/index.style.js +49 -0
- package/src/components/form-v7/text-input/index.test.js +63 -0
- package/src/components/form-v7/textarea/index.js +71 -0
- package/src/components/form-v7/textarea/index.stories.js +91 -0
- package/src/components/form-v7/textarea/index.style.js +25 -0
- package/src/components/form-v7/theme.js +20 -0
- package/src/components/globalStyle.js +28 -0
- package/src/components/grid/index.js +83 -0
- package/src/components/icon/iconFont.js +806 -0
- package/src/components/icon/index.js +116 -0
- package/src/components/icon/index.stories.js +45 -0
- package/src/components/icon/index.styles.js +12 -0
- package/src/components/icon/index.test.js +66 -0
- package/src/components/icon/theme.js +23 -0
- package/src/components/index.js +75 -0
- package/src/components/modal/index.js +100 -0
- package/src/components/modal/index.stories.js +86 -0
- package/src/components/modal/index.style.js +40 -0
- package/src/components/modal/theme.js +11 -0
- package/src/components/numeric-summery-report/index.js +28 -0
- package/src/components/numeric-summery-report/index.stories.js +37 -0
- package/src/components/numeric-summery-report/index.style.js +16 -0
- package/src/components/numeric-summery-report/index.test.js +22 -0
- package/src/components/product-menu/index.js +10 -0
- package/src/components/product-menu/index.stories.js +33 -0
- package/src/components/product-menu/index.style.js +38 -0
- package/src/components/product-menu/index.test.js +27 -0
- package/src/components/product-menu/menu-item.js +23 -0
- package/src/components/product-menu/menu.js +88 -0
- package/src/components/product-menu/theme.js +16 -0
- package/src/components/product-owner/index.js +85 -0
- package/src/components/product-owner/index.style.js +16 -0
- package/src/components/product-owner/index.test.js +75 -0
- package/src/components/product-properties/index.js +65 -0
- package/src/components/product-properties/index.stories.js +52 -0
- package/src/components/product-properties/index.style.js +14 -0
- package/src/components/product-properties/index.test.js +31 -0
- package/src/components/product-properties/product-property/index.js +49 -0
- package/src/components/product-properties/product-property/index.style.js +9 -0
- package/src/components/progress-bar/index.js +46 -0
- package/src/components/progress-bar/index.stories.js +33 -0
- package/src/components/progress-bar/index.styles.js +65 -0
- package/src/components/responsive/index.js +44 -0
- package/src/components/show-date/index.js +25 -0
- package/src/components/show-date/index.stories.js +51 -0
- package/src/components/show-date/index.style.js +1 -0
- package/src/components/show-date/index.test.js +24 -0
- package/src/components/spacing/core.js +106 -0
- package/src/components/spacing/index.js +10 -0
- package/src/components/spacing/margin/index.js +26 -0
- package/src/components/spacing/padding/index.js +26 -0
- package/src/components/storybook.css +54 -0
- package/src/components/table/actionCell.js +57 -0
- package/src/components/table/index.js +56 -0
- package/src/components/table/index.stories.js +188 -0
- package/src/components/table/index.style.js +107 -0
- package/src/components/table/index.test.js +119 -0
- package/src/components/table/tableHeaderRow.js +28 -0
- package/src/components/table/tableRow.js +60 -0
- package/src/components/table/theme.js +8 -0
- package/src/components/tabs/index.js +10 -0
- package/src/components/tabs/index.stories.js +61 -0
- package/src/components/tabs/index.style.js +35 -0
- package/src/components/tabs/index.test.js +30 -0
- package/src/components/tabs/tabPanel.js +17 -0
- package/src/components/tabs/tabs.js +71 -0
- package/src/components/tabs/theme.js +10 -0
- package/src/components/themes.js +97 -0
- package/src/components/titled-avatar/index.js +48 -0
- package/src/components/titled-avatar/index.stories.js +52 -0
- package/src/components/titled-avatar/index.style.js +30 -0
- package/src/components/titled-avatar/index.test.js +25 -0
- package/src/components/typography/heading/index.js +59 -0
- package/src/components/typography/heading/index.stories.js +94 -0
- package/src/components/typography/heading/index.styles.js +69 -0
- package/src/components/typography/heading/index.test.js +122 -0
- package/src/components/typography/index.js +16 -0
- package/src/components/typography/index.styles.js +1 -0
- package/src/components/typography/link/index.js +82 -0
- package/src/components/typography/link/index.stories.js +70 -0
- package/src/components/typography/link/index.styles.js +8 -0
- package/src/components/typography/link/index.test.js +60 -0
- package/src/components/typography/paragraph/index.js +37 -0
- package/src/components/typography/paragraph/index.stories.js +56 -0
- package/src/components/typography/paragraph/index.styles.js +12 -0
- package/src/components/typography/paragraph/index.test.js +47 -0
- package/src/components/typography/text/index.js +156 -0
- package/src/components/typography/text/index.stories.js +196 -0
- package/src/components/typography/text/index.styles.js +73 -0
- package/src/components/typography/text/index.test.js +333 -0
- package/src/components/typography/theme.js +66 -0
- package/src/components/typography/utils.js +53 -0
- package/src/components/typography/utils.test.js +188 -0
- package/src/components/utils/date.js +7 -0
- package/src/components/utils/date.test.js +15 -0
- package/src/components/utils/detectMobile.js +15 -0
- package/src/components/utils/index.js +7 -0
- package/src/components/utils/media-query.js +12 -0
- package/src/components/utils/numbers.js +25 -0
- package/src/components/utils/test.js +6 -0
- package/src/components/utils/theme.js +67 -0
- package/src/docs/App.css +33 -0
- package/src/docs/App.js +52 -0
- package/src/docs/assets/ads-label.svg +13 -0
- package/src/docs/assets/avatar-sample.jpeg +0 -0
- package/src/docs/assets/cover-sample.png +0 -0
- package/src/docs/assets/fonts/filesImgs.woff +0 -0
- package/src/docs/assets/fonts/icomoon.woff +0 -0
- package/src/docs/assets/fonts/iransharp_bold_web.woff +0 -0
- package/src/docs/assets/fonts/iransharp_bold_web.woff2 +0 -0
- package/src/docs/assets/fonts/iransharp_regular_web.woff +0 -0
- package/src/docs/assets/fonts/iransharp_regular_web.woff2 +0 -0
- package/src/docs/assets/fonts/wer6t7890- +0 -0
- package/src/docs/assets/logo.svg +7 -0
- package/src/docs/components/header/index.js +10 -0
- package/src/docs/components/header/index.styles.js +10 -0
- package/src/docs/components/side-navigation/index.js +167 -0
- package/src/docs/components/side-navigation/index.styles.js +46 -0
- package/src/docs/containers/avatar/index.js +92 -0
- package/src/docs/containers/button/index.js +295 -0
- package/src/docs/containers/card/index.js +153 -0
- package/src/docs/containers/cover/index.js +77 -0
- package/src/docs/containers/form/index.js +41 -0
- package/src/docs/containers/home/index.js +41 -0
- package/src/docs/containers/icon/index.js +56 -0
- package/src/docs/containers/icons/index.js +1488 -0
- package/src/docs/containers/product/index.js +123 -0
- package/src/docs/containers/typography/index.js +138 -0
- package/src/docs/globalStyle.js +58 -0
- package/src/index.css +3 -0
- package/src/index.js +18 -0
- package/src/playground/index.js +144 -0
- package/src/playground.css +26 -0
- package/src/serviceWorker.js +135 -0
- package/src/setupTests.js +24 -0
- package/src/stories/Page.jsx +67 -0
- package/src/storybook.css +58 -0
- package/src/styles.css +3 -0
- package/src/test-utils.js +21 -0
- package/storybook.log +113 -0
- package/tailwind.config.js +26 -0
- package/update-stories.js +41 -0
- package/accordion/index.js +0 -25
- package/accordion/index.styles.js +0 -10
- package/accordion/panel.js +0 -41
- package/avatar/index.js +0 -41
- package/avatar/index.styles.js +0 -17
- package/avatar/theme.js +0 -13
- package/button/index.js +0 -116
- package/button/index.styles.js +0 -101
- package/button/theme.js +0 -34
- package/button/utils.js +0 -12
- package/card/card-template/index.js +0 -74
- package/card/card-template/index.stories.js +0 -70
- package/card/card-template/index.style.js +0 -25
- package/card/card-template/index.test.js +0 -85
- package/card/event-card/constants.js +0 -3
- package/card/event-card/event-card-label/index.js +0 -24
- package/card/event-card/event-card-label/index.style.js +0 -10
- package/card/event-card/event-card-label/index.test.js +0 -23
- package/card/event-card/index.js +0 -227
- package/card/event-card/index.stories.js +0 -155
- package/card/event-card/index.style.js +0 -119
- package/card/event-card/index.test.js +0 -79
- package/card/index.js +0 -16
- package/card/organization-card/index.js +0 -59
- package/card/organization-card/index.stories.js +0 -19
- package/card/organization-card/index.style.js +0 -10
- package/card/organization-card/index.test.js +0 -25
- package/card/orgnizer-card/buttons.js +0 -48
- package/card/orgnizer-card/index.js +0 -179
- package/card/orgnizer-card/index.stories.js +0 -25
- package/card/orgnizer-card/index.style.js +0 -47
- package/cover/index.js +0 -74
- package/cover/index.style.js +0 -41
- package/display/index.js +0 -42
- package/display/index.style.js +0 -78
- package/file-item/fileImgIcon.js +0 -37
- package/file-item/fileImgsFont.js +0 -800
- package/file-item/index.js +0 -101
- package/file-item/index.style.js +0 -30
- package/file-item/theme.js +0 -12
- package/file-item/utils.js +0 -3
- package/form/captcha/index.js +0 -86
- package/form/captcha/index.stories.js +0 -23
- package/form/captcha/index.style.js +0 -36
- package/form/captcha/index.test.js +0 -31
- package/form/checkbox/checkbox-option.js +0 -41
- package/form/checkbox/checkbox.js +0 -54
- package/form/checkbox/index.js +0 -10
- package/form/checkbox/index.stories.js +0 -56
- package/form/checkbox/index.style.js +0 -40
- package/form/dropdown/index.js +0 -10
- package/form/dropdown/index.stories.js +0 -62
- package/form/dropdown/index.style.js +0 -55
- package/form/dropdown/index.test.js +0 -20
- package/form/dropdown/option.js +0 -22
- package/form/dropdown/select.js +0 -68
- package/form/errorMsg.js +0 -21
- package/form/index.js +0 -22
- package/form/radio/index.js +0 -10
- package/form/radio/index.stories.js +0 -56
- package/form/radio/index.style.js +0 -52
- package/form/radio/radio-option.js +0 -45
- package/form/radio/radio.js +0 -56
- package/form/text-input/index.js +0 -92
- package/form/text-input/index.stories.js +0 -26
- package/form/text-input/index.style.js +0 -55
- package/form/text-input/index.test.js +0 -63
- package/form/textarea/index.js +0 -59
- package/form/textarea/index.stories.js +0 -31
- package/form/textarea/index.style.js +0 -25
- package/form/theme.js +0 -16
- package/form-v7/captcha/index.js +0 -101
- package/form-v7/captcha/index.stories.js +0 -30
- package/form-v7/captcha/index.style.js +0 -36
- package/form-v7/captcha/index.test.js +0 -31
- package/form-v7/checkbox/checkbox-option.js +0 -42
- package/form-v7/checkbox/checkbox.js +0 -68
- package/form-v7/checkbox/index.js +0 -10
- package/form-v7/checkbox/index.stories.js +0 -80
- package/form-v7/checkbox/index.style.js +0 -40
- package/form-v7/dropdown/index.js +0 -10
- package/form-v7/dropdown/index.stories.js +0 -121
- package/form-v7/dropdown/index.style.js +0 -55
- package/form-v7/dropdown/index.test.js +0 -20
- package/form-v7/dropdown/option.js +0 -18
- package/form-v7/dropdown/select.js +0 -84
- package/form-v7/errorMsg.js +0 -21
- package/form-v7/file-input/index.js +0 -73
- package/form-v7/file-input/index.stories.js +0 -32
- package/form-v7/file-input/index.style.js +0 -54
- package/form-v7/file-input/index.test.js +0 -63
- package/form-v7/form/index.stories.js +0 -173
- package/form-v7/index.js +0 -25
- package/form-v7/index.style.js +0 -3
- package/form-v7/label/index.js +0 -31
- package/form-v7/label/index.style.js +0 -12
- package/form-v7/radio/index.js +0 -10
- package/form-v7/radio/index.stories.js +0 -82
- package/form-v7/radio/index.style.js +0 -52
- package/form-v7/radio/radio-option.js +0 -43
- package/form-v7/radio/radio.js +0 -73
- package/form-v7/text-input/index.js +0 -131
- package/form-v7/text-input/index.stories.js +0 -77
- package/form-v7/text-input/index.style.js +0 -41
- package/form-v7/text-input/index.test.js +0 -63
- package/form-v7/textarea/index.js +0 -70
- package/form-v7/textarea/index.stories.js +0 -45
- package/form-v7/textarea/index.style.js +0 -25
- package/form-v7/theme.js +0 -20
- package/globalStyle.js +0 -28
- package/icon/iconFont.js +0 -796
- package/icon/index.js +0 -52
- package/icon/index.styles.js +0 -12
- package/icon/theme.js +0 -23
- package/icons/index.js +0 -29
- package/icons/index.style.js +0 -30
- package/icons/theme.js +0 -12
- package/icons/utils.js +0 -672
- package/index.js +0 -75
- package/modal/index.js +0 -100
- package/modal/index.style.js +0 -40
- package/modal/theme.js +0 -11
- package/numeric-summery-report/index.js +0 -28
- package/numeric-summery-report/index.style.js +0 -11
- package/product-menu/index.js +0 -10
- package/product-menu/index.style.js +0 -37
- package/product-menu/menu-item.js +0 -23
- package/product-menu/menu.js +0 -88
- package/product-menu/theme.js +0 -12
- package/product-owner/index.js +0 -85
- package/product-owner/index.style.js +0 -10
- package/product-properties/index.js +0 -65
- package/product-properties/index.style.js +0 -11
- package/product-properties/product-property/index.js +0 -49
- package/product-properties/product-property/index.style.js +0 -9
- package/progress-bar/index.js +0 -46
- package/progress-bar/index.styles.js +0 -63
- package/responsive/index.js +0 -44
- package/show-date/index.js +0 -25
- package/spacing/core.js +0 -70
- package/spacing/index.js +0 -10
- package/spacing/margin/index.js +0 -26
- package/spacing/padding/index.js +0 -26
- package/table/actionCell.js +0 -57
- package/table/index.js +0 -56
- package/table/index.style.js +0 -106
- package/table/tableHeaderRow.js +0 -28
- package/table/tableRow.js +0 -60
- package/table/theme.js +0 -8
- package/tabs/index.js +0 -10
- package/tabs/index.style.js +0 -32
- package/tabs/tabPanel.js +0 -17
- package/tabs/tabs.js +0 -71
- package/tabs/theme.js +0 -10
- package/themes.js +0 -97
- package/titled-avatar/index.js +0 -48
- package/titled-avatar/index.style.js +0 -25
- package/typography/heading/index.js +0 -59
- package/typography/heading/index.stories.js +0 -41
- package/typography/heading/index.styles.js +0 -67
- package/typography/heading/index.test.js +0 -122
- package/typography/index.js +0 -16
- package/typography/link/index.js +0 -82
- package/typography/link/index.stories.js +0 -12
- package/typography/link/index.styles.js +0 -8
- package/typography/link/index.test.js +0 -60
- package/typography/paragraph/index.js +0 -37
- package/typography/paragraph/index.stories.js +0 -27
- package/typography/paragraph/index.styles.js +0 -12
- package/typography/paragraph/index.test.js +0 -47
- package/typography/text/index.js +0 -156
- package/typography/text/index.stories.js +0 -26
- package/typography/text/index.styles.js +0 -72
- package/typography/text/index.test.js +0 -333
- package/typography/theme.js +0 -66
- package/typography/utils.js +0 -53
- package/utils/date.js +0 -7
- package/utils/detectMobile.js +0 -15
- package/utils/index.js +0 -7
- package/utils/media-query.js +0 -12
- package/utils/numbers.js +0 -25
- package/utils/test.js +0 -6
- package/utils/theme.js +0 -67
- /package/{show-date → dist/components/show-date}/index.style.js +0 -0
- /package/{typography → dist/components/typography}/index.styles.js +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow, mount } from 'enzyme';
|
|
3
|
+
import 'jest-styled-components';
|
|
4
|
+
|
|
5
|
+
import CardTemplate from './index';
|
|
6
|
+
import { Text } from '../../typography';
|
|
7
|
+
import findByTestAtrr from '../../utils/test';
|
|
8
|
+
import theme from '../../themes';
|
|
9
|
+
|
|
10
|
+
const setupShallow = (props = {}) => (
|
|
11
|
+
shallow(
|
|
12
|
+
<CardTemplate
|
|
13
|
+
level={props.level}
|
|
14
|
+
hoverToLevel={props.hoverToLevel}
|
|
15
|
+
maxWidth={props.maxWidth}
|
|
16
|
+
linkTo={props.linkTo}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{props.children}
|
|
20
|
+
</CardTemplate>,
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const setupMount = (props = {}) => (
|
|
25
|
+
mount(
|
|
26
|
+
<CardTemplate
|
|
27
|
+
level={props.level}
|
|
28
|
+
hoverToLevel={props.hoverToLevel}
|
|
29
|
+
maxWidth={props.maxWidth}
|
|
30
|
+
linkTo={props.linkTo}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{props.children}
|
|
34
|
+
</CardTemplate>,
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
describe('Card Template', () => {
|
|
39
|
+
it('should render correctly', () => {
|
|
40
|
+
const component = setupShallow({
|
|
41
|
+
level: 2,
|
|
42
|
+
hoverToLevel: 3,
|
|
43
|
+
children: <Text>یک متن تستی</Text>,
|
|
44
|
+
});
|
|
45
|
+
const CardTemplate = findByTestAtrr(component, 'card-template');
|
|
46
|
+
expect(CardTemplate.length).toBe(1);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should render correctly with link wrapper', () => {
|
|
50
|
+
const component = setupShallow({
|
|
51
|
+
level: 2,
|
|
52
|
+
hoverToLevel: 3,
|
|
53
|
+
linkTo: '/link-address',
|
|
54
|
+
children: <Text>یک متن تستی</Text>,
|
|
55
|
+
});
|
|
56
|
+
const CardTemplate = findByTestAtrr(component, 'card-template-link-wrapper');
|
|
57
|
+
expect(CardTemplate.length).toBe(1);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should has correct style', () => {
|
|
61
|
+
const props = {
|
|
62
|
+
level: 1,
|
|
63
|
+
hoverToLevel: 3,
|
|
64
|
+
children: 'یک متن تستی',
|
|
65
|
+
maxWidth: 300,
|
|
66
|
+
};
|
|
67
|
+
const CardTemplate = setupMount(props);
|
|
68
|
+
expect(CardTemplate).toHaveStyleRule(
|
|
69
|
+
'box-shadow',
|
|
70
|
+
`0 0 ${theme.shadows[1].blur}px ${theme.shadows[1].spread}px rgba(0,0,0,${theme.shadows[1].opacity})`,
|
|
71
|
+
);
|
|
72
|
+
expect(CardTemplate).toHaveStyleRule(
|
|
73
|
+
'box-shadow',
|
|
74
|
+
`0 0 ${theme.shadows[3].blur}px ${theme.shadows[3].spread}px rgba(0,0,0,${theme.shadows[3].opacity})`,
|
|
75
|
+
{
|
|
76
|
+
modifier: ':hover',
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
expect(CardTemplate).toHaveStyleRule(
|
|
80
|
+
'border-radius',
|
|
81
|
+
`${theme.borderRadius.low}px`,
|
|
82
|
+
);
|
|
83
|
+
expect(CardTemplate).toHaveStyleRule('max-width', `${props.maxWidth}px`);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import ImageLabel from './index.style';
|
|
4
|
+
|
|
5
|
+
const adsLabelUrl = 'https://static.evand.net/assets/images/other/ads-label.svg';
|
|
6
|
+
// const adsLabelUrl = require('../../../../docs/assets/ads-label.svg');
|
|
7
|
+
|
|
8
|
+
const finishedLabelUrl = 'https://static.evand.net/assets/images/other/finished-text-label.svg';
|
|
9
|
+
|
|
10
|
+
const EventCardLabel = ({ type }) => {
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 'ads':
|
|
13
|
+
return <ImageLabel src={adsLabelUrl} data-test="ads-label" />;
|
|
14
|
+
case 'finished':
|
|
15
|
+
default:
|
|
16
|
+
return <ImageLabel src={finishedLabelUrl} data-test="finished-label" />;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
EventCardLabel.propTypes = {
|
|
21
|
+
type: PropTypes.oneOf(['ads', 'finished']).isRequired,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default EventCardLabel;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import EventCardLabel from './index';
|
|
5
|
+
import findByTestAtrr from '../../../utils/test';
|
|
6
|
+
|
|
7
|
+
const setupShallow = ({ type }) => (
|
|
8
|
+
shallow(<EventCardLabel type={type} />)
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
describe('EventCardLabel component', () => {
|
|
12
|
+
it('Should render ads label', () => {
|
|
13
|
+
const component = setupShallow({ type: 'ads' });
|
|
14
|
+
const AdsLabel = findByTestAtrr(component, 'ads-label');
|
|
15
|
+
expect(AdsLabel.length).toBe(1);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('Should render finished label', () => {
|
|
19
|
+
const component = setupShallow({ type: 'finished' });
|
|
20
|
+
const AdsLabel = findByTestAtrr(component, 'finished-label');
|
|
21
|
+
expect(AdsLabel.length).toBe(1);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes, { oneOfType } from 'prop-types';
|
|
3
|
+
import GlobalStyle from '../../globalStyle';
|
|
4
|
+
import { VERTICAL_CARD, HORIZONTAL_CARD, HORIZONTAL_MOBILE_CARD } from './constants';
|
|
5
|
+
import ShowDate from '../../show-date';
|
|
6
|
+
import { Text } from '../../typography';
|
|
7
|
+
import TitledAvatar from '../../titled-avatar';
|
|
8
|
+
import EventCardLabel from './event-card-label';
|
|
9
|
+
import {
|
|
10
|
+
VerticalCardContainer,
|
|
11
|
+
VerticalCover,
|
|
12
|
+
VerticalContentContainer,
|
|
13
|
+
DateLabelContainer,
|
|
14
|
+
DateBookmarkContainer,
|
|
15
|
+
BookmarkIcon,
|
|
16
|
+
VerticalPlacePrice,
|
|
17
|
+
VerticalTitle,
|
|
18
|
+
HorizontalCardContainer,
|
|
19
|
+
HorizontalCover,
|
|
20
|
+
HorizontalMobileCover,
|
|
21
|
+
HorizontalContentContainer,
|
|
22
|
+
HorizontalTitle,
|
|
23
|
+
HorizontalPlacePrice,
|
|
24
|
+
PartnershipBox,
|
|
25
|
+
} from './index.style';
|
|
26
|
+
import Icon from '../../icon';
|
|
27
|
+
|
|
28
|
+
const finishedClockLabelUrl = 'https://static.evand.net/assets/images/other/finished-clock-label.svg';
|
|
29
|
+
const defaultCoverUrl = 'https://static.evand.net/assets/images/defaults/event-cover.jpg';
|
|
30
|
+
const EventCard = ({
|
|
31
|
+
title,
|
|
32
|
+
price,
|
|
33
|
+
place,
|
|
34
|
+
renderEventLink,
|
|
35
|
+
clickBookmark,
|
|
36
|
+
bookmarked = false,
|
|
37
|
+
cover = '',
|
|
38
|
+
type = VERTICAL_CARD,
|
|
39
|
+
ads = false,
|
|
40
|
+
finished = false,
|
|
41
|
+
organization = undefined,
|
|
42
|
+
renderOrganizationLink = () => false,
|
|
43
|
+
date = '',
|
|
44
|
+
showDate = '',
|
|
45
|
+
partnership = {
|
|
46
|
+
status: '',
|
|
47
|
+
},
|
|
48
|
+
coverImage = null,
|
|
49
|
+
...rest
|
|
50
|
+
}) => {
|
|
51
|
+
// date param used on main evand and because it wrong to use moment-jalali in react jupiter
|
|
52
|
+
// we ommmit it in evand-next and use showDate param instead but its still used in evand
|
|
53
|
+
// TODO: remove date params if no longer needed (in evand project)
|
|
54
|
+
// TODO: remove ShowDate component and remove used places
|
|
55
|
+
// TODO: remove moment-jalali from this package after removing ShowDate
|
|
56
|
+
|
|
57
|
+
// in new form of event-card we dont show organazation info as a titled-avatar
|
|
58
|
+
// TODO: if the new form was accepted and remove old one from evand clean these parts
|
|
59
|
+
const productPropertiesList = [
|
|
60
|
+
{ iconName: 'place', text: place },
|
|
61
|
+
{ iconName: 'ticket', text: price },
|
|
62
|
+
];
|
|
63
|
+
if (organization && organization.logo === 'unset') {
|
|
64
|
+
productPropertiesList.push({ iconName: 'supervisor-account', text: organization.name });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const renderVerticalCard = () => (
|
|
68
|
+
<VerticalCardContainer
|
|
69
|
+
direction={type}
|
|
70
|
+
hoverToLevel={3}
|
|
71
|
+
maxWidth={270}
|
|
72
|
+
{...rest}
|
|
73
|
+
>
|
|
74
|
+
{renderEventLink(coverImage || <VerticalCover data-test="vertical-cover" src={cover || defaultCoverUrl} loading="lazy" onError={(e) => { e.target.onerror = null; e.target.src = defaultCoverUrl; }} />) }
|
|
75
|
+
<VerticalContentContainer
|
|
76
|
+
data-test="vertical-content"
|
|
77
|
+
background={finished ? finishedClockLabelUrl : null}
|
|
78
|
+
>
|
|
79
|
+
<div>
|
|
80
|
+
<DateBookmarkContainer data-test="vertical-date-bookmark">
|
|
81
|
+
<DateLabelContainer>
|
|
82
|
+
{finished && <EventCardLabel type="finished" />}
|
|
83
|
+
{!finished && ads && <EventCardLabel type="ads" />}
|
|
84
|
+
{!!partnership?.status && (
|
|
85
|
+
<PartnershipBox>
|
|
86
|
+
<Icon name={partnership?.status} color="yellow" stickyLeft marginRight={3} />
|
|
87
|
+
{' '}
|
|
88
|
+
{partnership?.status === 'colleague' ? 'همکار' : 'همیار'}
|
|
89
|
+
</PartnershipBox>
|
|
90
|
+
)}
|
|
91
|
+
{date && <ShowDate date={date} color="gray" fontSize="12" />}
|
|
92
|
+
{showDate && (
|
|
93
|
+
<Text size="12" color="gray" data-test="show-date">{showDate}</Text>
|
|
94
|
+
)}
|
|
95
|
+
</DateLabelContainer>
|
|
96
|
+
<BookmarkIcon
|
|
97
|
+
name={bookmarked ? 'bookmark' : 'bookmark-border'}
|
|
98
|
+
size="lg"
|
|
99
|
+
color="gray"
|
|
100
|
+
onClick={clickBookmark}
|
|
101
|
+
/>
|
|
102
|
+
</DateBookmarkContainer>
|
|
103
|
+
{ renderEventLink(<VerticalTitle level={2} size="sm">{title}</VerticalTitle>)}
|
|
104
|
+
<VerticalPlacePrice list={productPropertiesList} />
|
|
105
|
+
</div>
|
|
106
|
+
{(organization && organization.logo !== 'unset') && (
|
|
107
|
+
<TitledAvatar title={organization.name} titleSize={12} avatar={organization.logo} avatarSize="xs" renderAvatarLink={renderOrganizationLink} />
|
|
108
|
+
)}
|
|
109
|
+
</VerticalContentContainer>
|
|
110
|
+
</VerticalCardContainer>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const renderHorizontalCard = () => (
|
|
114
|
+
<HorizontalCardContainer
|
|
115
|
+
direction={type}
|
|
116
|
+
hoverToLevel={3}
|
|
117
|
+
maxWidth={560}
|
|
118
|
+
{...rest}
|
|
119
|
+
>
|
|
120
|
+
{renderEventLink(<HorizontalCover data-test="horizontal-cover" src={cover || defaultCoverUrl} loading="lazy" />) }
|
|
121
|
+
<HorizontalContentContainer data-test="horizontal-content">
|
|
122
|
+
<DateBookmarkContainer>
|
|
123
|
+
<DateLabelContainer>
|
|
124
|
+
{finished && <EventCardLabel type="finished" />}
|
|
125
|
+
{!finished && ads && <EventCardLabel type="ads" />}
|
|
126
|
+
{date && <ShowDate date={date} color="gray" fontSize="12" />}
|
|
127
|
+
{showDate && (
|
|
128
|
+
<Text size="12" color="gray" data-test="show-date">{showDate}</Text>
|
|
129
|
+
)}
|
|
130
|
+
</DateLabelContainer>
|
|
131
|
+
<BookmarkIcon
|
|
132
|
+
name={bookmarked ? 'bookmark' : 'bookmark-border'}
|
|
133
|
+
size="lg"
|
|
134
|
+
color="gray"
|
|
135
|
+
onClick={clickBookmark}
|
|
136
|
+
data-test={bookmarked ? 'bookmark' : 'bookmark-border'}
|
|
137
|
+
/>
|
|
138
|
+
</DateBookmarkContainer>
|
|
139
|
+
{ renderEventLink(<HorizontalTitle level={2} size="sm">{title}</HorizontalTitle>) }
|
|
140
|
+
<HorizontalPlacePrice list={productPropertiesList} isHorizontal />
|
|
141
|
+
</HorizontalContentContainer>
|
|
142
|
+
</HorizontalCardContainer>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
const renderHorizontalMobileCard = () => (
|
|
146
|
+
<HorizontalCardContainer
|
|
147
|
+
direction={type}
|
|
148
|
+
hoverToLevel={3}
|
|
149
|
+
maxWidth={560}
|
|
150
|
+
{...rest}
|
|
151
|
+
>
|
|
152
|
+
{renderEventLink(<HorizontalMobileCover data-test="horizontal-mobile-cover" src={cover || defaultCoverUrl} loading="lazy" />) }
|
|
153
|
+
<HorizontalContentContainer data-test="horizontal-content">
|
|
154
|
+
<DateBookmarkContainer>
|
|
155
|
+
<DateLabelContainer>
|
|
156
|
+
{finished && <EventCardLabel type="finished" />}
|
|
157
|
+
{!finished && ads && <EventCardLabel type="ads" />}
|
|
158
|
+
{date && <ShowDate date={date} color="gray" fontSize="10" />}
|
|
159
|
+
{showDate && (
|
|
160
|
+
<Text size="10" color="gray" data-test="show-date">{showDate}</Text>
|
|
161
|
+
)}
|
|
162
|
+
</DateLabelContainer>
|
|
163
|
+
<BookmarkIcon
|
|
164
|
+
name={bookmarked ? 'bookmark' : 'bookmark-border'}
|
|
165
|
+
size="sm"
|
|
166
|
+
color="gray"
|
|
167
|
+
onClick={clickBookmark}
|
|
168
|
+
data-test={bookmarked ? 'bookmark' : 'bookmark-border'}
|
|
169
|
+
/>
|
|
170
|
+
</DateBookmarkContainer>
|
|
171
|
+
{ renderEventLink(<HorizontalTitle level={4} size="sm">{title}</HorizontalTitle>) }
|
|
172
|
+
<HorizontalPlacePrice list={productPropertiesList} isHorizontal />
|
|
173
|
+
</HorizontalContentContainer>
|
|
174
|
+
</HorizontalCardContainer>
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const renderCard = () => {
|
|
178
|
+
switch (type) {
|
|
179
|
+
case HORIZONTAL_CARD:
|
|
180
|
+
return renderHorizontalCard();
|
|
181
|
+
case HORIZONTAL_MOBILE_CARD:
|
|
182
|
+
return renderHorizontalMobileCard();
|
|
183
|
+
case VERTICAL_CARD:
|
|
184
|
+
default:
|
|
185
|
+
return renderVerticalCard();
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<>
|
|
191
|
+
<GlobalStyle />
|
|
192
|
+
{renderCard()}
|
|
193
|
+
</>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
EventCard.propTypes = {
|
|
198
|
+
title: PropTypes.string.isRequired,
|
|
199
|
+
bookmarked: PropTypes.bool,
|
|
200
|
+
type: PropTypes.string,
|
|
201
|
+
price: PropTypes.string.isRequired,
|
|
202
|
+
place: PropTypes.string.isRequired,
|
|
203
|
+
date: PropTypes.oneOfType([
|
|
204
|
+
PropTypes.string,
|
|
205
|
+
PropTypes.object,
|
|
206
|
+
]),
|
|
207
|
+
showDate: PropTypes.string,
|
|
208
|
+
cover: PropTypes.string,
|
|
209
|
+
ads: PropTypes.bool,
|
|
210
|
+
finished: PropTypes.bool,
|
|
211
|
+
organization: oneOfType([
|
|
212
|
+
PropTypes.shape({
|
|
213
|
+
name: PropTypes.string.isRequired,
|
|
214
|
+
logo: PropTypes.string,
|
|
215
|
+
}),
|
|
216
|
+
PropTypes.undefined,
|
|
217
|
+
]),
|
|
218
|
+
renderEventLink: PropTypes.func.isRequired,
|
|
219
|
+
renderOrganizationLink: PropTypes.func,
|
|
220
|
+
clickBookmark: PropTypes.func.isRequired,
|
|
221
|
+
partnership: PropTypes.shape({
|
|
222
|
+
status: PropTypes.string,
|
|
223
|
+
}),
|
|
224
|
+
coverImage: PropTypes.node || null,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export default EventCard;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import EventCard from './index';
|
|
3
|
+
// import '../storybook.css';
|
|
4
|
+
import { VerticalCover } from './index.style';
|
|
5
|
+
|
|
6
|
+
const defaultArgs = {
|
|
7
|
+
title: "تایتل یک رویداد نسبتا طولانی در اینجاست که باید و باید و قرار است اضافه بیاید و بزند به بیرون",
|
|
8
|
+
cover: "https://static.evand.net/assets/images/defaults/event-cover.jpg",
|
|
9
|
+
date: "2020-01-10T14:00:00+0330",
|
|
10
|
+
place: "تهران",
|
|
11
|
+
price: "از ۴۴۰۰۰ تومان",
|
|
12
|
+
clickBookmark: () => true,
|
|
13
|
+
queryString: "icn=trendEvents&ici=fp5",
|
|
14
|
+
renderEventLink: (element) => <a href="/tosomewhere">{element}</a>,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const organizationArgs = {
|
|
18
|
+
organization: {
|
|
19
|
+
name: 'هلدینگ کلان - مجتمع فنی پلی تکنیک - شرکت تجارت جهانی اندیشه',
|
|
20
|
+
logo: 'https://static.evand.net/images/organizations/logos/original/e90483ade453446ae2fd156e15244d04.jpg',
|
|
21
|
+
},
|
|
22
|
+
renderOrganizationLink: (element) => <a href="/toorganization">{element}</a>,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
title: 'Components/Card/EventCard',
|
|
27
|
+
component: EventCard,
|
|
28
|
+
argTypes: {
|
|
29
|
+
type: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['horizontal-mobile', 'horizontal', 'vertical'],
|
|
32
|
+
description: 'The type of the event card',
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'The title of the event',
|
|
37
|
+
},
|
|
38
|
+
cover: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'The cover image URL',
|
|
41
|
+
},
|
|
42
|
+
date: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'The event date',
|
|
45
|
+
},
|
|
46
|
+
place: {
|
|
47
|
+
control: 'text',
|
|
48
|
+
description: 'The event location',
|
|
49
|
+
},
|
|
50
|
+
price: {
|
|
51
|
+
control: 'text',
|
|
52
|
+
description: 'The event price',
|
|
53
|
+
},
|
|
54
|
+
ads: {
|
|
55
|
+
control: 'boolean',
|
|
56
|
+
description: 'Whether the card is an advertisement',
|
|
57
|
+
},
|
|
58
|
+
finished: {
|
|
59
|
+
control: 'boolean',
|
|
60
|
+
description: 'Whether the event is finished',
|
|
61
|
+
},
|
|
62
|
+
partnership: {
|
|
63
|
+
control: 'object',
|
|
64
|
+
description: 'Partnership information',
|
|
65
|
+
},
|
|
66
|
+
organization: {
|
|
67
|
+
control: 'object',
|
|
68
|
+
description: 'Organization information',
|
|
69
|
+
},
|
|
70
|
+
clickBookmark: {
|
|
71
|
+
control: 'function',
|
|
72
|
+
description: 'Function to handle bookmark click',
|
|
73
|
+
},
|
|
74
|
+
renderEventLink: {
|
|
75
|
+
control: 'function',
|
|
76
|
+
description: 'Function to render event link',
|
|
77
|
+
},
|
|
78
|
+
renderOrganizationLink: {
|
|
79
|
+
control: 'function',
|
|
80
|
+
description: 'Function to render organization link',
|
|
81
|
+
},
|
|
82
|
+
coverImage: {
|
|
83
|
+
control: 'element',
|
|
84
|
+
description: 'Custom cover image element',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const Template = (args) => <EventCard {...args} />;
|
|
90
|
+
|
|
91
|
+
export const HorizontalMobile = Template.bind({});
|
|
92
|
+
HorizontalMobile.args = {
|
|
93
|
+
...defaultArgs,
|
|
94
|
+
type: 'horizontal-mobile',
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const Horizontal = Template.bind({});
|
|
98
|
+
Horizontal.args = {
|
|
99
|
+
...defaultArgs,
|
|
100
|
+
type: 'horizontal',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const HorizontalWithAds = Template.bind({});
|
|
104
|
+
HorizontalWithAds.args = {
|
|
105
|
+
...defaultArgs,
|
|
106
|
+
type: 'horizontal',
|
|
107
|
+
ads: true,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const HorizontalWithFinished = Template.bind({});
|
|
111
|
+
HorizontalWithFinished.args = {
|
|
112
|
+
...defaultArgs,
|
|
113
|
+
type: 'horizontal',
|
|
114
|
+
finished: true,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const Vertical = Template.bind({});
|
|
118
|
+
Vertical.args = {
|
|
119
|
+
...defaultArgs,
|
|
120
|
+
...organizationArgs,
|
|
121
|
+
type: 'vertical',
|
|
122
|
+
title: 'تایتل یک رویداد اینجاست کهن',
|
|
123
|
+
renderEventLink: (element) => <a href="/tosomewherenew">{element}</a>,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const VerticalWithCustomCover = Template.bind({});
|
|
127
|
+
VerticalWithCustomCover.args = {
|
|
128
|
+
...defaultArgs,
|
|
129
|
+
...organizationArgs,
|
|
130
|
+
type: 'vertical',
|
|
131
|
+
title: 'تایتل یک رویداد اینجاست کهن',
|
|
132
|
+
renderEventLink: (element) => <a href="/tosomewherenew">{element}</a>,
|
|
133
|
+
coverImage: <VerticalCover src="https://static.evand.net/assets/images/defaults/event-cover.jpg" />,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const VerticalWithFinished = Template.bind({});
|
|
137
|
+
VerticalWithFinished.args = {
|
|
138
|
+
...defaultArgs,
|
|
139
|
+
...organizationArgs,
|
|
140
|
+
type: 'vertical',
|
|
141
|
+
title: 'تایتل یک رویداد اینجاست کهن',
|
|
142
|
+
finished: true,
|
|
143
|
+
renderEventLink: (element) => <a href="/tosomewherenew">{element}</a>,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const VerticalWithAds = Template.bind({});
|
|
147
|
+
VerticalWithAds.args = {
|
|
148
|
+
...defaultArgs,
|
|
149
|
+
...organizationArgs,
|
|
150
|
+
type: 'vertical',
|
|
151
|
+
title: 'تایتل یک رویداد اینجاست کهن',
|
|
152
|
+
ads: true,
|
|
153
|
+
renderEventLink: (element) => <a href="/tosomewherenew">{element}</a>,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const VerticalWithPartnership = Template.bind({});
|
|
157
|
+
VerticalWithPartnership.args = {
|
|
158
|
+
...defaultArgs,
|
|
159
|
+
...organizationArgs,
|
|
160
|
+
type: 'vertical',
|
|
161
|
+
title: 'تایتل یک رویداد اینجاست کهن',
|
|
162
|
+
partnership: {
|
|
163
|
+
status: 'colleague',
|
|
164
|
+
},
|
|
165
|
+
renderEventLink: (element) => <a href="/tosomewherenew">{element}</a>,
|
|
166
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import CardTemplate from '../card-template';
|
|
3
|
+
import { Heading } from '../../typography';
|
|
4
|
+
import ProductProperties from '../../product-properties';
|
|
5
|
+
import Icon from '../../icon';
|
|
6
|
+
import defaultTheme from '../../themes';
|
|
7
|
+
|
|
8
|
+
/* Common event card styles */
|
|
9
|
+
|
|
10
|
+
export const Link = styled.a`
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const DateBookmarkContainer = styled.div`
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const DateLabelContainer = styled.div`
|
|
21
|
+
display: inline-block;
|
|
22
|
+
& > * {
|
|
23
|
+
vertical-align:middle;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const BookmarkIcon = styled(Icon)`
|
|
28
|
+
margin-left: 0;
|
|
29
|
+
&:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
/* Vertical event card styles */
|
|
35
|
+
export const VerticalCardContainer = styled(CardTemplate)`
|
|
36
|
+
background: white;
|
|
37
|
+
a {
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
}
|
|
40
|
+
@media only screen and (min-width: ${defaultTheme.breakpoints.sm}px) {
|
|
41
|
+
min-height: 358px;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const VerticalCover = styled.img`
|
|
46
|
+
width: 100%;
|
|
47
|
+
min-width: 270px;
|
|
48
|
+
height: auto;
|
|
49
|
+
min-height: 150px;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const VerticalContentContainer = styled.div`
|
|
53
|
+
background-image: url(${(props) => props.background});
|
|
54
|
+
background-size: cover;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
padding: 12px 16px 16px;
|
|
59
|
+
min-height: 180px;
|
|
60
|
+
max-height: 200px;
|
|
61
|
+
direction: rtl;
|
|
62
|
+
text-align: right;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export const VerticalTitle = styled(Heading)`
|
|
66
|
+
margin: 0;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
height: 60px;
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const VerticalPlacePrice = styled(ProductProperties)`
|
|
72
|
+
margin: 4px 0;
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
/* Horizontal event card styles */
|
|
76
|
+
|
|
77
|
+
export const HorizontalCardContainer = styled(VerticalCardContainer)`
|
|
78
|
+
height: 116px;
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export const HorizontalCover = styled.img`
|
|
82
|
+
width: 206px;
|
|
83
|
+
min-width: 206px;
|
|
84
|
+
height: auto;
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
export const HorizontalMobileCover = styled.img`
|
|
88
|
+
width: 146px;
|
|
89
|
+
min-width: 146px;
|
|
90
|
+
height: 100%;
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
export const HorizontalContentContainer = styled.div`
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
padding: 16px;
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
flex: 1;
|
|
99
|
+
min-width: 250px;
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
export const HorizontalMobileContentContainer = styled.div`
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
padding: 16px;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
flex: 1;
|
|
108
|
+
min-width: 0px;
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
export const HorizontalTitle = styled(Heading)`
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
text-overflow: ellipsis;
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
export const HorizontalPlacePrice = styled(ProductProperties)``;
|
|
118
|
+
|
|
119
|
+
export const PartnershipBox = styled.div`
|
|
120
|
+
background: #FFC72724;
|
|
121
|
+
border-radius: 5px;
|
|
122
|
+
margin-left: 5px;
|
|
123
|
+
color: #FFD324;
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
min-width: 60px;
|
|
127
|
+
height: 25px;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
`;
|