@atlaskit/heading 1.4.3 → 1.4.4
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 +7 -0
- package/dist/cjs/heading-context.js +1 -1
- package/dist/cjs/heading.partial.js +7 -7
- package/dist/es2019/heading-context.js +1 -1
- package/dist/es2019/heading.partial.js +7 -7
- package/dist/esm/heading-context.js +1 -1
- package/dist/esm/heading.partial.js +7 -7
- package/dist/types/heading-context.d.ts +2 -2
- package/dist/types/heading.partial.d.ts +3 -3
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/heading-context.d.ts +2 -2
- package/dist/types-ts4.5/heading.partial.d.ts +3 -3
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +4 -4
- package/scripts/codegen.tsx +1 -2
- package/tmp/api-report-tmp.d.ts +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/heading
|
|
2
2
|
|
|
3
|
+
## 1.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#63526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63526) [`cae958047771`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cae958047771) - Internal change to how typography tokens are imported. There is no expected behaviour change.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 1.4.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -35,7 +35,7 @@ var useHeading = exports.useHeading = function useHeading(fallback) {
|
|
|
35
35
|
/**
|
|
36
36
|
* __Heading level provider__
|
|
37
37
|
*
|
|
38
|
-
* The Heading level provider
|
|
38
|
+
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```tsx
|
|
@@ -73,11 +73,17 @@ var Heading = function Heading(_ref) {
|
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
76
|
-
* @codegen <<SignedSource::
|
|
76
|
+
* @codegen <<SignedSource::ea7494a514c27f0cf258be1e089043d0>>
|
|
77
77
|
* @codegenId typography
|
|
78
78
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
79
79
|
*/
|
|
80
80
|
var headingVariantStylesMap = {
|
|
81
|
+
xxlarge: (0, _react.css)({
|
|
82
|
+
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
83
|
+
}),
|
|
84
|
+
xlarge: (0, _react.css)({
|
|
85
|
+
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
86
|
+
}),
|
|
81
87
|
large: (0, _react.css)({
|
|
82
88
|
font: "var(--ds-font-heading-large, normal 500 24px/28px var(--ds-font-family-heading))"
|
|
83
89
|
}),
|
|
@@ -87,15 +93,9 @@ var headingVariantStylesMap = {
|
|
|
87
93
|
small: (0, _react.css)({
|
|
88
94
|
font: "var(--ds-font-heading-small, normal 600 16px/20px var(--ds-font-family-heading))"
|
|
89
95
|
}),
|
|
90
|
-
xlarge: (0, _react.css)({
|
|
91
|
-
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
92
|
-
}),
|
|
93
96
|
xsmall: (0, _react.css)({
|
|
94
97
|
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px var(--ds-font-family-heading))"
|
|
95
98
|
}),
|
|
96
|
-
xxlarge: (0, _react.css)({
|
|
97
|
-
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
98
|
-
}),
|
|
99
99
|
xxsmall: (0, _react.css)({
|
|
100
100
|
font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px var(--ds-font-family-heading))"
|
|
101
101
|
})
|
|
@@ -27,7 +27,7 @@ export const useHeading = fallback => {
|
|
|
27
27
|
/**
|
|
28
28
|
* __Heading level provider__
|
|
29
29
|
*
|
|
30
|
-
* The Heading level provider
|
|
30
|
+
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```tsx
|
|
@@ -61,11 +61,17 @@ const Heading = ({
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
64
|
-
* @codegen <<SignedSource::
|
|
64
|
+
* @codegen <<SignedSource::ea7494a514c27f0cf258be1e089043d0>>
|
|
65
65
|
* @codegenId typography
|
|
66
66
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
67
67
|
*/
|
|
68
68
|
const headingVariantStylesMap = {
|
|
69
|
+
xxlarge: css({
|
|
70
|
+
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
71
|
+
}),
|
|
72
|
+
xlarge: css({
|
|
73
|
+
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
74
|
+
}),
|
|
69
75
|
large: css({
|
|
70
76
|
font: "var(--ds-font-heading-large, normal 500 24px/28px var(--ds-font-family-heading))"
|
|
71
77
|
}),
|
|
@@ -75,15 +81,9 @@ const headingVariantStylesMap = {
|
|
|
75
81
|
small: css({
|
|
76
82
|
font: "var(--ds-font-heading-small, normal 600 16px/20px var(--ds-font-family-heading))"
|
|
77
83
|
}),
|
|
78
|
-
xlarge: css({
|
|
79
|
-
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
80
|
-
}),
|
|
81
84
|
xsmall: css({
|
|
82
85
|
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px var(--ds-font-family-heading))"
|
|
83
86
|
}),
|
|
84
|
-
xxlarge: css({
|
|
85
|
-
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
86
|
-
}),
|
|
87
87
|
xxsmall: css({
|
|
88
88
|
font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px var(--ds-font-family-heading))"
|
|
89
89
|
})
|
|
@@ -27,7 +27,7 @@ export var useHeading = function useHeading(fallback) {
|
|
|
27
27
|
/**
|
|
28
28
|
* __Heading level provider__
|
|
29
29
|
*
|
|
30
|
-
* The Heading level provider
|
|
30
|
+
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```tsx
|
|
@@ -65,11 +65,17 @@ var Heading = function Heading(_ref) {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
68
|
-
* @codegen <<SignedSource::
|
|
68
|
+
* @codegen <<SignedSource::ea7494a514c27f0cf258be1e089043d0>>
|
|
69
69
|
* @codegenId typography
|
|
70
70
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
71
71
|
*/
|
|
72
72
|
var headingVariantStylesMap = {
|
|
73
|
+
xxlarge: css({
|
|
74
|
+
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
75
|
+
}),
|
|
76
|
+
xlarge: css({
|
|
77
|
+
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
78
|
+
}),
|
|
73
79
|
large: css({
|
|
74
80
|
font: "var(--ds-font-heading-large, normal 500 24px/28px var(--ds-font-family-heading))"
|
|
75
81
|
}),
|
|
@@ -79,15 +85,9 @@ var headingVariantStylesMap = {
|
|
|
79
85
|
small: css({
|
|
80
86
|
font: "var(--ds-font-heading-small, normal 600 16px/20px var(--ds-font-family-heading))"
|
|
81
87
|
}),
|
|
82
|
-
xlarge: css({
|
|
83
|
-
font: "var(--ds-font-heading-xlarge, normal 600 29px/32px var(--ds-font-family-heading))"
|
|
84
|
-
}),
|
|
85
88
|
xsmall: css({
|
|
86
89
|
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px var(--ds-font-family-heading))"
|
|
87
90
|
}),
|
|
88
|
-
xxlarge: css({
|
|
89
|
-
font: "var(--ds-font-heading-xxlarge, normal 500 35px/40px var(--ds-font-family-heading))"
|
|
90
|
-
}),
|
|
91
91
|
xxsmall: css({
|
|
92
92
|
font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px var(--ds-font-family-heading))"
|
|
93
93
|
})
|
|
@@ -16,14 +16,14 @@ export interface HeadingLevelContextProps {
|
|
|
16
16
|
*/
|
|
17
17
|
value?: HeadingLevel;
|
|
18
18
|
/**
|
|
19
|
-
* Semantic
|
|
19
|
+
* Semantic hierarchy of content below the heading context.
|
|
20
20
|
*/
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* __Heading level provider__
|
|
25
25
|
*
|
|
26
|
-
* The Heading level provider
|
|
26
|
+
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```tsx
|
|
@@ -19,17 +19,17 @@ import type { HeadingProps } from './types';
|
|
|
19
19
|
declare const Heading: ({ children, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
|
|
20
20
|
/**
|
|
21
21
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
22
|
-
* @codegen <<SignedSource::
|
|
22
|
+
* @codegen <<SignedSource::ea7494a514c27f0cf258be1e089043d0>>
|
|
23
23
|
* @codegenId typography
|
|
24
24
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
25
25
|
*/
|
|
26
26
|
declare const headingVariantStylesMap: {
|
|
27
|
+
xxlarge: import("@emotion/react").SerializedStyles;
|
|
28
|
+
xlarge: import("@emotion/react").SerializedStyles;
|
|
27
29
|
large: import("@emotion/react").SerializedStyles;
|
|
28
30
|
medium: import("@emotion/react").SerializedStyles;
|
|
29
31
|
small: import("@emotion/react").SerializedStyles;
|
|
30
|
-
xlarge: import("@emotion/react").SerializedStyles;
|
|
31
32
|
xsmall: import("@emotion/react").SerializedStyles;
|
|
32
|
-
xxlarge: import("@emotion/react").SerializedStyles;
|
|
33
33
|
xxsmall: import("@emotion/react").SerializedStyles;
|
|
34
34
|
};
|
|
35
35
|
export type HeadingVariant = keyof typeof headingVariantStylesMap;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type HeadingProps = {
|
|
|
28
28
|
/**
|
|
29
29
|
* @private
|
|
30
30
|
* @deprecated Use `variant` prop instead.
|
|
31
|
-
* The
|
|
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
|
|
34
34
|
* const levelMap = {
|
|
@@ -19,14 +19,14 @@ export interface HeadingLevelContextProps {
|
|
|
19
19
|
*/
|
|
20
20
|
value?: HeadingLevel;
|
|
21
21
|
/**
|
|
22
|
-
* Semantic
|
|
22
|
+
* Semantic hierarchy of content below the heading context.
|
|
23
23
|
*/
|
|
24
24
|
children: ReactNode;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* __Heading level provider__
|
|
28
28
|
*
|
|
29
|
-
* The Heading level provider
|
|
29
|
+
* The Heading level provider injects the heading level to all `Heading` components below it in the component tree.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```tsx
|
|
@@ -19,17 +19,17 @@ import type { HeadingProps } from './types';
|
|
|
19
19
|
declare const Heading: ({ children, variant, id, testId, as, color, }: HeadingProps) => jsx.JSX.Element;
|
|
20
20
|
/**
|
|
21
21
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
22
|
-
* @codegen <<SignedSource::
|
|
22
|
+
* @codegen <<SignedSource::ea7494a514c27f0cf258be1e089043d0>>
|
|
23
23
|
* @codegenId typography
|
|
24
24
|
* @codegenCommand yarn workspace @atlaskit/heading codegen
|
|
25
25
|
*/
|
|
26
26
|
declare const headingVariantStylesMap: {
|
|
27
|
+
xxlarge: import("@emotion/react").SerializedStyles;
|
|
28
|
+
xlarge: import("@emotion/react").SerializedStyles;
|
|
27
29
|
large: import("@emotion/react").SerializedStyles;
|
|
28
30
|
medium: import("@emotion/react").SerializedStyles;
|
|
29
31
|
small: import("@emotion/react").SerializedStyles;
|
|
30
|
-
xlarge: import("@emotion/react").SerializedStyles;
|
|
31
32
|
xsmall: import("@emotion/react").SerializedStyles;
|
|
32
|
-
xxlarge: import("@emotion/react").SerializedStyles;
|
|
33
33
|
xxsmall: import("@emotion/react").SerializedStyles;
|
|
34
34
|
};
|
|
35
35
|
export type HeadingVariant = keyof typeof headingVariantStylesMap;
|
|
@@ -28,7 +28,7 @@ export type HeadingProps = {
|
|
|
28
28
|
/**
|
|
29
29
|
* @private
|
|
30
30
|
* @deprecated Use `variant` prop instead.
|
|
31
|
-
* The
|
|
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
|
|
34
34
|
* const levelMap = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/heading",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
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/"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"name": "Heading",
|
|
25
25
|
"category": "Components",
|
|
26
26
|
"status": {
|
|
27
|
-
"type": "
|
|
27
|
+
"type": "beta"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"codegen": "ts-node ./scripts/codegen.tsx"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/tokens": "^1.
|
|
35
|
+
"@atlaskit/tokens": "^1.33.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"@emotion/react": "^11.7.1"
|
|
38
38
|
},
|
|
@@ -85,4 +85,4 @@
|
|
|
85
85
|
},
|
|
86
86
|
"homepage": "https://atlassian.design/components/heading/",
|
|
87
87
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
88
|
-
}
|
|
88
|
+
}
|
package/scripts/codegen.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import parserTypeScript from 'prettier/parser-typescript';
|
|
|
8
8
|
import { createPartialSignedArtifact } from '@atlassian/codegen';
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line import/order
|
|
11
|
-
import {
|
|
11
|
+
import { typographyAdg3 as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
12
12
|
|
|
13
13
|
const constructTokenFunctionCall = (tokenName: string, fallback: string) => {
|
|
14
14
|
return `token('${tokenName}', '${fallback}')`;
|
|
@@ -28,7 +28,6 @@ export const createTypographyStylesFromTemplate = () => {
|
|
|
28
28
|
`
|
|
29
29
|
const headingVariantStylesMap = {
|
|
30
30
|
${headingTokens
|
|
31
|
-
.sort((a, b) => (a.name < b.name ? -1 : 1))
|
|
32
31
|
.map(token => {
|
|
33
32
|
return `
|
|
34
33
|
'${removeVerbosity(
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/heading"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
8
|
-
import { ReactNode } from 'react';
|
|
9
|
-
import { SerializedStyles } from '@emotion/react';
|
|
10
|
-
|
|
11
|
-
// @public (undocumented)
|
|
12
|
-
const _default: ({ level, variant, ...props }: HeadingProps) => jsx.JSX.Element;
|
|
13
|
-
export default _default;
|
|
14
|
-
|
|
15
|
-
// @public
|
|
16
|
-
export const HeadingContextProvider: ({ children, value, }: HeadingLevelContextProps) => JSX.Element;
|
|
17
|
-
|
|
18
|
-
// @public (undocumented)
|
|
19
|
-
type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
20
|
-
|
|
21
|
-
// @public (undocumented)
|
|
22
|
-
interface HeadingLevelContextProps {
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
value?: HeadingLevel;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// @public (undocumented)
|
|
28
|
-
export type HeadingProps = {
|
|
29
|
-
testId?: string;
|
|
30
|
-
children: ReactNode;
|
|
31
|
-
id?: string;
|
|
32
|
-
as?: 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
|
|
33
|
-
color?: 'default' | 'inverse';
|
|
34
|
-
} & ({
|
|
35
|
-
level?: 'h100' | 'h200' | 'h300' | 'h400' | 'h500' | 'h600' | 'h700' | 'h800' | 'h900';
|
|
36
|
-
variant?: never;
|
|
37
|
-
} | {
|
|
38
|
-
level?: never;
|
|
39
|
-
variant?: HeadingVariant;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// @public (undocumented)
|
|
43
|
-
type HeadingVariant = keyof typeof headingVariantStylesMap;
|
|
44
|
-
|
|
45
|
-
// @public
|
|
46
|
-
const headingVariantStylesMap: {
|
|
47
|
-
large: SerializedStyles;
|
|
48
|
-
medium: SerializedStyles;
|
|
49
|
-
small: SerializedStyles;
|
|
50
|
-
xlarge: SerializedStyles;
|
|
51
|
-
xsmall: SerializedStyles;
|
|
52
|
-
xxlarge: SerializedStyles;
|
|
53
|
-
xxsmall: SerializedStyles;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// (No @packageDocumentation comment for this package)
|
|
57
|
-
|
|
58
|
-
```
|