-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Button
component to TypeScript
#46997
Merged
Merged
Changes from 42 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
c05948f
Rename button/index.js to .jsx
kienstra 5b57ef6
Possible approach to the prop types
kienstra 718959c
Simplify the tag container
kienstra d8cae0c
Allow passing childrent to TagElement
kienstra d007837
Fix the type of onKeyDown
kienstra 6ab8806
Rename test/index.js to .tsx, fix some errors
kienstra 878c77d
Fix an eslint error from children being defined in the outer scope
kienstra 78e0aaf
Rename stories/index.js to .tsx, add type annotations
kienstra 00c05da
Merge branch 'trunk' into update/button-ts
kienstra 9e6cc7d
Alphabetize types.ts types
kienstra 9298bd7
Refactor TagElement to element
kienstra 7314d0a
Alphabetize an import
kienstra 0b616c7
Revert changes to element, this will fail type checking
kienstra 3998f8b
Merge branch 'trunk' into update/button-ts
kienstra 67efafe
Use the [] array type syntax
kienstra bbc7cd4
Improve the typing of hasChildren
kienstra 0f7a242
Fix the typing of chilren.length
kienstra ca6ded1
Revert "Revert changes to element, this will fail type checking"
kienstra dadbb4b
Pass the generic of WordPressComponentProps a second argument
kienstra a447deb
Don't destructure out children, simply let them be in props
kienstra e702dd4
Use React.MousEvent
kienstra 0badec8
Update README.md with types from types.ts
kienstra b9a3b50
Fix the type of shortcut
kienstra 57866b7
Remove unnecessary Type annotations
kienstra d8dcaee
In README.md, alphabetize the props
kienstra 5e270a1
Add a Required annotation to the variant prop
kienstra 8ce4937
Add a JS DocBlock to Button
kienstra fd4144a
Add a CHANGELOG entry
kienstra 916f9ac
Commit Lena's suggestion: Update packages/components/src/button/types.ts
kienstra 3632a42
Commit Lena's suggestion: Update packages/components/src/button/depre…
kienstra 309db5c
Commit Lena's suggestion: Update packages/components/src/button/index…
kienstra 31cbdab
Apply Lena's suggestion to change 'div' to 'button'
kienstra 2ca61e5
Remvoe needless type DisabledEvent
kienstra be1359d
Remove needless argTypes that Storybook will infer from types
kienstra 35f8efb
Restore a deleted test, thanks to Lena's idea
kienstra b84337d
Don't expect the console to error
kienstra 14e1137
Update tooltipPosition in README.md
kienstra 12fa70f
Merge branch 'trunk' into update/button-ts
kienstra a38c275
Move the CHANGELOG entry to Unreleased
kienstra cea1f6b
Cherry-pick @mirka 's commit to make Button types specific to a or b…
kienstra ccd87bc
Commit Lena's static tests verbatim
kienstra 561d6aa
Fix a failed test run that I caused
kienstra 3892543
Rename CommonButtonProps to BaseButtonProps
kienstra 01f3c9c
Merge in trunk, resolve conflict
kienstra 07b7002
Commit Lena's suggestion: Update packages/components/src/button/stori…
kienstra dfef117
Commit Lena's diff for static typing test
kienstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Button>
has noposition
prop, so maybe this should betooltipPosition
.This also has a
showTooltip
prop below.