paris 0.8.11 → 0.8.12
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
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "paris",
|
|
3
3
|
"author": "Sanil Chawla <sanil@slingshot.fm> (https://sanil.co)",
|
|
4
4
|
"description": "Paris is Slingshot's React design system. It's a collection of reusable components, design tokens, and guidelines that help us build consistent, accessible, and performant user interfaces.",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.12",
|
|
6
6
|
"homepage": "https://paris.slingshot.fm",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -27,6 +27,14 @@
|
|
|
27
27
|
border-bottom: 1px solid var(--pte-colors-borderOpaque);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
tr.empty {
|
|
31
|
+
border-bottom: none;
|
|
32
|
+
|
|
33
|
+
td {
|
|
34
|
+
padding: 20px 0 0 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
tbody tr.clickable {
|
|
31
39
|
transition: background-color var(--pte-animations-interaction);
|
|
32
40
|
|
|
@@ -55,6 +55,11 @@ export type TableProps<
|
|
|
55
55
|
* Whether the rows should be clickable.
|
|
56
56
|
*/
|
|
57
57
|
clickableRows?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The content to display when the table is empty.
|
|
61
|
+
*/
|
|
62
|
+
emptyState?: ReactNode;
|
|
58
63
|
/**
|
|
59
64
|
* Prop overrides for rendered elements.
|
|
60
65
|
*/
|
|
@@ -87,6 +92,7 @@ export function Table<RowData extends Record<string, any>[]>({
|
|
|
87
92
|
rowRenderFn,
|
|
88
93
|
onRowClick,
|
|
89
94
|
clickableRows = true,
|
|
95
|
+
emptyState,
|
|
90
96
|
overrides,
|
|
91
97
|
}: TableProps<RowData>) {
|
|
92
98
|
const id = useId();
|
|
@@ -164,6 +170,15 @@ export function Table<RowData extends Record<string, any>[]>({
|
|
|
164
170
|
</tr>
|
|
165
171
|
</thead>
|
|
166
172
|
<tbody {...overrides?.tbody}>
|
|
173
|
+
{renderedRows.length === 0 && emptyState && (
|
|
174
|
+
<>
|
|
175
|
+
<tr className={styles.empty}>
|
|
176
|
+
<td colSpan={columns.length} className={styles.emptyState}>
|
|
177
|
+
{emptyState}
|
|
178
|
+
</td>
|
|
179
|
+
</tr>
|
|
180
|
+
</>
|
|
181
|
+
)}
|
|
167
182
|
{renderedRows}
|
|
168
183
|
</tbody>
|
|
169
184
|
</table>
|