@atlaskit/range 5.1.0 → 5.1.1

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,12 @@
1
1
  # @atlaskit/range
2
2
 
3
+ ## 5.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
8
+ - Updated dependencies
9
+
3
10
  ## 5.1.0
4
11
 
5
12
  ### Minor Changes
@@ -21,8 +21,6 @@ var _colors = require("@atlaskit/theme/colors");
21
21
 
22
22
  var _constants = require("@atlaskit/theme/constants");
23
23
 
24
- var _tokens = require("@atlaskit/tokens");
25
-
26
24
  var _templateObject;
27
25
 
28
26
  var sliderThumbSize = 16;
@@ -39,7 +37,7 @@ var getBackgroundGradient = function getBackgroundGradient(_ref) {
39
37
  return "\n background: linear-gradient(".concat(lower, ", ").concat(lower, ") 0 / var(--range-inline-width) 100%\n no-repeat ").concat(upper, ";\n [dir='rtl'] & {\n background-position: right;\n }\n ");
40
38
  };
41
39
 
42
- var elevationStyle = (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A)); // Thumb style
40
+ var elevationStyle = "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"); // Thumb style
43
41
 
44
42
  var sliderThumbStyle = function sliderThumbStyle(_ref2) {
45
43
  var thumb = _ref2.thumb;
package/dist/cjs/theme.js CHANGED
@@ -11,37 +11,35 @@ var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
11
 
12
12
  var _components = require("@atlaskit/theme/components");
13
13
 
14
- var _tokens = require("@atlaskit/tokens");
15
-
16
14
  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); }
17
15
 
18
16
  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; }
19
17
 
20
18
  var thumb = {
21
19
  default: {
22
- background: (0, _tokens.token)('color.background.card', colors.N0)
20
+ background: "var(--ds-background-card, ".concat(colors.N0, ")")
23
21
  },
24
22
  disabled: {
25
- boxShadow: (0, _tokens.token)('shadow.card', "0 0 1px ".concat(colors.N60A))
23
+ boxShadow: "var(--ds-card, ".concat("0 0 1px ".concat(colors.N60A), ")")
26
24
  },
27
25
  focus: {
28
- background: (0, _tokens.token)('color.background.boldNeutral.resting', colors.N0),
29
- border: (0, _tokens.token)('color.border.focus', colors.B200)
26
+ background: "var(--ds-background-boldNeutral-resting, ".concat(colors.N0, ")"),
27
+ border: "var(--ds-border-focus, ".concat(colors.B200, ")")
30
28
  }
31
29
  };
32
30
  exports.thumb = thumb;
33
31
  var track = {
34
32
  default: {
35
- lower: (0, _tokens.token)('color.background.boldBrand.resting', colors.B400),
36
- upper: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N30)
33
+ lower: "var(--ds-background-boldBrand-resting, ".concat(colors.B400, ")"),
34
+ upper: "var(--ds-background-subtleNeutral-resting, ".concat(colors.N30, ")")
37
35
  },
38
36
  disabled: {
39
- lower: (0, _tokens.token)('color.text.disabled', colors.N50),
40
- upper: (0, _tokens.token)('color.background.disabled', colors.N30)
37
+ lower: "var(--ds-text-disabled, ".concat(colors.N50, ")"),
38
+ upper: "var(--ds-background-disabled, ".concat(colors.N30, ")")
41
39
  },
42
40
  hover: {
43
- lower: (0, _tokens.token)('color.background.boldBrand.hover', colors.B300),
44
- upper: (0, _tokens.token)('color.background.subtleNeutral.hover', colors.N40)
41
+ lower: "var(--ds-background-boldBrand-hover, ".concat(colors.B300, ")"),
42
+ upper: "var(--ds-background-subtleNeutral-hover, ".concat(colors.N40, ")")
45
43
  }
46
44
  };
47
45
  exports.track = track;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/range",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,6 @@ import { forwardRef, useMemo } from 'react';
7
7
  import { css, jsx } from '@emotion/core';
8
8
  import { N50A, N60A } from '@atlaskit/theme/colors';
9
9
  import { fontFamily } from '@atlaskit/theme/constants';
10
- import { token } from '@atlaskit/tokens';
11
10
  const sliderThumbSize = 16;
12
11
  const sliderThumbBorderThickness = 2;
13
12
  const sliderLineThickness = 4;
@@ -26,7 +25,7 @@ const getBackgroundGradient = ({
26
25
  }
27
26
  `;
28
27
 
29
- const elevationStyle = token('shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`); // Thumb style
28
+ const elevationStyle = `var(--ds-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`; // Thumb style
30
29
 
31
30
  const sliderThumbStyle = ({
32
31
  thumb
@@ -1,30 +1,29 @@
1
1
  import * as colors from '@atlaskit/theme/colors';
2
2
  import { createTheme } from '@atlaskit/theme/components';
3
- import { token } from '@atlaskit/tokens';
4
3
  export const thumb = {
5
4
  default: {
6
- background: token('color.background.card', colors.N0)
5
+ background: `var(--ds-background-card, ${colors.N0})`
7
6
  },
8
7
  disabled: {
9
- boxShadow: token('shadow.card', `0 0 1px ${colors.N60A}`)
8
+ boxShadow: `var(--ds-card, ${`0 0 1px ${colors.N60A}`})`
10
9
  },
11
10
  focus: {
12
- background: token('color.background.boldNeutral.resting', colors.N0),
13
- border: token('color.border.focus', colors.B200)
11
+ background: `var(--ds-background-boldNeutral-resting, ${colors.N0})`,
12
+ border: `var(--ds-border-focus, ${colors.B200})`
14
13
  }
15
14
  };
16
15
  export const track = {
17
16
  default: {
18
- lower: token('color.background.boldBrand.resting', colors.B400),
19
- upper: token('color.background.subtleNeutral.resting', colors.N30)
17
+ lower: `var(--ds-background-boldBrand-resting, ${colors.B400})`,
18
+ upper: `var(--ds-background-subtleNeutral-resting, ${colors.N30})`
20
19
  },
21
20
  disabled: {
22
- lower: token('color.text.disabled', colors.N50),
23
- upper: token('color.background.disabled', colors.N30)
21
+ lower: `var(--ds-text-disabled, ${colors.N50})`,
22
+ upper: `var(--ds-background-disabled, ${colors.N30})`
24
23
  },
25
24
  hover: {
26
- lower: token('color.background.boldBrand.hover', colors.B300),
27
- upper: token('color.background.subtleNeutral.hover', colors.N40)
25
+ lower: `var(--ds-background-boldBrand-hover, ${colors.B300})`,
26
+ upper: `var(--ds-background-subtleNeutral-hover, ${colors.N40})`
28
27
  }
29
28
  };
30
29
  export const Theme = createTheme(() => ({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/range",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,6 @@ import { forwardRef, useMemo } from 'react';
11
11
  import { css, jsx } from '@emotion/core';
12
12
  import { N50A, N60A } from '@atlaskit/theme/colors';
13
13
  import { fontFamily } from '@atlaskit/theme/constants';
14
- import { token } from '@atlaskit/tokens';
15
14
  var sliderThumbSize = 16;
16
15
  var sliderThumbBorderThickness = 2;
17
16
  var sliderLineThickness = 4;
@@ -25,7 +24,7 @@ var getBackgroundGradient = function getBackgroundGradient(_ref) {
25
24
  return "\n background: linear-gradient(".concat(lower, ", ").concat(lower, ") 0 / var(--range-inline-width) 100%\n no-repeat ").concat(upper, ";\n [dir='rtl'] & {\n background-position: right;\n }\n ");
26
25
  };
27
26
 
28
- var elevationStyle = token('shadow.overlay', "0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A)); // Thumb style
27
+ var elevationStyle = "var(--ds-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"); // Thumb style
29
28
 
30
29
  var sliderThumbStyle = function sliderThumbStyle(_ref2) {
31
30
  var thumb = _ref2.thumb;
package/dist/esm/theme.js CHANGED
@@ -1,30 +1,29 @@
1
1
  import * as colors from '@atlaskit/theme/colors';
2
2
  import { createTheme } from '@atlaskit/theme/components';
3
- import { token } from '@atlaskit/tokens';
4
3
  export var thumb = {
5
4
  default: {
6
- background: token('color.background.card', colors.N0)
5
+ background: "var(--ds-background-card, ".concat(colors.N0, ")")
7
6
  },
8
7
  disabled: {
9
- boxShadow: token('shadow.card', "0 0 1px ".concat(colors.N60A))
8
+ boxShadow: "var(--ds-card, ".concat("0 0 1px ".concat(colors.N60A), ")")
10
9
  },
11
10
  focus: {
12
- background: token('color.background.boldNeutral.resting', colors.N0),
13
- border: token('color.border.focus', colors.B200)
11
+ background: "var(--ds-background-boldNeutral-resting, ".concat(colors.N0, ")"),
12
+ border: "var(--ds-border-focus, ".concat(colors.B200, ")")
14
13
  }
15
14
  };
16
15
  export var track = {
17
16
  default: {
18
- lower: token('color.background.boldBrand.resting', colors.B400),
19
- upper: token('color.background.subtleNeutral.resting', colors.N30)
17
+ lower: "var(--ds-background-boldBrand-resting, ".concat(colors.B400, ")"),
18
+ upper: "var(--ds-background-subtleNeutral-resting, ".concat(colors.N30, ")")
20
19
  },
21
20
  disabled: {
22
- lower: token('color.text.disabled', colors.N50),
23
- upper: token('color.background.disabled', colors.N30)
21
+ lower: "var(--ds-text-disabled, ".concat(colors.N50, ")"),
22
+ upper: "var(--ds-background-disabled, ".concat(colors.N30, ")")
24
23
  },
25
24
  hover: {
26
- lower: token('color.background.boldBrand.hover', colors.B300),
27
- upper: token('color.background.subtleNeutral.hover', colors.N40)
25
+ lower: "var(--ds-background-boldBrand-hover, ".concat(colors.B300, ")"),
26
+ upper: "var(--ds-background-subtleNeutral-hover, ".concat(colors.N40, ")")
28
27
  }
29
28
  };
30
29
  export var Theme = createTheme(function () {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/range",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/range",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "A range lets users choose an approximate value on a slider.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@atlaskit/theme": "^12.0.0",
29
- "@atlaskit/tokens": "^0.3.0",
29
+ "@atlaskit/tokens": "^0.4.0",
30
30
  "@babel/runtime": "^7.0.0",
31
31
  "@emotion/core": "^10.0.9"
32
32
  },
@@ -73,4 +73,4 @@
73
73
  }
74
74
  },
75
75
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
76
- }
76
+ }