@ndla/ui 56.0.4-alpha.0 → 56.0.6-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.
Files changed (53) hide show
  1. package/dist/panda.buildinfo.json +1 -7
  2. package/dist/styles.css +4 -25
  3. package/es/Article/Article.js +68 -29
  4. package/es/Article/index.js +1 -2
  5. package/es/Breadcrumb/Breadcrumb.js +2 -3
  6. package/es/Breadcrumb/BreadcrumbItem.js +1 -1
  7. package/es/Breadcrumb/HomeBreadcrumb.js +2 -2
  8. package/es/CampaignBlock/CampaignBlock.js +0 -6
  9. package/es/Concept/Concept.js +1 -1
  10. package/es/Embed/ConceptEmbed.js +0 -4
  11. package/es/Embed/ImageEmbed.js +1 -4
  12. package/es/LinkBlock/LinkBlock.js +2 -2
  13. package/es/index.js +1 -1
  14. package/es/styles.css +4 -25
  15. package/es/utils/relativeUrl.js +4 -2
  16. package/lib/Article/Article.d.ts +22 -3
  17. package/lib/Article/Article.js +71 -31
  18. package/lib/Article/index.d.ts +1 -2
  19. package/lib/Article/index.js +19 -2
  20. package/lib/Breadcrumb/Breadcrumb.js +2 -3
  21. package/lib/Breadcrumb/BreadcrumbItem.js +1 -1
  22. package/lib/Breadcrumb/HomeBreadcrumb.js +1 -1
  23. package/lib/CampaignBlock/CampaignBlock.js +0 -6
  24. package/lib/Concept/Concept.js +1 -1
  25. package/lib/Embed/ConceptEmbed.js +0 -4
  26. package/lib/Embed/ImageEmbed.js +1 -4
  27. package/lib/LinkBlock/LinkBlock.js +2 -2
  28. package/lib/index.d.ts +1 -1
  29. package/lib/index.js +18 -0
  30. package/lib/styles.css +4 -25
  31. package/lib/types.d.ts +1 -1
  32. package/lib/utils/relativeUrl.js +4 -2
  33. package/package.json +7 -7
  34. package/src/Article/Article.tsx +69 -23
  35. package/src/Article/index.ts +10 -2
  36. package/src/Breadcrumb/Breadcrumb.tsx +1 -2
  37. package/src/Breadcrumb/BreadcrumbItem.tsx +1 -1
  38. package/src/Breadcrumb/HomeBreadcrumb.tsx +2 -2
  39. package/src/CampaignBlock/CampaignBlock.tsx +0 -6
  40. package/src/Concept/Concept.tsx +2 -2
  41. package/src/ContactBlock/ContactBlock.tsx +0 -2
  42. package/src/Embed/ConceptEmbed.tsx +1 -5
  43. package/src/Embed/ImageEmbed.stories.tsx +1 -3
  44. package/src/Embed/ImageEmbed.tsx +1 -3
  45. package/src/LinkBlock/LinkBlock.tsx +2 -2
  46. package/src/index.ts +3 -0
  47. package/src/types.ts +1 -1
  48. package/src/utils/__tests__/relativeUrl-test.tsx +12 -0
  49. package/src/utils/relativeUrl.ts +4 -2
  50. package/es/Article/ArticleContent.js +0 -27
  51. package/lib/Article/ArticleContent.d.ts +0 -11
  52. package/lib/Article/ArticleContent.js +0 -33
  53. package/src/Article/ArticleContent.tsx +0 -21
@@ -119,22 +119,17 @@
119
119
  "width]___[value:fit-content",
120
120
  "maxWidth]___[value:8xl",
121
121
  "flexWrap]___[value:wrap",
122
+ "gap]___[value:xxsmall",
122
123
  "alignItems]___[value:flex-start]___[cond:mobileDown",
123
124
  "justifyContent]___[value:center]___[cond:mobileDown",
124
125
  "flexDirection]___[value:column]___[cond:mobileDown",
125
- "gap]___[value:xxsmall]___[cond:mobileDown",
126
126
  "color]___[value:inherit",
127
- "gap]___[value:4xsmall",
128
127
  "alignItems]___[value:flex-end",
129
128
  "display]___[value:block]___[cond:tabletDown",
130
129
  "textDecoration]___[value:underline",
131
130
  "textDecoration]___[value:none]___[cond:_hover",
132
131
  "textDecoration]___[value:none]___[cond:_focusVisible",
133
132
  "display]___[value:none]___[cond:tabletDown",
134
- "maxWidth]___[value:surface.xsmall",
135
- "maxWidth]___[value:surface.medium]___[cond:mobileWide",
136
- "maxWidth]___[value:1100px]___[cond:tabletWide",
137
- "gap]___[value:xxsmall",
138
133
  "alignSelf]___[value:center",
139
134
  "height]___[value:215px",
140
135
  "height]___[value:340px]___[cond:desktop",
@@ -245,7 +240,6 @@
245
240
  "width]___[value:100%]___[cond:& iframe",
246
241
  "textStyle]___[value:label.xsmall]___[cond:& a",
247
242
  "marginInlineStart]___[value:1]___[cond:& a",
248
- "borderColor]___[value:surface.brand.1.strong",
249
243
  "borderBottom]___[value:0",
250
244
  "borderBottomLeftRadius]___[value:0",
251
245
  "borderBottomRightRadius]___[value:0",
package/dist/styles.css CHANGED
@@ -326,26 +326,18 @@
326
326
  max-width: 8xl;
327
327
  }
328
328
 
329
- .c_inherit {
330
- color: inherit;
329
+ .gap_xxsmall {
330
+ gap: var(--spacing-xxsmall);
331
331
  }
332
332
 
333
- .gap_4xsmall {
334
- gap: var(--spacing-4xsmall);
333
+ .c_inherit {
334
+ color: inherit;
335
335
  }
336
336
 
337
337
  .td_underline {
338
338
  text-decoration: underline;
339
339
  }
340
340
 
341
- .max-w_surface\.xsmall {
342
- max-width: var(--sizes-surface-xsmall);
343
- }
344
-
345
- .gap_xxsmall {
346
- gap: var(--spacing-xxsmall);
347
- }
348
-
349
341
  .h_215px {
350
342
  height: 215px;
351
343
  }
@@ -726,10 +718,6 @@
726
718
  background-color: var(--colors-surface-disabled);
727
719
  }
728
720
 
729
- .bd-c_surface\.brand\.1\.strong {
730
- border-color: var(--colors-surface-brand-1-strong);
731
- }
732
-
733
721
  .bdr-bl_0 {
734
722
  border-bottom-left-radius: 0;
735
723
  }
@@ -1424,9 +1412,6 @@
1424
1412
  }
1425
1413
 
1426
1414
  @media screen and (min-width: 29.75rem) {
1427
- .mobileWide\:max-w_surface\.medium {
1428
- max-width: var(--sizes-surface-medium);
1429
- }
1430
1415
  .mobileWide\:d_none {
1431
1416
  display: none;
1432
1417
  }
@@ -1525,9 +1510,6 @@
1525
1510
  }
1526
1511
  .tabletWide\:max-w_532px {
1527
1512
  max-width: 532px;
1528
- }
1529
- .tabletWide\:max-w_1100px {
1530
- max-width: 1100px;
1531
1513
  }
1532
1514
  .tabletWide\:flex-d_row {
1533
1515
  flex-direction: row;
@@ -1723,9 +1705,6 @@
1723
1705
  @media screen and (max-width: 19.9975rem) {
1724
1706
  .mobileDown\:px_xsmall {
1725
1707
  padding-inline: var(--spacing-xsmall);
1726
- }
1727
- .mobileDown\:gap_xxsmall {
1728
- gap: var(--spacing-xxsmall);
1729
1708
  }
1730
1709
  .mobileDown\:ai_flex-start {
1731
1710
  align-items: flex-start;
@@ -6,13 +6,29 @@
6
6
  *
7
7
  */
8
8
 
9
+ import { forwardRef } from "react";
10
+ import { ark } from "@ark-ui/react";
9
11
  import { Heading, Text } from "@ndla/primitives";
12
+ import { cx } from "@ndla/styled-system/css";
10
13
  import { styled } from "@ndla/styled-system/jsx";
11
14
  import ArticleByline from "./ArticleByline";
12
- import { ArticleContent } from "./ArticleContent";
13
15
  import { ContentTypeBadgeNew } from "..";
14
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- export const ArticleWrapper = styled("article", {
17
+ const StyledArticleContent = styled(ark.section, {}, {
18
+ baseComponent: true
19
+ });
20
+ export const ArticleContent = /*#__PURE__*/forwardRef((_ref, ref) => {
21
+ let {
22
+ className,
23
+ ...props
24
+ } = _ref;
25
+ return /*#__PURE__*/_jsx(StyledArticleContent, {
26
+ className: cx("ndla-article", className),
27
+ ...props,
28
+ ref: ref
29
+ });
30
+ });
31
+ const StyledArticleWrapper = styled("article", {
16
32
  base: {
17
33
  display: "flex",
18
34
  flexDirection: "column",
@@ -41,7 +57,12 @@ export const ArticleWrapper = styled("article", {
41
57
  }
42
58
  }
43
59
  });
44
- const ArticleTitleWrapper = styled("hgroup", {
60
+ export const ArticleWrapper = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(StyledArticleWrapper, {
61
+ "data-ndla-article": "",
62
+ ref: ref,
63
+ ...props
64
+ }));
65
+ export const ArticleHGroup = styled("hgroup", {
45
66
  base: {
46
67
  display: "flex",
47
68
  width: "100%",
@@ -53,7 +74,7 @@ const ArticleTitleWrapper = styled("hgroup", {
53
74
  }
54
75
  }
55
76
  });
56
- const ArticleFavoritesButtonWrapper = styled("div", {
77
+ export const ArticleActionWrapper = styled("div", {
57
78
  base: {
58
79
  position: "absolute",
59
80
  right: "8%",
@@ -83,7 +104,40 @@ export const ArticleFooter = styled("footer", {
83
104
  width: "100%"
84
105
  }
85
106
  });
86
- export const Article = _ref => {
107
+ export const ArticleTitle = _ref2 => {
108
+ let {
109
+ contentType,
110
+ heartButton,
111
+ title,
112
+ lang,
113
+ id,
114
+ introduction,
115
+ competenceGoals
116
+ } = _ref2;
117
+ return /*#__PURE__*/_jsxs(ArticleHeader, {
118
+ children: [/*#__PURE__*/_jsxs(ArticleHGroup, {
119
+ children: [!!contentType && /*#__PURE__*/_jsx(ContentTypeBadgeNew, {
120
+ contentType: contentType
121
+ }), !!heartButton && /*#__PURE__*/_jsx(ArticleActionWrapper, {
122
+ children: heartButton
123
+ }), /*#__PURE__*/_jsx(Heading, {
124
+ textStyle: "heading.large",
125
+ id: id,
126
+ lang: lang,
127
+ children: title
128
+ })]
129
+ }), !!introduction && /*#__PURE__*/_jsx(Text, {
130
+ lang: lang,
131
+ textStyle: "body.xlarge",
132
+ asChild: true,
133
+ consumeCss: true,
134
+ children: /*#__PURE__*/_jsx("div", {
135
+ children: introduction
136
+ })
137
+ }), competenceGoals]
138
+ });
139
+ };
140
+ export const Article = _ref3 => {
87
141
  let {
88
142
  article,
89
143
  contentType,
@@ -93,7 +147,7 @@ export const Article = _ref => {
93
147
  id,
94
148
  heartButton,
95
149
  lang
96
- } = _ref;
150
+ } = _ref3;
97
151
  const {
98
152
  title,
99
153
  introduction,
@@ -104,29 +158,14 @@ export const Article = _ref => {
104
158
  } = article;
105
159
  const authors = copyright?.creators.length || copyright?.rightsholders.length ? copyright.creators : copyright?.processors;
106
160
  return /*#__PURE__*/_jsxs(ArticleWrapper, {
107
- "data-ndla-article": "",
108
- children: [/*#__PURE__*/_jsxs(ArticleHeader, {
109
- children: [/*#__PURE__*/_jsxs(ArticleTitleWrapper, {
110
- children: [!!contentType && /*#__PURE__*/_jsx(ContentTypeBadgeNew, {
111
- contentType: contentType
112
- }), !!heartButton && /*#__PURE__*/_jsx(ArticleFavoritesButtonWrapper, {
113
- children: heartButton
114
- }), /*#__PURE__*/_jsx(Heading, {
115
- textStyle: "heading.large",
116
- id: id,
117
- tabIndex: -1,
118
- lang: lang,
119
- children: title
120
- })]
121
- }), !!introduction && /*#__PURE__*/_jsx(Text, {
122
- lang: lang,
123
- textStyle: "body.xlarge",
124
- asChild: true,
125
- consumeCss: true,
126
- children: /*#__PURE__*/_jsx("div", {
127
- children: introduction
128
- })
129
- }), competenceGoals]
161
+ children: [/*#__PURE__*/_jsx(ArticleTitle, {
162
+ id: id,
163
+ contentType: contentType,
164
+ heartButton: heartButton,
165
+ title: title,
166
+ introduction: introduction,
167
+ competenceGoals: competenceGoals,
168
+ lang: lang
130
169
  }), /*#__PURE__*/_jsx(ArticleContent, {
131
170
  children: content
132
171
  }), /*#__PURE__*/_jsxs(ArticleFooter, {
@@ -8,7 +8,6 @@
8
8
 
9
9
  import ArticleByline from "./ArticleByline";
10
10
  import ArticleFootNotes from "./ArticleFootNotes";
11
- export { Article, ArticleWrapper, ArticleHeader, ArticleFooter } from "./Article";
12
- export { ArticleContent } from "./ArticleContent";
11
+ export { Article, ArticleWrapper, ArticleHeader, ArticleFooter, ArticleTitle, ArticleActionWrapper, ArticleHGroup, ArticleContent } from "./Article";
13
12
  export { ArticleByline, ArticleFootNotes };
14
13
  export { ArticleParagraph } from "./ArticleParagraph";
@@ -16,12 +16,11 @@ const StyledList = styled("ol", {
16
16
  flexWrap: "wrap",
17
17
  alignItems: "center",
18
18
  listStyle: "none",
19
- gap: "xsmall",
19
+ gap: "xxsmall",
20
20
  mobileDown: {
21
21
  alignItems: "flex-start",
22
22
  justifyContent: "center",
23
- flexDirection: "column",
24
- gap: "xxsmall"
23
+ flexDirection: "column"
25
24
  }
26
25
  }
27
26
  });
@@ -15,7 +15,7 @@ const StyledListItem = styled("li", {
15
15
  base: {
16
16
  display: "flex",
17
17
  color: "inherit",
18
- gap: "4xsmall",
18
+ gap: "3xsmall",
19
19
  alignItems: "flex-end",
20
20
  tabletDown: {
21
21
  display: "block"
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import { ArrowRightShortLine, HomeFill } from "@ndla/icons/common";
9
+ import { ArrowRightShortLine, HomeLine } from "@ndla/icons/common";
10
10
  import { SafeLink } from "@ndla/safelink";
11
11
  import { styled } from "@ndla/styled-system/jsx";
12
12
  import Breadcrumb from "./Breadcrumb";
@@ -49,7 +49,7 @@ const HomeBreadcrumb = _ref => {
49
49
  return /*#__PURE__*/_jsx(IconSafeLink, {
50
50
  "aria-label": item.name,
51
51
  to: item.to,
52
- children: /*#__PURE__*/_jsx(HomeFill, {
52
+ children: /*#__PURE__*/_jsx(HomeLine, {
53
53
  title: item.name
54
54
  })
55
55
  });
@@ -23,14 +23,8 @@ const Container = styled("div", {
23
23
  borderRadius: "xsmall",
24
24
  boxShadow: "full",
25
25
  marginBlockEnd: "4xsmall",
26
- maxWidth: "surface.xsmall",
27
26
  overflow: "hidden",
28
- mobileWide: {
29
- maxWidth: "surface.medium"
30
- },
31
27
  tabletWide: {
32
- // TODO: This is probably not the correct max-width. And it should be a token
33
- maxWidth: "1100px",
34
28
  flexDirection: "row"
35
29
  }
36
30
  }
@@ -29,7 +29,7 @@ const ContentWrapper = styled("div", {
29
29
  }
30
30
  });
31
31
 
32
- // TODO: Figure out if we need to support tags, subjects and headerButtons.
32
+ // TODO: Figure out if we need to support headerButtons.
33
33
 
34
34
  export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
35
35
  let {
@@ -69,10 +69,6 @@ export const ConceptEmbed = _ref => {
69
69
  children: parsedContent
70
70
  });
71
71
  };
72
- // TODO: Consider if we should make this act like the old concept popover.
73
- // Should it take up the entire screen height on mobile? I don't think we need to.
74
- // Should it always stay directly underneath the trigger?
75
-
76
72
  export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
77
73
  let {
78
74
  linkText,
@@ -93,8 +93,7 @@ const ImageWrapper = styled("div", {
93
93
  border: {
94
94
  true: {
95
95
  border: "1px solid",
96
- // TODO: Not sure if we want this color.
97
- borderColor: "surface.brand.1.strong",
96
+ borderColor: "stroke.subtle",
98
97
  borderBottom: "0",
99
98
  borderRadius: "xsmall",
100
99
  borderBottomLeftRadius: "0",
@@ -127,8 +126,6 @@ const StyledFigure = styled(Figure, {
127
126
  }
128
127
  }
129
128
  });
130
-
131
- // TODO: Ask about BylineButton styling. Not included in design
132
129
  const BylineButton = styled("button", {
133
130
  base: {
134
131
  cursor: "pointer",
@@ -32,8 +32,8 @@ const StyledSafeLink = styled(SafeLink, {
32
32
  background: "surface.default",
33
33
  padding: "medium",
34
34
  border: "1px solid",
35
- // TODO: Check if this is correct. Not part of design. Also check if this should have border-radius.
36
- borderColor: "stroke.default",
35
+ borderColor: "stroke.subtle",
36
+ borderRadius: "xsmall",
37
37
  "& h3": {
38
38
  textDecoration: "underline"
39
39
  },
package/es/index.js CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  export { ImageEmbed, getCrop, getFocalPoint, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, ConceptListEmbed, UnknownEmbed, InlineConcept, BlockConcept, UuDisclaimerEmbed, CopyrightEmbed, CodeEmbed } from "./Embed";
13
13
  export { LicenseLink, EmbedByline } from "./LicenseByline";
14
- export { ArticleByline, ArticleFootNotes, ArticleWrapper, Article, ArticleParagraph, ArticleFooter, ArticleHeader, ArticleContent } from "./Article";
14
+ export { ArticleByline, ArticleFootNotes, ArticleWrapper, Article, ArticleParagraph, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleActionWrapper, ArticleTitle } from "./Article";
15
15
  export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
16
16
  export { default as ContentLoader } from "./ContentLoader";
17
17
  export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
package/es/styles.css CHANGED
@@ -326,26 +326,18 @@
326
326
  max-width: 8xl;
327
327
  }
328
328
 
329
- .c_inherit {
330
- color: inherit;
329
+ .gap_xxsmall {
330
+ gap: var(--spacing-xxsmall);
331
331
  }
332
332
 
333
- .gap_4xsmall {
334
- gap: var(--spacing-4xsmall);
333
+ .c_inherit {
334
+ color: inherit;
335
335
  }
336
336
 
337
337
  .td_underline {
338
338
  text-decoration: underline;
339
339
  }
340
340
 
341
- .max-w_surface\.xsmall {
342
- max-width: var(--sizes-surface-xsmall);
343
- }
344
-
345
- .gap_xxsmall {
346
- gap: var(--spacing-xxsmall);
347
- }
348
-
349
341
  .h_215px {
350
342
  height: 215px;
351
343
  }
@@ -726,10 +718,6 @@
726
718
  background-color: var(--colors-surface-disabled);
727
719
  }
728
720
 
729
- .bd-c_surface\.brand\.1\.strong {
730
- border-color: var(--colors-surface-brand-1-strong);
731
- }
732
-
733
721
  .bdr-bl_0 {
734
722
  border-bottom-left-radius: 0;
735
723
  }
@@ -1424,9 +1412,6 @@
1424
1412
  }
1425
1413
 
1426
1414
  @media screen and (min-width: 29.75rem) {
1427
- .mobileWide\:max-w_surface\.medium {
1428
- max-width: var(--sizes-surface-medium);
1429
- }
1430
1415
  .mobileWide\:d_none {
1431
1416
  display: none;
1432
1417
  }
@@ -1525,9 +1510,6 @@
1525
1510
  }
1526
1511
  .tabletWide\:max-w_532px {
1527
1512
  max-width: 532px;
1528
- }
1529
- .tabletWide\:max-w_1100px {
1530
- max-width: 1100px;
1531
1513
  }
1532
1514
  .tabletWide\:flex-d_row {
1533
1515
  flex-direction: row;
@@ -1723,9 +1705,6 @@
1723
1705
  @media screen and (max-width: 19.9975rem) {
1724
1706
  .mobileDown\:px_xsmall {
1725
1707
  padding-inline: var(--spacing-xsmall);
1726
- }
1727
- .mobileDown\:gap_xxsmall {
1728
- gap: var(--spacing-xxsmall);
1729
1708
  }
1730
1709
  .mobileDown\:ai_flex-start {
1731
1710
  align-items: flex-start;
@@ -23,13 +23,15 @@ export const getPossiblyRelativeUrl = (url, path) => {
23
23
  // If the host is the same, return the relative path
24
24
  if (urlObj.hostname.replace(REPLACE_WWW, "") === pathObj.hostname.replace(REPLACE_WWW, "")) {
25
25
  // Replace the language part of the url with the language part of the path
26
+ // Keep the search params if they exist
27
+ const search = urlObj.search;
26
28
  // If the path language part does not exist, remove it.
27
29
  const urlMatch = urlObj.pathname.match(LANGUAGE_REGEX);
28
30
  const pathMatch = pathObj.pathname.match(LANGUAGE_REGEX);
29
31
  if (urlMatch?.[1] && urlMatch?.[1] !== pathMatch?.[1]) {
30
- return urlObj.pathname.replace(urlMatch[1], pathMatch?.[1] || "");
32
+ return `${urlObj.pathname.replace(urlMatch[1], pathMatch?.[1] || "")}${search}`;
31
33
  }
32
- return urlObj.pathname;
34
+ return `${urlObj.pathname}${search}`;
33
35
  }
34
36
  return url;
35
37
  };
@@ -8,10 +8,29 @@
8
8
  import { ReactNode } from "react";
9
9
  import { ContentType } from "../ContentTypeBadge/ContentTypeBadgeNew";
10
10
  import { Article as ArticleType } from "../types";
11
- export declare const ArticleWrapper: import("@ndla/styled-system/types").StyledComponent<"article", {}>;
11
+ export declare const ArticleContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
12
+ consumeCss?: boolean | undefined;
13
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLElement>>;
14
+ export declare const ArticleWrapper: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
15
+ ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
16
+ } & {
17
+ consumeCss?: boolean | undefined;
18
+ } & import("@ndla/styled-system/types").WithCss, "ref"> & import("react").RefAttributes<HTMLElement>>;
19
+ export declare const ArticleHGroup: import("@ndla/styled-system/types").StyledComponent<"hgroup", {}>;
20
+ export declare const ArticleActionWrapper: import("@ndla/styled-system/types").StyledComponent<"div", {}>;
12
21
  export declare const ArticleHeader: import("@ndla/styled-system/types").StyledComponent<"header", {}>;
13
22
  export declare const ArticleFooter: import("@ndla/styled-system/types").StyledComponent<"footer", {}>;
14
- type Props = {
23
+ interface ArticleTitleProps {
24
+ heartButton?: ReactNode;
25
+ contentType?: ContentType;
26
+ competenceGoals?: ReactNode;
27
+ id: string;
28
+ lang?: string;
29
+ title?: ReactNode;
30
+ introduction?: ReactNode;
31
+ }
32
+ export declare const ArticleTitle: ({ contentType, heartButton, title, lang, id, introduction, competenceGoals, }: ArticleTitleProps) => import("react/jsx-runtime").JSX.Element;
33
+ interface Props {
15
34
  heartButton?: ReactNode;
16
35
  article: ArticleType;
17
36
  licenseBox?: ReactNode;
@@ -20,6 +39,6 @@ type Props = {
20
39
  competenceGoals?: ReactNode;
21
40
  id: string;
22
41
  lang?: string;
23
- };
42
+ }
24
43
  export declare const Article: ({ article, contentType, licenseBox, children, competenceGoals, id, heartButton, lang, }: Props) => import("react/jsx-runtime").JSX.Element;
25
44
  export {};
@@ -3,11 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ArticleWrapper = exports.ArticleHeader = exports.ArticleFooter = exports.Article = void 0;
6
+ exports.ArticleWrapper = exports.ArticleTitle = exports.ArticleHeader = exports.ArticleHGroup = exports.ArticleFooter = exports.ArticleContent = exports.ArticleActionWrapper = exports.Article = void 0;
7
+ var _react = require("react");
8
+ var _react2 = require("@ark-ui/react");
7
9
  var _primitives = require("@ndla/primitives");
10
+ var _css = require("@ndla/styled-system/css");
8
11
  var _jsx2 = require("@ndla/styled-system/jsx");
9
12
  var _ArticleByline = _interopRequireDefault(require("./ArticleByline"));
10
- var _ArticleContent = require("./ArticleContent");
11
13
  var _ = require("..");
12
14
  var _jsxRuntime = require("react/jsx-runtime");
13
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -19,7 +21,21 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
19
21
  *
20
22
  */
21
23
 
22
- const ArticleWrapper = exports.ArticleWrapper = (0, _jsx2.styled)("article", {
24
+ const StyledArticleContent = (0, _jsx2.styled)(_react2.ark.section, {}, {
25
+ baseComponent: true
26
+ });
27
+ const ArticleContent = exports.ArticleContent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
28
+ let {
29
+ className,
30
+ ...props
31
+ } = _ref;
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledArticleContent, {
33
+ className: (0, _css.cx)("ndla-article", className),
34
+ ...props,
35
+ ref: ref
36
+ });
37
+ });
38
+ const StyledArticleWrapper = (0, _jsx2.styled)("article", {
23
39
  base: {
24
40
  display: "flex",
25
41
  flexDirection: "column",
@@ -48,7 +64,12 @@ const ArticleWrapper = exports.ArticleWrapper = (0, _jsx2.styled)("article", {
48
64
  }
49
65
  }
50
66
  });
51
- const ArticleTitleWrapper = (0, _jsx2.styled)("hgroup", {
67
+ const ArticleWrapper = exports.ArticleWrapper = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledArticleWrapper, {
68
+ "data-ndla-article": "",
69
+ ref: ref,
70
+ ...props
71
+ }));
72
+ const ArticleHGroup = exports.ArticleHGroup = (0, _jsx2.styled)("hgroup", {
52
73
  base: {
53
74
  display: "flex",
54
75
  width: "100%",
@@ -60,7 +81,7 @@ const ArticleTitleWrapper = (0, _jsx2.styled)("hgroup", {
60
81
  }
61
82
  }
62
83
  });
63
- const ArticleFavoritesButtonWrapper = (0, _jsx2.styled)("div", {
84
+ const ArticleActionWrapper = exports.ArticleActionWrapper = (0, _jsx2.styled)("div", {
64
85
  base: {
65
86
  position: "absolute",
66
87
  right: "8%",
@@ -90,7 +111,41 @@ const ArticleFooter = exports.ArticleFooter = (0, _jsx2.styled)("footer", {
90
111
  width: "100%"
91
112
  }
92
113
  });
93
- const Article = _ref => {
114
+ const ArticleTitle = _ref2 => {
115
+ let {
116
+ contentType,
117
+ heartButton,
118
+ title,
119
+ lang,
120
+ id,
121
+ introduction,
122
+ competenceGoals
123
+ } = _ref2;
124
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHeader, {
125
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHGroup, {
126
+ children: [!!contentType && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ContentTypeBadgeNew, {
127
+ contentType: contentType
128
+ }), !!heartButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleActionWrapper, {
129
+ children: heartButton
130
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
131
+ textStyle: "heading.large",
132
+ id: id,
133
+ lang: lang,
134
+ children: title
135
+ })]
136
+ }), !!introduction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
137
+ lang: lang,
138
+ textStyle: "body.xlarge",
139
+ asChild: true,
140
+ consumeCss: true,
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
142
+ children: introduction
143
+ })
144
+ }), competenceGoals]
145
+ });
146
+ };
147
+ exports.ArticleTitle = ArticleTitle;
148
+ const Article = _ref3 => {
94
149
  let {
95
150
  article,
96
151
  contentType,
@@ -100,7 +155,7 @@ const Article = _ref => {
100
155
  id,
101
156
  heartButton,
102
157
  lang
103
- } = _ref;
158
+ } = _ref3;
104
159
  const {
105
160
  title,
106
161
  introduction,
@@ -111,30 +166,15 @@ const Article = _ref => {
111
166
  } = article;
112
167
  const authors = copyright?.creators.length || copyright?.rightsholders.length ? copyright.creators : copyright?.processors;
113
168
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleWrapper, {
114
- "data-ndla-article": "",
115
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHeader, {
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleTitleWrapper, {
117
- children: [!!contentType && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ContentTypeBadgeNew, {
118
- contentType: contentType
119
- }), !!heartButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleFavoritesButtonWrapper, {
120
- children: heartButton
121
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
122
- textStyle: "heading.large",
123
- id: id,
124
- tabIndex: -1,
125
- lang: lang,
126
- children: title
127
- })]
128
- }), !!introduction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
129
- lang: lang,
130
- textStyle: "body.xlarge",
131
- asChild: true,
132
- consumeCss: true,
133
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
134
- children: introduction
135
- })
136
- }), competenceGoals]
137
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArticleContent.ArticleContent, {
169
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleTitle, {
170
+ id: id,
171
+ contentType: contentType,
172
+ heartButton: heartButton,
173
+ title: title,
174
+ introduction: introduction,
175
+ competenceGoals: competenceGoals,
176
+ lang: lang
177
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleContent, {
138
178
  children: content
139
179
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleFooter, {
140
180
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ArticleByline.default, {
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import ArticleByline from "./ArticleByline";
9
9
  import ArticleFootNotes from "./ArticleFootNotes";
10
- export { Article, ArticleWrapper, ArticleHeader, ArticleFooter } from "./Article";
11
- export { ArticleContent } from "./ArticleContent";
10
+ export { Article, ArticleWrapper, ArticleHeader, ArticleFooter, ArticleTitle, ArticleActionWrapper, ArticleHGroup, ArticleContent, } from "./Article";
12
11
  export { ArticleByline, ArticleFootNotes };
13
12
  export { ArticleParagraph } from "./ArticleParagraph";