@ndla/ui 48.0.0 → 49.0.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/BlogPost/BlogPost.js +6 -6
- package/es/CampaignBlock/CampaignBlock.js +8 -8
- package/es/CopyParagraphButton/CopyParagraphButton.js +30 -58
- package/es/CopyParagraphButton/index.js +1 -3
- package/es/Embed/RelatedContentEmbed.js +3 -3
- package/es/FactBox/FactBox.js +64 -19
- package/es/FactBox/index.js +0 -1
- package/es/Figure/index.js +0 -2
- package/es/FileList/File.js +46 -24
- package/es/FileList/FileList.js +18 -14
- package/es/FileList/index.js +0 -2
- package/es/LinkBlock/LinkBlock.js +7 -7
- package/es/Messages/index.js +1 -2
- package/es/Navigation/index.js +1 -2
- package/es/RelatedArticleList/RelatedArticleList.js +80 -35
- package/es/RelatedArticleList/index.js +2 -3
- package/es/Search/index.js +0 -1
- package/es/all.css +1 -1
- package/es/i18n/i18n.js +2 -1
- package/es/index.js +9 -11
- package/es/utils/relativeUrl.js +17 -2
- package/lib/BlogPost/BlogPost.js +5 -5
- package/lib/CampaignBlock/CampaignBlock.js +7 -7
- package/lib/CopyParagraphButton/CopyParagraphButton.d.ts +5 -4
- package/lib/CopyParagraphButton/CopyParagraphButton.js +29 -57
- package/lib/CopyParagraphButton/index.d.ts +1 -3
- package/lib/CopyParagraphButton/index.js +0 -14
- package/lib/Embed/RelatedContentEmbed.js +3 -3
- package/lib/FactBox/FactBox.d.ts +1 -4
- package/lib/FactBox/FactBox.js +72 -27
- package/lib/FactBox/index.d.ts +0 -1
- package/lib/FactBox/index.js +0 -7
- package/lib/Figure/index.d.ts +0 -2
- package/lib/Figure/index.js +0 -14
- package/lib/FileList/File.d.ts +22 -3
- package/lib/FileList/File.js +45 -25
- package/lib/FileList/FileList.d.ts +10 -14
- package/lib/FileList/FileList.js +17 -15
- package/lib/FileList/index.d.ts +0 -2
- package/lib/FileList/index.js +0 -14
- package/lib/LinkBlock/LinkBlock.js +6 -6
- package/lib/Messages/index.d.ts +1 -2
- package/lib/Messages/index.js +0 -7
- package/lib/Navigation/index.d.ts +1 -2
- package/lib/Navigation/index.js +0 -7
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +16 -17
- package/lib/RelatedArticleList/RelatedArticleList.js +78 -35
- package/lib/RelatedArticleList/index.d.ts +2 -3
- package/lib/RelatedArticleList/index.js +2 -12
- package/lib/Search/index.d.ts +0 -1
- package/lib/Search/index.js +0 -7
- package/lib/all.css +1 -1
- package/lib/i18n/i18n.d.ts +1 -0
- package/lib/i18n/i18n.js +4 -2
- package/lib/index.d.ts +9 -11
- package/lib/index.js +9 -89
- package/lib/utils/relativeUrl.d.ts +1 -1
- package/lib/utils/relativeUrl.js +19 -4
- package/package.json +8 -8
- package/src/BlogPost/BlogPost.tsx +2 -2
- package/src/CampaignBlock/CampaignBlock.tsx +2 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +24 -46
- package/src/CopyParagraphButton/index.tsx +1 -3
- package/src/Embed/RelatedContentEmbed.stories.tsx +9 -9
- package/src/Embed/RelatedContentEmbed.tsx +3 -3
- package/src/FactBox/FactBox.tsx +29 -16
- package/src/FactBox/Factbox.stories.tsx +4 -4
- package/src/FactBox/index.ts +0 -2
- package/src/Figure/index.ts +0 -2
- package/src/FileList/File.tsx +62 -32
- package/src/FileList/FileList.stories.tsx +15 -15
- package/src/FileList/FileList.tsx +21 -27
- package/src/FileList/index.ts +0 -2
- package/src/LinkBlock/LinkBlock.tsx +2 -2
- package/src/Messages/index.ts +1 -2
- package/src/Navigation/index.ts +1 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +53 -47
- package/src/RelatedArticleList/index.ts +2 -3
- package/src/Search/index.ts +0 -1
- package/src/i18n/i18n.ts +2 -1
- package/src/index.ts +10 -13
- package/src/main.scss +0 -1
- package/src/utils/__tests__/relativeUrl-test.tsx +72 -0
- package/src/utils/relativeUrl.ts +19 -2
- package/es/CopyParagraphButton/CopyParagraphButtonV2.js +0 -87
- package/es/CopyParagraphButton/initCopyParagraphButtons.js +0 -29
- package/es/FactBox/FactBoxV2.js +0 -93
- package/es/Figure/FigureBylineExpandButton.js +0 -29
- package/es/Figure/FigureExpandButton.js +0 -30
- package/es/FileList/FileListV2.js +0 -47
- package/es/FileList/FileV2.js +0 -32
- package/es/Masthead/MastheadSearchModal.js +0 -82
- package/es/Messages/MessageBoxTag.js +0 -33
- package/es/MultidisciplinarySubject/List.js +0 -52
- package/es/MultidisciplinarySubject/ListItem.js +0 -90
- package/es/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -125
- package/es/MultidisciplinarySubject/index.js +0 -10
- package/es/Navigation/NavigationTopicAbout.js +0 -164
- package/es/RelatedArticleList/RelatedArticleV2.js +0 -125
- package/es/Search/ToggleSearchButton.js +0 -51
- package/es/Translation/Translation.js +0 -33
- package/es/Translation/TranslationLine.js +0 -47
- package/es/Translation/index.js +0 -2
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.d.ts +0 -15
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.js +0 -92
- package/lib/CopyParagraphButton/initCopyParagraphButtons.d.ts +0 -2
- package/lib/CopyParagraphButton/initCopyParagraphButtons.js +0 -38
- package/lib/FactBox/FactBoxV2.d.ts +0 -13
- package/lib/FactBox/FactBoxV2.js +0 -98
- package/lib/Figure/FigureBylineExpandButton.d.ts +0 -16
- package/lib/Figure/FigureBylineExpandButton.js +0 -35
- package/lib/Figure/FigureExpandButton.d.ts +0 -16
- package/lib/Figure/FigureExpandButton.js +0 -35
- package/lib/FileList/FileListV2.d.ts +0 -13
- package/lib/FileList/FileListV2.js +0 -52
- package/lib/FileList/FileV2.d.ts +0 -15
- package/lib/FileList/FileV2.js +0 -40
- package/lib/Masthead/MastheadSearchModal.d.ts +0 -8
- package/lib/Masthead/MastheadSearchModal.js +0 -89
- package/lib/Messages/MessageBoxTag.d.ts +0 -12
- package/lib/Messages/MessageBoxTag.js +0 -40
- package/lib/MultidisciplinarySubject/List.d.ts +0 -7
- package/lib/MultidisciplinarySubject/List.js +0 -59
- package/lib/MultidisciplinarySubject/ListItem.d.ts +0 -10
- package/lib/MultidisciplinarySubject/ListItem.js +0 -97
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.d.ts +0 -13
- package/lib/MultidisciplinarySubject/MultidisciplinarySubject.js +0 -135
- package/lib/MultidisciplinarySubject/index.d.ts +0 -9
- package/lib/MultidisciplinarySubject/index.js +0 -17
- package/lib/Navigation/NavigationTopicAbout.d.ts +0 -13
- package/lib/Navigation/NavigationTopicAbout.js +0 -171
- package/lib/RelatedArticleList/RelatedArticleV2.d.ts +0 -26
- package/lib/RelatedArticleList/RelatedArticleV2.js +0 -131
- package/lib/Search/ToggleSearchButton.d.ts +0 -14
- package/lib/Search/ToggleSearchButton.js +0 -57
- package/lib/Translation/Translation.d.ts +0 -14
- package/lib/Translation/Translation.js +0 -38
- package/lib/Translation/TranslationLine.d.ts +0 -16
- package/lib/Translation/TranslationLine.js +0 -51
- package/lib/Translation/index.d.ts +0 -2
- package/lib/Translation/index.js +0 -20
- package/src/CopyParagraphButton/CopyParagraphButtonV2.tsx +0 -85
- package/src/CopyParagraphButton/initCopyParagraphButtons.tsx +0 -27
- package/src/FactBox/FactBoxV2.tsx +0 -56
- package/src/Figure/FigureBylineExpandButton.tsx +0 -34
- package/src/Figure/FigureExpandButton.tsx +0 -35
- package/src/FileList/FileListV2.tsx +0 -58
- package/src/FileList/FileV2.tsx +0 -33
- package/src/Masthead/MastheadSearchModal.tsx +0 -101
- package/src/Messages/MessageBoxTag.tsx +0 -34
- package/src/MultidisciplinarySubject/List.tsx +0 -49
- package/src/MultidisciplinarySubject/ListItem.tsx +0 -74
- package/src/MultidisciplinarySubject/MultidisciplinarySubject.tsx +0 -117
- package/src/MultidisciplinarySubject/index.ts +0 -11
- package/src/Navigation/NavigationTopicAbout.tsx +0 -171
- package/src/RelatedArticleList/RelatedArticleV2.tsx +0 -101
- package/src/Search/ToggleSearchButton.tsx +0 -64
- package/src/Translation/Translation.tsx +0 -29
- package/src/Translation/TranslationLine.tsx +0 -42
- package/src/Translation/component.translation.scss +0 -53
- package/src/Translation/index.ts +0 -2
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _core = require("@ndla/core");
|
|
11
|
-
var _common = require("@ndla/icons/common");
|
|
12
|
-
var _button = require("@ndla/button");
|
|
13
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
-
var _excluded = ["children", "ndlaFilm"];
|
|
15
|
-
/**
|
|
16
|
-
* Copyright (c) 2018-present, NDLA.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
-
var StyledButton = /*#__PURE__*/(0, _base.default)(_button.ButtonV2, {
|
|
31
|
-
target: "e18v7i6v1",
|
|
32
|
-
label: "StyledButton"
|
|
33
|
-
})("border-radius:", _core.misc.borderRadius, ";border:0;color:", _core.colors.brand.primary, ";align-items:center;background:transparent;svg{height:24px;width:24px;}", _core.fonts.sizes('16px', '32px'), ";&[data-film='true']{background:", _core.colors.ndlaFilm.filmColorBright, ";color:", _core.colors.white, ";}", _core.mq.range({
|
|
34
|
-
from: _core.breakpoints.tabletWide
|
|
35
|
-
}), "{padding:", _core.spacing.small, " ", _core.spacing.normal, ";background:", _core.colors.brand.greyLighter, ";}&:hover,&:focus,&:active{border:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvZ2dsZVNlYXJjaEJ1dHRvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0JxQyIsImZpbGUiOiJUb2dnbGVTZWFyY2hCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTgtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgc3BhY2luZywgYnJlYWtwb2ludHMsIG1xLCBtaXNjLCBmb250cywgY29sb3JzIH0gZnJvbSAnQG5kbGEvY29yZSc7XG5pbXBvcnQgeyBTZWFyY2ggfSBmcm9tICdAbmRsYS9pY29ucy9jb21tb24nO1xuaW1wb3J0IHsgQnV0dG9uUHJvcHMsIEJ1dHRvblYyIH0gZnJvbSAnQG5kbGEvYnV0dG9uJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW50ZXJmYWNlIFByb3BzIGV4dGVuZHMgQnV0dG9uUHJvcHMge1xuICBuZGxhRmlsbT86IGJvb2xlYW47XG59XG5cbmNvbnN0IFN0eWxlZEJ1dHRvbiA9IHN0eWxlZChCdXR0b25WMilgXG4gIGJvcmRlci1yYWRpdXM6ICR7bWlzYy5ib3JkZXJSYWRpdXN9O1xuICBib3JkZXI6IDA7XG4gIGNvbG9yOiAke2NvbG9ycy5icmFuZC5wcmltYXJ5fTtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG5cbiAgc3ZnIHtcbiAgICBoZWlnaHQ6IDI0cHg7XG4gICAgd2lkdGg6IDI0cHg7XG4gIH1cblxuICAke2ZvbnRzLnNpemVzKCcxNnB4JywgJzMycHgnKX07XG5cbiAgJltkYXRhLWZpbG09J3RydWUnXSB7XG4gICAgYmFja2dyb3VuZDogJHtjb2xvcnMubmRsYUZpbG0uZmlsbUNvbG9yQnJpZ2h0fTtcbiAgICBjb2xvcjogJHtjb2xvcnMud2hpdGV9O1xuICB9XG5cbiAgJHttcS5yYW5nZSh7IGZyb206IGJyZWFrcG9pbnRzLnRhYmxldFdpZGUgfSl9IHtcbiAgICBwYWRkaW5nOiAke3NwYWNpbmcuc21hbGx9ICR7c3BhY2luZy5ub3JtYWx9O1xuICAgIGJhY2tncm91bmQ6ICR7Y29sb3JzLmJyYW5kLmdyZXlMaWdodGVyfTtcbiAgfVxuICAmOmhvdmVyLFxuICAmOmZvY3VzLFxuICAmOmFjdGl2ZSB7XG4gICAgYm9yZGVyOiAwO1xuICB9XG5gO1xuXG5jb25zdCBTdHlsZWRTcGFuID0gc3R5bGVkLnNwYW5gXG4gIG1hcmdpbi1yaWdodDogJHtzcGFjaW5nLm5vcm1hbH07XG4gIGZvbnQtd2VpZ2h0OiAke2ZvbnRzLndlaWdodC5ub3JtYWx9O1xuICAke21xLnJhbmdlKHsgdW50aWw6IGJyZWFrcG9pbnRzLnRhYmxldFdpZGUgfSl9IHtcbiAgICBkaXNwbGF5OiBub25lO1xuICB9XG5gO1xuXG5jb25zdCBUb2dnbGVTZWFyY2hCdXR0b24gPSBmb3J3YXJkUmVmPEhUTUxCdXR0b25FbGVtZW50LCBQcm9wcz4oKHsgY2hpbGRyZW4sIG5kbGFGaWxtLCAuLi5yZXN0IH0sIHJlZikgPT4gKFxuICA8U3R5bGVkQnV0dG9uIGRhdGEtZmlsbT17bmRsYUZpbG19IHR5cGU9XCJidXR0b25cIiByZWY9e3JlZn0gey4uLnJlc3R9PlxuICAgIDxTdHlsZWRTcGFuPntjaGlsZHJlbn08L1N0eWxlZFNwYW4+XG4gICAgPFNlYXJjaCAvPlxuICA8L1N0eWxlZEJ1dHRvbj5cbikpO1xuXG5leHBvcnQgZGVmYXVsdCBUb2dnbGVTZWFyY2hCdXR0b247XG4iXX0= */"));
|
|
36
|
-
var StyledSpan = /*#__PURE__*/(0, _base.default)("span", {
|
|
37
|
-
target: "e18v7i6v0",
|
|
38
|
-
label: "StyledSpan"
|
|
39
|
-
})("margin-right:", _core.spacing.normal, ";font-weight:", _core.fonts.weight.normal, ";", _core.mq.range({
|
|
40
|
-
until: _core.breakpoints.tabletWide
|
|
41
|
-
}), "{display:none;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvZ2dsZVNlYXJjaEJ1dHRvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0Q4QiIsImZpbGUiOiJUb2dnbGVTZWFyY2hCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTgtcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgc3BhY2luZywgYnJlYWtwb2ludHMsIG1xLCBtaXNjLCBmb250cywgY29sb3JzIH0gZnJvbSAnQG5kbGEvY29yZSc7XG5pbXBvcnQgeyBTZWFyY2ggfSBmcm9tICdAbmRsYS9pY29ucy9jb21tb24nO1xuaW1wb3J0IHsgQnV0dG9uUHJvcHMsIEJ1dHRvblYyIH0gZnJvbSAnQG5kbGEvYnV0dG9uJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW50ZXJmYWNlIFByb3BzIGV4dGVuZHMgQnV0dG9uUHJvcHMge1xuICBuZGxhRmlsbT86IGJvb2xlYW47XG59XG5cbmNvbnN0IFN0eWxlZEJ1dHRvbiA9IHN0eWxlZChCdXR0b25WMilgXG4gIGJvcmRlci1yYWRpdXM6ICR7bWlzYy5ib3JkZXJSYWRpdXN9O1xuICBib3JkZXI6IDA7XG4gIGNvbG9yOiAke2NvbG9ycy5icmFuZC5wcmltYXJ5fTtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG5cbiAgc3ZnIHtcbiAgICBoZWlnaHQ6IDI0cHg7XG4gICAgd2lkdGg6IDI0cHg7XG4gIH1cblxuICAke2ZvbnRzLnNpemVzKCcxNnB4JywgJzMycHgnKX07XG5cbiAgJltkYXRhLWZpbG09J3RydWUnXSB7XG4gICAgYmFja2dyb3VuZDogJHtjb2xvcnMubmRsYUZpbG0uZmlsbUNvbG9yQnJpZ2h0fTtcbiAgICBjb2xvcjogJHtjb2xvcnMud2hpdGV9O1xuICB9XG5cbiAgJHttcS5yYW5nZSh7IGZyb206IGJyZWFrcG9pbnRzLnRhYmxldFdpZGUgfSl9IHtcbiAgICBwYWRkaW5nOiAke3NwYWNpbmcuc21hbGx9ICR7c3BhY2luZy5ub3JtYWx9O1xuICAgIGJhY2tncm91bmQ6ICR7Y29sb3JzLmJyYW5kLmdyZXlMaWdodGVyfTtcbiAgfVxuICAmOmhvdmVyLFxuICAmOmZvY3VzLFxuICAmOmFjdGl2ZSB7XG4gICAgYm9yZGVyOiAwO1xuICB9XG5gO1xuXG5jb25zdCBTdHlsZWRTcGFuID0gc3R5bGVkLnNwYW5gXG4gIG1hcmdpbi1yaWdodDogJHtzcGFjaW5nLm5vcm1hbH07XG4gIGZvbnQtd2VpZ2h0OiAke2ZvbnRzLndlaWdodC5ub3JtYWx9O1xuICAke21xLnJhbmdlKHsgdW50aWw6IGJyZWFrcG9pbnRzLnRhYmxldFdpZGUgfSl9IHtcbiAgICBkaXNwbGF5OiBub25lO1xuICB9XG5gO1xuXG5jb25zdCBUb2dnbGVTZWFyY2hCdXR0b24gPSBmb3J3YXJkUmVmPEhUTUxCdXR0b25FbGVtZW50LCBQcm9wcz4oKHsgY2hpbGRyZW4sIG5kbGFGaWxtLCAuLi5yZXN0IH0sIHJlZikgPT4gKFxuICA8U3R5bGVkQnV0dG9uIGRhdGEtZmlsbT17bmRsYUZpbG19IHR5cGU9XCJidXR0b25cIiByZWY9e3JlZn0gey4uLnJlc3R9PlxuICAgIDxTdHlsZWRTcGFuPntjaGlsZHJlbn08L1N0eWxlZFNwYW4+XG4gICAgPFNlYXJjaCAvPlxuICA8L1N0eWxlZEJ1dHRvbj5cbikpO1xuXG5leHBvcnQgZGVmYXVsdCBUb2dnbGVTZWFyY2hCdXR0b247XG4iXX0= */"));
|
|
42
|
-
var ToggleSearchButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
43
|
-
var children = _ref.children,
|
|
44
|
-
ndlaFilm = _ref.ndlaFilm,
|
|
45
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
return (0, _jsxRuntime.jsxs)(StyledButton, _objectSpread(_objectSpread({
|
|
47
|
-
"data-film": ndlaFilm,
|
|
48
|
-
type: "button",
|
|
49
|
-
ref: ref
|
|
50
|
-
}, rest), {}, {
|
|
51
|
-
children: [(0, _jsxRuntime.jsx)(StyledSpan, {
|
|
52
|
-
children: children
|
|
53
|
-
}), (0, _jsxRuntime.jsx)(_common.Search, {})]
|
|
54
|
-
}));
|
|
55
|
-
});
|
|
56
|
-
var _default = ToggleSearchButton;
|
|
57
|
-
exports.default = _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2016-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
|
-
import { ReactNode } from 'react';
|
|
9
|
-
interface Props {
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
index: number;
|
|
12
|
-
}
|
|
13
|
-
declare const Translation: ({ children, index }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
-
export default Translation;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
16
|
-
* Copyright (c) 2016-present, NDLA.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
var classes = new _reactBemHelper.default({
|
|
23
|
-
name: 'translation',
|
|
24
|
-
prefix: 'c-'
|
|
25
|
-
});
|
|
26
|
-
var Translation = function Translation(_ref) {
|
|
27
|
-
var children = _ref.children,
|
|
28
|
-
index = _ref.index;
|
|
29
|
-
return (0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, classes('')), {}, {
|
|
30
|
-
children: [(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, classes('index')), {}, {
|
|
31
|
-
children: index
|
|
32
|
-
})), (0, _jsxRuntime.jsx)("dl", _objectSpread(_objectSpread({}, classes('wrapper')), {}, {
|
|
33
|
-
children: children
|
|
34
|
-
}))]
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
var _default = Translation;
|
|
38
|
-
exports.default = _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2016-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
|
-
import { ReactNode } from 'react';
|
|
9
|
-
interface Props {
|
|
10
|
-
isTerm?: boolean;
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
lang?: string;
|
|
13
|
-
langName?: string;
|
|
14
|
-
}
|
|
15
|
-
declare const TranslationLine: ({ children, lang, langName, isTerm }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default TranslationLine;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
16
|
-
* Copyright (c) 2016-present, NDLA.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
var classes = new _reactBemHelper.default({
|
|
23
|
-
name: 'translation',
|
|
24
|
-
prefix: 'c-'
|
|
25
|
-
});
|
|
26
|
-
var TranslationLine = function TranslationLine(_ref) {
|
|
27
|
-
var children = _ref.children,
|
|
28
|
-
lang = _ref.lang,
|
|
29
|
-
langName = _ref.langName,
|
|
30
|
-
_ref$isTerm = _ref.isTerm,
|
|
31
|
-
isTerm = _ref$isTerm === void 0 ? false : _ref$isTerm;
|
|
32
|
-
var hasLang = langName && lang;
|
|
33
|
-
var content = (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
34
|
-
children: [(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, classes('line-body')), {}, {
|
|
35
|
-
lang: lang,
|
|
36
|
-
children: children
|
|
37
|
-
})), hasLang && (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, classes('line-lang')), {}, {
|
|
38
|
-
children: langName
|
|
39
|
-
}))]
|
|
40
|
-
});
|
|
41
|
-
if (isTerm) {
|
|
42
|
-
return (0, _jsxRuntime.jsx)("dt", _objectSpread(_objectSpread({}, classes('line', hasLang ? 'lang' : '')), {}, {
|
|
43
|
-
children: content
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
return (0, _jsxRuntime.jsx)("dd", _objectSpread(_objectSpread({}, classes('line', hasLang ? 'lang' : '')), {}, {
|
|
47
|
-
children: content
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
var _default = TranslationLine;
|
|
51
|
-
exports.default = _default;
|
package/lib/Translation/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Translation", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Translation.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TranslationLine", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _TranslationLine.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _Translation = _interopRequireDefault(require("./Translation"));
|
|
19
|
-
var _TranslationLine = _interopRequireDefault(require("./TranslationLine"));
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021-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 { MouseEvent, ReactNode, useCallback, useEffect, useMemo, useState } from 'react';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
11
|
-
import styled from '@emotion/styled';
|
|
12
|
-
import { colors } from '@ndla/core';
|
|
13
|
-
import Tooltip from '@ndla/tooltip';
|
|
14
|
-
import { Link } from '@ndla/icons/common';
|
|
15
|
-
import { copyTextToClipboard } from '@ndla/util';
|
|
16
|
-
|
|
17
|
-
const ContainerDiv = styled.div`
|
|
18
|
-
position: relative;
|
|
19
|
-
`;
|
|
20
|
-
const IconButton = styled.button`
|
|
21
|
-
position: absolute;
|
|
22
|
-
left: -3em;
|
|
23
|
-
top: 0.1em;
|
|
24
|
-
background: none;
|
|
25
|
-
border: 0;
|
|
26
|
-
z-index: 1;
|
|
27
|
-
transition: 0.2s;
|
|
28
|
-
opacity: 0;
|
|
29
|
-
color: ${colors.brand.grey};
|
|
30
|
-
|
|
31
|
-
& svg {
|
|
32
|
-
width: 30px;
|
|
33
|
-
height: 30px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
${ContainerDiv}:hover &,
|
|
37
|
-
&:focus, &:focus-visible, &:active {
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
opacity: 1;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
interface Props {
|
|
44
|
-
// What to render within the h2
|
|
45
|
-
children: ReactNode;
|
|
46
|
-
copyText: string;
|
|
47
|
-
lang?: string;
|
|
48
|
-
}
|
|
49
|
-
const CopyParagraphButtonV2 = ({ children, copyText, lang }: Props) => {
|
|
50
|
-
const [hasCopied, setHasCopied] = useState(false);
|
|
51
|
-
const { t } = useTranslation();
|
|
52
|
-
const sanitizedTitle = useMemo(() => encodeURIComponent(copyText.replace(/ /g, '-')), [copyText]);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (hasCopied) {
|
|
56
|
-
setTimeout(() => setHasCopied(false), 3000);
|
|
57
|
-
}
|
|
58
|
-
}, [hasCopied]);
|
|
59
|
-
|
|
60
|
-
const onCopyClick = useCallback(() => {
|
|
61
|
-
setHasCopied(true);
|
|
62
|
-
const { location } = window;
|
|
63
|
-
const newHash = `#${sanitizedTitle}`;
|
|
64
|
-
const port = location.port ? `:${location.port}` : '';
|
|
65
|
-
const urlToCopy = `${location.protocol}//${location.hostname}${port}${location.pathname}${location.search}${newHash}`;
|
|
66
|
-
|
|
67
|
-
copyTextToClipboard(urlToCopy);
|
|
68
|
-
}, [sanitizedTitle]);
|
|
69
|
-
|
|
70
|
-
const tooltip = hasCopied ? t('article.copyPageLinkCopied') : t('article.copyHeaderLink');
|
|
71
|
-
return (
|
|
72
|
-
<ContainerDiv>
|
|
73
|
-
<Tooltip tooltip={tooltip}>
|
|
74
|
-
<IconButton onClick={onCopyClick} aria-label={`${tooltip}: ${copyText}`}>
|
|
75
|
-
<Link />
|
|
76
|
-
</IconButton>
|
|
77
|
-
</Tooltip>
|
|
78
|
-
<h2 id={sanitizedTitle} tabIndex={-1} lang={lang}>
|
|
79
|
-
{children}
|
|
80
|
-
</h2>
|
|
81
|
-
</ContainerDiv>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export default CopyParagraphButtonV2;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021-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
|
-
import ReactDOM from 'react-dom';
|
|
9
|
-
import CopyParagraphButton from './CopyParagraphButton';
|
|
10
|
-
|
|
11
|
-
const forEachElement = (selector: string, callback: Function) => {
|
|
12
|
-
const nodeList = document.querySelectorAll(selector);
|
|
13
|
-
for (let i = 0; i < nodeList.length; i += 1) {
|
|
14
|
-
callback(nodeList[i], i);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const initCopyParagraphButtons = () => {
|
|
19
|
-
forEachElement('[data-header-copy-container]', (el: HTMLElement) => {
|
|
20
|
-
const title = el.getAttribute('data-title');
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line react/no-deprecated
|
|
23
|
-
ReactDOM.hydrate(<CopyParagraphButton title={title} content={title} hydrate />, el);
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default initCopyParagraphButtons;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2016-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 { ReactNode, useState } from 'react';
|
|
10
|
-
import BEMHelper from 'react-bem-helper';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import styled from '@emotion/styled';
|
|
13
|
-
import { IconButtonV2 } from '@ndla/button';
|
|
14
|
-
import { ChevronDown, ChevronUp } from '@ndla/icons/common';
|
|
15
|
-
|
|
16
|
-
const classes = new BEMHelper({
|
|
17
|
-
name: 'factbox',
|
|
18
|
-
prefix: 'c-',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const StyledAside = styled.aside`
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
align-items: center;
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
const StyledDiv = styled.div`
|
|
32
|
-
width: 100%;
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
const StyledIconButton = styled(IconButtonV2)`
|
|
36
|
-
margin-top: -20px;
|
|
37
|
-
z-index: 1;
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
const FactBox = ({ children }: Props) => {
|
|
41
|
-
const { t } = useTranslation();
|
|
42
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
43
|
-
|
|
44
|
-
const additional = isOpen ? 'expanded' : '';
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<StyledAside {...classes(undefined, undefined, additional)}>
|
|
48
|
-
<StyledDiv {...classes('content')}>{children}</StyledDiv>
|
|
49
|
-
<StyledIconButton onClick={() => setIsOpen((p) => !p)} aria-label={t(`factbox.${isOpen ? 'close' : 'open'}`)}>
|
|
50
|
-
{isOpen ? <ChevronUp /> : <ChevronDown />}
|
|
51
|
-
</StyledIconButton>
|
|
52
|
-
</StyledAside>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default FactBox;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021-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 { ChevronUp, ChevronDown } from '@ndla/icons/common';
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
messages: {
|
|
13
|
-
expandBylineButtonLabel: string;
|
|
14
|
-
minimizeBylineButtonLabel: string;
|
|
15
|
-
};
|
|
16
|
-
typeClass: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const FigureBylineExpandButton = ({ messages, typeClass }: Props) => {
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="c-figure__show-byline-btn"
|
|
23
|
-
type="button"
|
|
24
|
-
data-figure-button
|
|
25
|
-
data-classtype={typeClass}
|
|
26
|
-
data-aria={messages.expandBylineButtonLabel}
|
|
27
|
-
data-ariaexpanded={messages.minimizeBylineButtonLabel}
|
|
28
|
-
aria-label={messages.expandBylineButtonLabel}
|
|
29
|
-
>
|
|
30
|
-
<ChevronUp className="expanded-icon" />
|
|
31
|
-
<ChevronDown className="contracted-icon" />
|
|
32
|
-
</button>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-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 { ArrowCollapse } from '@ndla/icons/common';
|
|
10
|
-
import { ExpandTwoArrows } from '@ndla/icons/action';
|
|
11
|
-
|
|
12
|
-
export function FigureExpandButton({ messages, typeClass }: Props) {
|
|
13
|
-
return (
|
|
14
|
-
<button
|
|
15
|
-
className="c-figure__fullscreen-btn"
|
|
16
|
-
type="button"
|
|
17
|
-
data-aria={messages.zoomImageButtonLabel}
|
|
18
|
-
data-ariaexpanded={messages.zoomOutImageButtonLabel}
|
|
19
|
-
aria-label={messages.zoomImageButtonLabel}
|
|
20
|
-
data-figure-button
|
|
21
|
-
data-classtype={typeClass}
|
|
22
|
-
>
|
|
23
|
-
<ExpandTwoArrows className="contracted-icon" />
|
|
24
|
-
<ArrowCollapse className="expanded-icon" />
|
|
25
|
-
</button>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface Props {
|
|
30
|
-
messages: {
|
|
31
|
-
zoomImageButtonLabel: string;
|
|
32
|
-
zoomOutImageButtonLabel: string;
|
|
33
|
-
};
|
|
34
|
-
typeClass: string;
|
|
35
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 styled from '@emotion/styled';
|
|
10
|
-
import { colors, fonts, spacing } from '@ndla/core';
|
|
11
|
-
import { ReactNode } from 'react';
|
|
12
|
-
import { useTranslation } from 'react-i18next';
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const FileListSection = styled.section`
|
|
19
|
-
margin: ${spacing.large} 0;
|
|
20
|
-
padding: ${spacing.small} 0 ${spacing.normal} ${spacing.normal};
|
|
21
|
-
border-left: 2px solid ${colors.brand.greyLightest};
|
|
22
|
-
font-family: ${fonts.sans};
|
|
23
|
-
|
|
24
|
-
.c-icon {
|
|
25
|
-
margin-top: 3px;
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
margin-right: ${spacing.small};
|
|
28
|
-
height: 18px;
|
|
29
|
-
width: 18px;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
const FileListHeading = styled.h3`
|
|
34
|
-
${fonts.sizes('16px', '18px')};
|
|
35
|
-
letter-spacing: 0.05em;
|
|
36
|
-
margin: 0 0 ${spacing.xsmall} 0;
|
|
37
|
-
padding-bottom: ${spacing.xsmall};
|
|
38
|
-
border-bottom: 2px solid ${colors.brand.greyLight};
|
|
39
|
-
font-weight: ${fonts.weight.bold};
|
|
40
|
-
text-transform: uppercase;
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
const FilesList = styled.ul`
|
|
44
|
-
margin: 0;
|
|
45
|
-
padding: 0;
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
const FileListV2 = ({ children }: Props) => {
|
|
49
|
-
const { t } = useTranslation();
|
|
50
|
-
return (
|
|
51
|
-
<FileListSection>
|
|
52
|
-
<FileListHeading>{t('files')}</FileListHeading>
|
|
53
|
-
<FilesList>{children}</FilesList>
|
|
54
|
-
</FileListSection>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default FileListV2;
|
package/src/FileList/FileV2.tsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 { useTranslation } from 'react-i18next';
|
|
10
|
-
import File from './File';
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
title: string;
|
|
14
|
-
url: string;
|
|
15
|
-
fileExists: boolean;
|
|
16
|
-
fileType: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const FileV2 = ({ title, url, fileExists, fileType }: Props) => {
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
const tooltip = `${t('download')} ${url.split('/').pop()}`;
|
|
22
|
-
return (
|
|
23
|
-
<File
|
|
24
|
-
file={{
|
|
25
|
-
title,
|
|
26
|
-
fileExists,
|
|
27
|
-
formats: [{ url, fileType, tooltip }],
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default FileV2;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { ReactNode, useCallback, useState } from 'react';
|
|
2
|
-
import { Drawer, Modal, ModalTrigger } from '@ndla/modal';
|
|
3
|
-
import { IconButtonV2 as IconButton } from '@ndla/button';
|
|
4
|
-
import { Cross } from '@ndla/icons/action';
|
|
5
|
-
import styled from '@emotion/styled';
|
|
6
|
-
import { spacing, mq, breakpoints, colors } from '@ndla/core';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import ToggleSearchButton from '../Search/ToggleSearchButton';
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
onClose: VoidFunction;
|
|
12
|
-
children: (arg: () => void) => ReactNode;
|
|
13
|
-
ndlaFilm?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const StyledDrawer = styled(Drawer)`
|
|
17
|
-
background-color: ${colors.brand.greyLightest};
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
const StyledHeader = styled.div`
|
|
21
|
-
display: flex;
|
|
22
|
-
gap: ${spacing.small};
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
25
|
-
width: 1024px;
|
|
26
|
-
max-width: calc(100vw - 100px);
|
|
27
|
-
}
|
|
28
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
29
|
-
width: 1024px;
|
|
30
|
-
max-width: calc(100vw - 156px);
|
|
31
|
-
}
|
|
32
|
-
padding: 0;
|
|
33
|
-
margin: 0 auto;
|
|
34
|
-
|
|
35
|
-
display: flex;
|
|
36
|
-
padding-top: ${spacing.small};
|
|
37
|
-
padding-bottom: ${spacing.small};
|
|
38
|
-
${mq.range({ from: breakpoints.tablet })} {
|
|
39
|
-
padding-top: ${spacing.normal};
|
|
40
|
-
padding-bottom: ${spacing.normal};
|
|
41
|
-
}
|
|
42
|
-
${mq.range({ from: breakpoints.desktop })} {
|
|
43
|
-
padding-top: calc(${spacing.normal} + ${spacing.small});
|
|
44
|
-
padding-bottom: calc(${spacing.normal} + ${spacing.small});
|
|
45
|
-
}
|
|
46
|
-
> input {
|
|
47
|
-
width: 100%;
|
|
48
|
-
margin-right: -${spacing.large};
|
|
49
|
-
${mq.range({ until: breakpoints.tablet })} {
|
|
50
|
-
.c-search-field__button--close {
|
|
51
|
-
right: ${spacing.large} + ${spacing.normal};
|
|
52
|
-
top: 16px;
|
|
53
|
-
}
|
|
54
|
-
.c-search-field__button--searchIcon {
|
|
55
|
-
right: ${spacing.large};
|
|
56
|
-
top: ${spacing.small};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
const MastheadSearchModal = ({ onClose: onSearchClose, children, ndlaFilm }: Props) => {
|
|
63
|
-
const { t } = useTranslation();
|
|
64
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
65
|
-
|
|
66
|
-
const closeModal = useCallback(() => {
|
|
67
|
-
onSearchClose();
|
|
68
|
-
setIsOpen(false);
|
|
69
|
-
}, [onSearchClose]);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<Modal open={isOpen} onOpenChange={setIsOpen}>
|
|
73
|
-
<ModalTrigger>
|
|
74
|
-
<ToggleSearchButton
|
|
75
|
-
onClick={() => setIsOpen(true)}
|
|
76
|
-
ndlaFilm={ndlaFilm}
|
|
77
|
-
aria-label={t('masthead.menu.search')}
|
|
78
|
-
title={t('masthead.menu.search')}
|
|
79
|
-
>
|
|
80
|
-
{t('masthead.menu.search')}
|
|
81
|
-
</ToggleSearchButton>
|
|
82
|
-
</ModalTrigger>
|
|
83
|
-
<StyledDrawer
|
|
84
|
-
aria-label={t('searchPage.searchFieldPlaceholder')}
|
|
85
|
-
position="top"
|
|
86
|
-
expands
|
|
87
|
-
size="small"
|
|
88
|
-
animationDuration={200}
|
|
89
|
-
>
|
|
90
|
-
<StyledHeader>
|
|
91
|
-
{children(closeModal)}
|
|
92
|
-
<IconButton aria-label={t('welcomePage.closeSearch')} variant="ghost" colorTheme="light" onClick={closeModal}>
|
|
93
|
-
<Cross className="c-icon--medium" />
|
|
94
|
-
</IconButton>
|
|
95
|
-
</StyledHeader>
|
|
96
|
-
</StyledDrawer>
|
|
97
|
-
</Modal>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export default MastheadSearchModal;
|