@zendeskgarden/react-tables 9.0.0-next.2 → 9.0.0-next.21

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 (58) hide show
  1. package/README.md +24 -33
  2. package/dist/esm/elements/Body.js +26 -0
  3. package/dist/esm/elements/Caption.js +26 -0
  4. package/dist/esm/elements/Cell.js +50 -0
  5. package/dist/esm/elements/GroupRow.js +33 -0
  6. package/dist/esm/elements/Head.js +33 -0
  7. package/dist/esm/elements/HeaderCell.js +45 -0
  8. package/dist/esm/elements/HeaderRow.js +33 -0
  9. package/dist/esm/elements/OverflowButton.js +37 -0
  10. package/dist/esm/elements/Row.js +76 -0
  11. package/dist/esm/elements/SortableCell.js +63 -0
  12. package/dist/esm/elements/Table.js +70 -0
  13. package/dist/esm/index.js +17 -0
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/sort-fill.svg.js +27 -0
  15. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/sort-stroke.svg.js +27 -0
  16. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/overflow-vertical-stroke.svg.js +25 -0
  17. package/dist/esm/styled/StyledBaseRow.js +46 -0
  18. package/dist/esm/styled/StyledBody.js +22 -0
  19. package/dist/esm/styled/StyledCaption.js +22 -0
  20. package/dist/esm/styled/StyledCell.js +47 -0
  21. package/dist/esm/styled/StyledGroupRow.js +47 -0
  22. package/dist/esm/styled/StyledHead.js +40 -0
  23. package/dist/esm/styled/StyledHeaderCell.js +44 -0
  24. package/dist/esm/styled/StyledHeaderRow.js +46 -0
  25. package/dist/esm/styled/StyledHiddenCell.js +23 -0
  26. package/dist/esm/styled/StyledOverflowButton.js +26 -0
  27. package/dist/esm/styled/StyledRow.js +106 -0
  28. package/dist/esm/styled/StyledSortableButton.js +104 -0
  29. package/dist/esm/styled/StyledTable.js +28 -0
  30. package/dist/esm/styled/style-utils.js +16 -0
  31. package/dist/esm/types/index.js +10 -0
  32. package/dist/esm/utils/useTableContext.js +17 -0
  33. package/dist/index.cjs.js +438 -308
  34. package/dist/typings/elements/Body.d.ts +2 -0
  35. package/dist/typings/elements/Caption.d.ts +2 -0
  36. package/dist/typings/elements/Cell.d.ts +2 -0
  37. package/dist/typings/elements/GroupRow.d.ts +2 -0
  38. package/dist/typings/elements/Head.d.ts +2 -0
  39. package/dist/typings/elements/HeaderCell.d.ts +2 -0
  40. package/dist/typings/elements/HeaderRow.d.ts +2 -0
  41. package/dist/typings/elements/OverflowButton.d.ts +4 -10
  42. package/dist/typings/elements/Row.d.ts +2 -0
  43. package/dist/typings/elements/SortableCell.d.ts +2 -0
  44. package/dist/typings/elements/Table.d.ts +23 -1
  45. package/dist/typings/styled/StyledBaseRow.d.ts +11 -0
  46. package/dist/typings/styled/StyledCell.d.ts +5 -2
  47. package/dist/typings/styled/StyledGroupRow.d.ts +7 -3
  48. package/dist/typings/styled/StyledHead.d.ts +1 -1
  49. package/dist/typings/styled/StyledHeaderCell.d.ts +1 -1
  50. package/dist/typings/styled/StyledHeaderRow.d.ts +7 -3
  51. package/dist/typings/styled/StyledOverflowButton.d.ts +7 -9
  52. package/dist/typings/styled/StyledRow.d.ts +10 -8
  53. package/dist/typings/styled/StyledSortableButton.d.ts +5 -4
  54. package/dist/typings/styled/StyledTable.d.ts +4 -6
  55. package/dist/typings/styled/index.d.ts +1 -1
  56. package/dist/typings/styled/style-utils.d.ts +1 -1
  57. package/package.json +9 -8
  58. package/dist/index.esm.js +0 -637
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import React from 'react';
8
8
  /**
9
+ * @deprecated use `Table.Body` instead
10
+ *
9
11
  * @extends HTMLAttributes<HTMLTableSectionElement>
10
12
  */
11
13
  export declare const Body: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import React from 'react';
8
8
  /**
9
+ * @deprecated use `Table.Caption` instead
10
+ *
9
11
  * @extends HTMLAttributes<HTMLTableCaptionElement>
10
12
  */
11
13
  export declare const Caption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
@@ -7,6 +7,8 @@
7
7
  import React from 'react';
8
8
  import { ICellProps } from '../types';
9
9
  /**
10
+ * @deprecated use `Table.Cell` instead
11
+ *
10
12
  * @extends TdHTMLAttributes<HTMLTableCellElement>
11
13
  */
12
14
  export declare const Cell: React.ForwardRefExoticComponent<ICellProps & React.RefAttributes<HTMLTableCellElement>>;
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import React from 'react';
8
8
  /**
9
+ * @deprecated use `Table.GroupRow` instead
10
+ *
9
11
  * @extends HTMLAttributes<HTMLTableRowElement>
10
12
  */
11
13
  export declare const GroupRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
@@ -7,6 +7,8 @@
7
7
  import React from 'react';
8
8
  import { IHeadProps } from '../types';
9
9
  /**
10
+ * @deprecated use `Table.Head` instead
11
+ *
10
12
  * @extends HTMLAttributes<HTMLTableSectionElement>
11
13
  */
12
14
  export declare const Head: React.ForwardRefExoticComponent<IHeadProps & React.RefAttributes<HTMLTableSectionElement>>;
@@ -7,6 +7,8 @@
7
7
  import React from 'react';
8
8
  import { IHeaderCellProps } from '../types';
9
9
  /**
10
+ * @deprecated use `Table.HeaderCell` instead
11
+ *
10
12
  * @extends ThHTMLAttributes<HTMLTableCellElement>
11
13
  */
12
14
  export declare const HeaderCell: React.ForwardRefExoticComponent<IHeaderCellProps & React.RefAttributes<HTMLTableCellElement>>;
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import React from 'react';
8
8
  /**
9
+ * @deprecated use `Table.HeaderRow` instead
10
+ *
9
11
  * @extends HTMLAttributes<HTMLTableRowElement>
10
12
  */
11
13
  export declare const HeaderRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
@@ -4,16 +4,10 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import React, { ButtonHTMLAttributes } from 'react';
8
- export interface IOverflowButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
9
- /** @ignore Applies hover styling */
10
- isHovered?: boolean;
11
- /** @ignore Applies active styling */
12
- isActive?: boolean;
13
- /** @ignore Applies focus styling */
14
- isFocused?: boolean;
15
- }
7
+ import React from 'react';
16
8
  /**
9
+ * @deprecated use `Table.OverflowButton` instead
10
+ *
17
11
  * @extends ButtonHTMLAttributes<HTMLButtonElement>
18
12
  */
19
- export declare const OverflowButton: React.ForwardRefExoticComponent<IOverflowButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+ export declare const OverflowButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
@@ -7,6 +7,8 @@
7
7
  import React from 'react';
8
8
  import { IRowProps } from '../types';
9
9
  /**
10
+ * @deprecated use `Table.Row` instead
11
+ *
10
12
  * @extends HTMLAttributes<HTMLTableRowElement>
11
13
  */
12
14
  export declare const Row: React.ForwardRefExoticComponent<IRowProps & React.RefAttributes<HTMLTableRowElement>>;
@@ -7,6 +7,8 @@
7
7
  import React from 'react';
8
8
  import { ISortableCellProps } from '../types';
9
9
  /**
10
+ * @deprecated use `Table.SortableCell` instead
11
+ *
10
12
  * @extends ButtonHTMLAttributes<HTMLButtonElement>
11
13
  */
12
14
  export declare const SortableCell: React.ForwardRefExoticComponent<ISortableCellProps & React.RefAttributes<HTMLButtonElement>>;
@@ -6,7 +6,29 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import { ITableProps } from '../types';
9
+ import { Head } from './Head';
10
+ import { Body } from './Body';
11
+ import { Caption } from './Caption';
12
+ import { Cell } from './Cell';
13
+ import { GroupRow } from './GroupRow';
14
+ import { HeaderCell } from './HeaderCell';
15
+ import { HeaderRow } from './HeaderRow';
16
+ import { OverflowButton } from './OverflowButton';
17
+ import { Row } from './Row';
18
+ import { SortableCell } from './SortableCell';
19
+ export declare const TableComponent: React.ForwardRefExoticComponent<ITableProps & React.RefAttributes<HTMLTableElement>>;
9
20
  /**
10
21
  * @extends TableHTMLAttributes<HTMLTableElement>
11
22
  */
12
- export declare const Table: React.ForwardRefExoticComponent<ITableProps & React.RefAttributes<HTMLTableElement>>;
23
+ export declare const Table: React.ForwardRefExoticComponent<ITableProps & React.RefAttributes<HTMLTableElement>> & {
24
+ Body: typeof Body;
25
+ Caption: typeof Caption;
26
+ Cell: typeof Cell;
27
+ GroupRow: typeof GroupRow;
28
+ Head: typeof Head;
29
+ HeaderCell: typeof HeaderCell;
30
+ HeaderRow: typeof HeaderRow;
31
+ OverflowButton: typeof OverflowButton;
32
+ Row: typeof Row;
33
+ SortableCell: typeof SortableCell;
34
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme } from 'styled-components';
8
+ export interface IStyledBaseRowProps {
9
+ $isStriped?: boolean;
10
+ }
11
+ export declare const StyledBaseRow: import("styled-components").StyledComponent<"tr", DefaultTheme, IStyledBaseRowProps, never>;
@@ -6,7 +6,10 @@
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
8
  import { ICellProps, ITableProps } from '../types';
9
- export interface IStyledCellProps extends Pick<ICellProps, 'isMinimum' | 'isTruncated' | 'hasOverflow' | 'width'> {
10
- size?: ITableProps['size'];
9
+ export interface IStyledCellProps extends Pick<ICellProps, 'width'> {
10
+ $size?: ITableProps['size'];
11
+ $isMinimum?: boolean;
12
+ $isTruncated?: boolean;
13
+ $hasOverflow?: boolean;
11
14
  }
12
15
  export declare const StyledCell: import("styled-components").StyledComponent<"td", DefaultTheme, IStyledCellProps, never>;
@@ -5,8 +5,12 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
- import { IStyledRowProps } from './StyledRow';
9
- export declare const StyledGroupRow: import("styled-components").StyledComponent<"tr", DefaultTheme, IStyledRowProps & {
8
+ import { ITableProps } from '../types';
9
+ interface IStyledGroupRowProps {
10
+ $size?: ITableProps['size'];
11
+ }
12
+ export declare const StyledGroupRow: import("styled-components").StyledComponent<"tr", DefaultTheme, import("./StyledBaseRow").IStyledBaseRowProps & {
10
13
  'data-garden-id': string;
11
14
  'data-garden-version': string;
12
- }, "data-garden-id" | "data-garden-version">;
15
+ } & IStyledGroupRowProps, "data-garden-id" | "data-garden-version">;
16
+ export {};
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
8
  interface IStyledHeadProps {
9
- isSticky?: boolean;
9
+ $isSticky?: boolean;
10
10
  }
11
11
  export declare const StyledHead: import("styled-components").StyledComponent<"thead", DefaultTheme, {
12
12
  'data-garden-id': string;
@@ -10,4 +10,4 @@ export declare const StyledHeaderCell: import("styled-components").StyledCompone
10
10
  as: string;
11
11
  'data-garden-id': string;
12
12
  'data-garden-version': string;
13
- }, "data-garden-id" | "data-garden-version" | "as">;
13
+ }, "as" | "data-garden-id" | "data-garden-version">;
@@ -5,8 +5,12 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { DefaultTheme } from 'styled-components';
8
- import { IStyledRowProps } from './StyledRow';
9
- export declare const StyledHeaderRow: import("styled-components").StyledComponent<"tr", DefaultTheme, IStyledRowProps & {
8
+ import { ITableProps } from '../types';
9
+ interface IStyledHeaderRowProps {
10
+ $size?: ITableProps['size'];
11
+ }
12
+ export declare const StyledHeaderRow: import("styled-components").StyledComponent<"tr", DefaultTheme, import("./StyledBaseRow").IStyledBaseRowProps & {
10
13
  'data-garden-id': string;
11
14
  'data-garden-version': string;
12
- }, "data-garden-id" | "data-garden-version">;
15
+ } & IStyledHeaderRowProps, "data-garden-id" | "data-garden-version">;
16
+ export {};
@@ -4,18 +4,16 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { DefaultTheme } from 'styled-components';
7
+ /// <reference types="react" />
8
8
  import { ITableProps } from '../types';
9
9
  interface IStyledOverflowButtonProps {
10
- isHovered?: boolean;
11
- isActive?: boolean;
12
- isFocused?: boolean;
13
- size?: ITableProps['size'];
10
+ $size?: ITableProps['size'];
14
11
  }
15
12
  /**
16
- * 1. Reset for <button> element
17
- * 2. Reset for <a>nchor element
13
+ * 1. Overrides IconButton sizing
18
14
  */
19
- export declare const StyledOverflowButton: import("styled-components").StyledComponent<"button", DefaultTheme, IStyledOverflowButtonProps, never>;
20
- export declare const StyledOverflowButtonIconWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
15
+ export declare const StyledOverflowButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@zendeskgarden/react-buttons").IIconButtonProps & import("react").RefAttributes<HTMLButtonElement>>, import("styled-components").DefaultTheme, {
16
+ 'data-garden-id': string;
17
+ 'data-garden-version': string;
18
+ } & IStyledOverflowButtonProps, "data-garden-id" | "data-garden-version">;
21
19
  export {};
@@ -7,12 +7,14 @@
7
7
  import { DefaultTheme } from 'styled-components';
8
8
  import { ITableProps } from '../types';
9
9
  export interface IStyledRowProps {
10
- isStriped?: boolean;
11
- isFocused?: boolean;
12
- isHovered?: boolean;
13
- isSelected?: boolean;
14
- isReadOnly?: ITableProps['isReadOnly'];
15
- size?: ITableProps['size'];
10
+ $isStriped?: boolean;
11
+ $isFocused?: boolean;
12
+ $isHovered?: boolean;
13
+ $isSelected?: boolean;
14
+ $isReadOnly?: ITableProps['isReadOnly'];
15
+ $size?: ITableProps['size'];
16
16
  }
17
- export declare const StyledBaseRow: import("styled-components").StyledComponent<"tr", DefaultTheme, IStyledRowProps, never>;
18
- export declare const StyledRow: import("styled-components").StyledComponent<"tr", DefaultTheme, IStyledRowProps, never>;
17
+ export declare const StyledRow: import("styled-components").StyledComponent<"tr", DefaultTheme, import("./StyledBaseRow").IStyledBaseRowProps & {
18
+ 'data-garden-id': string;
19
+ 'data-garden-version': string;
20
+ } & IStyledRowProps, "data-garden-id" | "data-garden-version">;
@@ -4,16 +4,17 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
+ import { DefaultTheme } from 'styled-components';
7
8
  import { ISortableCellProps } from '../types';
8
- export declare const StyledSortableStrokeIconWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
- export declare const StyledSortableFillIconWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const StyledSortableStrokeIconWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
10
+ export declare const StyledSortableFillIconWrapper: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
10
11
  interface IStyledSortableButtonProps {
11
- sort?: ISortableCellProps['sort'];
12
+ $sort?: ISortableCellProps['sort'];
12
13
  width?: ISortableCellProps['width'];
13
14
  }
14
15
  /**
15
16
  * 1. Reset for <button> element
16
17
  * 2. Reset for <a>nchor element
17
18
  */
18
- export declare const StyledSortableButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, IStyledSortableButtonProps, never>;
19
+ export declare const StyledSortableButton: import("styled-components").StyledComponent<"button", DefaultTheme, IStyledSortableButtonProps, never>;
19
20
  export {};
@@ -5,13 +5,11 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import { ThemeProps, DefaultTheme } from 'styled-components';
8
- import { ITableProps } from '../types';
9
- interface IStyledTableProps {
10
- size?: ITableProps['size'];
11
- }
12
8
  export declare const getLineHeight: (props: ThemeProps<DefaultTheme>) => string;
13
9
  /**
14
10
  * 1. <table> reset
15
11
  */
16
- export declare const StyledTable: import("styled-components").StyledComponent<"table", DefaultTheme, IStyledTableProps, never>;
17
- export {};
12
+ export declare const StyledTable: import("styled-components").StyledComponent<"table", DefaultTheme, {
13
+ 'data-garden-id': string;
14
+ 'data-garden-version': string;
15
+ }, "data-garden-id" | "data-garden-version">;
@@ -14,5 +14,5 @@ export { StyledTable } from './StyledTable';
14
14
  export { StyledHeaderCell } from './StyledHeaderCell';
15
15
  export { StyledHiddenCell } from './StyledHiddenCell';
16
16
  export { StyledSortableButton, StyledSortableFillIconWrapper, StyledSortableStrokeIconWrapper } from './StyledSortableButton';
17
- export { StyledOverflowButton, StyledOverflowButtonIconWrapper } from './StyledOverflowButton';
17
+ export { StyledOverflowButton } from './StyledOverflowButton';
18
18
  export { StyledRow } from './StyledRow';
@@ -7,5 +7,5 @@
7
7
  import { ThemeProps, DefaultTheme } from 'styled-components';
8
8
  import { ITableProps } from '../types';
9
9
  export declare const getRowHeight: (props: {
10
- size?: ITableProps['size'];
10
+ $size?: ITableProps['size'];
11
11
  } & ThemeProps<DefaultTheme>) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-tables",
3
- "version": "9.0.0-next.2",
3
+ "version": "9.0.0-next.21",
4
4
  "description": "Components relating to tables in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/zendeskgarden/react-components/issues"
11
11
  },
12
12
  "main": "dist/index.cjs.js",
13
- "module": "dist/index.esm.js",
13
+ "module": "dist/esm/index.js",
14
14
  "files": [
15
15
  "dist"
16
16
  ],
@@ -22,21 +22,22 @@
22
22
  "types": "dist/typings/index.d.ts",
23
23
  "dependencies": {
24
24
  "@zendeskgarden/container-utilities": "^2.0.0",
25
+ "@zendeskgarden/react-buttons": "^9.0.0-next.21",
25
26
  "dom-helpers": "^5.1.0",
26
- "polished": "^4.0.0",
27
+ "polished": "^4.3.1",
27
28
  "prop-types": "^15.5.7"
28
29
  },
29
30
  "peerDependencies": {
30
- "@zendeskgarden/react-theming": "^8.67.0",
31
+ "@zendeskgarden/react-theming": ">=9.0.0-next",
31
32
  "react": ">=16.8.0",
32
33
  "react-dom": ">=16.8.0",
33
- "styled-components": "^5.1.0"
34
+ "styled-components": "^5.3.1"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/react-beautiful-dnd": "13.1.8",
37
38
  "@types/react-window": "1.8.8",
38
- "@zendeskgarden/react-theming": "^9.0.0-next.2",
39
- "@zendeskgarden/svg-icons": "7.0.0",
39
+ "@zendeskgarden/react-theming": "^9.0.0-next.21",
40
+ "@zendeskgarden/svg-icons": "7.1.1",
40
41
  "react-beautiful-dnd": "13.1.1",
41
42
  "react-window": "1.8.10"
42
43
  },
@@ -50,5 +51,5 @@
50
51
  "access": "public"
51
52
  },
52
53
  "zendeskgarden:src": "src/index.ts",
53
- "gitHead": "e47dd011fedf130106acdb485a023340564171af"
54
+ "gitHead": "a245ce2b794ea65142174a6a1f855a111b2677a2"
54
55
  }