@openneuro/app 4.33.4 → 4.34.0-alpha.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,147 @@
|
|
|
1
|
+
@import '../scss/variables';
|
|
2
|
+
|
|
3
|
+
form,
|
|
4
|
+
fieldset {
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
border-style: none;
|
|
8
|
+
}
|
|
9
|
+
input:not([type='range'], [type='checkbox'], [type='radio']),
|
|
10
|
+
input[type='text'],
|
|
11
|
+
input[type='tel'],
|
|
12
|
+
input[type='email'],
|
|
13
|
+
input[type='search'],
|
|
14
|
+
input[type='password'],
|
|
15
|
+
textarea {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
appearance: none;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
border: 1px solid $newspaper;
|
|
21
|
+
padding: 10px 12px;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
line-height: 12px;
|
|
24
|
+
&:focus {
|
|
25
|
+
border-color: rgb(76, 104, 230);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&::placeholder {
|
|
29
|
+
color: rgb(160, 160, 160);
|
|
30
|
+
opacity: 1; /* Firefox */
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input[type='search'] {
|
|
35
|
+
&::-webkit-search-cancel-button {
|
|
36
|
+
-webkit-appearance: none;
|
|
37
|
+
background: url('../assets/close-button.png') no-repeat center;
|
|
38
|
+
background-size: contain;
|
|
39
|
+
height: 10px;
|
|
40
|
+
width: 10px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
select {
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
-webkit-appearance: none;
|
|
47
|
+
border: 1px solid $newspaper;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
textarea {
|
|
51
|
+
resize: vertical;
|
|
52
|
+
vertical-align: top;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
input[type='button'],
|
|
56
|
+
input[type='reset'],
|
|
57
|
+
input[type='file'],
|
|
58
|
+
input[type='submit'] {
|
|
59
|
+
appearance: none;
|
|
60
|
+
border-radius: 0;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.form-control {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
label {
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
margin-bottom: 10px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.form-control.inline {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
label {
|
|
77
|
+
padding: 12px 10px 0 0;
|
|
78
|
+
min-width: 100px;
|
|
79
|
+
text-align: right;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.float-form-style.form-control {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-flow: column-reverse;
|
|
86
|
+
margin-bottom: 1em;
|
|
87
|
+
|
|
88
|
+
label,
|
|
89
|
+
input,
|
|
90
|
+
textarea {
|
|
91
|
+
transition: all 0.2s;
|
|
92
|
+
touch-action: manipulation;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
input,
|
|
96
|
+
textarea {
|
|
97
|
+
border-radius: 0;
|
|
98
|
+
cursor: text;
|
|
99
|
+
z-index: 2;
|
|
100
|
+
background: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
label {
|
|
104
|
+
z-index: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
textarea:placeholder-shown,
|
|
108
|
+
input:placeholder-shown {
|
|
109
|
+
+ label {
|
|
110
|
+
cursor: text;
|
|
111
|
+
max-width: 66.66%;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
text-overflow: ellipsis;
|
|
115
|
+
transform-origin: left bottom;
|
|
116
|
+
transform: translate(12px, 36px) scale(1.5);
|
|
117
|
+
font-size: 13px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
textarea,
|
|
121
|
+
input {
|
|
122
|
+
&::-moz-placeholder {
|
|
123
|
+
opacity: 0;
|
|
124
|
+
transition: inherit;
|
|
125
|
+
}
|
|
126
|
+
&::-webkit-input-placeholder {
|
|
127
|
+
opacity: 0;
|
|
128
|
+
transition: inherit;
|
|
129
|
+
}
|
|
130
|
+
&:focus::-moz-placeholder {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
133
|
+
&:focus::-webkit-input-placeholder {
|
|
134
|
+
opacity: 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
textarea:not(:placeholder-shown),
|
|
138
|
+
textarea:focus,
|
|
139
|
+
input:not(:placeholder-shown),
|
|
140
|
+
input:focus {
|
|
141
|
+
+ label {
|
|
142
|
+
transform: translate(0, 0) scale(1);
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@import "../scss/variables";
|
|
2
|
+
|
|
3
|
+
.term-input {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: flex-end;
|
|
7
|
+
|
|
8
|
+
.form-control {
|
|
9
|
+
flex-grow: 1;
|
|
10
|
+
margin-right: 10px;
|
|
11
|
+
}
|
|
12
|
+
@media (max-width: 450px) {
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
.on-button {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
.form-control {
|
|
18
|
+
margin: 0 0 10px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.term-block {
|
|
24
|
+
margin: 0 0 30px;
|
|
25
|
+
position: relative;
|
|
26
|
+
.active-search-terms {
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0 20px 0 0;
|
|
29
|
+
list-style: none;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
align-items: center;
|
|
33
|
+
li {
|
|
34
|
+
margin-right: 10px;
|
|
35
|
+
margin-bottom: 15px;
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
line-height: 1.7em;
|
|
38
|
+
&:last-child {
|
|
39
|
+
margin-right: 0;
|
|
40
|
+
}
|
|
41
|
+
strong {
|
|
42
|
+
margin-right: 10px;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
color: #777;
|
|
45
|
+
}
|
|
46
|
+
> span {
|
|
47
|
+
word-break: break-word;
|
|
48
|
+
display: flex;
|
|
49
|
+
padding: 6px 10px;
|
|
50
|
+
color: #fff;
|
|
51
|
+
border-radius: $border-radius-default;
|
|
52
|
+
background-color: $chiclet-color;
|
|
53
|
+
transition: background-color 0.3s;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: darken($chiclet-color, 10%);
|
|
58
|
+
}
|
|
59
|
+
span {
|
|
60
|
+
color: #fff;
|
|
61
|
+
font-size: 22px;
|
|
62
|
+
margin-left: 8px;
|
|
63
|
+
margin-top: -1px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import "./json-tree.scss"
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
title: string
|
|
6
|
+
expanded?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface State {
|
|
10
|
+
isOpen: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class ExpandableProperty extends React.Component<Props, State> {
|
|
14
|
+
state = {
|
|
15
|
+
isOpen: !!this.props.expanded,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
render() {
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<div
|
|
22
|
+
className="expand-prop-name"
|
|
23
|
+
onClick={() => this.setState({ isOpen: !this.state.isOpen })}
|
|
24
|
+
>
|
|
25
|
+
{this.props.title}
|
|
26
|
+
{this.state.isOpen ? "-" : "+"}
|
|
27
|
+
</div>
|
|
28
|
+
{this.state.isOpen ? this.props.children : null}
|
|
29
|
+
{React.Children.count(this.props.children) === 0 && this.state.isOpen
|
|
30
|
+
? "The list is empty!"
|
|
31
|
+
: null}
|
|
32
|
+
</>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import ExpandableProperty from "./ExpandableProperty"
|
|
3
|
+
import "./json-tree.scss"
|
|
4
|
+
|
|
5
|
+
const camelCaseToNormal = (str: string) =>
|
|
6
|
+
str.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase())
|
|
7
|
+
|
|
8
|
+
interface IterableObject {
|
|
9
|
+
[s: number]: number | string | boolean | IterableObject
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
property: number | string | boolean | IterableObject
|
|
14
|
+
propertyName: string
|
|
15
|
+
emptyPropertyLabel?: string
|
|
16
|
+
rootProperty?: boolean
|
|
17
|
+
propertyNameProcessor?: (name: string) => string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const RecursiveProperty: React.FC<Props> = (props) => {
|
|
21
|
+
return (
|
|
22
|
+
<div className="json-container">
|
|
23
|
+
{props.property
|
|
24
|
+
? (
|
|
25
|
+
typeof props.property === "number" ||
|
|
26
|
+
typeof props.property === "string" ||
|
|
27
|
+
typeof props.property === "boolean"
|
|
28
|
+
? (
|
|
29
|
+
<>
|
|
30
|
+
<span className="prop-name">
|
|
31
|
+
{props.propertyNameProcessor!(props.propertyName)}:{" "}
|
|
32
|
+
</span>
|
|
33
|
+
{props.property.toString()}
|
|
34
|
+
</>
|
|
35
|
+
)
|
|
36
|
+
: (
|
|
37
|
+
<ExpandableProperty
|
|
38
|
+
title={props.propertyNameProcessor!(props.propertyName)}
|
|
39
|
+
expanded={!!props.rootProperty}
|
|
40
|
+
>
|
|
41
|
+
{Object.values(props.property).map(
|
|
42
|
+
/* eslint-disable-next-line */
|
|
43
|
+
(property, index, { length }) => (
|
|
44
|
+
<RecursiveProperty
|
|
45
|
+
key={index}
|
|
46
|
+
property={property}
|
|
47
|
+
propertyName={Object.getOwnPropertyNames(
|
|
48
|
+
props.property,
|
|
49
|
+
)[index]}
|
|
50
|
+
propertyNameProcessor={props.propertyNameProcessor}
|
|
51
|
+
/>
|
|
52
|
+
),
|
|
53
|
+
)}
|
|
54
|
+
</ExpandableProperty>
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
: (
|
|
58
|
+
props.emptyPropertyLabel
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RecursiveProperty.defaultProps = {
|
|
65
|
+
emptyPropertyLabel: "Property is empty",
|
|
66
|
+
propertyNameProcessor: camelCaseToNormal,
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.json-container {
|
|
2
|
+
padding-top: 10px;
|
|
3
|
+
padding-left: 3px;
|
|
4
|
+
margin-left: 10px;
|
|
5
|
+
color: #666;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
.prop-name {
|
|
8
|
+
color: black;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.expand-prop-name {
|
|
14
|
+
color: #008080;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import "./loading.scss"
|
|
3
|
+
|
|
4
|
+
export const Loading: React.FC = () => (
|
|
5
|
+
<div
|
|
6
|
+
className="cxq-spinner cxq-spinner--waveStretchDelay"
|
|
7
|
+
role="alert"
|
|
8
|
+
aria-busy="true"
|
|
9
|
+
>
|
|
10
|
+
<div className="cxq-spinner-hexagon "></div>
|
|
11
|
+
<div className="rects">
|
|
12
|
+
<div className="rect rect1"></div>
|
|
13
|
+
<div className="rect rect2"></div>
|
|
14
|
+
<div className="rect rect3"></div>
|
|
15
|
+
<div className="rect rect4"></div>
|
|
16
|
+
<div className="rect rect5"></div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { render, screen } from "@testing-library/react"
|
|
3
|
+
import { Loading } from "../Loading"
|
|
4
|
+
|
|
5
|
+
describe("Loading component", () => {
|
|
6
|
+
it("loading animation is labeled alert and aria-busy", async () => {
|
|
7
|
+
render(<Loading />)
|
|
8
|
+
const loader = await screen.getByRole("alert")
|
|
9
|
+
expect(loader).toBeInTheDocument()
|
|
10
|
+
expect(loader.hasAttribute("aria-busy")).toBe(true)
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
$spinner-base-value: 20px;
|
|
4
|
+
$spinner-width: $spinner-base-value * 2 * 1.732;
|
|
5
|
+
$spinner-height: $spinner-base-value * 2;
|
|
6
|
+
$spinner-hexagon-width: $spinner-width;
|
|
7
|
+
$spinner-hexagon-height: $spinner-height * 2;
|
|
8
|
+
$spinner-hexagon-bg-color: var(--current-theme-primary);
|
|
9
|
+
|
|
10
|
+
.cxq-spinner {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: $spinner-hexagon-width;
|
|
13
|
+
height: $spinner-hexagon-height;
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
}
|
|
16
|
+
.cxq-spinner-hexagon {
|
|
17
|
+
position: absolute;
|
|
18
|
+
width: $spinner-width;
|
|
19
|
+
height: $spinner-height;
|
|
20
|
+
border-radius: 0;
|
|
21
|
+
background: var(--current-theme-primary-light);
|
|
22
|
+
opacity: 1;
|
|
23
|
+
top: $spinner-base-value;
|
|
24
|
+
}
|
|
25
|
+
.cxq-spinner-hexagon:before,
|
|
26
|
+
.cxq-spinner-hexagon:after {
|
|
27
|
+
position: absolute;
|
|
28
|
+
width: inherit;
|
|
29
|
+
height: inherit;
|
|
30
|
+
border-radius: inherit;
|
|
31
|
+
background: inherit;
|
|
32
|
+
content: '';
|
|
33
|
+
}
|
|
34
|
+
.cxq-spinner-hexagon:before {
|
|
35
|
+
transform: rotate(60deg);
|
|
36
|
+
}
|
|
37
|
+
.cxq-spinner-hexagon:after {
|
|
38
|
+
transform: rotate(-60deg);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// rotating plane
|
|
42
|
+
.cxq-spinner--rotatePlane .cxq-spinner-hexagon {
|
|
43
|
+
animation: rotatePlane 2s infinite ease-in-out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// double bounce
|
|
47
|
+
.cxq-spinner--doubleBounce .cxq-spinner-hexagon {
|
|
48
|
+
animation: doubleBounce 2s infinite ease-in-out;
|
|
49
|
+
}
|
|
50
|
+
.cxq-spinner--doubleBounce .cxq-spinner-hexagon:nth-child(2) {
|
|
51
|
+
animation-delay: -1s;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// wave stretch
|
|
55
|
+
.cxq-spinner--waveStretchDelay .rects {
|
|
56
|
+
width: $spinner-hexagon-width;
|
|
57
|
+
height: math.div($spinner-hexagon-height, 3);
|
|
58
|
+
text-align: center;
|
|
59
|
+
position: relative;
|
|
60
|
+
top: $spinner-hexagon-height * math.div(1, 3);
|
|
61
|
+
}
|
|
62
|
+
.cxq-spinner--waveStretchDelay .rect {
|
|
63
|
+
position: relative;
|
|
64
|
+
height: 100%;
|
|
65
|
+
width: math.div($spinner-base-value, 10);
|
|
66
|
+
display: inline-block;
|
|
67
|
+
background-color: $spinner-hexagon-bg-color;
|
|
68
|
+
opacity: 1;
|
|
69
|
+
margin: 0 2px;
|
|
70
|
+
animation: waveStretchDelay 1.4s infinite ease-in-out;
|
|
71
|
+
|
|
72
|
+
&:nth-child(1) {
|
|
73
|
+
animation-delay: -1.2s;
|
|
74
|
+
}
|
|
75
|
+
&:nth-child(2) {
|
|
76
|
+
animation-delay: -1.1s;
|
|
77
|
+
}
|
|
78
|
+
&:nth-child(3) {
|
|
79
|
+
animation-delay: -1s;
|
|
80
|
+
}
|
|
81
|
+
&:nth-child(4) {
|
|
82
|
+
animation-delay: -0.9s;
|
|
83
|
+
}
|
|
84
|
+
&:nth-child(5) {
|
|
85
|
+
animation-delay: -0.8s;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes doubleBounce {
|
|
90
|
+
0%,
|
|
91
|
+
100% {
|
|
92
|
+
-webkit-transform: scale(0.2);
|
|
93
|
+
transform: scale(0.2);
|
|
94
|
+
}
|
|
95
|
+
50% {
|
|
96
|
+
-webkit-transform: scale(1);
|
|
97
|
+
transform: scale(1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes rotatePlane {
|
|
102
|
+
0% {
|
|
103
|
+
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
|
104
|
+
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
|
|
105
|
+
}
|
|
106
|
+
50% {
|
|
107
|
+
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
|
108
|
+
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
|
|
109
|
+
}
|
|
110
|
+
100% {
|
|
111
|
+
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
|
112
|
+
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@keyframes waveStretchDelay {
|
|
117
|
+
0%,
|
|
118
|
+
40%,
|
|
119
|
+
100% {
|
|
120
|
+
-webkit-transform: scaleY(0.4);
|
|
121
|
+
transform: scaleY(0.4);
|
|
122
|
+
}
|
|
123
|
+
20% {
|
|
124
|
+
-webkit-transform: scaleY(1);
|
|
125
|
+
transform: scaleY(1);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.search-loading {
|
|
130
|
+
padding-top: 100px;
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
align-items: flex-start;
|
|
134
|
+
position: absolute;
|
|
135
|
+
top: 0;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
left: 0;
|
|
138
|
+
right: 0;
|
|
139
|
+
background: rgba(255, 255, 255, 0.7);
|
|
140
|
+
z-index: 1;
|
|
141
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
import logodh from "../assets/on-dark-horz.svg"
|
|
4
|
+
import logodv from "../assets/on-dark.svg"
|
|
5
|
+
import logolh from "../assets/on-light-horz.svg"
|
|
6
|
+
import logolv from "../assets/on-light.svg"
|
|
7
|
+
|
|
8
|
+
export interface LogoProps {
|
|
9
|
+
dark?: boolean
|
|
10
|
+
width?: string
|
|
11
|
+
horizontal?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Logo: React.FC<LogoProps> = ({
|
|
15
|
+
dark = true,
|
|
16
|
+
width = "300px",
|
|
17
|
+
horizontal = true,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const logoStyle = dark && horizontal
|
|
21
|
+
? logodh
|
|
22
|
+
: horizontal
|
|
23
|
+
? logolh
|
|
24
|
+
: dark
|
|
25
|
+
? logodv
|
|
26
|
+
: logolv
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
className="logo-wrap"
|
|
31
|
+
style={{
|
|
32
|
+
width: width,
|
|
33
|
+
maxWidth: "100%",
|
|
34
|
+
}}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
<img
|
|
38
|
+
src={logoStyle}
|
|
39
|
+
loading="lazy"
|
|
40
|
+
alt="box with connection dots and lines that says openneuro next to it "
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { render, screen } from "@testing-library/react"
|
|
3
|
+
import { Logo } from "../Logo"
|
|
4
|
+
|
|
5
|
+
describe("Logo component", () => {
|
|
6
|
+
it("renders dark/horizontal", async () => {
|
|
7
|
+
render(<Logo />)
|
|
8
|
+
expect(await screen.getByRole("img")).toBeInTheDocument()
|
|
9
|
+
})
|
|
10
|
+
it("renders light/horizontal", async () => {
|
|
11
|
+
render(<Logo dark={false} />)
|
|
12
|
+
expect(await screen.getByRole("img")).toBeInTheDocument()
|
|
13
|
+
})
|
|
14
|
+
it("renders dark/vertical", async () => {
|
|
15
|
+
render(<Logo horizontal={false} />)
|
|
16
|
+
expect(await screen.getByRole("img")).toBeInTheDocument()
|
|
17
|
+
})
|
|
18
|
+
it("renders light/vertical", async () => {
|
|
19
|
+
render(<Logo dark={false} horizontal={false} />)
|
|
20
|
+
expect(await screen.getByRole("img")).toBeInTheDocument()
|
|
21
|
+
})
|
|
22
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Button } from "../button/Button"
|
|
3
|
+
import "./modal.scss"
|
|
4
|
+
|
|
5
|
+
export interface ModalProps {
|
|
6
|
+
children?: React.ReactNode
|
|
7
|
+
isOpen?: boolean
|
|
8
|
+
toggle?: () => void
|
|
9
|
+
closeText?: string
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Modal: React.FC<ModalProps> = ({
|
|
14
|
+
children,
|
|
15
|
+
isOpen,
|
|
16
|
+
toggle,
|
|
17
|
+
closeText,
|
|
18
|
+
className,
|
|
19
|
+
}) => {
|
|
20
|
+
const showModal = isOpen ? "show-modal" : "hide-modal"
|
|
21
|
+
return (
|
|
22
|
+
<div className={"modal-wrapper " + showModal + " " + className}>
|
|
23
|
+
<div className="overlay" onClick={toggle}></div>
|
|
24
|
+
|
|
25
|
+
<div className="grid modal">
|
|
26
|
+
<div className="col">
|
|
27
|
+
<span className="modal-close-x" onClick={toggle}>
|
|
28
|
+
×
|
|
29
|
+
</span>
|
|
30
|
+
<div className="grid modal-body">
|
|
31
|
+
<div className="col">{children}</div>
|
|
32
|
+
</div>
|
|
33
|
+
{closeText
|
|
34
|
+
? (
|
|
35
|
+
<div className="grid grid-end">
|
|
36
|
+
<div className="m-b-20 m-r-20">
|
|
37
|
+
<Button
|
|
38
|
+
className="modal-close-button"
|
|
39
|
+
size="small"
|
|
40
|
+
onClick={toggle}
|
|
41
|
+
label={closeText}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
: null}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
|
|
3
|
+
import { Button } from "../button/Button"
|
|
4
|
+
import { Modal } from "../modal/Modal"
|
|
5
|
+
|
|
6
|
+
export interface ModalExampleProps {
|
|
7
|
+
closeText: string
|
|
8
|
+
buttonText: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ModalExample: React.FC<ModalExampleProps> = ({
|
|
12
|
+
closeText,
|
|
13
|
+
buttonText,
|
|
14
|
+
}) => {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
16
|
+
const toggle = () => setIsOpen(!isOpen)
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<Button size="small" primary onClick={toggle} label={buttonText} />
|
|
20
|
+
<Modal isOpen={isOpen} toggle={toggle} closeText={closeText}>
|
|
21
|
+
<p>This is the content.</p>
|
|
22
|
+
</Modal>
|
|
23
|
+
</>
|
|
24
|
+
)
|
|
25
|
+
}
|