@ndla/ui 20.0.0 → 20.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "20.0.0",
3
+ "version": "20.0.2",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,19 +31,19 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
- "@ndla/button": "^3.1.3",
35
- "@ndla/carousel": "^1.2.12",
36
- "@ndla/core": "^2.3.0",
37
- "@ndla/forms": "^3.1.0",
34
+ "@ndla/button": "^3.1.5",
35
+ "@ndla/carousel": "^1.2.14",
36
+ "@ndla/core": "^2.3.2",
37
+ "@ndla/forms": "^3.1.2",
38
38
  "@ndla/hooks": "^1.1.4",
39
- "@ndla/icons": "^1.11.0",
40
- "@ndla/licenses": "^5.0.3",
41
- "@ndla/modal": "^1.2.13",
42
- "@ndla/notion": "^3.1.23",
43
- "@ndla/safelink": "^2.2.1",
44
- "@ndla/switch": "^0.1.7",
45
- "@ndla/tabs": "^1.1.11",
46
- "@ndla/tooltip": "^2.1.2",
39
+ "@ndla/icons": "^1.11.2",
40
+ "@ndla/licenses": "^5.0.5",
41
+ "@ndla/modal": "^1.2.15",
42
+ "@ndla/notion": "^3.1.25",
43
+ "@ndla/safelink": "^2.2.3",
44
+ "@ndla/switch": "^0.1.9",
45
+ "@ndla/tabs": "^1.1.13",
46
+ "@ndla/tooltip": "^2.1.4",
47
47
  "@ndla/util": "^3.0.0",
48
48
  "@reach/menu-button": "^0.16.2",
49
49
  "@reach/slider": "^0.16.0",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "92e4a15ab1e19af2c7b1055f56f90f5c415f87e7"
85
+ "gitHead": "8181e40829a9cbd8f2aaa1ccfb4dfdafa8560a5c"
86
86
  }
@@ -95,7 +95,10 @@ export const Masthead = ({
95
95
  )}
96
96
  <div id="masthead" {...classes('', { fixed: !!fixed, infoContent: !!infoContent, ndlaFilm: !!ndlaFilm })}>
97
97
  {messages?.map((message) => (
98
- <MessageBanner showCloseButton={message.closable} onClose={() => onCloseAlert?.(message.number)}>
98
+ <MessageBanner
99
+ key={message.number}
100
+ showCloseButton={message.closable}
101
+ onClose={() => onCloseAlert?.(message.number)}>
99
102
  {message.content}
100
103
  </MessageBanner>
101
104
  ))}
@@ -24,7 +24,7 @@ const MessageBannerWrapper = styled.div<WrapperProps>`
24
24
  padding: ${({ small }) => (small ? spacing.xxsmall : spacing.small)};
25
25
  background: ${colors.support.yellowLight};
26
26
  color: ${colors.brand.greyDark};
27
- border: none;
27
+ border-bottom: solid 1px ${colors.white};
28
28
  `;
29
29
 
30
30
  const TextWrapper = styled.div`
@@ -88,6 +88,7 @@ const StyledImageWrapper = styled.div<StyledImageProps>`
88
88
  width: 54px;
89
89
  height: 40px;
90
90
  }
91
+ overflow: hidden;
91
92
  `;
92
93
 
93
94
  const StyledImage = styled(Image)`
@@ -74,6 +74,7 @@ export const TopicMenu = ({
74
74
  currentProgramme,
75
75
  initialSelectedMenu,
76
76
  messages,
77
+ closeAlert,
77
78
  selectedGrade,
78
79
  onGradeChange,
79
80
  }) => {
@@ -149,11 +150,15 @@ export const TopicMenu = ({
149
150
  const disableSubTopic = disableMain && hasExpandedSubtopics;
150
151
 
151
152
  const sliderCounter = !expandedTopicId ? 0 : expandedSubtopicsId.length + 1;
152
-
153
153
  return (
154
154
  <nav>
155
155
  {messages?.map((message) => (
156
- <MessageBanner>{message}</MessageBanner>
156
+ <MessageBanner
157
+ key={message.number}
158
+ showCloseButton={message.closable}
159
+ onClose={() => closeAlert?.(message.number)}>
160
+ {message.content}
161
+ </MessageBanner>
157
162
  ))}
158
163
  <ModalHeader modifier={['white', 'menu']}>
159
164
  <div {...classes('masthead-left')}>
@@ -358,6 +363,7 @@ TopicMenu.propTypes = {
358
363
  topics: PropTypes.arrayOf(TopicShape).isRequired,
359
364
  toFrontpage: PropTypes.func.isRequired,
360
365
  toTopic: PropTypes.func,
366
+ closeAlert: PropTypes.func,
361
367
  toSubject: PropTypes.func,
362
368
  close: PropTypes.func,
363
369
  defaultCount: PropTypes.number,
@@ -369,6 +375,13 @@ TopicMenu.propTypes = {
369
375
  hideSearch: PropTypes.bool,
370
376
  searchFieldComponent: PropTypes.node,
371
377
  locale: PropTypes.string,
378
+ messages: PropTypes.arrayOf(
379
+ PropTypes.shape({
380
+ content: PropTypes.string.isRequired,
381
+ closable: PropTypes.bool.isRequired,
382
+ number: PropTypes.number.isRequired,
383
+ }),
384
+ ),
372
385
  subjectCategories: PropTypes.arrayOf(
373
386
  PropTypes.shape({
374
387
  name: PropTypes.string.isRequired,