@atlaskit/rating 2.0.4 → 3.0.0
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
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/rating
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#130517](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130517)
|
|
8
|
+
[`a754431f04095`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a754431f04095) -
|
|
9
|
+
[ux] Iconography uplift with new spacing prop
|
|
10
|
+
|
|
11
|
+
## 2.0.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 2.0.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -9,11 +9,11 @@ exports.default = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var _starStarredStarFilled = _interopRequireDefault(require("@atlaskit/icon/core/migration/star-starred--star-filled"));
|
|
13
|
+
var _starUnstarredStar = _interopRequireDefault(require("@atlaskit/icon/core/migration/star-unstarred--star"));
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
var _rating = _interopRequireDefault(require("./rating"));
|
|
16
|
-
var _excluded = ["size", "color"];
|
|
16
|
+
var _excluded = ["size", "color", "spacing"];
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
var Star = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
@@ -21,24 +21,30 @@ var Star = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
21
21
|
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
22
22
|
_ref$color = _ref.color,
|
|
23
23
|
color = _ref$color === void 0 ? "var(--ds-icon-accent-yellow, ".concat(_colors.Y200, ")") : _ref$color,
|
|
24
|
+
_ref$spacing = _ref.spacing,
|
|
25
|
+
spacing = _ref$spacing === void 0 ? 'spacious' : _ref$spacing,
|
|
24
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
27
|
var render = (0, _react.useCallback)(function (props) {
|
|
26
28
|
return props.isChecked ?
|
|
27
29
|
/*#__PURE__*/
|
|
28
30
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
29
|
-
_react.default.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
_react.default.createElement(_starStarredStarFilled.default, {
|
|
32
|
+
LEGACY_size: size,
|
|
33
|
+
LEGACY_primaryColor: color,
|
|
34
|
+
color: color,
|
|
35
|
+
spacing: spacing,
|
|
32
36
|
label: ""
|
|
33
37
|
}) :
|
|
34
38
|
/*#__PURE__*/
|
|
35
39
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
36
|
-
_react.default.createElement(
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
_react.default.createElement(_starUnstarredStar.default, {
|
|
41
|
+
LEGACY_size: size,
|
|
42
|
+
LEGACY_primaryColor: color,
|
|
43
|
+
color: color,
|
|
44
|
+
spacing: spacing,
|
|
39
45
|
label: ""
|
|
40
46
|
});
|
|
41
|
-
}, [color, size]);
|
|
47
|
+
}, [color, size, spacing]);
|
|
42
48
|
return /*#__PURE__*/_react.default.createElement(_rating.default, (0, _extends2.default)({}, props, {
|
|
43
49
|
ref: ref,
|
|
44
50
|
render: render
|
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, useCallback } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import StarStarredIcon from '@atlaskit/icon/core/migration/star-starred--star-filled';
|
|
4
|
+
import StarUnstarredIcon from '@atlaskit/icon/core/migration/star-unstarred--star';
|
|
5
5
|
import { Y200 } from '@atlaskit/theme/colors';
|
|
6
6
|
import Rating from './rating';
|
|
7
7
|
const Star = /*#__PURE__*/forwardRef(({
|
|
8
8
|
size = 'large',
|
|
9
9
|
color = `var(--ds-icon-accent-yellow, ${Y200})`,
|
|
10
|
+
spacing = 'spacious',
|
|
10
11
|
...props
|
|
11
12
|
}, ref) => {
|
|
12
13
|
const render = useCallback(props => {
|
|
13
14
|
return props.isChecked ?
|
|
14
15
|
/*#__PURE__*/
|
|
15
16
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
16
|
-
React.createElement(
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
React.createElement(StarStarredIcon, {
|
|
18
|
+
LEGACY_size: size,
|
|
19
|
+
LEGACY_primaryColor: color,
|
|
20
|
+
color: color,
|
|
21
|
+
spacing: spacing,
|
|
19
22
|
label: ""
|
|
20
23
|
}) :
|
|
21
24
|
/*#__PURE__*/
|
|
22
25
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
23
|
-
React.createElement(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
React.createElement(StarUnstarredIcon, {
|
|
27
|
+
LEGACY_size: size,
|
|
28
|
+
LEGACY_primaryColor: color,
|
|
29
|
+
color: color,
|
|
30
|
+
spacing: spacing,
|
|
26
31
|
label: ""
|
|
27
32
|
});
|
|
28
|
-
}, [color, size]);
|
|
33
|
+
}, [color, size, spacing]);
|
|
29
34
|
return /*#__PURE__*/React.createElement(Rating, _extends({}, props, {
|
|
30
35
|
ref: ref,
|
|
31
36
|
render: render
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "color"];
|
|
3
|
+
var _excluded = ["size", "color", "spacing"];
|
|
4
4
|
import React, { forwardRef, useCallback } from 'react';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import StarStarredIcon from '@atlaskit/icon/core/migration/star-starred--star-filled';
|
|
6
|
+
import StarUnstarredIcon from '@atlaskit/icon/core/migration/star-unstarred--star';
|
|
7
7
|
import { Y200 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Rating from './rating';
|
|
9
9
|
var Star = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -11,24 +11,30 @@ var Star = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
11
11
|
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
12
12
|
_ref$color = _ref.color,
|
|
13
13
|
color = _ref$color === void 0 ? "var(--ds-icon-accent-yellow, ".concat(Y200, ")") : _ref$color,
|
|
14
|
+
_ref$spacing = _ref.spacing,
|
|
15
|
+
spacing = _ref$spacing === void 0 ? 'spacious' : _ref$spacing,
|
|
14
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
17
|
var render = useCallback(function (props) {
|
|
16
18
|
return props.isChecked ?
|
|
17
19
|
/*#__PURE__*/
|
|
18
20
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
19
|
-
React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
React.createElement(StarStarredIcon, {
|
|
22
|
+
LEGACY_size: size,
|
|
23
|
+
LEGACY_primaryColor: color,
|
|
24
|
+
color: color,
|
|
25
|
+
spacing: spacing,
|
|
22
26
|
label: ""
|
|
23
27
|
}) :
|
|
24
28
|
/*#__PURE__*/
|
|
25
29
|
// Labels are set inside Rating - blank them out here to not double up.
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
React.createElement(StarUnstarredIcon, {
|
|
31
|
+
LEGACY_size: size,
|
|
32
|
+
LEGACY_primaryColor: color,
|
|
33
|
+
color: color,
|
|
34
|
+
spacing: spacing,
|
|
29
35
|
label: ""
|
|
30
36
|
});
|
|
31
|
-
}, [color, size]);
|
|
37
|
+
}, [color, size, spacing]);
|
|
32
38
|
return /*#__PURE__*/React.createElement(Rating, _extends({}, props, {
|
|
33
39
|
ref: ref,
|
|
34
40
|
render: render
|
|
@@ -14,6 +14,12 @@ export interface StarProps extends RatingProps {
|
|
|
14
14
|
* Defaults to `colors.Y200`.
|
|
15
15
|
*/
|
|
16
16
|
color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Spacing between the star and the text.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to `"spacious"`.
|
|
21
|
+
*/
|
|
22
|
+
spacing?: 'none' | 'spacious';
|
|
17
23
|
}
|
|
18
24
|
declare const Star: React.ForwardRefExoticComponent<StarProps & React.RefAttributes<HTMLLabelElement>>;
|
|
19
25
|
export default Star;
|
|
@@ -14,6 +14,12 @@ export interface StarProps extends RatingProps {
|
|
|
14
14
|
* Defaults to `colors.Y200`.
|
|
15
15
|
*/
|
|
16
16
|
color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Spacing between the star and the text.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to `"spacious"`.
|
|
21
|
+
*/
|
|
22
|
+
spacing?: 'none' | 'spacious';
|
|
17
23
|
}
|
|
18
24
|
declare const Star: React.ForwardRefExoticComponent<StarProps & React.RefAttributes<HTMLLabelElement>>;
|
|
19
25
|
export default Star;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rating",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "An accessible rating component that can be heavily customized.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"runReact18": true
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/icon": "^
|
|
36
|
-
"@atlaskit/motion": "^5.
|
|
35
|
+
"@atlaskit/icon": "^25.0.0",
|
|
36
|
+
"@atlaskit/motion": "^5.1.0",
|
|
37
37
|
"@atlaskit/theme": "^18.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^4.
|
|
38
|
+
"@atlaskit/tokens": "^4.5.0",
|
|
39
39
|
"@atlaskit/tooltip": "^20.0.0",
|
|
40
40
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-dom": "^18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@atlaskit/visual-regression": "
|
|
49
|
+
"@atlaskit/visual-regression": "^0.10.0",
|
|
50
50
|
"@testing-library/react": "^13.4.0",
|
|
51
51
|
"typescript": "~5.4.2"
|
|
52
52
|
},
|