@ndla/ui 22.3.0 → 24.1.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/es/Article/ArticleAuthorContent.js +2 -4
- package/es/Article/ArticleFavoritesButton.js +2 -2
- package/es/AuthorInfo/AuthorInfo.js +29 -16
- package/es/ContentCard/ContentCard.js +66 -25
- package/es/FileList/File.js +34 -8
- package/es/FileList/FileList.js +29 -3
- package/es/InfoBox/InfoBox.js +10 -3
- package/es/InfoWidget/InfoWidget.js +67 -22
- package/es/MyNdla/Resource/FolderInput.js +19 -6
- package/es/NoContentBox/NoContentBox.js +1 -6
- package/es/Portrait/Portrait.js +19 -13
- package/es/Resource/BlockResource.js +7 -6
- package/es/Resource/ListResource.js +8 -7
- package/es/ResourceBox/ResourceBox.js +7 -35
- package/es/Search/ActiveFilterContent.js +4 -14
- package/es/Search/ActiveFilters.js +8 -19
- package/es/Search/SearchField.js +31 -52
- package/es/Search/SearchResult.js +113 -136
- package/es/Search/ToggleSearchButton.js +34 -43
- package/es/Search/index.js +2 -8
- package/es/TreeStructure/FolderItems.js +3 -3
- package/es/TreeStructure/FolderNameInput.js +32 -14
- package/es/all.css +1 -1
- package/es/index-javascript.js +0 -1
- package/es/index.js +2 -1
- package/es/locale/messages-en.js +3 -3
- package/es/locale/messages-nb.js +3 -3
- package/es/locale/messages-nn.js +3 -3
- package/es/locale/messages-se.js +3 -3
- package/es/locale/messages-sma.js +3 -3
- package/lib/Article/ArticleAuthorContent.js +9 -4
- package/lib/Article/ArticleFavoritesButton.js +2 -2
- package/lib/AuthorInfo/AuthorInfo.d.ts +1 -11
- package/lib/AuthorInfo/AuthorInfo.js +36 -20
- package/lib/ContentCard/ContentCard.d.ts +1 -15
- package/lib/ContentCard/ContentCard.js +60 -28
- package/lib/FileList/File.js +36 -12
- package/lib/FileList/FileList.js +28 -5
- package/lib/InfoBox/InfoBox.js +12 -5
- package/lib/InfoWidget/InfoWidget.js +61 -25
- package/lib/MyNdla/Resource/FolderInput.js +18 -5
- package/lib/NoContentBox/NoContentBox.js +1 -8
- package/lib/Portrait/Portrait.js +19 -14
- package/lib/Resource/BlockResource.js +7 -6
- package/lib/Resource/ListResource.js +8 -7
- package/lib/ResourceBox/ResourceBox.d.ts +1 -4
- package/lib/ResourceBox/ResourceBox.js +15 -35
- package/lib/Search/ActiveFilterContent.d.ts +13 -0
- package/lib/Search/ActiveFilterContent.js +4 -15
- package/lib/Search/ActiveFilters.d.ts +13 -0
- package/lib/Search/ActiveFilters.js +8 -20
- package/lib/Search/SearchField.d.ts +19 -0
- package/lib/Search/SearchField.js +32 -56
- package/lib/Search/SearchResult.d.ts +36 -0
- package/lib/Search/SearchResult.js +116 -159
- package/lib/Search/ToggleSearchButton.d.ts +16 -0
- package/lib/Search/ToggleSearchButton.js +36 -46
- package/lib/Search/index.d.ts +12 -0
- package/lib/Search/index.js +0 -54
- package/lib/SearchTypeResult/SearchTypeHeader.d.ts +1 -1
- package/lib/TreeStructure/FolderItems.js +3 -3
- package/lib/TreeStructure/FolderNameInput.js +34 -14
- package/lib/TreeStructure/types.d.ts +1 -1
- package/lib/all.css +1 -1
- package/lib/index-javascript.js +0 -74
- package/lib/index.d.ts +1 -0
- package/lib/index.js +38 -1
- package/lib/locale/messages-en.js +3 -3
- package/lib/locale/messages-nb.js +3 -3
- package/lib/locale/messages-nn.js +3 -3
- package/lib/locale/messages-se.js +3 -3
- package/lib/locale/messages-sma.js +3 -3
- package/package.json +10 -10
- package/src/Article/ArticleAuthorContent.tsx +1 -1
- package/src/Article/ArticleFavoritesButton.tsx +2 -2
- package/src/AuthorInfo/AuthorInfo.tsx +53 -19
- package/src/ContentCard/ContentCard.tsx +127 -35
- package/src/FileList/File.tsx +47 -17
- package/src/FileList/FileList.tsx +37 -8
- package/src/InfoBox/InfoBox.tsx +24 -4
- package/src/InfoWidget/InfoWidget.tsx +83 -34
- package/src/MyNdla/Resource/FolderInput.tsx +18 -3
- package/src/NoContentBox/NoContentBox.tsx +2 -7
- package/src/Portrait/Portrait.tsx +25 -10
- package/src/Resource/BlockResource.tsx +1 -1
- package/src/Resource/ListResource.tsx +3 -1
- package/src/ResourceBox/ResourceBox.tsx +1 -20
- package/src/Search/{ActiveFilterContent.jsx → ActiveFilterContent.tsx} +11 -12
- package/src/Search/{ActiveFilters.jsx → ActiveFilters.tsx} +20 -17
- package/src/Search/{SearchField.jsx → SearchField.tsx} +58 -68
- package/src/Search/SearchResult.tsx +360 -0
- package/src/Search/ToggleSearchButton.tsx +73 -0
- package/src/Search/component.search.scss +0 -4
- package/src/Search/index.ts +16 -0
- package/src/SectionHeading/SectionHeading.tsx +1 -0
- package/src/TreeStructure/FolderItems.tsx +1 -1
- package/src/TreeStructure/FolderNameInput.tsx +33 -9
- package/src/TreeStructure/types.ts +1 -1
- package/src/all.scss +0 -1
- package/src/index-javascript.js +0 -15
- package/src/index.ts +2 -0
- package/src/locale/messages-en.ts +3 -3
- package/src/locale/messages-nb.ts +3 -3
- package/src/locale/messages-nn.ts +3 -3
- package/src/locale/messages-se.ts +3 -3
- package/src/locale/messages-sma.ts +3 -3
- package/src/main.scss +0 -8
- package/es/BackgroundImage/BackgroundImage.js +0 -27
- package/es/BackgroundImage/index.js +0 -2
- package/es/Search/SearchFilter.js +0 -72
- package/es/Search/SearchFilterList.js +0 -115
- package/es/Search/SearchOverlay.js +0 -39
- package/es/Search/SearchPage.js +0 -178
- package/es/Search/SearchPopoverFilter.js +0 -152
- package/es/Search/SearchResultAuthor.js +0 -51
- package/lib/BackgroundImage/BackgroundImage.d.ts +0 -12
- package/lib/BackgroundImage/BackgroundImage.js +0 -40
- package/lib/BackgroundImage/index.d.ts +0 -2
- package/lib/BackgroundImage/index.js +0 -13
- package/lib/Search/SearchFilter.js +0 -88
- package/lib/Search/SearchFilterList.js +0 -137
- package/lib/Search/SearchOverlay.js +0 -62
- package/lib/Search/SearchPage.js +0 -207
- package/lib/Search/SearchPopoverFilter.js +0 -172
- package/lib/Search/SearchResultAuthor.js +0 -60
- package/src/AuthorInfo/component.author-info.scss +0 -54
- package/src/BackgroundImage/BackgroundImage.tsx +0 -32
- package/src/BackgroundImage/component.background-image.scss +0 -52
- package/src/BackgroundImage/index.ts +0 -3
- package/src/ContentCard/component.content-card.scss +0 -109
- package/src/FileList/component.file-list.scss +0 -102
- package/src/InfoBox/component.info-box.scss +0 -21
- package/src/InfoWidget/component.info-widget.scss +0 -52
- package/src/NoContentBox/component.no-content-box.scss +0 -17
- package/src/Portrait/component.portrait.scss +0 -29
- package/src/Search/SearchFilter.jsx +0 -82
- package/src/Search/SearchFilterList.jsx +0 -110
- package/src/Search/SearchOverlay.jsx +0 -38
- package/src/Search/SearchPage.jsx +0 -178
- package/src/Search/SearchPopoverFilter.jsx +0 -109
- package/src/Search/SearchResult.jsx +0 -239
- package/src/Search/SearchResultAuthor.jsx +0 -54
- package/src/Search/ToggleSearchButton.jsx +0 -64
- package/src/Search/component.search-filter.scss +0 -67
- package/src/Search/component.search-overlay.scss +0 -103
- package/src/Search/component.search-page.scss +0 -125
- package/src/Search/component.search-result-author.scss +0 -65
- package/src/Search/index.js +0 -34
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
.c-author-info {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: flex-start;
|
|
12
|
-
padding-bottom: $spacing--large;
|
|
13
|
-
font-family: $font;
|
|
14
|
-
&__portrait-image {
|
|
15
|
-
margin-right: $spacing--large;
|
|
16
|
-
@include mq($until: desktop) {
|
|
17
|
-
margin-right: $spacing--medium;
|
|
18
|
-
width: 7rem;
|
|
19
|
-
height: 7rem;
|
|
20
|
-
span {
|
|
21
|
-
width: 7rem;
|
|
22
|
-
height: 7rem;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
@include mq($until: tablet) {
|
|
26
|
-
margin-right: $spacing--small;
|
|
27
|
-
width: 4rem;
|
|
28
|
-
height: 4rem;
|
|
29
|
-
span {
|
|
30
|
-
width: 4rem;
|
|
31
|
-
height: 4rem;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
&__heading {
|
|
36
|
-
margin: 0 0 $spacing--small;
|
|
37
|
-
@include mq($until: desktop) {
|
|
38
|
-
@include font-size(22px, 22px);
|
|
39
|
-
}
|
|
40
|
-
@include mq($until: tablet) {
|
|
41
|
-
@include font-size(18px, 18px);
|
|
42
|
-
margin-bottom: $spacing--small / 2;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
p, a {
|
|
46
|
-
margin: 0;
|
|
47
|
-
@include mq($until: tablet) {
|
|
48
|
-
@include font-size(14px, 22px);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
&__readmore {
|
|
52
|
-
margin: $spacing 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BEMHelper from 'react-bem-helper';
|
|
3
|
-
|
|
4
|
-
const classes = BEMHelper('c-background-image');
|
|
5
|
-
|
|
6
|
-
type ImageType = 'mobile' | 'tablet' | 'desktop' | 'wide';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
showOverlay?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
images: {
|
|
12
|
-
url: string;
|
|
13
|
-
types: ImageType[];
|
|
14
|
-
}[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const BackgroundImage = ({ images, showOverlay = false }: Props) => (
|
|
18
|
-
<div {...classes('', { showOverlay })}>
|
|
19
|
-
{images &&
|
|
20
|
-
images.map((image) =>
|
|
21
|
-
image.types.map((type) => (
|
|
22
|
-
<div
|
|
23
|
-
key={`${image.url}${type}`}
|
|
24
|
-
{...classes('background', type)}
|
|
25
|
-
style={{ backgroundImage: `url(${image.url})` }}
|
|
26
|
-
/>
|
|
27
|
-
)),
|
|
28
|
-
)}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export default BackgroundImage;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
.c-background-image {
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: 0;
|
|
4
|
-
bottom: 0;
|
|
5
|
-
left: 0;
|
|
6
|
-
right: 0;
|
|
7
|
-
|
|
8
|
-
&--showOverlay {
|
|
9
|
-
.c-background-image__background:after {
|
|
10
|
-
content: '';
|
|
11
|
-
position: absolute;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
background: rgba(0, 0, 0, 0.3);
|
|
15
|
-
z-index: 0;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&__background {
|
|
20
|
-
position: absolute;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
background-size: cover;
|
|
24
|
-
background-repeat: no-repeat;
|
|
25
|
-
background-position: center;
|
|
26
|
-
|
|
27
|
-
&--mobile {
|
|
28
|
-
display: none;
|
|
29
|
-
@include mq($from: mobile, $until: tablet) {
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
&--tablet {
|
|
34
|
-
display: none;
|
|
35
|
-
@include mq($from: tablet, $until: desktop) {
|
|
36
|
-
display: block;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
&--desktop {
|
|
40
|
-
display: none;
|
|
41
|
-
@include mq($from: desktop, $until: wide) {
|
|
42
|
-
display: block;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
&--wide {
|
|
46
|
-
display: none;
|
|
47
|
-
@include mq($from: wide) {
|
|
48
|
-
display: block;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
.c-content-card {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: block;
|
|
4
|
-
width: 100%;
|
|
5
|
-
|
|
6
|
-
&__image-wrapper {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 72px;
|
|
9
|
-
border-radius: 5px;
|
|
10
|
-
position: relative;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
background: $background-color--gray-dark;
|
|
13
|
-
|
|
14
|
-
@include mq(tablet) {
|
|
15
|
-
height: $spacing--large * 2.5;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&__link {
|
|
20
|
-
color: $primary-color;
|
|
21
|
-
&:hover,
|
|
22
|
-
&:focus {
|
|
23
|
-
.c-content-card__heading {
|
|
24
|
-
text-decoration: underline;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__type {
|
|
30
|
-
@include inuit-font-size(12px, 20px);
|
|
31
|
-
position: absolute;
|
|
32
|
-
left: $spacing--small;
|
|
33
|
-
bottom: $spacing--small;
|
|
34
|
-
display: inline-block;
|
|
35
|
-
background: $brand-grey--lightest;
|
|
36
|
-
border-radius: 2px;
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
margin: 0;
|
|
39
|
-
padding: 0 $spacing--small/3;
|
|
40
|
-
|
|
41
|
-
display: none;
|
|
42
|
-
|
|
43
|
-
@include mq(tablet) {
|
|
44
|
-
display: inline-block;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&__heading {
|
|
49
|
-
font-weight: $font-weight-semibold;
|
|
50
|
-
@include font-size(14px, 16px);
|
|
51
|
-
margin: $spacing--small / 2 0;
|
|
52
|
-
color: $brand-color;
|
|
53
|
-
|
|
54
|
-
@include mq(tablet) {
|
|
55
|
-
margin: $spacing--small 0 $spacing--small / 2;
|
|
56
|
-
@include font-size(20px, 22px);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&__description {
|
|
61
|
-
@include inuit-font-size(16px);
|
|
62
|
-
line-height: 1.25rem;
|
|
63
|
-
// font-family: $font-serif;
|
|
64
|
-
margin: 0;
|
|
65
|
-
display: none;
|
|
66
|
-
|
|
67
|
-
@include mq(tablet) {
|
|
68
|
-
display: block;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&__play-background {
|
|
73
|
-
position: absolute;
|
|
74
|
-
left: 50%;
|
|
75
|
-
top: 50%;
|
|
76
|
-
transform: translate3d(-50%, -50%, 0);
|
|
77
|
-
height: 35px;
|
|
78
|
-
width: 35px;
|
|
79
|
-
background-color: rgba(0, 0, 0, 0.48);
|
|
80
|
-
border-radius: 100%;
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
justify-content: center;
|
|
84
|
-
|
|
85
|
-
@include mq(tablet) {
|
|
86
|
-
height: 42px;
|
|
87
|
-
width: 42px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.c-icon {
|
|
91
|
-
color: $white;
|
|
92
|
-
height: 20px;
|
|
93
|
-
width: 20px;
|
|
94
|
-
margin-right: -1px;
|
|
95
|
-
|
|
96
|
-
@include mq(tablet) {
|
|
97
|
-
height: 25px;
|
|
98
|
-
width: 25px;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
&__background-image {
|
|
103
|
-
display: flex;
|
|
104
|
-
height: 100%;
|
|
105
|
-
width: 100%;
|
|
106
|
-
background-position: center center;
|
|
107
|
-
background-size: cover;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
.c-file-list {
|
|
2
|
-
margin: $spacing--large 0;
|
|
3
|
-
padding: $spacing--small 0 $spacing $spacing;
|
|
4
|
-
border-left: 2px solid $brand-grey--lightest;
|
|
5
|
-
font-family: $font;
|
|
6
|
-
|
|
7
|
-
&__heading {
|
|
8
|
-
@include font-size(16px, 18px);
|
|
9
|
-
letter-spacing: 0.05em;
|
|
10
|
-
margin: 0 0 $spacing--small / 2 0;
|
|
11
|
-
padding-bottom: $spacing--small / 2;
|
|
12
|
-
|
|
13
|
-
border-bottom: 2px solid $brand-grey--light;
|
|
14
|
-
font-weight: $font-weight-bold;
|
|
15
|
-
text-transform: uppercase;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&__files {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&__item {
|
|
24
|
-
@include font-size(18px, 26px);
|
|
25
|
-
font-weight: $font-weight-semibold;
|
|
26
|
-
min-height: 60px;
|
|
27
|
-
background: $brand-grey--lighter;
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: center;
|
|
30
|
-
flex-wrap: wrap;
|
|
31
|
-
margin-bottom: $spacing--small / 2;
|
|
32
|
-
padding: $spacing--small;
|
|
33
|
-
|
|
34
|
-
@include mq(tablet) {
|
|
35
|
-
padding: $spacing--small $spacing;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&__link {
|
|
40
|
-
box-shadow: none;
|
|
41
|
-
position: relative;
|
|
42
|
-
color: $brand-color;
|
|
43
|
-
margin-right: $spacing;
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
|
|
47
|
-
&:last-child {
|
|
48
|
-
margin-right: 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:hover,
|
|
52
|
-
&:focus,
|
|
53
|
-
&:active {
|
|
54
|
-
.c-file-list__link-text {
|
|
55
|
-
& > span {
|
|
56
|
-
box-shadow: $link--hover;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&__link-text {
|
|
63
|
-
& > span {
|
|
64
|
-
box-shadow: $link;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&__tooltip {
|
|
69
|
-
position: absolute;
|
|
70
|
-
display: none;
|
|
71
|
-
left: 50%;
|
|
72
|
-
top: -$spacing--small;
|
|
73
|
-
transform: translate3d(-50%, -100%, 0);
|
|
74
|
-
width: 300px;
|
|
75
|
-
text-align: center;
|
|
76
|
-
z-index: 1;
|
|
77
|
-
|
|
78
|
-
&[aria-hidden='false'] {
|
|
79
|
-
display: block;
|
|
80
|
-
animation-name: fadeIn;
|
|
81
|
-
animation-duration: 0.3s;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&__tooltip-text {
|
|
86
|
-
display: inline-block;
|
|
87
|
-
text-align: left;
|
|
88
|
-
background: $brand-color;
|
|
89
|
-
padding: $spacing--small;
|
|
90
|
-
@include font-size(14px, 18px);
|
|
91
|
-
font-weight: $font-weight-normal;
|
|
92
|
-
color: $white;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.c-icon {
|
|
96
|
-
margin-top: 3px;
|
|
97
|
-
flex-shrink: 0;
|
|
98
|
-
margin-right: $spacing--small;
|
|
99
|
-
height: 18px;
|
|
100
|
-
width: 18px;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.c-info-box {
|
|
2
|
-
background: $yellow-light;
|
|
3
|
-
padding: $spacing--small $spacing;
|
|
4
|
-
font-family: $font;
|
|
5
|
-
@include font-size(14px, 18px);
|
|
6
|
-
|
|
7
|
-
margin-bottom: $spacing--medium;
|
|
8
|
-
|
|
9
|
-
@include mq(tablet) {
|
|
10
|
-
@include font-size(16px, 20px);
|
|
11
|
-
padding: $spacing;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
& > *:first-child {
|
|
15
|
-
margin-top: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
& > *:last-child {
|
|
19
|
-
margin-bottom: 0;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
.c-info-widget {
|
|
2
|
-
max-width: 600px;
|
|
3
|
-
|
|
4
|
-
&--center {
|
|
5
|
-
margin: 0 auto;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
&__description {
|
|
9
|
-
padding: $spacing;
|
|
10
|
-
background: $brand-color--lighter;
|
|
11
|
-
color: $brand-color--dark;
|
|
12
|
-
@include font-size(18px, 26px);
|
|
13
|
-
|
|
14
|
-
p {
|
|
15
|
-
margin-top: 0;
|
|
16
|
-
|
|
17
|
-
&:last-child {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&__links {
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: flex-end;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&__main-link {
|
|
30
|
-
color: $brand-color--dark;
|
|
31
|
-
@include font-size(16px, 24px);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__icon-link {
|
|
35
|
-
width: 47px;
|
|
36
|
-
height: 47px;
|
|
37
|
-
border-radius: 100%;
|
|
38
|
-
background: $brand-color--lighter;
|
|
39
|
-
color: $brand-color--dark;
|
|
40
|
-
box-shadow: none;
|
|
41
|
-
display: flex;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
align-items: center;
|
|
44
|
-
|
|
45
|
-
.c-icon {
|
|
46
|
-
width: 20px;
|
|
47
|
-
height: 20px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
margin-right: $spacing--small;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
** NO CONTENT BOX
|
|
3
|
-
** No content found in lists (used by Topic and resources lists)
|
|
4
|
-
**/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.c-no-content-box {
|
|
8
|
-
background: $brand-grey--lightest;
|
|
9
|
-
border: 1px dashed $brand-color--light;
|
|
10
|
-
text-align: center;
|
|
11
|
-
padding: $spacing--small $spacing--small $spacing;
|
|
12
|
-
font-family: $font;
|
|
13
|
-
p {
|
|
14
|
-
@include font-size(16px, 18px);
|
|
15
|
-
margin: $spacing--small;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
.c-portrait {
|
|
2
|
-
width: 7rem;
|
|
3
|
-
height: 7rem;
|
|
4
|
-
span {
|
|
5
|
-
display: block;
|
|
6
|
-
border-radius: 50%;
|
|
7
|
-
background-color: rgba(0,0,0,0.16);
|
|
8
|
-
background-size: cover;
|
|
9
|
-
background-position: center center;
|
|
10
|
-
width: 7rem;
|
|
11
|
-
height: 7rem;
|
|
12
|
-
}
|
|
13
|
-
&--small {
|
|
14
|
-
width: 4rem;
|
|
15
|
-
height: 4rem;
|
|
16
|
-
span {
|
|
17
|
-
width: 4rem;
|
|
18
|
-
height: 4rem;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
&--large {
|
|
22
|
-
width: 10rem;
|
|
23
|
-
height: 10rem;
|
|
24
|
-
span {
|
|
25
|
-
width: 10rem;
|
|
26
|
-
height: 10rem;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BEMHelper from 'react-bem-helper';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import { FilterList } from '../Filter';
|
|
6
|
-
|
|
7
|
-
const searchFilterClasses = BEMHelper({
|
|
8
|
-
prefix: 'c-',
|
|
9
|
-
name: 'search-filter',
|
|
10
|
-
outputIsString: true,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const valueShape = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
|
14
|
-
|
|
15
|
-
const SearchFilter = ({
|
|
16
|
-
label,
|
|
17
|
-
options,
|
|
18
|
-
values,
|
|
19
|
-
defaultVisibleCount,
|
|
20
|
-
showLabel,
|
|
21
|
-
hideLabel,
|
|
22
|
-
narrowScreenOnly,
|
|
23
|
-
contextFilter,
|
|
24
|
-
onChange,
|
|
25
|
-
noFilterSelectedLabel,
|
|
26
|
-
children,
|
|
27
|
-
}) => {
|
|
28
|
-
const modifiers = [];
|
|
29
|
-
|
|
30
|
-
if (narrowScreenOnly) {
|
|
31
|
-
modifiers.push('narrow-screen-only');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (contextFilter) {
|
|
35
|
-
modifiers.push('context-filter');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div className={searchFilterClasses('', modifiers)}>
|
|
40
|
-
<FilterList
|
|
41
|
-
options={options}
|
|
42
|
-
label={label}
|
|
43
|
-
labelNotVisible={contextFilter}
|
|
44
|
-
values={values}
|
|
45
|
-
defaultVisibleCount={defaultVisibleCount}
|
|
46
|
-
modifiers={!contextFilter ? 'search' : null}
|
|
47
|
-
showLabel={showLabel}
|
|
48
|
-
hideLabel={hideLabel}
|
|
49
|
-
onChange={onChange}
|
|
50
|
-
alignedGroup
|
|
51
|
-
noFilterSelectedLabel={noFilterSelectedLabel}
|
|
52
|
-
/>
|
|
53
|
-
{children}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
SearchFilter.propTypes = {
|
|
59
|
-
label: PropTypes.string.isRequired,
|
|
60
|
-
options: PropTypes.arrayOf(
|
|
61
|
-
PropTypes.shape({
|
|
62
|
-
value: valueShape.isRequired,
|
|
63
|
-
title: PropTypes.string.isRequired,
|
|
64
|
-
noResults: PropTypes.bool,
|
|
65
|
-
}),
|
|
66
|
-
).isRequired,
|
|
67
|
-
values: PropTypes.arrayOf(valueShape),
|
|
68
|
-
defaultVisibleCount: PropTypes.number,
|
|
69
|
-
onChange: PropTypes.func,
|
|
70
|
-
showLabel: PropTypes.string,
|
|
71
|
-
hideLabel: PropTypes.string,
|
|
72
|
-
narrowScreenOnly: PropTypes.bool,
|
|
73
|
-
noFilterSelectedLabel: PropTypes.string,
|
|
74
|
-
contextFilter: PropTypes.bool,
|
|
75
|
-
children: PropTypes.node,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
SearchFilter.defaultProps = {
|
|
79
|
-
values: [],
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default SearchFilter;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import BEMHelper from 'react-bem-helper';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import { FilterList, ToggleItem } from '../Filter';
|
|
6
|
-
|
|
7
|
-
const searchFilterClasses = BEMHelper({
|
|
8
|
-
prefix: 'c-',
|
|
9
|
-
name: 'search-filter',
|
|
10
|
-
outputIsString: true,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const valueShape = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
|
|
14
|
-
|
|
15
|
-
const SearchFilterList = ({
|
|
16
|
-
label,
|
|
17
|
-
options,
|
|
18
|
-
values,
|
|
19
|
-
narrowScreenOnly,
|
|
20
|
-
onChange,
|
|
21
|
-
onSubfilterChange,
|
|
22
|
-
preid,
|
|
23
|
-
noFilterSelectedLabel,
|
|
24
|
-
subjectValues,
|
|
25
|
-
children,
|
|
26
|
-
}) => {
|
|
27
|
-
return (
|
|
28
|
-
<div className={searchFilterClasses('')}>
|
|
29
|
-
<div>
|
|
30
|
-
{options.map((option, index) => {
|
|
31
|
-
const itemModifiers = [];
|
|
32
|
-
const checked = values.some((value) => value === option.value);
|
|
33
|
-
|
|
34
|
-
if (!checked && index + 1 > this.state.visibleCount) {
|
|
35
|
-
itemModifiers.push('hidden');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const disabled = option.noResults || option.hits === 0;
|
|
39
|
-
|
|
40
|
-
if (disabled) {
|
|
41
|
-
itemModifiers.push('no-results');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Fragment key={option.value}>
|
|
46
|
-
<ToggleItem
|
|
47
|
-
modifiers={itemModifiers}
|
|
48
|
-
id={preid + option.value}
|
|
49
|
-
value={option.value}
|
|
50
|
-
disabled={disabled}
|
|
51
|
-
tabIndex={disabled ? -1 : 0}
|
|
52
|
-
checked={checked}
|
|
53
|
-
icon={option.icon}
|
|
54
|
-
label={option.title}
|
|
55
|
-
component="div"
|
|
56
|
-
onChange={(event) => {
|
|
57
|
-
let newValues = null;
|
|
58
|
-
if (event.currentTarget.checked) {
|
|
59
|
-
newValues = [...values, option.value];
|
|
60
|
-
} else {
|
|
61
|
-
newValues = values.filter((value) => value !== option.value);
|
|
62
|
-
}
|
|
63
|
-
if (onChange) {
|
|
64
|
-
onChange(newValues, option.value);
|
|
65
|
-
}
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
<div className={searchFilterClasses()}>
|
|
69
|
-
<FilterList
|
|
70
|
-
options={option.subjectFilters}
|
|
71
|
-
label={label}
|
|
72
|
-
labelNotVisible
|
|
73
|
-
values={subjectValues[option.value]}
|
|
74
|
-
onChange={(subjectFilters, subjectFilter) =>
|
|
75
|
-
onSubfilterChange(option.value, subjectFilters, subjectFilter)
|
|
76
|
-
}
|
|
77
|
-
alignedGroup
|
|
78
|
-
noFilterSelectedLabel={noFilterSelectedLabel}
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
</Fragment>
|
|
82
|
-
);
|
|
83
|
-
})}
|
|
84
|
-
</div>
|
|
85
|
-
{children}
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
SearchFilterList.propTypes = {
|
|
91
|
-
label: PropTypes.string.isRequired,
|
|
92
|
-
options: PropTypes.arrayOf(
|
|
93
|
-
PropTypes.shape({
|
|
94
|
-
value: valueShape.isRequired,
|
|
95
|
-
title: PropTypes.string.isRequired,
|
|
96
|
-
noResults: PropTypes.bool,
|
|
97
|
-
}),
|
|
98
|
-
).isRequired,
|
|
99
|
-
values: PropTypes.arrayOf(valueShape),
|
|
100
|
-
onChange: PropTypes.func,
|
|
101
|
-
onSubfilterChange: PropTypes.func,
|
|
102
|
-
noFilterSelectedLabel: PropTypes.string,
|
|
103
|
-
children: PropTypes.node,
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
SearchFilterList.defaultProps = {
|
|
107
|
-
values: [],
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export default SearchFilterList;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import BEMHelper from 'react-bem-helper';
|
|
4
|
-
import { Cross } from '@ndla/icons/action';
|
|
5
|
-
import { CSSTransition } from 'react-transition-group';
|
|
6
|
-
|
|
7
|
-
import Fade from '../Animation/Fade';
|
|
8
|
-
|
|
9
|
-
const classes = BEMHelper({
|
|
10
|
-
prefix: 'c-',
|
|
11
|
-
name: 'search-overlay',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const SearchOverlay = ({ close, isOpen, children }) => (
|
|
15
|
-
<Fragment>
|
|
16
|
-
<Fade in={isOpen}>
|
|
17
|
-
<div className="o-backdrop" />
|
|
18
|
-
</Fade>
|
|
19
|
-
<CSSTransition timeout={300} classNames={classes().className} unmountOnExit in={isOpen}>
|
|
20
|
-
<div {...classes()}>
|
|
21
|
-
<div {...classes('container o-wrapper')}>
|
|
22
|
-
{children}
|
|
23
|
-
<button {...classes('close-button')} type="button" onClick={close}>
|
|
24
|
-
<Cross />
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</CSSTransition>
|
|
29
|
-
</Fragment>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
SearchOverlay.propTypes = {
|
|
33
|
-
isOpen: PropTypes.bool.isRequired,
|
|
34
|
-
close: PropTypes.func,
|
|
35
|
-
children: PropTypes.node.isRequired,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default SearchOverlay;
|