dibk-design 3.3.2 → 3.4.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/dist/components/Accordion.js +1 -2
- package/dist/components/Button.js +1 -2
- package/dist/components/CheckBoxIcon.js +1 -2
- package/dist/components/CheckBoxInput.js +1 -2
- package/dist/components/CheckBoxList.js +6 -4
- package/dist/components/CheckBoxListItem.js +1 -2
- package/dist/components/Container.js +1 -2
- package/dist/components/ContentBox.js +1 -2
- package/dist/components/Dialog.js +1 -2
- package/dist/components/DragAndDropFileInput.js +1 -2
- package/dist/components/ErrorBox.js +1 -2
- package/dist/components/ErrorMessage.js +1 -2
- package/dist/components/Footer.js +1 -2
- package/dist/components/Header.js +1 -2
- package/dist/components/InputField.js +1 -2
- package/dist/components/Label.js +1 -2
- package/dist/components/List.js +1 -2
- package/dist/components/ListItem.js +1 -2
- package/dist/components/LoadingAnimation.js +1 -2
- package/dist/components/NavigationBar.js +27 -14
- package/dist/components/NavigationBarListItem.js +1 -2
- package/dist/components/Paper.js +1 -2
- package/dist/components/ProgressBar.js +1 -2
- package/dist/components/RadioButtonIcon.js +1 -2
- package/dist/components/RadioButtonInput.js +1 -2
- package/dist/components/RadioButtonList.js +6 -4
- package/dist/components/RadioButtonListItem.js +1 -2
- package/dist/components/Select.js +1 -2
- package/dist/components/Table.js +1 -2
- package/dist/components/Textarea.js +1 -2
- package/dist/components/Theme.js +1 -2
- package/dist/components/WizardNavigation/Step.js +1 -2
- package/dist/components/WizardNavigation.js +1 -2
- package/dist/functions/generators.js +2 -3
- package/dist/functions/helpers.js +6 -11
- package/dist/functions/theme.js +11 -21
- package/package.json +1 -1
|
@@ -15,11 +15,14 @@ var CheckBoxList = function CheckBoxList(props) {
|
|
|
15
15
|
var renderChildElements = function renderChildElements(childElements) {
|
|
16
16
|
var childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map(function (childElement, index) {
|
|
18
|
-
var
|
|
18
|
+
var _childElement$type;
|
|
19
|
+
var isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$type = childElement.type) === null || _childElement$type === void 0 ? void 0 : _childElement$type.name) === "CheckBoxListItem";
|
|
20
|
+
var childElementProps = isCheckBoxListItem ? {
|
|
19
21
|
requiredGroup: props.required,
|
|
20
22
|
compact: props.compact,
|
|
21
23
|
key: "checkboxListItem-".concat(index)
|
|
22
|
-
}
|
|
24
|
+
} : null;
|
|
25
|
+
var childElementCopy = _react.default.cloneElement(childElement, childElementProps);
|
|
23
26
|
return childElementCopy;
|
|
24
27
|
});
|
|
25
28
|
};
|
|
@@ -36,5 +39,4 @@ CheckBoxList.propTypes = {
|
|
|
36
39
|
required: _propTypes.default.bool,
|
|
37
40
|
compact: _propTypes.default.bool
|
|
38
41
|
};
|
|
39
|
-
var _default = CheckBoxList;
|
|
40
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = CheckBoxList;
|
package/dist/components/Label.js
CHANGED
package/dist/components/List.js
CHANGED
|
@@ -83,24 +83,37 @@ var NavigationBar = function NavigationBar(props) {
|
|
|
83
83
|
className: _NavigationBarModule.default.secondaryList
|
|
84
84
|
}, listItems);
|
|
85
85
|
};
|
|
86
|
-
var renderLogo = function renderLogo(logoLink) {
|
|
86
|
+
var renderLogo = function renderLogo(logoLink, logoLinkTitle) {
|
|
87
87
|
var themeLogo = (0, _theme.getThemeLogo)(props.theme);
|
|
88
88
|
var themeAppName = (0, _theme.getThemeAppName)(props.theme);
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
var getLogoAltText = function getLogoAltText() {
|
|
90
|
+
if (logoLink && logoLinkTitle) {
|
|
91
|
+
return "";
|
|
92
|
+
} else if (themeLogo && themeAppName) {
|
|
93
|
+
return "".concat(themeAppName, " logo");
|
|
94
|
+
} else {
|
|
95
|
+
return "DIBK logo";
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var renderLogoElement = function renderLogoElement() {
|
|
99
|
+
var altText = getLogoAltText();
|
|
100
|
+
return themeLogo ? _react.default.createElement("img", {
|
|
101
|
+
alt: altText,
|
|
102
|
+
src: themeLogo,
|
|
103
|
+
style: getLogoThemeStyle(props.theme)
|
|
104
|
+
}) : _react.default.createElement("img", {
|
|
105
|
+
alt: altText,
|
|
106
|
+
src: _dibkLogoMobile.default
|
|
107
|
+
});
|
|
108
|
+
};
|
|
97
109
|
var logoLinkProps = {
|
|
98
110
|
target: props.openLogoLinkInNewTab ? "_blank" : null,
|
|
99
111
|
rel: props.openLogoLinkInNewTab ? "noopener noreferrer" : null
|
|
100
112
|
};
|
|
101
113
|
return logoLink && logoLink.length ? _react.default.createElement("a", _extends({}, logoLinkProps, {
|
|
102
|
-
href: logoLink
|
|
103
|
-
|
|
114
|
+
href: logoLink,
|
|
115
|
+
title: logoLinkTitle
|
|
116
|
+
}), renderLogoElement()) : renderLogoElement();
|
|
104
117
|
};
|
|
105
118
|
var navigationBarThemeStyle = getNavigationBarThemeStyle(props.theme);
|
|
106
119
|
var hamburgerIconLineStyle = {
|
|
@@ -120,7 +133,7 @@ var NavigationBar = function NavigationBar(props) {
|
|
|
120
133
|
style: navigationBarThemeStyle
|
|
121
134
|
}, _react.default.createElement("div", {
|
|
122
135
|
className: _NavigationBarModule.default.logoContainer
|
|
123
|
-
}, renderLogo(props.logoLink)), !!props.children && _react.default.createElement("div", {
|
|
136
|
+
}, renderLogo(props.logoLink, props.logoLinkTitle)), !!props.children && _react.default.createElement("div", {
|
|
124
137
|
className: _NavigationBarModule.default.childElements
|
|
125
138
|
}, props.children), hasListItems && _react.default.createElement("button", {
|
|
126
139
|
type: "button",
|
|
@@ -153,6 +166,7 @@ NavigationBar.propTypes = {
|
|
|
153
166
|
primaryListItems: _propTypes.default.array,
|
|
154
167
|
secondaryListItems: _propTypes.default.array,
|
|
155
168
|
logoLink: _propTypes.default.string,
|
|
169
|
+
logoLinkTitle: _propTypes.default.string,
|
|
156
170
|
openLogoLinkInNewTab: _propTypes.default.bool,
|
|
157
171
|
theme: _propTypes.default.object
|
|
158
172
|
};
|
|
@@ -161,5 +175,4 @@ NavigationBar.defaultProps = {
|
|
|
161
175
|
secondaryListItems: [],
|
|
162
176
|
logoLink: null
|
|
163
177
|
};
|
|
164
|
-
var _default = NavigationBar;
|
|
165
|
-
exports.default = _default;
|
|
178
|
+
var _default = exports.default = NavigationBar;
|
|
@@ -34,5 +34,4 @@ NavigationBarListItem.propTypes = {
|
|
|
34
34
|
listItem: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
35
35
|
theme: _propTypes.default.object
|
|
36
36
|
};
|
|
37
|
-
var _default = NavigationBarListItem;
|
|
38
|
-
exports.default = _default;
|
|
37
|
+
var _default = exports.default = NavigationBarListItem;
|
package/dist/components/Paper.js
CHANGED
|
@@ -15,11 +15,14 @@ var RadioButtonList = function RadioButtonList(props) {
|
|
|
15
15
|
var renderChildElements = function renderChildElements(childElements) {
|
|
16
16
|
var childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map(function (childElement, index) {
|
|
18
|
-
var
|
|
18
|
+
var _childElement$type;
|
|
19
|
+
var isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$type = childElement.type) === null || _childElement$type === void 0 ? void 0 : _childElement$type.name) === "RadioButtonListItem";
|
|
20
|
+
var childElementProps = isRadioButtonListItem ? {
|
|
19
21
|
requiredGroup: props.required,
|
|
20
22
|
compact: props.compact,
|
|
21
23
|
key: "radioButtonListItem-".concat(index)
|
|
22
|
-
}
|
|
24
|
+
} : null;
|
|
25
|
+
var childElementCopy = _react.default.cloneElement(childElement, childElementProps);
|
|
23
26
|
return childElementCopy;
|
|
24
27
|
});
|
|
25
28
|
};
|
|
@@ -36,5 +39,4 @@ RadioButtonList.propTypes = {
|
|
|
36
39
|
required: _propTypes.default.bool,
|
|
37
40
|
compact: _propTypes.default.bool
|
|
38
41
|
};
|
|
39
|
-
var _default = RadioButtonList;
|
|
40
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = RadioButtonList;
|
package/dist/components/Table.js
CHANGED
package/dist/components/Theme.js
CHANGED
|
@@ -49,5 +49,4 @@ Step.propTypes = {
|
|
|
49
49
|
activeStepId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
50
50
|
index: _propTypes.default.number.isRequired
|
|
51
51
|
};
|
|
52
|
-
var _default = Step;
|
|
53
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = Step;
|
|
@@ -46,5 +46,4 @@ WizardNavigation.propTypes = {
|
|
|
46
46
|
activeStepId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
47
47
|
"aria-label": _propTypes.default.string
|
|
48
48
|
};
|
|
49
|
-
var _default = WizardNavigation;
|
|
50
|
-
exports.default = _default;
|
|
49
|
+
var _default = exports.default = WizardNavigation;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.generateRandomString = void 0;
|
|
7
|
-
var generateRandomString = function generateRandomString(length) {
|
|
7
|
+
var generateRandomString = exports.generateRandomString = function generateRandomString(length) {
|
|
8
8
|
var result = '';
|
|
9
9
|
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
10
10
|
var charactersLength = characters.length;
|
|
@@ -12,5 +12,4 @@ var generateRandomString = function generateRandomString(length) {
|
|
|
12
12
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
13
13
|
}
|
|
14
14
|
return result;
|
|
15
|
-
};
|
|
16
|
-
exports.generateRandomString = generateRandomString;
|
|
15
|
+
};
|
|
@@ -11,14 +11,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
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; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
13
|
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); }
|
|
14
|
-
var classNameArrayToClassNameString = function classNameArrayToClassNameString(classNameArray) {
|
|
14
|
+
var classNameArrayToClassNameString = exports.classNameArrayToClassNameString = function classNameArrayToClassNameString(classNameArray) {
|
|
15
15
|
var _classNameArray$filte;
|
|
16
16
|
return (classNameArray === null || classNameArray === void 0 || (_classNameArray$filte = classNameArray.filter(function (className) {
|
|
17
17
|
return className;
|
|
18
18
|
})) === null || _classNameArray$filte === void 0 ? void 0 : _classNameArray$filte.join(" ")) || "";
|
|
19
19
|
};
|
|
20
|
-
exports.
|
|
21
|
-
var cloneThroughFragments = function cloneThroughFragments(children) {
|
|
20
|
+
var cloneThroughFragments = exports.cloneThroughFragments = function cloneThroughFragments(children) {
|
|
22
21
|
return _react.Children.map(children, function (c) {
|
|
23
22
|
if ((0, _react.isValidElement)(c)) {
|
|
24
23
|
if (c.type === _react.Fragment) {
|
|
@@ -29,21 +28,18 @@ var cloneThroughFragments = function cloneThroughFragments(children) {
|
|
|
29
28
|
return c;
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
exports.
|
|
33
|
-
var setFocusToElement = function setFocusToElement(element) {
|
|
31
|
+
var setFocusToElement = exports.setFocusToElement = function setFocusToElement(element) {
|
|
34
32
|
var autoFocusElement = document.createElement("button");
|
|
35
33
|
element.prepend(autoFocusElement);
|
|
36
34
|
autoFocusElement.focus();
|
|
37
35
|
autoFocusElement.remove();
|
|
38
36
|
};
|
|
39
|
-
exports.
|
|
40
|
-
var getFocusableElementsInsideElement = function getFocusableElementsInsideElement(element) {
|
|
37
|
+
var getFocusableElementsInsideElement = exports.getFocusableElementsInsideElement = function getFocusableElementsInsideElement(element) {
|
|
41
38
|
return Array.from(element.querySelectorAll('button, [href], input, [tabindex="0"]')).filter(function (resultElement) {
|
|
42
39
|
return resultElement;
|
|
43
40
|
});
|
|
44
41
|
};
|
|
45
|
-
exports.
|
|
46
|
-
var addFocusTrapInsideElement = function addFocusTrapInsideElement(element) {
|
|
42
|
+
var addFocusTrapInsideElement = exports.addFocusTrapInsideElement = function addFocusTrapInsideElement(element) {
|
|
47
43
|
setFocusToElement(element);
|
|
48
44
|
var focusableElements = getFocusableElementsInsideElement(element);
|
|
49
45
|
var firstFocusableElement = focusableElements !== null && focusableElements !== void 0 && focusableElements.length ? focusableElements[0] : null;
|
|
@@ -66,5 +62,4 @@ var addFocusTrapInsideElement = function addFocusTrapInsideElement(element) {
|
|
|
66
62
|
}
|
|
67
63
|
};
|
|
68
64
|
}
|
|
69
|
-
};
|
|
70
|
-
exports.addFocusTrapInsideElement = addFocusTrapInsideElement;
|
|
65
|
+
};
|
package/dist/functions/theme.js
CHANGED
|
@@ -4,50 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getThemeTextColor = exports.getThemePaletteTextColor = exports.getThemePaletteBorderColor = exports.getThemePaletteBackgroundColor = exports.getThemeNavigationBarTextColor = exports.getThemeNavigationBarBackgroundColor = exports.getThemeLogoPadding = exports.getThemeLogo = exports.getThemeLinkColor = exports.getThemeAppName = void 0;
|
|
7
|
-
var getThemePaletteBackgroundColor = function getThemePaletteBackgroundColor(theme, color) {
|
|
7
|
+
var getThemePaletteBackgroundColor = exports.getThemePaletteBackgroundColor = function getThemePaletteBackgroundColor(theme, color) {
|
|
8
8
|
var _theme$colors;
|
|
9
9
|
return (theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 || (_theme$colors = _theme$colors.palette) === null || _theme$colors === void 0 || (_theme$colors = _theme$colors[color]) === null || _theme$colors === void 0 ? void 0 : _theme$colors.background) || null;
|
|
10
10
|
};
|
|
11
|
-
exports.
|
|
12
|
-
var getThemePaletteTextColor = function getThemePaletteTextColor(theme, color) {
|
|
11
|
+
var getThemePaletteTextColor = exports.getThemePaletteTextColor = function getThemePaletteTextColor(theme, color) {
|
|
13
12
|
var _theme$colors2;
|
|
14
13
|
return (theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 || (_theme$colors2 = _theme$colors2.palette) === null || _theme$colors2 === void 0 || (_theme$colors2 = _theme$colors2[color]) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.text) || null;
|
|
15
14
|
};
|
|
16
|
-
exports.
|
|
17
|
-
var getThemePaletteBorderColor = function getThemePaletteBorderColor(theme, color) {
|
|
15
|
+
var getThemePaletteBorderColor = exports.getThemePaletteBorderColor = function getThemePaletteBorderColor(theme, color) {
|
|
18
16
|
var _theme$colors3;
|
|
19
17
|
return (theme === null || theme === void 0 || (_theme$colors3 = theme.colors) === null || _theme$colors3 === void 0 || (_theme$colors3 = _theme$colors3.palette) === null || _theme$colors3 === void 0 || (_theme$colors3 = _theme$colors3[color]) === null || _theme$colors3 === void 0 ? void 0 : _theme$colors3.border) || null;
|
|
20
18
|
};
|
|
21
|
-
exports.
|
|
22
|
-
var getThemeNavigationBarBackgroundColor = function getThemeNavigationBarBackgroundColor(theme) {
|
|
19
|
+
var getThemeNavigationBarBackgroundColor = exports.getThemeNavigationBarBackgroundColor = function getThemeNavigationBarBackgroundColor(theme) {
|
|
23
20
|
var _theme$colors4;
|
|
24
21
|
return (theme === null || theme === void 0 || (_theme$colors4 = theme.colors) === null || _theme$colors4 === void 0 || (_theme$colors4 = _theme$colors4.navigationBar) === null || _theme$colors4 === void 0 ? void 0 : _theme$colors4.background) || null;
|
|
25
22
|
};
|
|
26
|
-
exports.
|
|
27
|
-
var getThemeNavigationBarTextColor = function getThemeNavigationBarTextColor(theme) {
|
|
23
|
+
var getThemeNavigationBarTextColor = exports.getThemeNavigationBarTextColor = function getThemeNavigationBarTextColor(theme) {
|
|
28
24
|
var _theme$colors5;
|
|
29
25
|
return (theme === null || theme === void 0 || (_theme$colors5 = theme.colors) === null || _theme$colors5 === void 0 || (_theme$colors5 = _theme$colors5.navigationBar) === null || _theme$colors5 === void 0 ? void 0 : _theme$colors5.text) || null;
|
|
30
26
|
};
|
|
31
|
-
exports.
|
|
32
|
-
var getThemeLogo = function getThemeLogo(theme) {
|
|
27
|
+
var getThemeLogo = exports.getThemeLogo = function getThemeLogo(theme) {
|
|
33
28
|
return (theme === null || theme === void 0 ? void 0 : theme.logo) || null;
|
|
34
29
|
};
|
|
35
|
-
exports.
|
|
36
|
-
var getThemeLogoPadding = function getThemeLogoPadding(theme) {
|
|
30
|
+
var getThemeLogoPadding = exports.getThemeLogoPadding = function getThemeLogoPadding(theme) {
|
|
37
31
|
return (theme === null || theme === void 0 ? void 0 : theme.logoPadding) || null;
|
|
38
32
|
};
|
|
39
|
-
exports.
|
|
40
|
-
var getThemeAppName = function getThemeAppName(theme) {
|
|
33
|
+
var getThemeAppName = exports.getThemeAppName = function getThemeAppName(theme) {
|
|
41
34
|
return (theme === null || theme === void 0 ? void 0 : theme.appName) || null;
|
|
42
35
|
};
|
|
43
|
-
exports.
|
|
44
|
-
var getThemeTextColor = function getThemeTextColor(theme) {
|
|
36
|
+
var getThemeTextColor = exports.getThemeTextColor = function getThemeTextColor(theme) {
|
|
45
37
|
var _theme$colors6;
|
|
46
38
|
return (theme === null || theme === void 0 || (_theme$colors6 = theme.colors) === null || _theme$colors6 === void 0 ? void 0 : _theme$colors6.text) || null;
|
|
47
39
|
};
|
|
48
|
-
exports.
|
|
49
|
-
var getThemeLinkColor = function getThemeLinkColor(theme) {
|
|
40
|
+
var getThemeLinkColor = exports.getThemeLinkColor = function getThemeLinkColor(theme) {
|
|
50
41
|
var _theme$colors7;
|
|
51
42
|
return (theme === null || theme === void 0 || (_theme$colors7 = theme.colors) === null || _theme$colors7 === void 0 ? void 0 : _theme$colors7.link) || null;
|
|
52
|
-
};
|
|
53
|
-
exports.getThemeLinkColor = getThemeLinkColor;
|
|
43
|
+
};
|