@atlaskit/heading 5.0.0 → 5.1.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,18 @@
1
1
  # @atlaskit/heading
2
2
 
3
+ ## 5.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#118121](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118121)
8
+ [`4850fa1a503ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4850fa1a503ba) -
9
+ [ux] Automatic color inversion based on bold surfaces will only affect the default color behind a
10
+ feature flag. If testing successful, this change will be made available in a later release.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 5.0.0
4
17
 
5
18
  ### Major Changes
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _primitives = require("@atlaskit/primitives");
16
17
  var _compiled = require("@atlaskit/primitives/compiled");
17
18
  var _headingContext = require("./heading-context");
@@ -56,6 +57,15 @@ var headingSizeStylesMap = {
56
57
 
57
58
  var useColor = function useColor(colorProp) {
58
59
  var surface = (0, _compiled.UNSAFE_useSurface)();
60
+ if ((0, _platformFeatureFlags.fg)('platform-typography-improved-color-control')) {
61
+ if (colorProp) {
62
+ return colorProp;
63
+ }
64
+ if (_primitives.UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
65
+ return _primitives.UNSAFE_inverseColorMap[surface];
66
+ }
67
+ return 'color.text';
68
+ }
59
69
 
60
70
  /**
61
71
  * Where the color of the surface is inverted we always override the color
@@ -3,6 +3,7 @@ import "./heading.partial.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { UNSAFE_inverseColorMap } from '@atlaskit/primitives';
7
8
  import { UNSAFE_useSurface } from '@atlaskit/primitives/compiled';
8
9
  import { useHeading } from './heading-context';
@@ -45,6 +46,15 @@ const headingSizeStylesMap = {
45
46
 
46
47
  const useColor = colorProp => {
47
48
  const surface = UNSAFE_useSurface();
49
+ if (fg('platform-typography-improved-color-control')) {
50
+ if (colorProp) {
51
+ return colorProp;
52
+ }
53
+ if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
54
+ return UNSAFE_inverseColorMap[surface];
55
+ }
56
+ return 'color.text';
57
+ }
48
58
 
49
59
  /**
50
60
  * Where the color of the surface is inverted we always override the color
@@ -4,6 +4,7 @@ import "./heading.partial.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { forwardRef } from 'react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { UNSAFE_inverseColorMap } from '@atlaskit/primitives';
8
9
  import { UNSAFE_useSurface } from '@atlaskit/primitives/compiled';
9
10
  import { useHeading } from './heading-context';
@@ -46,6 +47,15 @@ var headingSizeStylesMap = {
46
47
 
47
48
  var useColor = function useColor(colorProp) {
48
49
  var surface = UNSAFE_useSurface();
50
+ if (fg('platform-typography-improved-color-control')) {
51
+ if (colorProp) {
52
+ return colorProp;
53
+ }
54
+ if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
55
+ return UNSAFE_inverseColorMap[surface];
56
+ }
57
+ return 'color.text';
58
+ }
49
59
 
50
60
  /**
51
61
  * Where the color of the surface is inverted we always override the color
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/heading",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "A heading is a typography component used to display text in different sizes and formats.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,8 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/css": "^0.10.0",
35
- "@atlaskit/primitives": "^14.0.0",
36
- "@atlaskit/tokens": "^4.0.0",
35
+ "@atlaskit/platform-feature-flags": "^1.1.0",
36
+ "@atlaskit/primitives": "^14.1.0",
37
+ "@atlaskit/tokens": "^4.2.0",
37
38
  "@babel/runtime": "^7.0.0",
38
39
  "@compiled/react": "^0.18.2",
39
40
  "@emotion/react": "^11.7.1"
@@ -46,7 +47,7 @@
46
47
  "@af/formatting": "*",
47
48
  "@af/integration-testing": "*",
48
49
  "@af/visual-regression": "*",
49
- "@atlaskit/button": "^21.0.0",
50
+ "@atlaskit/button": "^21.1.0",
50
51
  "@atlaskit/ds-lib": "^4.0.0",
51
52
  "@atlaskit/ssr": "*",
52
53
  "@atlassian/codegen": "^0.1.0",
@@ -86,5 +87,10 @@
86
87
  "af:exports": {
87
88
  ".": "./src/index.tsx"
88
89
  },
89
- "homepage": "https://atlassian.design/components/heading/"
90
+ "homepage": "https://atlassian.design/components/heading/",
91
+ "platform-feature-flags": {
92
+ "platform-typography-improved-color-control": {
93
+ "type": "boolean"
94
+ }
95
+ }
90
96
  }