@atlaskit/forge-react-types 0.52.1 → 0.53.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,23 @@
1
1
  # @atlaskit/forge-react-types
2
2
 
3
+ ## 0.53.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6f93643f9e844`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6f93643f9e844) -
8
+ [ux] Addition of Tile component for Forge UIKit
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 0.52.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`baaa9523c646c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/baaa9523c646c) -
19
+ Update Lozenge and Badge prop types
20
+
3
21
  ## 0.52.1
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - BadgeProps
5
5
  *
6
- * @codegen <<SignedSource::dded43c94e5bc997c5df041eeb253927>>
6
+ * @codegen <<SignedSource::9d4cb948f5d6ac145a3d3e82ab8cfa92>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::002a848f01b18a8dea0ea160d731edbf>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::f9bf0bacecb91875eab391c4148409c1>>
9
9
  */
10
10
  import type React from 'react';
11
11
  export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
@@ -20,7 +20,7 @@ type _PlatformBadgeProps = {
20
20
  /**
21
21
  * Affects the visual style of the badge.
22
22
  */
23
- appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
23
+ appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed' | 'warning' | 'discovery' | 'danger' | 'neutral' | 'success' | 'information' | 'inverse';
24
24
  children?: React.ReactNode;
25
25
  /**
26
26
  * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
@@ -3,34 +3,36 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - LozengeProps
5
5
  *
6
- * @codegen <<SignedSource::2c6d1eb88477563937e65c98996d0b92>>
6
+ * @codegen <<SignedSource::abe727d97158c4d16d13504ebd7f60d6>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::5e9e88bd5dd513ba567d815ada9e7eae>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::9799ca9fa788b29c08dfbdb778da62b4>>
9
9
  */
10
10
  import type React from 'react';
11
11
  type PlatformLozengeProps = {
12
12
  /**
13
- * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
13
+ * The appearance of the lozenge. Supports both legacy semantic appearances and new accent/semantic colors.
14
+ * Legacy appearances (default, success, removed, inprogress, new, moved) are automatically mapped to the new semantic colors.
14
15
  */
15
- children?: React.ReactNode;
16
+ appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success' | 'warning' | 'danger' | 'information' | 'neutral' | 'discovery' | 'accent-red' | 'accent-orange' | 'accent-yellow' | 'accent-lime' | 'accent-green' | 'accent-teal' | 'accent-blue' | 'accent-purple' | 'accent-magenta' | 'accent-gray';
16
17
  /**
17
- * A `testId` prop is provided for specified elements, which is a unique
18
- * string that appears as a data attribute `data-testid` in the rendered code,
19
- * serving as a hook for automated tests
18
+ * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
20
19
  */
21
- testId?: string;
20
+ children?: React.ReactNode;
22
21
  /**
23
22
  * Determines whether to apply the bold style or not.
23
+ * @deprecated This prop is deprecated and will be removed in an upcoming major release. Use Tag component for non-bold styles.
24
24
  */
25
25
  isBold?: boolean;
26
- /**
27
- * The appearance type.
28
- */
29
- appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
30
26
  /**
31
27
  * max-width of lozenge container. Default to 200px.
32
28
  */
33
29
  maxWidth?: string | number;
30
+ /**
31
+ * A `testId` prop is provided for specified elements, which is a unique
32
+ * string that appears as a data attribute `data-testid` in the rendered code,
33
+ * serving as a hook for automated tests
34
+ */
35
+ testId?: string;
34
36
  };
35
37
  export type LozengeProps = Pick<PlatformLozengeProps, 'appearance' | 'children' | 'isBold' | 'maxWidth' | 'testId'>;
36
38
  /**
@@ -0,0 +1,20 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Extract component prop types from UIKit 2 components - TileProps
5
+ *
6
+ * @codegen <<SignedSource::8b1e13d93e3348f59fa7b79a0da227aa>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/tile/__generated__/index.partial.tsx <<SignedSource::d7ec62556fa495888b1d4326b71c4d52>>
9
+ */
10
+ import React from 'react';
11
+ import PlatformTile from '@atlaskit/tile';
12
+ type PlatformTileProps = React.ComponentProps<typeof PlatformTile>;
13
+ export type TileProps = Pick<PlatformTileProps, 'backgroundColor' | 'label' | 'size' | 'children' | 'hasBorder' | 'isInset' | 'testId'>;
14
+ /**
15
+ * A tile is a rounded square that takes an asset and represents a noun.
16
+ *
17
+ * @see [Tile](https://developer.atlassian.com/platform/forge/ui-kit/components/tile/) in UI Kit documentation for more information
18
+ */
19
+ export type TTile<T> = (props: TileProps) => T;
20
+ export {};
@@ -54,6 +54,7 @@ export type { TagGroupProps, TTagGroup } from './TagGroupProps.codegen';
54
54
  export type { SimpleTagProps as TagProps, TSimpleTag as TTag } from './TagProps.codegen';
55
55
  export type { TextAreaProps, TTextArea } from './TextAreaProps.codegen';
56
56
  export type { TextfieldProps, TTextfield } from './TextfieldProps.codegen';
57
+ export type { TileProps, TTile } from './TileProps.codegen';
57
58
  export type { TimePickerProps, TTimePicker } from './TimePickerProps.codegen';
58
59
  export type { ToggleProps, TToggle } from './ToggleProps.codegen';
59
60
  export type { TooltipProps, TTooltip } from './TooltipProps.codegen';
@@ -1,4 +1,4 @@
1
- export type { AdfRendererProps, BadgeProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, CommentProps, 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, TextProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, PressableProps, TBadge, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TComment, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, TFileCard, TFlex, TFormFooter, TFormHeader, TForm, TFormSection, TGrid, THeading, THelperMessage, TIcon, TInline, TInlineEdit, TLabel, TLinkButton, TList, TListItem, TLoadingButton, TLozenge, TModalBody, TModalFooter, TModalHeader, TModal, TModalTitle, TModalTransition, TProgressBar, TProgressTracker, TRadioGroup, TRadio, TRange, TSectionMessageAction, TSectionMessage, TSelect, TSpinner, TStack, TTabList, TTabPanel, TTab, TTabs, TTagGroup, TTag, TTextArea, TTextfield, TTimePicker, TToggle, TTooltip, TValidMessage, TPopup, TAdfRenderer, TText, TPressable, TFilePicker, } from './components/__generated__';
1
+ export type { AdfRendererProps, BadgeProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, CommentProps, 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, TextProps, TextAreaProps, TextfieldProps, TileProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, PressableProps, TBadge, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TComment, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, TFileCard, TFlex, TFormFooter, TFormHeader, TForm, TFormSection, TGrid, THeading, THelperMessage, TIcon, TInline, TInlineEdit, TLabel, TLinkButton, TList, TListItem, TLoadingButton, TLozenge, TModalBody, TModalFooter, TModalHeader, TModal, TModalTitle, TModalTransition, TProgressBar, TProgressTracker, TRadioGroup, TRadio, TRange, TSectionMessageAction, TSectionMessage, TSelect, TSpinner, TStack, TTabList, TTabPanel, TTab, TTabs, TTagGroup, TTag, TTextArea, TTextfield, TTimePicker, TToggle, TTooltip, TValidMessage, TPopup, TAdfRenderer, TText, TPressable, TFilePicker, TTile, } from './components/__generated__';
2
2
  export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, DonutChartProps, PieChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, TLineChart, TDonutChart, TPieChart, } from './components/charts';
3
3
  export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
4
4
  export type { ChartColorTokens } from './types';
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - BadgeProps
5
5
  *
6
- * @codegen <<SignedSource::dded43c94e5bc997c5df041eeb253927>>
6
+ * @codegen <<SignedSource::9d4cb948f5d6ac145a3d3e82ab8cfa92>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::002a848f01b18a8dea0ea160d731edbf>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::f9bf0bacecb91875eab391c4148409c1>>
9
9
  */
10
10
  import type React from 'react';
11
11
  export type PlatformBadgeProps = Omit<_PlatformBadgeProps, 'children'> & {
@@ -20,7 +20,7 @@ type _PlatformBadgeProps = {
20
20
  /**
21
21
  * Affects the visual style of the badge.
22
22
  */
23
- appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
23
+ appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed' | 'warning' | 'discovery' | 'danger' | 'neutral' | 'success' | 'information' | 'inverse';
24
24
  children?: React.ReactNode;
25
25
  /**
26
26
  * The maximum value to display. Defaults to `99`. If the value is 100, and max is 50, "50+" will be displayed.
@@ -3,34 +3,36 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - LozengeProps
5
5
  *
6
- * @codegen <<SignedSource::2c6d1eb88477563937e65c98996d0b92>>
6
+ * @codegen <<SignedSource::abe727d97158c4d16d13504ebd7f60d6>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::5e9e88bd5dd513ba567d815ada9e7eae>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::9799ca9fa788b29c08dfbdb778da62b4>>
9
9
  */
10
10
  import type React from 'react';
11
11
  type PlatformLozengeProps = {
12
12
  /**
13
- * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
13
+ * The appearance of the lozenge. Supports both legacy semantic appearances and new accent/semantic colors.
14
+ * Legacy appearances (default, success, removed, inprogress, new, moved) are automatically mapped to the new semantic colors.
14
15
  */
15
- children?: React.ReactNode;
16
+ appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success' | 'warning' | 'danger' | 'information' | 'neutral' | 'discovery' | 'accent-red' | 'accent-orange' | 'accent-yellow' | 'accent-lime' | 'accent-green' | 'accent-teal' | 'accent-blue' | 'accent-purple' | 'accent-magenta' | 'accent-gray';
16
17
  /**
17
- * A `testId` prop is provided for specified elements, which is a unique
18
- * string that appears as a data attribute `data-testid` in the rendered code,
19
- * serving as a hook for automated tests
18
+ * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
20
19
  */
21
- testId?: string;
20
+ children?: React.ReactNode;
22
21
  /**
23
22
  * Determines whether to apply the bold style or not.
23
+ * @deprecated This prop is deprecated and will be removed in an upcoming major release. Use Tag component for non-bold styles.
24
24
  */
25
25
  isBold?: boolean;
26
- /**
27
- * The appearance type.
28
- */
29
- appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
30
26
  /**
31
27
  * max-width of lozenge container. Default to 200px.
32
28
  */
33
29
  maxWidth?: string | number;
30
+ /**
31
+ * A `testId` prop is provided for specified elements, which is a unique
32
+ * string that appears as a data attribute `data-testid` in the rendered code,
33
+ * serving as a hook for automated tests
34
+ */
35
+ testId?: string;
34
36
  };
35
37
  export type LozengeProps = Pick<PlatformLozengeProps, 'appearance' | 'children' | 'isBold' | 'maxWidth' | 'testId'>;
36
38
  /**
@@ -0,0 +1,20 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Extract component prop types from UIKit 2 components - TileProps
5
+ *
6
+ * @codegen <<SignedSource::8b1e13d93e3348f59fa7b79a0da227aa>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/tile/__generated__/index.partial.tsx <<SignedSource::d7ec62556fa495888b1d4326b71c4d52>>
9
+ */
10
+ import React from 'react';
11
+ import PlatformTile from '@atlaskit/tile';
12
+ type PlatformTileProps = React.ComponentProps<typeof PlatformTile>;
13
+ export type TileProps = Pick<PlatformTileProps, 'backgroundColor' | 'label' | 'size' | 'children' | 'hasBorder' | 'isInset' | 'testId'>;
14
+ /**
15
+ * A tile is a rounded square that takes an asset and represents a noun.
16
+ *
17
+ * @see [Tile](https://developer.atlassian.com/platform/forge/ui-kit/components/tile/) in UI Kit documentation for more information
18
+ */
19
+ export type TTile<T> = (props: TileProps) => T;
20
+ export {};
@@ -54,6 +54,7 @@ export type { TagGroupProps, TTagGroup } from './TagGroupProps.codegen';
54
54
  export type { SimpleTagProps as TagProps, TSimpleTag as TTag } from './TagProps.codegen';
55
55
  export type { TextAreaProps, TTextArea } from './TextAreaProps.codegen';
56
56
  export type { TextfieldProps, TTextfield } from './TextfieldProps.codegen';
57
+ export type { TileProps, TTile } from './TileProps.codegen';
57
58
  export type { TimePickerProps, TTimePicker } from './TimePickerProps.codegen';
58
59
  export type { ToggleProps, TToggle } from './ToggleProps.codegen';
59
60
  export type { TooltipProps, TTooltip } from './TooltipProps.codegen';
@@ -1,4 +1,4 @@
1
- export type { AdfRendererProps, BadgeProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, CommentProps, 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, TextProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, PressableProps, TBadge, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TComment, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, TFileCard, TFlex, TFormFooter, TFormHeader, TForm, TFormSection, TGrid, THeading, THelperMessage, TIcon, TInline, TInlineEdit, TLabel, TLinkButton, TList, TListItem, TLoadingButton, TLozenge, TModalBody, TModalFooter, TModalHeader, TModal, TModalTitle, TModalTransition, TProgressBar, TProgressTracker, TRadioGroup, TRadio, TRange, TSectionMessageAction, TSectionMessage, TSelect, TSpinner, TStack, TTabList, TTabPanel, TTab, TTabs, TTagGroup, TTag, TTextArea, TTextfield, TTimePicker, TToggle, TTooltip, TValidMessage, TPopup, TAdfRenderer, TText, TPressable, TFilePicker, } from './components/__generated__';
1
+ export type { AdfRendererProps, BadgeProps, BoxProps, ButtonGroupProps, ButtonProps, CalendarProps, CheckboxProps, CheckboxGroupProps, CodeBlockProps, CodeProps, CommentProps, 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, TextProps, TextAreaProps, TextfieldProps, TileProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, PressableProps, TBadge, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TComment, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, TFileCard, TFlex, TFormFooter, TFormHeader, TForm, TFormSection, TGrid, THeading, THelperMessage, TIcon, TInline, TInlineEdit, TLabel, TLinkButton, TList, TListItem, TLoadingButton, TLozenge, TModalBody, TModalFooter, TModalHeader, TModal, TModalTitle, TModalTransition, TProgressBar, TProgressTracker, TRadioGroup, TRadio, TRange, TSectionMessageAction, TSectionMessage, TSelect, TSpinner, TStack, TTabList, TTabPanel, TTab, TTabs, TTagGroup, TTag, TTextArea, TTextfield, TTimePicker, TToggle, TTooltip, TValidMessage, TPopup, TAdfRenderer, TText, TPressable, TFilePicker, TTile, } from './components/__generated__';
2
2
  export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, DonutChartProps, PieChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, TLineChart, TDonutChart, TPieChart, } from './components/charts';
3
3
  export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
4
4
  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.52.1",
3
+ "version": "0.53.0",
4
4
  "description": "Component types for Forge UI Kit React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,17 +23,17 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/button": "^23.9.0",
25
25
  "@atlaskit/comment": "^13.2.0",
26
- "@atlaskit/datetime-picker": "^17.2.0",
26
+ "@atlaskit/datetime-picker": "^17.4.0",
27
27
  "@atlaskit/dynamic-table": "^18.3.0",
28
- "@atlaskit/form": "^15.1.0",
29
- "@atlaskit/inline-edit": "^15.4.0",
28
+ "@atlaskit/form": "^15.2.0",
29
+ "@atlaskit/inline-edit": "^15.5.0",
30
30
  "@atlaskit/modal-dialog": "^14.9.0",
31
- "@atlaskit/navigation-system": "^5.13.0",
32
- "@atlaskit/popup": "^4.8.0",
31
+ "@atlaskit/navigation-system": "^5.21.0",
32
+ "@atlaskit/popup": "^4.13.0",
33
33
  "@atlaskit/primitives": "^17.0.0",
34
34
  "@atlaskit/progress-bar": "^4.1.0",
35
35
  "@atlaskit/progress-tracker": "^10.4.0",
36
- "@atlaskit/radio": "^8.3.0",
36
+ "@atlaskit/radio": "^8.4.0",
37
37
  "@atlaskit/section-message": "^8.11.0",
38
38
  "@atlaskit/select": "^21.6.0",
39
39
  "@atlaskit/spinner": "^19.0.0",
@@ -42,9 +42,10 @@
42
42
  "@atlaskit/tag-group": "^12.0.0",
43
43
  "@atlaskit/textarea": "^8.2.0",
44
44
  "@atlaskit/textfield": "^8.2.0",
45
+ "@atlaskit/tile": "^1.0.0",
45
46
  "@atlaskit/toggle": "^15.2.0",
46
- "@atlaskit/tokens": "^9.0.0",
47
- "@atlaskit/tooltip": "^20.11.0",
47
+ "@atlaskit/tokens": "^9.1.0",
48
+ "@atlaskit/tooltip": "^20.12.0",
48
49
  "@babel/runtime": "^7.0.0"
49
50
  },
50
51
  "peerDependencies": {
@@ -52,7 +53,7 @@
52
53
  },
53
54
  "devDependencies": {
54
55
  "@atlassian/codegen": "^0.1.0",
55
- "@atlassian/forge-ui": "^32.60.0",
56
+ "@atlassian/forge-ui": "^32.64.0",
56
57
  "@types/node": "~22.17.1",
57
58
  "lodash": "^4.17.21",
58
59
  "react": "^18.2.0",
@@ -4,6 +4,7 @@ import {
4
4
  type Type as TSType,
5
5
  type UnionTypeNode,
6
6
  type TypeReferenceNode,
7
+ type Symbol as TSSymbol,
7
8
  SyntaxKind,
8
9
  } from 'ts-morph';
9
10
 
@@ -139,10 +140,17 @@ const flattenPickType = (
139
140
 
140
141
  const serializedProperties = properties
141
142
  .map((prop) => {
142
- const propertySignature = prop.getDeclarations()[0] as PropertySignature | undefined;
143
- if (!propertySignature) {
144
- return null; // Skip if no declaration
143
+ const propertySignatures = extractPropertySignatures(prop);
144
+ if (propertySignatures.length === 0) {
145
+ return null;
146
+ } else if (propertySignatures.length > 1) {
147
+ // Currently we only support union type with same property signatures or a superset signature
148
+ // as we assume this setup is to support gradual type changes behind feature flags.
149
+ // other use cases are not supported currently.
150
+ throw new Error(`Unsupported union prop type with multiple different property signatures, ${prop.getName()}`);
145
151
  }
152
+
153
+ const propertySignature = propertySignatures[0];
146
154
  const { jsDoc, typeCode } =
147
155
  propertyCallback({
148
156
  propertySignature,
@@ -162,6 +170,70 @@ const flattenPickType = (
162
170
  return `{\n${serializedProperties.map((prop) => (!!prop?.trim() ? ` ${prop}` : '')).join('\n')}\n}`;
163
171
  };
164
172
 
173
+ // Note: ADS components uses union types to rollout new component type changes gradually (behind feature flags).
174
+ // e.g. LozengeProps = LegacyLozengeProps | NewLozengeProps
175
+ // In such cases, we need to consolidate property signatures from all union members.
176
+ const extractPropertySignatures = (prop: TSSymbol): PropertySignature[] => {
177
+ const declarations = prop.getDeclarations();
178
+ if (!declarations) {
179
+ return [];
180
+ }
181
+ const signatures = declarations.filter((decl) => decl.getKind() === SyntaxKind.PropertySignature) as PropertySignature[];
182
+ if (signatures.length <= 1) {
183
+ return signatures;
184
+ }
185
+
186
+ // consolidate signatures if they are exactly the same
187
+ const uniqSignatures: PropertySignature[] = [];
188
+ const signatureTexts = new Set<string>();
189
+ for (const sig of signatures) {
190
+ const sigText = sig.getText();
191
+ if (!signatureTexts.has(sigText)) {
192
+ signatureTexts.add(sigText);
193
+ uniqSignatures.push(sig);
194
+ }
195
+ }
196
+
197
+ // next we should find one that's the supperset of others
198
+ if (uniqSignatures.length <= 1) {
199
+ return uniqSignatures;
200
+ }
201
+
202
+ const supersetSignatures: PropertySignature[] = [];
203
+ for (const sig of uniqSignatures) {
204
+ const sigType = sig.getType();
205
+ let isSuperset = true;
206
+ for (const otherSig of uniqSignatures) {
207
+ if (sig === otherSig) {
208
+ continue;
209
+ }
210
+ const otherSigType = otherSig.getType();
211
+ if (!isTypeAssignableTo(prop, otherSigType, sigType)) {
212
+ isSuperset = false;
213
+ break;
214
+ }
215
+ }
216
+ if (isSuperset) {
217
+ supersetSignatures.push(sig);
218
+ }
219
+ }
220
+
221
+ if (supersetSignatures.length > 0) {
222
+ return supersetSignatures;
223
+ }
224
+ return uniqSignatures;
225
+ };
226
+
227
+ const isTypeAssignableTo = (prop: TSSymbol, sourceType: TSType, targetType: TSType): boolean => {
228
+ const typeChecker = prop.getDeclarations()[0].getProject().getTypeChecker().compilerObject;
229
+
230
+ // ts typecker has an intneral method `isTypeAssignableTo` we can leverage here:
231
+ // https://github.com/microsoft/TypeScript/pull/56448
232
+ return (typeChecker as unknown as {
233
+ isTypeAssignableTo: (source: unknown, target: unknown) => boolean;
234
+ }).isTypeAssignableTo(sourceType.compilerType, targetType.compilerType);
235
+ };
236
+
165
237
  const getUnresolvableTypes = (tsType: TSType) => {
166
238
  const unresolvableTypes = new Set<string>();
167
239
  getUnresolvableTypesBase(tsType, unresolvableTypes);
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - BadgeProps
5
5
  *
6
- * @codegen <<SignedSource::dded43c94e5bc997c5df041eeb253927>>
6
+ * @codegen <<SignedSource::9d4cb948f5d6ac145a3d3e82ab8cfa92>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::002a848f01b18a8dea0ea160d731edbf>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/badge/__generated__/index.partial.tsx <<SignedSource::f9bf0bacecb91875eab391c4148409c1>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
@@ -25,7 +25,7 @@ type _PlatformBadgeProps = {
25
25
  /**
26
26
  * Affects the visual style of the badge.
27
27
  */
28
- appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed';
28
+ appearance?: 'added' | 'default' | 'important' | 'primary' | 'primaryInverted' | 'removed' | 'warning' | 'discovery' | 'danger' | 'neutral' | 'success' | 'information' | 'inverse';
29
29
 
30
30
  children?: React.ReactNode;
31
31
  /**
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Extract component prop types from UIKit 2 components - LozengeProps
5
5
  *
6
- * @codegen <<SignedSource::2c6d1eb88477563937e65c98996d0b92>>
6
+ * @codegen <<SignedSource::abe727d97158c4d16d13504ebd7f60d6>>
7
7
  * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::5e9e88bd5dd513ba567d815ada9e7eae>>
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/lozenge/__generated__/index.partial.tsx <<SignedSource::9799ca9fa788b29c08dfbdb778da62b4>>
9
9
  */
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
@@ -15,27 +15,29 @@ import type React from 'react';
15
15
  // Serialized type
16
16
  type PlatformLozengeProps = {
17
17
  /**
18
- * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
18
+ * The appearance of the lozenge. Supports both legacy semantic appearances and new accent/semantic colors.
19
+ * Legacy appearances (default, success, removed, inprogress, new, moved) are automatically mapped to the new semantic colors.
19
20
  */
20
- children?: React.ReactNode;
21
+ appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success' | 'warning' | 'danger' | 'information' | 'neutral' | 'discovery' | 'accent-red' | 'accent-orange' | 'accent-yellow' | 'accent-lime' | 'accent-green' | 'accent-teal' | 'accent-blue' | 'accent-purple' | 'accent-magenta' | 'accent-gray';
21
22
  /**
22
- * A `testId` prop is provided for specified elements, which is a unique
23
- * string that appears as a data attribute `data-testid` in the rendered code,
24
- * serving as a hook for automated tests
23
+ * Elements to be rendered inside the lozenge. This should ideally be just a word or two.
25
24
  */
26
- testId?: string;
25
+ children?: React.ReactNode;
27
26
  /**
28
27
  * Determines whether to apply the bold style or not.
28
+ * @deprecated This prop is deprecated and will be removed in an upcoming major release. Use Tag component for non-bold styles.
29
29
  */
30
30
  isBold?: boolean;
31
- /**
32
- * The appearance type.
33
- */
34
- appearance?: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
35
31
  /**
36
32
  * max-width of lozenge container. Default to 200px.
37
33
  */
38
34
  maxWidth?: string | number;
35
+ /**
36
+ * A `testId` prop is provided for specified elements, which is a unique
37
+ * string that appears as a data attribute `data-testid` in the rendered code,
38
+ * serving as a hook for automated tests
39
+ */
40
+ testId?: string;
39
41
  };
40
42
 
41
43
  export type LozengeProps = Pick<
@@ -0,0 +1,27 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Extract component prop types from UIKit 2 components - TileProps
5
+ *
6
+ * @codegen <<SignedSource::8b1e13d93e3348f59fa7b79a0da227aa>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
+ * @codegenDependency ../../../../forge-ui/src/components/UIKit/tile/__generated__/index.partial.tsx <<SignedSource::d7ec62556fa495888b1d4326b71c4d52>>
9
+ */
10
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
+
12
+ import React from 'react';
13
+ import PlatformTile from '@atlaskit/tile';
14
+
15
+ type PlatformTileProps = React.ComponentProps<typeof PlatformTile>;
16
+
17
+ export type TileProps = Pick<
18
+ PlatformTileProps,
19
+ 'backgroundColor' | 'label' | 'size' | 'children' | 'hasBorder' | 'isInset' | 'testId'
20
+ >;
21
+
22
+ /**
23
+ * A tile is a rounded square that takes an asset and represents a noun.
24
+ *
25
+ * @see [Tile](https://developer.atlassian.com/platform/forge/ui-kit/components/tile/) in UI Kit documentation for more information
26
+ */
27
+ export type TTile<T> = (props: TileProps) => T;
@@ -57,6 +57,7 @@ export type { TagGroupProps, TTagGroup } from './TagGroupProps.codegen';
57
57
  export type { SimpleTagProps as TagProps, TSimpleTag as TTag } from './TagProps.codegen';
58
58
  export type { TextAreaProps, TTextArea } from './TextAreaProps.codegen';
59
59
  export type { TextfieldProps, TTextfield } from './TextfieldProps.codegen';
60
+ export type { TileProps, TTile } from './TileProps.codegen';
60
61
  export type { TimePickerProps, TTimePicker } from './TimePickerProps.codegen';
61
62
  export type { ToggleProps, TToggle } from './ToggleProps.codegen';
62
63
  export type { TooltipProps, TTooltip } from './TooltipProps.codegen';
package/src/index.ts CHANGED
@@ -55,6 +55,7 @@ export type {
55
55
  TextProps,
56
56
  TextAreaProps,
57
57
  TextfieldProps,
58
+ TileProps,
58
59
  ToggleProps,
59
60
  TooltipProps,
60
61
  TimePickerProps,
@@ -127,6 +128,7 @@ export type {
127
128
  TText,
128
129
  TPressable,
129
130
  TFilePicker,
131
+ TTile,
130
132
  } from './components/__generated__';
131
133
 
132
134
  export type {