@ndla/ui 50.9.5 → 50.9.7

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 (126) hide show
  1. package/es/Article/ArticleNotions.js +6 -6
  2. package/es/AudioPlayer/Controls.js +22 -22
  3. package/es/ContentPlaceholder/ContentPlaceholder.js +4 -12
  4. package/es/CopyParagraphButton/CopyParagraphButton.js +3 -3
  5. package/es/Embed/ConceptEmbed.js +14 -11
  6. package/es/Embed/conceptComponents.js +11 -11
  7. package/es/FactBox/FactBox.js +8 -24
  8. package/es/Filter/FilterCarousel.js +6 -5
  9. package/es/Footer/Footer.js +9 -17
  10. package/es/Grid/Grid.js +3 -3
  11. package/es/Hero/Hero.js +1 -1
  12. package/es/Hero/HeroContent.js +3 -3
  13. package/es/KeyFigure/KeyFigure.js +4 -4
  14. package/es/LearningPaths/LearningPathMenuContent.js +6 -6
  15. package/es/LearningPaths/LearningPathMenuModalWrapper.js +3 -3
  16. package/es/LearningPaths/LearningPathSticky.js +4 -4
  17. package/es/Masthead/Masthead.js +4 -4
  18. package/es/Masthead/SkipToMainContent.js +2 -2
  19. package/es/MediaList/MediaList.js +10 -10
  20. package/es/MyNdla/Resource/Folder.js +8 -17
  21. package/es/NDLAFilm/FilmContentCardTags.js +3 -3
  22. package/es/Resource/BlockResource.js +7 -15
  23. package/es/Resource/ListResource.js +8 -8
  24. package/es/Resource/resourceComponents.js +12 -12
  25. package/es/ResourceGroup/ResourceItem.js +34 -37
  26. package/es/Search/SearchField.js +34 -13
  27. package/es/Search/SearchFieldForm.js +4 -4
  28. package/es/SearchTypeResult/SearchItem.js +7 -16
  29. package/es/SearchTypeResult/SearchTypeResult.js +3 -3
  30. package/es/SearchTypeResult/components/ItemContexts.js +6 -6
  31. package/es/SearchTypeResult/components/ItemResourceHeader.js +7 -7
  32. package/es/SnackBar/SnackbarProvider.js +3 -12
  33. package/es/all.css +1 -1
  34. package/es/locale/messages-en.js +34 -2
  35. package/es/locale/messages-nb.js +34 -2
  36. package/es/locale/messages-nn.js +34 -2
  37. package/es/locale/messages-se.js +34 -2
  38. package/es/locale/messages-sma.js +34 -2
  39. package/lib/Article/ArticleNotions.js +5 -5
  40. package/lib/AudioPlayer/Controls.js +21 -21
  41. package/lib/ContentPlaceholder/ContentPlaceholder.js +3 -11
  42. package/lib/CopyParagraphButton/CopyParagraphButton.js +2 -2
  43. package/lib/Embed/ConceptEmbed.js +13 -10
  44. package/lib/Embed/conceptComponents.js +10 -10
  45. package/lib/FactBox/FactBox.js +7 -23
  46. package/lib/Filter/FilterCarousel.js +6 -5
  47. package/lib/Footer/Footer.js +8 -16
  48. package/lib/Grid/Grid.js +3 -3
  49. package/lib/Hero/Hero.js +1 -1
  50. package/lib/Hero/HeroContent.js +2 -2
  51. package/lib/KeyFigure/KeyFigure.js +4 -4
  52. package/lib/LearningPaths/LearningPathMenuContent.js +5 -5
  53. package/lib/LearningPaths/LearningPathMenuModalWrapper.js +2 -2
  54. package/lib/LearningPaths/LearningPathSticky.js +3 -3
  55. package/lib/Masthead/Masthead.js +3 -3
  56. package/lib/Masthead/SkipToMainContent.js +1 -1
  57. package/lib/MediaList/MediaList.js +9 -9
  58. package/lib/MyNdla/Resource/Folder.js +9 -16
  59. package/lib/NDLAFilm/FilmContentCardTags.js +2 -2
  60. package/lib/Resource/BlockResource.js +6 -14
  61. package/lib/Resource/ListResource.js +7 -7
  62. package/lib/Resource/resourceComponents.js +11 -11
  63. package/lib/ResourceGroup/ResourceItem.js +34 -37
  64. package/lib/Search/SearchField.js +34 -13
  65. package/lib/Search/SearchFieldForm.js +3 -3
  66. package/lib/SearchTypeResult/SearchItem.js +8 -15
  67. package/lib/SearchTypeResult/SearchTypeResult.js +2 -2
  68. package/lib/SearchTypeResult/components/ItemContexts.js +5 -5
  69. package/lib/SearchTypeResult/components/ItemResourceHeader.js +6 -6
  70. package/lib/SnackBar/SnackbarProvider.js +4 -11
  71. package/lib/all.css +1 -1
  72. package/lib/locale/messages-en.d.ts +32 -0
  73. package/lib/locale/messages-en.js +34 -2
  74. package/lib/locale/messages-nb.d.ts +32 -0
  75. package/lib/locale/messages-nb.js +34 -2
  76. package/lib/locale/messages-nn.d.ts +32 -0
  77. package/lib/locale/messages-nn.js +34 -2
  78. package/lib/locale/messages-se.d.ts +32 -0
  79. package/lib/locale/messages-se.js +34 -2
  80. package/lib/locale/messages-sma.d.ts +32 -0
  81. package/lib/locale/messages-sma.js +34 -2
  82. package/package.json +17 -17
  83. package/src/Article/ArticleNotions.tsx +2 -2
  84. package/src/Article/component.article.scss +2 -2
  85. package/src/AudioPlayer/Controls.tsx +2 -2
  86. package/src/ContentPlaceholder/ContentPlaceholder.tsx +2 -2
  87. package/src/CopyParagraphButton/CopyParagraphButton.tsx +2 -2
  88. package/src/Embed/ConceptEmbed.tsx +10 -16
  89. package/src/Embed/conceptComponents.tsx +3 -3
  90. package/src/FactBox/FactBox.tsx +5 -5
  91. package/src/Figure/component.figure.scss +2 -2
  92. package/src/Filter/FilterCarousel.tsx +2 -1
  93. package/src/Filter/component.filter.scss +5 -5
  94. package/src/Footer/Footer.tsx +4 -4
  95. package/src/Grid/Grid.tsx +2 -0
  96. package/src/Hero/Hero.tsx +1 -1
  97. package/src/Hero/HeroContent.tsx +2 -2
  98. package/src/KeyFigure/KeyFigure.tsx +1 -1
  99. package/src/LearningPaths/LearningPathMenuContent.tsx +3 -3
  100. package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +2 -2
  101. package/src/LearningPaths/LearningPathSticky.tsx +2 -2
  102. package/src/Masthead/Masthead.tsx +2 -2
  103. package/src/Masthead/SkipToMainContent.tsx +2 -2
  104. package/src/MediaList/MediaList.tsx +3 -3
  105. package/src/MyNdla/Resource/Folder.tsx +2 -2
  106. package/src/NDLAFilm/FilmContentCardTags.tsx +3 -3
  107. package/src/Resource/BlockResource.tsx +2 -2
  108. package/src/Resource/ListResource.tsx +2 -2
  109. package/src/Resource/resourceComponents.tsx +2 -2
  110. package/src/ResourceGroup/ResourceItem.tsx +46 -43
  111. package/src/Search/SearchField.tsx +63 -15
  112. package/src/Search/SearchFieldForm.tsx +3 -12
  113. package/src/SearchTypeResult/SearchItem.tsx +3 -3
  114. package/src/SearchTypeResult/SearchTypeResult.tsx +2 -2
  115. package/src/SearchTypeResult/components/ItemContexts.tsx +2 -2
  116. package/src/SearchTypeResult/components/ItemResourceHeader.tsx +3 -5
  117. package/src/SnackBar/SnackbarProvider.tsx +2 -2
  118. package/src/locale/messages-en.ts +33 -0
  119. package/src/locale/messages-nb.ts +33 -0
  120. package/src/locale/messages-nn.ts +33 -0
  121. package/src/locale/messages-se.ts +33 -0
  122. package/src/locale/messages-sma.ts +33 -0
  123. package/src/main.scss +4 -5
  124. package/src/Search/component.search-field.scss +0 -122
  125. package/src/Search/component.search-result.scss +0 -355
  126. package/src/Search/component.search.scss +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "50.9.5",
3
+ "version": "50.9.7",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,23 +31,23 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/accordion": "^3.0.24",
35
- "@ndla/button": "^12.0.29",
36
- "@ndla/carousel": "^4.0.29",
37
- "@ndla/core": "^4.3.7",
38
- "@ndla/dropdown-menu": "^1.0.27",
39
- "@ndla/forms": "^5.2.20",
34
+ "@ndla/accordion": "^3.0.26",
35
+ "@ndla/button": "^12.0.31",
36
+ "@ndla/carousel": "^4.0.30",
37
+ "@ndla/core": "^4.4.0",
38
+ "@ndla/dropdown-menu": "^1.0.28",
39
+ "@ndla/forms": "^5.2.22",
40
40
  "@ndla/hooks": "^2.1.5",
41
- "@ndla/icons": "^5.0.8",
41
+ "@ndla/icons": "^5.0.9",
42
42
  "@ndla/licenses": "^7.2.5",
43
- "@ndla/modal": "^5.0.28",
44
- "@ndla/notion": "^6.0.29",
45
- "@ndla/safelink": "^4.1.54",
46
- "@ndla/select": "^3.3.3",
47
- "@ndla/switch": "^1.1.33",
48
- "@ndla/tabs": "^3.2.13",
49
- "@ndla/tooltip": "^6.0.15",
50
- "@ndla/typography": "^0.4.10",
43
+ "@ndla/modal": "^5.0.29",
44
+ "@ndla/notion": "^6.0.30",
45
+ "@ndla/safelink": "^4.1.56",
46
+ "@ndla/select": "^3.3.4",
47
+ "@ndla/switch": "^1.1.34",
48
+ "@ndla/tabs": "^3.2.14",
49
+ "@ndla/tooltip": "^6.0.17",
50
+ "@ndla/typography": "^0.4.11",
51
51
  "@ndla/util": "^4.0.4",
52
52
  "@radix-ui/react-popover": "^1.0.7",
53
53
  "@radix-ui/react-slider": "^1.1.2",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "8662822e5a1f4521c58caad125c525f353d7ade9"
84
+ "gitHead": "0ac986c583fdda4957ce9dd298043ac459052704"
85
85
  }
@@ -9,7 +9,7 @@
9
9
  import { ReactNode } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import styled from "@emotion/styled";
12
- import { mq, breakpoints, fonts, colors } from "@ndla/core";
12
+ import { breakpoints, colors, fonts, mq, stackOrder } from "@ndla/core";
13
13
  import { Explanation, NotionFlip } from "@ndla/icons/common";
14
14
  import { ModalHeader, ModalCloseButton, ModalBody, Modal, ModalTitle, ModalTrigger, ModalContent } from "@ndla/modal";
15
15
 
@@ -37,7 +37,7 @@ const NotionsTrigger = styled.div`
37
37
  top: 12rem;
38
38
  right: 18px;
39
39
  background-color: transparent;
40
- z-index: 10;
40
+ z-index: ${stackOrder.trigger};
41
41
  }
42
42
 
43
43
  svg {
@@ -154,12 +154,12 @@
154
154
  left: 0;
155
155
 
156
156
  @include mq(tablet) {
157
- top: $spacing--small / 2;
157
+ top: $spacing--xsmall;
158
158
  }
159
159
 
160
160
  @include mq(desktop) {
161
161
  left: -80px;
162
- top: $spacing--small / 2;
162
+ top: $spacing--xsmall;
163
163
  }
164
164
  }
165
165
  }
@@ -12,7 +12,7 @@ import styled from "@emotion/styled";
12
12
  import { Root as PopoverRoot, PopoverContent, PopoverTrigger, PopoverPortal } from "@radix-ui/react-popover";
13
13
  import { Root as SliderRoot, Track, Range, SliderThumb } from "@radix-ui/react-slider";
14
14
  import { ButtonV2, IconButtonV2 } from "@ndla/button";
15
- import { breakpoints, colors, fonts, mq, spacing } from "@ndla/core";
15
+ import { breakpoints, colors, fonts, mq, spacing, stackOrder } from "@ndla/core";
16
16
  import { DropdownMenu, DropdownContent, DropdownItem, DropdownTrigger } from "@ndla/dropdown-menu";
17
17
  import { Back15, Forward15 } from "@ndla/icons/action";
18
18
  import { Play, Pause, VolumeUp } from "@ndla/icons/common";
@@ -149,7 +149,7 @@ const VolumeList = styled(PopoverContent)`
149
149
  padding: ${spacing.small};
150
150
  border: 1px solid ${colors.brand.lighter};
151
151
  height: 128px;
152
- z-index: 2;
152
+ z-index: ${stackOrder.offsetDouble};
153
153
  `;
154
154
 
155
155
  const VolumeSliderWrapper = styled(SliderRoot)`
@@ -7,11 +7,11 @@
7
7
  */
8
8
 
9
9
  import styled from "@emotion/styled";
10
- import { colors } from "@ndla/core";
10
+ import { colors, stackOrder } from "@ndla/core";
11
11
 
12
12
  const Wrapper = styled.div`
13
13
  position: fixed;
14
- z-index: 98;
14
+ z-index: ${stackOrder.dropdown - stackOrder.offsetSingle};
15
15
  top: 0;
16
16
  left: 0;
17
17
  right: 0;
@@ -9,7 +9,7 @@
9
9
  import { ReactNode, useCallback, useEffect, useMemo, useState } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import styled from "@emotion/styled";
12
- import { colors } from "@ndla/core";
12
+ import { colors, stackOrder } from "@ndla/core";
13
13
  import { Link } from "@ndla/icons/common";
14
14
  import Tooltip from "@ndla/tooltip";
15
15
  import { copyTextToClipboard } from "@ndla/util";
@@ -23,7 +23,7 @@ const IconButton = styled.button`
23
23
  top: 0.1em;
24
24
  background: none;
25
25
  border: 0;
26
- z-index: 1;
26
+ z-index: ${stackOrder.offsetSingle};
27
27
  transition: 0.2s;
28
28
  opacity: 0;
29
29
  color: ${colors.brand.grey};
@@ -13,7 +13,7 @@ import { useTranslation } from "react-i18next";
13
13
  import styled from "@emotion/styled";
14
14
  import { Root, Trigger, Content, Anchor, Close, Portal } from "@radix-ui/react-popover";
15
15
  import { IconButtonV2 } from "@ndla/button";
16
- import { breakpoints, colors, mq, spacing } from "@ndla/core";
16
+ import { breakpoints, colors, mq, spacing, stackOrder } from "@ndla/core";
17
17
  import { Cross } from "@ndla/icons/action";
18
18
  import { COPYRIGHTED } from "@ndla/licenses";
19
19
  import Tooltip from "@ndla/tooltip";
@@ -37,6 +37,7 @@ const PopoverWrapper = styled.div<PopoverPosition>`
37
37
  left: 50% !important;
38
38
  transform: translateX(-50%) !important;
39
39
  top: ${({ top }) => top}px !important;
40
+ z-index: ${stackOrder.popover} !important;
40
41
  }
41
42
 
42
43
  ${mq.range({ until: breakpoints.tablet })} {
@@ -49,7 +50,7 @@ const PopoverWrapper = styled.div<PopoverPosition>`
49
50
  top: 0 !important;
50
51
  left: 0 !important;
51
52
  width: 100vw;
52
- z-index: 100 !important;
53
+ z-index: ${stackOrder.popover} !important;
53
54
  height: 100vh;
54
55
  min-width: 100vw !important;
55
56
  }
@@ -196,19 +197,12 @@ const NotionButton = styled.button`
196
197
  color: ${colors.notion.dark};
197
198
  cursor: pointer;
198
199
  &:focus,
199
- &:hover {
200
- background-color: ${colors.notion.dark};
201
- color: ${colors.white};
202
- outline: none;
203
- ${BaselineIcon} {
204
- border-color: transparent;
205
- }
206
- }
207
-
208
- &:active {
200
+ &:hover,
201
+ &:active,
202
+ &[data-open="true"] {
209
203
  color: ${colors.notion.dark};
210
204
  background-color: ${colors.notion.light};
211
- ${BaselineIcon} {
205
+ [data-baseline-icon] {
212
206
  border-color: currentColor;
213
207
  }
214
208
  }
@@ -231,7 +225,7 @@ const getModalPosition = (anchor: HTMLElement) => {
231
225
  const article = anchor.closest(".c-article");
232
226
  const articlePos = article?.getBoundingClientRect();
233
227
  const anchorPos = anchor.getBoundingClientRect();
234
- return anchorPos.top - (articlePos?.top || -window.scrollY);
228
+ return anchorPos.top - (articlePos?.top || -window.scrollY) + 30; // add 30 so that position is under the word
235
229
  };
236
230
 
237
231
  export const InlineConcept = ({
@@ -272,9 +266,9 @@ export const InlineConcept = ({
272
266
  <StyledAnchorSpan />
273
267
  </StyledAnchor>
274
268
  <Trigger asChild>
275
- <NotionButton>
269
+ <NotionButton data-open={modalPos !== -9999}>
276
270
  {linkText}
277
- {<BaselineIcon />}
271
+ {<BaselineIcon data-baseline-icon />}
278
272
  </NotionButton>
279
273
  </Trigger>
280
274
  <Portal container={(anchorRef.current?.closest(".c-article") as HTMLElement | null) || undefined}>
@@ -10,7 +10,7 @@ import { forwardRef, ReactNode, RefAttributes } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import { css } from "@emotion/react";
12
12
  import styled from "@emotion/styled";
13
- import { breakpoints, colors, fonts, misc, mq, spacing } from "@ndla/core";
13
+ import { breakpoints, colors, fonts, misc, mq, spacing, stackOrder } from "@ndla/core";
14
14
  import { COPYRIGHTED } from "@ndla/licenses";
15
15
  import { ConceptData, ConceptVisualElementMeta } from "@ndla/types-embed";
16
16
  import { ExternalEmbed, HeartButtonType, IframeEmbed } from ".";
@@ -87,7 +87,7 @@ const notionContentCss = css`
87
87
  animation-name: animateIn;
88
88
  animation-duration: 300ms;
89
89
  background-color: white;
90
- z-index: 1;
90
+ z-index: ${stackOrder.offsetSingle};
91
91
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
92
92
  ${mq.range({ from: breakpoints.tablet })} {
93
93
  width: 500px;
@@ -98,7 +98,7 @@ const notionContentCss = css`
98
98
 
99
99
  ${mq.range({ until: breakpoints.tablet })} {
100
100
  padding: ${spacing.small};
101
- z-index: 100;
101
+ z-index: ${stackOrder.popover};
102
102
  height: 100%;
103
103
  width: 100%;
104
104
  overflow: auto;
@@ -11,7 +11,7 @@ import { useTranslation } from "react-i18next";
11
11
  import { css } from "@emotion/react";
12
12
  import styled from "@emotion/styled";
13
13
  import { IconButtonV2 } from "@ndla/button";
14
- import { breakpoints, colors, mq, spacing } from "@ndla/core";
14
+ import { breakpoints, colors, mq, spacing, stackOrder } from "@ndla/core";
15
15
  import { ChevronDown, ChevronUp } from "@ndla/icons/common";
16
16
 
17
17
  interface Props extends ComponentProps<"aside"> {
@@ -26,7 +26,7 @@ const StyledAside = styled.aside`
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  position: relative;
29
- z-index: 1;
29
+ z-index: ${stackOrder.offsetSingle};
30
30
  margin: ${spacing.large} 0 calc(${spacing.large} - ${spacing.nsmall}) 0;
31
31
  overflow: hidden;
32
32
  padding-bottom: ${spacing.nsmall};
@@ -75,7 +75,7 @@ const StyledDiv = styled.div`
75
75
  /* The 00 after our color is to set its opacity to 0 */
76
76
  background: linear-gradient(${colors.brand.light}00, ${colors.white});
77
77
  opacity: 1;
78
- z-index: 0;
78
+ z-index: ${stackOrder.base};
79
79
  }
80
80
 
81
81
  @media print {
@@ -102,7 +102,7 @@ const StyledDiv = styled.div`
102
102
 
103
103
  const StyledIconButton = styled(IconButtonV2)`
104
104
  margin-top: -20px;
105
- z-index: 1;
105
+ z-index: ${stackOrder.offsetSingle};
106
106
 
107
107
  @media print {
108
108
  display: none;
@@ -117,7 +117,7 @@ const expandedContentStyle = css`
117
117
  max-height: 500vh;
118
118
  &:after {
119
119
  opacity: 0;
120
- z-index: -1;
120
+ z-index: ${stackOrder.hide};
121
121
  }
122
122
  `;
123
123
 
@@ -239,7 +239,7 @@
239
239
  margin-top: $spacing--small;
240
240
 
241
241
  [data-icon] {
242
- margin-left: $spacing--small/2;
242
+ margin-left: $spacing--xsmall;
243
243
  width: 18px;
244
244
  height: 18px;
245
245
  }
@@ -267,7 +267,7 @@
267
267
  }
268
268
 
269
269
  &__link-description {
270
- margin-top: $spacing--small/2 !important;
270
+ margin-top: $spacing--xsmall !important;
271
271
  margin-bottom: 0;
272
272
  @include font-size(14px, 25px);
273
273
  }
@@ -11,6 +11,7 @@ import { useTranslation } from "react-i18next";
11
11
  import { useSwipeable } from "react-swipeable";
12
12
  import { css } from "@emotion/react";
13
13
  import styled from "@emotion/styled";
14
+ import { stackOrder } from "@ndla/core";
14
15
  import { ChevronLeft, ChevronRight } from "@ndla/icons/common";
15
16
 
16
17
  interface Props {
@@ -47,7 +48,7 @@ const NavButton = styled("button")<{
47
48
  position: absolute;
48
49
  bottom: 0;
49
50
  top: 4px;
50
- z-index: 3;
51
+ z-index: ${stackOrder.trigger};
51
52
  left: 3px;
52
53
 
53
54
  svg {
@@ -43,7 +43,7 @@
43
43
  &:not(:last-child) {
44
44
  margin-bottom: $spacing--small;
45
45
  @include mq(tabletWide) {
46
- margin-bottom: $spacing--small / 2;
46
+ margin-bottom: $spacing--xsmall;
47
47
  }
48
48
  }
49
49
  &:not(:first-child) {
@@ -131,7 +131,7 @@
131
131
  @include mq($until: mobileWide) {
132
132
  width: 100% !important;
133
133
  margin: $spacing 0 0 0 !important;
134
- padding: $spacing--small / 2 20px;
134
+ padding: $spacing--xsmall 20px;
135
135
  background: $brand-grey--lighter;
136
136
  flex-direction: row;
137
137
  .c-filter__item label {
@@ -329,7 +329,7 @@
329
329
  }
330
330
  @include mq($until: mobileWide) {
331
331
  width: 100%;
332
- padding: $spacing--small / 2 0;
332
+ padding: $spacing--xsmall 0;
333
333
  justify-content: space-between;
334
334
  min-height: 52px;
335
335
  align-items: center;
@@ -430,7 +430,7 @@
430
430
  }
431
431
  @include mq($until: mobileWide) {
432
432
  margin-top: 0;
433
- padding: $spacing--small / 2 $spacing;
433
+ padding: $spacing--xsmall $spacing;
434
434
  width: 100%;
435
435
  justify-content: space-between;
436
436
  min-height: 52px;
@@ -483,7 +483,7 @@
483
483
  padding-bottom: 0;
484
484
  flex-direction: row;
485
485
  button {
486
- margin-right: $spacing--small / 2;
486
+ margin-right: $spacing--xsmall;
487
487
  width: auto;
488
488
  }
489
489
  }
@@ -9,7 +9,7 @@
9
9
  import { ReactNode } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import styled from "@emotion/styled";
12
- import { colors, spacing, fonts, mq, breakpoints, spacingUnit } from "@ndla/core";
12
+ import { colors, spacing, fonts, mq, breakpoints, spacingUnit, stackOrder } from "@ndla/core";
13
13
  import { FooterHeaderIcon } from "@ndla/icons/common";
14
14
  import { Text } from "@ndla/typography";
15
15
  import FooterLinks from "./FooterLinks";
@@ -32,14 +32,14 @@ const StyledDiv = styled.div`
32
32
  position: relative;
33
33
  background: ${colors.brand.dark};
34
34
  overflow: hidden;
35
- z-index: 0;
35
+ z-index: ${stackOrder.base};
36
36
  &[data-margin="true"] {
37
37
  margin-top: ${spacing.xxlarge};
38
38
  }
39
39
  `;
40
40
 
41
41
  const StyledOneColumn = styled(OneColumn)`
42
- z-index: 1;
42
+ z-index: ${stackOrder.offsetSingle};
43
43
  position: relative;
44
44
  `;
45
45
 
@@ -102,7 +102,7 @@ const StyledHr = styled.hr`
102
102
 
103
103
  const StyledLanguageWrapper = styled.div`
104
104
  position: relative;
105
- z-index: 1;
105
+ z-index: ${stackOrder.offsetSingle};
106
106
  margin-top: ${spacing.normal};
107
107
  display: flex;
108
108
  align-items: center;
package/src/Grid/Grid.tsx CHANGED
@@ -24,6 +24,7 @@ const GridContainer = styled.div`
24
24
  border-radius: ${misc.borderRadius};
25
25
  grid-template-columns: 1fr;
26
26
  grid-gap: ${spacing.normal};
27
+ padding: ${spacing.normal};
27
28
 
28
29
  ${mq.range({ until: breakpoints.tabletWide })} {
29
30
  &[data-columns="2x2"],
@@ -68,6 +69,7 @@ const GridContainer = styled.div`
68
69
 
69
70
  p {
70
71
  word-break: break-word;
72
+ margin-top: 0px;
71
73
  }
72
74
  `;
73
75
 
package/src/Hero/Hero.tsx CHANGED
@@ -87,7 +87,7 @@ const StyledDiv = styled.div`
87
87
  + div article.c-article {
88
88
  background: ${colors.white};
89
89
  margin: 0 -${spacing.normal};
90
- padding: ${spacing.large} ${spacing.normal} ${spacing.normal} 0;
90
+ padding: ${spacing.large} ${spacing.normal} ${spacing.normal} ${spacing.normal};
91
91
  }
92
92
  }
93
93
  }
@@ -7,14 +7,14 @@
7
7
  */
8
8
 
9
9
  import styled from "@emotion/styled";
10
- import { spacing, mq, breakpoints } from "@ndla/core";
10
+ import { breakpoints, mq, spacing, stackOrder } from "@ndla/core";
11
11
 
12
12
  export const HeroContent = styled.div`
13
13
  display: flex;
14
14
  flex-wrap: wrap;
15
15
  align-items: flex-end;
16
16
  padding: ${spacing.small} 0 ${spacing.small};
17
- z-index: 9;
17
+ z-index: ${stackOrder.trigger};
18
18
 
19
19
  ${mq.range({ from: breakpoints.tablet })} {
20
20
  min-height: 90px;
@@ -17,7 +17,7 @@ const ContentWrapper = styled.div`
17
17
  padding: ${spacing.small};
18
18
  align-items: center;
19
19
  ${mq.range({ from: breakpoints.tabletWide })} {
20
- padding: ${spacing.medium} ${spacing.large};
20
+ padding: ${spacing.xsmall} ${spacing.nsmall};
21
21
  }
22
22
  `;
23
23
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { css } from "@emotion/react";
10
10
  import styled from "@emotion/styled";
11
- import { colors, spacing, spacingUnit, fonts, mq, breakpoints, animations, utils } from "@ndla/core";
11
+ import { colors, spacing, spacingUnit, fonts, mq, breakpoints, animations, utils, stackOrder } from "@ndla/core";
12
12
  import { LearningPathRead } from "@ndla/icons/contentType";
13
13
  import SafeLink from "@ndla/safelink";
14
14
  import { StepProps } from "./LearningPathMenu";
@@ -136,7 +136,7 @@ const StyledMenuItem = styled.li<StyledMenuItemProps>`
136
136
 
137
137
  const StyledContentType = styled.div`
138
138
  position: relative;
139
- z-index: 1;
139
+ z-index: ${stackOrder.offsetSingle};
140
140
  margin-right: ${spacingUnit * 0.75}px;
141
141
  max-height: 35px;
142
142
  `;
@@ -175,7 +175,7 @@ const StyledNavigation = styled.nav<StyledNavigationProps>`
175
175
  a:hover,
176
176
  a:focus {
177
177
  position: relative;
178
- z-index: 1;
178
+ z-index: ${stackOrder.offsetSingle};
179
179
  width: ${SIDE_NAV_WIDTH};
180
180
  background: ${colors.brand.greyLighter};
181
181
  span {
@@ -11,7 +11,7 @@ import { useTranslation } from "react-i18next";
11
11
  import { css } from "@emotion/react";
12
12
  import styled from "@emotion/styled";
13
13
  import { ButtonV2 } from "@ndla/button";
14
- import { spacing, mq, breakpoints, colors } from "@ndla/core";
14
+ import { spacing, mq, breakpoints, colors, stackOrder } from "@ndla/core";
15
15
  import { LearningPath } from "@ndla/icons/contentType";
16
16
  import { ModalHeader, ModalBody, ModalTrigger, ModalCloseButton, Modal, ModalContent } from "@ndla/modal";
17
17
 
@@ -21,7 +21,7 @@ const buttonToggleCss = css`
21
21
  }
22
22
  margin-right: auto;
23
23
  margin-left: ${spacing.normal};
24
- z-index: 100;
24
+ z-index: ${stackOrder.popover};
25
25
  svg {
26
26
  width: 20px;
27
27
  height: 20px;
@@ -10,7 +10,7 @@ import { ReactNode } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import { css } from "@emotion/react";
12
12
  import styled from "@emotion/styled";
13
- import { colors, spacing, animations, mq, breakpoints } from "@ndla/core";
13
+ import { animations, breakpoints, colors, mq, spacing, stackOrder } from "@ndla/core";
14
14
  import { Back, Forward } from "@ndla/icons/common";
15
15
  import SafeLink from "@ndla/safelink";
16
16
 
@@ -27,7 +27,7 @@ const StyledFooter = styled.nav`
27
27
  height: calc(${FOOTER_HEIGHT_MOBILE} + var(--safe-area-inset-bottom));
28
28
  min-height: var(-webkit-fill-available);
29
29
  position: fixed;
30
- z-index: 2;
30
+ z-index: ${stackOrder.offsetDouble};
31
31
  bottom: 0;
32
32
  left: 0;
33
33
  right: 0;
@@ -9,7 +9,7 @@
9
9
  import { ReactNode } from "react";
10
10
  import { css } from "@emotion/react";
11
11
  import styled from "@emotion/styled";
12
- import { breakpoints, colors, fonts, mq, spacing } from "@ndla/core";
12
+ import { breakpoints, colors, fonts, mq, spacing, stackOrder } from "@ndla/core";
13
13
  import SkipToMainContent from "./SkipToMainContent";
14
14
  import { MessageBanner } from "../Messages";
15
15
 
@@ -35,7 +35,7 @@ interface StyledMastheadProps {
35
35
  }
36
36
 
37
37
  const StyledMasthead = styled.div<StyledMastheadProps>`
38
- z-index: 99;
38
+ z-index: ${stackOrder.banner};
39
39
  position: relative;
40
40
  background: white;
41
41
  border-bottom: 1px solid ${colors.brand.greyLighter};
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { useTranslation } from "react-i18next";
10
10
  import styled from "@emotion/styled";
11
- import { colors } from "@ndla/core";
11
+ import { colors, stackOrder } from "@ndla/core";
12
12
 
13
13
  interface Props {
14
14
  skipToMainContentId: string;
@@ -33,7 +33,7 @@ const StyledSkipToMainContent = styled.a`
33
33
  border: 4px solid ${colors.brand.tertiary};
34
34
  text-align: center;
35
35
  font-size: 1.2em;
36
- z-index: 9999;
36
+ z-index: ${stackOrder.popover};
37
37
  animation-name: fadeIn;
38
38
  animation-duration: 0.3s;
39
39
  transform: translateY(-150%);
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { ComponentProps, ReactNode } from "react";
10
10
  import styled from "@emotion/styled";
11
- import { breakpoints, colors, fonts, mq, spacing } from "@ndla/core";
11
+ import { breakpoints, colors, fonts, mq, spacing, stackOrder } from "@ndla/core";
12
12
  import { Launch } from "@ndla/icons/common";
13
13
  import {
14
14
  getLicenseByAbbreviation,
@@ -19,7 +19,7 @@ import {
19
19
  import type { MetaType } from "@ndla/licenses";
20
20
  import { LicenseDescription } from "@ndla/notion";
21
21
  import SafeLink from "@ndla/safelink";
22
- import { Heading, Text } from "@ndla/typography";
22
+ import { Text } from "@ndla/typography";
23
23
  import { uuid } from "@ndla/util";
24
24
 
25
25
  const StyledMediaList = styled.ul`
@@ -90,7 +90,7 @@ const OpenIndicator = styled.div`
90
90
  background-color: ${colors.brand.primary};
91
91
  border-radius: 100%;
92
92
  pointer-events: none;
93
- z-index: 1;
93
+ z-index: ${stackOrder.offsetSingle};
94
94
  svg {
95
95
  color: ${colors.white};
96
96
  width: ${spacing.normal};
@@ -9,7 +9,7 @@
9
9
  import { ReactNode } from "react";
10
10
  import { useTranslation } from "react-i18next";
11
11
  import styled from "@emotion/styled";
12
- import { fonts, spacing, colors, mq, breakpoints } from "@ndla/core";
12
+ import { fonts, spacing, colors, mq, breakpoints, stackOrder } from "@ndla/core";
13
13
  import { FileDocumentOutline, Share } from "@ndla/icons/common";
14
14
  import { FolderOutlined, FolderSharedOutlined } from "@ndla/icons/contentType";
15
15
  import { ResourceTitleLink } from "../../Resource/resourceComponents";
@@ -91,7 +91,7 @@ const FolderTitle = styled.h2`
91
91
 
92
92
  const MenuWrapper = styled.div`
93
93
  display: flex;
94
- z-index: 1;
94
+ z-index: ${stackOrder.offsetSingle};
95
95
  flex-direction: row;
96
96
  align-items: center;
97
97
  justify-content: space-between;
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import styled from "@emotion/styled";
10
- import { spacing, spacingUnit, colors, fonts, misc } from "@ndla/core";
10
+ import { spacing, spacingUnit, colors, fonts, misc, stackOrder } from "@ndla/core";
11
11
  import { MovieResourceType } from "./types";
12
12
 
13
13
  const StyledWrapperDiv = styled.div`
@@ -17,14 +17,14 @@ const StyledWrapperDiv = styled.div`
17
17
  position: absolute;
18
18
  bottom: 0px;
19
19
  left: 0px;
20
- z-index: 1;
20
+ z-index: ${stackOrder.offsetSingle};
21
21
  `;
22
22
 
23
23
  const StyledMovieTags = styled.span`
24
24
  ${fonts.sizes("14px", "16px")};
25
25
  font-weight: ${fonts.weight.semibold};
26
26
  background: ${colors.brand.greyLight};
27
- padding: calc(${spacing.xsmall} / 2) ${spacing.xsmall};
27
+ padding: ${spacing.xxsmall} ${spacing.xsmall};
28
28
  border-radius: ${misc.borderRadius};
29
29
  color: ${colors.text.primary};
30
30
  margin-right: ${spacingUnit / 4}px;
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { ReactNode } from "react";
10
10
  import styled from "@emotion/styled";
11
- import { colors, spacing } from "@ndla/core";
11
+ import { colors, spacing, stackOrder } from "@ndla/core";
12
12
  import { Text } from "@ndla/typography";
13
13
  import {
14
14
  CompressedTagList,
@@ -72,7 +72,7 @@ const TagsAndActionMenu = styled.div`
72
72
  display: flex;
73
73
  align-items: center;
74
74
  justify-content: flex-end;
75
- z-index: 1;
75
+ z-index: ${stackOrder.offsetSingle};
76
76
  `;
77
77
 
78
78
  const BlockInfoWrapper = styled.div`
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { ReactNode } from "react";
10
10
  import styled from "@emotion/styled";
11
- import { spacing, colors, breakpoints, mq } from "@ndla/core";
11
+ import { spacing, colors, breakpoints, mq, stackOrder } from "@ndla/core";
12
12
  import { Text } from "@ndla/typography";
13
13
  import {
14
14
  CompressedTagList,
@@ -101,7 +101,7 @@ const StyledResourceDescription = styled(Text)`
101
101
 
102
102
  const TagsandActionMenu = styled.div`
103
103
  grid-area: tags;
104
- z-index: 1;
104
+ z-index: ${stackOrder.offsetSingle};
105
105
  box-sizing: content-box;
106
106
  display: grid;
107
107
  grid-template-columns: 1fr auto auto;