dibk-design 3.3.3 → 3.5.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 +15 -25
- package/dist/components/Button.js +16 -22
- package/dist/components/CheckBoxIcon.js +9 -13
- package/dist/components/CheckBoxInput.js +5 -6
- package/dist/components/CheckBoxList.js +8 -9
- package/dist/components/CheckBoxListItem.js +5 -6
- package/dist/components/Container.js +2 -3
- package/dist/components/ContentBox.js +8 -9
- package/dist/components/Dialog.js +9 -11
- package/dist/components/DragAndDropFileInput.js +22 -35
- package/dist/components/ErrorBox.js +3 -4
- package/dist/components/ErrorMessage.js +4 -5
- package/dist/components/Footer.js +2 -3
- package/dist/components/Header.js +8 -9
- package/dist/components/InputField.js +32 -29
- package/dist/components/Label.js +11 -15
- package/dist/components/List.js +10 -13
- package/dist/components/ListItem.js +3 -4
- package/dist/components/LoadingAnimation.js +2 -3
- package/dist/components/NavigationBar.js +50 -49
- package/dist/components/NavigationBarListItem.js +5 -7
- package/dist/components/Paper.js +2 -3
- package/dist/components/ProgressBar.js +6 -9
- package/dist/components/RadioButtonIcon.js +9 -13
- package/dist/components/RadioButtonInput.js +5 -6
- package/dist/components/RadioButtonList.js +8 -9
- package/dist/components/RadioButtonListItem.js +5 -6
- package/dist/components/Select.js +62 -66
- package/dist/components/Table.js +8 -9
- package/dist/components/Textarea.js +29 -25
- package/dist/components/Theme.js +16 -17
- package/dist/components/WizardNavigation/Step.js +13 -13
- package/dist/components/WizardNavigation.js +9 -10
- package/dist/functions/generators.js +5 -5
- package/dist/functions/helpers.js +18 -24
- package/dist/functions/theme.js +10 -10
- package/dist/index.js +32 -32
- package/package.json +1 -1
|
@@ -5,61 +5,55 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.setFocusToElement = exports.getFocusableElementsInsideElement = exports.cloneThroughFragments = exports.classNameArrayToClassNameString = exports.addFocusTrapInsideElement = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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) {
|
|
8
|
+
const classNameArrayToClassNameString = classNameArray => {
|
|
15
9
|
var _classNameArray$filte;
|
|
16
|
-
return (classNameArray === null || classNameArray === void 0 || (_classNameArray$filte = classNameArray.filter(
|
|
17
|
-
return className;
|
|
18
|
-
})) === null || _classNameArray$filte === void 0 ? void 0 : _classNameArray$filte.join(" ")) || "";
|
|
10
|
+
return (classNameArray === null || classNameArray === void 0 || (_classNameArray$filte = classNameArray.filter(className => className)) === null || _classNameArray$filte === void 0 ? void 0 : _classNameArray$filte.join(" ")) || "";
|
|
19
11
|
};
|
|
20
12
|
exports.classNameArrayToClassNameString = classNameArrayToClassNameString;
|
|
21
|
-
|
|
22
|
-
return _react.Children.map(children,
|
|
13
|
+
const cloneThroughFragments = children => {
|
|
14
|
+
return _react.Children.map(children, c => {
|
|
23
15
|
if ((0, _react.isValidElement)(c)) {
|
|
24
16
|
if (c.type === _react.Fragment) {
|
|
25
17
|
return cloneThroughFragments(c.props.children);
|
|
26
18
|
}
|
|
27
|
-
return (0, _react.cloneElement)(c,
|
|
19
|
+
return (0, _react.cloneElement)(c, {
|
|
20
|
+
...c.props
|
|
21
|
+
});
|
|
28
22
|
}
|
|
29
23
|
return c;
|
|
30
24
|
});
|
|
31
25
|
};
|
|
32
26
|
exports.cloneThroughFragments = cloneThroughFragments;
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
const setFocusToElement = element => {
|
|
28
|
+
const autoFocusElement = document.createElement("button");
|
|
35
29
|
element.prepend(autoFocusElement);
|
|
36
30
|
autoFocusElement.focus();
|
|
37
31
|
autoFocusElement.remove();
|
|
38
32
|
};
|
|
39
33
|
exports.setFocusToElement = setFocusToElement;
|
|
40
|
-
|
|
41
|
-
return Array.from(element.querySelectorAll('button, [href], input, [tabindex="0"]')).filter(
|
|
34
|
+
const getFocusableElementsInsideElement = element => {
|
|
35
|
+
return Array.from(element.querySelectorAll('button, [href], input, [tabindex="0"]')).filter(resultElement => {
|
|
42
36
|
return resultElement;
|
|
43
37
|
});
|
|
44
38
|
};
|
|
45
39
|
exports.getFocusableElementsInsideElement = getFocusableElementsInsideElement;
|
|
46
|
-
|
|
40
|
+
const addFocusTrapInsideElement = element => {
|
|
47
41
|
setFocusToElement(element);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const focusableElements = getFocusableElementsInsideElement(element);
|
|
43
|
+
const firstFocusableElement = focusableElements !== null && focusableElements !== void 0 && focusableElements.length ? focusableElements[0] : null;
|
|
44
|
+
const lastFocusableElement = (focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.length) > 1 ? focusableElements[focusableElements.length - 1] : firstFocusableElement;
|
|
51
45
|
if (firstFocusableElement) {
|
|
52
|
-
firstFocusableElement.onkeydown =
|
|
46
|
+
firstFocusableElement.onkeydown = event => {
|
|
53
47
|
if (event.keyCode === 9 && event.shiftKey) {
|
|
54
48
|
lastFocusableElement.focus();
|
|
55
49
|
}
|
|
56
50
|
};
|
|
57
51
|
}
|
|
58
52
|
if (lastFocusableElement) {
|
|
59
|
-
lastFocusableElement.onclick =
|
|
53
|
+
lastFocusableElement.onclick = () => {
|
|
60
54
|
firstFocusableElement.focus();
|
|
61
55
|
};
|
|
62
|
-
lastFocusableElement.onkeydown =
|
|
56
|
+
lastFocusableElement.onkeydown = event => {
|
|
63
57
|
if (event.keyCode === 9 && !event.shiftKey) {
|
|
64
58
|
event.preventDefault();
|
|
65
59
|
firstFocusableElement.focus();
|
package/dist/functions/theme.js
CHANGED
|
@@ -4,49 +4,49 @@ 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
|
-
|
|
7
|
+
const 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
11
|
exports.getThemePaletteBackgroundColor = getThemePaletteBackgroundColor;
|
|
12
|
-
|
|
12
|
+
const getThemePaletteTextColor = (theme, color) => {
|
|
13
13
|
var _theme$colors2;
|
|
14
14
|
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
15
|
};
|
|
16
16
|
exports.getThemePaletteTextColor = getThemePaletteTextColor;
|
|
17
|
-
|
|
17
|
+
const getThemePaletteBorderColor = (theme, color) => {
|
|
18
18
|
var _theme$colors3;
|
|
19
19
|
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
20
|
};
|
|
21
21
|
exports.getThemePaletteBorderColor = getThemePaletteBorderColor;
|
|
22
|
-
|
|
22
|
+
const getThemeNavigationBarBackgroundColor = theme => {
|
|
23
23
|
var _theme$colors4;
|
|
24
24
|
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
25
|
};
|
|
26
26
|
exports.getThemeNavigationBarBackgroundColor = getThemeNavigationBarBackgroundColor;
|
|
27
|
-
|
|
27
|
+
const getThemeNavigationBarTextColor = theme => {
|
|
28
28
|
var _theme$colors5;
|
|
29
29
|
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
30
|
};
|
|
31
31
|
exports.getThemeNavigationBarTextColor = getThemeNavigationBarTextColor;
|
|
32
|
-
|
|
32
|
+
const getThemeLogo = theme => {
|
|
33
33
|
return (theme === null || theme === void 0 ? void 0 : theme.logo) || null;
|
|
34
34
|
};
|
|
35
35
|
exports.getThemeLogo = getThemeLogo;
|
|
36
|
-
|
|
36
|
+
const getThemeLogoPadding = theme => {
|
|
37
37
|
return (theme === null || theme === void 0 ? void 0 : theme.logoPadding) || null;
|
|
38
38
|
};
|
|
39
39
|
exports.getThemeLogoPadding = getThemeLogoPadding;
|
|
40
|
-
|
|
40
|
+
const getThemeAppName = theme => {
|
|
41
41
|
return (theme === null || theme === void 0 ? void 0 : theme.appName) || null;
|
|
42
42
|
};
|
|
43
43
|
exports.getThemeAppName = getThemeAppName;
|
|
44
|
-
|
|
44
|
+
const getThemeTextColor = theme => {
|
|
45
45
|
var _theme$colors6;
|
|
46
46
|
return (theme === null || theme === void 0 || (_theme$colors6 = theme.colors) === null || _theme$colors6 === void 0 ? void 0 : _theme$colors6.text) || null;
|
|
47
47
|
};
|
|
48
48
|
exports.getThemeTextColor = getThemeTextColor;
|
|
49
|
-
|
|
49
|
+
const getThemeLinkColor = theme => {
|
|
50
50
|
var _theme$colors7;
|
|
51
51
|
return (theme === null || theme === void 0 || (_theme$colors7 = theme.colors) === null || _theme$colors7 === void 0 ? void 0 : _theme$colors7.link) || null;
|
|
52
52
|
};
|
package/dist/index.js
CHANGED
|
@@ -5,193 +5,193 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Accordion", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Accordion.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "Button", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _Button.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "CheckBoxIcon", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _CheckBoxIcon.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "CheckBoxInput", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _CheckBoxInput.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "CheckBoxList", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
32
|
+
get: function () {
|
|
33
33
|
return _CheckBoxList.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "CheckBoxListItem", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function
|
|
38
|
+
get: function () {
|
|
39
39
|
return _CheckBoxListItem.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "Container", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function
|
|
44
|
+
get: function () {
|
|
45
45
|
return _Container.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "ContentBox", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function
|
|
50
|
+
get: function () {
|
|
51
51
|
return _ContentBox.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "Dialog", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function
|
|
56
|
+
get: function () {
|
|
57
57
|
return _Dialog.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "DragAndDropFileInput", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function
|
|
62
|
+
get: function () {
|
|
63
63
|
return _DragAndDropFileInput.default;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "ErrorBox", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function
|
|
68
|
+
get: function () {
|
|
69
69
|
return _ErrorBox.default;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "ErrorMessage", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function
|
|
74
|
+
get: function () {
|
|
75
75
|
return _ErrorMessage.default;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "Footer", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function
|
|
80
|
+
get: function () {
|
|
81
81
|
return _Footer.default;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "Header", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function
|
|
86
|
+
get: function () {
|
|
87
87
|
return _Header.default;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "InputField", {
|
|
91
91
|
enumerable: true,
|
|
92
|
-
get: function
|
|
92
|
+
get: function () {
|
|
93
93
|
return _InputField.default;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "Label", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function
|
|
98
|
+
get: function () {
|
|
99
99
|
return _Label.default;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
Object.defineProperty(exports, "List", {
|
|
103
103
|
enumerable: true,
|
|
104
|
-
get: function
|
|
104
|
+
get: function () {
|
|
105
105
|
return _List.default;
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "ListItem", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function
|
|
110
|
+
get: function () {
|
|
111
111
|
return _ListItem.default;
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "LoadingAnimation", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function
|
|
116
|
+
get: function () {
|
|
117
117
|
return _LoadingAnimation.default;
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "NavigationBar", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function
|
|
122
|
+
get: function () {
|
|
123
123
|
return _NavigationBar.default;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "NavigationBarListItem", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function
|
|
128
|
+
get: function () {
|
|
129
129
|
return _NavigationBarListItem.default;
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "Paper", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function
|
|
134
|
+
get: function () {
|
|
135
135
|
return _Paper.default;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "ProgressBar", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function
|
|
140
|
+
get: function () {
|
|
141
141
|
return _ProgressBar.default;
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "RadioButtonIcon", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function
|
|
146
|
+
get: function () {
|
|
147
147
|
return _RadioButtonIcon.default;
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "RadioButtonInput", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function
|
|
152
|
+
get: function () {
|
|
153
153
|
return _RadioButtonInput.default;
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "RadioButtonList", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function
|
|
158
|
+
get: function () {
|
|
159
159
|
return _RadioButtonList.default;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "RadioButtonListItem", {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function
|
|
164
|
+
get: function () {
|
|
165
165
|
return _RadioButtonListItem.default;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "Select", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function
|
|
170
|
+
get: function () {
|
|
171
171
|
return _Select.default;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "Table", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function
|
|
176
|
+
get: function () {
|
|
177
177
|
return _Table.default;
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
Object.defineProperty(exports, "Textarea", {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function
|
|
182
|
+
get: function () {
|
|
183
183
|
return _Textarea.default;
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "WizardNavigation", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function
|
|
188
|
+
get: function () {
|
|
189
189
|
return _WizardNavigation.default;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
Object.defineProperty(exports, "WizardNavigationStep", {
|
|
193
193
|
enumerable: true,
|
|
194
|
-
get: function
|
|
194
|
+
get: function () {
|
|
195
195
|
return _Step.default;
|
|
196
196
|
}
|
|
197
197
|
});
|