@atlaskit/rating 0.2.49 → 0.2.51
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 +12 -0
- package/dist/cjs/components/rating-group.js +5 -5
- package/dist/cjs/components/rating.js +7 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/rating-group.js +1 -1
- package/dist/es2019/components/rating.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/rating-group.js +1 -1
- package/dist/esm/components/rating.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/rating-group.d.ts +2 -1
- package/dist/types-ts4.0/components/rating-group.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/rating
|
|
2
2
|
|
|
3
|
+
## 0.2.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`016d3039482`](https://bitbucket.org/atlassian/atlassian-frontend/commits/016d3039482) - Updates `@emotion/core` v10 to `@emotion/react` v11. There is no expected behavior change.
|
|
8
|
+
|
|
9
|
+
## 0.2.50
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.2.49
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -13,7 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
18
|
var _constants = require("@atlaskit/theme/constants");
|
|
19
19
|
|
|
@@ -54,13 +54,13 @@ function RatingGroup(_ref) {
|
|
|
54
54
|
console.error("@atlaskit/rating\nDon't use \"defaultValue\" with \"value\" you're trying to mix uncontrolled and controlled modes.\nUse \"defaultValue\" or \"value\" happy days :-).\n");
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
return (0,
|
|
57
|
+
return (0, _react2.jsx)("div", {
|
|
58
58
|
"data-testid": testId && "".concat(testId, "--root"),
|
|
59
|
-
css: (0,
|
|
60
|
-
}, !firstSelectionMade && (0,
|
|
59
|
+
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n /* Because some children are inline-block we make the font-size zero to eliminate the implicit space between them. */\n font-size: 0;\n\n /* This implementation does some interesting tricks to keep it flowing LTR and ensuring accessibility. */\n /* Instead of it starting in an empty state - it starts filled - and then uses the CSS sibling select \"~\" */\n /* to then display the empty state for the star rating. */\n\n [data-rating-icon-checked] {\n display: inline-block;\n }\n\n [data-rating-icon] {\n display: none;\n }\n\n label:hover\n ~ label\n [data-rating-icon-checked][data-rating-icon-checked],\n input:checked ~ label [data-rating-icon-checked] {\n display: none;\n }\n\n label:hover ~ label [data-rating-icon][data-rating-icon],\n input:checked ~ label [data-rating-icon] {\n display: inline-block;\n }\n\n /* When hovering reset all elements back to filled state. */\n &:hover [data-rating-icon-checked][data-rating-icon-checked] {\n display: inline-block;\n }\n\n &:hover [data-rating-icon][data-rating-icon] {\n display: none;\n }\n "])))
|
|
60
|
+
}, !firstSelectionMade && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("label", {
|
|
61
61
|
css: _constants.visuallyHidden,
|
|
62
62
|
htmlFor: "".concat(groupName, "--empty")
|
|
63
|
-
}), (0,
|
|
63
|
+
}), (0, _react2.jsx)("input", {
|
|
64
64
|
css: _constants.visuallyHidden,
|
|
65
65
|
id: "".concat(groupName, "--empty"),
|
|
66
66
|
"data-testid": testId && "".concat(testId, "--input-empty"),
|
|
@@ -13,7 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
18
|
var _motion = require("@atlaskit/motion");
|
|
19
19
|
|
|
@@ -35,7 +35,7 @@ var Rating = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
35
35
|
var onChangeHandler = (0, _react.useCallback)(function (e) {
|
|
36
36
|
onChange && onChange(e.target.checked ? value : undefined);
|
|
37
37
|
}, [onChange, value]);
|
|
38
|
-
return (0,
|
|
38
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("label", (0, _extends2.default)({}, props, {
|
|
39
39
|
ref: ref,
|
|
40
40
|
htmlFor: id,
|
|
41
41
|
"data-testid": testId && "".concat(testId, "--label"),
|
|
@@ -43,25 +43,25 @@ var Rating = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
43
43
|
transition: "transform ".concat(_motion.smallDurationMs, "ms ").concat(_motion.easeInOut),
|
|
44
44
|
transform: isChecked ? 'scale(1.2)' : undefined
|
|
45
45
|
}
|
|
46
|
-
}), (0,
|
|
46
|
+
}), (0, _react2.jsx)(_tooltip.default, {
|
|
47
47
|
testId: testId && "".concat(testId, "--tooltip"),
|
|
48
48
|
content: label,
|
|
49
49
|
delay: 10
|
|
50
|
-
}, (0,
|
|
50
|
+
}, (0, _react2.jsx)("div", null, (0, _react2.jsx)("span", {
|
|
51
51
|
css: _constants.visuallyHidden
|
|
52
|
-
}, label), (0,
|
|
52
|
+
}, label), (0, _react2.jsx)("span", {
|
|
53
53
|
"aria-hidden": "true",
|
|
54
54
|
"data-rating-icon": true,
|
|
55
55
|
"data-testid": testId && "".concat(testId, "--icon-container")
|
|
56
56
|
}, render({
|
|
57
57
|
isChecked: false
|
|
58
|
-
})), (0,
|
|
58
|
+
})), (0, _react2.jsx)("span", {
|
|
59
59
|
"aria-hidden": "true",
|
|
60
60
|
"data-rating-icon-checked": true,
|
|
61
61
|
"data-testid": testId && "".concat(testId, "--icon-checked-container")
|
|
62
62
|
}, render({
|
|
63
63
|
isChecked: true
|
|
64
|
-
}))))), (0,
|
|
64
|
+
}))))), (0, _react2.jsx)("input", {
|
|
65
65
|
id: id,
|
|
66
66
|
css: _constants.visuallyHidden,
|
|
67
67
|
onChange: onChangeHandler,
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { Children, cloneElement, Fragment, useState } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
6
6
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
7
7
|
|
|
8
8
|
import { visuallyHidden } from '@atlaskit/theme/constants';
|
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { forwardRef, Fragment, useCallback } from 'react';
|
|
7
|
-
import { jsx } from '@emotion/
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
8
8
|
import { easeInOut, smallDurationMs } from '@atlaskit/motion'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
9
9
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
10
10
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,7 +7,7 @@ var _templateObject;
|
|
|
7
7
|
|
|
8
8
|
/** @jsx jsx */
|
|
9
9
|
import { Children, cloneElement, Fragment, useState } from 'react';
|
|
10
|
-
import { css, jsx } from '@emotion/
|
|
10
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
12
12
|
|
|
13
13
|
import { visuallyHidden } from '@atlaskit/theme/constants';
|
|
@@ -6,7 +6,7 @@ var _excluded = ["isChecked", "name", "testId", "label", "id", "value", "onChang
|
|
|
6
6
|
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import { forwardRef, Fragment, useCallback } from 'react';
|
|
9
|
-
import { jsx } from '@emotion/
|
|
9
|
+
import { jsx } from '@emotion/react';
|
|
10
10
|
import { easeInOut, smallDurationMs } from '@atlaskit/motion'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
12
12
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
export interface RatingGroupProps {
|
|
3
4
|
/**
|
|
4
5
|
* Callback that is called everytime the rating changes.
|
|
@@ -46,4 +47,4 @@ export interface RatingGroupProps {
|
|
|
46
47
|
*/
|
|
47
48
|
children: JSX.Element | JSX.Element[];
|
|
48
49
|
}
|
|
49
|
-
export default function RatingGroup({ groupName, onChange, defaultValue, value, testId, children, }: RatingGroupProps): JSX.Element;
|
|
50
|
+
export default function RatingGroup({ groupName, onChange, defaultValue, value, testId, children, }: RatingGroupProps): jsx.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
2
3
|
export interface RatingGroupProps {
|
|
3
4
|
/**
|
|
4
5
|
* Callback that is called everytime the rating changes.
|
|
@@ -46,4 +47,4 @@ export interface RatingGroupProps {
|
|
|
46
47
|
*/
|
|
47
48
|
children: JSX.Element | JSX.Element[];
|
|
48
49
|
}
|
|
49
|
-
export default function RatingGroup({ groupName, onChange, defaultValue, value, testId, children, }: RatingGroupProps): JSX.Element;
|
|
50
|
+
export default function RatingGroup({ groupName, onChange, defaultValue, value, testId, children, }: RatingGroupProps): jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rating",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.51",
|
|
4
4
|
"description": "An accessible rating component that can be heavily customized.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@atlaskit/icon": "^21.11.0",
|
|
35
35
|
"@atlaskit/motion": "^1.3.0",
|
|
36
36
|
"@atlaskit/theme": "^12.2.0",
|
|
37
|
-
"@atlaskit/tokens": "0.10.
|
|
37
|
+
"@atlaskit/tokens": "0.10.35",
|
|
38
38
|
"@atlaskit/tooltip": "^17.6.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
|
-
"@emotion/
|
|
40
|
+
"@emotion/react": "^11.7.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^16.8.0",
|