-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: merge controls, hide props table on empty
- Loading branch information
1 parent
89a5b43
commit ee4b11a
Showing
6 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
props-info/react-docgen-typescript/test/__snapshots__/extends.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`extends button.tsx 1`] = ` | ||
Object { | ||
"description": "", | ||
"displayName": "Button", | ||
"methods": Array [], | ||
"props": Object { | ||
"fullWidth": Object { | ||
"parentName": "ButtonProps", | ||
"type": Object { | ||
"name": "boolean", | ||
"raw": "boolean", | ||
}, | ||
}, | ||
"size": Object { | ||
"defaultValue": "medium", | ||
"parentName": "ButtonProps", | ||
"type": Object { | ||
"name": "enum", | ||
"raw": "\\"small\\" | \\"medium\\"", | ||
"value": Array [ | ||
Object { | ||
"name": "string", | ||
"value": "small", | ||
}, | ||
Object { | ||
"name": "string", | ||
"value": "medium", | ||
}, | ||
], | ||
}, | ||
}, | ||
"variant": Object { | ||
"defaultValue": "primary", | ||
"parentName": "ButtonProps", | ||
"type": Object { | ||
"name": "enum", | ||
"raw": "\\"primary\\" | \\"success\\" | \\"warn\\" | \\"danger\\"", | ||
"value": Array [ | ||
Object { | ||
"name": "string", | ||
"value": "primary", | ||
}, | ||
Object { | ||
"name": "string", | ||
"value": "success", | ||
}, | ||
Object { | ||
"name": "string", | ||
"value": "warn", | ||
}, | ||
Object { | ||
"name": "string", | ||
"value": "danger", | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { loadTestFiles } from './loadTestFiles'; | ||
|
||
describe('extends', () => { | ||
loadTestFiles(['extends']); | ||
}); |
25 changes: 25 additions & 0 deletions
25
props-info/react-docgen-typescript/test/fixtures/extends/button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { FC } from 'react'; | ||
|
||
export interface ButtonProps extends React.ComponentProps<'button'> { | ||
variant?: 'primary' | 'success' | 'warn' | 'danger'; | ||
size?: 'small' | 'medium'; | ||
fullWidth?: boolean; | ||
} | ||
|
||
export const Button: FC<ButtonProps> = ({ | ||
children, | ||
size = 'medium', | ||
type = 'button', | ||
variant = 'primary', | ||
fullWidth, | ||
className, | ||
...props | ||
}) => ( | ||
<button | ||
type={type} | ||
className={`${variant}-${size}-${fullWidth ? 'yes' : 'no'} ${className}`} | ||
{...props} | ||
> | ||
{children} | ||
</button> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters