@@ -26,6 +26,14 @@ type ButtonOverloadFactory = Factory<{
26
26
variant : ButtonVariant ;
27
27
staticComponents : {
28
28
Group : typeof ButtonGroup ;
29
+ Primary : typeof ButtonPrimary ;
30
+ Secondary : typeof ButtonSecondary ;
31
+ Tertiary : typeof ButtonTertiary ;
32
+ Quaternary : typeof ButtonQuaternary ;
33
+ DestructivePrimary : typeof ButtonDestructive ;
34
+ DestructiveSecondary : typeof ButtonDestructiveSecondary ;
35
+ DestructiveTertiary : typeof ButtonDestructiveTertiary ;
36
+ DestructiveQuaternary : typeof ButtonDestructiveQuaternary ;
29
37
} ;
30
38
} > ;
31
39
@@ -55,10 +63,28 @@ export const Button = polymorphicFactory<ButtonOverloadFactory>(
55
63
) ;
56
64
} ,
57
65
) ;
58
- Button . Group = MantineButton . Group ;
66
+ const ButtonPrimary = Button . withProps ( { variant : 'filled' } ) ;
67
+ const ButtonSecondary = Button . withProps ( { variant : 'light' } ) ;
68
+ const ButtonTertiary = Button . withProps ( {
69
+ variant : 'default' ,
70
+ vars : ( ) => ( { root : { '--button-color' : 'var(--mantine-primary-color-filled)' } } ) ,
71
+ } ) ;
72
+ const ButtonQuaternary = Button . withProps ( { variant : 'subtle' } ) ;
73
+
74
+ const ButtonDestructive = Button . withProps ( { variant : 'filled' , color : 'var(--mantine-color-error)' } ) ;
75
+ const ButtonDestructiveSecondary = Button . withProps ( { variant : 'light' , color : 'var(--mantine-color-error)' } ) ;
76
+ const ButtonDestructiveTertiary = Button . withProps ( {
77
+ variant : 'default' ,
78
+ vars : ( ) => ( { root : { '--button-color' : 'var(--mantine-color-error)' } } ) ,
79
+ } ) ;
80
+ const ButtonDestructiveQuaternary = Button . withProps ( { variant : 'subtle' , color : 'var(--mantine-color-error)' } ) ;
59
81
60
- export const ButtonPrimary = Button . withProps ( { variant : 'filled' } ) ;
61
- export const ButtonSecondary = Button . withProps ( { variant : 'light' } ) ;
62
- export const ButtonTertiary = Button . withProps ( { variant : 'subtle' } ) ;
63
- export const ButtonDestructive = Button . withProps ( { variant : 'filled' , color : 'var(--mantine-color-error)' } ) ;
64
- export const ButtonDestructiveSecondary = Button . withProps ( { variant : 'light' , color : 'var(--mantine-color-error)' } ) ;
82
+ Button . Group = MantineButton . Group ;
83
+ Button . Primary = ButtonPrimary ;
84
+ Button . Secondary = ButtonSecondary ;
85
+ Button . Tertiary = ButtonTertiary ;
86
+ Button . Quaternary = ButtonQuaternary ;
87
+ Button . DestructivePrimary = ButtonDestructive ;
88
+ Button . DestructiveSecondary = ButtonDestructiveSecondary ;
89
+ Button . DestructiveTertiary = ButtonDestructiveTertiary ;
90
+ Button . DestructiveQuaternary = ButtonDestructiveQuaternary ;
0 commit comments