@ndla/ui 56.0.74-alpha.0 → 56.0.76-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 +4 -21
- package/dist/styles.css +12 -76
- package/es/Article/Article.js +2 -2
- package/es/Article/ArticleByline.js +1 -1
- package/es/AudioPlayer/AudioPlayer.js +1 -0
- package/es/AudioPlayer/Controls.js +1 -3
- package/es/AudioPlayer/SpeechControl.js +1 -1
- package/es/Breadcrumb/BreadcrumbItem.js +1 -1
- package/es/Breadcrumb/HomeBreadcrumb.js +1 -1
- package/es/CampaignBlock/CampaignBlock.js +1 -1
- package/es/ContentTypeBadge/ContentTypeBadge.js +35 -213
- package/es/ContentTypeHero/ContentTypeHero.js +2 -1
- package/es/CopyParagraphButton/CopyParagraphButton.js +1 -1
- package/es/Embed/CodeEmbed.js +1 -2
- package/es/Embed/EmbedErrorPlaceholder.js +2 -2
- package/es/Embed/ImageEmbed.js +1 -1
- package/es/Embed/UuDisclaimerEmbed.js +1 -1
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +1 -1
- package/es/FactBox/FactBox.js +1 -1
- package/es/FileList/File.js +1 -1
- package/es/Gloss/Gloss.js +1 -1
- package/es/LicenseByline/EmbedByline.js +1 -1
- package/es/LinkBlock/LinkBlock.js +1 -2
- package/es/RelatedArticleList/RelatedArticleList.js +2 -2
- package/es/ResourceBox/ResourceBox.js +1 -1
- package/es/TagSelector/TagSelector.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 +3 -3
- package/lib/Article/Article.js +1 -1
- package/lib/Article/ArticleByline.d.ts +3 -3
- package/lib/Article/ArticleByline.js +2 -2
- package/lib/Article/ArticleFootNotes.d.ts +1 -1
- package/lib/AudioPlayer/AudioPlayer.d.ts +1 -1
- package/lib/AudioPlayer/AudioPlayer.js +1 -0
- package/lib/AudioPlayer/Controls.js +6 -8
- package/lib/AudioPlayer/SpeechControl.js +2 -2
- package/lib/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/lib/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js +2 -2
- package/lib/Breadcrumb/HomeBreadcrumb.d.ts +1 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js +4 -4
- package/lib/CampaignBlock/CampaignBlock.d.ts +2 -2
- package/lib/CampaignBlock/CampaignBlock.js +2 -2
- package/lib/CodeBlock/CodeBlock.d.ts +1 -1
- package/lib/Concept/Concept.d.ts +3 -3
- package/lib/ContactBlock/ContactBlock.d.ts +1 -1
- package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +9 -19
- package/lib/ContentTypeBadge/ContentTypeBadge.js +36 -223
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.d.ts +2 -2
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.d.ts +2 -2
- package/lib/ContentTypeHero/ContentTypeHero.d.ts +2 -2
- package/lib/ContentTypeHero/ContentTypeHero.js +2 -1
- package/lib/CopyParagraphButton/CopyParagraphButton.d.ts +1 -1
- package/lib/CopyParagraphButton/CopyParagraphButton.js +2 -2
- package/lib/Embed/AudioEmbed.d.ts +2 -2
- package/lib/Embed/BrightcoveEmbed.d.ts +2 -2
- package/lib/Embed/CodeEmbed.d.ts +1 -1
- package/lib/Embed/CodeEmbed.js +2 -3
- package/lib/Embed/ConceptEmbed.d.ts +3 -3
- package/lib/Embed/ContentLinkEmbed.d.ts +2 -2
- package/lib/Embed/CopyrightEmbed.d.ts +2 -2
- package/lib/Embed/EmbedErrorPlaceholder.d.ts +2 -2
- package/lib/Embed/EmbedErrorPlaceholder.js +2 -2
- package/lib/Embed/EmbedWrapper.d.ts +1 -1
- package/lib/Embed/ExternalEmbed.d.ts +1 -1
- package/lib/Embed/FootnoteEmbed.d.ts +1 -1
- package/lib/Embed/GlossEmbed.d.ts +1 -1
- package/lib/Embed/H5pEmbed.d.ts +1 -1
- package/lib/Embed/IframeEmbed.d.ts +1 -1
- package/lib/Embed/ImageEmbed.d.ts +3 -3
- package/lib/Embed/ImageEmbed.js +2 -2
- package/lib/Embed/RelatedContentEmbed.d.ts +1 -1
- package/lib/Embed/UnknownEmbed.d.ts +1 -1
- package/lib/Embed/UuDisclaimerEmbed.d.ts +2 -2
- package/lib/Embed/UuDisclaimerEmbed.js +2 -2
- package/lib/Embed/types.d.ts +3 -3
- package/lib/ErrorMessage/ErrorMessage.d.ts +1 -1
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +3 -3
- package/lib/FactBox/FactBox.d.ts +1 -1
- package/lib/FactBox/FactBox.js +2 -2
- package/lib/FileList/File.d.ts +1 -1
- package/lib/FileList/File.js +2 -2
- package/lib/FileList/FileList.d.ts +1 -1
- package/lib/Gloss/Gloss.d.ts +1 -1
- package/lib/Gloss/Gloss.js +2 -2
- package/lib/Gloss/GlossExample.d.ts +1 -1
- package/lib/Grid/Grid.d.ts +1 -1
- package/lib/Grid/GridParallaxItem.d.ts +1 -1
- package/lib/LicenseByline/EmbedByline.d.ts +6 -6
- package/lib/LicenseByline/EmbedByline.js +2 -2
- package/lib/LicenseByline/LicenseLink.d.ts +2 -2
- package/lib/LinkBlock/LinkBlock.d.ts +1 -1
- package/lib/LinkBlock/LinkBlock.js +3 -4
- package/lib/LinkBlock/LinkBlockSection.d.ts +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +2 -2
- package/lib/RelatedArticleList/RelatedArticleList.js +4 -4
- package/lib/ResourceBox/ResourceBox.js +2 -2
- package/lib/TagSelector/TagSelector.d.ts +1 -1
- package/lib/TagSelector/TagSelector.js +2 -2
- package/lib/ZendeskButton/ZendeskButton.d.ts +1 -1
- package/lib/i18n/useComponentTranslations.d.ts +1 -1
- 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/lib/types.d.ts +1 -1
- package/package.json +12 -12
- package/src/Article/Article.tsx +6 -6
- package/src/Article/ArticleByline.stories.tsx +1 -1
- package/src/Article/ArticleByline.tsx +5 -5
- package/src/Article/ArticleFootNotes.tsx +1 -1
- package/src/AudioPlayer/AudiPlayer.stories.tsx +1 -1
- package/src/AudioPlayer/AudioPlayer.tsx +2 -1
- package/src/AudioPlayer/Controls.tsx +1 -3
- package/src/AudioPlayer/SpeechControl.tsx +1 -1
- package/src/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/Breadcrumb/BreadcrumbItem.tsx +2 -2
- package/src/Breadcrumb/HomeBreadcrumb.stories.tsx +1 -1
- package/src/Breadcrumb/HomeBreadcrumb.tsx +2 -2
- package/src/CampaignBlock/CampaignBlock.stories.tsx +1 -1
- package/src/CampaignBlock/CampaignBlock.tsx +4 -4
- package/src/CodeBlock/CodeBlock.stories.tsx +1 -1
- package/src/CodeBlock/CodeBlock.tsx +1 -1
- package/src/Concept/Concept.stories.tsx +2 -2
- package/src/Concept/Concept.tsx +3 -3
- package/src/ContactBlock/ContactBlock.stories.tsx +1 -1
- package/src/ContactBlock/ContactBlock.tsx +2 -2
- package/src/ContentTypeBadge/ContentTypeBadge.stories.tsx +46 -54
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +63 -211
- package/src/ContentTypeBlockQuote/ContentTypeBlockQuote.tsx +2 -2
- package/src/ContentTypeFramedContent/ContentTypeFramedContent.tsx +2 -2
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +1 -1
- package/src/ContentTypeHero/ContentTypeHero.tsx +3 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +2 -2
- package/src/Embed/AudioEmbed.stories.tsx +2 -2
- package/src/Embed/AudioEmbed.tsx +2 -2
- package/src/Embed/BrightcoveEmbed.stories.tsx +2 -2
- package/src/Embed/BrightcoveEmbed.tsx +2 -2
- package/src/Embed/CodeEmbed.stories.tsx +1 -1
- package/src/Embed/CodeEmbed.tsx +3 -4
- package/src/Embed/ConceptEmbed.stories.tsx +2 -2
- package/src/Embed/ConceptEmbed.tsx +3 -3
- package/src/Embed/ContentLinkEmbed.tsx +2 -2
- package/src/Embed/CopyrightEmbed.tsx +2 -2
- package/src/Embed/EmbedErrorPlaceholder.tsx +4 -4
- package/src/Embed/EmbedWrapper.tsx +1 -1
- package/src/Embed/ExternalEmbed.stories.tsx +2 -2
- package/src/Embed/ExternalEmbed.tsx +1 -1
- package/src/Embed/FootnoteEmbed.stories.tsx +2 -2
- package/src/Embed/FootnoteEmbed.tsx +1 -1
- package/src/Embed/GlossEmbed.stories.tsx +2 -2
- package/src/Embed/GlossEmbed.tsx +1 -1
- package/src/Embed/H5pEmbed.stories.tsx +2 -2
- package/src/Embed/H5pEmbed.tsx +1 -1
- package/src/Embed/IframeEmbed.stories.tsx +2 -2
- package/src/Embed/IframeEmbed.tsx +1 -1
- package/src/Embed/ImageEmbed.stories.tsx +4 -4
- package/src/Embed/ImageEmbed.tsx +5 -5
- package/src/Embed/InlineTriggerButton.tsx +1 -1
- package/src/Embed/RelatedContentEmbed.stories.tsx +2 -2
- package/src/Embed/RelatedContentEmbed.tsx +1 -1
- package/src/Embed/UnknownEmbed.tsx +1 -1
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +2 -2
- package/src/Embed/UuDisclaimerEmbed.tsx +3 -3
- package/src/Embed/types.ts +3 -3
- package/src/ErrorMessage/ErrorMessage.stories.tsx +1 -1
- package/src/ErrorMessage/ErrorMessage.tsx +1 -1
- package/src/ErrorMessage/ErrorResourceAccessDenied.tsx +1 -1
- package/src/FactBox/FactBox.tsx +11 -2
- package/src/FactBox/Factbox.stories.tsx +1 -1
- package/src/FileList/File.tsx +2 -2
- package/src/FileList/FileList.stories.tsx +3 -4
- package/src/FileList/FileList.tsx +1 -1
- package/src/Gloss/Gloss.stories.tsx +1 -1
- package/src/Gloss/Gloss.tsx +2 -2
- package/src/Gloss/GlossExample.tsx +1 -1
- package/src/Grid/Grid.stories.tsx +1 -1
- package/src/Grid/Grid.tsx +1 -1
- package/src/Grid/GridParallaxItem.tsx +1 -1
- package/src/KeyFigure/KeyFigure.stories.tsx +1 -1
- package/src/LicenseByline/EmbedByline.stories.tsx +1 -1
- package/src/LicenseByline/EmbedByline.tsx +7 -7
- package/src/LicenseByline/LicenseLink.tsx +2 -2
- package/src/LinkBlock/LinkBlock.stories.tsx +1 -1
- package/src/LinkBlock/LinkBlock.tsx +2 -3
- package/src/LinkBlock/LinkBlockSection.tsx +1 -1
- package/src/Pitch/Pitch.stories.tsx +2 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +4 -4
- package/src/ResourceBox/ResourceBox.tsx +1 -1
- package/src/TagSelector/TagSelector.stories.tsx +2 -4
- package/src/TagSelector/TagSelector.tsx +7 -7
- package/src/ZendeskButton/ZendeskButton.tsx +1 -1
- package/src/i18n/useComponentTranslations.ts +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/src/types.ts +1 -1
- 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
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ReactNode } from "react";
|
|
10
|
-
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
11
11
|
import { PageContent, Text } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import { IImageMetaInformationV3 } from "@ndla/types-backend/image-api";
|
|
14
|
-
import { ImageEmbedData } from "@ndla/types-embed";
|
|
13
|
+
import type { IImageMetaInformationV3 } from "@ndla/types-backend/image-api";
|
|
14
|
+
import type { ImageEmbedData } from "@ndla/types-embed";
|
|
15
15
|
import ImageEmbed from "./ImageEmbed";
|
|
16
16
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
17
17
|
import { Grid } from "../Grid";
|
package/src/Embed/ImageEmbed.tsx
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import parse from "html-react-parser";
|
|
10
|
-
import { ReactNode, useMemo, useState } from "react";
|
|
10
|
+
import { type ReactNode, useMemo, useState } from "react";
|
|
11
11
|
import { useTranslation } from "react-i18next";
|
|
12
|
-
import { AddLine } from "@ndla/icons
|
|
13
|
-
import { Figure, FigureSize, FigureVariantProps, Image } from "@ndla/primitives";
|
|
12
|
+
import { AddLine } from "@ndla/icons";
|
|
13
|
+
import { Figure, type FigureSize, type FigureVariantProps, Image } from "@ndla/primitives";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
-
import { ImageEmbedData, ImageMetaData } from "@ndla/types-embed";
|
|
15
|
+
import type { ImageEmbedData, ImageMetaData } from "@ndla/types-embed";
|
|
16
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
17
|
-
import { RenderContext } from "./types";
|
|
17
|
+
import type { RenderContext } from "./types";
|
|
18
18
|
import { EmbedByline } from "../LicenseByline";
|
|
19
19
|
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
20
20
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ComponentPropsWithRef, KeyboardEvent, forwardRef, useCallback, useRef } from "react";
|
|
9
|
+
import { type ComponentPropsWithRef, type KeyboardEvent, forwardRef, useCallback, useRef } from "react";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
11
|
import { composeRefs } from "@ndla/util";
|
|
12
12
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
10
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import { RelatedContentMetaData } from "@ndla/types-embed";
|
|
11
|
+
import type { RelatedContentMetaData } from "@ndla/types-embed";
|
|
12
12
|
import RelatedContentEmbed from "./RelatedContentEmbed";
|
|
13
13
|
import { ArticleWrapper, ArticleContent } from "../Article";
|
|
14
14
|
import RelatedArticleList from "../RelatedArticleList";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { RelatedContentMetaData } from "@ndla/types-embed";
|
|
10
|
+
import type { RelatedContentMetaData } from "@ndla/types-embed";
|
|
11
11
|
import { contentTypeMapping } from "../model/ContentType";
|
|
12
12
|
import { RelatedArticle } from "../RelatedArticleList/RelatedArticleList";
|
|
13
13
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
10
|
import { ExpandableBox, ExpandableBoxSummary, FramedContent, PageContent } from "@ndla/primitives";
|
|
11
|
-
import { UuDisclaimerEmbedData } from "@ndla/types-embed";
|
|
11
|
+
import type { UuDisclaimerEmbedData } from "@ndla/types-embed";
|
|
12
12
|
import H5pEmbed from "./H5pEmbed";
|
|
13
13
|
import IframeEmbed from "./IframeEmbed";
|
|
14
14
|
import UuDisclaimerEmbed from "./UuDisclaimerEmbed";
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ReactNode } from "react";
|
|
10
|
-
import { InformationLine } from "@ndla/icons
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
import { InformationLine } from "@ndla/icons";
|
|
11
11
|
import { MessageBox } from "@ndla/primitives";
|
|
12
12
|
import { SafeLink } from "@ndla/safelink";
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
|
-
import { UuDisclaimerMetaData } from "@ndla/types-embed";
|
|
14
|
+
import type { UuDisclaimerMetaData } from "@ndla/types-embed";
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
17
|
embed: UuDisclaimerMetaData;
|
package/src/Embed/types.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ElementType } from "react";
|
|
10
|
-
import { IImageMetaInformationV3 } from "@ndla/types-backend/image-api";
|
|
11
|
-
import { EmbedMetaData } from "@ndla/types-embed";
|
|
9
|
+
import type { ElementType } from "react";
|
|
10
|
+
import type { IImageMetaInformationV3 } from "@ndla/types-backend/image-api";
|
|
11
|
+
import type { EmbedMetaData } from "@ndla/types-embed";
|
|
12
12
|
|
|
13
13
|
export type HeartButtonType = ElementType<{
|
|
14
14
|
embed: Extract<EmbedMetaData, { status: "success" }>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
10
|
import ErrorMessage from "./ErrorMessage";
|
|
11
11
|
// @ts-expect-error - It exists.
|
|
12
12
|
import Oops from "../../../../images/oops.gif";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { PresentationLine, LoginBoxLine } from "@ndla/icons
|
|
10
|
+
import { PresentationLine, LoginBoxLine } from "@ndla/icons";
|
|
11
11
|
import { Button } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import ErrorMessage from "./ErrorMessage";
|
package/src/FactBox/FactBox.tsx
CHANGED
|
@@ -6,9 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
type ComponentProps,
|
|
11
|
+
type ReactNode,
|
|
12
|
+
forwardRef,
|
|
13
|
+
useCallback,
|
|
14
|
+
useEffect,
|
|
15
|
+
useId,
|
|
16
|
+
useMemo,
|
|
17
|
+
useState,
|
|
18
|
+
} from "react";
|
|
10
19
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { ArrowDownShortLine } from "@ndla/icons
|
|
20
|
+
import { ArrowDownShortLine } from "@ndla/icons";
|
|
12
21
|
import { IconButton } from "@ndla/primitives";
|
|
13
22
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
23
|
|
package/src/FileList/File.tsx
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ComponentPropsWithRef, forwardRef } from "react";
|
|
9
|
+
import { type ComponentPropsWithRef, forwardRef } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { DownloadLine } from "@ndla/icons
|
|
11
|
+
import { DownloadLine } from "@ndla/icons";
|
|
12
12
|
import { Text } from "@ndla/primitives";
|
|
13
13
|
import { SafeLink } from "@ndla/safelink";
|
|
14
14
|
import { HStack, styled } from "@ndla/styled-system/jsx";
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
|
-
import { PencilFill, DeleteBinLine } from "@ndla/icons
|
|
11
|
-
import { DragVertical } from "@ndla/icons/editor";
|
|
9
|
+
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
|
+
import { PencilFill, DeleteBinLine, Draggable } from "@ndla/icons";
|
|
12
11
|
import { IconButton } from "@ndla/primitives";
|
|
13
12
|
import { HStack, styled } from "@ndla/styled-system/jsx";
|
|
14
13
|
import { File } from "./File";
|
|
@@ -151,7 +150,7 @@ export const FilesWithDragHandle: StoryObj<typeof File> = {
|
|
|
151
150
|
<ul>
|
|
152
151
|
<StyledFileListItem>
|
|
153
152
|
<IconButton variant="clear">
|
|
154
|
-
<
|
|
153
|
+
<Draggable />
|
|
155
154
|
</IconButton>
|
|
156
155
|
<File title="Fil 1" url="https://ndla.no/1" fileExists fileType="mp4" fileSize="100 mb" />
|
|
157
156
|
</StyledFileListItem>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryObj, StoryFn } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryObj, StoryFn } from "@storybook/react";
|
|
10
10
|
import Gloss from "./Gloss";
|
|
11
11
|
import GlossExample from "./GlossExample";
|
|
12
12
|
import { wordClass } from "../model/WordClass";
|
package/src/Gloss/Gloss.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useMemo } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
import { AccordionItemTrigger } from "@ark-ui/react";
|
|
12
|
-
import { ArrowDownShortLine } from "@ndla/icons
|
|
12
|
+
import { ArrowDownShortLine } from "@ndla/icons";
|
|
13
13
|
import {
|
|
14
14
|
AccordionItem,
|
|
15
15
|
AccordionItemContent,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
Text,
|
|
20
20
|
} from "@ndla/primitives";
|
|
21
21
|
import { styled } from "@ndla/styled-system/jsx";
|
|
22
|
-
import {
|
|
22
|
+
import type { StyledVariantProps } from "@ndla/styled-system/types";
|
|
23
23
|
import type { IGlossData, IGlossExample } from "@ndla/types-backend/concept-api";
|
|
24
24
|
import GlossExample from "./GlossExample";
|
|
25
25
|
import SpeechControl from "../AudioPlayer/SpeechControl";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { Fragment } from "react";
|
|
10
10
|
import { Text } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import { IGlossExample } from "@ndla/types-backend/concept-api";
|
|
12
|
+
import type { IGlossExample } from "@ndla/types-backend/concept-api";
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
examples: IGlossExample[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryFn } from "@storybook/react";
|
|
10
10
|
import { PageContent } from "@ndla/primitives";
|
|
11
11
|
import { ArticleContent, ArticleWrapper } from "@ndla/ui";
|
|
12
12
|
import { Grid } from "./Grid";
|
package/src/Grid/Grid.tsx
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Dispatch, ReactNode, SetStateAction, useState } from "react";
|
|
9
|
+
import { type Dispatch, type ReactNode, type SetStateAction, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { AlertLine } from "@ndla/icons
|
|
11
|
+
import { AlertLine } from "@ndla/icons";
|
|
12
12
|
import { getLicenseByAbbreviation, getLicenseCredits } from "@ndla/licenses";
|
|
13
13
|
import { Button, Text } from "@ndla/primitives";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
-
import { ICopyright as ArticleCopyright } from "@ndla/types-backend/article-api";
|
|
16
|
-
import { ICopyright as AudioCopyright } from "@ndla/types-backend/audio-api";
|
|
17
|
-
import { IDraftCopyright as ConceptCopyright } from "@ndla/types-backend/concept-api";
|
|
18
|
-
import { ICopyright as ImageCopyright } from "@ndla/types-backend/image-api";
|
|
19
|
-
import { BrightcoveCopyright } from "@ndla/types-embed";
|
|
15
|
+
import type { ICopyright as ArticleCopyright } from "@ndla/types-backend/article-api";
|
|
16
|
+
import type { ICopyright as AudioCopyright } from "@ndla/types-backend/audio-api";
|
|
17
|
+
import type { IDraftCopyright as ConceptCopyright } from "@ndla/types-backend/concept-api";
|
|
18
|
+
import type { ICopyright as ImageCopyright } from "@ndla/types-backend/image-api";
|
|
19
|
+
import type { BrightcoveCopyright } from "@ndla/types-embed";
|
|
20
20
|
import { LicenseLink } from "./LicenseLink";
|
|
21
21
|
|
|
22
22
|
interface BaseProps {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
|
-
import { LicenseLocaleType } from "@ndla/licenses";
|
|
11
|
-
import { SafeLink, SafeLinkProps } from "@ndla/safelink";
|
|
10
|
+
import type { LicenseLocaleType } from "@ndla/licenses";
|
|
11
|
+
import { SafeLink, type SafeLinkProps } from "@ndla/safelink";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
|
|
14
14
|
interface Props extends Omit<SafeLinkProps, "to"> {
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import parse from "html-react-parser";
|
|
10
10
|
import { useMemo } from "react";
|
|
11
|
-
import { ArrowRightLine } from "@ndla/icons
|
|
12
|
-
import { CalendarLine } from "@ndla/icons/editor";
|
|
11
|
+
import { ArrowRightLine, CalendarLine } from "@ndla/icons";
|
|
13
12
|
import { Heading } from "@ndla/primitives";
|
|
14
13
|
import { SafeLink } from "@ndla/safelink";
|
|
15
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
|
-
import { LinkBlockEmbedData } from "@ndla/types-embed";
|
|
15
|
+
import type { LinkBlockEmbedData } from "@ndla/types-embed";
|
|
17
16
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
18
17
|
|
|
19
18
|
const InfoWrapper = styled("div", {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
9
|
+
import type { Meta, StoryFn } from "@storybook/react";
|
|
10
10
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import { Pitch, Props } from "./Pitch";
|
|
11
|
+
import { Pitch, type Props } from "./Pitch";
|
|
12
12
|
import { ArticleContent, ArticleWrapper } from "../Article";
|
|
13
13
|
import { Grid } from "../Grid";
|
|
14
14
|
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Children, ComponentPropsWithoutRef, ReactNode, useMemo, useState } from "react";
|
|
9
|
+
import { Children, type ComponentPropsWithoutRef, type ReactNode, useMemo, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { ExternalLinkLine } from "@ndla/icons
|
|
11
|
+
import { ExternalLinkLine } from "@ndla/icons";
|
|
12
12
|
import { CardContent, CardHeading, CardRoot, Text, Heading, Button } from "@ndla/primitives";
|
|
13
13
|
import { SafeLink } from "@ndla/safelink";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
15
|
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
16
|
-
import { ContentTypeBadge } from "../ContentTypeBadge/
|
|
16
|
+
import { ContentTypeBadge } from "../ContentTypeBadge/ContentTypeBadge";
|
|
17
17
|
import { contentTypes } from "../model/ContentType";
|
|
18
|
-
import { HeadingLevel } from "../types";
|
|
18
|
+
import type { HeadingLevel } from "../types";
|
|
19
19
|
|
|
20
20
|
interface RelatedArticleProps {
|
|
21
21
|
title: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { breakpoints } from "@ndla/core";
|
|
10
|
-
import { ShareBoxLine } from "@ndla/icons
|
|
10
|
+
import { ShareBoxLine } from "@ndla/icons";
|
|
11
11
|
import { Heading, Image, Text } from "@ndla/primitives";
|
|
12
12
|
import { SafeLinkButton } from "@ndla/safelink";
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { type ComboboxInputValueChangeDetails, createListCollection } from "@ark-ui/react";
|
|
11
11
|
|
|
12
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
13
|
-
import { CloseLine } from "@ndla/icons
|
|
14
|
-
import { ArrowDownShortLine } from "@ndla/icons/common";
|
|
15
|
-
import { CheckLine } from "@ndla/icons/editor";
|
|
12
|
+
import type { Meta, StoryFn } from "@storybook/react";
|
|
13
|
+
import { CloseLine, ArrowDownShortLine, CheckLine } from "@ndla/icons";
|
|
16
14
|
import {
|
|
17
15
|
ComboboxContent,
|
|
18
16
|
ComboboxItem,
|
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
|
|
9
9
|
import { forwardRef, useEffect, useId, useRef } from "react";
|
|
10
10
|
import { type CollectionItem, useTagsInputContext, useComboboxContext } from "@ark-ui/react";
|
|
11
|
-
import { CloseLine } from "@ndla/icons
|
|
11
|
+
import { CloseLine } from "@ndla/icons";
|
|
12
12
|
import {
|
|
13
13
|
ComboboxClearTrigger,
|
|
14
14
|
ComboboxControl,
|
|
15
|
-
ComboboxControlProps,
|
|
15
|
+
type ComboboxControlProps,
|
|
16
16
|
ComboboxInput,
|
|
17
|
-
ComboboxInputProps,
|
|
17
|
+
type ComboboxInputProps,
|
|
18
18
|
ComboboxLabel,
|
|
19
19
|
ComboboxRoot,
|
|
20
|
-
ComboboxRootProps,
|
|
20
|
+
type ComboboxRootProps,
|
|
21
21
|
ComboboxTrigger,
|
|
22
22
|
TagsInputControl,
|
|
23
|
-
TagsInputControlProps,
|
|
23
|
+
type TagsInputControlProps,
|
|
24
24
|
TagsInputInput,
|
|
25
|
-
TagsInputInputProps,
|
|
25
|
+
type TagsInputInputProps,
|
|
26
26
|
TagsInputItem,
|
|
27
27
|
TagsInputItemDeleteTrigger,
|
|
28
28
|
TagsInputItemPreview,
|
|
29
29
|
TagsInputItemText,
|
|
30
30
|
TagsInputRoot,
|
|
31
|
-
TagsInputRootProps,
|
|
31
|
+
type TagsInputRootProps,
|
|
32
32
|
TagsInputItemInput,
|
|
33
33
|
} from "@ndla/primitives";
|
|
34
34
|
import { contains } from "@ndla/util";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { forwardRef, useState } from "react";
|
|
10
|
-
import { Button, ButtonProps } from "@ndla/primitives";
|
|
10
|
+
import { Button, type ButtonProps } from "@ndla/primitives";
|
|
11
11
|
|
|
12
12
|
// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.
|
|
13
13
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import type { CollectionItem } from "@ark-ui/react";
|
|
11
11
|
import type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps } from "@ndla/primitives";
|
|
12
|
-
import { TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
12
|
+
import { type TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
13
13
|
|
|
14
14
|
type DeepPartial<T> = {
|
|
15
15
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
package/src/index.ts
CHANGED
|
@@ -54,8 +54,6 @@ export {
|
|
|
54
54
|
|
|
55
55
|
export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
|
|
56
56
|
|
|
57
|
-
export { default as ContentLoader } from "./ContentLoader";
|
|
58
|
-
|
|
59
57
|
export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
|
|
60
58
|
|
|
61
59
|
export { ErrorResourceAccessDenied, default as ErrorMessage } from "./ErrorMessage";
|
|
@@ -94,22 +92,8 @@ export {
|
|
|
94
92
|
useVideoSearchTranslations,
|
|
95
93
|
} from "./i18n";
|
|
96
94
|
|
|
97
|
-
export {
|
|
98
|
-
|
|
99
|
-
SubjectMaterialBadge,
|
|
100
|
-
TasksAndActivitiesBadge,
|
|
101
|
-
AssessmentResourcesBadge,
|
|
102
|
-
LearningPathBadge,
|
|
103
|
-
SubjectBadge,
|
|
104
|
-
SourceMaterialBadge,
|
|
105
|
-
ConceptBadge,
|
|
106
|
-
} from "./ContentTypeBadge";
|
|
107
|
-
|
|
108
|
-
export type { ContentTypeBadgeProps, StrictContentType, ContentType } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
109
|
-
export {
|
|
110
|
-
ContentTypeBadge as ContentTypeBadgeNew,
|
|
111
|
-
contentTypeToBadgeVariantMap,
|
|
112
|
-
} from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
95
|
+
export type { ContentTypeBadgeProps, StrictContentType, ContentType } from "./ContentTypeBadge/ContentTypeBadge";
|
|
96
|
+
export { ContentTypeBadge, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadge";
|
|
113
97
|
|
|
114
98
|
export { ContentTypeBlockQuote } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
|
|
115
99
|
export { type ContentTypeBlockQuoteVariant } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
|
package/src/model/ContentType.ts
CHANGED
|
@@ -24,6 +24,7 @@ export const PODCAST = "podcast";
|
|
|
24
24
|
export const GLOSS = "gloss";
|
|
25
25
|
export const PROGRAMME = "programme";
|
|
26
26
|
export const PODCAST_SERIES = "podcast-series";
|
|
27
|
+
export const FRONTPAGE_ARTICLE = "frontpage-article";
|
|
27
28
|
|
|
28
29
|
export const contentTypes = {
|
|
29
30
|
SUBJECT_MATERIAL,
|
|
@@ -57,6 +58,7 @@ export const contentTypeMapping: Record<string, string> = {
|
|
|
57
58
|
[RESOURCE_TYPE_CONCEPT]: CONCEPT,
|
|
58
59
|
[MULTIDISCIPLINARY]: MULTIDISCIPLINARY,
|
|
59
60
|
[TOPIC]: TOPIC,
|
|
61
|
+
[FRONTPAGE_ARTICLE]: FRONTPAGE_ARTICLE,
|
|
60
62
|
default: SUBJECT_MATERIAL,
|
|
61
63
|
};
|
|
62
64
|
|