dibk-design 1.0.7 → 1.0.10
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 -4
- package/dist/components/CheckBoxInput.md +0 -7
- package/dist/components/Header.md +1 -0
- package/dist/components/Header.module.scss +9 -0
- package/dist/components/List.js +23 -75
- package/dist/components/List.md +28 -3
- package/dist/components/List.module.scss +7 -8
- package/dist/components/RadioButtonInput.js +0 -2
- package/dist/components/RadioButtonInput.md +0 -2
- package/dist/components/Select.js +1 -1
- package/package.json +1 -1
|
@@ -70,7 +70,6 @@ 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
|
-
"aria-description": this.props["aria-description"],
|
|
74
73
|
"aria-controls": this.props["aria-controls"]
|
|
75
74
|
};
|
|
76
75
|
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));
|
|
@@ -90,7 +89,6 @@ CheckBoxInput.propTypes = {
|
|
|
90
89
|
hasErrors: _propTypes.default.bool,
|
|
91
90
|
theme: _propTypes.default.object,
|
|
92
91
|
checkmarkCharacter: _propTypes.default.string,
|
|
93
|
-
"aria-description": _propTypes.default.string,
|
|
94
92
|
"aria-controls": _propTypes.default.string
|
|
95
93
|
};
|
|
96
94
|
CheckBoxInput.defaultProps = {
|
|
@@ -99,8 +97,7 @@ CheckBoxInput.defaultProps = {
|
|
|
99
97
|
name: "",
|
|
100
98
|
contentOnly: false,
|
|
101
99
|
hasErrors: false,
|
|
102
|
-
checkmarkCharacter: "✔"
|
|
103
|
-
expandable: false
|
|
100
|
+
checkmarkCharacter: "✔"
|
|
104
101
|
};
|
|
105
102
|
var _default = CheckBoxInput;
|
|
106
103
|
exports.default = _default;
|
|
@@ -20,13 +20,6 @@ Checkbox input example:
|
|
|
20
20
|
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-6" checked={true} checkmarkCharacter="✕">
|
|
21
21
|
<span>Label for checked checkbox with custom checkmark</span>
|
|
22
22
|
</CheckBoxInput>
|
|
23
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-7" checked={true} checkmarkCharacter="✕" expandable={true}>
|
|
24
|
-
<span>Label for checkbox with aria-expanded true</span>
|
|
25
|
-
</CheckBoxInput>
|
|
26
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-8" checked={false} checkmarkCharacter="✕" expandable={true}>
|
|
27
|
-
<span>Label for checkbox with aria-expanded false</span>
|
|
28
|
-
</CheckBoxInput>
|
|
29
|
-
|
|
30
23
|
</div>
|
|
31
24
|
```
|
|
32
25
|
|
|
@@ -5,6 +5,7 @@ Title examples:
|
|
|
5
5
|
<Header content="Title with size 2" size={2}/>
|
|
6
6
|
<Header content="Title with size 3" size={3}/>
|
|
7
7
|
<Header content="Title with size 4" size={4}/>
|
|
8
|
+
<Header content="Title with size 5" size={5}/>
|
|
8
9
|
<Header content="Big title with size 1" big/>
|
|
9
10
|
<Header content="Title with size 2 and htmlTag h1" size={2} htmlTag="h1"/>
|
|
10
11
|
|
package/dist/components/List.js
CHANGED
|
@@ -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
|
});
|
|
@@ -15,87 +13,37 @@ var _ListModule = _interopRequireDefault(require("./List.module.scss"));
|
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
-
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
-
|
|
24
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
-
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
|
|
28
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
-
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
-
|
|
32
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
-
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
-
|
|
36
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
-
|
|
38
|
-
var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
39
|
-
_inherits(ListItem, _React$Component);
|
|
16
|
+
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; }
|
|
40
17
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_classCallCheck(this, ListItem);
|
|
45
|
-
|
|
46
|
-
return _super.apply(this, arguments);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
_createClass(ListItem, [{
|
|
50
|
-
key: "render",
|
|
51
|
-
value: function render() {
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("li", null, this.props.listItem);
|
|
53
|
-
}
|
|
54
|
-
}]);
|
|
55
|
-
|
|
56
|
-
return ListItem;
|
|
57
|
-
}(_react.default.Component);
|
|
58
|
-
|
|
59
|
-
var List = /*#__PURE__*/function (_React$Component2) {
|
|
60
|
-
_inherits(List, _React$Component2);
|
|
61
|
-
|
|
62
|
-
var _super2 = _createSuper(List);
|
|
63
|
-
|
|
64
|
-
function List() {
|
|
65
|
-
_classCallCheck(this, List);
|
|
66
|
-
|
|
67
|
-
return _super2.apply(this, arguments);
|
|
68
|
-
}
|
|
18
|
+
var ListItem = function ListItem(props) {
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("li", null, props.listItem);
|
|
20
|
+
};
|
|
69
21
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
key: i
|
|
77
|
-
});
|
|
22
|
+
var List = function List(props) {
|
|
23
|
+
var renderList = function renderList() {
|
|
24
|
+
var listItems = props.listItems.map(function (listItem, i) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(ListItem, {
|
|
26
|
+
listItem: listItem,
|
|
27
|
+
key: i
|
|
78
28
|
});
|
|
79
|
-
|
|
29
|
+
});
|
|
30
|
+
var listType = props.ordered ? "ol" : "ul";
|
|
31
|
+
var defaultListStyle = props.ordered ? 'decimal' : 'disc';
|
|
32
|
+
var scssValueProperty = "--listStyle";
|
|
80
33
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
34
|
+
var listElement = /*#__PURE__*/_react.default.createElement(listType, {
|
|
35
|
+
className: "".concat(_ListModule.default.list, " ").concat(!!props.compact ? _ListModule.default.compact : ''),
|
|
36
|
+
style: _defineProperty({}, scssValueProperty, props.listStyle || defaultListStyle)
|
|
37
|
+
}, listItems);
|
|
84
38
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, {
|
|
88
|
-
key: "render",
|
|
89
|
-
value: function render() {
|
|
90
|
-
return /*#__PURE__*/_react.default.createElement("div", null, this.renderList());
|
|
91
|
-
}
|
|
92
|
-
}]);
|
|
39
|
+
return listElement;
|
|
40
|
+
};
|
|
93
41
|
|
|
94
|
-
return
|
|
95
|
-
}
|
|
42
|
+
return renderList();
|
|
43
|
+
};
|
|
96
44
|
|
|
97
45
|
List.propTypes = {
|
|
98
|
-
listItems: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
46
|
+
listItems: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object])),
|
|
99
47
|
ordered: _propTypes.default.bool
|
|
100
48
|
};
|
|
101
49
|
List.defaultProps = {
|
package/dist/components/List.md
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
Ordered List example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<List listItems={["item 1", "item 2", "item 3"]} ordered={true} />
|
|
5
|
+
```
|
|
6
|
+
|
|
1
7
|
Unordered List example:
|
|
2
8
|
|
|
3
9
|
```js
|
|
4
|
-
<List listItems={[
|
|
10
|
+
<List listItems={["item 1", "item 2", "item 3", <a href="hoy">test</a>]} />
|
|
5
11
|
```
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
Unordered square-styled List example:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
<List listItems={["item 1", "item 2", "item 3"]} listStyle="square" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Unordered unstyled List example:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
<List listItems={["item 1", "item 2", "item 3"]} listStyle="none" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Unordered unstyled compact List example:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
<List listItems={["item 1", "item 2", "item 3"]} listStyle="none" compact />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Unordered List with subitems example:
|
|
32
|
+
|
|
8
33
|
```js
|
|
9
|
-
<List listItems={['item 1',
|
|
34
|
+
<List listItems={['item 1', <React.Fragment>item 2 <List listItems={['subitem 1', 'subitem 2', 'subitem 3']} /></React.Fragment>, 'item 2']} />
|
|
10
35
|
```
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
margin-bottom: 20px;
|
|
6
6
|
list-style-position: outside;
|
|
7
7
|
font-size: 16px;
|
|
8
|
+
list-style: var(--listStyle);
|
|
8
9
|
li {
|
|
9
10
|
line-height: 1.6;
|
|
10
11
|
}
|
|
12
|
+
&:local(.compact) {
|
|
13
|
+
margin-left: 0px;
|
|
14
|
+
li {
|
|
15
|
+
line-height: 1.4;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
11
18
|
}
|
|
12
|
-
|
|
13
|
-
:local(ul.list) {
|
|
14
|
-
list-style: disc;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:local(ol.list) {
|
|
18
|
-
list-style: decimal;
|
|
19
|
-
}
|
|
@@ -69,7 +69,6 @@ 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
|
-
"aria-description": this.props["aria-description"],
|
|
73
72
|
"aria-controls": this.props["aria-controls"]
|
|
74
73
|
};
|
|
75
74
|
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));
|
|
@@ -89,7 +88,6 @@ RadioButtonInput.propTypes = {
|
|
|
89
88
|
hasErrors: _propTypes.default.bool,
|
|
90
89
|
theme: _propTypes.default.object,
|
|
91
90
|
inputValue: _propTypes.default.string.isRequired,
|
|
92
|
-
"aria-description": _propTypes.default.string,
|
|
93
91
|
"aria-controls": _propTypes.default.string
|
|
94
92
|
};
|
|
95
93
|
RadioButtonInput.defaultProps = {
|
|
@@ -6,8 +6,6 @@ Radio button input example:
|
|
|
6
6
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-2"><span>Unchecked radio button</span></RadioButtonInput>
|
|
7
7
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 1" name="radio-button-input" id="radio-button-input-3" checked={true} disabled={true}><span>Checked disabled radio button</span></RadioButtonInput>
|
|
8
8
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" disabled={true}><span>Unchecked disabled radio button</span></RadioButtonInput>
|
|
9
|
-
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={false} expandable={true}><span>Unchecked expandable radio button </span></RadioButtonInput>
|
|
10
|
-
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={true} expandable={true}><span>Checked expandable radio button </span></RadioButtonInput>
|
|
11
9
|
</div>
|
|
12
10
|
```
|
|
13
11
|
|
|
@@ -177,7 +177,7 @@ Select.propTypes = {
|
|
|
177
177
|
onChange: _propTypes.default.func.isRequired,
|
|
178
178
|
name: _propTypes.default.string,
|
|
179
179
|
multiple: _propTypes.default.bool,
|
|
180
|
-
options: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
|
|
180
|
+
options: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), _propTypes.default.shape({
|
|
181
181
|
key: _propTypes.default.string,
|
|
182
182
|
value: _propTypes.default.string
|
|
183
183
|
})])),
|