@ndla/ui 30.2.2 → 30.3.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.
- package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +11 -8
- package/es/Resource/BlockResource.js +10 -10
- package/es/Resource/ListResource.js +7 -7
- package/es/ToolboxPage/ToolboxInfo.js +6 -3
- package/es/Topic/Topic.js +24 -21
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.d.ts +2 -1
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +11 -8
- package/lib/Resource/BlockResource.js +10 -10
- package/lib/Resource/ListResource.js +7 -7
- package/lib/ToolboxPage/ToolboxInfo.d.ts +4 -3
- package/lib/ToolboxPage/ToolboxInfo.js +6 -3
- package/lib/Topic/Topic.d.ts +2 -1
- package/lib/Topic/Topic.js +24 -21
- package/package.json +2 -2
- package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +5 -2
- package/src/Resource/BlockResource.tsx +2 -0
- package/src/Resource/ListResource.tsx +1 -0
- package/src/ToolboxPage/ToolboxInfo.tsx +7 -4
- package/src/Topic/Topic.tsx +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.3.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f9ee8725e9d18a8bf738babad7d4b65ee50a9cab"
|
|
90
90
|
}
|
|
@@ -90,9 +90,10 @@ type Props = {
|
|
|
90
90
|
children: ReactNode;
|
|
91
91
|
totalCardCount: number;
|
|
92
92
|
hideCards?: boolean;
|
|
93
|
+
id?: string;
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
export const MultidisciplinarySubject = ({ cards, children, totalCardCount, hideCards }: Props) => {
|
|
96
|
+
export const MultidisciplinarySubject = ({ cards, children, totalCardCount, hideCards, id }: Props) => {
|
|
96
97
|
const { t } = useTranslation();
|
|
97
98
|
return (
|
|
98
99
|
<StyledWrapper>
|
|
@@ -100,7 +101,9 @@ export const MultidisciplinarySubject = ({ cards, children, totalCardCount, hide
|
|
|
100
101
|
<OneColumn wide>
|
|
101
102
|
<Header>
|
|
102
103
|
<LayoutItem layout="extend">
|
|
103
|
-
<Heading
|
|
104
|
+
<Heading id={id} tabIndex={-1}>
|
|
105
|
+
{t('frontpageMultidisciplinarySubject.heading')}
|
|
106
|
+
</Heading>
|
|
104
107
|
<InfoText>{t('frontpageMultidisciplinarySubject.text')}</InfoText>
|
|
105
108
|
</LayoutItem>
|
|
106
109
|
<Illustration />
|
|
@@ -106,6 +106,7 @@ const TagsandActionMenu = styled.div<TagsAndActionProps>`
|
|
|
106
106
|
grid-template-columns: 1fr auto auto;
|
|
107
107
|
align-items: center;
|
|
108
108
|
align-self: flex-start;
|
|
109
|
+
justify-items: flex-end;
|
|
109
110
|
margin: -${spacing.small} -${(props) => (props.hasMenuButton ? spacing.small : 0)} 0 0;
|
|
110
111
|
${mq.range({ until: breakpoints.mobileWide })} {
|
|
111
112
|
margin: 0 -${(props) => (props.hasMenuButton ? spacing.small : 0)} -${spacing.small} 0;
|
|
@@ -39,18 +39,21 @@ const Introduction = styled.p`
|
|
|
39
39
|
}
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
interface Props {
|
|
43
|
+
id?: string;
|
|
43
44
|
title: string;
|
|
44
45
|
introduction: string;
|
|
45
46
|
topics: ItemProps[];
|
|
46
47
|
onSelectTopic?: (event: MouseEvent<HTMLElement>, id?: string) => void;
|
|
47
|
-
}
|
|
48
|
+
}
|
|
48
49
|
|
|
49
|
-
const ToolboxInfo = ({ title, introduction, topics, onSelectTopic }: Props) => {
|
|
50
|
+
const ToolboxInfo = ({ title, introduction, topics, onSelectTopic, id }: Props) => {
|
|
50
51
|
const { t } = useTranslation();
|
|
51
52
|
return (
|
|
52
53
|
<>
|
|
53
|
-
<Heading
|
|
54
|
+
<Heading id={id} tabIndex={-1}>
|
|
55
|
+
{title}
|
|
56
|
+
</Heading>
|
|
54
57
|
<Introduction>{introduction}</Introduction>
|
|
55
58
|
<NavigationBox
|
|
56
59
|
items={topics}
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -215,6 +215,7 @@ type VisualElementProps = {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
export type TopicProps = {
|
|
218
|
+
id?: string;
|
|
218
219
|
topic?: {
|
|
219
220
|
title: string;
|
|
220
221
|
introduction: string;
|
|
@@ -241,6 +242,7 @@ export type TopicProps = {
|
|
|
241
242
|
};
|
|
242
243
|
|
|
243
244
|
const Topic = ({
|
|
245
|
+
id,
|
|
244
246
|
topic,
|
|
245
247
|
subTopics,
|
|
246
248
|
onSubTopicSelected,
|
|
@@ -323,7 +325,7 @@ const Topic = ({
|
|
|
323
325
|
)}
|
|
324
326
|
</TopicHeaderVisualElementWrapper>
|
|
325
327
|
)}
|
|
326
|
-
<TopicHeading invertedStyle={invertedStyle}>
|
|
328
|
+
<TopicHeading invertedStyle={invertedStyle} id={id} tabIndex={-1}>
|
|
327
329
|
<StyledHeadingText>{topic.title}</StyledHeadingText>
|
|
328
330
|
{isAdditionalTopic && (
|
|
329
331
|
<StyledAdditionalResource>
|