dibk-design 0.4.28 → 0.4.32

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 (40) hide show
  1. package/dist/components/Accordion.js +77 -39
  2. package/dist/components/Button.js +75 -31
  3. package/dist/components/CheckBoxIcon.js +64 -20
  4. package/dist/components/CheckBoxIcon.md +13 -4
  5. package/dist/components/CheckBoxIcon.module.scss +7 -0
  6. package/dist/components/CheckBoxInput.js +63 -22
  7. package/dist/components/CheckBoxInput.md +14 -8
  8. package/dist/components/CheckBoxInput.module.scss +4 -1
  9. package/dist/components/CheckBoxListItem.js +55 -16
  10. package/dist/components/CheckBoxListItem.md +20 -5
  11. package/dist/components/CheckBoxListItem.module.scss +8 -2
  12. package/dist/components/ContentBox.js +67 -30
  13. package/dist/components/Dialog.js +98 -57
  14. package/dist/components/DragAndDropFileInput.js +140 -90
  15. package/dist/components/Footer.js +44 -8
  16. package/dist/components/Header.js +47 -11
  17. package/dist/components/InputField.js +142 -92
  18. package/dist/components/Label.js +53 -11
  19. package/dist/components/List.js +72 -21
  20. package/dist/components/LoadingAnimation.js +42 -6
  21. package/dist/components/NavigationBar.js +179 -126
  22. package/dist/components/NavigationBarListItem.js +59 -22
  23. package/dist/components/Paper.js +42 -6
  24. package/dist/components/RadioButtonIcon.js +63 -19
  25. package/dist/components/RadioButtonIcon.md +7 -1
  26. package/dist/components/RadioButtonIcon.module.scss +9 -1
  27. package/dist/components/RadioButtonInput.js +56 -17
  28. package/dist/components/RadioButtonInput.md +8 -0
  29. package/dist/components/RadioButtonInput.module.scss +7 -0
  30. package/dist/components/RadioButtonListItem.js +52 -13
  31. package/dist/components/RadioButtonListItem.md +21 -3
  32. package/dist/components/RadioButtonListItem.module.scss +8 -2
  33. package/dist/components/Select.js +142 -100
  34. package/dist/components/Textarea.js +91 -52
  35. package/dist/components/Theme.js +98 -55
  36. package/dist/components/WizardNavigation/Step.js +72 -35
  37. package/dist/components/WizardNavigation.js +59 -25
  38. package/dist/functions/theme.js +10 -10
  39. package/dist/index.js +24 -24
  40. package/package.json +1 -1
@@ -1,5 +1,7 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -21,144 +23,195 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
21
23
 
22
24
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
25
 
24
- class NavigationBar extends _react.default.Component {
25
- constructor(props) {
26
- super(props);
27
- this.state = {
28
- active: false
29
- };
30
- }
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
27
 
32
- handleClickOutside() {
33
- this.setState({
34
- active: false
35
- });
36
- }
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); } }
37
29
 
38
- toggleList() {
39
- this.setState(prevState => ({
40
- active: !prevState.active
41
- }));
42
- }
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; }
43
31
 
44
- getNavigationBarThemeStyle(theme) {
45
- return {
46
- backgroundColor: (0, _theme.getThemeNavigationBarBackgroundColor)(theme),
47
- color: (0, _theme.getThemeNavigationBarTextColor)(theme)
48
- };
49
- }
32
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
50
33
 
51
- getListItemThemeStyle(theme) {
52
- return {
53
- color: (0, _theme.getThemeNavigationBarTextColor)(theme),
54
- borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
55
- };
56
- }
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
57
35
 
58
- getLogoThemeStyle(theme) {
59
- return {
60
- padding: (0, _theme.getThemeLogoPadding)(theme)
61
- };
62
- }
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); }; }
63
37
 
64
- renderPrimaryList() {
65
- let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.primaryListItems;
66
- let iteration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
67
- const listItemThemeStyle = this.getListItemThemeStyle(this.props.theme);
68
- let listItems = items.map((listItem, i) => {
69
- let key = iteration + '-' + i;
70
-
71
- if (listItem.listItems !== undefined) {
72
- return /*#__PURE__*/_react.default.createElement("li", {
73
- key: key
74
- }, /*#__PURE__*/_react.default.createElement("span", {
75
- style: listItemThemeStyle
76
- }, listItem.name), this.renderPrimaryList(listItem.listItems, iteration + 1));
77
- } else {
78
- return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
79
- listItem: listItem,
80
- key: key,
81
- theme: this.props.theme
82
- });
83
- }
84
- });
85
- return /*#__PURE__*/_react.default.createElement("ul", {
86
- className: _NavigationBarModule.default.primaryList
87
- }, listItems);
88
- }
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); }
89
39
 
90
- renderSecondaryList() {
91
- let listItems = this.props.secondaryListItems.map((listItem, i) => {
92
- return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
93
- listItem: listItem,
94
- key: i,
95
- theme: this.props.theme
96
- });
97
- });
98
- return /*#__PURE__*/_react.default.createElement("ul", {
99
- className: _NavigationBarModule.default.secondaryList
100
- }, listItems);
101
- }
40
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
102
41
 
103
- renderLogo(logoLink) {
104
- const themeLogo = (0, _theme.getThemeLogo)(this.props.theme);
105
- const themeAppName = (0, _theme.getThemeAppName)(this.props.theme);
106
- const logoElement = themeLogo && themeAppName ? /*#__PURE__*/_react.default.createElement("img", {
107
- alt: "".concat(themeAppName, " logo"),
108
- src: themeLogo,
109
- style: this.getLogoThemeStyle(this.props.theme)
110
- }) : /*#__PURE__*/_react.default.createElement("img", {
111
- alt: "DIBK logo",
112
- src: _dibkLogoMobile.default
113
- });
114
- const logoLinkProps = {
115
- target: this.props.openLogoLinkInNewTab ? '_blank' : null,
116
- rel: this.props.openLogoLinkInNewTab ? 'noopener noreferrer' : null
117
- };
118
- return logoLink && logoLink.length ? /*#__PURE__*/_react.default.createElement("a", _extends({}, logoLinkProps, {
119
- href: logoLink
120
- }), logoElement) : logoElement;
121
- }
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 NavigationBar = /*#__PURE__*/function (_React$Component) {
47
+ _inherits(NavigationBar, _React$Component);
122
48
 
123
- render() {
124
- const navigationBarThemeStyle = this.getNavigationBarThemeStyle(this.props.theme);
125
- const hamburgerIconLineStyle = {
126
- backgroundColor: (0, _theme.getThemeNavigationBarTextColor)(this.props.theme)
49
+ var _super = _createSuper(NavigationBar);
50
+
51
+ function NavigationBar(props) {
52
+ var _this;
53
+
54
+ _classCallCheck(this, NavigationBar);
55
+
56
+ _this = _super.call(this, props);
57
+ _this.state = {
58
+ active: false
127
59
  };
128
- return /*#__PURE__*/_react.default.createElement("header", null, /*#__PURE__*/_react.default.createElement("div", {
129
- className: _NavigationBarModule.default.isPresent
130
- }, /*#__PURE__*/_react.default.createElement("div", {
131
- className: _NavigationBarModule.default.navigationBar,
132
- style: navigationBarThemeStyle
133
- }, /*#__PURE__*/_react.default.createElement("div", {
134
- className: _NavigationBarModule.default.logoContainer
135
- }, this.renderLogo(this.props.logoLink)), this.props.children ? /*#__PURE__*/_react.default.createElement("div", {
136
- className: _NavigationBarModule.default.childElements
137
- }, this.props.children) : '', this.props.primaryListItems && this.props.primaryListItems.length || this.props.secondaryListItems && this.props.secondaryListItems.length ? /*#__PURE__*/_react.default.createElement("button", {
138
- className: "".concat(_NavigationBarModule.default.menuToggle, " ").concat(this.state.active ? _NavigationBarModule.default.active : ''),
139
- onClick: () => this.toggleList()
140
- }, /*#__PURE__*/_react.default.createElement("span", {
141
- className: _NavigationBarModule.default.hamburgerIcon
142
- }, /*#__PURE__*/_react.default.createElement("span", {
143
- className: _NavigationBarModule.default.line,
144
- style: hamburgerIconLineStyle
145
- }), /*#__PURE__*/_react.default.createElement("span", {
146
- className: _NavigationBarModule.default.line,
147
- style: hamburgerIconLineStyle
148
- }), /*#__PURE__*/_react.default.createElement("span", {
149
- className: _NavigationBarModule.default.line,
150
- style: hamburgerIconLineStyle
151
- }))) : ''), /*#__PURE__*/_react.default.createElement("div", {
152
- className: "".concat(_NavigationBarModule.default.dropdownContainer, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
153
- }, /*#__PURE__*/_react.default.createElement("div", {
154
- className: _NavigationBarModule.default.dropdown,
155
- style: navigationBarThemeStyle
156
- }, this.renderPrimaryList(), this.renderSecondaryList(), this.props.children)), /*#__PURE__*/_react.default.createElement("div", {
157
- className: "".concat(_NavigationBarModule.default.dropdownOverlay, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
158
- })));
60
+ return _this;
159
61
  }
160
62
 
161
- }
63
+ _createClass(NavigationBar, [{
64
+ key: "handleClickOutside",
65
+ value: function handleClickOutside() {
66
+ this.setState({
67
+ active: false
68
+ });
69
+ }
70
+ }, {
71
+ key: "toggleList",
72
+ value: function toggleList() {
73
+ this.setState(function (prevState) {
74
+ return {
75
+ active: !prevState.active
76
+ };
77
+ });
78
+ }
79
+ }, {
80
+ key: "getNavigationBarThemeStyle",
81
+ value: function getNavigationBarThemeStyle(theme) {
82
+ return {
83
+ backgroundColor: (0, _theme.getThemeNavigationBarBackgroundColor)(theme),
84
+ color: (0, _theme.getThemeNavigationBarTextColor)(theme)
85
+ };
86
+ }
87
+ }, {
88
+ key: "getListItemThemeStyle",
89
+ value: function getListItemThemeStyle(theme) {
90
+ return {
91
+ color: (0, _theme.getThemeNavigationBarTextColor)(theme),
92
+ borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
93
+ };
94
+ }
95
+ }, {
96
+ key: "getLogoThemeStyle",
97
+ value: function getLogoThemeStyle(theme) {
98
+ return {
99
+ padding: (0, _theme.getThemeLogoPadding)(theme)
100
+ };
101
+ }
102
+ }, {
103
+ key: "renderPrimaryList",
104
+ value: function renderPrimaryList() {
105
+ var _this2 = this;
106
+
107
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.primaryListItems;
108
+ var iteration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
109
+ var listItemThemeStyle = this.getListItemThemeStyle(this.props.theme);
110
+ var listItems = items.map(function (listItem, i) {
111
+ var key = iteration + '-' + i;
112
+
113
+ if (listItem.listItems !== undefined) {
114
+ return /*#__PURE__*/_react.default.createElement("li", {
115
+ key: key
116
+ }, /*#__PURE__*/_react.default.createElement("span", {
117
+ style: listItemThemeStyle
118
+ }, listItem.name), _this2.renderPrimaryList(listItem.listItems, iteration + 1));
119
+ } else {
120
+ return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
121
+ listItem: listItem,
122
+ key: key,
123
+ theme: _this2.props.theme
124
+ });
125
+ }
126
+ });
127
+ return /*#__PURE__*/_react.default.createElement("ul", {
128
+ className: _NavigationBarModule.default.primaryList
129
+ }, listItems);
130
+ }
131
+ }, {
132
+ key: "renderSecondaryList",
133
+ value: function renderSecondaryList() {
134
+ var _this3 = this;
135
+
136
+ var listItems = this.props.secondaryListItems.map(function (listItem, i) {
137
+ return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
138
+ listItem: listItem,
139
+ key: i,
140
+ theme: _this3.props.theme
141
+ });
142
+ });
143
+ return /*#__PURE__*/_react.default.createElement("ul", {
144
+ className: _NavigationBarModule.default.secondaryList
145
+ }, listItems);
146
+ }
147
+ }, {
148
+ key: "renderLogo",
149
+ value: function renderLogo(logoLink) {
150
+ var themeLogo = (0, _theme.getThemeLogo)(this.props.theme);
151
+ var themeAppName = (0, _theme.getThemeAppName)(this.props.theme);
152
+ var logoElement = themeLogo && themeAppName ? /*#__PURE__*/_react.default.createElement("img", {
153
+ alt: "".concat(themeAppName, " logo"),
154
+ src: themeLogo,
155
+ style: this.getLogoThemeStyle(this.props.theme)
156
+ }) : /*#__PURE__*/_react.default.createElement("img", {
157
+ alt: "DIBK logo",
158
+ src: _dibkLogoMobile.default
159
+ });
160
+ var logoLinkProps = {
161
+ target: this.props.openLogoLinkInNewTab ? '_blank' : null,
162
+ rel: this.props.openLogoLinkInNewTab ? 'noopener noreferrer' : null
163
+ };
164
+ return logoLink && logoLink.length ? /*#__PURE__*/_react.default.createElement("a", _extends({}, logoLinkProps, {
165
+ href: logoLink
166
+ }), logoElement) : logoElement;
167
+ }
168
+ }, {
169
+ key: "render",
170
+ value: function render() {
171
+ var _this4 = this;
172
+
173
+ var navigationBarThemeStyle = this.getNavigationBarThemeStyle(this.props.theme);
174
+ var hamburgerIconLineStyle = {
175
+ backgroundColor: (0, _theme.getThemeNavigationBarTextColor)(this.props.theme)
176
+ };
177
+ return /*#__PURE__*/_react.default.createElement("header", null, /*#__PURE__*/_react.default.createElement("div", {
178
+ className: _NavigationBarModule.default.isPresent
179
+ }, /*#__PURE__*/_react.default.createElement("div", {
180
+ className: _NavigationBarModule.default.navigationBar,
181
+ style: navigationBarThemeStyle
182
+ }, /*#__PURE__*/_react.default.createElement("div", {
183
+ className: _NavigationBarModule.default.logoContainer
184
+ }, this.renderLogo(this.props.logoLink)), this.props.children ? /*#__PURE__*/_react.default.createElement("div", {
185
+ className: _NavigationBarModule.default.childElements
186
+ }, this.props.children) : '', this.props.primaryListItems && this.props.primaryListItems.length || this.props.secondaryListItems && this.props.secondaryListItems.length ? /*#__PURE__*/_react.default.createElement("button", {
187
+ className: "".concat(_NavigationBarModule.default.menuToggle, " ").concat(this.state.active ? _NavigationBarModule.default.active : ''),
188
+ onClick: function onClick() {
189
+ return _this4.toggleList();
190
+ }
191
+ }, /*#__PURE__*/_react.default.createElement("span", {
192
+ className: _NavigationBarModule.default.hamburgerIcon
193
+ }, /*#__PURE__*/_react.default.createElement("span", {
194
+ className: _NavigationBarModule.default.line,
195
+ style: hamburgerIconLineStyle
196
+ }), /*#__PURE__*/_react.default.createElement("span", {
197
+ className: _NavigationBarModule.default.line,
198
+ style: hamburgerIconLineStyle
199
+ }), /*#__PURE__*/_react.default.createElement("span", {
200
+ className: _NavigationBarModule.default.line,
201
+ style: hamburgerIconLineStyle
202
+ }))) : ''), /*#__PURE__*/_react.default.createElement("div", {
203
+ className: "".concat(_NavigationBarModule.default.dropdownContainer, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
204
+ }, /*#__PURE__*/_react.default.createElement("div", {
205
+ className: _NavigationBarModule.default.dropdown,
206
+ style: navigationBarThemeStyle
207
+ }, this.renderPrimaryList(), this.renderSecondaryList(), this.props.children)), /*#__PURE__*/_react.default.createElement("div", {
208
+ className: "".concat(_NavigationBarModule.default.dropdownOverlay, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
209
+ })));
210
+ }
211
+ }]);
212
+
213
+ return NavigationBar;
214
+ }(_react.default.Component);
162
215
 
163
216
  NavigationBar.propTypes = {
164
217
  /** Main links in navigation bar */
@@ -13,32 +13,69 @@ var _theme = require("../functions/theme");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- class NavigationBarListItem extends _react.default.Component {
17
- getListItemThemeStyle(theme) {
18
- return {
19
- color: (0, _theme.getThemeNavigationBarTextColor)(theme),
20
- borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
21
- };
16
+ 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); }
17
+
18
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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 NavigationBarListItem = /*#__PURE__*/function (_React$Component) {
39
+ _inherits(NavigationBarListItem, _React$Component);
40
+
41
+ var _super = _createSuper(NavigationBarListItem);
42
+
43
+ function NavigationBarListItem() {
44
+ _classCallCheck(this, NavigationBarListItem);
45
+
46
+ return _super.apply(this, arguments);
22
47
  }
23
48
 
24
- render() {
25
- const listItemThemeStyle = this.getListItemThemeStyle(this.props.theme);
26
-
27
- if (typeof this.props.listItem === 'string') {
28
- return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("span", {
29
- style: listItemThemeStyle
30
- }, this.props.listItem));
31
- } else if (typeof this.props.listItem === 'object') {
32
- return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
33
- href: this.props.listItem.href,
34
- style: listItemThemeStyle
35
- }, this.props.listItem.name));
36
- } else {
37
- return null;
49
+ _createClass(NavigationBarListItem, [{
50
+ key: "getListItemThemeStyle",
51
+ value: function getListItemThemeStyle(theme) {
52
+ return {
53
+ color: (0, _theme.getThemeNavigationBarTextColor)(theme),
54
+ borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
55
+ };
38
56
  }
39
- }
57
+ }, {
58
+ key: "render",
59
+ value: function render() {
60
+ var listItemThemeStyle = this.getListItemThemeStyle(this.props.theme);
61
+
62
+ if (typeof this.props.listItem === 'string') {
63
+ return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("span", {
64
+ style: listItemThemeStyle
65
+ }, this.props.listItem));
66
+ } else if (_typeof(this.props.listItem) === 'object') {
67
+ return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
68
+ href: this.props.listItem.href,
69
+ style: listItemThemeStyle
70
+ }, this.props.listItem.name));
71
+ } else {
72
+ return null;
73
+ }
74
+ }
75
+ }]);
40
76
 
41
- }
77
+ return NavigationBarListItem;
78
+ }(_react.default.Component);
42
79
 
43
80
  NavigationBarListItem.propTypes = {
44
81
  listItem: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
@@ -1,5 +1,7 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -13,14 +15,48 @@ var _PaperModule = _interopRequireDefault(require("./Paper.module.scss"));
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
- class Paper extends _react.default.Component {
17
- render() {
18
- return /*#__PURE__*/_react.default.createElement("div", {
19
- className: "".concat(_PaperModule.default.paper, " ").concat(this.props.noMargin ? _PaperModule.default.noMargin : '', " ").concat(this.props.noPadding ? _PaperModule.default.noPadding : '')
20
- }, this.props.children);
18
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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 Paper = /*#__PURE__*/function (_React$Component) {
39
+ _inherits(Paper, _React$Component);
40
+
41
+ var _super = _createSuper(Paper);
42
+
43
+ function Paper() {
44
+ _classCallCheck(this, Paper);
45
+
46
+ return _super.apply(this, arguments);
21
47
  }
22
48
 
23
- }
49
+ _createClass(Paper, [{
50
+ key: "render",
51
+ value: function render() {
52
+ return /*#__PURE__*/_react.default.createElement("div", {
53
+ className: "".concat(_PaperModule.default.paper, " ").concat(this.props.noMargin ? _PaperModule.default.noMargin : '', " ").concat(this.props.noPadding ? _PaperModule.default.noPadding : '')
54
+ }, this.props.children);
55
+ }
56
+ }]);
57
+
58
+ return Paper;
59
+ }(_react.default.Component);
24
60
 
25
61
  ;
26
62
  Paper.propTypes = {
@@ -1,5 +1,7 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -15,36 +17,78 @@ var _RadioButtonIconModule = _interopRequireDefault(require("./RadioButtonIcon.m
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
- class RadioButtonIcon extends _react.default.Component {
19
- render() {
20
- let inlineStyle = {
21
- height: this.props.size,
22
- width: this.props.size
23
- };
24
-
25
- if (this.props.theme && this.props.checked) {
26
- inlineStyle = { ...inlineStyle,
27
- background: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
28
- boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'))
29
- };
30
- }
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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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); }
31
39
 
32
- return /*#__PURE__*/_react.default.createElement("span", {
33
- className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(this.props.checked ? _RadioButtonIconModule.default.checked : ''),
34
- style: inlineStyle
35
- });
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 RadioButtonIcon = /*#__PURE__*/function (_React$Component) {
47
+ _inherits(RadioButtonIcon, _React$Component);
48
+
49
+ var _super = _createSuper(RadioButtonIcon);
50
+
51
+ function RadioButtonIcon() {
52
+ _classCallCheck(this, RadioButtonIcon);
53
+
54
+ return _super.apply(this, arguments);
36
55
  }
37
56
 
38
- }
57
+ _createClass(RadioButtonIcon, [{
58
+ key: "render",
59
+ value: function render() {
60
+ var inlineStyle = {
61
+ height: this.props.size,
62
+ width: this.props.size
63
+ };
64
+
65
+ if (this.props.theme && this.props.checked) {
66
+ inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
67
+ background: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
68
+ boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'))
69
+ });
70
+ }
71
+
72
+ return /*#__PURE__*/_react.default.createElement("span", {
73
+ className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(this.props.checked ? _RadioButtonIconModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonIconModule.default.disabled : ''),
74
+ style: inlineStyle
75
+ });
76
+ }
77
+ }]);
78
+
79
+ return RadioButtonIcon;
80
+ }(_react.default.Component);
39
81
 
40
82
  RadioButtonIcon.propTypes = {
41
83
  size: _propTypes.default.string,
42
84
  checked: _propTypes.default.bool,
85
+ disabled: _propTypes.default.bool,
43
86
  theme: _propTypes.default.object
44
87
  };
45
88
  RadioButtonIcon.defaultProps = {
46
89
  size: '10px',
47
- checked: false
90
+ checked: false,
91
+ disabled: false
48
92
  };
49
93
  var _default = RadioButtonIcon;
50
94
  exports.default = _default;
@@ -3,6 +3,8 @@ Regular radio button icons example:
3
3
  ```js
4
4
  <RadioButtonIcon />
5
5
  <RadioButtonIcon checked={true} />
6
+ <RadioButtonIcon disabled={true} />
7
+ <RadioButtonIcon checked={true} disabled={true} />
6
8
  ```
7
9
 
8
10
  Themed Regular radio button icons example:
@@ -11,7 +13,9 @@ Themed Regular radio button icons example:
11
13
  import customTheme from 'data/customTheme';
12
14
  <React.Fragment>
13
15
  <RadioButtonIcon theme={customTheme}/>
14
- <RadioButtonIcon checked={true} theme={customTheme}/>
16
+ <RadioButtonIcon checked={true} theme={customTheme} />
17
+ <RadioButtonIcon theme={customTheme} disabled={true} />
18
+ <RadioButtonIcon checked={true} theme={customTheme} disabled={true} />
15
19
  </React.Fragment>
16
20
  ```
17
21
 
@@ -20,4 +24,6 @@ Radio button icons with custom size example:
20
24
  ```js
21
25
  <RadioButtonIcon size='36px' />
22
26
  <RadioButtonIcon size='36px' checked={true} />
27
+ <RadioButtonIcon size='36px' disabled={true} />
28
+ <RadioButtonIcon size='36px' checked={true} disabled={true} />
23
29
  ```
@@ -11,12 +11,20 @@
11
11
  width: 10px;
12
12
  height: 10px;
13
13
  background: white;
14
- margin-right: .4em;
14
+ margin-right: 0.4em;
15
15
  margin-top: 2px;
16
16
  border: 0.3em solid white;
17
+ cursor: pointer;
17
18
 
18
19
  &:local(.checked) {
19
20
  @include box-shadow(0 0 0 1px $color-dark-blue);
20
21
  background: $color-primary;
21
22
  }
23
+ &:local(.disabled) {
24
+ opacity: 0.5;
25
+ border-color: #bfbfbf;
26
+ &:not(&:local(.checked)) {
27
+ background: #bfbfbf;
28
+ }
29
+ }
22
30
  }