@atlaskit/heading 4.3.1 → 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,36 @@
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
+
16
+ ## 5.0.0
17
+
18
+ ### Major Changes
19
+
20
+ - [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
21
+ [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
22
+ This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
23
+ status of only supporting React 18 going forward. No explicit breaking change to React support has
24
+ been made in this release, but this is to signify going forward, breaking changes for React 16 or
25
+ React 17 may come via non-major semver releases.
26
+
27
+ Please refer this community post for more details:
28
+ https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+
3
34
  ## 4.3.1
4
35
 
5
36
  ### Patch 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": "4.3.1",
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/"
@@ -31,23 +31,24 @@
31
31
  "codegen": "ts-node ./scripts/codegen.tsx"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/css": "^0.9.0",
35
- "@atlaskit/primitives": "^13.6.0",
36
- "@atlaskit/tokens": "^3.3.0",
34
+ "@atlaskit/css": "^0.10.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"
40
41
  },
41
42
  "peerDependencies": {
42
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
43
+ "react": "^18.2.0"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@af/accessibility-testing": "*",
46
47
  "@af/formatting": "*",
47
48
  "@af/integration-testing": "*",
48
49
  "@af/visual-regression": "*",
49
- "@atlaskit/button": "^20.5.0",
50
- "@atlaskit/ds-lib": "^3.5.0",
50
+ "@atlaskit/button": "^21.1.0",
51
+ "@atlaskit/ds-lib": "^4.0.0",
51
52
  "@atlaskit/ssr": "*",
52
53
  "@atlassian/codegen": "^0.1.0",
53
54
  "@testing-library/react": "^13.4.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
  }