@ndla/ui 56.0.54-alpha.0 → 56.0.56-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.
@@ -324,6 +324,8 @@
324
324
  "gridColumnGap]___[value:medium",
325
325
  "backgroundColor]___[value:background.subtle",
326
326
  "gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))",
327
+ "height]___[value:100%]___[cond:& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']",
328
+ "marginTop]___[value:auto]___[cond:& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']<___>& > :last-child",
327
329
  "gridTemplateColumns]___[value:repeat(1, minmax(0, 1fr))]___[cond:tabletDown",
328
330
  "gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))]___[cond:tabletToDesktop",
329
331
  "display]___[value:flex]___[cond:tabletToDesktop<___>& > div:nth-child(3):last-child",
package/dist/styles.css CHANGED
@@ -1063,6 +1063,10 @@
1063
1063
  background: var(--colors-surface-brand-1-subtle);
1064
1064
  }
1065
1065
 
1066
+ .\[\&_\:not\(div\[data-parallax-cell\=\'true\'\]\)_\>_div\[data-embed-type\=\'pitch\'\]\]\:h_100\% :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch'] {
1067
+ height: 100%;
1068
+ }
1069
+
1066
1070
  .\[\&_\>_div\]\:pos_sticky > div {
1067
1071
  position: sticky;
1068
1072
  }
@@ -1258,6 +1262,10 @@
1258
1262
  font-weight: var(--font-weights-bold);
1259
1263
  }
1260
1264
 
1265
+ .\[\&_\:not\(div\[data-parallax-cell\=\'true\'\]\)_\>_div\[data-embed-type\=\'pitch\'\]\]\:\[\&_\>_\:last-child\]\:mt_auto :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch'] > :last-child {
1266
+ margin-top: auto;
1267
+ }
1268
+
1261
1269
  .focusVisible\:after\:pos_absolute:is(:focus-visible, [data-focus-visible])::after {
1262
1270
  position: absolute;
1263
1271
  }
package/es/Grid/Grid.js CHANGED
@@ -19,6 +19,12 @@ const GridContainer = styled("div", {
19
19
  backgroundColor: "background.subtle",
20
20
  minWidth: "surface.xxsmall",
21
21
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
22
+ "& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']": {
23
+ height: "100%",
24
+ "& > :last-child": {
25
+ marginTop: "auto"
26
+ }
27
+ },
22
28
  tabletDown: {
23
29
  gridTemplateColumns: "repeat(1, minmax(0, 1fr))"
24
30
  },
package/es/Pitch/Pitch.js CHANGED
@@ -73,7 +73,7 @@ export const Pitch = _ref => {
73
73
  variant: "rounded",
74
74
  src: metaImage.url,
75
75
  alt: metaImage.alt,
76
- sizes: "180px",
76
+ sizes: "480px",
77
77
  fallbackWidth: 300,
78
78
  width: 550,
79
79
  height: 310
package/lib/Grid/Grid.js CHANGED
@@ -25,6 +25,12 @@ const GridContainer = (0, _jsx2.styled)("div", {
25
25
  backgroundColor: "background.subtle",
26
26
  minWidth: "surface.xxsmall",
27
27
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
28
+ "& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']": {
29
+ height: "100%",
30
+ "& > :last-child": {
31
+ marginTop: "auto"
32
+ }
33
+ },
28
34
  tabletDown: {
29
35
  gridTemplateColumns: "repeat(1, minmax(0, 1fr))"
30
36
  },
@@ -80,7 +80,7 @@ const Pitch = _ref => {
80
80
  variant: "rounded",
81
81
  src: metaImage.url,
82
82
  alt: metaImage.alt,
83
- sizes: "180px",
83
+ sizes: "480px",
84
84
  fallbackWidth: 300,
85
85
  width: 550,
86
86
  height: 310
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "56.0.54-alpha.0",
3
+ "version": "56.0.56-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": "2cb315cb7418685fb4e4d28f83ec2affad062482"
61
+ "gitHead": "49af42aa58dfaf274b6796f4822e09572d91dc9b"
62
62
  }
package/src/Grid/Grid.tsx CHANGED
@@ -20,6 +20,13 @@ const GridContainer = styled("div", {
20
20
  backgroundColor: "background.subtle",
21
21
  minWidth: "surface.xxsmall",
22
22
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
23
+
24
+ "& :not(div[data-parallax-cell='true']) > div[data-embed-type='pitch']": {
25
+ height: "100%",
26
+ "& > :last-child": {
27
+ marginTop: "auto",
28
+ },
29
+ },
23
30
  tabletDown: {
24
31
  gridTemplateColumns: "repeat(1, minmax(0, 1fr))",
25
32
  },
@@ -8,24 +8,26 @@
8
8
 
9
9
  import { Meta, StoryFn } from "@storybook/react";
10
10
  import { PageContent } from "@ndla/primitives";
11
- import { Pitch } from "./Pitch";
11
+ import { Pitch, Props } from "./Pitch";
12
12
  import { ArticleContent, ArticleWrapper } from "../Article";
13
13
  import { Grid } from "../Grid";
14
14
 
15
+ const args: Props = {
16
+ title: "Min pitch",
17
+ description:
18
+ "Vil du øve på spansk? Kunne du tenke deg hjelp til naturfag? Drømmer du om en prat med Mandela? Lag din egen praterobot!",
19
+ url: "#",
20
+ metaImage: {
21
+ alt: "Yonghetempelet i Beijing. Foto.",
22
+ url: "https://api.test.ndla.no/image-api/raw/id//62870",
23
+ },
24
+ };
25
+
15
26
  export default {
16
27
  title: "Components/Pitch",
17
28
  component: Pitch,
18
29
  tags: ["autodocs"],
19
- args: {
20
- title: "Min bloggpost",
21
- description:
22
- "Vil du øve på spansk? Kunne du tenke deg hjelp til naturfag? Drømmer du om en prat med Mandela? Lag din egen praterobot!",
23
- url: "#",
24
- metaImage: {
25
- alt: "Yonghetempelet i Beijing. Foto.",
26
- url: "https://api.test.ndla.no/image-api/raw/id//62870",
27
- },
28
- },
30
+ args: args,
29
31
  decorators: [
30
32
  (Story) => (
31
33
  <PageContent variant="page" asChild>
@@ -42,8 +44,14 @@ export default {
42
44
  export const Default: StoryFn<typeof Pitch> = ({ ...args }) => {
43
45
  return (
44
46
  <Grid columns="2" background="transparent">
45
- <Pitch {...args} />
46
- <Pitch {...args} />
47
+ <div data-type="grid-cell" data-parallax-cell="false">
48
+ <Pitch {...args} />
49
+ </div>
50
+ <div data-type="grid-cell" data-parallax-cell="false">
51
+ <Pitch {...args} description="Kortere beskrivelse" />
52
+ </div>
47
53
  </Grid>
48
54
  );
49
55
  };
56
+
57
+ Default.args = args;
@@ -72,7 +72,7 @@ export const Pitch = ({ title, url, metaImage, path, description }: Props) => {
72
72
  variant="rounded"
73
73
  src={metaImage.url}
74
74
  alt={metaImage.alt}
75
- sizes="180px"
75
+ sizes="480px"
76
76
  fallbackWidth={300}
77
77
  width={550}
78
78
  height={310}