Fix the types

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2025-02-10 17:45:56 +00:00
parent b2cce01cb0
commit c7427d40b7
3 changed files with 29 additions and 11 deletions
+23 -5
View File
@@ -121,6 +121,27 @@ export const Button: React_2.ForwardRefExoticComponent<
ButtonProps & React_2.RefAttributes<HTMLButtonElement>
>;
// @public (undocumented)
export type ButtonOwnProps = GetPropDefTypes<typeof buttonPropDefs>;
// @public (undocumented)
export const buttonPropDefs: {
variant: {
type: 'enum';
values: ('primary' | 'secondary')[];
className: string;
default: 'primary';
responsive: true;
};
size: {
type: 'enum';
values: ('small' | 'medium')[];
className: string;
default: 'medium';
responsive: true;
};
};
// @public
export interface ButtonProps {
// (undocumented)
@@ -134,14 +155,11 @@ export interface ButtonProps {
// (undocumented)
iconStart?: IconNames;
// (undocumented)
size?: 'small' | 'medium' | Partial<Record<Breakpoint, 'small' | 'medium'>>;
size?: ButtonOwnProps['size'];
// (undocumented)
style?: React.CSSProperties;
// (undocumented)
variant?:
| 'primary'
| 'secondary'
| Partial<Record<Breakpoint, 'primary' | 'secondary'>>;
variant?: ButtonOwnProps['variant'];
}
// @public (undocumented)
@@ -15,3 +15,5 @@
*/
export { Button } from './Button';
export type { ButtonProps } from './types';
export { buttonPropDefs } from './Button.props';
export type { ButtonOwnProps } from './Button.props';
@@ -14,18 +14,16 @@
* limitations under the License.
*/
import { IconNames } from '../Icon';
import type { Breakpoint } from '../../types';
import type { ButtonOwnProps } from './Button.props';
/**
* Properties for {@link Button}
*
* @public
*/
export interface ButtonProps {
size?: 'small' | 'medium' | Partial<Record<Breakpoint, 'small' | 'medium'>>;
variant?:
| 'primary'
| 'secondary'
| Partial<Record<Breakpoint, 'primary' | 'secondary'>>;
size?: ButtonOwnProps['size'];
variant?: ButtonOwnProps['variant'];
children: React.ReactNode;
className?: string;
disabled?: boolean;