@ndla/ui 56.0.88-alpha.0 → 56.0.90-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.
@@ -224,8 +224,7 @@
224
224
  "backgroundColor]___[value:surface.brand.2.subtle",
225
225
  "borderRadius]___[value:xxsmall",
226
226
  "borderColor]___[value:stroke.info",
227
- "textOverflow]___[value:ellipsis",
228
- "whiteSpace]___[value:nowrap",
227
+ "lineClamp]___[value:1",
229
228
  "inset]___[value:0]___[cond:_before",
230
229
  "zIndex]___[value:0]___[cond:_before",
231
230
  "textStyle]___[value:label.xsmall]___[cond:& a",
@@ -352,6 +351,7 @@
352
351
  "whiteSpace]___[value:pre-wrap]___[cond:mobileWideDown<___>_open",
353
352
  "maxHeight]___[value:none]___[cond:mobileWideDown<___>_open",
354
353
  "display]___[value:none]___[cond:mobileWide",
354
+ "whiteSpace]___[value:nowrap",
355
355
  "textDecoration]___[value:none]___[cond:_focusWithin",
356
356
  "display]___[value:none]___[cond:mobileWideDown<___>_disabled",
357
357
  "textDecoration]___[value:underline]___[cond:& h3",
package/dist/styles.css CHANGED
@@ -453,12 +453,11 @@
453
453
  border-radius: xxsmall;
454
454
  }
455
455
 
456
- .tov_ellipsis {
457
- text-overflow: ellipsis;
458
- }
459
-
460
- .white-space_nowrap {
461
- white-space: nowrap;
456
+ .lc_1 {
457
+ overflow: hidden;
458
+ display: -webkit-box;
459
+ -webkit-line-clamp: 1;
460
+ -webkit-box-orient: vertical;
462
461
  }
463
462
 
464
463
  .z_docked {
@@ -545,6 +544,10 @@
545
544
  white-space: pre-wrap;
546
545
  }
547
546
 
547
+ .white-space_nowrap {
548
+ white-space: nowrap;
549
+ }
550
+
548
551
  .c_icon\.strong {
549
552
  color: var(--colors-icon-strong);
550
553
  }
@@ -68,8 +68,7 @@ const Wrapper = styled("div", {
68
68
  });
69
69
  const UrlText = styled(Text, {
70
70
  base: {
71
- textOverflow: "ellipsis",
72
- whiteSpace: "nowrap",
71
+ lineClamp: "1",
73
72
  overflow: "hidden"
74
73
  }
75
74
  });
@@ -57,7 +57,9 @@ export const GlossEmbed = _ref => {
57
57
  children: /*#__PURE__*/_jsx(Gloss, {
58
58
  glossData: concept.glossData,
59
59
  title: concept.title,
60
- audio: audio
60
+ audio: audio,
61
+ exampleIds: embed.embedData.exampleIds,
62
+ exampleLangs: embed.embedData.exampleLangs
61
63
  })
62
64
  })
63
65
  })
@@ -70,6 +72,8 @@ export const GlossEmbed = _ref => {
70
72
  glossData: concept.glossData,
71
73
  title: concept.title,
72
74
  audio: audio,
75
+ exampleIds: embed.embedData.exampleIds,
76
+ exampleLangs: embed.embedData.exampleLangs,
73
77
  variant: "bordered"
74
78
  })
75
79
  });
@@ -9,7 +9,7 @@
9
9
  import { useTranslation } from "react-i18next";
10
10
  import { Portal } from "@ark-ui/react";
11
11
  import { AccessibilityFill, ErrorWarningFill } from "@ndla/icons";
12
- import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger, PopoverTitle } from "@ndla/primitives";
12
+ import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
13
13
  import { styled } from "@ndla/styled-system/jsx";
14
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  const DisclaimerWrapper = styled("div", {
@@ -66,12 +66,8 @@ const UuDisclaimerEmbed = _ref => {
66
66
  children: /*#__PURE__*/_jsx(AccessibilityFill, {})
67
67
  })
68
68
  }), /*#__PURE__*/_jsx(Portal, {
69
- children: /*#__PURE__*/_jsxs(PopoverContent, {
70
- children: [/*#__PURE__*/_jsx(PopoverTitle, {
71
- children: t("uuDisclaimer.title")
72
- }), /*#__PURE__*/_jsx("div", {
73
- children: transformedDisclaimer
74
- })]
69
+ children: /*#__PURE__*/_jsx(PopoverContent, {
70
+ children: transformedDisclaimer
75
71
  })
76
72
  })]
77
73
  }), /*#__PURE__*/_jsx("div", {
@@ -75,8 +75,7 @@ const Wrapper = (0, _jsx2.styled)("div", {
75
75
  });
76
76
  const UrlText = (0, _jsx2.styled)(_primitives.Text, {
77
77
  base: {
78
- textOverflow: "ellipsis",
79
- whiteSpace: "nowrap",
78
+ lineClamp: "1",
80
79
  overflow: "hidden"
81
80
  }
82
81
  });
@@ -64,7 +64,9 @@ const GlossEmbed = _ref => {
64
64
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Gloss.Gloss, {
65
65
  glossData: concept.glossData,
66
66
  title: concept.title,
67
- audio: audio
67
+ audio: audio,
68
+ exampleIds: embed.embedData.exampleIds,
69
+ exampleLangs: embed.embedData.exampleLangs
68
70
  })
69
71
  })
70
72
  })
@@ -77,6 +79,8 @@ const GlossEmbed = _ref => {
77
79
  glossData: concept.glossData,
78
80
  title: concept.title,
79
81
  audio: audio,
82
+ exampleIds: embed.embedData.exampleIds,
83
+ exampleLangs: embed.embedData.exampleLangs,
80
84
  variant: "bordered"
81
85
  })
82
86
  });
@@ -72,12 +72,8 @@ const UuDisclaimerEmbed = _ref => {
72
72
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AccessibilityFill, {})
73
73
  })
74
74
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Portal, {
75
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.PopoverContent, {
76
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PopoverTitle, {
77
- children: t("uuDisclaimer.title")
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
79
- children: transformedDisclaimer
80
- })]
75
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PopoverContent, {
76
+ children: transformedDisclaimer
81
77
  })
82
78
  })]
83
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
package/lib/types.d.ts CHANGED
@@ -38,4 +38,5 @@ export interface Article {
38
38
  footNotes: Array<FootNote>;
39
39
  copyright?: Copyright;
40
40
  published: string;
41
+ disclaimer?: ReactNode;
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "56.0.88-alpha.0",
3
+ "version": "56.0.90-alpha.0",
4
4
  "description": "UI component library for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "695e6f669f22dfac4d5fef96fd0463b690bb7973"
61
+ "gitHead": "5f9b8e9db029204a71d9ba5fbd45e9f5ce4343ba"
62
62
  }
@@ -77,8 +77,7 @@ const Wrapper = styled("div", {
77
77
 
78
78
  const UrlText = styled(Text, {
79
79
  base: {
80
- textOverflow: "ellipsis",
81
- whiteSpace: "nowrap",
80
+ lineClamp: "1",
82
81
  overflow: "hidden",
83
82
  },
84
83
  });
@@ -53,7 +53,13 @@ export const GlossEmbed = ({ embed }: Props) => {
53
53
  <Portal>
54
54
  <StyledPopoverContent ref={contentRef}>
55
55
  <Figure>
56
- <Gloss glossData={concept.glossData} title={concept.title} audio={audio} />
56
+ <Gloss
57
+ glossData={concept.glossData}
58
+ title={concept.title}
59
+ audio={audio}
60
+ exampleIds={embed.embedData.exampleIds}
61
+ exampleLangs={embed.embedData.exampleLangs}
62
+ />
57
63
  </Figure>
58
64
  </StyledPopoverContent>
59
65
  </Portal>
@@ -63,7 +69,14 @@ export const GlossEmbed = ({ embed }: Props) => {
63
69
 
64
70
  return (
65
71
  <Figure data-embed-type="gloss">
66
- <Gloss glossData={concept.glossData} title={concept.title} audio={audio} variant="bordered" />
72
+ <Gloss
73
+ glossData={concept.glossData}
74
+ title={concept.title}
75
+ audio={audio}
76
+ exampleIds={embed.embedData.exampleIds}
77
+ exampleLangs={embed.embedData.exampleLangs}
78
+ variant="bordered"
79
+ />
67
80
  </Figure>
68
81
  );
69
82
  };
@@ -10,7 +10,7 @@ import { type ReactNode } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import { Portal } from "@ark-ui/react";
12
12
  import { AccessibilityFill, ErrorWarningFill } from "@ndla/icons";
13
- import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger, PopoverTitle } from "@ndla/primitives";
13
+ import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
14
14
  import { styled } from "@ndla/styled-system/jsx";
15
15
  import type { UuDisclaimerMetaData } from "@ndla/types-embed";
16
16
 
@@ -70,10 +70,7 @@ const UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }: Props) =>
70
70
  </StyledIconButton>
71
71
  </PopoverTrigger>
72
72
  <Portal>
73
- <PopoverContent>
74
- <PopoverTitle>{t("uuDisclaimer.title")}</PopoverTitle>
75
- <div>{transformedDisclaimer}</div>
76
- </PopoverContent>
73
+ <PopoverContent>{transformedDisclaimer}</PopoverContent>
77
74
  </Portal>
78
75
  </PopoverRoot>
79
76
  <div data-uu-content="">{children}</div>
package/src/types.ts CHANGED
@@ -45,4 +45,5 @@ export interface Article {
45
45
  footNotes: Array<FootNote>;
46
46
  copyright?: Copyright;
47
47
  published: string;
48
+ disclaimer?: ReactNode;
48
49
  }