@atlaskit/forge-react-types 0.34.9 → 0.34.11
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 +12 -0
- package/dist/cjs/components/__generated__/BoxProps.codegen.js +7 -3
- package/dist/es2019/components/__generated__/BoxProps.codegen.js +6 -2
- package/dist/esm/components/__generated__/BoxProps.codegen.js +6 -2
- package/dist/types/components/__generated__/AdfRendererProps.codegen.d.ts +28 -2
- package/dist/types/components/__generated__/BadgeProps.codegen.d.ts +15 -3
- package/dist/types/components/__generated__/BoxProps.codegen.d.ts +73 -3
- package/dist/types/components/__generated__/index.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/__generated__/AdfRendererProps.codegen.d.ts +28 -2
- package/dist/types-ts4.5/components/__generated__/BadgeProps.codegen.d.ts +15 -3
- package/dist/types-ts4.5/components/__generated__/BoxProps.codegen.d.ts +73 -3
- package/dist/types-ts4.5/components/__generated__/index.d.ts +3 -3
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +7 -7
- package/scripts/codegen/codeGenerator.ts +65 -6
- package/src/components/__generated__/AdfRendererProps.codegen.tsx +31 -3
- package/src/components/__generated__/BadgeProps.codegen.tsx +17 -4
- package/src/components/__generated__/BoxProps.codegen.tsx +84 -12
- package/src/components/__generated__/index.ts +3 -3
- package/src/index.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
*
|
|
9
9
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
10
10
|
*
|
|
11
|
-
* @codegen <<SignedSource::
|
|
11
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
12
12
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
13
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
13
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
14
14
|
*/
|
|
15
15
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
16
16
|
|
|
@@ -169,4 +169,8 @@ var xcssValidator = makeXCSSValidator({
|
|
|
169
169
|
position: {
|
|
170
170
|
supportedValues: ['relative', 'static']
|
|
171
171
|
}
|
|
172
|
-
});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
176
|
+
*/
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
11
11
|
|
|
@@ -165,4 +165,8 @@ const xcssValidator = makeXCSSValidator({
|
|
|
165
165
|
supportedValues: ['relative', 'static']
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
171
|
+
*/
|
|
168
172
|
export {};
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
11
11
|
|
|
@@ -165,4 +165,8 @@ var xcssValidator = makeXCSSValidator({
|
|
|
165
165
|
supportedValues: ['relative', 'static']
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
171
|
+
*/
|
|
168
172
|
export {};
|
|
@@ -3,11 +3,37 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - AdfRendererProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5e5e266275ea97ba9ead9f2dca647d84>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::12eb3f93e6fda477a20a6813ed9107ac>>
|
|
9
9
|
*/
|
|
10
10
|
import { type RendererProps } from '@atlaskit/renderer';
|
|
11
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
11
12
|
export type AdfRendererProps = RendererProps & {
|
|
13
|
+
/**
|
|
14
|
+
* An ADF document to render
|
|
15
|
+
*
|
|
16
|
+
* @type [DocNode](https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/doc/)
|
|
17
|
+
*/
|
|
18
|
+
document: DocNode;
|
|
12
19
|
documentWithoutMedia?: RendererProps['document'];
|
|
20
|
+
/**
|
|
21
|
+
* A function to determine behaviour for handling unsupported nodes:
|
|
22
|
+
* - Return a new Node to replace the unsupported one
|
|
23
|
+
* - Return false to remove the node entirely
|
|
24
|
+
* - Return undefined to leave the node as-is (default behaviour)
|
|
25
|
+
*
|
|
26
|
+
* @type [Visitor](https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/master/editor/adf-utils/src/types/index.ts)
|
|
27
|
+
*/
|
|
28
|
+
replaceUnsupportedNode?: Function;
|
|
13
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* The AdfRenderer component provides a way to render a valid ADF document, using the same renderer that Atlassian uses internally to render ADF content in Confluence pages, Jira work items, and so on.
|
|
32
|
+
* It allows you to replace node types that are unsupported in the context of a Forge app with replacement content, or remove them entirely.
|
|
33
|
+
* See [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) for information on valid nodes.
|
|
34
|
+
*
|
|
35
|
+
* This component uses [@atlaskit/renderer](https://www.npmjs.com/package/@atlaskit/renderer) under the hood.
|
|
36
|
+
*
|
|
37
|
+
* Visit [Renderer editor](https://atlaskit.atlassian.com/examples/editor/renderer/basic) for a comprehensive list of different ADF document examples
|
|
38
|
+
*/
|
|
39
|
+
export type TAdfRenderer<T> = (props: AdfRendererProps) => T;
|
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BadgeProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::be50537eb7e4a631ef0c0e1018412e29>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::d5b0fcebb6993614e6df8397ce50002d>>
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import PlatformBadge from '@atlaskit/badge';
|
|
12
|
-
type
|
|
12
|
+
type _PlatformBadgeProps = React.ComponentProps<typeof PlatformBadge>;
|
|
13
|
+
export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
|
|
14
|
+
/**
|
|
15
|
+
* The value displayed within the badge. A badge should only be used in cases where you want to represent a number. Use a lozenge for non-numeric information.
|
|
16
|
+
*
|
|
17
|
+
* @type string | number
|
|
18
|
+
*/
|
|
19
|
+
children?: _PlatformBadgeProps['children'];
|
|
20
|
+
};
|
|
13
21
|
export type BadgeProps = Pick<PlatformBadgeProps, 'appearance' | 'children' | 'max' | 'testId'>;
|
|
22
|
+
/**
|
|
23
|
+
* A badge is a visual indicator for numeric values such as tallies and scores.
|
|
24
|
+
*/
|
|
25
|
+
export type TBadge<T> = (props: BadgeProps) => T;
|
|
14
26
|
export {};
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { Box as PlatformBox } from '@atlaskit/primitives';
|
|
@@ -2132,6 +2132,76 @@ declare const xcssValidator: (styleObj: SafeCSSObject<keyof CSSProperties, keyof
|
|
|
2132
2132
|
}>;
|
|
2133
2133
|
type PlatformBoxProps = React.ComponentProps<typeof PlatformBox>;
|
|
2134
2134
|
type XCSSProp = ReturnType<typeof xcssValidator>;
|
|
2135
|
-
export type BoxProps = Pick<PlatformBoxProps, '
|
|
2135
|
+
export type BoxProps = Pick<PlatformBoxProps, 'children' | 'ref' | 'testId'> & {
|
|
2136
|
+
/**
|
|
2137
|
+
* A shorthand for `paddingBlock` and `paddingInline` together.
|
|
2138
|
+
*
|
|
2139
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2140
|
+
*/
|
|
2141
|
+
padding?: PlatformBoxProps['padding'];
|
|
2142
|
+
/**
|
|
2143
|
+
* The logical block start and end padding of an element.
|
|
2144
|
+
*
|
|
2145
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2146
|
+
*/
|
|
2147
|
+
paddingBlock?: PlatformBoxProps['paddingBlock'];
|
|
2148
|
+
/**
|
|
2149
|
+
* The logical block start padding of an element.
|
|
2150
|
+
*
|
|
2151
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2152
|
+
*/
|
|
2153
|
+
paddingBlockStart?: PlatformBoxProps['paddingBlockStart'];
|
|
2154
|
+
/**
|
|
2155
|
+
* The logical block end padding of an element.
|
|
2156
|
+
*
|
|
2157
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2158
|
+
*/
|
|
2159
|
+
paddingBlockEnd?: PlatformBoxProps['paddingBlockEnd'];
|
|
2160
|
+
/**
|
|
2161
|
+
* The logical inline start and end padding of an element.
|
|
2162
|
+
*
|
|
2163
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2164
|
+
*/
|
|
2165
|
+
paddingInline?: PlatformBoxProps['paddingInline'];
|
|
2166
|
+
/**
|
|
2167
|
+
* The logical inline end padding of an element.
|
|
2168
|
+
*
|
|
2169
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2170
|
+
*/
|
|
2171
|
+
paddingInlineEnd?: PlatformBoxProps['paddingInlineEnd'];
|
|
2172
|
+
/**
|
|
2173
|
+
* The logical inline start padding of an element.
|
|
2174
|
+
*
|
|
2175
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2176
|
+
*/
|
|
2177
|
+
paddingInlineStart?: PlatformBoxProps['paddingInlineStart'];
|
|
2178
|
+
/**
|
|
2179
|
+
* A token alias for background color. See: [Design tokens](https://atlassian.design/components/tokens/all-tokens)
|
|
2180
|
+
* for a list of available colors.
|
|
2181
|
+
*
|
|
2182
|
+
* When the background color is set to a surface token, the current surface CSS variable
|
|
2183
|
+
* will also be set to this value in the `Box` styles.
|
|
2184
|
+
*
|
|
2185
|
+
* @type [Background color tokens](https://atlassian.design/components/tokens/all-tokens#color-background)
|
|
2186
|
+
*/
|
|
2187
|
+
backgroundColor?: PlatformBoxProps['backgroundColor'];
|
|
2188
|
+
/**
|
|
2189
|
+
* Apply a subset of permitted styles, powered by Atlassian Design System tokens.
|
|
2190
|
+
* For a list of supported style properties on this component, see [here](/platform/forge/ui-kit/components/xcss).
|
|
2191
|
+
*
|
|
2192
|
+
* @type XCSSProp
|
|
2193
|
+
*/
|
|
2136
2194
|
xcss?: XCSSProp;
|
|
2195
|
+
/**
|
|
2196
|
+
* @type string
|
|
2197
|
+
*/
|
|
2198
|
+
role?: PlatformBoxProps['role'];
|
|
2199
|
+
/**
|
|
2200
|
+
* @type ForgeComponent
|
|
2201
|
+
*/
|
|
2202
|
+
children?: PlatformBoxProps['children'];
|
|
2137
2203
|
};
|
|
2204
|
+
/**
|
|
2205
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
2206
|
+
*/
|
|
2207
|
+
export type TBox<T> = (props: BoxProps) => T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { BadgeProps } from './BadgeProps.codegen';
|
|
1
|
+
export type { BadgeProps, TBadge } from './BadgeProps.codegen';
|
|
2
2
|
export type { BleedProps } from './BleedProps.codegen';
|
|
3
|
-
export type { BoxProps } from './BoxProps.codegen';
|
|
3
|
+
export type { BoxProps, TBox } from './BoxProps.codegen';
|
|
4
4
|
export type { ButtonGroupProps } from './ButtonGroupProps.codegen';
|
|
5
5
|
export type { ButtonProps } from './ButtonProps.codegen';
|
|
6
6
|
export type { CheckboxProps } from './CheckboxProps.codegen';
|
|
@@ -58,4 +58,4 @@ export type { ToggleProps } from './ToggleProps.codegen';
|
|
|
58
58
|
export type { TooltipProps } from './TooltipProps.codegen';
|
|
59
59
|
export type { ValidMessageProps } from './ValidMessageProps.codegen';
|
|
60
60
|
export type { PopupProps } from './PopupProps.codegen';
|
|
61
|
-
export type { AdfRendererProps } from './AdfRendererProps.codegen';
|
|
61
|
+
export type { AdfRendererProps, TAdfRenderer } from './AdfRendererProps.codegen';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AdfRendererProps, BadgeProps, BleedProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, DatePickerProps, DynamicTableProps, EmptyStateProps, ErrorMessageProps, FlexProps, FormFooterProps, FormHeaderProps, FormProps, FormSectionProps, GridProps, HeadingProps, HelperMessageProps, IconProps, InlineProps, LabelProps, LinkButtonProps, ListProps, ListItemProps, LoadingButtonProps, LozengeProps, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioGroupProps, RadioProps, RangeProps, SectionMessageActionProps, SectionMessageProps, SelectProps, SpinnerProps, StackProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, } from './components/__generated__';
|
|
1
|
+
export type { AdfRendererProps, BadgeProps, BleedProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, DatePickerProps, DynamicTableProps, EmptyStateProps, ErrorMessageProps, FlexProps, FormFooterProps, FormHeaderProps, FormProps, FormSectionProps, GridProps, HeadingProps, HelperMessageProps, IconProps, InlineProps, LabelProps, LinkButtonProps, ListProps, ListItemProps, LoadingButtonProps, LozengeProps, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioGroupProps, RadioProps, RangeProps, SectionMessageActionProps, SectionMessageProps, SelectProps, SpinnerProps, StackProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, TBadge, TBox, TAdfRenderer, } from './components/__generated__';
|
|
2
2
|
export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
|
|
3
3
|
export type { ChartColorTokens } from './types';
|
|
@@ -3,11 +3,37 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - AdfRendererProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5e5e266275ea97ba9ead9f2dca647d84>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::12eb3f93e6fda477a20a6813ed9107ac>>
|
|
9
9
|
*/
|
|
10
10
|
import { type RendererProps } from '@atlaskit/renderer';
|
|
11
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
11
12
|
export type AdfRendererProps = RendererProps & {
|
|
13
|
+
/**
|
|
14
|
+
* An ADF document to render
|
|
15
|
+
*
|
|
16
|
+
* @type [DocNode](https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/doc/)
|
|
17
|
+
*/
|
|
18
|
+
document: DocNode;
|
|
12
19
|
documentWithoutMedia?: RendererProps['document'];
|
|
20
|
+
/**
|
|
21
|
+
* A function to determine behaviour for handling unsupported nodes:
|
|
22
|
+
* - Return a new Node to replace the unsupported one
|
|
23
|
+
* - Return false to remove the node entirely
|
|
24
|
+
* - Return undefined to leave the node as-is (default behaviour)
|
|
25
|
+
*
|
|
26
|
+
* @type [Visitor](https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/master/editor/adf-utils/src/types/index.ts)
|
|
27
|
+
*/
|
|
28
|
+
replaceUnsupportedNode?: Function;
|
|
13
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* The AdfRenderer component provides a way to render a valid ADF document, using the same renderer that Atlassian uses internally to render ADF content in Confluence pages, Jira work items, and so on.
|
|
32
|
+
* It allows you to replace node types that are unsupported in the context of a Forge app with replacement content, or remove them entirely.
|
|
33
|
+
* See [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) for information on valid nodes.
|
|
34
|
+
*
|
|
35
|
+
* This component uses [@atlaskit/renderer](https://www.npmjs.com/package/@atlaskit/renderer) under the hood.
|
|
36
|
+
*
|
|
37
|
+
* Visit [Renderer editor](https://atlaskit.atlassian.com/examples/editor/renderer/basic) for a comprehensive list of different ADF document examples
|
|
38
|
+
*/
|
|
39
|
+
export type TAdfRenderer<T> = (props: AdfRendererProps) => T;
|
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BadgeProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::be50537eb7e4a631ef0c0e1018412e29>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::d5b0fcebb6993614e6df8397ce50002d>>
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import PlatformBadge from '@atlaskit/badge';
|
|
12
|
-
type
|
|
12
|
+
type _PlatformBadgeProps = React.ComponentProps<typeof PlatformBadge>;
|
|
13
|
+
export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
|
|
14
|
+
/**
|
|
15
|
+
* The value displayed within the badge. A badge should only be used in cases where you want to represent a number. Use a lozenge for non-numeric information.
|
|
16
|
+
*
|
|
17
|
+
* @type string | number
|
|
18
|
+
*/
|
|
19
|
+
children?: _PlatformBadgeProps['children'];
|
|
20
|
+
};
|
|
13
21
|
export type BadgeProps = Pick<PlatformBadgeProps, 'appearance' | 'children' | 'max' | 'testId'>;
|
|
22
|
+
/**
|
|
23
|
+
* A badge is a visual indicator for numeric values such as tallies and scores.
|
|
24
|
+
*/
|
|
25
|
+
export type TBadge<T> = (props: BadgeProps) => T;
|
|
14
26
|
export {};
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { Box as PlatformBox } from '@atlaskit/primitives';
|
|
@@ -2132,6 +2132,76 @@ declare const xcssValidator: (styleObj: SafeCSSObject<keyof CSSProperties, keyof
|
|
|
2132
2132
|
}>;
|
|
2133
2133
|
type PlatformBoxProps = React.ComponentProps<typeof PlatformBox>;
|
|
2134
2134
|
type XCSSProp = ReturnType<typeof xcssValidator>;
|
|
2135
|
-
export type BoxProps = Pick<PlatformBoxProps, '
|
|
2135
|
+
export type BoxProps = Pick<PlatformBoxProps, 'children' | 'ref' | 'testId'> & {
|
|
2136
|
+
/**
|
|
2137
|
+
* A shorthand for `paddingBlock` and `paddingInline` together.
|
|
2138
|
+
*
|
|
2139
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2140
|
+
*/
|
|
2141
|
+
padding?: PlatformBoxProps['padding'];
|
|
2142
|
+
/**
|
|
2143
|
+
* The logical block start and end padding of an element.
|
|
2144
|
+
*
|
|
2145
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2146
|
+
*/
|
|
2147
|
+
paddingBlock?: PlatformBoxProps['paddingBlock'];
|
|
2148
|
+
/**
|
|
2149
|
+
* The logical block start padding of an element.
|
|
2150
|
+
*
|
|
2151
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2152
|
+
*/
|
|
2153
|
+
paddingBlockStart?: PlatformBoxProps['paddingBlockStart'];
|
|
2154
|
+
/**
|
|
2155
|
+
* The logical block end padding of an element.
|
|
2156
|
+
*
|
|
2157
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2158
|
+
*/
|
|
2159
|
+
paddingBlockEnd?: PlatformBoxProps['paddingBlockEnd'];
|
|
2160
|
+
/**
|
|
2161
|
+
* The logical inline start and end padding of an element.
|
|
2162
|
+
*
|
|
2163
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2164
|
+
*/
|
|
2165
|
+
paddingInline?: PlatformBoxProps['paddingInline'];
|
|
2166
|
+
/**
|
|
2167
|
+
* The logical inline end padding of an element.
|
|
2168
|
+
*
|
|
2169
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2170
|
+
*/
|
|
2171
|
+
paddingInlineEnd?: PlatformBoxProps['paddingInlineEnd'];
|
|
2172
|
+
/**
|
|
2173
|
+
* The logical inline start padding of an element.
|
|
2174
|
+
*
|
|
2175
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
2176
|
+
*/
|
|
2177
|
+
paddingInlineStart?: PlatformBoxProps['paddingInlineStart'];
|
|
2178
|
+
/**
|
|
2179
|
+
* A token alias for background color. See: [Design tokens](https://atlassian.design/components/tokens/all-tokens)
|
|
2180
|
+
* for a list of available colors.
|
|
2181
|
+
*
|
|
2182
|
+
* When the background color is set to a surface token, the current surface CSS variable
|
|
2183
|
+
* will also be set to this value in the `Box` styles.
|
|
2184
|
+
*
|
|
2185
|
+
* @type [Background color tokens](https://atlassian.design/components/tokens/all-tokens#color-background)
|
|
2186
|
+
*/
|
|
2187
|
+
backgroundColor?: PlatformBoxProps['backgroundColor'];
|
|
2188
|
+
/**
|
|
2189
|
+
* Apply a subset of permitted styles, powered by Atlassian Design System tokens.
|
|
2190
|
+
* For a list of supported style properties on this component, see [here](/platform/forge/ui-kit/components/xcss).
|
|
2191
|
+
*
|
|
2192
|
+
* @type XCSSProp
|
|
2193
|
+
*/
|
|
2136
2194
|
xcss?: XCSSProp;
|
|
2195
|
+
/**
|
|
2196
|
+
* @type string
|
|
2197
|
+
*/
|
|
2198
|
+
role?: PlatformBoxProps['role'];
|
|
2199
|
+
/**
|
|
2200
|
+
* @type ForgeComponent
|
|
2201
|
+
*/
|
|
2202
|
+
children?: PlatformBoxProps['children'];
|
|
2137
2203
|
};
|
|
2204
|
+
/**
|
|
2205
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
2206
|
+
*/
|
|
2207
|
+
export type TBox<T> = (props: BoxProps) => T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { BadgeProps } from './BadgeProps.codegen';
|
|
1
|
+
export type { BadgeProps, TBadge } from './BadgeProps.codegen';
|
|
2
2
|
export type { BleedProps } from './BleedProps.codegen';
|
|
3
|
-
export type { BoxProps } from './BoxProps.codegen';
|
|
3
|
+
export type { BoxProps, TBox } from './BoxProps.codegen';
|
|
4
4
|
export type { ButtonGroupProps } from './ButtonGroupProps.codegen';
|
|
5
5
|
export type { ButtonProps } from './ButtonProps.codegen';
|
|
6
6
|
export type { CheckboxProps } from './CheckboxProps.codegen';
|
|
@@ -58,4 +58,4 @@ export type { ToggleProps } from './ToggleProps.codegen';
|
|
|
58
58
|
export type { TooltipProps } from './TooltipProps.codegen';
|
|
59
59
|
export type { ValidMessageProps } from './ValidMessageProps.codegen';
|
|
60
60
|
export type { PopupProps } from './PopupProps.codegen';
|
|
61
|
-
export type { AdfRendererProps } from './AdfRendererProps.codegen';
|
|
61
|
+
export type { AdfRendererProps, TAdfRenderer } from './AdfRendererProps.codegen';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AdfRendererProps, BadgeProps, BleedProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, DatePickerProps, DynamicTableProps, EmptyStateProps, ErrorMessageProps, FlexProps, FormFooterProps, FormHeaderProps, FormProps, FormSectionProps, GridProps, HeadingProps, HelperMessageProps, IconProps, InlineProps, LabelProps, LinkButtonProps, ListProps, ListItemProps, LoadingButtonProps, LozengeProps, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioGroupProps, RadioProps, RangeProps, SectionMessageActionProps, SectionMessageProps, SelectProps, SpinnerProps, StackProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, } from './components/__generated__';
|
|
1
|
+
export type { AdfRendererProps, BadgeProps, BleedProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, DatePickerProps, DynamicTableProps, EmptyStateProps, ErrorMessageProps, FlexProps, FormFooterProps, FormHeaderProps, FormProps, FormSectionProps, GridProps, HeadingProps, HelperMessageProps, IconProps, InlineProps, LabelProps, LinkButtonProps, ListProps, ListItemProps, LoadingButtonProps, LozengeProps, ModalBodyProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, ModalTransitionProps, ProgressBarProps, ProgressTrackerProps, RadioGroupProps, RadioProps, RangeProps, SectionMessageActionProps, SectionMessageProps, SelectProps, SpinnerProps, StackProps, TabListProps, TabPanelProps, TabProps, TabsProps, TagGroupProps, TagProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, TBadge, TBox, TAdfRenderer, } from './components/__generated__';
|
|
2
2
|
export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
|
|
3
3
|
export type { ChartColorTokens } from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/forge-react-types",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.11",
|
|
4
4
|
"description": "Component types for Forge UI Kit React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
"team": "Forge UI"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/badge": "^
|
|
27
|
+
"@atlaskit/badge": "^17.0.0",
|
|
28
28
|
"@atlaskit/button": "^20.3.0",
|
|
29
|
-
"@atlaskit/calendar": "^16.
|
|
29
|
+
"@atlaskit/calendar": "^16.2.0",
|
|
30
30
|
"@atlaskit/checkbox": "^15.2.0",
|
|
31
31
|
"@atlaskit/code": "^15.6.0",
|
|
32
|
-
"@atlaskit/datetime-picker": "^15.
|
|
32
|
+
"@atlaskit/datetime-picker": "^15.11.0",
|
|
33
33
|
"@atlaskit/dynamic-table": "^17.0.0",
|
|
34
34
|
"@atlaskit/empty-state": "^8.1.0",
|
|
35
35
|
"@atlaskit/form": "^11.0.0",
|
|
36
36
|
"@atlaskit/heading": "^4.0.0",
|
|
37
|
-
"@atlaskit/inline-edit": "^14.
|
|
37
|
+
"@atlaskit/inline-edit": "^14.1.0",
|
|
38
38
|
"@atlaskit/lozenge": "^11.12.0",
|
|
39
39
|
"@atlaskit/modal-dialog": "^12.19.0",
|
|
40
40
|
"@atlaskit/popup": "^1.30.0",
|
|
41
41
|
"@atlaskit/primitives": "^13.3.0",
|
|
42
42
|
"@atlaskit/progress-bar": "3.0.2",
|
|
43
|
-
"@atlaskit/progress-tracker": "9.0
|
|
43
|
+
"@atlaskit/progress-tracker": "9.1.0",
|
|
44
44
|
"@atlaskit/radio": "^7.0.0",
|
|
45
45
|
"@atlaskit/range": "^8.0.0",
|
|
46
46
|
"@atlaskit/renderer": "^112.8.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/textarea": "^5.7.0",
|
|
54
54
|
"@atlaskit/textfield": "^6.7.0",
|
|
55
55
|
"@atlaskit/toggle": "^14.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^3.
|
|
56
|
+
"@atlaskit/tokens": "^3.1.0",
|
|
57
57
|
"@atlaskit/tooltip": "^19.0.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0"
|
|
59
59
|
},
|
|
@@ -55,11 +55,15 @@ const getBaseComponentSymbol = (componentSymbol: Symbol, sourceFile: SourceFile)
|
|
|
55
55
|
const getDependentTypeDeclarations = (baseComponentPropSymbol: Symbol, sourceFile: SourceFile) => {
|
|
56
56
|
return sourceFile.getTypeAliases().reduce((declarations, typeAlias) => {
|
|
57
57
|
const typeAliasName = typeAlias.getName();
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
if (typeAliasName !== baseComponentPropSymbol.getName()) {
|
|
59
|
+
const baseComponentPropSymbolDeclaration = getDeclaration(baseComponentPropSymbol).getText();
|
|
60
|
+
let targetTypeName = typeAliasName;
|
|
61
|
+
if (targetTypeName.startsWith('_Platform')) {
|
|
62
|
+
targetTypeName = targetTypeName.slice(1);
|
|
63
|
+
}
|
|
64
|
+
if (baseComponentPropSymbolDeclaration.includes(targetTypeName)) {
|
|
65
|
+
declarations.push(typeAlias);
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return declarations;
|
|
65
69
|
}, [] as Array<TypeAliasDeclaration>);
|
|
@@ -295,12 +299,40 @@ const resolveExternalTypesCode = (
|
|
|
295
299
|
return !!declarationCode ? declarationCode : null;
|
|
296
300
|
};
|
|
297
301
|
|
|
302
|
+
const makeJSDocComment = (comment: string) => {
|
|
303
|
+
return `/**
|
|
304
|
+
* ${comment.split('\n').join('\n * ')}
|
|
305
|
+
*/`;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const getComponentTypeCode = (componentPropSymbol: Symbol, sourceFile: SourceFile) => {
|
|
309
|
+
const propName = componentPropSymbol.getName();
|
|
310
|
+
const componentName = propName.replace('Props', '');
|
|
311
|
+
const targetComponent = sourceFile.getVariableDeclaration(componentName);
|
|
312
|
+
|
|
313
|
+
const statements = [];
|
|
314
|
+
if (targetComponent) {
|
|
315
|
+
const comment = targetComponent
|
|
316
|
+
.getVariableStatement()
|
|
317
|
+
?.getJsDocs()
|
|
318
|
+
.map((jsDoc) => jsDoc.getInnerText())
|
|
319
|
+
.join('\n');
|
|
320
|
+
|
|
321
|
+
if (comment && comment.length > 0) {
|
|
322
|
+
statements.push(updateDACUrlInJSDocComment(makeJSDocComment(comment)));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
statements.push(`export type T${componentName}<T> = (props: ${propName}) => T;`);
|
|
326
|
+
return statements.join('\n');
|
|
327
|
+
};
|
|
328
|
+
|
|
298
329
|
type CodeConsolidator = (context: {
|
|
299
330
|
sourceFile: SourceFile;
|
|
300
331
|
importCode?: string | null;
|
|
301
332
|
externalTypesCode?: string | null;
|
|
302
333
|
dependentTypeCode?: string | null;
|
|
303
334
|
componentPropCode?: string | null;
|
|
335
|
+
componentTypeCode?: string | null;
|
|
304
336
|
}) => string;
|
|
305
337
|
|
|
306
338
|
const consolidateCodeSections: CodeConsolidator = ({
|
|
@@ -308,6 +340,7 @@ const consolidateCodeSections: CodeConsolidator = ({
|
|
|
308
340
|
externalTypesCode,
|
|
309
341
|
dependentTypeCode,
|
|
310
342
|
componentPropCode,
|
|
343
|
+
componentTypeCode,
|
|
311
344
|
}) => {
|
|
312
345
|
return [
|
|
313
346
|
'/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */',
|
|
@@ -315,11 +348,31 @@ const consolidateCodeSections: CodeConsolidator = ({
|
|
|
315
348
|
externalTypesCode,
|
|
316
349
|
dependentTypeCode,
|
|
317
350
|
componentPropCode,
|
|
351
|
+
componentTypeCode,
|
|
318
352
|
]
|
|
319
353
|
.filter((code) => !!code)
|
|
320
354
|
.join('\n\n');
|
|
321
355
|
};
|
|
322
356
|
|
|
357
|
+
const toAbsoluteDACUrl = (path: string) => `https://developer.atlassian.com${path}`;
|
|
358
|
+
|
|
359
|
+
const updateDACUrlInJSDocComment = (code: string) => {
|
|
360
|
+
// regex to match markdown links in the JS doc comments
|
|
361
|
+
const markdownLinkRegex = /([ \t]+\*.+\[.+\])\(([^)]+)\)/g;
|
|
362
|
+
return code.replace(markdownLinkRegex, (match, p1, url) => {
|
|
363
|
+
if (url.startsWith('/')) {
|
|
364
|
+
return `${p1}(${toAbsoluteDACUrl(url)})`;
|
|
365
|
+
}
|
|
366
|
+
return match;
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const getComponentPropsTypeCode = (componentPropSymbol: Symbol) => {
|
|
371
|
+
const sourceCode = getDeclaration(componentPropSymbol).getText(true);
|
|
372
|
+
|
|
373
|
+
return updateDACUrlInJSDocComment(sourceCode);
|
|
374
|
+
};
|
|
375
|
+
|
|
323
376
|
const baseGenerateComponentPropTypeSourceCode = (
|
|
324
377
|
componentPropSymbol: Symbol,
|
|
325
378
|
sourceFile: SourceFile,
|
|
@@ -353,7 +406,10 @@ const baseGenerateComponentPropTypeSourceCode = (
|
|
|
353
406
|
const dependentTypeCode = dependentTypeDeclarations
|
|
354
407
|
.map((typeAlias) => typeAlias.getText())
|
|
355
408
|
.join('\n');
|
|
356
|
-
const componentPropCode =
|
|
409
|
+
const componentPropCode = getComponentPropsTypeCode(baseComponentPropSymbol);
|
|
410
|
+
|
|
411
|
+
// 6) get component type code
|
|
412
|
+
const componentTypeCode = getComponentTypeCode(baseComponentPropSymbol, sourceFile);
|
|
357
413
|
|
|
358
414
|
return (customConsolidator ?? consolidateCodeSections)({
|
|
359
415
|
sourceFile,
|
|
@@ -361,6 +417,7 @@ const baseGenerateComponentPropTypeSourceCode = (
|
|
|
361
417
|
externalTypesCode,
|
|
362
418
|
dependentTypeCode,
|
|
363
419
|
componentPropCode,
|
|
420
|
+
componentTypeCode,
|
|
364
421
|
});
|
|
365
422
|
};
|
|
366
423
|
|
|
@@ -370,6 +427,7 @@ const boxPropsCodeConsolidator: CodeConsolidator = ({
|
|
|
370
427
|
externalTypesCode,
|
|
371
428
|
dependentTypeCode,
|
|
372
429
|
componentPropCode,
|
|
430
|
+
componentTypeCode,
|
|
373
431
|
}) => {
|
|
374
432
|
const xcssValidator = sourceFile.getVariableDeclarationOrThrow('xcssValidator').getText();
|
|
375
433
|
|
|
@@ -392,6 +450,7 @@ const boxPropsCodeConsolidator: CodeConsolidator = ({
|
|
|
392
450
|
externalTypesCode,
|
|
393
451
|
dependentTypeCode,
|
|
394
452
|
componentPropCode,
|
|
453
|
+
componentTypeCode,
|
|
395
454
|
]
|
|
396
455
|
.filter((code) => !!code)
|
|
397
456
|
.join('\n\n');
|
|
@@ -3,14 +3,42 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - AdfRendererProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5e5e266275ea97ba9ead9f2dca647d84>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/adfrenderer/index.tsx <<SignedSource::12eb3f93e6fda477a20a6813ed9107ac>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
11
11
|
|
|
12
12
|
import { type RendererProps } from '@atlaskit/renderer';
|
|
13
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
13
14
|
|
|
14
15
|
export type AdfRendererProps = RendererProps & {
|
|
16
|
+
/**
|
|
17
|
+
* An ADF document to render
|
|
18
|
+
*
|
|
19
|
+
* @type [DocNode](https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/doc/)
|
|
20
|
+
*/
|
|
21
|
+
document: DocNode;
|
|
15
22
|
documentWithoutMedia?: RendererProps['document'];
|
|
16
|
-
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A function to determine behaviour for handling unsupported nodes:
|
|
26
|
+
* - Return a new Node to replace the unsupported one
|
|
27
|
+
* - Return false to remove the node entirely
|
|
28
|
+
* - Return undefined to leave the node as-is (default behaviour)
|
|
29
|
+
*
|
|
30
|
+
* @type [Visitor](https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/master/editor/adf-utils/src/types/index.ts)
|
|
31
|
+
*/
|
|
32
|
+
replaceUnsupportedNode?: Function
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The AdfRenderer component provides a way to render a valid ADF document, using the same renderer that Atlassian uses internally to render ADF content in Confluence pages, Jira work items, and so on.
|
|
37
|
+
* It allows you to replace node types that are unsupported in the context of a Forge app with replacement content, or remove them entirely.
|
|
38
|
+
* See [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) for information on valid nodes.
|
|
39
|
+
*
|
|
40
|
+
* This component uses [@atlaskit/renderer](https://www.npmjs.com/package/@atlaskit/renderer) under the hood.
|
|
41
|
+
*
|
|
42
|
+
* Visit [Renderer editor](https://atlaskit.atlassian.com/examples/editor/renderer/basic) for a comprehensive list of different ADF document examples
|
|
43
|
+
*/
|
|
44
|
+
export type TAdfRenderer<T> = (props: AdfRendererProps) => T;
|
|
@@ -3,18 +3,31 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BadgeProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::be50537eb7e4a631ef0c0e1018412e29>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::d5b0fcebb6993614e6df8397ce50002d>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import PlatformBadge from '@atlaskit/badge';
|
|
14
14
|
|
|
15
|
-
type
|
|
15
|
+
type _PlatformBadgeProps = React.ComponentProps<typeof PlatformBadge>;
|
|
16
|
+
export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
|
|
17
|
+
/**
|
|
18
|
+
* The value displayed within the badge. A badge should only be used in cases where you want to represent a number. Use a lozenge for non-numeric information.
|
|
19
|
+
*
|
|
20
|
+
* @type string | number
|
|
21
|
+
*/
|
|
22
|
+
children?: _PlatformBadgeProps['children'];
|
|
23
|
+
}
|
|
16
24
|
|
|
17
25
|
export type BadgeProps = Pick<
|
|
18
26
|
PlatformBadgeProps,
|
|
19
27
|
'appearance' | 'children' | 'max' | 'testId'
|
|
20
|
-
>;
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A badge is a visual indicator for numeric values such as tallies and scores.
|
|
32
|
+
*/
|
|
33
|
+
export type TBadge<T> = (props: BadgeProps) => T;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extract component prop types from UIKit 2 components - BoxProps
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::5953057bca93305790983ebf1513e471>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/box/__generated__/index.partial.tsx <<SignedSource::1b547198cbfceadd8838222c33bbda26>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
|
|
11
11
|
|
|
@@ -181,18 +181,90 @@ type XCSSProp = ReturnType<typeof xcssValidator>;
|
|
|
181
181
|
|
|
182
182
|
export type BoxProps = Pick<
|
|
183
183
|
PlatformBoxProps,
|
|
184
|
-
| 'padding'
|
|
185
|
-
| 'paddingBlock'
|
|
186
|
-
| 'paddingBlockStart'
|
|
187
|
-
| 'paddingBlockEnd'
|
|
188
|
-
| 'paddingInline'
|
|
189
|
-
| 'paddingInlineStart'
|
|
190
|
-
| 'paddingInlineEnd'
|
|
191
|
-
| 'backgroundColor'
|
|
192
184
|
| 'children'
|
|
193
185
|
| 'ref'
|
|
194
186
|
| 'testId'
|
|
195
|
-
| 'role'
|
|
196
187
|
> & {
|
|
188
|
+
/**
|
|
189
|
+
* A shorthand for `paddingBlock` and `paddingInline` together.
|
|
190
|
+
*
|
|
191
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
192
|
+
*/
|
|
193
|
+
padding?: PlatformBoxProps['padding'];
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The logical block start and end padding of an element.
|
|
197
|
+
*
|
|
198
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
199
|
+
*/
|
|
200
|
+
paddingBlock?: PlatformBoxProps['paddingBlock'];
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The logical block start padding of an element.
|
|
204
|
+
*
|
|
205
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
206
|
+
*/
|
|
207
|
+
paddingBlockStart?: PlatformBoxProps['paddingBlockStart'];
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The logical block end padding of an element.
|
|
211
|
+
*
|
|
212
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
213
|
+
*/
|
|
214
|
+
paddingBlockEnd?: PlatformBoxProps['paddingBlockEnd'];
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The logical inline start and end padding of an element.
|
|
218
|
+
*
|
|
219
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
220
|
+
*/
|
|
221
|
+
paddingInline?: PlatformBoxProps['paddingInline'];
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The logical inline end padding of an element.
|
|
225
|
+
*
|
|
226
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
227
|
+
*/
|
|
228
|
+
paddingInlineEnd?: PlatformBoxProps['paddingInlineEnd'];
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The logical inline start padding of an element.
|
|
232
|
+
*
|
|
233
|
+
* @type [Space tokens](https://atlassian.design/components/tokens/all-tokens#space)
|
|
234
|
+
*/
|
|
235
|
+
paddingInlineStart?: PlatformBoxProps['paddingInlineStart'];
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A token alias for background color. See: [Design tokens](https://atlassian.design/components/tokens/all-tokens)
|
|
239
|
+
* for a list of available colors.
|
|
240
|
+
*
|
|
241
|
+
* When the background color is set to a surface token, the current surface CSS variable
|
|
242
|
+
* will also be set to this value in the `Box` styles.
|
|
243
|
+
*
|
|
244
|
+
* @type [Background color tokens](https://atlassian.design/components/tokens/all-tokens#color-background)
|
|
245
|
+
*/
|
|
246
|
+
backgroundColor?: PlatformBoxProps['backgroundColor'];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Apply a subset of permitted styles, powered by Atlassian Design System tokens.
|
|
250
|
+
* For a list of supported style properties on this component, see [here](/platform/forge/ui-kit/components/xcss).
|
|
251
|
+
*
|
|
252
|
+
* @type XCSSProp
|
|
253
|
+
*/
|
|
197
254
|
xcss?: XCSSProp;
|
|
198
|
-
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @type string
|
|
258
|
+
*/
|
|
259
|
+
role?: PlatformBoxProps['role'];
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @type ForgeComponent
|
|
263
|
+
*/
|
|
264
|
+
children?: PlatformBoxProps['children'];
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A box is a generic container that provides managed access to design tokens.
|
|
269
|
+
*/
|
|
270
|
+
export type TBox<T> = (props: BoxProps) => T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { BadgeProps } from './BadgeProps.codegen';
|
|
1
|
+
export type { BadgeProps, TBadge } from './BadgeProps.codegen';
|
|
2
2
|
export type { BleedProps } from './BleedProps.codegen';
|
|
3
|
-
export type { BoxProps } from './BoxProps.codegen';
|
|
3
|
+
export type { BoxProps, TBox } from './BoxProps.codegen';
|
|
4
4
|
export type { ButtonGroupProps } from './ButtonGroupProps.codegen';
|
|
5
5
|
export type { ButtonProps } from './ButtonProps.codegen';
|
|
6
6
|
export type { CheckboxProps } from './CheckboxProps.codegen';
|
|
@@ -58,4 +58,4 @@ export type { ToggleProps } from './ToggleProps.codegen';
|
|
|
58
58
|
export type { TooltipProps } from './TooltipProps.codegen';
|
|
59
59
|
export type { ValidMessageProps } from './ValidMessageProps.codegen';
|
|
60
60
|
export type { PopupProps } from './PopupProps.codegen';
|
|
61
|
-
export type { AdfRendererProps } from './AdfRendererProps.codegen';
|
|
61
|
+
export type { AdfRendererProps, TAdfRenderer } from './AdfRendererProps.codegen';
|