Skip to content

Commit

Permalink
Add TypeScript annotations to MultiSelect (#13144)
Browse files Browse the repository at this point in the history
* refactor(MultiSelect): add typescript annotations

Convert existing propType definitions to Typescript annotations on the
MultiSelect component. This is part of a broader effort to add
Typescript annotations to components, tracked in carbon-design-system#12513.
Closes carbon-design-system#12547.

Only type annotations, no breaking feature changes

* fix(MultiSelect): pass locale prop to sort options

* chore(snapshot): update snapshots

* refactor(MultiSelect): add typescript annotations

Convert existing propType definitions to Typescript annotations on the
MultiSelect component. This is part of a broader effort to add
Typescript annotations to components, tracked in carbon-design-system#12513.
Closes carbon-design-system#12547.

Only type annotations, no breaking feature changes

* fix(MultiSelect): add back downshift props

---------

Co-authored-by: TJ Egan <tw15egan@gmail.com>
Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
  • Loading branch information
3 people authored Feb 23, 2023
1 parent a6bdaba commit d791865
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 70 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,15 @@
"contributions": [
"code"
]
},
{
"login": "awarrier99",
"name": "Ashvin Warrier",
"avatar_url": "https://avatars.githubusercontent.com/u/17476235?v=4",
"profile": "https://github.com/awarrier99",
"contributions": [
"code"
]
}
],
"commitConvention": "none"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
<td align="center"><a href="https://github.com/lewandom"><img src="https://avatars.githubusercontent.com/u/8779205?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Marcin Lewandowski</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=lewandom" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/remolueoend"><img src="https://avatars.githubusercontent.com/u/7881606?v=4?s=100" width="100px;" alt=""/><br /><sub><b>remolueoend</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=remolueoend" title="Code">💻</a></td>
<td align="center"><a href="https://jsehull.com/"><img src="https://avatars.githubusercontent.com/u/9935383?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jesse Hull</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=jsehull" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/awarrier99"><img src="https://avatars.githubusercontent.com/u/17476235?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ashvin Warrier</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=awarrier99" title="Code">💻</a></td>
</tr>
</table>

Expand Down
7 changes: 5 additions & 2 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4784,10 +4784,10 @@ Map {
"itemToString": [Function],
"locale": "en",
"open": false,
"selectedItems": null,
"selectedItems": undefined,
"selectionFeedback": "top-after-reopen",
"sortItems": [Function],
"title": false,
"titleText": false,
"type": "default",
},
"propTypes": Object {
Expand Down Expand Up @@ -4939,6 +4939,9 @@ Map {
],
"type": "shape",
},
"helperText": Object {
"type": "node",
},
"hideLabel": Object {
"type": "bool",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export const WithInitialSelectedItems = () => {
return (
<div style={{ width: 300 }}>
<MultiSelect
label="Multiselect Label"
id="carbon-multiselect-example-2"
titleText="Multiselect title"
helperText="This is helper text"
Expand Down
Loading

0 comments on commit d791865

Please sign in to comment.