1
1
import type { ReactNode } from 'react' ;
2
2
3
- import type { ButtonOptions , HoverEvent } from '@koobiq/react-primitives' ;
3
+ import type { ExtendableProps } from '@koobiq/react-core' ;
4
+ import type { HoverEvent , UseButtonProps } from '@koobiq/react-primitives' ;
4
5
5
6
export const buttonPropVariant = [
6
7
'contrast-filled' ,
@@ -13,44 +14,47 @@ export const buttonPropVariant = [
13
14
14
15
export type ButtonPropVariant = ( typeof buttonPropVariant ) [ number ] ;
15
16
16
- export type ButtonBaseProps = {
17
- /** The content of the component. */
18
- children ?: ReactNode ;
19
- /**
20
- * The variant to use.
21
- * @default contrast-filled
22
- * */
23
- variant ?: ButtonPropVariant ;
24
- /**
25
- * If `true`, the progress indicator is shown and the button becomes disabled.
26
- * @default false
27
- * */
28
- progress ?: boolean ;
29
- /**
30
- * If `true`, the component is disabled.
31
- * @default false
32
- * */
33
- disabled ?: boolean ;
34
- /**
35
- * If `true`, only the icon is shown, and the button has same sides.
36
- * @default false
37
- * */
38
- onlyIcon ?: boolean ;
39
- /** Additional CSS-classes. */
40
- className ?: string ;
41
- /**
42
- * If `true`, the button will take up the full width of its container.
43
- * @default false
44
- * */
45
- fullWidth ?: boolean ;
46
- /** Icon placed before the children. */
47
- startIcon ?: ReactNode ;
48
- /** Icon placed after the children. */
49
- endIcon ?: ReactNode ;
50
- /** Unique identifier for testing purposes. */
51
- 'data-testid' ?: string | number ;
52
- /** Handler that is called when a hover interaction starts. */
53
- onHoverStart ?: ( e : HoverEvent ) => void ;
54
- /** Handler that is called when a hover interaction ends. */
55
- onHoverEnd ?: ( e : HoverEvent ) => void ;
56
- } & ButtonOptions ;
17
+ export type ButtonBaseProps = ExtendableProps <
18
+ {
19
+ /** The content of the component. */
20
+ children ?: ReactNode ;
21
+ /**
22
+ * The variant to use.
23
+ * @default contrast-filled
24
+ * */
25
+ variant ?: ButtonPropVariant ;
26
+ /**
27
+ * If `true`, the progress indicator is shown and the button becomes disabled.
28
+ * @default false
29
+ * */
30
+ progress ?: boolean ;
31
+ /**
32
+ * If `true`, the component is disabled.
33
+ * @default false
34
+ * */
35
+ disabled ?: boolean ;
36
+ /**
37
+ * If `true`, only the icon is shown, and the button has same sides.
38
+ * @default false
39
+ * */
40
+ onlyIcon ?: boolean ;
41
+ /** Additional CSS-classes. */
42
+ className ?: string ;
43
+ /**
44
+ * If `true`, the button will take up the full width of its container.
45
+ * @default false
46
+ * */
47
+ fullWidth ?: boolean ;
48
+ /** Icon placed before the children. */
49
+ startIcon ?: ReactNode ;
50
+ /** Icon placed after the children. */
51
+ endIcon ?: ReactNode ;
52
+ /** Unique identifier for testing purposes. */
53
+ 'data-testid' ?: string | number ;
54
+ /** Handler that is called when a hover interaction starts. */
55
+ onHoverStart ?: ( e : HoverEvent ) => void ;
56
+ /** Handler that is called when a hover interaction ends. */
57
+ onHoverEnd ?: ( e : HoverEvent ) => void ;
58
+ } ,
59
+ UseButtonProps
60
+ > ;
0 commit comments