@ndla/ui 55.0.13-alpha.0 → 55.0.15-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 +142 -1
- package/dist/styles.css +597 -0
- package/es/Article/ArticleByline.js +7 -7
- package/es/Article/ArticleParagraph.js +11 -13
- package/es/AudioPlayer/AudioPlayer.js +1 -0
- package/es/CampaignBlock/CampaignBlock.js +103 -68
- package/es/Concept/Concept.js +69 -0
- package/es/ContactBlock/ContactBlock.js +17 -17
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +48 -0
- package/es/Embed/AudioEmbed.js +1 -2
- package/es/Embed/BrightcoveEmbed.js +13 -25
- package/es/Embed/ConceptEmbed.js +57 -301
- package/es/Embed/ConceptListEmbed.js +18 -24
- package/es/Embed/ContentLinkEmbed.js +10 -10
- package/es/Embed/CopyrightEmbed.js +3 -21
- package/es/Embed/ExternalEmbed.js +10 -18
- package/es/Embed/FootnoteEmbed.js +11 -8
- package/es/Embed/GlossEmbed.js +68 -0
- package/es/Embed/H5pEmbed.js +19 -19
- package/es/Embed/IframeEmbed.js +9 -6
- package/es/Embed/InlineTriggerButton.js +70 -0
- package/es/Embed/UnknownEmbed.js +9 -9
- package/es/Embed/UuDisclaimerEmbed.js +14 -25
- package/es/Embed/index.js +1 -3
- package/es/ErrorMessage/ErrorMessage.js +41 -22
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +8 -6
- package/es/FactBox/FactBox.js +118 -47
- package/es/FileList/PdfFile.js +23 -5
- package/es/Gloss/Gloss.js +116 -86
- package/es/Gloss/GlossExample.js +49 -51
- package/es/LicenseByline/EmbedByline.js +143 -33
- package/es/LicenseByline/LicenseLink.js +16 -9
- package/es/LicenseByline/index.js +2 -2
- package/es/LinkBlock/LinkBlock.js +61 -33
- package/es/LinkBlock/LinkBlockSection.js +9 -6
- package/es/Logo/Logo.js +1 -30
- package/es/RelatedArticleList/RelatedArticleList.js +70 -87
- package/es/ResourceBox/ResourceBox.js +65 -37
- package/es/TagSelector/TagSelector.js +124 -131
- package/es/i18n/index.js +2 -1
- package/es/i18n/useComponentTranslations.js +83 -0
- package/es/index.js +4 -12
- package/es/locale/messages-en.js +30 -4
- package/es/locale/messages-nb.js +30 -4
- package/es/locale/messages-nn.js +30 -4
- package/es/locale/messages-se.js +30 -4
- package/es/locale/messages-sma.js +30 -4
- package/es/model/ContentType.js +3 -0
- package/es/styles.css +597 -0
- package/lib/Article/ArticleByline.js +8 -8
- package/lib/Article/ArticleParagraph.js +12 -14
- package/lib/AudioPlayer/AudioPlayer.js +1 -0
- package/lib/CampaignBlock/CampaignBlock.d.ts +2 -2
- package/lib/CampaignBlock/CampaignBlock.js +106 -68
- package/lib/Concept/Concept.d.ts +18 -0
- package/lib/Concept/Concept.js +75 -0
- package/lib/ContactBlock/ContactBlock.js +18 -18
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +17 -0
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +56 -0
- package/lib/Embed/AudioEmbed.js +2 -3
- package/lib/Embed/BrightcoveEmbed.d.ts +1 -2
- package/lib/Embed/BrightcoveEmbed.js +16 -26
- package/lib/Embed/ConceptEmbed.d.ts +15 -21
- package/lib/Embed/ConceptEmbed.js +58 -301
- package/lib/Embed/ConceptListEmbed.js +21 -26
- package/lib/Embed/ContentLinkEmbed.js +10 -11
- package/lib/Embed/CopyrightEmbed.js +5 -22
- package/lib/Embed/ExternalEmbed.d.ts +1 -2
- package/lib/Embed/ExternalEmbed.js +13 -19
- package/lib/Embed/FootnoteEmbed.js +11 -9
- package/lib/Embed/GlossEmbed.d.ts +13 -0
- package/lib/Embed/GlossEmbed.js +76 -0
- package/lib/Embed/H5pEmbed.d.ts +1 -2
- package/lib/Embed/H5pEmbed.js +21 -19
- package/lib/Embed/IframeEmbed.d.ts +1 -2
- package/lib/Embed/IframeEmbed.js +11 -8
- package/lib/Embed/InlineTriggerButton.d.ts +11 -0
- package/lib/Embed/InlineTriggerButton.js +76 -0
- package/lib/Embed/UnknownEmbed.js +9 -10
- package/lib/Embed/UuDisclaimerEmbed.js +16 -26
- package/lib/Embed/index.d.ts +2 -3
- package/lib/Embed/index.js +2 -9
- package/lib/ErrorMessage/ErrorMessage.js +40 -23
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +7 -6
- package/lib/FactBox/FactBox.d.ts +0 -1
- package/lib/FactBox/FactBox.js +119 -46
- package/lib/FileList/PdfFile.js +23 -5
- package/lib/Gloss/Gloss.d.ts +10 -2
- package/lib/Gloss/Gloss.js +116 -85
- package/lib/Gloss/GlossExample.d.ts +3 -5
- package/lib/Gloss/GlossExample.js +49 -52
- package/lib/LicenseByline/EmbedByline.d.ts +2 -4
- package/lib/LicenseByline/EmbedByline.js +145 -35
- package/lib/LicenseByline/LicenseLink.d.ts +2 -2
- package/lib/LicenseByline/LicenseLink.js +16 -9
- package/lib/LicenseByline/index.d.ts +2 -2
- package/lib/LicenseByline/index.js +4 -5
- package/lib/LinkBlock/LinkBlock.js +62 -34
- package/lib/LinkBlock/LinkBlockSection.js +9 -7
- package/lib/Logo/Logo.d.ts +1 -3
- package/lib/Logo/Logo.js +2 -30
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +4 -4
- package/lib/RelatedArticleList/RelatedArticleList.js +74 -90
- package/lib/ResourceBox/ResourceBox.js +64 -37
- package/lib/TagSelector/TagSelector.d.ts +27 -12
- package/lib/TagSelector/TagSelector.js +126 -131
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.js +20 -1
- package/lib/i18n/useComponentTranslations.d.ts +14 -0
- package/lib/i18n/useComponentTranslations.js +93 -0
- package/lib/index.d.ts +5 -15
- package/lib/index.js +70 -102
- package/lib/locale/messages-en.d.ts +26 -0
- package/lib/locale/messages-en.js +30 -4
- package/lib/locale/messages-nb.d.ts +26 -0
- package/lib/locale/messages-nb.js +30 -4
- package/lib/locale/messages-nn.d.ts +26 -0
- package/lib/locale/messages-nn.js +30 -4
- package/lib/locale/messages-se.d.ts +26 -0
- package/lib/locale/messages-se.js +30 -4
- package/lib/locale/messages-sma.d.ts +26 -0
- package/lib/locale/messages-sma.js +30 -4
- package/lib/model/ContentType.d.ts +3 -0
- package/lib/model/ContentType.js +4 -1
- package/lib/styles.css +597 -0
- package/package.json +11 -13
- package/src/Article/ArticleByline.tsx +1 -1
- package/src/Article/ArticleParagraph.tsx +11 -9
- package/src/AudioPlayer/AudioPlayer.tsx +1 -0
- package/src/CampaignBlock/CampaignBlock.tsx +92 -55
- package/src/Concept/Concept.stories.tsx +142 -0
- package/src/Concept/Concept.tsx +73 -0
- package/src/ContactBlock/ContactBlock.tsx +1 -1
- package/src/ContentTypeBadge/ContentTypeBadgeNew.stories.tsx +70 -0
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +69 -0
- package/src/Embed/AudioEmbed.tsx +2 -2
- package/src/Embed/BrightcoveEmbed.stories.tsx +0 -3
- package/src/Embed/BrightcoveEmbed.tsx +18 -20
- package/src/Embed/ConceptEmbed.stories.tsx +1 -105
- package/src/Embed/ConceptEmbed.tsx +60 -385
- package/src/Embed/ConceptListEmbed.tsx +20 -19
- package/src/Embed/ContentLinkEmbed.tsx +8 -10
- package/src/Embed/CopyrightEmbed.tsx +1 -11
- package/src/Embed/ExternalEmbed.tsx +14 -17
- package/src/Embed/FootnoteEmbed.stories.tsx +2 -5
- package/src/Embed/FootnoteEmbed.tsx +13 -16
- package/src/Embed/GlossEmbed.stories.tsx +140 -0
- package/src/Embed/GlossEmbed.tsx +64 -0
- package/src/Embed/H5pEmbed.tsx +22 -16
- package/src/Embed/IframeEmbed.tsx +12 -6
- package/src/Embed/InlineTriggerButton.tsx +72 -0
- package/src/Embed/UnknownEmbed.tsx +6 -7
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +4 -4
- package/src/Embed/UuDisclaimerEmbed.tsx +17 -25
- package/src/Embed/index.ts +2 -3
- package/src/ErrorMessage/ErrorMessage.tsx +40 -29
- package/src/ErrorMessage/ErrorResourceAccessDenied.tsx +8 -6
- package/src/FactBox/FactBox.tsx +115 -115
- package/src/FactBox/Factbox.stories.tsx +43 -27
- package/src/FileList/FileList.stories.tsx +6 -1
- package/src/FileList/PdfFile.tsx +22 -5
- package/src/Gloss/Gloss.stories.tsx +107 -1
- package/src/Gloss/Gloss.tsx +143 -156
- package/src/Gloss/GlossExample.tsx +51 -77
- package/src/LicenseByline/EmbedByline.stories.tsx +9 -4
- package/src/LicenseByline/EmbedByline.tsx +139 -53
- package/src/LicenseByline/LicenseLink.tsx +15 -15
- package/src/LicenseByline/index.tsx +2 -2
- package/src/LinkBlock/LinkBlock.stories.tsx +8 -10
- package/src/LinkBlock/LinkBlock.tsx +54 -59
- package/src/LinkBlock/LinkBlockSection.tsx +9 -12
- package/src/Logo/Logo.stories.tsx +0 -1
- package/src/Logo/Logo.tsx +2 -30
- package/src/RelatedArticleList/RelatedArticleList.tsx +69 -88
- package/src/ResourceBox/ResourceBox.tsx +63 -59
- package/src/TagSelector/TagSelector.stories.tsx +92 -68
- package/src/TagSelector/TagSelector.tsx +161 -126
- package/src/i18n/index.ts +5 -0
- package/src/i18n/useComponentTranslations.ts +72 -0
- package/src/index.ts +23 -19
- package/src/locale/messages-en.ts +28 -2
- package/src/locale/messages-nb.ts +28 -2
- package/src/locale/messages-nn.ts +28 -2
- package/src/locale/messages-se.ts +28 -2
- package/src/locale/messages-sma.ts +28 -2
- package/src/model/ContentType.ts +3 -0
- package/es/DefinitionList/DefinitionDescription.js +0 -28
- package/es/DefinitionList/DefinitionTerm.js +0 -28
- package/es/DefinitionList/index.js +0 -10
- package/es/Embed/conceptComponents.js +0 -155
- package/es/ExpandableBox/ExpandableBox.js +0 -29
- package/es/ExpandableBox/index.js +0 -9
- package/es/Figure/Figure.js +0 -73
- package/es/Figure/index.js +0 -9
- package/es/FramedContent/FramedContent.js +0 -28
- package/es/FramedContent/index.js +0 -10
- package/es/Image/Image.js +0 -99
- package/es/Image/ImageLink.js +0 -39
- package/es/Image/index.js +0 -12
- package/es/LetterFilter/LetterFilter.js +0 -54
- package/es/LetterFilter/alphabet.js +0 -9
- package/es/LetterFilter/index.js +0 -10
- package/es/LicenseByline/LicenseDescription.js +0 -63
- package/es/List/OrderedList.js +0 -41
- package/es/List/UnOrderedList.js +0 -28
- package/es/List/index.js +0 -10
- package/es/Notion/Notion.js +0 -76
- package/es/Notion/NotionImage.js +0 -46
- package/es/Notion/index.js +0 -9
- package/es/Table/Table.js +0 -141
- package/es/Table/index.js +0 -11
- package/es/TagSelector/Control.js +0 -28
- package/es/TagSelector/DropdownIndicator.js +0 -60
- package/es/TagSelector/Input.js +0 -22
- package/es/TagSelector/Menu.js +0 -27
- package/es/TagSelector/MenuList.js +0 -28
- package/es/TagSelector/Option.js +0 -60
- package/es/TagSelector/SelectContainer.js +0 -27
- package/es/TagSelector/ValueButton.js +0 -53
- package/es/TagSelector/ariaMessages.js +0 -94
- package/es/TagSelector/index.js +0 -10
- package/es/TagSelector/types.js +0 -1
- package/lib/DefinitionList/DefinitionDescription.d.ts +0 -10
- package/lib/DefinitionList/DefinitionDescription.js +0 -35
- package/lib/DefinitionList/DefinitionTerm.d.ts +0 -10
- package/lib/DefinitionList/DefinitionTerm.js +0 -35
- package/lib/DefinitionList/index.d.ts +0 -9
- package/lib/DefinitionList/index.js +0 -20
- package/lib/Embed/conceptComponents.d.ts +0 -40
- package/lib/Embed/conceptComponents.js +0 -163
- package/lib/ExpandableBox/ExpandableBox.d.ts +0 -15
- package/lib/ExpandableBox/ExpandableBox.js +0 -37
- package/lib/ExpandableBox/index.d.ts +0 -8
- package/lib/ExpandableBox/index.js +0 -18
- package/lib/Figure/Figure.d.ts +0 -16
- package/lib/Figure/Figure.js +0 -81
- package/lib/Figure/index.d.ts +0 -9
- package/lib/Figure/index.js +0 -13
- package/lib/FramedContent/FramedContent.d.ts +0 -12
- package/lib/FramedContent/FramedContent.js +0 -35
- package/lib/FramedContent/index.d.ts +0 -9
- package/lib/FramedContent/index.js +0 -16
- package/lib/Image/Image.d.ts +0 -38
- package/lib/Image/Image.js +0 -105
- package/lib/Image/ImageLink.d.ts +0 -18
- package/lib/Image/ImageLink.js +0 -44
- package/lib/Image/index.d.ts +0 -12
- package/lib/Image/index.js +0 -30
- package/lib/LetterFilter/LetterFilter.d.ts +0 -14
- package/lib/LetterFilter/LetterFilter.js +0 -61
- package/lib/LetterFilter/alphabet.d.ts +0 -8
- package/lib/LetterFilter/alphabet.js +0 -15
- package/lib/LetterFilter/index.d.ts +0 -9
- package/lib/LetterFilter/index.js +0 -16
- package/lib/LicenseByline/LicenseDescription.d.ts +0 -15
- package/lib/LicenseByline/LicenseDescription.js +0 -70
- package/lib/List/OrderedList.d.ts +0 -16
- package/lib/List/OrderedList.js +0 -48
- package/lib/List/UnOrderedList.d.ts +0 -10
- package/lib/List/UnOrderedList.js +0 -35
- package/lib/List/index.d.ts +0 -9
- package/lib/List/index.js +0 -20
- package/lib/Notion/Notion.d.ts +0 -20
- package/lib/Notion/Notion.js +0 -82
- package/lib/Notion/NotionImage.d.ts +0 -13
- package/lib/Notion/NotionImage.js +0 -54
- package/lib/Notion/index.d.ts +0 -8
- package/lib/Notion/index.js +0 -13
- package/lib/Table/Table.d.ts +0 -19
- package/lib/Table/Table.js +0 -145
- package/lib/Table/index.d.ts +0 -10
- package/lib/Table/index.js +0 -23
- package/lib/TagSelector/Control.d.ts +0 -11
- package/lib/TagSelector/Control.js +0 -35
- package/lib/TagSelector/DropdownIndicator.d.ts +0 -11
- package/lib/TagSelector/DropdownIndicator.js +0 -64
- package/lib/TagSelector/Input.d.ts +0 -12
- package/lib/TagSelector/Input.js +0 -29
- package/lib/TagSelector/Menu.d.ts +0 -12
- package/lib/TagSelector/Menu.js +0 -34
- package/lib/TagSelector/MenuList.d.ts +0 -16
- package/lib/TagSelector/MenuList.js +0 -35
- package/lib/TagSelector/Option.d.ts +0 -12
- package/lib/TagSelector/Option.js +0 -67
- package/lib/TagSelector/SelectContainer.d.ts +0 -11
- package/lib/TagSelector/SelectContainer.js +0 -34
- package/lib/TagSelector/ValueButton.d.ts +0 -20
- package/lib/TagSelector/ValueButton.js +0 -60
- package/lib/TagSelector/ariaMessages.d.ts +0 -16
- package/lib/TagSelector/ariaMessages.js +0 -101
- package/lib/TagSelector/index.d.ts +0 -11
- package/lib/TagSelector/index.js +0 -13
- package/lib/TagSelector/types.d.ts +0 -11
- package/lib/TagSelector/types.js +0 -5
- package/src/DefinitionList/DefinitionDescription.tsx +0 -26
- package/src/DefinitionList/DefinitionTerm.tsx +0 -26
- package/src/DefinitionList/index.tsx +0 -10
- package/src/Embed/conceptComponents.tsx +0 -293
- package/src/ExpandableBox/ExpandableBox.stories.tsx +0 -41
- package/src/ExpandableBox/ExpandableBox.tsx +0 -23
- package/src/ExpandableBox/index.ts +0 -9
- package/src/Figure/Figure.tsx +0 -167
- package/src/Figure/index.ts +0 -11
- package/src/FramedContent/FramedContent.stories.tsx +0 -152
- package/src/FramedContent/FramedContent.tsx +0 -26
- package/src/FramedContent/index.ts +0 -10
- package/src/Image/Image.stories.tsx +0 -61
- package/src/Image/Image.tsx +0 -147
- package/src/Image/ImageLink.tsx +0 -37
- package/src/Image/index.ts +0 -14
- package/src/LetterFilter/LetterFilter.stories.tsx +0 -29
- package/src/LetterFilter/LetterFilter.tsx +0 -78
- package/src/LetterFilter/alphabet.ts +0 -39
- package/src/LetterFilter/index.ts +0 -11
- package/src/LicenseByline/LicenseDescription.tsx +0 -100
- package/src/List/OrderedList.stories.tsx +0 -135
- package/src/List/OrderedList.tsx +0 -158
- package/src/List/UnOrderedList.tsx +0 -43
- package/src/List/UnorderedList.stories.tsx +0 -72
- package/src/List/index.ts +0 -10
- package/src/Notion/Notion.tsx +0 -96
- package/src/Notion/NotionImage.tsx +0 -64
- package/src/Notion/index.ts +0 -9
- package/src/Table/Table.stories.tsx +0 -738
- package/src/Table/Table.tsx +0 -284
- package/src/Table/index.ts +0 -12
- package/src/TagSelector/Control.tsx +0 -34
- package/src/TagSelector/DropdownIndicator.tsx +0 -55
- package/src/TagSelector/Input.tsx +0 -31
- package/src/TagSelector/Menu.tsx +0 -38
- package/src/TagSelector/MenuList.tsx +0 -30
- package/src/TagSelector/Option.tsx +0 -58
- package/src/TagSelector/SelectContainer.tsx +0 -31
- package/src/TagSelector/ValueButton.tsx +0 -47
- package/src/TagSelector/ariaMessages.ts +0 -96
- package/src/TagSelector/index.ts +0 -14
- package/src/TagSelector/types.ts +0 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2019-present, NDLA.
|
|
4
3
|
*
|
|
@@ -7,29 +6,49 @@ import _styled from "@emotion/styled/base";
|
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import {
|
|
9
|
+
import { Text } from "@ndla/primitives";
|
|
11
10
|
import { SafeLink } from "@ndla/safelink";
|
|
11
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
+
|
|
13
|
+
// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
13
|
-
const StyledErrorMessage =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
const StyledErrorMessage = styled("article", {
|
|
16
|
+
base: {
|
|
17
|
+
textAlign: "center",
|
|
18
|
+
"& a": {
|
|
19
|
+
color: "text.strong"
|
|
20
|
+
},
|
|
21
|
+
"& h1": {
|
|
22
|
+
marginTop: "0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const IllustrationWrapper = styled("div", {
|
|
27
|
+
base: {
|
|
28
|
+
marginBottom: "medium",
|
|
29
|
+
tablet: {
|
|
30
|
+
marginTop: "xxlarge"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const Description = styled(Text, {
|
|
35
|
+
base: {
|
|
36
|
+
marginBottom: "medium",
|
|
37
|
+
tablet: {
|
|
38
|
+
marginBottom: "xxlarge"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const CustomElementWrapper = styled("div", {
|
|
43
|
+
base: {
|
|
44
|
+
marginBlock: "xxlarge"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const MessageWrapper = styled("div", {
|
|
48
|
+
base: {
|
|
49
|
+
marginTop: "3xsmall"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
33
52
|
export const ErrorMessage = _ref => {
|
|
34
53
|
let {
|
|
35
54
|
children,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2021-present, NDLA.
|
|
4
3
|
*
|
|
@@ -9,14 +8,17 @@ import _styled from "@emotion/styled/base";
|
|
|
9
8
|
|
|
10
9
|
import { useTranslation } from "react-i18next";
|
|
11
10
|
import { ButtonV2 } from "@ndla/button";
|
|
12
|
-
import { spacing } from "@ndla/core";
|
|
13
11
|
import { HumanMaleBoard, LogIn } from "@ndla/icons/common";
|
|
12
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
14
13
|
import ErrorMessage from "./ErrorMessage";
|
|
14
|
+
|
|
15
|
+
// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
16
|
-
const StyledLogInIconWrapper =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
const StyledLogInIconWrapper = styled("span", {
|
|
18
|
+
base: {
|
|
19
|
+
marginLeft: "3xsmall"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
20
22
|
const ErrorResourceAccessDenied = _ref => {
|
|
21
23
|
let {
|
|
22
24
|
onAuthenticateClick
|
package/es/FactBox/FactBox.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
1
|
/**
|
|
4
2
|
* Copyright (c) 2016-present, NDLA.
|
|
5
3
|
*
|
|
@@ -8,40 +6,99 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
6
|
*
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
9
|
+
import { forwardRef, useCallback, useEffect, useId, useMemo, useState } from "react";
|
|
13
10
|
import { useTranslation } from "react-i18next";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { ChevronDown, ChevronUp } from "@ndla/icons/common";
|
|
11
|
+
import { ChevronDown } from "@ndla/icons/common";
|
|
12
|
+
import { IconButton } from "@ndla/primitives";
|
|
13
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
18
14
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
19
|
-
const StyledAside =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
const
|
|
15
|
+
const StyledAside = styled("aside", {
|
|
16
|
+
base: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
position: "relative",
|
|
21
|
+
padding: "medium",
|
|
22
|
+
transitionProperty: "max-height",
|
|
23
|
+
transitionDuration: "slow",
|
|
24
|
+
transitionTimingFunction: "ease-in-out",
|
|
25
|
+
border: "1px solid",
|
|
26
|
+
borderColor: "stroke.default",
|
|
27
|
+
borderRadius: "xsmall",
|
|
28
|
+
maxHeight: "surface.xxsmall",
|
|
29
|
+
_closed: {
|
|
30
|
+
_print: {
|
|
31
|
+
overflow: "visible",
|
|
32
|
+
maxHeight: "500vh"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
_open: {
|
|
36
|
+
maxHeight: "500vh"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const StyledContent = styled("div", {
|
|
41
|
+
base: {
|
|
42
|
+
position: "relative",
|
|
43
|
+
width: "100%",
|
|
44
|
+
overflow: "hidden",
|
|
45
|
+
// Reset the top margin of the very first child.
|
|
46
|
+
"& :first-child": {
|
|
47
|
+
marginBlockStart: "0"
|
|
48
|
+
},
|
|
49
|
+
_after: {
|
|
50
|
+
content: '""',
|
|
51
|
+
textAlign: "center",
|
|
52
|
+
position: "absolute",
|
|
53
|
+
inset: "0",
|
|
54
|
+
transitionProperty: "opacity",
|
|
55
|
+
transitionDuration: "slow",
|
|
56
|
+
transitionTimingFunction: "ease-out",
|
|
57
|
+
// TODO: Consider improving this gradient. It's a little light up top.
|
|
58
|
+
gradientFrom: "surface.default/00",
|
|
59
|
+
gradientTo: "surface.default",
|
|
60
|
+
backgroundGradient: "to-b",
|
|
61
|
+
opacity: "1",
|
|
62
|
+
zIndex: "base"
|
|
63
|
+
},
|
|
64
|
+
_print: {
|
|
65
|
+
overflow: "visible",
|
|
66
|
+
_after: {
|
|
67
|
+
display: "none"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
_open: {
|
|
71
|
+
paddingBlockEnd: "xsmall",
|
|
72
|
+
_after: {
|
|
73
|
+
opacity: "0",
|
|
74
|
+
zIndex: "hide"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const StyledIconButton = styled(IconButton, {
|
|
80
|
+
base: {
|
|
81
|
+
position: "absolute",
|
|
82
|
+
bottom: "-medium",
|
|
83
|
+
zIndex: "base",
|
|
84
|
+
"& svg": {
|
|
85
|
+
transitionProperty: "transform",
|
|
86
|
+
transitionTimingFunction: "ease-in-out",
|
|
87
|
+
transitionDuration: "fast"
|
|
88
|
+
},
|
|
89
|
+
_open: {
|
|
90
|
+
"& svg": {
|
|
91
|
+
transform: "rotate(180deg)"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
_print: {
|
|
95
|
+
display: "none"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// TODO: Consider moving the open trigger depending on whether the content is open or closed.
|
|
101
|
+
|
|
45
102
|
const FactBox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
46
103
|
let {
|
|
47
104
|
children,
|
|
@@ -53,28 +110,42 @@ const FactBox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
53
110
|
const {
|
|
54
111
|
t
|
|
55
112
|
} = useTranslation();
|
|
56
|
-
const [
|
|
113
|
+
const [state, setState] = useState(defaultOpen ? "open" : "closed");
|
|
114
|
+
const contentId = useId();
|
|
115
|
+
// Inert has existed since early 2023. It allows us to disable tabindex inside the content if it is closed, allowing us to be accessible for users with newish browsers. React 18 removes this because it doesn't recognize the attribute. This is a workaround for that.
|
|
116
|
+
// TODO: Remove this hack when we upgrade to React 19.
|
|
117
|
+
const inertAttribute = useMemo(() => {
|
|
118
|
+
return state === "closed" ? {
|
|
119
|
+
inert: ""
|
|
120
|
+
} : {};
|
|
121
|
+
}, [state]);
|
|
57
122
|
useEffect(() => {
|
|
58
123
|
if (open !== undefined) {
|
|
59
|
-
|
|
124
|
+
setState(open ? "open" : "closed");
|
|
60
125
|
}
|
|
61
126
|
}, [open]);
|
|
62
127
|
const onClick = useCallback(() => {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
onOpenChange?.(
|
|
66
|
-
}, [
|
|
128
|
+
const newState = state === "open" ? "closed" : "open";
|
|
129
|
+
setState(newState);
|
|
130
|
+
onOpenChange?.(newState === "open");
|
|
131
|
+
}, [state, onOpenChange]);
|
|
67
132
|
return _jsxs(StyledAside, {
|
|
133
|
+
"data-state": state,
|
|
68
134
|
...rest,
|
|
69
|
-
css: [isOpen ? expandedStyle : undefined, ";label:FactBox;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZhY3RCb3gudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQThJNkIiLCJmaWxlIjoiRmFjdEJveC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbi8qKiBAanN4SW1wb3J0U291cmNlIEBlbW90aW9uL3JlYWN0ICovXG5pbXBvcnQgeyBDb21wb25lbnRQcm9wcywgUmVhY3ROb2RlLCBmb3J3YXJkUmVmLCB1c2VDYWxsYmFjaywgdXNlRWZmZWN0LCB1c2VTdGF0ZSB9IGZyb20g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ZGVmaW5lZF19IHJlZj17cmVmfT5cbiAgICAgICAgPFN0eWxlZERpdiBjc3M9e2lzT3BlbiA/IGV4cGFuZGVkQ29udGVudFN0eWxlIDogdW5kZWZpbmVkfT57Y2hpbGRyZW59PC9TdHlsZWREaXY+XG4gICAgICAgIDxTdHlsZWRJY29uQnV0dG9uIG9uQ2xpY2s9e29uQ2xpY2t9IGFyaWEtbGFiZWw9e3QoYGZhY3Rib3guJHtpc09wZW4gPyBcImNsb3NlXCIgOiBcIm9wZW5cIn1gKX0+XG4gICAgICAgICAge2lzT3BlbiA/IDxDaGV2cm9uVXAgLz4gOiA8Q2hldnJvbkRvd24gLz59XG4gICAgICAgIDwvU3R5bGVkSWNvbkJ1dHRvbj5cbiAgICAgIDwvU3R5bGVkQXNpZGU+XG4gICAgKTtcbiAgfSxcbik7XG5cbmV4cG9ydCBkZWZhdWx0IEZhY3RCb3g7XG4iXX0= */")],
|
|
70
135
|
ref: ref,
|
|
71
|
-
children: [_jsx(
|
|
72
|
-
|
|
73
|
-
children: children
|
|
74
|
-
}), _jsx(StyledIconButton, {
|
|
136
|
+
children: [_jsx(StyledIconButton, {
|
|
137
|
+
"data-state": state,
|
|
75
138
|
onClick: onClick,
|
|
76
|
-
"aria-
|
|
77
|
-
|
|
139
|
+
"aria-expanded": state === "open",
|
|
140
|
+
"aria-controls": contentId,
|
|
141
|
+
"aria-label": t(`factbox.${state === "open" ? "close" : "open"}`),
|
|
142
|
+
children: _jsx(ChevronDown, {})
|
|
143
|
+
}), _jsx(StyledContent, {
|
|
144
|
+
id: contentId,
|
|
145
|
+
"data-state": state,
|
|
146
|
+
"aria-hidden": state === "closed",
|
|
147
|
+
...inertAttribute,
|
|
148
|
+
children: children
|
|
78
149
|
})]
|
|
79
150
|
});
|
|
80
151
|
});
|
package/es/FileList/PdfFile.js
CHANGED
|
@@ -6,17 +6,35 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Figure } from "
|
|
9
|
+
import { Heading, Figure } from "@ndla/primitives";
|
|
10
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
12
|
+
const StyledIframe = styled("iframe", {
|
|
13
|
+
base: {
|
|
14
|
+
width: "100%"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const StyledFigure = styled(Figure, {
|
|
18
|
+
base: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
gap: "xsmall"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
11
24
|
const PdfFile = _ref => {
|
|
12
25
|
let {
|
|
13
26
|
title,
|
|
14
27
|
url
|
|
15
28
|
} = _ref;
|
|
16
|
-
return _jsxs(
|
|
17
|
-
children: [_jsx(
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
return _jsxs(StyledFigure, {
|
|
30
|
+
children: [_jsx(Heading, {
|
|
31
|
+
asChild: true,
|
|
32
|
+
consumeCss: true,
|
|
33
|
+
textStyle: "title.medium",
|
|
34
|
+
children: _jsx("h4", {
|
|
35
|
+
children: title
|
|
36
|
+
})
|
|
37
|
+
}), _jsx(StyledIframe, {
|
|
20
38
|
title: title,
|
|
21
39
|
height: "1050",
|
|
22
40
|
src: url
|