react-jupiter 5.11.34 → 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 +19 -10
- 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/index.js +0 -10
- package/spacing/margin/index.js +0 -12
- package/spacing/padding/index.js +0 -12
- 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,132 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
5
|
+
var _styledComponents = require("styled-components");
|
|
6
|
+
var _reactHookForm = require("react-hook-form");
|
|
7
|
+
var _globalStyle = _interopRequireDefault(require("../../globalStyle"));
|
|
8
|
+
var _theme = _interopRequireDefault(require("../theme"));
|
|
9
|
+
var _errorMsg = _interopRequireDefault(require("../errorMsg"));
|
|
10
|
+
var _label = _interopRequireDefault(require("../label"));
|
|
11
|
+
var _index = require("./index.style");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _index2 = require("../index.style");
|
|
17
|
+
var _numbers = require("../../utils/numbers");function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}function _extends() {return _extends = Object.assign ? Object.assign.bind() : function (n) {for (var e = 1; e < arguments.length; e++) {var t = arguments[e];for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);}return n;}, _extends.apply(null, arguments);}function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == typeof i ? i : i + "";}function _toPrimitive(t, r) {if ("object" != typeof t || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != typeof i) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TextInput extends _react.Component {
|
|
41
|
+
constructor(props) {
|
|
42
|
+
super(props);_defineProperty(this, "togglePasswordVisibility",
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
() => {
|
|
49
|
+
this.setState((prevState) => ({ showPassword: !prevState.showPassword }));
|
|
50
|
+
});_defineProperty(this, "handleFocus",
|
|
51
|
+
|
|
52
|
+
(e) => {
|
|
53
|
+
e.target.setSelectionRange(0, 0);
|
|
54
|
+
});this.state = { showPassword: false };}
|
|
55
|
+
|
|
56
|
+
render() {
|
|
57
|
+
const {
|
|
58
|
+
type = 'text',
|
|
59
|
+
label = null,
|
|
60
|
+
htmlElementName,
|
|
61
|
+
id = null,
|
|
62
|
+
placeholder = null,
|
|
63
|
+
disabled = false,
|
|
64
|
+
description = null,
|
|
65
|
+
required = false,
|
|
66
|
+
number = null,
|
|
67
|
+
rtl = true,
|
|
68
|
+
onFocus = () => {},
|
|
69
|
+
readOnly = false,
|
|
70
|
+
register,
|
|
71
|
+
control
|
|
72
|
+
} = this.props;
|
|
73
|
+
|
|
74
|
+
const { showPassword } = this.state;
|
|
75
|
+
|
|
76
|
+
return (/*#__PURE__*/
|
|
77
|
+
_react.default.createElement(_styledComponents.ThemeProvider, { theme: _theme.default }, /*#__PURE__*/
|
|
78
|
+
_react.default.createElement(_index2.Fieldset, null, /*#__PURE__*/
|
|
79
|
+
_react.default.createElement(_globalStyle.default, null), /*#__PURE__*/
|
|
80
|
+
_react.default.createElement(_label.default, {
|
|
81
|
+
htmlFor: id || `${type}-${htmlElementName.split(' ').join('')}`,
|
|
82
|
+
label: label,
|
|
83
|
+
number: number,
|
|
84
|
+
required: required }
|
|
85
|
+
),
|
|
86
|
+
description && /*#__PURE__*/
|
|
87
|
+
_react.default.createElement(_index.DescriptionContainer, { size: 10, color: "gray", "data-test": "text-input-description" },
|
|
88
|
+
description
|
|
89
|
+
), /*#__PURE__*/
|
|
90
|
+
|
|
91
|
+
_react.default.createElement(_reactHookForm.Controller, {
|
|
92
|
+
name: htmlElementName,
|
|
93
|
+
control: control,
|
|
94
|
+
rules: { required: required ? 'این فیلد اجباری است' : false },
|
|
95
|
+
render: (_ref) => {let { field: { value }, fieldState } = _ref;return (/*#__PURE__*/
|
|
96
|
+
_react.default.createElement("div", { style: { position: 'relative' } },
|
|
97
|
+
type === 'password' && /*#__PURE__*/
|
|
98
|
+
_react.default.createElement(_index.PasswordIcon, {
|
|
99
|
+
name: showPassword ? 'visibility-off' : 'visibility',
|
|
100
|
+
color: "gray",
|
|
101
|
+
onClick: this.togglePasswordVisibility,
|
|
102
|
+
style: {
|
|
103
|
+
cursor: 'pointer', position: 'absolute', top: '50%', left: '10px', transform: 'translateY(-50%)'
|
|
104
|
+
} }
|
|
105
|
+
), /*#__PURE__*/
|
|
106
|
+
|
|
107
|
+
_react.default.createElement(_index.Input, _extends({
|
|
108
|
+
id: id || `${type}-${htmlElementName.split(' ').join('')}`,
|
|
109
|
+
name: htmlElementName,
|
|
110
|
+
type: showPassword ? 'text' : type,
|
|
111
|
+
placeholder: placeholder,
|
|
112
|
+
defaultValue: value,
|
|
113
|
+
rtl: rtl },
|
|
114
|
+
register(htmlElementName, {
|
|
115
|
+
onFocus: this.handleFocus,
|
|
116
|
+
disabled,
|
|
117
|
+
onChange: (e) => (0, _numbers.fixNumbers)(e)
|
|
118
|
+
}), {
|
|
119
|
+
onFocus: onFocus,
|
|
120
|
+
readOnly: readOnly })
|
|
121
|
+
), /*#__PURE__*/
|
|
122
|
+
_react.default.createElement(_errorMsg.default, { errorMessage: fieldState && fieldState.error?.message })
|
|
123
|
+
));} }
|
|
124
|
+
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
));
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
}var _default = exports.default =
|
|
131
|
+
|
|
132
|
+
TextInput;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.WithError = exports.Password = exports.LTR = exports.FullOptions = exports.Disabled = void 0;var _react = _interopRequireDefault(require("react"));
|
|
2
|
+
var _reactHookForm = require("react-hook-form");
|
|
3
|
+
|
|
4
|
+
var _index = _interopRequireDefault(require("./index"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}function _extends() {return _extends = Object.assign ? Object.assign.bind() : function (n) {for (var e = 1; e < arguments.length; e++) {var t = arguments[e];for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);}return n;}, _extends.apply(null, arguments);}var _default = exports.default =
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
title: 'Form-V7/Text Input',
|
|
8
|
+
component: _index.default,
|
|
9
|
+
|
|
10
|
+
argTypes: {
|
|
11
|
+
htmlElementName: {
|
|
12
|
+
control: 'text',
|
|
13
|
+
defaultValue: 'text-name-02'
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
defaultValue: 'این لیبل است'
|
|
18
|
+
},
|
|
19
|
+
placeholder: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
defaultValue: 'متن پیشفرض'
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
defaultValue: false
|
|
26
|
+
},
|
|
27
|
+
description: {
|
|
28
|
+
control: 'text',
|
|
29
|
+
defaultValue: 'توضیحات اضافه'
|
|
30
|
+
},
|
|
31
|
+
errorMessage: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
defaultValue: 'ارور زیبا'
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
control: 'select',
|
|
37
|
+
options: ['text', 'password'],
|
|
38
|
+
defaultValue: 'text'
|
|
39
|
+
},
|
|
40
|
+
rtl: {
|
|
41
|
+
control: 'boolean',
|
|
42
|
+
defaultValue: true
|
|
43
|
+
},
|
|
44
|
+
required: {
|
|
45
|
+
control: 'boolean',
|
|
46
|
+
defaultValue: true
|
|
47
|
+
},
|
|
48
|
+
number: {
|
|
49
|
+
control: 'number',
|
|
50
|
+
defaultValue: 23
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const Template = (args) => {
|
|
56
|
+
const { register, control } = (0, _reactHookForm.useForm)();
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({}, args, { register: register, control: control }));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const FullOptions = exports.FullOptions = Template.bind({});
|
|
61
|
+
FullOptions.args = {
|
|
62
|
+
htmlElementName: 'text-name-02',
|
|
63
|
+
required: true,
|
|
64
|
+
label: 'این لیبل است',
|
|
65
|
+
number: 23,
|
|
66
|
+
placeholder: 'متن پیشفرض',
|
|
67
|
+
disabled: false,
|
|
68
|
+
description: 'توضیحات اضافه',
|
|
69
|
+
errorMessage: 'ارور زیبا',
|
|
70
|
+
type: 'text',
|
|
71
|
+
rtl: true
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const LTR = exports.LTR = Template.bind({});
|
|
75
|
+
LTR.args = {
|
|
76
|
+
...FullOptions.args,
|
|
77
|
+
rtl: false
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const Password = exports.Password = Template.bind({});
|
|
81
|
+
Password.args = {
|
|
82
|
+
...FullOptions.args,
|
|
83
|
+
type: 'password'
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const Disabled = exports.Disabled = Template.bind({});
|
|
87
|
+
Disabled.args = {
|
|
88
|
+
...FullOptions.args,
|
|
89
|
+
disabled: true
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const WithError = exports.WithError = Template.bind({});
|
|
93
|
+
WithError.args = {
|
|
94
|
+
...FullOptions.args,
|
|
95
|
+
errorMessage: 'لطفا این فیلد را پر کنید'
|
|
96
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.PasswordIcon = exports.Input = exports.DescriptionContainer = void 0;var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
2
|
+
var _typography = require("../../typography");
|
|
3
|
+
var _icon = _interopRequireDefault(require("../../icon"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
4
|
+
|
|
5
|
+
const Input = exports.Input = _styledComponents.default.input`
|
|
6
|
+
font-family: 'IranSharp';
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
border-radius: ${(_ref) => {let { theme } = _ref;return `${theme.borderRadius}px`;}};
|
|
10
|
+
border: solid 1px ${(_ref2) => {let { theme } = _ref2;return theme.borderColor.normal;}};
|
|
11
|
+
padding: 6px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
width: 100%;
|
|
14
|
+
direction: ${(_ref3) => {let { rtl } = _ref3;return rtl ? 'rtl' : 'ltr';}};
|
|
15
|
+
|
|
16
|
+
&[disabled=""]{
|
|
17
|
+
background-color: ${(_ref4) => {let { theme } = _ref4;return theme.disabled.background;}};
|
|
18
|
+
color: ${(_ref5) => {let { theme } = _ref5;return theme.disabled.color;}};
|
|
19
|
+
border-color: transparent;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
border-color: transparent;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
border-color: ${(_ref6) => {let { theme } = _ref6;return theme.borderColor.hover;}};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:focus {
|
|
32
|
+
border-color: ${(_ref7) => {let { theme } = _ref7;return theme.borderColor.focus;}};
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const DescriptionContainer = exports.DescriptionContainer = (0, _styledComponents.default)(_typography.Text)`
|
|
37
|
+
display: block;
|
|
38
|
+
margin-bottom: 4px;
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const PasswordIcon = exports.PasswordIcon = (0, _styledComponents.default)(_icon.default)`
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: 0;
|
|
44
|
+
bottom: 3px;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";var _react = _interopRequireDefault(require("react"));
|
|
2
|
+
var _enzyme = require("enzyme");
|
|
3
|
+
var _test = _interopRequireDefault(require("../../utils/test"));
|
|
4
|
+
var _index = _interopRequireDefault(require("./index"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
5
|
+
|
|
6
|
+
describe('text input tests', () => {
|
|
7
|
+
it('render simple text input', () => {
|
|
8
|
+
const component = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "eng name" }));
|
|
9
|
+
const textInput = (0, _test.default)(component, 'text-input');
|
|
10
|
+
|
|
11
|
+
expect(textInput.length).toBe(1);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('render text input with placeholder', () => {
|
|
15
|
+
const component = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "eng name", placeholder: "hi guys" }));
|
|
16
|
+
const textInput = (0, _test.default)(component, 'text-input');
|
|
17
|
+
|
|
18
|
+
expect(textInput.find('input').prop('placeholder')).toBe('hi guys');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('test text input id without id props', () => {
|
|
22
|
+
const component = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "eng name", placeholder: "hi guys" }));
|
|
23
|
+
const textInput = (0, _test.default)(component, 'text-input');
|
|
24
|
+
|
|
25
|
+
expect(textInput.find('input').prop('id')).toBe('text-engname');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('render text input - full props', () => {
|
|
29
|
+
const component = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "eng name", placeholder: "hi guys", type: "text", id: "hiiii-id" }));
|
|
30
|
+
const textInput = (0, _test.default)(component, 'text-input');
|
|
31
|
+
|
|
32
|
+
expect(textInput.find('input').prop('id')).toBe('hiiii-id');
|
|
33
|
+
expect(textInput.find('input').prop('type')).toBe('text');
|
|
34
|
+
expect(textInput.find('input').prop('placeholder')).toBe('hi guys');
|
|
35
|
+
expect(textInput.find('input').prop('name')).toBe('eng name');
|
|
36
|
+
expect(textInput.length).not.toBe(0);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('render disabled input', () => {
|
|
40
|
+
const component = (0, _enzyme.mount)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "eng name", disabled: true }));
|
|
41
|
+
const textInput = (0, _test.default)(component, 'text-input');
|
|
42
|
+
|
|
43
|
+
expect(textInput.find('input').prop('disabled')).toBe(true);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('render with or without text-input-description', () => {
|
|
47
|
+
const componentWithDesc = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "with desc", description: "hiiiiii" }));
|
|
48
|
+
const componentWithoutDesc = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "without desc" }));
|
|
49
|
+
const textInputDescription01 = (0, _test.default)(componentWithDesc, 'text-input-description');
|
|
50
|
+
const textInputDescription02 = (0, _test.default)(componentWithoutDesc, 'text-input-description');
|
|
51
|
+
|
|
52
|
+
expect(textInputDescription01.length).toBe(1);
|
|
53
|
+
expect(textInputDescription02.length).toBe(0);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('render with or err msg', () => {
|
|
57
|
+
const component = (0, _enzyme.shallow)(/*#__PURE__*/_react.default.createElement(_index.default, { label: "this is label", htmlElementName: "with desc", description: "hiiiiii", errorMessage: "this is a good err" }));
|
|
58
|
+
const textInputErrorMessage = (0, _test.default)(component, 'error-message');
|
|
59
|
+
|
|
60
|
+
expect(textInputErrorMessage.length).toBe(1);
|
|
61
|
+
expect(textInputErrorMessage.children().text()).toBe('this is a good err');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _react = _interopRequireDefault(require("react"));
|
|
2
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
3
|
+
var _reactHookForm = require("react-hook-form");
|
|
4
|
+
var _styledComponents = require("styled-components");
|
|
5
|
+
var _globalStyle = _interopRequireDefault(require("../../globalStyle"));
|
|
6
|
+
var _theme = _interopRequireDefault(require("../theme"));
|
|
7
|
+
var _errorMsg = _interopRequireDefault(require("../errorMsg"));
|
|
8
|
+
var _label = _interopRequireDefault(require("../label"));
|
|
9
|
+
var _index = _interopRequireDefault(require("./index.style"));
|
|
10
|
+
var _index2 = require("../index.style");function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}function _extends() {return _extends = Object.assign ? Object.assign.bind() : function (n) {for (var e = 1; e < arguments.length; e++) {var t = arguments[e];for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);}return n;}, _extends.apply(null, arguments);}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const Textarea = (_ref) => {let {
|
|
28
|
+
htmlElementName = 'textarea-element',
|
|
29
|
+
label = '',
|
|
30
|
+
isDisabled = false,
|
|
31
|
+
defaultValue = '',
|
|
32
|
+
placeholder = '',
|
|
33
|
+
resize = 'none',
|
|
34
|
+
minHeight = 120,
|
|
35
|
+
handleChange = () => {},
|
|
36
|
+
required = false,
|
|
37
|
+
number = null,
|
|
38
|
+
register,
|
|
39
|
+
control
|
|
40
|
+
} = _ref;return (/*#__PURE__*/
|
|
41
|
+
_react.default.createElement(_styledComponents.ThemeProvider, { theme: _theme.default }, /*#__PURE__*/
|
|
42
|
+
_react.default.createElement(_index2.Fieldset, null, /*#__PURE__*/
|
|
43
|
+
_react.default.createElement(_globalStyle.default, null), /*#__PURE__*/
|
|
44
|
+
_react.default.createElement(_label.default, { htmlFor: htmlElementName, label: label, number: number, required: required }), /*#__PURE__*/
|
|
45
|
+
|
|
46
|
+
_react.default.createElement(_reactHookForm.Controller, {
|
|
47
|
+
name: htmlElementName,
|
|
48
|
+
control: control,
|
|
49
|
+
rules: { required: required ? 'این فیلد اجباری است' : false },
|
|
50
|
+
render: (_ref2) => {let { fieldState } = _ref2;return (/*#__PURE__*/
|
|
51
|
+
_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/
|
|
52
|
+
_react.default.createElement(_index.default, _extends({
|
|
53
|
+
name: htmlElementName,
|
|
54
|
+
placeholder: placeholder,
|
|
55
|
+
resize: resize,
|
|
56
|
+
defaultValue: defaultValue,
|
|
57
|
+
minHeight: minHeight },
|
|
58
|
+
register(htmlElementName, {
|
|
59
|
+
onChange: handleChange,
|
|
60
|
+
disabled: isDisabled
|
|
61
|
+
}))
|
|
62
|
+
), /*#__PURE__*/
|
|
63
|
+
_react.default.createElement(_errorMsg.default, { errorMessage: fieldState && fieldState.error?.message })
|
|
64
|
+
));} }
|
|
65
|
+
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
));};var _default = exports.default =
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Textarea;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.WithError = exports.NoResize = exports.Minimal = exports.HorizontalResize = exports.FullOptions = exports.Disabled = void 0;var _react = _interopRequireDefault(require("react"));
|
|
2
|
+
|
|
3
|
+
var _addonActions = require("@storybook/addon-actions");
|
|
4
|
+
var _reactHookForm = require("react-hook-form");
|
|
5
|
+
var _index = _interopRequireDefault(require("./index"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}function _extends() {return _extends = Object.assign ? Object.assign.bind() : function (n) {for (var e = 1; e < arguments.length; e++) {var t = arguments[e];for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);}return n;}, _extends.apply(null, arguments);}var _default = exports.default =
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
title: 'Form-V7/Textarea',
|
|
9
|
+
component: _index.default,
|
|
10
|
+
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
defaultValue: 'توضیجات'
|
|
15
|
+
},
|
|
16
|
+
htmlElementName: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
defaultValue: 'html-element-name'
|
|
19
|
+
},
|
|
20
|
+
placeholder: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
defaultValue: 'این پلیس هولدر است'
|
|
23
|
+
},
|
|
24
|
+
minHeight: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
defaultValue: '120'
|
|
27
|
+
},
|
|
28
|
+
isDisabled: {
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
defaultValue: false
|
|
31
|
+
},
|
|
32
|
+
required: {
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
defaultValue: true
|
|
35
|
+
},
|
|
36
|
+
resize: {
|
|
37
|
+
control: 'select',
|
|
38
|
+
options: ['both', 'horizontal', 'vertical', 'none'],
|
|
39
|
+
defaultValue: 'both'
|
|
40
|
+
},
|
|
41
|
+
defaultValue: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
defaultValue: 'این یک باکس متنی میباشد'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const Template = (args) => {
|
|
49
|
+
const { register, control } = (0, _reactHookForm.useForm)();
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, _extends({}, args, { register: register, control: control }));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const Minimal = exports.Minimal = Template.bind({});
|
|
54
|
+
Minimal.args = {};
|
|
55
|
+
|
|
56
|
+
const FullOptions = exports.FullOptions = Template.bind({});
|
|
57
|
+
FullOptions.args = {
|
|
58
|
+
label: 'توضیجات',
|
|
59
|
+
htmlElementName: 'html-element-name',
|
|
60
|
+
placeholder: 'این پلیس هولدر است',
|
|
61
|
+
minHeight: '120',
|
|
62
|
+
isDisabled: false,
|
|
63
|
+
required: true,
|
|
64
|
+
resize: 'both',
|
|
65
|
+
handleChange: (0, _addonActions.action)('trigger what you want to do in onChange function'),
|
|
66
|
+
defaultValue: 'این یک باکس متنی میباشد'
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const Disabled = exports.Disabled = Template.bind({});
|
|
70
|
+
Disabled.args = {
|
|
71
|
+
...FullOptions.args,
|
|
72
|
+
isDisabled: true
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const NoResize = exports.NoResize = Template.bind({});
|
|
76
|
+
NoResize.args = {
|
|
77
|
+
...FullOptions.args,
|
|
78
|
+
resize: 'none'
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const HorizontalResize = exports.HorizontalResize = Template.bind({});
|
|
82
|
+
HorizontalResize.args = {
|
|
83
|
+
...FullOptions.args,
|
|
84
|
+
resize: 'horizontal'
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const WithError = exports.WithError = Template.bind({});
|
|
88
|
+
WithError.args = {
|
|
89
|
+
...FullOptions.args,
|
|
90
|
+
errorMessage: 'لطفا متن را وارد کنید'
|
|
91
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _styledComponents = _interopRequireDefault(require("styled-components"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
2
|
+
|
|
3
|
+
const StyledTextarea = _styledComponents.default.textarea`
|
|
4
|
+
font-family: 'IranSharp';
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
|
|
7
|
+
resize: ${(_ref) => {let { resize } = _ref;return resize;}};
|
|
8
|
+
min-height: ${(_ref2) => {let { minHeight } = _ref2;return `${minHeight}px`;}};
|
|
9
|
+
width: 100%;
|
|
10
|
+
padding: 8px 16px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
|
|
13
|
+
border-radius: ${(_ref3) => {let { theme } = _ref3;return `${theme.borderRadius}px`;}};
|
|
14
|
+
border: 1px solid ${(_ref4) => {let { disabled, theme } = _ref4;return disabled ? theme.disabled.color : theme.borderColor.normal;}};
|
|
15
|
+
background: ${(_ref5) => {let { disabled, theme } = _ref5;return disabled ? theme.disabled.background : 'white';}};
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
border-color: ${(_ref6) => {let { disabled, theme } = _ref6;return disabled ? theme.disabled.color : theme.borderColor.hover;}};
|
|
19
|
+
}
|
|
20
|
+
&:focus {
|
|
21
|
+
border-color: ${(_ref7) => {let { theme } = _ref7;return theme.borderColor.focus;}};
|
|
22
|
+
}
|
|
23
|
+
`;var _default = exports.default =
|
|
24
|
+
|
|
25
|
+
StyledTextarea;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _themes = _interopRequireDefault(require("../themes"));function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
2
|
+
|
|
3
|
+
const theme = {
|
|
4
|
+
borderRadius: _themes.default.borderRadius.high,
|
|
5
|
+
borderColor: {
|
|
6
|
+
normal: _themes.default.colors.gray600,
|
|
7
|
+
hover: _themes.default.colors.blue400,
|
|
8
|
+
focus: _themes.default.colors.blue600
|
|
9
|
+
},
|
|
10
|
+
disabled: {
|
|
11
|
+
background: _themes.default.colors.gray200,
|
|
12
|
+
color: _themes.default.colors.gray800
|
|
13
|
+
},
|
|
14
|
+
colors: {
|
|
15
|
+
red: _themes.default.colors.red600,
|
|
16
|
+
blue: _themes.default.colors.blue600
|
|
17
|
+
}
|
|
18
|
+
};var _default = exports.default =
|
|
19
|
+
|
|
20
|
+
theme;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _styledComponents = require("styled-components");
|
|
2
|
+
|
|
3
|
+
const GlobalStyle = (0, _styledComponents.createGlobalStyle)`
|
|
4
|
+
h1, h2, h3, h4, h5, h6, p, ol, ul {
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
ol, ul {
|
|
11
|
+
list-style: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
*, *:before, *:after {
|
|
15
|
+
box-sizing: inherit;
|
|
16
|
+
outline: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ReactModal__Body--open {
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
`;var _default = exports.default =
|
|
27
|
+
|
|
28
|
+
GlobalStyle;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _react = _interopRequireDefault(require("react"));
|
|
2
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));function _getRequireWildcardCache(e) {if ("function" != typeof WeakMap) return null;var r = new WeakMap(),t = new WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;}function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
3
|
+
|
|
4
|
+
const getResponsiveValue = (value, theme) => {
|
|
5
|
+
if (typeof value === 'object') {
|
|
6
|
+
const breakpoints = theme.breakpoints || {
|
|
7
|
+
mobile: 0,
|
|
8
|
+
tablet: 768,
|
|
9
|
+
desktop: 1024
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return Object.entries(value).
|
|
13
|
+
map((_ref) => {let [breakpoint, val] = _ref;
|
|
14
|
+
const minWidth = breakpoints[breakpoint];
|
|
15
|
+
return minWidth ?
|
|
16
|
+
`@media (min-width: ${minWidth}px) { width: ${val * 100}%; }` :
|
|
17
|
+
'';
|
|
18
|
+
}).
|
|
19
|
+
join('\n');
|
|
20
|
+
}
|
|
21
|
+
return `width: ${value * 100}%;`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getResponsiveVisibility = (visible, theme) => {
|
|
25
|
+
if (typeof visible === 'object') {
|
|
26
|
+
const breakpoints = theme.breakpoints || {
|
|
27
|
+
mobile: 0,
|
|
28
|
+
tablet: 768,
|
|
29
|
+
desktop: 1024
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return Object.entries(visible).
|
|
33
|
+
map((_ref2) => {let [breakpoint, val] = _ref2;
|
|
34
|
+
const minWidth = breakpoints[breakpoint];
|
|
35
|
+
return minWidth ?
|
|
36
|
+
`@media (min-width: ${minWidth}px) { display: ${val ? 'block' : 'none'}; }` :
|
|
37
|
+
'';
|
|
38
|
+
}).
|
|
39
|
+
join('\n');
|
|
40
|
+
}
|
|
41
|
+
return `display: ${visible ? 'block' : 'none'};`;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const getResponsiveAlignment = (align, theme) => {
|
|
45
|
+
if (typeof align === 'object') {
|
|
46
|
+
const breakpoints = theme.breakpoints || {
|
|
47
|
+
mobile: 0,
|
|
48
|
+
tablet: 768,
|
|
49
|
+
desktop: 1024
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return Object.entries(align).
|
|
53
|
+
map((_ref3) => {let [breakpoint, val] = _ref3;
|
|
54
|
+
const minWidth = breakpoints[breakpoint];
|
|
55
|
+
return minWidth ? `@media (min-width: ${minWidth}px) { justify-content: ${val}; }` : '';
|
|
56
|
+
}).
|
|
57
|
+
join('\n');
|
|
58
|
+
}
|
|
59
|
+
return `justify-content: ${align};`;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const GridContainer = _styledComponents.default.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-wrap: ${(_ref4) => {let { wrap } = _ref4;return wrap ? 'wrap' : 'nowrap';}};
|
|
65
|
+
flex-direction: ${(_ref5) => {let { reverse } = _ref5;return reverse ? 'row-reverse' : 'row';}};
|
|
66
|
+
${(_ref6) => {let { horizontalAlign, theme } = _ref6;return getResponsiveAlignment(horizontalAlign || 'left', theme);}}
|
|
67
|
+
${(_ref7) => {let { verticalAlign } = _ref7;return `align-items: ${verticalAlign || 'stretch'};`;}}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
const GridUnit = _styledComponents.default.div`
|
|
71
|
+
${(_ref8) => {let { size, theme } = _ref8;return getResponsiveValue(size, theme);}}
|
|
72
|
+
${(_ref9) => {let { visible, theme } = _ref9;return getResponsiveVisibility(visible, theme);}}
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const Grid = (_ref10) => {let { children, ...props } = _ref10;return (/*#__PURE__*/
|
|
76
|
+
_react.default.createElement(GridContainer, props,
|
|
77
|
+
children
|
|
78
|
+
));};
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Grid.Unit = GridUnit;var _default = exports.default =
|
|
82
|
+
|
|
83
|
+
Grid;
|