@ndla/ui 8.2.4 → 9.0.1
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/Article/ArticleNotions.js +9 -7
- package/es/Figure/Figure.js +6 -5
- package/es/Figure/FigureExpandButton.js +6 -6
- package/es/Figure/FigureOpenDialogButton.js +45 -0
- package/es/Figure/index.js +2 -1
- package/es/Image/Image.js +1 -1
- package/es/MessageBox/MessageBox.js +8 -8
- package/es/Notion/ConceptNotion.js +79 -28
- package/es/Notion/FigureNotion.js +5 -6
- package/es/Notion/Notion.js +19 -98
- package/es/Notion/NotionImage.js +25 -6
- package/es/Notion/NotionVisualElement.js +49 -10
- package/es/ResourceBox/ResourceBox.js +34 -67
- package/es/Topic/Topic.js +21 -21
- package/es/all.css +1 -1
- package/es/index.js +1 -2
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +1 -1
- package/es/locale/messages-nn.js +1 -1
- package/lib/Article/ArticleNotions.d.ts +2 -1
- package/lib/Article/ArticleNotions.js +9 -7
- package/lib/Figure/Figure.d.ts +2 -1
- package/lib/Figure/Figure.js +6 -5
- package/lib/Figure/FigureExpandButton.js +6 -6
- package/lib/Figure/FigureOpenDialogButton.d.ts +16 -0
- package/lib/Figure/FigureOpenDialogButton.js +57 -0
- package/lib/Figure/index.d.ts +1 -0
- package/lib/Figure/index.js +8 -0
- package/lib/Image/Image.js +1 -1
- package/lib/MessageBox/MessageBox.js +9 -9
- package/lib/Notion/ConceptNotion.d.ts +6 -7
- package/lib/Notion/ConceptNotion.js +84 -30
- package/lib/Notion/FigureNotion.d.ts +3 -2
- package/lib/Notion/FigureNotion.js +5 -7
- package/lib/Notion/Notion.d.ts +1 -12
- package/lib/Notion/Notion.js +23 -105
- package/lib/Notion/NotionImage.d.ts +2 -1
- package/lib/Notion/NotionImage.js +25 -7
- package/lib/Notion/NotionVisualElement.d.ts +6 -7
- package/lib/Notion/NotionVisualElement.js +48 -18
- package/lib/ResourceBox/ResourceBox.js +34 -63
- package/lib/Topic/Topic.js +21 -21
- package/lib/all.css +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +7 -9
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +1 -1
- package/lib/locale/messages-nn.js +1 -1
- package/package.json +10 -9
- package/src/Article/ArticleNotions.tsx +3 -2
- package/src/Figure/Figure.tsx +49 -41
- package/src/Figure/FigureExpandButton.tsx +4 -4
- package/src/Figure/FigureOpenDialogButton.tsx +37 -0
- package/src/Figure/component.figure.scss +4 -0
- package/src/Figure/index.ts +1 -0
- package/src/Image/Image.tsx +1 -1
- package/src/MessageBox/MessageBox.tsx +1 -1
- package/src/Notion/ConceptNotion.tsx +136 -37
- package/src/Notion/FigureNotion.tsx +6 -6
- package/src/Notion/Notion.tsx +7 -145
- package/src/Notion/NotionImage.tsx +44 -15
- package/src/Notion/NotionVisualElement.tsx +35 -8
- package/src/ResourceBox/ResourceBox.tsx +47 -102
- package/src/Topic/Topic.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +1 -1
- package/src/locale/messages-nn.ts +1 -1
- package/es/CloseButton/CloseButton.js +0 -46
- package/es/CloseButton/index.js +0 -10
- package/lib/CloseButton/CloseButton.d.ts +0 -10
- package/lib/CloseButton/CloseButton.js +0 -54
- package/lib/CloseButton/index.d.ts +0 -10
- package/lib/CloseButton/index.js +0 -26
- package/src/CloseButton/CloseButton.tsx +0 -36
- package/src/CloseButton/index.ts +0 -13
package/es/CloseButton/index.js
DELETED
|
@@ -1,10 +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
|
-
import CloseButton from './CloseButton';
|
|
9
|
-
export { CloseButton };
|
|
10
|
-
export default CloseButton;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022-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 { ButtonHTMLAttributes } from 'react';
|
|
9
|
-
export declare const CloseButton: (props: ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
10
|
-
export default CloseButton;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.CloseButton = void 0;
|
|
7
|
-
|
|
8
|
-
var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _action = require("@ndla/icons/action");
|
|
13
|
-
|
|
14
|
-
var _reactI18next = require("react-i18next");
|
|
15
|
-
|
|
16
|
-
var _core = require("@ndla/core");
|
|
17
|
-
|
|
18
|
-
var _core2 = require("@emotion/core");
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
-
|
|
24
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
25
|
-
|
|
26
|
-
var StyledButton = (0, _styledBase["default"])("button", {
|
|
27
|
-
target: "e4bzt4x0",
|
|
28
|
-
label: "StyledButton"
|
|
29
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
30
|
-
name: "1x6nvfn",
|
|
31
|
-
styles: "background-color:transparent;border:none;display:flex;cursor:pointer;"
|
|
32
|
-
} : {
|
|
33
|
-
name: "1x6nvfn",
|
|
34
|
-
styles: "background-color:transparent;border:none;display:flex;cursor:pointer;",
|
|
35
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNsb3NlQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFha0MiLCJmaWxlIjoiQ2xvc2VCdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuaW1wb3J0IFJlYWN0LCB7IEJ1dHRvbkhUTUxBdHRyaWJ1dGVzIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgQ3Jvc3MgfSBmcm9tICdAbmRsYS9pY29ucy9hY3Rpb24nO1xuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tICdyZWFjdC1pMThuZXh0JztcbmltcG9ydCB7IGNvbG9ycyB9IGZyb20gJ0BuZGxhL2NvcmUnO1xuXG5jb25zdCBTdHlsZWRCdXR0b24gPSBzdHlsZWQuYnV0dG9uYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcbiAgYm9yZGVyOiBub25lO1xuICBkaXNwbGF5OiBmbGV4O1xuICBjdXJzb3I6IHBvaW50ZXI7XG5gO1xuXG5jb25zdCBTdHlsZWRDcm9zcyA9IHN0eWxlZChDcm9zcylgXG4gIGhlaWdodDogMjRweDtcbiAgd2lkdGg6IDI0cHg7XG4gIGNvbG9yOiAke2NvbG9ycy50ZXh0LnByaW1hcnl9O1xuYDtcblxuZXhwb3J0IGNvbnN0IENsb3NlQnV0dG9uID0gKHByb3BzOiBCdXR0b25IVE1MQXR0cmlidXRlczxIVE1MQnV0dG9uRWxlbWVudD4pID0+IHtcbiAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbigpO1xuICByZXR1cm4gKFxuICAgIDxTdHlsZWRCdXR0b24gYXJpYS1sYWJlbD17dCgnY2xvc2UnKX0gey4uLnByb3BzfT5cbiAgICAgIDxTdHlsZWRDcm9zcyAvPlxuICAgIDwvU3R5bGVkQnV0dG9uPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xvc2VCdXR0b247XG4iXX0= */",
|
|
36
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
37
|
-
});
|
|
38
|
-
var StyledCross = ( /*#__PURE__*/0, _styledBase["default"])(_action.Cross, {
|
|
39
|
-
target: "e4bzt4x1",
|
|
40
|
-
label: "StyledCross"
|
|
41
|
-
})("height:24px;width:24px;color:", _core.colors.text.primary, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNsb3NlQnV0dG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQmlDIiwiZmlsZSI6IkNsb3NlQnV0dG9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDIyLXByZXNlbnQsIE5ETEEuXG4gKlxuICogVG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ICAgICA8U3R5bGVkQ3Jvc3MgLz5cbiAgICA8L1N0eWxlZEJ1dHRvbj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IENsb3NlQnV0dG9uO1xuIl19 */"));
|
|
42
|
-
|
|
43
|
-
var CloseButton = function CloseButton(props) {
|
|
44
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
45
|
-
t = _useTranslation.t;
|
|
46
|
-
|
|
47
|
-
return (0, _core2.jsx)(StyledButton, _extends({
|
|
48
|
-
"aria-label": t('close')
|
|
49
|
-
}, props), (0, _core2.jsx)(StyledCross, null));
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
exports.CloseButton = CloseButton;
|
|
53
|
-
var _default = CloseButton;
|
|
54
|
-
exports["default"] = _default;
|
|
@@ -1,10 +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
|
-
import CloseButton from './CloseButton';
|
|
9
|
-
export { CloseButton };
|
|
10
|
-
export default CloseButton;
|
package/lib/CloseButton/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "CloseButton", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _CloseButton["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports["default"] = void 0;
|
|
13
|
-
|
|
14
|
-
var _CloseButton = _interopRequireDefault(require("./CloseButton"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Copyright (c) 2019-present, NDLA.
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
var _default = _CloseButton["default"];
|
|
26
|
-
exports["default"] = _default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022-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 React, { ButtonHTMLAttributes } from 'react';
|
|
9
|
-
import styled from '@emotion/styled';
|
|
10
|
-
import { Cross } from '@ndla/icons/action';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
import { colors } from '@ndla/core';
|
|
13
|
-
|
|
14
|
-
const StyledButton = styled.button`
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
border: none;
|
|
17
|
-
display: flex;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
const StyledCross = styled(Cross)`
|
|
22
|
-
height: 24px;
|
|
23
|
-
width: 24px;
|
|
24
|
-
color: ${colors.text.primary};
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
export const CloseButton = (props: ButtonHTMLAttributes<HTMLButtonElement>) => {
|
|
28
|
-
const { t } = useTranslation();
|
|
29
|
-
return (
|
|
30
|
-
<StyledButton aria-label={t('close')} {...props}>
|
|
31
|
-
<StyledCross />
|
|
32
|
-
</StyledButton>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default CloseButton;
|
package/src/CloseButton/index.ts
DELETED
|
@@ -1,13 +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 CloseButton from './CloseButton';
|
|
10
|
-
|
|
11
|
-
export { CloseButton };
|
|
12
|
-
|
|
13
|
-
export default CloseButton;
|