Skip to content

Commit 3bb0842

Browse files
committed
fix: product card error and site theme settings
1 parent 5d7b93b commit 3bb0842

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

Diff for: core/lib/makeswift/components/button-link/button-link.makeswift.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { MakeswiftComponentType } from '@makeswift/runtime';
22
import { Link, Select, Style, TextInput } from '@makeswift/runtime/controls';
33

4-
import { ButtonLink, Props } from '@/vibes/soul/primitives/button-link';
4+
import { ButtonLink, ButtonLinkProps } from '@/vibes/soul/primitives/button-link';
55
import { runtime } from '~/lib/makeswift/runtime';
66

7-
type MSButtonLinkProps = Omit<Props, 'href'> & {
7+
type MSButtonLinkProps = Omit<ButtonLinkProps, 'href'> & {
88
link: { href?: string; target?: string };
99
text: string;
1010
};

Diff for: core/lib/makeswift/components/product-card/product-card.makeswift.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,5 @@ runtime.registerComponent(MakeswiftProductCard, {
8888
text: TextInput({ label: 'Badge text', defaultValue: 'New' }),
8989
},
9090
}),
91-
showCompare: Checkbox({ label: 'Show compare', defaultValue: true }),
9291
},
9392
});

Diff for: core/vibes/soul/primitives/button-link/index.tsx

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { clsx } from 'clsx';
2+
import { ComponentPropsWithoutRef } from 'react';
23

34
import { Link } from '~/components/link';
45

5-
export type Props = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
6+
export interface ButtonLinkProps extends ComponentPropsWithoutRef<typeof Link> {
67
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost';
78
size?: 'large' | 'medium' | 'small' | 'x-small';
89
shape?: 'pill' | 'rounded' | 'square' | 'circle';
9-
href: string;
10-
};
10+
}
1111

1212
// eslint-disable-next-line valid-jsdoc
1313
/**
@@ -20,19 +20,19 @@ export type Props = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
2020
* --button-font-family: var(--font-family-body);
2121
* --button-primary-background: hsl(var(--primary));
2222
* --button-primary-background-hover: color-mix(in oklab, hsl(var(--primary)), white 75%);
23-
* --button-primary-foreground: hsl(var(--foreground));
23+
* --button-primary-text: hsl(var(--foreground));
2424
* --button-primary-border: hsl(var(--primary));
2525
* --button-secondary-background: hsl(var(--foreground));
2626
* --button-secondary-background-hover: hsl(var(--background));
27-
* --button-secondary-foreground: hsl(var(--background));
27+
* --button-secondary-text: hsl(var(--background));
2828
* --button-secondary-border: hsl(var(--foreground));
2929
* --button-tertiary-background: hsl(var(--background));
3030
* --button-tertiary-background-hover: hsl(var(--contrast-100));
31-
* --button-tertiary-foreground: hsl(var(--foreground));
31+
* --button-tertiary-text: hsl(var(--foreground));
3232
* --button-tertiary-border: hsl(var(--contrast-200));
3333
* --button-ghost-background: transparent;
3434
* --button-ghost-background-hover: hsl(var(--foreground) / 5%);
35-
* --button-ghost-foreground: hsl(var(--foreground));
35+
* --button-ghost-text: hsl(var(--foreground));
3636
* --button-ghost-border: transparent;
3737
* }
3838
* ```
@@ -41,25 +41,24 @@ export function ButtonLink({
4141
variant = 'primary',
4242
size = 'large',
4343
shape = 'pill',
44-
href,
4544
className,
4645
children,
4746
...props
48-
}: Props) {
47+
}: ButtonLinkProps) {
4948
return (
5049
<Link
5150
{...props}
5251
className={clsx(
53-
'relative z-0 inline-flex h-fit select-none items-center justify-center overflow-hidden border text-center font-[family-name:var(--button-font-family)] font-semibold leading-normal after:absolute after:inset-0 after:-z-10 after:-translate-x-[105%] after:transition-[opacity,transform] after:duration-300 after:[animation-timing-function:cubic-bezier(0,0.25,0,1)] hover:after:translate-x-0 focus-visible:outline-none focus-visible:ring-2',
52+
'relative z-0 inline-flex h-fit select-none items-center justify-center overflow-hidden border text-center font-[family-name:var(--button-font-family)] font-semibold leading-normal after:absolute after:inset-0 after:-z-10 after:-translate-x-[105%] after:transition-[opacity,transform] after:duration-300 after:[animation-timing-function:cubic-bezier(0,0.25,0,1)] hover:after:translate-x-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--button-focus,hsl(var(--primary)))] focus-visible:ring-offset-2',
5453
{
5554
primary:
56-
'border-[var(--button-primary-border,hsl(var(--primary)))] bg-[var(--button-primary-background,hsl(var(--primary)))] text-[var(--button-primary-foreground)] after:bg-[var(--button-primary-background-hover,color-mix(in_oklab,hsl(var(--primary)),white_75%))]',
55+
'border-[var(--button-primary-border,hsl(var(--primary)))] bg-[var(--button-primary-background,hsl(var(--primary)))] text-[var(--button-primary-text)] after:bg-[var(--button-primary-background-hover,color-mix(in_oklab,hsl(var(--primary)),white_75%))]',
5756
secondary:
58-
'border-[var(--button-secondary-border,hsl(var(--foreground)))] bg-[var(--button-secondary-background,hsl(var(--foreground)))] text-[var(--button-secondary-foreground,hsl(var(--background)))] after:bg-[var(--button-secondary-background-hover,hsl(var(--background)))]',
57+
'border-[var(--button-secondary-border,hsl(var(--foreground)))] bg-[var(--button-secondary-background,hsl(var(--foreground)))] text-[var(--button-secondary-text,hsl(var(--background)))] after:bg-[var(--button-secondary-background-hover,hsl(var(--background)))]',
5958
tertiary:
60-
'border-[var(--button-tertiary-border,hsl(var(--contrast-200)))] bg-[var(--button-tertiary-background,hsl(var(--background)))] text-[var(--button-tertiary-foreground,hsl(var(--foreground)))] after:bg-[var(--button-tertiary-background-hover,hsl(var(--contrast-100)))]',
59+
'border-[var(--button-tertiary-border,hsl(var(--contrast-200)))] bg-[var(--button-tertiary-background,hsl(var(--background)))] text-[var(--button-tertiary-text,hsl(var(--foreground)))] after:bg-[var(--button-tertiary-background-hover,hsl(var(--contrast-100)))]',
6160
ghost:
62-
'border-[var(--button-ghost-border,transparent)] bg-[var(--button-ghost-background,transparent)] text-[var(--button-ghost-foreground,hsl(var(--foreground)))] after:bg-[var(--button-ghost-background-hover,hsl(var(--foreground)/5%))]',
61+
'border-[var(--button-ghost-border,transparent)] bg-[var(--button-ghost-background,transparent)] text-[var(--button-ghost-text,hsl(var(--foreground)))] after:bg-[var(--button-ghost-background-hover,hsl(var(--foreground)/5%))]',
6362
}[variant],
6463
{
6564
'x-small': 'min-h-8 text-xs',
@@ -82,7 +81,6 @@ export function ButtonLink({
8281
}[shape],
8382
className,
8483
)}
85-
href={href}
8684
>
8785
<span className={clsx(variant === 'secondary' && 'mix-blend-difference')}>{children}</span>
8886
</Link>

0 commit comments

Comments
 (0)