@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/README.md +1 -1
- package/es/Masthead/Masthead.js +1 -0
- package/es/Messages/MessageBanner.js +3 -3
- package/es/Resource/ListResource.js +6 -6
- package/es/TopicMenu/TopicMenu.js +14 -1
- package/es/all.css +1 -1
- package/lib/Masthead/Masthead.js +1 -0
- package/lib/Messages/MessageBanner.js +3 -3
- package/lib/Resource/ListResource.js +6 -6
- package/lib/TopicMenu/TopicMenu.js +14 -1
- package/lib/all.css +1 -1
- package/package.json +14 -14
- package/src/Masthead/Masthead.tsx +4 -1
- package/src/Messages/MessageBanner.tsx +1 -1
- package/src/Resource/ListResource.tsx +1 -0
- package/src/TopicMenu/TopicMenu.jsx +15 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "20.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.
|
|
35
|
-
"@ndla/carousel": "^1.2.
|
|
36
|
-
"@ndla/core": "^2.3.
|
|
37
|
-
"@ndla/forms": "^3.1.
|
|
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.
|
|
40
|
-
"@ndla/licenses": "^5.0.
|
|
41
|
-
"@ndla/modal": "^1.2.
|
|
42
|
-
"@ndla/notion": "^3.1.
|
|
43
|
-
"@ndla/safelink": "^2.2.
|
|
44
|
-
"@ndla/switch": "^0.1.
|
|
45
|
-
"@ndla/tabs": "^1.1.
|
|
46
|
-
"@ndla/tooltip": "^2.1.
|
|
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": "
|
|
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
|
|
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:
|
|
27
|
+
border-bottom: solid 1px ${colors.white};
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
30
|
const TextWrapper = styled.div`
|
|
@@ -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
|
|
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,
|