-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Represent string literal types as unions of a single element (#42)
- Loading branch information
Showing
5 changed files
with
96 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import * as React from 'react'; | ||
|
||
import { ButtonGroupProps } from './interfaces'; | ||
|
||
export { ButtonGroupProps }; | ||
|
||
/** | ||
* Component-level description | ||
*/ | ||
export default function ButtonGroup({ variant, items }: ButtonGroupProps) { | ||
return <div className={variant}>{items.length}</div>; | ||
} |
20 changes: 20 additions & 0 deletions
20
fixtures/components/complex-types/button-group/interfaces.ts
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,20 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export interface ButtonGroupProps { | ||
/** | ||
* This is variant | ||
*/ | ||
variant: ButtonGroupProps.Variant; | ||
|
||
/** | ||
* This is items array | ||
*/ | ||
items: ReadonlyArray<ButtonGroupProps.Item>; | ||
} | ||
|
||
export namespace ButtonGroupProps { | ||
export type Variant = 'icon'; | ||
|
||
export type Item = { id: string }; | ||
} |
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