Skip to content

Commit 0f4851e

Browse files
committed
cleanup
1 parent ec7a6ba commit 0f4851e

File tree

5 files changed

+6
-201
lines changed

5 files changed

+6
-201
lines changed

docs/src/components/ReferenceAccordion/PropsReferenceAccordion.tsx renamed to docs/src/components/ReferenceTable/PropsReferenceAccordion.tsx

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { inlineMdxComponents } from 'docs/src/mdx-components';
55
import { rehypeSyntaxHighlighting } from 'docs/src/syntax-highlighting';
66
import * as Accordion from '../Accordion';
77
import * as DescriptionList from '../DescriptionList';
8-
import type { PropDef as BasePropDef } from '../ReferenceTable/types';
8+
import type { PropDef as BasePropDef } from './types';
99
import { TableCode } from '../TableCode';
1010

1111
interface PropDef extends BasePropDef {
@@ -18,51 +18,6 @@ interface Props extends React.ComponentPropsWithoutRef<any> {
1818
name: string;
1919
}
2020

21-
const DATA: Record<string, PropDef> = {
22-
value: {
23-
type: 'string',
24-
description: 'A unique string that identifies the toggle when used\ninside a toggle group.',
25-
},
26-
defaultPressed: {
27-
type: 'boolean',
28-
default: 'false',
29-
description:
30-
'Whether the toggle button is currently pressed.\nThis is the uncontrolled counterpart of `pressed`.',
31-
},
32-
pressed: {
33-
type: 'boolean',
34-
description:
35-
'Whether the toggle button is currently pressed.\nThis is the controlled counterpart of `defaultPressed`.',
36-
},
37-
onPressedChange: {
38-
type: '((pressed: boolean, event: Event) => void)',
39-
description: 'Callback fired when the pressed state is changed.',
40-
example:
41-
'```tsx\nconst [pressed, setPressed] = React.useState(true);\n\nreturn (\n <Toggle pressed={pressed} onPressedChange={setPressed} />\n)\n```',
42-
},
43-
nativeButton: {
44-
type: 'boolean',
45-
default: 'true',
46-
description:
47-
'Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (e.g. `<div>`).',
48-
},
49-
disabled: {
50-
type: 'boolean',
51-
default: 'false',
52-
description: 'Whether the component should ignore user interaction.',
53-
},
54-
className: {
55-
type: 'string | ((state: Toggle.State) => string)',
56-
description:
57-
'CSS class applied to the element, or a function that\nreturns a class based on the component’s state.',
58-
},
59-
render: {
60-
type: 'ReactElement | ((props: HTMLProps, state: Toggle.State) => ReactElement)',
61-
description:
62-
'Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render.',
63-
},
64-
};
65-
6621
function getShortPropType(name: string, type: string | undefined) {
6722
if (/^on[A-Z].*/.test(name)) {
6823
return 'function';
@@ -100,7 +55,7 @@ function getShortPropType(name: string, type: string | undefined) {
10055
}
10156

10257
export async function PropsReferenceAccordion({
103-
data = DATA,
58+
data,
10459
name: partName,
10560
// type = 'props',
10661
...props

docs/src/components/ReferenceTable/PropsReferenceTable.tsx

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

docs/src/components/ReferenceTable/ReferenceTablePopover.tsx

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

docs/src/components/ReferenceTable/rehypeReference.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ const REFERENCE = 'Reference';
1313
const ATTRIBUTES_TABLE = 'AttributesReferenceTable';
1414
const CSS_VARIABLES_TABLE = 'CssVariablesReferenceTable';
1515

16-
// const PROPS_TABLE = 'PropsReferenceTable';
17-
const NEW_PROPS_TABLE = 'PropsReferenceAccordion';
16+
const PROPS_TABLE = 'PropsReferenceTable';
1817

1918
/**
2019
* Finds `<Reference />` in the MDX and transforms it into
@@ -104,7 +103,7 @@ export function rehypeReference() {
104103
if (Object.keys(def.props).length) {
105104
subtree.push(
106105
createMdxElement({
107-
name: NEW_PROPS_TABLE,
106+
name: PROPS_TABLE,
108107
props: { name: def.name, data: def.props },
109108
}),
110109
);

docs/src/mdx-components.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as CodeBlock from './components/CodeBlock';
55
import * as Table from './components/Table';
66
import * as QuickNav from './components/QuickNav/QuickNav';
77
import { Code } from './components/Code';
8-
import { PropsReferenceTable } from './components/ReferenceTable/PropsReferenceTable';
8+
import { PropsReferenceAccordion } from './components/ReferenceTable/PropsReferenceAccordion';
99
import { AttributesReferenceTable } from './components/ReferenceTable/AttributesReferenceTable';
1010
import { CssVariablesReferenceTable } from './components/ReferenceTable/CssVariablesReferenceTable';
1111
import { getChildrenText } from './utils/getChildrenText';
@@ -14,8 +14,6 @@ import { HeadingLink } from './components/HeadingLink';
1414
import { Subtitle } from './components/Subtitle/Subtitle';
1515
import { Kbd } from './components/Kbd/Kbd';
1616

17-
import { PropsReferenceAccordion } from './components/ReferenceAccordion/PropsReferenceAccordion';
18-
1917
interface MDXComponents {
2018
[key: string]: React.FC<any> | MDXComponents;
2119
}
@@ -112,9 +110,7 @@ export const mdxComponents: MDXComponents = {
112110
CssVariablesReferenceTable: (props) => (
113111
<CssVariablesReferenceTable className="mt-5 mb-6" {...props} />
114112
),
115-
PropsReferenceTable: (props) => <PropsReferenceTable className="mt-5 mb-6" {...props} />,
116-
117-
PropsReferenceAccordion: (props) => <PropsReferenceAccordion className="mt-5 mb-6" {...props} />,
113+
PropsReferenceTable: (props) => <PropsReferenceAccordion className="mt-5 mb-6" {...props} />,
118114
};
119115

120116
export const inlineMdxComponents: MDXComponents = {

0 commit comments

Comments
 (0)