@atlaskit/heading 2.3.1 → 2.4.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,27 @@
1
1
  # @atlaskit/heading
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#110670](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110670)
8
+ [`c733254a2dd6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c733254a2dd6e) -
9
+ Explicitly set jsxRuntime to classic via pragma comments in order to avoid issues where jsxRuntime
10
+ is implicitly set to automatic.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 2.3.2
17
+
18
+ ### Patch Changes
19
+
20
+ - [#110191](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110191)
21
+ [`c3dc02298f8aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c3dc02298f8aa) -
22
+ [ux] Change heading xsmall lineheight from 16 to 20 for minor third theme.
23
+ - Updated dependencies
24
+
3
25
  ## 2.3.1
4
26
 
5
27
  ### Patch Changes
@@ -20,7 +42,7 @@
20
42
 
21
43
  - [#91625](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91625)
22
44
  [`d7770083ff25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7770083ff25) -
23
- Add support for React 18.
45
+ Add support for React 18 in non-strict mode.
24
46
 
25
47
  ## 2.1.2
26
48
 
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2020 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
@@ -1,81 +1,66 @@
1
1
  import type {
2
- API,
3
- ASTPath,
4
- default as core,
5
- FileInfo,
6
- ImportDeclaration,
7
- Options,
2
+ API,
3
+ ASTPath,
4
+ default as core,
5
+ FileInfo,
6
+ ImportDeclaration,
7
+ Options,
8
8
  } from 'jscodeshift';
9
9
 
10
- export default function transformer(
11
- fileInfo: FileInfo,
12
- { jscodeshift: j }: API,
13
- options: Options,
14
- ) {
15
- const base = j(fileInfo.source);
16
- const headingSpecifier = getDefaultSpecifier(j, base, '@atlaskit/heading');
17
- if (!headingSpecifier) {
18
- return;
19
- }
10
+ export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
11
+ const base = j(fileInfo.source);
12
+ const headingSpecifier = getDefaultSpecifier(j, base, '@atlaskit/heading');
13
+ if (!headingSpecifier) {
14
+ return;
15
+ }
20
16
 
21
- replaceLevelWithSize(j, base, headingSpecifier);
17
+ replaceLevelWithSize(j, base, headingSpecifier);
22
18
 
23
- return base.toSource();
19
+ return base.toSource();
24
20
  }
25
21
 
26
22
  const levelToSizeMap = {
27
- h900: 'xxlarge',
28
- h800: 'xlarge',
29
- h700: 'large',
30
- h600: 'medium',
31
- h500: 'small',
32
- h400: 'xsmall',
33
- h300: 'xxsmall',
34
- // We may want to auto-transform h100s and h200s in the future
35
- // h200: 'xxsmall',
36
- // h100: 'xxsmall',
23
+ h900: 'xxlarge',
24
+ h800: 'xlarge',
25
+ h700: 'large',
26
+ h600: 'medium',
27
+ h500: 'small',
28
+ h400: 'xsmall',
29
+ h300: 'xxsmall',
30
+ // We may want to auto-transform h100s and h200s in the future
31
+ // h200: 'xxsmall',
32
+ // h100: 'xxsmall',
37
33
  };
38
34
 
39
35
  function replaceLevelWithSize(
40
- j: core.JSCodeshift,
41
- source: ReturnType<typeof j>,
42
- specifier: string,
36
+ j: core.JSCodeshift,
37
+ source: ReturnType<typeof j>,
38
+ specifier: string,
43
39
  ) {
44
- source.findJSXElements(specifier).forEach(element => {
45
- j(element)
46
- .find(j.JSXAttribute, { name: { type: 'JSXIdentifier', name: 'level' } })
47
- .forEach(attr => {
48
- const attrValue = j(attr).nodes()[0].value;
49
- if (attrValue.type === 'StringLiteral') {
50
- const replacementValue =
51
- levelToSizeMap[attrValue.value as keyof typeof levelToSizeMap];
52
- if (replacementValue) {
53
- j(attr).replaceWith(
54
- j.jsxAttribute(
55
- j.jsxIdentifier('size'),
56
- j.stringLiteral(replacementValue),
57
- ),
58
- );
59
- }
60
- }
61
- });
62
- });
40
+ source.findJSXElements(specifier).forEach((element) => {
41
+ j(element)
42
+ .find(j.JSXAttribute, { name: { type: 'JSXIdentifier', name: 'level' } })
43
+ .forEach((attr) => {
44
+ const attrValue = j(attr).nodes()[0].value;
45
+ if (attrValue.type === 'StringLiteral') {
46
+ const replacementValue = levelToSizeMap[attrValue.value as keyof typeof levelToSizeMap];
47
+ if (replacementValue) {
48
+ j(attr).replaceWith(
49
+ j.jsxAttribute(j.jsxIdentifier('size'), j.stringLiteral(replacementValue)),
50
+ );
51
+ }
52
+ }
53
+ });
54
+ });
63
55
  }
64
56
 
65
- function getDefaultSpecifier(
66
- j: core.JSCodeshift,
67
- source: any,
68
- specifier: string,
69
- ) {
70
- const specifiers = source
71
- .find(j.ImportDeclaration)
72
- .filter(
73
- (path: ASTPath<ImportDeclaration>) =>
74
- path.node.source.value === specifier,
75
- )
76
- .find(j.ImportDefaultSpecifier);
77
- if (!specifiers.length) {
78
- return null;
79
- }
80
- return specifiers.nodes()[0]!.local!.name;
57
+ function getDefaultSpecifier(j: core.JSCodeshift, source: any, specifier: string) {
58
+ const specifiers = source
59
+ .find(j.ImportDeclaration)
60
+ .filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
61
+ .find(j.ImportDefaultSpecifier);
62
+ if (!specifiers.length) {
63
+ return null;
64
+ }
65
+ return specifiers.nodes()[0]!.local!.name;
81
66
  }
@@ -13,7 +13,11 @@ var _headingContext = require("./heading-context");
13
13
  var _heading = _interopRequireDefault(require("./heading.partial"));
14
14
  var _excluded = ["level"];
15
15
  /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
16
+ /**
17
+ * @jsxRuntime classic
18
+ */
16
19
  /** @jsx jsx */
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
21
  // https://atlassian.design/foundations/typography
18
22
  var levelMap = {
19
23
  h900: 'h1',
@@ -9,7 +9,11 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
9
9
  var _react = require("@emotion/react");
10
10
  var _primitives = require("@atlaskit/primitives");
11
11
  var _headingContext = require("./heading-context");
12
+ /**
13
+ * @jsxRuntime classic
14
+ */
12
15
  /** @jsx jsx */
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
17
 
14
18
  var sizeTagMap = {
15
19
  xxlarge: 'h1',
@@ -93,7 +97,7 @@ var headingColorStylesMap = exports.headingColorStylesMap = {
93
97
 
94
98
  /**
95
99
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
96
- * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
100
+ * @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
97
101
  * @codegenId typography
98
102
  * @codegenCommand yarn workspace @atlaskit/heading codegen
99
103
  */
@@ -1,6 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
3
+ /**
4
+ * @jsxRuntime classic
5
+ */
3
6
  /** @jsx jsx */
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
8
  import { css, jsx } from '@emotion/react';
5
9
  import { useHeading } from './heading-context';
6
10
  import NewHeading from './heading.partial';
@@ -1,4 +1,8 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
6
  import { css, jsx } from '@emotion/react';
3
7
  import { UNSAFE_inverseColorMap, UNSAFE_useSurface } from '@atlaskit/primitives';
4
8
  import { useHeading } from './heading-context';
@@ -82,7 +86,7 @@ export const headingColorStylesMap = {
82
86
 
83
87
  /**
84
88
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
85
- * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
89
+ * @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
86
90
  * @codegenId typography
87
91
  * @codegenCommand yarn workspace @atlaskit/heading codegen
88
92
  */
@@ -3,7 +3,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  var _excluded = ["level"];
5
5
  /* eslint-disable @atlaskit/design-system/no-deprecated-design-token-usage */
6
+ /**
7
+ * @jsxRuntime classic
8
+ */
6
9
  /** @jsx jsx */
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
11
  import { css, jsx } from '@emotion/react';
8
12
  import { useHeading } from './heading-context';
9
13
  import NewHeading from './heading.partial';
@@ -1,5 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ /**
3
+ * @jsxRuntime classic
4
+ */
2
5
  /** @jsx jsx */
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
7
  import { css, jsx } from '@emotion/react';
4
8
  import { UNSAFE_inverseColorMap, UNSAFE_useSurface } from '@atlaskit/primitives';
5
9
  import { useHeading } from './heading-context';
@@ -85,7 +89,7 @@ export var headingColorStylesMap = {
85
89
 
86
90
  /**
87
91
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
88
- * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
92
+ * @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
89
93
  * @codegenId typography
90
94
  * @codegenCommand yarn workspace @atlaskit/heading codegen
91
95
  */
@@ -36,5 +36,5 @@ export interface HeadingLevelContextProps {
36
36
  * </HeadingContext>
37
37
  * ```
38
38
  */
39
- declare const HeadingLevelContextProvider: ({ children, value, }: HeadingLevelContextProps) => JSX.Element;
39
+ declare const HeadingLevelContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
40
40
  export default HeadingLevelContextProvider;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import { jsx } from '@emotion/react';
3
6
  import type { HeadingProps } from './types';
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import { jsx, type SerializedStyles } from '@emotion/react';
3
6
  import type { HeadingColor, NewHeadingProps } from './types';
@@ -12,11 +15,11 @@ import type { HeadingColor, NewHeadingProps } from './types';
12
15
  * <Heading size="xxlarge">Page title</Heading>
13
16
  * ```
14
17
  */
15
- declare const Heading: ({ children, size, id, testId, as, color: colorProp, }: NewHeadingProps) => jsx.JSX.Element;
18
+ declare const Heading: ({ children, size, id, testId, as, color: colorProp }: NewHeadingProps) => jsx.JSX.Element;
16
19
  export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
17
20
  /**
18
21
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
19
- * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
22
+ * @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
20
23
  * @codegenId typography
21
24
  * @codegenCommand yarn workspace @atlaskit/heading codegen
22
25
  */
@@ -39,5 +39,5 @@ export interface HeadingLevelContextProps {
39
39
  * </HeadingContext>
40
40
  * ```
41
41
  */
42
- declare const HeadingLevelContextProvider: ({ children, value, }: HeadingLevelContextProps) => JSX.Element;
42
+ declare const HeadingLevelContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
43
43
  export default HeadingLevelContextProvider;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import { jsx } from '@emotion/react';
3
6
  import type { HeadingProps } from './types';
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import { jsx, type SerializedStyles } from '@emotion/react';
3
6
  import type { HeadingColor, NewHeadingProps } from './types';
@@ -12,11 +15,11 @@ import type { HeadingColor, NewHeadingProps } from './types';
12
15
  * <Heading size="xxlarge">Page title</Heading>
13
16
  * ```
14
17
  */
15
- declare const Heading: ({ children, size, id, testId, as, color: colorProp, }: NewHeadingProps) => jsx.JSX.Element;
18
+ declare const Heading: ({ children, size, id, testId, as, color: colorProp }: NewHeadingProps) => jsx.JSX.Element;
16
19
  export declare const headingColorStylesMap: Record<HeadingColor, SerializedStyles>;
17
20
  /**
18
21
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
19
- * @codegen <<SignedSource::d7d7bb136aa9b7935c15f8e85d0916d7>>
22
+ * @codegen <<SignedSource::df829c6c0aa19bb57c0c77dc08d12d60>>
20
23
  * @codegenId typography
21
24
  * @codegenCommand yarn workspace @atlaskit/heading codegen
22
25
  */
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
1
  {
2
- "name": "@atlaskit/heading",
3
- "version": "2.3.1",
4
- "description": "A heading is a typography component used to display text in different sizes and formats.",
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org/"
7
- },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
- "author": "Atlassian Pty Ltd",
10
- "license": "Apache-2.0",
11
- "main": "dist/cjs/index.js",
12
- "module": "dist/esm/index.js",
13
- "module:es2019": "dist/es2019/index.js",
14
- "types": "dist/types/index.d.ts",
15
- "sideEffects": false,
16
- "atlaskit:src": "src/index.tsx",
17
- "atlassian": {
18
- "team": "Design System Team",
19
- "productPushConsumption": [
20
- "jira"
21
- ],
22
- "releaseModel": "continuous",
23
- "website": {
24
- "name": "Heading",
25
- "category": "Components",
26
- "status": {
27
- "type": "beta"
28
- }
29
- },
30
- "runReact18": true
31
- },
32
- "scripts": {
33
- "codegen": "ts-node ./scripts/codegen.tsx"
34
- },
35
- "dependencies": {
36
- "@atlaskit/primitives": "^7.0.0",
37
- "@atlaskit/tokens": "^1.49.0",
38
- "@babel/runtime": "^7.0.0",
39
- "@emotion/react": "^11.7.1"
40
- },
41
- "peerDependencies": {
42
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
43
- },
44
- "devDependencies": {
45
- "@af/accessibility-testing": "*",
46
- "@af/formatting": "*",
47
- "@atlaskit/ds-lib": "^2.3.0",
48
- "@atlaskit/ssr": "*",
49
- "@atlaskit/toggle": "^13.1.0",
50
- "@atlaskit/visual-regression": "*",
51
- "@atlassian/codegen": "^0.1.0",
52
- "@testing-library/react": "^12.1.5",
53
- "jscodeshift": "^0.13.0",
54
- "react-dom": "^16.8.0",
55
- "ts-node": "^10.9.1",
56
- "typescript": "~5.4.2"
57
- },
58
- "techstack": {
59
- "@atlassian/frontend": {
60
- "import-structure": "atlassian-conventions",
61
- "circular-dependencies": "file-and-folder-level"
62
- },
63
- "@repo/internal": {
64
- "dom-events": "use-bind-event-listener",
65
- "design-system": "v1",
66
- "styling": [
67
- "emotion"
68
- ],
69
- "ui-components": "lite-mode",
70
- "analytics": "analytics-next",
71
- "design-tokens": [
72
- "color",
73
- "spacing"
74
- ],
75
- "deprecation": "no-deprecated-imports"
76
- }
77
- },
78
- "typesVersions": {
79
- ">=4.5 <4.9": {
80
- "*": [
81
- "dist/types-ts4.5/*",
82
- "dist/types-ts4.5/index.d.ts"
83
- ]
84
- }
85
- },
86
- "af:exports": {
87
- ".": "./src/index.tsx"
88
- },
89
- "homepage": "https://atlassian.design/components/heading/"
90
- }
2
+ "name": "@atlaskit/heading",
3
+ "version": "2.4.0",
4
+ "description": "A heading is a typography component used to display text in different sizes and formats.",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
+ "author": "Atlassian Pty Ltd",
10
+ "license": "Apache-2.0",
11
+ "main": "dist/cjs/index.js",
12
+ "module": "dist/esm/index.js",
13
+ "module:es2019": "dist/es2019/index.js",
14
+ "types": "dist/types/index.d.ts",
15
+ "sideEffects": false,
16
+ "atlaskit:src": "src/index.tsx",
17
+ "atlassian": {
18
+ "team": "Design System Team",
19
+ "productPushConsumption": [
20
+ "jira"
21
+ ],
22
+ "releaseModel": "continuous",
23
+ "website": {
24
+ "name": "Heading",
25
+ "category": "Components",
26
+ "status": {
27
+ "type": "beta"
28
+ }
29
+ },
30
+ "runReact18": true
31
+ },
32
+ "scripts": {
33
+ "codegen": "ts-node ./scripts/codegen.tsx"
34
+ },
35
+ "dependencies": {
36
+ "@atlaskit/primitives": "^7.4.0",
37
+ "@atlaskit/tokens": "^1.51.0",
38
+ "@babel/runtime": "^7.0.0",
39
+ "@emotion/react": "^11.7.1"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@af/accessibility-testing": "*",
46
+ "@af/formatting": "*",
47
+ "@atlaskit/ds-lib": "^2.3.0",
48
+ "@atlaskit/ssr": "*",
49
+ "@atlaskit/toggle": "^13.2.0",
50
+ "@atlaskit/visual-regression": "*",
51
+ "@atlassian/codegen": "^0.1.0",
52
+ "@testing-library/react": "^12.1.5",
53
+ "jscodeshift": "^0.13.0",
54
+ "react-dom": "^16.8.0",
55
+ "ts-node": "^10.9.1",
56
+ "typescript": "~5.4.2"
57
+ },
58
+ "techstack": {
59
+ "@atlassian/frontend": {
60
+ "import-structure": "atlassian-conventions",
61
+ "circular-dependencies": "file-and-folder-level"
62
+ },
63
+ "@repo/internal": {
64
+ "dom-events": "use-bind-event-listener",
65
+ "design-system": "v1",
66
+ "styling": [
67
+ "emotion"
68
+ ],
69
+ "ui-components": "lite-mode",
70
+ "analytics": "analytics-next",
71
+ "design-tokens": [
72
+ "color",
73
+ "spacing"
74
+ ],
75
+ "deprecation": "no-deprecated-imports"
76
+ }
77
+ },
78
+ "typesVersions": {
79
+ ">=4.5 <4.9": {
80
+ "*": [
81
+ "dist/types-ts4.5/*",
82
+ "dist/types-ts4.5/index.d.ts"
83
+ ]
84
+ }
85
+ },
86
+ "af:exports": {
87
+ ".": "./src/index.tsx"
88
+ },
89
+ "homepage": "https://atlassian.design/components/heading/"
90
+ }
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/heading"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -24,45 +25,33 @@ const _default: ({ level, variant, ...props }: HeadingProps) => jsx.JSX.Element;
24
25
  export default _default;
25
26
 
26
27
  // @public
27
- export const HeadingContextProvider: ({
28
- children,
29
- value,
30
- }: HeadingLevelContextProps) => JSX.Element;
28
+ export const HeadingContextProvider: ({ children, value }: HeadingLevelContextProps) => JSX.Element;
31
29
 
32
30
  // @public (undocumented)
33
31
  type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
34
32
 
35
33
  // @public (undocumented)
36
34
  interface HeadingLevelContextProps {
37
- children: ReactNode;
38
- value?: HeadingLevel;
35
+ children: ReactNode;
36
+ value?: HeadingLevel;
39
37
  }
40
38
 
41
39
  // @public (undocumented)
42
40
  export type HeadingProps = {
43
- testId?: string;
44
- children: ReactNode;
45
- id?: string;
46
- as?: 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
47
- color?: 'default' | 'inverse';
41
+ testId?: string;
42
+ children: ReactNode;
43
+ id?: string;
44
+ as?: 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
45
+ color?: 'default' | 'inverse';
48
46
  } & (
49
- | {
50
- level?:
51
- | 'h100'
52
- | 'h200'
53
- | 'h300'
54
- | 'h400'
55
- | 'h500'
56
- | 'h600'
57
- | 'h700'
58
- | 'h800'
59
- | 'h900';
60
- variant?: never;
61
- }
62
- | {
63
- level?: never;
64
- variant?: HeadingVariant;
65
- }
47
+ | {
48
+ level?: 'h100' | 'h200' | 'h300' | 'h400' | 'h500' | 'h600' | 'h700' | 'h800' | 'h900';
49
+ variant?: never;
50
+ }
51
+ | {
52
+ level?: never;
53
+ variant?: HeadingVariant;
54
+ }
66
55
  );
67
56
 
68
57
  // @public (undocumented)
@@ -70,13 +59,13 @@ type HeadingVariant = keyof typeof headingVariantStylesMap;
70
59
 
71
60
  // @public
72
61
  const headingVariantStylesMap: {
73
- large: SerializedStyles;
74
- medium: SerializedStyles;
75
- small: SerializedStyles;
76
- xlarge: SerializedStyles;
77
- xsmall: SerializedStyles;
78
- xxlarge: SerializedStyles;
79
- xxsmall: SerializedStyles;
62
+ large: SerializedStyles;
63
+ medium: SerializedStyles;
64
+ small: SerializedStyles;
65
+ xlarge: SerializedStyles;
66
+ xsmall: SerializedStyles;
67
+ xxlarge: SerializedStyles;
68
+ xxsmall: SerializedStyles;
80
69
  };
81
70
 
82
71
  // (No @packageDocumentation comment for this package)
@@ -90,7 +79,7 @@ const headingVariantStylesMap: {
90
79
 
91
80
  ```json
92
81
  {
93
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
82
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
94
83
  }
95
84
  ```
96
85
 
@@ -9,47 +9,47 @@ import { createPartialSignedArtifact } from '@atlassian/codegen';
9
9
  import { typographyAdg3 as tokens } from '@atlaskit/tokens/tokens-raw';
10
10
 
11
11
  const constructTokenFunctionCall = (tokenName: string) => {
12
- return `token('${tokenName}')`;
12
+ return `token('${tokenName}')`;
13
13
  };
14
14
 
15
15
  const headingTokens = tokens
16
- .filter(t => t.attributes.group === 'typography')
17
- .filter(t => t.cleanName.includes('heading'));
16
+ .filter((t) => t.attributes.group === 'typography')
17
+ .filter((t) => t.cleanName.includes('heading'));
18
18
 
19
19
  const removeVerbosity = (name: string): string => {
20
- return name.replace('font.heading.', '');
20
+ return name.replace('font.heading.', '');
21
21
  };
22
22
 
23
23
  export const createTypographyStylesFromTemplate = () => {
24
- return (
25
- format(
26
- `
24
+ return (
25
+ format(
26
+ `
27
27
  const headingSizeStylesMap = {
28
28
  ${headingTokens
29
- .map(token => {
30
- return `
29
+ .map((token) => {
30
+ return `
31
31
  '${removeVerbosity(
32
- token.name,
33
- )}': css({ font: ${constructTokenFunctionCall(token.cleanName)} })
32
+ token.name,
33
+ )}': css({ font: ${constructTokenFunctionCall(token.cleanName)} })
34
34
  `.trim();
35
- })
36
- .join(',\n\t')}
35
+ })
36
+ .join(',\n\t')}
37
37
  };`,
38
- 'typescript',
39
- ) + `\nexport type HeadingSize = keyof typeof headingSizeStylesMap;\n`
40
- );
38
+ 'typescript',
39
+ ) + `\nexport type HeadingSize = keyof typeof headingSizeStylesMap;\n`
40
+ );
41
41
  };
42
42
 
43
43
  const targetPath = join(__dirname, '../', 'src', 'heading.partial.tsx');
44
44
 
45
45
  writeFileSync(
46
- join(__dirname, '../src/heading.partial.tsx'),
47
- createPartialSignedArtifact(
48
- createTypographyStylesFromTemplate(),
49
- 'yarn workspace @atlaskit/heading codegen',
50
- {
51
- id: 'typography',
52
- absoluteFilePath: targetPath,
53
- },
54
- ),
46
+ join(__dirname, '../src/heading.partial.tsx'),
47
+ createPartialSignedArtifact(
48
+ createTypographyStylesFromTemplate(),
49
+ 'yarn workspace @atlaskit/heading codegen',
50
+ {
51
+ id: 'typography',
52
+ absoluteFilePath: targetPath,
53
+ },
54
+ ),
55
55
  );