@atlaskit/table 0.4.0 → 0.4.1

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,11 @@
1
1
  # @atlaskit/table
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactElement } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- export declare type BodyProps<Item extends object> = {
4
+ export type BodyProps<Item extends object> = {
5
5
  rows: Item[];
6
6
  children: (row: Item) => ReactElement;
7
7
  } | {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ExpandableRowContentProps = {
2
+ type ExpandableRowContentProps = {
3
3
  children?: React.ReactNode;
4
4
  };
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ExpandableRowProps = {
2
+ type ExpandableRowProps = {
3
3
  children: React.ReactNode;
4
4
  /**
5
5
  * Controlled: If the row is expanded.
@@ -1,6 +1,6 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import { SelectableActions, SelectableState } from './use-selectable';
3
- declare type SelectionContext = [
3
+ type SelectionContext = [
4
4
  SelectableState,
5
5
  /**
6
6
  * Context actions will be undefined without a `SelectionProvider` mounted.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ExpandContentContext = {
2
+ type ExpandContentContext = {
3
3
  isExpandableContent: boolean;
4
4
  };
5
5
  declare const ExpandContentContext: React.Context<ExpandContentContext>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ExpandContextState = {
2
+ type ExpandContextState = {
3
3
  isExpanded: boolean;
4
4
  toggleExpanded(): void;
5
5
  };
@@ -1,4 +1,4 @@
1
- export declare type SelectableState = {
1
+ export type SelectableState = {
2
2
  /**
3
3
  * The localised ids that have been checked.
4
4
  */
@@ -27,7 +27,7 @@ export declare type SelectableState = {
27
27
  */
28
28
  previousSelection: number[];
29
29
  };
30
- export declare type SelectableActions = {
30
+ export type SelectableActions = {
31
31
  setAll: () => void;
32
32
  removeAll: () => void;
33
33
  toggleSelection: (id: number, shiftHeld: boolean) => void;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- export declare type SortDirection = 'ascending' | 'descending';
3
- export declare type SortKey<Key extends string | symbol | number> = Key | 'unset';
4
- export declare type TableContext<T, K extends keyof T = keyof T> = {
2
+ export type SortDirection = 'ascending' | 'descending';
3
+ export type SortKey<Key extends string | symbol | number> = Key | 'unset';
4
+ export type TableContext<T, K extends keyof T = keyof T> = {
5
5
  isSelectable?: boolean;
6
6
  sortKey: SortKey<K>;
7
7
  sortDirection?: SortDirection;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { FC, ReactNode } from 'react';
3
- export declare type RowProps = {
3
+ export type RowProps = {
4
4
  /**
5
5
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
6
6
  * in the rendered code, serving as a hook for automated tests.
@@ -2,7 +2,7 @@
2
2
  import { ReactElement } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import { SortKey } from './hooks/use-table';
5
- export declare type TableProps<ItemType extends object = {}> = {
5
+ export type TableProps<ItemType extends object = {}> = {
6
6
  /**
7
7
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
8
8
  * in the rendered code, serving as a hook for automated tests.
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { FC, ReactNode } from 'react';
3
- declare type THeadProps = {
3
+ type THeadProps = {
4
4
  actions?: (selected: number[]) => ReactNode;
5
5
  children?: ReactNode;
6
6
  };
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  import { BoxProps } from '@atlaskit/ds-explorations/box';
4
- export declare type BaseCellProps = {
4
+ export type BaseCellProps = {
5
5
  /**
6
6
  * A percentage of pixel width of the table to apply to a column.
7
7
  */
@@ -37,7 +37,7 @@ export declare type BaseCellProps = {
37
37
  /**
38
38
  * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
39
39
  */
40
- export declare type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
40
+ export type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
41
41
  declare const alignMap: {
42
42
  readonly text: import("@emotion/react").SerializedStyles;
43
43
  readonly number: import("@emotion/react").SerializedStyles;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- declare type ExpandableCellProps = {
4
+ type ExpandableCellProps = {
5
5
  as: 'td' | 'th';
6
6
  children?: ReactNode;
7
7
  };
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- declare type SelectableCellProps = {
4
+ type SelectableCellProps = {
5
5
  as: 'td' | 'th';
6
6
  children?: ReactNode;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { FC, ReactNode } from 'react';
3
- declare type TableProps = {
3
+ type TableProps = {
4
4
  /**
5
5
  * A `testId` prop is a unique string that appears as a data attribute `data-testid`
6
6
  * in the rendered code, serving as a hook for automated tests.
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { BaseCellProps, SortDirection } from './base-cell';
3
- export declare type THProps = Omit<BaseCellProps, 'as'>;
4
- declare type InternalTHProps = THProps & {
3
+ export type THProps = Omit<BaseCellProps, 'as'>;
4
+ type InternalTHProps = THProps & {
5
5
  sortDirection?: SortDirection;
6
6
  };
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A table is used to display data.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,6 +25,14 @@
25
25
  "module": "dist/esm/index.js",
26
26
  "module:es2019": "dist/es2019/index.js",
27
27
  "types": "dist/types/index.d.ts",
28
+ "typesVersions": {
29
+ ">=4.5 <4.9": {
30
+ "*": [
31
+ "dist/types-ts4.5/*",
32
+ "dist/types-ts4.5/index.d.ts"
33
+ ]
34
+ }
35
+ },
28
36
  "sideEffects": false,
29
37
  "atlaskit:src": "src/index.tsx",
30
38
  "af:exports": {
@@ -33,13 +41,13 @@
33
41
  },
34
42
  "dependencies": {
35
43
  "@atlaskit/button": "^16.7.0",
36
- "@atlaskit/checkbox": "^12.5.0",
44
+ "@atlaskit/checkbox": "^12.6.0",
37
45
  "@atlaskit/ds-explorations": "^2.1.0",
38
46
  "@atlaskit/ds-lib": "^2.2.0",
39
47
  "@atlaskit/focus-ring": "^1.3.0",
40
48
  "@atlaskit/icon": "^21.12.0",
41
49
  "@atlaskit/primitives": "^0.9.0",
42
- "@atlaskit/tokens": "^1.3.0",
50
+ "@atlaskit/tokens": "^1.4.0",
43
51
  "@atlaskit/tooltip": "^17.8.0",
44
52
  "@atlaskit/visually-hidden": "^1.2.0",
45
53
  "@babel/runtime": "^7.0.0",
@@ -67,7 +75,7 @@
67
75
  "jest-axe": "^4.0.0",
68
76
  "react-dom": "^16.8.0",
69
77
  "storybook-addon-designs": "^6.3.1",
70
- "typescript": "4.5.5",
78
+ "typescript": "~4.9.5",
71
79
  "wait-for-expect": "^1.2.0"
72
80
  },
73
81
  "techstack": {
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/ui/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/ui/index.d.ts"
11
+ "../dist/types-ts4.5/ui/index.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -0,0 +1,130 @@
1
+ ## API Report File for "@atlaskit/table"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ /// <reference types="react" />
8
+
9
+ import { BoxProps } from '@atlaskit/ds-explorations/box';
10
+ import { FC } from 'react';
11
+ import { jsx } from '@emotion/react';
12
+ import { MemoExoticComponent } from 'react';
13
+ import { default as React_2 } from 'react';
14
+ import { ReactElement } from 'react';
15
+ import { ReactNode } from 'react';
16
+ import { SerializedStyles } from '@emotion/react';
17
+
18
+ // @public (undocumented)
19
+ const alignMap: {
20
+ readonly text: SerializedStyles;
21
+ readonly number: SerializedStyles;
22
+ readonly icon: SerializedStyles;
23
+ };
24
+
25
+ // @public (undocumented)
26
+ type BaseCellProps = {
27
+ width?: string;
28
+ align?: keyof typeof alignMap;
29
+ as?: 'td' | 'th';
30
+ scope?: 'col' | 'row';
31
+ testId?: string;
32
+ children?: ReactNode;
33
+ colSpan?: number;
34
+ } & Pick<BoxProps, 'backgroundColor' | 'className' | 'paddingBlock' | 'paddingInline'>;
35
+
36
+ // @public (undocumented)
37
+ type BodyProps<Item extends object> = {
38
+ rows: Item[];
39
+ children: (row: Item) => ReactElement;
40
+ } | {
41
+ rows?: never;
42
+ children: ReactElement | ReactElement[];
43
+ };
44
+
45
+ // @public
46
+ export const Cell: FC<Omit<BaseCellProps, 'as'>>;
47
+
48
+ // @public (undocumented)
49
+ interface CellProps {
50
+ // (undocumented)
51
+ children?: ReactNode;
52
+ name: string;
53
+ // (undocumented)
54
+ onClick?: React.MouseEventHandler;
55
+ testId?: string;
56
+ }
57
+
58
+ // @public
59
+ export const ExpandableCell: MemoExoticComponent<() => jsx.JSX.Element>;
60
+
61
+ // @public
62
+ export const ExpandableRow: ({ children, isExpanded, isDefaultExpanded, }: ExpandableRowProps) => JSX.Element;
63
+
64
+ // @public
65
+ export const ExpandableRowContent: ({ children }: ExpandableRowContentProps) => JSX.Element;
66
+
67
+ // @public (undocumented)
68
+ type ExpandableRowContentProps = {
69
+ children?: React_2.ReactNode;
70
+ };
71
+
72
+ // @public (undocumented)
73
+ type ExpandableRowProps = {
74
+ children: React_2.ReactNode;
75
+ isExpanded?: boolean;
76
+ isDefaultExpanded?: boolean;
77
+ };
78
+
79
+ // @public
80
+ export const HeadCell: FC<THProps>;
81
+
82
+ // @public
83
+ export const Row: FC<RowProps>;
84
+
85
+ // @public (undocumented)
86
+ type RowProps = {
87
+ testId?: string;
88
+ children?: ReactNode;
89
+ };
90
+
91
+ // @public
92
+ export const SortableColumn: FC<CellProps>;
93
+
94
+ // @public (undocumented)
95
+ type SortKey<Key extends number | string | symbol> = 'unset' | Key;
96
+
97
+ // @public
98
+ function Table<ItemType extends object = object>({ children, isSelectable, sortKey, testId, }: TableProps<ItemType>): jsx.JSX.Element;
99
+ export default Table;
100
+
101
+ // @public (undocumented)
102
+ type TableProps<ItemType extends object = {}> = {
103
+ testId?: string;
104
+ sortKey?: SortKey<keyof ItemType>;
105
+ children: ReactElement | ReactElement[];
106
+ } & ({
107
+ isSelectable: true;
108
+ defaultSelected?: number;
109
+ } | {
110
+ isSelectable?: false;
111
+ });
112
+
113
+ // @public
114
+ export function TBody<ObjectType extends object>({ rows, children, }: BodyProps<ObjectType>): jsx.JSX.Element;
115
+
116
+ // @public (undocumented)
117
+ export const THead: FC<THeadProps>;
118
+
119
+ // @public (undocumented)
120
+ type THeadProps = {
121
+ actions?: (selected: number[]) => ReactNode;
122
+ children?: ReactNode;
123
+ };
124
+
125
+ // @public (undocumented)
126
+ type THProps = Omit<BaseCellProps, 'as'>;
127
+
128
+ // (No @packageDocumentation comment for this package)
129
+
130
+ ```