@ndla/ui 22.3.0 → 24.1.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.
Files changed (148) hide show
  1. package/es/Article/ArticleAuthorContent.js +2 -4
  2. package/es/Article/ArticleFavoritesButton.js +2 -2
  3. package/es/AuthorInfo/AuthorInfo.js +29 -16
  4. package/es/ContentCard/ContentCard.js +66 -25
  5. package/es/FileList/File.js +34 -8
  6. package/es/FileList/FileList.js +29 -3
  7. package/es/InfoBox/InfoBox.js +10 -3
  8. package/es/InfoWidget/InfoWidget.js +67 -22
  9. package/es/MyNdla/Resource/FolderInput.js +19 -6
  10. package/es/NoContentBox/NoContentBox.js +1 -6
  11. package/es/Portrait/Portrait.js +19 -13
  12. package/es/Resource/BlockResource.js +7 -6
  13. package/es/Resource/ListResource.js +8 -7
  14. package/es/ResourceBox/ResourceBox.js +7 -35
  15. package/es/Search/ActiveFilterContent.js +4 -14
  16. package/es/Search/ActiveFilters.js +8 -19
  17. package/es/Search/SearchField.js +31 -52
  18. package/es/Search/SearchResult.js +113 -136
  19. package/es/Search/ToggleSearchButton.js +34 -43
  20. package/es/Search/index.js +2 -8
  21. package/es/TreeStructure/FolderItems.js +3 -3
  22. package/es/TreeStructure/FolderNameInput.js +32 -14
  23. package/es/all.css +1 -1
  24. package/es/index-javascript.js +0 -1
  25. package/es/index.js +2 -1
  26. package/es/locale/messages-en.js +3 -3
  27. package/es/locale/messages-nb.js +3 -3
  28. package/es/locale/messages-nn.js +3 -3
  29. package/es/locale/messages-se.js +3 -3
  30. package/es/locale/messages-sma.js +3 -3
  31. package/lib/Article/ArticleAuthorContent.js +9 -4
  32. package/lib/Article/ArticleFavoritesButton.js +2 -2
  33. package/lib/AuthorInfo/AuthorInfo.d.ts +1 -11
  34. package/lib/AuthorInfo/AuthorInfo.js +36 -20
  35. package/lib/ContentCard/ContentCard.d.ts +1 -15
  36. package/lib/ContentCard/ContentCard.js +60 -28
  37. package/lib/FileList/File.js +36 -12
  38. package/lib/FileList/FileList.js +28 -5
  39. package/lib/InfoBox/InfoBox.js +12 -5
  40. package/lib/InfoWidget/InfoWidget.js +61 -25
  41. package/lib/MyNdla/Resource/FolderInput.js +18 -5
  42. package/lib/NoContentBox/NoContentBox.js +1 -8
  43. package/lib/Portrait/Portrait.js +19 -14
  44. package/lib/Resource/BlockResource.js +7 -6
  45. package/lib/Resource/ListResource.js +8 -7
  46. package/lib/ResourceBox/ResourceBox.d.ts +1 -4
  47. package/lib/ResourceBox/ResourceBox.js +15 -35
  48. package/lib/Search/ActiveFilterContent.d.ts +13 -0
  49. package/lib/Search/ActiveFilterContent.js +4 -15
  50. package/lib/Search/ActiveFilters.d.ts +13 -0
  51. package/lib/Search/ActiveFilters.js +8 -20
  52. package/lib/Search/SearchField.d.ts +19 -0
  53. package/lib/Search/SearchField.js +32 -56
  54. package/lib/Search/SearchResult.d.ts +36 -0
  55. package/lib/Search/SearchResult.js +116 -159
  56. package/lib/Search/ToggleSearchButton.d.ts +16 -0
  57. package/lib/Search/ToggleSearchButton.js +36 -46
  58. package/lib/Search/index.d.ts +12 -0
  59. package/lib/Search/index.js +0 -54
  60. package/lib/SearchTypeResult/SearchTypeHeader.d.ts +1 -1
  61. package/lib/TreeStructure/FolderItems.js +3 -3
  62. package/lib/TreeStructure/FolderNameInput.js +34 -14
  63. package/lib/TreeStructure/types.d.ts +1 -1
  64. package/lib/all.css +1 -1
  65. package/lib/index-javascript.js +0 -74
  66. package/lib/index.d.ts +1 -0
  67. package/lib/index.js +38 -1
  68. package/lib/locale/messages-en.js +3 -3
  69. package/lib/locale/messages-nb.js +3 -3
  70. package/lib/locale/messages-nn.js +3 -3
  71. package/lib/locale/messages-se.js +3 -3
  72. package/lib/locale/messages-sma.js +3 -3
  73. package/package.json +10 -10
  74. package/src/Article/ArticleAuthorContent.tsx +1 -1
  75. package/src/Article/ArticleFavoritesButton.tsx +2 -2
  76. package/src/AuthorInfo/AuthorInfo.tsx +53 -19
  77. package/src/ContentCard/ContentCard.tsx +127 -35
  78. package/src/FileList/File.tsx +47 -17
  79. package/src/FileList/FileList.tsx +37 -8
  80. package/src/InfoBox/InfoBox.tsx +24 -4
  81. package/src/InfoWidget/InfoWidget.tsx +83 -34
  82. package/src/MyNdla/Resource/FolderInput.tsx +18 -3
  83. package/src/NoContentBox/NoContentBox.tsx +2 -7
  84. package/src/Portrait/Portrait.tsx +25 -10
  85. package/src/Resource/BlockResource.tsx +1 -1
  86. package/src/Resource/ListResource.tsx +3 -1
  87. package/src/ResourceBox/ResourceBox.tsx +1 -20
  88. package/src/Search/{ActiveFilterContent.jsx → ActiveFilterContent.tsx} +11 -12
  89. package/src/Search/{ActiveFilters.jsx → ActiveFilters.tsx} +20 -17
  90. package/src/Search/{SearchField.jsx → SearchField.tsx} +58 -68
  91. package/src/Search/SearchResult.tsx +360 -0
  92. package/src/Search/ToggleSearchButton.tsx +73 -0
  93. package/src/Search/component.search.scss +0 -4
  94. package/src/Search/index.ts +16 -0
  95. package/src/SectionHeading/SectionHeading.tsx +1 -0
  96. package/src/TreeStructure/FolderItems.tsx +1 -1
  97. package/src/TreeStructure/FolderNameInput.tsx +33 -9
  98. package/src/TreeStructure/types.ts +1 -1
  99. package/src/all.scss +0 -1
  100. package/src/index-javascript.js +0 -15
  101. package/src/index.ts +2 -0
  102. package/src/locale/messages-en.ts +3 -3
  103. package/src/locale/messages-nb.ts +3 -3
  104. package/src/locale/messages-nn.ts +3 -3
  105. package/src/locale/messages-se.ts +3 -3
  106. package/src/locale/messages-sma.ts +3 -3
  107. package/src/main.scss +0 -8
  108. package/es/BackgroundImage/BackgroundImage.js +0 -27
  109. package/es/BackgroundImage/index.js +0 -2
  110. package/es/Search/SearchFilter.js +0 -72
  111. package/es/Search/SearchFilterList.js +0 -115
  112. package/es/Search/SearchOverlay.js +0 -39
  113. package/es/Search/SearchPage.js +0 -178
  114. package/es/Search/SearchPopoverFilter.js +0 -152
  115. package/es/Search/SearchResultAuthor.js +0 -51
  116. package/lib/BackgroundImage/BackgroundImage.d.ts +0 -12
  117. package/lib/BackgroundImage/BackgroundImage.js +0 -40
  118. package/lib/BackgroundImage/index.d.ts +0 -2
  119. package/lib/BackgroundImage/index.js +0 -13
  120. package/lib/Search/SearchFilter.js +0 -88
  121. package/lib/Search/SearchFilterList.js +0 -137
  122. package/lib/Search/SearchOverlay.js +0 -62
  123. package/lib/Search/SearchPage.js +0 -207
  124. package/lib/Search/SearchPopoverFilter.js +0 -172
  125. package/lib/Search/SearchResultAuthor.js +0 -60
  126. package/src/AuthorInfo/component.author-info.scss +0 -54
  127. package/src/BackgroundImage/BackgroundImage.tsx +0 -32
  128. package/src/BackgroundImage/component.background-image.scss +0 -52
  129. package/src/BackgroundImage/index.ts +0 -3
  130. package/src/ContentCard/component.content-card.scss +0 -109
  131. package/src/FileList/component.file-list.scss +0 -102
  132. package/src/InfoBox/component.info-box.scss +0 -21
  133. package/src/InfoWidget/component.info-widget.scss +0 -52
  134. package/src/NoContentBox/component.no-content-box.scss +0 -17
  135. package/src/Portrait/component.portrait.scss +0 -29
  136. package/src/Search/SearchFilter.jsx +0 -82
  137. package/src/Search/SearchFilterList.jsx +0 -110
  138. package/src/Search/SearchOverlay.jsx +0 -38
  139. package/src/Search/SearchPage.jsx +0 -178
  140. package/src/Search/SearchPopoverFilter.jsx +0 -109
  141. package/src/Search/SearchResult.jsx +0 -239
  142. package/src/Search/SearchResultAuthor.jsx +0 -54
  143. package/src/Search/ToggleSearchButton.jsx +0 -64
  144. package/src/Search/component.search-filter.scss +0 -67
  145. package/src/Search/component.search-overlay.scss +0 -103
  146. package/src/Search/component.search-page.scss +0 -125
  147. package/src/Search/component.search-result-author.scss +0 -65
  148. package/src/Search/index.js +0 -34
@@ -1,67 +0,0 @@
1
- .c-search-filter {
2
- @include mq(mobileWide) {
3
- + .c-search-filter {
4
- margin-top: $spacing--medium;
5
- }
6
- }
7
-
8
- width: 100%;
9
- text-align: left;
10
-
11
- &--narrow-screen-only {
12
- @include mq(desktop) {
13
- display: none;
14
- }
15
- }
16
-
17
- @include mq(desktop) {
18
- padding: $spacing;
19
- background: $white;
20
- border: none;
21
- margin-bottom: $spacing--small;
22
- }
23
-
24
- &--context-filter {
25
- background: $brand-color--light;
26
- padding: $spacing--medium;
27
- }
28
-
29
- &:first-child {
30
- .c-filter__list {
31
- border-top: 0;
32
- }
33
- }
34
-
35
- @include mq($until: mobileWide) {
36
- margin-bottom: $spacing;
37
-
38
- .c-search-filter {
39
- label {
40
- padding-left: $spacing--large;
41
- }
42
- }
43
-
44
- .c-filter__item {
45
- width: 100%;
46
- }
47
- }
48
-
49
- @include mq($from: mobileWide, $until: desktop) {
50
- .c-search-filter {
51
- + .c-filter__item {
52
- margin-top: $spacing;
53
- }
54
-
55
- .c-filter__item-wrapper {
56
- padding-left: $spacing;
57
- padding-top: $spacing--small;
58
- }
59
- }
60
- }
61
-
62
- @include mq(568px) {
63
- .c-search-filter .c-filter__item {
64
- width: 235px - $spacing;
65
- }
66
- }
67
- }
@@ -1,103 +0,0 @@
1
- $overlay-height: 150px;
2
-
3
- @keyframes searchAnimation {
4
- 0% {
5
- display: none;
6
- opacity: 0;
7
- }
8
- 1% {
9
- opacity: 0.3;
10
- display: block;
11
- top: 13px;
12
- height: 58px;
13
- left: calc(100% - 302px);
14
- right: 302px;
15
- }
16
- 100% {
17
- opacity: 1;
18
- height: $overlay-height;
19
- top: 0;
20
- left: 0;
21
- right: 0;
22
- }
23
- }
24
-
25
- @keyframes closeButton {
26
- 0% {
27
- opacity: 0;
28
- }
29
-
30
- 70% {
31
- opacity: 0;
32
- }
33
-
34
- 100% {
35
- opacity: 1;
36
- }
37
- }
38
-
39
- .c-search-overlay {
40
- z-index: 1000;
41
- height: $overlay-height;
42
- background: $brand-grey--lighter;
43
- position: fixed;
44
- top: 0;
45
- left: 0;
46
- right: 0;
47
-
48
- display: flex;
49
- justify-content: space-between;
50
- align-items: center;
51
-
52
- &-enter {
53
- opacity: 0.3;
54
- top: 13px;
55
- height: 58px;
56
- left: calc(100% - 302px);
57
- right: 302px;
58
-
59
- transition: all 0.3s ease;
60
-
61
- &-active {
62
- opacity: 1;
63
- height: $overlay-height;
64
- top: 0;
65
- left: 0;
66
- right: 0;
67
- }
68
- }
69
-
70
- &-exit {
71
- transition: all 0.3s ease;
72
-
73
- &-active {
74
- @extend .c-search-overlay-enter;
75
- opacity: 0;
76
- }
77
- }
78
-
79
- &__container {
80
- padding: 0;
81
- position: relative;
82
- }
83
-
84
- &__close-button {
85
- position: absolute;
86
- top: $spacing--small;
87
- right: -($spacing--large + 36px);
88
- width: 36px;
89
- height: 36px;
90
- color: $brand-color--dark;
91
- background: none;
92
- border: 0;
93
- padding: 0;
94
- cursor: pointer;
95
-
96
- animation: closeButton 0.7s;
97
-
98
- .c-icon {
99
- width: 100%;
100
- height: 100%;
101
- }
102
- }
103
- }
@@ -1,125 +0,0 @@
1
- $filter-width: 250px;
2
- $search-field-wrapper-margin: $filter-width;
3
- .c-search-page {
4
- &__close-button {
5
- display: inline-flex;
6
- align-items: center;
7
- box-shadow: none;
8
- position: absolute;
9
- right: $spacing--small;
10
- top: $spacing--small;
11
- @include font-size(16px, 20px);
12
- cursor: pointer;
13
-
14
- @include mq(desktop) {
15
- display: none;
16
- }
17
-
18
- span {
19
- box-shadow: $link;
20
- color: $brand-color;
21
- margin-right: $spacing--small;
22
- }
23
-
24
- .c-icon {
25
- color: $brand-color--dark;
26
- width: 24px;
27
- height: 24px;
28
- }
29
- }
30
-
31
- &__toggle-filter {
32
- @include mq(desktop) {
33
- display: none;
34
- }
35
- margin-bottom: $spacing;
36
- }
37
-
38
- &__filter-result-wrapper {
39
- @include mq(desktop) {
40
- display: flex;
41
- }
42
- }
43
-
44
- &__search-field-wrapper {
45
- padding: $spacing 0 $spacing 0;
46
- @include mq(desktop) {
47
- padding: $spacing--large 0 $spacing--large $spacing--small;
48
- margin-left: $search-field-wrapper-margin;
49
- }
50
- .c-search-field__input-wrapper {
51
- padding: 0;
52
- margin: 0;
53
- }
54
- @include mq($until: desktop) {
55
- .c-active-filters {
56
- display: none;
57
- }
58
- }
59
- }
60
-
61
- &__active-filters {
62
- margin-bottom: $spacing;
63
-
64
- @include mq(desktop) {
65
- display: none;
66
- }
67
- }
68
-
69
- &__filter-wrapper {
70
- display: none;
71
-
72
- @include mq($until: desktop) {
73
- position: fixed;
74
- top: 0;
75
- left: 0;
76
- bottom: 0;
77
- right: 0;
78
- overflow: auto;
79
- background: $white;
80
- margin-right: 0;
81
- z-index: 100;
82
- padding-top: $spacing * 3;
83
- }
84
-
85
- flex-basis: $filter-width;
86
- flex-shrink: 0;
87
- margin-right: $spacing--small;
88
- text-align: center;
89
-
90
- &--expanded {
91
- display: block;
92
- position: fixed;
93
- padding-bottom: $spacing--large;
94
- animation: slideIn 0.5s;
95
- }
96
-
97
- @include mq(desktop) {
98
- display: block;
99
- width: $filter-width;
100
- }
101
- }
102
-
103
- &__filter-heading {
104
- text-align: left;
105
- text-transform: uppercase;
106
- display: none;
107
- margin: 0;
108
- font-weight: 600;
109
- @include font-size(18px, 32px);
110
-
111
- @include mq(desktop) {
112
- display: block;
113
- }
114
- }
115
-
116
- &__filters {
117
- & > button {
118
- margin-top: $spacing;
119
- }
120
- }
121
-
122
- &__result-wrapper {
123
- flex-grow: 1;
124
- }
125
- }
@@ -1,65 +0,0 @@
1
- .c-search-result-author {
2
- background: $brand-grey--lighter;
3
- padding: $spacing;
4
- display: flex;
5
- align-items: flex-start;
6
- justify-content: space-between;
7
- margin-bottom: $spacing;
8
- &--desktop {
9
- @include mq($until: desktop) {
10
- display: none;
11
- }
12
- }
13
- &--tablet {
14
- @include mq(desktop) {
15
- display: none;
16
- }
17
- }
18
- @include mq($until: desktop) {
19
- flex-direction: row-reverse;
20
- background: none;
21
- padding: 0 0 $spacing 0;
22
- justify-content: flex-end;
23
- align-items: center;
24
- &__portrait-image {
25
- margin-right: $spacing--medium;
26
- }
27
- &__url {
28
- display: none;
29
- }
30
- }
31
- &__heading {
32
- margin: 0 0 $spacing--small;
33
- @include font-size(24px, 32px);
34
- font-weight: $font-weight-bold;
35
- @include mq($until: desktop) {
36
- display: none;
37
- }
38
- }
39
- p {
40
- margin: 0;
41
- }
42
- &__links {
43
- display: flex;
44
- &:empty {
45
- display: none;
46
- }
47
- a:not(:last-child) {
48
- margin-right: $spacing--large;
49
- }
50
- }
51
- @include mq($until: tablet) {
52
- p, a {
53
- @include font-size(16px, 24px);
54
- }
55
- &__portrait-image {
56
- margin-right: $spacing;
57
- width: 4rem;
58
- height: 4rem;
59
- span {
60
- width: 4rem;
61
- height: 4rem;
62
- }
63
- }
64
- }
65
- }
@@ -1,34 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import SearchField from './SearchField';
10
- import SearchOverlay from './SearchOverlay';
11
- import SearchPage from './SearchPage';
12
-
13
- import { SearchResult, SearchResultList, SearchResultItem } from './SearchResult';
14
-
15
- import SearchFilter from './SearchFilter';
16
- import SearchFilterList from './SearchFilterList';
17
- import SearchPopoverFilter from './SearchPopoverFilter';
18
- import SearchResultAuthor from './SearchResultAuthor';
19
- import ActiveFilters from './ActiveFilters';
20
- export { default as ToggleSearchButton } from './ToggleSearchButton';
21
-
22
- export {
23
- SearchField,
24
- SearchOverlay,
25
- SearchPage,
26
- SearchResult,
27
- SearchResultItem,
28
- SearchResultList,
29
- SearchFilter,
30
- SearchFilterList,
31
- SearchPopoverFilter,
32
- SearchResultAuthor,
33
- ActiveFilters,
34
- };