@openneuro/app 4.33.4 → 4.34.0
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/package.json +4 -3
- package/src/client.jsx +2 -1
- package/src/scripts/authentication/signOut.ts +1 -1
- package/src/scripts/common/containers/footer.tsx +1 -1
- package/src/scripts/common/containers/header.tsx +3 -2
- package/src/scripts/common/content/affiliate-content.jsx +72 -0
- package/src/scripts/common/content/assets/affiliates/bids.jpg +0 -0
- package/src/scripts/common/content/assets/affiliates/datalad.jpg +0 -0
- package/src/scripts/common/content/assets/affiliates/nih-bi-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/brand_mark.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-get.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-share.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-use.png +0 -0
- package/src/scripts/common/content/assets/front-page/ljaf.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_app.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_cube.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_data.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_users.png +0 -0
- package/src/scripts/common/content/assets/front-page/novo-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/nru-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/nsf.png +0 -0
- package/src/scripts/common/content/assets/front-page/sqm-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/squishymedia.png +0 -0
- package/src/scripts/common/content/assets/front-page/stanford.png +0 -0
- package/src/scripts/common/content/assets/modality-cubes/brain-initiative.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/eeg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/ieeg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/meg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/mri.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/nih_cube.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/nirs.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/pet-scan.jpg +0 -0
- package/src/scripts/common/content/assets/portal-content/nih-bi-brand.png +0 -0
- package/src/scripts/common/content/facet-content.jsx +186 -0
- package/src/scripts/common/content/front-page-content.jsx +177 -0
- package/src/scripts/common/content/image-attribution.tsx +3 -3
- package/src/scripts/common/content/modality-cube-content.jsx +92 -0
- package/src/scripts/common/content/portal-content.jsx +149 -0
- package/src/scripts/common/content/portal-grant-content.jsx +30 -0
- package/src/scripts/common/content/sortby-list.jsx +18 -0
- package/src/scripts/common/forms/warn-button.jsx +1 -1
- package/src/scripts/components/accordion/AccordionTab.tsx +68 -0
- package/src/scripts/components/accordion/AccordionWrap.tsx +22 -0
- package/src/scripts/components/accordion/__tests__/AccordionTab.spec.tsx +35 -0
- package/src/scripts/components/accordion/accordion.scss +68 -0
- package/src/scripts/components/activity-slider/ActivitySlider.tsx +121 -0
- package/src/scripts/components/activity-slider/slider.scss +130 -0
- package/src/scripts/components/affiliate-article/AffiliateArticle.tsx +26 -0
- package/src/scripts/components/affiliate-article/affiliate.scss +32 -0
- package/src/scripts/components/aggregate-count/AggregateCount.tsx +20 -0
- package/src/scripts/components/assets/activity-icon.png +0 -0
- package/src/scripts/components/assets/close-button.png +0 -0
- package/src/scripts/components/assets/favicon copy.ico +0 -0
- package/src/scripts/components/assets/favicon.ico +0 -0
- package/src/scripts/components/assets/get_data_browse.png +0 -0
- package/src/scripts/components/assets/get_data_download.png +0 -0
- package/src/scripts/components/assets/ljaf copy.png +0 -0
- package/src/scripts/components/assets/logo_app copy.png +0 -0
- package/src/scripts/components/assets/logo_cube copy.png +0 -0
- package/src/scripts/components/assets/logo_data copy.png +0 -0
- package/src/scripts/components/assets/logo_users copy.png +0 -0
- package/src/scripts/components/assets/mri-scan.jpg +0 -0
- package/src/scripts/components/assets/nih copy.png +0 -0
- package/src/scripts/components/assets/nih-bi-brand.jpg +0 -0
- package/src/scripts/components/assets/nih-stanford.jpg +0 -0
- package/src/scripts/components/assets/nih.png +0 -0
- package/src/scripts/components/assets/nimh.png +0 -0
- package/src/scripts/components/assets/nsf copy.png +0 -0
- package/src/scripts/components/assets/on-dark-horz.svg +1 -0
- package/src/scripts/components/assets/on-dark.svg +1 -0
- package/src/scripts/components/assets/on-light-horz.svg +1 -0
- package/src/scripts/components/assets/on-light.svg +1 -0
- package/src/scripts/components/assets/orcid_24x24 copy.png +0 -0
- package/src/scripts/components/assets/orcid_24x24.png +0 -0
- package/src/scripts/components/assets/share_data_collaborate.png +0 -0
- package/src/scripts/components/assets/share_data_publish.png +0 -0
- package/src/scripts/components/assets/share_data_validate.png +0 -0
- package/src/scripts/components/assets/squishymedia copy.png +0 -0
- package/src/scripts/components/assets/stanford copy.png +0 -0
- package/src/scripts/components/assets/tab-get_data.png +0 -0
- package/src/scripts/components/assets/tab-share_data.png +0 -0
- package/src/scripts/components/assets/tab-use_data.png +0 -0
- package/src/scripts/components/assets/use_data_analyze.png +0 -0
- package/src/scripts/components/assets/use_data_snapshot.png +0 -0
- package/src/scripts/components/button/Button.tsx +113 -0
- package/src/scripts/components/button/__tests__/Button.spec.tsx +21 -0
- package/src/scripts/components/button/button.scss +140 -0
- package/src/scripts/components/count-toggle/CountToggle.tsx +65 -0
- package/src/scripts/components/count-toggle/__tests__/CountToggle.spec.tsx +31 -0
- package/src/scripts/components/count-toggle/count-toggle.scss +34 -0
- package/src/scripts/components/dropdown/Dropdown.tsx +38 -0
- package/src/scripts/components/dropdown/dropdown.scss +29 -0
- package/src/scripts/components/facets/FacetRadio.tsx +43 -0
- package/src/scripts/components/facets/FacetRange.tsx +35 -0
- package/src/scripts/components/facets/FacetSearch.tsx +66 -0
- package/src/scripts/components/facets/FacetSelect.tsx +87 -0
- package/src/scripts/components/facets/SingleSelect.tsx +39 -0
- package/src/scripts/components/facets/__tests__/FacetSelect.spec.tsx +14 -0
- package/src/scripts/components/facets/__tests__/SingleSelect.spec.tsx +58 -0
- package/src/scripts/components/facets/facet.scss +244 -0
- package/src/scripts/components/footer/Footer.tsx +52 -0
- package/src/scripts/components/footer/footer.scss +20 -0
- package/src/scripts/components/formatting/__tests__/modality-label.spec.tsx +34 -0
- package/src/scripts/components/formatting/modality-label.tsx +34 -0
- package/src/scripts/components/front-page/ActivityHeader.tsx +12 -0
- package/src/scripts/components/front-page/AffiliateBlock.tsx +22 -0
- package/src/scripts/components/front-page/Contributors.tsx +28 -0
- package/src/scripts/components/front-page/GetUpdates.tsx +99 -0
- package/src/scripts/components/front-page/Infographic.tsx +36 -0
- package/src/scripts/components/front-page/front-page.scss +295 -0
- package/src/scripts/components/header/Header.tsx +151 -0
- package/src/scripts/components/header/LandingExpandedHeader.tsx +110 -0
- package/src/scripts/components/header/header.scss +409 -0
- package/src/scripts/components/icon/Icon.tsx +55 -0
- package/src/scripts/components/icon/__tests__/Icon.spec.tsx +10 -0
- package/src/scripts/components/icon/icon.scss +8 -0
- package/src/scripts/components/input/Input.tsx +137 -0
- package/src/scripts/components/input/TermSearch.tsx +101 -0
- package/src/scripts/components/input/input.scss +147 -0
- package/src/scripts/components/input/term-search.scss +68 -0
- package/src/scripts/components/json-tree/ExpandableProperty.tsx +35 -0
- package/src/scripts/components/json-tree/RecursiveProperty.tsx +67 -0
- package/src/scripts/components/json-tree/json-tree.scss +19 -0
- package/src/scripts/components/loading/Loading.tsx +19 -0
- package/src/scripts/components/loading/__tests__/Loading.spec.tsx +12 -0
- package/src/scripts/components/loading/loading.scss +141 -0
- package/src/scripts/components/logo/Logo.tsx +44 -0
- package/src/scripts/components/logo/__tests__/Logo.spec.tsx +22 -0
- package/src/scripts/components/modal/Modal.tsx +51 -0
- package/src/scripts/components/modal/ModalExample.tsx +25 -0
- package/src/scripts/components/modal/UserLoginModal.tsx +74 -0
- package/src/scripts/components/modal/__tests__/UserLoginModal.spec.tsx +37 -0
- package/src/scripts/components/modal/modal.scss +60 -0
- package/src/scripts/components/modality-cube/ModalityCube.tsx +60 -0
- package/src/scripts/components/modality-cube/modality-cube.scss +303 -0
- package/src/scripts/components/page/Page.tsx +61 -0
- package/src/scripts/components/page/page.scss +408 -0
- package/src/scripts/components/progress-bar/ProgressBar.tsx +16 -0
- package/src/scripts/components/progress-bar/progress-bar.scss +34 -0
- package/src/scripts/components/radio/Radio.tsx +33 -0
- package/src/scripts/components/radio/RadioGroup.tsx +45 -0
- package/src/scripts/components/radio/__tests__/RadioGroup.spec.tsx +31 -0
- package/src/scripts/components/radio/radio.scss +335 -0
- package/src/scripts/components/range/TwoHandleRange.scss +108 -0
- package/src/scripts/components/range/TwoHandleRange.tsx +128 -0
- package/src/scripts/components/range/__tests__/TwoHandleRange.spec.tsx +34 -0
- package/src/scripts/components/read-more/ReadMore.tsx +50 -0
- package/src/scripts/components/read-more/__tests__/ReadMore.spec.tsx +14 -0
- package/src/scripts/components/read-more/read-more.scss +79 -0
- package/src/scripts/components/scss/_flex-grid.scss +216 -0
- package/src/scripts/components/scss/_helper-classes.scss +162 -0
- package/src/scripts/components/scss/_normalize.scss +614 -0
- package/src/scripts/components/scss/_variables.scss +245 -0
- package/src/scripts/components/scss/global.scss +124 -0
- package/src/scripts/components/scss/toasts.scss +33 -0
- package/src/scripts/components/scss/upload-modal.scss +479 -0
- package/src/scripts/components/search-page/CommunityHeader.tsx +27 -0
- package/src/scripts/components/search-page/FacetBlockContainerExample.tsx +6 -0
- package/src/scripts/components/search-page/FilterDateItem.tsx +44 -0
- package/src/scripts/components/search-page/FilterListItem.tsx +62 -0
- package/src/scripts/components/search-page/FiltersBlock.tsx +277 -0
- package/src/scripts/components/search-page/ModalityHeader.tsx +64 -0
- package/src/scripts/components/search-page/NeurobagelSearch.tsx +59 -0
- package/src/scripts/components/search-page/SearchPage.tsx +114 -0
- package/src/scripts/components/search-page/SearchResultItem.tsx +417 -0
- package/src/scripts/components/search-page/SearchResultsList.tsx +48 -0
- package/src/scripts/components/search-page/SearchSort.tsx +52 -0
- package/src/scripts/components/search-page/SearchSortContainerExample.tsx +9 -0
- package/src/scripts/components/search-page/TermListItem.tsx +41 -0
- package/src/scripts/components/search-page/__tests__/NuerobagelSearch.spec.tsx +17 -0
- package/src/scripts/components/search-page/filters-block.scss +99 -0
- package/src/scripts/components/search-page/neurobagel_logo.svg +75 -0
- package/src/scripts/components/search-page/search-page.scss +505 -0
- package/src/scripts/components/search-page/search-result.scss +117 -0
- package/src/scripts/components/search-page/search-sort.scss +56 -0
- package/src/scripts/components/select/SelectGroup.tsx +41 -0
- package/src/scripts/components/select/__tests__/SelectGroup.spec.tsx +43 -0
- package/src/scripts/components/select/select.scss +40 -0
- package/src/scripts/components/textarea/Textarea.tsx +68 -0
- package/src/scripts/components/textarea/__tests__/Textarea.spec.tsx +53 -0
- package/src/scripts/components/tooltip/Tooltip.tsx +30 -0
- package/src/scripts/components/tooltip/__tests__/Tooltip.spec.tsx +14 -0
- package/src/scripts/components/tooltip/tooltip.scss +159 -0
- package/src/scripts/components/user/UserMenu.tsx +72 -0
- package/src/scripts/components/user/user-menu.scss +88 -0
- package/src/scripts/components/warn-button/WarnButton.tsx +97 -0
- package/src/scripts/components/warn-button/warn-button.scss +39 -0
- package/src/scripts/datalad/dataset/dataset-query-context.js +2 -0
- package/src/scripts/dataset/comments/comment.jsx +1 -1
- package/src/scripts/dataset/components/AnalyzeDropdown.tsx +2 -2
- package/src/scripts/dataset/components/CloneDropdown.tsx +2 -2
- package/src/scripts/dataset/components/DatasetEventItem.tsx +105 -0
- package/src/scripts/dataset/components/DatasetGitAccess.tsx +2 -2
- package/src/scripts/dataset/components/DatasetToolButton.tsx +2 -2
- package/src/scripts/dataset/components/ModalitiesMetaDataBlock.tsx +2 -10
- package/src/scripts/dataset/components/ValidationBlock.tsx +37 -2
- package/src/scripts/dataset/components/VersionList.tsx +1 -1
- package/src/scripts/dataset/components/scss/dataset-events.module.scss +41 -0
- package/src/scripts/dataset/dataset-query.jsx +12 -11
- package/src/scripts/dataset/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +7 -1
- package/src/scripts/dataset/download/__tests__/download-command-line.spec.jsx +2 -2
- package/src/scripts/dataset/download/download-command-line.jsx +17 -13
- package/src/scripts/dataset/download/download-datalad.jsx +6 -3
- package/src/scripts/dataset/download/download-link.jsx +1 -1
- package/src/scripts/dataset/download/download-s3.jsx +0 -4
- package/src/scripts/dataset/files/file-display.jsx +1 -1
- package/src/scripts/dataset/files/file-tree-unloaded-directory.jsx +1 -1
- package/src/scripts/dataset/files/file-tree.tsx +1 -1
- package/src/scripts/dataset/files/file-view.jsx +1 -1
- package/src/scripts/dataset/files/file-viewer-type.jsx +5 -1
- package/src/scripts/dataset/files/file.tsx +2 -2
- package/src/scripts/dataset/files/files.tsx +3 -3
- package/src/scripts/dataset/files/viewers/file-viewer-json.jsx +1 -1
- package/src/scripts/dataset/files/viewers/file-viewer-markdown.tsx +13 -0
- package/src/scripts/dataset/fragments/cancel-button.tsx +1 -1
- package/src/scripts/dataset/fragments/dataset-citation.jsx +2 -2
- package/src/scripts/dataset/fragments/edit-button.tsx +1 -1
- package/src/scripts/dataset/fragments/edit-list.jsx +1 -1
- package/src/scripts/dataset/fragments/save-button.tsx +1 -1
- package/src/scripts/dataset/mutations/admin-exports.jsx +1 -1
- package/src/scripts/dataset/mutations/cache-clear.jsx +1 -1
- package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +2 -2
- package/src/scripts/dataset/mutations/dataset-events.tsx +187 -0
- package/src/scripts/dataset/mutations/dataset-relations.tsx +1 -1
- package/src/scripts/dataset/mutations/delete-anonymous-reviewer.tsx +1 -1
- package/src/scripts/dataset/mutations/delete-comment.jsx +1 -1
- package/src/scripts/dataset/mutations/delete-file.jsx +1 -1
- package/src/scripts/dataset/mutations/deprecate-version.tsx +1 -1
- package/src/scripts/dataset/mutations/flag-annex-object.jsx +2 -2
- package/src/scripts/dataset/mutations/follow.tsx +1 -1
- package/src/scripts/dataset/mutations/import-dataset.tsx +1 -1
- package/src/scripts/dataset/mutations/publish.jsx +1 -1
- package/src/scripts/dataset/mutations/remove-annex-object.jsx +2 -2
- package/src/scripts/dataset/mutations/remove-permissions.tsx +1 -1
- package/src/scripts/dataset/mutations/revalidate.jsx +2 -2
- package/src/scripts/dataset/mutations/snapshot.tsx +1 -1
- package/src/scripts/dataset/mutations/star.tsx +1 -1
- package/src/scripts/dataset/mutations/submit-metadata.jsx +1 -1
- package/src/scripts/dataset/mutations/undo-deprecate-version.tsx +2 -2
- package/src/scripts/dataset/mutations/update-permissions.tsx +1 -1
- package/src/scripts/dataset/routes/admin-datalad.jsx +4 -0
- package/src/scripts/dataset/routes/dataset-default.tsx +1 -1
- package/src/scripts/dataset/routes/delete-page.tsx +7 -3
- package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +1 -1
- package/src/scripts/dataset/routes/manage-permissions.jsx +1 -1
- package/src/scripts/dataset/routes/snapshot-default.tsx +1 -1
- package/src/scripts/dataset/routes/snapshot.tsx +1 -1
- package/src/scripts/dataset/snapshot-container.tsx +14 -8
- package/src/scripts/pages/admin/flagged-files.jsx +1 -1
- package/src/scripts/pages/admin/user-tools.tsx +1 -1
- package/src/scripts/pages/admin/users.tsx +2 -2
- package/src/scripts/pages/api.jsx +2 -2
- package/src/scripts/pages/front-page/aggregate-queries/aggregate-counts-container.tsx +6 -7
- package/src/scripts/pages/front-page/front-page.tsx +7 -9
- package/src/scripts/pages/metadata/dataset-metadata.tsx +1 -1
- package/src/scripts/search/__tests__/search-container.spec.tsx +7 -7
- package/src/scripts/search/filters-block-container.tsx +66 -9
- package/src/scripts/search/initial-search-params.tsx +7 -7
- package/src/scripts/search/inputs/__tests__/sort-by-select.spec.tsx +1 -1
- package/src/scripts/search/inputs/admin-allDatasets-toggle.tsx +1 -1
- package/src/scripts/search/inputs/age-range-input.tsx +3 -2
- package/src/scripts/search/inputs/author-input.tsx +3 -2
- package/src/scripts/search/inputs/dataset-type-select.tsx +3 -2
- package/src/scripts/search/inputs/date-radios.tsx +3 -2
- package/src/scripts/search/inputs/diagnosis-select.tsx +3 -2
- package/src/scripts/search/inputs/initiative-select.tsx +12 -6
- package/src/scripts/search/inputs/keyword-input.tsx +2 -2
- package/src/scripts/search/inputs/modality-select.tsx +28 -26
- package/src/scripts/search/inputs/pet/bodyParts_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/scannerManufacturersModelNames_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/scannerManufacturers_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/tracerNames_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/tracerRadionuclides_input.tsx +4 -3
- package/src/scripts/search/inputs/section-select.tsx +3 -2
- package/src/scripts/search/inputs/sex-radios.tsx +3 -2
- package/src/scripts/search/inputs/show-datasets-radios.tsx +4 -3
- package/src/scripts/search/inputs/sort-by-select.tsx +1 -1
- package/src/scripts/search/inputs/species-select.tsx +3 -2
- package/src/scripts/search/inputs/study-domain-input.tsx +4 -3
- package/src/scripts/search/inputs/subject-count-range-input.tsx +3 -2
- package/src/scripts/search/inputs/task-input.tsx +4 -3
- package/src/scripts/search/search-container.tsx +14 -17
- package/src/scripts/search/search-params-ctx.tsx +28 -5
- package/src/scripts/search/search-routes.tsx +2 -4
- package/src/scripts/search/use-search-results.tsx +14 -13
- package/src/scripts/uploader/upload-issues.tsx +1 -1
- package/src/scripts/uploader/upload-progress.jsx +1 -1
- package/src/scripts/uploader/uploader-modal.jsx +1 -1
- package/src/scripts/users/components/close-button.tsx +1 -1
- package/src/scripts/users/components/edit-button.tsx +1 -1
- package/src/scripts/users/components/edit-list.tsx +1 -1
- package/src/scripts/users/components/edit-string.tsx +1 -1
- package/src/scripts/users/dataset-card.tsx +2 -2
- package/src/scripts/users/user-notification-accordion.tsx +1 -1
- package/src/scripts/utils/user-login-modal-ctx.tsx +1 -1
- package/src/scripts/validation/validation-issues.tsx +2 -1
- package/src/scripts/validation/validation-panel.tsx +2 -1
- package/src/scripts/validation/validation-results.tsx +4 -3
- package/src/scripts/validation-legacy/validation-panel.jsx +2 -1
- package/src/scripts/validation-legacy/validation-results.issues.jsx +2 -3
- package/src/scripts/validation-legacy/validation-results.tsx +3 -4
- package/tsconfig.json +1 -4
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
@import '../scss/variables';
|
|
2
|
+
header {
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
.navbar-brand {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
|
|
8
|
+
@media (max-width: 480px) {
|
|
9
|
+
width: 200px;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
margin-top: 13px;
|
|
12
|
+
}
|
|
13
|
+
@media (max-width: 380px) {
|
|
14
|
+
width: 150px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
.navbar-inner-wrap {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
padding: 10px 25px;
|
|
22
|
+
align-items: center;
|
|
23
|
+
background-color: $on-dark-aqua;
|
|
24
|
+
background: linear-gradient(
|
|
25
|
+
69deg,
|
|
26
|
+
darken($on-dark-aqua, 5%),
|
|
27
|
+
adjust-color($on-dark-aqua, $lightness: 8%)
|
|
28
|
+
);
|
|
29
|
+
position: relative;
|
|
30
|
+
z-index: 1199;
|
|
31
|
+
}
|
|
32
|
+
.svg-fill-on-dark-aqua {
|
|
33
|
+
fill: $on-dark-aqua;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.navbar-navigation {
|
|
37
|
+
@media (max-width: 800px) {
|
|
38
|
+
margin-top: 20px;
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
margin-right: 20px;
|
|
41
|
+
}
|
|
42
|
+
ul {
|
|
43
|
+
list-style: none;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
@media (max-width: 800px) {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
background: #fff;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
padding: 20px;
|
|
57
|
+
z-index: 2000;
|
|
58
|
+
}
|
|
59
|
+
@media (max-width: 450px) {
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
}
|
|
62
|
+
li {
|
|
63
|
+
margin: 0 10px -10px;
|
|
64
|
+
text-align: center;
|
|
65
|
+
position: relative;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
@media (max-width: 800px) {
|
|
70
|
+
margin-bottom: 20px;
|
|
71
|
+
}
|
|
72
|
+
a,
|
|
73
|
+
.no-a {
|
|
74
|
+
color: #f4f4f4;
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
.upload-progress-block {
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:after {
|
|
83
|
+
transition: width 0.5s;
|
|
84
|
+
content: '';
|
|
85
|
+
border-bottom: 2px solid #fff;
|
|
86
|
+
width: 0;
|
|
87
|
+
display: block;
|
|
88
|
+
transition: width 0.3s;
|
|
89
|
+
margin-top: 10px;
|
|
90
|
+
}
|
|
91
|
+
&:hover {
|
|
92
|
+
&:after {
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
&.active {
|
|
97
|
+
&:after {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
@media (max-width: 800px) {
|
|
102
|
+
color: $on-dark-aqua;
|
|
103
|
+
border-bottom: 2px solid transparent;
|
|
104
|
+
&:hover {
|
|
105
|
+
border-bottom-color: $on-dark-aqua;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
.mobile-nav-close-x,
|
|
113
|
+
.mobile-collapse-toggle {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
@media (max-width: 800px) {
|
|
117
|
+
.mobile-collapse-toggle {
|
|
118
|
+
display: inline-block;
|
|
119
|
+
font-size: 29px;
|
|
120
|
+
span {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
i {
|
|
124
|
+
color: #fff;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
.navbar-inner-wrap {
|
|
128
|
+
align-items: flex-start;
|
|
129
|
+
.mobile-nav-close-x {
|
|
130
|
+
display: inline-block;
|
|
131
|
+
font-size: 33px;
|
|
132
|
+
position: absolute;
|
|
133
|
+
right: 8px;
|
|
134
|
+
top: 8px;
|
|
135
|
+
}
|
|
136
|
+
&.nav-open {
|
|
137
|
+
.navbar-navigation ul {
|
|
138
|
+
transform: translateY(0);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
&.nav-closed {
|
|
142
|
+
.navbar-navigation ul {
|
|
143
|
+
transform: translateY(-500px);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
#orcid-info-accordion {
|
|
149
|
+
.accordion-title {
|
|
150
|
+
color: $on-dark-aqua;
|
|
151
|
+
color: darken($on-dark-aqua, 5%);
|
|
152
|
+
text-decoration: underline;
|
|
153
|
+
font-size: 12px;
|
|
154
|
+
justify-content: flex-end;
|
|
155
|
+
margin: 10px 20px 0 0;
|
|
156
|
+
|
|
157
|
+
&:after {
|
|
158
|
+
content: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
.accordion-content {
|
|
162
|
+
padding: 20px;
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.navbar-account {
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: flex-end;
|
|
170
|
+
@media (max-width: 800px) {
|
|
171
|
+
margin-top: 20px;
|
|
172
|
+
.on-button--large.on-button--navbar {
|
|
173
|
+
padding: 10px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.expaned-header {
|
|
179
|
+
min-width: 100%;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.sign-in-modal .modal {
|
|
183
|
+
flex-basis: 730px;
|
|
184
|
+
}
|
|
185
|
+
.sign-in-modal-header {
|
|
186
|
+
display: flex;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
align-items: center;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
h2 {
|
|
191
|
+
font-size: 18px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.sign-in-modal-content {
|
|
195
|
+
display: flex;
|
|
196
|
+
justify-content: space-between;
|
|
197
|
+
@media (max-width: 450px) {
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
align-items: center;
|
|
201
|
+
}
|
|
202
|
+
> div {
|
|
203
|
+
flex-basis: 50%;
|
|
204
|
+
max-width: 50%;
|
|
205
|
+
margin: 0 10px 0 0;
|
|
206
|
+
&:last-child {
|
|
207
|
+
margin: 0 0 0 10px;
|
|
208
|
+
}
|
|
209
|
+
@media (max-width: 450px) {
|
|
210
|
+
margin: 0 0 20px;
|
|
211
|
+
flex-basis: 100%;
|
|
212
|
+
min-width: 100%;
|
|
213
|
+
&:last-child {
|
|
214
|
+
margin-left: 0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
button {
|
|
219
|
+
width: 100%;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
margin: 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.hero-signin {
|
|
226
|
+
margin: 20px 8px 0;
|
|
227
|
+
align-items: center;
|
|
228
|
+
> div {
|
|
229
|
+
margin-right: 60px;
|
|
230
|
+
@media (max-width: 1420px) {
|
|
231
|
+
margin-right: 20px;
|
|
232
|
+
}
|
|
233
|
+
@media (max-width: 1302px) {
|
|
234
|
+
margin-right: 0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
.hero-sigin-label {
|
|
238
|
+
@media (max-width: 800px) {
|
|
239
|
+
flex-basis: 100%;
|
|
240
|
+
min-width: 100%;
|
|
241
|
+
margin-bottom: 20px;
|
|
242
|
+
}
|
|
243
|
+
h3 {
|
|
244
|
+
font-size: 18px;
|
|
245
|
+
color: #fff;
|
|
246
|
+
margin: 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.expaned-header .header-wrap .expaned-h-left {
|
|
252
|
+
@media (max-width: 1400px) {
|
|
253
|
+
flex-basis: 100%;
|
|
254
|
+
width: 100%;
|
|
255
|
+
min-width: 100%;
|
|
256
|
+
}
|
|
257
|
+
@media (max-width: 450px) {
|
|
258
|
+
padding: 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.expaned-header {
|
|
263
|
+
h2 {
|
|
264
|
+
font-weight: 300;
|
|
265
|
+
color: #fff;
|
|
266
|
+
font-size: 29px;
|
|
267
|
+
max-width: 90%;
|
|
268
|
+
@media (max-width: 1250px) {
|
|
269
|
+
max-width: 100%;
|
|
270
|
+
width: 100%;
|
|
271
|
+
}
|
|
272
|
+
a {
|
|
273
|
+
font-weight: 600;
|
|
274
|
+
color: $on-light-aqua;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
.expaned-h-left {
|
|
278
|
+
display: flex;
|
|
279
|
+
flex-direction: column;
|
|
280
|
+
margin-top: 60px;
|
|
281
|
+
.hero-signin {
|
|
282
|
+
margin-top: auto;
|
|
283
|
+
margin-bottom: 30px;
|
|
284
|
+
}
|
|
285
|
+
.header-aggregate {
|
|
286
|
+
display: flex;
|
|
287
|
+
justify-content: space-between;
|
|
288
|
+
max-width: 90%;
|
|
289
|
+
@media (max-width: 1250px) {
|
|
290
|
+
max-width: 100%;
|
|
291
|
+
width: 100%;
|
|
292
|
+
}
|
|
293
|
+
@media (max-width: 767px) {
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
justify-content: center;
|
|
296
|
+
align-items: center;
|
|
297
|
+
}
|
|
298
|
+
.aggregate-count {
|
|
299
|
+
color: #fff;
|
|
300
|
+
font-size: 23px;
|
|
301
|
+
span {
|
|
302
|
+
font-weight: 600;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@media (max-width: $screen-lg) {
|
|
309
|
+
.expaned-h-left,
|
|
310
|
+
.cube-wrap {
|
|
311
|
+
flex-basis: 90%;
|
|
312
|
+
max-width: 90%;
|
|
313
|
+
|
|
314
|
+
margin: 0 auto;
|
|
315
|
+
h2 {
|
|
316
|
+
width: auto;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
@media (max-width: 450px) {
|
|
321
|
+
.expaned-h-left,
|
|
322
|
+
.cube-wrap {
|
|
323
|
+
.header-aggregate .aggregate-count {
|
|
324
|
+
font-size: 15px;
|
|
325
|
+
}
|
|
326
|
+
h2 {
|
|
327
|
+
font-size: 22px;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.header-input-wrap {
|
|
334
|
+
width: 90%;
|
|
335
|
+
margin: 20px 0;
|
|
336
|
+
display: flex;
|
|
337
|
+
justify-content: space-between;
|
|
338
|
+
align-items: center;
|
|
339
|
+
@media (max-width: 1250px) {
|
|
340
|
+
max-width: 100%;
|
|
341
|
+
width: 100%;
|
|
342
|
+
}
|
|
343
|
+
.header-input {
|
|
344
|
+
flex-grow: 1;
|
|
345
|
+
input {
|
|
346
|
+
width: 100%;
|
|
347
|
+
padding: 13px 16px 14px;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
.header-input-button {
|
|
351
|
+
width: 55px;
|
|
352
|
+
margin-left: 15px;
|
|
353
|
+
button.on-button--primary {
|
|
354
|
+
background-color: $on-light-aqua;
|
|
355
|
+
max-width: 100%;
|
|
356
|
+
padding: 17px;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.header-or-text {
|
|
362
|
+
color: #fff;
|
|
363
|
+
font-size: 18px;
|
|
364
|
+
font-weight: 600;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.header-modality-wrap {
|
|
368
|
+
width: 90%;
|
|
369
|
+
margin: 60px 0 20px;
|
|
370
|
+
z-index: 1;
|
|
371
|
+
@media (max-width: 1250px) {
|
|
372
|
+
max-width: 100%;
|
|
373
|
+
width: 100%;
|
|
374
|
+
}
|
|
375
|
+
.facet-accordion.on-accordion-wrapper {
|
|
376
|
+
.accordion-title {
|
|
377
|
+
padding: 15px 0;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@media (max-width: 450px) {
|
|
381
|
+
.level-1 > li {
|
|
382
|
+
> span.label {
|
|
383
|
+
padding: 10px 5px;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
.level-2 > li:before {
|
|
387
|
+
display: none;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
.facet-accordion.on-accordion-wrapper
|
|
392
|
+
.facet-list
|
|
393
|
+
ul
|
|
394
|
+
li.selected-facet
|
|
395
|
+
> .label {
|
|
396
|
+
font-weight: 400;
|
|
397
|
+
color: #666;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.freshdesk-support {
|
|
402
|
+
.modal {
|
|
403
|
+
width: 770px;
|
|
404
|
+
max-width: 100%;
|
|
405
|
+
}
|
|
406
|
+
.modal-body {
|
|
407
|
+
margin-top: 30px;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import "./icon.scss"
|
|
3
|
+
|
|
4
|
+
export interface IconProps {
|
|
5
|
+
primary?: boolean
|
|
6
|
+
secondary?: boolean
|
|
7
|
+
backgroundColor?: string
|
|
8
|
+
label?: string | number | React.ReactNode
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
icon?: string
|
|
11
|
+
color?: string
|
|
12
|
+
imgSrc?: string
|
|
13
|
+
iconSize?: string
|
|
14
|
+
className?: string
|
|
15
|
+
iconOnly?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Icon: React.FC<IconProps> = ({
|
|
19
|
+
backgroundColor,
|
|
20
|
+
label = "",
|
|
21
|
+
icon,
|
|
22
|
+
color,
|
|
23
|
+
imgSrc,
|
|
24
|
+
iconSize,
|
|
25
|
+
className,
|
|
26
|
+
iconOnly,
|
|
27
|
+
}) => {
|
|
28
|
+
const iconWithText = icon && label && !iconOnly
|
|
29
|
+
? "icon-text"
|
|
30
|
+
: imgSrc && label
|
|
31
|
+
? "img-icon-text"
|
|
32
|
+
: null
|
|
33
|
+
const fontIcon = icon
|
|
34
|
+
? <i style={{ fontSize: iconSize }} className={icon}></i>
|
|
35
|
+
: null
|
|
36
|
+
const imgIcon = imgSrc
|
|
37
|
+
? <img style={{ width: iconSize }} src={imgSrc} alt="" loading="lazy" />
|
|
38
|
+
: null
|
|
39
|
+
const wBackgroundColor = backgroundColor ? "has-bg-color" : null
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<span
|
|
43
|
+
className={[className, "on-icon", iconWithText, wBackgroundColor].join(
|
|
44
|
+
" ",
|
|
45
|
+
)}
|
|
46
|
+
style={{ backgroundColor, color }}
|
|
47
|
+
role="img"
|
|
48
|
+
aria-label={label.toString()}
|
|
49
|
+
>
|
|
50
|
+
{imgIcon}
|
|
51
|
+
{fontIcon}
|
|
52
|
+
{iconOnly ? null : label}
|
|
53
|
+
</span>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { render, screen } from "@testing-library/react"
|
|
3
|
+
import { Icon } from "../Icon"
|
|
4
|
+
|
|
5
|
+
describe("Icon component", () => {
|
|
6
|
+
it('provides "img" role', async () => {
|
|
7
|
+
render(<Icon label="test icon" />)
|
|
8
|
+
expect(await screen.getByRole("img")).toBeVisible()
|
|
9
|
+
})
|
|
10
|
+
})
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { AccordionTab } from "../accordion/AccordionTab"
|
|
3
|
+
import { AccordionWrap } from "../accordion/AccordionWrap"
|
|
4
|
+
import "./input.scss"
|
|
5
|
+
|
|
6
|
+
export type InputPropsStyle = "inline" | "float" | "default"
|
|
7
|
+
|
|
8
|
+
export interface InputProps {
|
|
9
|
+
placeholder: string
|
|
10
|
+
type: string
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
label?: string
|
|
13
|
+
name: string
|
|
14
|
+
labelStyle?: InputPropsStyle
|
|
15
|
+
value?: string
|
|
16
|
+
setValue?: (string) => void
|
|
17
|
+
onKeyDown?(event): void
|
|
18
|
+
tipContent?: React.ReactNode
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Input: React.FC<InputProps> = ({
|
|
22
|
+
placeholder,
|
|
23
|
+
type,
|
|
24
|
+
label,
|
|
25
|
+
name,
|
|
26
|
+
labelStyle,
|
|
27
|
+
setValue,
|
|
28
|
+
value,
|
|
29
|
+
tipContent,
|
|
30
|
+
onKeyDown = () => {},
|
|
31
|
+
}) => {
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
{labelStyle == "float"
|
|
35
|
+
? (
|
|
36
|
+
<div className="form-control float-form-style">
|
|
37
|
+
<input
|
|
38
|
+
type={type}
|
|
39
|
+
name={name}
|
|
40
|
+
id={name}
|
|
41
|
+
value={value}
|
|
42
|
+
placeholder={placeholder}
|
|
43
|
+
onChange={(e) => setValue(e.target.value)}
|
|
44
|
+
onKeyDown={onKeyDown}
|
|
45
|
+
/>
|
|
46
|
+
{label
|
|
47
|
+
? (
|
|
48
|
+
<label htmlFor={name}>
|
|
49
|
+
{label}
|
|
50
|
+
{tipContent
|
|
51
|
+
? (
|
|
52
|
+
<AccordionWrap>
|
|
53
|
+
<AccordionTab
|
|
54
|
+
accordionStyle="plain"
|
|
55
|
+
label="?"
|
|
56
|
+
className="keyword-accordion"
|
|
57
|
+
>
|
|
58
|
+
{tipContent}
|
|
59
|
+
</AccordionTab>
|
|
60
|
+
</AccordionWrap>
|
|
61
|
+
)
|
|
62
|
+
: null}
|
|
63
|
+
</label>
|
|
64
|
+
)
|
|
65
|
+
: null}
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
68
|
+
: labelStyle == "inline"
|
|
69
|
+
? (
|
|
70
|
+
<div className="form-control inline">
|
|
71
|
+
{label
|
|
72
|
+
? (
|
|
73
|
+
<label htmlFor={name}>
|
|
74
|
+
{label}
|
|
75
|
+
{tipContent
|
|
76
|
+
? (
|
|
77
|
+
<AccordionWrap>
|
|
78
|
+
<AccordionTab
|
|
79
|
+
accordionStyle="plain"
|
|
80
|
+
label="?"
|
|
81
|
+
className="keyword-accordion"
|
|
82
|
+
>
|
|
83
|
+
{tipContent}
|
|
84
|
+
</AccordionTab>
|
|
85
|
+
</AccordionWrap>
|
|
86
|
+
)
|
|
87
|
+
: null}
|
|
88
|
+
</label>
|
|
89
|
+
)
|
|
90
|
+
: null}
|
|
91
|
+
<input
|
|
92
|
+
value={value}
|
|
93
|
+
type={type}
|
|
94
|
+
name={name}
|
|
95
|
+
id={name}
|
|
96
|
+
placeholder={placeholder}
|
|
97
|
+
onChange={(e) => setValue(e.target.value)}
|
|
98
|
+
onKeyDown={onKeyDown}
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
)
|
|
102
|
+
: (
|
|
103
|
+
<div className="form-control ">
|
|
104
|
+
{label
|
|
105
|
+
? (
|
|
106
|
+
<label htmlFor={name}>
|
|
107
|
+
{label}
|
|
108
|
+
{tipContent
|
|
109
|
+
? (
|
|
110
|
+
<AccordionWrap>
|
|
111
|
+
<AccordionTab
|
|
112
|
+
accordionStyle="plain"
|
|
113
|
+
label="?"
|
|
114
|
+
className="keyword-accordion"
|
|
115
|
+
>
|
|
116
|
+
{tipContent}
|
|
117
|
+
</AccordionTab>
|
|
118
|
+
</AccordionWrap>
|
|
119
|
+
)
|
|
120
|
+
: null}
|
|
121
|
+
</label>
|
|
122
|
+
)
|
|
123
|
+
: null}
|
|
124
|
+
<input
|
|
125
|
+
value={value}
|
|
126
|
+
type={type}
|
|
127
|
+
name={name}
|
|
128
|
+
id={name}
|
|
129
|
+
placeholder={placeholder}
|
|
130
|
+
onChange={(e) => setValue(e.target.value)}
|
|
131
|
+
onKeyDown={onKeyDown}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
)}
|
|
135
|
+
</>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Input } from "../input/Input"
|
|
3
|
+
import type { InputPropsStyle } from "../input/Input"
|
|
4
|
+
import { Button } from "../button/Button"
|
|
5
|
+
export type ButtonPropsSize = "xsmall" | "small" | "medium" | "large"
|
|
6
|
+
import "./term-search.scss"
|
|
7
|
+
|
|
8
|
+
export interface TermSearchProps {
|
|
9
|
+
setTermValue: (string) => void
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
pushTerm: React.Dispatch<React.SetStateAction<any[]>>
|
|
12
|
+
allTerms: string[]
|
|
13
|
+
className?: string
|
|
14
|
+
type?: string
|
|
15
|
+
label?: string
|
|
16
|
+
placeholder?: string
|
|
17
|
+
labelStyle?: InputPropsStyle
|
|
18
|
+
name?: string
|
|
19
|
+
termValue: string
|
|
20
|
+
primary?: boolean
|
|
21
|
+
color?: string
|
|
22
|
+
icon?: string
|
|
23
|
+
iconSize?: string
|
|
24
|
+
size?: ButtonPropsSize
|
|
25
|
+
removeFilterItem?(param, value): void
|
|
26
|
+
tipContent?: React.ReactNode
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const TermSearch = ({
|
|
30
|
+
className,
|
|
31
|
+
termValue,
|
|
32
|
+
setTermValue,
|
|
33
|
+
pushTerm,
|
|
34
|
+
allTerms,
|
|
35
|
+
type,
|
|
36
|
+
label,
|
|
37
|
+
placeholder,
|
|
38
|
+
labelStyle,
|
|
39
|
+
name,
|
|
40
|
+
color,
|
|
41
|
+
icon,
|
|
42
|
+
size,
|
|
43
|
+
iconSize,
|
|
44
|
+
tipContent,
|
|
45
|
+
removeFilterItem,
|
|
46
|
+
}: TermSearchProps) => {
|
|
47
|
+
const emptyOrWhitespace = /^\s*$/
|
|
48
|
+
const disabled = emptyOrWhitespace.test(termValue) ||
|
|
49
|
+
allTerms.includes(termValue)
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<div className={className + " term-input"}>
|
|
53
|
+
<Input
|
|
54
|
+
type={type}
|
|
55
|
+
label={label}
|
|
56
|
+
placeholder={placeholder}
|
|
57
|
+
labelStyle={labelStyle}
|
|
58
|
+
name={name}
|
|
59
|
+
value={termValue}
|
|
60
|
+
setValue={setTermValue}
|
|
61
|
+
tipContent={tipContent}
|
|
62
|
+
onKeyDown={(e) =>
|
|
63
|
+
e.keyCode === 13 &&
|
|
64
|
+
!disabled &&
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
+
pushTerm(termValue as React.SetStateAction<any>)}
|
|
67
|
+
/>
|
|
68
|
+
<Button
|
|
69
|
+
primary={true}
|
|
70
|
+
disabled={disabled}
|
|
71
|
+
color={color}
|
|
72
|
+
icon={icon}
|
|
73
|
+
iconOnly={true}
|
|
74
|
+
iconSize={iconSize}
|
|
75
|
+
size={size}
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
|
+
onClick={() => pushTerm(termValue as React.SetStateAction<any>)}
|
|
78
|
+
label="Add Term"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
{allTerms.length
|
|
82
|
+
? (
|
|
83
|
+
<div className="term-block">
|
|
84
|
+
<ul className="active-search-terms">
|
|
85
|
+
{allTerms.map((term, index) => (
|
|
86
|
+
<li key={index}>
|
|
87
|
+
<span>
|
|
88
|
+
{term}
|
|
89
|
+
<span onClick={() => removeFilterItem(name, term)}>
|
|
90
|
+
×
|
|
91
|
+
</span>
|
|
92
|
+
</span>
|
|
93
|
+
</li>
|
|
94
|
+
))}
|
|
95
|
+
</ul>
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
: null}
|
|
99
|
+
</>
|
|
100
|
+
)
|
|
101
|
+
}
|