@faststore/components 2.0.41-alpha.0 → 2.0.42-alpha.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
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.42-alpha.0](https://github.com/vtex/faststore/compare/v2.0.41-alpha.0...v2.0.42-alpha.0) (2023-01-10)
7
+
8
+
9
+ ### Chores
10
+
11
+ * `Table` component's improvements ([#1592](https://github.com/vtex/faststore/issues/1592)) ([176a710](https://github.com/vtex/faststore/commit/176a710cf8d2917527cb4f99a8ddc956d841ae76))
12
+
13
+
14
+
6
15
  ## [2.0.41-alpha.0](https://github.com/vtex/faststore/compare/v2.0.40-alpha.0...v2.0.41-alpha.0) (2023-01-10)
7
16
 
8
17
 
@@ -1,18 +1,16 @@
1
- import type { TableHTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { TableHTMLAttributes } from 'react';
3
3
  export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
4
4
  /**
5
5
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
6
  */
7
7
  testId?: string;
8
- /**
9
- * Children for Table components.
10
- */
11
- children: React.ReactNode;
12
8
  /**
13
9
  * Defines what style this component should use.
14
10
  */
15
11
  variant?: 'colored' | 'bordered';
16
12
  }
17
- declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
13
+ declare const Table: React.ForwardRefExoticComponent<TableProps & {
14
+ children?: React.ReactNode;
15
+ } & React.RefAttributes<HTMLTableElement>>;
18
16
  export default Table;
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- const Table = forwardRef(function Table({ variant = 'colored', testId = 'fs-table', children, ...otherProps }, ref) {
2
+ const Table = forwardRef(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
3
3
  return (React.createElement("div", { "data-fs-table": true },
4
4
  React.createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
5
5
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/molecules/Table/Table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAiBzC,MAAM,KAAK,GAAG,UAAU,CAA+B,SAAS,KAAK,CACnE,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACrE,GAAG;IAEH,OAAO,CACL;QACE,+BACE,GAAG,EAAE,GAAG,0DAEe,OAAO,iBACjB,MAAM,KACf,UAAU,IAEb,QAAQ,CACH,CACJ,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/molecules/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAczC,MAAM,KAAK,GAAG,UAAU,CACtB,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,UAAU,EAAE,EACrE,GAAG;IAEH,OAAO,CACL;QACE,+BACE,GAAG,EAAE,GAAG,0DAEe,OAAO,iBACjB,MAAM,KACf,UAAU,IAEb,QAAQ,CACH,CACJ,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -1,14 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
6
  */
7
7
  testId?: string;
8
- /**
9
- * Children for TableBody components.
10
- */
11
- children: React.ReactNode;
12
8
  }
13
- declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
9
+ declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & {
10
+ children?: React.ReactNode;
11
+ } & React.RefAttributes<HTMLTableSectionElement>>;
14
12
  export default TableBody;
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAczC,MAAM,SAAS,GAAG,UAAU,CAC1B,SAAS,SAAS,CAChB,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,iCAAyB,UAAU,IACpE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAWzC,MAAM,SAAS,GAAG,UAAU,CAG1B,SAAS,SAAS,CAClB,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,iCAAyB,UAAU,IACpE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  type TableCellVariant = 'data' | 'header';
4
4
  export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
5
5
  /**
@@ -20,5 +20,7 @@ export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
20
20
  */
21
21
  align?: 'left' | 'center' | 'right';
22
22
  }
23
- declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
23
+ declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & {
24
+ children?: React.ReactNode;
25
+ } & React.RefAttributes<HTMLTableCellElement>>;
24
26
  export default TableCell;
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- const TableCell = forwardRef(function TableCell({ testId = 'fs-table-cell', children, variant = 'data', scope, align, ...otherProps }, ref) {
2
+ const TableCell = forwardRef(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
3
3
  const Cell = variant === 'header' ? 'th' : 'td';
4
4
  return (React.createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
5
5
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAwBzC,MAAM,SAAS,GAAG,UAAU,CAC1B,SAAS,SAAS,CAChB,EACE,MAAM,GAAG,eAAe,EACxB,QAAQ,EACR,OAAO,GAAG,MAAM,EAChB,KAAK,EACL,KAAK,EACL,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,IAAI,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAE/C,OAAO,CACL,oBAAC,IAAI,IACH,GAAG,EAAE,GAAG,wBACY,OAAO,8BACD,KAAK,iBAClB,MAAM,EACnB,KAAK,EAAE,KAAK,KACR,UAAU,IAEb,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAyBzC,MAAM,SAAS,GAAG,UAAU,CAG1B,SAAS,SAAS,CAClB,EACE,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,MAAM,EAChB,MAAM,GAAG,eAAe,EACxB,GAAG,UAAU,EACd,EACD,GAAG;IAEH,MAAM,IAAI,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAE/C,OAAO,CACL,oBAAC,IAAI,IACH,GAAG,EAAE,GAAG,wBACY,OAAO,8BACD,KAAK,iBAClB,MAAM,EACnB,KAAK,EAAE,KAAK,KACR,UAAU,IAEb,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
@@ -1,14 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  export interface TableFooterProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
6
  */
7
7
  testId?: string;
8
- /**
9
- * Children for TableFooter components.
10
- */
11
- children: React.ReactNode;
12
8
  }
13
- declare const TableFooter: React.ForwardRefExoticComponent<TableFooterProps & React.RefAttributes<HTMLTableSectionElement>>;
9
+ declare const TableFooter: React.ForwardRefExoticComponent<TableFooterProps & {
10
+ children?: React.ReactNode;
11
+ } & React.RefAttributes<HTMLTableSectionElement>>;
14
12
  export default TableFooter;
@@ -1 +1 @@
1
- {"version":3,"file":"TableFooter.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAczC,MAAM,WAAW,GAAG,UAAU,CAC5B,SAAS,WAAW,CAClB,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,GAAG,UAAU,EAAE,EACvD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,mCAA2B,UAAU,IACtE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"TableFooter.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAWzC,MAAM,WAAW,GAAG,UAAU,CAG5B,SAAS,WAAW,CACpB,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,GAAG,UAAU,EAAE,EACvD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,mCAA2B,UAAU,IACtE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
@@ -1,14 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  export interface TableHeadProps extends HTMLAttributes<HTMLTableSectionElement> {
4
4
  /**
5
5
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
6
  */
7
7
  testId?: string;
8
- /**
9
- * Children for TableHead components.
10
- */
11
- children: React.ReactNode;
12
8
  }
13
- declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableSectionElement>>;
9
+ declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & {
10
+ children?: React.ReactNode;
11
+ } & React.RefAttributes<HTMLTableSectionElement>>;
14
12
  export default TableHead;
@@ -1 +1 @@
1
- {"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableHead.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAczC,MAAM,SAAS,GAAG,UAAU,CAC1B,SAAS,SAAS,CAChB,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,iCAAyB,UAAU,IACpE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableHead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAWzC,MAAM,SAAS,GAAG,UAAU,CAG1B,SAAS,SAAS,CAClB,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EACrD,GAAG;IAEH,OAAO,CACL,+BAAO,GAAG,EAAE,GAAG,iBAAe,MAAM,iCAAyB,UAAU,IACpE,QAAQ,CACH,CACT,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
@@ -1,14 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
2
1
  import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
3
  export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
4
4
  /**
5
5
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
6
  */
7
7
  testId?: string;
8
- /**
9
- * Children for TableRow components.
10
- */
11
- children: React.ReactNode;
12
8
  }
13
- declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
9
+ declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & {
10
+ children?: React.ReactNode;
11
+ } & React.RefAttributes<HTMLTableRowElement>>;
14
12
  export default TableRow;
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- const TableRow = forwardRef(function TableRow({ testId = 'fs-table-row', children, ...otherProps }, ref) {
2
+ const TableRow = forwardRef(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
3
3
  return (React.createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
4
4
  });
5
5
  export default TableRow;
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAazC,MAAM,QAAQ,GAAG,UAAU,CACzB,SAAS,QAAQ,CACf,EAAE,MAAM,GAAG,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EACpD,GAAG;IAEH,OAAO,CACL,4BAAI,GAAG,EAAE,GAAG,4CAAiC,MAAM,KAAM,UAAU,IAChE,QAAQ,CACN,CACN,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../../../src/molecules/Table/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAUzC,MAAM,QAAQ,GAAG,UAAU,CAGzB,SAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG;IAC3E,OAAO,CACL,4BAAI,GAAG,EAAE,GAAG,4CAAiC,MAAM,KAAM,UAAU,IAChE,QAAQ,CACN,CACN,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,QAAQ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/components",
3
- "version": "2.0.41-alpha.0",
3
+ "version": "2.0.42-alpha.0",
4
4
  "module": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "author": "Emerson Laurentino @emersonlaurentino",
@@ -30,5 +30,5 @@
30
30
  "node": "16.18.0",
31
31
  "yarn": "1.19.1"
32
32
  },
33
- "gitHead": "e307ecc596c61e0da4b83cb76aeea0c677197e03"
33
+ "gitHead": "47ce2b7c180d5a90d1ebadd7628ee47d0ceb1280"
34
34
  }
@@ -1,38 +1,36 @@
1
- import type { TableHTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { TableHTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
5
5
  /**
6
6
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
7
  */
8
8
  testId?: string
9
- /**
10
- * Children for Table components.
11
- */
12
- children: React.ReactNode
13
9
  /**
14
10
  * Defines what style this component should use.
15
11
  */
16
12
  variant?: 'colored' | 'bordered'
17
13
  }
18
14
 
19
- const Table = forwardRef<HTMLTableElement, TableProps>(function Table(
20
- { variant = 'colored', testId = 'fs-table', children, ...otherProps },
21
- ref
22
- ) {
23
- return (
24
- <div data-fs-table>
25
- <table
26
- ref={ref}
27
- data-fs-table-content
28
- data-fs-table-variant={variant}
29
- data-testid={testId}
30
- {...otherProps}
31
- >
32
- {children}
33
- </table>
34
- </div>
35
- )
36
- })
15
+ const Table = forwardRef<HTMLTableElement, PropsWithChildren<TableProps>>(
16
+ function Table(
17
+ { children, variant = 'colored', testId = 'fs-table', ...otherProps },
18
+ ref
19
+ ) {
20
+ return (
21
+ <div data-fs-table>
22
+ <table
23
+ ref={ref}
24
+ data-fs-table-content
25
+ data-fs-table-variant={variant}
26
+ data-testid={testId}
27
+ {...otherProps}
28
+ >
29
+ {children}
30
+ </table>
31
+ </div>
32
+ )
33
+ }
34
+ )
37
35
 
38
36
  export default Table
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { HTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  export interface TableBodyProps
5
5
  extends HTMLAttributes<HTMLTableSectionElement> {
@@ -7,23 +7,20 @@ export interface TableBodyProps
7
7
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
8
8
  */
9
9
  testId?: string
10
- /**
11
- * Children for TableBody components.
12
- */
13
- children: React.ReactNode
14
10
  }
15
11
 
16
- const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(
17
- function TableBody(
18
- { children, testId = 'fs-table-body', ...otherProps },
19
- ref
20
- ) {
21
- return (
22
- <tbody ref={ref} data-testid={testId} data-fs-table-body {...otherProps}>
23
- {children}
24
- </tbody>
25
- )
26
- }
27
- )
12
+ const TableBody = forwardRef<
13
+ HTMLTableSectionElement,
14
+ PropsWithChildren<TableBodyProps>
15
+ >(function TableBody(
16
+ { children, testId = 'fs-table-body', ...otherProps },
17
+ ref
18
+ ) {
19
+ return (
20
+ <tbody ref={ref} data-testid={testId} data-fs-table-body {...otherProps}>
21
+ {children}
22
+ </tbody>
23
+ )
24
+ })
28
25
 
29
26
  export default TableBody
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { HTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  type TableCellVariant = 'data' | 'header'
5
5
 
@@ -23,33 +23,34 @@ export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
23
23
  align?: 'left' | 'center' | 'right'
24
24
  }
25
25
 
26
- const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
27
- function TableCell(
28
- {
29
- testId = 'fs-table-cell',
30
- children,
31
- variant = 'data',
32
- scope,
33
- align,
34
- ...otherProps
35
- },
36
- ref
37
- ) {
38
- const Cell = variant === 'header' ? 'th' : 'td'
26
+ const TableCell = forwardRef<
27
+ HTMLTableCellElement,
28
+ PropsWithChildren<TableCellProps>
29
+ >(function TableCell(
30
+ {
31
+ scope,
32
+ align,
33
+ children,
34
+ variant = 'data',
35
+ testId = 'fs-table-cell',
36
+ ...otherProps
37
+ },
38
+ ref
39
+ ) {
40
+ const Cell = variant === 'header' ? 'th' : 'td'
39
41
 
40
- return (
41
- <Cell
42
- ref={ref}
43
- data-fs-table-cell={variant}
44
- data-fs-table-cell-align={align}
45
- data-testid={testId}
46
- scope={scope}
47
- {...otherProps}
48
- >
49
- {children}
50
- </Cell>
51
- )
52
- }
53
- )
42
+ return (
43
+ <Cell
44
+ ref={ref}
45
+ data-fs-table-cell={variant}
46
+ data-fs-table-cell-align={align}
47
+ data-testid={testId}
48
+ scope={scope}
49
+ {...otherProps}
50
+ >
51
+ {children}
52
+ </Cell>
53
+ )
54
+ })
54
55
 
55
56
  export default TableCell
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { HTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  export interface TableFooterProps
5
5
  extends HTMLAttributes<HTMLTableSectionElement> {
@@ -7,23 +7,20 @@ export interface TableFooterProps
7
7
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
8
8
  */
9
9
  testId?: string
10
- /**
11
- * Children for TableFooter components.
12
- */
13
- children: React.ReactNode
14
10
  }
15
11
 
16
- const TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(
17
- function TableFooter(
18
- { children, testId = 'fs-table-footer', ...otherProps },
19
- ref
20
- ) {
21
- return (
22
- <tfoot ref={ref} data-testid={testId} data-fs-table-footer {...otherProps}>
23
- {children}
24
- </tfoot>
25
- )
26
- }
27
- )
12
+ const TableFooter = forwardRef<
13
+ HTMLTableSectionElement,
14
+ PropsWithChildren<TableFooterProps>
15
+ >(function TableFooter(
16
+ { children, testId = 'fs-table-footer', ...otherProps },
17
+ ref
18
+ ) {
19
+ return (
20
+ <tfoot ref={ref} data-testid={testId} data-fs-table-footer {...otherProps}>
21
+ {children}
22
+ </tfoot>
23
+ )
24
+ })
28
25
 
29
26
  export default TableFooter
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { HTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  export interface TableHeadProps
5
5
  extends HTMLAttributes<HTMLTableSectionElement> {
@@ -7,23 +7,20 @@ export interface TableHeadProps
7
7
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
8
8
  */
9
9
  testId?: string
10
- /**
11
- * Children for TableHead components.
12
- */
13
- children: React.ReactNode
14
10
  }
15
11
 
16
- const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(
17
- function TableHead(
18
- { children, testId = 'fs-table-head', ...otherProps },
19
- ref
20
- ) {
21
- return (
22
- <thead ref={ref} data-testid={testId} data-fs-table-head {...otherProps}>
23
- {children}
24
- </thead>
25
- )
26
- }
27
- )
12
+ const TableHead = forwardRef<
13
+ HTMLTableSectionElement,
14
+ PropsWithChildren<TableHeadProps>
15
+ >(function TableHead(
16
+ { children, testId = 'fs-table-head', ...otherProps },
17
+ ref
18
+ ) {
19
+ return (
20
+ <thead ref={ref} data-testid={testId} data-fs-table-head {...otherProps}>
21
+ {children}
22
+ </thead>
23
+ )
24
+ })
28
25
 
29
26
  export default TableHead
@@ -1,28 +1,22 @@
1
- import type { HTMLAttributes } from 'react'
2
1
  import React, { forwardRef } from 'react'
2
+ import type { HTMLAttributes, PropsWithChildren } from 'react'
3
3
 
4
4
  export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
5
5
  /**
6
6
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
7
  */
8
8
  testId?: string
9
- /**
10
- * Children for TableRow components.
11
- */
12
- children: React.ReactNode
13
9
  }
14
10
 
15
- const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(
16
- function TableRow(
17
- { testId = 'fs-table-row', children, ...otherProps },
18
- ref
19
- ) {
20
- return (
21
- <tr ref={ref} data-fs-table-row data-testid={testId} {...otherProps}>
22
- {children}
23
- </tr>
24
- )
25
- }
26
- )
11
+ const TableRow = forwardRef<
12
+ HTMLTableRowElement,
13
+ PropsWithChildren<TableRowProps>
14
+ >(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
15
+ return (
16
+ <tr ref={ref} data-fs-table-row data-testid={testId} {...otherProps}>
17
+ {children}
18
+ </tr>
19
+ )
20
+ })
27
21
 
28
22
  export default TableRow