@atlaskit/heading 1.7.0 → 1.8.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
+ ## 1.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#80528](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80528) [`8877e9b57d55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8877e9b57d55) - Added `size` prop which will replace `variant` prop in the next major version.
8
+
9
+ ## 1.7.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#80805](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80805) [`427c2dd9e0d6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/427c2dd9e0d6) - Update input border color token and width to meet 3:1 color contrast
14
+ - Updated dependencies
15
+
3
16
  ## 1.7.0
4
17
 
5
18
  ### Minor Changes
@@ -17,12 +17,12 @@ export default function transformer(
17
17
  return;
18
18
  }
19
19
 
20
- replaceLevelWithVariant(j, base, headingSpecifier);
20
+ replaceLevelWithSize(j, base, headingSpecifier);
21
21
 
22
22
  return base.toSource();
23
23
  }
24
24
 
25
- const levelToVariantMap = {
25
+ const levelToSizeMap = {
26
26
  h900: 'xxlarge',
27
27
  h800: 'xlarge',
28
28
  h700: 'large',
@@ -35,7 +35,7 @@ const levelToVariantMap = {
35
35
  // h100: 'xxsmall',
36
36
  };
37
37
 
38
- function replaceLevelWithVariant(
38
+ function replaceLevelWithSize(
39
39
  j: core.JSCodeshift,
40
40
  source: ReturnType<typeof j>,
41
41
  specifier: string,
@@ -47,13 +47,11 @@ function replaceLevelWithVariant(
47
47
  const attrValue = j(attr).nodes()[0].value;
48
48
  if (attrValue.type === 'StringLiteral') {
49
49
  const replacementValue =
50
- levelToVariantMap[
51
- attrValue.value as keyof typeof levelToVariantMap
52
- ];
50
+ levelToSizeMap[attrValue.value as keyof typeof levelToSizeMap];
53
51
  if (replacementValue) {
54
52
  j(attr).replaceWith(
55
53
  j.jsxAttribute(
56
- j.jsxIdentifier('variant'),
54
+ j.jsxIdentifier('size'),
57
55
  j.stringLiteral(replacementValue),
58
56
  ),
59
57
  );
@@ -1,12 +1,12 @@
1
1
  jest.autoMockOff();
2
2
 
3
- import transformer from '../1.6.0-level-to-variant';
3
+ import transformer from '../1.6.0-level-to-size';
4
4
 
5
5
  import { check } from './_framework';
6
6
 
7
7
  check({
8
8
  transformer,
9
- it: 'should replace level with variant only on Heading component',
9
+ it: 'should replace level with size only on Heading component',
10
10
  original: `
11
11
  import Heading from '@atlaskit/heading';
12
12
 
@@ -22,7 +22,7 @@ check({
22
22
 
23
23
  function App() {
24
24
  return <>
25
- <Heading variant="large" as="h3">hello</Heading>
25
+ <Heading size="large" as="h3">hello</Heading>
26
26
  <SomethingElse level="h700">still here</SomethingElse>
27
27
  </>;
28
28
  }
@@ -48,7 +48,7 @@ check({
48
48
 
49
49
  function App() {
50
50
  return <>
51
- <Heading variant="xxsmall">hello</Heading>
51
+ <Heading size="xxsmall">hello</Heading>
52
52
  <Heading level="h200">hello</Heading>
53
53
  <Heading level="h100">hello</Heading>
54
54
  </>;
@@ -58,13 +58,13 @@ check({
58
58
 
59
59
  check({
60
60
  transformer,
61
- it: 'should do nothing if variant already exists',
61
+ it: 'should do nothing if size already exists',
62
62
  original: `
63
63
  import Heading from '@atlaskit/heading';
64
64
 
65
65
  function App() {
66
66
  return <>
67
- <Heading variant="large">hello</Heading>
67
+ <Heading size="large">hello</Heading>
68
68
  </>;
69
69
  }
70
70
  `,
@@ -73,7 +73,7 @@ check({
73
73
 
74
74
  function App() {
75
75
  return <>
76
- <Heading variant="large">hello</Heading>
76
+ <Heading size="large">hello</Heading>
77
77
  </>;
78
78
  }
79
79
  `,
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("@emotion/react");
12
12
  var _headingContext = require("./heading-context");
13
13
  var _heading = _interopRequireDefault(require("./heading.partial"));
14
- var _excluded = ["level", "variant"];
14
+ var _excluded = ["level", "size", "variant"];
15
15
  /** @jsx jsx */
16
16
  // https://atlassian.design/foundations/typography
17
17
  var levelMap = {
@@ -135,6 +135,7 @@ var Heading = function Heading(_ref) {
135
135
  };
136
136
  var _default = exports.default = function _default(_ref2) {
137
137
  var level = _ref2.level,
138
+ size = _ref2.size,
138
139
  variant = _ref2.variant,
139
140
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
140
141
  return level ?
@@ -144,6 +145,7 @@ var _default = exports.default = function _default(_ref2) {
144
145
  }, props)) :
145
146
  // eslint-disable-next-line jsx-a11y/heading-has-content
146
147
  (0, _react.jsx)(_heading.default, (0, _extends2.default)({
147
- variant: variant
148
+ variant: variant,
149
+ size: size
148
150
  }, props));
149
151
  };
@@ -10,8 +10,7 @@ var _react = require("@emotion/react");
10
10
  var _headingContext = require("./heading-context");
11
11
  /** @jsx jsx */
12
12
 
13
- // https://atlassian.design/foundations/typography
14
- var variantTagMap = {
13
+ var sizeTagMap = {
15
14
  xxlarge: 'h1',
16
15
  xlarge: 'h1',
17
16
  large: 'h2',
@@ -38,11 +37,12 @@ var inverseStyles = (0, _react.css)({
38
37
  * @example
39
38
  *
40
39
  * ```jsx
41
- * <Heading variant="xxlarge">Page title</Heading>
40
+ * <Heading size="xxlarge">Page title</Heading>
42
41
  * ```
43
42
  */
44
43
  var Heading = function Heading(_ref) {
45
44
  var children = _ref.children,
45
+ size = _ref.size,
46
46
  variant = _ref.variant,
47
47
  id = _ref.id,
48
48
  testId = _ref.testId,
@@ -53,9 +53,12 @@ var Heading = function Heading(_ref) {
53
53
  throw new Error('`as` prop should be a string.');
54
54
  }
55
55
 
56
- // Technically variant can be undefined here due to how the types work.
57
- // Once removing the level prop this assertion can be removed since variant will be a required prop.
58
- var _useHeading = (0, _headingContext.useHeading)(variantTagMap[variant]),
56
+ // TODO: Temporary to move variant over to size
57
+ var localSize = variant || size;
58
+
59
+ // Technically size can be undefined here due to how the types work.
60
+ // Once removing the level prop this assertion can be removed since size will be a required prop.
61
+ var _useHeading = (0, _headingContext.useHeading)(sizeTagMap[localSize]),
59
62
  _useHeading2 = (0, _slicedToArray2.default)(_useHeading, 2),
60
63
  hLevel = _useHeading2[0],
61
64
  inferredElement = _useHeading2[1];
@@ -66,17 +69,17 @@ var Heading = function Heading(_ref) {
66
69
  "data-testid": testId,
67
70
  role: needsAriaRole ? 'heading' : undefined,
68
71
  "aria-level": needsAriaRole ? hLevel : undefined,
69
- css: [headingResetStyles, variant && headingVariantStylesMap[variant], color === 'inverse' && inverseStyles]
72
+ css: [headingResetStyles, localSize && headingSizeStylesMap[localSize], color === 'inverse' && inverseStyles]
70
73
  }, children);
71
74
  };
72
75
 
73
76
  /**
74
77
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
75
- * @codegen <<SignedSource::e846dd958c335ee435433cfe1a6ffe77>>
78
+ * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
76
79
  * @codegenId typography
77
80
  * @codegenCommand yarn workspace @atlaskit/heading codegen
78
81
  */
79
- var headingVariantStylesMap = {
82
+ var headingSizeStylesMap = {
80
83
  xxlarge: (0, _react.css)({
81
84
  font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
82
85
  }),
@@ -122,6 +122,7 @@ const Heading = ({
122
122
  };
123
123
  export default (({
124
124
  level,
125
+ size,
125
126
  variant,
126
127
  ...props
127
128
  }) => {
@@ -132,6 +133,7 @@ export default (({
132
133
  }, props)) :
133
134
  // eslint-disable-next-line jsx-a11y/heading-has-content
134
135
  jsx(NewHeading, _extends({
135
- variant: variant
136
+ variant: variant,
137
+ size: size
136
138
  }, props));
137
139
  });
@@ -1,8 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
3
  import { useHeading } from './heading-context';
4
- // https://atlassian.design/foundations/typography
5
- const variantTagMap = {
4
+ const sizeTagMap = {
6
5
  xxlarge: 'h1',
7
6
  xlarge: 'h1',
8
7
  large: 'h2',
@@ -29,11 +28,12 @@ const inverseStyles = css({
29
28
  * @example
30
29
  *
31
30
  * ```jsx
32
- * <Heading variant="xxlarge">Page title</Heading>
31
+ * <Heading size="xxlarge">Page title</Heading>
33
32
  * ```
34
33
  */
35
34
  const Heading = ({
36
35
  children,
36
+ size,
37
37
  variant,
38
38
  id,
39
39
  testId,
@@ -44,9 +44,12 @@ const Heading = ({
44
44
  throw new Error('`as` prop should be a string.');
45
45
  }
46
46
 
47
- // Technically variant can be undefined here due to how the types work.
48
- // Once removing the level prop this assertion can be removed since variant will be a required prop.
49
- const [hLevel, inferredElement] = useHeading(variantTagMap[variant]);
47
+ // TODO: Temporary to move variant over to size
48
+ const localSize = variant || size;
49
+
50
+ // Technically size can be undefined here due to how the types work.
51
+ // Once removing the level prop this assertion can be removed since size will be a required prop.
52
+ const [hLevel, inferredElement] = useHeading(sizeTagMap[localSize]);
50
53
  const Component = as || inferredElement;
51
54
  const needsAriaRole = Component === 'div' && hLevel;
52
55
  return jsx(Component, {
@@ -54,17 +57,17 @@ const Heading = ({
54
57
  "data-testid": testId,
55
58
  role: needsAriaRole ? 'heading' : undefined,
56
59
  "aria-level": needsAriaRole ? hLevel : undefined,
57
- css: [headingResetStyles, variant && headingVariantStylesMap[variant], color === 'inverse' && inverseStyles]
60
+ css: [headingResetStyles, localSize && headingSizeStylesMap[localSize], color === 'inverse' && inverseStyles]
58
61
  }, children);
59
62
  };
60
63
 
61
64
  /**
62
65
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
63
- * @codegen <<SignedSource::e846dd958c335ee435433cfe1a6ffe77>>
66
+ * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
64
67
  * @codegenId typography
65
68
  * @codegenCommand yarn workspace @atlaskit/heading codegen
66
69
  */
67
- const headingVariantStylesMap = {
70
+ const headingSizeStylesMap = {
68
71
  xxlarge: css({
69
72
  font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
70
73
  }),
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- var _excluded = ["level", "variant"];
4
+ var _excluded = ["level", "size", "variant"];
5
5
  /** @jsx jsx */
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { useHeading } from './heading-context';
@@ -128,6 +128,7 @@ var Heading = function Heading(_ref) {
128
128
  };
129
129
  export default (function (_ref2) {
130
130
  var level = _ref2.level,
131
+ size = _ref2.size,
131
132
  variant = _ref2.variant,
132
133
  props = _objectWithoutProperties(_ref2, _excluded);
133
134
  return level ?
@@ -137,6 +138,7 @@ export default (function (_ref2) {
137
138
  }, props)) :
138
139
  // eslint-disable-next-line jsx-a11y/heading-has-content
139
140
  jsx(NewHeading, _extends({
140
- variant: variant
141
+ variant: variant,
142
+ size: size
141
143
  }, props));
142
144
  });
@@ -2,8 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { useHeading } from './heading-context';
5
- // https://atlassian.design/foundations/typography
6
- var variantTagMap = {
5
+ var sizeTagMap = {
7
6
  xxlarge: 'h1',
8
7
  xlarge: 'h1',
9
8
  large: 'h2',
@@ -30,11 +29,12 @@ var inverseStyles = css({
30
29
  * @example
31
30
  *
32
31
  * ```jsx
33
- * <Heading variant="xxlarge">Page title</Heading>
32
+ * <Heading size="xxlarge">Page title</Heading>
34
33
  * ```
35
34
  */
36
35
  var Heading = function Heading(_ref) {
37
36
  var children = _ref.children,
37
+ size = _ref.size,
38
38
  variant = _ref.variant,
39
39
  id = _ref.id,
40
40
  testId = _ref.testId,
@@ -45,9 +45,12 @@ var Heading = function Heading(_ref) {
45
45
  throw new Error('`as` prop should be a string.');
46
46
  }
47
47
 
48
- // Technically variant can be undefined here due to how the types work.
49
- // Once removing the level prop this assertion can be removed since variant will be a required prop.
50
- var _useHeading = useHeading(variantTagMap[variant]),
48
+ // TODO: Temporary to move variant over to size
49
+ var localSize = variant || size;
50
+
51
+ // Technically size can be undefined here due to how the types work.
52
+ // Once removing the level prop this assertion can be removed since size will be a required prop.
53
+ var _useHeading = useHeading(sizeTagMap[localSize]),
51
54
  _useHeading2 = _slicedToArray(_useHeading, 2),
52
55
  hLevel = _useHeading2[0],
53
56
  inferredElement = _useHeading2[1];
@@ -58,17 +61,17 @@ var Heading = function Heading(_ref) {
58
61
  "data-testid": testId,
59
62
  role: needsAriaRole ? 'heading' : undefined,
60
63
  "aria-level": needsAriaRole ? hLevel : undefined,
61
- css: [headingResetStyles, variant && headingVariantStylesMap[variant], color === 'inverse' && inverseStyles]
64
+ css: [headingResetStyles, localSize && headingSizeStylesMap[localSize], color === 'inverse' && inverseStyles]
62
65
  }, children);
63
66
  };
64
67
 
65
68
  /**
66
69
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
67
- * @codegen <<SignedSource::e846dd958c335ee435433cfe1a6ffe77>>
70
+ * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
68
71
  * @codegenId typography
69
72
  * @codegenCommand yarn workspace @atlaskit/heading codegen
70
73
  */
71
- var headingVariantStylesMap = {
74
+ var headingSizeStylesMap = {
72
75
  xxlarge: css({
73
76
  font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
74
77
  }),
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { HeadingProps } from './types';
4
- declare const _default: ({ level, variant, ...props }: HeadingProps) => jsx.JSX.Element;
4
+ declare const _default: ({ level, size, variant, ...props }: HeadingProps) => jsx.JSX.Element;
5
5
  export default _default;
@@ -9,17 +9,17 @@ import type { HeadingProps } from './types';
9
9
  * @example
10
10
  *
11
11
  * ```jsx
12
- * <Heading variant="xxlarge">Page title</Heading>
12
+ * <Heading size="xxlarge">Page title</Heading>
13
13
  * ```
14
14
  */
15
- declare const Heading: ({ children, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
15
+ declare const Heading: ({ children, size, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
16
16
  /**
17
17
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
18
- * @codegen <<SignedSource::e846dd958c335ee435433cfe1a6ffe77>>
18
+ * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
19
19
  * @codegenId typography
20
20
  * @codegenCommand yarn workspace @atlaskit/heading codegen
21
21
  */
22
- declare const headingVariantStylesMap: {
22
+ declare const headingSizeStylesMap: {
23
23
  xxlarge: import("@emotion/react").SerializedStyles;
24
24
  xlarge: import("@emotion/react").SerializedStyles;
25
25
  large: import("@emotion/react").SerializedStyles;
@@ -28,7 +28,7 @@ declare const headingVariantStylesMap: {
28
28
  xsmall: import("@emotion/react").SerializedStyles;
29
29
  xxsmall: import("@emotion/react").SerializedStyles;
30
30
  };
31
- export type HeadingVariant = keyof typeof headingVariantStylesMap;
31
+ export type HeadingSize = keyof typeof headingSizeStylesMap;
32
32
  /**
33
33
  * @codegenEnd
34
34
  */
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { HeadingVariant } from './heading.partial';
2
+ import { HeadingSize } from './heading.partial';
3
3
  export type HeadingProps = {
4
4
  /**
5
5
  * A `testId` prop is provided for specified elements, which is a unique
@@ -27,7 +27,7 @@ export type HeadingProps = {
27
27
  } & ({
28
28
  /**
29
29
  * @private
30
- * @deprecated Use `variant` prop instead.
30
+ * @deprecated Use `size` prop instead.
31
31
  * The heading level as defined by the Atlassian Design [typography foundations](/foundations/typography/). The `level` prop affects the actual HTML element rendered in the DOM:
32
32
  * @example
33
33
  * ```js
@@ -49,17 +49,21 @@ export type HeadingProps = {
49
49
  */
50
50
  level: 'h900' | 'h800' | 'h700' | 'h600' | 'h500' | 'h400' | 'h300' | 'h200' | 'h100';
51
51
  /**
52
- * Heading style variant. This style is detached from the specific heading level applied to allow for more flexibility.
53
- * Use instead of the deprecated `level` prop.
52
+ * Heading size. Use instead of the deprecated `level` prop.
54
53
  */
54
+ size?: never;
55
55
  variant?: never;
56
56
  } | {
57
57
  level?: never;
58
58
  /**
59
- * Heading style variant. This style is detached from the specific heading level applied to allow for more flexibility.
59
+ * Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
60
60
  * Use instead of the deprecated `level` prop.
61
61
  *
62
- * This prop will only work if the typography theme is applied.
62
+ * This prop will only work if the typography tokens theme is applied on the page.
63
+ */
64
+ size?: HeadingSize;
65
+ /**
66
+ * @deprecated. Use `size` instead.
63
67
  */
64
- variant: HeadingVariant;
68
+ variant?: HeadingSize;
65
69
  });
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { HeadingProps } from './types';
4
- declare const _default: ({ level, variant, ...props }: HeadingProps) => jsx.JSX.Element;
4
+ declare const _default: ({ level, size, variant, ...props }: HeadingProps) => jsx.JSX.Element;
5
5
  export default _default;
@@ -9,17 +9,17 @@ import type { HeadingProps } from './types';
9
9
  * @example
10
10
  *
11
11
  * ```jsx
12
- * <Heading variant="xxlarge">Page title</Heading>
12
+ * <Heading size="xxlarge">Page title</Heading>
13
13
  * ```
14
14
  */
15
- declare const Heading: ({ children, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
15
+ declare const Heading: ({ children, size, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
16
16
  /**
17
17
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
18
- * @codegen <<SignedSource::e846dd958c335ee435433cfe1a6ffe77>>
18
+ * @codegen <<SignedSource::057c0fe2015c2071afe3d694c5afcc0e>>
19
19
  * @codegenId typography
20
20
  * @codegenCommand yarn workspace @atlaskit/heading codegen
21
21
  */
22
- declare const headingVariantStylesMap: {
22
+ declare const headingSizeStylesMap: {
23
23
  xxlarge: import("@emotion/react").SerializedStyles;
24
24
  xlarge: import("@emotion/react").SerializedStyles;
25
25
  large: import("@emotion/react").SerializedStyles;
@@ -28,7 +28,7 @@ declare const headingVariantStylesMap: {
28
28
  xsmall: import("@emotion/react").SerializedStyles;
29
29
  xxsmall: import("@emotion/react").SerializedStyles;
30
30
  };
31
- export type HeadingVariant = keyof typeof headingVariantStylesMap;
31
+ export type HeadingSize = keyof typeof headingSizeStylesMap;
32
32
  /**
33
33
  * @codegenEnd
34
34
  */
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { HeadingVariant } from './heading.partial';
2
+ import { HeadingSize } from './heading.partial';
3
3
  export type HeadingProps = {
4
4
  /**
5
5
  * A `testId` prop is provided for specified elements, which is a unique
@@ -27,7 +27,7 @@ export type HeadingProps = {
27
27
  } & ({
28
28
  /**
29
29
  * @private
30
- * @deprecated Use `variant` prop instead.
30
+ * @deprecated Use `size` prop instead.
31
31
  * The heading level as defined by the Atlassian Design [typography foundations](/foundations/typography/). The `level` prop affects the actual HTML element rendered in the DOM:
32
32
  * @example
33
33
  * ```js
@@ -49,17 +49,21 @@ export type HeadingProps = {
49
49
  */
50
50
  level: 'h900' | 'h800' | 'h700' | 'h600' | 'h500' | 'h400' | 'h300' | 'h200' | 'h100';
51
51
  /**
52
- * Heading style variant. This style is detached from the specific heading level applied to allow for more flexibility.
53
- * Use instead of the deprecated `level` prop.
52
+ * Heading size. Use instead of the deprecated `level` prop.
54
53
  */
54
+ size?: never;
55
55
  variant?: never;
56
56
  } | {
57
57
  level?: never;
58
58
  /**
59
- * Heading style variant. This style is detached from the specific heading level applied to allow for more flexibility.
59
+ * Heading size. This value is detached from the specific heading level applied to allow for more flexibility.
60
60
  * Use instead of the deprecated `level` prop.
61
61
  *
62
- * This prop will only work if the typography theme is applied.
62
+ * This prop will only work if the typography tokens theme is applied on the page.
63
+ */
64
+ size?: HeadingSize;
65
+ /**
66
+ * @deprecated. Use `size` instead.
63
67
  */
64
- variant: HeadingVariant;
68
+ variant?: HeadingSize;
65
69
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/heading",
3
- "version": "1.7.0",
3
+ "version": "1.8.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,7 +32,7 @@
32
32
  "codegen": "ts-node ./scripts/codegen.tsx"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/tokens": "^1.40.0",
35
+ "@atlaskit/tokens": "^1.41.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@emotion/react": "^11.7.1"
38
38
  },
@@ -26,7 +26,7 @@ export const createTypographyStylesFromTemplate = () => {
26
26
  return (
27
27
  prettier.format(
28
28
  `
29
- const headingVariantStylesMap = {
29
+ const headingSizeStylesMap = {
30
30
  ${headingTokens
31
31
  .map(token => {
32
32
  return `
@@ -46,7 +46,7 @@ const headingVariantStylesMap = {
46
46
  parser: 'typescript',
47
47
  plugins: [parserTypeScript],
48
48
  },
49
- ) + `\nexport type HeadingVariant = keyof typeof headingVariantStylesMap;\n`
49
+ ) + `\nexport type HeadingSize = keyof typeof headingSizeStylesMap;\n`
50
50
  );
51
51
  };
52
52