@ndla/ui 56.0.172-alpha.0 → 56.0.174-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/es/AnchorHeading/AnchorHeading.mjs +1 -1
- package/es/AnchorHeading/AnchorHeading.mjs.map +1 -1
- package/es/Article/Article.mjs +1 -8
- package/es/Article/Article.mjs.map +1 -1
- package/es/Article/ArticleByline.mjs +1 -1
- package/es/Article/ArticleByline.mjs.map +1 -1
- package/es/AudioPlayer/AudioPlayer.mjs +1 -1
- package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
- package/es/AudioPlayer/Controls.mjs +1 -1
- package/es/AudioPlayer/Controls.mjs.map +1 -1
- package/es/AudioPlayer/SpeechControl.mjs +1 -1
- package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
- package/es/Breadcrumb/Breadcrumb.mjs +8 -1
- package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs +8 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs.map +1 -1
- package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
- package/es/CampaignBlock/CampaignBlock.mjs +1 -8
- package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
- package/es/CodeBlock/CodeBlock.mjs +1 -8
- package/es/CodeBlock/CodeBlock.mjs.map +1 -1
- package/es/Concept/Concept.mjs +1 -8
- package/es/Concept/Concept.mjs.map +1 -1
- package/es/ContactBlock/ContactBlock.mjs +0 -7
- package/es/ContactBlock/ContactBlock.mjs.map +1 -1
- package/es/Embed/AudioEmbed.mjs +1 -8
- package/es/Embed/AudioEmbed.mjs.map +1 -1
- package/es/Embed/BrightcoveEmbed.mjs +2 -9
- package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
- package/es/Embed/CodeEmbed.mjs +1 -8
- package/es/Embed/CodeEmbed.mjs.map +1 -1
- package/es/Embed/ConceptEmbed.mjs +1 -8
- package/es/Embed/ConceptEmbed.mjs.map +1 -1
- package/es/Embed/ContentLinkEmbed.mjs.map +1 -1
- package/es/Embed/CopyrightEmbed.mjs.map +1 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs +8 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs.map +1 -1
- package/es/Embed/EmbedWrapper.mjs +1 -8
- package/es/Embed/EmbedWrapper.mjs.map +1 -1
- package/es/Embed/ExternalEmbed.mjs +1 -8
- package/es/Embed/ExternalEmbed.mjs.map +1 -1
- package/es/Embed/FootnoteEmbed.mjs +0 -7
- package/es/Embed/FootnoteEmbed.mjs.map +1 -1
- package/es/Embed/GlossEmbed.mjs +1 -8
- package/es/Embed/GlossEmbed.mjs.map +1 -1
- package/es/Embed/H5pEmbed.mjs +0 -7
- package/es/Embed/H5pEmbed.mjs.map +1 -1
- package/es/Embed/IframeEmbed.mjs +2 -9
- package/es/Embed/IframeEmbed.mjs.map +1 -1
- package/es/Embed/ImageEmbed.mjs +2 -9
- package/es/Embed/ImageEmbed.mjs.map +1 -1
- package/es/Embed/InlineTriggerButton.mjs +1 -1
- package/es/Embed/InlineTriggerButton.mjs.map +1 -1
- package/es/Embed/RelatedContentEmbed.mjs +0 -7
- package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
- package/es/Embed/UnknownEmbed.mjs +0 -7
- package/es/Embed/UnknownEmbed.mjs.map +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs.map +1 -1
- package/es/FactBox/FactBox.mjs +1 -1
- package/es/FactBox/FactBox.mjs.map +1 -1
- package/es/FileList/File.mjs +1 -1
- package/es/FileList/File.mjs.map +1 -1
- package/es/FileList/FileList.mjs +8 -1
- package/es/FileList/FileList.mjs.map +1 -1
- package/es/Gloss/Gloss.mjs +1 -8
- package/es/Gloss/Gloss.mjs.map +1 -1
- package/es/Gloss/GlossExample.mjs +1 -8
- package/es/Gloss/GlossExample.mjs.map +1 -1
- package/es/Grid/Grid.mjs +1 -1
- package/es/Grid/Grid.mjs.map +1 -1
- package/es/KeyFigure/KeyFigure.mjs.map +1 -1
- package/es/LicenseByline/EmbedByline.mjs +1 -8
- package/es/LicenseByline/EmbedByline.mjs.map +1 -1
- package/es/LicenseByline/LicenseLink.mjs +1 -8
- package/es/LicenseByline/LicenseLink.mjs.map +1 -1
- package/es/LinkBlock/LinkBlock.mjs +1 -8
- package/es/LinkBlock/LinkBlock.mjs.map +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
- package/es/Pitch/Pitch.mjs.map +1 -1
- package/es/RelatedArticleList/RelatedArticleList.mjs +1 -1
- package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
- package/es/TagSelector/TagSelector.mjs +1 -1
- package/es/TagSelector/TagSelector.mjs.map +1 -1
- package/es/ZendeskButton/ZendeskButton.mjs +1 -1
- package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
- package/es/i18n/useComponentTranslations.mjs +0 -7
- package/es/i18n/useComponentTranslations.mjs.map +1 -1
- package/es/model/ContentType.mjs +8 -1
- package/es/model/ContentType.mjs.map +1 -1
- package/lib/AnchorHeading/AnchorHeading.js +1 -1
- package/lib/AnchorHeading/AnchorHeading.js.map +1 -1
- package/lib/Article/Article.d.ts +1 -1
- package/lib/Article/Article.js +1 -8
- package/lib/Article/Article.js.map +1 -1
- package/lib/Article/ArticleByline.d.ts +1 -1
- package/lib/Article/ArticleByline.js +1 -1
- package/lib/Article/ArticleByline.js.map +1 -1
- package/lib/AudioPlayer/AudioPlayer.js +1 -1
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
- package/lib/AudioPlayer/Controls.js +1 -1
- package/lib/AudioPlayer/Controls.js.map +1 -1
- package/lib/AudioPlayer/SpeechControl.js +1 -1
- package/lib/AudioPlayer/SpeechControl.js.map +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
- package/lib/CampaignBlock/CampaignBlock.js +1 -8
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
- package/lib/CodeBlock/CodeBlock.d.ts +1 -1
- package/lib/CodeBlock/CodeBlock.js +1 -8
- package/lib/CodeBlock/CodeBlock.js.map +1 -1
- package/lib/Concept/Concept.d.ts +1 -1
- package/lib/Concept/Concept.js +1 -8
- package/lib/Concept/Concept.js.map +1 -1
- package/lib/ContactBlock/ContactBlock.js +0 -7
- package/lib/ContactBlock/ContactBlock.js.map +1 -1
- package/lib/Embed/AudioEmbed.js +1 -8
- package/lib/Embed/AudioEmbed.js.map +1 -1
- package/lib/Embed/BrightcoveEmbed.js +2 -9
- package/lib/Embed/BrightcoveEmbed.js.map +1 -1
- package/lib/Embed/CodeEmbed.js +1 -8
- package/lib/Embed/CodeEmbed.js.map +1 -1
- package/lib/Embed/ConceptEmbed.d.ts +1 -1
- package/lib/Embed/ConceptEmbed.js +1 -8
- package/lib/Embed/ConceptEmbed.js.map +1 -1
- package/lib/Embed/ContentLinkEmbed.d.ts +1 -1
- package/lib/Embed/ContentLinkEmbed.js.map +1 -1
- package/lib/Embed/CopyrightEmbed.d.ts +1 -1
- package/lib/Embed/CopyrightEmbed.js.map +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.d.ts +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.js +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
- package/lib/Embed/EmbedWrapper.d.ts +1 -1
- package/lib/Embed/EmbedWrapper.js +1 -8
- package/lib/Embed/EmbedWrapper.js.map +1 -1
- package/lib/Embed/ExternalEmbed.js +1 -8
- package/lib/Embed/ExternalEmbed.js.map +1 -1
- package/lib/Embed/FootnoteEmbed.js +0 -7
- package/lib/Embed/FootnoteEmbed.js.map +1 -1
- package/lib/Embed/GlossEmbed.d.ts +1 -1
- package/lib/Embed/GlossEmbed.js +1 -8
- package/lib/Embed/GlossEmbed.js.map +1 -1
- package/lib/Embed/H5pEmbed.js +0 -7
- package/lib/Embed/H5pEmbed.js.map +1 -1
- package/lib/Embed/IframeEmbed.js +2 -9
- package/lib/Embed/IframeEmbed.js.map +1 -1
- package/lib/Embed/ImageEmbed.d.ts +1 -1
- package/lib/Embed/ImageEmbed.js +2 -9
- package/lib/Embed/ImageEmbed.js.map +1 -1
- package/lib/Embed/InlineTriggerButton.js +1 -1
- package/lib/Embed/InlineTriggerButton.js.map +1 -1
- package/lib/Embed/RelatedContentEmbed.js +0 -7
- package/lib/Embed/RelatedContentEmbed.js.map +1 -1
- package/lib/Embed/UnknownEmbed.js +0 -7
- package/lib/Embed/UnknownEmbed.js.map +1 -1
- package/lib/Embed/UuDisclaimerEmbed.d.ts +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js +1 -8
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -1
- package/lib/Embed/types.d.ts +1 -1
- package/lib/FactBox/FactBox.js +2 -2
- package/lib/FactBox/FactBox.js.map +1 -1
- package/lib/FileList/File.js +1 -1
- package/lib/FileList/File.js.map +1 -1
- package/lib/FileList/FileList.js +1 -1
- package/lib/FileList/FileList.js.map +1 -1
- package/lib/Gloss/Gloss.js +1 -8
- package/lib/Gloss/Gloss.js.map +1 -1
- package/lib/Gloss/GlossExample.js +1 -8
- package/lib/Gloss/GlossExample.js.map +1 -1
- package/lib/Grid/Grid.d.ts +1 -1
- package/lib/Grid/Grid.js +1 -8
- package/lib/Grid/Grid.js.map +1 -1
- package/lib/KeyFigure/KeyFigure.js.map +1 -1
- package/lib/LicenseByline/EmbedByline.d.ts +1 -1
- package/lib/LicenseByline/EmbedByline.js +1 -8
- package/lib/LicenseByline/EmbedByline.js.map +1 -1
- package/lib/LicenseByline/LicenseLink.js +1 -8
- package/lib/LicenseByline/LicenseLink.js.map +1 -1
- package/lib/LinkBlock/LinkBlock.js +1 -8
- package/lib/LinkBlock/LinkBlock.js.map +1 -1
- package/lib/LinkBlock/LinkBlockSection.js +1 -1
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
- package/lib/Pitch/Pitch.js.map +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
- package/lib/TagSelector/TagSelector.js +1 -1
- package/lib/TagSelector/TagSelector.js.map +1 -1
- package/lib/ZendeskButton/ZendeskButton.js +1 -1
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
- package/lib/i18n/useComponentTranslations.js +0 -7
- package/lib/i18n/useComponentTranslations.js.map +1 -1
- package/lib/model/ContentType.d.ts +5 -0
- package/lib/model/ContentType.js +8 -1
- package/lib/model/ContentType.js.map +1 -1
- package/lib/model/index.d.ts +2 -0
- package/package.json +9 -9
- package/src/AnchorHeading/AnchorHeading.tsx +1 -1
- package/src/Article/Article.tsx +2 -2
- package/src/Article/ArticleByline.stories.tsx +0 -1
- package/src/Article/ArticleByline.tsx +3 -3
- package/src/AudioPlayer/AudioPlayer.tsx +2 -2
- package/src/AudioPlayer/Controls.tsx +2 -2
- package/src/AudioPlayer/SpeechControl.tsx +2 -2
- package/src/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/Breadcrumb/BreadcrumbItem.tsx +1 -1
- package/src/Breadcrumb/HomeBreadcrumb.tsx +1 -1
- package/src/CampaignBlock/CampaignBlock.tsx +3 -3
- package/src/CodeBlock/CodeBlock.tsx +2 -2
- package/src/Concept/Concept.stories.tsx +1 -1
- package/src/Concept/Concept.tsx +3 -3
- package/src/ContactBlock/ContactBlock.tsx +3 -3
- 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 +4 -4
- package/src/Embed/CodeEmbed.stories.tsx +1 -1
- package/src/Embed/CodeEmbed.tsx +4 -4
- package/src/Embed/ConceptEmbed.stories.tsx +2 -2
- package/src/Embed/ConceptEmbed.tsx +5 -5
- package/src/Embed/ContentLinkEmbed.tsx +2 -2
- package/src/Embed/CopyrightEmbed.tsx +1 -1
- package/src/Embed/EmbedErrorPlaceholder.tsx +1 -1
- package/src/Embed/EmbedWrapper.tsx +2 -2
- package/src/Embed/ExternalEmbed.stories.tsx +2 -2
- package/src/Embed/ExternalEmbed.tsx +4 -4
- package/src/Embed/FootnoteEmbed.stories.tsx +2 -2
- package/src/Embed/FootnoteEmbed.tsx +2 -2
- package/src/Embed/GlossEmbed.stories.tsx +2 -2
- package/src/Embed/GlossEmbed.tsx +3 -3
- package/src/Embed/H5pEmbed.stories.tsx +2 -2
- package/src/Embed/H5pEmbed.tsx +2 -2
- package/src/Embed/IframeEmbed.stories.tsx +2 -2
- package/src/Embed/IframeEmbed.tsx +5 -5
- 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 +2 -2
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +4 -4
- package/src/Embed/UuDisclaimerEmbed.tsx +3 -3
- package/src/Embed/types.ts +1 -1
- package/src/FactBox/FactBox.tsx +3 -3
- package/src/FileList/File.tsx +2 -2
- package/src/FileList/FileList.tsx +1 -1
- package/src/Gloss/Gloss.stories.tsx +1 -1
- package/src/Gloss/Gloss.tsx +6 -6
- package/src/Gloss/GlossExample.tsx +2 -2
- package/src/Grid/Grid.stories.tsx +1 -1
- package/src/Grid/Grid.tsx +2 -2
- package/src/KeyFigure/KeyFigure.tsx +1 -1
- package/src/LicenseByline/EmbedByline.tsx +6 -6
- package/src/LicenseByline/LicenseLink.tsx +1 -1
- package/src/LinkBlock/LinkBlock.tsx +3 -3
- package/src/LinkBlock/LinkBlockSection.tsx +1 -1
- package/src/Pitch/Pitch.stories.tsx +1 -1
- package/src/Pitch/Pitch.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleList.tsx +2 -2
- package/src/TagSelector/TagSelector.stories.tsx +3 -4
- package/src/TagSelector/TagSelector.tsx +1 -1
- package/src/ZendeskButton/ZendeskButton.tsx +1 -1
- package/src/i18n/useComponentTranslations.ts +2 -2
- package/src/model/ContentType.ts +7 -0
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
+
import type { OembedMetaData } from "@ndla/types-embed";
|
|
11
10
|
import { Figure } from "@ndla/primitives";
|
|
12
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
12
|
+
import { useEffect, useRef } from "react";
|
|
13
|
+
import { useTranslation } from "react-i18next";
|
|
15
14
|
import { ResourceBox } from "../ResourceBox/ResourceBox";
|
|
15
|
+
import { EmbedErrorPlaceholder } from "./EmbedErrorPlaceholder";
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
18
18
|
embed: OembedMetaData;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
10
9
|
import type { FootnoteData, FootnoteEmbedData } from "@ndla/types-embed";
|
|
11
|
-
import {
|
|
10
|
+
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
12
11
|
import { ArticleByline } from "../Article/ArticleByline";
|
|
12
|
+
import { FootnoteEmbed } from "./FootnoteEmbed";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Kildehenvisninger benytter [APA-stilen](https://sokogskriv.no/kildebruk-og-referanser/referansestiler/apa-6th/) for utlistning nederst på siden.
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
11
9
|
import type { FootnoteMetaData } from "@ndla/types-embed";
|
|
10
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
+
import { useTranslation } from "react-i18next";
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
14
14
|
embed: FootnoteMetaData;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
9
|
import type { ConceptData, ConceptEmbedData } from "@ndla/types-embed";
|
|
11
|
-
import {
|
|
10
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
12
11
|
import { wordClass } from "../model/WordClass";
|
|
12
|
+
import { GlossEmbed } from "./GlossEmbed";
|
|
13
13
|
|
|
14
14
|
const glossBlockEmbedData: ConceptEmbedData = {
|
|
15
15
|
contentId: "4942",
|
package/src/Embed/GlossEmbed.tsx
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type { ConceptMetaData } from "@ndla/types-embed";
|
|
10
10
|
import { Portal } from "@ark-ui/react";
|
|
11
11
|
import { Figure, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import type
|
|
13
|
+
import { useRef, type ReactNode } from "react";
|
|
14
|
+
import { Gloss } from "../Gloss/Gloss";
|
|
14
15
|
import { ConceptInlineTriggerButton } from "./ConceptInlineTriggerButton";
|
|
15
16
|
import { EmbedErrorPlaceholder } from "./EmbedErrorPlaceholder";
|
|
16
|
-
import { Gloss } from "../Gloss/Gloss";
|
|
17
17
|
|
|
18
18
|
interface Props {
|
|
19
19
|
embed: ConceptMetaData;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { H5pEmbedData, H5pData } from "@ndla/types-embed";
|
|
9
10
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
11
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import type { H5pEmbedData, H5pData } from "@ndla/types-embed";
|
|
12
|
-
import { H5pEmbed } from "./H5pEmbed";
|
|
13
12
|
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
13
|
+
import { H5pEmbed } from "./H5pEmbed";
|
|
14
14
|
|
|
15
15
|
const embedData: H5pEmbedData = {
|
|
16
16
|
resource: "h5p",
|
package/src/Embed/H5pEmbed.tsx
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type { H5pMetaData } from "@ndla/types-embed";
|
|
10
10
|
import { Figure } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import
|
|
12
|
+
import { useTranslation } from "react-i18next";
|
|
13
13
|
import { EmbedErrorPlaceholder } from "./EmbedErrorPlaceholder";
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { IframeData, IframeEmbedData } from "@ndla/types-embed";
|
|
9
10
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
11
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import type { IframeData, IframeEmbedData } from "@ndla/types-embed";
|
|
12
|
-
import { IframeEmbed } from "./IframeEmbed";
|
|
13
12
|
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
13
|
+
import { IframeEmbed } from "./IframeEmbed";
|
|
14
14
|
|
|
15
15
|
const embedData: IframeEmbedData = {
|
|
16
16
|
width: "708px",
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
+
import type { IframeMetaData } from "@ndla/types-embed";
|
|
11
10
|
import { Figure } from "@ndla/primitives";
|
|
12
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
12
|
+
import { useEffect, useRef } from "react";
|
|
13
|
+
import { useTranslation } from "react-i18next";
|
|
15
14
|
import { ResourceBox } from "../ResourceBox/ResourceBox";
|
|
15
|
+
import { EmbedErrorPlaceholder } from "./EmbedErrorPlaceholder";
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
18
18
|
embed: IframeMetaData;
|
|
@@ -83,7 +83,7 @@ export const IframeEmbed = ({ embed }: Props) => {
|
|
|
83
83
|
src={url}
|
|
84
84
|
width={strippedWidth}
|
|
85
85
|
height={strippedHeight}
|
|
86
|
-
allow="
|
|
86
|
+
allow="autoplay; encrypted-media; fullscreen"
|
|
87
87
|
loading="lazy"
|
|
88
88
|
/>
|
|
89
89
|
</StyledFigure>
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { ImageMetaInformationV3DTO } from "@ndla/types-backend/image-api";
|
|
10
|
+
import type { ImageEmbedData } from "@ndla/types-embed";
|
|
10
11
|
import type { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
12
|
+
import type { ReactNode } from "react";
|
|
11
13
|
import { PageContent, Text } from "@ndla/primitives";
|
|
12
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import type { ImageMetaInformationV3DTO } from "@ndla/types-backend/image-api";
|
|
14
|
-
import type { ImageEmbedData } from "@ndla/types-embed";
|
|
15
|
-
import { ImageEmbed } from "./ImageEmbed";
|
|
16
15
|
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
17
16
|
import { Grid } from "../Grid/Grid";
|
|
17
|
+
import { ImageEmbed } from "./ImageEmbed";
|
|
18
18
|
|
|
19
19
|
const embedData: ImageEmbedData = {
|
|
20
20
|
resource: "image",
|
package/src/Embed/ImageEmbed.tsx
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { type ReactNode, useMemo, useState } from "react";
|
|
11
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
+
import type { ImageEmbedData, ImageMetaData } from "@ndla/types-embed";
|
|
12
10
|
import { AddLine } from "@ndla/icons";
|
|
13
11
|
import { Figure, type FigureSize, type FigureVariantProps, Image } from "@ndla/primitives";
|
|
14
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
13
|
+
import parse from "html-react-parser";
|
|
14
|
+
import { type ReactNode, useMemo, useState } from "react";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
17
16
|
import type { RenderContext } from "./types";
|
|
18
17
|
import { EmbedByline } from "../LicenseByline/EmbedByline";
|
|
19
18
|
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
19
|
+
import { EmbedErrorPlaceholder } from "./EmbedErrorPlaceholder";
|
|
20
20
|
|
|
21
21
|
interface Props {
|
|
22
22
|
embed: ImageMetaData;
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { type ComponentPropsWithRef, type KeyboardEvent, forwardRef, useCallback, useRef } from "react";
|
|
10
9
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
10
|
import { composeRefs } from "@ndla/util";
|
|
11
|
+
import { type ComponentPropsWithRef, type KeyboardEvent, forwardRef, useCallback, useRef } from "react";
|
|
12
12
|
|
|
13
13
|
const StyledSpan = styled("span", { base: {} });
|
|
14
14
|
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { RelatedContentMetaData } from "@ndla/types-embed";
|
|
9
10
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
11
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import type { RelatedContentMetaData } from "@ndla/types-embed";
|
|
12
|
-
import { RelatedContentEmbed } from "./RelatedContentEmbed";
|
|
13
12
|
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
14
13
|
import { RelatedArticleList } from "../RelatedArticleList/RelatedArticleList";
|
|
14
|
+
import { RelatedContentEmbed } from "./RelatedContentEmbed";
|
|
15
15
|
|
|
16
16
|
const filmResourceMeta: RelatedContentMetaData = {
|
|
17
17
|
resource: "related-content",
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
9
|
import type { RelatedContentMetaData } from "@ndla/types-embed";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
11
|
import { RelatedArticle } from "../RelatedArticleList/RelatedArticleList";
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { Text } from "@ndla/primitives";
|
|
11
9
|
import type { MetaData } from "@ndla/types-embed";
|
|
10
|
+
import { Text } from "@ndla/primitives";
|
|
11
|
+
import { useTranslation } from "react-i18next";
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
14
14
|
embed: MetaData<any, any>;
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { UUDisclaimerData, UuDisclaimerEmbedData } from "@ndla/types-embed";
|
|
9
10
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
10
11
|
import { ExpandableBox, ExpandableBoxSummary, FramedContent, PageContent } from "@ndla/primitives";
|
|
11
|
-
import
|
|
12
|
+
import { AnchorHeading } from "../AnchorHeading/AnchorHeading";
|
|
13
|
+
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
14
|
+
import { FactBox } from "../FactBox/FactBox";
|
|
12
15
|
import { H5pEmbed } from "./H5pEmbed";
|
|
13
16
|
import { IframeEmbed } from "./IframeEmbed";
|
|
14
17
|
import { UuDisclaimerEmbed } from "./UuDisclaimerEmbed";
|
|
15
|
-
import { ArticleWrapper, ArticleContent } from "../Article/Article";
|
|
16
|
-
import { AnchorHeading } from "../AnchorHeading/AnchorHeading";
|
|
17
|
-
import { FactBox } from "../FactBox/FactBox";
|
|
18
18
|
|
|
19
19
|
const embedData: UuDisclaimerEmbedData = {
|
|
20
20
|
resource: "uu-disclaimer",
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
+
import type { UuDisclaimerMetaData } from "@ndla/types-embed";
|
|
11
10
|
import { Portal } from "@ark-ui/react";
|
|
12
11
|
import { AccessibilityFill, ErrorWarningFill } from "@ndla/icons";
|
|
13
12
|
import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
14
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
-
import type
|
|
14
|
+
import { type ReactNode } from "react";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
18
18
|
embed: UuDisclaimerMetaData;
|
package/src/Embed/types.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { ElementType } from "react";
|
|
10
9
|
import type { ImageMetaInformationV3DTO } from "@ndla/types-backend/image-api";
|
|
11
10
|
import type { EmbedMetaData } from "@ndla/types-embed";
|
|
11
|
+
import type { ElementType } from "react";
|
|
12
12
|
|
|
13
13
|
export type HeartButtonType = ElementType<{
|
|
14
14
|
embed: Extract<EmbedMetaData, { status: "success" }>;
|
package/src/FactBox/FactBox.tsx
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { ArrowDownShortLine } from "@ndla/icons";
|
|
10
|
+
import { IconButton } from "@ndla/primitives";
|
|
11
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
9
12
|
import React, {
|
|
10
13
|
type ComponentProps,
|
|
11
14
|
type ReactNode,
|
|
@@ -17,9 +20,6 @@ import React, {
|
|
|
17
20
|
useState,
|
|
18
21
|
} from "react";
|
|
19
22
|
import { useTranslation } from "react-i18next";
|
|
20
|
-
import { ArrowDownShortLine } from "@ndla/icons";
|
|
21
|
-
import { IconButton } from "@ndla/primitives";
|
|
22
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
23
23
|
|
|
24
24
|
interface Props extends ComponentProps<"aside"> {
|
|
25
25
|
children?: ReactNode;
|
package/src/FileList/File.tsx
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { type ComponentPropsWithRef, forwardRef } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
9
|
import { DownloadLine } from "@ndla/icons";
|
|
12
10
|
import { Text } from "@ndla/primitives";
|
|
13
11
|
import { SafeLink } from "@ndla/safelink";
|
|
14
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
13
|
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
14
|
+
import { type ComponentPropsWithRef, forwardRef } from "react";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
16
|
import { FileListItem } from "./FileList";
|
|
17
17
|
|
|
18
18
|
export interface FileProps extends ComponentPropsWithRef<"div"> {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { type ComponentPropsWithoutRef } from "react";
|
|
10
9
|
import { ark } from "@ark-ui/react";
|
|
11
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
12
12
|
|
|
13
13
|
interface Props extends ComponentPropsWithoutRef<"ul"> {}
|
|
14
14
|
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { Meta, StoryObj, StoryFn } from "@storybook/react";
|
|
10
|
+
import { wordClass } from "../model/WordClass";
|
|
10
11
|
import { Gloss } from "./Gloss";
|
|
11
12
|
import { GlossExample } from "./GlossExample";
|
|
12
|
-
import { wordClass } from "../model/WordClass";
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof Gloss> = {
|
|
15
15
|
title: "Components/Gloss",
|
package/src/Gloss/Gloss.tsx
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
+
import type { StyledVariantProps } from "@ndla/styled-system/types";
|
|
10
|
+
import type { ConceptTitleDTO, GlossDataDTO, GlossExampleDTO } from "@ndla/types-backend/concept-api";
|
|
12
11
|
import { AccordionItemTrigger } from "@ark-ui/react";
|
|
13
12
|
import { ArrowDownShortLine } from "@ndla/icons";
|
|
14
13
|
import {
|
|
@@ -20,10 +19,11 @@ import {
|
|
|
20
19
|
Text,
|
|
21
20
|
} from "@ndla/primitives";
|
|
22
21
|
import { styled } from "@ndla/styled-system/jsx";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
22
|
+
import parse from "html-react-parser";
|
|
23
|
+
import { useMemo } from "react";
|
|
24
|
+
import { useTranslation } from "react-i18next";
|
|
26
25
|
import { SpeechControl } from "../AudioPlayer/SpeechControl";
|
|
26
|
+
import { GlossExample } from "./GlossExample";
|
|
27
27
|
|
|
28
28
|
// TODO: Figure out padding between bordered and simple variant.
|
|
29
29
|
// The design says that the content above the accordion content should have enough padding to align with the accordion content.
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type { GlossExampleDTO } from "@ndla/types-backend/concept-api";
|
|
10
10
|
import { Text } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import
|
|
12
|
+
import { Fragment } from "react";
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
examples: GlossExampleDTO[];
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
import type { Meta, StoryFn } from "@storybook/react";
|
|
10
10
|
import { PageContent } from "@ndla/primitives";
|
|
11
11
|
import { ArticleContent, ArticleWrapper } from "@ndla/ui";
|
|
12
|
-
import { Grid, GridItem } from "./Grid";
|
|
13
12
|
import { Plain } from "../KeyFigure/KeyFigure.stories";
|
|
14
13
|
import { Default as PitchStory } from "../Pitch/Pitch.stories";
|
|
14
|
+
import { Grid, GridItem } from "./Grid";
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: "Components/Grid",
|
package/src/Grid/Grid.tsx
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { type ComponentProps, type ReactNode } from "react";
|
|
10
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
11
9
|
import type { StyledVariantProps } from "@ndla/styled-system/types";
|
|
10
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
12
12
|
|
|
13
13
|
const GridContainer = styled("div", {
|
|
14
14
|
base: {
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { type Dispatch, type ReactNode, type SetStateAction, useState } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { AlertLine } from "@ndla/icons";
|
|
12
|
-
import { getLicenseByAbbreviation } from "@ndla/licenses";
|
|
13
|
-
import { Button, Text } from "@ndla/primitives";
|
|
14
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
15
9
|
import type { CopyrightDTO as ArticleCopyright } from "@ndla/types-backend/article-api";
|
|
16
10
|
import type { CopyrightDTO as AudioCopyright } from "@ndla/types-backend/audio-api";
|
|
17
11
|
import type { DraftCopyrightDTO as ConceptCopyright } from "@ndla/types-backend/concept-api";
|
|
18
12
|
import type { CopyrightDTO as ImageCopyright } from "@ndla/types-backend/image-api";
|
|
19
13
|
import type { BrightcoveCopyright } from "@ndla/types-embed";
|
|
14
|
+
import { AlertLine } from "@ndla/icons";
|
|
15
|
+
import { getLicenseByAbbreviation } from "@ndla/licenses";
|
|
16
|
+
import { Button, Text } from "@ndla/primitives";
|
|
17
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
18
|
+
import { type Dispatch, type ReactNode, type SetStateAction, useState } from "react";
|
|
19
|
+
import { useTranslation } from "react-i18next";
|
|
20
20
|
import { LicenseLink } from "./LicenseLink";
|
|
21
21
|
|
|
22
22
|
interface BaseProps {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { forwardRef } from "react";
|
|
10
9
|
import type { LicenseLocaleType } from "@ndla/licenses";
|
|
11
10
|
import { SafeLink, type SafeLinkProps } from "@ndla/safelink";
|
|
12
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
+
import { forwardRef } from "react";
|
|
13
13
|
|
|
14
14
|
interface Props extends Omit<SafeLinkProps, "to"> {
|
|
15
15
|
license: LicenseLocaleType;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import { useMemo } from "react";
|
|
9
|
+
import type { LinkBlockEmbedData } from "@ndla/types-embed";
|
|
11
10
|
import { ArrowRightLine, CalendarLine } from "@ndla/icons";
|
|
12
11
|
import { Heading } from "@ndla/primitives";
|
|
13
12
|
import { SafeLink } from "@ndla/safelink";
|
|
14
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
-
import
|
|
14
|
+
import parse from "html-react-parser";
|
|
15
|
+
import { useMemo } from "react";
|
|
16
16
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
17
17
|
|
|
18
18
|
const InfoWrapper = styled("div", {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Children, type HTMLAttributes, type ReactNode } from "react";
|
|
10
9
|
import { styled } from "@ndla/styled-system/jsx";
|
|
10
|
+
import { Children, type HTMLAttributes, type ReactNode } from "react";
|
|
11
11
|
|
|
12
12
|
interface Props extends HTMLAttributes<HTMLElement> {
|
|
13
13
|
children: ReactNode;
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import type { Meta } from "@storybook/react";
|
|
10
10
|
import { PageContent } from "@ndla/primitives";
|
|
11
|
-
import { Pitch, type Props } from "./Pitch";
|
|
12
11
|
import { ArticleContent, ArticleWrapper } from "../Article/Article";
|
|
13
12
|
import { Grid } from "../Grid/Grid";
|
|
13
|
+
import { Pitch, type Props } from "./Pitch";
|
|
14
14
|
|
|
15
15
|
const args: Props = {
|
|
16
16
|
title: "Min pitch",
|
package/src/Pitch/Pitch.tsx
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import parse from "html-react-parser";
|
|
10
9
|
import { CardHeading, CardImage, CardRoot, Text } from "@ndla/primitives";
|
|
11
10
|
import { SafeLink } from "@ndla/safelink";
|
|
12
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
12
|
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
13
|
+
import parse from "html-react-parser";
|
|
14
14
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
15
15
|
|
|
16
16
|
export interface Props {
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
9
|
import { ExternalLinkLine } from "@ndla/icons";
|
|
12
10
|
import { CardContent, CardHeading, CardRoot, Text, Heading, Button } from "@ndla/primitives";
|
|
13
11
|
import { SafeLink } from "@ndla/safelink";
|
|
14
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
13
|
import { linkOverlay } from "@ndla/styled-system/patterns";
|
|
14
|
+
import { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from "react";
|
|
15
|
+
import { useTranslation } from "react-i18next";
|
|
16
16
|
import type { HeadingLevel } from "../types";
|
|
17
17
|
|
|
18
18
|
interface RelatedArticleProps {
|
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useState } from "react";
|
|
10
|
-
import { type ComboboxInputValueChangeDetails, createListCollection } from "@ark-ui/react";
|
|
11
|
-
|
|
12
9
|
import type { Meta, StoryFn } from "@storybook/react";
|
|
10
|
+
import { type ComboboxInputValueChangeDetails, createListCollection } from "@ark-ui/react";
|
|
13
11
|
import { CloseLine, ArrowDownShortLine, CheckLine } from "@ndla/icons";
|
|
14
12
|
import {
|
|
15
13
|
ComboboxContent,
|
|
@@ -21,6 +19,8 @@ import {
|
|
|
21
19
|
InputContainer,
|
|
22
20
|
} from "@ndla/primitives";
|
|
23
21
|
import { HStack } from "@ndla/styled-system/jsx";
|
|
22
|
+
import { useState } from "react";
|
|
23
|
+
import { useTagSelectorTranslations } from "../i18n/useComponentTranslations";
|
|
24
24
|
import {
|
|
25
25
|
TagSelectorClearTrigger,
|
|
26
26
|
TagSelectorControl,
|
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
TagSelectorRoot,
|
|
30
30
|
TagSelectorTrigger,
|
|
31
31
|
} from "./TagSelector";
|
|
32
|
-
import { useTagSelectorTranslations } from "../i18n/useComponentTranslations";
|
|
33
32
|
|
|
34
33
|
export default {
|
|
35
34
|
title: "Components/TagSelector",
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { forwardRef, useEffect, useId, useRef } from "react";
|
|
10
9
|
import { type CollectionItem, useTagsInputContext, useComboboxContext } from "@ark-ui/react";
|
|
11
10
|
import { CloseLine } from "@ndla/icons";
|
|
12
11
|
import {
|
|
@@ -32,6 +31,7 @@ import {
|
|
|
32
31
|
TagsInputItemInput,
|
|
33
32
|
} from "@ndla/primitives";
|
|
34
33
|
import { contains } from "@ndla/util";
|
|
34
|
+
import { forwardRef, useEffect, useId, useRef } from "react";
|
|
35
35
|
|
|
36
36
|
export type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;
|
|
37
37
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { forwardRef, useState } from "react";
|
|
10
9
|
import { Button, type ButtonProps } from "@ndla/primitives";
|
|
10
|
+
import { forwardRef, useState } from "react";
|
|
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
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
9
|
import type { CollectionItem } from "@ark-ui/react";
|
|
11
10
|
import type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from "@ndla/primitives";
|
|
12
|
-
import { type TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
13
11
|
import { useMemo } from "react";
|
|
12
|
+
import { useTranslation } from "react-i18next";
|
|
13
|
+
import { type TagSelectorRootProps } from "../TagSelector/TagSelector";
|
|
14
14
|
|
|
15
15
|
type DeepPartial<T> = {
|
|
16
16
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|