@ndla/ui 56.0.140-alpha.0 → 56.0.142-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.
@@ -244,13 +244,6 @@
244
244
  "transitionTimingFunction]___[value:ease-out]___[cond:& svg",
245
245
  "alignSelf]___[value:flex-end",
246
246
  "fill]___[value:icon.subtle",
247
- "color]___[value:text.strong]___[cond:& a",
248
- "marginTop]___[value:0]___[cond:& h1",
249
- "marginBottom]___[value:medium",
250
- "marginTop]___[value:xxlarge]___[cond:tablet",
251
- "marginBottom]___[value:xxlarge]___[cond:tablet",
252
- "marginBlock]___[value:xxlarge",
253
- "marginTop]___[value:3xsmall",
254
247
  "gridTemplateRows]___[value:0fr",
255
248
  "transitionProperty]___[value:grid-template-rows",
256
249
  "transitionDuration]___[value:slow",
package/dist/styles.css CHANGED
@@ -300,10 +300,6 @@
300
300
  border-radius: var(--radii-large);
301
301
  }
302
302
 
303
- .my_xxlarge {
304
- margin-block: var(--spacing-xxlarge);
305
- }
306
-
307
303
  .py_small {
308
304
  padding-block: var(--spacing-small);
309
305
  }
@@ -763,14 +759,6 @@
763
759
  height: var(--sizes-medium);
764
760
  }
765
761
 
766
- .mb_medium {
767
- margin-bottom: var(--spacing-medium);
768
- }
769
-
770
- .mt_3xsmall {
771
- margin-top: var(--spacing-3xsmall);
772
- }
773
-
774
762
  .bottom_-medium {
775
763
  bottom: calc(var(--spacing-medium) * -1);
776
764
  }
@@ -930,10 +918,6 @@
930
918
  transition-timing-function: ease-out;
931
919
  }
932
920
 
933
- .\[\&_a\]\:c_text\.strong a {
934
- color: var(--colors-text-strong);
935
- }
936
-
937
921
  .open\:grid-tr_1fr:is([open], [data-open], [data-state="open"], :popover-open) {
938
922
  grid-template-rows: 1fr;
939
923
  }
@@ -1082,10 +1066,6 @@
1082
1066
  width: 100%;
1083
1067
  }
1084
1068
 
1085
- .\[\&_h1\]\:mt_0 h1 {
1086
- margin-top: 0;
1087
- }
1088
-
1089
1069
  .\[\&_\>_div\]\:min-h_surface\.3xsmall > div {
1090
1070
  min-height: var(--sizes-surface-3xsmall);
1091
1071
  }
@@ -1294,12 +1274,6 @@
1294
1274
  display: -webkit-box;
1295
1275
  -webkit-line-clamp: 4;
1296
1276
  -webkit-box-orient: vertical;
1297
- }
1298
- .tablet\:mt_xxlarge {
1299
- margin-top: var(--spacing-xxlarge);
1300
- }
1301
- .tablet\:mb_xxlarge {
1302
- margin-bottom: var(--spacing-xxlarge);
1303
1277
  }
1304
1278
  .\[\&\[data-has-image\=\'true\'\]\]\:tablet\:py_xsmall[data-has-image='true'] {
1305
1279
  padding-block: var(--spacing-xsmall);
@@ -1,5 +1,5 @@
1
1
  import { useRef } from "react";
2
- import { IconButton, TooltipContent, TooltipRoot, TooltipTrigger } from "@ndla/primitives";
2
+ import { IconButton } from "@ndla/primitives";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { VolumeUpFill } from "@ndla/icons";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -22,15 +22,13 @@ const SpeechControl = ({ src, title, type = "audio" }) => {
22
22
  src,
23
23
  title,
24
24
  preload: "metadata"
25
- }), /* @__PURE__ */ jsxs(TooltipRoot, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
26
- asChild: true,
27
- children: /* @__PURE__ */ jsx(IconButton, {
28
- variant: "tertiary",
29
- "aria-label": t(`${type}.play`),
30
- onClick: togglePlay,
31
- children: /* @__PURE__ */ jsx(VolumeUpFill, {})
32
- })
33
- }), /* @__PURE__ */ jsx(TooltipContent, { children: t(`${type}.play`) })] })]
25
+ }), /* @__PURE__ */ jsx(IconButton, {
26
+ variant: "tertiary",
27
+ "aria-label": t(`${type}.play`),
28
+ title: t(`${type}.play`),
29
+ onClick: togglePlay,
30
+ children: /* @__PURE__ */ jsx(VolumeUpFill, {})
31
+ })]
34
32
  });
35
33
  };
36
34
  var SpeechControl_default = SpeechControl;
@@ -1 +1 @@
1
- {"version":3,"file":"SpeechControl.mjs","names":[],"sources":["../../src/AudioPlayer/SpeechControl.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { VolumeUpFill } from \"@ndla/icons\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, IconButton } from \"@ndla/primitives\";\n\ntype Props = {\n src: string;\n title: string;\n type?: \"gloss\" | \"audio\";\n};\n\nconst SpeechControl = ({ src, title, type = \"audio\" }: Props) => {\n const { t } = useTranslation();\n const audioRef = useRef<HTMLAudioElement>(null);\n\n const togglePlay = () => {\n if (audioRef.current) {\n const audioElement = audioRef.current;\n if (audioElement.paused) {\n audioElement.play();\n } else {\n audioElement.pause();\n }\n }\n };\n return (\n <div data-embed-type=\"speech\">\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n <audio ref={audioRef} src={src} title={title} preload=\"metadata\" />\n <TooltipRoot>\n <TooltipTrigger asChild>\n <IconButton variant=\"tertiary\" aria-label={t(`${type}.play`)} onClick={togglePlay}>\n <VolumeUpFill />\n </IconButton>\n </TooltipTrigger>\n <TooltipContent>{t(`${type}.play`)}</TooltipContent>\n </TooltipRoot>\n </div>\n );\n};\n\nexport default SpeechControl;\n"],"mappings":";;;;;;;AAmBA,MAAM,gBAAgB,CAAC,EAAE,KAAK,OAAO,OAAO,SAAgB,KAAK;CAC/D,MAAM,EAAE,GAAG,GAAG,gBAAgB;CAC9B,MAAM,WAAW,OAAyB,KAAK;CAE/C,MAAM,aAAa,MAAM;AACvB,MAAI,SAAS,SAAS;GACpB,MAAM,eAAe,SAAS;AAC9B,OAAI,aAAa,OACf,cAAa,MAAM;OAEnB,cAAa,OAAO;EAEvB;CACF;AACD,wBACE,KAAC;EAAI,mBAAgB;6BAEnB,IAAC;GAAM,KAAK;GAAe;GAAY;GAAO,SAAQ;IAAa,kBACnE,KAAC,0CACC,IAAC;GAAe;6BACd,IAAC;IAAW,SAAQ;IAAW,cAAY,GAAG,EAAE,KAAK,OAAO;IAAE,SAAS;8BACrE,IAAC,iBAAe;KACL;IACE,kBACjB,IAAC,4BAAgB,GAAG,EAAE,KAAK,OAAO,GAAkB,IACxC;GACV;AAET;AAED,4BAAe"}
1
+ {"version":3,"file":"SpeechControl.mjs","names":[],"sources":["../../src/AudioPlayer/SpeechControl.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { VolumeUpFill } from \"@ndla/icons\";\nimport { IconButton } from \"@ndla/primitives\";\n\ntype Props = {\n src: string;\n title: string;\n type?: \"gloss\" | \"audio\";\n};\n\nconst SpeechControl = ({ src, title, type = \"audio\" }: Props) => {\n const { t } = useTranslation();\n const audioRef = useRef<HTMLAudioElement>(null);\n\n const togglePlay = () => {\n if (audioRef.current) {\n const audioElement = audioRef.current;\n if (audioElement.paused) {\n audioElement.play();\n } else {\n audioElement.pause();\n }\n }\n };\n return (\n <div data-embed-type=\"speech\">\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n <audio ref={audioRef} src={src} title={title} preload=\"metadata\" />\n <IconButton variant=\"tertiary\" aria-label={t(`${type}.play`)} title={t(`${type}.play`)} onClick={togglePlay}>\n <VolumeUpFill />\n </IconButton>\n </div>\n );\n};\n\nexport default SpeechControl;\n"],"mappings":";;;;;;;AAmBA,MAAM,gBAAgB,CAAC,EAAE,KAAK,OAAO,OAAO,SAAgB,KAAK;CAC/D,MAAM,EAAE,GAAG,GAAG,gBAAgB;CAC9B,MAAM,WAAW,OAAyB,KAAK;CAE/C,MAAM,aAAa,MAAM;AACvB,MAAI,SAAS,SAAS;GACpB,MAAM,eAAe,SAAS;AAC9B,OAAI,aAAa,OACf,cAAa,MAAM;OAEnB,cAAa,OAAO;EAEvB;CACF;AACD,wBACE,KAAC;EAAI,mBAAgB;6BAEnB,IAAC;GAAM,KAAK;GAAe;GAAY;GAAO,SAAQ;IAAa,kBACnE,IAAC;GAAW,SAAQ;GAAW,cAAY,GAAG,EAAE,KAAK,OAAO;GAAE,OAAO,GAAG,EAAE,KAAK,OAAO;GAAE,SAAS;6BAC/F,IAAC,iBAAe;IACL;GACT;AAET;AAED,4BAAe"}
package/es/index.mjs CHANGED
@@ -32,7 +32,6 @@ import { ArticleByline, ArticleBylineAccordionItem } from "./Article/ArticleByli
32
32
  import { Article, ArticleContent, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper } from "./Article/Article.mjs";
33
33
  import { getPossiblyRelativeUrl } from "./utils/relativeUrl.mjs";
34
34
  import { RelatedArticleList_default } from "./RelatedArticleList/index.mjs";
35
- import { ErrorMessage_default } from "./ErrorMessage/index.mjs";
36
35
  import { FileListEmbed, FileListItem, FileListWrapper } from "./FileList/FileList.mjs";
37
36
  import { File, FileListElement } from "./FileList/File.mjs";
38
37
  import { PdfFile } from "./FileList/PdfFile.mjs";
@@ -61,4 +60,4 @@ import { LinkBlock_default } from "./LinkBlock/LinkBlock.mjs";
61
60
  import { LinkBlockSection_default } from "./LinkBlock/LinkBlockSection.mjs";
62
61
  import { ZendeskButton } from "./ZendeskButton/ZendeskButton.mjs";
63
62
 
64
- export { Article, ArticleByline, ArticleBylineAccordionItem, ArticleContent, ArticleFootNotes, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper, AudioEmbed_default as AudioEmbed, AudioPlayer_default as AudioPlayer, BlockConcept, Breadcrumb_default as Breadcrumb, BrightcoveEmbed_default as BrightcoveEmbed, CampaignBlock_default as CampaignBlock, CodeBlock_default as CodeBlock, CodeEmbed_default as CodeEmbed, Concept, ConceptEmbed, ConceptInlineTriggerButton, ContactBlock, ContentLinkEmbed_default as ContentLinkEmbed, ContentTypeBadge, ContentTypeBlockQuote, ContentTypeFramedContent, ContentTypeHero, CopyParagraphButton_default as CopyParagraphButton, CopyrightEmbed_default as CopyrightEmbed, EmbedByline, EmbedWrapper, ErrorMessage_default as ErrorMessage, ExternalEmbed_default as ExternalEmbed, FactBox_default as FactBox, File, FileListElement, FileListEmbed, FileListItem, FileListWrapper, FootnoteEmbed_default as FootnoteEmbed, Gloss_default as Gloss, GlossExample_default as GlossExample, Grid, GridParallaxItem, H5pEmbed_default as H5pEmbed, HomeBreadcrumb_default as HomeBreadcrumb, IframeEmbed_default as IframeEmbed, ImageEmbed_default as ImageEmbed, InlineConcept, InlineTriggerButton, KeyFigure_default as KeyFigure, LicenseLink, LinkBlock_default as LinkBlock, LinkBlockSection_default as LinkBlockSection, PdfFile, Pitch, RelatedArticle, RelatedArticleList_default as RelatedArticleList, RelatedContentEmbed_default as RelatedContentEmbed, ResourceBox_default as ResourceBox, TagSelectorClearTrigger, TagSelectorControl, TagSelectorInput, TagSelectorInputBase, TagSelectorItemInput, TagSelectorLabel, TagSelectorRoot, TagSelectorTrigger, UnknownEmbed_default as UnknownEmbed, UuDisclaimerEmbed_default as UuDisclaimerEmbed, ZendeskButton, codeLanguageOptions, model_default as constants, contactBlockBackgrounds, contentTypeToBadgeVariantMap, formatNestedMessages, getCrop, getFocalPoint, getPossiblyRelativeUrl, licenseAttributes, messages_en_default as messagesEN, messages_nb_default as messagesNB, messages_nn_default as messagesNN, messages_se_default as messagesSE, useAudioSearchTranslations, useComboboxTranslations, useDatePickerTranslations, useImageSearchTranslations, usePaginationTranslations, useTagSelectorTranslations, useTagsInputTranslations, useVideoSearchTranslations };
63
+ export { Article, ArticleByline, ArticleBylineAccordionItem, ArticleContent, ArticleFootNotes, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper, AudioEmbed_default as AudioEmbed, AudioPlayer_default as AudioPlayer, BlockConcept, Breadcrumb_default as Breadcrumb, BrightcoveEmbed_default as BrightcoveEmbed, CampaignBlock_default as CampaignBlock, CodeBlock_default as CodeBlock, CodeEmbed_default as CodeEmbed, Concept, ConceptEmbed, ConceptInlineTriggerButton, ContactBlock, ContentLinkEmbed_default as ContentLinkEmbed, ContentTypeBadge, ContentTypeBlockQuote, ContentTypeFramedContent, ContentTypeHero, CopyParagraphButton_default as CopyParagraphButton, CopyrightEmbed_default as CopyrightEmbed, EmbedByline, EmbedWrapper, ExternalEmbed_default as ExternalEmbed, FactBox_default as FactBox, File, FileListElement, FileListEmbed, FileListItem, FileListWrapper, FootnoteEmbed_default as FootnoteEmbed, Gloss_default as Gloss, GlossExample_default as GlossExample, Grid, GridParallaxItem, H5pEmbed_default as H5pEmbed, HomeBreadcrumb_default as HomeBreadcrumb, IframeEmbed_default as IframeEmbed, ImageEmbed_default as ImageEmbed, InlineConcept, InlineTriggerButton, KeyFigure_default as KeyFigure, LicenseLink, LinkBlock_default as LinkBlock, LinkBlockSection_default as LinkBlockSection, PdfFile, Pitch, RelatedArticle, RelatedArticleList_default as RelatedArticleList, RelatedContentEmbed_default as RelatedContentEmbed, ResourceBox_default as ResourceBox, TagSelectorClearTrigger, TagSelectorControl, TagSelectorInput, TagSelectorInputBase, TagSelectorItemInput, TagSelectorLabel, TagSelectorRoot, TagSelectorTrigger, UnknownEmbed_default as UnknownEmbed, UuDisclaimerEmbed_default as UuDisclaimerEmbed, ZendeskButton, codeLanguageOptions, model_default as constants, contactBlockBackgrounds, contentTypeToBadgeVariantMap, formatNestedMessages, getCrop, getFocalPoint, getPossiblyRelativeUrl, licenseAttributes, messages_en_default as messagesEN, messages_nb_default as messagesNB, messages_nn_default as messagesNN, messages_se_default as messagesSE, useAudioSearchTranslations, useComboboxTranslations, useDatePickerTranslations, useImageSearchTranslations, usePaginationTranslations, useTagSelectorTranslations, useTagsInputTranslations, useVideoSearchTranslations };
@@ -23,15 +23,13 @@ const SpeechControl = ({ src, title, type = "audio" }) => {
23
23
  src,
24
24
  title,
25
25
  preload: "metadata"
26
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ndla_primitives.TooltipRoot, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.TooltipTrigger, {
27
- asChild: true,
28
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.IconButton, {
29
- variant: "tertiary",
30
- "aria-label": t(`${type}.play`),
31
- onClick: togglePlay,
32
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_icons.VolumeUpFill, {})
33
- })
34
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.TooltipContent, { children: t(`${type}.play`) })] })]
26
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.IconButton, {
27
+ variant: "tertiary",
28
+ "aria-label": t(`${type}.play`),
29
+ title: t(`${type}.play`),
30
+ onClick: togglePlay,
31
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_icons.VolumeUpFill, {})
32
+ })]
35
33
  });
36
34
  };
37
35
  var SpeechControl_default = SpeechControl;
@@ -1 +1 @@
1
- {"version":3,"file":"SpeechControl.js","names":["TooltipRoot","TooltipTrigger","IconButton","VolumeUpFill","TooltipContent"],"sources":["../../src/AudioPlayer/SpeechControl.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { VolumeUpFill } from \"@ndla/icons\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, IconButton } from \"@ndla/primitives\";\n\ntype Props = {\n src: string;\n title: string;\n type?: \"gloss\" | \"audio\";\n};\n\nconst SpeechControl = ({ src, title, type = \"audio\" }: Props) => {\n const { t } = useTranslation();\n const audioRef = useRef<HTMLAudioElement>(null);\n\n const togglePlay = () => {\n if (audioRef.current) {\n const audioElement = audioRef.current;\n if (audioElement.paused) {\n audioElement.play();\n } else {\n audioElement.pause();\n }\n }\n };\n return (\n <div data-embed-type=\"speech\">\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n <audio ref={audioRef} src={src} title={title} preload=\"metadata\" />\n <TooltipRoot>\n <TooltipTrigger asChild>\n <IconButton variant=\"tertiary\" aria-label={t(`${type}.play`)} onClick={togglePlay}>\n <VolumeUpFill />\n </IconButton>\n </TooltipTrigger>\n <TooltipContent>{t(`${type}.play`)}</TooltipContent>\n </TooltipRoot>\n </div>\n );\n};\n\nexport default SpeechControl;\n"],"mappings":";;;;;;;;AAmBA,MAAM,gBAAgB,CAAC,EAAE,KAAK,OAAO,OAAO,SAAgB,KAAK;CAC/D,MAAM,EAAE,GAAG,GAAG,mCAAgB;CAC9B,MAAM,WAAW,kBAAyB,KAAK;CAE/C,MAAM,aAAa,MAAM;AACvB,MAAI,SAAS,SAAS;GACpB,MAAM,eAAe,SAAS;AAC9B,OAAI,aAAa,OACf,cAAa,MAAM;OAEnB,cAAa,OAAO;EAEvB;CACF;AACD,wBACE,4BAAC;EAAI,mBAAgB;6BAEnB,2BAAC;GAAM,KAAK;GAAe;GAAY;GAAO,SAAQ;IAAa,kBACnE,4BAACA,4DACC,2BAACC;GAAe;6BACd,2BAACC;IAAW,SAAQ;IAAW,cAAY,GAAG,EAAE,KAAK,OAAO;IAAE,SAAS;8BACrE,2BAACC,8BAAe;KACL;IACE,kBACjB,2BAACC,8CAAgB,GAAG,EAAE,KAAK,OAAO,GAAkB,IACxC;GACV;AAET;AAED,4BAAe"}
1
+ {"version":3,"file":"SpeechControl.js","names":["IconButton","VolumeUpFill"],"sources":["../../src/AudioPlayer/SpeechControl.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { VolumeUpFill } from \"@ndla/icons\";\nimport { IconButton } from \"@ndla/primitives\";\n\ntype Props = {\n src: string;\n title: string;\n type?: \"gloss\" | \"audio\";\n};\n\nconst SpeechControl = ({ src, title, type = \"audio\" }: Props) => {\n const { t } = useTranslation();\n const audioRef = useRef<HTMLAudioElement>(null);\n\n const togglePlay = () => {\n if (audioRef.current) {\n const audioElement = audioRef.current;\n if (audioElement.paused) {\n audioElement.play();\n } else {\n audioElement.pause();\n }\n }\n };\n return (\n <div data-embed-type=\"speech\">\n {/* eslint-disable-next-line jsx-a11y/media-has-caption */}\n <audio ref={audioRef} src={src} title={title} preload=\"metadata\" />\n <IconButton variant=\"tertiary\" aria-label={t(`${type}.play`)} title={t(`${type}.play`)} onClick={togglePlay}>\n <VolumeUpFill />\n </IconButton>\n </div>\n );\n};\n\nexport default SpeechControl;\n"],"mappings":";;;;;;;;AAmBA,MAAM,gBAAgB,CAAC,EAAE,KAAK,OAAO,OAAO,SAAgB,KAAK;CAC/D,MAAM,EAAE,GAAG,GAAG,mCAAgB;CAC9B,MAAM,WAAW,kBAAyB,KAAK;CAE/C,MAAM,aAAa,MAAM;AACvB,MAAI,SAAS,SAAS;GACpB,MAAM,eAAe,SAAS;AAC9B,OAAI,aAAa,OACf,cAAa,MAAM;OAEnB,cAAa,OAAO;EAEvB;CACF;AACD,wBACE,4BAAC;EAAI,mBAAgB;6BAEnB,2BAAC;GAAM,KAAK;GAAe;GAAY;GAAO,SAAQ;IAAa,kBACnE,2BAACA;GAAW,SAAQ;GAAW,cAAY,GAAG,EAAE,KAAK,OAAO;GAAE,OAAO,GAAG,EAAE,KAAK,OAAO;GAAE,SAAS;6BAC/F,2BAACC,8BAAe;IACL;GACT;AAET;AAED,4BAAe"}
package/lib/index.d.ts CHANGED
@@ -12,7 +12,6 @@ export { LicenseLink, EmbedByline } from "./LicenseByline";
12
12
  export { ArticleByline, ArticleBylineAccordionItem, ArticleFootNotes, ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle, } from "./Article";
13
13
  export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
14
14
  export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
15
- export { default as ErrorMessage } from "./ErrorMessage";
16
15
  export { FileListEmbed, File, PdfFile, FileListItem, FileListElement, FileListWrapper } from "./FileList";
17
16
  export { default as FactBox } from "./FactBox";
18
17
  export type { ContentTypeHeroProps } from "./ContentTypeHero";
package/lib/index.js CHANGED
@@ -32,7 +32,6 @@ const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Articl
32
32
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Article_Article = require('./Article/Article.js');
33
33
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_utils_relativeUrl = require('./utils/relativeUrl.js');
34
34
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_RelatedArticleList_index = require('./RelatedArticleList/index.js');
35
- const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_ErrorMessage_index = require('./ErrorMessage/index.js');
36
35
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_FileList_FileList = require('./FileList/FileList.js');
37
36
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_FileList_File = require('./FileList/File.js');
38
37
  const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_FileList_PdfFile = require('./FileList/PdfFile.js');
@@ -92,7 +91,6 @@ exports.CopyParagraphButton = require__Users_jec_code_ndla_frontend_packages_pac
92
91
  exports.CopyrightEmbed = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Embed_CopyrightEmbed.CopyrightEmbed_default;
93
92
  exports.EmbedByline = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_LicenseByline_EmbedByline.EmbedByline;
94
93
  exports.EmbedWrapper = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Embed_EmbedWrapper.EmbedWrapper;
95
- exports.ErrorMessage = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_ErrorMessage_index.ErrorMessage_default;
96
94
  exports.ExternalEmbed = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Embed_ExternalEmbed.ExternalEmbed_default;
97
95
  exports.FactBox = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_FactBox_index.FactBox_default;
98
96
  exports.File = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_FileList_File.File;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
3
  "type": "module",
4
- "version": "56.0.140-alpha.0",
4
+ "version": "56.0.142-alpha.0",
5
5
  "description": "UI component library for NDLA",
6
6
  "license": "GPL-3.0",
7
7
  "exports": {
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@ark-ui/react": "^5.25.0",
40
40
  "@ndla/core": "^6.0.3-alpha.0",
41
- "@ndla/icons": "^8.0.66-alpha.0",
41
+ "@ndla/icons": "^8.0.67-alpha.0",
42
42
  "@ndla/licenses": "^10.0.0-alpha.0",
43
43
  "@ndla/primitives": "^1.0.99-alpha.0",
44
44
  "@ndla/safelink": "^7.0.102-alpha.0",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "1c974c9234fe76368bdb7c418a67de46dd159fdb"
65
+ "gitHead": "6fde2ca9ba17fc522610391805f05984bbe630f6"
66
66
  }
@@ -9,7 +9,7 @@
9
9
  import { useRef } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import { VolumeUpFill } from "@ndla/icons";
12
- import { TooltipRoot, TooltipTrigger, TooltipContent, IconButton } from "@ndla/primitives";
12
+ import { IconButton } from "@ndla/primitives";
13
13
 
14
14
  type Props = {
15
15
  src: string;
@@ -35,14 +35,9 @@ const SpeechControl = ({ src, title, type = "audio" }: Props) => {
35
35
  <div data-embed-type="speech">
36
36
  {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
37
37
  <audio ref={audioRef} src={src} title={title} preload="metadata" />
38
- <TooltipRoot>
39
- <TooltipTrigger asChild>
40
- <IconButton variant="tertiary" aria-label={t(`${type}.play`)} onClick={togglePlay}>
41
- <VolumeUpFill />
42
- </IconButton>
43
- </TooltipTrigger>
44
- <TooltipContent>{t(`${type}.play`)}</TooltipContent>
45
- </TooltipRoot>
38
+ <IconButton variant="tertiary" aria-label={t(`${type}.play`)} title={t(`${type}.play`)} onClick={togglePlay}>
39
+ <VolumeUpFill />
40
+ </IconButton>
46
41
  </div>
47
42
  );
48
43
  };
package/src/index.ts CHANGED
@@ -56,8 +56,6 @@ export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
56
56
 
57
57
  export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
58
58
 
59
- export { default as ErrorMessage } from "./ErrorMessage";
60
-
61
59
  export { FileListEmbed, File, PdfFile, FileListItem, FileListElement, FileListWrapper } from "./FileList";
62
60
 
63
61
  export { default as FactBox } from "./FactBox";
@@ -1,54 +0,0 @@
1
- import "react";
2
- import { Text } from "@ndla/primitives";
3
- import { styled } from "@ndla/styled-system/jsx";
4
- import { SafeLink } from "@ndla/safelink";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
-
7
- //#region src/ErrorMessage/ErrorMessage.tsx
8
- const StyledErrorMessage = styled("article", { base: {
9
- textAlign: "center",
10
- "& a": { color: "text.strong" },
11
- "& h1": { marginTop: "0" }
12
- } });
13
- const IllustrationWrapper = styled("div", { base: {
14
- display: "flex",
15
- justifyContent: "center",
16
- marginBottom: "medium",
17
- tablet: { marginTop: "xxlarge" }
18
- } });
19
- const Description = styled(Text, { base: {
20
- marginBottom: "medium",
21
- tablet: { marginBottom: "xxlarge" }
22
- } });
23
- const CustomElementWrapper = styled("div", { base: { marginBlock: "xxlarge" } });
24
- const MessageWrapper = styled("div", { base: { marginTop: "3xsmall" } });
25
- const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }) => /* @__PURE__ */ jsxs(StyledErrorMessage, { children: [
26
- !!illustration && /* @__PURE__ */ jsx(IllustrationWrapper, { children: /* @__PURE__ */ jsx("img", {
27
- src: illustration.url,
28
- alt: illustration.altText
29
- }) }),
30
- !!illustrationElement && /* @__PURE__ */ jsx(IllustrationWrapper, { children: illustrationElement }),
31
- /* @__PURE__ */ jsx("h1", { children: messages.title }),
32
- !!messages.description && /* @__PURE__ */ jsx(Description, { children: messages.description }),
33
- !!customElement && /* @__PURE__ */ jsx(CustomElementWrapper, { children: customElement }),
34
- !!messages.linksTitle && /* @__PURE__ */ jsx("h2", { children: messages.linksTitle }),
35
- !!messages.back && /* @__PURE__ */ jsx(SafeLink, {
36
- to: `/#${encodeURI(messages.back)}`,
37
- onClick: () => window.history.back(),
38
- children: messages.back
39
- }),
40
- !!messages.goToFrontPage && /* @__PURE__ */ jsx(MessageWrapper, { children: /* @__PURE__ */ jsx(SafeLink, {
41
- to: "/",
42
- children: messages.goToFrontPage
43
- }) }),
44
- !!messages.logInFailed && /* @__PURE__ */ jsx(MessageWrapper, { children: /* @__PURE__ */ jsx(SafeLink, {
45
- to: "/minndla",
46
- children: messages.logInFailed
47
- }) }),
48
- children
49
- ] });
50
- var ErrorMessage_default = ErrorMessage;
51
-
52
- //#endregion
53
- export { ErrorMessage_default as ErrorMessage_default$1 };
54
- //# sourceMappingURL=ErrorMessage.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorMessage.mjs","names":[],"sources":["../../src/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\n// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda\n\nconst StyledErrorMessage = styled(\"article\", {\n base: {\n textAlign: \"center\",\n \"& a\": {\n color: \"text.strong\",\n },\n \"& h1\": {\n marginTop: \"0\",\n },\n },\n});\n\nconst IllustrationWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n marginBottom: \"medium\",\n tablet: {\n marginTop: \"xxlarge\",\n },\n },\n});\n\nconst Description = styled(Text, {\n base: {\n marginBottom: \"medium\",\n tablet: {\n marginBottom: \"xxlarge\",\n },\n },\n});\n\nconst CustomElementWrapper = styled(\"div\", {\n base: {\n marginBlock: \"xxlarge\",\n },\n});\n\nconst MessageWrapper = styled(\"div\", {\n base: {\n marginTop: \"3xsmall\",\n },\n});\n\ninterface Props {\n messages: {\n title: string;\n description?: string;\n linksTitle?: string;\n back?: string;\n goToFrontPage?: string;\n logInFailed?: string;\n };\n illustration?: {\n url: string;\n altText: string;\n };\n illustrationElement?: ReactNode;\n customElement?: ReactNode;\n children?: ReactNode;\n}\nexport const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }: Props) => (\n <StyledErrorMessage>\n {!!illustration && (\n <IllustrationWrapper>\n <img src={illustration.url} alt={illustration.altText} />\n </IllustrationWrapper>\n )}\n {!!illustrationElement && <IllustrationWrapper>{illustrationElement}</IllustrationWrapper>}\n <h1>{messages.title}</h1>\n {!!messages.description && <Description>{messages.description}</Description>}\n {!!customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}\n {!!messages.linksTitle && <h2>{messages.linksTitle}</h2>}\n {!!messages.back && (\n <SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>\n {messages.back}\n </SafeLink>\n )}\n {!!messages.goToFrontPage && (\n <MessageWrapper>\n <SafeLink to=\"/\">{messages.goToFrontPage}</SafeLink>\n </MessageWrapper>\n )}\n {!!messages.logInFailed && (\n <MessageWrapper>\n <SafeLink to=\"/minndla\">{messages.logInFailed}</SafeLink>\n </MessageWrapper>\n )}\n {children}\n </StyledErrorMessage>\n);\n\nexport default ErrorMessage;\n"],"mappings":";;;;;;;AAeA,MAAM,qBAAqB,OAAO,WAAW,EAC3C,MAAM;CACJ,WAAW;CACX,OAAO,EACL,OAAO,cACR;CACD,QAAQ,EACN,WAAW,IACZ;AACF,EACF,EAAC;AAEF,MAAM,sBAAsB,OAAO,OAAO,EACxC,MAAM;CACJ,SAAS;CACT,gBAAgB;CAChB,cAAc;CACd,QAAQ,EACN,WAAW,UACZ;AACF,EACF,EAAC;AAEF,MAAM,cAAc,OAAO,MAAM,EAC/B,MAAM;CACJ,cAAc;CACd,QAAQ,EACN,cAAc,UACf;AACF,EACF,EAAC;AAEF,MAAM,uBAAuB,OAAO,OAAO,EACzC,MAAM,EACJ,aAAa,UACd,EACF,EAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM,EACJ,WAAW,UACZ,EACF,EAAC;AAmBF,MAAa,eAAe,CAAC,EAAE,UAAU,UAAU,cAAc,qBAAqB,eAAsB,qBAC1G,KAAC;GACI,gCACD,IAAC,iDACC,IAAC;EAAI,KAAK,aAAa;EAAK,KAAK,aAAa;GAAW,GACrC;GAErB,uCAAuB,IAAC,iCAAqB,sBAA0C;iBAC1F,IAAC,kBAAI,SAAS,QAAW;GACtB,SAAS,+BAAe,IAAC,yBAAa,SAAS,cAA0B;GACzE,iCAAiB,IAAC,kCAAsB,gBAAqC;GAC7E,SAAS,8BAAc,IAAC,kBAAI,SAAS,aAAgB;GACrD,SAAS,wBACV,IAAC;EAAS,KAAK,IAAI,UAAU,SAAS,KAAK,CAAC;EAAG,SAAS,MAAM,OAAO,QAAQ,MAAM;YAChF,SAAS;GACD;GAEV,SAAS,iCACV,IAAC,4CACC,IAAC;EAAS,IAAG;YAAK,SAAS;GAAyB,GACrC;GAEhB,SAAS,+BACV,IAAC,4CACC,IAAC;EAAS,IAAG;YAAY,SAAS;GAAuB,GAC1C;CAElB;IACkB;AAGvB,2BAAe"}
@@ -1,8 +0,0 @@
1
- import { ErrorMessage_default$1 as ErrorMessage_default } from "./ErrorMessage.mjs";
2
-
3
- //#region src/ErrorMessage/index.ts
4
- var ErrorMessage_default$1 = ErrorMessage_default;
5
-
6
- //#endregion
7
- export { ErrorMessage_default$1 as ErrorMessage_default };
8
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":["ErrorMessage"],"sources":["../../src/ErrorMessage/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport ErrorMessage from \"./ErrorMessage\";\n\nexport default ErrorMessage;\n"],"mappings":";;;AAUA,6BAAeA"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-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
- import { type ReactNode } from "react";
9
- interface Props {
10
- messages: {
11
- title: string;
12
- description?: string;
13
- linksTitle?: string;
14
- back?: string;
15
- goToFrontPage?: string;
16
- logInFailed?: string;
17
- };
18
- illustration?: {
19
- url: string;
20
- altText: string;
21
- };
22
- illustrationElement?: ReactNode;
23
- customElement?: ReactNode;
24
- children?: ReactNode;
25
- }
26
- export declare const ErrorMessage: ({ children, messages, illustration, illustrationElement, customElement }: Props) => import("react/jsx-runtime").JSX.Element;
27
- export default ErrorMessage;
@@ -1,55 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
- const react = require_rolldown_runtime.__toESM(require("react"));
3
- const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
4
- const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
5
- const __ndla_safelink = require_rolldown_runtime.__toESM(require("@ndla/safelink"));
6
- const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
7
-
8
- //#region src/ErrorMessage/ErrorMessage.tsx
9
- const StyledErrorMessage = (0, __ndla_styled_system_jsx.styled)("article", { base: {
10
- textAlign: "center",
11
- "& a": { color: "text.strong" },
12
- "& h1": { marginTop: "0" }
13
- } });
14
- const IllustrationWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
15
- display: "flex",
16
- justifyContent: "center",
17
- marginBottom: "medium",
18
- tablet: { marginTop: "xxlarge" }
19
- } });
20
- const Description = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Text, { base: {
21
- marginBottom: "medium",
22
- tablet: { marginBottom: "xxlarge" }
23
- } });
24
- const CustomElementWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginBlock: "xxlarge" } });
25
- const MessageWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginTop: "3xsmall" } });
26
- const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledErrorMessage, { children: [
27
- !!illustration && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
28
- src: illustration.url,
29
- alt: illustration.altText
30
- }) }),
31
- !!illustrationElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: illustrationElement }),
32
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: messages.title }),
33
- !!messages.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Description, { children: messages.description }),
34
- !!customElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomElementWrapper, { children: customElement }),
35
- !!messages.linksTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: messages.linksTitle }),
36
- !!messages.back && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
37
- to: `/#${encodeURI(messages.back)}`,
38
- onClick: () => window.history.back(),
39
- children: messages.back
40
- }),
41
- !!messages.goToFrontPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
42
- to: "/",
43
- children: messages.goToFrontPage
44
- }) }),
45
- !!messages.logInFailed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
46
- to: "/minndla",
47
- children: messages.logInFailed
48
- }) }),
49
- children
50
- ] });
51
- var ErrorMessage_default = ErrorMessage;
52
-
53
- //#endregion
54
- exports.ErrorMessage_default$1 = ErrorMessage_default;
55
- //# sourceMappingURL=ErrorMessage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorMessage.js","names":["Text","SafeLink"],"sources":["../../src/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\n// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda\n\nconst StyledErrorMessage = styled(\"article\", {\n base: {\n textAlign: \"center\",\n \"& a\": {\n color: \"text.strong\",\n },\n \"& h1\": {\n marginTop: \"0\",\n },\n },\n});\n\nconst IllustrationWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n marginBottom: \"medium\",\n tablet: {\n marginTop: \"xxlarge\",\n },\n },\n});\n\nconst Description = styled(Text, {\n base: {\n marginBottom: \"medium\",\n tablet: {\n marginBottom: \"xxlarge\",\n },\n },\n});\n\nconst CustomElementWrapper = styled(\"div\", {\n base: {\n marginBlock: \"xxlarge\",\n },\n});\n\nconst MessageWrapper = styled(\"div\", {\n base: {\n marginTop: \"3xsmall\",\n },\n});\n\ninterface Props {\n messages: {\n title: string;\n description?: string;\n linksTitle?: string;\n back?: string;\n goToFrontPage?: string;\n logInFailed?: string;\n };\n illustration?: {\n url: string;\n altText: string;\n };\n illustrationElement?: ReactNode;\n customElement?: ReactNode;\n children?: ReactNode;\n}\nexport const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }: Props) => (\n <StyledErrorMessage>\n {!!illustration && (\n <IllustrationWrapper>\n <img src={illustration.url} alt={illustration.altText} />\n </IllustrationWrapper>\n )}\n {!!illustrationElement && <IllustrationWrapper>{illustrationElement}</IllustrationWrapper>}\n <h1>{messages.title}</h1>\n {!!messages.description && <Description>{messages.description}</Description>}\n {!!customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}\n {!!messages.linksTitle && <h2>{messages.linksTitle}</h2>}\n {!!messages.back && (\n <SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>\n {messages.back}\n </SafeLink>\n )}\n {!!messages.goToFrontPage && (\n <MessageWrapper>\n <SafeLink to=\"/\">{messages.goToFrontPage}</SafeLink>\n </MessageWrapper>\n )}\n {!!messages.logInFailed && (\n <MessageWrapper>\n <SafeLink to=\"/minndla\">{messages.logInFailed}</SafeLink>\n </MessageWrapper>\n )}\n {children}\n </StyledErrorMessage>\n);\n\nexport default ErrorMessage;\n"],"mappings":";;;;;;;;AAeA,MAAM,qBAAqB,qCAAO,WAAW,EAC3C,MAAM;CACJ,WAAW;CACX,OAAO,EACL,OAAO,cACR;CACD,QAAQ,EACN,WAAW,IACZ;AACF,EACF,EAAC;AAEF,MAAM,sBAAsB,qCAAO,OAAO,EACxC,MAAM;CACJ,SAAS;CACT,gBAAgB;CAChB,cAAc;CACd,QAAQ,EACN,WAAW,UACZ;AACF,EACF,EAAC;AAEF,MAAM,cAAc,qCAAOA,wBAAM,EAC/B,MAAM;CACJ,cAAc;CACd,QAAQ,EACN,cAAc,UACf;AACF,EACF,EAAC;AAEF,MAAM,uBAAuB,qCAAO,OAAO,EACzC,MAAM,EACJ,aAAa,UACd,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM,EACJ,WAAW,UACZ,EACF,EAAC;AAmBF,MAAa,eAAe,CAAC,EAAE,UAAU,UAAU,cAAc,qBAAqB,eAAsB,qBAC1G,4BAAC;GACI,gCACD,2BAAC,iDACC,2BAAC;EAAI,KAAK,aAAa;EAAK,KAAK,aAAa;GAAW,GACrC;GAErB,uCAAuB,2BAAC,iCAAqB,sBAA0C;iBAC1F,2BAAC,kBAAI,SAAS,QAAW;GACtB,SAAS,+BAAe,2BAAC,yBAAa,SAAS,cAA0B;GACzE,iCAAiB,2BAAC,kCAAsB,gBAAqC;GAC7E,SAAS,8BAAc,2BAAC,kBAAI,SAAS,aAAgB;GACrD,SAAS,wBACV,2BAACC;EAAS,KAAK,IAAI,UAAU,SAAS,KAAK,CAAC;EAAG,SAAS,MAAM,OAAO,QAAQ,MAAM;YAChF,SAAS;GACD;GAEV,SAAS,iCACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAK,SAAS;GAAyB,GACrC;GAEhB,SAAS,+BACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAY,SAAS;GAAuB,GAC1C;CAElB;IACkB;AAGvB,2BAAe"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-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
- import ErrorMessage from "./ErrorMessage";
9
- export default ErrorMessage;
@@ -1,8 +0,0 @@
1
- const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_ErrorMessage_ErrorMessage = require('./ErrorMessage.js');
2
-
3
- //#region src/ErrorMessage/index.ts
4
- var ErrorMessage_default$1 = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_ErrorMessage_ErrorMessage.ErrorMessage_default$1;
5
-
6
- //#endregion
7
- exports.ErrorMessage_default = ErrorMessage_default$1;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["ErrorMessage"],"sources":["../../src/ErrorMessage/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport ErrorMessage from \"./ErrorMessage\";\n\nexport default ErrorMessage;\n"],"mappings":";;;AAUA,6BAAeA"}
@@ -1,57 +0,0 @@
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 type { Meta, StoryFn, StoryObj } from "@storybook/react";
10
- import ErrorMessage from "./ErrorMessage";
11
- // @ts-expect-error - It exists.
12
- import Oops from "../../../../images/oops.gif";
13
-
14
- /**
15
- * Feilmeldingskomponenten lenker tilbake til forrige side eller til forsiden. Den brukes når det har oppstått en feil i systemet, f.eks. ved 404- eller 503-feil.
16
- */
17
- export default {
18
- title: "Patterns/ErrorMessage",
19
- component: ErrorMessage,
20
- tags: ["autodocs"],
21
- parameters: {
22
- inlineStories: true,
23
- },
24
- args: {
25
- illustration: {
26
- url: Oops,
27
- altText: "Systemfeil",
28
- },
29
- messages: {
30
- title: "Oisann, her gikk noe galt",
31
- description: "En kort beskrivelse av feilen som oppsto.",
32
- linksTitle: "Kom igang:",
33
- back: "Gå tilbake",
34
- goToFrontPage: "Gå til forsiden",
35
- },
36
- },
37
- } as Meta<typeof ErrorMessage>;
38
-
39
- export const ErrorMessageStory: StoryFn<typeof ErrorMessage> = (args) => {
40
- return <ErrorMessage {...args} />;
41
- };
42
-
43
- ErrorMessageStory.storyName = "ErrorMessage";
44
-
45
- export const LoginFailed: StoryObj<typeof ErrorMessage> = {
46
- args: {
47
- illustration: {
48
- url: Oops,
49
- altText: "Systemfeil",
50
- },
51
- messages: {
52
- title: "Ops, her gikk noe galt",
53
- linksTitle: "Prøv igjen",
54
- logInFailed: "Logg inn",
55
- },
56
- },
57
- };
@@ -1,108 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-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 { type ReactNode } from "react";
10
- import { Text } from "@ndla/primitives";
11
- import { SafeLink } from "@ndla/safelink";
12
- import { styled } from "@ndla/styled-system/jsx";
13
-
14
- // TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda
15
-
16
- const StyledErrorMessage = styled("article", {
17
- base: {
18
- textAlign: "center",
19
- "& a": {
20
- color: "text.strong",
21
- },
22
- "& h1": {
23
- marginTop: "0",
24
- },
25
- },
26
- });
27
-
28
- const IllustrationWrapper = styled("div", {
29
- base: {
30
- display: "flex",
31
- justifyContent: "center",
32
- marginBottom: "medium",
33
- tablet: {
34
- marginTop: "xxlarge",
35
- },
36
- },
37
- });
38
-
39
- const Description = styled(Text, {
40
- base: {
41
- marginBottom: "medium",
42
- tablet: {
43
- marginBottom: "xxlarge",
44
- },
45
- },
46
- });
47
-
48
- const CustomElementWrapper = styled("div", {
49
- base: {
50
- marginBlock: "xxlarge",
51
- },
52
- });
53
-
54
- const MessageWrapper = styled("div", {
55
- base: {
56
- marginTop: "3xsmall",
57
- },
58
- });
59
-
60
- interface Props {
61
- messages: {
62
- title: string;
63
- description?: string;
64
- linksTitle?: string;
65
- back?: string;
66
- goToFrontPage?: string;
67
- logInFailed?: string;
68
- };
69
- illustration?: {
70
- url: string;
71
- altText: string;
72
- };
73
- illustrationElement?: ReactNode;
74
- customElement?: ReactNode;
75
- children?: ReactNode;
76
- }
77
- export const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }: Props) => (
78
- <StyledErrorMessage>
79
- {!!illustration && (
80
- <IllustrationWrapper>
81
- <img src={illustration.url} alt={illustration.altText} />
82
- </IllustrationWrapper>
83
- )}
84
- {!!illustrationElement && <IllustrationWrapper>{illustrationElement}</IllustrationWrapper>}
85
- <h1>{messages.title}</h1>
86
- {!!messages.description && <Description>{messages.description}</Description>}
87
- {!!customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}
88
- {!!messages.linksTitle && <h2>{messages.linksTitle}</h2>}
89
- {!!messages.back && (
90
- <SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>
91
- {messages.back}
92
- </SafeLink>
93
- )}
94
- {!!messages.goToFrontPage && (
95
- <MessageWrapper>
96
- <SafeLink to="/">{messages.goToFrontPage}</SafeLink>
97
- </MessageWrapper>
98
- )}
99
- {!!messages.logInFailed && (
100
- <MessageWrapper>
101
- <SafeLink to="/minndla">{messages.logInFailed}</SafeLink>
102
- </MessageWrapper>
103
- )}
104
- {children}
105
- </StyledErrorMessage>
106
- );
107
-
108
- export default ErrorMessage;
@@ -1,11 +0,0 @@
1
- /**
2
- * Copyright (c) 2019-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 ErrorMessage from "./ErrorMessage";
10
-
11
- export default ErrorMessage;