@ndla/ui 47.1.3 → 47.2.1
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/{Image/LazyLoadImage.js → ExpandableBox/ExpandableBox.js} +15 -32
- package/es/ExpandableBox/index.js +9 -0
- package/es/Footer/Footer.js +8 -8
- package/es/Footer/FooterLinks.js +6 -6
- package/es/Image/Image.js +5 -14
- package/es/Resource/storyComponents.js +67 -0
- package/es/index.js +1 -0
- package/es/locale/messages-en.js +15 -4
- package/es/locale/messages-nb.js +15 -4
- package/es/locale/messages-nn.js +15 -4
- package/es/locale/messages-se.js +13 -2
- package/es/locale/messages-sma.js +17 -6
- package/lib/ExpandableBox/ExpandableBox.d.ts +15 -0
- package/lib/{Image/LazyLoadImage.js → ExpandableBox/ExpandableBox.js} +18 -32
- package/lib/ExpandableBox/index.d.ts +8 -0
- package/lib/ExpandableBox/index.js +18 -0
- package/lib/Footer/Footer.d.ts +5 -9
- package/lib/Footer/Footer.js +8 -8
- package/lib/Footer/FooterLinks.d.ts +5 -9
- package/lib/Footer/FooterLinks.js +6 -6
- package/lib/Image/Image.js +5 -14
- package/lib/Resource/storyComponents.d.ts +12 -0
- package/lib/Resource/storyComponents.js +74 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/messages-en.d.ts +13 -2
- package/lib/locale/messages-en.js +15 -4
- package/lib/locale/messages-nb.d.ts +13 -2
- package/lib/locale/messages-nb.js +15 -4
- package/lib/locale/messages-nn.d.ts +13 -2
- package/lib/locale/messages-nn.js +15 -4
- package/lib/locale/messages-se.d.ts +13 -2
- package/lib/locale/messages-se.js +13 -2
- package/lib/locale/messages-sma.d.ts +13 -2
- package/lib/locale/messages-sma.js +17 -6
- package/package.json +18 -18
- package/src/Breadcrumb/Breadcrumb.stories.tsx +77 -0
- package/src/Breadcrumb/HomeBreadcrumb.stories.tsx +57 -0
- package/src/ContentLoader/ContentLoader.stories.tsx +64 -0
- package/src/ExpandableBox/ExpandableBox.stories.tsx +34 -0
- package/src/ExpandableBox/ExpandableBox.tsx +21 -0
- package/src/ExpandableBox/index.ts +9 -0
- package/src/FactBox/Factbox.stories.tsx +62 -0
- package/src/FileList/FileList.stories.tsx +48 -0
- package/src/Footer/Footer.stories.tsx +116 -0
- package/src/Footer/Footer.tsx +5 -9
- package/src/Footer/FooterLinks.tsx +5 -9
- package/src/Image/Image.stories.tsx +63 -0
- package/src/Image/Image.tsx +3 -17
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +19 -10
- package/src/List/OrderedList.stories.tsx +114 -0
- package/src/List/UnorderedList.stories.tsx +46 -0
- package/src/Messages/MessageBanner.stories.tsx +33 -0
- package/src/Messages/MessageBox.stories.tsx +60 -0
- package/src/MyNdla/Resource/Folder.stories.tsx +31 -4
- package/src/MyNdla/Resource/FolderInput.stories.tsx +29 -0
- package/src/Resource/BlockResource.stories.tsx +51 -5
- package/src/Resource/ListResource.stories.tsx +98 -0
- package/src/Resource/storyComponents.tsx +46 -0
- package/src/SnackBar/Snack.stories.tsx +91 -0
- package/src/Table/Table.stories.tsx +701 -0
- package/src/index.ts +1 -0
- package/src/locale/messages-en.ts +12 -4
- package/src/locale/messages-nb.ts +15 -4
- package/src/locale/messages-nn.ts +15 -4
- package/src/locale/messages-se.ts +10 -2
- package/src/locale/messages-sma.ts +14 -6
- package/lib/Image/LazyLoadImage.d.ts +0 -17
- package/src/Image/LazyLoadImage.tsx +0 -37
- package/src/Resource/Resource.stories.tsx +0 -81
|
@@ -516,6 +516,11 @@ const messages = {
|
|
|
516
516
|
subject: {
|
|
517
517
|
associatedTopics: 'Associated topics',
|
|
518
518
|
},
|
|
519
|
+
subjectFrontPage: {
|
|
520
|
+
buildsOn: 'Builds on',
|
|
521
|
+
connectedTo: 'Common programme subject with',
|
|
522
|
+
leadsTo: 'Leads to',
|
|
523
|
+
},
|
|
519
524
|
accordion: {
|
|
520
525
|
closeAll: 'Close all',
|
|
521
526
|
openAll: 'Open all',
|
|
@@ -1275,8 +1280,11 @@ const messages = {
|
|
|
1275
1280
|
},
|
|
1276
1281
|
myProfile: {
|
|
1277
1282
|
title: 'My Profile',
|
|
1278
|
-
disclaimerTitle: 'Where is my picture and name used?',
|
|
1279
|
-
disclaimerText:
|
|
1283
|
+
disclaimerTitle: { employee: 'Where is my picture and name used?', student: 'Where is my name used?' },
|
|
1284
|
+
disclaimerText: {
|
|
1285
|
+
employee: 'Your picture and name are displayed when you participate in discussions in the arena.',
|
|
1286
|
+
student: 'Your name is only displayed for you',
|
|
1287
|
+
},
|
|
1280
1288
|
preferenceTitle: 'Choose whether you want to display name when sharing a folder',
|
|
1281
1289
|
preferenceText:
|
|
1282
1290
|
'Here you can choose whether you want to display your name when you share a folder. The selected option applies to all your folders and can be changed later. If you later change the option, your name will appear on all your shared folders.',
|
|
@@ -1341,8 +1349,8 @@ const messages = {
|
|
|
1341
1349
|
help: 'Help',
|
|
1342
1350
|
},
|
|
1343
1351
|
programmes: {
|
|
1344
|
-
header: '
|
|
1345
|
-
description: '
|
|
1352
|
+
header: 'What do you want to learn today?',
|
|
1353
|
+
description: 'Choose a programme to see your subjects',
|
|
1346
1354
|
grades: 'Grades',
|
|
1347
1355
|
accordionHeader: 'All educational programmes',
|
|
1348
1356
|
},
|
|
@@ -515,6 +515,11 @@ const messages = {
|
|
|
515
515
|
subject: {
|
|
516
516
|
associatedTopics: 'Tilhørende emner',
|
|
517
517
|
},
|
|
518
|
+
subjectFrontPage: {
|
|
519
|
+
buildsOn: 'Bygger på',
|
|
520
|
+
connectedTo: 'Felles programfag sammen med',
|
|
521
|
+
leadsTo: 'Leder til',
|
|
522
|
+
},
|
|
518
523
|
accordion: {
|
|
519
524
|
closeAll: 'Lukk alle',
|
|
520
525
|
openAll: 'Åpne alle',
|
|
@@ -1271,8 +1276,14 @@ const messages = {
|
|
|
1271
1276
|
},
|
|
1272
1277
|
myProfile: {
|
|
1273
1278
|
title: 'Min Profil',
|
|
1274
|
-
disclaimerTitle:
|
|
1275
|
-
|
|
1279
|
+
disclaimerTitle: {
|
|
1280
|
+
employee: 'Hvor brukes bildet og navnet mitt?',
|
|
1281
|
+
student: 'Hvor brukes navnet mitt?',
|
|
1282
|
+
},
|
|
1283
|
+
disclaimerText: {
|
|
1284
|
+
employee: 'Bilde og navn vises når du deltar i diskusjoner i arenaen.',
|
|
1285
|
+
student: 'Navnet ditt vises bare for deg selv når du er logget inn.',
|
|
1286
|
+
},
|
|
1276
1287
|
preferenceTitle: 'Velg om du vil vise navn når du deler en mappe',
|
|
1277
1288
|
preferenceText:
|
|
1278
1289
|
'Her kan du selv velge om du vil vise navnet ditt når du deler en mappe. Valget gjelder for alle mappene dine og kan endres senere. Dersom du endrer vil navnet ditt vises på alle dine delte mapper.',
|
|
@@ -1337,8 +1348,8 @@ const messages = {
|
|
|
1337
1348
|
help: 'Hjelp',
|
|
1338
1349
|
},
|
|
1339
1350
|
programmes: {
|
|
1340
|
-
header: '
|
|
1341
|
-
description: '
|
|
1351
|
+
header: 'Hva vil du lære om i dag?',
|
|
1352
|
+
description: 'Velg utdanningsprogram for å se dine fag',
|
|
1342
1353
|
grades: 'Trinn',
|
|
1343
1354
|
accordionHeader: 'Alle utdanningsprogram',
|
|
1344
1355
|
},
|
|
@@ -515,6 +515,11 @@ const messages = {
|
|
|
515
515
|
subject: {
|
|
516
516
|
associatedTopics: 'Tilhøyrande emne',
|
|
517
517
|
},
|
|
518
|
+
subjectFrontPage: {
|
|
519
|
+
buildsOn: 'Byggjer på',
|
|
520
|
+
connectedTo: 'Felles programfag saman med',
|
|
521
|
+
leadsTo: 'Leier til',
|
|
522
|
+
},
|
|
518
523
|
accordion: {
|
|
519
524
|
closeAll: 'Lukk alle',
|
|
520
525
|
openAll: 'Åpne alle',
|
|
@@ -1271,8 +1276,14 @@ const messages = {
|
|
|
1271
1276
|
},
|
|
1272
1277
|
myProfile: {
|
|
1273
1278
|
title: 'Min Profil',
|
|
1274
|
-
disclaimerTitle:
|
|
1275
|
-
|
|
1279
|
+
disclaimerTitle: {
|
|
1280
|
+
employee: 'Kvar blir biletet og namnet mitt brukt?',
|
|
1281
|
+
student: 'Kvar blir namnet mitt brukt?',
|
|
1282
|
+
},
|
|
1283
|
+
disclaimerText: {
|
|
1284
|
+
employee: 'Bilete og namn vert vist når du deltek i diskusjonar i arenaen.',
|
|
1285
|
+
student: 'Namnet ditt blir berre vist for deg sjølv når du er logga inn.',
|
|
1286
|
+
},
|
|
1276
1287
|
preferenceTitle: 'Vel om du vil vise namn når du deler ei mappe',
|
|
1277
1288
|
preferenceText:
|
|
1278
1289
|
'Her kan du sjølv velje om du vil vise namnet ditt når du deler ei mappe. Valet gjeld for alle mappene dine og kan endrast seinare. Dersom du endrar vil namnet ditt visast på alle dine delte mapper.',
|
|
@@ -1337,8 +1348,8 @@ const messages = {
|
|
|
1337
1348
|
help: 'Hjelp',
|
|
1338
1349
|
},
|
|
1339
1350
|
programmes: {
|
|
1340
|
-
header: '
|
|
1341
|
-
description: '
|
|
1351
|
+
header: 'Kva vil du lære om i dag?',
|
|
1352
|
+
description: 'Vel utdanningsprogram for å sjå faga dine',
|
|
1342
1353
|
grades: 'Trinn',
|
|
1343
1354
|
accordionHeader: 'Alle utdanningsprogram',
|
|
1344
1355
|
},
|
|
@@ -516,6 +516,11 @@ const messages = {
|
|
|
516
516
|
subject: {
|
|
517
517
|
associatedTopics: 'Gullevaš fáttát',
|
|
518
518
|
},
|
|
519
|
+
subjectFrontPage: {
|
|
520
|
+
buildsOn: 'Duddjo dása',
|
|
521
|
+
connectedTo: 'Oktasaš prográmmafáddán lea',
|
|
522
|
+
leadsTo: 'Dát doalvu',
|
|
523
|
+
},
|
|
519
524
|
accordion: {
|
|
520
525
|
closeAll: 'Govčča buot',
|
|
521
526
|
openAll: 'Raba buot',
|
|
@@ -1271,8 +1276,11 @@ const messages = {
|
|
|
1271
1276
|
},
|
|
1272
1277
|
myProfile: {
|
|
1273
1278
|
title: 'Mu profiila',
|
|
1274
|
-
disclaimerTitle: 'Gos geavahit mu gova ja mu nama?',
|
|
1275
|
-
disclaimerText:
|
|
1279
|
+
disclaimerTitle: { employee: 'Gos geavahit mu gova ja mu nama?', student: 'Gos geavahit mu nama?' },
|
|
1280
|
+
disclaimerText: {
|
|
1281
|
+
employee: 'Govva ja namma čájehuvvojit go searvat digaštallamii arenain.',
|
|
1282
|
+
student: 'Du namma čájehuvvo dušše go leat sisačálihuvvon',
|
|
1283
|
+
},
|
|
1276
1284
|
preferenceTitle: 'Vállje jos namma čájehuvvo máhpa juohkkedettiin',
|
|
1277
1285
|
preferenceText:
|
|
1278
1286
|
'Dás válljet jos iežat namma čájehuvvo juohkkedettiin máhpa. Dát molssaeaktu guoská buot máhpaide ja sáhttá rievdaduvvot maŋŋil. Jos rievdadat dán, de čájehuvvo du namma buot juogaduvvon máhpain.',
|
|
@@ -516,6 +516,11 @@ const messages = {
|
|
|
516
516
|
subject: {
|
|
517
517
|
associatedTopics: 'Teemah mah govlehtuvvieh',
|
|
518
518
|
},
|
|
519
|
+
subjectFrontPage: {
|
|
520
|
+
buildsOn: 'Bigkie bæjjese',
|
|
521
|
+
connectedTo: 'Tjåenghkies programmefaage aalkoealmetjidie',
|
|
522
|
+
leadsTo: 'Goh ryökneme',
|
|
523
|
+
},
|
|
519
524
|
accordion: {
|
|
520
525
|
closeAll: 'Dahph gaajhkh',
|
|
521
526
|
openAll: 'Rïhpesth gaajhkh',
|
|
@@ -1276,8 +1281,11 @@ const messages = {
|
|
|
1276
1281
|
},
|
|
1277
1282
|
myProfile: {
|
|
1278
1283
|
title: 'Mov Profijle',
|
|
1279
|
-
disclaimerTitle: 'Gusnie guvvie jïh nomme åtnasuvvieh?',
|
|
1280
|
-
disclaimerText:
|
|
1284
|
+
disclaimerTitle: { employee: 'Gusnie guvvie jïh nomme åtnasuvvieh?', student: 'Gusnie mov nomme' },
|
|
1285
|
+
disclaimerText: {
|
|
1286
|
+
employee: 'Guvvie jïh nomme våajnoes sjidtieh gosse meatan digkiedimmesne sijjesne.',
|
|
1287
|
+
student: 'Dov nomme ajve tjaalasåvva dutnjien gosse sïjse loggedh',
|
|
1288
|
+
},
|
|
1281
1289
|
preferenceTitle: 'Sjïehtedh jis edtja nommem vuesiehtidh gosse maabpam juekedh',
|
|
1282
1290
|
preferenceText:
|
|
1283
1291
|
'Daesnie jïjtje veeljh mejtie sïjhth dov nommem vuesiehtidh gosse maabpam juekedh . Daate veeljeme lea gaajhkine dov maabpojne, jïh maahta dam mænngan jarkelidh. Jis jeatjahdahtah , dov nomme sæjhta våajnoes årrodh gaajhkine dov joekedamme maabpojne.',
|
|
@@ -1342,10 +1350,10 @@ const messages = {
|
|
|
1342
1350
|
help: 'Hjelp',
|
|
1343
1351
|
},
|
|
1344
1352
|
programmes: {
|
|
1345
|
-
header: '
|
|
1346
|
-
description: '
|
|
1347
|
-
grades: '
|
|
1348
|
-
accordionHeader: '
|
|
1353
|
+
header: 'Maam sïjhth daan biejjien lïeredh ?',
|
|
1354
|
+
description: 'Veeljh ööhpehtimmieprogrammem juktie dov faagide vuartasjidh',
|
|
1355
|
+
grades: 'Daltesasse',
|
|
1356
|
+
accordionHeader: 'Gaajhkh ööhpehtimmieprogrammh',
|
|
1349
1357
|
},
|
|
1350
1358
|
embed: {
|
|
1351
1359
|
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
@@ -1,17 +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
|
-
interface Props {
|
|
9
|
-
alt: string;
|
|
10
|
-
src: string;
|
|
11
|
-
sizes?: string;
|
|
12
|
-
contentType?: string;
|
|
13
|
-
srcSet?: string;
|
|
14
|
-
lazyLoadSrc?: string;
|
|
15
|
-
}
|
|
16
|
-
declare const LazyLoadImage: ({ alt, src, srcSet, lazyLoadSrc, sizes, ...rest }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default LazyLoadImage;
|
|
@@ -1,37 +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
|
-
interface Props {
|
|
10
|
-
alt: string;
|
|
11
|
-
src: string;
|
|
12
|
-
sizes?: string;
|
|
13
|
-
contentType?: string;
|
|
14
|
-
srcSet?: string;
|
|
15
|
-
lazyLoadSrc?: string;
|
|
16
|
-
}
|
|
17
|
-
// Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
|
|
18
|
-
const LazyLoadImage = ({ alt, src, srcSet, lazyLoadSrc, sizes, ...rest }: Props) => (
|
|
19
|
-
<>
|
|
20
|
-
<noscript key="noscript">
|
|
21
|
-
<img alt={alt} src={`${src}`} srcSet={srcSet} sizes={sizes} {...rest} />
|
|
22
|
-
</noscript>
|
|
23
|
-
<img
|
|
24
|
-
alt={alt}
|
|
25
|
-
key="img"
|
|
26
|
-
style={{ width: '100%' }}
|
|
27
|
-
className="lazyload"
|
|
28
|
-
src={lazyLoadSrc}
|
|
29
|
-
data-src={src}
|
|
30
|
-
data-src-set={srcSet}
|
|
31
|
-
data-sizes={sizes}
|
|
32
|
-
{...rest}
|
|
33
|
-
/>
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export default LazyLoadImage;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022-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
|
-
import { Meta, StoryFn } from '@storybook/react';
|
|
10
|
-
import { DropdownMenu, DropdownContent, DropdownItem, DropdownTrigger } from '@ndla/dropdown-menu';
|
|
11
|
-
import { ButtonV2, IconButtonV2 } from '@ndla/button';
|
|
12
|
-
import { HorizontalMenu } from '@ndla/icons/contentType';
|
|
13
|
-
import { Pencil } from '@ndla/icons/action';
|
|
14
|
-
import { DeleteForever } from '@ndla/icons/editor';
|
|
15
|
-
import ListResource from './ListResource';
|
|
16
|
-
import { defaultParameters } from '../../../../stories/defaults';
|
|
17
|
-
|
|
18
|
-
const StoryResourceMenu = () => (
|
|
19
|
-
<DropdownMenu>
|
|
20
|
-
<DropdownTrigger>
|
|
21
|
-
<IconButtonV2 aria-label="Show more" title="Show more" variant="ghost" colorTheme="light">
|
|
22
|
-
<HorizontalMenu />
|
|
23
|
-
</IconButtonV2>
|
|
24
|
-
</DropdownTrigger>
|
|
25
|
-
<DropdownContent>
|
|
26
|
-
<DropdownItem>
|
|
27
|
-
<ButtonV2 variant="ghost" colorTheme="light" shape="sharp" size="small" fontWeight="normal">
|
|
28
|
-
<Pencil />
|
|
29
|
-
Rediger
|
|
30
|
-
</ButtonV2>
|
|
31
|
-
</DropdownItem>
|
|
32
|
-
<DropdownItem>
|
|
33
|
-
<ButtonV2 variant="ghost" colorTheme="danger" shape="sharp" size="small" fontWeight="normal">
|
|
34
|
-
<DeleteForever />
|
|
35
|
-
Slett
|
|
36
|
-
</ButtonV2>
|
|
37
|
-
</DropdownItem>
|
|
38
|
-
</DropdownContent>
|
|
39
|
-
</DropdownMenu>
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
export default {
|
|
43
|
-
title: 'Components/Resources/ListResource',
|
|
44
|
-
component: ListResource,
|
|
45
|
-
tags: ['autodocs'],
|
|
46
|
-
parameters: {
|
|
47
|
-
...defaultParameters,
|
|
48
|
-
},
|
|
49
|
-
argTypes: {
|
|
50
|
-
resourceImage: {
|
|
51
|
-
control: false,
|
|
52
|
-
},
|
|
53
|
-
resourceTypes: {
|
|
54
|
-
control: false,
|
|
55
|
-
},
|
|
56
|
-
headingLevel: {
|
|
57
|
-
control: false,
|
|
58
|
-
},
|
|
59
|
-
menu: {
|
|
60
|
-
control: false,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
args: {
|
|
64
|
-
id: '1234',
|
|
65
|
-
link: '',
|
|
66
|
-
title: 'Tittel til ressurs',
|
|
67
|
-
resourceImage: {
|
|
68
|
-
src: '',
|
|
69
|
-
alt: '',
|
|
70
|
-
},
|
|
71
|
-
resourceTypes: [{ id: 'urn:resourcetype:learningPath', name: 'Læringssti' }],
|
|
72
|
-
menu: <StoryResourceMenu />,
|
|
73
|
-
tags: ['tag', 'tag', 'tag', 'tag'],
|
|
74
|
-
},
|
|
75
|
-
} as Meta<typeof ListResource>;
|
|
76
|
-
|
|
77
|
-
export const ListResourceStory: StoryFn<typeof ListResource> = (args) => {
|
|
78
|
-
return <ListResource {...args} />;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
ListResourceStory.storyName = 'ListResource';
|