react-jupiter 6.0.0-beta.2 → 6.0.0-beta.3
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/accordion/index.js +25 -0
- package/{src/components/accordion → accordion}/index.styles.js +6 -6
- package/accordion/panel.js +41 -0
- package/avatar/index.js +41 -0
- package/avatar/index.styles.js +17 -0
- package/avatar/theme.js +13 -0
- package/button/index.js +210 -0
- package/button/index.styles.js +104 -0
- package/button/theme.js +58 -0
- package/button/utils.js +12 -0
- package/card/card-template/index.js +74 -0
- package/card/card-template/index.stories.js +110 -0
- package/card/card-template/index.style.js +25 -0
- package/card/card-template/index.test.js +85 -0
- package/card/event-card/constants.js +3 -0
- package/card/event-card/event-card-label/index.js +24 -0
- package/card/event-card/event-card-label/index.style.js +10 -0
- package/card/event-card/event-card-label/index.test.js +23 -0
- package/card/event-card/index.js +227 -0
- package/card/event-card/index.stories.js +166 -0
- package/card/event-card/index.style.js +129 -0
- package/card/event-card/index.test.js +79 -0
- package/card/index.js +16 -0
- package/card/organization-card/index.js +59 -0
- package/card/organization-card/index.stories.js +49 -0
- package/card/organization-card/index.style.js +10 -0
- package/card/organization-card/index.test.js +25 -0
- package/card/orgnizer-card/buttons.js +48 -0
- package/card/orgnizer-card/index.js +179 -0
- package/card/orgnizer-card/index.stories.js +81 -0
- package/card/orgnizer-card/index.style.js +58 -0
- package/cover/index.js +74 -0
- package/cover/index.style.js +48 -0
- package/display/index.js +42 -0
- package/display/index.style.js +79 -0
- package/file-item/fileImgIcon.js +37 -0
- package/{src/components/file-item → file-item}/fileImgsFont.js +4 -4
- package/file-item/index.js +101 -0
- package/file-item/index.style.js +31 -0
- package/file-item/theme.js +12 -0
- package/file-item/utils.js +3 -0
- package/form/captcha/index.js +86 -0
- package/form/captcha/index.stories.js +42 -0
- package/form/captcha/index.style.js +38 -0
- package/form/captcha/index.test.js +31 -0
- package/form/checkbox/checkbox-option.js +41 -0
- package/form/checkbox/checkbox.js +54 -0
- package/form/checkbox/index.js +10 -0
- package/form/checkbox/index.stories.js +121 -0
- package/form/checkbox/index.style.js +62 -0
- package/form/dropdown/index.js +10 -0
- package/form/dropdown/index.stories.js +119 -0
- package/form/dropdown/index.style.js +57 -0
- package/form/dropdown/index.test.js +20 -0
- package/form/dropdown/option.js +22 -0
- package/form/dropdown/select.js +68 -0
- package/form/errorMsg.js +21 -0
- package/form/index.js +22 -0
- package/form/radio/index.js +10 -0
- package/form/radio/index.stories.js +119 -0
- package/form/radio/index.style.js +61 -0
- package/form/radio/radio-option.js +45 -0
- package/form/radio/radio.js +56 -0
- package/form/text-input/index.js +92 -0
- package/form/text-input/index.stories.js +77 -0
- package/form/text-input/index.style.js +57 -0
- package/form/text-input/index.test.js +63 -0
- package/form/textarea/index.js +59 -0
- package/form/textarea/index.stories.js +90 -0
- package/form/textarea/index.style.js +25 -0
- package/form/theme.js +16 -0
- package/form-v7/captcha/index.js +101 -0
- package/form-v7/captcha/index.stories.js +60 -0
- package/form-v7/captcha/index.style.js +38 -0
- package/form-v7/captcha/index.test.js +31 -0
- package/form-v7/checkbox/checkbox-option.js +44 -0
- package/form-v7/checkbox/checkbox.js +70 -0
- package/form-v7/checkbox/index.js +10 -0
- package/form-v7/checkbox/index.stories.js +113 -0
- package/form-v7/checkbox/index.style.js +62 -0
- package/form-v7/dropdown/index.js +10 -0
- package/form-v7/dropdown/index.stories.js +130 -0
- package/form-v7/dropdown/index.style.js +57 -0
- package/form-v7/dropdown/index.test.js +20 -0
- package/form-v7/dropdown/option.js +18 -0
- package/form-v7/dropdown/select.js +85 -0
- package/form-v7/errorMsg.js +21 -0
- package/form-v7/file-input/index.js +73 -0
- package/form-v7/file-input/index.stories.js +73 -0
- package/form-v7/file-input/index.style.js +62 -0
- package/form-v7/file-input/index.test.js +63 -0
- package/form-v7/form/index.stories.js +276 -0
- package/form-v7/index.js +25 -0
- package/form-v7/index.style.js +11 -0
- package/form-v7/label/index.js +31 -0
- package/form-v7/label/index.style.js +12 -0
- package/form-v7/radio/index.js +10 -0
- package/form-v7/radio/index.stories.js +117 -0
- package/form-v7/radio/index.style.js +61 -0
- package/form-v7/radio/radio-option.js +45 -0
- package/form-v7/radio/radio.js +75 -0
- package/form-v7/text-input/index.js +132 -0
- package/form-v7/text-input/index.stories.js +96 -0
- package/form-v7/text-input/index.style.js +49 -0
- package/form-v7/text-input/index.test.js +63 -0
- package/form-v7/textarea/index.js +71 -0
- package/form-v7/textarea/index.stories.js +91 -0
- package/form-v7/textarea/index.style.js +25 -0
- package/form-v7/theme.js +20 -0
- package/{src/components/globalStyle.js → globalStyle.js} +4 -4
- package/grid/index.js +83 -0
- package/{dist/components/icon → icon}/iconFont.js +4 -4
- package/icon/index.js +116 -0
- package/icon/index.styles.js +12 -0
- package/icon/theme.js +23 -0
- package/index.js +75 -0
- package/modal/index.js +100 -0
- package/modal/index.style.js +40 -0
- package/modal/theme.js +11 -0
- package/numeric-summery-report/index.js +28 -0
- package/numeric-summery-report/index.style.js +16 -0
- package/package.json +11 -130
- package/product-menu/index.js +10 -0
- package/product-menu/index.style.js +38 -0
- package/product-menu/menu-item.js +23 -0
- package/product-menu/menu.js +88 -0
- package/product-menu/theme.js +16 -0
- package/product-owner/index.js +85 -0
- package/product-owner/index.style.js +16 -0
- package/product-properties/index.js +65 -0
- package/product-properties/index.style.js +14 -0
- package/product-properties/product-property/index.js +49 -0
- package/product-properties/product-property/index.style.js +9 -0
- package/progress-bar/index.js +46 -0
- package/{dist/components/progress-bar → progress-bar}/index.styles.js +11 -11
- package/responsive/index.js +44 -0
- package/show-date/index.js +25 -0
- package/spacing/core.js +106 -0
- package/spacing/index.js +10 -0
- package/spacing/margin/index.js +26 -0
- package/spacing/padding/index.js +26 -0
- package/table/actionCell.js +57 -0
- package/table/index.js +56 -0
- package/{src/components/table → table}/index.style.js +31 -31
- package/table/tableHeaderRow.js +28 -0
- package/table/tableRow.js +60 -0
- package/table/theme.js +8 -0
- package/tabs/index.js +10 -0
- package/tabs/index.style.js +35 -0
- package/tabs/tabPanel.js +17 -0
- package/tabs/tabs.js +71 -0
- package/tabs/theme.js +10 -0
- package/themes.js +97 -0
- package/titled-avatar/index.js +48 -0
- package/titled-avatar/index.style.js +30 -0
- package/typography/heading/index.js +59 -0
- package/typography/heading/index.stories.js +94 -0
- package/typography/heading/index.styles.js +69 -0
- package/typography/heading/index.test.js +122 -0
- package/typography/index.js +16 -0
- package/typography/link/index.js +82 -0
- package/typography/link/index.stories.js +70 -0
- package/typography/link/index.styles.js +8 -0
- package/typography/link/index.test.js +60 -0
- package/typography/paragraph/index.js +37 -0
- package/typography/paragraph/index.stories.js +56 -0
- package/typography/paragraph/index.styles.js +12 -0
- package/typography/paragraph/index.test.js +47 -0
- package/typography/text/index.js +156 -0
- package/typography/text/index.stories.js +196 -0
- package/typography/text/index.styles.js +73 -0
- package/typography/text/index.test.js +333 -0
- package/typography/theme.js +66 -0
- package/typography/utils.js +53 -0
- package/utils/date.js +7 -0
- package/utils/detectMobile.js +15 -0
- package/utils/index.js +7 -0
- package/utils/media-query.js +12 -0
- package/utils/numbers.js +25 -0
- package/utils/test.js +6 -0
- package/utils/theme.js +67 -0
- package/.babelrc +0 -12
- package/.env +0 -3
- package/.eslintignore +0 -2
- package/.eslintrc +0 -18
- package/.eslintrc.js +0 -47
- package/.eslintrc.json +0 -16
- package/.flowconfig +0 -0
- package/.storybook/main.js +0 -27
- package/.storybook/preview-head.html +0 -1
- package/.storybook/preview.js +0 -30
- package/.storybook/style.css +0 -9
- package/.vscode/settings.json +0 -4
- package/__mocks__/fileMock.js +0 -1
- package/config-overrides.js +0 -34
- package/dist/App.js +0 -13
- package/dist/components/accordion/index.js +0 -25
- package/dist/components/accordion/index.stories.js +0 -82
- package/dist/components/accordion/index.styles.js +0 -52
- package/dist/components/accordion/panel.js +0 -41
- package/dist/components/avatar/index.js +0 -41
- package/dist/components/avatar/index.stories.js +0 -59
- package/dist/components/avatar/index.styles.js +0 -17
- package/dist/components/avatar/index.test.js +0 -10
- package/dist/components/avatar/theme.js +0 -13
- package/dist/components/button/__snapshots__/index.test.js.snap +0 -489
- package/dist/components/button/index.js +0 -209
- package/dist/components/button/index.stories.js +0 -304
- package/dist/components/button/index.styles.js +0 -104
- package/dist/components/button/theme.js +0 -58
- package/dist/components/button/utils.js +0 -12
- package/dist/components/card/card-template/index.js +0 -74
- package/dist/components/card/card-template/index.stories.js +0 -110
- package/dist/components/card/card-template/index.style.js +0 -25
- package/dist/components/card/card-template/index.test.js +0 -85
- package/dist/components/card/event-card/constants.js +0 -3
- package/dist/components/card/event-card/event-card-label/index.js +0 -24
- package/dist/components/card/event-card/event-card-label/index.style.js +0 -10
- package/dist/components/card/event-card/event-card-label/index.test.js +0 -23
- package/dist/components/card/event-card/index.js +0 -227
- package/dist/components/card/event-card/index.stories.js +0 -166
- package/dist/components/card/event-card/index.style.js +0 -129
- package/dist/components/card/event-card/index.test.js +0 -79
- package/dist/components/card/index.js +0 -16
- package/dist/components/card/organization-card/index.js +0 -59
- package/dist/components/card/organization-card/index.stories.js +0 -49
- package/dist/components/card/organization-card/index.style.js +0 -10
- package/dist/components/card/organization-card/index.test.js +0 -25
- package/dist/components/card/orgnizer-card/buttons.js +0 -48
- package/dist/components/card/orgnizer-card/index.js +0 -179
- package/dist/components/card/orgnizer-card/index.stories.js +0 -81
- package/dist/components/card/orgnizer-card/index.style.js +0 -58
- package/dist/components/cover/index.js +0 -74
- package/dist/components/cover/index.style.js +0 -48
- package/dist/components/cover/index.test.js +0 -25
- package/dist/components/display/index.js +0 -42
- package/dist/components/display/index.style.js +0 -79
- package/dist/components/file-item/fileImgIcon.js +0 -37
- package/dist/components/file-item/fileImgsFont.js +0 -800
- package/dist/components/file-item/index.js +0 -101
- package/dist/components/file-item/index.stories.js +0 -71
- package/dist/components/file-item/index.style.js +0 -31
- package/dist/components/file-item/index.test.js +0 -106
- package/dist/components/file-item/theme.js +0 -12
- package/dist/components/file-item/utils.js +0 -3
- package/dist/components/form/captcha/index.js +0 -86
- package/dist/components/form/captcha/index.stories.js +0 -42
- package/dist/components/form/captcha/index.style.js +0 -38
- package/dist/components/form/captcha/index.test.js +0 -31
- package/dist/components/form/checkbox/checkbox-option.js +0 -41
- package/dist/components/form/checkbox/checkbox.js +0 -54
- package/dist/components/form/checkbox/index.js +0 -10
- package/dist/components/form/checkbox/index.stories.js +0 -121
- package/dist/components/form/checkbox/index.style.js +0 -62
- package/dist/components/form/dropdown/index.js +0 -10
- package/dist/components/form/dropdown/index.stories.js +0 -119
- package/dist/components/form/dropdown/index.style.js +0 -57
- package/dist/components/form/dropdown/index.test.js +0 -20
- package/dist/components/form/dropdown/option.js +0 -22
- package/dist/components/form/dropdown/select.js +0 -68
- package/dist/components/form/errorMsg.js +0 -21
- package/dist/components/form/index.js +0 -22
- package/dist/components/form/radio/index.js +0 -10
- package/dist/components/form/radio/index.stories.js +0 -119
- package/dist/components/form/radio/index.style.js +0 -61
- package/dist/components/form/radio/radio-option.js +0 -45
- package/dist/components/form/radio/radio.js +0 -56
- package/dist/components/form/text-input/index.js +0 -92
- package/dist/components/form/text-input/index.stories.js +0 -77
- package/dist/components/form/text-input/index.style.js +0 -57
- package/dist/components/form/text-input/index.test.js +0 -63
- package/dist/components/form/textarea/index.js +0 -59
- package/dist/components/form/textarea/index.stories.js +0 -90
- package/dist/components/form/textarea/index.style.js +0 -25
- package/dist/components/form/theme.js +0 -16
- package/dist/components/form-v7/captcha/index.js +0 -101
- package/dist/components/form-v7/captcha/index.stories.js +0 -60
- package/dist/components/form-v7/captcha/index.style.js +0 -38
- package/dist/components/form-v7/captcha/index.test.js +0 -31
- package/dist/components/form-v7/checkbox/checkbox-option.js +0 -44
- package/dist/components/form-v7/checkbox/checkbox.js +0 -70
- package/dist/components/form-v7/checkbox/index.js +0 -10
- package/dist/components/form-v7/checkbox/index.stories.js +0 -113
- package/dist/components/form-v7/checkbox/index.style.js +0 -62
- package/dist/components/form-v7/dropdown/index.js +0 -10
- package/dist/components/form-v7/dropdown/index.stories.js +0 -130
- package/dist/components/form-v7/dropdown/index.style.js +0 -57
- package/dist/components/form-v7/dropdown/index.test.js +0 -20
- package/dist/components/form-v7/dropdown/option.js +0 -18
- package/dist/components/form-v7/dropdown/select.js +0 -85
- package/dist/components/form-v7/errorMsg.js +0 -21
- package/dist/components/form-v7/file-input/index.js +0 -73
- package/dist/components/form-v7/file-input/index.stories.js +0 -73
- package/dist/components/form-v7/file-input/index.style.js +0 -62
- package/dist/components/form-v7/file-input/index.test.js +0 -63
- package/dist/components/form-v7/form/index.stories.js +0 -276
- package/dist/components/form-v7/index.js +0 -25
- package/dist/components/form-v7/index.style.js +0 -11
- package/dist/components/form-v7/label/index.js +0 -31
- package/dist/components/form-v7/label/index.style.js +0 -12
- package/dist/components/form-v7/radio/index.js +0 -10
- package/dist/components/form-v7/radio/index.stories.js +0 -117
- package/dist/components/form-v7/radio/index.style.js +0 -61
- package/dist/components/form-v7/radio/radio-option.js +0 -45
- package/dist/components/form-v7/radio/radio.js +0 -75
- package/dist/components/form-v7/text-input/index.js +0 -132
- package/dist/components/form-v7/text-input/index.stories.js +0 -96
- package/dist/components/form-v7/text-input/index.style.js +0 -49
- package/dist/components/form-v7/text-input/index.test.js +0 -63
- package/dist/components/form-v7/textarea/index.js +0 -71
- package/dist/components/form-v7/textarea/index.stories.js +0 -91
- package/dist/components/form-v7/textarea/index.style.js +0 -25
- package/dist/components/form-v7/theme.js +0 -20
- package/dist/components/globalStyle.js +0 -28
- package/dist/components/grid/index.js +0 -83
- package/dist/components/icon/index.js +0 -116
- package/dist/components/icon/index.stories.js +0 -45
- package/dist/components/icon/index.styles.js +0 -12
- package/dist/components/icon/index.test.js +0 -66
- package/dist/components/icon/theme.js +0 -23
- package/dist/components/index.js +0 -75
- package/dist/components/modal/index.js +0 -100
- package/dist/components/modal/index.stories.js +0 -86
- package/dist/components/modal/index.style.js +0 -40
- package/dist/components/modal/theme.js +0 -11
- package/dist/components/numeric-summery-report/index.js +0 -28
- package/dist/components/numeric-summery-report/index.stories.js +0 -37
- package/dist/components/numeric-summery-report/index.style.js +0 -16
- package/dist/components/numeric-summery-report/index.test.js +0 -22
- package/dist/components/product-menu/index.js +0 -10
- package/dist/components/product-menu/index.stories.js +0 -33
- package/dist/components/product-menu/index.style.js +0 -38
- package/dist/components/product-menu/index.test.js +0 -27
- package/dist/components/product-menu/menu-item.js +0 -23
- package/dist/components/product-menu/menu.js +0 -88
- package/dist/components/product-menu/theme.js +0 -16
- package/dist/components/product-owner/index.js +0 -85
- package/dist/components/product-owner/index.style.js +0 -16
- package/dist/components/product-owner/index.test.js +0 -75
- package/dist/components/product-properties/index.js +0 -65
- package/dist/components/product-properties/index.stories.js +0 -52
- package/dist/components/product-properties/index.style.js +0 -14
- package/dist/components/product-properties/index.test.js +0 -31
- package/dist/components/product-properties/product-property/index.js +0 -49
- package/dist/components/product-properties/product-property/index.style.js +0 -9
- package/dist/components/progress-bar/index.js +0 -46
- package/dist/components/progress-bar/index.stories.js +0 -33
- package/dist/components/responsive/index.js +0 -44
- package/dist/components/show-date/index.js +0 -25
- package/dist/components/show-date/index.stories.js +0 -51
- package/dist/components/show-date/index.test.js +0 -24
- package/dist/components/spacing/core.js +0 -106
- package/dist/components/spacing/index.js +0 -10
- package/dist/components/spacing/margin/index.js +0 -26
- package/dist/components/spacing/padding/index.js +0 -26
- package/dist/components/storybook.css +0 -54
- package/dist/components/table/actionCell.js +0 -57
- package/dist/components/table/index.js +0 -56
- package/dist/components/table/index.stories.js +0 -188
- package/dist/components/table/index.style.js +0 -107
- package/dist/components/table/index.test.js +0 -119
- package/dist/components/table/tableHeaderRow.js +0 -28
- package/dist/components/table/tableRow.js +0 -60
- package/dist/components/table/theme.js +0 -8
- package/dist/components/tabs/index.js +0 -10
- package/dist/components/tabs/index.stories.js +0 -61
- package/dist/components/tabs/index.style.js +0 -35
- package/dist/components/tabs/index.test.js +0 -30
- package/dist/components/tabs/tabPanel.js +0 -17
- package/dist/components/tabs/tabs.js +0 -71
- package/dist/components/tabs/theme.js +0 -10
- package/dist/components/themes.js +0 -97
- package/dist/components/titled-avatar/index.js +0 -48
- package/dist/components/titled-avatar/index.stories.js +0 -52
- package/dist/components/titled-avatar/index.style.js +0 -30
- package/dist/components/titled-avatar/index.test.js +0 -25
- package/dist/components/typography/heading/index.js +0 -59
- package/dist/components/typography/heading/index.stories.js +0 -94
- package/dist/components/typography/heading/index.styles.js +0 -69
- package/dist/components/typography/heading/index.test.js +0 -122
- package/dist/components/typography/index.js +0 -16
- package/dist/components/typography/link/index.js +0 -82
- package/dist/components/typography/link/index.stories.js +0 -70
- package/dist/components/typography/link/index.styles.js +0 -8
- package/dist/components/typography/link/index.test.js +0 -60
- package/dist/components/typography/paragraph/index.js +0 -37
- package/dist/components/typography/paragraph/index.stories.js +0 -56
- package/dist/components/typography/paragraph/index.styles.js +0 -12
- package/dist/components/typography/paragraph/index.test.js +0 -47
- package/dist/components/typography/text/index.js +0 -156
- package/dist/components/typography/text/index.stories.js +0 -196
- package/dist/components/typography/text/index.styles.js +0 -73
- package/dist/components/typography/text/index.test.js +0 -333
- package/dist/components/typography/theme.js +0 -66
- package/dist/components/typography/utils.js +0 -53
- package/dist/components/typography/utils.test.js +0 -188
- package/dist/components/utils/date.js +0 -7
- package/dist/components/utils/date.test.js +0 -15
- package/dist/components/utils/detectMobile.js +0 -15
- package/dist/components/utils/index.js +0 -7
- package/dist/components/utils/media-query.js +0 -12
- package/dist/components/utils/numbers.js +0 -25
- package/dist/components/utils/test.js +0 -6
- package/dist/components/utils/theme.js +0 -67
- package/dist/docs/App.css +0 -33
- package/dist/docs/App.js +0 -52
- package/dist/docs/assets/ads-label.svg +0 -13
- 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 +0 -7
- package/dist/docs/components/header/index.js +0 -10
- package/dist/docs/components/header/index.styles.js +0 -10
- package/dist/docs/components/side-navigation/index.js +0 -167
- package/dist/docs/components/side-navigation/index.styles.js +0 -46
- package/dist/docs/containers/avatar/index.js +0 -92
- package/dist/docs/containers/button/index.js +0 -295
- package/dist/docs/containers/card/index.js +0 -153
- package/dist/docs/containers/cover/index.js +0 -77
- package/dist/docs/containers/form/index.js +0 -41
- package/dist/docs/containers/home/index.js +0 -41
- package/dist/docs/containers/icon/index.js +0 -56
- package/dist/docs/containers/icons/index.js +0 -1488
- package/dist/docs/containers/product/index.js +0 -123
- package/dist/docs/containers/typography/index.js +0 -138
- package/dist/docs/globalStyle.js +0 -58
- package/dist/index.css +0 -3
- package/dist/index.js +0 -18
- package/dist/playground/index.js +0 -144
- package/dist/playground.css +0 -26
- package/dist/serviceWorker.js +0 -135
- package/dist/setupTests.js +0 -24
- package/dist/stories/Page.js +0 -67
- package/dist/storybook.css +0 -58
- package/dist/styles.css +0 -3
- package/dist/test-utils.js +0 -21
- package/doctor-storybook.log +0 -25
- package/migration-storybook.log +0 -329
- package/package.lib.json +0 -75
- package/postcss.config.js +0 -6
- 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 +0 -43
- package/public/logo.svg +0 -1
- package/public/logo142.svg +0 -1
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -2
- package/src/App.js +0 -13
- package/src/components/accordion/index.js +0 -25
- package/src/components/accordion/index.stories.js +0 -82
- package/src/components/accordion/panel.js +0 -41
- package/src/components/avatar/index.js +0 -41
- package/src/components/avatar/index.stories.js +0 -59
- package/src/components/avatar/index.styles.js +0 -17
- package/src/components/avatar/index.test.js +0 -10
- package/src/components/avatar/theme.js +0 -13
- package/src/components/button/__snapshots__/index.test.js.snap +0 -489
- package/src/components/button/index.js +0 -209
- package/src/components/button/index.stories.js +0 -304
- package/src/components/button/index.styles.js +0 -104
- package/src/components/button/theme.js +0 -60
- package/src/components/button/utils.js +0 -12
- package/src/components/card/card-template/index.js +0 -74
- package/src/components/card/card-template/index.stories.js +0 -110
- package/src/components/card/card-template/index.style.js +0 -25
- package/src/components/card/card-template/index.test.js +0 -85
- package/src/components/card/event-card/constants.js +0 -3
- package/src/components/card/event-card/event-card-label/index.js +0 -24
- package/src/components/card/event-card/event-card-label/index.style.js +0 -10
- package/src/components/card/event-card/event-card-label/index.test.js +0 -23
- package/src/components/card/event-card/index.js +0 -227
- package/src/components/card/event-card/index.stories.js +0 -166
- package/src/components/card/event-card/index.style.js +0 -129
- package/src/components/card/event-card/index.test.js +0 -79
- package/src/components/card/index.js +0 -16
- package/src/components/card/organization-card/index.js +0 -59
- package/src/components/card/organization-card/index.stories.js +0 -49
- package/src/components/card/organization-card/index.style.js +0 -10
- package/src/components/card/organization-card/index.test.js +0 -25
- package/src/components/card/orgnizer-card/buttons.js +0 -48
- package/src/components/card/orgnizer-card/index.js +0 -179
- package/src/components/card/orgnizer-card/index.stories.js +0 -81
- package/src/components/card/orgnizer-card/index.style.js +0 -58
- package/src/components/cover/index.js +0 -74
- package/src/components/cover/index.style.js +0 -48
- package/src/components/cover/index.test.js +0 -25
- package/src/components/display/index.js +0 -42
- package/src/components/display/index.style.js +0 -80
- package/src/components/file-item/fileImgIcon.js +0 -37
- package/src/components/file-item/index.js +0 -101
- package/src/components/file-item/index.stories.js +0 -71
- package/src/components/file-item/index.style.js +0 -31
- package/src/components/file-item/index.test.js +0 -106
- package/src/components/file-item/theme.js +0 -12
- package/src/components/file-item/utils.js +0 -3
- package/src/components/form/captcha/index.js +0 -86
- package/src/components/form/captcha/index.stories.js +0 -42
- package/src/components/form/captcha/index.style.js +0 -38
- package/src/components/form/captcha/index.test.js +0 -31
- package/src/components/form/checkbox/checkbox-option.js +0 -41
- package/src/components/form/checkbox/checkbox.js +0 -54
- package/src/components/form/checkbox/index.js +0 -10
- package/src/components/form/checkbox/index.stories.js +0 -121
- package/src/components/form/checkbox/index.style.js +0 -62
- package/src/components/form/dropdown/index.js +0 -10
- package/src/components/form/dropdown/index.stories.js +0 -119
- package/src/components/form/dropdown/index.style.js +0 -57
- package/src/components/form/dropdown/index.test.js +0 -20
- package/src/components/form/dropdown/option.js +0 -22
- package/src/components/form/dropdown/select.js +0 -68
- package/src/components/form/errorMsg.js +0 -21
- package/src/components/form/index.js +0 -22
- package/src/components/form/radio/index.js +0 -10
- package/src/components/form/radio/index.stories.js +0 -119
- package/src/components/form/radio/index.style.js +0 -61
- package/src/components/form/radio/radio-option.js +0 -45
- package/src/components/form/radio/radio.js +0 -56
- package/src/components/form/text-input/index.js +0 -92
- package/src/components/form/text-input/index.stories.js +0 -77
- package/src/components/form/text-input/index.style.js +0 -57
- package/src/components/form/text-input/index.test.js +0 -63
- package/src/components/form/textarea/index.js +0 -59
- package/src/components/form/textarea/index.stories.js +0 -90
- package/src/components/form/textarea/index.style.js +0 -25
- package/src/components/form/theme.js +0 -16
- package/src/components/form-v7/captcha/index.js +0 -101
- package/src/components/form-v7/captcha/index.stories.js +0 -60
- package/src/components/form-v7/captcha/index.style.js +0 -38
- package/src/components/form-v7/captcha/index.test.js +0 -31
- package/src/components/form-v7/checkbox/checkbox-option.js +0 -44
- package/src/components/form-v7/checkbox/checkbox.js +0 -70
- package/src/components/form-v7/checkbox/index.js +0 -10
- package/src/components/form-v7/checkbox/index.stories.js +0 -113
- package/src/components/form-v7/checkbox/index.style.js +0 -62
- package/src/components/form-v7/dropdown/index.js +0 -10
- package/src/components/form-v7/dropdown/index.stories.js +0 -130
- package/src/components/form-v7/dropdown/index.style.js +0 -57
- package/src/components/form-v7/dropdown/index.test.js +0 -20
- package/src/components/form-v7/dropdown/option.js +0 -18
- package/src/components/form-v7/dropdown/select.js +0 -85
- package/src/components/form-v7/errorMsg.js +0 -21
- package/src/components/form-v7/file-input/index.js +0 -73
- package/src/components/form-v7/file-input/index.stories.js +0 -73
- package/src/components/form-v7/file-input/index.style.js +0 -62
- package/src/components/form-v7/file-input/index.test.js +0 -63
- package/src/components/form-v7/form/index.stories.js +0 -276
- package/src/components/form-v7/index.js +0 -25
- package/src/components/form-v7/index.style.js +0 -11
- package/src/components/form-v7/label/index.js +0 -31
- package/src/components/form-v7/label/index.style.js +0 -12
- package/src/components/form-v7/radio/index.js +0 -10
- package/src/components/form-v7/radio/index.stories.js +0 -117
- package/src/components/form-v7/radio/index.style.js +0 -61
- package/src/components/form-v7/radio/radio-option.js +0 -45
- package/src/components/form-v7/radio/radio.js +0 -75
- package/src/components/form-v7/text-input/index.js +0 -132
- package/src/components/form-v7/text-input/index.stories.js +0 -96
- package/src/components/form-v7/text-input/index.style.js +0 -49
- package/src/components/form-v7/text-input/index.test.js +0 -63
- package/src/components/form-v7/textarea/index.js +0 -71
- package/src/components/form-v7/textarea/index.stories.js +0 -91
- package/src/components/form-v7/textarea/index.style.js +0 -25
- package/src/components/form-v7/theme.js +0 -20
- package/src/components/grid/index.js +0 -83
- package/src/components/icon/iconFont.js +0 -806
- package/src/components/icon/index.js +0 -116
- package/src/components/icon/index.stories.js +0 -45
- package/src/components/icon/index.styles.js +0 -12
- package/src/components/icon/index.test.js +0 -66
- package/src/components/icon/theme.js +0 -23
- package/src/components/index.js +0 -75
- package/src/components/modal/index.js +0 -100
- package/src/components/modal/index.stories.js +0 -86
- package/src/components/modal/index.style.js +0 -40
- package/src/components/modal/theme.js +0 -11
- package/src/components/numeric-summery-report/index.js +0 -28
- package/src/components/numeric-summery-report/index.stories.js +0 -37
- package/src/components/numeric-summery-report/index.style.js +0 -16
- package/src/components/numeric-summery-report/index.test.js +0 -22
- package/src/components/product-menu/index.js +0 -10
- package/src/components/product-menu/index.stories.js +0 -33
- package/src/components/product-menu/index.style.js +0 -38
- package/src/components/product-menu/index.test.js +0 -27
- package/src/components/product-menu/menu-item.js +0 -23
- package/src/components/product-menu/menu.js +0 -88
- package/src/components/product-menu/theme.js +0 -16
- package/src/components/product-owner/index.js +0 -85
- package/src/components/product-owner/index.style.js +0 -16
- package/src/components/product-owner/index.test.js +0 -75
- package/src/components/product-properties/index.js +0 -65
- package/src/components/product-properties/index.stories.js +0 -52
- package/src/components/product-properties/index.style.js +0 -14
- package/src/components/product-properties/index.test.js +0 -31
- package/src/components/product-properties/product-property/index.js +0 -49
- package/src/components/product-properties/product-property/index.style.js +0 -9
- package/src/components/progress-bar/index.js +0 -46
- package/src/components/progress-bar/index.stories.js +0 -33
- package/src/components/progress-bar/index.styles.js +0 -65
- package/src/components/responsive/index.js +0 -44
- package/src/components/show-date/index.js +0 -25
- package/src/components/show-date/index.stories.js +0 -51
- package/src/components/show-date/index.style.js +0 -1
- package/src/components/show-date/index.test.js +0 -24
- package/src/components/spacing/core.js +0 -106
- package/src/components/spacing/index.js +0 -10
- package/src/components/spacing/margin/index.js +0 -26
- package/src/components/spacing/padding/index.js +0 -26
- package/src/components/storybook.css +0 -54
- package/src/components/table/actionCell.js +0 -57
- package/src/components/table/index.js +0 -56
- package/src/components/table/index.stories.js +0 -188
- package/src/components/table/index.test.js +0 -119
- package/src/components/table/tableHeaderRow.js +0 -28
- package/src/components/table/tableRow.js +0 -60
- package/src/components/table/theme.js +0 -8
- package/src/components/tabs/index.js +0 -10
- package/src/components/tabs/index.stories.js +0 -61
- package/src/components/tabs/index.style.js +0 -35
- package/src/components/tabs/index.test.js +0 -30
- package/src/components/tabs/tabPanel.js +0 -17
- package/src/components/tabs/tabs.js +0 -71
- package/src/components/tabs/theme.js +0 -10
- package/src/components/themes.js +0 -97
- package/src/components/titled-avatar/index.js +0 -48
- package/src/components/titled-avatar/index.stories.js +0 -52
- package/src/components/titled-avatar/index.style.js +0 -30
- package/src/components/titled-avatar/index.test.js +0 -25
- package/src/components/typography/heading/index.js +0 -59
- package/src/components/typography/heading/index.stories.js +0 -94
- package/src/components/typography/heading/index.styles.js +0 -69
- package/src/components/typography/heading/index.test.js +0 -122
- package/src/components/typography/index.js +0 -16
- package/src/components/typography/index.styles.js +0 -1
- package/src/components/typography/link/index.js +0 -82
- package/src/components/typography/link/index.stories.js +0 -70
- package/src/components/typography/link/index.styles.js +0 -8
- package/src/components/typography/link/index.test.js +0 -60
- package/src/components/typography/paragraph/index.js +0 -37
- package/src/components/typography/paragraph/index.stories.js +0 -56
- package/src/components/typography/paragraph/index.styles.js +0 -12
- package/src/components/typography/paragraph/index.test.js +0 -47
- package/src/components/typography/text/index.js +0 -156
- package/src/components/typography/text/index.stories.js +0 -196
- package/src/components/typography/text/index.styles.js +0 -73
- package/src/components/typography/text/index.test.js +0 -333
- package/src/components/typography/theme.js +0 -66
- package/src/components/typography/utils.js +0 -53
- package/src/components/typography/utils.test.js +0 -188
- package/src/components/utils/date.js +0 -7
- package/src/components/utils/date.test.js +0 -15
- package/src/components/utils/detectMobile.js +0 -15
- package/src/components/utils/index.js +0 -7
- package/src/components/utils/media-query.js +0 -12
- package/src/components/utils/numbers.js +0 -25
- package/src/components/utils/test.js +0 -6
- package/src/components/utils/theme.js +0 -67
- package/src/docs/App.css +0 -33
- package/src/docs/App.js +0 -52
- package/src/docs/assets/ads-label.svg +0 -13
- 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 +0 -7
- package/src/docs/components/header/index.js +0 -10
- package/src/docs/components/header/index.styles.js +0 -10
- package/src/docs/components/side-navigation/index.js +0 -167
- package/src/docs/components/side-navigation/index.styles.js +0 -46
- package/src/docs/containers/avatar/index.js +0 -92
- package/src/docs/containers/button/index.js +0 -295
- package/src/docs/containers/card/index.js +0 -153
- package/src/docs/containers/cover/index.js +0 -77
- package/src/docs/containers/form/index.js +0 -41
- package/src/docs/containers/home/index.js +0 -41
- package/src/docs/containers/icon/index.js +0 -56
- package/src/docs/containers/icons/index.js +0 -1488
- package/src/docs/containers/product/index.js +0 -123
- package/src/docs/containers/typography/index.js +0 -138
- package/src/docs/globalStyle.js +0 -58
- package/src/index.css +0 -3
- package/src/index.js +0 -18
- package/src/playground/index.js +0 -144
- package/src/playground.css +0 -26
- package/src/serviceWorker.js +0 -135
- package/src/setupTests.js +0 -24
- package/src/stories/Page.jsx +0 -67
- package/src/storybook.css +0 -58
- package/src/styles.css +0 -3
- package/src/test-utils.js +0 -21
- package/storybook.log +0 -113
- package/tailwind.config.js +0 -26
- package/update-stories.js +0 -41
- /package/{dist/components/show-date → show-date}/index.style.js +0 -0
- /package/{dist/components/typography → typography}/index.styles.js +0 -0
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import Textarea from './index';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Form/Textarea',
|
|
8
|
-
component: Textarea,
|
|
9
|
-
|
|
10
|
-
argTypes: {
|
|
11
|
-
label: {
|
|
12
|
-
control: 'text',
|
|
13
|
-
defaultValue: 'توضیجات',
|
|
14
|
-
},
|
|
15
|
-
htmlElementName: {
|
|
16
|
-
control: 'text',
|
|
17
|
-
defaultValue: 'html-element-name',
|
|
18
|
-
},
|
|
19
|
-
defaultValue: {
|
|
20
|
-
control: 'text',
|
|
21
|
-
defaultValue: 'توضیحات قبلی',
|
|
22
|
-
},
|
|
23
|
-
placeholder: {
|
|
24
|
-
control: 'text',
|
|
25
|
-
defaultValue: 'این پلیس هولدر است',
|
|
26
|
-
},
|
|
27
|
-
minHeight: {
|
|
28
|
-
control: 'text',
|
|
29
|
-
defaultValue: '120',
|
|
30
|
-
},
|
|
31
|
-
isDisabled: {
|
|
32
|
-
control: 'boolean',
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
},
|
|
35
|
-
resize: {
|
|
36
|
-
control: 'select',
|
|
37
|
-
options: ['none', 'vertical', 'horizontal'],
|
|
38
|
-
defaultValue: 'vertical',
|
|
39
|
-
},
|
|
40
|
-
errorMessage: {
|
|
41
|
-
control: 'text',
|
|
42
|
-
defaultValue: 'ارور زیبا',
|
|
43
|
-
},
|
|
44
|
-
handleChange: {
|
|
45
|
-
action: 'handleChange',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const Template = (args) => <Textarea {...args} />;
|
|
51
|
-
|
|
52
|
-
export const Minimal = Template.bind({});
|
|
53
|
-
Minimal.args = {};
|
|
54
|
-
|
|
55
|
-
export const FullOptions = Template.bind({});
|
|
56
|
-
FullOptions.args = {
|
|
57
|
-
label: 'توضیجات',
|
|
58
|
-
htmlElementName: 'html-element-name',
|
|
59
|
-
defaultValue: 'توضیحات قبلی',
|
|
60
|
-
placeholder: 'این پلیس هولدر است',
|
|
61
|
-
minHeight: '120',
|
|
62
|
-
isDisabled: false,
|
|
63
|
-
resize: 'vertical',
|
|
64
|
-
handleChange: action('trigger what you want to do in onChange function'),
|
|
65
|
-
errorMessage: 'ارور زیبا',
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const Disabled = Template.bind({});
|
|
69
|
-
Disabled.args = {
|
|
70
|
-
...FullOptions.args,
|
|
71
|
-
isDisabled: true,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const NoResize = Template.bind({});
|
|
75
|
-
NoResize.args = {
|
|
76
|
-
...FullOptions.args,
|
|
77
|
-
resize: 'none',
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const HorizontalResize = Template.bind({});
|
|
81
|
-
HorizontalResize.args = {
|
|
82
|
-
...FullOptions.args,
|
|
83
|
-
resize: 'horizontal',
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const WithError = Template.bind({});
|
|
87
|
-
WithError.args = {
|
|
88
|
-
...FullOptions.args,
|
|
89
|
-
errorMessage: 'لطفا توضیحات را وارد کنید',
|
|
90
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const StyledTextarea = styled.textarea`
|
|
4
|
-
font-family: 'IranSharp';
|
|
5
|
-
font-size: 14px;
|
|
6
|
-
|
|
7
|
-
resize: ${({ resize }) => resize};
|
|
8
|
-
min-height: ${({ minHeight }) => `${minHeight}px`};
|
|
9
|
-
width: 100%;
|
|
10
|
-
padding: 8px 16px;
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
|
|
13
|
-
border-radius: ${({ theme }) => `${theme.borderRadius}px`};
|
|
14
|
-
border: 1px solid ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.normal)};
|
|
15
|
-
background: ${({ disabled, theme }) => (disabled ? theme.disabled.background : 'white')};
|
|
16
|
-
|
|
17
|
-
&:hover {
|
|
18
|
-
border-color: ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.hover)};
|
|
19
|
-
}
|
|
20
|
-
&:focus {
|
|
21
|
-
border-color: ${({ theme }) => theme.borderColor.focus};
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export default StyledTextarea;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import defaultTheme from '../themes';
|
|
2
|
-
|
|
3
|
-
const theme = {
|
|
4
|
-
borderRadius: defaultTheme.borderRadius.low,
|
|
5
|
-
borderColor: {
|
|
6
|
-
normal: defaultTheme.colors.gray800,
|
|
7
|
-
hover: defaultTheme.colors.blue400,
|
|
8
|
-
focus: defaultTheme.colors.blue600,
|
|
9
|
-
},
|
|
10
|
-
disabled: {
|
|
11
|
-
background: defaultTheme.colors.gray200,
|
|
12
|
-
color: defaultTheme.colors.gray400,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default theme;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Controller } from 'react-hook-form';
|
|
3
|
-
import { ThemeProvider } from 'styled-components';
|
|
4
|
-
import theme from '../theme';
|
|
5
|
-
import ErrorMsg from '../errorMsg';
|
|
6
|
-
import Icon from '../../icon';
|
|
7
|
-
import Button from '../../button';
|
|
8
|
-
import Label from '../label';
|
|
9
|
-
import { Input } from '../text-input/index.style';
|
|
10
|
-
import Display from '../../display';
|
|
11
|
-
import { Fieldset } from '../index.style';
|
|
12
|
-
|
|
13
|
-
type Props = {
|
|
14
|
-
htmlElementName: String,
|
|
15
|
-
label: String,
|
|
16
|
-
imageUrl: string,
|
|
17
|
-
control: FormData;
|
|
18
|
-
classNames?: String,
|
|
19
|
-
fetchData: () => {},
|
|
20
|
-
loading?: boolean,
|
|
21
|
-
number?: number,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function Captcha({
|
|
25
|
-
classNames = '',
|
|
26
|
-
loading = false,
|
|
27
|
-
number = null,
|
|
28
|
-
htmlElementName,
|
|
29
|
-
label,
|
|
30
|
-
imageUrl,
|
|
31
|
-
control,
|
|
32
|
-
fetchData,
|
|
33
|
-
}: Props) {
|
|
34
|
-
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
|
35
|
-
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
|
36
|
-
|
|
37
|
-
const fixNumbers = (str) => {
|
|
38
|
-
let result = str;
|
|
39
|
-
if (typeof str === 'string') {
|
|
40
|
-
for (let i = 0; i < 10; i++) {
|
|
41
|
-
result = result.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<ThemeProvider theme={theme}>
|
|
49
|
-
<Fieldset>
|
|
50
|
-
<div className={classNames}>
|
|
51
|
-
<Controller
|
|
52
|
-
name={htmlElementName}
|
|
53
|
-
control={control}
|
|
54
|
-
rules={{
|
|
55
|
-
required: 'این فیلد اجباری است',
|
|
56
|
-
pattern: {
|
|
57
|
-
value: /^[۰۱۲۳۴۵۶۷۸۹0-9]{4}$/,
|
|
58
|
-
message: 'لطفا فقط عدد وارد کنید.',
|
|
59
|
-
},
|
|
60
|
-
}}
|
|
61
|
-
defaultValue=""
|
|
62
|
-
render={({ field: { onChange, value }, fieldState }) => (
|
|
63
|
-
<Display display="block">
|
|
64
|
-
<Label htmlFor={htmlElementName} label={label} number={number} required />
|
|
65
|
-
<Display display="flex">
|
|
66
|
-
<Display display="flex" width="100%">
|
|
67
|
-
<Input
|
|
68
|
-
id={`${'text'}-${htmlElementName.split(' ').join('')}`}
|
|
69
|
-
name={htmlElementName}
|
|
70
|
-
type="text"
|
|
71
|
-
rtl={false}
|
|
72
|
-
value={value}
|
|
73
|
-
onChange={(e) => {
|
|
74
|
-
onChange(fixNumbers(e.target.value));
|
|
75
|
-
}}
|
|
76
|
-
className="captcha-input"
|
|
77
|
-
/>
|
|
78
|
-
<img
|
|
79
|
-
width="auto"
|
|
80
|
-
height="40px"
|
|
81
|
-
src={imageUrl}
|
|
82
|
-
alt="captcha-img"
|
|
83
|
-
loading="lazy"
|
|
84
|
-
data-test="captcha-img"
|
|
85
|
-
/>
|
|
86
|
-
</Display>
|
|
87
|
-
<Button type="button" size="sm" styleType="tertiary" onClick={fetchData} disabled={loading}>
|
|
88
|
-
<Icon name={loading ? 'loading' : 'refresh'} />
|
|
89
|
-
</Button>
|
|
90
|
-
</Display>
|
|
91
|
-
<ErrorMsg errorMessage={fieldState && fieldState.error?.message} />
|
|
92
|
-
</Display>
|
|
93
|
-
)}
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
</Fieldset>
|
|
97
|
-
</ThemeProvider>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default Captcha;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import { useForm } from 'react-hook-form';
|
|
5
|
-
import Captcha from './index';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Form-v7/Captcha',
|
|
9
|
-
component: Captcha,
|
|
10
|
-
|
|
11
|
-
argTypes: {
|
|
12
|
-
label: {
|
|
13
|
-
control: 'text',
|
|
14
|
-
defaultValue: 'کد تصویری',
|
|
15
|
-
},
|
|
16
|
-
htmlElementName: {
|
|
17
|
-
control: 'text',
|
|
18
|
-
defaultValue: 'captcha',
|
|
19
|
-
},
|
|
20
|
-
imageUrl: {
|
|
21
|
-
control: 'text',
|
|
22
|
-
defaultValue: 'https://static.evand.net/captcha/0bb5a9832be7b86a2a0a646ae2fd1649.jpg',
|
|
23
|
-
},
|
|
24
|
-
errorMessage: {
|
|
25
|
-
control: 'text',
|
|
26
|
-
defaultValue: 'لطفا کد تصویری را وارد کنید',
|
|
27
|
-
},
|
|
28
|
-
required: {
|
|
29
|
-
control: 'boolean',
|
|
30
|
-
defaultValue: true,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const Template = (args) => {
|
|
36
|
-
const { register, control } = useForm();
|
|
37
|
-
return (
|
|
38
|
-
<Captcha
|
|
39
|
-
{...args}
|
|
40
|
-
register={register}
|
|
41
|
-
control={control}
|
|
42
|
-
handleChange={action('trigger what you want to do in onChange function')}
|
|
43
|
-
fetchData={() => console.log('fetching')}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const Default = Template.bind({});
|
|
49
|
-
Default.args = {
|
|
50
|
-
label: 'کد تصویری',
|
|
51
|
-
htmlElementName: 'captcha',
|
|
52
|
-
imageUrl: 'https://static.evand.net/captcha/0bb5a9832be7b86a2a0a646ae2fd1649.jpg',
|
|
53
|
-
required: true,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const WithError = Template.bind({});
|
|
57
|
-
WithError.args = {
|
|
58
|
-
...Default.args,
|
|
59
|
-
errorMessage: 'کد تصویری نامعتبر است',
|
|
60
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import defaultTheme from '../theme';
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
flex-shrink: 0;
|
|
6
|
-
margin: 6px 6px 0 0;
|
|
7
|
-
|
|
8
|
-
& .hide {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
export const Loading = styled.div`
|
|
14
|
-
height: 32px;
|
|
15
|
-
width: 120px;
|
|
16
|
-
background: ${defaultTheme.disabled.color};
|
|
17
|
-
animation-name: sparkle;
|
|
18
|
-
animation-duration: 2s;
|
|
19
|
-
animation-iteration-count: infinite;
|
|
20
|
-
|
|
21
|
-
@keyframes sparkle {
|
|
22
|
-
0% {opacity: 0;}
|
|
23
|
-
50% {opacity: 1;}
|
|
24
|
-
70% {opacity: 1;}
|
|
25
|
-
100% {opacity: 0;}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
export const CaptchaBoxContainer = styled.div`
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
flex-wrap: nowrap;
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
export const InputConiatiner = styled.div`
|
|
37
|
-
flex-grow: 1;
|
|
38
|
-
`;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import findByTestAtrr from '../../utils/test';
|
|
4
|
-
import Captcha from './index';
|
|
5
|
-
|
|
6
|
-
describe('captcha', () => {
|
|
7
|
-
it('render captcha box', () => {
|
|
8
|
-
const component = shallow(<Captcha src="wrong-src" handleRetryCaptcha={() => {}} />);
|
|
9
|
-
const chaptchaBox = findByTestAtrr(component, 'captcha-box');
|
|
10
|
-
|
|
11
|
-
expect(chaptchaBox.length).toBe(1);
|
|
12
|
-
});
|
|
13
|
-
it('render captcha input', () => {
|
|
14
|
-
const component = shallow(<Captcha src="wrong-src" handleRetryCaptcha={() => {}} />);
|
|
15
|
-
const chaptchaInput = findByTestAtrr(component, 'captcha-input');
|
|
16
|
-
|
|
17
|
-
expect(chaptchaInput.length).toBe(1);
|
|
18
|
-
});
|
|
19
|
-
it('render captcha img', () => {
|
|
20
|
-
const component = shallow(<Captcha src="wrong-src" handleRetryCaptcha={() => {}} />);
|
|
21
|
-
const chaptchaImg = findByTestAtrr(component, 'captcha-img');
|
|
22
|
-
|
|
23
|
-
expect(chaptchaImg.length).toBe(1);
|
|
24
|
-
});
|
|
25
|
-
it('render retry button', () => {
|
|
26
|
-
const component = shallow(<Captcha src="wrong-src" handleRetryCaptcha={() => {}} />);
|
|
27
|
-
const chaptchaRetry = findByTestAtrr(component, 'captcha-retry');
|
|
28
|
-
|
|
29
|
-
expect(chaptchaRetry.length).toBe(1);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { UseFormRegister, FieldValues } from 'react-hook-form';
|
|
4
|
-
import { ThemeProvider } from 'styled-components';
|
|
5
|
-
import theme from '../theme';
|
|
6
|
-
import { Text } from '../../typography';
|
|
7
|
-
import { Input, InputContainer, Label } from './index.style';
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
label: string,
|
|
11
|
-
value: string,
|
|
12
|
-
groupName: string,
|
|
13
|
-
isDisabled?: boolean,
|
|
14
|
-
isChecked?: boolean,
|
|
15
|
-
register: UseFormRegister<FieldValues>;
|
|
16
|
-
};
|
|
17
|
-
const CheckboxOption = ({
|
|
18
|
-
label, value, isDisabled = false, isChecked = false, groupName, register, handleOnchange,
|
|
19
|
-
}: Props) => {
|
|
20
|
-
const itemId = `${groupName}-${value}`;
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<ThemeProvider theme={theme}>
|
|
24
|
-
<label htmlFor={itemId}>
|
|
25
|
-
<Input
|
|
26
|
-
type="checkbox"
|
|
27
|
-
id={itemId}
|
|
28
|
-
name={groupName}
|
|
29
|
-
value={value}
|
|
30
|
-
defaultChecked={isChecked}
|
|
31
|
-
{...register(groupName, {
|
|
32
|
-
disabled: isDisabled,
|
|
33
|
-
onChange: (handleOnchange),
|
|
34
|
-
})}
|
|
35
|
-
/>
|
|
36
|
-
<Text size={14}>
|
|
37
|
-
{label}
|
|
38
|
-
</Text>
|
|
39
|
-
</label>
|
|
40
|
-
</ThemeProvider>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default CheckboxOption;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { ThemeProvider } from 'styled-components';
|
|
4
|
-
import { Controller, UseFormRegister, FieldValues } from 'react-hook-form';
|
|
5
|
-
import GlobalStyle from '../../globalStyle';
|
|
6
|
-
import ErrorMsg from '../errorMsg';
|
|
7
|
-
import { CheckboxWrapper } from './index.style';
|
|
8
|
-
import { Fieldset } from '../index.style';
|
|
9
|
-
import theme from '../theme';
|
|
10
|
-
import Label from '../label';
|
|
11
|
-
import { Text } from '../../typography';
|
|
12
|
-
|
|
13
|
-
type Props = {
|
|
14
|
-
children: * => Node,
|
|
15
|
-
groupName?: string,
|
|
16
|
-
handleChange?: () => void,
|
|
17
|
-
isDisabled?: boolean,
|
|
18
|
-
label?: string,
|
|
19
|
-
type?: 'horizontal' | 'vertical',
|
|
20
|
-
required?: boolean,
|
|
21
|
-
register: UseFormRegister<FieldValues>;
|
|
22
|
-
control: FormData;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const Checkbox = ({
|
|
26
|
-
groupName = 'radio-element',
|
|
27
|
-
label = '',
|
|
28
|
-
handleChange = () => { },
|
|
29
|
-
isDisabled = false,
|
|
30
|
-
type = 'horizontal',
|
|
31
|
-
required = false,
|
|
32
|
-
register,
|
|
33
|
-
number,
|
|
34
|
-
control,
|
|
35
|
-
children,
|
|
36
|
-
}: Props) => {
|
|
37
|
-
const radioElements = React.Children.toArray(children);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<ThemeProvider theme={theme}>
|
|
41
|
-
<Fieldset onChange={handleChange}>
|
|
42
|
-
<GlobalStyle />
|
|
43
|
-
<Label label={label} number={number} required={required} />
|
|
44
|
-
<Controller
|
|
45
|
-
name={groupName}
|
|
46
|
-
control={control}
|
|
47
|
-
rules={{ required: required ? 'این فیلد اجباری است' : false }}
|
|
48
|
-
render={({ fieldState }) => (
|
|
49
|
-
<>
|
|
50
|
-
<CheckboxWrapper type={type}>
|
|
51
|
-
{radioElements.map(
|
|
52
|
-
(radioElement) => (
|
|
53
|
-
isDisabled ? (
|
|
54
|
-
React.cloneElement(radioElement, { groupName, isDisabled, register })
|
|
55
|
-
) : (
|
|
56
|
-
React.cloneElement(radioElement, { groupName, register })
|
|
57
|
-
)
|
|
58
|
-
),
|
|
59
|
-
)}
|
|
60
|
-
</CheckboxWrapper>
|
|
61
|
-
<ErrorMsg errorMessage={fieldState && fieldState.error?.message} />
|
|
62
|
-
</>
|
|
63
|
-
)}
|
|
64
|
-
/>
|
|
65
|
-
</Fieldset>
|
|
66
|
-
</ThemeProvider>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default Checkbox;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useForm } from 'react-hook-form';
|
|
3
|
-
|
|
4
|
-
import { action } from '@storybook/addon-actions';
|
|
5
|
-
import Checkbox from './checkbox';
|
|
6
|
-
import CheckboxOption from './checkbox-option';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Form-V7/Checkbox',
|
|
10
|
-
component: Checkbox,
|
|
11
|
-
|
|
12
|
-
argTypes: {
|
|
13
|
-
groupName: {
|
|
14
|
-
control: 'text',
|
|
15
|
-
defaultValue: 'degree',
|
|
16
|
-
},
|
|
17
|
-
label: {
|
|
18
|
-
control: 'text',
|
|
19
|
-
defaultValue: 'در کدام موضوع ها توانایی دارید',
|
|
20
|
-
},
|
|
21
|
-
number: {
|
|
22
|
-
control: 'number',
|
|
23
|
-
defaultValue: 4,
|
|
24
|
-
},
|
|
25
|
-
isDisabled: {
|
|
26
|
-
control: 'boolean',
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
},
|
|
29
|
-
type: {
|
|
30
|
-
control: 'select',
|
|
31
|
-
options: ['horizontal', 'vertical'],
|
|
32
|
-
defaultValue: 'horizontal',
|
|
33
|
-
},
|
|
34
|
-
errorMessage: {
|
|
35
|
-
control: 'text',
|
|
36
|
-
defaultValue: 'ارور زیبا',
|
|
37
|
-
},
|
|
38
|
-
required: {
|
|
39
|
-
control: 'boolean',
|
|
40
|
-
defaultValue: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const Template = (args) => {
|
|
46
|
-
const { register, control } = useForm();
|
|
47
|
-
return (
|
|
48
|
-
<Checkbox {...args} register={register} control={control}>
|
|
49
|
-
<CheckboxOption value="100" label="ورزشی" />
|
|
50
|
-
<CheckboxOption value="234" label="علمی" />
|
|
51
|
-
<CheckboxOption value="300" label="مذهبی" />
|
|
52
|
-
<CheckboxOption value="400" label="فرهنگی" />
|
|
53
|
-
<CheckboxOption value="500" label="هنری" />
|
|
54
|
-
</Checkbox>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Minimal = Template.bind({});
|
|
59
|
-
Minimal.args = {
|
|
60
|
-
groupName: 'degree',
|
|
61
|
-
required: true,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const FullOptions = Template.bind({});
|
|
65
|
-
FullOptions.args = {
|
|
66
|
-
groupName: 'degree',
|
|
67
|
-
label: 'در کدام موضوع ها توانایی دارید',
|
|
68
|
-
number: 4,
|
|
69
|
-
handleChange: action('trigger what you want to do in onChange function'),
|
|
70
|
-
isDisabled: false,
|
|
71
|
-
type: 'horizontal',
|
|
72
|
-
errorMessage: 'ارور زیبا',
|
|
73
|
-
required: true,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const VerticalLayout = Template.bind({});
|
|
77
|
-
VerticalLayout.args = {
|
|
78
|
-
...FullOptions.args,
|
|
79
|
-
type: 'vertical',
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const Disabled = Template.bind({});
|
|
83
|
-
Disabled.args = {
|
|
84
|
-
...FullOptions.args,
|
|
85
|
-
isDisabled: true,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const WithError = Template.bind({});
|
|
89
|
-
WithError.args = {
|
|
90
|
-
...FullOptions.args,
|
|
91
|
-
errorMessage: 'لطفا حداقل یک گزینه را انتخاب کنید',
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const CheckboxOptionTemplate = (args) => {
|
|
95
|
-
const { register } = useForm();
|
|
96
|
-
return (
|
|
97
|
-
<Checkbox groupName="degree" required label="در کدام موضوع ها توانایی دارید" register={register}>
|
|
98
|
-
<CheckboxOption {...args} register={register} />
|
|
99
|
-
<CheckboxOption value="200" label="علمی" />
|
|
100
|
-
<CheckboxOption value="300" label="مذهبی" />
|
|
101
|
-
<CheckboxOption value="400" label="فرهنگی" />
|
|
102
|
-
<CheckboxOption value="500" label="هنری" />
|
|
103
|
-
</Checkbox>
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const CustomOption = CheckboxOptionTemplate.bind({});
|
|
108
|
-
CustomOption.args = {
|
|
109
|
-
label: 'ورزشی',
|
|
110
|
-
value: '100',
|
|
111
|
-
isDisabled: false,
|
|
112
|
-
isChecked: false,
|
|
113
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const Fieldset = styled.fieldset`
|
|
4
|
-
border: none;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: 0;
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
export const CheckboxWrapper = styled.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
${({ type }) => (type === 'vertical' ? 'flex-direction: column;' : '')}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export const Input = styled.input`
|
|
16
|
-
-webkit-appearance: none;
|
|
17
|
-
-moz-appearance: none;
|
|
18
|
-
appearance: none;
|
|
19
|
-
|
|
20
|
-
width: 16px;
|
|
21
|
-
height: 16px;
|
|
22
|
-
|
|
23
|
-
border: 1px solid ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.normal)};
|
|
24
|
-
background: ${({ disabled, theme }) => (disabled ? theme.disabled.background : 'white')};
|
|
25
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
26
|
-
transition: 0.2s all linear;
|
|
27
|
-
margin-right: 5px;
|
|
28
|
-
|
|
29
|
-
position: relative;
|
|
30
|
-
top: 10px;
|
|
31
|
-
|
|
32
|
-
&:hover {
|
|
33
|
-
border-color: ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.hover)};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:checked {
|
|
37
|
-
border-color: ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.focus)};
|
|
38
|
-
|
|
39
|
-
&:after {
|
|
40
|
-
border-color: ${({ disabled, theme }) => (disabled ? theme.disabled.color : theme.borderColor.focus)};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&:after {
|
|
45
|
-
content: '';
|
|
46
|
-
display: block;
|
|
47
|
-
|
|
48
|
-
height: 8px;
|
|
49
|
-
width: 5px;
|
|
50
|
-
position: absolute;
|
|
51
|
-
right: 5px;
|
|
52
|
-
top: 2px;
|
|
53
|
-
|
|
54
|
-
transition: 0.2s all linear;
|
|
55
|
-
|
|
56
|
-
-webkit-transform: rotate(45deg);
|
|
57
|
-
-ms-transform: rotate(45deg);
|
|
58
|
-
transform: rotate(45deg);
|
|
59
|
-
border-bottom: 2px solid transparent;
|
|
60
|
-
border-right: 2px solid transparent;
|
|
61
|
-
}
|
|
62
|
-
`;
|