diff --git a/docs/ui/AppearanceDemo.tsx b/docs/ui/AppearanceDemo.tsx
index d9cd2a4417..8bc9c0e16c 100644
--- a/docs/ui/AppearanceDemo.tsx
+++ b/docs/ui/AppearanceDemo.tsx
@@ -61,8 +61,16 @@ export const AppearanceDemo = ({
const appearance = getAppearance(component, theme);
const [selected, setSelected] = useState({
- variant: 'default',
- size: 'default',
+ variant: appearance.variant.length
+ ? appearance.variant.includes('default')
+ ? 'default'
+ : appearance.variant[0]
+ : 'none',
+ size: appearance.size.length
+ ? appearance.size.includes('default')
+ ? 'default'
+ : appearance.size[0]
+ : 'none',
});
const Wrapper = ({ children }: { children: ReactNode }) =>
@@ -106,7 +114,9 @@ export const AppearanceDemo = ({
}
disabled={appearance.variant.length === 0 ? true : false}
>
- default
+ {appearance.variant.length === 0 ? (
+ default
+ ) : null}
{appearance.variant.map(v => (
{v}
@@ -124,7 +134,9 @@ export const AppearanceDemo = ({
}
disabled={appearance.size.length === 0 ? true : false}
>
- default
+ {appearance.size.length === 0 ? (
+ default
+ ) : null}
{appearance.size.map(v => (
{v}
diff --git a/themes/theme-b2b/src/components/Button.styles.ts b/themes/theme-b2b/src/components/Button.styles.ts
index 47e7f4775e..d345e908a2 100644
--- a/themes/theme-b2b/src/components/Button.styles.ts
+++ b/themes/theme-b2b/src/components/Button.styles.ts
@@ -9,6 +9,7 @@ export const Button: ThemeComponent<'Button'> = cva(
{
variants: {
variant: {
+ default: '',
primary: [
'text-text-inverted bg-bg-accent',
'hover:bg-bg-accent-hover',
@@ -36,8 +37,13 @@ export const Button: ThemeComponent<'Button'> = cva(
],
},
size: {
+ default: '',
small: 'px-4 leading-8',
},
},
+ defaultVariants: {
+ variant: 'default',
+ size: 'default',
+ },
}
);
diff --git a/themes/theme-core/src/components/Button.styles.ts b/themes/theme-core/src/components/Button.styles.ts
index f1046a071a..eb7b3ac3ea 100644
--- a/themes/theme-core/src/components/Button.styles.ts
+++ b/themes/theme-core/src/components/Button.styles.ts
@@ -10,6 +10,7 @@ export const Button: ThemeComponent<'Button'> = cva(
{
variants: {
variant: {
+ default: '',
primary: [
'border-border-brand bg-bg-brand text-text-inverted',
'hover:bg-bg-brand-hover hover:border-border-brand-hover',
@@ -32,8 +33,13 @@ export const Button: ThemeComponent<'Button'> = cva(
],
},
size: {
+ default: '',
small: 'py-1',
},
},
+ defaultVariants: {
+ variant: 'default',
+ size: 'default',
+ },
}
);