@doodl/slate 1.22.3 → 1.22.6
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.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.22.6](https://bitbucket.org/doodlltd/slate/compare/v1.22.5...v1.22.6) (2022-06-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Fix critical typo in button background colour generator mixin ([b436504](https://bitbucket.org/doodlltd/slate/commit/b436504b82094d7ff8cc5870f9d70379de868a76))
|
|
11
|
+
|
|
12
|
+
### [1.22.5](https://bitbucket.org/doodlltd/slate/compare/v1.22.4...v1.22.5) (2022-05-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Resolve colour behaviour of default contained buttons ([9fe80a6](https://bitbucket.org/doodlltd/slate/commit/9fe80a6411fb0af3b4e5cc6fa5a52a7a14531fc2))
|
|
18
|
+
|
|
19
|
+
### [1.22.4](https://bitbucket.org/doodlltd/slate/compare/v1.22.3...v1.22.4) (2022-04-07)
|
|
20
|
+
|
|
5
21
|
### [1.22.3](https://bitbucket.org/doodlltd/slate/compare/v1.22.2...v1.22.3) (2022-02-13)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
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; }
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import styles from '../../../../scss/css-modules/section.module.scss';
|
|
6
|
-
|
|
7
|
-
var Section = function Section(props) {
|
|
6
|
+
var Section = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
7
|
var _classNames;
|
|
9
8
|
|
|
10
|
-
var
|
|
9
|
+
var id = props.id,
|
|
10
|
+
children = props.children,
|
|
11
11
|
_props$component = props.component,
|
|
12
12
|
Component = _props$component === void 0 ? 'section' : _props$component,
|
|
13
13
|
className = props.className,
|
|
@@ -21,8 +21,9 @@ var Section = function Section(props) {
|
|
|
21
21
|
removeRightPadding = _props$removeRightPad === void 0 ? false : _props$removeRightPad;
|
|
22
22
|
var classes = classNames(styles.section, (_classNames = {}, _defineProperty(_classNames, styles['remove-bottom-padding'], removeBottomPadding), _defineProperty(_classNames, styles['remove-top-padding'], removeTopPadding), _defineProperty(_classNames, styles['remove-left-padding'], removeLeftPadding), _defineProperty(_classNames, styles['remove-right-padding'], removeRightPadding), _classNames), className);
|
|
23
23
|
return /*#__PURE__*/React.createElement(Component, {
|
|
24
|
-
|
|
24
|
+
id: id,
|
|
25
|
+
className: classes,
|
|
26
|
+
ref: ref
|
|
25
27
|
}, children);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
+
});
|
|
28
29
|
export default Section;
|
package/package.json
CHANGED
package/scss/_mixins.scss
CHANGED
|
@@ -119,9 +119,9 @@
|
|
|
119
119
|
} @else {
|
|
120
120
|
$_colour: $slate-button-colour--contrast;
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
@include assign-variable-property(color, $_colour, $key, #{$keyPrefix}colour--, $keySuffix);
|
|
124
122
|
}
|
|
123
|
+
|
|
124
|
+
@include assign-variable-property(color, $_colour, $key, #{$keyPrefix}colour--, $keySuffix);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
@mixin contained-button(
|
|
@@ -158,14 +158,14 @@
|
|
|
158
158
|
// Use the default value to determine a lightness
|
|
159
159
|
$_bg-lightness: lightness(map-get($_background-colour,default));
|
|
160
160
|
@if $_bg-lightness < 20 {
|
|
161
|
-
$
|
|
161
|
+
$_background-colour--hover: map-get($background,600);
|
|
162
162
|
} @else {
|
|
163
163
|
$_background-colour--hover: map-get($background,400);
|
|
164
164
|
}
|
|
165
165
|
} @else {
|
|
166
166
|
$_bg-lightness: lightness(guarantee-colour-value($_background-colour));
|
|
167
167
|
@if $_bg-lightness < 20 {
|
|
168
|
-
$
|
|
168
|
+
$_background-colour--hover: scale-color(guarantee-colour-value($_background-colour),$lightness: $slate-button-lighten-amount);
|
|
169
169
|
} @else {
|
|
170
170
|
$_background-colour--hover: scale-color(guarantee-colour-value($_background-colour),$lightness: -$slate-button-darken-amount);
|
|
171
171
|
}
|
package/scss/core/_button.scss
CHANGED
|
@@ -109,11 +109,17 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
&.contained {
|
|
112
|
+
// Edge case for default contained button, where we will usually want
|
|
113
|
+
// to retain the default button colour on hover
|
|
114
|
+
$_default-button-colour-override--contained--hover: $slate-button-colour;
|
|
115
|
+
@if $slate-button-colour-override--contained--hover != 0 {
|
|
116
|
+
$_default-button-colour-override--contained--hover: $slate-button-colour-override--contained--hover;
|
|
117
|
+
}
|
|
112
118
|
@include contained-button(
|
|
113
119
|
$slate-button-background--contained,
|
|
114
120
|
$slate-button-colour,
|
|
115
121
|
$slate-button-background-override--contained--hover,
|
|
116
|
-
$
|
|
122
|
+
$_default-button-colour-override--contained--hover,
|
|
117
123
|
$slate-button-border-colour-override--contained,
|
|
118
124
|
$slate-button-border-colour-override--contained--hover,
|
|
119
125
|
);
|
|
@@ -82,7 +82,7 @@ $slate-button-border-colour-bad-override--contained: 0 !default;
|
|
|
82
82
|
$slate-button-border-colour-bad-override--contained--hover: 0 !default;
|
|
83
83
|
////
|
|
84
84
|
|
|
85
|
-
$slate-button-lighten-amount:
|
|
85
|
+
$slate-button-lighten-amount: 90 !default;
|
|
86
86
|
$slate-button-darken-amount: 15 !default;
|
|
87
87
|
$slate-button-box-shadow--active: inset 0.05em 0.05em 0.5em !default; // Don't include the colour here
|
|
88
88
|
$slate-button-background--contained: scale-color($slate-button-colour, $lightness: $slate-button-lighten-amount) !default;
|