@atlaskit/rating 0.1.8 → 0.2.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,30 @@
1
1
  # @atlaskit/rating
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`36130d571ed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36130d571ed) - [ux] Instrumented rating with the new theming package, `@atlaskit/tokens`.
8
+
9
+ New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
10
+ These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 0.1.10
17
+
18
+ ### Patch Changes
19
+
20
+ - [`e1901ffa79d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e1901ffa79d) - Internal changes to disable linting rules.
21
+
22
+ ## 0.1.9
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 0.1.8
4
29
 
5
30
  ### Patch Changes
@@ -21,7 +21,7 @@ var _constants = require("@atlaskit/theme/constants");
21
21
 
22
22
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
23
23
 
24
- /** @jsx jsx */
24
+ var _excluded = ["isChecked", "name", "testId", "label", "id", "value", "onChange", "render"];
25
25
  var Rating = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
26
26
  var isChecked = _ref.isChecked,
27
27
  name = _ref.name,
@@ -31,7 +31,7 @@ var Rating = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
31
31
  value = _ref.value,
32
32
  onChange = _ref.onChange,
33
33
  render = _ref.render,
34
- props = (0, _objectWithoutProperties2.default)(_ref, ["isChecked", "name", "testId", "label", "id", "value", "onChange", "render"]);
34
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
35
35
  var onChangeHandler = (0, _react.useCallback)(function (e) {
36
36
  onChange && onChange(e.target.checked ? value : undefined);
37
37
  }, [onChange, value]);
@@ -23,6 +23,8 @@ var _colors = require("@atlaskit/theme/colors");
23
23
 
24
24
  var _rating = _interopRequireDefault(require("./rating"));
25
25
 
26
+ var _excluded = ["size", "color"];
27
+
26
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
29
 
28
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -31,8 +33,8 @@ var Star = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
31
33
  var _ref$size = _ref.size,
32
34
  size = _ref$size === void 0 ? 'large' : _ref$size,
33
35
  _ref$color = _ref.color,
34
- color = _ref$color === void 0 ? _colors.Y200 : _ref$color,
35
- props = (0, _objectWithoutProperties2.default)(_ref, ["size", "color"]);
36
+ color = _ref$color === void 0 ? "var(--ds-icon-accent-yellow, ".concat(_colors.Y200, ")") : _ref$color,
37
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
38
  var render = (0, _react.useCallback)(function (props) {
37
39
  return props.isChecked ?
38
40
  /*#__PURE__*/
package/dist/cjs/index.js CHANGED
@@ -5,22 +5,22 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- Object.defineProperty(exports, "RatingGroup", {
8
+ Object.defineProperty(exports, "Rating", {
9
9
  enumerable: true,
10
10
  get: function get() {
11
- return _ratingGroup.default;
11
+ return _rating.default;
12
12
  }
13
13
  });
14
- Object.defineProperty(exports, "Star", {
14
+ Object.defineProperty(exports, "RatingGroup", {
15
15
  enumerable: true,
16
16
  get: function get() {
17
- return _star.default;
17
+ return _ratingGroup.default;
18
18
  }
19
19
  });
20
- Object.defineProperty(exports, "Rating", {
20
+ Object.defineProperty(exports, "Star", {
21
21
  enumerable: true,
22
22
  get: function get() {
23
- return _rating.default;
23
+ return _star.default;
24
24
  }
25
25
  });
26
26
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/rating",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,10 @@
1
+ /* eslint-disable @atlaskit/design-system/use-visually-hidden */
2
+
1
3
  /** @jsx jsx */
2
4
  import { Children, cloneElement, Fragment, useState } from 'react';
3
- import { css, jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/core'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
6
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
7
+
4
8
  import { visuallyHidden } from '@atlaskit/theme/constants';
5
9
  export default function RatingGroup({
6
10
  groupName = 'ak--rating-group',
@@ -1,9 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
+ /* eslint-disable @atlaskit/design-system/use-visually-hidden */
4
+
3
5
  /** @jsx jsx */
4
6
  import { forwardRef, Fragment, useCallback } from 'react';
5
7
  import { jsx } from '@emotion/core';
6
- import { easeInOut, smallDurationMs } from '@atlaskit/motion';
8
+ import { easeInOut, smallDurationMs } from '@atlaskit/motion'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
9
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
10
+
7
11
  import { visuallyHidden } from '@atlaskit/theme/constants';
8
12
  import Tooltip from '@atlaskit/tooltip';
9
13
  const Rating = /*#__PURE__*/forwardRef(({
@@ -6,7 +6,7 @@ import { Y200 } from '@atlaskit/theme/colors';
6
6
  import Rating from './rating';
7
7
  const Star = /*#__PURE__*/forwardRef(({
8
8
  size = 'large',
9
- color = Y200,
9
+ color = `var(--ds-icon-accent-yellow, ${Y200})`,
10
10
  ...props
11
11
  }, ref) => {
12
12
  const render = useCallback(props => {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/rating",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -3,9 +3,13 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
 
4
4
  var _templateObject;
5
5
 
6
+ /* eslint-disable @atlaskit/design-system/use-visually-hidden */
7
+
6
8
  /** @jsx jsx */
7
9
  import { Children, cloneElement, Fragment, useState } from 'react';
8
- import { css, jsx } from '@emotion/core';
10
+ import { css, jsx } from '@emotion/core'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
11
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
12
+
9
13
  import { visuallyHidden } from '@atlaskit/theme/constants';
10
14
  export default function RatingGroup(_ref) {
11
15
  var _ref$groupName = _ref.groupName,
@@ -1,10 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["isChecked", "name", "testId", "label", "id", "value", "onChange", "render"];
4
+
5
+ /* eslint-disable @atlaskit/design-system/use-visually-hidden */
3
6
 
4
7
  /** @jsx jsx */
5
8
  import { forwardRef, Fragment, useCallback } from 'react';
6
9
  import { jsx } from '@emotion/core';
7
- import { easeInOut, smallDurationMs } from '@atlaskit/motion';
10
+ import { easeInOut, smallDurationMs } from '@atlaskit/motion'; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
11
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
12
+
8
13
  import { visuallyHidden } from '@atlaskit/theme/constants';
9
14
  import Tooltip from '@atlaskit/tooltip';
10
15
  var Rating = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -16,7 +21,7 @@ var Rating = /*#__PURE__*/forwardRef(function (_ref, ref) {
16
21
  value = _ref.value,
17
22
  onChange = _ref.onChange,
18
23
  render = _ref.render,
19
- props = _objectWithoutProperties(_ref, ["isChecked", "name", "testId", "label", "id", "value", "onChange", "render"]);
24
+ props = _objectWithoutProperties(_ref, _excluded);
20
25
 
21
26
  var onChangeHandler = useCallback(function (e) {
22
27
  onChange && onChange(e.target.checked ? value : undefined);
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["size", "color"];
3
4
  import React, { forwardRef, useCallback } from 'react';
4
5
  import StarIcon from '@atlaskit/icon/glyph/star';
5
6
  import StarFilledIcon from '@atlaskit/icon/glyph/star-filled';
@@ -9,8 +10,8 @@ var Star = /*#__PURE__*/forwardRef(function (_ref, ref) {
9
10
  var _ref$size = _ref.size,
10
11
  size = _ref$size === void 0 ? 'large' : _ref$size,
11
12
  _ref$color = _ref.color,
12
- color = _ref$color === void 0 ? Y200 : _ref$color,
13
- props = _objectWithoutProperties(_ref, ["size", "color"]);
13
+ color = _ref$color === void 0 ? "var(--ds-icon-accent-yellow, ".concat(Y200, ")") : _ref$color,
14
+ props = _objectWithoutProperties(_ref, _excluded);
14
15
 
15
16
  var render = useCallback(function (props) {
16
17
  return props.isChecked ?
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/rating",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface RatingGroupProps {
2
3
  /**
3
4
  * Callback that is called everytime the rating changes.
@@ -1,4 +1,4 @@
1
- import { InternalRatingProps } from './rating';
1
+ import { InternalRatingProps } from '../components/rating';
2
2
  /**
3
3
  * This gets around extract-react-types not supporting forwardRef.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { StarProps } from './star';
1
+ import { StarProps } from '../components/star';
2
2
  /**
3
3
  * This gets around extract-react-types not supporting forwardRef.
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rating",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "An accessible rating component that can be heavily customized.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -17,17 +17,17 @@
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
19
  "deprecatedAutoEntryPoints": true,
20
- "inPublicMirror": true,
21
20
  "releaseModel": "scheduled",
22
21
  "website": {
23
22
  "name": "Rating"
24
23
  }
25
24
  },
26
25
  "dependencies": {
27
- "@atlaskit/icon": "^21.1.0",
26
+ "@atlaskit/icon": "^21.10.0",
28
27
  "@atlaskit/motion": "^1.0.0",
29
- "@atlaskit/theme": "^11.3.0",
30
- "@atlaskit/tooltip": "^17.0.0",
28
+ "@atlaskit/theme": "^12.1.0",
29
+ "@atlaskit/tokens": "0.7.0",
30
+ "@atlaskit/tooltip": "^17.5.0",
31
31
  "@babel/runtime": "^7.0.0",
32
32
  "@emotion/core": "^10.0.9"
33
33
  },
@@ -36,7 +36,7 @@
36
36
  "react-dom": "^16.8.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@atlaskit/button": "^15.1.0",
39
+ "@atlaskit/button": "^16.2.0",
40
40
  "@atlaskit/docs": "*",
41
41
  "@atlaskit/ssr": "*",
42
42
  "@atlaskit/visual-regression": "*",
@@ -47,6 +47,13 @@
47
47
  "techstack": {
48
48
  "@atlassian/frontend": {
49
49
  "import-structure": "atlassian-conventions"
50
+ },
51
+ "@repo/internal": {
52
+ "theming": "tokens",
53
+ "deprecation": "no-deprecated-imports",
54
+ "styling": [
55
+ "emotion"
56
+ ]
50
57
  }
51
58
  },
52
59
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"