@ndla/ui 41.0.0 → 41.0.2

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.
@@ -560,7 +560,7 @@ var messages = _objectSpread(_objectSpread({
560
560
  },
561
561
  concept: {
562
562
  heading: 'How to reuse concept content',
563
- description: 'You will find guidelines for use of concept content in the asset',
563
+ description: 'Remember that built-in content might have a different license than the explanation text',
564
564
  rules: 'Rules for use of concept:',
565
565
  title: 'Title',
566
566
  embedlink: {
@@ -575,7 +575,7 @@ var messages = _objectSpread(_objectSpread({
575
575
  },
576
576
  concept: {
577
577
  heading: 'Slik gjenbruker du forklaringer',
578
- description: 'Du finner retningslinjene for bruk av innholdet i forklaring-elementet',
578
+ description: 'Husk at innebygd innhold i en forklaring kan ha en annen lisens enn selve forklaringsteksten',
579
579
  rules: 'Regler for bruk av forklaring:',
580
580
  title: 'Tittel',
581
581
  embedlink: {
@@ -581,7 +581,7 @@ var messages = _objectSpread(_objectSpread({
581
581
  hasCopiedTitle: 'Innbyggingslenke kopiert'
582
582
  },
583
583
  heading: 'Slik gjenbruker du forklaringar',
584
- description: 'Du finn retningslinjene for bruk av innhaldet i forklaring-elementet',
584
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
585
585
  rules: 'Reglar for bruk av forklaring:',
586
586
  title: 'Tittel'
587
587
  },
@@ -575,7 +575,7 @@ var messages = _objectSpread(_objectSpread({
575
575
  },
576
576
  concept: {
577
577
  heading: 'Ná geavahat čilgehusaid ođđasit',
578
- description: 'Njuolggadusaid sisdoalu geavaheapmái gávnnat čilgehus-elemeanttas',
578
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
579
579
  rules: 'Njuolggadusat čilgehusa geavaheapmái:',
580
580
  title: 'Tihttel',
581
581
  embedlink: {
@@ -575,7 +575,7 @@ var messages = _objectSpread(_objectSpread({
575
575
  },
576
576
  concept: {
577
577
  heading: 'Slik gjenbruker du forklaringer',
578
- description: 'Datne njoelkedassh sisvege-åtnoen bïjre gaavnh buerkiestimmiebiehkesne',
578
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
579
579
  rules: 'Njoelkedassh guktie buerkiestimmiem nuhtjh:',
580
580
  title: 'Tihtele',
581
581
  embedlink: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "41.0.0",
3
+ "version": "41.0.2",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,21 +31,21 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^2.2.7",
34
+ "@ndla/accordion": "^2.2.8",
35
35
  "@ndla/article-scripts": "^3.0.18",
36
- "@ndla/button": "^10.1.6",
37
- "@ndla/carousel": "^3.1.4",
38
- "@ndla/core": "^4.1.0",
39
- "@ndla/forms": "^4.3.6",
36
+ "@ndla/button": "^10.1.7",
37
+ "@ndla/carousel": "^3.1.5",
38
+ "@ndla/core": "^4.1.1",
39
+ "@ndla/forms": "^4.3.7",
40
40
  "@ndla/hooks": "^2.0.7",
41
- "@ndla/icons": "^3.0.2",
41
+ "@ndla/icons": "^3.0.3",
42
42
  "@ndla/licenses": "^7.0.4",
43
- "@ndla/modal": "^3.0.4",
44
- "@ndla/notion": "^5.0.4",
45
- "@ndla/safelink": "^4.1.6",
46
- "@ndla/switch": "^1.1.4",
47
- "@ndla/tabs": "^3.0.0",
48
- "@ndla/tooltip": "^4.1.6",
43
+ "@ndla/modal": "^3.0.5",
44
+ "@ndla/notion": "^5.0.5",
45
+ "@ndla/safelink": "^4.1.7",
46
+ "@ndla/switch": "^1.1.5",
47
+ "@ndla/tabs": "^3.0.1",
48
+ "@ndla/tooltip": "^4.1.7",
49
49
  "@ndla/util": "^3.1.13",
50
50
  "@radix-ui/react-dropdown-menu": "^2.0.5",
51
51
  "@radix-ui/react-popover": "^1.0.6",
@@ -74,8 +74,7 @@
74
74
  "devDependencies": {
75
75
  "@babel/plugin-proposal-optional-chaining": "^7.11.0",
76
76
  "@ndla/types-backend": "^0.2.5",
77
- "@ndla/types-embed": "^2.0.3",
78
- "@types/reach__dialog": "^0.1.0",
77
+ "@ndla/types-embed": "^2.0.4",
79
78
  "css-loader": "^6.7.3",
80
79
  "mini-css-extract-plugin": "^2.7.5",
81
80
  "sass-loader": "^13.2.2",
@@ -85,5 +84,5 @@
85
84
  "publishConfig": {
86
85
  "access": "public"
87
86
  },
88
- "gitHead": "982a8c9b737182c8c1b4f1105ed128be637d47cb"
87
+ "gitHead": "1fa31ba26d4b1cc78663fa125892215c37078f94"
89
88
  }
@@ -125,7 +125,7 @@ const ImageEmbed = ({ embed, previewAlt, heartButton: HeartButton }: Props) => {
125
125
  type={imageSizes ? undefined : figureType}
126
126
  className={imageSizes ? 'c-figure--right expanded' : ''}
127
127
  >
128
- <ImageWrapper src={data.image.imageUrl} crop={crop} size={embedData.size}>
128
+ <ImageWrapper src={embedData.pageUrl || data.image.imageUrl} crop={crop} size={embedData.size}>
129
129
  <Image
130
130
  focalPoint={focalPoint}
131
131
  contentType={data.image.contentType}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Copyright (c) 2023-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import React from 'react';
10
+ import { Meta, StoryFn } from '@storybook/react';
11
+ import { defaultParameters } from '../../../../stories/defaults';
12
+ import { contentTypes } from '../model/ContentType';
13
+ import LearningPathMenu from './LearningPathMenu';
14
+ const args = {
15
+ name: 'Læringssti',
16
+ LearningPathId: 1,
17
+ lastUpdated: '2023-06-01',
18
+ copyright: {
19
+ contributors: [
20
+ {
21
+ type: 'originator',
22
+ name: 'NDLA',
23
+ },
24
+ ],
25
+ license: {
26
+ license: 'CC-BY-SA-4.0',
27
+ },
28
+ },
29
+ learningPathUrl: 'https://stier.ndla.no',
30
+ currentIndex: 1,
31
+ cookies: {},
32
+ learningsteps: [
33
+ {
34
+ id: 1,
35
+ title: 'Introduksjon',
36
+ type: contentTypes.LEARNING_PATH,
37
+ },
38
+ {
39
+ id: 2,
40
+ title: 'Steg 1',
41
+ type: contentTypes.SUBJECT_MATERIAL,
42
+ },
43
+ {
44
+ id: 3,
45
+ title: 'Steg 2',
46
+ type: contentTypes.TASKS_AND_ACTIVITIES,
47
+ },
48
+ ],
49
+ toLearningPathUrl: (pathId: number, stepId: number) => '',
50
+ };
51
+
52
+ export default {
53
+ title: 'Sammensatte moduler/Læringssti-meny',
54
+ component: LearningPathMenu,
55
+ tags: ['autodocs'],
56
+ parameters: {
57
+ ...defaultParameters,
58
+ layout: 'centered',
59
+ },
60
+ args: args,
61
+ } as Meta<typeof LearningPathMenu>;
62
+
63
+ export const LearningPathMenuStory: StoryFn<typeof LearningPathMenu> = ({ ...args }) => {
64
+ return <LearningPathMenu {...args} />;
65
+ };
66
+
67
+ LearningPathMenuStory.args = args;
68
+ LearningPathMenuStory.storyName = 'Læringssti-meny';
@@ -139,7 +139,7 @@ const StyledContentType = styled.div`
139
139
  position: relative;
140
140
  z-index: 1;
141
141
  margin-right: ${spacingUnit * 0.75}px;
142
- max-height: 36px;
142
+ max-height: 35px;
143
143
  `;
144
144
 
145
145
  const HiddenSpan = styled.span`
@@ -49,7 +49,7 @@ const StyledMenuIntro = styled.div<StyledMenuIntroProps>`
49
49
  padding: 0 0 ${spacing.medium} ${spacing.normal};
50
50
  }
51
51
  ${mq.range({ from: breakpoints.tablet })} {
52
- margin-left: ${spacingUnit + BORDER_WIDTH / 2}px;
52
+ margin-left: ${spacingUnit + BORDER_WIDTH}px;
53
53
  margin-top: ${spacing.normal};
54
54
  }
55
55
  ${mq.range({ from: breakpoints.tablet, until: breakpoints.desktop })} {
@@ -33,7 +33,11 @@ const StyledSpan = styled.span`
33
33
 
34
34
  const LicenseLink = ({ license, asLink = true }: Props) => {
35
35
  if (asLink) {
36
- return <StyledSafeLink to={license.url}>{license.abbreviation}</StyledSafeLink>;
36
+ return (
37
+ <StyledSafeLink to={license.url} rel="license">
38
+ {license.abbreviation}
39
+ </StyledSafeLink>
40
+ );
37
41
  } else {
38
42
  return <StyledSpan>{license.abbreviation}</StyledSpan>;
39
43
  }
@@ -594,7 +594,7 @@ const messages = {
594
594
  },
595
595
  concept: {
596
596
  heading: 'How to reuse concept content',
597
- description: 'You will find guidelines for use of concept content in the asset',
597
+ description: 'Remember that built-in content might have a different license than the explanation text',
598
598
  rules: 'Rules for use of concept:',
599
599
  title: 'Title',
600
600
  embedlink: {
@@ -608,7 +608,7 @@ const messages = {
608
608
  },
609
609
  concept: {
610
610
  heading: 'Slik gjenbruker du forklaringer',
611
- description: 'Du finner retningslinjene for bruk av innholdet i forklaring-elementet',
611
+ description: 'Husk at innebygd innhold i en forklaring kan ha en annen lisens enn selve forklaringsteksten',
612
612
  rules: 'Regler for bruk av forklaring:',
613
613
  title: 'Tittel',
614
614
  embedlink: {
@@ -614,7 +614,7 @@ const messages = {
614
614
  hasCopiedTitle: 'Innbyggingslenke kopiert',
615
615
  },
616
616
  heading: 'Slik gjenbruker du forklaringar',
617
- description: 'Du finn retningslinjene for bruk av innhaldet i forklaring-elementet',
617
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
618
618
  rules: 'Reglar for bruk av forklaring:',
619
619
  title: 'Tittel',
620
620
  },
@@ -609,7 +609,7 @@ const messages = {
609
609
  },
610
610
  concept: {
611
611
  heading: 'Ná geavahat čilgehusaid ođđasit',
612
- description: 'Njuolggadusaid sisdoalu geavaheapmái gávnnat čilgehus-elemeanttas',
612
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
613
613
  rules: 'Njuolggadusat čilgehusa geavaheapmái:',
614
614
  title: 'Tihttel',
615
615
  embedlink: {
@@ -611,7 +611,7 @@ const messages = {
611
611
  },
612
612
  concept: {
613
613
  heading: 'Slik gjenbruker du forklaringer',
614
- description: 'Datne njoelkedassh sisvege-åtnoen bïjre gaavnh buerkiestimmiebiehkesne',
614
+ description: 'Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten',
615
615
  rules: 'Njoelkedassh guktie buerkiestimmiem nuhtjh:',
616
616
  title: 'Tihtele',
617
617
  embedlink: {