@coorpacademy/components 10.13.1 → 10.13.3-alpha.14
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/es/atom/button-link/test/fixtures.js +31 -0
- package/es/atom/button-link/test/fixtures.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures.js +21 -0
- package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -0
- package/es/atom/button-menu/test/fixtures.js +15 -0
- package/es/atom/button-menu/test/fixtures.js.map +1 -0
- package/es/atom/card-image-preview/test/fixtures.js +15 -0
- package/es/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/es/atom/checkbox-with-title/test/fixtures.js +15 -0
- package/es/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/es/atom/chips/test/fixtures.js +17 -0
- package/es/atom/chips/test/fixtures.js.map +1 -0
- package/es/atom/content-badge/test/fixtures.js +29 -0
- package/es/atom/content-badge/test/fixtures.js.map +1 -0
- package/es/atom/drag-and-drop/index.js +71 -43
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +173 -70
- package/es/atom/drag-and-drop/test/fixtures/default.js +4 -3
- package/es/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/error.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/error.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/modified.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/modified.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js +12 -0
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures.js +6 -0
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/empty-search-result/test/fixtures.js +13 -0
- package/es/atom/empty-search-result/test/fixtures.js.map +1 -0
- package/es/atom/image-upload/index.js +6 -3
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/clean-modified.js +13 -0
- package/es/atom/image-upload/test/fixtures/clean-modified.js.map +1 -0
- package/es/atom/image-upload/test/fixtures/{without-image.js → default.js} +1 -1
- package/es/atom/image-upload/test/fixtures/default.js.map +1 -0
- package/es/atom/image-upload/test/fixtures/desktop.js +2 -1
- package/es/atom/image-upload/test/fixtures/desktop.js.map +1 -1
- package/es/atom/image-upload/test/fixtures/mobile.js +2 -1
- package/es/atom/image-upload/test/fixtures/mobile.js.map +1 -1
- package/es/atom/image-upload/test/fixtures.js +4 -2
- package/es/atom/image-upload/test/fixtures.js.map +1 -1
- package/es/atom/input-checkbox/test/fixtures.js +2 -0
- package/es/atom/input-checkbox/test/fixtures.js.map +1 -1
- package/es/atom/input-search/test/fixtures.js +19 -0
- package/es/atom/input-search/test/fixtures.js.map +1 -0
- package/es/atom/input-switch/test/fixtures.js +10 -0
- package/es/atom/input-switch/test/fixtures.js.map +1 -1
- package/es/atom/input-text/test/fixtures.js +2 -0
- package/es/atom/input-text/test/fixtures.js.map +1 -1
- package/es/atom/input-text-with-title/index.js +35 -0
- package/es/atom/input-text-with-title/index.js.map +1 -0
- package/es/atom/input-text-with-title/style.css +24 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js +12 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js +13 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures.js +15 -0
- package/es/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/es/atom/input-textarea/test/fixtures.js +4 -0
- package/es/atom/input-textarea/test/fixtures.js.map +1 -1
- package/es/atom/loader/style.css +7 -3
- package/es/atom/loader/test/fixtures.js +2 -0
- package/es/atom/loader/test/fixtures.js.map +1 -1
- package/es/atom/review-header-step-item/test/fixtures.js +19 -0
- package/es/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/es/atom/select/test/fixtures.js +4 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/tag/test/fixtures.js +21 -0
- package/es/atom/tag/test/fixtures.js.map +1 -0
- package/es/atom/title/test/fixtures.js +6 -2
- package/es/atom/title/test/fixtures.js.map +1 -1
- package/es/atom/wizard-steps/test/fixtures.js +17 -0
- package/es/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/es/molecule/banner/test/fixtures.js +23 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -0
- package/es/molecule/brand-form-group/index.js +3 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +5 -0
- package/es/molecule/brand-form-group/test/fixtures/images.js +6 -2
- package/es/molecule/brand-form-group/test/fixtures/images.js.map +1 -1
- package/es/molecule/brand-form-group/test/fixtures.js +2 -0
- package/es/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/test/fixtures.js +15 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- package/es/molecule/card/test/fixtures.js +6 -0
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures.js +17 -0
- package/es/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/es/molecule/coorp-manager-roles/test/fixtures.js +13 -0
- package/es/molecule/coorp-manager-roles/test/fixtures.js.map +1 -0
- package/es/molecule/course-section/test/fixtures.js +15 -0
- package/es/molecule/course-section/test/fixtures.js.map +1 -0
- package/es/molecule/course-sections/index.js +20 -4
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +17 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +11 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +17 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -0
- package/es/molecule/dashboard/review-banner/test/fixtures.js +13 -0
- package/es/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
- package/es/molecule/draggable/test/fixtures.js +13 -0
- package/es/molecule/draggable/test/fixtures.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +15 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/es/molecule/popin/test/fixtures.js +21 -0
- package/es/molecule/popin/test/fixtures.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/quick-access-card/test/fixtures.js +21 -0
- package/es/molecule/quick-access-card/test/fixtures.js.map +1 -0
- package/es/molecule/quick-access-cards-group/test/fixtures.js +21 -0
- package/es/molecule/quick-access-cards-group/test/fixtures.js.map +1 -0
- package/es/molecule/review-correction-popin/test/fixtures.js +15 -0
- package/es/molecule/review-correction-popin/test/fixtures.js.map +1 -0
- package/es/molecule/review-header-steps/test/fixtures.js +23 -0
- package/es/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/es/molecule/select-multiple/test/fixtures.js +8 -0
- package/es/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/es/molecule/setup-slide/index.js +3 -1
- package/es/molecule/setup-slide/index.js.map +1 -1
- package/es/molecule/setup-slide/style.css +5 -0
- package/es/molecule/vertical-tabs/test/fixtures.js +17 -0
- package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures.js +23 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/es/organism/accordion/coorp-manager/part/test/fixtures.js +4 -0
- package/es/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
- package/es/organism/brand-analytics/test/fixtures.js +23 -0
- package/es/organism/brand-analytics/test/fixtures.js.map +1 -0
- package/es/organism/brand-dashboard/test/fixtures.js +2 -10
- package/es/organism/brand-dashboard/test/fixtures.js.map +1 -1
- package/es/organism/brand-form/test/fixtures.js +2 -0
- package/es/organism/brand-form/test/fixtures.js.map +1 -1
- package/es/organism/content-translation/test/fixtures.js +15 -0
- package/es/organism/content-translation/test/fixtures.js.map +1 -0
- package/es/organism/course-selection/index.js +2 -1
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +12 -3
- package/es/organism/course-selection/test/fixtures/loading.js +9 -0
- package/es/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/es/organism/course-selection/test/fixtures.js +25 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -0
- package/es/organism/list-item/test/fixtures.js +19 -0
- package/es/organism/list-item/test/fixtures.js.map +1 -0
- package/es/organism/list-items/test/fixtures.js +17 -0
- package/es/organism/list-items/test/fixtures.js.map +1 -0
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/search-and-chips-results/index.js +2 -1
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +10 -3
- package/es/organism/search-and-chips-results/test/fixtures/loading.js +9 -0
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures.js +23 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures.js +23 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -0
- package/es/template/app-player/popin-end/test/fixtures.js +2 -0
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +5 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +10 -1
- package/es/template/back-office/brand-update/test/fixtures.js +26 -2
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/atom/button-link/test/fixtures.js +49 -0
- package/lib/atom/button-link/test/fixtures.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures.js +34 -0
- package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -0
- package/lib/atom/button-menu/test/fixtures.js +25 -0
- package/lib/atom/button-menu/test/fixtures.js.map +1 -0
- package/lib/atom/card-image-preview/test/fixtures.js +25 -0
- package/lib/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/lib/atom/checkbox-with-title/test/fixtures.js +25 -0
- package/lib/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/chips/test/fixtures.js +28 -0
- package/lib/atom/chips/test/fixtures.js.map +1 -0
- package/lib/atom/content-badge/test/fixtures.js +46 -0
- package/lib/atom/content-badge/test/fixtures.js.map +1 -0
- package/lib/atom/drag-and-drop/index.js +73 -42
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +173 -70
- package/lib/atom/drag-and-drop/test/fixtures/default.js +4 -3
- package/lib/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/error.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/error.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/modified.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/modified.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js +21 -0
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures.js +9 -0
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/empty-search-result/test/fixtures.js +22 -0
- package/lib/atom/empty-search-result/test/fixtures.js.map +1 -0
- package/lib/atom/image-upload/index.js +6 -3
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/clean-modified.js +22 -0
- package/lib/atom/image-upload/test/fixtures/clean-modified.js.map +1 -0
- package/lib/atom/image-upload/test/fixtures/{without-image.js → default.js} +1 -1
- package/lib/atom/image-upload/test/fixtures/default.js.map +1 -0
- package/lib/atom/image-upload/test/fixtures/desktop.js +2 -1
- package/lib/atom/image-upload/test/fixtures/desktop.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures/mobile.js +2 -1
- package/lib/atom/image-upload/test/fixtures/mobile.js.map +1 -1
- package/lib/atom/image-upload/test/fixtures.js +6 -3
- package/lib/atom/image-upload/test/fixtures.js.map +1 -1
- package/lib/atom/input-checkbox/test/fixtures.js +3 -0
- package/lib/atom/input-checkbox/test/fixtures.js.map +1 -1
- package/lib/atom/input-search/test/fixtures.js +31 -0
- package/lib/atom/input-search/test/fixtures.js.map +1 -0
- package/lib/atom/input-switch/test/fixtures.js +15 -0
- package/lib/atom/input-switch/test/fixtures.js.map +1 -1
- package/lib/atom/input-text/test/fixtures.js +3 -0
- package/lib/atom/input-text/test/fixtures.js.map +1 -1
- package/lib/atom/input-text-with-title/index.js +46 -0
- package/lib/atom/input-text-with-title/index.js.map +1 -0
- package/lib/atom/input-text-with-title/style.css +24 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js +21 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js +22 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures.js +25 -0
- package/lib/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/input-textarea/test/fixtures.js +6 -0
- package/lib/atom/input-textarea/test/fixtures.js.map +1 -1
- package/lib/atom/loader/style.css +7 -3
- package/lib/atom/loader/test/fixtures.js +3 -0
- package/lib/atom/loader/test/fixtures.js.map +1 -1
- package/lib/atom/review-header-step-item/test/fixtures.js +31 -0
- package/lib/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +6 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/tag/test/fixtures.js +34 -0
- package/lib/atom/tag/test/fixtures.js.map +1 -0
- package/lib/atom/title/test/fixtures.js +8 -2
- package/lib/atom/title/test/fixtures.js.map +1 -1
- package/lib/atom/wizard-steps/test/fixtures.js +28 -0
- package/lib/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/banner/test/fixtures.js +37 -0
- package/lib/molecule/banner/test/fixtures.js.map +1 -0
- package/lib/molecule/brand-form-group/index.js +3 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +5 -0
- package/lib/molecule/brand-form-group/test/fixtures/images.js +6 -2
- package/lib/molecule/brand-form-group/test/fixtures/images.js.map +1 -1
- package/lib/molecule/brand-form-group/test/fixtures.js +3 -0
- package/lib/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js +25 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- package/lib/molecule/card/test/fixtures.js +9 -0
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures.js +28 -0
- package/lib/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/coorp-manager-roles/test/fixtures.js +22 -0
- package/lib/molecule/coorp-manager-roles/test/fixtures.js.map +1 -0
- package/lib/molecule/course-section/test/fixtures.js +25 -0
- package/lib/molecule/course-section/test/fixtures.js.map +1 -0
- package/lib/molecule/course-sections/index.js +21 -4
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +17 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +21 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +28 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
- package/lib/molecule/dashboard/review-banner/test/fixtures.js +22 -0
- package/lib/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable/test/fixtures.js +22 -0
- package/lib/molecule/draggable/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +25 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/lib/molecule/popin/test/fixtures.js +34 -0
- package/lib/molecule/popin/test/fixtures.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/quick-access-card/test/fixtures.js +34 -0
- package/lib/molecule/quick-access-card/test/fixtures.js.map +1 -0
- package/lib/molecule/quick-access-cards-group/test/fixtures.js +34 -0
- package/lib/molecule/quick-access-cards-group/test/fixtures.js.map +1 -0
- package/lib/molecule/review-correction-popin/test/fixtures.js +25 -0
- package/lib/molecule/review-correction-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/review-header-steps/test/fixtures.js +37 -0
- package/lib/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/select-multiple/test/fixtures.js +12 -0
- package/lib/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/lib/molecule/setup-slide/index.js +3 -1
- package/lib/molecule/setup-slide/index.js.map +1 -1
- package/lib/molecule/setup-slide/style.css +5 -0
- package/lib/molecule/vertical-tabs/test/fixtures.js +28 -0
- package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +37 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/lib/organism/accordion/coorp-manager/part/test/fixtures.js +6 -0
- package/lib/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
- package/lib/organism/brand-analytics/test/fixtures.js +37 -0
- package/lib/organism/brand-analytics/test/fixtures.js.map +1 -0
- package/lib/organism/brand-dashboard/test/fixtures.js +2 -14
- package/lib/organism/brand-dashboard/test/fixtures.js.map +1 -1
- package/lib/organism/brand-form/test/fixtures.js +3 -0
- package/lib/organism/brand-form/test/fixtures.js.map +1 -1
- package/lib/organism/content-translation/test/fixtures.js +25 -0
- package/lib/organism/content-translation/test/fixtures.js.map +1 -0
- package/lib/organism/course-selection/index.js +2 -1
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +12 -3
- package/lib/organism/course-selection/test/fixtures/loading.js +19 -0
- package/lib/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures.js +40 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -0
- package/lib/organism/list-item/test/fixtures.js +31 -0
- package/lib/organism/list-item/test/fixtures.js.map +1 -0
- package/lib/organism/list-items/test/fixtures.js +28 -0
- package/lib/organism/list-items/test/fixtures.js.map +1 -0
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/search-and-chips-results/index.js +2 -1
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +10 -3
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js +19 -0
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js +37 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +2 -2
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures.js +37 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -0
- package/lib/template/app-player/popin-end/test/fixtures.js +3 -0
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +5 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +10 -1
- package/lib/template/back-office/brand-update/test/fixtures.js +38 -2
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/package.json +2 -2
- package/es/atom/image-upload/test/fixtures/without-image.js.map +0 -1
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/atom/image-upload/test/fixtures/without-image.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomButtonLink from '..';
|
|
5
|
+
import fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';
|
|
6
|
+
import fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';
|
|
7
|
+
import fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';
|
|
8
|
+
import fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';
|
|
9
|
+
import fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';
|
|
10
|
+
import fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';
|
|
11
|
+
import fixtureLinkSecondaryIconRight from './fixtures/link-secondary-icon-right';
|
|
12
|
+
import fixtureLinkTertiaryNoIcon from './fixtures/link-tertiary-no-icon';
|
|
13
|
+
import fixtureLinkTextIconRightTargetBlank from './fixtures/link-text-icon-right-target-blank';
|
|
14
|
+
import fixtureLinkTextNoIconDownload from './fixtures/link-text-no-icon-download';
|
|
15
|
+
test('Atom › AtomButtonLink > should have valid propTypes', t => {
|
|
16
|
+
t.pass();
|
|
17
|
+
forEach(AtomButtonLink.propTypes, (value, key) => {
|
|
18
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonLink.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
test('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonDangerousNoIcon);
|
|
22
|
+
test('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);
|
|
23
|
+
test('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);
|
|
24
|
+
test('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);
|
|
25
|
+
test('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);
|
|
26
|
+
test('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);
|
|
27
|
+
test('Atom › AtomButtonLink › LinkSecondaryIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkSecondaryIconRight);
|
|
28
|
+
test('Atom › AtomButtonLink › LinkTertiaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTertiaryNoIcon);
|
|
29
|
+
test('Atom › AtomButtonLink › LinkTextIconRightTargetBlank › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextIconRightTargetBlank);
|
|
30
|
+
test('Atom › AtomButtonLink › LinkTextNoIconDownload › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextNoIconDownload);
|
|
31
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonLink","fixtureButtonDangerousNoIcon","fixtureButtonPrimaryIconLeft","fixtureButtonPrimaryNoIcon","fixtureButtonSecondaryNoIconDisabled","fixtureButtonTertiaryIconLeft","fixtureLinkPrimaryDisabledIconRight","fixtureLinkSecondaryIconRight","fixtureLinkTertiaryNoIcon","fixtureLinkTextIconRightTargetBlank","fixtureLinkTextNoIconDownload","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,4BAAP,MAAyC,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ACAX,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,cAApG,EAAoHS,mCAApH,CAAJ;AACAZ,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GU,6BAA9G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLink from '..';\nimport fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';\nimport fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';\nimport fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';\nimport fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';\nimport fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';\nimport fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';\nimport fixtureLinkSecondaryIconRight from './fixtures/link-secondary-icon-right';\nimport fixtureLinkTertiaryNoIcon from './fixtures/link-tertiary-no-icon';\nimport fixtureLinkTextIconRightTargetBlank from './fixtures/link-text-icon-right-target-blank';\nimport fixtureLinkTextNoIconDownload from './fixtures/link-text-no-icon-download';\n\ntest('Atom › AtomButtonLink > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLink.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLink.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonDangerousNoIcon);\ntest('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);\ntest('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);\ntest('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);\ntest('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);\ntest('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);\ntest('Atom › AtomButtonLink › LinkSecondaryIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkSecondaryIconRight);\ntest('Atom › AtomButtonLink › LinkTertiaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTertiaryNoIcon);\ntest('Atom › AtomButtonLink › LinkTextIconRightTargetBlank › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextIconRightTargetBlank);\ntest('Atom › AtomButtonLink › LinkTextNoIconDownload › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextNoIconDownload);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomButtonLinkIconOnly from '..';
|
|
5
|
+
import fixtureButtonIconBullet from './fixtures/button-icon-bullet';
|
|
6
|
+
import fixtureDefault from './fixtures/default';
|
|
7
|
+
import fixtureNoIcon from './fixtures/no-icon';
|
|
8
|
+
import fixtureSmallButtonDisabled from './fixtures/small-button-disabled';
|
|
9
|
+
import fixtureSmallLinkDownload from './fixtures/small-link-download';
|
|
10
|
+
test('Atom › AtomButtonLinkIconOnly > should have valid propTypes', t => {
|
|
11
|
+
t.pass();
|
|
12
|
+
forEach(AtomButtonLinkIconOnly.propTypes, (value, key) => {
|
|
13
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonLinkIconOnly.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
test('Atom › AtomButtonLinkIconOnly › ButtonIconBullet › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureButtonIconBullet);
|
|
17
|
+
test('Atom › AtomButtonLinkIconOnly › Default › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureDefault);
|
|
18
|
+
test('Atom › AtomButtonLinkIconOnly › NoIcon › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureNoIcon);
|
|
19
|
+
test('Atom › AtomButtonLinkIconOnly › SmallButtonDisabled › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallButtonDisabled);
|
|
20
|
+
test('Atom › AtomButtonLinkIconOnly › SmallLinkDownload › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallLinkDownload);
|
|
21
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonLinkIconOnly","fixtureButtonIconBullet","fixtureDefault","fixtureNoIcon","fixtureSmallButtonDisabled","fixtureSmallLinkDownload","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,OAAOC,wBAAP,MAAqC,gCAArC;AAEAR,IAAI,CAAC,6DAAD,EAAgES,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACAT,EAAAA,OAAO,CAACE,sBAAsB,CAACQ,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAb,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,sBAAhG,EAAwHC,uBAAxH,CAAJ;AACAJ,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GE,cAA/G,CAAJ;AACAL,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,sBAAtF,EAA8GG,aAA9G,CAAJ;AACAN,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,sBAAnG,EAA2HI,0BAA3H,CAAJ;AACAP,IAAI,CAAC,wEAAD,EAA2EE,oBAA3E,EAAiGC,sBAAjG,EAAyHK,wBAAzH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLinkIconOnly from '..';\nimport fixtureButtonIconBullet from './fixtures/button-icon-bullet';\nimport fixtureDefault from './fixtures/default';\nimport fixtureNoIcon from './fixtures/no-icon';\nimport fixtureSmallButtonDisabled from './fixtures/small-button-disabled';\nimport fixtureSmallLinkDownload from './fixtures/small-link-download';\n\ntest('Atom › AtomButtonLinkIconOnly > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLinkIconOnly.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLinkIconOnly.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLinkIconOnly › ButtonIconBullet › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureButtonIconBullet);\ntest('Atom › AtomButtonLinkIconOnly › Default › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureDefault);\ntest('Atom › AtomButtonLinkIconOnly › NoIcon › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureNoIcon);\ntest('Atom › AtomButtonLinkIconOnly › SmallButtonDisabled › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallButtonDisabled);\ntest('Atom › AtomButtonLinkIconOnly › SmallLinkDownload › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallLinkDownload);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomButtonMenu from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureMultipleButtons from './fixtures/multiple-buttons';
|
|
7
|
+
test('Atom › AtomButtonMenu > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomButtonMenu.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonMenu.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);
|
|
14
|
+
test('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-menu/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonMenu","fixtureDefault","fixtureMultipleButtons","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AAEAL,IAAI,CAAC,qDAAD,EAAwDM,CAAC,IAAI;AAC/DA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+CAA8CF,GAAI,mEAA3E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,cAA/E,EAA+FC,cAA/F,CAAJ;AACAJ,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,cAAvF,EAAuGE,sBAAvG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonMenu from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureMultipleButtons from './fixtures/multiple-buttons';\n\ntest('Atom › AtomButtonMenu > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonMenu.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonMenu.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);\ntest('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomCardImagePreview from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureEmpty from './fixtures/empty';
|
|
7
|
+
test('Atom › AtomCardImagePreview > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomCardImagePreview.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomCardImagePreview.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);
|
|
14
|
+
test('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/card-image-preview/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCardImagePreview","fixtureDefault","fixtureEmpty","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,2DAAD,EAA8DM,CAAC,IAAI;AACrEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oBAAoB,CAACK,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,qDAAoDF,GAAI,mEAAjF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,oBAArF,EAA2GC,cAA3G,CAAJ;AACAJ,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,oBAAnF,EAAyGE,YAAzG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCardImagePreview from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureEmpty from './fixtures/empty';\n\ntest('Atom › AtomCardImagePreview > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCardImagePreview.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCardImagePreview.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);\ntest('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomCheckboxWithTitle from '..';
|
|
5
|
+
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
+
test('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomCheckboxWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);
|
|
14
|
+
test('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/checkbox-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCheckboxWithTitle","fixtureChecked","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,4DAAD,EAA+DM,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,qBAAqB,CAACK,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,qBAAtF,EAA6GC,cAA7G,CAAJ;AACAJ,IAAI,CAAC,+DAAD,EAAkEE,oBAAlE,EAAwFC,qBAAxF,EAA+GE,gBAA/G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCheckboxWithTitle from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCheckboxWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);\ntest('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomChips from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureLongText from './fixtures/long-text';
|
|
7
|
+
import fixtureNonSelected from './fixtures/non-selected';
|
|
8
|
+
test('Atom › AtomChips > should have valid propTypes', t => {
|
|
9
|
+
t.pass();
|
|
10
|
+
forEach(AtomChips.propTypes, (value, key) => {
|
|
11
|
+
t.not(value, undefined, `PropType for "Atom.AtomChips.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test('Atom › AtomChips › Default › should be rendered', renderComponentMacro, AtomChips, fixtureDefault);
|
|
15
|
+
test('Atom › AtomChips › LongText › should be rendered', renderComponentMacro, AtomChips, fixtureLongText);
|
|
16
|
+
test('Atom › AtomChips › NonSelected › should be rendered', renderComponentMacro, AtomChips, fixtureNonSelected);
|
|
17
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/chips/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomChips","fixtureDefault","fixtureLongText","fixtureNonSelected","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,SAAP,MAAsB,IAAtB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,sBAA5B;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAN,IAAI,CAAC,gDAAD,EAAmDO,CAAC,IAAI;AAC1DA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,SAAS,CAACM,SAAX,EAAsB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3CJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0CAAyCF,GAAI,mEAAtE;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,iDAAD,EAAoDE,oBAApD,EAA0EC,SAA1E,EAAqFC,cAArF,CAAJ;AACAJ,IAAI,CAAC,kDAAD,EAAqDE,oBAArD,EAA2EC,SAA3E,EAAsFE,eAAtF,CAAJ;AACAL,IAAI,CAAC,qDAAD,EAAwDE,oBAAxD,EAA8EC,SAA9E,EAAyFG,kBAAzF,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomChips from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLongText from './fixtures/long-text';\nimport fixtureNonSelected from './fixtures/non-selected';\n\ntest('Atom › AtomChips > should have valid propTypes', t => {\n t.pass();\n forEach(AtomChips.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomChips.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomChips › Default › should be rendered', renderComponentMacro, AtomChips, fixtureDefault);\ntest('Atom › AtomChips › LongText › should be rendered', renderComponentMacro, AtomChips, fixtureLongText);\ntest('Atom › AtomChips › NonSelected › should be rendered', renderComponentMacro, AtomChips, fixtureNonSelected);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomContentBadge from '..';
|
|
5
|
+
import fixtureAdvanced from './fixtures/advanced';
|
|
6
|
+
import fixtureArticle from './fixtures/article';
|
|
7
|
+
import fixtureChapter from './fixtures/chapter';
|
|
8
|
+
import fixtureCoach from './fixtures/coach';
|
|
9
|
+
import fixtureCourse from './fixtures/course';
|
|
10
|
+
import fixtureDefault from './fixtures/default';
|
|
11
|
+
import fixturePodcast from './fixtures/podcast';
|
|
12
|
+
import fixtureScorm from './fixtures/scorm';
|
|
13
|
+
import fixtureVideo from './fixtures/video';
|
|
14
|
+
test('Atom › AtomContentBadge > should have valid propTypes', t => {
|
|
15
|
+
t.pass();
|
|
16
|
+
forEach(AtomContentBadge.propTypes, (value, key) => {
|
|
17
|
+
t.not(value, undefined, `PropType for "Atom.AtomContentBadge.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
test('Atom › AtomContentBadge › Advanced › should be rendered', renderComponentMacro, AtomContentBadge, fixtureAdvanced);
|
|
21
|
+
test('Atom › AtomContentBadge › Article › should be rendered', renderComponentMacro, AtomContentBadge, fixtureArticle);
|
|
22
|
+
test('Atom › AtomContentBadge › Chapter › should be rendered', renderComponentMacro, AtomContentBadge, fixtureChapter);
|
|
23
|
+
test('Atom › AtomContentBadge › Coach › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCoach);
|
|
24
|
+
test('Atom › AtomContentBadge › Course › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCourse);
|
|
25
|
+
test('Atom › AtomContentBadge › Default › should be rendered', renderComponentMacro, AtomContentBadge, fixtureDefault);
|
|
26
|
+
test('Atom › AtomContentBadge › Podcast › should be rendered', renderComponentMacro, AtomContentBadge, fixturePodcast);
|
|
27
|
+
test('Atom › AtomContentBadge › Scorm › should be rendered', renderComponentMacro, AtomContentBadge, fixtureScorm);
|
|
28
|
+
test('Atom › AtomContentBadge › Video › should be rendered', renderComponentMacro, AtomContentBadge, fixtureVideo);
|
|
29
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/content-badge/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomContentBadge","fixtureAdvanced","fixtureArticle","fixtureChapter","fixtureCoach","fixtureCourse","fixtureDefault","fixturePodcast","fixtureScorm","fixtureVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,gBAAP,MAA6B,IAA7B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAZ,IAAI,CAAC,uDAAD,EAA0Da,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACAb,EAAAA,OAAO,CAACE,gBAAgB,CAACY,SAAlB,EAA6B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAClDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAjB,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,gBAAlF,EAAoGC,eAApG,CAAJ;AACAJ,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGE,cAAnG,CAAJ;AACAL,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGG,cAAnG,CAAJ;AACAN,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGI,YAAjG,CAAJ;AACAP,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,gBAAhF,EAAkGK,aAAlG,CAAJ;AACAR,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGM,cAAnG,CAAJ;AACAT,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGO,cAAnG,CAAJ;AACAV,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGQ,YAAjG,CAAJ;AACAX,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGS,YAAjG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomContentBadge from '..';\nimport fixtureAdvanced from './fixtures/advanced';\nimport fixtureArticle from './fixtures/article';\nimport fixtureChapter from './fixtures/chapter';\nimport fixtureCoach from './fixtures/coach';\nimport fixtureCourse from './fixtures/course';\nimport fixtureDefault from './fixtures/default';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureVideo from './fixtures/video';\n\ntest('Atom › AtomContentBadge > should have valid propTypes', t => {\n t.pass();\n forEach(AtomContentBadge.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomContentBadge.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomContentBadge › Advanced › should be rendered', renderComponentMacro, AtomContentBadge, fixtureAdvanced);\ntest('Atom › AtomContentBadge › Article › should be rendered', renderComponentMacro, AtomContentBadge, fixtureArticle);\ntest('Atom › AtomContentBadge › Chapter › should be rendered', renderComponentMacro, AtomContentBadge, fixtureChapter);\ntest('Atom › AtomContentBadge › Coach › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCoach);\ntest('Atom › AtomContentBadge › Course › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCourse);\ntest('Atom › AtomContentBadge › Default › should be rendered', renderComponentMacro, AtomContentBadge, fixtureDefault);\ntest('Atom › AtomContentBadge › Podcast › should be rendered', renderComponentMacro, AtomContentBadge, fixturePodcast);\ntest('Atom › AtomContentBadge › Scorm › should be rendered', renderComponentMacro, AtomContentBadge, fixtureScorm);\ntest('Atom › AtomContentBadge › Video › should be rendered', renderComponentMacro, AtomContentBadge, fixtureVideo);\n"],"file":"fixtures.js"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
import _isEmpty from "lodash/fp/isEmpty";
|
|
1
2
|
import _constant from "lodash/fp/constant";
|
|
2
|
-
import _get from "lodash/fp/get";
|
|
3
3
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
4
4
|
|
|
5
5
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
7
|
import React from 'react';
|
|
10
8
|
import PropTypes from 'prop-types';
|
|
11
|
-
import {
|
|
12
|
-
import Provider from '../provider';
|
|
9
|
+
import { NovaLineStatusClose as Close, NovaSolidFilesBasicFileUpload2 as FileUploadIcon, NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon } from '@coorpacademy/nova-icons';
|
|
13
10
|
import Loader from '../loader';
|
|
14
11
|
import style from './style.css';
|
|
12
|
+
import Button from '../button-link';
|
|
13
|
+
import getClassState from '../../util/get-class-state';
|
|
15
14
|
|
|
16
15
|
const constantNull = _constant(null);
|
|
17
16
|
|
|
@@ -38,12 +37,6 @@ class DragAndDrop extends React.Component {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
render() {
|
|
41
|
-
const {
|
|
42
|
-
skin
|
|
43
|
-
} = this.context;
|
|
44
|
-
|
|
45
|
-
const brandColor = _get('common.brand', skin);
|
|
46
|
-
|
|
47
40
|
const idBox = _uniqueId('drop-box-');
|
|
48
41
|
|
|
49
42
|
const {
|
|
@@ -55,7 +48,8 @@ class DragAndDrop extends React.Component {
|
|
|
55
48
|
previewContent,
|
|
56
49
|
loading = false,
|
|
57
50
|
modified = false,
|
|
58
|
-
onReset = null
|
|
51
|
+
onReset = null,
|
|
52
|
+
error = false
|
|
59
53
|
} = this.props;
|
|
60
54
|
const {
|
|
61
55
|
dragging
|
|
@@ -64,25 +58,36 @@ class DragAndDrop extends React.Component {
|
|
|
64
58
|
|
|
65
59
|
if (previewContent && previewContent.type === 'image') {
|
|
66
60
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: style.
|
|
61
|
+
className: style.preview
|
|
68
62
|
}, /*#__PURE__*/React.createElement("img", {
|
|
69
63
|
src: previewContent.src
|
|
70
64
|
}));
|
|
71
65
|
} else if (previewContent && previewContent.type === 'video') {
|
|
72
66
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className:
|
|
74
|
-
width: '300px'
|
|
75
|
-
})
|
|
67
|
+
className: style.preview
|
|
76
68
|
}, /*#__PURE__*/React.createElement("video", {
|
|
77
|
-
width: "100%",
|
|
78
69
|
controls: true,
|
|
79
70
|
src: previewContent.src,
|
|
80
71
|
type: "video/*"
|
|
81
72
|
}));
|
|
82
73
|
} else if (loading) {
|
|
83
74
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: style.
|
|
85
|
-
}, /*#__PURE__*/React.createElement(
|
|
75
|
+
className: style.loaderWrapper
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: style.loadingCancel
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
79
|
+
"data-name": "reset-content-icon",
|
|
80
|
+
height: 16,
|
|
81
|
+
width: 16,
|
|
82
|
+
className: style.closeIcon,
|
|
83
|
+
onClick: onReset
|
|
84
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: style.loader
|
|
86
|
+
}, /*#__PURE__*/React.createElement(Loader, {
|
|
87
|
+
theme: "coorpmanager"
|
|
88
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
89
|
+
className: style.loaderText
|
|
90
|
+
}, "Uploading"));
|
|
86
91
|
} else {
|
|
87
92
|
previewView = /*#__PURE__*/React.createElement("span", null, previewLabel);
|
|
88
93
|
}
|
|
@@ -98,38 +103,60 @@ class DragAndDrop extends React.Component {
|
|
|
98
103
|
className: style.closeIcon,
|
|
99
104
|
onClick: onReset
|
|
100
105
|
})) : null;
|
|
106
|
+
|
|
107
|
+
const buildButton = (dragging, error) => {
|
|
108
|
+
const defaultButtonProps = {
|
|
109
|
+
label: uploadLabel,
|
|
110
|
+
'aria-label': 'aria button',
|
|
111
|
+
'data-name': 'default-button',
|
|
112
|
+
icon: {
|
|
113
|
+
position: 'left',
|
|
114
|
+
type: 'folders'
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
if (dragging) {
|
|
119
|
+
return null;
|
|
120
|
+
} else if (error) {
|
|
121
|
+
const errorButtonProps = _extends(_extends({}, defaultButtonProps), {}, {
|
|
122
|
+
label: 'Try again',
|
|
123
|
+
icon: {}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/React.createElement(Button, errorButtonProps);
|
|
127
|
+
} else {
|
|
128
|
+
return /*#__PURE__*/React.createElement(Button, defaultButtonProps);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const button = buildButton(dragging, error);
|
|
133
|
+
const previewContainer = getClassState(style.previewContainer, style.modifiedPreviewContainer, null, modified, error);
|
|
134
|
+
const inputWrapper = getClassState(style.inputWrapper, style.modifiedInputWrapper, style.errorInputWrapper, modified, error);
|
|
101
135
|
return /*#__PURE__*/React.createElement("div", {
|
|
102
136
|
className: style.wrapper,
|
|
103
137
|
"data-name": "drag-and-drop-wrapper"
|
|
138
|
+
}, !_isEmpty(previewContent) || loading ? /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: previewContainer
|
|
140
|
+
}, previewView) : /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: dragging ? style.dragging : inputWrapper,
|
|
142
|
+
id: idBox
|
|
104
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: style.infosContainer
|
|
145
|
+
}, error ? /*#__PURE__*/React.createElement(FileUploadBlockedIcon, {
|
|
146
|
+
className: style.iconError
|
|
147
|
+
}) : /*#__PURE__*/React.createElement(FileUploadIcon, {
|
|
148
|
+
className: style.icon
|
|
149
|
+
}), description ? /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: style.description
|
|
151
|
+
}, description) : null, error ? null : /*#__PURE__*/React.createElement("div", {
|
|
105
152
|
className: style.title
|
|
106
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
className:
|
|
108
|
-
},
|
|
109
|
-
className: dragging ? style.dragging : style.inputWrapper,
|
|
110
|
-
id: idBox
|
|
111
|
-
}, /*#__PURE__*/React.createElement(UploadIcon, {
|
|
112
|
-
className: style.arrow,
|
|
113
|
-
color: brandColor
|
|
114
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: style.uploadLabel
|
|
116
|
-
}, uploadLabel), children(this.handleDragStart, this.handleDragStop)), resetContent, description ?
|
|
117
|
-
/*#__PURE__*/
|
|
118
|
-
// eslint-disable-next-line react/no-danger
|
|
119
|
-
React.createElement("div", {
|
|
120
|
-
className: style.description,
|
|
121
|
-
dangerouslySetInnerHTML: {
|
|
122
|
-
__html: description
|
|
123
|
-
}
|
|
124
|
-
}) : null);
|
|
153
|
+
}, title)), button, /*#__PURE__*/React.createElement("div", null, children(this.handleDragStart, this.handleDragStop))), error ? /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: style.errorMessage
|
|
155
|
+
}, error) : resetContent);
|
|
125
156
|
}
|
|
126
157
|
|
|
127
158
|
}
|
|
128
159
|
|
|
129
|
-
_defineProperty(DragAndDrop, "contextTypes", {
|
|
130
|
-
skin: Provider.childContextTypes.skin
|
|
131
|
-
});
|
|
132
|
-
|
|
133
160
|
DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
134
161
|
title: PropTypes.string,
|
|
135
162
|
description: PropTypes.string,
|
|
@@ -142,7 +169,8 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
142
169
|
loading: PropTypes.bool,
|
|
143
170
|
modified: PropTypes.bool,
|
|
144
171
|
children: PropTypes.func,
|
|
145
|
-
onReset: PropTypes.func
|
|
172
|
+
onReset: PropTypes.func,
|
|
173
|
+
error: PropTypes.string
|
|
146
174
|
} : {};
|
|
147
175
|
export default DragAndDrop;
|
|
148
176
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaSolidDataTransferDataUpload1","UploadIcon","NovaLineStatusClose","Close","Provider","Loader","style","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","skin","context","brandColor","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","previewView","type","src","width","resetContent","resetUploadWrapper","resetSrcLabel","closeIcon","wrapper","previewWrapper","inputWrapper","arrow","__html","childContextTypes","propTypes","string","shape","bool","func"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,gCAAgC,IAAIC,UADtC,EAEEC,mBAAmB,IAAIC,KAFzB,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAG,UAAS,IAAT,CAArB;;A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AS,CAACmD,IAXH;AAYjBnB,EAAAA,OAAO,EAAEhC,SAAS,CAACmD;AAZF,C;AAoHrB,eAAe1C,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, get, constant} from 'lodash/fp';\nimport {\n NovaSolidDataTransferDataUpload1 as UploadIcon,\n NovaLineStatusClose as Close\n} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Loader from '../loader';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const {skin} = this.context;\n const brandColor = get('common.brand', skin);\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.previewView}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={{...style.previewView, width: '300px'}}>\n <video width=\"100%\" controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loading}>\n <Loader />\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src && onReset ? (\n <div className={style.resetUploadWrapper}>\n <div className={style.resetSrcLabel}>{previewContent.src}</div>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n <div className={modified ? style.modified : style.previewWrapper}>{previewView}</div>\n <div className={dragging ? style.dragging : style.inputWrapper} id={idBox}>\n <UploadIcon className={style.arrow} color={brandColor} />\n <div className={style.uploadLabel}>{uploadLabel}</div>\n {children(this.handleDragStart, this.handleDragStop)}\n </div>\n {resetContent}\n {description ? (\n // eslint-disable-next-line react/no-danger\n <div className={style.description} dangerouslySetInnerHTML={{__html: description}} />\n ) : null}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaLineStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","Loader","style","Button","getClassState","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","buildButton","defaultButtonProps","label","icon","position","errorButtonProps","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","errorMessage","propTypes","string","shape","bool","func"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mBAAmB,IAAIC,KADzB,EAEEC,8BAA8B,IAAIC,cAFpC,EAGEC,6BAA6B,IAAIC,qBAHnC,QAIO,0BAJP;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,MADc;AAE9B1B,IAAAA,GAAG,EAAErC,SAAS,CAAC+D;AAFe,GAAhB,CALC;AASjBjC,EAAAA,OAAO,EAAE9B,SAAS,CAACiE,IATF;AAUjBlC,EAAAA,QAAQ,EAAE/B,SAAS,CAACiE,IAVH;AAWjBzC,EAAAA,QAAQ,EAAExB,SAAS,CAACkE,IAXH;AAYjBlC,EAAAA,OAAO,EAAEhC,SAAS,CAACkE,IAZF;AAajBjC,EAAAA,KAAK,EAAEjC,SAAS,CAAC+D;AAbA,C;AA0JrB,eAAenD,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaLineStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon,\n} from '@coorpacademy/nova-icons';\nimport Loader from '../loader';\nimport style from './style.css';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = false\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme='coorpmanager'/>\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src && onReset ? (\n <div className={style.resetUploadWrapper}>\n <div className={style.resetSrcLabel}>{previewContent.src}</div>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n ) : null;\n\n \n const buildButton = (dragging, error) => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n },\n };\n if (dragging) {\n return null;\n } else if (error) {\n const errorButtonProps = {...defaultButtonProps, label: 'Try again', icon: {}}\n return <Button {...errorButtonProps} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n }\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(style.previewContainer, style.modifiedPreviewContainer, null, modified, error);\n const inputWrapper = getClassState(style.inputWrapper, style.modifiedInputWrapper, style.errorInputWrapper, modified, error);\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n {!isEmpty(previewContent) || loading ? \n <div className={previewContainer}>{previewView}</div> \n : \n <div className={dragging ? style.dragging : inputWrapper} id={idBox}>\n <div className={style.infosContainer}>\n {error ? <FileUploadBlockedIcon className={style.iconError} /> : <FileUploadIcon className={style.icon} />}\n {description ? (\n <div className={style.description}>{description}</div>\n ) : null}\n {error ? null : <div className={style.title}>{title}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n }\n {error ? <span className={style.errorMessage}>{error}</span> : resetContent}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|