@dnb/eufemia 9.19.0 → 9.20.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/CHANGELOG.md +20 -198
- package/cjs/components/avatar/Avatar.js +14 -12
- package/cjs/components/avatar/AvatarGroup.js +11 -11
- package/cjs/components/avatar/style/_avatar.scss +2 -0
- package/cjs/components/avatar/style/dnb-avatar.css +4 -1
- package/cjs/components/avatar/style/dnb-avatar.min.css +1 -1
- package/cjs/components/breadcrumb/Breadcrumb.js +27 -52
- package/cjs/components/breadcrumb/BreadcrumbItem.js +15 -29
- package/cjs/components/button/Button.d.ts +11 -7
- package/cjs/components/icon-primary/IconPrimary.d.ts +2 -1
- package/cjs/components/info-card/InfoCard.js +22 -22
- package/cjs/components/pagination/Pagination.d.ts +6 -6
- package/cjs/components/pagination/Pagination.js +2 -2
- package/cjs/components/skeleton/Skeleton.d.ts +1 -1
- package/cjs/components/skeleton/SkeletonHelper.d.ts +2 -1
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.js +4 -4
- package/cjs/components/tag/Tag.js +17 -29
- package/cjs/components/tag/TagGroup.js +10 -24
- package/cjs/components/timeline/Timeline.js +24 -64
- package/cjs/components/timeline/TimelineItem.js +16 -29
- package/cjs/elements/Div.d.ts +1 -1
- package/cjs/elements/P.d.ts +2 -1
- package/cjs/shared/AnimateHeight.js +19 -13
- package/cjs/shared/helpers.js +16 -4
- package/cjs/shared/hooks/index.js +13 -0
- package/cjs/shared/hooks/usePropsWithContext.js +92 -0
- package/cjs/style/dnb-ui-components.css +4 -1
- package/cjs/style/dnb-ui-components.min.css +1 -1
- package/cjs/style/dnb-ui-elements.css +1 -3
- package/cjs/style/dnb-ui-elements.min.css +1 -1
- package/cjs/style/dnb-ui-tags.css +2 -6
- package/cjs/style/dnb-ui-tags.min.css +2 -2
- package/cjs/style/elements/code.scss +1 -3
- package/cjs/style/stylis.d.ts +38 -0
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +1 -3
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +1 -3
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/components/avatar/Avatar.js +14 -13
- package/components/avatar/Avatar.tsx +8 -9
- package/components/avatar/AvatarGroup.js +20 -20
- package/components/avatar/AvatarGroup.tsx +4 -8
- package/components/avatar/style/_avatar.scss +2 -0
- package/components/avatar/style/dnb-avatar.css +4 -1
- package/components/avatar/style/dnb-avatar.min.css +1 -1
- package/components/breadcrumb/Breadcrumb.js +22 -35
- package/components/breadcrumb/Breadcrumb.tsx +10 -10
- package/components/breadcrumb/BreadcrumbItem.js +14 -25
- package/components/breadcrumb/BreadcrumbItem.tsx +8 -11
- package/components/button/Button.d.ts +11 -7
- package/components/icon-primary/IconPrimary.d.ts +2 -1
- package/components/info-card/InfoCard.js +22 -22
- package/components/info-card/InfoCard.tsx +13 -12
- package/components/modal/Modal.tsx +1 -1
- package/components/modal/ModalContent.tsx +6 -2
- package/components/modal/components/ModalHeader.tsx +2 -2
- package/components/modal/types.ts +2 -2
- package/components/pagination/Pagination.d.ts +6 -6
- package/components/pagination/Pagination.js +2 -2
- package/components/skeleton/SkeletonHelper.d.ts +2 -1
- package/components/step-indicator/StepIndicatorTriggerButton.js +4 -4
- package/components/tag/Tag.js +17 -27
- package/components/tag/Tag.tsx +15 -13
- package/components/tag/TagGroup.js +9 -22
- package/components/tag/TagGroup.tsx +6 -10
- package/components/timeline/Timeline.js +23 -27
- package/components/timeline/Timeline.tsx +24 -20
- package/components/timeline/TimelineItem.js +15 -25
- package/components/timeline/TimelineItem.tsx +8 -10
- package/elements/P.d.ts +2 -1
- package/es/components/avatar/Avatar.js +7 -6
- package/es/components/avatar/Avatar.tsx +8 -9
- package/es/components/avatar/AvatarGroup.js +6 -6
- package/es/components/avatar/AvatarGroup.tsx +4 -8
- package/es/components/avatar/style/_avatar.scss +2 -0
- package/es/components/avatar/style/dnb-avatar.css +4 -1
- package/es/components/avatar/style/dnb-avatar.min.css +1 -1
- package/es/components/breadcrumb/Breadcrumb.js +8 -14
- package/es/components/breadcrumb/Breadcrumb.tsx +10 -10
- package/es/components/breadcrumb/BreadcrumbItem.js +9 -13
- package/es/components/breadcrumb/BreadcrumbItem.tsx +8 -11
- package/es/components/button/Button.d.ts +11 -7
- package/es/components/icon-primary/IconPrimary.d.ts +2 -1
- package/es/components/info-card/InfoCard.js +8 -8
- package/es/components/info-card/InfoCard.tsx +13 -12
- package/es/components/modal/Modal.tsx +1 -1
- package/es/components/modal/ModalContent.tsx +6 -2
- package/es/components/modal/components/ModalHeader.tsx +2 -2
- package/es/components/modal/types.ts +2 -2
- package/es/components/pagination/Pagination.d.ts +6 -6
- package/es/components/pagination/Pagination.js +2 -2
- package/es/components/skeleton/Skeleton.d.ts +1 -1
- package/es/components/skeleton/SkeletonHelper.d.ts +2 -1
- package/es/components/step-indicator/StepIndicatorTriggerButton.js +4 -4
- package/es/components/tag/Tag.js +11 -14
- package/es/components/tag/Tag.tsx +15 -13
- package/es/components/tag/TagGroup.js +7 -13
- package/es/components/tag/TagGroup.tsx +6 -10
- package/es/components/timeline/Timeline.js +21 -17
- package/es/components/timeline/Timeline.tsx +24 -20
- package/es/components/timeline/TimelineItem.js +9 -12
- package/es/components/timeline/TimelineItem.tsx +8 -10
- package/es/elements/Div.d.ts +1 -1
- package/es/elements/P.d.ts +2 -1
- package/es/shared/AnimateHeight.js +15 -13
- package/es/shared/helpers.js +9 -2
- package/es/shared/hooks/index.js +1 -0
- package/es/shared/hooks/index.ts +1 -0
- package/es/shared/hooks/usePropsWithContext.js +26 -0
- package/es/shared/hooks/usePropsWithContext.ts +45 -0
- package/es/shared/interfaces.tsx +0 -2
- package/es/style/dnb-ui-components.css +4 -1
- package/es/style/dnb-ui-components.min.css +1 -1
- package/es/style/dnb-ui-elements.css +1 -3
- package/es/style/dnb-ui-elements.min.css +1 -1
- package/es/style/dnb-ui-tags.css +2 -6
- package/es/style/dnb-ui-tags.min.css +2 -2
- package/es/style/elements/code.scss +1 -3
- package/es/style/stylis.d.ts +38 -0
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +1 -3
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.css +1 -3
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/esm/components/avatar/Avatar.js +14 -13
- package/esm/components/avatar/Avatar.tsx +8 -9
- package/esm/components/avatar/AvatarGroup.js +20 -20
- package/esm/components/avatar/AvatarGroup.tsx +4 -8
- package/esm/components/avatar/style/_avatar.scss +2 -0
- package/esm/components/avatar/style/dnb-avatar.css +4 -1
- package/esm/components/avatar/style/dnb-avatar.min.css +1 -1
- package/esm/components/breadcrumb/Breadcrumb.js +22 -35
- package/esm/components/breadcrumb/Breadcrumb.tsx +10 -10
- package/esm/components/breadcrumb/BreadcrumbItem.js +14 -25
- package/esm/components/breadcrumb/BreadcrumbItem.tsx +8 -11
- package/esm/components/button/Button.d.ts +11 -7
- package/esm/components/icon-primary/IconPrimary.d.ts +2 -1
- package/esm/components/info-card/InfoCard.js +22 -22
- package/esm/components/info-card/InfoCard.tsx +13 -12
- package/esm/components/modal/Modal.tsx +1 -1
- package/esm/components/modal/ModalContent.tsx +6 -2
- package/esm/components/modal/components/ModalHeader.tsx +2 -2
- package/esm/components/modal/types.ts +2 -2
- package/esm/components/pagination/Pagination.d.ts +6 -6
- package/esm/components/pagination/Pagination.js +2 -2
- package/esm/components/skeleton/SkeletonHelper.d.ts +2 -1
- package/esm/components/step-indicator/StepIndicatorTriggerButton.js +4 -4
- package/esm/components/tag/Tag.js +17 -27
- package/esm/components/tag/Tag.tsx +15 -13
- package/esm/components/tag/TagGroup.js +9 -22
- package/esm/components/tag/TagGroup.tsx +6 -10
- package/esm/components/timeline/Timeline.js +23 -27
- package/esm/components/timeline/Timeline.tsx +24 -20
- package/esm/components/timeline/TimelineItem.js +15 -25
- package/esm/components/timeline/TimelineItem.tsx +8 -10
- package/esm/dnb-ui-components.min.mjs +3 -3
- package/esm/dnb-ui-lib.min.mjs +3 -3
- package/esm/dnb-ui-web-components.min.mjs +4 -4
- package/esm/elements/P.d.ts +2 -1
- package/esm/shared/AnimateHeight.js +19 -13
- package/esm/shared/helpers.js +15 -4
- package/esm/shared/hooks/index.js +1 -0
- package/esm/shared/hooks/index.ts +1 -0
- package/esm/shared/hooks/usePropsWithContext.js +47 -0
- package/esm/shared/hooks/usePropsWithContext.ts +45 -0
- package/esm/shared/interfaces.tsx +0 -2
- package/esm/style/dnb-ui-components.css +4 -1
- package/esm/style/dnb-ui-components.min.css +1 -1
- package/esm/style/dnb-ui-elements.css +1 -3
- package/esm/style/dnb-ui-elements.min.css +1 -1
- package/esm/style/dnb-ui-tags.css +2 -6
- package/esm/style/dnb-ui-tags.min.css +2 -2
- package/esm/style/elements/code.scss +1 -3
- package/esm/style/stylis.d.ts +38 -0
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.css +1 -3
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/esm/style/themes/theme-ui/dnb-theme-ui.css +1 -3
- package/esm/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/package.json +1 -1
- package/shared/AnimateHeight.js +19 -13
- package/shared/helpers.js +15 -4
- package/shared/hooks/index.js +1 -0
- package/shared/hooks/index.ts +1 -0
- package/shared/hooks/usePropsWithContext.js +47 -0
- package/shared/hooks/usePropsWithContext.ts +45 -0
- package/shared/interfaces.tsx +0 -2
- package/style/dnb-ui-components.css +4 -1
- package/style/dnb-ui-components.min.css +1 -1
- package/style/dnb-ui-elements.css +1 -3
- package/style/dnb-ui-elements.min.css +1 -1
- package/style/dnb-ui-tags.css +2 -6
- package/style/dnb-ui-tags.min.css +2 -2
- package/style/elements/code.scss +1 -3
- package/style/stylis.d.ts +38 -0
- package/style/themes/theme-open-banking/dnb-theme-open-banking.css +1 -3
- package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/style/themes/theme-ui/dnb-theme-ui.css +1 -3
- package/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/umd/dnb-ui-components.min.js +3 -3
- package/umd/dnb-ui-lib.min.js +4 -4
- package/umd/dnb-ui-web-components.min.js +3 -3
|
@@ -6,22 +6,12 @@ require("core-js/modules/es.array.index-of.js");
|
|
|
6
6
|
|
|
7
7
|
require("core-js/modules/es.symbol.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.array.filter.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
18
|
-
|
|
19
9
|
require("core-js/modules/es.object.assign.js");
|
|
20
10
|
|
|
21
11
|
Object.defineProperty(exports, "__esModule", {
|
|
22
12
|
value: true
|
|
23
13
|
});
|
|
24
|
-
exports.default =
|
|
14
|
+
exports.default = void 0;
|
|
25
15
|
|
|
26
16
|
var _react = _interopRequireDefault(require("react"));
|
|
27
17
|
|
|
@@ -35,7 +25,7 @@ var _home = _interopRequireDefault(require("../../icons/home"));
|
|
|
35
25
|
|
|
36
26
|
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
37
27
|
|
|
38
|
-
var
|
|
28
|
+
var _hooks = require("../../shared/hooks");
|
|
39
29
|
|
|
40
30
|
var _excluded = ["text", "href", "icon", "onClick", "variant", "skeleton"];
|
|
41
31
|
|
|
@@ -43,12 +33,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
43
33
|
|
|
44
34
|
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); }
|
|
45
35
|
|
|
46
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
47
|
-
|
|
48
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
49
|
-
|
|
50
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
51
|
-
|
|
52
36
|
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; }
|
|
53
37
|
|
|
54
38
|
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; }
|
|
@@ -62,19 +46,19 @@ var defaultProps = {
|
|
|
62
46
|
skeleton: null
|
|
63
47
|
};
|
|
64
48
|
|
|
65
|
-
function BreadcrumbItem(localProps) {
|
|
49
|
+
var BreadcrumbItem = function BreadcrumbItem(localProps) {
|
|
66
50
|
var context = _react.default.useContext(_Context.default);
|
|
67
51
|
|
|
68
52
|
var homeText = context.translation.Breadcrumb.homeText;
|
|
69
53
|
|
|
70
|
-
var
|
|
71
|
-
text =
|
|
72
|
-
href =
|
|
73
|
-
icon =
|
|
74
|
-
onClick =
|
|
75
|
-
variant =
|
|
76
|
-
skeleton =
|
|
77
|
-
props = _objectWithoutProperties(
|
|
54
|
+
var _usePropsWithContext = (0, _hooks.usePropsWithContext)(localProps, defaultProps, context === null || context === void 0 ? void 0 : context.BreadcrumbItem),
|
|
55
|
+
text = _usePropsWithContext.text,
|
|
56
|
+
href = _usePropsWithContext.href,
|
|
57
|
+
icon = _usePropsWithContext.icon,
|
|
58
|
+
onClick = _usePropsWithContext.onClick,
|
|
59
|
+
variant = _usePropsWithContext.variant,
|
|
60
|
+
skeleton = _usePropsWithContext.skeleton,
|
|
61
|
+
props = _objectWithoutProperties(_usePropsWithContext, _excluded);
|
|
78
62
|
|
|
79
63
|
var currentIcon = icon || variant === 'home' && _home.default || 'chevron_left';
|
|
80
64
|
var currentText = text || variant === 'home' && homeText || '';
|
|
@@ -88,7 +72,6 @@ function BreadcrumbItem(localProps) {
|
|
|
88
72
|
href: href,
|
|
89
73
|
icon: currentIcon,
|
|
90
74
|
icon_position: "left",
|
|
91
|
-
icon_: currentIcon,
|
|
92
75
|
on_click: onClick,
|
|
93
76
|
text: currentText,
|
|
94
77
|
skeleton: skeleton
|
|
@@ -101,4 +84,7 @@ function BreadcrumbItem(localProps) {
|
|
|
101
84
|
left: "0",
|
|
102
85
|
"data-testid": "breadcrumb-item-text"
|
|
103
86
|
}, currentText)));
|
|
104
|
-
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var _default = BreadcrumbItem;
|
|
90
|
+
exports.default = _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SkeletonShow } from '../skeleton/Skeleton';
|
|
3
|
+
import { IconPrimaryIcon } from '../icon-primary/IconPrimary';
|
|
2
4
|
export type ButtonText = string | React.ReactNode;
|
|
3
5
|
export type ButtonVariant =
|
|
4
6
|
| 'primary'
|
|
5
7
|
| 'secondary'
|
|
6
8
|
| 'tertiary'
|
|
7
|
-
| 'signal'
|
|
9
|
+
| 'signal'
|
|
10
|
+
| 'unstyled';
|
|
8
11
|
export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
|
|
9
|
-
export type ButtonIcon =
|
|
10
|
-
| string
|
|
11
|
-
| React.ReactNode
|
|
12
|
-
| ((...args: any[]) => any);
|
|
12
|
+
export type ButtonIcon = IconPrimaryIcon;
|
|
13
13
|
export type ButtonIconPosition = 'left' | 'right' | 'top';
|
|
14
14
|
export type ButtonIconSize = string | number;
|
|
15
15
|
export type ButtonTooltip =
|
|
@@ -26,7 +26,7 @@ export type ButtonTo = string | any | ((...args: any[]) => any);
|
|
|
26
26
|
export type ButtonWrap = string | boolean;
|
|
27
27
|
export type ButtonBounding = string | boolean;
|
|
28
28
|
export type ButtonStretch = string | boolean;
|
|
29
|
-
export type ButtonSkeleton =
|
|
29
|
+
export type ButtonSkeleton = SkeletonShow;
|
|
30
30
|
export type ButtonDisabled = string | boolean;
|
|
31
31
|
export type ButtonChildren =
|
|
32
32
|
| string
|
|
@@ -70,7 +70,11 @@ export type ButtonOnClick = string | ((...args: any[]) => any);
|
|
|
70
70
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
|
-
export interface ButtonProps
|
|
73
|
+
export interface ButtonProps
|
|
74
|
+
extends Omit<
|
|
75
|
+
React.HTMLProps<HTMLElement>,
|
|
76
|
+
'disabled' | 'size' | 'title' | 'wrap'
|
|
77
|
+
> {
|
|
74
78
|
/**
|
|
75
79
|
* The content of the button can be a string or a React Element.
|
|
76
80
|
*/
|
|
@@ -53,7 +53,8 @@ export type IconPrimaryChildren =
|
|
|
53
53
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
|
-
export interface IconPrimaryProps
|
|
56
|
+
export interface IconPrimaryProps
|
|
57
|
+
extends Omit<React.HTMLProps<HTMLElement>, 'size'> {
|
|
57
58
|
/**
|
|
58
59
|
* <em>(required)</em> a React SVG Component or the icon name (in case we use `IconPrimary` or `dnb-icon-primary`).
|
|
59
60
|
*/
|
|
@@ -47,7 +47,7 @@ var _SkeletonHelper = require("../skeleton/SkeletonHelper");
|
|
|
47
47
|
|
|
48
48
|
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _hooks = require("../../shared/hooks");
|
|
51
51
|
|
|
52
52
|
var _excluded = ["alt", "centered", "title", "skeleton", "className", "icon", "src", "imgProps", "text", "onClose", "onAccept", "closeButtonText", "acceptButtonText", "closeButtonAttributes", "acceptButtonAttributes"];
|
|
53
53
|
|
|
@@ -83,28 +83,28 @@ var defaultProps = {
|
|
|
83
83
|
};
|
|
84
84
|
exports.defaultProps = defaultProps;
|
|
85
85
|
|
|
86
|
-
function InfoCard(localProps) {
|
|
86
|
+
var InfoCard = function InfoCard(localProps) {
|
|
87
87
|
var _IconPrimary;
|
|
88
88
|
|
|
89
89
|
var context = _react.default.useContext(_Context.default);
|
|
90
90
|
|
|
91
|
-
var
|
|
92
|
-
alt =
|
|
93
|
-
centered =
|
|
94
|
-
title =
|
|
95
|
-
skeleton =
|
|
96
|
-
className =
|
|
97
|
-
icon =
|
|
98
|
-
src =
|
|
99
|
-
imgProps =
|
|
100
|
-
text =
|
|
101
|
-
onClose =
|
|
102
|
-
onAccept =
|
|
103
|
-
closeButtonText =
|
|
104
|
-
acceptButtonText =
|
|
105
|
-
closeButtonAttributes =
|
|
106
|
-
acceptButtonAttributes =
|
|
107
|
-
props = _objectWithoutProperties(
|
|
91
|
+
var _usePropsWithContext = (0, _hooks.usePropsWithContext)(_objectSpread(_objectSpread({}, defaultProps), localProps)),
|
|
92
|
+
alt = _usePropsWithContext.alt,
|
|
93
|
+
centered = _usePropsWithContext.centered,
|
|
94
|
+
title = _usePropsWithContext.title,
|
|
95
|
+
skeleton = _usePropsWithContext.skeleton,
|
|
96
|
+
className = _usePropsWithContext.className,
|
|
97
|
+
icon = _usePropsWithContext.icon,
|
|
98
|
+
src = _usePropsWithContext.src,
|
|
99
|
+
imgProps = _usePropsWithContext.imgProps,
|
|
100
|
+
text = _usePropsWithContext.text,
|
|
101
|
+
onClose = _usePropsWithContext.onClose,
|
|
102
|
+
onAccept = _usePropsWithContext.onAccept,
|
|
103
|
+
closeButtonText = _usePropsWithContext.closeButtonText,
|
|
104
|
+
acceptButtonText = _usePropsWithContext.acceptButtonText,
|
|
105
|
+
closeButtonAttributes = _usePropsWithContext.closeButtonAttributes,
|
|
106
|
+
acceptButtonAttributes = _usePropsWithContext.acceptButtonAttributes,
|
|
107
|
+
props = _objectWithoutProperties(_usePropsWithContext, _excluded);
|
|
108
108
|
|
|
109
109
|
var skeletonClasses = (0, _SkeletonHelper.createSkeletonClass)('shape', skeleton, context);
|
|
110
110
|
var spacingClasses = (0, _SpacingHelper.createSpacingClasses)(props);
|
|
@@ -137,14 +137,14 @@ function InfoCard(localProps) {
|
|
|
137
137
|
className: 'dnb-info-card--buttons' + (centered ? " dnb-info-card--buttons-centered" : "")
|
|
138
138
|
}, !acceptButtonIsHidden && _react.default.createElement(_Button.default, _extends({
|
|
139
139
|
type: "button",
|
|
140
|
-
"data-testid": "
|
|
140
|
+
"data-testid": "info-card-accept-button",
|
|
141
141
|
variant: "secondary",
|
|
142
142
|
right: !centered && 'small',
|
|
143
143
|
on_click: onAccept,
|
|
144
144
|
text: acceptButtonText
|
|
145
145
|
}, acceptButtonAttributes)), !closeButtonIsHidden && _react.default.createElement(_Button.default, _extends({
|
|
146
146
|
type: "button",
|
|
147
|
-
"data-testid": "
|
|
147
|
+
"data-testid": "info-card-close-button",
|
|
148
148
|
variant: "tertiary",
|
|
149
149
|
top: centered && 'small',
|
|
150
150
|
on_click: onClose,
|
|
@@ -174,7 +174,7 @@ function InfoCard(localProps) {
|
|
|
174
174
|
"data-testid": "info-card-icon"
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
|
-
}
|
|
177
|
+
};
|
|
178
178
|
|
|
179
179
|
var _default = InfoCard;
|
|
180
180
|
exports.default = _default;
|
|
@@ -128,7 +128,7 @@ export interface PaginationProps extends React.HTMLProps<HTMLElement> {
|
|
|
128
128
|
skeleton?: PaginationSkeleton;
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. Defaults to `pagination`.
|
|
131
|
+
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. For more information, check out the <a href="https://eufemia.dnb.no/uilib/components/pagination/infinity-scroller">Infinity Scroller</a>. Defaults to `pagination`.
|
|
132
132
|
*/
|
|
133
133
|
mode?: PaginationMode;
|
|
134
134
|
|
|
@@ -214,7 +214,7 @@ export interface PaginationProps extends React.HTMLProps<HTMLElement> {
|
|
|
214
214
|
is_loading_text?: string;
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
|
-
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1
|
|
217
|
+
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1. Defaults to `Vis mer innhold`.
|
|
218
218
|
*/
|
|
219
219
|
load_button_text?: string;
|
|
220
220
|
|
|
@@ -406,7 +406,7 @@ export interface PaginationInstanceProps {
|
|
|
406
406
|
skeleton?: PaginationInstanceSkeleton;
|
|
407
407
|
|
|
408
408
|
/**
|
|
409
|
-
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. Defaults to `pagination`.
|
|
409
|
+
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. For more information, check out the <a href="https://eufemia.dnb.no/uilib/components/pagination/infinity-scroller">Infinity Scroller</a>. Defaults to `pagination`.
|
|
410
410
|
*/
|
|
411
411
|
mode?: PaginationInstanceMode;
|
|
412
412
|
|
|
@@ -492,7 +492,7 @@ export interface PaginationInstanceProps {
|
|
|
492
492
|
is_loading_text?: string;
|
|
493
493
|
|
|
494
494
|
/**
|
|
495
|
-
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1
|
|
495
|
+
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1. Defaults to `Vis mer innhold`.
|
|
496
496
|
*/
|
|
497
497
|
load_button_text?: string;
|
|
498
498
|
|
|
@@ -686,7 +686,7 @@ export interface InfinityMarkerProps {
|
|
|
686
686
|
skeleton?: InfinityMarkerSkeleton;
|
|
687
687
|
|
|
688
688
|
/**
|
|
689
|
-
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. Defaults to `pagination`.
|
|
689
|
+
* If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. For more information, check out the <a href="https://eufemia.dnb.no/uilib/components/pagination/infinity-scroller">Infinity Scroller</a>. Defaults to `pagination`.
|
|
690
690
|
*/
|
|
691
691
|
mode?: InfinityMarkerMode;
|
|
692
692
|
|
|
@@ -772,7 +772,7 @@ export interface InfinityMarkerProps {
|
|
|
772
772
|
is_loading_text?: string;
|
|
773
773
|
|
|
774
774
|
/**
|
|
775
|
-
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1
|
|
775
|
+
* Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1. Defaults to `Vis mer innhold`.
|
|
776
776
|
*/
|
|
777
777
|
load_button_text?: string;
|
|
778
778
|
|
|
@@ -267,13 +267,13 @@ var PaginationInstance = function (_React$PureComponent2) {
|
|
|
267
267
|
var pageNumber = _ref.pageNumber;
|
|
268
268
|
return pageNumber === currentPage;
|
|
269
269
|
})) === null || _items$find === void 0 ? void 0 : _items$find.content;
|
|
270
|
-
return _react.default.createElement(
|
|
270
|
+
return _react.default.createElement("div", mainParams, _react.default.createElement(_PaginationBar.default, {
|
|
271
271
|
contentRef: this._contentRef
|
|
272
272
|
}, children), items.length > 0 && _react.default.createElement(PaginationContent, {
|
|
273
273
|
ref: this._contentRef
|
|
274
274
|
}, content || _react.default.createElement(_PaginationHelpers.PaginationIndicator, {
|
|
275
275
|
indicator_element: indicator_element || fallback_element
|
|
276
|
-
})))
|
|
276
|
+
})));
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
return _InfinityScroller || (_InfinityScroller = _react.default.createElement(_PaginationInfinity.default, null));
|
|
@@ -39,10 +39,10 @@ export type SkeletonChildren =
|
|
|
39
39
|
| string
|
|
40
40
|
| ((...args: any[]) => any)
|
|
41
41
|
| React.ReactNode;
|
|
42
|
-
|
|
43
42
|
/**
|
|
44
43
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
45
44
|
*/
|
|
45
|
+
|
|
46
46
|
export interface SkeletonProps extends React.HTMLProps<HTMLElement> {
|
|
47
47
|
/**
|
|
48
48
|
* Use `true` to enable/show the skeleton for the component used inside. Defaults to `false`.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SkeletonShow } from './Skeleton';
|
|
2
3
|
export interface AutoSizeProps {
|
|
3
4
|
__element?: React.ReactNode;
|
|
4
5
|
children?: React.ReactNode;
|
|
@@ -20,7 +21,7 @@ export interface SkeletonContextProps {
|
|
|
20
21
|
}
|
|
21
22
|
export const createSkeletonClass: (
|
|
22
23
|
method: 'shape' | 'font',
|
|
23
|
-
skeleton:
|
|
24
|
+
skeleton: SkeletonShow,
|
|
24
25
|
context?: SkeletonContextProps
|
|
25
26
|
) => React.HTMLProps<HTMLElement>;
|
|
26
27
|
export interface skeletonDOMAttributesContext {
|
|
@@ -122,6 +122,8 @@ var StepIndicatorTriggerButton = function (_React$PureComponent) {
|
|
|
122
122
|
key: "componentDidMount",
|
|
123
123
|
value: function componentDidMount() {
|
|
124
124
|
this._heightAnim.setElement(this._buttonRef.current);
|
|
125
|
+
|
|
126
|
+
this._prevStep = this.context.activeStep;
|
|
125
127
|
}
|
|
126
128
|
}, {
|
|
127
129
|
key: "componentWillUnmount",
|
|
@@ -134,12 +136,10 @@ var StepIndicatorTriggerButton = function (_React$PureComponent) {
|
|
|
134
136
|
if (this._prevStep !== this.context.activeStep) {
|
|
135
137
|
var toHeight = this._heightAnim.getUnknownHeight();
|
|
136
138
|
|
|
137
|
-
this._heightAnim.adjustFrom(height);
|
|
138
|
-
|
|
139
139
|
this._heightAnim.adjustTo(height, toHeight);
|
|
140
|
-
}
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
this._prevStep = this.context.activeStep;
|
|
142
|
+
}
|
|
143
143
|
}
|
|
144
144
|
}, {
|
|
145
145
|
key: "render",
|
|
@@ -6,16 +6,6 @@ require("core-js/modules/es.array.index-of.js");
|
|
|
6
6
|
|
|
7
7
|
require("core-js/modules/es.symbol.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.array.filter.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.to-string.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
18
|
-
|
|
19
9
|
require("core-js/modules/es.object.assign.js");
|
|
20
10
|
|
|
21
11
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -35,6 +25,8 @@ var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
|
35
25
|
|
|
36
26
|
var _componentHelper = require("../../shared/component-helper");
|
|
37
27
|
|
|
28
|
+
var _hooks = require("../../shared/hooks");
|
|
29
|
+
|
|
38
30
|
var _TagGroup = _interopRequireDefault(require("./TagGroup"));
|
|
39
31
|
|
|
40
32
|
var _TagContext = require("./TagContext");
|
|
@@ -47,12 +39,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
47
39
|
|
|
48
40
|
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); }
|
|
49
41
|
|
|
50
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
-
|
|
52
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
53
|
-
|
|
54
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
55
|
-
|
|
56
42
|
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; }
|
|
57
43
|
|
|
58
44
|
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; }
|
|
@@ -76,15 +62,15 @@ var Tag = function Tag(localProps) {
|
|
|
76
62
|
|
|
77
63
|
var tagGroupContext = _react.default.useContext(_TagContext.TagGroupContext);
|
|
78
64
|
|
|
79
|
-
var
|
|
80
|
-
className =
|
|
81
|
-
skeleton =
|
|
82
|
-
children =
|
|
83
|
-
text =
|
|
84
|
-
onClick =
|
|
85
|
-
onDelete =
|
|
86
|
-
omitOnKeyUpDeleteEvent =
|
|
87
|
-
props = _objectWithoutProperties(
|
|
65
|
+
var _usePropsWithContext = (0, _hooks.usePropsWithContext)(localProps, defaultProps, context === null || context === void 0 ? void 0 : (_context$translation = context.translation) === null || _context$translation === void 0 ? void 0 : _context$translation.Tag, context === null || context === void 0 ? void 0 : context.Tag, tagGroupContext),
|
|
66
|
+
className = _usePropsWithContext.className,
|
|
67
|
+
skeleton = _usePropsWithContext.skeleton,
|
|
68
|
+
children = _usePropsWithContext.children,
|
|
69
|
+
text = _usePropsWithContext.text,
|
|
70
|
+
onClick = _usePropsWithContext.onClick,
|
|
71
|
+
onDelete = _usePropsWithContext.onDelete,
|
|
72
|
+
omitOnKeyUpDeleteEvent = _usePropsWithContext.omitOnKeyUpDeleteEvent,
|
|
73
|
+
props = _objectWithoutProperties(_usePropsWithContext, _excluded);
|
|
88
74
|
|
|
89
75
|
var content = text || children;
|
|
90
76
|
var isClickable = !!onClick;
|
|
@@ -102,13 +88,15 @@ var Tag = function Tag(localProps) {
|
|
|
102
88
|
}
|
|
103
89
|
};
|
|
104
90
|
|
|
91
|
+
var buttonAttr = props;
|
|
92
|
+
|
|
105
93
|
if (!isInteractive) {
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
buttonAttr.element = 'span';
|
|
95
|
+
buttonAttr.type = '';
|
|
108
96
|
}
|
|
109
97
|
|
|
110
98
|
if (isRemovable) {
|
|
111
|
-
|
|
99
|
+
buttonAttr.icon = getDeleteIcon();
|
|
112
100
|
}
|
|
113
101
|
|
|
114
102
|
if (!tagGroupContext) {
|
|
@@ -127,7 +115,7 @@ var Tag = function Tag(localProps) {
|
|
|
127
115
|
onKeyUp: isRemovable && !omitOnKeyUpDeleteEvent ? function (e) {
|
|
128
116
|
return handleKeyUp(e);
|
|
129
117
|
} : undefined
|
|
130
|
-
},
|
|
118
|
+
}, buttonAttr));
|
|
131
119
|
|
|
132
120
|
function getDeleteIcon() {
|
|
133
121
|
return _IconPrimary || (_IconPrimary = _react.default.createElement(_IconPrimary2.default, {
|
|
@@ -6,18 +6,10 @@ require("core-js/modules/es.array.index-of.js");
|
|
|
6
6
|
|
|
7
7
|
require("core-js/modules/es.symbol.js");
|
|
8
8
|
|
|
9
|
-
require("core-js/modules/es.
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
10
|
|
|
11
11
|
require("core-js/modules/es.object.to-string.js");
|
|
12
12
|
|
|
13
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.symbol.description.js");
|
|
20
|
-
|
|
21
13
|
require("core-js/modules/es.symbol.iterator.js");
|
|
22
14
|
|
|
23
15
|
require("core-js/modules/es.array.iterator.js");
|
|
@@ -51,7 +43,7 @@ var _SpacingHelper = require("../space/SpacingHelper");
|
|
|
51
43
|
|
|
52
44
|
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
53
45
|
|
|
54
|
-
var
|
|
46
|
+
var _hooks = require("../../shared/hooks");
|
|
55
47
|
|
|
56
48
|
var _TagContext = require("./TagContext");
|
|
57
49
|
|
|
@@ -73,12 +65,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
73
65
|
|
|
74
66
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
75
67
|
|
|
76
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
77
|
-
|
|
78
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
79
|
-
|
|
80
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
81
|
-
|
|
82
68
|
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; }
|
|
83
69
|
|
|
84
70
|
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; }
|
|
@@ -90,14 +76,14 @@ var defaultProps = {
|
|
|
90
76
|
};
|
|
91
77
|
exports.defaultProps = defaultProps;
|
|
92
78
|
|
|
93
|
-
function TagGroup(localProps) {
|
|
79
|
+
var TagGroup = function TagGroup(localProps) {
|
|
94
80
|
var context = _react.default.useContext(_Context.default);
|
|
95
81
|
|
|
96
|
-
var
|
|
97
|
-
label =
|
|
98
|
-
className =
|
|
99
|
-
childrenProp =
|
|
100
|
-
props = _objectWithoutProperties(
|
|
82
|
+
var _usePropsWithContext = (0, _hooks.usePropsWithContext)(localProps, defaultProps, context === null || context === void 0 ? void 0 : context.TagGroup),
|
|
83
|
+
label = _usePropsWithContext.label,
|
|
84
|
+
className = _usePropsWithContext.className,
|
|
85
|
+
childrenProp = _usePropsWithContext.children,
|
|
86
|
+
props = _objectWithoutProperties(_usePropsWithContext, _excluded);
|
|
101
87
|
|
|
102
88
|
var children = childrenProp;
|
|
103
89
|
|
|
@@ -110,14 +96,14 @@ function TagGroup(localProps) {
|
|
|
110
96
|
var spacingClasses = (0, _SpacingHelper.createSpacingClasses)(props);
|
|
111
97
|
return _react.default.createElement(_TagContext.TagGroupContext.Provider, {
|
|
112
98
|
value: props
|
|
113
|
-
}, _react.default.createElement("
|
|
99
|
+
}, _react.default.createElement("span", _extends({
|
|
114
100
|
className: (0, _classnames.default)('dnb-tag__group', spacingClasses, className),
|
|
115
101
|
"data-testid": "tag-group"
|
|
116
102
|
}, props), _react.default.createElement("span", {
|
|
117
103
|
"data-testid": "tag-group-label",
|
|
118
104
|
className: "dnb-sr-only"
|
|
119
105
|
}, label), children));
|
|
120
|
-
}
|
|
106
|
+
};
|
|
121
107
|
|
|
122
108
|
var _default = TagGroup;
|
|
123
109
|
exports.default = _default;
|