@ndla/ui 47.1.3 → 47.3.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/DefinitionList/DefinitionDescription.js +2 -2
- package/es/DefinitionList/DefinitionTerm.js +2 -2
- 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/LinkBlock/LinkBlock.js +6 -6
- package/es/Messages/MessageBox.js +22 -56
- 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/DefinitionList/DefinitionDescription.js +1 -1
- package/lib/DefinitionList/DefinitionTerm.js +1 -1
- 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/LinkBlock/LinkBlock.js +6 -6
- package/lib/Messages/MessageBox.d.ts +2 -2
- package/lib/Messages/MessageBox.js +21 -55
- 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/DefinitionList/DefinitionDescription.tsx +1 -2
- package/src/DefinitionList/DefinitionTerm.tsx +1 -2
- package/src/Embed/FootnoteEmbed.stories.tsx +134 -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/LinkBlock/LinkBlock.tsx +1 -1
- 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 +97 -0
- package/src/Messages/MessageBox.tsx +28 -62
- 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/ResourceGroup/ResourceItem.stories.tsx +103 -0
- package/src/SnackBar/Snack.stories.tsx +91 -0
- package/src/Table/Table.stories.tsx +701 -0
- package/src/TreeStructure/TreeStructure.stories.tsx +271 -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
|
@@ -225,8 +225,14 @@ declare const messages: {
|
|
|
225
225
|
};
|
|
226
226
|
myProfile: {
|
|
227
227
|
title: string;
|
|
228
|
-
disclaimerTitle:
|
|
229
|
-
|
|
228
|
+
disclaimerTitle: {
|
|
229
|
+
employee: string;
|
|
230
|
+
student: string;
|
|
231
|
+
};
|
|
232
|
+
disclaimerText: {
|
|
233
|
+
employee: string;
|
|
234
|
+
student: string;
|
|
235
|
+
};
|
|
230
236
|
preferenceTitle: string;
|
|
231
237
|
preferenceText: string;
|
|
232
238
|
editButtonText: string;
|
|
@@ -799,6 +805,11 @@ declare const messages: {
|
|
|
799
805
|
subject: {
|
|
800
806
|
associatedTopics: string;
|
|
801
807
|
};
|
|
808
|
+
subjectFrontPage: {
|
|
809
|
+
buildsOn: string;
|
|
810
|
+
connectedTo: string;
|
|
811
|
+
leadsTo: string;
|
|
812
|
+
};
|
|
802
813
|
accordion: {
|
|
803
814
|
closeAll: string;
|
|
804
815
|
openAll: string;
|
|
@@ -484,6 +484,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
484
484
|
subject: {
|
|
485
485
|
associatedTopics: 'Tilhørende emner'
|
|
486
486
|
},
|
|
487
|
+
subjectFrontPage: {
|
|
488
|
+
buildsOn: 'Bygger på',
|
|
489
|
+
connectedTo: 'Felles programfag sammen med',
|
|
490
|
+
leadsTo: 'Leder til'
|
|
491
|
+
},
|
|
487
492
|
accordion: {
|
|
488
493
|
closeAll: 'Lukk alle',
|
|
489
494
|
openAll: 'Åpne alle'
|
|
@@ -1229,8 +1234,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1229
1234
|
},
|
|
1230
1235
|
myProfile: {
|
|
1231
1236
|
title: 'Min Profil',
|
|
1232
|
-
disclaimerTitle:
|
|
1233
|
-
|
|
1237
|
+
disclaimerTitle: {
|
|
1238
|
+
employee: 'Hvor brukes bildet og navnet mitt?',
|
|
1239
|
+
student: 'Hvor brukes navnet mitt?'
|
|
1240
|
+
},
|
|
1241
|
+
disclaimerText: {
|
|
1242
|
+
employee: 'Bilde og navn vises når du deltar i diskusjoner i arenaen.',
|
|
1243
|
+
student: 'Navnet ditt vises bare for deg selv når du er logget inn.'
|
|
1244
|
+
},
|
|
1234
1245
|
preferenceTitle: 'Velg om du vil vise navn når du deler en mappe',
|
|
1235
1246
|
preferenceText: '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.',
|
|
1236
1247
|
editButtonText: 'Endre profilbilde',
|
|
@@ -1294,8 +1305,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1294
1305
|
help: 'Hjelp'
|
|
1295
1306
|
},
|
|
1296
1307
|
programmes: {
|
|
1297
|
-
header: '
|
|
1298
|
-
description: '
|
|
1308
|
+
header: 'Hva vil du lære om i dag?',
|
|
1309
|
+
description: 'Velg utdanningsprogram for å se dine fag',
|
|
1299
1310
|
grades: 'Trinn',
|
|
1300
1311
|
accordionHeader: 'Alle utdanningsprogram'
|
|
1301
1312
|
},
|
|
@@ -225,8 +225,14 @@ declare const messages: {
|
|
|
225
225
|
};
|
|
226
226
|
myProfile: {
|
|
227
227
|
title: string;
|
|
228
|
-
disclaimerTitle:
|
|
229
|
-
|
|
228
|
+
disclaimerTitle: {
|
|
229
|
+
employee: string;
|
|
230
|
+
student: string;
|
|
231
|
+
};
|
|
232
|
+
disclaimerText: {
|
|
233
|
+
employee: string;
|
|
234
|
+
student: string;
|
|
235
|
+
};
|
|
230
236
|
preferenceTitle: string;
|
|
231
237
|
preferenceText: string;
|
|
232
238
|
editButtonText: string;
|
|
@@ -799,6 +805,11 @@ declare const messages: {
|
|
|
799
805
|
subject: {
|
|
800
806
|
associatedTopics: string;
|
|
801
807
|
};
|
|
808
|
+
subjectFrontPage: {
|
|
809
|
+
buildsOn: string;
|
|
810
|
+
connectedTo: string;
|
|
811
|
+
leadsTo: string;
|
|
812
|
+
};
|
|
802
813
|
accordion: {
|
|
803
814
|
closeAll: string;
|
|
804
815
|
openAll: string;
|
|
@@ -484,6 +484,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
484
484
|
subject: {
|
|
485
485
|
associatedTopics: 'Tilhøyrande emne'
|
|
486
486
|
},
|
|
487
|
+
subjectFrontPage: {
|
|
488
|
+
buildsOn: 'Byggjer på',
|
|
489
|
+
connectedTo: 'Felles programfag saman med',
|
|
490
|
+
leadsTo: 'Leier til'
|
|
491
|
+
},
|
|
487
492
|
accordion: {
|
|
488
493
|
closeAll: 'Lukk alle',
|
|
489
494
|
openAll: 'Åpne alle'
|
|
@@ -1229,8 +1234,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1229
1234
|
},
|
|
1230
1235
|
myProfile: {
|
|
1231
1236
|
title: 'Min Profil',
|
|
1232
|
-
disclaimerTitle:
|
|
1233
|
-
|
|
1237
|
+
disclaimerTitle: {
|
|
1238
|
+
employee: 'Kvar blir biletet og namnet mitt brukt?',
|
|
1239
|
+
student: 'Kvar blir namnet mitt brukt?'
|
|
1240
|
+
},
|
|
1241
|
+
disclaimerText: {
|
|
1242
|
+
employee: 'Bilete og namn vert vist når du deltek i diskusjonar i arenaen.',
|
|
1243
|
+
student: 'Namnet ditt blir berre vist for deg sjølv når du er logga inn.'
|
|
1244
|
+
},
|
|
1234
1245
|
preferenceTitle: 'Vel om du vil vise namn når du deler ei mappe',
|
|
1235
1246
|
preferenceText: '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.',
|
|
1236
1247
|
editButtonText: 'Endre profilbilete',
|
|
@@ -1294,8 +1305,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1294
1305
|
help: 'Hjelp'
|
|
1295
1306
|
},
|
|
1296
1307
|
programmes: {
|
|
1297
|
-
header: '
|
|
1298
|
-
description: '
|
|
1308
|
+
header: 'Kva vil du lære om i dag?',
|
|
1309
|
+
description: 'Vel utdanningsprogram for å sjå faga dine',
|
|
1299
1310
|
grades: 'Trinn',
|
|
1300
1311
|
accordionHeader: 'Alle utdanningsprogram'
|
|
1301
1312
|
},
|
|
@@ -225,8 +225,14 @@ declare const messages: {
|
|
|
225
225
|
};
|
|
226
226
|
myProfile: {
|
|
227
227
|
title: string;
|
|
228
|
-
disclaimerTitle:
|
|
229
|
-
|
|
228
|
+
disclaimerTitle: {
|
|
229
|
+
employee: string;
|
|
230
|
+
student: string;
|
|
231
|
+
};
|
|
232
|
+
disclaimerText: {
|
|
233
|
+
employee: string;
|
|
234
|
+
student: string;
|
|
235
|
+
};
|
|
230
236
|
preferenceTitle: string;
|
|
231
237
|
preferenceText: string;
|
|
232
238
|
editButtonText: string;
|
|
@@ -799,6 +805,11 @@ declare const messages: {
|
|
|
799
805
|
subject: {
|
|
800
806
|
associatedTopics: string;
|
|
801
807
|
};
|
|
808
|
+
subjectFrontPage: {
|
|
809
|
+
buildsOn: string;
|
|
810
|
+
connectedTo: string;
|
|
811
|
+
leadsTo: string;
|
|
812
|
+
};
|
|
802
813
|
accordion: {
|
|
803
814
|
closeAll: string;
|
|
804
815
|
openAll: string;
|
|
@@ -484,6 +484,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
484
484
|
subject: {
|
|
485
485
|
associatedTopics: 'Gullevaš fáttát'
|
|
486
486
|
},
|
|
487
|
+
subjectFrontPage: {
|
|
488
|
+
buildsOn: 'Duddjo dása',
|
|
489
|
+
connectedTo: 'Oktasaš prográmmafáddán lea',
|
|
490
|
+
leadsTo: 'Dát doalvu'
|
|
491
|
+
},
|
|
487
492
|
accordion: {
|
|
488
493
|
closeAll: 'Govčča buot',
|
|
489
494
|
openAll: 'Raba buot'
|
|
@@ -1229,8 +1234,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1229
1234
|
},
|
|
1230
1235
|
myProfile: {
|
|
1231
1236
|
title: 'Mu profiila',
|
|
1232
|
-
disclaimerTitle:
|
|
1233
|
-
|
|
1237
|
+
disclaimerTitle: {
|
|
1238
|
+
employee: 'Gos geavahit mu gova ja mu nama?',
|
|
1239
|
+
student: 'Gos geavahit mu nama?'
|
|
1240
|
+
},
|
|
1241
|
+
disclaimerText: {
|
|
1242
|
+
employee: 'Govva ja namma čájehuvvojit go searvat digaštallamii arenain.',
|
|
1243
|
+
student: 'Du namma čájehuvvo dušše go leat sisačálihuvvon'
|
|
1244
|
+
},
|
|
1234
1245
|
preferenceTitle: 'Vállje jos namma čájehuvvo máhpa juohkkedettiin',
|
|
1235
1246
|
preferenceText: '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.',
|
|
1236
1247
|
editButtonText: 'Rievdat profiilagova',
|
|
@@ -225,8 +225,14 @@ declare const messages: {
|
|
|
225
225
|
};
|
|
226
226
|
myProfile: {
|
|
227
227
|
title: string;
|
|
228
|
-
disclaimerTitle:
|
|
229
|
-
|
|
228
|
+
disclaimerTitle: {
|
|
229
|
+
employee: string;
|
|
230
|
+
student: string;
|
|
231
|
+
};
|
|
232
|
+
disclaimerText: {
|
|
233
|
+
employee: string;
|
|
234
|
+
student: string;
|
|
235
|
+
};
|
|
230
236
|
preferenceTitle: string;
|
|
231
237
|
preferenceText: string;
|
|
232
238
|
editButtonText: string;
|
|
@@ -799,6 +805,11 @@ declare const messages: {
|
|
|
799
805
|
subject: {
|
|
800
806
|
associatedTopics: string;
|
|
801
807
|
};
|
|
808
|
+
subjectFrontPage: {
|
|
809
|
+
buildsOn: string;
|
|
810
|
+
connectedTo: string;
|
|
811
|
+
leadsTo: string;
|
|
812
|
+
};
|
|
802
813
|
accordion: {
|
|
803
814
|
closeAll: string;
|
|
804
815
|
openAll: string;
|
|
@@ -484,6 +484,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
484
484
|
subject: {
|
|
485
485
|
associatedTopics: 'Teemah mah govlehtuvvieh'
|
|
486
486
|
},
|
|
487
|
+
subjectFrontPage: {
|
|
488
|
+
buildsOn: 'Bigkie bæjjese',
|
|
489
|
+
connectedTo: 'Tjåenghkies programmefaage aalkoealmetjidie',
|
|
490
|
+
leadsTo: 'Goh ryökneme'
|
|
491
|
+
},
|
|
487
492
|
accordion: {
|
|
488
493
|
closeAll: 'Dahph gaajhkh',
|
|
489
494
|
openAll: 'Rïhpesth gaajhkh'
|
|
@@ -1229,8 +1234,14 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1229
1234
|
},
|
|
1230
1235
|
myProfile: {
|
|
1231
1236
|
title: 'Mov Profijle',
|
|
1232
|
-
disclaimerTitle:
|
|
1233
|
-
|
|
1237
|
+
disclaimerTitle: {
|
|
1238
|
+
employee: 'Gusnie guvvie jïh nomme åtnasuvvieh?',
|
|
1239
|
+
student: 'Gusnie mov nomme'
|
|
1240
|
+
},
|
|
1241
|
+
disclaimerText: {
|
|
1242
|
+
employee: 'Guvvie jïh nomme våajnoes sjidtieh gosse meatan digkiedimmesne sijjesne.',
|
|
1243
|
+
student: 'Dov nomme ajve tjaalasåvva dutnjien gosse sïjse loggedh'
|
|
1244
|
+
},
|
|
1234
1245
|
preferenceTitle: 'Sjïehtedh jis edtja nommem vuesiehtidh gosse maabpam juekedh',
|
|
1235
1246
|
preferenceText: '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.',
|
|
1236
1247
|
editButtonText: 'Naemhtie profijleguvviem jarkelidh',
|
|
@@ -1294,10 +1305,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1294
1305
|
help: 'Hjelp'
|
|
1295
1306
|
},
|
|
1296
1307
|
programmes: {
|
|
1297
|
-
header: '
|
|
1298
|
-
description: '
|
|
1299
|
-
grades: '
|
|
1300
|
-
accordionHeader: '
|
|
1308
|
+
header: 'Maam sïjhth daan biejjien lïeredh ?',
|
|
1309
|
+
description: 'Veeljh ööhpehtimmieprogrammem juktie dov faagide vuartasjidh',
|
|
1310
|
+
grades: 'Daltesasse',
|
|
1311
|
+
accordionHeader: 'Gaajhkh ööhpehtimmieprogrammh'
|
|
1301
1312
|
},
|
|
1302
1313
|
embed: {
|
|
1303
1314
|
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "47.
|
|
3
|
+
"version": "47.3.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^2.2.
|
|
35
|
-
"@ndla/button": "^12.0.
|
|
36
|
-
"@ndla/carousel": "^4.0.
|
|
37
|
-
"@ndla/core": "^4.2.
|
|
38
|
-
"@ndla/dropdown-menu": "^1.0.
|
|
39
|
-
"@ndla/forms": "^5.0.
|
|
34
|
+
"@ndla/accordion": "^2.2.31",
|
|
35
|
+
"@ndla/button": "^12.0.5",
|
|
36
|
+
"@ndla/carousel": "^4.0.8",
|
|
37
|
+
"@ndla/core": "^4.2.2",
|
|
38
|
+
"@ndla/dropdown-menu": "^1.0.11",
|
|
39
|
+
"@ndla/forms": "^5.0.7",
|
|
40
40
|
"@ndla/hooks": "^2.1.1",
|
|
41
|
-
"@ndla/icons": "^4.1.
|
|
42
|
-
"@ndla/licenses": "^7.2.
|
|
43
|
-
"@ndla/modal": "^5.0.
|
|
44
|
-
"@ndla/notion": "^6.0.
|
|
45
|
-
"@ndla/safelink": "^4.1.
|
|
46
|
-
"@ndla/select": "^3.1.
|
|
47
|
-
"@ndla/switch": "^1.1.
|
|
48
|
-
"@ndla/tabs": "^3.1.
|
|
49
|
-
"@ndla/tooltip": "^5.0.
|
|
50
|
-
"@ndla/typography": "^0.2.
|
|
41
|
+
"@ndla/icons": "^4.1.3",
|
|
42
|
+
"@ndla/licenses": "^7.2.2",
|
|
43
|
+
"@ndla/modal": "^5.0.5",
|
|
44
|
+
"@ndla/notion": "^6.0.7",
|
|
45
|
+
"@ndla/safelink": "^4.1.30",
|
|
46
|
+
"@ndla/select": "^3.1.3",
|
|
47
|
+
"@ndla/switch": "^1.1.17",
|
|
48
|
+
"@ndla/tabs": "^3.1.2",
|
|
49
|
+
"@ndla/tooltip": "^5.0.5",
|
|
50
|
+
"@ndla/typography": "^0.2.4",
|
|
51
51
|
"@ndla/util": "^4.0.0",
|
|
52
52
|
"@radix-ui/react-popover": "^1.0.7",
|
|
53
53
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "6efaf50569b477800eb4a8093eb01c6ea2205479"
|
|
84
84
|
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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, StoryObj } from '@storybook/react';
|
|
10
|
+
import Breadcrumb from './Breadcrumb';
|
|
11
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
12
|
+
|
|
13
|
+
const items = [
|
|
14
|
+
{
|
|
15
|
+
name: 'Fag',
|
|
16
|
+
to: '#1',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'Hovedemne tittel',
|
|
20
|
+
to: '#2',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Underemne tittel',
|
|
24
|
+
to: '#3',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Tittel på side/ressurs',
|
|
28
|
+
to: '#4',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
title: 'Components/Breadcrumb/Breadcrumb',
|
|
34
|
+
component: Breadcrumb,
|
|
35
|
+
tags: ['autodocs'],
|
|
36
|
+
args: {
|
|
37
|
+
items: items,
|
|
38
|
+
},
|
|
39
|
+
parameters: {
|
|
40
|
+
inlineStories: true,
|
|
41
|
+
...defaultParameters,
|
|
42
|
+
},
|
|
43
|
+
} as Meta<typeof Breadcrumb>;
|
|
44
|
+
|
|
45
|
+
export const Defalt: StoryObj<typeof Breadcrumb> = {};
|
|
46
|
+
|
|
47
|
+
export const CollapseFirst: StoryObj<typeof Breadcrumb> = {
|
|
48
|
+
args: { collapseFirst: true },
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const CollapseLast: StoryObj<typeof Breadcrumb> = {
|
|
52
|
+
args: { collapseLast: true },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const AutoCollapse: StoryObj<typeof Breadcrumb> = {
|
|
56
|
+
args: { autoCollapse: true },
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const CustomSeparator: StoryObj<typeof Breadcrumb> = {
|
|
60
|
+
args: {
|
|
61
|
+
renderSeparator: (item, totalCount) => (
|
|
62
|
+
<div style={{ padding: '0px 12px' }}>
|
|
63
|
+
{item.index}/{totalCount}
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const CustomItem: StoryObj<typeof Breadcrumb> = {
|
|
70
|
+
args: {
|
|
71
|
+
renderItem: (item) => (
|
|
72
|
+
<div>
|
|
73
|
+
{item.index}:{item.name}
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-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, StoryObj } from '@storybook/react';
|
|
10
|
+
import { colors } from '@ndla/core';
|
|
11
|
+
import HomeBreadcrumb from './HomeBreadcrumb';
|
|
12
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
13
|
+
|
|
14
|
+
const items = [
|
|
15
|
+
{
|
|
16
|
+
name: 'Fag',
|
|
17
|
+
to: '#1',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Hovedemne tittel',
|
|
21
|
+
to: '#2',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Underemne tittel',
|
|
25
|
+
to: '#3',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Tittel på side/ressurs',
|
|
29
|
+
to: '#4',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
title: 'Components/Breadcrumb/HomeBreadcrumb',
|
|
35
|
+
component: HomeBreadcrumb,
|
|
36
|
+
tags: ['autodocs'],
|
|
37
|
+
parameters: {
|
|
38
|
+
inlineStories: true,
|
|
39
|
+
...defaultParameters,
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
items: items,
|
|
43
|
+
},
|
|
44
|
+
} as Meta<typeof HomeBreadcrumb>;
|
|
45
|
+
|
|
46
|
+
export const Default: StoryObj<typeof HomeBreadcrumb> = {};
|
|
47
|
+
|
|
48
|
+
export const Light: StoryObj<typeof HomeBreadcrumb> = {
|
|
49
|
+
args: { light: true },
|
|
50
|
+
decorators: [
|
|
51
|
+
(Story) => (
|
|
52
|
+
<div style={{ backgroundColor: colors.brand.primary }}>
|
|
53
|
+
<Story />
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-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, StoryObj } from '@storybook/react';
|
|
10
|
+
import ContentLoader from '.';
|
|
11
|
+
import { defaultParameters } from '../../../../stories/defaults';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Components/ContentLoader',
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
parameters: {
|
|
17
|
+
inlineStories: true,
|
|
18
|
+
...defaultParameters,
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
speed: 2,
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
children: { control: false },
|
|
25
|
+
},
|
|
26
|
+
component: ContentLoader,
|
|
27
|
+
} as Meta<typeof ContentLoader>;
|
|
28
|
+
|
|
29
|
+
export const ImageOrVideo: StoryObj<typeof ContentLoader> = {
|
|
30
|
+
args: {
|
|
31
|
+
width: 1000,
|
|
32
|
+
height: 750,
|
|
33
|
+
children: (
|
|
34
|
+
<>
|
|
35
|
+
<rect x="0" y="0" rx="3" ry="3" width="800" height="600" />
|
|
36
|
+
<rect x="20" y="610" rx="3" ry="3" width="600" height="30" />
|
|
37
|
+
<rect x="20" y="650" rx="3" ry="3" width="400" height="30" />
|
|
38
|
+
<circle cx="30" cy="700" r="15" fill="purple" />
|
|
39
|
+
<circle cx="70" cy="700" r="15" fill="purple" />
|
|
40
|
+
<circle cx="110" cy="700" r="15" fill="purple" />
|
|
41
|
+
</>
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Article: StoryObj<typeof ContentLoader> = {
|
|
47
|
+
args: {
|
|
48
|
+
width: 1000,
|
|
49
|
+
height: 1050,
|
|
50
|
+
children: (
|
|
51
|
+
<>
|
|
52
|
+
<rect x="100" y="0" rx="3" ry="3" width="800" height="60" />
|
|
53
|
+
<rect x="100" y="100" rx="3" ry="3" width="800" height="25" />
|
|
54
|
+
<rect x="100" y="140" rx="3" ry="3" width="800" height="25" />
|
|
55
|
+
<rect x="100" y="180" rx="3" ry="3" width="400" height="25" />
|
|
56
|
+
<rect x="0" y="260" rx="3" ry="3" width="1000" height="600" />
|
|
57
|
+
<rect x="100" y="900" rx="3" ry="3" width="800" height="20" />
|
|
58
|
+
<rect x="100" y="930" rx="3" ry="3" width="800" height="20" />
|
|
59
|
+
<rect x="100" y="970" rx="3" ry="3" width="800" height="20" />
|
|
60
|
+
<rect x="100" y="1000" rx="3" ry="3" width="600" height="20" />
|
|
61
|
+
</>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
|
-
import {
|
|
10
|
+
import { fonts } from '@ndla/core';
|
|
11
11
|
import { forwardRef, HTMLAttributes } from 'react';
|
|
12
12
|
|
|
13
13
|
const StyledDD = styled.dd`
|
|
14
|
-
color: ${colors.text.light};
|
|
15
14
|
font-weight: ${fonts.weight.normal};
|
|
16
15
|
${fonts.sizes('18px', '29px')};
|
|
17
16
|
`;
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
|
-
import {
|
|
10
|
+
import { fonts } from '@ndla/core';
|
|
11
11
|
import { forwardRef, HTMLAttributes } from 'react';
|
|
12
12
|
|
|
13
13
|
const StyledDT = styled.dt`
|
|
14
|
-
color: ${colors.text.primary};
|
|
15
14
|
font-weight: ${fonts.weight.bold};
|
|
16
15
|
${fonts.sizes('18px', '29px')};
|
|
17
16
|
`;
|