@ndla/ui 30.8.2 → 30.8.3
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/CopyParagraphButton/CopyParagraphButton.js +18 -24
- package/es/Frontpage/FrontpageSearch.js +3 -2
- package/es/all.css +1 -1
- package/lib/CopyParagraphButton/CopyParagraphButton.js +18 -24
- package/lib/Frontpage/FrontpageSearch.js +3 -2
- package/lib/all.css +1 -1
- package/package.json +17 -17
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +14 -10
- package/src/Frontpage/FrontpageSearch.tsx +1 -0
- package/src/TopicMenu/component.topic-menu.scss +16 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "30.8.
|
|
3
|
+
"version": "30.8.3",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/article-scripts": "^3.0.
|
|
35
|
-
"@ndla/button": "^6.0.
|
|
36
|
-
"@ndla/carousel": "^2.0.
|
|
37
|
-
"@ndla/core": "^3.0.
|
|
38
|
-
"@ndla/forms": "^4.0.
|
|
39
|
-
"@ndla/hooks": "^1.1.
|
|
40
|
-
"@ndla/icons": "^2.0.
|
|
41
|
-
"@ndla/licenses": "^6.0.
|
|
42
|
-
"@ndla/modal": "^2.1.
|
|
43
|
-
"@ndla/notion": "^4.0.
|
|
44
|
-
"@ndla/safelink": "^3.0.
|
|
45
|
-
"@ndla/switch": "^1.0.
|
|
46
|
-
"@ndla/tabs": "^2.0.
|
|
47
|
-
"@ndla/tooltip": "^3.0.
|
|
34
|
+
"@ndla/article-scripts": "^3.0.10",
|
|
35
|
+
"@ndla/button": "^6.0.3",
|
|
36
|
+
"@ndla/carousel": "^2.0.8",
|
|
37
|
+
"@ndla/core": "^3.0.3",
|
|
38
|
+
"@ndla/forms": "^4.0.15",
|
|
39
|
+
"@ndla/hooks": "^1.1.14",
|
|
40
|
+
"@ndla/icons": "^2.0.8",
|
|
41
|
+
"@ndla/licenses": "^6.0.10",
|
|
42
|
+
"@ndla/modal": "^2.1.3",
|
|
43
|
+
"@ndla/notion": "^4.0.17",
|
|
44
|
+
"@ndla/safelink": "^3.0.15",
|
|
45
|
+
"@ndla/switch": "^1.0.3",
|
|
46
|
+
"@ndla/tabs": "^2.0.10",
|
|
47
|
+
"@ndla/tooltip": "^3.0.6",
|
|
48
48
|
"@ndla/types-learningpath-api": "^0.0.17",
|
|
49
|
-
"@ndla/util": "^3.1.
|
|
49
|
+
"@ndla/util": "^3.1.8",
|
|
50
50
|
"@reach/menu-button": "^0.16.2",
|
|
51
51
|
"@reach/slider": "^0.16.0",
|
|
52
52
|
"focus-trap-react": "^8.9.2",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "069ef3ed8a9641137f8d4de51ab6415985bca997"
|
|
90
90
|
}
|
|
@@ -13,6 +13,11 @@ import { Link } from '@ndla/icons/common';
|
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
14
|
import Tooltip from '@ndla/tooltip';
|
|
15
15
|
import { copyTextToClipboard } from '@ndla/util';
|
|
16
|
+
import { colors } from '@ndla/core';
|
|
17
|
+
|
|
18
|
+
const ContainerDiv = styled.div`
|
|
19
|
+
position: relative;
|
|
20
|
+
`;
|
|
16
21
|
|
|
17
22
|
const IconButton = styled.button`
|
|
18
23
|
position: absolute;
|
|
@@ -23,18 +28,17 @@ const IconButton = styled.button`
|
|
|
23
28
|
z-index: 1;
|
|
24
29
|
transition: 0.2s;
|
|
25
30
|
opacity: 0;
|
|
31
|
+
color: ${colors.brand.grey};
|
|
26
32
|
|
|
27
33
|
& svg {
|
|
28
34
|
width: 30px;
|
|
29
35
|
height: 30px;
|
|
30
36
|
}
|
|
31
|
-
`;
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
&:hover button {
|
|
38
|
+
${ContainerDiv}:hover &,
|
|
39
|
+
&:focus, &:focus-visible, &:active {
|
|
36
40
|
cursor: pointer;
|
|
37
|
-
opacity:
|
|
41
|
+
opacity: 1;
|
|
38
42
|
}
|
|
39
43
|
`;
|
|
40
44
|
|
|
@@ -54,12 +58,12 @@ interface CopyButtonProps {
|
|
|
54
58
|
const CopyButton = ({ onClick, title, tooltip, content }: CopyButtonProps) => {
|
|
55
59
|
return (
|
|
56
60
|
<div>
|
|
57
|
-
<
|
|
58
|
-
<
|
|
61
|
+
<Tooltip tooltip={tooltip}>
|
|
62
|
+
<IconButton onClick={onClick} data-title={title} aria-label={`${tooltip}: ${title}`}>
|
|
59
63
|
<Link title={''} />
|
|
60
|
-
</
|
|
61
|
-
</
|
|
62
|
-
<h2 id={title} tabIndex={
|
|
64
|
+
</IconButton>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
<h2 id={title} tabIndex={-1} dangerouslySetInnerHTML={{ __html: content || '' }} />
|
|
63
67
|
</div>
|
|
64
68
|
);
|
|
65
69
|
};
|
|
@@ -264,8 +264,7 @@ $navigation-row-width: 980px / 3;
|
|
|
264
264
|
|
|
265
265
|
@include mq(desktop) {
|
|
266
266
|
padding: $spacing--large;
|
|
267
|
-
margin: -($spacing + $spacing--small) $spacing + $spacing--small 0 $spacing +
|
|
268
|
-
$spacing--small;
|
|
267
|
+
margin: -($spacing + $spacing--small) $spacing + $spacing--small 0 $spacing + $spacing--small;
|
|
269
268
|
}
|
|
270
269
|
|
|
271
270
|
& > * {
|
|
@@ -362,7 +361,8 @@ $navigation-row-width: 980px / 3;
|
|
|
362
361
|
@include inuit-font-size(26px);
|
|
363
362
|
}
|
|
364
363
|
|
|
365
|
-
a,
|
|
364
|
+
a,
|
|
365
|
+
button {
|
|
366
366
|
padding: 0;
|
|
367
367
|
padding-right: $spacing--small;
|
|
368
368
|
border: 0;
|
|
@@ -374,7 +374,8 @@ $navigation-row-width: 980px / 3;
|
|
|
374
374
|
svg {
|
|
375
375
|
transition: transform 100ms ease;
|
|
376
376
|
}
|
|
377
|
-
&:hover,
|
|
377
|
+
&:hover,
|
|
378
|
+
&:focus {
|
|
378
379
|
svg {
|
|
379
380
|
transform: translateX($spacing--small / 4);
|
|
380
381
|
}
|
|
@@ -386,7 +387,8 @@ $navigation-row-width: 980px / 3;
|
|
|
386
387
|
|
|
387
388
|
@include mq($until: tabletWide) {
|
|
388
389
|
width: 100%;
|
|
389
|
-
a,
|
|
390
|
+
a,
|
|
391
|
+
button {
|
|
390
392
|
background: $brand-color--lighter;
|
|
391
393
|
box-shadow: none;
|
|
392
394
|
width: 100%;
|
|
@@ -402,13 +404,14 @@ $navigation-row-width: 980px / 3;
|
|
|
402
404
|
}
|
|
403
405
|
}
|
|
404
406
|
@include mq($until: mobileWide) {
|
|
405
|
-
a,
|
|
407
|
+
a,
|
|
408
|
+
button {
|
|
406
409
|
padding: 0 $left-margin-narrow-screen;
|
|
407
410
|
}
|
|
408
411
|
}
|
|
409
412
|
}
|
|
410
413
|
&__menu-filter {
|
|
411
|
-
display:flex;
|
|
414
|
+
display: flex;
|
|
412
415
|
flex-wrap: wrap;
|
|
413
416
|
margin-top: -$spacing--small;
|
|
414
417
|
button {
|
|
@@ -453,7 +456,7 @@ $navigation-row-width: 980px / 3;
|
|
|
453
456
|
.c-topic-menu__back-button {
|
|
454
457
|
display: flex;
|
|
455
458
|
align-items: center;
|
|
456
|
-
cursor:pointer;
|
|
459
|
+
cursor: pointer;
|
|
457
460
|
border: 0;
|
|
458
461
|
padding: 0;
|
|
459
462
|
color: $brand-color;
|
|
@@ -484,7 +487,7 @@ $navigation-row-width: 980px / 3;
|
|
|
484
487
|
.c-topic-menu__back-button-slides {
|
|
485
488
|
display: flex;
|
|
486
489
|
align-items: center;
|
|
487
|
-
cursor:pointer;
|
|
490
|
+
cursor: pointer;
|
|
488
491
|
border: 0;
|
|
489
492
|
padding: 0;
|
|
490
493
|
color: $brand-color;
|
|
@@ -734,7 +737,6 @@ $navigation-row-width: 980px / 3;
|
|
|
734
737
|
&:active,
|
|
735
738
|
&:focus {
|
|
736
739
|
background-color: $brand-color--light;
|
|
737
|
-
|
|
738
740
|
}
|
|
739
741
|
}
|
|
740
742
|
|
|
@@ -745,13 +747,13 @@ $navigation-row-width: 980px / 3;
|
|
|
745
747
|
height: auto;
|
|
746
748
|
min-height: $link-height;
|
|
747
749
|
|
|
748
|
-
.c-topic-menu__link-wrapper{
|
|
750
|
+
.c-topic-menu__link-wrapper {
|
|
749
751
|
border-bottom: 1px solid $brand-color--dark;
|
|
750
752
|
padding-bottom: $spacing--small;
|
|
751
753
|
display: flex;
|
|
752
754
|
flex-wrap: wrap;
|
|
753
755
|
@include mq($until: tabletWide) {
|
|
754
|
-
border:0;
|
|
756
|
+
border: 0;
|
|
755
757
|
padding-bottom: 0;
|
|
756
758
|
}
|
|
757
759
|
}
|
|
@@ -871,6 +873,7 @@ $navigation-row-width: 980px / 3;
|
|
|
871
873
|
|
|
872
874
|
&-right {
|
|
873
875
|
justify-content: flex-end;
|
|
876
|
+
margin-right: 16px;
|
|
874
877
|
}
|
|
875
878
|
}
|
|
876
879
|
.c-topic-menu__search {
|
|
@@ -940,7 +943,7 @@ $navigation-row-width: 980px / 3;
|
|
|
940
943
|
padding-right: $spacing + $spacing--small;
|
|
941
944
|
}
|
|
942
945
|
& > nav:first-child {
|
|
943
|
-
margin-top:0;
|
|
946
|
+
margin-top: 0;
|
|
944
947
|
}
|
|
945
948
|
}
|
|
946
949
|
|