dibk-design 0.3.24

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 (101) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +3 -0
  3. package/dist/components/Accordion.js +120 -0
  4. package/dist/components/Accordion.md +15 -0
  5. package/dist/components/Accordion.module.scss +180 -0
  6. package/dist/components/Button.js +104 -0
  7. package/dist/components/Button.md +48 -0
  8. package/dist/components/Button.module.scss +141 -0
  9. package/dist/components/CheckBoxIcon.js +97 -0
  10. package/dist/components/CheckBoxIcon.md +23 -0
  11. package/dist/components/CheckBoxIcon.module.scss +39 -0
  12. package/dist/components/CheckBoxInput.js +91 -0
  13. package/dist/components/CheckBoxInput.md +39 -0
  14. package/dist/components/CheckBoxInput.module.scss +18 -0
  15. package/dist/components/CheckBoxListItem.js +85 -0
  16. package/dist/components/CheckBoxListItem.md +35 -0
  17. package/dist/components/CheckBoxListItem.module.scss +59 -0
  18. package/dist/components/ContentBox.js +106 -0
  19. package/dist/components/ContentBox.md +46 -0
  20. package/dist/components/ContentBox.module.scss +105 -0
  21. package/dist/components/DragAndDropFileInput.js +196 -0
  22. package/dist/components/DragAndDropFileInput.md +7 -0
  23. package/dist/components/DragAndDropFileInput.module.scss +36 -0
  24. package/dist/components/Footer.js +62 -0
  25. package/dist/components/Footer.md +7 -0
  26. package/dist/components/Footer.module.scss +11 -0
  27. package/dist/components/Header.js +75 -0
  28. package/dist/components/Header.md +7 -0
  29. package/dist/components/Header.module.scss +30 -0
  30. package/dist/components/InputField.js +201 -0
  31. package/dist/components/InputField.md +36 -0
  32. package/dist/components/InputField.module.scss +91 -0
  33. package/dist/components/List.js +106 -0
  34. package/dist/components/List.md +10 -0
  35. package/dist/components/List.module.scss +19 -0
  36. package/dist/components/LoadingAnimation.js +74 -0
  37. package/dist/components/LoadingAnimation.md +5 -0
  38. package/dist/components/LoadingAnimation.module.scss +26 -0
  39. package/dist/components/NavigationBar.js +229 -0
  40. package/dist/components/NavigationBar.md +31 -0
  41. package/dist/components/NavigationBar.module.scss +176 -0
  42. package/dist/components/NavigationBarListItem.js +85 -0
  43. package/dist/components/NavigationBarListItem.md +16 -0
  44. package/dist/components/Paper.js +71 -0
  45. package/dist/components/Paper.md +9 -0
  46. package/dist/components/Paper.module.scss +17 -0
  47. package/dist/components/RadioButtonIcon.js +92 -0
  48. package/dist/components/RadioButtonIcon.md +23 -0
  49. package/dist/components/RadioButtonIcon.module.scss +21 -0
  50. package/dist/components/RadioButtonInput.js +89 -0
  51. package/dist/components/RadioButtonInput.md +22 -0
  52. package/dist/components/RadioButtonInput.module.scss +15 -0
  53. package/dist/components/RadioButtonListItem.js +86 -0
  54. package/dist/components/RadioButtonListItem.md +24 -0
  55. package/dist/components/RadioButtonListItem.module.scss +59 -0
  56. package/dist/components/Select.js +188 -0
  57. package/dist/components/Select.md +26 -0
  58. package/dist/components/Select.module.scss +84 -0
  59. package/dist/components/Theme.js +131 -0
  60. package/dist/components/Theme.md +12 -0
  61. package/dist/components/Theme.module.scss +76 -0
  62. package/dist/components/WizardNavigation/Step.js +104 -0
  63. package/dist/components/WizardNavigation/Step.module.scss +75 -0
  64. package/dist/components/WizardNavigation.js +95 -0
  65. package/dist/components/WizardNavigation.md +84 -0
  66. package/dist/components/WizardNavigation.module.scss +4 -0
  67. package/dist/fonts/Altis-Light.eot +0 -0
  68. package/dist/fonts/Altis-Light.svg +326 -0
  69. package/dist/fonts/Altis-Light.ttf +0 -0
  70. package/dist/fonts/Altis-Light.woff +0 -0
  71. package/dist/functions/theme.js +60 -0
  72. package/dist/images/dibk-logo-mobile.svg +91 -0
  73. package/dist/images/dibk-logo.svg +991 -0
  74. package/dist/images/spinner.svg +57 -0
  75. package/dist/index.js +185 -0
  76. package/dist/style/abstracts/_all.scss +2 -0
  77. package/dist/style/abstracts/mixins/_all.scss +12 -0
  78. package/dist/style/abstracts/mixins/_animation.scss +6 -0
  79. package/dist/style/abstracts/mixins/_appearance.scss +5 -0
  80. package/dist/style/abstracts/mixins/_border-radius.scss +31 -0
  81. package/dist/style/abstracts/mixins/_box-shadow.scss +5 -0
  82. package/dist/style/abstracts/mixins/_box-sizing.scss +5 -0
  83. package/dist/style/abstracts/mixins/_calc.scss +5 -0
  84. package/dist/style/abstracts/mixins/_keyframes.scss +14 -0
  85. package/dist/style/abstracts/mixins/_opacity.scss +5 -0
  86. package/dist/style/abstracts/mixins/_placeholder.scss +17 -0
  87. package/dist/style/abstracts/mixins/_scrollbar.scss +26 -0
  88. package/dist/style/abstracts/mixins/_transform.scss +6 -0
  89. package/dist/style/abstracts/mixins/_transition.scss +34 -0
  90. package/dist/style/abstracts/variables/_all.scss +3 -0
  91. package/dist/style/abstracts/variables/_colors.scss +35 -0
  92. package/dist/style/abstracts/variables/_typography.scss +1 -0
  93. package/dist/style/abstracts/variables/_viewports.scss +11 -0
  94. package/dist/style/base/_all.scss +2 -0
  95. package/dist/style/base/_reset.scss +15 -0
  96. package/dist/style/base/_typography.scss +6 -0
  97. package/dist/style/base/fonts.css +6 -0
  98. package/dist/style/global.scss +3 -0
  99. package/dist/style/layout/_all.scss +1 -0
  100. package/dist/style/layout/_containers.scss +9 -0
  101. package/package.json +43 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # DIBK design
2
+
3
+ Shared components for DIBK applications
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _AccordionModule = _interopRequireDefault(require("./Accordion.module.scss"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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); 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 } }); 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 Accordion = /*#__PURE__*/function (_React$Component) {
39
+ _inherits(Accordion, _React$Component);
40
+
41
+ var _super = _createSuper(Accordion);
42
+
43
+ function Accordion(props) {
44
+ var _this;
45
+
46
+ _classCallCheck(this, Accordion);
47
+
48
+ _this = _super.call(this, props);
49
+ _this.state = {
50
+ expanded: _this.props.expanded,
51
+ initialized: _this.props.expanded
52
+ };
53
+ _this.handleToggleExpand = _this.handleToggleExpand.bind(_assertThisInitialized(_this));
54
+ return _this;
55
+ }
56
+
57
+ _createClass(Accordion, [{
58
+ key: "handleToggleExpand",
59
+ value: function handleToggleExpand() {
60
+ this.setState({
61
+ expanded: !this.state.expanded,
62
+ initialized: true
63
+ });
64
+ }
65
+ }, {
66
+ key: "componentDidUpdate",
67
+ value: function componentDidUpdate(prevProps) {
68
+ if (this.props.expanded !== prevProps.expanded) {
69
+ this.setState({
70
+ expanded: this.props.expanded
71
+ });
72
+ }
73
+ }
74
+ }, {
75
+ key: "renderPanel",
76
+ value: function renderPanel() {
77
+ return /*#__PURE__*/_react.default.createElement("div", {
78
+ className: _AccordionModule.default.panel,
79
+ onClick: this.handleToggleExpand
80
+ }, /*#__PURE__*/_react.default.createElement("span", {
81
+ className: _AccordionModule.default.panelText
82
+ }, this.props.title), /*#__PURE__*/_react.default.createElement("span", {
83
+ className: "".concat(_AccordionModule.default.panelChevron, " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
84
+ }));
85
+ }
86
+ }, {
87
+ key: "render",
88
+ value: function render() {
89
+ var className = "".concat(_AccordionModule.default.accordion, " ").concat(this.props.color ? _AccordionModule.default[this.props.color] : '');
90
+ return /*#__PURE__*/_react.default.createElement("div", {
91
+ className: className
92
+ }, this.renderPanel(), /*#__PURE__*/_react.default.createElement("div", {
93
+ className: "".concat(_AccordionModule.default.content, " ").concat(this.state.initialized ? _AccordionModule.default.initialized : '', " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
94
+ }, this.props.children));
95
+ }
96
+ }]);
97
+
98
+ return Accordion;
99
+ }(_react.default.Component);
100
+
101
+ Accordion.propTypes = {
102
+ /** Content title inside box */
103
+ title: _propTypes.default.string,
104
+ titleSize: _propTypes.default.oneOf(['regular', 'large']),
105
+
106
+ /** Text content inside box */
107
+ content: _propTypes.default.string,
108
+ color: _propTypes.default.oneOf(['default', 'primary', 'success', 'warning', 'info', 'lightCyan', 'orange', 'lightOrange', 'lime', 'lightLime']),
109
+ expanded: _propTypes.default.bool
110
+ };
111
+ Accordion.defaultProps = {
112
+ title: null,
113
+ titleSize: 'regular',
114
+ href: null,
115
+ content: '',
116
+ color: 'default',
117
+ expanded: false
118
+ };
119
+ var _default = Accordion;
120
+ exports.default = _default;
@@ -0,0 +1,15 @@
1
+ Accordions example:
2
+
3
+
4
+ ```js
5
+ <Accordion color="default" title="Accordion title">Accordion with default color</Accordion>
6
+ <Accordion color="primary" title="Accordion title">Accordion with primary color</Accordion>
7
+ <Accordion color="success" title="Accordion title">Accordion with success color</Accordion>
8
+ <Accordion color="warning" title="Accordion title">Accordion with warning color</Accordion>
9
+ <Accordion color="info" title="Accordion title">Accordion with info color</Accordion>
10
+ <Accordion color="lightCyan" title="Accordion title">Accordion with light cyan color</Accordion>
11
+ <Accordion color="orange" title="Accordion title">Accordion with orange color</Accordion>
12
+ <Accordion color="lightOrange" title="Accordion title">Accordion with light orange color</Accordion>
13
+ <Accordion color="lime" title="Accordion title" titleSize="large">Accordion with lime color</Accordion>
14
+ <Accordion color="lightLime" title="Accordion title">Accordion with light lime color</Accordion>
15
+ ```
@@ -0,0 +1,180 @@
1
+ @import "../style/global.scss";
2
+
3
+ @keyframes show {
4
+ 0% {
5
+ opacity: 0;
6
+ margin-top: 0px;
7
+ padding: 0 30px 0;
8
+ line-height: 0;
9
+ max-height: 0;
10
+ }
11
+ 100% {
12
+ opacity: 1;
13
+ margin-top: 0px;
14
+ padding: 8px 30px 15px;
15
+ line-height: inherit;
16
+ max-height: 1000px;
17
+ }
18
+ }
19
+
20
+ @keyframes hide {
21
+ 100% {
22
+ opacity: 0;
23
+ margin-top: 0px;
24
+ padding: 0 30px 0;
25
+ line-height: 0;
26
+ max-height: 0;
27
+ }
28
+ 0% {
29
+ opacity: 1;
30
+ margin-top: 0px;
31
+ padding: 8px 30px 15px;
32
+ line-height: inherit;
33
+ max-height: 1000px;
34
+ }
35
+ }
36
+
37
+ :local(.accordion) {
38
+ font-family: $default-font;
39
+ text-decoration: none;
40
+ width: 100%;
41
+ display: block;
42
+ &:local(.default) {
43
+ background-color: $color-default;
44
+ :local(.panel) span,
45
+ :local(.content) {
46
+ color: #000;
47
+ }
48
+ }
49
+ &:local(.primary) {
50
+ background-color: $color-primary;
51
+ color: #fff;
52
+ :local(.panel) span,
53
+ :local(.content) {
54
+ color: #fff;
55
+ }
56
+ }
57
+ &:local(.success) {
58
+ background-color: $color-success;
59
+ color: #fff;
60
+ :local(.panel) span,
61
+ :local(.content) {
62
+ color: #fff;
63
+ }
64
+ }
65
+ &:local(.warning) {
66
+ background-color: $color-warning;
67
+ color: #fff;
68
+ :local(.panel) span,
69
+ :local(.content) {
70
+ color: #fff;
71
+ }
72
+ }
73
+
74
+ &:local(.info) {
75
+ background-color: $color-info;
76
+ :local(.panel) span,
77
+ :local(.content) {
78
+ color: #000;
79
+ }
80
+ }
81
+ &:local(.lightCyan) {
82
+ background-color: $color-light-cyan;
83
+ :local(.panel) span,
84
+ :local(.content) {
85
+ color: #000;
86
+ }
87
+ }
88
+ &:local(.orange) {
89
+ background-color: $color-orange;
90
+ color: #fff;
91
+ :local(.panel) span,
92
+ :local(.content) {
93
+ color: #fff;
94
+ }
95
+ }
96
+ &:local(.lightOrange) {
97
+ background-color: $color-light-orange;
98
+ :local(.panel) span,
99
+ :local(.content) {
100
+ color: #000;
101
+ }
102
+ }
103
+ &:local(.lime) {
104
+ background-color: $color-lime;
105
+ color: #fff;
106
+ :local(.panel) span,
107
+ :local(.content) {
108
+ color: #fff;
109
+ }
110
+ }
111
+ &:local(.lightLime) {
112
+ background-color: $color-light-lime;
113
+ :local(.panel) span,
114
+ :local(.content) {
115
+ color: #000;
116
+ }
117
+ }
118
+
119
+ :local(.panel) {
120
+ padding: 15px 30px;
121
+ display: flex;
122
+ align-items: center;
123
+ position: relative;
124
+ text-decoration: none;
125
+ overflow-wrap: break-word;
126
+ font-weight: 500;
127
+ font-size: 20px;
128
+ line-height: 1.7;
129
+ cursor: pointer;
130
+ :local(.panelText) {
131
+ flex: 1;
132
+ }
133
+ :local(.panelChevron) {
134
+ box-sizing: border-box;
135
+ position: relative;
136
+ display: block;
137
+ width: 18px;
138
+ height: 18px;
139
+ border-radius: 100px;
140
+
141
+ &::after {
142
+ content: "";
143
+ display: block;
144
+ box-sizing: border-box;
145
+ position: absolute;
146
+ width: 18px;
147
+ height: 18px;
148
+ border-bottom: 2px solid;
149
+ border-right: 2px solid;
150
+ transform: translateY(-30%) rotate(45deg);
151
+ transition: transform 0.3s ease-in-out;
152
+ }
153
+ &:local(.expanded) {
154
+ &::after {
155
+ transform: translateY(30%) rotate(225deg);
156
+ }
157
+ }
158
+ }
159
+ }
160
+ :local(.content) {
161
+ opacity: 0;
162
+ margin-top: 0px;
163
+ line-height: 0;
164
+ max-height: 0;
165
+ overflow: hidden;
166
+ padding: 0 30px 0;
167
+ &:local(.initialized) {
168
+ animation: hide 0.3s ease-in-out;
169
+ }
170
+
171
+ &:local(.expanded) {
172
+ animation: show 0.3s ease-in-out;
173
+ opacity: 1;
174
+ margin-top: 0px;
175
+ padding: 8px 30px 15px;
176
+ line-height: inherit;
177
+ max-height: 10000px;
178
+ }
179
+ }
180
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _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 _ButtonModule = _interopRequireDefault(require("./Button.module.scss"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ 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); }
21
+
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+
24
+ 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); } }
25
+
26
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
27
+
28
+ 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
+
30
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
+
32
+ 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); }; }
33
+
34
+ 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); }
35
+
36
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
+
38
+ 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; } }
39
+
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+
42
+ var Button = /*#__PURE__*/function (_React$Component) {
43
+ _inherits(Button, _React$Component);
44
+
45
+ var _super = _createSuper(Button);
46
+
47
+ function Button() {
48
+ _classCallCheck(this, Button);
49
+
50
+ return _super.apply(this, arguments);
51
+ }
52
+
53
+ _createClass(Button, [{
54
+ key: "getArrowClass",
55
+ value: function getArrowClass() {
56
+ switch (this.props.arrow) {
57
+ case 'left':
58
+ return _ButtonModule.default.hasArrowLeft;
59
+
60
+ case 'right':
61
+ return _ButtonModule.default.hasArrowRight;
62
+
63
+ default:
64
+ return '';
65
+ }
66
+ }
67
+ }, {
68
+ key: "getThemeStyle",
69
+ value: function getThemeStyle(theme, color) {
70
+ return {
71
+ backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
72
+ color: (0, _theme.getThemePaletteTextColor)(theme, color)
73
+ };
74
+ }
75
+ }, {
76
+ key: "render",
77
+ value: function render() {
78
+ var themeStyle = this.props.theme ? this.getThemeStyle(this.props.theme, this.props.color) : null;
79
+ var className = "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[this.props.color], " ").concat(_ButtonModule.default[this.props.size], " ").concat(this.getArrowClass());
80
+ return /*#__PURE__*/_react.default.createElement("button", _extends({}, this.props, {
81
+ className: className,
82
+ style: themeStyle
83
+ }), this.props.content);
84
+ }
85
+ }]);
86
+
87
+ return Button;
88
+ }(_react.default.Component);
89
+
90
+ Button.propTypes = {
91
+ /** Text content inside button */
92
+ content: _propTypes.default.string,
93
+ color: _propTypes.default.oneOf(['default', 'primary', 'success', 'warning']),
94
+ size: _propTypes.default.oneOf(['small', 'regular']),
95
+ arrow: _propTypes.default.oneOf(['left', 'right']),
96
+ theme: _propTypes.default.object
97
+ };
98
+ Button.defaultProps = {
99
+ content: 'button',
100
+ color: 'default',
101
+ size: 'regular'
102
+ };
103
+ var _default = Button;
104
+ exports.default = _default;
@@ -0,0 +1,48 @@
1
+ Regular buttons example:
2
+
3
+ ```js
4
+ <Button content="Click me" color="default" />
5
+ <Button content="Click me" color="primary" />
6
+ <Button content="Click me" color="success" />
7
+ <Button content="Click me" color="warning" disabled="disabled" />
8
+ ```
9
+
10
+ Regular buttons with arrow example:
11
+
12
+ ```js
13
+ <Button content="Click me" color="default" arrow="left" disabled="disabled"/>
14
+ <Button content="Click me" color="primary" arrow="left" disabled="disabled"/>
15
+ <Button content="Click me" color="success" arrow="right" disabled="disabled"/>
16
+ <Button content="Click me" color="warning" arrow="right" disabled="disabled"/>
17
+ ```
18
+
19
+ Small buttons example:
20
+
21
+ ```js
22
+ <Button content="Click me" color="default" size="small" />
23
+ <Button content="Click me" color="primary" size="small" />
24
+ <Button content="Click me" color="success" size="small" />
25
+ <Button content="Click me" color="warning" size="small" />
26
+ ```
27
+
28
+
29
+ Small buttons with arrow example:
30
+
31
+ ```js
32
+ <Button content="Click me" color="default" size="small" arrow="left" />
33
+ <Button content="Click me" color="primary" size="small" arrow="left" />
34
+ <Button content="Click me" color="success" size="small" arrow="right" />
35
+ <Button content="Click me" color="warning" size="small" arrow="right" />
36
+ ```
37
+
38
+ Themed buttons:
39
+
40
+ ```js
41
+ import customTheme from 'data/customTheme';
42
+ <React.Fragment>
43
+ <Button content="Click me" color="default" size="small" theme={customTheme} />
44
+ <Button content="Click me" color="primary" size="small" theme={customTheme} />
45
+ <Button content="Click me" color="success" size="small" theme={customTheme} />
46
+ <Button content="Click me" color="warning" size="small" theme={customTheme} />
47
+ </React.Fragment>
48
+ ```