@ndla/ui 56.0.73-alpha.0 → 56.0.75-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panda.buildinfo.json +3 -21
- package/dist/styles.css +8 -76
- package/es/Article/Article.js +2 -2
- package/es/AudioPlayer/Controls.js +33 -31
- package/es/ContentTypeBadge/ContentTypeBadge.js +35 -213
- package/es/ContentTypeHero/ContentTypeHero.js +2 -1
- package/es/Embed/ImageEmbed.js +0 -1
- package/es/RelatedArticleList/RelatedArticleList.js +1 -1
- package/es/index.js +1 -3
- package/es/locale/messages-en.js +2 -1
- package/es/locale/messages-nb.js +2 -1
- package/es/locale/messages-nn.js +2 -1
- package/es/locale/messages-se.js +2 -1
- package/es/locale/messages-sma.js +2 -1
- package/es/model/ContentType.js +2 -0
- package/lib/Article/Article.d.ts +1 -1
- package/lib/Article/Article.js +1 -1
- package/lib/AudioPlayer/Controls.js +32 -30
- package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +9 -19
- package/lib/ContentTypeBadge/ContentTypeBadge.js +36 -223
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.d.ts +1 -1
- package/lib/ContentTypeHero/ContentTypeHero.d.ts +1 -1
- package/lib/ContentTypeHero/ContentTypeHero.js +2 -1
- package/lib/Embed/ImageEmbed.d.ts +0 -1
- package/lib/Embed/ImageEmbed.js +1 -2
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -2
- package/lib/i18n/useComponentTranslations.d.ts +1 -0
- package/lib/index.d.ts +2 -4
- package/lib/index.js +5 -61
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +2 -1
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +2 -1
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +2 -1
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +2 -1
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +2 -1
- package/lib/model/ContentType.d.ts +1 -0
- package/lib/model/ContentType.js +3 -1
- package/package.json +8 -8
- package/src/Article/Article.tsx +3 -3
- package/src/AudioPlayer/Controls.tsx +32 -29
- package/src/ContentTypeBadge/ContentTypeBadge.stories.tsx +45 -53
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +63 -211
- package/src/ContentTypeBlockQuote/ContentTypeBlockQuote.tsx +1 -1
- package/src/ContentTypeHero/ContentTypeHero.tsx +2 -1
- package/src/Embed/ImageEmbed.tsx +0 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +1 -1
- package/src/index.ts +2 -18
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +1 -0
- package/src/locale/messages-nn.ts +1 -0
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +1 -0
- package/src/model/ContentType.ts +2 -0
- package/es/ContentLoader/index.js +0 -82
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +0 -49
- package/es/ContentTypeBadge/index.js +0 -11
- package/lib/ContentLoader/index.d.ts +0 -16
- package/lib/ContentLoader/index.js +0 -88
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +0 -16
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +0 -57
- package/lib/ContentTypeBadge/index.d.ts +0 -10
- package/lib/ContentTypeBadge/index.js +0 -57
- package/src/ContentLoader/ContentLoader.stories.tsx +0 -62
- package/src/ContentLoader/index.tsx +0 -73
- package/src/ContentTypeBadge/ContentTypeBadgeNew.stories.tsx +0 -70
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +0 -77
- package/src/ContentTypeBadge/index.ts +0 -21
package/lib/index.js
CHANGED
|
@@ -63,12 +63,6 @@ Object.defineProperty(exports, "ArticleWrapper", {
|
|
|
63
63
|
return _Article.ArticleWrapper;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
Object.defineProperty(exports, "AssessmentResourcesBadge", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _ContentTypeBadge.AssessmentResourcesBadge;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
66
|
Object.defineProperty(exports, "AudioEmbed", {
|
|
73
67
|
enumerable: true,
|
|
74
68
|
get: function () {
|
|
@@ -123,12 +117,6 @@ Object.defineProperty(exports, "Concept", {
|
|
|
123
117
|
return _Concept.Concept;
|
|
124
118
|
}
|
|
125
119
|
});
|
|
126
|
-
Object.defineProperty(exports, "ConceptBadge", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _ContentTypeBadge.ConceptBadge;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
120
|
Object.defineProperty(exports, "ConceptEmbed", {
|
|
133
121
|
enumerable: true,
|
|
134
122
|
get: function () {
|
|
@@ -153,22 +141,10 @@ Object.defineProperty(exports, "ContentLinkEmbed", {
|
|
|
153
141
|
return _Embed.ContentLinkEmbed;
|
|
154
142
|
}
|
|
155
143
|
});
|
|
156
|
-
Object.defineProperty(exports, "ContentLoader", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function () {
|
|
159
|
-
return _ContentLoader.default;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
144
|
Object.defineProperty(exports, "ContentTypeBadge", {
|
|
163
145
|
enumerable: true,
|
|
164
146
|
get: function () {
|
|
165
|
-
return _ContentTypeBadge.
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "ContentTypeBadgeNew", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function () {
|
|
171
|
-
return _ContentTypeBadgeNew.ContentTypeBadge;
|
|
147
|
+
return _ContentTypeBadge.ContentTypeBadge;
|
|
172
148
|
}
|
|
173
149
|
});
|
|
174
150
|
Object.defineProperty(exports, "ContentTypeBlockQuote", {
|
|
@@ -339,12 +315,6 @@ Object.defineProperty(exports, "KeyFigure", {
|
|
|
339
315
|
return _KeyFigure.KeyFigure;
|
|
340
316
|
}
|
|
341
317
|
});
|
|
342
|
-
Object.defineProperty(exports, "LearningPathBadge", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function () {
|
|
345
|
-
return _ContentTypeBadge.LearningPathBadge;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
318
|
Object.defineProperty(exports, "LicenseLink", {
|
|
349
319
|
enumerable: true,
|
|
350
320
|
get: function () {
|
|
@@ -399,24 +369,6 @@ Object.defineProperty(exports, "ResourceBox", {
|
|
|
399
369
|
return _ResourceBox.ResourceBox;
|
|
400
370
|
}
|
|
401
371
|
});
|
|
402
|
-
Object.defineProperty(exports, "SourceMaterialBadge", {
|
|
403
|
-
enumerable: true,
|
|
404
|
-
get: function () {
|
|
405
|
-
return _ContentTypeBadge.SourceMaterialBadge;
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
Object.defineProperty(exports, "SubjectBadge", {
|
|
409
|
-
enumerable: true,
|
|
410
|
-
get: function () {
|
|
411
|
-
return _ContentTypeBadge.SubjectBadge;
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
Object.defineProperty(exports, "SubjectMaterialBadge", {
|
|
415
|
-
enumerable: true,
|
|
416
|
-
get: function () {
|
|
417
|
-
return _ContentTypeBadge.SubjectMaterialBadge;
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
372
|
Object.defineProperty(exports, "TagSelectorClearTrigger", {
|
|
421
373
|
enumerable: true,
|
|
422
374
|
get: function () {
|
|
@@ -465,12 +417,6 @@ Object.defineProperty(exports, "TagSelectorTrigger", {
|
|
|
465
417
|
return _TagSelector.TagSelectorTrigger;
|
|
466
418
|
}
|
|
467
419
|
});
|
|
468
|
-
Object.defineProperty(exports, "TasksAndActivitiesBadge", {
|
|
469
|
-
enumerable: true,
|
|
470
|
-
get: function () {
|
|
471
|
-
return _ContentTypeBadge.TasksAndActivitiesBadge;
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
420
|
Object.defineProperty(exports, "UnknownEmbed", {
|
|
475
421
|
enumerable: true,
|
|
476
422
|
get: function () {
|
|
@@ -510,7 +456,7 @@ Object.defineProperty(exports, "contactBlockBackgrounds", {
|
|
|
510
456
|
Object.defineProperty(exports, "contentTypeToBadgeVariantMap", {
|
|
511
457
|
enumerable: true,
|
|
512
458
|
get: function () {
|
|
513
|
-
return
|
|
459
|
+
return _ContentTypeBadge.contentTypeToBadgeVariantMap;
|
|
514
460
|
}
|
|
515
461
|
});
|
|
516
462
|
Object.defineProperty(exports, "formatNestedMessages", {
|
|
@@ -626,7 +572,6 @@ var _Embed = require("./Embed");
|
|
|
626
572
|
var _LicenseByline = require("./LicenseByline");
|
|
627
573
|
var _Article = require("./Article");
|
|
628
574
|
var _relativeUrl = require("./utils/relativeUrl");
|
|
629
|
-
var _ContentLoader = _interopRequireDefault(require("./ContentLoader"));
|
|
630
575
|
var _RelatedArticleList = _interopRequireWildcard(require("./RelatedArticleList"));
|
|
631
576
|
var _ErrorMessage = _interopRequireWildcard(require("./ErrorMessage"));
|
|
632
577
|
var _FileList = require("./FileList");
|
|
@@ -642,8 +587,7 @@ var _messagesSe = _interopRequireDefault(require("./locale/messages-se"));
|
|
|
642
587
|
var _messagesSma = _interopRequireDefault(require("./locale/messages-sma"));
|
|
643
588
|
var _Breadcrumb = _interopRequireWildcard(require("./Breadcrumb"));
|
|
644
589
|
var _i18n = require("./i18n");
|
|
645
|
-
var _ContentTypeBadge =
|
|
646
|
-
var _ContentTypeBadgeNew = require("./ContentTypeBadge/ContentTypeBadgeNew");
|
|
590
|
+
var _ContentTypeBadge = require("./ContentTypeBadge/ContentTypeBadge");
|
|
647
591
|
var _ContentTypeBlockQuote = require("./ContentTypeBlockQuote/ContentTypeBlockQuote");
|
|
648
592
|
var _ContentTypeFramedContent = require("./ContentTypeFramedContent/ContentTypeFramedContent");
|
|
649
593
|
var _CopyParagraphButton = _interopRequireDefault(require("./CopyParagraphButton"));
|
|
@@ -658,6 +602,6 @@ var _LinkBlock = require("./LinkBlock");
|
|
|
658
602
|
var _CodeBlock = require("./CodeBlock");
|
|
659
603
|
var _ZendeskButton = require("./ZendeskButton/ZendeskButton");
|
|
660
604
|
var _licenseAttributes = require("./utils/licenseAttributes");
|
|
605
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
661
606
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
662
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
663
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
607
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -580,7 +580,8 @@ const messages = {
|
|
|
580
580
|
external: "External",
|
|
581
581
|
gloss: "Gloss",
|
|
582
582
|
programme: "Programme",
|
|
583
|
-
"podcast-series": "Podcast series"
|
|
583
|
+
"podcast-series": "Podcast series",
|
|
584
|
+
"frontpage-article": "About NDLA article"
|
|
584
585
|
},
|
|
585
586
|
modal: {
|
|
586
587
|
closeModal: "Close"
|
|
@@ -580,7 +580,8 @@ const messages = {
|
|
|
580
580
|
external: "Ekstern",
|
|
581
581
|
gloss: "Glose",
|
|
582
582
|
programme: "Programfag",
|
|
583
|
-
"podcast-series": "Podkast-serie"
|
|
583
|
+
"podcast-series": "Podkast-serie",
|
|
584
|
+
"frontpage-article": "Om NDLA-artikkel"
|
|
584
585
|
},
|
|
585
586
|
modal: {
|
|
586
587
|
closeModal: "Lukk"
|
|
@@ -580,7 +580,8 @@ const messages = {
|
|
|
580
580
|
external: "Ekstern",
|
|
581
581
|
gloss: "Glose",
|
|
582
582
|
programme: "Programfag",
|
|
583
|
-
"podcast-series": "Podkast-serie"
|
|
583
|
+
"podcast-series": "Podkast-serie",
|
|
584
|
+
"frontpage-article": "Om NDLA-artikkel"
|
|
584
585
|
},
|
|
585
586
|
modal: {
|
|
586
587
|
closeModal: "Lukk"
|
|
@@ -580,7 +580,8 @@ const messages = {
|
|
|
580
580
|
external: "Ekstern",
|
|
581
581
|
gloss: "Glose",
|
|
582
582
|
programme: "Programfag",
|
|
583
|
-
"podcast-series": "Podkast-serie"
|
|
583
|
+
"podcast-series": "Podkast-serie",
|
|
584
|
+
"frontpage-article": "Om NDLA-artikkel"
|
|
584
585
|
},
|
|
585
586
|
modal: {
|
|
586
587
|
closeModal: "Govčča"
|
|
@@ -580,7 +580,8 @@ const messages = {
|
|
|
580
580
|
external: "Ekstern",
|
|
581
581
|
gloss: "Glose",
|
|
582
582
|
programme: "Programfag",
|
|
583
|
-
"podcast-series": "Podkast-serie"
|
|
583
|
+
"podcast-series": "Podkast-serie",
|
|
584
|
+
"frontpage-article": "Om NDLA-artikkel"
|
|
584
585
|
},
|
|
585
586
|
modal: {
|
|
586
587
|
closeModal: "Dahph"
|
|
@@ -23,6 +23,7 @@ export declare const PODCAST = "podcast";
|
|
|
23
23
|
export declare const GLOSS = "gloss";
|
|
24
24
|
export declare const PROGRAMME = "programme";
|
|
25
25
|
export declare const PODCAST_SERIES = "podcast-series";
|
|
26
|
+
export declare const FRONTPAGE_ARTICLE = "frontpage-article";
|
|
26
27
|
export declare const contentTypes: {
|
|
27
28
|
SUBJECT_MATERIAL: string;
|
|
28
29
|
TASKS_AND_ACTIVITIES: string;
|
package/lib/model/ContentType.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.resourceEmbedTypeMapping = exports.contentTypes = exports.contentTypeMapping = exports.VIDEO = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_CONCEPT = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.PROGRAMME = exports.PODCAST_SERIES = exports.PODCAST = exports.MULTIDISCIPLINARY = exports.MISSING = exports.LEARNING_PATH = exports.IMAGE = exports.GLOSS = exports.EXTERNAL = exports.CONCEPT = exports.AUDIO = exports.ASSESSMENT_RESOURCES = void 0;
|
|
6
|
+
exports.resourceEmbedTypeMapping = exports.contentTypes = exports.contentTypeMapping = exports.VIDEO = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_CONCEPT = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.PROGRAMME = exports.PODCAST_SERIES = exports.PODCAST = exports.MULTIDISCIPLINARY = exports.MISSING = exports.LEARNING_PATH = exports.IMAGE = exports.GLOSS = exports.FRONTPAGE_ARTICLE = exports.EXTERNAL = exports.CONCEPT = exports.AUDIO = exports.ASSESSMENT_RESOURCES = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Copyright (c) 2017-present, NDLA.
|
|
9
9
|
*
|
|
@@ -30,6 +30,7 @@ const PODCAST = exports.PODCAST = "podcast";
|
|
|
30
30
|
const GLOSS = exports.GLOSS = "gloss";
|
|
31
31
|
const PROGRAMME = exports.PROGRAMME = "programme";
|
|
32
32
|
const PODCAST_SERIES = exports.PODCAST_SERIES = "podcast-series";
|
|
33
|
+
const FRONTPAGE_ARTICLE = exports.FRONTPAGE_ARTICLE = "frontpage-article";
|
|
33
34
|
const contentTypes = exports.contentTypes = {
|
|
34
35
|
SUBJECT_MATERIAL,
|
|
35
36
|
TASKS_AND_ACTIVITIES,
|
|
@@ -60,6 +61,7 @@ const contentTypeMapping = exports.contentTypeMapping = {
|
|
|
60
61
|
[RESOURCE_TYPE_CONCEPT]: CONCEPT,
|
|
61
62
|
[MULTIDISCIPLINARY]: MULTIDISCIPLINARY,
|
|
62
63
|
[TOPIC]: TOPIC,
|
|
64
|
+
[FRONTPAGE_ARTICLE]: FRONTPAGE_ARTICLE,
|
|
63
65
|
default: SUBJECT_MATERIAL
|
|
64
66
|
};
|
|
65
67
|
const resourceEmbedTypeMapping = exports.resourceEmbedTypeMapping = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.75-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ndla/core": "^5.0.2",
|
|
36
|
-
"@ndla/icons": "^8.0.
|
|
36
|
+
"@ndla/icons": "^8.0.46-alpha.0",
|
|
37
37
|
"@ndla/licenses": "^8.0.4-alpha.0",
|
|
38
|
-
"@ndla/primitives": "^1.0.
|
|
39
|
-
"@ndla/safelink": "^7.0.
|
|
40
|
-
"@ndla/styled-system": "^0.0.
|
|
38
|
+
"@ndla/primitives": "^1.0.59-alpha.0",
|
|
39
|
+
"@ndla/safelink": "^7.0.60-alpha.0",
|
|
40
|
+
"@ndla/styled-system": "^0.0.29",
|
|
41
41
|
"@ndla/util": "^5.0.1-alpha.0",
|
|
42
42
|
"html-react-parser": "^5.1.8",
|
|
43
43
|
"i18next-browser-languagedetector": "^7.1.0"
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"react-router-dom": "> 6.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@ndla/preset-panda": "^0.0.
|
|
53
|
+
"@ndla/preset-panda": "^0.0.47",
|
|
54
54
|
"@ndla/types-backend": "^0.2.86",
|
|
55
55
|
"@ndla/types-embed": "^5.0.4-alpha.0",
|
|
56
|
-
"@pandacss/dev": "^0.
|
|
56
|
+
"@pandacss/dev": "^0.48.0"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8929fb445477b02e740a9a21fd2d3ef08287d99c"
|
|
62
62
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -12,9 +12,9 @@ import { Heading, Text } from "@ndla/primitives";
|
|
|
12
12
|
import { cx } from "@ndla/styled-system/css";
|
|
13
13
|
import { Stack, styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
15
|
-
import {
|
|
15
|
+
import { ContentTypeBadge } from "..";
|
|
16
16
|
import { ArticleByline } from "./ArticleByline";
|
|
17
|
-
import { ContentType } from "../ContentTypeBadge/
|
|
17
|
+
import { ContentType } from "../ContentTypeBadge/ContentTypeBadge";
|
|
18
18
|
import { Article as ArticleType } from "../types";
|
|
19
19
|
|
|
20
20
|
const StyledArticleContent = styled(ark.section, {}, { baseComponent: true });
|
|
@@ -135,7 +135,7 @@ export const ArticleTitle = ({
|
|
|
135
135
|
<ArticleHGroup>
|
|
136
136
|
{(!!contentType || !!heartButton) && (
|
|
137
137
|
<StyledStack justify="space-between" align="center" direction="row" gap="small">
|
|
138
|
-
{!!contentType && <
|
|
138
|
+
{!!contentType && <ContentTypeBadge contentType={contentType}>{contentTypeLabel}</ContentTypeBadge>}
|
|
139
139
|
{heartButton}
|
|
140
140
|
</StyledStack>
|
|
141
141
|
)}
|
|
@@ -14,6 +14,7 @@ import { PlayFill, PauseLine, VolumeUpFill } from "@ndla/icons/common";
|
|
|
14
14
|
import { CheckLine } from "@ndla/icons/editor";
|
|
15
15
|
import {
|
|
16
16
|
Button,
|
|
17
|
+
FieldRoot,
|
|
17
18
|
IconButton,
|
|
18
19
|
PopoverContent,
|
|
19
20
|
PopoverRoot,
|
|
@@ -292,35 +293,37 @@ const Controls = ({ src, title }: Props) => {
|
|
|
292
293
|
<div>-{formatTime(remainingTime)}</div>
|
|
293
294
|
</StyledText>
|
|
294
295
|
</ProgressWrapper>
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
<
|
|
304
|
-
<
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
<
|
|
317
|
-
|
|
318
|
-
<
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
296
|
+
<FieldRoot>
|
|
297
|
+
<StyledSelectRoot
|
|
298
|
+
collection={speedValues}
|
|
299
|
+
value={[speedValue.toString()]}
|
|
300
|
+
onValueChange={(details) => setSpeedValue(parseFloat(details.value[0]))}
|
|
301
|
+
positioning={{ placement: "top" }}
|
|
302
|
+
>
|
|
303
|
+
<SelectLabel css={visuallyHidden.raw()}>{t("audio.controls.selectSpeed")}</SelectLabel>
|
|
304
|
+
<SelectControl>
|
|
305
|
+
<SelectTrigger asChild>
|
|
306
|
+
<SpeedButton
|
|
307
|
+
variant="tertiary"
|
|
308
|
+
title={t("audio.controls.selectSpeed")}
|
|
309
|
+
aria-label={t("audio.controls.selectSpeed")}
|
|
310
|
+
>
|
|
311
|
+
<span>{`${speedValue}x`}</span>
|
|
312
|
+
</SpeedButton>
|
|
313
|
+
</SelectTrigger>
|
|
314
|
+
</SelectControl>
|
|
315
|
+
<SelectContent>
|
|
316
|
+
{speedValues.items.map((speed) => (
|
|
317
|
+
<SelectItem key={speed} item={speed}>
|
|
318
|
+
<SelectItemText>{speed}x</SelectItemText>
|
|
319
|
+
<SelectItemIndicator>
|
|
320
|
+
<CheckLine />
|
|
321
|
+
</SelectItemIndicator>
|
|
322
|
+
</SelectItem>
|
|
323
|
+
))}
|
|
324
|
+
</SelectContent>
|
|
325
|
+
</StyledSelectRoot>
|
|
326
|
+
</FieldRoot>
|
|
324
327
|
<PopoverRoot positioning={{ placement: "top" }}>
|
|
325
328
|
<PopoverTrigger asChild>
|
|
326
329
|
<VolumeButton variant="tertiary" aria-label={t("audio.controls.adjustVolume")}>
|
|
@@ -1,83 +1,75 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the GPLv3 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
9
10
|
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
|
-
import {
|
|
11
|
+
import { MovieLine } from "@ndla/icons/editor";
|
|
12
|
+
import { HStack, styled } from "@ndla/styled-system/jsx";
|
|
11
13
|
import { ContentTypeBadge } from "./ContentTypeBadge";
|
|
12
|
-
import * as contentTypes from "../model/ContentType";
|
|
13
14
|
|
|
14
15
|
export default {
|
|
15
16
|
title: "Components/ContentTypeBadge",
|
|
17
|
+
component: ContentTypeBadge,
|
|
16
18
|
tags: ["autodocs"],
|
|
17
19
|
parameters: {
|
|
18
20
|
inlineStories: true,
|
|
19
21
|
},
|
|
20
22
|
args: {
|
|
21
|
-
|
|
22
|
-
border: true,
|
|
23
|
-
type: "subject-material",
|
|
24
|
-
background: true,
|
|
25
|
-
title: "I'm a badge",
|
|
26
|
-
},
|
|
27
|
-
argTypes: {
|
|
28
|
-
children: { control: false },
|
|
23
|
+
contentType: "subject-material",
|
|
29
24
|
},
|
|
30
|
-
|
|
31
|
-
} as Meta<typeof ContentTypeBadge>;
|
|
25
|
+
} satisfies Meta<typeof ContentTypeBadge>;
|
|
32
26
|
|
|
33
27
|
export const Default: StoryObj<typeof ContentTypeBadge> = {};
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<ContentTypeBadge {...args} size="x-small" />
|
|
39
|
-
<ContentTypeBadge {...args} size="small" />
|
|
40
|
-
<ContentTypeBadge {...args} size="large" />
|
|
41
|
-
</>
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
export const NoBorder: StoryObj<typeof ContentTypeBadge> = {
|
|
45
|
-
args: {
|
|
46
|
-
border: false,
|
|
29
|
+
const StyledHStack = styled(HStack, {
|
|
30
|
+
base: {
|
|
31
|
+
flexWrap: "wrap",
|
|
47
32
|
},
|
|
48
|
-
};
|
|
33
|
+
});
|
|
49
34
|
|
|
50
|
-
export const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
export const AllBadges: StoryFn<typeof ContentTypeBadge> = () => (
|
|
36
|
+
<StyledHStack gap="3xsmall">
|
|
37
|
+
<ContentTypeBadge contentType="subject-material" />
|
|
38
|
+
<ContentTypeBadge contentType="tasks-and-activities" />
|
|
39
|
+
<ContentTypeBadge contentType="assessment-resources" />
|
|
40
|
+
<ContentTypeBadge contentType="subject" />
|
|
41
|
+
<ContentTypeBadge contentType="source-material" />
|
|
42
|
+
<ContentTypeBadge contentType="learning-path" />
|
|
43
|
+
<ContentTypeBadge contentType="topic" />
|
|
44
|
+
<ContentTypeBadge contentType="multidisciplinary" />
|
|
45
|
+
<ContentTypeBadge contentType="concept" />
|
|
46
|
+
<ContentTypeBadge contentType="external" />
|
|
47
|
+
<ContentTypeBadge contentType="image" />
|
|
48
|
+
<ContentTypeBadge contentType="audio" />
|
|
49
|
+
<ContentTypeBadge contentType="video" />
|
|
50
|
+
<ContentTypeBadge contentType="missing" />
|
|
51
|
+
<ContentTypeBadge contentType="frontpage-article" />
|
|
52
|
+
<ContentTypeBadge contentType="programme" />
|
|
53
|
+
<ContentTypeBadge contentType="podcast" />
|
|
54
|
+
<ContentTypeBadge contentType="podcast-series" />
|
|
55
|
+
<ContentTypeBadge contentType="gloss" />
|
|
56
|
+
</StyledHStack>
|
|
57
|
+
);
|
|
55
58
|
|
|
56
|
-
const
|
|
59
|
+
const StyledContentTypeBadge = styled(ContentTypeBadge, {
|
|
57
60
|
base: {
|
|
58
61
|
display: "flex",
|
|
62
|
+
gap: "4xsmall",
|
|
59
63
|
alignItems: "center",
|
|
60
|
-
gap: "xsmall",
|
|
61
64
|
},
|
|
62
65
|
});
|
|
63
66
|
|
|
64
|
-
export const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<ContentTypeBadge {...args} type={contentTypes.MULTIDISCIPLINARY} />
|
|
74
|
-
<ContentTypeBadge {...args} type={contentTypes.CONCEPT} />
|
|
75
|
-
<ContentTypeBadge {...args} type={contentTypes.EXTERNAL} />
|
|
76
|
-
<ContentTypeBadge {...args} type={contentTypes.resourceEmbedTypeMapping.image} />
|
|
77
|
-
<ContentTypeBadge {...args} type={contentTypes.resourceEmbedTypeMapping.audio} />
|
|
78
|
-
<ContentTypeBadge {...args} type={contentTypes.resourceEmbedTypeMapping.video} />
|
|
79
|
-
<ContentTypeBadge {...args} type={contentTypes.GLOSS} />
|
|
80
|
-
<ContentTypeBadge {...args} type={contentTypes.PROGRAMME} />
|
|
81
|
-
<ContentTypeBadge {...args} type={contentTypes.PODCAST_SERIES} />
|
|
82
|
-
</BadgesWrapper>
|
|
83
|
-
);
|
|
67
|
+
export const ContentOverride: StoryFn<typeof ContentTypeBadge> = () => {
|
|
68
|
+
const { t } = useTranslation();
|
|
69
|
+
return (
|
|
70
|
+
<StyledContentTypeBadge contentType="video">
|
|
71
|
+
<MovieLine size="small" />
|
|
72
|
+
{t("contentTypes.video")}
|
|
73
|
+
</StyledContentTypeBadge>
|
|
74
|
+
);
|
|
75
|
+
};
|