dibk-design 0.3.24 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,14 +69,16 @@ var Button = /*#__PURE__*/function (_React$Component) {
69
69
  value: function getThemeStyle(theme, color) {
70
70
  return {
71
71
  backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
72
- color: (0, _theme.getThemePaletteTextColor)(theme, color)
72
+ color: (0, _theme.getThemePaletteTextColor)(theme, color),
73
+ borderColor: (0, _theme.getThemePaletteBorderColor)(theme, color),
74
+ borderWidth: (0, _theme.getThemePaletteBorderColor)(theme, color) ? '1px' : '0'
73
75
  };
74
76
  }
75
77
  }, {
76
78
  key: "render",
77
79
  value: function render() {
78
80
  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());
81
+ 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 : '');
80
82
  return /*#__PURE__*/_react.default.createElement("button", _extends({}, this.props, {
81
83
  className: className,
82
84
  style: themeStyle
@@ -90,15 +92,19 @@ var Button = /*#__PURE__*/function (_React$Component) {
90
92
  Button.propTypes = {
91
93
  /** Text content inside button */
92
94
  content: _propTypes.default.string,
93
- color: _propTypes.default.oneOf(['default', 'primary', 'success', 'warning']),
95
+ color: _propTypes.default.oneOf(['default', 'primary']),
94
96
  size: _propTypes.default.oneOf(['small', 'regular']),
95
97
  arrow: _propTypes.default.oneOf(['left', 'right']),
96
- theme: _propTypes.default.object
98
+ theme: _propTypes.default.object,
99
+ disabled: _propTypes.default.bool,
100
+ noHover: _propTypes.default.bool
97
101
  };
98
102
  Button.defaultProps = {
99
103
  content: 'button',
100
104
  color: 'default',
101
- size: 'regular'
105
+ size: 'regular',
106
+ disabled: false,
107
+ noHover: false
102
108
  };
103
109
  var _default = Button;
104
110
  exports.default = _default;
@@ -3,17 +3,26 @@ Regular buttons example:
3
3
  ```js
4
4
  <Button content="Click me" color="default" />
5
5
  <Button content="Click me" color="primary" />
6
- <Button content="Click me" color="success" />
7
- <Button content="Click me" color="warning" disabled="disabled" />
6
+ <Button content="Click me" color="default" disabled="disabled" />
7
+ <Button content="Click me" color="primary" disabled="disabled" />
8
8
  ```
9
9
 
10
10
  Regular buttons with arrow example:
11
11
 
12
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"/>
13
+ <Button content="Click me" color="default" arrow="left" />
14
+ <Button content="Click me" color="primary" arrow="right" />
15
+ <Button content="Click me" color="default" arrow="left" disabled="disabled" />
16
+ <Button content="Click me" color="primary" arrow="right" disabled="disabled" />
17
+ ```
18
+
19
+ Regular buttons without hover effect example:
20
+
21
+ ```js
22
+ <Button content="Click me" color="default" noHover />
23
+ <Button content="Click me" color="primary" noHover />
24
+ <Button content="Click me" color="default" noHover disabled="disabled" />
25
+ <Button content="Click me" color="primary" noHover disabled="disabled" />
17
26
  ```
18
27
 
19
28
  Small buttons example:
@@ -21,8 +30,8 @@ Small buttons example:
21
30
  ```js
22
31
  <Button content="Click me" color="default" size="small" />
23
32
  <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" />
33
+ <Button content="Click me" color="default" size="small" disabled="disabled" />
34
+ <Button content="Click me" color="primary" size="small" disabled="disabled" />
26
35
  ```
27
36
 
28
37
 
@@ -30,9 +39,9 @@ Small buttons with arrow example:
30
39
 
31
40
  ```js
32
41
  <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" />
42
+ <Button content="Click me" color="primary" size="small" arrow="right" />
43
+ <Button content="Click me" color="default" size="small" arrow="left" disabled="disabled" />
44
+ <Button content="Click me" color="primary" size="small" arrow="right" disabled="disabled" />
36
45
  ```
37
46
 
38
47
  Themed buttons:
@@ -42,7 +51,7 @@ import customTheme from 'data/customTheme';
42
51
  <React.Fragment>
43
52
  <Button content="Click me" color="default" size="small" theme={customTheme} />
44
53
  <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} />
54
+ <Button content="Click me" color="default" size="small" theme={customTheme} disabled="disabled" />
55
+ <Button content="Click me" color="primary" size="small" theme={customTheme} disabled="disabled" />
47
56
  </React.Fragment>
48
57
  ```
@@ -29,68 +29,116 @@
29
29
  :local(.button) {
30
30
  @include appearance(none);
31
31
  @include border-radius(0);
32
- @include transition(filter 300ms ease-out);
33
- font-family: $default-font;
32
+ @include transition(
33
+ filter 300ms ease-out,
34
+ background-color 300ms ease-out,
35
+ color 300ms ease-out,
36
+ border-color 300ms ease-out
37
+ );
38
+ font-family: "Altis", sans-serif;
34
39
  border-style: solid;
35
- border-width: 0;
40
+ border-width: 1px;
41
+ $border-color: $color-primary;
36
42
  cursor: pointer;
37
- line-height: normal;
43
+ line-height: 1;
38
44
  position: relative;
39
45
  text-align: center;
40
46
  text-decoration: none;
41
47
  display: inline-block;
42
48
  margin-right: 5px;
43
49
  margin-bottom: 5px;
44
- font-size: 18px;
45
- font-weight: normal;
50
+ font-size: 20px;
51
+ font-weight: 500;
46
52
 
47
- &:hover, &:focus {
48
- filter: brightness(90%);
49
- }
53
+ &:local(.hasTheme) {
54
+ &:hover,
55
+ &:focus {
56
+ filter: brightness(90%);
57
+ }
50
58
 
51
- &:active {
52
- filter: brightness(85%);
59
+ &:active {
60
+ filter: brightness(85%);
61
+ }
53
62
  }
54
63
 
55
64
  &:local(.regular) {
56
- padding: 15px 30px;
65
+ padding: 17px 32px;
57
66
  }
58
67
 
59
68
  &:local(.small) {
60
- padding: 1px 30px;
61
- height: 46px;
69
+ padding: 1px 32px;
70
+ height: 35px;
62
71
  min-width: 80px;
63
72
  }
64
73
 
65
74
  &:local(.default) {
66
- background-color: $color-default;
75
+ background-color: #fff;
67
76
  color: $color-primary;
77
+ &:not(:local(.hasTheme)) {
78
+ &:hover:not(:local(.noHover)),
79
+ &:active {
80
+ background-color: $color-primary;
81
+ color: #fff;
82
+ &:after,
83
+ &:before {
84
+ border-color: #fff;
85
+ }
86
+ }
87
+ }
68
88
  }
69
89
 
70
90
  &:local(.primary) {
71
91
  background-color: $color-primary;
72
92
  color: #fff;
73
- }
74
-
75
- &:local(.success) {
76
- background-color: $color-success;
77
- color: #fff;
78
- }
79
-
80
- &:local(.warning) {
81
- background-color: $color-warning;
82
- color: #fff;
93
+ &:not(:local(.hasTheme)) {
94
+ &:hover:not(:local(.noHover)),
95
+ &:active {
96
+ background-color: #fff;
97
+ color: $color-primary;
98
+ &:after,
99
+ &:before {
100
+ border-color: $color-primary;
101
+ }
102
+ }
103
+ }
83
104
  }
84
105
 
85
106
  &:disabled {
86
- cursor: default;
107
+ &:local(.hasTheme),
108
+ &:not(:local(.hasTheme)) {
109
+ &:local(.default),
110
+ &:local(.primary) {
111
+ background-color: #fff;
112
+ cursor: default;
113
+ opacity: 0.6;
114
+ color: #afaba8;
115
+ border: 1px solid #e5e3e1;
116
+ &:hover,
117
+ &:focus,
118
+ &:active {
119
+ background-color: #fff;
120
+ cursor: default;
121
+ opacity: 0.6;
122
+ color: #afaba8;
123
+ border: 1px solid #e5e3e1;
124
+ &:before,
125
+ &:after {
126
+ border-color: #afaba8;
127
+ }
128
+ }
129
+ &:before,
130
+ &:after {
131
+ border-color: #afaba8;
132
+ }
133
+ }
134
+ }
87
135
  }
88
136
 
89
137
  &:local(.hasArrowLeft) {
90
138
  &:before {
91
139
  @include transform(rotate(-135deg));
92
- @include calc('top', '50% - 0.3rem');
93
- content: ' ';
140
+ @include calc("top", "50% - 0.3rem");
141
+ content: " ";
94
142
  display: inline-block;
95
143
  position: absolute;
96
144
  left: 1em;
@@ -109,7 +157,7 @@
109
157
  }
110
158
  }
111
159
  &:local(.default) {
112
- &:before{
160
+ &:before {
113
161
  border-color: $color-primary;
114
162
  }
115
163
  }
@@ -118,8 +166,8 @@
118
166
  &:local(.hasArrowRight) {
119
167
  &:after {
120
168
  @include transform(rotate(45deg));
121
- @include calc('top', '50% - 0.3rem');
122
- content: ' ';
169
+ @include calc("top", "50% - 0.3rem");
170
+ content: " ";
123
171
  display: inline-block;
124
172
  position: absolute;
125
173
  left: auto;
@@ -6,84 +6,95 @@
6
6
  padding: 20px;
7
7
  width: 100%;
8
8
  display: block;
9
- &:local(.link){
9
+ &:local(.link) {
10
10
  color: $color-primary;
11
- @include transition(filter .3s);
12
- &:hover, &:focus {
11
+ @include transition(filter 0.3s);
12
+ &:hover,
13
+ &:focus {
13
14
  filter: brightness(90%);
14
15
  }
15
16
  &:active {
16
- filter: brightness(85%);
17
+ filter: brightness(85%);
17
18
  }
18
19
  }
19
20
  &:local(.default) {
20
21
  background-color: $color-default;
21
- :local(.content){
22
+ :local(.content),
23
+ :local(.title) {
22
24
  color: #000;
23
25
  }
24
26
  }
25
27
  &:local(.primary) {
26
28
  background-color: $color-primary;
27
29
  color: #fff;
28
- :local(.content){
30
+ :local(.content),
31
+ :local(.title) {
29
32
  color: #fff;
30
33
  }
31
34
  }
32
35
  &:local(.success) {
33
36
  background-color: $color-success;
34
37
  color: #fff;
35
- :local(.content){
38
+ :local(.content),
39
+ :local(.title) {
36
40
  color: #fff;
37
41
  }
38
42
  }
39
43
  &:local(.warning) {
40
44
  background-color: $color-warning;
41
45
  color: #fff;
42
- :local(.content){
46
+ :local(.content),
47
+ :local(.title) {
43
48
  color: #fff;
44
49
  }
45
50
  }
46
51
 
47
52
  &:local(.info) {
48
53
  background-color: $color-info;
49
- :local(.content){
54
+ :local(.content),
55
+ :local(.title) {
50
56
  color: #000;
51
57
  }
52
58
  }
53
59
  &:local(.lightCyan) {
54
60
  background-color: $color-light-cyan;
55
- :local(.content){
61
+ :local(.content),
62
+ :local(.title) {
56
63
  color: #000;
57
64
  }
58
65
  }
59
66
  &:local(.orange) {
60
67
  background-color: $color-orange;
61
68
  color: #fff;
62
- :local(.content){
69
+ :local(.content),
70
+ :local(.title) {
63
71
  color: #fff;
64
72
  }
65
73
  }
66
74
  &:local(.lightOrange) {
67
75
  background-color: $color-light-orange;
68
- :local(.content){
76
+ :local(.content),
77
+ :local(.title) {
69
78
  color: #000;
70
79
  }
71
80
  }
72
81
  &:local(.lime) {
73
82
  background-color: $color-lime;
74
83
  color: #fff;
75
- :local(.content){
84
+ :local(.content),
85
+ :local(.title) {
76
86
  color: #fff;
77
87
  }
78
88
  }
79
89
  &:local(.lightLime) {
80
90
  background-color: $color-light-lime;
81
- :local(.content){
91
+ :local(.content),
92
+ :local(.title) {
82
93
  color: #000;
83
94
  }
84
95
  }
85
96
 
86
- :local(.title){
97
+ :local(.title) {
87
98
  &:local(.regular) {
88
99
  font-family: "Open Sans";
89
100
  font-weight: bold;
@@ -93,7 +104,7 @@
93
104
  padding-bottom: 10px;
94
105
  border-bottom: 1px solid #e5e3e1;
95
106
  }
96
- &:local(.large){
107
+ &:local(.large) {
97
108
  font-family: "Open Sans";
98
109
  font-weight: normal;
99
110
  font-size: 24px;
@@ -49,8 +49,11 @@ var Header = /*#__PURE__*/function (_React$Component) {
49
49
  _createClass(Header, [{
50
50
  key: "render",
51
51
  value: function render() {
52
+ var bigClass = this.props.big ? _HeaderModule.default.bigHeader : '';
53
+ var themeClass = this.props.theme ? _HeaderModule.default.hasTheme : '';
54
+
52
55
  var headerElement = /*#__PURE__*/_react.default.createElement('h' + this.props.size, {
53
- className: _HeaderModule.default.header
56
+ className: "".concat(_HeaderModule.default.header, " ").concat(bigClass, " ").concat(themeClass)
54
57
  }, this.props.content);
55
58
 
56
59
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -65,7 +68,9 @@ var Header = /*#__PURE__*/function (_React$Component) {
65
68
  Header.propTypes = {
66
69
  /** Text content inside button */
67
70
  content: _propTypes.default.string.isRequired,
68
- size: _propTypes.default.oneOf([1, 2, 3, 4, 5])
71
+ size: _propTypes.default.oneOf([1, 2, 3, 4, 5]),
72
+ big: _propTypes.default.bool,
73
+ theme: _propTypes.default.object
69
74
  };
70
75
  Header.defaultProps = {
71
76
  content: '',
@@ -1,7 +1,8 @@
1
1
  Title examples:
2
2
 
3
3
  ```js
4
- <Header content="Title with size 1 (default)"/>
4
+ <Header content="Title with size 1"/>
5
5
  <Header content="Title with size 2" size={2}/>
6
6
  <Header content="Title with size 3" size={3}/>
7
+ <Header content="Big title with size 1" big/>
7
8
  ```
@@ -1,30 +1,44 @@
1
- :local(.headerContainer){
1
+ @import "../style/global.scss";
2
+
3
+ :local(.headerContainer) {
2
4
  font-size: 22px;
3
5
  padding: 10px 0;
4
- :local(.header){
6
+ :local(.header) {
5
7
  margin: 0;
6
8
  font-weight: normal;
7
9
  line-height: 1.4;
8
10
  font-style: normal;
9
11
  font-size: 18px;
12
+ &:not(:local(.hasTheme)) {
13
+ color: $color-primary;
14
+ }
10
15
  }
11
- :local(h1.header){
12
- font-family: "Altis-Light","Open Sans",arial,sans-serif;
13
- font-size: 50px;
14
- line-height: 1.2;
15
- overflow: hidden;
16
- text-overflow: ellipsis;
16
+ :local(h1.header) {
17
+ font-family: "Altis", sans-serif;
18
+ font-size: 35px;
19
+ font-style: normal;
20
+ font-weight: 500;
21
+ line-height: 1.43;
22
+ &:local(.bigHeader) {
23
+ font-family: "Altis-Light", "Open Sans", arial, sans-serif;
24
+ font-size: 50px;
25
+ line-height: 1.2;
26
+ overflow: hidden;
27
+ text-overflow: ellipsis;
28
+ }
17
29
  }
18
- :local(h2.header){
19
- font-family: "Open Sans",arial,sans-serif;
20
- font-size: 24px;
21
- font-weight: bold;
22
- line-height: 1.3;
30
+ :local(h2.header) {
31
+ font-family: "Altis", sans-serif;
32
+ font-size: 26px;
33
+ font-style: normal;
34
+ font-weight: 500;
35
+ line-height: 1.42;
23
36
  }
24
- :local(h3.header){
25
- font-family: "Open Sans",arial,sans-serif;
26
- font-size: 18px;
27
- font-weight: bold;
28
- line-height: 1.3;
37
+ :local(h3.header) {
38
+ font-family: "Altis", arial, sans-serif;
39
+ font-size: 22px;
40
+ font-style: italic;
41
+ font-weight: 600;
42
+ line-height: 1.42;
29
43
  }
30
44
  }