@atlaskit/forge-react-types 0.37.8 → 0.37.10

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,22 @@
1
1
  # @atlaskit/forge-react-types
2
2
 
3
+ ## 0.37.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#123531](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123531)
8
+ [`661b1bc0352d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/661b1bc0352d1) -
9
+ Exposing UIKit JSDoc enabled chart component types
10
+ - Updated dependencies
11
+
12
+ ## 0.37.9
13
+
14
+ ### Patch Changes
15
+
16
+ - [#123324](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123324)
17
+ [`f5904f3eb2d35`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f5904f3eb2d35) -
18
+ Export UI Kit Component types for Charts with JSDoc comments
19
+
3
20
  ## 0.37.8
4
21
 
5
22
  ### Patch Changes
@@ -1,20 +1,109 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type BarChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#1--array-of-arrays).
14
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
17
+ /**
18
+ * Boolean to display the chart border. Defaults to `false`.
19
+ */
6
20
  showBorder?: boolean;
21
+ /**
22
+ * Accessor to define the x-axis values. This can be a numerical or string index.
23
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#data).
24
+ */
7
25
  xAccessor: number | string;
26
+ /**
27
+ * Accessor to define the y-axis values.
28
+ */
8
29
  yAccessor: number | string;
30
+ /**
31
+ * Accessor to define the color grouping.
32
+ */
9
33
  colorAccessor?: number | string;
34
+ /**
35
+ * A string value that represents the title of the chart.
36
+ */
10
37
  title?: string;
38
+ /**
39
+ * A string value that represents the subtitle of the chart. This appears below the title.
40
+ */
11
41
  subtitle?: string;
42
+ /**
43
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
44
+ * This is utilized to render each bar with the specified colors, based on the color grouping given by colorAccessor.
45
+ */
12
46
  colors?: ChartColorTokens[];
13
47
  };
14
48
  type StackChartProps = BarChartProps & {
49
+ /**
50
+ * Accessor to define the color grouping.
51
+ */
15
52
  colorAccessor: number | string;
16
53
  };
17
- export type HorizontalBarChartProps = BarChartProps;
18
- export type StackBarChartProps = StackChartProps;
19
- export type HorizontalStackBarChartProps = StackChartProps;
54
+ export type HorizontalBarChartProps = BarChartProps & {
55
+ /**
56
+ * Data can be one of two formats:
57
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#1--array-of-arrays).
58
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#2--array-of-objects).
59
+ */
60
+ data: unknown[];
61
+ /**
62
+ * Accessor to define the x-axis values. This can be a numerical or string index.
63
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#data).
64
+ */
65
+ xAccessor: number | string;
66
+ };
67
+ export type StackBarChartProps = StackChartProps & {
68
+ /**
69
+ * Data can be one of two formats:
70
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#1--array-of-arrays).
71
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#2--array-of-objects).
72
+ */
73
+ data: unknown[];
74
+ /**
75
+ * Accessor to define the x-axis values. This can be a numerical or string index.
76
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#data).
77
+ */
78
+ xAccessor: number | string;
79
+ };
80
+ export type HorizontalStackBarChartProps = StackChartProps & {
81
+ /**
82
+ * Data can be one of two formats:
83
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#1--array-of-arrays).
84
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#2--array-of-objects).
85
+ */
86
+ data: unknown[];
87
+ /**
88
+ * Accessor to define the x-axis values. This can be a numerical or string index.
89
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#data).
90
+ */
91
+ xAccessor: number | string;
92
+ };
93
+ /**
94
+ * A visual representation of data using rectangular bars of varying heights to compare different categories or values.
95
+ */
96
+ export type TBarChart<T> = (props: BarChartProps) => T;
97
+ /**
98
+ * A visual representation of data using horizontal rectangular bars of varying lengths to compare different categories or values.
99
+ */
100
+ export type THorizontalBarChart<T> = (props: HorizontalBarChartProps) => T;
101
+ /**
102
+ * A visual representation of data using rectangular bars of varying heights to demonstrate comparisons between categories of data.
103
+ */
104
+ export type TStackBarChart<T> = (props: StackBarChartProps) => T;
105
+ /**
106
+ * A visual representation of data using horizontal rectangular bars of varying lengths to demonstrate comparisons between categories of data.
107
+ */
108
+ export type THorizontalStackBarChart<T> = (props: HorizontalStackBarChartProps) => T;
20
109
  export {};
@@ -1,13 +1,48 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type LineChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#1--array-of-arrays).
14
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
6
17
  showBorder?: boolean;
18
+ /**
19
+ * Accessor to define the x-axis values. This can be a numerical or string index.
20
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#data).
21
+ */
7
22
  xAccessor: number | string;
23
+ /**
24
+ * Accessor to define the y-axis values.
25
+ */
8
26
  yAccessor: number | string;
27
+ /**
28
+ * Accessor to define the color grouping.
29
+ */
9
30
  colorAccessor?: number | string;
31
+ /**
32
+ * A string value that represents the title of the chart.
33
+ */
10
34
  title?: string;
35
+ /**
36
+ * A string value that represents the subtitle of the chart. This appears below the title.
37
+ */
11
38
  subtitle?: string;
39
+ /**
40
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
41
+ * This is utilized to render each line with the specified colors, based on the color grouping given by colorAccessor.
42
+ */
12
43
  colors?: ChartColorTokens[];
13
44
  };
45
+ /**
46
+ * A visual representation of data showing trends.
47
+ */
48
+ export type TLineChart<T> = (props: LineChartProps) => T;
@@ -1,15 +1,59 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type PieChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. [Array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#1--array-of-arrays).
14
+ * 2. [Array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
17
+ /**
18
+ * Boolean to display the chart border. Defaults to `false`.
19
+ */
6
20
  showBorder?: boolean;
21
+ /**
22
+ * Accessor to define the color grouping. This can be a numerical or string index.
23
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#data).
24
+ */
7
25
  colorAccessor: number | string;
26
+ /**
27
+ * Accessor to define the angle of arcs in a pie.
28
+ */
8
29
  valueAccessor: number | string;
30
+ /**
31
+ * Accessor to define the labels.
32
+ */
9
33
  labelAccessor: number | string;
34
+ /**
35
+ * A string value that represents the title of the chart.
36
+ */
10
37
  title?: string;
38
+ /**
39
+ * A string value that represents the subtitle of the chart. This appears below the title.
40
+ */
11
41
  subtitle?: string;
42
+ /**
43
+ * Boolean to render the pie as the donut variation. Defaults to `false`.
44
+ */
12
45
  isDonut?: boolean;
46
+ /**
47
+ * Boolean to display labels on top of each slice. Defaults to `false`.
48
+ */
13
49
  showMarkLabels?: boolean;
50
+ /**
51
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
52
+ * This is utilized to render each slice with the specified colors, based on the color grouping given by colorAccessor.
53
+ */
14
54
  colors?: ChartColorTokens[];
15
55
  };
56
+ /**
57
+ * A visual representation of data proportions in a circular format.
58
+ */
59
+ export type TPieChart<T> = (props: PieChartProps) => T;
@@ -1,8 +1,33 @@
1
1
  export type SingleValueChartProps = {
2
+ /**
3
+ * Data can be one of two formats:
4
+ * 1. A **number** - The value that is displayed, abbreviated at the thousand, millions, trillions and billions.
5
+ * 2. An **array of numbers**: The first number in the array is used as the display value, the second number in the array is used to calculate the increase/decrease percentage relative to the first number.
6
+ */
2
7
  data: number | number[];
8
+ /**
9
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
10
+ */
3
11
  width?: number;
12
+ /**
13
+ * The static height of the chart in pixels. Defaults to `120`.
14
+ */
4
15
  height?: number;
16
+ /**
17
+ * Boolean to display the chart border. Defaults to `false`.
18
+ */
5
19
  showBorder?: boolean;
20
+ /**
21
+ * A string value that represents the title of the chart.
22
+ */
6
23
  title?: string;
24
+ /**
25
+ * A string value that represents the subtitle of the chart. This appears below the metric value.
26
+ */
7
27
  subtitle?: string;
8
28
  };
29
+ /**
30
+ * A visualization representation of information with a single value as its metrics.
31
+ * The metric can be displayed with a increase/decrease indicator to display trends or changes over time.
32
+ */
33
+ export type TSingleValueChart<T> = (props: SingleValueChartProps) => T;
@@ -1,4 +1,4 @@
1
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, } from './BarChartProps';
2
- export type { LineChartProps } from './LineChartProps';
3
- export type { SingleValueChartProps } from './SingleValueChartProps';
4
- export type { PieChartProps } from './PieChartProps';
1
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, } from './BarChartProps';
2
+ export type { LineChartProps, TLineChart } from './LineChartProps';
3
+ export type { SingleValueChartProps, TSingleValueChart } from './SingleValueChartProps';
4
+ export type { PieChartProps, TPieChart } from './PieChartProps';
@@ -1,3 +1,3 @@
1
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, TextProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, TBadge, TBleed, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, 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, } from './components/__generated__';
2
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
2
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, TLineChart, TSingleValueChart, TPieChart, } from './components/charts';
3
3
  export type { ChartColorTokens } from './types';
@@ -1,20 +1,109 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type BarChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#1--array-of-arrays).
14
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
17
+ /**
18
+ * Boolean to display the chart border. Defaults to `false`.
19
+ */
6
20
  showBorder?: boolean;
21
+ /**
22
+ * Accessor to define the x-axis values. This can be a numerical or string index.
23
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#data).
24
+ */
7
25
  xAccessor: number | string;
26
+ /**
27
+ * Accessor to define the y-axis values.
28
+ */
8
29
  yAccessor: number | string;
30
+ /**
31
+ * Accessor to define the color grouping.
32
+ */
9
33
  colorAccessor?: number | string;
34
+ /**
35
+ * A string value that represents the title of the chart.
36
+ */
10
37
  title?: string;
38
+ /**
39
+ * A string value that represents the subtitle of the chart. This appears below the title.
40
+ */
11
41
  subtitle?: string;
42
+ /**
43
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
44
+ * This is utilized to render each bar with the specified colors, based on the color grouping given by colorAccessor.
45
+ */
12
46
  colors?: ChartColorTokens[];
13
47
  };
14
48
  type StackChartProps = BarChartProps & {
49
+ /**
50
+ * Accessor to define the color grouping.
51
+ */
15
52
  colorAccessor: number | string;
16
53
  };
17
- export type HorizontalBarChartProps = BarChartProps;
18
- export type StackBarChartProps = StackChartProps;
19
- export type HorizontalStackBarChartProps = StackChartProps;
54
+ export type HorizontalBarChartProps = BarChartProps & {
55
+ /**
56
+ * Data can be one of two formats:
57
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#1--array-of-arrays).
58
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#2--array-of-objects).
59
+ */
60
+ data: unknown[];
61
+ /**
62
+ * Accessor to define the x-axis values. This can be a numerical or string index.
63
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#data).
64
+ */
65
+ xAccessor: number | string;
66
+ };
67
+ export type StackBarChartProps = StackChartProps & {
68
+ /**
69
+ * Data can be one of two formats:
70
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#1--array-of-arrays).
71
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#2--array-of-objects).
72
+ */
73
+ data: unknown[];
74
+ /**
75
+ * Accessor to define the x-axis values. This can be a numerical or string index.
76
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#data).
77
+ */
78
+ xAccessor: number | string;
79
+ };
80
+ export type HorizontalStackBarChartProps = StackChartProps & {
81
+ /**
82
+ * Data can be one of two formats:
83
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#1--array-of-arrays).
84
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#2--array-of-objects).
85
+ */
86
+ data: unknown[];
87
+ /**
88
+ * Accessor to define the x-axis values. This can be a numerical or string index.
89
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#data).
90
+ */
91
+ xAccessor: number | string;
92
+ };
93
+ /**
94
+ * A visual representation of data using rectangular bars of varying heights to compare different categories or values.
95
+ */
96
+ export type TBarChart<T> = (props: BarChartProps) => T;
97
+ /**
98
+ * A visual representation of data using horizontal rectangular bars of varying lengths to compare different categories or values.
99
+ */
100
+ export type THorizontalBarChart<T> = (props: HorizontalBarChartProps) => T;
101
+ /**
102
+ * A visual representation of data using rectangular bars of varying heights to demonstrate comparisons between categories of data.
103
+ */
104
+ export type TStackBarChart<T> = (props: StackBarChartProps) => T;
105
+ /**
106
+ * A visual representation of data using horizontal rectangular bars of varying lengths to demonstrate comparisons between categories of data.
107
+ */
108
+ export type THorizontalStackBarChart<T> = (props: HorizontalStackBarChartProps) => T;
20
109
  export {};
@@ -1,13 +1,48 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type LineChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#1--array-of-arrays).
14
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
6
17
  showBorder?: boolean;
18
+ /**
19
+ * Accessor to define the x-axis values. This can be a numerical or string index.
20
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#data).
21
+ */
7
22
  xAccessor: number | string;
23
+ /**
24
+ * Accessor to define the y-axis values.
25
+ */
8
26
  yAccessor: number | string;
27
+ /**
28
+ * Accessor to define the color grouping.
29
+ */
9
30
  colorAccessor?: number | string;
31
+ /**
32
+ * A string value that represents the title of the chart.
33
+ */
10
34
  title?: string;
35
+ /**
36
+ * A string value that represents the subtitle of the chart. This appears below the title.
37
+ */
11
38
  subtitle?: string;
39
+ /**
40
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
41
+ * This is utilized to render each line with the specified colors, based on the color grouping given by colorAccessor.
42
+ */
12
43
  colors?: ChartColorTokens[];
13
44
  };
45
+ /**
46
+ * A visual representation of data showing trends.
47
+ */
48
+ export type TLineChart<T> = (props: LineChartProps) => T;
@@ -1,15 +1,59 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
  export type PieChartProps = {
3
+ /**
4
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
5
+ */
3
6
  width?: number;
7
+ /**
8
+ * The static height of the chart in pixels. Defaults to `400`.
9
+ */
4
10
  height?: number;
11
+ /**
12
+ * Data can be one of two formats:
13
+ * 1. [Array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#1--array-of-arrays).
14
+ * 2. [Array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#2--array-of-objects).
15
+ */
5
16
  data: unknown[];
17
+ /**
18
+ * Boolean to display the chart border. Defaults to `false`.
19
+ */
6
20
  showBorder?: boolean;
21
+ /**
22
+ * Accessor to define the color grouping. This can be a numerical or string index.
23
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#data).
24
+ */
7
25
  colorAccessor: number | string;
26
+ /**
27
+ * Accessor to define the angle of arcs in a pie.
28
+ */
8
29
  valueAccessor: number | string;
30
+ /**
31
+ * Accessor to define the labels.
32
+ */
9
33
  labelAccessor: number | string;
34
+ /**
35
+ * A string value that represents the title of the chart.
36
+ */
10
37
  title?: string;
38
+ /**
39
+ * A string value that represents the subtitle of the chart. This appears below the title.
40
+ */
11
41
  subtitle?: string;
42
+ /**
43
+ * Boolean to render the pie as the donut variation. Defaults to `false`.
44
+ */
12
45
  isDonut?: boolean;
46
+ /**
47
+ * Boolean to display labels on top of each slice. Defaults to `false`.
48
+ */
13
49
  showMarkLabels?: boolean;
50
+ /**
51
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
52
+ * This is utilized to render each slice with the specified colors, based on the color grouping given by colorAccessor.
53
+ */
14
54
  colors?: ChartColorTokens[];
15
55
  };
56
+ /**
57
+ * A visual representation of data proportions in a circular format.
58
+ */
59
+ export type TPieChart<T> = (props: PieChartProps) => T;
@@ -1,8 +1,33 @@
1
1
  export type SingleValueChartProps = {
2
+ /**
3
+ * Data can be one of two formats:
4
+ * 1. A **number** - The value that is displayed, abbreviated at the thousand, millions, trillions and billions.
5
+ * 2. An **array of numbers**: The first number in the array is used as the display value, the second number in the array is used to calculate the increase/decrease percentage relative to the first number.
6
+ */
2
7
  data: number | number[];
8
+ /**
9
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
10
+ */
3
11
  width?: number;
12
+ /**
13
+ * The static height of the chart in pixels. Defaults to `120`.
14
+ */
4
15
  height?: number;
16
+ /**
17
+ * Boolean to display the chart border. Defaults to `false`.
18
+ */
5
19
  showBorder?: boolean;
20
+ /**
21
+ * A string value that represents the title of the chart.
22
+ */
6
23
  title?: string;
24
+ /**
25
+ * A string value that represents the subtitle of the chart. This appears below the metric value.
26
+ */
7
27
  subtitle?: string;
8
28
  };
29
+ /**
30
+ * A visualization representation of information with a single value as its metrics.
31
+ * The metric can be displayed with a increase/decrease indicator to display trends or changes over time.
32
+ */
33
+ export type TSingleValueChart<T> = (props: SingleValueChartProps) => T;
@@ -1,4 +1,4 @@
1
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, } from './BarChartProps';
2
- export type { LineChartProps } from './LineChartProps';
3
- export type { SingleValueChartProps } from './SingleValueChartProps';
4
- export type { PieChartProps } from './PieChartProps';
1
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, } from './BarChartProps';
2
+ export type { LineChartProps, TLineChart } from './LineChartProps';
3
+ export type { SingleValueChartProps, TSingleValueChart } from './SingleValueChartProps';
4
+ export type { PieChartProps, TPieChart } from './PieChartProps';
@@ -1,3 +1,3 @@
1
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, TextProps, TextAreaProps, TextfieldProps, ToggleProps, TooltipProps, TimePickerProps, ValidMessageProps, PopupProps, InlineEditProps, TBadge, TBleed, TBox, TButtonGroup, TButton, TCalendar, TCheckbox, TCheckboxGroup, TCodeBlock, TCode, TDatePicker, TDynamicTable, TEmptyState, TErrorMessage, 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, } from './components/__generated__';
2
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
2
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, TBarChart, TStackBarChart, THorizontalStackBarChart, THorizontalBarChart, TLineChart, TSingleValueChart, TPieChart, } 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.37.8",
3
+ "version": "0.37.10",
4
4
  "description": "Component types for Forge UI Kit React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,17 +34,17 @@
34
34
  "@atlaskit/empty-state": "^9.0.0",
35
35
  "@atlaskit/form": "^12.0.0",
36
36
  "@atlaskit/heading": "^5.1.0",
37
- "@atlaskit/inline-edit": "^15.0.0",
37
+ "@atlaskit/inline-edit": "^15.1.0",
38
38
  "@atlaskit/lozenge": "^12.2.0",
39
39
  "@atlaskit/modal-dialog": "^13.0.0",
40
40
  "@atlaskit/popup": "^2.0.0",
41
41
  "@atlaskit/primitives": "^14.1.0",
42
- "@atlaskit/progress-bar": "4.0.3",
43
- "@atlaskit/progress-tracker": "10.0.2",
42
+ "@atlaskit/progress-bar": "^4.0.0",
43
+ "@atlaskit/progress-tracker": "^10.0.0",
44
44
  "@atlaskit/radio": "^8.0.0",
45
45
  "@atlaskit/range": "^9.0.0",
46
46
  "@atlaskit/renderer": "^113.2.0",
47
- "@atlaskit/section-message": "^8.0.0",
47
+ "@atlaskit/section-message": "^8.1.0",
48
48
  "@atlaskit/select": "^20.0.0",
49
49
  "@atlaskit/spinner": "^18.0.0",
50
50
  "@atlaskit/tabs": "^18.0.0",
@@ -61,7 +61,7 @@
61
61
  "react": "^18.2.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@atlassian/codegen": "^0.1.2",
64
+ "@atlassian/codegen": "^0.1.0",
65
65
  "@types/node": "~20.16.5",
66
66
  "react": "^18.2.0",
67
67
  "ts-morph": "^17.0.0",
@@ -1,22 +1,120 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
 
3
3
  export type BarChartProps = {
4
+ /**
5
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
6
+ */
4
7
  width?: number;
8
+ /**
9
+ * The static height of the chart in pixels. Defaults to `400`.
10
+ */
5
11
  height?: number;
12
+ /**
13
+ * Data can be one of two formats:
14
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#1--array-of-arrays).
15
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#2--array-of-objects).
16
+ */
6
17
  data: unknown[];
18
+ /**
19
+ * Boolean to display the chart border. Defaults to `false`.
20
+ */
7
21
  showBorder?: boolean;
22
+ /**
23
+ * Accessor to define the x-axis values. This can be a numerical or string index.
24
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/bar-chart/#data).
25
+ */
8
26
  xAccessor: number | string;
27
+ /**
28
+ * Accessor to define the y-axis values.
29
+ */
9
30
  yAccessor: number | string;
31
+ /**
32
+ * Accessor to define the color grouping.
33
+ */
10
34
  colorAccessor?: number | string;
35
+ /**
36
+ * A string value that represents the title of the chart.
37
+ */
11
38
  title?: string;
39
+ /**
40
+ * A string value that represents the subtitle of the chart. This appears below the title.
41
+ */
12
42
  subtitle?: string;
43
+ /**
44
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
45
+ * This is utilized to render each bar with the specified colors, based on the color grouping given by colorAccessor.
46
+ */
13
47
  colors?: ChartColorTokens[];
14
48
  };
15
49
 
16
50
  type StackChartProps = BarChartProps & {
51
+ /**
52
+ * Accessor to define the color grouping.
53
+ */
17
54
  colorAccessor: number | string;
18
55
  };
19
56
 
20
- export type HorizontalBarChartProps = BarChartProps;
21
- export type StackBarChartProps = StackChartProps;
22
- export type HorizontalStackBarChartProps = StackChartProps;
57
+ export type HorizontalBarChartProps = BarChartProps & {
58
+ /**
59
+ * Data can be one of two formats:
60
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#1--array-of-arrays).
61
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#2--array-of-objects).
62
+ */
63
+ data: unknown[];
64
+
65
+ /**
66
+ * Accessor to define the x-axis values. This can be a numerical or string index.
67
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-bar-chart/#data).
68
+ */
69
+ xAccessor: number | string;
70
+ };
71
+
72
+ export type StackBarChartProps = StackChartProps & {
73
+ /**
74
+ * Data can be one of two formats:
75
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#1--array-of-arrays).
76
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#2--array-of-objects).
77
+ */
78
+ data: unknown[];
79
+
80
+ /**
81
+ * Accessor to define the x-axis values. This can be a numerical or string index.
82
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/stack-bar-chart/#data).
83
+ */
84
+ xAccessor: number | string;
85
+ };
86
+
87
+ export type HorizontalStackBarChartProps = StackChartProps & {
88
+ /**
89
+ * Data can be one of two formats:
90
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#1--array-of-arrays).
91
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#2--array-of-objects).
92
+ */
93
+ data: unknown[];
94
+
95
+ /**
96
+ * Accessor to define the x-axis values. This can be a numerical or string index.
97
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/horizontal-stack-bar-chart/#data).
98
+ */
99
+ xAccessor: number | string;
100
+ };
101
+
102
+ /**
103
+ * A visual representation of data using rectangular bars of varying heights to compare different categories or values.
104
+ */
105
+ export type TBarChart<T> = (props: BarChartProps) => T;
106
+
107
+ /**
108
+ * A visual representation of data using horizontal rectangular bars of varying lengths to compare different categories or values.
109
+ */
110
+ export type THorizontalBarChart<T> = (props: HorizontalBarChartProps) => T;
111
+
112
+ /**
113
+ * A visual representation of data using rectangular bars of varying heights to demonstrate comparisons between categories of data.
114
+ */
115
+ export type TStackBarChart<T> = (props: StackBarChartProps) => T;
116
+
117
+ /**
118
+ * A visual representation of data using horizontal rectangular bars of varying lengths to demonstrate comparisons between categories of data.
119
+ */
120
+ export type THorizontalStackBarChart<T> = (props: HorizontalStackBarChartProps) => T;
@@ -1,14 +1,50 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
 
3
3
  export type LineChartProps = {
4
+ /**
5
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
6
+ */
4
7
  width?: number;
8
+ /**
9
+ * The static height of the chart in pixels. Defaults to `400`.
10
+ */
5
11
  height?: number;
12
+ /**
13
+ * Data can be one of two formats:
14
+ * 1. An [array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#1--array-of-arrays).
15
+ * 2. An [array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#2--array-of-objects).
16
+ */
6
17
  data: unknown[];
7
18
  showBorder?: boolean;
19
+ /**
20
+ * Accessor to define the x-axis values. This can be a numerical or string index.
21
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/line-chart/#data).
22
+ */
8
23
  xAccessor: number | string;
24
+ /**
25
+ * Accessor to define the y-axis values.
26
+ */
9
27
  yAccessor: number | string;
28
+ /**
29
+ * Accessor to define the color grouping.
30
+ */
10
31
  colorAccessor?: number | string;
32
+ /**
33
+ * A string value that represents the title of the chart.
34
+ */
11
35
  title?: string;
36
+ /**
37
+ * A string value that represents the subtitle of the chart. This appears below the title.
38
+ */
12
39
  subtitle?: string;
40
+ /**
41
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
42
+ * This is utilized to render each line with the specified colors, based on the color grouping given by colorAccessor.
43
+ */
13
44
  colors?: ChartColorTokens[];
14
45
  };
46
+
47
+ /**
48
+ * A visual representation of data showing trends.
49
+ */
50
+ export type TLineChart<T> = (props: LineChartProps) => T;
@@ -1,16 +1,61 @@
1
1
  import type { ChartColorTokens } from '../../types';
2
2
 
3
3
  export type PieChartProps = {
4
+ /**
5
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
6
+ */
4
7
  width?: number;
8
+ /**
9
+ * The static height of the chart in pixels. Defaults to `400`.
10
+ */
5
11
  height?: number;
12
+ /**
13
+ * Data can be one of two formats:
14
+ * 1. [Array of arrays](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#1--array-of-arrays).
15
+ * 2. [Array of objects](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#2--array-of-objects).
16
+ */
6
17
  data: unknown[];
18
+ /**
19
+ * Boolean to display the chart border. Defaults to `false`.
20
+ */
7
21
  showBorder?: boolean;
22
+ /**
23
+ * Accessor to define the color grouping. This can be a numerical or string index.
24
+ * For more information on all accessors, see [Data](https://developer.atlassian.com/platform/forge/ui-kit/components/pie-chart/#data).
25
+ */
8
26
  colorAccessor: number | string;
27
+ /**
28
+ * Accessor to define the angle of arcs in a pie.
29
+ */
9
30
  valueAccessor: number | string;
31
+ /**
32
+ * Accessor to define the labels.
33
+ */
10
34
  labelAccessor: number | string;
35
+ /**
36
+ * A string value that represents the title of the chart.
37
+ */
11
38
  title?: string;
39
+ /**
40
+ * A string value that represents the subtitle of the chart. This appears below the title.
41
+ */
12
42
  subtitle?: string;
43
+ /**
44
+ * Boolean to render the pie as the donut variation. Defaults to `false`.
45
+ */
13
46
  isDonut?: boolean;
47
+ /**
48
+ * Boolean to display labels on top of each slice. Defaults to `false`.
49
+ */
14
50
  showMarkLabels?: boolean;
51
+ /**
52
+ * An array of [chart color tokens](https://atlassian.design/components/tokens/all-tokens#color-chart).
53
+ * This is utilized to render each slice with the specified colors, based on the color grouping given by colorAccessor.
54
+ */
15
55
  colors?: ChartColorTokens[];
16
56
  };
57
+
58
+ /**
59
+ * A visual representation of data proportions in a circular format.
60
+ */
61
+ export type TPieChart<T> = (props: PieChartProps) => T;
@@ -1,8 +1,34 @@
1
1
  export type SingleValueChartProps = {
2
+ /**
3
+ * Data can be one of two formats:
4
+ * 1. A **number** - The value that is displayed, abbreviated at the thousand, millions, trillions and billions.
5
+ * 2. An **array of numbers**: The first number in the array is used as the display value, the second number in the array is used to calculate the increase/decrease percentage relative to the first number.
6
+ */
2
7
  data: number | number[];
8
+ /**
9
+ * The static width of the chart in pixels. If this is not specified, the width is responsive.
10
+ */
3
11
  width?: number;
12
+ /**
13
+ * The static height of the chart in pixels. Defaults to `120`.
14
+ */
4
15
  height?: number;
16
+ /**
17
+ * Boolean to display the chart border. Defaults to `false`.
18
+ */
5
19
  showBorder?: boolean;
20
+ /**
21
+ * A string value that represents the title of the chart.
22
+ */
6
23
  title?: string;
24
+ /**
25
+ * A string value that represents the subtitle of the chart. This appears below the metric value.
26
+ */
7
27
  subtitle?: string;
8
28
  };
29
+
30
+ /**
31
+ * A visualization representation of information with a single value as its metrics.
32
+ * The metric can be displayed with a increase/decrease indicator to display trends or changes over time.
33
+ */
34
+ export type TSingleValueChart<T> = (props: SingleValueChartProps) => T;
@@ -3,8 +3,12 @@ export type {
3
3
  StackBarChartProps,
4
4
  HorizontalStackBarChartProps,
5
5
  HorizontalBarChartProps,
6
+ TBarChart,
7
+ TStackBarChart,
8
+ THorizontalStackBarChart,
9
+ THorizontalBarChart,
6
10
  } from './BarChartProps';
7
11
 
8
- export type { LineChartProps } from './LineChartProps';
9
- export type { SingleValueChartProps } from './SingleValueChartProps';
10
- export type { PieChartProps } from './PieChartProps';
12
+ export type { LineChartProps, TLineChart } from './LineChartProps';
13
+ export type { SingleValueChartProps, TSingleValueChart } from './SingleValueChartProps';
14
+ export type { PieChartProps, TPieChart } from './PieChartProps';
package/src/index.ts CHANGED
@@ -133,6 +133,13 @@ export type {
133
133
  LineChartProps,
134
134
  SingleValueChartProps,
135
135
  PieChartProps,
136
+ TBarChart,
137
+ TStackBarChart,
138
+ THorizontalStackBarChart,
139
+ THorizontalBarChart,
140
+ TLineChart,
141
+ TSingleValueChart,
142
+ TPieChart,
136
143
  } from './components/charts';
137
144
 
138
145
  export type { ChartColorTokens } from './types';