@atlaskit/heading 5.1.1 → 5.2.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,24 @@
1
1
  # @atlaskit/heading
2
2
 
3
+ ## 5.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#138526](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138526)
14
+ [`1c66b8e32f30a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c66b8e32f30a) -
15
+ [ux] Removed feature flag `platform-typography-improved-color-control` resulting in automatic
16
+ color inversion based on bold surfaces will only affect the default color.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 5.1.1
4
23
 
5
24
  ### Patch Changes
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.useHeading = exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
10
  // Allows support for heading levels 1-9 via aria-level
12
11
 
13
12
  var HeadingLevelContext = /*#__PURE__*/(0, _react.createContext)(0);
@@ -12,12 +12,10 @@ 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");
16
15
  var _primitives = require("@atlaskit/primitives");
17
16
  var _compiled = require("@atlaskit/primitives/compiled");
18
17
  var _headingContext = require("./heading-context");
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
21
19
  var sizeTagMap = {
22
20
  xxlarge: 'h1',
23
21
  xlarge: 'h1',
@@ -57,24 +55,13 @@ var headingSizeStylesMap = {
57
55
 
58
56
  var useColor = function useColor(colorProp) {
59
57
  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';
58
+ if (colorProp) {
59
+ return colorProp;
68
60
  }
69
-
70
- /**
71
- * Where the color of the surface is inverted we always override the color
72
- * as there is no valid choice that is not covered by the override.
73
- */
74
61
  if (_primitives.UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
75
62
  return _primitives.UNSAFE_inverseColorMap[surface];
76
63
  }
77
- return colorProp || 'color.text';
64
+ return 'color.text';
78
65
  };
79
66
 
80
67
  /**
@@ -3,7 +3,6 @@ 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';
7
6
  import { UNSAFE_inverseColorMap } from '@atlaskit/primitives';
8
7
  import { UNSAFE_useSurface } from '@atlaskit/primitives/compiled';
9
8
  import { useHeading } from './heading-context';
@@ -46,24 +45,13 @@ const headingSizeStylesMap = {
46
45
 
47
46
  const useColor = colorProp => {
48
47
  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';
48
+ if (colorProp) {
49
+ return colorProp;
57
50
  }
58
-
59
- /**
60
- * Where the color of the surface is inverted we always override the color
61
- * as there is no valid choice that is not covered by the override.
62
- */
63
51
  if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
64
52
  return UNSAFE_inverseColorMap[surface];
65
53
  }
66
- return colorProp || 'color.text';
54
+ return 'color.text';
67
55
  };
68
56
 
69
57
  /**
@@ -4,7 +4,6 @@ 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';
8
7
  import { UNSAFE_inverseColorMap } from '@atlaskit/primitives';
9
8
  import { UNSAFE_useSurface } from '@atlaskit/primitives/compiled';
10
9
  import { useHeading } from './heading-context';
@@ -47,24 +46,13 @@ var headingSizeStylesMap = {
47
46
 
48
47
  var useColor = function useColor(colorProp) {
49
48
  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';
49
+ if (colorProp) {
50
+ return colorProp;
58
51
  }
59
-
60
- /**
61
- * Where the color of the surface is inverted we always override the color
62
- * as there is no valid choice that is not covered by the override.
63
- */
64
52
  if (UNSAFE_inverseColorMap.hasOwnProperty(surface)) {
65
53
  return UNSAFE_inverseColorMap[surface];
66
54
  }
67
- return colorProp || 'color.text';
55
+ return 'color.text';
68
56
  };
69
57
 
70
58
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/heading",
3
- "version": "5.1.1",
3
+ "version": "5.2.1",
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,9 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/css": "^0.10.0",
35
- "@atlaskit/platform-feature-flags": "^1.1.0",
36
- "@atlaskit/primitives": "^14.2.0",
37
- "@atlaskit/tokens": "^4.5.0",
35
+ "@atlaskit/primitives": "^14.8.0",
36
+ "@atlaskit/tokens": "^5.0.0",
38
37
  "@babel/runtime": "^7.0.0",
39
38
  "@compiled/react": "^0.18.3"
40
39
  },
@@ -42,14 +41,16 @@
42
41
  "react": "^18.2.0"
43
42
  },
44
43
  "devDependencies": {
45
- "@af/accessibility-testing": "^2.0.0",
46
- "@af/formatting": "^0.0.4",
47
- "@af/integration-testing": "^0.5.0",
48
- "@af/visual-regression": "^1.3.0",
49
- "@atlaskit/button": "^21.1.0",
44
+ "@af/accessibility-testing": "workspace:^",
45
+ "@af/formatting": "workspace:^",
46
+ "@af/integration-testing": "workspace:^",
47
+ "@af/visual-regression": "workspace:^",
48
+ "@atlaskit/button": "^23.2.0",
49
+ "@atlaskit/docs": "^10.0.0",
50
50
  "@atlaskit/ds-lib": "^4.0.0",
51
- "@atlaskit/ssr": "^0.4.0",
51
+ "@atlaskit/ssr": "workspace:^",
52
52
  "@atlassian/codegen": "^0.1.0",
53
+ "@atlassian/ssr-tests": "^0.2.0",
53
54
  "@testing-library/react": "^13.4.0",
54
55
  "react-dom": "^18.2.0",
55
56
  "ts-node": "^10.9.1",
@@ -87,10 +88,5 @@
87
88
  "af:exports": {
88
89
  ".": "./src/index.tsx"
89
90
  },
90
- "homepage": "https://atlassian.design/components/heading/",
91
- "platform-feature-flags": {
92
- "platform-typography-improved-color-control": {
93
- "type": "boolean"
94
- }
95
- }
91
+ "homepage": "https://atlassian.design/components/heading/"
96
92
  }