dibk-design 0.4.50 → 0.4.53

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.
@@ -83,13 +83,18 @@ var Button = /*#__PURE__*/function (_React$Component) {
83
83
  }, {
84
84
  key: "render",
85
85
  value: function render() {
86
+ var _this$props$href;
87
+
86
88
  var buttonProps = _objectSpread({}, this.props);
87
89
 
88
90
  delete buttonProps.noHover;
89
91
  delete buttonProps.rounded;
90
92
  var themeStyle = this.props.theme ? this.getThemeStyle(this.props.theme, this.props.color) : null;
91
93
  var className = "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[this.props.color], " ").concat(_ButtonModule.default[this.props.size], " ").concat(this.getArrowClass(), " ").concat(this.props.theme ? _ButtonModule.default.hasTheme : '', " ").concat(this.props.noHover ? _ButtonModule.default.noHover : '', " ").concat(this.props.rounded ? _ButtonModule.default.rounded : '');
92
- return /*#__PURE__*/_react.default.createElement("button", _extends({}, buttonProps, {
94
+ return (_this$props$href = this.props.href) !== null && _this$props$href !== void 0 && _this$props$href.length ? /*#__PURE__*/_react.default.createElement("a", _extends({}, buttonProps, {
95
+ className: className,
96
+ style: themeStyle
97
+ }), this.props.content) : /*#__PURE__*/_react.default.createElement("button", _extends({}, buttonProps, {
93
98
  className: className,
94
99
  style: themeStyle
95
100
  }), this.props.content);
@@ -108,7 +113,8 @@ Button.propTypes = {
108
113
  theme: _propTypes.default.object,
109
114
  disabled: _propTypes.default.bool,
110
115
  noHover: _propTypes.default.bool,
111
- rounded: _propTypes.default.bool
116
+ rounded: _propTypes.default.bool,
117
+ href: _propTypes.default.string
112
118
  };
113
119
  Button.defaultProps = {
114
120
  content: 'button',
@@ -5,6 +5,7 @@ Regular buttons example:
5
5
  <Button content="Click me" color="primary" />
6
6
  <Button content="Click me" color="default" disabled />
7
7
  <Button content="Click me" color="primary" disabled />
8
+ <Button content="Link button" color="primary" href="#" />
8
9
  ```
9
10
 
10
11
  Rounded buttons example:
@@ -38,7 +38,7 @@
38
38
  font-family: "Altis", sans-serif;
39
39
  border-style: solid;
40
40
  border-width: 1px;
41
- $border-color: $color-primary;
41
+ border-color: $color-primary;
42
42
  cursor: pointer;
43
43
  line-height: 1;
44
44
  position: relative;
@@ -64,6 +64,13 @@
64
64
  }
65
65
  }
66
66
 
67
+ &:focus-visible {
68
+ outline-color: #005fcc;
69
+ outline-style: auto;
70
+ outline-width: 2px;
71
+ outline-offset: 0px;
72
+ }
73
+
67
74
  &:local(.regular) {
68
75
  padding: 14px 24px;
69
76
  @media only screen and (min-width: $screen-sm) {
@@ -3,6 +3,7 @@
3
3
  :local(.checkBoxInput) {
4
4
  display: flex;
5
5
  margin-right: 1em;
6
+ border: 1px solid transparent;
6
7
 
7
8
  &:not(:local(.contentOnly)):not(:local(.disabled)) {
8
9
  cursor: pointer;
@@ -17,6 +18,11 @@
17
18
  }
18
19
  }
19
20
 
21
+ &:focus-within{
22
+ border-color: #072938;
23
+ outline-color: #54acb8;
24
+ }
25
+
20
26
  input[type="checkbox"] {
21
27
  opacity: 0;
22
28
  position: absolute;
@@ -96,7 +96,7 @@
96
96
 
97
97
  :local(.title) {
98
98
  &:local(.regular) {
99
- font-family: "Open Sans";
99
+ font-family: $default-font;
100
100
  font-weight: bold;
101
101
  font-size: 21px;
102
102
  font-style: normal;
@@ -105,7 +105,7 @@
105
105
  border-bottom: 1px solid #e5e3e1;
106
106
  }
107
107
  &:local(.large) {
108
- font-family: "Open Sans";
108
+ font-family: $default-font;
109
109
  font-weight: normal;
110
110
  font-size: 24px;
111
111
  margin: 0;
@@ -5,7 +5,7 @@
5
5
  cursor: pointer;
6
6
  font-size: 18px;
7
7
  margin: 0 0 4px;
8
- font-family: "Open Sans", arial, sans-serif;
8
+ font-family: $default-font;
9
9
  line-height: 1.3;
10
10
  font-weight: bold;
11
11
  font-style: normal;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _theme = require("../functions/theme");
13
+
14
+ var _ErrorBoxModule = _interopRequireDefault(require("./ErrorBox.module.scss"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ // Dependencies
19
+ // Functions
20
+ // Stylesheets
21
+ var ErrorBox = function ErrorBox(_ref) {
22
+ var theme = _ref.theme,
23
+ children = _ref.children;
24
+
25
+ var getThemeErrorBoxStyle = function getThemeErrorBoxStyle() {
26
+ return {
27
+ borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
28
+ };
29
+ };
30
+
31
+ return /*#__PURE__*/_react.default.createElement("div", {
32
+ className: _ErrorBoxModule.default.errorBox,
33
+ style: getThemeErrorBoxStyle()
34
+ }, children);
35
+ };
36
+
37
+ ErrorBox.propTypes = {
38
+ theme: _propTypes.default.object
39
+ };
40
+ ErrorBox.defaultProps = {
41
+ children: ''
42
+ };
43
+ var _default = ErrorBox;
44
+ exports.default = _default;
@@ -0,0 +1,27 @@
1
+ Error box example:
2
+
3
+ ```js
4
+ <ErrorBox>
5
+ <h3>Du kan ikke signere erklæringen før alle opplysningene er fylt ut:</h3>
6
+ <ul>
7
+ <li>Du må krysse av for at foretaket erklærer ansvar i henhold til plan- og bygningsloven.</li>
8
+ <li>Du må fylle ut mobil- eller telefonnummeret til kontaktpersonen.</li>
9
+ </ul>
10
+ </ErrorBox>
11
+ ```
12
+
13
+
14
+ Themed error box example:
15
+
16
+ ```js
17
+ import customTheme from 'data/customTheme';
18
+ <React.Fragment>
19
+ <ErrorBox theme={customTheme}>
20
+ <h3>Du kan ikke signere erklæringen før alle opplysningene er fylt ut:</h3>
21
+ <ul>
22
+ <li>Du må krysse av for at foretaket erklærer ansvar i henhold til plan- og bygningsloven.</li>
23
+ <li>Du må fylle ut mobil- eller telefonnummeret til kontaktpersonen.</li>
24
+ </ul>
25
+ </ErrorBox>
26
+ </React.Fragment>
27
+ ```
@@ -0,0 +1,25 @@
1
+ @import "../style/global.scss";
2
+
3
+ :local(.errorBox) {
4
+ @include box-shadow(0 2px 3px rgb(0 0 0 / 18%));
5
+ border-left: 12px solid $color-error;
6
+ background: white;
7
+ padding: 30px 33px 46px 21px;
8
+ font-family: $default-font;
9
+ margin: 0;
10
+ h1,
11
+ h2,
12
+ h3,
13
+ h4 {
14
+ font-size: 20px;
15
+ font-weight: 500;
16
+ line-height: 1.3;
17
+ margin: 0;
18
+ @media only screen and (min-width: $screen-sm) {
19
+ font-size: 24px;
20
+ }
21
+ }
22
+ ul {
23
+ padding-left: 20px;
24
+ }
25
+ }
@@ -7,7 +7,7 @@
7
7
  font-weight: 400;
8
8
  line-height: 1.2;
9
9
  margin: 4px 0;
10
- font-family: "Open Sans", sans-serif;
10
+ font-family: $default-font;
11
11
  font-style: italic;
12
12
  overflow-wrap: break-word;
13
13
  @media only screen and (min-width: $screen-sm) {
@@ -41,7 +41,7 @@
41
41
  }
42
42
  }
43
43
  &:local(.size-3) {
44
- font-family: "Open Sans", arial, sans-serif;
44
+ font-family: $default-font;
45
45
  font-size: 19px;
46
46
  font-style: normal;
47
47
  font-weight: bold;
@@ -51,7 +51,7 @@
51
51
  }
52
52
  }
53
53
  &:local(.size-4) {
54
- font-family: "Open Sans", arial, sans-serif;
54
+ font-family: $default-font;
55
55
  font-size: 17px;
56
56
  font-style: italic;
57
57
  font-weight: normal;
@@ -1,3 +1,5 @@
1
+ @import "../style/global.scss";
2
+
1
3
  :local(.label) {
2
4
  color: #000;
3
5
  display: block;
@@ -5,7 +7,7 @@
5
7
  font-weight: bold;
6
8
  line-height: 1.2;
7
9
  margin-bottom: 2px;
8
- font-family: "Open Sans", sans-serif;
10
+ font-family: $default-font;
9
11
  overflow-wrap: break-word;
10
12
  &:local(.inline) {
11
13
  display: inline-block;
@@ -107,7 +107,7 @@
107
107
  color: #fff;
108
108
  text-transform: uppercase;
109
109
  text-decoration: none;
110
- font-family: "Open Sans";
110
+ font-family: $default-font;
111
111
  padding: 10px 0;
112
112
  display: block;
113
113
  border-bottom: 1px solid $color-primary;
@@ -123,7 +123,7 @@
123
123
  color: #fff;
124
124
  text-transform: none;
125
125
  text-decoration: none;
126
- font-family: "Open Sans";
126
+ font-family: $default-font;
127
127
  padding: 10px 0;
128
128
  margin-left: 20px;
129
129
  display: block;
@@ -4,6 +4,7 @@
4
4
  display: flex;
5
5
  cursor: pointer;
6
6
  margin-right: 1em;
7
+ border: 1px solid transparent;
7
8
 
8
9
  &:not(:local(.contentOnly)):not(:local(.disabled)) {
9
10
  cursor: pointer;
@@ -19,6 +20,11 @@
19
20
  }
20
21
  }
21
22
 
23
+ &:focus-within{
24
+ border-color: #072938;
25
+ outline-color: #54acb8;
26
+ }
27
+
22
28
  input[type="radio"] {
23
29
  opacity: 0;
24
30
  position: absolute;
package/dist/index.js CHANGED
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "DragAndDropFileInput", {
57
57
  return _DragAndDropFileInput.default;
58
58
  }
59
59
  });
60
+ Object.defineProperty(exports, "ErrorBox", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _ErrorBox.default;
64
+ }
65
+ });
60
66
  Object.defineProperty(exports, "ErrorMessage", {
61
67
  enumerable: true,
62
68
  get: function get() {
@@ -184,6 +190,8 @@ var _Dialog = _interopRequireDefault(require("./components/Dialog"));
184
190
 
185
191
  var _DragAndDropFileInput = _interopRequireDefault(require("./components/DragAndDropFileInput"));
186
192
 
193
+ var _ErrorBox = _interopRequireDefault(require("./components/ErrorBox"));
194
+
187
195
  var _ErrorMessage = _interopRequireDefault(require("./components/ErrorMessage"));
188
196
 
189
197
  var _Footer = _interopRequireDefault(require("./components/Footer"));
@@ -1,2 +1,2 @@
1
- $default-font: "Open Sans";
1
+ $default-font: "Open Sans", arial, sans-serif;
2
2
  $heading-font: "Altis"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dibk-design",
3
- "version": "0.4.50",
3
+ "version": "0.4.53",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",