@doodl/slate 1.22.2 → 1.22.5
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 +16 -0
- package/js/dist/react-components/grid/grid-item.js +4 -3
- package/js/dist/react-components/grid/index.js +6 -4
- package/js/dist/react-components/grid/padded-grid.js +5 -5
- package/js/dist/react-components/section/index.js +8 -7
- package/package.json +1 -1
- package/scss/_mixins.scss +2 -2
- package/scss/core/_button.scss +7 -1
- package/scss/variables/_breakpoints.scss +2 -2
- package/scss/variables/_button.scss +1 -1
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.5](https://bitbucket.org/doodlltd/slate/compare/v1.22.4...v1.22.5) (2022-05-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Resolve colour behaviour of default contained buttons ([9fe80a6](https://bitbucket.org/doodlltd/slate/commit/9fe80a6411fb0af3b4e5cc6fa5a52a7a14531fc2))
|
|
11
|
+
|
|
12
|
+
### [1.22.4](https://bitbucket.org/doodlltd/slate/compare/v1.22.3...v1.22.4) (2022-04-07)
|
|
13
|
+
|
|
14
|
+
### [1.22.3](https://bitbucket.org/doodlltd/slate/compare/v1.22.2...v1.22.3) (2022-02-13)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* Flag default breakpoints as SCSS defaults ([f380ddc](https://bitbucket.org/doodlltd/slate/commit/f380ddce65ef6287b040e2a2a796ebf0eecbc29d))
|
|
20
|
+
|
|
5
21
|
### [1.22.2](https://bitbucket.org/doodlltd/slate/compare/v1.22.1...v1.22.2) (2021-12-22)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -10,11 +10,11 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
10
10
|
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { forwardRef } from 'react';
|
|
14
14
|
import classNames from "classnames";
|
|
15
15
|
import styles from '../../../../scss/css-modules/grid.module.scss';
|
|
16
16
|
|
|
17
|
-
var GridItem = function GridItem(props) {
|
|
17
|
+
var GridItem = function GridItem(props, ref) {
|
|
18
18
|
var children = props.children,
|
|
19
19
|
className = props.className,
|
|
20
20
|
_props$component = props.component,
|
|
@@ -28,8 +28,9 @@ var GridItem = function GridItem(props) {
|
|
|
28
28
|
});
|
|
29
29
|
var gridItemClasses = classNames.apply(void 0, _toConsumableArray(gridSizes).concat([className]));
|
|
30
30
|
return /*#__PURE__*/React.createElement(Component, {
|
|
31
|
+
ref: ref,
|
|
31
32
|
className: gridItemClasses
|
|
32
33
|
}, children);
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
export default GridItem;
|
|
36
|
+
export default /*#__PURE__*/forwardRef(GridItem);
|
|
@@ -12,14 +12,15 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
12
12
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
14
|
|
|
15
|
-
import React from 'react';
|
|
15
|
+
import React, { forwardRef } from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import styles from '../../../../scss/css-modules/grid.module.scss';
|
|
18
18
|
|
|
19
|
-
var Grid = function Grid(props) {
|
|
19
|
+
var Grid = function Grid(props, ref) {
|
|
20
20
|
var _ref;
|
|
21
21
|
|
|
22
22
|
var children = props.children,
|
|
23
|
+
className = props.className,
|
|
23
24
|
_props$component = props.component,
|
|
24
25
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
25
26
|
_props$center = props.center,
|
|
@@ -34,10 +35,11 @@ var Grid = function Grid(props) {
|
|
|
34
35
|
var gridSizes = sizes.split(" ").map(function (size) {
|
|
35
36
|
return styles["".concat(slateGridClassName, "-width-").concat(size)];
|
|
36
37
|
});
|
|
37
|
-
var gridClasses = classNames.apply(void 0, [styles[slateGridClassName]].concat(_toConsumableArray(gridSizes), [(_ref = {}, _defineProperty(_ref, styles
|
|
38
|
+
var gridClasses = classNames.apply(void 0, [styles[slateGridClassName]].concat(_toConsumableArray(gridSizes), [(_ref = {}, _defineProperty(_ref, styles.center, center), _defineProperty(_ref, styles.verticalCenter, verticalCenter), _ref), className, gridClassName]));
|
|
38
39
|
return /*#__PURE__*/React.createElement(Component, {
|
|
40
|
+
ref: ref,
|
|
39
41
|
className: gridClasses
|
|
40
42
|
}, children);
|
|
41
43
|
};
|
|
42
44
|
|
|
43
|
-
export default Grid;
|
|
45
|
+
export default /*#__PURE__*/forwardRef(Grid);
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var _excluded = ["children", "component", "className"
|
|
1
|
+
var _excluded = ["children", "component", "className"];
|
|
2
2
|
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
import Grid from ".";
|
|
10
10
|
import styles from '../../../../scss/css-modules/grid.module.scss';
|
|
11
11
|
|
|
12
|
-
var PaddedGrid = function PaddedGrid(props) {
|
|
12
|
+
var PaddedGrid = function PaddedGrid(props, ref) {
|
|
13
13
|
var children = props.children,
|
|
14
14
|
_props$component = props.component,
|
|
15
15
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
16
16
|
className = props.className,
|
|
17
|
-
gridClassName = props.gridClassName,
|
|
18
17
|
gridProps = _objectWithoutProperties(props, _excluded);
|
|
19
18
|
|
|
20
19
|
var slatePaddedGridClassName = styles.slatePaddedGridClassName;
|
|
21
20
|
var paddedGridClasses = classNames(styles[slatePaddedGridClassName], className);
|
|
22
21
|
return /*#__PURE__*/React.createElement(Component, {
|
|
22
|
+
ref: ref,
|
|
23
23
|
className: paddedGridClasses
|
|
24
24
|
}, /*#__PURE__*/React.createElement(Grid, gridProps, children));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export default PaddedGrid;
|
|
27
|
+
export default /*#__PURE__*/forwardRef(PaddedGrid);
|
|
@@ -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(
|
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
|
);
|
|
@@ -10,14 +10,14 @@ $slate-breakpoints: (
|
|
|
10
10
|
medium: $slate-breakpoints-medium,
|
|
11
11
|
large: $slate-breakpoints-large,
|
|
12
12
|
x-large: $slate-breakpoints-x-large
|
|
13
|
-
);
|
|
13
|
+
) !default;
|
|
14
14
|
|
|
15
15
|
$slate-media-queries: (
|
|
16
16
|
small: screen and (min-width: $slate-breakpoints-small),
|
|
17
17
|
medium: screen and (min-width: $slate-breakpoints-medium),
|
|
18
18
|
large: screen and (min-width: $slate-breakpoints-large),
|
|
19
19
|
x-large: screen and (min-width: $slate-breakpoints-x-large)
|
|
20
|
-
);
|
|
20
|
+
) !default;
|
|
21
21
|
|
|
22
22
|
:export {
|
|
23
23
|
small: $slate-breakpoints-small;
|
|
@@ -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;
|