dibk-design 1.0.14 → 1.1.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/dist/components/CheckBoxInput.js +1 -0
- package/dist/components/CheckBoxList.js +21 -0
- package/dist/components/CheckBoxList.md +26 -0
- package/dist/components/CheckBoxList.module.scss +5 -0
- package/dist/components/CheckBoxListItem.js +26 -57
- package/dist/components/RadioButtonInput.js +1 -0
- package/dist/components/RadioButtonList.js +21 -0
- package/dist/components/RadioButtonList.md +28 -0
- package/dist/components/RadioButtonList.module.scss +5 -0
- package/dist/components/RadioButtonListItem.js +24 -55
- package/dist/functions/helpers.js +16 -0
- package/dist/index.js +16 -0
- package/package.json +1 -1
|
@@ -70,6 +70,7 @@ var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
|
|
|
70
70
|
checked: this.props.checked,
|
|
71
71
|
disabled: this.props.disabled,
|
|
72
72
|
onChange: this.props.onChange,
|
|
73
|
+
tabIndex: this.props.tabIndex || null,
|
|
73
74
|
"aria-controls": this.props["aria-controls"]
|
|
74
75
|
};
|
|
75
76
|
return /*#__PURE__*/_react.default.createElement("label", labelProps, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, iconProps), /*#__PURE__*/_react.default.createElement("input", inputProps)) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, iconProps), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _CheckBoxListModule = _interopRequireDefault(require("./CheckBoxList.module.scss"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var CheckBoxList = function CheckBoxList(props) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
16
|
+
className: _CheckBoxListModule.default.checkBoxList
|
|
17
|
+
}, props.children);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = CheckBoxList;
|
|
21
|
+
exports.default = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Ordered List example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import CheckBoxListItem from "lib/components/CheckBoxListItem";
|
|
5
|
+
<CheckBoxList>
|
|
6
|
+
<CheckBoxListItem
|
|
7
|
+
onChange={() => {
|
|
8
|
+
console.log("onchange");
|
|
9
|
+
}}
|
|
10
|
+
checked={true}
|
|
11
|
+
name="checkboxlist"
|
|
12
|
+
id="checkboxList-listItem-1"
|
|
13
|
+
>
|
|
14
|
+
Label for checked checkbox
|
|
15
|
+
</CheckBoxListItem>
|
|
16
|
+
<CheckBoxListItem
|
|
17
|
+
onChange={() => {
|
|
18
|
+
console.log("onchange");
|
|
19
|
+
}}
|
|
20
|
+
name="checkboxlist"
|
|
21
|
+
id="checkboxList-listItem-2"
|
|
22
|
+
>
|
|
23
|
+
Label for unchecked checkbox
|
|
24
|
+
</CheckBoxListItem>
|
|
25
|
+
</CheckBoxList>;
|
|
26
|
+
```
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -13,64 +11,35 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
11
|
|
|
14
12
|
var _CheckBoxInput = _interopRequireDefault(require("./CheckBoxInput"));
|
|
15
13
|
|
|
14
|
+
var _helpers = require("../functions/helpers");
|
|
15
|
+
|
|
16
16
|
var _CheckBoxListItemModule = _interopRequireDefault(require("./CheckBoxListItem.module.scss"));
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_inherits(CheckBoxListItem, _React$Component);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(CheckBoxListItem);
|
|
44
|
-
|
|
45
|
-
function CheckBoxListItem() {
|
|
46
|
-
_classCallCheck(this, CheckBoxListItem);
|
|
47
|
-
|
|
48
|
-
return _super.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_createClass(CheckBoxListItem, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
-
className: "".concat(_CheckBoxListItemModule.default.checkBoxListItem, " ").concat(this.props.checked ? _CheckBoxListItemModule.default.checked : '', " ").concat(this.props.disabled ? _CheckBoxListItemModule.default.disabled : '', " ").concat(this.props.contentOnly ? _CheckBoxListItemModule.default.contentOnly : '', " ").concat(this.props.compact ? _CheckBoxListItemModule.default.compact : '', " ").concat(this.props.hasErrors ? _CheckBoxListItemModule.default.hasErrors : '')
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_CheckBoxInput.default, {
|
|
57
|
-
onChange: this.props.onChange,
|
|
58
|
-
checked: this.props.checked,
|
|
59
|
-
disabled: this.props.disabled,
|
|
60
|
-
contentOnly: this.props.contentOnly,
|
|
61
|
-
hasErrors: this.props.hasErrors,
|
|
62
|
-
id: this.props.id,
|
|
63
|
-
theme: this.props.theme,
|
|
64
|
-
checkmarkCharacter: this.props.checkmarkCharacter
|
|
65
|
-
}, this.props.children));
|
|
66
|
-
}
|
|
67
|
-
}]);
|
|
68
|
-
|
|
69
|
-
return CheckBoxListItem;
|
|
70
|
-
}(_react.default.Component);
|
|
20
|
+
// Dependencies
|
|
21
|
+
// Components
|
|
22
|
+
// Functions
|
|
23
|
+
// Stylesheets
|
|
24
|
+
var CheckBoxListItem = function CheckBoxListItem(props) {
|
|
25
|
+
var listItemClassNameArray = [_CheckBoxListItemModule.default.checkBoxListItem, props.checked ? _CheckBoxListItemModule.default.checked : null, props.disabled ? _CheckBoxListItemModule.default.disabled : null, props.compact ? _CheckBoxListItemModule.default.compact : null, props.contentOnly ? _CheckBoxListItemModule.default.contentOnly : null, props.hasErrors ? _CheckBoxListItemModule.default.hasErrors : null];
|
|
26
|
+
var listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
|
|
27
|
+
var inputProps = {
|
|
28
|
+
onChange: props.onChange,
|
|
29
|
+
checked: props.checked,
|
|
30
|
+
disabled: props.disabled,
|
|
31
|
+
contentOnly: props.contentOnly,
|
|
32
|
+
hasErrors: props.hasErrors,
|
|
33
|
+
id: props.id,
|
|
34
|
+
theme: props.theme,
|
|
35
|
+
checkmarkCharacter: props.checkmarkCharacter
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
38
|
+
className: listItemClassNameString
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_CheckBoxInput.default, inputProps, props.children));
|
|
40
|
+
};
|
|
71
41
|
|
|
72
42
|
CheckBoxListItem.propTypes = {
|
|
73
|
-
/** Text content inside list item */
|
|
74
43
|
checked: _propTypes.default.bool,
|
|
75
44
|
disabled: _propTypes.default.bool,
|
|
76
45
|
id: _propTypes.default.string.isRequired,
|
|
@@ -85,11 +54,11 @@ CheckBoxListItem.propTypes = {
|
|
|
85
54
|
CheckBoxListItem.defaultProps = {
|
|
86
55
|
checked: false,
|
|
87
56
|
disabled: false,
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
57
|
+
id: "",
|
|
58
|
+
name: "",
|
|
90
59
|
contentOnly: false,
|
|
91
60
|
hasErrors: false,
|
|
92
|
-
checkmarkCharacter:
|
|
61
|
+
checkmarkCharacter: "✔"
|
|
93
62
|
};
|
|
94
63
|
var _default = CheckBoxListItem;
|
|
95
64
|
exports.default = _default;
|
|
@@ -69,6 +69,7 @@ var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
|
|
|
69
69
|
checked: this.props.checked,
|
|
70
70
|
disabled: this.props.disabled,
|
|
71
71
|
onChange: this.props.onChange,
|
|
72
|
+
tabIndex: this.props.tabIndex || null,
|
|
72
73
|
"aria-controls": this.props["aria-controls"]
|
|
73
74
|
};
|
|
74
75
|
return /*#__PURE__*/_react.default.createElement("label", labelProps, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_RadioButtonIcon.default, iconProps), /*#__PURE__*/_react.default.createElement("input", inputProps)) : null, /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _RadioButtonListModule = _interopRequireDefault(require("./RadioButtonList.module.scss"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var RadioButtonList = function RadioButtonList(props) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
16
|
+
className: _RadioButtonListModule.default.radioButtonList
|
|
17
|
+
}, props.children);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = RadioButtonList;
|
|
21
|
+
exports.default = _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Ordered List example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import RadioButtonListItem from "lib/components/RadioButtonListItem";
|
|
5
|
+
<RadioButtonList>
|
|
6
|
+
<RadioButtonListItem
|
|
7
|
+
onChange={() => {
|
|
8
|
+
console.log("onchange");
|
|
9
|
+
}}
|
|
10
|
+
inputValue="value 1"
|
|
11
|
+
name="radio-button-list-list-item"
|
|
12
|
+
id="radioButtonList-listItem-1"
|
|
13
|
+
checked={true}
|
|
14
|
+
>
|
|
15
|
+
Checked radio button
|
|
16
|
+
</RadioButtonListItem>
|
|
17
|
+
<RadioButtonListItem
|
|
18
|
+
onChange={() => {
|
|
19
|
+
console.log("onchange");
|
|
20
|
+
}}
|
|
21
|
+
inputValue="value 2"
|
|
22
|
+
name="radio-button-list-list-item"
|
|
23
|
+
id="radioButtonList-listItem-1"
|
|
24
|
+
>
|
|
25
|
+
Unchecked radio button
|
|
26
|
+
</RadioButtonListItem>
|
|
27
|
+
</RadioButtonList>;
|
|
28
|
+
```
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -13,64 +11,35 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
11
|
|
|
14
12
|
var _RadioButtonInput = _interopRequireDefault(require("./RadioButtonInput"));
|
|
15
13
|
|
|
14
|
+
var _helpers = require("../functions/helpers");
|
|
15
|
+
|
|
16
16
|
var _RadioButtonListItemModule = _interopRequireDefault(require("./RadioButtonListItem.module.scss"));
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_inherits(RadioButtonListItem, _React$Component);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(RadioButtonListItem);
|
|
44
|
-
|
|
45
|
-
function RadioButtonListItem() {
|
|
46
|
-
_classCallCheck(this, RadioButtonListItem);
|
|
47
|
-
|
|
48
|
-
return _super.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_createClass(RadioButtonListItem, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
-
className: "".concat(_RadioButtonListItemModule.default.radioButtonListItem, " ").concat(this.props.disabled ? _RadioButtonListItemModule.default.disabled : '', " ").concat(this.props.compact ? _RadioButtonListItemModule.default.compact : '', " ").concat(this.props.contentOnly ? _RadioButtonListItemModule.default.contentOnly : '', " ").concat(this.props.hasErrors ? _RadioButtonListItemModule.default.hasErrors : '')
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_RadioButtonInput.default, {
|
|
57
|
-
onChange: this.props.onChange,
|
|
58
|
-
inputValue: this.props.inputValue,
|
|
59
|
-
checked: this.props.checked,
|
|
60
|
-
disabled: this.props.disabled,
|
|
61
|
-
contentOnly: this.props.contentOnly,
|
|
62
|
-
hasErrors: this.props.hasErrors,
|
|
63
|
-
id: this.props.id,
|
|
64
|
-
theme: this.props.theme
|
|
65
|
-
}, this.props.children));
|
|
66
|
-
}
|
|
67
|
-
}]);
|
|
68
|
-
|
|
69
|
-
return RadioButtonListItem;
|
|
70
|
-
}(_react.default.Component);
|
|
20
|
+
// Dependencies
|
|
21
|
+
// Components
|
|
22
|
+
// Functions
|
|
23
|
+
// Stylesheets
|
|
24
|
+
var RadioButtonListItem = function RadioButtonListItem(props) {
|
|
25
|
+
var listItemClassNameArray = [_RadioButtonListItemModule.default.radioButtonListItem, props.disabled ? _RadioButtonListItemModule.default.disabled : null, props.compact ? _RadioButtonListItemModule.default.compact : null, props.contentOnly ? _RadioButtonListItemModule.default.contentOnly : null, props.hasErrors ? _RadioButtonListItemModule.default.hasErrors : null];
|
|
26
|
+
var listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
|
|
27
|
+
var inputProps = {
|
|
28
|
+
onChange: props.onChange,
|
|
29
|
+
inputValue: props.inputValue,
|
|
30
|
+
checked: props.checked,
|
|
31
|
+
disabled: props.disabled,
|
|
32
|
+
contentOnly: props.contentOnly,
|
|
33
|
+
hasErrors: props.hasErrors,
|
|
34
|
+
id: props.id,
|
|
35
|
+
theme: props.theme
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
38
|
+
className: listItemClassNameString
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_RadioButtonInput.default, inputProps, props.children));
|
|
40
|
+
};
|
|
71
41
|
|
|
72
42
|
RadioButtonListItem.propTypes = {
|
|
73
|
-
/** Text content inside list item */
|
|
74
43
|
inputValue: _propTypes.default.string.isRequired,
|
|
75
44
|
checked: _propTypes.default.bool,
|
|
76
45
|
disabled: _propTypes.default.bool,
|
|
@@ -82,7 +51,7 @@ RadioButtonListItem.propTypes = {
|
|
|
82
51
|
hasErrors: _propTypes.default.bool
|
|
83
52
|
};
|
|
84
53
|
RadioButtonListItem.defaultProps = {
|
|
85
|
-
name:
|
|
54
|
+
name: "",
|
|
86
55
|
checked: false,
|
|
87
56
|
disabled: false,
|
|
88
57
|
contentOnly: false,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.classNameArrayToClassNameString = void 0;
|
|
7
|
+
|
|
8
|
+
var classNameArrayToClassNameString = function classNameArrayToClassNameString(classNameArray) {
|
|
9
|
+
var _classNameArray$filte;
|
|
10
|
+
|
|
11
|
+
return (classNameArray === null || classNameArray === void 0 ? void 0 : (_classNameArray$filte = classNameArray.filter(function (className) {
|
|
12
|
+
return className;
|
|
13
|
+
})) === null || _classNameArray$filte === void 0 ? void 0 : _classNameArray$filte.join(" ")) || "";
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.classNameArrayToClassNameString = classNameArrayToClassNameString;
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "CheckBoxInput", {
|
|
|
27
27
|
return _CheckBoxInput.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "CheckBoxList", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _CheckBoxList.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "CheckBoxListItem", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
@@ -147,6 +153,12 @@ Object.defineProperty(exports, "RadioButtonInput", {
|
|
|
147
153
|
return _RadioButtonInput.default;
|
|
148
154
|
}
|
|
149
155
|
});
|
|
156
|
+
Object.defineProperty(exports, "RadioButtonList", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _RadioButtonList.default;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
150
162
|
Object.defineProperty(exports, "RadioButtonListItem", {
|
|
151
163
|
enumerable: true,
|
|
152
164
|
get: function get() {
|
|
@@ -192,6 +204,8 @@ var _CheckBoxIcon = _interopRequireDefault(require("./components/CheckBoxIcon"))
|
|
|
192
204
|
|
|
193
205
|
var _CheckBoxInput = _interopRequireDefault(require("./components/CheckBoxInput"));
|
|
194
206
|
|
|
207
|
+
var _CheckBoxList = _interopRequireDefault(require("./components/CheckBoxList"));
|
|
208
|
+
|
|
195
209
|
var _CheckBoxListItem = _interopRequireDefault(require("./components/CheckBoxListItem"));
|
|
196
210
|
|
|
197
211
|
var _Container = _interopRequireDefault(require("./components/Container"));
|
|
@@ -232,6 +246,8 @@ var _RadioButtonIcon = _interopRequireDefault(require("./components/RadioButtonI
|
|
|
232
246
|
|
|
233
247
|
var _RadioButtonInput = _interopRequireDefault(require("./components/RadioButtonInput"));
|
|
234
248
|
|
|
249
|
+
var _RadioButtonList = _interopRequireDefault(require("./components/RadioButtonList"));
|
|
250
|
+
|
|
235
251
|
var _RadioButtonListItem = _interopRequireDefault(require("./components/RadioButtonListItem"));
|
|
236
252
|
|
|
237
253
|
var _Select = _interopRequireDefault(require("./components/Select"));
|