@ndla/ui 50.9.8 → 50.9.10
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/Embed/UuDisclaimerEmbed.js +3 -3
- package/es/ExpandableBox/ExpandableBox.js +8 -2
- package/es/Filter/ToggleItem.js +31 -9
- package/es/Filter/index.js +0 -3
- package/es/Logo/Logo.js +44 -20
- package/es/Logo/SvgLogo.js +7 -3
- package/es/all.css +1 -1
- package/es/index.js +1 -1
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +1 -1
- package/es/locale/messages-nn.js +1 -1
- package/es/locale/messages-se.js +1 -1
- package/es/locale/messages-sma.js +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js +3 -3
- package/lib/ExpandableBox/ExpandableBox.js +8 -1
- package/lib/Filter/ToggleItem.d.ts +1 -2
- package/lib/Filter/ToggleItem.js +32 -9
- package/lib/Filter/index.d.ts +0 -3
- package/lib/Filter/index.js +0 -21
- package/lib/Logo/Logo.d.ts +0 -2
- package/lib/Logo/Logo.js +45 -22
- package/lib/Logo/SvgLogo.js +8 -3
- package/lib/all.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -12
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +1 -1
- package/lib/locale/messages-nn.js +1 -1
- package/lib/locale/messages-se.js +1 -1
- package/lib/locale/messages-sma.js +1 -1
- package/package.json +3 -3
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +1 -1
- package/src/Embed/UuDisclaimerEmbed.tsx +1 -1
- package/src/ExpandableBox/ExpandableBox.stories.tsx +10 -1
- package/src/ExpandableBox/ExpandableBox.tsx +11 -1
- package/src/Figure/component.figure.scss +0 -56
- package/src/Filter/ToggleItem.tsx +131 -9
- package/src/Filter/index.ts +0 -3
- package/src/Logo/Logo.tsx +36 -16
- package/src/Logo/SvgLogo.tsx +8 -9
- package/src/index.ts +1 -1
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +1 -1
- package/src/locale/messages-nn.ts +1 -1
- package/src/locale/messages-se.ts +1 -1
- package/src/locale/messages-sma.ts +1 -1
- package/src/main.scss +0 -2
- package/es/Filter/FilterList.js +0 -100
- package/es/Filter/FilterListPhone.js +0 -224
- package/es/Filter/filterClasses.js +0 -13
- package/lib/Filter/FilterList.d.ts +0 -32
- package/lib/Filter/FilterList.js +0 -105
- package/lib/Filter/FilterListPhone.d.ts +0 -38
- package/lib/Filter/FilterListPhone.js +0 -229
- package/lib/Filter/filterClasses.d.ts +0 -9
- package/lib/Filter/filterClasses.js +0 -20
- package/src/Filter/FilterList.tsx +0 -137
- package/src/Filter/FilterListPhone.tsx +0 -278
- package/src/Filter/component.filter.scss +0 -503
- package/src/Filter/filterClasses.ts +0 -14
- package/src/Logo/component.logo.scss +0 -28
package/lib/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { default as Image, ImageLink, makeSrcQueryString } from "./Image";
|
|
|
25
25
|
export type { ImageCrop, ImageFocalPoint } from "./Image";
|
|
26
26
|
export type { HeroContentType } from "./Hero";
|
|
27
27
|
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero, HeroContent, } from "./Hero";
|
|
28
|
-
export {
|
|
28
|
+
export { FilterButtons, ToggleItem } from "./Filter";
|
|
29
29
|
export { Footer, EditorName, FooterText } from "./Footer";
|
|
30
30
|
export { Figure, FigureOpenDialogButton } from "./Figure";
|
|
31
31
|
export type { FigureType } from "./Figure";
|
package/lib/index.js
CHANGED
|
@@ -339,18 +339,6 @@ Object.defineProperty(exports, "FilterButtons", {
|
|
|
339
339
|
return _Filter.FilterButtons;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
-
Object.defineProperty(exports, "FilterList", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _Filter.FilterList;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
Object.defineProperty(exports, "FilterListPhone", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
get: function () {
|
|
351
|
-
return _Filter.FilterListPhone;
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
342
|
Object.defineProperty(exports, "Folder", {
|
|
355
343
|
enumerable: true,
|
|
356
344
|
get: function () {
|
|
@@ -1052,7 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
notification: {
|
|
1053
1053
|
title: "Notifications",
|
|
1054
1054
|
showAll: "View all notifications",
|
|
1055
|
-
description: "Welcome to
|
|
1055
|
+
description: "Welcome to the arena for teachers in upper secondary education. This is <em>your</em> arena: a professional meeting place for discussion, inspiration, sharing, development, and collaboration.",
|
|
1056
1056
|
myNotification: "My notifications",
|
|
1057
1057
|
markAll: "Mark all as read",
|
|
1058
1058
|
subscribe: "You will now be notified of new replies to this topic",
|
|
@@ -1052,7 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
notification: {
|
|
1053
1053
|
title: "Varslinger",
|
|
1054
1054
|
showAll: "Se alle varslinger",
|
|
1055
|
-
description: "Velkommen
|
|
1055
|
+
description: "Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1056
1056
|
myNotification: "Mine varsler",
|
|
1057
1057
|
markAll: "Merk alle som lest",
|
|
1058
1058
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
@@ -1052,7 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
notification: {
|
|
1053
1053
|
title: "Varslingar",
|
|
1054
1054
|
showAll: "Sjå alle varslingar",
|
|
1055
|
-
description: "
|
|
1055
|
+
description: "Velkommen inn i arenaen for lærarar i vidaregåande opplæring! Dette er <em>din</em> arena: ein fagleg møtestad for diskusjon, inspirasjon, deling og utviklande samarbeid.",
|
|
1056
1056
|
myNotification: "Mine varsler",
|
|
1057
1057
|
markAll: "Merk alle som lest",
|
|
1058
1058
|
subscribe: "Du får no varsling om nye svar på dette innlegget",
|
|
@@ -1052,7 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
notification: {
|
|
1053
1053
|
title: "Varslinger",
|
|
1054
1054
|
showAll: "Se alle varslinger",
|
|
1055
|
-
description: "Velkommen
|
|
1055
|
+
description: "Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1056
1056
|
myNotification: "Mine varsler",
|
|
1057
1057
|
markAll: "Merk alle som lest",
|
|
1058
1058
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
@@ -1052,7 +1052,7 @@ const messages = {
|
|
|
1052
1052
|
notification: {
|
|
1053
1053
|
title: "Varslinger",
|
|
1054
1054
|
showAll: "Se alle varslinger",
|
|
1055
|
-
description: "Velkommen
|
|
1055
|
+
description: "Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1056
1056
|
myNotification: "Mine varsler",
|
|
1057
1057
|
markAll: "Merk alle som lest",
|
|
1058
1058
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "50.9.
|
|
3
|
+
"version": "50.9.10",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@ndla/types-backend": "^0.2.21",
|
|
74
|
-
"@ndla/types-embed": "^4.0.
|
|
74
|
+
"@ndla/types-embed": "^4.0.15",
|
|
75
75
|
"css-loader": "^6.7.3",
|
|
76
76
|
"mini-css-extract-plugin": "^2.7.5",
|
|
77
77
|
"sass-loader": "^13.2.2",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "7d0a10e8b9a945dcebaae4267bfe174237e9bad1"
|
|
85
85
|
}
|
|
@@ -16,7 +16,7 @@ import { defaultParameters } from "../../../../stories/defaults";
|
|
|
16
16
|
const embedData: UuDisclaimerEmbedData = {
|
|
17
17
|
resource: "uu-disclaimer",
|
|
18
18
|
disclaimer: "Dette inholdet er ikke tastaturvennlig.",
|
|
19
|
-
articleId: 123,
|
|
19
|
+
articleId: "123",
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const meta: Meta<typeof UuDisclaimerEmbed> = {
|
|
@@ -36,7 +36,7 @@ const UuDisclaimerEmbed = ({ embed, children }: Props) => {
|
|
|
36
36
|
|
|
37
37
|
const { embedData, data } = embed;
|
|
38
38
|
|
|
39
|
-
const disclaimerLink = data
|
|
39
|
+
const disclaimerLink = data?.disclaimerLink ? (
|
|
40
40
|
<>
|
|
41
41
|
{` ${t("uuDisclaimer.alternative")} `}
|
|
42
42
|
<SafeLink to={data.disclaimerLink.href} target="_blank" rel="noopener noreferrer">
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
9
|
+
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
10
|
import { ExpandableBox, ExpandableBoxSummary } from "./ExpandableBox";
|
|
11
11
|
import { defaultParameters } from "../../../../stories/defaults";
|
|
12
12
|
|
|
@@ -32,3 +32,12 @@ export default {
|
|
|
32
32
|
} as Meta<typeof ExpandableBox>;
|
|
33
33
|
|
|
34
34
|
export const Default: StoryObj<typeof ExpandableBox> = {};
|
|
35
|
+
|
|
36
|
+
export const WithHeader: StoryFn<typeof ExpandableBox> = ({ ...args }) => (
|
|
37
|
+
<ExpandableBox {...args}>
|
|
38
|
+
<ExpandableBoxSummary>
|
|
39
|
+
<h2>Open me as header text</h2>
|
|
40
|
+
</ExpandableBoxSummary>
|
|
41
|
+
Everything here is only visible when the box is open
|
|
42
|
+
</ExpandableBox>
|
|
43
|
+
);
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { HTMLAttributes } from "react";
|
|
10
|
+
import styled from "@emotion/styled";
|
|
11
|
+
import { fonts } from "@ndla/core";
|
|
10
12
|
|
|
11
13
|
interface Props extends HTMLAttributes<HTMLDetailsElement> {}
|
|
12
14
|
|
|
@@ -16,6 +18,14 @@ export const ExpandableBox = ({ children, ...rest }: Props) => {
|
|
|
16
18
|
|
|
17
19
|
interface SummaryProps extends HTMLAttributes<HTMLElement> {}
|
|
18
20
|
|
|
21
|
+
const StyledSummary = styled.summary`
|
|
22
|
+
& > * {
|
|
23
|
+
display: inline;
|
|
24
|
+
font-size: ${fonts.size.text.metaText.medium};
|
|
25
|
+
font-weight: ${fonts.weight.normal};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
19
29
|
export const ExpandableBoxSummary = ({ children, ...rest }: SummaryProps) => {
|
|
20
|
-
return <
|
|
30
|
+
return <StyledSummary {...rest}>{children}</StyledSummary>;
|
|
21
31
|
};
|
|
@@ -90,35 +90,8 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
.c-figure__licensetag {
|
|
94
|
-
display: none;
|
|
95
|
-
}
|
|
96
93
|
.c-figure__byline {
|
|
97
94
|
text-align: left;
|
|
98
|
-
|
|
99
|
-
.c-figure__toggleAlternativeVideo {
|
|
100
|
-
margin-left: 10px;
|
|
101
|
-
span.hidden {
|
|
102
|
-
display: none;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.c-figure__byline-author-buttons {
|
|
108
|
-
flex: 1 1 auto;
|
|
109
|
-
display: flex;
|
|
110
|
-
align-items: center;
|
|
111
|
-
justify-content: space-between;
|
|
112
|
-
color: $primary-color;
|
|
113
|
-
}
|
|
114
|
-
.c-figure__byline-author-buttons--no-siblings {
|
|
115
|
-
//styling for button in licensewrapper when there are no other elements in it. Places the button to the right
|
|
116
|
-
justify-content: flex-end;
|
|
117
|
-
}
|
|
118
|
-
.c-figure__byline-authors {
|
|
119
|
-
@include font-size(14px, 20px);
|
|
120
|
-
margin-right: $spacing--small;
|
|
121
|
-
font-family: $font;
|
|
122
95
|
}
|
|
123
96
|
|
|
124
97
|
.c-figure__info {
|
|
@@ -235,40 +208,11 @@
|
|
|
235
208
|
}
|
|
236
209
|
|
|
237
210
|
.c-figure {
|
|
238
|
-
&__link-wrapper {
|
|
239
|
-
margin-top: $spacing--small;
|
|
240
|
-
|
|
241
|
-
[data-icon] {
|
|
242
|
-
margin-left: $spacing--xsmall;
|
|
243
|
-
width: 18px;
|
|
244
|
-
height: 18px;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
211
|
&__link {
|
|
249
212
|
color: $brand-color;
|
|
250
213
|
box-shadow: none;
|
|
251
214
|
display: flex;
|
|
252
215
|
align-items: center;
|
|
253
216
|
@include font-size(14px, 25px);
|
|
254
|
-
|
|
255
|
-
&:hover,
|
|
256
|
-
&:active,
|
|
257
|
-
&:focus {
|
|
258
|
-
.c-figure__link-text {
|
|
259
|
-
box-shadow: $link--hover;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
&__link-text {
|
|
265
|
-
box-shadow: $link;
|
|
266
|
-
display: block;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
&__link-description {
|
|
270
|
-
margin-top: $spacing--xsmall !important;
|
|
271
|
-
margin-bottom: 0;
|
|
272
|
-
@include font-size(14px, 25px);
|
|
273
217
|
}
|
|
274
218
|
}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ChangeEvent, ElementType } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { css } from "@emotion/react";
|
|
11
|
+
import styled from "@emotion/styled";
|
|
12
|
+
import { breakpoints, colors, fonts, misc, mq, spacing, stackOrder } from "@ndla/core";
|
|
11
13
|
|
|
12
14
|
interface Props {
|
|
13
15
|
id: string;
|
|
@@ -16,16 +18,137 @@ interface Props {
|
|
|
16
18
|
checked?: boolean;
|
|
17
19
|
disabled?: boolean;
|
|
18
20
|
tabIndex?: number;
|
|
19
|
-
modifiers?: string[] | string;
|
|
20
21
|
value?: string;
|
|
21
22
|
component?: ElementType;
|
|
22
23
|
hits?: number;
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
const StyledText = styled.span`
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
z-index: ${stackOrder.offsetDouble};
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const StyledInput = styled.input`
|
|
32
|
+
position: absolute;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
z-index: ${stackOrder.trigger};
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
&:checked {
|
|
38
|
+
& + label [data-checkbox] {
|
|
39
|
+
border: 2px solid ${colors.brand.primary};
|
|
40
|
+
background: ${colors.brand.primary};
|
|
41
|
+
::before {
|
|
42
|
+
background: white;
|
|
43
|
+
width: 5px;
|
|
44
|
+
}
|
|
45
|
+
::after {
|
|
46
|
+
background: white;
|
|
47
|
+
width: 10px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const StyledItemCheckbox = styled.span`
|
|
54
|
+
content: "";
|
|
55
|
+
display: inline-block;
|
|
56
|
+
position: relative;
|
|
57
|
+
width: ${spacing.normal};
|
|
58
|
+
height: ${spacing.normal};
|
|
59
|
+
padding: 0;
|
|
60
|
+
background: ${colors.white};
|
|
61
|
+
border: 2px solid ${colors.brand.tertiary};
|
|
62
|
+
margin: 2px ${spacing.small} 2px 3px;
|
|
63
|
+
border-radius: 2px;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
66
|
+
width: 20px;
|
|
67
|
+
height: 20px;
|
|
68
|
+
margin: 4px ${spacing.small} 4px 3px;
|
|
69
|
+
}
|
|
70
|
+
&::before {
|
|
71
|
+
content: "";
|
|
72
|
+
width: 0px;
|
|
73
|
+
height: 2px;
|
|
74
|
+
border-radius: 2px;
|
|
75
|
+
background: ${colors.brand.tertiary};
|
|
76
|
+
position: absolute;
|
|
77
|
+
transform: rotate(45deg);
|
|
78
|
+
top: 10px;
|
|
79
|
+
left: 7px;
|
|
80
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
81
|
+
top: 8px;
|
|
82
|
+
left: 5px;
|
|
83
|
+
}
|
|
84
|
+
transition: width 50ms ease 50ms;
|
|
85
|
+
transform-origin: 0% 0%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&::after {
|
|
89
|
+
content: "";
|
|
90
|
+
width: 0;
|
|
91
|
+
height: 2px;
|
|
92
|
+
border-radius: 2px;
|
|
93
|
+
background: ${colors.brand.tertiary};
|
|
94
|
+
position: absolute;
|
|
95
|
+
transform: rotate(305deg);
|
|
96
|
+
top: 13px;
|
|
97
|
+
left: 8px;
|
|
98
|
+
|
|
99
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
100
|
+
top: 11px;
|
|
101
|
+
left: 6px;
|
|
102
|
+
}
|
|
103
|
+
transition: width 50ms ease;
|
|
104
|
+
transform-origin: 0% 0%;
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
const toggleItemCss = css`
|
|
109
|
+
display: inline-block;
|
|
110
|
+
position: relative;
|
|
111
|
+
margin: 0 ${spacing.small} 0 2px;
|
|
112
|
+
color: ${colors.brand.primary};
|
|
113
|
+
border-radius: ${misc.borderRadius};
|
|
114
|
+
transition: all 0.2s cubic-bezier(0.17, 0.04, 0.03, 0.94);
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
${fonts.sizes("16px", "18px")};
|
|
117
|
+
|
|
118
|
+
&:hover {
|
|
119
|
+
[data-checkbox] {
|
|
120
|
+
border: 2px solid ${colors.brand.tertiary};
|
|
121
|
+
}
|
|
122
|
+
[data-checkbox]::before {
|
|
123
|
+
width: 5px;
|
|
124
|
+
transition: width 100ms ease;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-checkbox]::after {
|
|
128
|
+
width: 10px;
|
|
129
|
+
transition: width 150ms ease 100ms;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
label {
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
display: inline-flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
${mq.range({ until: breakpoints.tabletWide })} {
|
|
137
|
+
width: 100%;
|
|
138
|
+
}
|
|
139
|
+
${mq.range({ until: breakpoints.mobileWide })} {
|
|
140
|
+
width: 100%;
|
|
141
|
+
padding: $spacing--xsmall 0;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
min-height: 52px;
|
|
144
|
+
align-items: center;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
|
|
25
149
|
const ToggleItem = ({
|
|
26
150
|
id,
|
|
27
151
|
checked = false,
|
|
28
|
-
modifiers,
|
|
29
152
|
label,
|
|
30
153
|
component: Component = "li",
|
|
31
154
|
onChange,
|
|
@@ -34,9 +157,8 @@ const ToggleItem = ({
|
|
|
34
157
|
disabled,
|
|
35
158
|
hits,
|
|
36
159
|
}: Props) => (
|
|
37
|
-
<Component {
|
|
38
|
-
<
|
|
39
|
-
{...classes("input")}
|
|
160
|
+
<Component css={toggleItemCss}>
|
|
161
|
+
<StyledInput
|
|
40
162
|
type="checkbox"
|
|
41
163
|
id={id}
|
|
42
164
|
value={value}
|
|
@@ -46,11 +168,11 @@ const ToggleItem = ({
|
|
|
46
168
|
onChange={onChange}
|
|
47
169
|
/>
|
|
48
170
|
<label htmlFor={id}>
|
|
49
|
-
<
|
|
50
|
-
<
|
|
171
|
+
<StyledItemCheckbox data-checkbox="" />
|
|
172
|
+
<StyledText>
|
|
51
173
|
{label}
|
|
52
174
|
{hits !== undefined && ` (${hits})`}
|
|
53
|
-
</
|
|
175
|
+
</StyledText>
|
|
54
176
|
</label>
|
|
55
177
|
</Component>
|
|
56
178
|
);
|
package/src/Filter/index.ts
CHANGED
|
@@ -6,8 +6,5 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export { default as FilterList } from "./FilterList";
|
|
10
|
-
export { default as FilterListPhone } from "./FilterListPhone";
|
|
11
9
|
export { default as ToggleItem } from "./ToggleItem";
|
|
12
|
-
export { classes as filterClasses } from "./filterClasses";
|
|
13
10
|
export { default as FilterButtons } from "./FilterButtons";
|
package/src/Logo/Logo.tsx
CHANGED
|
@@ -5,17 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
/* eslint-disable max-len */
|
|
9
8
|
|
|
10
|
-
import
|
|
9
|
+
import { useMemo } from "react";
|
|
10
|
+
import { SerializedStyles, css } from "@emotion/react";
|
|
11
|
+
import styled from "@emotion/styled";
|
|
12
|
+
import { colors } from "@ndla/core";
|
|
11
13
|
import SafeLink from "@ndla/safelink";
|
|
12
14
|
import SvgLogo from "./SvgLogo";
|
|
13
15
|
|
|
14
|
-
export const logoClasses = new BEMHelper({
|
|
15
|
-
name: "logo",
|
|
16
|
-
prefix: "c-",
|
|
17
|
-
});
|
|
18
|
-
|
|
19
16
|
interface Props {
|
|
20
17
|
to?:
|
|
21
18
|
| string
|
|
@@ -32,23 +29,46 @@ interface Props {
|
|
|
32
29
|
color?: string;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (cssModifier) {
|
|
39
|
-
modifiers[cssModifier] = true;
|
|
32
|
+
const StyledLogoWrapper = styled.div`
|
|
33
|
+
a {
|
|
34
|
+
box-shadow: none;
|
|
40
35
|
}
|
|
36
|
+
width: 120px;
|
|
37
|
+
margin: 0;
|
|
38
|
+
position: relative;
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const modifierStyles: Record<string, SerializedStyles> = {
|
|
42
|
+
large: css`
|
|
43
|
+
width: 287px;
|
|
44
|
+
`,
|
|
45
|
+
white: css`
|
|
46
|
+
svg {
|
|
47
|
+
fill: ${colors.white};
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Logo = ({ name = true, to, cssModifier, color, large = false, locale, label }: Props) => {
|
|
53
|
+
const modifiers = useMemo(() => {
|
|
54
|
+
const mods = [];
|
|
55
|
+
if (large) {
|
|
56
|
+
mods.push(modifierStyles.large);
|
|
57
|
+
}
|
|
58
|
+
if (cssModifier && modifierStyles[cssModifier]) {
|
|
59
|
+
mods.push(modifierStyles[cssModifier]);
|
|
60
|
+
}
|
|
61
|
+
return mods;
|
|
62
|
+
}, [large, cssModifier]);
|
|
41
63
|
|
|
42
64
|
const logo = to ? (
|
|
43
65
|
<SafeLink to={to} aria-label={label} title={label}>
|
|
44
66
|
<SvgLogo name={name} color={color} locale={locale} />
|
|
45
67
|
</SafeLink>
|
|
46
68
|
) : (
|
|
47
|
-
|
|
48
|
-
<SvgLogo name={name} color={color} locale={locale} />
|
|
49
|
-
</>
|
|
69
|
+
<SvgLogo name={name} color={color} locale={locale} />
|
|
50
70
|
);
|
|
51
|
-
return <
|
|
71
|
+
return <StyledLogoWrapper css={modifiers}>{logo}</StyledLogoWrapper>;
|
|
52
72
|
};
|
|
53
73
|
|
|
54
74
|
export default Logo;
|
package/src/Logo/SvgLogo.tsx
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/* eslint-disable max-len */
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import styled from "@emotion/styled";
|
|
11
|
+
import { colors } from "@ndla/core";
|
|
11
12
|
|
|
12
13
|
const LogoText = (locale?: string) => {
|
|
13
14
|
if (locale === "en") {
|
|
@@ -30,20 +31,18 @@ interface Props {
|
|
|
30
31
|
locale?: string;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
const StyledSvg = styled.svg`
|
|
35
|
+
fill: ${colors.brand.primary};
|
|
36
|
+
`;
|
|
37
|
+
|
|
33
38
|
export const SvgLogo = ({ name = true, color = "#000000", locale }: Props) => (
|
|
34
|
-
<svg
|
|
35
|
-
{...logoClasses("graphic")}
|
|
36
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
-
viewBox="0 0 376 152"
|
|
38
|
-
fill={color}
|
|
39
|
-
fillRule="evenodd"
|
|
40
|
-
>
|
|
39
|
+
<StyledSvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 376 152" fill={color} fillRule="evenodd">
|
|
41
40
|
<path d="M355 67h-84v51h102V51h-18v16zm0 14h-66v19h66V81zm-84-48v18h84V33h-84z" />
|
|
42
41
|
<rect width="18" height="118" x="236" transform="matrix(-1 0 0 1 490 0)" />
|
|
43
42
|
<path d="M201 100V51h-65v49h65zm18 18V0h-18v33h-83v85h101z" />
|
|
44
43
|
<polygon points="18 51 18 118 0 118 0 33 101 33 101 118 83 118 83 51" />
|
|
45
44
|
{name && LogoText(locale)}
|
|
46
|
-
</
|
|
45
|
+
</StyledSvg>
|
|
47
46
|
);
|
|
48
47
|
|
|
49
48
|
export default SvgLogo;
|
package/src/index.ts
CHANGED
|
@@ -1062,7 +1062,7 @@ const messages = {
|
|
|
1062
1062
|
title: "Notifications",
|
|
1063
1063
|
showAll: "View all notifications",
|
|
1064
1064
|
description:
|
|
1065
|
-
"Welcome to
|
|
1065
|
+
"Welcome to the arena for teachers in upper secondary education. This is <em>your</em> arena: a professional meeting place for discussion, inspiration, sharing, development, and collaboration.",
|
|
1066
1066
|
myNotification: "My notifications",
|
|
1067
1067
|
markAll: "Mark all as read",
|
|
1068
1068
|
subscribe: "You will now be notified of new replies to this topic",
|
|
@@ -1061,7 +1061,7 @@ const messages = {
|
|
|
1061
1061
|
title: "Varslinger",
|
|
1062
1062
|
showAll: "Se alle varslinger",
|
|
1063
1063
|
description:
|
|
1064
|
-
"Velkommen
|
|
1064
|
+
"Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1065
1065
|
myNotification: "Mine varsler",
|
|
1066
1066
|
markAll: "Merk alle som lest",
|
|
1067
1067
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
@@ -1061,7 +1061,7 @@ const messages = {
|
|
|
1061
1061
|
title: "Varslingar",
|
|
1062
1062
|
showAll: "Sjå alle varslingar",
|
|
1063
1063
|
description:
|
|
1064
|
-
"
|
|
1064
|
+
"Velkommen inn i arenaen for lærarar i vidaregåande opplæring! Dette er <em>din</em> arena: ein fagleg møtestad for diskusjon, inspirasjon, deling og utviklande samarbeid.",
|
|
1065
1065
|
myNotification: "Mine varsler",
|
|
1066
1066
|
markAll: "Merk alle som lest",
|
|
1067
1067
|
subscribe: "Du får no varsling om nye svar på dette innlegget",
|
|
@@ -1063,7 +1063,7 @@ const messages = {
|
|
|
1063
1063
|
title: "Varslinger",
|
|
1064
1064
|
showAll: "Se alle varslinger",
|
|
1065
1065
|
description:
|
|
1066
|
-
"Velkommen
|
|
1066
|
+
"Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1067
1067
|
myNotification: "Mine varsler",
|
|
1068
1068
|
markAll: "Merk alle som lest",
|
|
1069
1069
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
@@ -1065,7 +1065,7 @@ const messages = {
|
|
|
1065
1065
|
title: "Varslinger",
|
|
1066
1066
|
showAll: "Se alle varslinger",
|
|
1067
1067
|
description:
|
|
1068
|
-
"Velkommen
|
|
1068
|
+
"Velkommen inn i arenaen for lærere i videregående opplæring! Dette er <em>din</em> arena: et faglig møtested for diskusjon, inspirasjon, deling og utviklende samarbeid.",
|
|
1069
1069
|
myNotification: "Mine varsler",
|
|
1070
1070
|
markAll: "Merk alle som lest",
|
|
1071
1071
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|