@instructure/ui-table 8.14.1-snapshot.63 → 8.14.1-snapshot.66

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.
@@ -27,7 +27,7 @@ var _dec, _class, _class2, _temp, _ScreenReaderContent;
27
27
  */
28
28
 
29
29
  /** @jsx jsx */
30
- import React, { Component, Children } from 'react';
30
+ import { Component, Children } from 'react';
31
31
  import { omitProps, matchComponentTypes, callRenderProp } from '@instructure/ui-react-utils';
32
32
  import { SimpleSelect } from '@instructure/ui-simple-select';
33
33
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
@@ -103,11 +103,11 @@ let Head = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
103
103
  count += 1;
104
104
 
105
105
  if (matchComponentTypes(colHeader, [ColHeader])) {
106
- const _props = colHeader.props,
107
- id = _props.id,
108
- stackedSortByLabel = _props.stackedSortByLabel,
109
- sortDirection = _props.sortDirection,
110
- onRequestSort = _props.onRequestSort;
106
+ const _colHeader$props = colHeader.props,
107
+ id = _colHeader$props.id,
108
+ stackedSortByLabel = _colHeader$props.stackedSortByLabel,
109
+ sortDirection = _colHeader$props.sortDirection,
110
+ onRequestSort = _colHeader$props.onRequestSort;
111
111
  const label = stackedSortByLabel || id;
112
112
 
113
113
  if (onRequestSort) {
package/es/Table/index.js CHANGED
@@ -27,7 +27,7 @@ var _dec, _class, _class2, _temp;
27
27
  */
28
28
 
29
29
  /** @jsx jsx */
30
- import React, { Component, Children } from 'react';
30
+ import { Component, Children } from 'react';
31
31
  import { matchComponentTypes, safeCloneElement, omitProps } from '@instructure/ui-react-utils';
32
32
  import { View } from '@instructure/ui-view';
33
33
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
@@ -83,18 +83,18 @@ let Table = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
83
83
  head = _ref2[0];
84
84
 
85
85
  if (matchComponentTypes(head, [Head])) {
86
- const _ref3 = Children.toArray(head.props.children),
87
- _ref4 = _slicedToArray(_ref3, 1),
88
- row = _ref4[0];
86
+ const _Children$toArray = Children.toArray(head.props.children),
87
+ _Children$toArray2 = _slicedToArray(_Children$toArray, 1),
88
+ row = _Children$toArray2[0];
89
89
 
90
90
  if (matchComponentTypes(row, [Row])) {
91
91
  return Children.map(row.props.children, colHeader => {
92
- return matchComponentTypes(colHeader, [ColHeader]) ? colHeader.props.children : null;
92
+ return matchComponentTypes(colHeader, [ColHeader]) ? colHeader.props.children : void 0;
93
93
  });
94
94
  }
95
95
  }
96
96
 
97
- return null;
97
+ return void 0;
98
98
  }
99
99
 
100
100
  render() {
@@ -106,7 +106,7 @@ let Table = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_clas
106
106
  hover = _this$props3.hover,
107
107
  styles = _this$props3.styles;
108
108
  const isStacked = layout === 'stacked';
109
- const headers = isStacked ? this.getHeaders() : null;
109
+ const headers = isStacked ? this.getHeaders() : void 0;
110
110
  return jsx(View, Object.assign({}, View.omitViewProps(omitProps(this.props, Table.allowedProps), Table), {
111
111
  as: isStacked ? 'div' : 'table',
112
112
  margin: margin,
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
 
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -11,7 +9,7 @@ exports.default = exports.Head = void 0;
11
9
 
12
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
11
 
14
- var _react = _interopRequireWildcard(require("react"));
12
+ var _react = require("react");
15
13
 
16
14
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
17
15
 
@@ -37,7 +35,7 @@ var _Row = require("../Row");
37
35
 
38
36
  var _ColHeader = require("../ColHeader");
39
37
 
40
- var _props2 = require("./props");
38
+ var _props = require("./props");
41
39
 
42
40
  var _dec, _class, _class2, _temp, _ScreenReaderContent;
43
41
 
@@ -105,11 +103,11 @@ let Head = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
105
103
  count += 1;
106
104
 
107
105
  if ((0, _matchComponentTypes.matchComponentTypes)(colHeader, [_ColHeader.ColHeader])) {
108
- const _props = colHeader.props,
109
- id = _props.id,
110
- stackedSortByLabel = _props.stackedSortByLabel,
111
- sortDirection = _props.sortDirection,
112
- onRequestSort = _props.onRequestSort;
106
+ const _colHeader$props = colHeader.props,
107
+ id = _colHeader$props.id,
108
+ stackedSortByLabel = _colHeader$props.stackedSortByLabel,
109
+ sortDirection = _colHeader$props.sortDirection,
110
+ onRequestSort = _colHeader$props.onRequestSort;
113
111
  const label = stackedSortByLabel || id;
114
112
 
115
113
  if (onRequestSort) {
@@ -178,7 +176,7 @@ let Head = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
178
176
  }), _react.Children.map(children, child => (0, _matchComponentTypes.matchComponentTypes)(child, [_Row.Row]) ? child : null));
179
177
  }
180
178
 
181
- }, _class2.displayName = "Head", _class2.componentId = 'Table.Head', _class2.allowedProps = _props2.allowedProps, _class2.propTypes = _props2.propTypes, _class2.defaultProps = {
179
+ }, _class2.displayName = "Head", _class2.componentId = 'Table.Head', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
182
180
  children: null
183
181
  }, _temp)) || _class);
184
182
  exports.Head = Head;
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
 
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -11,7 +9,7 @@ exports.default = exports.Table = void 0;
11
9
 
12
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
11
 
14
- var _react = _interopRequireWildcard(require("react"));
12
+ var _react = require("react");
15
13
 
16
14
  var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
17
15
 
@@ -86,18 +84,18 @@ let Table = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
86
84
  head = _ref2[0];
87
85
 
88
86
  if ((0, _matchComponentTypes.matchComponentTypes)(head, [_Head.Head])) {
89
- const _ref3 = _react.Children.toArray(head.props.children),
90
- _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
91
- row = _ref4[0];
87
+ const _Children$toArray = _react.Children.toArray(head.props.children),
88
+ _Children$toArray2 = (0, _slicedToArray2.default)(_Children$toArray, 1),
89
+ row = _Children$toArray2[0];
92
90
 
93
91
  if ((0, _matchComponentTypes.matchComponentTypes)(row, [_Row.Row])) {
94
92
  return _react.Children.map(row.props.children, colHeader => {
95
- return (0, _matchComponentTypes.matchComponentTypes)(colHeader, [_ColHeader.ColHeader]) ? colHeader.props.children : null;
93
+ return (0, _matchComponentTypes.matchComponentTypes)(colHeader, [_ColHeader.ColHeader]) ? colHeader.props.children : void 0;
96
94
  });
97
95
  }
98
96
  }
99
97
 
100
- return null;
98
+ return void 0;
101
99
  }
102
100
 
103
101
  render() {
@@ -109,7 +107,7 @@ let Table = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
109
107
  hover = _this$props3.hover,
110
108
  styles = _this$props3.styles;
111
109
  const isStacked = layout === 'stacked';
112
- const headers = isStacked ? this.getHeaders() : null;
110
+ const headers = isStacked ? this.getHeaders() : void 0;
113
111
  return (0, _emotion.jsx)(_View.View, Object.assign({}, _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, Table.allowedProps), Table), {
114
112
  as: isStacked ? 'div' : 'table',
115
113
  margin: margin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-table",
3
- "version": "8.14.1-snapshot.63+2acf47d5b",
3
+ "version": "8.14.1-snapshot.66+ff0decd44",
4
4
  "description": "A styled HTML table component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,24 +24,24 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.14.1-snapshot.63+2acf47d5b",
28
- "@instructure/ui-color-utils": "8.14.1-snapshot.63+2acf47d5b",
29
- "@instructure/ui-test-utils": "8.14.1-snapshot.63+2acf47d5b",
30
- "@instructure/ui-themes": "8.14.1-snapshot.63+2acf47d5b"
27
+ "@instructure/ui-babel-preset": "8.14.1-snapshot.66+ff0decd44",
28
+ "@instructure/ui-color-utils": "8.14.1-snapshot.66+ff0decd44",
29
+ "@instructure/ui-test-utils": "8.14.1-snapshot.66+ff0decd44",
30
+ "@instructure/ui-themes": "8.14.1-snapshot.66+ff0decd44"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/console": "8.14.1-snapshot.63+2acf47d5b",
35
- "@instructure/emotion": "8.14.1-snapshot.63+2acf47d5b",
36
- "@instructure/shared-types": "8.14.1-snapshot.63+2acf47d5b",
37
- "@instructure/ui-a11y-content": "8.14.1-snapshot.63+2acf47d5b",
38
- "@instructure/ui-icons": "8.14.1-snapshot.63+2acf47d5b",
39
- "@instructure/ui-prop-types": "8.14.1-snapshot.63+2acf47d5b",
40
- "@instructure/ui-react-utils": "8.14.1-snapshot.63+2acf47d5b",
41
- "@instructure/ui-simple-select": "8.14.1-snapshot.63+2acf47d5b",
42
- "@instructure/ui-testable": "8.14.1-snapshot.63+2acf47d5b",
43
- "@instructure/ui-utils": "8.14.1-snapshot.63+2acf47d5b",
44
- "@instructure/ui-view": "8.14.1-snapshot.63+2acf47d5b",
34
+ "@instructure/console": "8.14.1-snapshot.66+ff0decd44",
35
+ "@instructure/emotion": "8.14.1-snapshot.66+ff0decd44",
36
+ "@instructure/shared-types": "8.14.1-snapshot.66+ff0decd44",
37
+ "@instructure/ui-a11y-content": "8.14.1-snapshot.66+ff0decd44",
38
+ "@instructure/ui-icons": "8.14.1-snapshot.66+ff0decd44",
39
+ "@instructure/ui-prop-types": "8.14.1-snapshot.66+ff0decd44",
40
+ "@instructure/ui-react-utils": "8.14.1-snapshot.66+ff0decd44",
41
+ "@instructure/ui-simple-select": "8.14.1-snapshot.66+ff0decd44",
42
+ "@instructure/ui-testable": "8.14.1-snapshot.66+ff0decd44",
43
+ "@instructure/ui-utils": "8.14.1-snapshot.66+ff0decd44",
44
+ "@instructure/ui-view": "8.14.1-snapshot.66+ff0decd44",
45
45
  "prop-types": "^15"
46
46
  },
47
47
  "peerDependencies": {
@@ -51,5 +51,5 @@
51
51
  "access": "public"
52
52
  },
53
53
  "sideEffects": false,
54
- "gitHead": "2acf47d5bc73bd07f4f5228bdc7654a3df997d3e"
54
+ "gitHead": "ff0decd44fd390bd7f50885610373d2c9c793053"
55
55
  }
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  /** @jsx jsx */
26
- import { Component, Children, ReactElement } from 'react'
26
+ import { Component, Children } from 'react'
27
27
 
28
28
  import {
29
29
  matchComponentTypes,
@@ -37,7 +37,7 @@ import generateStyle from './styles'
37
37
  import generateComponentTheme from './theme'
38
38
  import { Row } from '../Row'
39
39
  import type { TableBodyProps } from './props'
40
- import type { TableRowProps } from '../Row/props'
40
+ import type { RowChild } from '../props'
41
41
  import { allowedProps, propTypes } from './props'
42
42
 
43
43
  /**
@@ -76,17 +76,15 @@ class Body extends Component<TableBodyProps> {
76
76
  css={styles?.body}
77
77
  role={isStacked ? 'rowgroup' : undefined}
78
78
  >
79
- {Children.map(
80
- children as React.ComponentElement<TableRowProps, Row>[],
81
- (child) =>
82
- matchComponentTypes(child, [Row])
83
- ? safeCloneElement(child as ReactElement, {
84
- key: child.props.name,
85
- hover,
86
- isStacked,
87
- headers
88
- })
89
- : null
79
+ {Children.map(children as RowChild[], (child) =>
80
+ matchComponentTypes(child, [Row])
81
+ ? safeCloneElement(child, {
82
+ key: child.props.name,
83
+ hover,
84
+ isStacked,
85
+ headers
86
+ })
87
+ : null
90
88
  )}
91
89
  </View>
92
90
  )
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  /** @jsx jsx */
26
- import React, { Component, Children } from 'react'
26
+ import { Component, Children } from 'react'
27
27
 
28
28
  import {
29
29
  omitProps,
@@ -45,7 +45,7 @@ import { Row } from '../Row'
45
45
  import { ColHeader } from '../ColHeader'
46
46
  import type { TableColHeaderProps } from '../ColHeader/props'
47
47
  import type { TableHeadProps } from './props'
48
- import type { TableRowProps } from '../Row/props'
48
+ import type { ColHeaderChild, RowChild } from '../props'
49
49
  import { allowedProps, propTypes } from './props'
50
50
 
51
51
  /**
@@ -67,19 +67,14 @@ class Head extends Component<TableHeadProps> {
67
67
  }
68
68
 
69
69
  get isSortable() {
70
- const [row] = Children.toArray(
71
- this.props.children
72
- ) as React.ComponentElement<TableRowProps, Row>[]
70
+ const [row] = Children.toArray(this.props.children) as RowChild[]
73
71
  let sortable = false
74
72
 
75
73
  if (row) {
76
74
  Children.forEach(
77
- row.props.children as React.ComponentElement<
78
- TableColHeaderProps,
79
- ColHeader
80
- >[],
75
+ row.props.children as ColHeaderChild[],
81
76
  (colHeader) => {
82
- if (matchComponentTypes(colHeader, [ColHeader])) {
77
+ if (matchComponentTypes<ColHeaderChild>(colHeader, [ColHeader])) {
83
78
  if (colHeader.props.onRequestSort) sortable = true
84
79
  }
85
80
  }
@@ -105,12 +100,9 @@ class Head extends Component<TableHeadProps> {
105
100
 
106
101
  renderSelect() {
107
102
  const { children, renderSortLabel } = this.props
108
- const [row] = Children.toArray(children) as React.ComponentElement<
109
- TableRowProps,
110
- Row
111
- >[]
103
+ const [row] = Children.toArray(children) as RowChild[]
112
104
 
113
- if (!matchComponentTypes(row, [Row])) {
105
+ if (!matchComponentTypes<RowChild>(row, [Row])) {
114
106
  return null
115
107
  }
116
108
  const options: {
@@ -128,9 +120,9 @@ class Head extends Component<TableHeadProps> {
128
120
 
129
121
  Children.forEach(row.props.children, (colHeader) => {
130
122
  count += 1
131
- if (matchComponentTypes(colHeader, [ColHeader])) {
123
+ if (matchComponentTypes<ColHeaderChild>(colHeader, [ColHeader])) {
132
124
  const { id, stackedSortByLabel, sortDirection, onRequestSort } = (
133
- colHeader as ColHeader
125
+ colHeader
134
126
  ).props
135
127
 
136
128
  const label = stackedSortByLabel || id
@@ -197,7 +189,7 @@ class Head extends Component<TableHeadProps> {
197
189
  ) : (
198
190
  <thead {...omitProps(this.props, Head.allowedProps)} css={styles?.head}>
199
191
  {Children.map(children, (child) =>
200
- matchComponentTypes(child, [Row]) ? child : null
192
+ matchComponentTypes<RowChild>(child, [Row]) ? child : null
201
193
  )}
202
194
  </thead>
203
195
  )
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  /** @jsx jsx */
26
- import { Component, Children, ReactElement } from 'react'
26
+ import { Component, Children } from 'react'
27
27
 
28
28
  import {
29
29
  omitProps,
@@ -41,6 +41,7 @@ import { ColHeader } from '../ColHeader'
41
41
  import { RowHeader } from '../RowHeader'
42
42
  import { Cell } from '../Cell'
43
43
  import type { TableRowProps } from './props'
44
+ import type { ColHeaderChild, RowHeaderChild, CellChild } from '../props'
44
45
  import { allowedProps, propTypes } from './props'
45
46
 
46
47
  /**
@@ -79,21 +80,27 @@ class Row extends Component<TableRowProps> {
79
80
  css={styles?.row}
80
81
  role={isStacked ? 'row' : undefined}
81
82
  >
82
- {Children.toArray(children)
83
+ {(
84
+ Children.toArray(children) as (
85
+ | ColHeaderChild
86
+ | RowHeaderChild
87
+ | CellChild
88
+ )[]
89
+ )
83
90
  .filter(Boolean)
84
91
  .map((child, index) => {
85
- if (matchComponentTypes(child, [ColHeader])) {
92
+ if (matchComponentTypes<ColHeaderChild>(child, [ColHeader])) {
86
93
  return child
87
94
  }
88
- if (matchComponentTypes(child, [RowHeader])) {
89
- return safeCloneElement(child as ReactElement, {
90
- key: (child as RowHeader).props.name,
95
+ if (matchComponentTypes<RowHeaderChild>(child, [RowHeader])) {
96
+ return safeCloneElement(child, {
97
+ key: child.props.name,
91
98
  isStacked
92
99
  })
93
100
  }
94
- if (matchComponentTypes(child, [Cell])) {
95
- return safeCloneElement(child as ReactElement, {
96
- key: (child as Cell).props.name,
101
+ if (matchComponentTypes<CellChild>(child, [Cell])) {
102
+ return safeCloneElement(child, {
103
+ key: child.props.name,
97
104
  isStacked,
98
105
  header: headers && headers[index]
99
106
  })
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  /** @jsx jsx */
26
- import React, { Component, Children, ReactElement } from 'react'
26
+ import { Component, Children } from 'react'
27
27
 
28
28
  import {
29
29
  matchComponentTypes,
@@ -44,9 +44,17 @@ import { Row } from './Row'
44
44
  import { ColHeader } from './ColHeader'
45
45
  import { RowHeader } from './RowHeader'
46
46
  import { Cell } from './Cell'
47
- import type { TableProps } from './props'
48
- import type { TableHeadProps } from './Head/props'
49
- import type { TableRowProps } from './Row/props'
47
+
48
+ import type {
49
+ TableProps,
50
+ HeadChild,
51
+ BodyChild,
52
+ RowChild,
53
+ ColHeaderChild,
54
+ RowHeaderChild,
55
+ CellChild
56
+ } from './props'
57
+
50
58
  import { allowedProps, propTypes } from './props'
51
59
 
52
60
  /**
@@ -97,31 +105,29 @@ class Table extends Component<TableProps> {
97
105
 
98
106
  getHeaders() {
99
107
  const { children } = this.props
100
- const [head] = Children.toArray(children) as React.ComponentElement<
101
- TableHeadProps,
102
- Head
103
- >[]
104
-
105
- if (matchComponentTypes(head, [Head])) {
106
- const [row] = Children.toArray(
107
- head.props.children
108
- ) as React.ComponentElement<TableRowProps, Row>[]
109
-
110
- if (matchComponentTypes(row, [Row])) {
111
- return Children.map(row.props.children, (colHeader) => {
112
- return matchComponentTypes(colHeader, [ColHeader])
113
- ? (colHeader as ColHeader).props.children
114
- : null
115
- })
108
+ const [head] = Children.toArray(children) as HeadChild[]
109
+
110
+ if (matchComponentTypes<HeadChild>(head, [Head])) {
111
+ const [row] = Children.toArray(head.props.children)
112
+
113
+ if (matchComponentTypes<RowChild>(row, [Row])) {
114
+ return Children.map(
115
+ row.props.children as (ColHeaderChild | RowHeaderChild | CellChild)[],
116
+ (colHeader) => {
117
+ return matchComponentTypes<ColHeaderChild>(colHeader, [ColHeader])
118
+ ? colHeader.props.children
119
+ : undefined
120
+ }
121
+ )
116
122
  }
117
123
  }
118
- return null
124
+ return undefined
119
125
  }
120
126
 
121
127
  render() {
122
128
  const { margin, layout, caption, children, hover, styles } = this.props
123
129
  const isStacked = layout === 'stacked'
124
- const headers = isStacked ? this.getHeaders() : null
130
+ const headers = isStacked ? this.getHeaders() : undefined
125
131
 
126
132
  return (
127
133
  <View
@@ -142,15 +148,15 @@ class Table extends Component<TableProps> {
142
148
  </caption>
143
149
  )}
144
150
  {Children.map(children, (child) => {
145
- if (matchComponentTypes(child, [Head])) {
146
- return safeCloneElement(child as ReactElement, {
147
- key: (child as Head).props.name,
151
+ if (matchComponentTypes<HeadChild>(child, [Head])) {
152
+ return safeCloneElement(child, {
153
+ key: child.props.name,
148
154
  isStacked
149
155
  })
150
156
  }
151
- if (matchComponentTypes(child, [Body])) {
152
- return safeCloneElement(child as ReactElement, {
153
- key: (child as Body).props.name,
157
+ if (matchComponentTypes<BodyChild>(child, [Body])) {
158
+ return safeCloneElement(child, {
159
+ key: child.props.name,
154
160
  isStacked,
155
161
  hover,
156
162
  headers
@@ -27,9 +27,6 @@ import PropTypes from 'prop-types'
27
27
  import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
28
28
  import { ThemeablePropTypes } from '@instructure/emotion'
29
29
 
30
- import { Head } from './Head'
31
- import { Body } from './Body'
32
-
33
30
  import type {
34
31
  Spacing,
35
32
  WithStyleProps,
@@ -41,6 +38,26 @@ import type {
41
38
  TableTheme
42
39
  } from '@instructure/shared-types'
43
40
 
41
+ import { Head } from './Head'
42
+ import type { TableHeadProps } from './Head/props'
43
+ import { Body } from './Body'
44
+ import type { TableBodyProps } from './Body/props'
45
+ import { Row } from './Row'
46
+ import type { TableRowProps } from './Row/props'
47
+ import { ColHeader } from './ColHeader'
48
+ import type { TableColHeaderProps } from './ColHeader/props'
49
+ import { RowHeader } from './RowHeader'
50
+ import type { TableRowHeaderProps } from './RowHeader/props'
51
+ import { Cell } from './Cell'
52
+ import type { TableCellProps } from './Cell/props'
53
+
54
+ type HeadChild = React.ComponentElement<TableHeadProps, Head>
55
+ type BodyChild = React.ComponentElement<TableBodyProps, Body>
56
+ type RowChild = React.ComponentElement<TableRowProps, Row>
57
+ type ColHeaderChild = React.ComponentElement<TableColHeaderProps, ColHeader>
58
+ type RowHeaderChild = React.ComponentElement<TableRowHeaderProps, RowHeader>
59
+ type CellChild = React.ComponentElement<TableCellProps, Cell>
60
+
44
61
  type TableOwnProps = {
45
62
  /**
46
63
  * Provide a screen reader friendly description. Anything passed to this
@@ -101,5 +118,15 @@ const allowedProps: AllowedPropKeys = [
101
118
  'layout'
102
119
  ]
103
120
 
104
- export type { TableProps, TableStyle }
121
+ export type {
122
+ TableProps,
123
+ TableStyle,
124
+ // children
125
+ HeadChild,
126
+ BodyChild,
127
+ RowChild,
128
+ ColHeaderChild,
129
+ RowHeaderChild,
130
+ CellChild
131
+ }
105
132
  export { propTypes, allowedProps }