dibk-design 1.0.0 → 1.0.3

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.
@@ -7,9 +7,6 @@
7
7
  padding: 0 15px 0;
8
8
  line-height: 0;
9
9
  max-height: 0;
10
- @media only screen and (min-width: $screen-sm) {
11
- padding: 0 30px 0;
12
- }
13
10
  }
14
11
  100% {
15
12
  opacity: 1;
@@ -17,9 +14,6 @@
17
14
  padding: 8px 15px 15px;
18
15
  line-height: inherit;
19
16
  max-height: 1000px;
20
- @media only screen and (min-width: $screen-sm) {
21
- padding: 8px 30px 15px;
22
- }
23
17
  }
24
18
  }
25
19
 
@@ -30,9 +24,6 @@
30
24
  padding: 0 15px 0;
31
25
  line-height: 0;
32
26
  max-height: 0;
33
- @media only screen and (min-width: $screen-sm) {
34
- padding: 0 30px 0;
35
- }
36
27
  }
37
28
  0% {
38
29
  opacity: 1;
@@ -40,8 +31,40 @@
40
31
  padding: 8px 15px 15px;
41
32
  line-height: inherit;
42
33
  max-height: 1000px;
43
- @media only screen and (min-width: $screen-sm) {
34
+ }
35
+ }
36
+
37
+ @media only screen and (min-width: $screen-sm) {
38
+ @keyframes show {
39
+ 0% {
40
+ opacity: 0;
41
+ margin-top: 0px;
42
+ padding: 0 30px 0;
43
+ line-height: 0;
44
+ max-height: 0;
45
+ }
46
+ 100% {
47
+ opacity: 1;
48
+ margin-top: 0px;
49
+ padding: 8px 30px 15px;
50
+ line-height: inherit;
51
+ max-height: 1000px;
52
+ }
53
+ }
54
+ @keyframes hide {
55
+ 100% {
56
+ opacity: 0;
57
+ margin-top: 0px;
58
+ padding: 0 30px 0;
59
+ line-height: 0;
60
+ max-height: 0;
61
+ }
62
+ 0% {
63
+ opacity: 1;
64
+ margin-top: 0px;
44
65
  padding: 8px 30px 15px;
66
+ line-height: inherit;
67
+ max-height: 1000px;
45
68
  }
46
69
  }
47
70
  }
@@ -71,13 +71,10 @@ var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
71
71
  });
72
72
  }
73
73
 
74
- var ariaExpandedIndex = "aria-expanded";
75
-
76
- var props = _defineProperty({
74
+ var props = {
77
75
  className: "".concat(_CheckBoxIconModule.default.checkBoxIcon, " ").concat(this.props.checked ? _CheckBoxIconModule.default.checked : '', " ").concat(this.props.disabled ? _CheckBoxIconModule.default.disabled : '', " ").concat(this.props.showBox ? _CheckBoxIconModule.default.showBox : '', " ").concat(this.props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ''),
78
76
  style: inlineStyle
79
- }, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
80
-
77
+ };
81
78
  return /*#__PURE__*/_react.default.createElement("span", props, /*#__PURE__*/_react.default.createElement("span", {
82
79
  className: _CheckBoxIconModule.default.checkmark
83
80
  }, this.props.checked ? this.props.checkmarkCharacter : ''));
@@ -94,8 +91,7 @@ CheckBoxIcon.propTypes = {
94
91
  showBox: _propTypes.default.bool,
95
92
  theme: _propTypes.default.object,
96
93
  hasErrors: _propTypes.default.bool,
97
- checkmarkCharacter: _propTypes.default.string,
98
- expandable: _propTypes.default.bool
94
+ checkmarkCharacter: _propTypes.default.string
99
95
  };
100
96
  CheckBoxIcon.defaultProps = {
101
97
  size: '20px',
@@ -103,8 +99,7 @@ CheckBoxIcon.defaultProps = {
103
99
  disabled: false,
104
100
  showBox: true,
105
101
  hasErrors: false,
106
- checkmarkCharacter: '✔',
107
- expandable: false
102
+ checkmarkCharacter: '✔'
108
103
  };
109
104
  var _default = CheckBoxIcon;
110
105
  exports.default = _default;
@@ -51,29 +51,29 @@ var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
51
51
  _createClass(CheckBoxInput, [{
52
52
  key: "render",
53
53
  value: function render() {
54
- return /*#__PURE__*/_react.default.createElement("label", {
55
- className: "".concat(_CheckBoxInputModule.default.checkBoxInput, " ").concat(this.props.contentOnly ? _CheckBoxInputModule.default.contentOnly : '', " ").concat(this.props.disabled ? _CheckBoxInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ''),
54
+ var labelProps = {
55
+ className: "".concat(_CheckBoxInputModule.default.checkBoxInput, " ").concat(this.props.contentOnly ? _CheckBoxInputModule.default.contentOnly : "", " ").concat(this.props.disabled ? _CheckBoxInputModule.default.disabled : "", " ").concat(this.props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ""),
56
56
  htmlFor: this.props.id
57
- }, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
57
+ };
58
+ var iconProps = {
58
59
  checked: this.props.checked,
59
60
  disabled: this.props.disabled,
60
61
  theme: this.props.theme,
61
- hasErrors: this.props.hasErrors,
62
- checkmarkCharacter: this.props.checkmarkCharacter,
63
- expandable: this.props.expandable
64
- }), /*#__PURE__*/_react.default.createElement("input", {
65
- onChange: this.props.onChange,
66
- type: "checkbox",
67
- name: this.props.name,
62
+ showBox: !this.props.contentOnly,
63
+ hasErrors: this.props.contentOnly && this.props.hasErrors,
64
+ checkmarkCharacter: this.props.checkmarkCharacter
65
+ };
66
+ var inputProps = {
68
67
  id: this.props.id,
69
- checked: this.props.checked,
70
- disabled: this.props.disabled
71
- })) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
68
+ name: this.props.name || null,
69
+ type: "checkbox",
72
70
  checked: this.props.checked,
73
71
  disabled: this.props.disabled,
74
- showBox: false,
75
- theme: this.props.theme
76
- }), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
72
+ onChange: this.props.onChange,
73
+ "aria-expanded": this.props["aria-expanded"],
74
+ "aria-controls": this.props["aria-controls"]
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));
77
77
  }
78
78
  }]);
79
79
 
@@ -90,15 +90,16 @@ CheckBoxInput.propTypes = {
90
90
  hasErrors: _propTypes.default.bool,
91
91
  theme: _propTypes.default.object,
92
92
  checkmarkCharacter: _propTypes.default.string,
93
- expandable: _propTypes.default.bool
93
+ "aria-expanded": _propTypes.default.string,
94
+ "aria-controls": _propTypes.default.string
94
95
  };
95
96
  CheckBoxInput.defaultProps = {
96
97
  checked: false,
97
98
  disabled: false,
98
- name: '',
99
+ name: "",
99
100
  contentOnly: false,
100
101
  hasErrors: false,
101
- checkmarkCharacter: '',
102
+ checkmarkCharacter: "",
102
103
  expandable: false
103
104
  };
104
105
  var _default = CheckBoxInput;
@@ -69,13 +69,10 @@ var RadioButtonIcon = /*#__PURE__*/function (_React$Component) {
69
69
  });
70
70
  }
71
71
 
72
- var ariaExpandedIndex = "aria-expanded";
73
-
74
- var props = _defineProperty({
72
+ var props = {
75
73
  className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(this.props.checked ? _RadioButtonIconModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonIconModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ''),
76
74
  style: inlineStyle
77
- }, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
78
-
75
+ };
79
76
  return /*#__PURE__*/_react.default.createElement("span", props);
80
77
  }
81
78
  }]);
@@ -88,15 +85,13 @@ RadioButtonIcon.propTypes = {
88
85
  checked: _propTypes.default.bool,
89
86
  disabled: _propTypes.default.bool,
90
87
  theme: _propTypes.default.object,
91
- hasErrors: _propTypes.default.bool,
92
- expandable: _propTypes.default.bool
88
+ hasErrors: _propTypes.default.bool
93
89
  };
94
90
  RadioButtonIcon.defaultProps = {
95
91
  size: '10px',
96
92
  checked: false,
97
93
  disabled: false,
98
- hasErrors: false,
99
- expandable: false
94
+ hasErrors: false
100
95
  };
101
96
  var _default = RadioButtonIcon;
102
97
  exports.default = _default;
@@ -51,23 +51,28 @@ var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
51
51
  _createClass(RadioButtonInput, [{
52
52
  key: "render",
53
53
  value: function render() {
54
- return /*#__PURE__*/_react.default.createElement("label", {
55
- htmlFor: this.props.id,
56
- className: "".concat(_RadioButtonInputModule.default.radioButtonInput, " ").concat(this.props.checked ? _RadioButtonInputModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonInputModule.default.hasErrors : '')
57
- }, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_RadioButtonIcon.default, {
54
+ var labelProps = {
55
+ className: "".concat(_RadioButtonInputModule.default.radioButtonInput, " ").concat(this.props.checked ? _RadioButtonInputModule.default.checked : "", " ").concat(this.props.disabled ? _RadioButtonInputModule.default.disabled : "", " ").concat(this.props.hasErrors ? _RadioButtonInputModule.default.hasErrors : ""),
56
+ htmlFor: this.props.id
57
+ };
58
+ var iconProps = {
58
59
  checked: this.props.checked,
59
60
  disabled: this.props.disabled,
60
61
  theme: this.props.theme,
61
- hasErrors: this.props.hasErrors,
62
- expandable: this.props.expandable
63
- }), /*#__PURE__*/_react.default.createElement("input", {
64
- type: "radio",
65
- onChange: this.props.onChange,
62
+ hasErrors: this.props.contentOnly && this.props.hasErrors
63
+ };
64
+ var inputProps = {
66
65
  id: this.props.id,
67
- name: this.props.name,
66
+ name: this.props.name || null,
67
+ type: "radio",
68
68
  value: this.props.inputValue,
69
- checked: this.props.checked
70
- })) : '', /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
69
+ checked: this.props.checked,
70
+ disabled: this.props.disabled,
71
+ onChange: this.props.onChange,
72
+ "aria-expanded": this.props["aria-expanded"],
73
+ "aria-controls": this.props["aria-controls"]
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));
71
76
  }
72
77
  }]);
73
78
 
@@ -77,22 +82,22 @@ var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
77
82
  RadioButtonInput.propTypes = {
78
83
  checked: _propTypes.default.bool,
79
84
  disabled: _propTypes.default.bool,
80
- inputValue: _propTypes.default.string.isRequired,
81
- name: _propTypes.default.string,
82
85
  id: _propTypes.default.string.isRequired,
86
+ name: _propTypes.default.string,
83
87
  onChange: _propTypes.default.func,
84
88
  contentOnly: _propTypes.default.bool,
85
- theme: _propTypes.default.object,
86
89
  hasErrors: _propTypes.default.bool,
87
- expandable: _propTypes.default.bool
90
+ theme: _propTypes.default.object,
91
+ inputValue: _propTypes.default.string.isRequired,
92
+ "aria-expanded": _propTypes.default.string,
93
+ "aria-controls": _propTypes.default.string
88
94
  };
89
95
  RadioButtonInput.defaultProps = {
90
- name: '',
96
+ name: "",
91
97
  checked: false,
92
98
  disabled: false,
93
99
  contentOnly: false,
94
- hasErrors: false,
95
- expandable: false
100
+ hasErrors: false
96
101
  };
97
102
  var _default = RadioButtonInput;
98
103
  exports.default = _default;
@@ -0,0 +1,23 @@
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 _TableModule = _interopRequireDefault(require("./Table.module.scss"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ // Dependencies
15
+ // Stylesheets
16
+ var Table = function Table(props) {
17
+ return /*#__PURE__*/_react.default.createElement("table", {
18
+ className: _TableModule.default.table
19
+ }, props.children);
20
+ };
21
+
22
+ var _default = Table;
23
+ exports.default = _default;
@@ -0,0 +1,26 @@
1
+ Select example:
2
+
3
+ ```js
4
+ <Table>
5
+ <thead>
6
+ <tr>
7
+ <th>Table header 1</th>
8
+ <th>Table header 2</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody>
12
+ <tr>
13
+ <td>Table data 1</td>
14
+ <td>Table data 2</td>
15
+ </tr>
16
+ <tr>
17
+ <td>Table data 3</td>
18
+ <td>Table data 4</td>
19
+ </tr>
20
+ <tr>
21
+ <td>Table data 5</td>
22
+ <td>Table data 6</td>
23
+ </tr>
24
+ </tbody>
25
+ </Table>
26
+ ```
@@ -0,0 +1,27 @@
1
+ @import "../style/global.scss";
2
+
3
+ :local(.table) {
4
+ font-family: $default-font;
5
+ border-collapse: collapse;
6
+ width: 100%;
7
+ thead {
8
+ tr {
9
+ background-color: #ededed;
10
+ border: 1px solid #000;
11
+ th {
12
+ text-align: left;
13
+ font-size: 17px;
14
+ padding: 10px;
15
+ }
16
+ }
17
+ }
18
+ tbody {
19
+ tr {
20
+ border: 1px solid #000;
21
+ td {
22
+ padding: 10px;
23
+ font-size: 17px;
24
+ }
25
+ }
26
+ }
27
+ }
package/dist/index.js CHANGED
@@ -153,6 +153,12 @@ Object.defineProperty(exports, "Select", {
153
153
  return _Select.default;
154
154
  }
155
155
  });
156
+ Object.defineProperty(exports, "Table", {
157
+ enumerable: true,
158
+ get: function get() {
159
+ return _Table.default;
160
+ }
161
+ });
156
162
  Object.defineProperty(exports, "Textarea", {
157
163
  enumerable: true,
158
164
  get: function get() {
@@ -222,6 +228,8 @@ var _RadioButtonListItem = _interopRequireDefault(require("./components/RadioBut
222
228
 
223
229
  var _Select = _interopRequireDefault(require("./components/Select"));
224
230
 
231
+ var _Table = _interopRequireDefault(require("./components/Table"));
232
+
225
233
  var _Textarea = _interopRequireDefault(require("./components/Textarea"));
226
234
 
227
235
  var _WizardNavigation = _interopRequireDefault(require("./components/WizardNavigation"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dibk-design",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",