dibk-design 0.4.41 → 0.4.44

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.
Files changed (100) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +3 -3
  3. package/dist/components/Accordion.md +15 -15
  4. package/dist/components/Accordion.module.scss +205 -181
  5. package/dist/components/Button.md +75 -75
  6. package/dist/components/Button.module.scss +232 -216
  7. package/dist/components/CheckBoxIcon.js +109 -103
  8. package/dist/components/CheckBoxIcon.md +38 -38
  9. package/dist/components/CheckBoxIcon.module.scss +62 -62
  10. package/dist/components/CheckBoxInput.js +104 -101
  11. package/dist/components/CheckBoxInput.md +58 -51
  12. package/dist/components/CheckBoxInput.module.scss +24 -24
  13. package/dist/components/CheckBoxListItem.md +82 -82
  14. package/dist/components/CheckBoxListItem.module.scss +71 -71
  15. package/dist/components/ContentBox.md +46 -46
  16. package/dist/components/ContentBox.module.scss +116 -116
  17. package/dist/components/Dialog.md +5 -5
  18. package/dist/components/Dialog.module.scss +78 -71
  19. package/dist/components/DragAndDropFileInput.md +13 -13
  20. package/dist/components/DragAndDropFileInput.module.scss +45 -45
  21. package/dist/components/Footer.md +7 -7
  22. package/dist/components/Footer.module.scss +11 -11
  23. package/dist/components/Header.md +11 -11
  24. package/dist/components/Header.module.scss +64 -51
  25. package/dist/components/InputField.md +41 -41
  26. package/dist/components/InputField.module.scss +95 -83
  27. package/dist/components/Label.md +9 -9
  28. package/dist/components/Label.module.scss +16 -16
  29. package/dist/components/List.md +10 -10
  30. package/dist/components/List.module.scss +18 -18
  31. package/dist/components/LoadingAnimation.md +5 -5
  32. package/dist/components/LoadingAnimation.module.scss +26 -26
  33. package/dist/components/NavigationBar.md +42 -42
  34. package/dist/components/NavigationBar.module.scss +176 -176
  35. package/dist/components/NavigationBarListItem.md +15 -15
  36. package/dist/components/Paper.md +9 -9
  37. package/dist/components/Paper.module.scss +18 -17
  38. package/dist/components/RadioButtonIcon.md +41 -41
  39. package/dist/components/RadioButtonIcon.module.scss +44 -44
  40. package/dist/components/RadioButtonInput.md +30 -30
  41. package/dist/components/RadioButtonInput.module.scss +26 -26
  42. package/dist/components/RadioButtonListItem.md +70 -70
  43. package/dist/components/RadioButtonListItem.module.scss +71 -71
  44. package/dist/components/Select.md +28 -28
  45. package/dist/components/Select.module.scss +100 -101
  46. package/dist/components/Textarea.md +27 -27
  47. package/dist/components/Textarea.module.scss +72 -64
  48. package/dist/components/Theme.md +12 -12
  49. package/dist/components/Theme.module.scss +76 -76
  50. package/dist/components/WizardNavigation/Step.module.scss +75 -75
  51. package/dist/components/WizardNavigation.md +84 -84
  52. package/dist/components/WizardNavigation.module.scss +3 -3
  53. package/dist/fonts/Altis-Light.svg +326 -326
  54. package/dist/fonts/open-sans-v27-latin-ext_latin-300.svg +346 -346
  55. package/dist/fonts/open-sans-v27-latin-ext_latin-300italic.svg +377 -377
  56. package/dist/fonts/open-sans-v27-latin-ext_latin-700.svg +349 -349
  57. package/dist/fonts/open-sans-v27-latin-ext_latin-700italic.svg +379 -379
  58. package/dist/fonts/open-sans-v27-latin-ext_latin-italic.svg +379 -379
  59. package/dist/fonts/open-sans-v27-latin-ext_latin-regular.svg +349 -349
  60. package/dist/images/dibk-logo-mobile.svg +91 -91
  61. package/dist/images/dibk-logo.svg +991 -991
  62. package/dist/images/spinner.svg +56 -56
  63. package/dist/style/abstracts/_all.scss +1 -1
  64. package/dist/style/abstracts/mixins/_all.scss +12 -12
  65. package/dist/style/abstracts/mixins/_animation.scss +6 -6
  66. package/dist/style/abstracts/mixins/_appearance.scss +5 -5
  67. package/dist/style/abstracts/mixins/_border-radius.scss +31 -31
  68. package/dist/style/abstracts/mixins/_box-shadow.scss +5 -5
  69. package/dist/style/abstracts/mixins/_box-sizing.scss +5 -5
  70. package/dist/style/abstracts/mixins/_calc.scss +5 -5
  71. package/dist/style/abstracts/mixins/_keyframes.scss +14 -14
  72. package/dist/style/abstracts/mixins/_opacity.scss +5 -5
  73. package/dist/style/abstracts/mixins/_placeholder.scss +17 -17
  74. package/dist/style/abstracts/mixins/_scrollbar.scss +26 -26
  75. package/dist/style/abstracts/mixins/_transform.scss +6 -6
  76. package/dist/style/abstracts/mixins/_transition.scss +34 -34
  77. package/dist/style/abstracts/variables/_all.scss +2 -2
  78. package/dist/style/abstracts/variables/_colors.scss +29 -29
  79. package/dist/style/abstracts/variables/_typography.scss +1 -1
  80. package/dist/style/abstracts/variables/_viewports.scss +14 -11
  81. package/dist/style/base/_all.scss +1 -1
  82. package/dist/style/base/_reset.scss +15 -15
  83. package/dist/style/base/_typography.scss +6 -6
  84. package/dist/style/base/fonts.css +95 -95
  85. package/dist/style/global.scss +3 -3
  86. package/dist/style/layout/_containers.scss +9 -9
  87. package/package.json +43 -42
  88. package/dist/fonts_old/Altis-Light.eot +0 -0
  89. package/dist/fonts_old/Altis-Light.svg +0 -326
  90. package/dist/fonts_old/Altis-Light.ttf +0 -0
  91. package/dist/fonts_old/Altis-Light.woff +0 -0
  92. package/dist/fonts_old/Altis.eot +0 -0
  93. package/dist/fonts_old/Altis.svg +0 -327
  94. package/dist/fonts_old/Altis.ttf +0 -0
  95. package/dist/fonts_old/OpenSans-300.woff2 +0 -0
  96. package/dist/fonts_old/OpenSans-400.ttf +0 -0
  97. package/dist/fonts_old/OpenSans-400.woff +0 -0
  98. package/dist/fonts_old/OpenSans-400.woff2 +0 -0
  99. package/dist/fonts_old/OpenSans-400ekte.woff +0 -0
  100. package/dist/fonts_old/OpenSans-700.woff2 +0 -0
@@ -1,104 +1,110 @@
1
- "use strict";
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
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
- var _theme = require("../functions/theme");
15
-
16
- var _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.scss"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
-
24
- 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; }
25
-
26
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
-
28
- 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); } }
29
-
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
-
32
- 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); }
33
-
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
-
36
- 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); }; }
37
-
38
- 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); }
39
-
40
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
-
42
- 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; } }
43
-
44
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
-
46
- var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
47
- _inherits(CheckBoxIcon, _React$Component);
48
-
49
- var _super = _createSuper(CheckBoxIcon);
50
-
51
- function CheckBoxIcon() {
52
- _classCallCheck(this, CheckBoxIcon);
53
-
54
- return _super.apply(this, arguments);
55
- }
56
-
57
- _createClass(CheckBoxIcon, [{
58
- key: "render",
59
- value: function render() {
60
- var inlineStyle = {
61
- height: this.props.size,
62
- width: this.props.size,
63
- fontSize: this.props.size
64
- };
65
-
66
- if (this.props.theme && this.props.checked) {
67
- inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
68
- color: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
69
- boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary')) // TODO: support theme error color
70
-
71
- });
72
- }
73
-
74
- return /*#__PURE__*/_react.default.createElement("span", {
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 : ''),
76
- style: inlineStyle
77
- }, /*#__PURE__*/_react.default.createElement("span", {
78
- className: _CheckBoxIconModule.default.checkmark
79
- }, this.props.checked ? this.props.checkmarkCharacter : ''));
80
- }
81
- }]);
82
-
83
- return CheckBoxIcon;
84
- }(_react.default.Component);
85
-
86
- CheckBoxIcon.propTypes = {
87
- size: _propTypes.default.string,
88
- checked: _propTypes.default.bool,
89
- disabled: _propTypes.default.bool,
90
- showBox: _propTypes.default.bool,
91
- theme: _propTypes.default.object,
92
- hasErrors: _propTypes.default.bool,
93
- checkmarkCharacter: _propTypes.default.string
94
- };
95
- CheckBoxIcon.defaultProps = {
96
- size: '20px',
97
- checked: false,
98
- disabled: false,
99
- showBox: true,
100
- hasErrors: false,
101
- checkmarkCharacter: ''
102
- };
103
- var _default = CheckBoxIcon;
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _theme = require("../functions/theme");
15
+
16
+ var _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.scss"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
+
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+
24
+ 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; }
25
+
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+
28
+ 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); } }
29
+
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+
32
+ 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); }
33
+
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
+
36
+ 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); }; }
37
+
38
+ 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); }
39
+
40
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
+
42
+ 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; } }
43
+
44
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
+
46
+ var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
47
+ _inherits(CheckBoxIcon, _React$Component);
48
+
49
+ var _super = _createSuper(CheckBoxIcon);
50
+
51
+ function CheckBoxIcon() {
52
+ _classCallCheck(this, CheckBoxIcon);
53
+
54
+ return _super.apply(this, arguments);
55
+ }
56
+
57
+ _createClass(CheckBoxIcon, [{
58
+ key: "render",
59
+ value: function render() {
60
+ var inlineStyle = {
61
+ height: this.props.size,
62
+ width: this.props.size,
63
+ fontSize: this.props.size
64
+ };
65
+
66
+ if (this.props.theme && this.props.checked) {
67
+ inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
68
+ color: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
69
+ boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary')) // TODO: support theme error color
70
+
71
+ });
72
+ }
73
+
74
+ var ariaExpandedIndex = "aria-expanded";
75
+
76
+ var props = _defineProperty({
77
+ 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
+ style: inlineStyle
79
+ }, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
80
+
81
+ return /*#__PURE__*/_react.default.createElement("span", props, /*#__PURE__*/_react.default.createElement("span", {
82
+ className: _CheckBoxIconModule.default.checkmark
83
+ }, this.props.checked ? this.props.checkmarkCharacter : ''));
84
+ }
85
+ }]);
86
+
87
+ return CheckBoxIcon;
88
+ }(_react.default.Component);
89
+
90
+ CheckBoxIcon.propTypes = {
91
+ size: _propTypes.default.string,
92
+ checked: _propTypes.default.bool,
93
+ disabled: _propTypes.default.bool,
94
+ showBox: _propTypes.default.bool,
95
+ theme: _propTypes.default.object,
96
+ hasErrors: _propTypes.default.bool,
97
+ checkmarkCharacter: _propTypes.default.string,
98
+ expandable: _propTypes.default.bool
99
+ };
100
+ CheckBoxIcon.defaultProps = {
101
+ size: '20px',
102
+ checked: false,
103
+ disabled: false,
104
+ showBox: true,
105
+ hasErrors: false,
106
+ checkmarkCharacter: '✔',
107
+ expandable: false
108
+ };
109
+ var _default = CheckBoxIcon;
104
110
  exports.default = _default;
@@ -1,38 +1,38 @@
1
- Regular check box icons example:
2
-
3
- ```js
4
- <CheckBoxIcon />
5
- <CheckBoxIcon checked={true} />
6
- <CheckBoxIcon checked={true} checkmarkCharacter="✕" />
7
- <CheckBoxIcon disabled={true} />
8
- <CheckBoxIcon checked={true} disabled={true} />
9
- <CheckBoxIcon checked={true} checkmarkCharacter="✕" disabled={true} />
10
- ```
11
-
12
- Themed Regular check box icons example:
13
-
14
- ```js
15
- import customTheme from 'data/customTheme';
16
- <React.Fragment>
17
- <CheckBoxIcon size='43px' />
18
- <CheckBoxIcon size='43px' checked={true} />
19
- <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
20
- <CheckBoxIcon size='43px' disabled={true} />
21
- <CheckBoxIcon size='43px' checked={true} disabled={true} />
22
- <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
23
- </React.Fragment>
24
- ```
25
-
26
- Check box icons with custom size example:
27
-
28
- ```js
29
- <CheckBoxIcon size='43px' />
30
- <CheckBoxIcon size='43px' checked={true} />
31
- <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
32
- <CheckBoxIcon size='43px' disabled={true} />
33
- <CheckBoxIcon size='43px' checked={true} disabled={true} />
34
- <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
35
- ```
36
-
37
-
38
-
1
+ Regular check box icons example:
2
+
3
+ ```js
4
+ <CheckBoxIcon />
5
+ <CheckBoxIcon checked={true} />
6
+ <CheckBoxIcon checked={true} checkmarkCharacter="✕" />
7
+ <CheckBoxIcon disabled={true} />
8
+ <CheckBoxIcon checked={true} disabled={true} />
9
+ <CheckBoxIcon checked={true} checkmarkCharacter="✕" disabled={true} />
10
+ ```
11
+
12
+ Themed Regular check box icons example:
13
+
14
+ ```js
15
+ import customTheme from 'data/customTheme';
16
+ <React.Fragment>
17
+ <CheckBoxIcon size='43px' />
18
+ <CheckBoxIcon size='43px' checked={true} />
19
+ <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
20
+ <CheckBoxIcon size='43px' disabled={true} />
21
+ <CheckBoxIcon size='43px' checked={true} disabled={true} />
22
+ <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
23
+ </React.Fragment>
24
+ ```
25
+
26
+ Check box icons with custom size example:
27
+
28
+ ```js
29
+ <CheckBoxIcon size='43px' />
30
+ <CheckBoxIcon size='43px' checked={true} />
31
+ <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
32
+ <CheckBoxIcon size='43px' disabled={true} />
33
+ <CheckBoxIcon size='43px' checked={true} disabled={true} />
34
+ <CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
35
+ ```
36
+
37
+
38
+
@@ -1,62 +1,62 @@
1
- @import "../style/global.scss";
2
-
3
- :local(.checkBoxIcon) {
4
- @include border-radius(0);
5
- @include transition(all 0.1s ease-in-out);
6
- @include box-sizing(content-box);
7
- display: inline-block;
8
- vertical-align: middle;
9
- min-width: 10px;
10
- width: 10px;
11
- height: 10px;
12
- min-width: 20px;
13
- margin-right: 0.2em;
14
- line-height: 1;
15
- text-align: center;
16
- cursor: pointer;
17
-
18
- &:local(.showBox) {
19
- margin-right: 0.4em;
20
- margin-top: 2px;
21
- background: white;
22
- &:not(:local(.hasErrors)) {
23
- @include box-shadow(0 0 0 1px #afaba8);
24
- }
25
- &:local(.hasErrors) {
26
- @include box-shadow(0 0 2px 1px #9d2024);
27
- }
28
- }
29
-
30
- &:local(.checked) {
31
- color: $color-primary;
32
- &:local(.hasErrors) {
33
- span {
34
- color: #9d2024;
35
- }
36
- }
37
- &:local(.showBox) {
38
- &:not(:local(.hasErrors)) {
39
- @include box-shadow(0 0 0 1px #afaba8);
40
- }
41
- &:local(.hasErrors) {
42
- @include box-shadow(0 0 2px 1px #9d2024);
43
- }
44
- }
45
- }
46
-
47
- &:local(.disabled) {
48
- opacity: 0.5;
49
- background: rgba(0, 0, 0, 0.25);
50
- cursor: default;
51
- }
52
-
53
- :local(.checkmark) {
54
- font-size: 1em;
55
- line-height: 0.75em;
56
- }
57
- :not(:local(.showBox)) {
58
- &:local(.checkmark) {
59
- line-height: 1.05em;
60
- }
61
- }
62
- }
1
+ @import "../style/global.scss";
2
+
3
+ :local(.checkBoxIcon) {
4
+ @include border-radius(0);
5
+ @include transition(all 0.1s ease-in-out);
6
+ @include box-sizing(content-box);
7
+ display: inline-block;
8
+ vertical-align: middle;
9
+ min-width: 10px;
10
+ width: 10px;
11
+ height: 10px;
12
+ min-width: 20px;
13
+ margin-right: 0.2em;
14
+ line-height: 1;
15
+ text-align: center;
16
+ cursor: pointer;
17
+
18
+ &:local(.showBox) {
19
+ margin-right: 0.4em;
20
+ margin-top: 2px;
21
+ background: white;
22
+ &:not(:local(.hasErrors)) {
23
+ @include box-shadow(0 0 0 1px #afaba8);
24
+ }
25
+ &:local(.hasErrors) {
26
+ @include box-shadow(0 0 2px 1px #9d2024);
27
+ }
28
+ }
29
+
30
+ &:local(.checked) {
31
+ color: $color-primary;
32
+ &:local(.hasErrors) {
33
+ span {
34
+ color: #9d2024;
35
+ }
36
+ }
37
+ &:local(.showBox) {
38
+ &:not(:local(.hasErrors)) {
39
+ @include box-shadow(0 0 0 1px #afaba8);
40
+ }
41
+ &:local(.hasErrors) {
42
+ @include box-shadow(0 0 2px 1px #9d2024);
43
+ }
44
+ }
45
+ }
46
+
47
+ &:local(.disabled) {
48
+ opacity: 0.5;
49
+ background: rgba(0, 0, 0, 0.25);
50
+ cursor: default;
51
+ }
52
+
53
+ :local(.checkmark) {
54
+ font-size: 1em;
55
+ line-height: 0.75em;
56
+ }
57
+ :not(:local(.showBox)) {
58
+ &:local(.checkmark) {
59
+ line-height: 1.05em;
60
+ }
61
+ }
62
+ }
@@ -1,102 +1,105 @@
1
- "use strict";
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
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
- var _CheckBoxIcon = _interopRequireDefault(require("./CheckBoxIcon"));
15
-
16
- var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.module.scss"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
-
22
- 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); } }
23
-
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
-
26
- 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); }
27
-
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
-
30
- 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); }; }
31
-
32
- 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); }
33
-
34
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
-
36
- 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; } }
37
-
38
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
-
40
- var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
41
- _inherits(CheckBoxInput, _React$Component);
42
-
43
- var _super = _createSuper(CheckBoxInput);
44
-
45
- function CheckBoxInput() {
46
- _classCallCheck(this, CheckBoxInput);
47
-
48
- return _super.apply(this, arguments);
49
- }
50
-
51
- _createClass(CheckBoxInput, [{
52
- key: "render",
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 : ''),
56
- htmlFor: this.props.id
57
- }, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
58
- checked: this.props.checked,
59
- disabled: this.props.disabled,
60
- theme: this.props.theme,
61
- hasErrors: this.props.hasErrors,
62
- checkmarkCharacter: this.props.checkmarkCharacter
63
- }), /*#__PURE__*/_react.default.createElement("input", {
64
- onChange: this.props.onChange,
65
- type: "checkbox",
66
- name: this.props.name,
67
- id: this.props.id,
68
- checked: this.props.checked,
69
- disabled: this.props.disabled
70
- })) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
71
- checked: this.props.checked,
72
- disabled: this.props.disabled,
73
- showBox: false,
74
- theme: this.props.theme
75
- }), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
76
- }
77
- }]);
78
-
79
- return CheckBoxInput;
80
- }(_react.default.Component);
81
-
82
- CheckBoxInput.propTypes = {
83
- checked: _propTypes.default.bool,
84
- disabled: _propTypes.default.bool,
85
- id: _propTypes.default.string.isRequired,
86
- name: _propTypes.default.string,
87
- onChange: _propTypes.default.func.isRequired,
88
- contentOnly: _propTypes.default.bool,
89
- hasErrors: _propTypes.default.bool,
90
- theme: _propTypes.default.object,
91
- checkmarkCharacter: _propTypes.default.string
92
- };
93
- CheckBoxInput.defaultProps = {
94
- checked: false,
95
- disabled: false,
96
- name: '',
97
- contentOnly: false,
98
- hasErrors: false,
99
- checkmarkCharacter: '✔'
100
- };
101
- var _default = CheckBoxInput;
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _CheckBoxIcon = _interopRequireDefault(require("./CheckBoxIcon"));
15
+
16
+ var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.module.scss"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
+
22
+ 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); } }
23
+
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+
26
+ 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); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ 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); }; }
31
+
32
+ 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); }
33
+
34
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
+
36
+ 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; } }
37
+
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
41
+ _inherits(CheckBoxInput, _React$Component);
42
+
43
+ var _super = _createSuper(CheckBoxInput);
44
+
45
+ function CheckBoxInput() {
46
+ _classCallCheck(this, CheckBoxInput);
47
+
48
+ return _super.apply(this, arguments);
49
+ }
50
+
51
+ _createClass(CheckBoxInput, [{
52
+ key: "render",
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 : ''),
56
+ htmlFor: this.props.id
57
+ }, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
58
+ checked: this.props.checked,
59
+ disabled: this.props.disabled,
60
+ 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,
68
+ id: this.props.id,
69
+ checked: this.props.checked,
70
+ disabled: this.props.disabled
71
+ })) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
72
+ checked: this.props.checked,
73
+ disabled: this.props.disabled,
74
+ showBox: false,
75
+ theme: this.props.theme
76
+ }), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
77
+ }
78
+ }]);
79
+
80
+ return CheckBoxInput;
81
+ }(_react.default.Component);
82
+
83
+ CheckBoxInput.propTypes = {
84
+ checked: _propTypes.default.bool,
85
+ disabled: _propTypes.default.bool,
86
+ id: _propTypes.default.string.isRequired,
87
+ name: _propTypes.default.string,
88
+ onChange: _propTypes.default.func.isRequired,
89
+ contentOnly: _propTypes.default.bool,
90
+ hasErrors: _propTypes.default.bool,
91
+ theme: _propTypes.default.object,
92
+ checkmarkCharacter: _propTypes.default.string,
93
+ expandable: _propTypes.default.bool
94
+ };
95
+ CheckBoxInput.defaultProps = {
96
+ checked: false,
97
+ disabled: false,
98
+ name: '',
99
+ contentOnly: false,
100
+ hasErrors: false,
101
+ checkmarkCharacter: '✔',
102
+ expandable: false
103
+ };
104
+ var _default = CheckBoxInput;
102
105
  exports.default = _default;