Skip to content

Commit 4760608

Browse files
committed
removed site's table and use Salt table
1 parent 929e5c7 commit 4760608

File tree

9 files changed

+48
-125
lines changed

9 files changed

+48
-125
lines changed

site/src/components/components/PropsTable.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { Table, TBody, TD, TH, THead, TR } from "@salt-ds/core";
12
import dynamic from "next/dynamic";
23
import { type FC, useEffect, useState } from "react";
34
import { Code } from "../mdx/code";
4-
import { Table } from "../mdx/table";
55
import styles from "./PropsTable.module.css";
66

77
const Markdown = dynamic(import("../markdown/Markdown"));
@@ -77,33 +77,33 @@ export const PropsTable: FC<PropsTableType> = ({
7777

7878
return (
7979
<Table>
80-
<thead>
81-
<tr>
82-
<th>Name</th>
83-
<th>Type</th>
84-
<th>Description</th>
85-
<th>Default</th>
86-
</tr>
87-
</thead>
88-
<tbody>
80+
<THead>
81+
<TR>
82+
<TH>Name</TH>
83+
<TH>Type</TH>
84+
<TH>Description</TH>
85+
<TH>Default</TH>
86+
</TR>
87+
</THead>
88+
<TBody>
8989
{props &&
9090
Object.values(props).map(
9191
({ name, type, description, defaultValue }) => (
92-
<tr key={name}>
93-
<td className={styles.overflowWrap}>{name}</td>
94-
<td>
92+
<TR key={name}>
93+
<TD className={styles.overflowWrap}>{name}</TD>
94+
<TD>
9595
<Code>{type.name}</Code>
96-
</td>
97-
<td>
96+
</TD>
97+
<TD>
9898
<Markdown>{description}</Markdown>
99-
</td>
100-
<td>
99+
</TD>
100+
<TD>
101101
<Code>{defaultValue ? defaultValue.value : "-"}</Code>
102-
</td>
103-
</tr>
102+
</TD>
103+
</TR>
104104
),
105105
)}
106-
</tbody>
106+
</TBody>
107107
</Table>
108108
);
109109
};

site/src/components/css-display/CharacteristicsTokenTable.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import {
44
SaltProviderNext,
55
Spinner,
66
StackLayout,
7+
Table,
8+
TBody,
9+
TD,
10+
TH,
11+
THead,
12+
TR,
713
} from "@salt-ds/core";
814
import { useEffect, useState } from "react";
915
import { CopyToClipboard } from "../copy-to-clipboard";
1016
import { Code } from "../mdx/code";
11-
import { Table, Thead, Tr } from "../mdx/table";
1217
import { BlockView } from "./BlockView";
1318
import styles from "./CharacteristicsTokenTable.module.css";
1419

@@ -76,31 +81,31 @@ export const CharacteristicsTokenTable = ({
7681

7782
return (
7883
<Table>
79-
<Thead>
80-
<Tr>
81-
<th>Preview</th>
82-
<th>Token name & token value</th>
83-
</Tr>
84-
</Thead>
85-
<tbody>
84+
<THead>
85+
<TR>
86+
<TH>Preview</TH>
87+
<TH>Token name & token value</TH>
88+
</TR>
89+
</THead>
90+
<TBody>
8691
{Object.entries(cssVariablesData).map(([name, value]) => (
87-
<Tr key={name}>
88-
<td>
92+
<TR key={name}>
93+
<TD>
8994
<ChosenProvider theme="">
9095
<BlockView name={name} />
9196
</ChosenProvider>
92-
</td>
93-
<td>
97+
</TD>
98+
<TD>
9499
<StackLayout gap={0} align="start">
95100
<FlowLayout align="center" gap={1}>
96101
<CopyToClipboard value={name} />
97102
</FlowLayout>
98103
<Code>{value}</Code>
99104
</StackLayout>
100-
</td>
101-
</Tr>
105+
</TD>
106+
</TR>
102107
))}
103-
</tbody>
108+
</TBody>
104109
</Table>
105110
);
106111
};
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { Table, TBody, TH, THead, TR } from "@salt-ds/core";
12
import { clsx } from "clsx";
23
import type { FC, ReactNode } from "react";
3-
import { Table } from "../mdx/table";
44
import styles from "./KeyboardControls.module.css";
55

66
export interface KeyboardControlsProps {
@@ -14,13 +14,13 @@ export const KeyboardControls: FC<KeyboardControlsProps> = ({
1414
}) => {
1515
return (
1616
<Table className={clsx(styles.table, className)}>
17-
<thead>
18-
<tr>
19-
<th className={styles.keyCol}>Key</th>
17+
<THead>
18+
<TR>
19+
<TH className={styles.keyCol}>Key</TH>
2020
<th>Function</th>
21-
</tr>
22-
</thead>
23-
<tbody>{children}</tbody>
21+
</TR>
22+
</THead>
23+
<TBody>{children}</TBody>
2424
</Table>
2525
);
2626
};

site/src/components/mdx/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Table as table, THead as thead, TR as tr } from "@salt-ds/core";
12
import { withAnchorHeading } from "./anchorHeading";
23
import { Code as code } from "./code";
34
import { Heading2 } from "./h2";
@@ -7,7 +8,6 @@ import { Image } from "./image";
78
import { Link as a } from "./link";
89
import { Paragraph as p } from "./p";
910
import { Pre as pre } from "./pre";
10-
import { Table as table, Thead as thead, Tr as tr } from "./table";
1111
import { UnorderedList as ul } from "./ul";
1212

1313
const h2 = withAnchorHeading(Heading2);

site/src/components/mdx/table/Table.module.css

Lines changed: 0 additions & 51 deletions
This file was deleted.

site/src/components/mdx/table/Table.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

site/src/components/mdx/table/Thead.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

site/src/components/mdx/table/Tr.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

site/src/components/mdx/table/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)