@ndla/ui 56.0.83-alpha.0 → 56.0.85-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.
@@ -49,7 +49,7 @@ const ExternalEmbed = _ref => {
49
49
  } = embed;
50
50
  if (embedData.type === "fullscreen") {
51
51
  const image = {
52
- src: data.iframeImage?.image.imageUrl ?? "",
52
+ src: data.iframeImage?.image.imageUrl,
53
53
  alt: embedData.alt !== undefined ? embedData.alt : data.iframeImage?.alttext?.alttext ?? ""
54
54
  };
55
55
  return /*#__PURE__*/_jsx(Figure, {
@@ -49,7 +49,7 @@ const IframeEmbed = _ref => {
49
49
  const iframeImage = embed.status === "success" ? data.iframeImage : undefined;
50
50
  const alt = embedData.alt !== undefined ? embedData.alt : iframeImage?.alttext.alttext;
51
51
  const image = {
52
- src: iframeImage?.image.imageUrl ?? "",
52
+ src: iframeImage?.image.imageUrl,
53
53
  alt: alt ?? ""
54
54
  };
55
55
  return /*#__PURE__*/_jsx(Figure, {
@@ -6,12 +6,10 @@
6
6
  *
7
7
  */
8
8
 
9
- import { useTranslation } from "react-i18next";
10
9
  import { ark } from "@ark-ui/react";
11
- import { Heading } from "@ndla/primitives";
12
10
  import { styled } from "@ndla/styled-system/jsx";
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- export const FileListWrapper = styled("div", {
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export const FileListWrapper = styled("ul", {
15
13
  base: {
16
14
  display: "flex",
17
15
  flexDirection: "column",
@@ -38,22 +36,9 @@ export const FileListEmbed = _ref => {
38
36
  children,
39
37
  ...rest
40
38
  } = _ref;
41
- const {
42
- t
43
- } = useTranslation();
44
- return /*#__PURE__*/_jsxs(FileListWrapper, {
39
+ return /*#__PURE__*/_jsx(FileListWrapper, {
45
40
  ...rest,
46
41
  "data-embed-type": "file-list",
47
- children: [/*#__PURE__*/_jsx(Heading, {
48
- fontWeight: "bold",
49
- textStyle: "heading.small",
50
- asChild: true,
51
- consumeCss: true,
52
- children: /*#__PURE__*/_jsx("h3", {
53
- children: t("files")
54
- })
55
- }), /*#__PURE__*/_jsx("ul", {
56
- children: children
57
- })]
42
+ children: children
58
43
  });
59
44
  };
@@ -56,7 +56,7 @@ const ExternalEmbed = _ref => {
56
56
  } = embed;
57
57
  if (embedData.type === "fullscreen") {
58
58
  const image = {
59
- src: data.iframeImage?.image.imageUrl ?? "",
59
+ src: data.iframeImage?.image.imageUrl,
60
60
  alt: embedData.alt !== undefined ? embedData.alt : data.iframeImage?.alttext?.alttext ?? ""
61
61
  };
62
62
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Figure, {
@@ -56,7 +56,7 @@ const IframeEmbed = _ref => {
56
56
  const iframeImage = embed.status === "success" ? data.iframeImage : undefined;
57
57
  const alt = embedData.alt !== undefined ? embedData.alt : iframeImage?.alttext.alttext;
58
58
  const image = {
59
- src: iframeImage?.image.imageUrl ?? "",
59
+ src: iframeImage?.image.imageUrl,
60
60
  alt: alt ?? ""
61
61
  };
62
62
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Figure, {
@@ -6,9 +6,9 @@
6
6
  *
7
7
  */
8
8
  import { type ComponentPropsWithoutRef } from "react";
9
- interface Props extends ComponentPropsWithoutRef<"div"> {
9
+ interface Props extends ComponentPropsWithoutRef<"ul"> {
10
10
  }
11
- export declare const FileListWrapper: import("@ndla/styled-system/types").StyledComponent<"div", {}>;
11
+ export declare const FileListWrapper: import("@ndla/styled-system/types").StyledComponent<"ul", {}>;
12
12
  export declare const FileListItem: import("@ndla/styled-system/types").StyledComponent<import("react").ForwardRefExoticComponent<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & import("@ark-ui/react").PolymorphicProps>, {}>;
13
13
  export declare const FileListEmbed: ({ children, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FileListWrapper = exports.FileListItem = exports.FileListEmbed = void 0;
7
- var _reactI18next = require("react-i18next");
8
7
  var _react = require("@ark-ui/react");
9
- var _primitives = require("@ndla/primitives");
10
8
  var _jsx2 = require("@ndla/styled-system/jsx");
11
9
  var _jsxRuntime = require("react/jsx-runtime");
12
10
  /**
@@ -17,7 +15,7 @@ var _jsxRuntime = require("react/jsx-runtime");
17
15
  *
18
16
  */
19
17
 
20
- const FileListWrapper = exports.FileListWrapper = (0, _jsx2.styled)("div", {
18
+ const FileListWrapper = exports.FileListWrapper = (0, _jsx2.styled)("ul", {
21
19
  base: {
22
20
  display: "flex",
23
21
  flexDirection: "column",
@@ -44,23 +42,10 @@ const FileListEmbed = _ref => {
44
42
  children,
45
43
  ...rest
46
44
  } = _ref;
47
- const {
48
- t
49
- } = (0, _reactI18next.useTranslation)();
50
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FileListWrapper, {
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(FileListWrapper, {
51
46
  ...rest,
52
47
  "data-embed-type": "file-list",
53
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
54
- fontWeight: "bold",
55
- textStyle: "heading.small",
56
- asChild: true,
57
- consumeCss: true,
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
59
- children: t("files")
60
- })
61
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
62
- children: children
63
- })]
48
+ children: children
64
49
  });
65
50
  };
66
51
  exports.FileListEmbed = FileListEmbed;
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  interface ImageMeta {
9
- src: string;
9
+ src: string | undefined;
10
10
  alt: string;
11
11
  }
12
12
  interface Props {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "56.0.83-alpha.0",
3
+ "version": "56.0.85-alpha.0",
4
4
  "description": "UI component library for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@ndla/core": "^5.0.3",
36
- "@ndla/icons": "^8.0.48-alpha.0",
36
+ "@ndla/icons": "^8.0.49-alpha.0",
37
37
  "@ndla/licenses": "^8.0.6-alpha.0",
38
- "@ndla/primitives": "^1.0.67-alpha.0",
39
- "@ndla/safelink": "^7.0.68-alpha.0",
40
- "@ndla/styled-system": "^0.0.29",
38
+ "@ndla/primitives": "^1.0.68-alpha.0",
39
+ "@ndla/safelink": "^7.0.69-alpha.0",
40
+ "@ndla/styled-system": "^0.0.30",
41
41
  "@ndla/util": "^5.0.5-alpha.0",
42
42
  "html-react-parser": "^5.1.19",
43
43
  "i18next-browser-languagedetector": "^7.1.0"
@@ -50,7 +50,7 @@
50
50
  "react-router-dom": "> 6.0.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@ndla/preset-panda": "^0.0.48",
53
+ "@ndla/preset-panda": "^0.0.49",
54
54
  "@ndla/types-backend": "^1.0.1",
55
55
  "@ndla/types-embed": "^5.0.6-alpha.0",
56
56
  "@pandacss/dev": "^0.48.0"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "05b33be72aef0446dffee0deac725f630b59ab6b"
61
+ "gitHead": "7960790a61f90467f2c0b0919201967eac276662"
62
62
  }
@@ -49,7 +49,7 @@ const ExternalEmbed = ({ embed }: Props) => {
49
49
 
50
50
  if (embedData.type === "fullscreen") {
51
51
  const image = {
52
- src: data.iframeImage?.image.imageUrl ?? "",
52
+ src: data.iframeImage?.image.imageUrl,
53
53
  alt: embedData.alt !== undefined ? embedData.alt : (data.iframeImage?.alttext?.alttext ?? ""),
54
54
  };
55
55
  return (
@@ -48,7 +48,7 @@ const IframeEmbed = ({ embed }: Props) => {
48
48
  if (embedData.type === "fullscreen") {
49
49
  const iframeImage = embed.status === "success" ? data.iframeImage : undefined;
50
50
  const alt = embedData.alt !== undefined ? embedData.alt : iframeImage?.alttext.alttext;
51
- const image = { src: iframeImage?.image.imageUrl ?? "", alt: alt ?? "" };
51
+ const image = { src: iframeImage?.image.imageUrl, alt: alt ?? "" };
52
52
  return (
53
53
  <Figure data-embed-type="iframe">
54
54
  <ResourceBox
@@ -95,7 +95,7 @@ export const DifferentFiles: StoryObj<typeof File> = {
95
95
  ),
96
96
  };
97
97
 
98
- export const NoHeader: StoryObj<typeof File> = {
98
+ export const JustTheFileItems: StoryObj<typeof File> = {
99
99
  render: () => (
100
100
  <ul>
101
101
  <FileListItem>
@@ -108,7 +108,7 @@ export const NoHeader: StoryObj<typeof File> = {
108
108
  ),
109
109
  };
110
110
 
111
- export const FilesWithButtons: StoryObj<typeof File> = {
111
+ export const FileItemsWithButtons: StoryObj<typeof File> = {
112
112
  render: () => (
113
113
  <ul>
114
114
  <FileListItem>
@@ -7,14 +7,12 @@
7
7
  */
8
8
 
9
9
  import { type ComponentPropsWithoutRef } from "react";
10
- import { useTranslation } from "react-i18next";
11
10
  import { ark } from "@ark-ui/react";
12
- import { Heading } from "@ndla/primitives";
13
11
  import { styled } from "@ndla/styled-system/jsx";
14
12
 
15
- interface Props extends ComponentPropsWithoutRef<"div"> {}
13
+ interface Props extends ComponentPropsWithoutRef<"ul"> {}
16
14
 
17
- export const FileListWrapper = styled("div", {
15
+ export const FileListWrapper = styled("ul", {
18
16
  base: {
19
17
  display: "flex",
20
18
  flexDirection: "column",
@@ -42,13 +40,9 @@ export const FileListItem = styled(
42
40
  );
43
41
 
44
42
  export const FileListEmbed = ({ children, ...rest }: Props) => {
45
- const { t } = useTranslation();
46
43
  return (
47
44
  <FileListWrapper {...rest} data-embed-type="file-list">
48
- <Heading fontWeight="bold" textStyle="heading.small" asChild consumeCss>
49
- <h3>{t("files")}</h3>
50
- </Heading>
51
- <ul>{children}</ul>
45
+ {children}
52
46
  </FileListWrapper>
53
47
  );
54
48
  };
@@ -66,7 +66,7 @@ const StyledText = styled(Text, {
66
66
  });
67
67
 
68
68
  interface ImageMeta {
69
- src: string;
69
+ src: string | undefined;
70
70
  alt: string;
71
71
  }
72
72