@sproutsocial/seeds-react-table 1.0.1 → 1.0.3

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.
@@ -1,277 +1,53 @@
1
1
  yarn run v1.22.22
2
2
  $ tsup --dts
3
- [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
4
-
5
- package.json:14:6:
6
- 14 │ "types": "./dist/index.d.ts"
7
- ╵ ~~~~~~~
8
-
9
- The "import" condition comes earlier and will be used for all "import" statements:
10
-
11
- package.json:12:6:
12
- 12 │ "import": "./dist/esm/index.js",
13
- ~~~~~~~~
14
-
15
- The "require" condition comes earlier and will be used for all "require" calls:
16
-
17
- package.json:13:6:
18
- 13 │ "require": "./dist/index.js",
19
- ╵ ~~~~~~~~~
20
-
21
- [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
22
-
23
- package.json:19:6:
24
- 19 │ "types": "./dist/tableCell.d.ts"
25
- ╵ ~~~~~~~
26
-
27
- The "import" condition comes earlier and will be used for all "import" statements:
28
-
29
- package.json:17:6:
30
- 17 │ "import": "./dist/esm/tableCell.js",
31
- ╵ ~~~~~~~~
32
-
33
- The "require" condition comes earlier and will be used for all "require" calls:
34
-
35
- package.json:18:6:
36
- 18 │ "require": "./dist/tableCell.js",
37
- ╵ ~~~~~~~~~
38
-
39
- [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
40
-
41
- package.json:24:6:
42
- 24 │ "types": "./dist/tableHeaderCell.d.ts"
43
- ╵ ~~~~~~~
44
-
45
- The "import" condition comes earlier and will be used for all "import" statements:
46
-
47
- package.json:22:6:
48
- 22 │ "import": "./dist/esm/tableHeaderCell.js",
49
- ╵ ~~~~~~~~
50
-
51
- The "require" condition comes earlier and will be used for all "require" calls:
52
-
53
- package.json:23:6:
54
- 23 │ "require": "./dist/tableHeaderCell.js",
55
- ╵ ~~~~~~~~~
56
-
57
- ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
58
-
59
- package.json:29:6:
60
- 29 │ "types": "./dist/tableRowAccordion.d.ts"
61
- ╵ ~~~~~~~
62
-
63
- The "import" condition comes earlier and will be used for all "import" statements:
64
-
65
- package.json:27:6:
66
- 27 │ "import": "./dist/esm/tableRowAccordion.js",
67
- ╵ ~~~~~~~~
68
-
69
- The "require" condition comes earlier and will be used for all "require" calls:
70
-
71
- package.json:28:6:
72
- 28 │ "require": "./dist/tableRowAccordion.js",
73
- ╵ ~~~~~~~~~
74
-
75
- CLI Building entry: {"index":"src/index.ts","tableCell":"src/TableCell/index.ts","tableHeaderCell":"src/TableHeaderCell/index.ts","tableRowAccordion":"src/TableRowAccordion/index.ts"}
76
- CLI Using tsconfig: tsconfig.json
77
- CLI tsup v8.0.2
78
- CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-table/tsup.config.ts
79
- CLI Target: es2022
80
- CLI Cleaning output folder
81
- CJS Build start
82
- ESM Build start
83
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
84
-
85
- package.json:14:6:
86
-  14 │ "types": "./dist/index.d.ts"
87
- ╵ ~~~~~~~
88
-
89
- The "import" condition comes earlier and will be used for all "import" statements:
90
-
91
- package.json:12:6:
92
-  12 │ "import": "./dist/esm/index.js",
93
- ╵ ~~~~~~~~
94
-
95
- The "require" condition comes earlier and will be used for all "require" calls:
96
-
97
- package.json:13:6:
98
-  13 │ "require": "./dist/index.js",
99
- ╵ ~~~~~~~~~
100
-
101
-
102
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
103
-
104
- package.json:19:6:
105
-  19 │ "types": "./dist/tableCell.d.ts"
106
- ╵ ~~~~~~~
107
-
108
- The "import" condition comes earlier and will be used for all "import" statements:
109
-
110
- package.json:17:6:
111
-  17 │ "import": "./dist/esm/tableCell.js",
112
- ╵ ~~~~~~~~
113
-
114
- The "require" condition comes earlier and will be used for all "require" calls:
115
-
116
- package.json:18:6:
117
-  18 │ "require": "./dist/tableCell.js",
118
- ╵ ~~~~~~~~~
119
-
120
-
121
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
122
-
123
- package.json:24:6:
124
-  24 │ "types": "./dist/tableHeaderCell.d.ts"
125
- ╵ ~~~~~~~
126
-
127
- The "import" condition comes earlier and will be used for all "import" statements:
128
-
129
- package.json:22:6:
130
-  22 │ "import": "./dist/esm/tableHeaderCell.js",
131
- ╵ ~~~~~~~~
132
-
133
- The "require" condition comes earlier and will be used for all "require" calls:
134
-
135
- package.json:23:6:
136
-  23 │ "require": "./dist/tableHeaderCell.js",
137
- ╵ ~~~~~~~~~
138
-
139
-
140
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
141
-
142
- package.json:29:6:
143
-  29 │ "types": "./dist/tableRowAccordion.d.ts"
144
- ╵ ~~~~~~~
145
-
146
- The "import" condition comes earlier and will be used for all "import" statements:
147
-
148
- package.json:27:6:
149
-  27 │ "import": "./dist/esm/tableRowAccordion.js",
150
- ╵ ~~~~~~~~
151
-
152
- The "require" condition comes earlier and will be used for all "require" calls:
153
-
154
- package.json:28:6:
155
-  28 │ "require": "./dist/tableRowAccordion.js",
156
- ╵ ~~~~~~~~~
157
-
158
-
159
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
160
-
161
- package.json:14:6:
162
-  14 │ "types": "./dist/index.d.ts"
163
- ╵ ~~~~~~~
164
-
165
- The "import" condition comes earlier and will be used for all "import" statements:
166
-
167
- package.json:12:6:
168
-  12 │ "import": "./dist/esm/index.js",
169
- ╵ ~~~~~~~~
170
-
171
- The "require" condition comes earlier and will be used for all "require" calls:
172
-
173
- package.json:13:6:
174
-  13 │ "require": "./dist/index.js",
175
- ╵ ~~~~~~~~~
176
-
177
-
178
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
179
-
180
- package.json:19:6:
181
-  19 │ "types": "./dist/tableCell.d.ts"
182
- ╵ ~~~~~~~
183
-
184
- The "import" condition comes earlier and will be used for all "import" statements:
185
-
186
- package.json:17:6:
187
-  17 │ "import": "./dist/esm/tableCell.js",
188
- ╵ ~~~~~~~~
189
-
190
- The "require" condition comes earlier and will be used for all "require" calls:
191
-
192
- package.json:18:6:
193
-  18 │ "require": "./dist/tableCell.js",
194
- ╵ ~~~~~~~~~
195
-
196
-
197
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
198
-
199
- package.json:24:6:
200
-  24 │ "types": "./dist/tableHeaderCell.d.ts"
201
- ╵ ~~~~~~~
202
-
203
- The "import" condition comes earlier and will be used for all "import" statements:
204
-
205
- package.json:22:6:
206
-  22 │ "import": "./dist/esm/tableHeaderCell.js",
207
- ╵ ~~~~~~~~
208
-
209
- The "require" condition comes earlier and will be used for all "require" calls:
210
-
211
- package.json:23:6:
212
-  23 │ "require": "./dist/tableHeaderCell.js",
213
- ╵ ~~~~~~~~~
214
-
215
-
216
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
217
-
218
- package.json:29:6:
219
-  29 │ "types": "./dist/tableRowAccordion.d.ts"
220
- ╵ ~~~~~~~
221
-
222
- The "import" condition comes earlier and will be used for all "import" statements:
223
-
224
- package.json:27:6:
225
-  27 │ "import": "./dist/esm/tableRowAccordion.js",
226
- ╵ ~~~~~~~~
227
-
228
- The "require" condition comes earlier and will be used for all "require" calls:
229
-
230
- package.json:28:6:
231
-  28 │ "require": "./dist/tableRowAccordion.js",
232
- ╵ ~~~~~~~~~
233
-
234
-
235
- CJS dist/index.js 10.33 KB
236
- CJS dist/tableCell.js 3.10 KB
237
- CJS dist/tableHeaderCell.js 5.96 KB
238
- CJS dist/tableRowAccordion.js 6.36 KB
239
- CJS dist/index.js.map 18.90 KB
240
- CJS dist/tableCell.js.map 3.88 KB
241
- CJS dist/tableHeaderCell.js.map 8.11 KB
242
- CJS dist/tableRowAccordion.js.map 9.26 KB
243
- CJS ⚡️ Build success in 330ms
244
- ESM dist/esm/index.js 2.92 KB
245
- ESM dist/esm/tableCell.js 196.00 B
246
- ESM dist/esm/tableHeaderCell.js 270.00 B
247
- ESM dist/esm/chunk-SMHAMHIP.js 3.89 KB
248
- ESM dist/esm/tableRowAccordion.js 2.93 KB
249
- ESM dist/esm/chunk-XJMS6762.js 1.34 KB
250
- ESM dist/esm/index.js.map 6.74 KB
251
- ESM dist/esm/tableCell.js.map 71.00 B
252
- ESM dist/esm/tableHeaderCell.js.map 71.00 B
253
- ESM dist/esm/chunk-SMHAMHIP.js.map 8.00 KB
254
- ESM dist/esm/tableRowAccordion.js.map 5.25 KB
255
- ESM dist/esm/chunk-XJMS6762.js.map 3.79 KB
256
- ESM ⚡️ Build success in 337ms
257
- DTS Build start
258
- DTS ⚡️ Build success in 88864ms
259
- DTS dist/index.d.ts 1.27 KB
260
- DTS dist/tableCell.d.ts 270.00 B
261
- DTS dist/tableHeaderCell.d.ts 396.00 B
262
- DTS dist/tableRowAccordion.d.ts 1.27 KB
263
- DTS dist/TableCell-CN71R1B5.d.ts 453.00 B
264
- DTS dist/TableHeaderCell-DnwlruQg.d.ts 588.00 B
265
- DTS dist/TableTypes-Dg7QrcGt.d.ts 1.55 KB
266
- DTS dist/TableHeaderCellTypes-CH_zzW6X.d.ts 1.06 KB
267
- DTS dist/TableCellTypes-Cp-8r7l1.d.ts 1013.00 B
268
- DTS dist/index.d.mts 1.28 KB
269
- DTS dist/tableCell.d.mts 272.00 B
270
- DTS dist/tableHeaderCell.d.mts 399.00 B
271
- DTS dist/tableRowAccordion.d.mts 1.27 KB
272
- DTS dist/TableCell-B8GMRlv7.d.mts 454.00 B
273
- DTS dist/TableHeaderCell-DsJpGb2j.d.mts 589.00 B
274
- DTS dist/TableTypes-jS0O3bwQ.d.mts 1.55 KB
275
- DTS dist/TableHeaderCellTypes-CsJQBwu2.d.mts 1.06 KB
276
- DTS dist/TableCellTypes-Cp-8r7l1.d.mts 1013.00 B
277
- Done in 96.37s.
3
+ CLI Building entry: {"index":"src/index.ts","tableCell":"src/TableCell/index.ts","tableHeaderCell":"src/TableHeaderCell/index.ts","tableRowAccordion":"src/TableRowAccordion/index.ts"}
4
+ CLI Using tsconfig: tsconfig.json
5
+ CLI tsup v8.5.0
6
+ CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-table/tsup.config.ts
7
+ CLI Target: es2022
8
+ CLI Cleaning output folder
9
+ CJS Build start
10
+ ESM Build start
11
+ ESM dist/esm/index.js 2.92 KB
12
+ ESM dist/esm/tableCell.js 196.00 B
13
+ ESM dist/esm/tableHeaderCell.js 270.00 B
14
+ ESM dist/esm/chunk-SMHAMHIP.js 3.89 KB
15
+ ESM dist/esm/tableRowAccordion.js 2.93 KB
16
+ ESM dist/esm/chunk-XJMS6762.js 1.34 KB
17
+ ESM dist/esm/index.js.map 6.74 KB
18
+ ESM dist/esm/tableCell.js.map 71.00 B
19
+ ESM dist/esm/tableHeaderCell.js.map 71.00 B
20
+ ESM dist/esm/chunk-SMHAMHIP.js.map 8.00 KB
21
+ ESM dist/esm/tableRowAccordion.js.map 5.25 KB
22
+ ESM dist/esm/chunk-XJMS6762.js.map 3.79 KB
23
+ ESM ⚡️ Build success in 277ms
24
+ CJS dist/index.js 10.33 KB
25
+ CJS dist/tableCell.js 3.10 KB
26
+ CJS dist/tableHeaderCell.js 5.96 KB
27
+ CJS dist/tableRowAccordion.js 6.36 KB
28
+ CJS dist/index.js.map 18.90 KB
29
+ CJS dist/tableCell.js.map 3.88 KB
30
+ CJS dist/tableHeaderCell.js.map 8.11 KB
31
+ CJS dist/tableRowAccordion.js.map 9.26 KB
32
+ CJS ⚡️ Build success in 300ms
33
+ DTS Build start
34
+ DTS ⚡️ Build success in 83842ms
35
+ DTS dist/index.d.ts 1.27 KB
36
+ DTS dist/tableCell.d.ts 270.00 B
37
+ DTS dist/tableHeaderCell.d.ts 396.00 B
38
+ DTS dist/tableRowAccordion.d.ts 1.27 KB
39
+ DTS dist/TableCell-CN71R1B5.d.ts 453.00 B
40
+ DTS dist/TableHeaderCell-DnwlruQg.d.ts 588.00 B
41
+ DTS dist/TableTypes-Dg7QrcGt.d.ts 1.55 KB
42
+ DTS dist/TableHeaderCellTypes-CH_zzW6X.d.ts 1.06 KB
43
+ DTS dist/TableCellTypes-Cp-8r7l1.d.ts 1013.00 B
44
+ DTS dist/index.d.mts 1.28 KB
45
+ DTS dist/tableCell.d.mts 272.00 B
46
+ DTS dist/tableHeaderCell.d.mts 399.00 B
47
+ DTS dist/tableRowAccordion.d.mts 1.27 KB
48
+ DTS dist/TableCell-B8GMRlv7.d.mts 454.00 B
49
+ DTS dist/TableHeaderCell-DsJpGb2j.d.mts 589.00 B
50
+ DTS dist/TableTypes-jS0O3bwQ.d.mts 1.55 KB
51
+ DTS dist/TableHeaderCellTypes-CsJQBwu2.d.mts 1.06 KB
52
+ DTS dist/TableCellTypes-Cp-8r7l1.d.mts 1013.00 B
53
+ Done in 91.43s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @sproutsocial/seeds-react-table
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [47580c4]
8
+ - @sproutsocial/seeds-react-theme@3.1.0
9
+ - @sproutsocial/seeds-react-icon@1.1.4
10
+
11
+ ## 1.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [22e1111]
16
+ - @sproutsocial/seeds-react-theme@3.0.1
17
+ - @sproutsocial/seeds-react-icon@1.1.3
18
+
3
19
  ## 1.0.1
4
20
 
5
21
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table.tsx","../../src/styles.ts","../../src/TableTypes.ts","../../src/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport TableCell from \"./TableCell\";\nimport TableHeaderCell from \"./TableHeaderCell\";\nimport Container from \"./styles\";\nimport type {\n TypePassthroughProps,\n TypeTableProps,\n TypeTableRow,\n} from \"./TableTypes\";\n\nconst renderTableRow = (row: TypeTableRow) => {\n return (\n <tbody key={row.id} data-qa-table-row=\"\">\n <tr>\n {row.cells.map((td) => {\n return <TableCell {...td} key={td.id} />;\n })}\n </tr>\n </tbody>\n );\n};\n\n/**\n * The table component assist in rendering tablular data.\n */\nexport const Table = ({\n head = [],\n rows = [],\n onSort,\n sortId,\n sortDirection,\n rowRender,\n children,\n color,\n ...rest\n}: TypeTableProps) => {\n if (children) {\n return (\n <Container {...rest} data-qa-table=\"\">\n {children}\n </Container>\n );\n }\n\n return (\n <Container\n {...rest}\n data-qa-table=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <colgroup>\n {head.map(({ id, colSpan = 1 }) => (\n <col key={id} span={colSpan} />\n ))}\n </colgroup>\n {head.length > 0 && (\n <thead data-qa-table-header=\"\">\n <tr>\n {head.map(({ color, ...th }) => {\n return (\n <TableHeaderCell\n {...th}\n key={th.id}\n onSort={onSort}\n sortId={sortId}\n sortDirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n })}\n </tr>\n </thead>\n )}\n {rows.map((row) => {\n return rowRender ? rowRender(row) : renderTableRow(row);\n })}\n </Container>\n );\n};\n\nexport const TableHead = ({ children, ...props }: TypePassthroughProps) => (\n <thead {...props}>{children}</thead>\n);\n\nexport const TableBody = ({ children, ...props }: TypePassthroughProps) => (\n <tbody {...props}>{children}</tbody>\n);\n\nexport const TableRow = ({ children, ...props }: TypePassthroughProps) => (\n <tr {...props}>{children}</tr>\n);\n\nTableHead.displayName = \"Table.TableHead\";\nTableBody.displayName = \"Table.TableBody\";\nTableRow.displayName = \"Table.TableRow\";\nTableHeaderCell.displayName = \"Table.HeaderCell\";\nTableCell.displayName = \"Table.Cell\";\n\nTable.TableHead = TableHead;\nTable.TableBody = TableBody;\nTable.TableRow = TableRow;\nTable.HeaderCell = TableHeaderCell;\nTable.Cell = TableCell;\n\nexport default Table;\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\n\nconst Container = styled.table`\n width: 100%;\n border-collapse: collapse;\n\n thead {\n vertical-align: bottom;\n }\n\n tr,\n thead {\n border-bottom: 1px solid\n ${(props) => props.theme.colors.container.border.base};\n }\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeEnumSortDirections,\n TypeTableHeaderCellProps,\n} from \"./TableHeaderCell\";\nimport type { TypeTableCellProps } from \"./TableCell/TableCellTypes\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypePassthroughProps {\n children: React.ReactNode;\n}\n\nexport interface TypeTableRow {\n /** Table Row Id */\n id: string;\n\n /** Array for TableCells to render */\n cells: TypeTableCellProps[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TypeTableHeadProp\n extends Omit<\n TypeTableHeaderCellProps,\n \"onSort\" | \"sortId\" | \"sortDirection\"\n > {}\n\nexport interface TypeTableProps\n extends TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"table\">, keyof TypeSystemCommonProps> {\n /** Array of TableHeaderCells to render */\n head?: TypeTableHeadProp[];\n\n /** Array of TableRows to render */\n rows?: TypeTableRow[];\n\n /** Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Custom row render for flexibilty */\n rowRender?: (row: TypeTableRow) => React.ReactNode;\n\n /**\n * Including children will overwrite all head, rows, rowRender, and sorting props\n * Should be used for manually rendering tables and ignoring data props\n */\n children?: React.ReactNode;\n}\n","import Table from \"./Table\";\n\nexport default Table;\nexport { Table };\nexport * from \"./TableTyp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AAAA;AAAA,UACT;AAAA,QAEJ,CAAC,GACH,GACF;AAAA,QAED,KAAK,IAAI,CAAC,QAAQ;AACjB,iBAAO,YAAY,UAAU,GAAG,IAAI,eAAe,GAAG;AAAA,QACxD,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEO,IAAM,YAAY,CAAC,EAAE,UAAU,GAAG,MAAM,MAC7C,oBAAC,WAAO,GAAG,OAAQ,UAAS;AAGvB,IAAM,YAAY,CAAC,EAAE,UAAU,GAAG,MAAM,MAC7C,oBAAC,WAAO,GAAG,OAAQ,UAAS;AAGvB,IAAM,WAAW,CAAC,EAAE,UAAU,GAAG,MAAM,MAC5C,oBAAC,QAAI,GAAG,OAAQ,UAAS;AAG3B,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,SAAS,cAAc;AACvB,wBAAgB,cAAc;AAC9B,kBAAU,cAAc;AAExB,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,OAAO;AAEb,IAAO,gBAAQ;;;AE9Gf,OAAuB;;;ACEvB,IAAO,cAAQ;","names":["color"]}
1
+ {"version":3,"sources":["../../src/Table.tsx","../../src/styles.ts","../../src/TableTypes.ts","../../src/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport TableCell from \"./TableCell\";\nimport TableHeaderCell from \"./TableHeaderCell\";\nimport Container from \"./styles\";\nimport type {\n TypePassthroughProps,\n TypeTableProps,\n TypeTableRow,\n} from \"./TableTypes\";\n\nconst renderTableRow = (row: TypeTableRow) => {\n return (\n <tbody key={row.id} data-qa-table-row=\"\">\n <tr>\n {row.cells.map((td) => {\n return <TableCell {...td} key={td.id} />;\n })}\n </tr>\n </tbody>\n );\n};\n\n/**\n * The table component assist in rendering tabular data.\n */\nexport const Table = ({\n head = [],\n rows = [],\n onSort,\n sortId,\n sortDirection,\n rowRender,\n children,\n color,\n ...rest\n}: TypeTableProps) => {\n if (children) {\n return (\n <Container {...rest} data-qa-table=\"\">\n {children}\n </Container>\n );\n }\n\n return (\n <Container\n {...rest}\n data-qa-table=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <colgroup>\n {head.map(({ id, colSpan = 1 }) => (\n <col key={id} span={colSpan} />\n ))}\n </colgroup>\n {head.length > 0 && (\n <thead data-qa-table-header=\"\">\n <tr>\n {head.map(({ color, ...th }) => {\n return (\n <TableHeaderCell\n {...th}\n key={th.id}\n onSort={onSort}\n sortId={sortId}\n sortDirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n })}\n </tr>\n </thead>\n )}\n {rows.map((row) => {\n return rowRender ? rowRender(row) : renderTableRow(row);\n })}\n </Container>\n );\n};\n\nexport const TableHead = ({ children, ...props }: TypePassthroughProps) => (\n <thead {...props}>{children}</thead>\n);\n\nexport const TableBody = ({ children, ...props }: TypePassthroughProps) => (\n <tbody {...props}>{children}</tbody>\n);\n\nexport const TableRow = ({ children, ...props }: TypePassthroughProps) => (\n <tr {...props}>{children}</tr>\n);\n\nTableHead.displayName = \"Table.TableHead\";\nTableBody.displayName = \"Table.TableBody\";\nTableRow.displayName = \"Table.TableRow\";\nTableHeaderCell.displayName = \"Table.HeaderCell\";\nTableCell.displayName = \"Table.Cell\";\n\nTable.TableHead = TableHead;\nTable.TableBody = TableBody;\nTable.TableRow = TableRow;\nTable.HeaderCell = TableHeaderCell;\nTable.Cell = TableCell;\n\nexport default Table;\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\n\nconst Container = styled.table`\n width: 100%;\n border-collapse: collapse;\n\n thead {\n vertical-align: bottom;\n }\n\n tr,\n thead {\n border-bottom: 1px solid\n ${(props) => props.theme.colors.container.border.base};\n }\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeEnumSortDirections,\n TypeTableHeaderCellProps,\n} from \"./TableHeaderCell\";\nimport type { TypeTableCellProps } from \"./TableCell/TableCellTypes\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypePassthroughProps {\n children: React.ReactNode;\n}\n\nexport interface TypeTableRow {\n /** Table Row Id */\n id: string;\n\n /** Array for TableCells to render */\n cells: TypeTableCellProps[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TypeTableHeadProp\n extends Omit<\n TypeTableHeaderCellProps,\n \"onSort\" | \"sortId\" | \"sortDirection\"\n > {}\n\nexport interface TypeTableProps\n extends TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"table\">, keyof TypeSystemCommonProps> {\n /** Array of TableHeaderCells to render */\n head?: TypeTableHeadProp[];\n\n /** Array of TableRows to render */\n rows?: TypeTableRow[];\n\n /** Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Custom row render for flexibilty */\n rowRender?: (row: TypeTableRow) => React.ReactNode;\n\n /**\n * Including children will overwrite all head, rows, rowRender, and sorting props\n * Should be used for manually rendering tables and ignoring data props\n */\n children?: React.ReactNode;\n}\n","import Table from \"./Table\";\n\nexport default Table;\nexport { Table };\nexport * from \"./TableTypes\";\n"],"mappings":";;;;;;;;AAAA,OAAuB;;;ACAvB,OAAO,YAAY;AACnB,SAAS,cAAc;AAEvB,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAWjB,CAAC,UAAU,MAAM,MAAM,OAAO,UAAU,OAAO,IAAI;AAAA;AAAA;AAAA,IAGvD,MAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADPT,cAgCF,YAhCE;AAEW;AALjB,IAAM,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,oBAAC,WAAO,GAAG,OAAQ,UAAS;AAGvB,IAAM,WAAW,CAAC,EAAE,UAAU,GAAG,MAAM,MAC5C,oBAAC,QAAI,GAAG,OAAQ,UAAS;AAG3B,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,SAAS,cAAc;AACvB,wBAAgB,cAAc;AAC9B,kBAAU,cAAc;AAExB,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,OAAO;AAEb,IAAO,gBAAQ;;;AE9Gf,OAAuB;;;ACEvB,IAAO,cAAQ;","names":["color"]}
package/dist/index.d.mts CHANGED
@@ -9,7 +9,7 @@ import '@sproutsocial/seeds-react-system-props';
9
9
  import './TableHeaderCellTypes-CsJQBwu2.mjs';
10
10
 
11
11
  /**
12
- * The table component assist in rendering tablular data.
12
+ * The table component assist in rendering tabular data.
13
13
  */
14
14
  declare const Table: {
15
15
  ({ head, rows, onSort, sortId, sortDirection, rowRender, children, color, ...rest }: TypeTableProps): react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import '@sproutsocial/seeds-react-system-props';
9
9
  import './TableHeaderCellTypes-CH_zzW6X.js';
10
10
 
11
11
  /**
12
- * The table component assist in rendering tablular data.
12
+ * The table component assist in rendering tabular data.
13
13
  */
14
14
  declare const Table: {
15
15
  ({ head, rows, onSort, sortId, sortDirection, rowRender, children, color, ...rest }: TypeTableProps): react_jsx_runtime.JSX.Element;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/Table.tsx","../src/TableCell/TableCell.tsx","../src/TableCell/styles.ts","../src/TableCell/TableCellTypes.ts","../src/TableCell/index.ts","../src/TableHeaderCell/TableHeaderCell.tsx","../src/TableHeaderCell/styles.ts","../src/TableHeaderCell/constants.ts","../src/TableHeaderCell/TableHeaderCellTypes.ts","../src/TableHeaderCell/index.ts","../src/styles.ts","../src/TableTypes.ts"],"sourcesContent":["import Table from \"./Table\";\n\nexport default Table;\nexport { Table };\nexport * from \"./TableTypes\";\n","import * as React from \"react\";\nimport TableCell from \"./TableCell\";\nimport TableHeaderCell from \"./TableHeaderCell\";\nimport Container from \"./styles\";\nimport type {\n TypePassthroughProps,\n TypeTableProps,\n TypeTableRow,\n} from \"./TableTypes\";\n\nconst renderTableRow = (row: TypeTableRow) => {\n return (\n <tbody key={row.id} data-qa-table-row=\"\">\n <tr>\n {row.cells.map((td) => {\n return <TableCell {...td} key={td.id} />;\n })}\n </tr>\n </tbody>\n );\n};\n\n/**\n * The table component assist in rendering tablular data.\n */\nexport const Table = ({\n head = [],\n rows = [],\n onSort,\n sortId,\n sortDirection,\n rowRender,\n children,\n color,\n ...rest\n}: TypeTableProps) => {\n if (children) {\n return (\n <Container {...rest} data-qa-table=\"\">\n {children}\n </Container>\n );\n }\n\n return (\n <Container\n {...rest}\n data-qa-table=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <colgroup>\n {head.map(({ id, colSpan = 1 }) => (\n <col key={id} span={colSpan} />\n ))}\n </colgroup>\n {head.length > 0 && (\n <thead data-qa-table-header=\"\">\n <tr>\n {head.map(({ color, ...th }) => {\n return (\n <TableHeaderCell\n {...th}\n key={th.id}\n onSort={onSort}\n sortId={sortId}\n sortDirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n })}\n </tr>\n </thead>\n )}\n {rows.map((row) => {\n return rowRender ? rowRender(row) : renderTableRow(row);\n })}\n </Container>\n );\n};\n\nexport const TableHead = ({ children, ...props }: TypePassthroughProps) => (\n <thead {...props}>{children}</thead>\n);\n\nexport const TableBody = ({ children, ...props }: TypePassthroughProps) => (\n <tbody {...props}>{children}</tbody>\n);\n\nexport const TableRow = ({ children, ...props }: TypePassthroughProps) => (\n <tr {...props}>{children}</tr>\n);\n\nTableHead.displayName = \"Table.TableHead\";\nTableBody.displayName = \"Table.TableBody\";\nTableRow.displayName = \"Table.TableRow\";\nTableHeaderCell.displayName = \"Table.HeaderCell\";\nTableCell.displayName = \"Table.Cell\";\n\nTable.TableHead = TableHead;\nTable.TableBody = TableBody;\nTable.TableRow = TableRow;\nTable.HeaderCell = TableHeaderCell;\nTable.Cell = TableCell;\n\nexport default Table;\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeTableCellProps } from \"./TableCellTypes\";\n\n/**\n * The table cell component is for rendering table cells and is meant to be used with the table component.\n */\nexport class TableCell extends React.Component<TypeTableCellProps> {\n static displayName: string;\n override render() {\n const {\n id,\n content,\n colSpan,\n width,\n align,\n scope,\n children,\n color,\n ...rest\n } = this.props;\n return (\n <Container\n {...rest}\n // If the `scope` property is passed we must render the element as a <th>\n as={scope ? \"th\" : \"td\"}\n scope={scope ? scope : undefined}\n alignment={align || \"left\"}\n key={id}\n colSpan={colSpan}\n width={width}\n data-qa-table-cell=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n {children || content}\n </Container>\n );\n }\n}\n\nexport default TableCell;\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeTableCellProps } from \"./TableCellTypes\";\n\nconst Container = styled.td<{\n alignment: TypeTableCellProps[\"align\"];\n}>`\n ${(props) => props.theme.typography[200]}\n font-weight: ${(props) => props.theme.fontWeights.normal};\n padding: ${(props) => props.theme.space[300]};\n text-align: ${(props) => props.alignment};\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypeTableCellProps\n extends TypeSystemCommonProps,\n Omit<\n React.ComponentPropsWithoutRef<\"td\">,\n keyof TypeSystemCommonProps | \"content\"\n > {\n /** Table Cell Id */\n id: string;\n\n /** Content is deprecated. Please use children instead. Content to be render */\n content?: React.ReactNode;\n\n /** Controls the colSpan attribute (optional) */\n colSpan?: number;\n\n /** Controls the width attribute (optional) */\n width?: number;\n\n /** Controls the CSS text-align property (optional) */\n align?: \"left\" | \"right\" | \"center\" | \"justify\";\n\n /** Controls the scope attribute. If set, will change the element from a <td> to a <th>. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#scope (optional) */\n scope?: \"row\" | \"col\" | \"rowGroup\" | \"colGroup\";\n\n /** Children to be rendered */\n children?: React.ReactNode;\n}\n","import TableCell from \"./TableCell\";\n\nexport default TableCell;\nexport { TableCell };\nexport * from \"./TableCellTypes\";\n","import * as React from \"react\";\nimport Icon, { type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport Container, { SortIcon, UnstyledButton } from \"./styles\";\nimport { SORT_DIRECTIONS } from \"./constants\";\nimport type { TypeTableHeaderCellProps } from \"./TableHeaderCellTypes\";\n\nexport class TableHeaderCell extends React.Component<TypeTableHeaderCellProps> {\n static displayName: string;\n\n getSortIcon = (\n isSorted: boolean,\n ariaSortDirection: \"ascending\" | \"descending\" | undefined\n ) => {\n const { sortDirection } = this.props;\n let iconName: TypeIconName = \"caret-up-down-outline\";\n\n if (isSorted && sortDirection === SORT_DIRECTIONS.ASC) {\n iconName = \"caret-up-solid\";\n } else if (isSorted && sortDirection === SORT_DIRECTIONS.DESC) {\n iconName = \"caret-down-solid\";\n }\n\n return (\n <SortIcon>\n <Icon size=\"mini\" name={iconName} aria-label={ariaSortDirection} />\n </SortIcon>\n );\n };\n\n // @ts-note: If this is set to an HTMLButtonElement event, then the `Container` freaks out\n handleClick = (\n e: React.MouseEvent<HTMLTableCellElement | HTMLButtonElement>\n ) => {\n const { onClick, onSort, isSortable, id } = this.props;\n\n if (onClick || isSortable) {\n e.preventDefault();\n }\n\n if (onClick) {\n // @ts-note: Right now the `onClick` is incorrectly set to consume an HTMLButtonElement event\n onClick(e as unknown as React.MouseEvent<HTMLButtonElement>);\n return;\n }\n\n if (!isSortable || !onSort) return;\n onSort(id);\n };\n\n override render() {\n const {\n id,\n content,\n colSpan,\n width,\n align,\n isSortable,\n sortId,\n sortDirection,\n children,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n shouldTruncate,\n onSort,\n onClick,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n color,\n ...rest\n } = this.props;\n\n const isSorted = sortId === id;\n const ariaSort = isSorted\n ? sortDirection === SORT_DIRECTIONS.ASC\n ? \"ascending\"\n : \"descending\"\n : undefined;\n\n const buttonProps = isSortable\n ? {\n role: \"button\",\n onClick: this.handleClick,\n }\n : {};\n\n const scope = colSpan ? \"colgroup\" : \"col\";\n\n return (\n <Container\n {...rest}\n key={id}\n alignment={align || \"left\"}\n sortable={isSortable}\n colSpan={colSpan}\n scope={scope}\n width={width}\n onClick={this.handleClick}\n data-tableheadercell-sortable={isSortable}\n data-qa-table-header-cell=\"\"\n data-qa-table-header-cell-sortdirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n aria-sort={ariaSort}\n >\n {isSortable ? (\n <UnstyledButton {...buttonProps}>\n <div aria-live=\"polite\" role=\"status\">\n {children || content}\n {!children && this.getSortIcon(id === sortId, ariaSort)}\n </div>\n </UnstyledButton>\n ) : (\n children || content\n )}\n </Container>\n );\n }\n}\n\nexport default TableHeaderCell;\n","import styled, { css } from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeTableHeaderCellProps } from \"./TableHeaderCellTypes\";\n\nconst Container = styled.th<{\n sortable?: boolean;\n alignment: TypeTableHeaderCellProps[\"align\"];\n width: TypeTableHeaderCellProps[\"width\"];\n}>`\n ${(props) => props.theme.typography[100]}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding: ${(props) => props.theme.space[300]};\n text-align: ${(props) => props.alignment};\n\n ${(props) =>\n props.sortable &&\n css`\n position: relative;\n cursor: pointer;\n `}\n\n ${COMMON}\n`;\n\nexport const SortIcon = styled.span`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n font-size: 0;\n padding: 0 ${(props) => props.theme.space[200]};\n`;\n\nexport const UnstyledButton = styled.button`\n background: none;\n border: none;\n color: inherit;\n font: inherit;\n line-height: normal;\n overflow: visible;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n`;\n\nexport default Container;\n","export const SORT_DIRECTIONS = {\n ASC: \"ASC\",\n DESC: \"DESC\",\n} as const;\n","import * as React from \"react\";\nimport type { TypeTableCellProps } from \"../TableCell/TableCellTypes\";\nimport { SORT_DIRECTIONS } from \"./constants\";\n\nexport type TypeEnumSortDirections = keyof typeof SORT_DIRECTIONS;\n\nexport interface TypeTableHeaderCellProps\n extends Omit<TypeTableCellProps, \"onClick\"> {\n /** Legacy Deteremines if a table column is sortable (optional) */\n isSortable?: boolean;\n\n /** Truncates text into a singular line with ellipsis (optional) */\n shouldTruncate?: boolean;\n\n /** Legacy: Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Legacy: Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Legacy: Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Callback for Click Events. If Included will override onSort prop */\n onClick?: (e: React.SyntheticEvent<HTMLButtonElement>) => void;\n}\n","import TableHeaderCell from \"./TableHeaderCell\";\n\nexport default TableHeaderCell;\nexport { TableHeaderCell };\nexport * from \"./TableHeaderCellTypes\";\nexport * from \"./constants\";\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\n\nconst Container = styled.table`\n width: 100%;\n border-collapse: collapse;\n\n thead {\n vertical-align: bottom;\n }\n\n tr,\n thead {\n border-bottom: 1px solid\n ${(props) => props.theme.colors.container.border.base};\n }\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeEnumSortDirections,\n TypeTableHeaderCellProps,\n} from \"./TableHeaderCell\";\nimport type { TypeTableCellProps } from \"./TableCell/TableCellTypes\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypePassthroughProps {\n children: React.ReactNode;\n}\n\nexport interface TypeTableRow {\n /** Table Row Id */\n id: string;\n\n /** Array for TableCells to render */\n cells: TypeTableCellProps[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TypeTableHeadProp\n extends Omit<\n TypeTableHeaderCellProps,\n \"onSort\" | \"sortId\" | \"sortDirection\"\n > {}\n\nexport interface TypeTableProps\n extends TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"table\">, keyof TypeSystemCommonProps> {\n /** Array of TableHeaderCells to render */\n head?: TypeTableHeadProp[];\n\n /** Array of TableRows to render */\n rows?: TypeTableRow[];\n\n /** Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Custom row render for flexibilty */\n rowRender?: (row: TypeTableRow) => React.ReactNode;\n\n /**\n * Including children will overwrite all head, rows, rowRender, and sorting props\n * Should be used for manually rendering tables and ignoring data props\n */\n children?: React.ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAAuB;AAGvB,IAAM,YAAY,yBAAAC,QAAO;AAAA,IAGrB,CAAC,UAAU,MAAM,MAAM,WAAW,GAAG,CAAC;AAAA,iBACzB,CAAC,UAAU,MAAM,MAAM,YAAY,MAAM;AAAA,aAC7C,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA,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I,SAAuB;;;AZEvB,IAAO,cAAQ;","names":["React","styled","React","TableCell_default","React","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_react","Icon","styles_default","React","TableHeaderCell_default","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_jsx_runtime","import_react","TableCell_default","styles_default","color","TableHeaderCell_default","React"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/Table.tsx","../src/TableCell/TableCell.tsx","../src/TableCell/styles.ts","../src/TableCell/TableCellTypes.ts","../src/TableCell/index.ts","../src/TableHeaderCell/TableHeaderCell.tsx","../src/TableHeaderCell/styles.ts","../src/TableHeaderCell/constants.ts","../src/TableHeaderCell/TableHeaderCellTypes.ts","../src/TableHeaderCell/index.ts","../src/styles.ts","../src/TableTypes.ts"],"sourcesContent":["import Table from \"./Table\";\n\nexport default Table;\nexport { Table };\nexport * from \"./TableTypes\";\n","import * as React from \"react\";\nimport TableCell from \"./TableCell\";\nimport TableHeaderCell from \"./TableHeaderCell\";\nimport Container from \"./styles\";\nimport type {\n TypePassthroughProps,\n TypeTableProps,\n TypeTableRow,\n} from \"./TableTypes\";\n\nconst renderTableRow = (row: TypeTableRow) => {\n return (\n <tbody key={row.id} data-qa-table-row=\"\">\n <tr>\n {row.cells.map((td) => {\n return <TableCell {...td} key={td.id} />;\n })}\n </tr>\n </tbody>\n );\n};\n\n/**\n * The table component assist in rendering tabular data.\n */\nexport const Table = ({\n head = [],\n rows = [],\n onSort,\n sortId,\n sortDirection,\n rowRender,\n children,\n color,\n ...rest\n}: TypeTableProps) => {\n if (children) {\n return (\n <Container {...rest} data-qa-table=\"\">\n {children}\n </Container>\n );\n }\n\n return (\n <Container\n {...rest}\n data-qa-table=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <colgroup>\n {head.map(({ id, colSpan = 1 }) => (\n <col key={id} span={colSpan} />\n ))}\n </colgroup>\n {head.length > 0 && (\n <thead data-qa-table-header=\"\">\n <tr>\n {head.map(({ color, ...th }) => {\n return (\n <TableHeaderCell\n {...th}\n key={th.id}\n onSort={onSort}\n sortId={sortId}\n sortDirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n />\n );\n })}\n </tr>\n </thead>\n )}\n {rows.map((row) => {\n return rowRender ? rowRender(row) : renderTableRow(row);\n })}\n </Container>\n );\n};\n\nexport const TableHead = ({ children, ...props }: TypePassthroughProps) => (\n <thead {...props}>{children}</thead>\n);\n\nexport const TableBody = ({ children, ...props }: TypePassthroughProps) => (\n <tbody {...props}>{children}</tbody>\n);\n\nexport const TableRow = ({ children, ...props }: TypePassthroughProps) => (\n <tr {...props}>{children}</tr>\n);\n\nTableHead.displayName = \"Table.TableHead\";\nTableBody.displayName = \"Table.TableBody\";\nTableRow.displayName = \"Table.TableRow\";\nTableHeaderCell.displayName = \"Table.HeaderCell\";\nTableCell.displayName = \"Table.Cell\";\n\nTable.TableHead = TableHead;\nTable.TableBody = TableBody;\nTable.TableRow = TableRow;\nTable.HeaderCell = TableHeaderCell;\nTable.Cell = TableCell;\n\nexport default Table;\n","import * as React from \"react\";\nimport Container from \"./styles\";\nimport type { TypeTableCellProps } from \"./TableCellTypes\";\n\n/**\n * The table cell component is for rendering table cells and is meant to be used with the table component.\n */\nexport class TableCell extends React.Component<TypeTableCellProps> {\n static displayName: string;\n override render() {\n const {\n id,\n content,\n colSpan,\n width,\n align,\n scope,\n children,\n color,\n ...rest\n } = this.props;\n return (\n <Container\n {...rest}\n // If the `scope` property is passed we must render the element as a <th>\n as={scope ? \"th\" : \"td\"}\n scope={scope ? scope : undefined}\n alignment={align || \"left\"}\n key={id}\n colSpan={colSpan}\n width={width}\n data-qa-table-cell=\"\"\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n {children || content}\n </Container>\n );\n }\n}\n\nexport default TableCell;\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeTableCellProps } from \"./TableCellTypes\";\n\nconst Container = styled.td<{\n alignment: TypeTableCellProps[\"align\"];\n}>`\n ${(props) => props.theme.typography[200]}\n font-weight: ${(props) => props.theme.fontWeights.normal};\n padding: ${(props) => props.theme.space[300]};\n text-align: ${(props) => props.alignment};\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypeTableCellProps\n extends TypeSystemCommonProps,\n Omit<\n React.ComponentPropsWithoutRef<\"td\">,\n keyof TypeSystemCommonProps | \"content\"\n > {\n /** Table Cell Id */\n id: string;\n\n /** Content is deprecated. Please use children instead. Content to be render */\n content?: React.ReactNode;\n\n /** Controls the colSpan attribute (optional) */\n colSpan?: number;\n\n /** Controls the width attribute (optional) */\n width?: number;\n\n /** Controls the CSS text-align property (optional) */\n align?: \"left\" | \"right\" | \"center\" | \"justify\";\n\n /** Controls the scope attribute. If set, will change the element from a <td> to a <th>. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#scope (optional) */\n scope?: \"row\" | \"col\" | \"rowGroup\" | \"colGroup\";\n\n /** Children to be rendered */\n children?: React.ReactNode;\n}\n","import TableCell from \"./TableCell\";\n\nexport default TableCell;\nexport { TableCell };\nexport * from \"./TableCellTypes\";\n","import * as React from \"react\";\nimport Icon, { type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport Container, { SortIcon, UnstyledButton } from \"./styles\";\nimport { SORT_DIRECTIONS } from \"./constants\";\nimport type { TypeTableHeaderCellProps } from \"./TableHeaderCellTypes\";\n\nexport class TableHeaderCell extends React.Component<TypeTableHeaderCellProps> {\n static displayName: string;\n\n getSortIcon = (\n isSorted: boolean,\n ariaSortDirection: \"ascending\" | \"descending\" | undefined\n ) => {\n const { sortDirection } = this.props;\n let iconName: TypeIconName = \"caret-up-down-outline\";\n\n if (isSorted && sortDirection === SORT_DIRECTIONS.ASC) {\n iconName = \"caret-up-solid\";\n } else if (isSorted && sortDirection === SORT_DIRECTIONS.DESC) {\n iconName = \"caret-down-solid\";\n }\n\n return (\n <SortIcon>\n <Icon size=\"mini\" name={iconName} aria-label={ariaSortDirection} />\n </SortIcon>\n );\n };\n\n // @ts-note: If this is set to an HTMLButtonElement event, then the `Container` freaks out\n handleClick = (\n e: React.MouseEvent<HTMLTableCellElement | HTMLButtonElement>\n ) => {\n const { onClick, onSort, isSortable, id } = this.props;\n\n if (onClick || isSortable) {\n e.preventDefault();\n }\n\n if (onClick) {\n // @ts-note: Right now the `onClick` is incorrectly set to consume an HTMLButtonElement event\n onClick(e as unknown as React.MouseEvent<HTMLButtonElement>);\n return;\n }\n\n if (!isSortable || !onSort) return;\n onSort(id);\n };\n\n override render() {\n const {\n id,\n content,\n colSpan,\n width,\n align,\n isSortable,\n sortId,\n sortDirection,\n children,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n shouldTruncate,\n onSort,\n onClick,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n color,\n ...rest\n } = this.props;\n\n const isSorted = sortId === id;\n const ariaSort = isSorted\n ? sortDirection === SORT_DIRECTIONS.ASC\n ? \"ascending\"\n : \"descending\"\n : undefined;\n\n const buttonProps = isSortable\n ? {\n role: \"button\",\n onClick: this.handleClick,\n }\n : {};\n\n const scope = colSpan ? \"colgroup\" : \"col\";\n\n return (\n <Container\n {...rest}\n key={id}\n alignment={align || \"left\"}\n sortable={isSortable}\n colSpan={colSpan}\n scope={scope}\n width={width}\n onClick={this.handleClick}\n data-tableheadercell-sortable={isSortable}\n data-qa-table-header-cell=\"\"\n data-qa-table-header-cell-sortdirection={sortDirection}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n aria-sort={ariaSort}\n >\n {isSortable ? (\n <UnstyledButton {...buttonProps}>\n <div aria-live=\"polite\" role=\"status\">\n {children || content}\n {!children && this.getSortIcon(id === sortId, ariaSort)}\n </div>\n </UnstyledButton>\n ) : (\n children || content\n )}\n </Container>\n );\n }\n}\n\nexport default TableHeaderCell;\n","import styled, { css } from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeTableHeaderCellProps } from \"./TableHeaderCellTypes\";\n\nconst Container = styled.th<{\n sortable?: boolean;\n alignment: TypeTableHeaderCellProps[\"align\"];\n width: TypeTableHeaderCellProps[\"width\"];\n}>`\n ${(props) => props.theme.typography[100]}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding: ${(props) => props.theme.space[300]};\n text-align: ${(props) => props.alignment};\n\n ${(props) =>\n props.sortable &&\n css`\n position: relative;\n cursor: pointer;\n `}\n\n ${COMMON}\n`;\n\nexport const SortIcon = styled.span`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n font-size: 0;\n padding: 0 ${(props) => props.theme.space[200]};\n`;\n\nexport const UnstyledButton = styled.button`\n background: none;\n border: none;\n color: inherit;\n font: inherit;\n line-height: normal;\n overflow: visible;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n`;\n\nexport default Container;\n","export const SORT_DIRECTIONS = {\n ASC: \"ASC\",\n DESC: \"DESC\",\n} as const;\n","import * as React from \"react\";\nimport type { TypeTableCellProps } from \"../TableCell/TableCellTypes\";\nimport { SORT_DIRECTIONS } from \"./constants\";\n\nexport type TypeEnumSortDirections = keyof typeof SORT_DIRECTIONS;\n\nexport interface TypeTableHeaderCellProps\n extends Omit<TypeTableCellProps, \"onClick\"> {\n /** Legacy Deteremines if a table column is sortable (optional) */\n isSortable?: boolean;\n\n /** Truncates text into a singular line with ellipsis (optional) */\n shouldTruncate?: boolean;\n\n /** Legacy: Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Legacy: Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Legacy: Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Callback for Click Events. If Included will override onSort prop */\n onClick?: (e: React.SyntheticEvent<HTMLButtonElement>) => void;\n}\n","import TableHeaderCell from \"./TableHeaderCell\";\n\nexport default TableHeaderCell;\nexport { TableHeaderCell };\nexport * from \"./TableHeaderCellTypes\";\nexport * from \"./constants\";\n","import styled from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\n\nconst Container = styled.table`\n width: 100%;\n border-collapse: collapse;\n\n thead {\n vertical-align: bottom;\n }\n\n tr,\n thead {\n border-bottom: 1px solid\n ${(props) => props.theme.colors.container.border.base};\n }\n\n ${COMMON}\n`;\n\nexport default Container;\n","import * as React from \"react\";\nimport type {\n TypeEnumSortDirections,\n TypeTableHeaderCellProps,\n} from \"./TableHeaderCell\";\nimport type { TypeTableCellProps } from \"./TableCell/TableCellTypes\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypePassthroughProps {\n children: React.ReactNode;\n}\n\nexport interface TypeTableRow {\n /** Table Row Id */\n id: string;\n\n /** Array for TableCells to render */\n cells: TypeTableCellProps[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TypeTableHeadProp\n extends Omit<\n TypeTableHeaderCellProps,\n \"onSort\" | \"sortId\" | \"sortDirection\"\n > {}\n\nexport interface TypeTableProps\n extends TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"table\">, keyof TypeSystemCommonProps> {\n /** Array of TableHeaderCells to render */\n head?: TypeTableHeadProp[];\n\n /** Array of TableRows to render */\n rows?: TypeTableRow[];\n\n /** Callback for Sorting Table Columns (optional) */\n onSort?: (id: string) => void;\n\n /** Controls which column is being sorted (optional) */\n sortId?: string;\n\n /** Controls the current sort direction (optional) */\n sortDirection?: TypeEnumSortDirections;\n\n /** Custom row render for flexibilty */\n rowRender?: (row: TypeTableRow) => React.ReactNode;\n\n /**\n * Including children will overwrite all head, rows, rowRender, and sorting props\n * Should be used for manually rendering tables and ignoring data props\n */\n children?: React.ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,YAAuB;;;ACAvB,+BAAmB;AACnB,sCAAuB;AAGvB,IAAM,YAAY,yBAAAC,QAAO;AAAA,IAGrB,CAAC,UAAU,MAAM,MAAM,WAAW,GAAG,CAAC;AAAA,iBACzB,CAAC,UAAU,MAAM,MAAM,YAAY,MAAM;AAAA,aAC7C,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA,gBAC9B,CAAC,UAAU,MAAM,SAAS;AAAA;AAAA,IAEtC,sCAAM;AAAA;AAGV,IAAO,iBAAQ;;;ADOT;AAfC,IAAM,YAAN,cAA8B,gBAA8B;AAAA,EACjE,OAAO;AAAA,EACE,SAAS;AAChB,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI,KAAK;AACT,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QAEJ,IAAI,QAAQ,OAAO;AAAA,QACnB,OAAO,QAAQ,QAAQ;AAAA,QACvB,WAAW,SAAS;AAAA,QACpB,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA,sBAAmB;AAAA,QAInB;AAAA;AAAA,MAEC,YAAY;AAAA,IACf;AAAA,EAEJ;AACF;AAEA,IAAO,oBAAQ;;;AE3Cf,IAAAC,SAAuB;;;ACEvB,IAAOC,qBAAQ;;;ACFf,IAAAC,SAAuB;AACvB,8BAAwC;;;ACDxC,IAAAC,4BAA4B;AAC5B,IAAAC,mCAAuB;AAGvB,IAAMC,aAAY,0BAAAC,QA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AM,YAAY,CAAC,EAAE,UAAU,GAAG,MAAM,MAC7C,6CAAC,WAAO,GAAG,OAAQ,UAAS;AAGvB,IAAM,YAAY,CAAC,EAAE,UAAU,GAAG,MAAM,MAC7C,6CAAC,WAAO,GAAG,OAAQ,UAAS;AAGvB,IAAM,WAAW,CAAC,EAAE,UAAU,GAAG,MAAM,MAC5C,6CAAC,QAAI,GAAG,OAAQ,UAAS;AAG3B,UAAU,cAAc;AACxB,UAAU,cAAc;AACxB,SAAS,cAAc;AACvBC,yBAAgB,cAAc;AAC9BH,mBAAU,cAAc;AAExB,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,WAAW;AACjB,MAAM,aAAaG;AACnB,MAAM,OAAOH;AAEb,IAAO,gBAAQ;;;AW9Gf,IAAAI,SAAuB;;;AZEvB,IAAO,cAAQ;","names":["React","styled","React","TableCell_default","React","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_react","Icon","styles_default","React","TableHeaderCell_default","import_styled_components","import_seeds_react_system_props","Container","styled","styles_default","import_jsx_runtime","import_react","TableCell_default","styles_default","color","TableHeaderCell_default","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-table",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Seeds React Table",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
@@ -9,24 +9,24 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
+ "types": "./dist/index.d.ts",
12
13
  "import": "./dist/esm/index.js",
13
- "require": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
14
+ "require": "./dist/index.js"
15
15
  },
16
16
  "./TableCell": {
17
+ "types": "./dist/tableCell.d.ts",
17
18
  "import": "./dist/esm/tableCell.js",
18
- "require": "./dist/tableCell.js",
19
- "types": "./dist/tableCell.d.ts"
19
+ "require": "./dist/tableCell.js"
20
20
  },
21
21
  "./TableHeaderCell": {
22
+ "types": "./dist/tableHeaderCell.d.ts",
22
23
  "import": "./dist/esm/tableHeaderCell.js",
23
- "require": "./dist/tableHeaderCell.js",
24
- "types": "./dist/tableHeaderCell.d.ts"
24
+ "require": "./dist/tableHeaderCell.js"
25
25
  },
26
26
  "./TableRowAccordion": {
27
+ "types": "./dist/tableRowAccordion.d.ts",
27
28
  "import": "./dist/esm/tableRowAccordion.js",
28
- "require": "./dist/tableRowAccordion.js",
29
- "types": "./dist/tableRowAccordion.d.ts"
29
+ "require": "./dist/tableRowAccordion.js"
30
30
  }
31
31
  },
32
32
  "scripts": {
@@ -40,9 +40,9 @@
40
40
  "test:watch": "jest --watch --coverage=false"
41
41
  },
42
42
  "dependencies": {
43
- "@sproutsocial/seeds-react-theme": "^2.2.0",
43
+ "@sproutsocial/seeds-react-theme": "^3.1.0",
44
44
  "@sproutsocial/seeds-react-system-props": "^3.0.1",
45
- "@sproutsocial/seeds-react-icon": "^1.1.1"
45
+ "@sproutsocial/seeds-react-icon": "^1.1.4"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^18.0.0",
@@ -50,7 +50,7 @@
50
50
  "@sproutsocial/eslint-config-seeds": "*",
51
51
  "react": "^18.0.0",
52
52
  "styled-components": "^5.2.3",
53
- "tsup": "^8.0.2",
53
+ "tsup": "^8.3.4",
54
54
  "typescript": "^5.6.2",
55
55
  "@sproutsocial/seeds-tsconfig": "*",
56
56
  "@sproutsocial/seeds-testing": "*",
package/src/Table.tsx CHANGED
@@ -21,7 +21,7 @@ const renderTableRow = (row: TypeTableRow) => {
21
21
  };
22
22
 
23
23
  /**
24
- * The table component assist in rendering tablular data.
24
+ * The table component assist in rendering tabular data.
25
25
  */
26
26
  export const Table = ({
27
27
  head = [],
package/tsconfig.json CHANGED
@@ -5,5 +5,11 @@
5
5
  "module": "esnext"
6
6
  },
7
7
  "include": ["src/**/*"],
8
- "exclude": ["node_modules", "dist", "coverage"]
8
+ "exclude": [
9
+ "node_modules",
10
+ "dist",
11
+ "coverage",
12
+ "**/*.stories.tsx",
13
+ "**/*.stories.ts"
14
+ ]
9
15
  }