@coorpacademy/components 11.11.15-alpha.10 → 11.11.15-alpha.202
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/autocomplete/index.d.ts +3 -1
- package/es/atom/autocomplete/index.d.ts.map +1 -1
- package/es/atom/autocomplete/index.js +45 -17
- package/es/atom/autocomplete/index.js.map +1 -1
- package/es/atom/autocomplete/style.css +150 -1
- package/es/atom/avatar/style.css +1 -1
- package/es/atom/battle-opponent/index.d.ts.map +1 -1
- package/es/atom/battle-opponent/index.js +4 -2
- package/es/atom/battle-opponent/index.js.map +1 -1
- package/es/atom/battle-opponent/style.css +12 -0
- package/es/atom/button/index.d.ts +14 -3
- package/es/atom/button/index.d.ts.map +1 -1
- package/es/atom/button/index.js +77 -39
- package/es/atom/button/index.js.map +1 -1
- package/es/atom/button/index.native.d.ts.map +1 -1
- package/es/atom/button/index.native.js +6 -1
- package/es/atom/button/index.native.js.map +1 -1
- package/es/atom/button-link/index.d.ts +23 -22
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +23 -35
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +1 -1
- package/es/atom/button-link/types.d.ts +50 -0
- package/es/atom/button-link/types.d.ts.map +1 -0
- package/es/atom/button-link/types.js +25 -0
- package/es/atom/button-link/types.js.map +1 -0
- package/es/atom/button-link-icon-only/index.d.ts.map +1 -1
- package/es/atom/button-link-icon-only/index.js +1 -0
- package/es/atom/button-link-icon-only/index.js.map +1 -1
- package/es/atom/button-link-icon-only/style.css +16 -1
- package/es/atom/button-menu/index.d.ts +14 -13
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +5 -13
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/types.d.ts +35 -0
- package/es/atom/button-menu/types.d.ts.map +1 -0
- package/es/atom/button-menu/types.js +14 -0
- package/es/atom/button-menu/types.js.map +1 -0
- package/es/atom/choice/index.native.d.ts.map +1 -1
- package/es/atom/choice/index.native.js +2 -1
- package/es/atom/choice/index.native.js.map +1 -1
- package/es/atom/cta/index.d.ts +36 -60
- package/es/atom/cta/index.d.ts.map +1 -1
- package/es/atom/cta/index.js +55 -94
- package/es/atom/cta/index.js.map +1 -1
- package/es/atom/cta/prop-types.d.ts +40 -0
- package/es/atom/cta/prop-types.d.ts.map +1 -0
- package/es/atom/cta/prop-types.js +22 -0
- package/es/atom/cta/prop-types.js.map +1 -0
- package/es/atom/difficulty-level/style.css +1 -1
- package/es/atom/drag-and-drop/index.d.ts +2 -0
- package/es/atom/drag-and-drop/index.d.ts.map +1 -1
- package/es/atom/drag-and-drop/index.js +55 -19
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +25 -8
- package/es/atom/html/index.native.js +2 -2
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/image-upload/index.d.ts +5 -1
- package/es/atom/image-upload/index.d.ts.map +1 -1
- package/es/atom/image-upload/index.js +10 -12
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/image-upload/style.css +8 -1
- package/es/atom/input-html/index.d.ts +34 -23
- package/es/atom/input-html/index.d.ts.map +1 -1
- package/es/atom/input-html/index.js +63 -94
- package/es/atom/input-html/index.js.map +1 -1
- package/es/atom/input-html/input-preview.d.ts.map +1 -1
- package/es/atom/input-html/input-preview.js +2 -0
- package/es/atom/input-html/input-preview.js.map +1 -1
- package/es/atom/input-textarea/index.d.ts.map +1 -1
- package/es/atom/input-textarea/index.js +2 -1
- package/es/atom/input-textarea/index.js.map +1 -1
- package/es/atom/link/index.d.ts +2 -0
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +18 -11
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +2 -0
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select-modal/index.native.d.ts.map +1 -1
- package/es/atom/select-modal/index.native.js +4 -5
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/atom/slide/index.d.ts +2 -0
- package/es/atom/status-item/style.css +3 -0
- package/es/atom/text/index.native.d.ts +3 -6
- package/es/atom/text/index.native.d.ts.map +1 -1
- package/es/atom/text/index.native.js +11 -11
- package/es/atom/text/index.native.js.map +1 -1
- package/es/atom/tooltip/index.d.ts +5 -1
- package/es/atom/tooltip/index.d.ts.map +1 -1
- package/es/atom/tooltip/index.js +37 -18
- package/es/atom/tooltip/index.js.map +1 -1
- package/es/atom/tooltip/style.css +1 -1
- package/es/atom/video-upload/index.d.ts +2 -0
- package/es/globals.d.js.map +1 -1
- package/es/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/es/hoc/modal/select-item/index.native.js +4 -2
- package/es/hoc/modal/select-item/index.native.js.map +1 -1
- package/es/hoc/transition/child-prop-types.d.ts +16 -0
- package/es/hoc/transition/child-prop-types.d.ts.map +1 -0
- package/es/hoc/transition/child-prop-types.js +9 -0
- package/es/hoc/transition/child-prop-types.js.map +1 -0
- package/es/hoc/transition/index.d.ts +14 -9
- package/es/hoc/transition/index.d.ts.map +1 -1
- package/es/hoc/transition/index.js +34 -30
- package/es/hoc/transition/index.js.map +1 -1
- package/es/hoc/transition/transition-prop-types.d.ts +20 -0
- package/es/hoc/transition/transition-prop-types.d.ts.map +1 -0
- package/es/hoc/transition/transition-prop-types.js +12 -0
- package/es/hoc/transition/transition-prop-types.js.map +1 -0
- package/es/molecule/add-to-my-list/index.d.ts.map +1 -1
- package/es/molecule/add-to-my-list/index.js +2 -0
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- package/es/molecule/audio/index.d.ts.map +1 -1
- package/es/molecule/audio/index.js +1 -0
- package/es/molecule/audio/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +21 -4
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +14 -2
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +29 -7
- package/es/molecule/bullet-point-menu-button/index.d.ts +20 -17
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +9 -11
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +20 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts +31 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -0
- package/es/molecule/bullet-point-menu-button/types.js +13 -0
- package/es/molecule/bullet-point-menu-button/types.js.map +1 -0
- package/es/molecule/card/customer.js +1 -1
- package/es/molecule/card/customer.js.map +1 -1
- package/es/molecule/card/favorite.css +15 -35
- package/es/molecule/card/favorite.d.ts +15 -9
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +103 -62
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/selectable.js +1 -1
- package/es/molecule/card/selectable.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +2 -2
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +32 -17
- package/es/molecule/course-section/style.css +4 -6
- package/es/molecule/discipline-header/index.d.ts +2 -1
- package/es/molecule/discipline-header/index.d.ts.map +1 -1
- package/es/molecule/discipline-header/index.js +29 -14
- package/es/molecule/discipline-header/index.js.map +1 -1
- package/es/molecule/discipline-header/style.css +36 -9
- package/es/molecule/drag-and-drop/index.js +3 -1
- package/es/molecule/drag-and-drop/index.js.map +1 -1
- package/es/molecule/drag-and-drop/overlay.d.ts.map +1 -1
- package/es/molecule/drag-and-drop/overlay.js +2 -1
- package/es/molecule/drag-and-drop/overlay.js.map +1 -1
- package/es/molecule/drag-and-drop/upload-report.d.ts.map +1 -1
- package/es/molecule/drag-and-drop/upload-report.js +1 -0
- package/es/molecule/drag-and-drop/upload-report.js.map +1 -1
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/es/molecule/draggable/index.d.ts.map +1 -1
- package/es/molecule/draggable/index.js +1 -0
- package/es/molecule/draggable/index.js.map +1 -1
- package/es/molecule/draggable/style.css +9 -5
- package/es/molecule/draggable-list/index.d.ts +50 -2
- package/es/molecule/draggable-list/index.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.js +7 -4
- package/es/molecule/draggable-list/index.js.map +1 -1
- package/es/molecule/empty-state-dashboard/index.d.ts +1 -1
- package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -1
- package/es/molecule/empty-state-dashboard/index.js +2 -2
- package/es/molecule/empty-state-dashboard/index.js.map +1 -1
- package/es/molecule/empty-state-dashboard/types.d.ts +8 -0
- package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -1
- package/es/molecule/empty-state-dashboard/types.js.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +103 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -0
- package/es/molecule/expandible-actionable-table/index.js +194 -0
- package/es/molecule/expandible-actionable-table/index.js.map +1 -0
- package/es/molecule/expandible-actionable-table/style.css +134 -0
- package/es/molecule/expandible-actionable-table/types.d.ts +116 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -0
- package/es/molecule/expandible-actionable-table/types.js +33 -0
- package/es/molecule/expandible-actionable-table/types.js.map +1 -0
- package/es/molecule/external-content-button/index.d.ts.map +1 -1
- package/es/molecule/external-content-button/index.js +2 -1
- package/es/molecule/external-content-button/index.js.map +1 -1
- package/es/molecule/news/index.d.ts +2 -0
- package/es/molecule/questions/free-text/index.d.ts.map +1 -1
- package/es/molecule/questions/free-text/index.js +1 -0
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.d.ts.map +1 -1
- package/es/molecule/questions/mobile/slider/index.native.js +6 -4
- package/es/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +3 -1
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +4 -1
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +6 -3
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +2 -1
- package/es/molecule/questions/question-range/index.js +2 -1
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +2 -1
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.js +38 -14
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.native.js +12 -2
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/molecule/review-correction-popin/style.css +11 -53
- package/es/molecule/scope-tabs/index.js +2 -1
- package/es/molecule/scope-tabs/index.js.map +1 -1
- package/es/molecule/select-multiple/index.d.ts.map +1 -1
- package/es/molecule/select-multiple/index.js +7 -7
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts.map +1 -1
- package/es/molecule/setup-slider/index.js +4 -1
- package/es/molecule/setup-slider/index.js.map +1 -1
- package/es/molecule/setup-slider/style.css +3 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/es/molecule/uploading-file-progress/index.d.ts +1 -1
- package/es/molecule/uploading-file-progress/index.d.ts.map +1 -1
- package/es/molecule/uploading-file-progress/index.js.map +1 -1
- package/es/molecule/uploading-file-progress/types.d.ts +10 -1
- package/es/molecule/uploading-file-progress/types.d.ts.map +1 -1
- package/es/molecule/uploading-file-progress/types.js.map +1 -1
- package/es/organism/brand-form/index.d.ts +21 -4
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +1 -8
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/brand-form/style.css +0 -13
- package/es/organism/course-selection/style.css +1 -0
- package/es/organism/list-item/index.d.ts +2 -0
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +8 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +6 -4
- package/es/organism/list-items/index.d.ts +121 -23
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +63 -14
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/list-items/style.css +17 -0
- package/es/organism/mobile-intro-popin/index.native.d.ts +20 -0
- package/es/organism/mobile-intro-popin/index.native.d.ts.map +1 -0
- package/es/organism/mobile-intro-popin/index.native.js +152 -0
- package/es/organism/mobile-intro-popin/index.native.js.map +1 -0
- package/es/organism/mooc/image-slider/index.d.ts +2 -0
- package/es/organism/mooc-footer/index.js +1 -1
- package/es/organism/mooc-footer/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts +3 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +6 -2
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +0 -1
- package/es/organism/review-skills/index.native.js +1 -1
- package/es/organism/review-skills/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +39 -18
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/rewards-form/index.d.ts +2 -0
- package/es/organism/sidebar/index.d.ts +2 -0
- package/es/organism/sidebar/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +94 -4
- package/es/organism/wizard-contents/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.js +7 -1
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/template/activity/engine-stars.d.ts.map +1 -1
- package/es/template/activity/engine-stars.js +2 -1
- package/es/template/activity/engine-stars.js.map +1 -1
- package/es/template/activity/stars-summary.css +5 -3
- package/es/template/activity/stars-summary.d.ts.map +1 -1
- package/es/template/activity/stars-summary.js +3 -2
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/app-player/player/index.d.ts +2 -0
- package/es/template/app-player/player/slides/footer/index.js +1 -1
- package/es/template/app-player/player/slides/footer/index.js.map +1 -1
- package/es/template/app-player/player/slides/header/index.js +2 -1
- package/es/template/app-player/player/slides/header/index.js.map +1 -1
- package/es/template/app-player/player/slides/header/microlearning.css +10 -0
- package/es/template/app-player/player/slides/header/microlearning.d.ts +1 -0
- package/es/template/app-player/player/slides/header/microlearning.d.ts.map +1 -1
- package/es/template/app-player/player/slides/header/microlearning.js +34 -18
- package/es/template/app-player/player/slides/header/microlearning.js.map +1 -1
- package/es/template/app-player/player/slides/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +1 -0
- package/es/template/app-player/popin-end/summary.d.ts +1 -0
- package/es/template/app-player/popin-header/index.d.ts +1 -0
- package/es/template/app-player/popin-header/index.d.ts.map +1 -1
- package/es/template/app-review/index.native.d.ts.map +1 -1
- package/es/template/app-review/index.native.js +3 -3
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +298 -773
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +14 -1
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/cockpit/jw-uploader/index.d.ts +2 -0
- package/es/template/common/discipline/index.d.ts.map +1 -1
- package/es/template/common/discipline/index.js +4 -2
- package/es/template/common/discipline/index.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +14 -3
- package/es/template/external-course/index.d.ts +18 -22
- package/es/template/external-course/index.d.ts.map +1 -1
- package/es/template/external-course/index.js +67 -57
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/mobile-login/confirm-email-sent/index.native.d.ts +13 -0
- package/es/template/mobile-login/confirm-email-sent/index.native.d.ts.map +1 -0
- package/es/template/mobile-login/confirm-email-sent/index.native.js +214 -0
- package/es/template/mobile-login/confirm-email-sent/index.native.js.map +1 -0
- package/es/template/mobile-login/qr-code-scanner/index.native.d.ts +16 -0
- package/es/template/mobile-login/qr-code-scanner/index.native.d.ts.map +1 -0
- package/es/template/mobile-login/qr-code-scanner/index.native.js +351 -0
- package/es/template/mobile-login/qr-code-scanner/index.native.js.map +1 -0
- package/es/template/mobile-login/receive-email/index.native.d.ts +14 -0
- package/es/template/mobile-login/receive-email/index.native.d.ts.map +1 -0
- package/es/template/mobile-login/receive-email/index.native.js +204 -0
- package/es/template/mobile-login/receive-email/index.native.js.map +1 -0
- package/es/template/mobile-login/welcome/index.native.d.ts +18 -0
- package/es/template/mobile-login/welcome/index.native.d.ts.map +1 -0
- package/es/template/mobile-login/welcome/index.native.js +290 -0
- package/es/template/mobile-login/welcome/index.native.js.map +1 -0
- package/es/template/teams-dashboard/index.d.ts +2 -0
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/es/util/proptypes.d.ts.map +1 -1
- package/es/util/proptypes.js +2 -2
- package/es/util/proptypes.js.map +1 -1
- package/es/util/use-mobile-keyboard-visibility.d.ts +3 -0
- package/es/util/use-mobile-keyboard-visibility.d.ts.map +1 -0
- package/es/util/use-mobile-keyboard-visibility.js +22 -0
- package/es/util/use-mobile-keyboard-visibility.js.map +1 -0
- package/lib/atom/autocomplete/index.d.ts +3 -1
- package/lib/atom/autocomplete/index.d.ts.map +1 -1
- package/lib/atom/autocomplete/index.js +48 -16
- package/lib/atom/autocomplete/index.js.map +1 -1
- package/lib/atom/autocomplete/style.css +150 -1
- package/lib/atom/avatar/style.css +1 -1
- package/lib/atom/battle-opponent/index.d.ts.map +1 -1
- package/lib/atom/battle-opponent/index.js +4 -2
- package/lib/atom/battle-opponent/index.js.map +1 -1
- package/lib/atom/battle-opponent/style.css +12 -0
- package/lib/atom/button/index.d.ts +14 -3
- package/lib/atom/button/index.d.ts.map +1 -1
- package/lib/atom/button/index.js +82 -39
- package/lib/atom/button/index.js.map +1 -1
- package/lib/atom/button/index.native.d.ts.map +1 -1
- package/lib/atom/button/index.native.js +6 -1
- package/lib/atom/button/index.native.js.map +1 -1
- package/lib/atom/button-link/index.d.ts +23 -22
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +24 -37
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +1 -1
- package/lib/atom/button-link/types.d.ts +50 -0
- package/lib/atom/button-link/types.d.ts.map +1 -0
- package/lib/atom/button-link/types.js +36 -0
- package/lib/atom/button-link/types.js.map +1 -0
- package/lib/atom/button-link-icon-only/index.d.ts.map +1 -1
- package/lib/atom/button-link-icon-only/index.js +1 -0
- package/lib/atom/button-link-icon-only/index.js.map +1 -1
- package/lib/atom/button-link-icon-only/style.css +16 -1
- package/lib/atom/button-menu/index.d.ts +14 -13
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +6 -14
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/types.d.ts +35 -0
- package/lib/atom/button-menu/types.d.ts.map +1 -0
- package/lib/atom/button-menu/types.js +24 -0
- package/lib/atom/button-menu/types.js.map +1 -0
- package/lib/atom/choice/index.native.d.ts.map +1 -1
- package/lib/atom/choice/index.native.js +2 -1
- package/lib/atom/choice/index.native.js.map +1 -1
- package/lib/atom/cta/index.d.ts +36 -60
- package/lib/atom/cta/index.d.ts.map +1 -1
- package/lib/atom/cta/index.js +61 -95
- package/lib/atom/cta/index.js.map +1 -1
- package/lib/atom/cta/prop-types.d.ts +40 -0
- package/lib/atom/cta/prop-types.d.ts.map +1 -0
- package/lib/atom/cta/prop-types.js +32 -0
- package/lib/atom/cta/prop-types.js.map +1 -0
- package/lib/atom/difficulty-level/style.css +1 -1
- package/lib/atom/drag-and-drop/index.d.ts +2 -0
- package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
- package/lib/atom/drag-and-drop/index.js +55 -19
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +25 -8
- package/lib/atom/html/index.native.js +2 -2
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/image-upload/index.d.ts +5 -1
- package/lib/atom/image-upload/index.d.ts.map +1 -1
- package/lib/atom/image-upload/index.js +10 -13
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/image-upload/style.css +8 -1
- package/lib/atom/input-html/index.d.ts +34 -23
- package/lib/atom/input-html/index.d.ts.map +1 -1
- package/lib/atom/input-html/index.js +67 -94
- package/lib/atom/input-html/index.js.map +1 -1
- package/lib/atom/input-html/input-preview.d.ts.map +1 -1
- package/lib/atom/input-html/input-preview.js +2 -0
- package/lib/atom/input-html/input-preview.js.map +1 -1
- package/lib/atom/input-textarea/index.d.ts.map +1 -1
- package/lib/atom/input-textarea/index.js +2 -1
- package/lib/atom/input-textarea/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +2 -0
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +18 -11
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +2 -0
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select-modal/index.native.d.ts.map +1 -1
- package/lib/atom/select-modal/index.native.js +4 -5
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/atom/slide/index.d.ts +2 -0
- package/lib/atom/status-item/style.css +3 -0
- package/lib/atom/text/index.native.d.ts +3 -6
- package/lib/atom/text/index.native.d.ts.map +1 -1
- package/lib/atom/text/index.native.js +13 -17
- package/lib/atom/text/index.native.js.map +1 -1
- package/lib/atom/tooltip/index.d.ts +5 -1
- package/lib/atom/tooltip/index.d.ts.map +1 -1
- package/lib/atom/tooltip/index.js +39 -18
- package/lib/atom/tooltip/index.js.map +1 -1
- package/lib/atom/tooltip/style.css +1 -1
- package/lib/atom/video-upload/index.d.ts +2 -0
- package/lib/globals.d.js.map +1 -1
- package/lib/hoc/modal/select-item/index.native.d.ts.map +1 -1
- package/lib/hoc/modal/select-item/index.native.js +4 -2
- package/lib/hoc/modal/select-item/index.native.js.map +1 -1
- package/lib/hoc/transition/child-prop-types.d.ts +16 -0
- package/lib/hoc/transition/child-prop-types.d.ts.map +1 -0
- package/lib/hoc/transition/child-prop-types.js +18 -0
- package/lib/hoc/transition/child-prop-types.js.map +1 -0
- package/lib/hoc/transition/index.d.ts +14 -9
- package/lib/hoc/transition/index.d.ts.map +1 -1
- package/lib/hoc/transition/index.js +35 -30
- package/lib/hoc/transition/index.js.map +1 -1
- package/lib/hoc/transition/transition-prop-types.d.ts +20 -0
- package/lib/hoc/transition/transition-prop-types.d.ts.map +1 -0
- package/lib/hoc/transition/transition-prop-types.js +21 -0
- package/lib/hoc/transition/transition-prop-types.js.map +1 -0
- package/lib/molecule/add-to-my-list/index.d.ts.map +1 -1
- package/lib/molecule/add-to-my-list/index.js +2 -0
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- package/lib/molecule/audio/index.d.ts.map +1 -1
- package/lib/molecule/audio/index.js +1 -0
- package/lib/molecule/audio/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +21 -4
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +18 -2
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +29 -7
- package/lib/molecule/bullet-point-menu-button/index.d.ts +20 -17
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +10 -11
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +20 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts +31 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -0
- package/lib/molecule/bullet-point-menu-button/types.js +23 -0
- package/lib/molecule/bullet-point-menu-button/types.js.map +1 -0
- package/lib/molecule/card/customer.js +1 -1
- package/lib/molecule/card/customer.js.map +1 -1
- package/lib/molecule/card/favorite.css +15 -35
- package/lib/molecule/card/favorite.d.ts +15 -9
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +114 -65
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/selectable.js +1 -1
- package/lib/molecule/card/selectable.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +2 -2
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +32 -17
- package/lib/molecule/course-section/style.css +4 -6
- package/lib/molecule/discipline-header/index.d.ts +2 -1
- package/lib/molecule/discipline-header/index.d.ts.map +1 -1
- package/lib/molecule/discipline-header/index.js +30 -14
- package/lib/molecule/discipline-header/index.js.map +1 -1
- package/lib/molecule/discipline-header/style.css +36 -9
- package/lib/molecule/drag-and-drop/index.js +3 -1
- package/lib/molecule/drag-and-drop/index.js.map +1 -1
- package/lib/molecule/drag-and-drop/overlay.d.ts.map +1 -1
- package/lib/molecule/drag-and-drop/overlay.js +2 -1
- package/lib/molecule/drag-and-drop/overlay.js.map +1 -1
- package/lib/molecule/drag-and-drop/upload-report.d.ts.map +1 -1
- package/lib/molecule/drag-and-drop/upload-report.js +1 -0
- package/lib/molecule/drag-and-drop/upload-report.js.map +1 -1
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/lib/molecule/draggable/index.d.ts.map +1 -1
- package/lib/molecule/draggable/index.js +1 -0
- package/lib/molecule/draggable/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +9 -5
- package/lib/molecule/draggable-list/index.d.ts +50 -2
- package/lib/molecule/draggable-list/index.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.js +8 -4
- package/lib/molecule/draggable-list/index.js.map +1 -1
- package/lib/molecule/empty-state-dashboard/index.d.ts +1 -1
- package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -1
- package/lib/molecule/empty-state-dashboard/index.js +2 -2
- package/lib/molecule/empty-state-dashboard/index.js.map +1 -1
- package/lib/molecule/empty-state-dashboard/types.d.ts +8 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -1
- package/lib/molecule/empty-state-dashboard/types.js.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +103 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -0
- package/lib/molecule/expandible-actionable-table/index.js +216 -0
- package/lib/molecule/expandible-actionable-table/index.js.map +1 -0
- package/lib/molecule/expandible-actionable-table/style.css +134 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts +116 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -0
- package/lib/molecule/expandible-actionable-table/types.js +47 -0
- package/lib/molecule/expandible-actionable-table/types.js.map +1 -0
- package/lib/molecule/external-content-button/index.d.ts.map +1 -1
- package/lib/molecule/external-content-button/index.js +2 -1
- package/lib/molecule/external-content-button/index.js.map +1 -1
- package/lib/molecule/news/index.d.ts +2 -0
- package/lib/molecule/questions/free-text/index.d.ts.map +1 -1
- package/lib/molecule/questions/free-text/index.js +1 -0
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/mobile/slider/index.native.js +6 -4
- package/lib/molecule/questions/mobile/slider/index.native.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +3 -1
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +4 -1
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +6 -3
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +2 -1
- package/lib/molecule/questions/question-range/index.js +2 -1
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +2 -1
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.js +44 -14
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.js +12 -2
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/molecule/review-correction-popin/style.css +11 -53
- package/lib/molecule/scope-tabs/index.js +4 -1
- package/lib/molecule/scope-tabs/index.js.map +1 -1
- package/lib/molecule/select-multiple/index.d.ts.map +1 -1
- package/lib/molecule/select-multiple/index.js +7 -7
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts.map +1 -1
- package/lib/molecule/setup-slider/index.js +5 -1
- package/lib/molecule/setup-slider/index.js.map +1 -1
- package/lib/molecule/setup-slider/style.css +3 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/lib/molecule/uploading-file-progress/index.d.ts +1 -1
- package/lib/molecule/uploading-file-progress/index.d.ts.map +1 -1
- package/lib/molecule/uploading-file-progress/index.js.map +1 -1
- package/lib/molecule/uploading-file-progress/types.d.ts +10 -1
- package/lib/molecule/uploading-file-progress/types.d.ts.map +1 -1
- package/lib/molecule/uploading-file-progress/types.js.map +1 -1
- package/lib/organism/brand-form/index.d.ts +21 -4
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +1 -9
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/brand-form/style.css +0 -13
- package/lib/organism/course-selection/style.css +1 -0
- package/lib/organism/list-item/index.d.ts +2 -0
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +8 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +6 -4
- package/lib/organism/list-items/index.d.ts +121 -23
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +66 -14
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/list-items/style.css +17 -0
- package/lib/organism/mobile-intro-popin/index.native.d.ts +20 -0
- package/lib/organism/mobile-intro-popin/index.native.d.ts.map +1 -0
- package/lib/organism/mobile-intro-popin/index.native.js +169 -0
- package/lib/organism/mobile-intro-popin/index.native.js.map +1 -0
- package/lib/organism/mooc/image-slider/index.d.ts +2 -0
- package/lib/organism/mooc-footer/index.js +1 -1
- package/lib/organism/mooc-footer/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts +3 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +6 -2
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +0 -1
- package/lib/organism/review-skills/index.native.js +1 -1
- package/lib/organism/review-skills/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +39 -17
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +2 -0
- package/lib/organism/sidebar/index.d.ts +2 -0
- package/lib/organism/sidebar/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +94 -4
- package/lib/organism/wizard-contents/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.js +8 -1
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/template/activity/engine-stars.d.ts.map +1 -1
- package/lib/template/activity/engine-stars.js +2 -1
- package/lib/template/activity/engine-stars.js.map +1 -1
- package/lib/template/activity/stars-summary.css +5 -3
- package/lib/template/activity/stars-summary.d.ts.map +1 -1
- package/lib/template/activity/stars-summary.js +3 -2
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/app-player/player/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/footer/index.js +1 -1
- package/lib/template/app-player/player/slides/footer/index.js.map +1 -1
- package/lib/template/app-player/player/slides/header/index.js +2 -1
- package/lib/template/app-player/player/slides/header/index.js.map +1 -1
- package/lib/template/app-player/player/slides/header/microlearning.css +10 -0
- package/lib/template/app-player/player/slides/header/microlearning.d.ts +1 -0
- package/lib/template/app-player/player/slides/header/microlearning.d.ts.map +1 -1
- package/lib/template/app-player/player/slides/header/microlearning.js +35 -18
- package/lib/template/app-player/player/slides/header/microlearning.js.map +1 -1
- package/lib/template/app-player/player/slides/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +1 -0
- package/lib/template/app-player/popin-end/summary.d.ts +1 -0
- package/lib/template/app-player/popin-header/index.d.ts +1 -0
- package/lib/template/app-player/popin-header/index.d.ts.map +1 -1
- package/lib/template/app-review/index.native.d.ts.map +1 -1
- package/lib/template/app-review/index.native.js +2 -2
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +298 -773
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +15 -1
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/cockpit/jw-uploader/index.d.ts +2 -0
- package/lib/template/common/discipline/index.d.ts.map +1 -1
- package/lib/template/common/discipline/index.js +4 -2
- package/lib/template/common/discipline/index.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +14 -3
- package/lib/template/external-course/index.d.ts +18 -22
- package/lib/template/external-course/index.d.ts.map +1 -1
- package/lib/template/external-course/index.js +70 -55
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/mobile-login/confirm-email-sent/index.native.d.ts +13 -0
- package/lib/template/mobile-login/confirm-email-sent/index.native.d.ts.map +1 -0
- package/lib/template/mobile-login/confirm-email-sent/index.native.js +234 -0
- package/lib/template/mobile-login/confirm-email-sent/index.native.js.map +1 -0
- package/lib/template/mobile-login/qr-code-scanner/index.native.d.ts +16 -0
- package/lib/template/mobile-login/qr-code-scanner/index.native.d.ts.map +1 -0
- package/lib/template/mobile-login/qr-code-scanner/index.native.js +375 -0
- package/lib/template/mobile-login/qr-code-scanner/index.native.js.map +1 -0
- package/lib/template/mobile-login/receive-email/index.native.d.ts +14 -0
- package/lib/template/mobile-login/receive-email/index.native.d.ts.map +1 -0
- package/lib/template/mobile-login/receive-email/index.native.js +223 -0
- package/lib/template/mobile-login/receive-email/index.native.js.map +1 -0
- package/lib/template/mobile-login/welcome/index.native.d.ts +18 -0
- package/lib/template/mobile-login/welcome/index.native.d.ts.map +1 -0
- package/lib/template/mobile-login/welcome/index.native.js +311 -0
- package/lib/template/mobile-login/welcome/index.native.js.map +1 -0
- package/lib/template/teams-dashboard/index.d.ts +2 -0
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/lib/util/proptypes.d.ts.map +1 -1
- package/lib/util/proptypes.js +2 -2
- package/lib/util/proptypes.js.map +1 -1
- package/lib/util/use-mobile-keyboard-visibility.d.ts +3 -0
- package/lib/util/use-mobile-keyboard-visibility.d.ts.map +1 -0
- package/lib/util/use-mobile-keyboard-visibility.js +31 -0
- package/lib/util/use-mobile-keyboard-visibility.js.map +1 -0
- package/locales/.mtslconfig.json +1 -0
- package/locales/bs/global.json +4 -1
- package/locales/cs/global.json +4 -1
- package/locales/de/global.json +4 -1
- package/locales/en/global.json +3 -1
- package/locales/es/global.json +4 -1
- package/locales/et/global.json +4 -1
- package/locales/fr/global.json +4 -1
- package/locales/hr/global.json +4 -1
- package/locales/hu/global.json +4 -1
- package/locales/hy/global.json +4 -1
- package/locales/it/global.json +4 -1
- package/locales/ja/global.json +4 -1
- package/locales/ko/global.json +4 -1
- package/locales/nl/global.json +4 -1
- package/locales/pl/global.json +4 -1
- package/locales/pt/global.json +4 -1
- package/locales/ro/global.json +4 -1
- package/locales/ru/global.json +4 -1
- package/locales/sk/global.json +4 -1
- package/locales/th/global.json +4 -1
- package/locales/tl/global.json +4 -1
- package/locales/tr/global.json +4 -1
- package/locales/uk/global.json +4 -1
- package/locales/vi/global.json +4 -1
- package/locales/zh/global.json +4 -1
- package/locales/zh_TW/global.json +4 -1
- package/package.json +6 -3
- package/es/organism/podcast-popin-intro/index.native.d.ts +0 -10
- package/es/organism/podcast-popin-intro/index.native.d.ts.map +0 -1
- package/es/organism/podcast-popin-intro/index.native.js +0 -114
- package/es/organism/podcast-popin-intro/index.native.js.map +0 -1
- package/lib/organism/podcast-popin-intro/index.native.d.ts +0 -10
- package/lib/organism/podcast-popin-intro/index.native.d.ts.map +0 -1
- package/lib/organism/podcast-popin-intro/index.native.js +0 -131
- package/lib/organism/podcast-popin-intro/index.native.js.map +0 -1
|
@@ -9,11 +9,13 @@ declare namespace Autocomplete {
|
|
|
9
9
|
const required: PropTypes.Requireable<boolean>;
|
|
10
10
|
const modified: PropTypes.Requireable<boolean>;
|
|
11
11
|
const error: PropTypes.Requireable<boolean>;
|
|
12
|
+
const errorMessage: PropTypes.Requireable<string>;
|
|
12
13
|
const suggestions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
13
14
|
name: PropTypes.Requireable<string>;
|
|
14
15
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
15
16
|
}> | null | undefined)[]>;
|
|
16
|
-
const
|
|
17
|
+
const theme: PropTypes.Requireable<string>;
|
|
18
|
+
const onInput: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
19
|
const onFetch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
20
|
const onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
21
|
const onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";AAgBA,uDA8FC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
2
|
+
import _isEmpty from "lodash/fp/isEmpty";
|
|
1
3
|
import _isNil from "lodash/fp/isNil";
|
|
2
4
|
import _noop from "lodash/fp/noop";
|
|
3
|
-
import React, { useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
6
|
import Autosuggest from 'react-autosuggest';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import classnames from 'classnames';
|
|
9
|
+
import { NovaSolidStatusClose as ErrorIcon } from '@coorpacademy/nova-icons';
|
|
7
10
|
import getClassState from '../../util/get-class-state';
|
|
8
11
|
import style from './style.css';
|
|
12
|
+
const THEME_STYLE = {
|
|
13
|
+
coorpmanager: style.coorpmanager,
|
|
14
|
+
default: style.default
|
|
15
|
+
};
|
|
9
16
|
|
|
10
17
|
const renderSuggestion = suggestion => /*#__PURE__*/React.createElement("span", null, suggestion.name);
|
|
11
18
|
|
|
@@ -17,32 +24,51 @@ const Autocomplete = props => {
|
|
|
17
24
|
required,
|
|
18
25
|
modified = false,
|
|
19
26
|
error = false,
|
|
27
|
+
errorMessage,
|
|
20
28
|
suggestions = [],
|
|
21
|
-
|
|
29
|
+
onInput = _noop,
|
|
22
30
|
onFetch = _noop,
|
|
23
31
|
onClear = _noop,
|
|
24
32
|
onBlur = _noop,
|
|
25
33
|
onSuggestionSelected = _noop,
|
|
26
|
-
title: propsTitle
|
|
34
|
+
title: propsTitle,
|
|
35
|
+
theme = 'default'
|
|
27
36
|
} = props;
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
37
|
+
const mainClass = THEME_STYLE[theme];
|
|
38
|
+
const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);
|
|
39
|
+
const className = useMemo(() => getClassState(style.default, style.modified, style.error, modified, error), [modified, error]);
|
|
40
|
+
const handleInput = useCallback(e => {
|
|
41
|
+
onInput(e);
|
|
42
|
+
}, [onInput]);
|
|
43
|
+
const handleBlur = useCallback((e, selectedSuggestion) => onBlur(e, selectedSuggestion), [onBlur]);
|
|
44
|
+
const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);
|
|
45
|
+
const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);
|
|
46
|
+
const handleSuggestionsSelected = useCallback((e, data) => onSuggestionSelected(data), [onSuggestionSelected]);
|
|
35
47
|
const inputProps = {
|
|
36
48
|
placeholder,
|
|
37
49
|
value,
|
|
38
|
-
onChange:
|
|
39
|
-
onBlur: handleBlur
|
|
50
|
+
onChange: _noop,
|
|
51
|
+
onBlur: handleBlur,
|
|
52
|
+
onInput: handleInput,
|
|
53
|
+
'data-testid': 'autocomplete-input'
|
|
40
54
|
};
|
|
55
|
+
const errorIconView = theme === 'coorpmanager' && error ? /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
56
|
+
className: style.leftIcon
|
|
57
|
+
}) : null;
|
|
58
|
+
const errorText = theme === 'coorpmanager' && error ? /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: style.errorText // eslint-disable-next-line react/no-danger
|
|
60
|
+
,
|
|
61
|
+
dangerouslySetInnerHTML: {
|
|
62
|
+
__html: errorMessage
|
|
63
|
+
}
|
|
64
|
+
}) : null;
|
|
41
65
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: classnames(className, _isNil(
|
|
66
|
+
className: classnames(mainClass, className, _isNil(propsTitle) && style.isNoTitle)
|
|
43
67
|
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
44
|
-
className: style.title
|
|
45
|
-
}, title), /*#__PURE__*/React.createElement("div",
|
|
68
|
+
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
69
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: style.inputContainer
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Autosuggest, {
|
|
46
72
|
theme: {
|
|
47
73
|
container: style.container,
|
|
48
74
|
input: style.input,
|
|
@@ -60,7 +86,7 @@ const Autocomplete = props => {
|
|
|
60
86
|
inputProps: inputProps,
|
|
61
87
|
focusInputOnSuggestionClick: false,
|
|
62
88
|
onSuggestionSelected: handleSuggestionsSelected
|
|
63
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
}), errorIconView, errorText)), /*#__PURE__*/React.createElement("div", {
|
|
64
90
|
className: style.description
|
|
65
91
|
}, description));
|
|
66
92
|
};
|
|
@@ -73,11 +99,13 @@ Autocomplete.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
73
99
|
required: PropTypes.bool,
|
|
74
100
|
modified: PropTypes.bool,
|
|
75
101
|
error: PropTypes.bool,
|
|
102
|
+
errorMessage: PropTypes.string,
|
|
76
103
|
suggestions: PropTypes.arrayOf(PropTypes.shape({
|
|
77
104
|
name: PropTypes.string,
|
|
78
105
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
79
106
|
})),
|
|
80
|
-
|
|
107
|
+
theme: PropTypes.oneOf(_keys(THEME_STYLE)),
|
|
108
|
+
onInput: PropTypes.func,
|
|
81
109
|
onFetch: PropTypes.func,
|
|
82
110
|
onClear: PropTypes.func,
|
|
83
111
|
onBlur: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","Autosuggest","PropTypes","classnames","getClassState","style","renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","suggestions","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","Autosuggest","PropTypes","classnames","NovaSolidStatusClose","ErrorIcon","getClassState","style","THEME_STYLE","coorpmanager","default","renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","onFetch","onClear","onBlur","onSuggestionSelected","title","propsTitle","theme","mainClass","className","handleInput","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","errorIconView","leftIcon","errorText","__html","isNoTitle","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","propTypes","string","bool","arrayOf","shape","oneOfType","number","oneOf","func"],"sources":["../../../src/atom/autocomplete/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport Autosuggest from 'react-autosuggest';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {noop, isNil, isEmpty, keys} from 'lodash/fp';\nimport {NovaSolidStatusClose as ErrorIcon} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst THEME_STYLE = {\n coorpmanager: style.coorpmanager,\n default: style.default\n};\n\nconst renderSuggestion = suggestion => <span>{suggestion.name}</span>;\n\nconst Autocomplete = props => {\n const {\n placeholder = '',\n value,\n description,\n required,\n modified = false,\n error = false,\n errorMessage,\n suggestions = [],\n onInput = noop,\n onFetch = noop,\n onClear = noop,\n onBlur = noop,\n onSuggestionSelected = noop,\n title: propsTitle,\n theme = 'default'\n } = props;\n\n const mainClass = THEME_STYLE[theme];\n const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);\n const className = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [modified, error]\n );\n\n const handleInput = useCallback(\n e => {\n onInput(e);\n },\n [onInput]\n );\n const handleBlur = useCallback(\n (e, selectedSuggestion) => onBlur(e, selectedSuggestion),\n [onBlur]\n );\n const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);\n const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);\n const handleSuggestionsSelected = useCallback(\n (e, data) => onSuggestionSelected(data),\n [onSuggestionSelected]\n );\n\n const inputProps = {\n placeholder,\n value,\n onChange: noop,\n onBlur: handleBlur,\n onInput: handleInput,\n 'data-testid': 'autocomplete-input'\n };\n\n const errorIconView =\n theme === 'coorpmanager' && error ? <ErrorIcon className={style.leftIcon} /> : null;\n\n const errorText =\n theme === 'coorpmanager' && error ? (\n <div\n className={style.errorText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: errorMessage}}\n />\n ) : null;\n return (\n <div className={classnames(mainClass, className, isNil(propsTitle) && style.isNoTitle)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>{title}</span>\n <div className={style.inputContainer}>\n <Autosuggest\n theme={{\n container: style.container,\n input: style.input,\n suggestionsContainer: style.suggestionsContainer,\n suggestionsContainerOpen: style.suggestionsContainerOpen,\n suggestionsList: style.suggestionsList,\n suggestion: style.suggestion,\n suggestionHighlighted: style.suggestionHighlighted\n }}\n suggestions={suggestions}\n onSuggestionsFetchRequested={handleSuggestionsFetchRequested}\n onSuggestionsClearRequested={handleSuggestionsClearRequested}\n getSuggestionValue={noop}\n renderSuggestion={renderSuggestion}\n inputProps={inputProps}\n focusInputOnSuggestionClick={false}\n onSuggestionSelected={handleSuggestionsSelected}\n />\n {errorIconView}\n {errorText}\n </div>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nAutocomplete.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n description: PropTypes.string,\n required: PropTypes.bool,\n modified: PropTypes.bool,\n error: PropTypes.bool,\n errorMessage: PropTypes.string,\n suggestions: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n })\n ),\n theme: PropTypes.oneOf(keys(THEME_STYLE)),\n onInput: PropTypes.func,\n onFetch: PropTypes.func,\n onClear: PropTypes.func,\n onBlur: PropTypes.func,\n onSuggestionSelected: PropTypes.func\n};\n\nexport default Autocomplete;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,OAAOC,WAAP,MAAwB,mBAAxB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,oBAAoB,IAAIC,SAAhC,QAAgD,0BAAhD;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,WAAW,GAAG;EAClBC,YAAY,EAAEF,KAAK,CAACE,YADF;EAElBC,OAAO,EAAEH,KAAK,CAACG;AAFG,CAApB;;AAKA,MAAMC,gBAAgB,GAAGC,UAAU,iBAAI,kCAAOA,UAAU,CAACC,IAAlB,CAAvC;;AAEA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,WAAW,GAAG,EADV;IAEJC,KAFI;IAGJC,WAHI;IAIJC,QAJI;IAKJC,QAAQ,GAAG,KALP;IAMJC,KAAK,GAAG,KANJ;IAOJC,YAPI;IAQJC,WAAW,GAAG,EARV;IASJC,OAAO,QATH;IAUJC,OAAO,QAVH;IAWJC,OAAO,QAXH;IAY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value dark from colors;
|
|
6
6
|
@value medium from colors;
|
|
7
7
|
@value white from colors;
|
|
8
|
+
@value cm_positive_100 from colors;
|
|
9
|
+
@value cm_negative_100 from colors;
|
|
10
|
+
@value cm_grey_100 from colors;
|
|
11
|
+
@value cm_grey_150 from colors;
|
|
12
|
+
@value cm_grey_400 from colors;
|
|
13
|
+
@value cm_grey_700 from colors;
|
|
8
14
|
|
|
9
15
|
.default {
|
|
10
16
|
display: flex;
|
|
@@ -127,4 +133,147 @@
|
|
|
127
133
|
|
|
128
134
|
.suggestionHighlighted {
|
|
129
135
|
background-color: #ddd;
|
|
130
|
-
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/******************************* coorpmanager theme ***************************************/
|
|
139
|
+
|
|
140
|
+
.coorpmanager {
|
|
141
|
+
width: 100%;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: flex-start;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
flex-wrap: nowrap;
|
|
146
|
+
position: relative;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.coorpmanager label {
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
margin-right: 0;
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: flex-start;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
position: relative;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.coorpmanager .title {
|
|
160
|
+
flex-grow: 0;
|
|
161
|
+
font-family: Gilroy;
|
|
162
|
+
font-size: 10px;
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
font-stretch: normal;
|
|
165
|
+
font-style: normal;
|
|
166
|
+
line-height: 1.2;
|
|
167
|
+
letter-spacing: normal;
|
|
168
|
+
text-align: left;
|
|
169
|
+
z-index: 1;
|
|
170
|
+
color: cm_grey_400;
|
|
171
|
+
width: auto;
|
|
172
|
+
transition: all 0.25s linear;
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: row;
|
|
176
|
+
flex-wrap: nowrap;
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 7px;
|
|
179
|
+
left: 16px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.coorpmanager .title.noValue{
|
|
183
|
+
font-size: 14px;
|
|
184
|
+
font-weight: 500;
|
|
185
|
+
color: cm_grey_700;
|
|
186
|
+
top: 14px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.coorpmanager:focus-within .title.noValue {
|
|
190
|
+
font-size: 10px;
|
|
191
|
+
font-weight: bold;
|
|
192
|
+
color: cm_grey_400;
|
|
193
|
+
top: 7px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.coorpmanager .inputContainer {
|
|
197
|
+
width: 100%
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.coorpmanager input {
|
|
201
|
+
width: 100%;
|
|
202
|
+
height: 44px;
|
|
203
|
+
margin: 0px;
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: flex-start;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
flex-grow: 0;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
background-color: cm_grey_100;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
border: none;
|
|
212
|
+
border-radius: 7px;
|
|
213
|
+
color: cm_grey_700;
|
|
214
|
+
font-family: Gilroy;
|
|
215
|
+
font-size: 14px;
|
|
216
|
+
font-weight: 500;
|
|
217
|
+
font-stretch: normal;
|
|
218
|
+
font-style: normal;
|
|
219
|
+
line-height: 44px;
|
|
220
|
+
letter-spacing: normal;
|
|
221
|
+
outline: none;
|
|
222
|
+
padding: 19px 30px 5px 16px;
|
|
223
|
+
text-align: left;
|
|
224
|
+
transition: all 0.25s linear;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.coorpmanager .suggestionsContainerOpen {
|
|
228
|
+
width: 100%;
|
|
229
|
+
margin-left: 0;
|
|
230
|
+
border-radius: 7px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.coorpmanager:focus-within input::placeholder {
|
|
234
|
+
color: cm_grey_400;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.coorpmanager .suggestionsList {
|
|
238
|
+
border-radius: 7px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.coorpmanager .suggestionHighlighted {
|
|
242
|
+
border-radius: 5px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.coorpmanager input::placeholder {
|
|
246
|
+
color: transparent;
|
|
247
|
+
transition: color 0.25s linear;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.coorpmanager input:hover {
|
|
251
|
+
background-color: cm_grey_150;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.coorpmanager.error .leftIcon {
|
|
255
|
+
background-color: cm_negative_100;
|
|
256
|
+
color: white;
|
|
257
|
+
border-radius: 50%;
|
|
258
|
+
padding: 2px;
|
|
259
|
+
width: 10px;
|
|
260
|
+
height: 10px;
|
|
261
|
+
position: absolute;
|
|
262
|
+
right: 17px;
|
|
263
|
+
top: 14px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.coorpmanager .errorText {
|
|
267
|
+
flex-grow: 0;
|
|
268
|
+
opacity: 0.5;
|
|
269
|
+
font-family: Gilroy;
|
|
270
|
+
font-size: 10px;
|
|
271
|
+
font-weight: 500;
|
|
272
|
+
font-stretch: normal;
|
|
273
|
+
font-style: normal;
|
|
274
|
+
line-height: 1.2;
|
|
275
|
+
letter-spacing: normal;
|
|
276
|
+
text-align: left;
|
|
277
|
+
padding-top: 8px;
|
|
278
|
+
color: cm_negative_100;
|
|
279
|
+
}
|
package/es/atom/avatar/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAkB,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAG5D,QAAA,MAAM,cAAc;gHASf,mBAAmB,iBACP,gBAAgB;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAkB,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAG5D,QAAA,MAAM,cAAc;gHASf,mBAAmB,iBACP,gBAAgB;;;;;;;;;;;;;CA2GhC,CAAC;AAQF,eAAe,cAAc,CAAC"}
|
|
@@ -83,13 +83,15 @@ const BattleOpponent = ({
|
|
|
83
83
|
className: style.informationIcon,
|
|
84
84
|
width: 20,
|
|
85
85
|
height: 20
|
|
86
|
-
})), /*#__PURE__*/React.createElement(
|
|
86
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
className: style.toolTipWrapper
|
|
88
|
+
}, /*#__PURE__*/React.createElement(ToolTip, {
|
|
87
89
|
fontSize: 12,
|
|
88
90
|
anchorId: battleOpponentInfoId,
|
|
89
91
|
toolTipIsVisible: toolTipIsVisible,
|
|
90
92
|
TooltipContent: TooltipContent,
|
|
91
93
|
closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text')
|
|
92
|
-
})) : /*#__PURE__*/React.createElement(ArrowRight, {
|
|
94
|
+
}))) : /*#__PURE__*/React.createElement(ArrowRight, {
|
|
93
95
|
className: style.rightArrow,
|
|
94
96
|
width: 16,
|
|
95
97
|
height: 16
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","useRef","classnames","v5","uuidV5","has","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionCoorpacademyInformationIcon","InformationIcon","ToolTip","toggleStateOnKeyPress","Provider","GetTranslateFromContext","propTypes","style","BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","ariaLabel","legacyContext","translate","wrapperClassnames","card","random","displayNameClassnames","name","alreadyEngaged","mouseLeaveTimer","setMouseLeaveTimer","undefined","toolTipIsVisible","setToolTipIsVisible","battleOpponentInfoId","URL","buttonRef","handleMouseOver","clearTimeout","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","TooltipContent","_props","avatar","tooltipIconContainer","informationIcon","rightArrow","contextTypes","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState, useRef} from 'react';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport has from 'lodash/fp/has';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon\n} from '@coorpacademy/nova-icons';\nimport ToolTip, {toggleStateOnKeyPress} from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText,\n 'aria-label': ariaLabel\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState<number | undefined>(undefined);\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n // to be replaced by useId when React17 is bumped to React18\n const [battleOpponentInfoId] = useState(\n isAlreadyEngaged ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const buttonRef = useRef(null);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n // @ts-expect-error (error: focus does not exists on type never)\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500) as unknown as number\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const TooltipContent = useCallback(\n _props => (\n <p\n {..._props}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-testid=\"battle-opponent-tooltip-content\"\n >\n {tooltipText}\n </p>\n ),\n [handleMouseLeave, handleMouseOver, tooltipText]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n tabIndex={0}\n >\n <div className={style.avatar}>{isRandom ? null : <img src={userAvatarSrc} alt=\"\" />}</div>\n <p className={displayNameClassnames} tabIndex={0}>\n {displayName}\n </p>\n {isAlreadyEngaged ? (\n <>\n <button\n ref={buttonRef}\n tabIndex={0}\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid=\"battle-engaged-opponent-information-button\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n data-for={battleOpponentInfoId}\n data-tooltip-place=\"left\"\n data-tip={isAlreadyEngaged}\n aria-label={ariaLabel}\n >\n <InformationIcon className={style.informationIcon} width={20} height={20} />\n </button>\n <ToolTip\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","useRef","classnames","v5","uuidV5","has","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionCoorpacademyInformationIcon","InformationIcon","ToolTip","toggleStateOnKeyPress","Provider","GetTranslateFromContext","propTypes","style","BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","ariaLabel","legacyContext","translate","wrapperClassnames","card","random","displayNameClassnames","name","alreadyEngaged","mouseLeaveTimer","setMouseLeaveTimer","undefined","toolTipIsVisible","setToolTipIsVisible","battleOpponentInfoId","URL","buttonRef","handleMouseOver","clearTimeout","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","TooltipContent","_props","avatar","tooltipIconContainer","informationIcon","toolTipWrapper","rightArrow","contextTypes","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState, useRef} from 'react';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport has from 'lodash/fp/has';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon\n} from '@coorpacademy/nova-icons';\nimport ToolTip, {toggleStateOnKeyPress} from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText,\n 'aria-label': ariaLabel\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState<number | undefined>(undefined);\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n // to be replaced by useId when React17 is bumped to React18\n const [battleOpponentInfoId] = useState(\n isAlreadyEngaged ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const buttonRef = useRef(null);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n // @ts-expect-error (error: focus does not exists on type never)\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500) as unknown as number\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const TooltipContent = useCallback(\n _props => (\n <p\n {..._props}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-testid=\"battle-opponent-tooltip-content\"\n >\n {tooltipText}\n </p>\n ),\n [handleMouseLeave, handleMouseOver, tooltipText]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n tabIndex={0}\n >\n <div className={style.avatar}>{isRandom ? null : <img src={userAvatarSrc} alt=\"\" />}</div>\n <p className={displayNameClassnames} tabIndex={0}>\n {displayName}\n </p>\n {isAlreadyEngaged ? (\n <>\n <button\n ref={buttonRef}\n tabIndex={0}\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid=\"battle-engaged-opponent-information-button\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n data-for={battleOpponentInfoId}\n data-tooltip-place=\"left\"\n data-tip={isAlreadyEngaged}\n aria-label={ariaLabel}\n >\n <InformationIcon className={style.informationIcon} width={20} height={20} />\n </button>\n <span className={style.toolTipWrapper}>\n <ToolTip\n fontSize={12}\n anchorId={battleOpponentInfoId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n />\n </span>\n </>\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </li>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,EAA+CC,MAA/C,QAA4D,OAA5D;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,EAAE,IAAIC,MAAd,QAA2B,MAA3B;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SACEC,mCAAmC,IAAIC,UADzC,EAEEC,0CAA0C,IAAIC,eAFhD,QAGO,0BAHP;AAIA,OAAOC,OAAP,IAAiBC,qBAAjB,QAA6C,YAA7C;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD,aAAhD;AAEA,OAAOC,SAAP,MAA6C,cAA7C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CACrB;EACEC,gBADF;EAEEC,QAFF;EAGEC,aAHF;EAIEC,OAJF;EAKEC,WALF;EAMEC,WANF;EAOE,cAAcC;AAPhB,CADqB,EAUrBC,aAVqB,KAWlB;EACH,MAAMC,SAAkD,GAAGZ,uBAAuB,CAACW,aAAD,CAAlF;EACA,MAAME,iBAAiB,GAAG3B,OAAO,CAC/B,MAAMG,UAAU,CAACa,KAAK,CAACY,IAAP,EAAaZ,KAAK,CAAC,eAAD,CAAlB,EAAqCG,QAAQ,GAAGH,KAAK,CAACa,MAAT,GAAkB,IAA/D,CADe,EAE/B,CAACV,QAAD,CAF+B,CAAjC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C,OAAD;IACE,QAAQ,EAAE,EADZ;IAEE,QAAQ,EAAEjB,oBAFZ;IAGE,gBAAgB,EAAEF,gBAHpB;IAIE,cAAc,EAAEc,cAJlB;IAKE,oCAAoC,EAAExB,SAAS,CAC7C,oDAD6C;EALjD,EADF,CAjBF,CADe,gBA+Bf,oBAAC,UAAD;IAAY,SAAS,EAAEV,KAAK,CAACwC,UAA7B;IAAyC,KAAK,EAAE,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EAzCJ,CADF;AA8CD,CArHD;;AAuHAvC,cAAc,CAACF,SAAf,2CAA2BA,SAA3B;AAEAE,cAAc,CAACwC,YAAf,GAA8B;EAC5B/B,SAAS,EAAEb,QAAQ,CAAC6C,iBAAT,CAA2BhC;AADV,CAA9B;AAIA,eAAeT,cAAf"}
|
|
@@ -112,6 +112,18 @@
|
|
|
112
112
|
align-items: center;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
.toolTipWrapper {
|
|
116
|
+
position: absolute;
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.card .tooltipIconContainer + .toolTipWrapper [class*="__react_component_tooltip"]:not([class*="toolTipReact"]) {
|
|
121
|
+
position: sticky;
|
|
122
|
+
top: unset !important;
|
|
123
|
+
left: unset !important;
|
|
124
|
+
max-width: 75%;
|
|
125
|
+
}
|
|
126
|
+
|
|
115
127
|
@media mobile {
|
|
116
128
|
.opponent-card {
|
|
117
129
|
width: 100%;
|
|
@@ -5,17 +5,28 @@ declare namespace Button {
|
|
|
5
5
|
color: any;
|
|
6
6
|
submitValue: PropTypes.Requireable<string>;
|
|
7
7
|
disabled: PropTypes.Requireable<boolean>;
|
|
8
|
-
isLinkDisabled: PropTypes.Requireable<boolean>;
|
|
9
8
|
href: PropTypes.Requireable<string>;
|
|
10
9
|
download: PropTypes.Requireable<boolean>;
|
|
11
10
|
target: PropTypes.Requireable<string>;
|
|
12
11
|
type: PropTypes.Requireable<string>;
|
|
13
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
15
13
|
className: PropTypes.Requireable<string>;
|
|
16
|
-
buttonContentClassName: PropTypes.Requireable<string>;
|
|
17
14
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
18
15
|
'data-name': PropTypes.Requireable<string>;
|
|
16
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
17
|
+
'data-testid': PropTypes.Requireable<string>;
|
|
18
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
19
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
+
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
24
|
+
'data-for': PropTypes.Requireable<string>;
|
|
25
|
+
'data-tooltip-place': PropTypes.Requireable<string>;
|
|
26
|
+
'data-tip': PropTypes.Requireable<boolean>;
|
|
27
|
+
isLinkDisabled: PropTypes.Requireable<boolean>;
|
|
28
|
+
useWrapper: PropTypes.Requireable<boolean>;
|
|
29
|
+
buttonContentClassName: PropTypes.Requireable<string>;
|
|
19
30
|
};
|
|
20
31
|
}
|
|
21
32
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";AA8IA,iDAgCC"}
|
package/es/atom/button/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
+
import noop from 'lodash/fp/noop';
|
|
6
7
|
import { ColorPropType } from '../../util/proptypes';
|
|
7
8
|
import Link from '../link';
|
|
8
9
|
import cssStyle from './style.css';
|
|
@@ -16,12 +17,21 @@ const ButtonContent = props => {
|
|
|
16
17
|
href,
|
|
17
18
|
target,
|
|
18
19
|
onClick,
|
|
19
|
-
className
|
|
20
|
+
className,
|
|
20
21
|
children,
|
|
21
22
|
type,
|
|
22
23
|
style,
|
|
23
24
|
'data-name': dataName,
|
|
24
|
-
'aria-label': ariaLabel
|
|
25
|
+
'aria-label': ariaLabel,
|
|
26
|
+
'data-testid': dataTestid,
|
|
27
|
+
useButtonTag,
|
|
28
|
+
buttonRef,
|
|
29
|
+
'data-for': dataFor,
|
|
30
|
+
'data-tooltip-place': dataTooltipPlace,
|
|
31
|
+
'data-tip': dataTip,
|
|
32
|
+
onKeyDown = noop,
|
|
33
|
+
onMouseLeave = noop,
|
|
34
|
+
onMouseOver = noop
|
|
25
35
|
} = props;
|
|
26
36
|
const anchorClassName = disabled && `${className} ${cssStyle.disabledAnchor}` || className;
|
|
27
37
|
const anchorOnClick = disabled && null || onClick;
|
|
@@ -38,7 +48,8 @@ const ButtonContent = props => {
|
|
|
38
48
|
target: target,
|
|
39
49
|
className: anchorClassName,
|
|
40
50
|
style: style,
|
|
41
|
-
"aria-label": ariaLabel
|
|
51
|
+
"aria-label": ariaLabel,
|
|
52
|
+
"data-testid": dataTestid
|
|
42
53
|
}, submitValue || children || 'submit');
|
|
43
54
|
|
|
44
55
|
case 'a':
|
|
@@ -48,21 +59,45 @@ const ButtonContent = props => {
|
|
|
48
59
|
target: target,
|
|
49
60
|
className: anchorClassName,
|
|
50
61
|
onClick: anchorOnClick,
|
|
51
|
-
style: style
|
|
62
|
+
style: style,
|
|
63
|
+
"data-testid": dataTestid
|
|
52
64
|
}, submitValue || children);
|
|
53
65
|
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/React.createElement("
|
|
66
|
+
case 'button':
|
|
67
|
+
if (useButtonTag) return /*#__PURE__*/React.createElement("button", {
|
|
68
|
+
ref: buttonRef,
|
|
69
|
+
type: "button",
|
|
70
|
+
"data-for": dataFor,
|
|
71
|
+
"data-tooltip-place": dataTooltipPlace,
|
|
72
|
+
"data-tip": dataTip,
|
|
56
73
|
"data-name": dataName,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
"data-testid": dataTestid,
|
|
75
|
+
"aria-label": ariaLabel.favorite,
|
|
76
|
+
className: className,
|
|
60
77
|
onClick: onClick,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
style: style,
|
|
79
|
+
onKeyDown: onKeyDown,
|
|
80
|
+
onMouseLeave: onMouseLeave,
|
|
81
|
+
onMouseOver: onMouseOver,
|
|
82
|
+
tabIndex: 0
|
|
83
|
+
}, children);
|
|
84
|
+
// falls through in case type is button BUT no button tag is needed, for retro-compatibility
|
|
85
|
+
|
|
86
|
+
default:
|
|
87
|
+
{
|
|
88
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
89
|
+
"data-name": dataName,
|
|
90
|
+
type: type,
|
|
91
|
+
value: submitValue,
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
onClick: onClick,
|
|
94
|
+
className: inputClassName,
|
|
95
|
+
"data-testid": dataTestid,
|
|
96
|
+
style: _extends({
|
|
97
|
+
color
|
|
98
|
+
}, style)
|
|
99
|
+
});
|
|
100
|
+
}
|
|
66
101
|
}
|
|
67
102
|
};
|
|
68
103
|
|
|
@@ -74,12 +109,23 @@ ButtonContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
74
109
|
download: PropTypes.bool,
|
|
75
110
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
76
111
|
type: PropTypes.string,
|
|
77
|
-
onClick: PropTypes.func,
|
|
78
112
|
children: PropTypes.node,
|
|
79
113
|
className: PropTypes.string,
|
|
80
114
|
style: PropTypes.shape({}),
|
|
81
115
|
'data-name': PropTypes.string,
|
|
82
|
-
'aria-label': PropTypes.string
|
|
116
|
+
'aria-label': PropTypes.string,
|
|
117
|
+
'data-testid': PropTypes.string,
|
|
118
|
+
useButtonTag: PropTypes.bool,
|
|
119
|
+
// event handlers
|
|
120
|
+
onClick: PropTypes.func,
|
|
121
|
+
onKeyDown: PropTypes.func,
|
|
122
|
+
onMouseLeave: PropTypes.func,
|
|
123
|
+
onMouseOver: PropTypes.func,
|
|
124
|
+
// for ReactTooltip handling
|
|
125
|
+
buttonRef: PropTypes.shape({}),
|
|
126
|
+
'data-for': PropTypes.string,
|
|
127
|
+
'data-tooltip-place': PropTypes.string,
|
|
128
|
+
'data-tip': PropTypes.bool
|
|
83
129
|
} : {};
|
|
84
130
|
|
|
85
131
|
const Button = props => {
|
|
@@ -89,33 +135,25 @@ const Button = props => {
|
|
|
89
135
|
isLinkDisabled,
|
|
90
136
|
type = 'submit',
|
|
91
137
|
children,
|
|
92
|
-
|
|
138
|
+
useWrapper = true
|
|
93
139
|
} = props;
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
140
|
+
const buttonWrapperClassNames = useMemo(() => isLinkDisabled && classnames([cssStyle.disabledAnchor, className]) || classnames([cssStyle.button, className]), [className, isLinkDisabled]);
|
|
141
|
+
const contentClassName = useMemo(() => buttonContentClassName ? buttonContentClassName : cssStyle.buttonContent, [buttonContentClassName]);
|
|
142
|
+
return useWrapper ? /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: buttonWrapperClassNames
|
|
97
144
|
}, /*#__PURE__*/React.createElement(ButtonContent, _extends({}, props, {
|
|
98
145
|
type: type,
|
|
99
|
-
className:
|
|
100
|
-
|
|
101
|
-
|
|
146
|
+
className: contentClassName
|
|
147
|
+
}), children)) : /*#__PURE__*/React.createElement(ButtonContent, _extends({}, props, {
|
|
148
|
+
type: type,
|
|
149
|
+
className: contentClassName
|
|
150
|
+
}), children);
|
|
102
151
|
};
|
|
103
152
|
|
|
104
|
-
Button.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
105
|
-
color: ColorPropType,
|
|
106
|
-
submitValue: PropTypes.string,
|
|
107
|
-
disabled: PropTypes.bool,
|
|
153
|
+
Button.propTypes = process.env.NODE_ENV !== "production" ? _extends({
|
|
108
154
|
isLinkDisabled: PropTypes.bool,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
type: PropTypes.string,
|
|
113
|
-
onClick: PropTypes.func,
|
|
114
|
-
children: PropTypes.node,
|
|
115
|
-
className: PropTypes.string,
|
|
116
|
-
buttonContentClassName: PropTypes.string,
|
|
117
|
-
style: PropTypes.shape({}),
|
|
118
|
-
'data-name': PropTypes.string
|
|
119
|
-
} : {};
|
|
155
|
+
useWrapper: PropTypes.bool,
|
|
156
|
+
buttonContentClassName: PropTypes.string
|
|
157
|
+
}, ButtonContent.propTypes) : {};
|
|
120
158
|
export default Button;
|
|
121
159
|
//# sourceMappingURL=index.js.map
|