@atlaskit/forge-react-types 0.20.1 → 0.22.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/components/charts/BarChartProps.js +5 -1
  3. package/dist/cjs/components/charts/LineChartProps.js +5 -1
  4. package/dist/cjs/components/charts/PieChartProps.js +5 -0
  5. package/dist/cjs/types/ColourTokens.js +5 -0
  6. package/dist/cjs/types/index.js +1 -0
  7. package/dist/es2019/components/charts/BarChartProps.js +1 -0
  8. package/dist/es2019/components/charts/LineChartProps.js +1 -0
  9. package/dist/es2019/components/charts/PieChartProps.js +1 -0
  10. package/dist/es2019/types/ColourTokens.js +1 -0
  11. package/dist/es2019/types/index.js +0 -0
  12. package/dist/esm/components/charts/BarChartProps.js +1 -0
  13. package/dist/esm/components/charts/LineChartProps.js +1 -0
  14. package/dist/esm/components/charts/PieChartProps.js +1 -0
  15. package/dist/esm/types/ColourTokens.js +1 -0
  16. package/dist/esm/types/index.js +0 -0
  17. package/dist/types/components/charts/BarChartProps.d.ts +8 -3
  18. package/dist/types/components/charts/LineChartProps.d.ts +2 -1
  19. package/dist/types/components/charts/PieChartProps.d.ts +15 -0
  20. package/dist/types/components/charts/index.d.ts +1 -0
  21. package/dist/types/index.d.ts +2 -1
  22. package/dist/types/types/ColourTokens.d.ts +4 -0
  23. package/dist/types/types/index.d.ts +1 -0
  24. package/dist/types-ts4.5/components/charts/BarChartProps.d.ts +8 -3
  25. package/dist/types-ts4.5/components/charts/LineChartProps.d.ts +2 -1
  26. package/dist/types-ts4.5/components/charts/PieChartProps.d.ts +15 -0
  27. package/dist/types-ts4.5/components/charts/index.d.ts +1 -0
  28. package/dist/types-ts4.5/index.d.ts +2 -1
  29. package/dist/types-ts4.5/types/ColourTokens.d.ts +4 -0
  30. package/dist/types-ts4.5/types/index.d.ts +1 -0
  31. package/package.json +3 -3
  32. package/src/components/charts/BarChartProps.tsx +9 -3
  33. package/src/components/charts/LineChartProps.tsx +3 -1
  34. package/src/components/charts/PieChartProps.tsx +16 -0
  35. package/src/components/charts/index.ts +1 -1
  36. package/src/index.ts +3 -0
  37. package/src/types/ColourTokens.ts +5 -0
  38. package/src/types/index.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/forge-react-types
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#114728](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114728)
8
+ [`624681820dace`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/624681820dace) -
9
+ colorAccessor is now a mandatory prop for StackBarChart and HorizontalStackBarChart
10
+ - [#114508](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114508)
11
+ [`7760a71229d04`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7760a71229d04) -
12
+ Add chart color token support to UI Kit charts.
13
+
14
+ ## 0.21.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#113502](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113502)
19
+ [`a6b334ccc7d63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a6b334ccc7d63) -
20
+ Add PieChart component to UI Kit
21
+
3
22
  ## 0.20.1
4
23
 
5
24
  ### Patch Changes
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -1,3 +1,4 @@
1
+ import type { ChartColorTokens } from '../../types';
1
2
  export type BarChartProps = {
2
3
  width?: number;
3
4
  height?: number;
@@ -8,8 +9,12 @@ export type BarChartProps = {
8
9
  colorAccessor?: number | string;
9
10
  title?: string;
10
11
  subtitle?: string;
11
- colors?: string[];
12
+ colors?: ChartColorTokens[];
13
+ };
14
+ type StackChartProps = BarChartProps & {
15
+ colorAccessor: number | string;
12
16
  };
13
- export type StackBarChartProps = BarChartProps;
14
- export type HorizontalStackBarChartProps = BarChartProps;
15
17
  export type HorizontalBarChartProps = BarChartProps;
18
+ export type StackBarChartProps = StackChartProps;
19
+ export type HorizontalStackBarChartProps = StackChartProps;
20
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { ChartColorTokens } from '../../types';
1
2
  export type LineChartProps = {
2
3
  width?: number;
3
4
  height?: number;
@@ -8,5 +9,5 @@ export type LineChartProps = {
8
9
  colorAccessor?: number | string;
9
10
  title?: string;
10
11
  subtitle?: string;
11
- colors?: string[];
12
+ colors?: ChartColorTokens[];
12
13
  };
@@ -0,0 +1,15 @@
1
+ import type { ChartColorTokens } from '../../types';
2
+ export type PieChartProps = {
3
+ width?: number;
4
+ height?: number;
5
+ data: unknown[];
6
+ showBorder?: boolean;
7
+ colorAccessor: number | string;
8
+ valueAccessor: number | string;
9
+ labelAccessor: number | string;
10
+ title?: string;
11
+ subtitle?: string;
12
+ isDonut?: boolean;
13
+ showMarkLabels?: boolean;
14
+ colors?: ChartColorTokens[];
15
+ };
@@ -1,3 +1,4 @@
1
1
  export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, } from './BarChartProps';
2
2
  export type { LineChartProps } from './LineChartProps';
3
3
  export type { SingleValueChartProps } from './SingleValueChartProps';
4
+ export type { PieChartProps } from './PieChartProps';
@@ -1,2 +1,3 @@
1
1
  export type { BadgeProps, BannerProps, 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, ValidMessageProps, } from './components/__generated__';
2
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, } from './components/charts';
2
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
3
+ export type { ChartColorTokens } from './types';
@@ -0,0 +1,4 @@
1
+ import type { ActiveTokens } from '@atlaskit/tokens';
2
+ type ExtractChartColorTokens<T> = T extends `color.chart.${string}` ? T : never;
3
+ export type ChartColorTokens = ExtractChartColorTokens<ActiveTokens>;
4
+ export {};
@@ -0,0 +1 @@
1
+ export type { ChartColorTokens } from './ColourTokens';
@@ -1,3 +1,4 @@
1
+ import type { ChartColorTokens } from '../../types';
1
2
  export type BarChartProps = {
2
3
  width?: number;
3
4
  height?: number;
@@ -8,8 +9,12 @@ export type BarChartProps = {
8
9
  colorAccessor?: number | string;
9
10
  title?: string;
10
11
  subtitle?: string;
11
- colors?: string[];
12
+ colors?: ChartColorTokens[];
13
+ };
14
+ type StackChartProps = BarChartProps & {
15
+ colorAccessor: number | string;
12
16
  };
13
- export type StackBarChartProps = BarChartProps;
14
- export type HorizontalStackBarChartProps = BarChartProps;
15
17
  export type HorizontalBarChartProps = BarChartProps;
18
+ export type StackBarChartProps = StackChartProps;
19
+ export type HorizontalStackBarChartProps = StackChartProps;
20
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { ChartColorTokens } from '../../types';
1
2
  export type LineChartProps = {
2
3
  width?: number;
3
4
  height?: number;
@@ -8,5 +9,5 @@ export type LineChartProps = {
8
9
  colorAccessor?: number | string;
9
10
  title?: string;
10
11
  subtitle?: string;
11
- colors?: string[];
12
+ colors?: ChartColorTokens[];
12
13
  };
@@ -0,0 +1,15 @@
1
+ import type { ChartColorTokens } from '../../types';
2
+ export type PieChartProps = {
3
+ width?: number;
4
+ height?: number;
5
+ data: unknown[];
6
+ showBorder?: boolean;
7
+ colorAccessor: number | string;
8
+ valueAccessor: number | string;
9
+ labelAccessor: number | string;
10
+ title?: string;
11
+ subtitle?: string;
12
+ isDonut?: boolean;
13
+ showMarkLabels?: boolean;
14
+ colors?: ChartColorTokens[];
15
+ };
@@ -1,3 +1,4 @@
1
1
  export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, } from './BarChartProps';
2
2
  export type { LineChartProps } from './LineChartProps';
3
3
  export type { SingleValueChartProps } from './SingleValueChartProps';
4
+ export type { PieChartProps } from './PieChartProps';
@@ -1,2 +1,3 @@
1
1
  export type { BadgeProps, BannerProps, 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, ValidMessageProps, } from './components/__generated__';
2
- export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, } from './components/charts';
2
+ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, HorizontalBarChartProps, LineChartProps, SingleValueChartProps, PieChartProps, } from './components/charts';
3
+ export type { ChartColorTokens } from './types';
@@ -0,0 +1,4 @@
1
+ import type { ActiveTokens } from '@atlaskit/tokens';
2
+ type ExtractChartColorTokens<T> = T extends `color.chart.${string}` ? T : never;
3
+ export type ChartColorTokens = ExtractChartColorTokens<ActiveTokens>;
4
+ export {};
@@ -0,0 +1 @@
1
+ export type { ChartColorTokens } from './ColourTokens';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/forge-react-types",
3
- "version": "0.20.1",
3
+ "version": "0.22.0",
4
4
  "description": "Component types for Forge UI Kit React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/heading": "^2.4.0",
38
38
  "@atlaskit/lozenge": "^11.8.0",
39
39
  "@atlaskit/modal-dialog": "^12.14.0",
40
- "@atlaskit/primitives": "^8.0.0",
40
+ "@atlaskit/primitives": "^8.2.0",
41
41
  "@atlaskit/progress-bar": "2.2.0",
42
42
  "@atlaskit/progress-tracker": "8.7.1",
43
43
  "@atlaskit/radio": "^6.4.0",
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/textarea": "^5.5.0",
52
52
  "@atlaskit/textfield": "^6.4.0",
53
53
  "@atlaskit/toggle": "^13.2.0",
54
- "@atlaskit/tokens": "^1.52.0",
54
+ "@atlaskit/tokens": "^1.53.0",
55
55
  "@atlaskit/tooltip": "^18.5.0",
56
56
  "@babel/runtime": "^7.0.0"
57
57
  },
@@ -1,3 +1,5 @@
1
+ import type { ChartColorTokens } from '../../types';
2
+
1
3
  export type BarChartProps = {
2
4
  width?: number;
3
5
  height?: number;
@@ -8,9 +10,13 @@ export type BarChartProps = {
8
10
  colorAccessor?: number | string;
9
11
  title?: string;
10
12
  subtitle?: string;
11
- colors?: string[];
13
+ colors?: ChartColorTokens[];
14
+ };
15
+
16
+ type StackChartProps = BarChartProps & {
17
+ colorAccessor: number | string;
12
18
  };
13
19
 
14
- export type StackBarChartProps = BarChartProps;
15
- export type HorizontalStackBarChartProps = BarChartProps;
16
20
  export type HorizontalBarChartProps = BarChartProps;
21
+ export type StackBarChartProps = StackChartProps;
22
+ export type HorizontalStackBarChartProps = StackChartProps;
@@ -1,3 +1,5 @@
1
+ import type { ChartColorTokens } from '../../types';
2
+
1
3
  export type LineChartProps = {
2
4
  width?: number;
3
5
  height?: number;
@@ -8,5 +10,5 @@ export type LineChartProps = {
8
10
  colorAccessor?: number | string;
9
11
  title?: string;
10
12
  subtitle?: string;
11
- colors?: string[];
13
+ colors?: ChartColorTokens[];
12
14
  };
@@ -0,0 +1,16 @@
1
+ import type { ChartColorTokens } from '../../types';
2
+
3
+ export type PieChartProps = {
4
+ width?: number;
5
+ height?: number;
6
+ data: unknown[];
7
+ showBorder?: boolean;
8
+ colorAccessor: number | string;
9
+ valueAccessor: number | string;
10
+ labelAccessor: number | string;
11
+ title?: string;
12
+ subtitle?: string;
13
+ isDonut?: boolean;
14
+ showMarkLabels?: boolean;
15
+ colors?: ChartColorTokens[];
16
+ };
@@ -6,5 +6,5 @@ export type {
6
6
  } from './BarChartProps';
7
7
 
8
8
  export type { LineChartProps } from './LineChartProps';
9
-
10
9
  export type { SingleValueChartProps } from './SingleValueChartProps';
10
+ export type { PieChartProps } from './PieChartProps';
package/src/index.ts CHANGED
@@ -66,4 +66,7 @@ export type {
66
66
  HorizontalBarChartProps,
67
67
  LineChartProps,
68
68
  SingleValueChartProps,
69
+ PieChartProps,
69
70
  } from './components/charts';
71
+
72
+ export type { ChartColorTokens } from './types';
@@ -0,0 +1,5 @@
1
+ import type { ActiveTokens } from '@atlaskit/tokens';
2
+
3
+ type ExtractChartColorTokens<T> = T extends `color.chart.${string}` ? T : never;
4
+
5
+ export type ChartColorTokens = ExtractChartColorTokens<ActiveTokens>;
@@ -0,0 +1 @@
1
+ export type { ChartColorTokens } from './ColourTokens';