mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-11-18 07:22:06 +00:00
upgrade Nodemailer to v10
fix dead code with knip upgrade TS to v6 and fix linting errors auto apply oxfmt rules fix linting errors - unused deps etc ignore file remove all ignored files in knip add knip - dead code analysis tool swap prettier and eslint of oxfmt and oxlint fix: fix map rendering in react strict mode fix: headlessUI float replace fix: disable Matomo if not URL and SITE ID exist upgrade: 1st pass upgrade to Next.js v16 deps: upgrade react to v19
This commit is contained in:
+39
-44
@@ -1,52 +1,50 @@
|
||||
import { type ComponentProps } from 'react'
|
||||
import { type VariantProps, cva } from "class-variance-authority";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export const buttonVariants = cva(
|
||||
"flex items-center justify-center transition-all duration-200",
|
||||
{
|
||||
variants: {
|
||||
intent: {
|
||||
primary: [
|
||||
"text-center",
|
||||
"text-white",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"bg-primary-600",
|
||||
"hover:bg-primary-800",
|
||||
"disabled:opacity-25",
|
||||
"dark:text-white dark:hover:bg-primary-700",
|
||||
],
|
||||
export const buttonVariants = cva("flex items-center justify-center transition-all duration-200", {
|
||||
variants: {
|
||||
intent: {
|
||||
primary: [
|
||||
"text-center",
|
||||
"text-white",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"bg-primary-600",
|
||||
"hover:bg-primary-800",
|
||||
"disabled:opacity-25",
|
||||
"dark:text-white dark:hover:bg-primary-700",
|
||||
],
|
||||
|
||||
secondary: [
|
||||
"text-primary dark:text-white",
|
||||
"hover:text-white dark:hover:text-white",
|
||||
"hover:bg-primary hover:text-white",
|
||||
"border border-primary",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"disabled:opacity-25",
|
||||
],
|
||||
secondary: [
|
||||
"text-primary dark:text-white",
|
||||
"hover:text-white dark:hover:text-white",
|
||||
"hover:bg-primary hover:text-white",
|
||||
"border border-primary",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"disabled:opacity-25",
|
||||
],
|
||||
|
||||
tertiary: [
|
||||
"text-gray-900 dark:text-neutral-400",
|
||||
"hover:text-primary dark:hover:text-white",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"disabled:opacity-25",
|
||||
],
|
||||
},
|
||||
size: {
|
||||
small: ["text-sm font-medium", "px-3 py-2", "sm:w-fit", "rounded-lg"],
|
||||
medium: ["text-sm font-medium", "px-5 py-3", "sm:w-fit", "rounded-lg"],
|
||||
compacted: ["rounded-none", "px-0 py-0"],
|
||||
},
|
||||
tertiary: [
|
||||
"text-gray-900 dark:text-neutral-400",
|
||||
"hover:text-primary dark:hover:text-white",
|
||||
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
||||
"disabled:opacity-25",
|
||||
],
|
||||
},
|
||||
defaultVariants: {
|
||||
intent: "primary",
|
||||
size: "medium",
|
||||
size: {
|
||||
small: ["text-sm font-medium", "px-3 py-2", "sm:w-fit", "rounded-lg"],
|
||||
medium: ["text-sm font-medium", "px-5 py-3", "sm:w-fit", "rounded-lg"],
|
||||
compacted: ["rounded-none", "px-0 py-0"],
|
||||
},
|
||||
},
|
||||
);
|
||||
defaultVariants: {
|
||||
intent: "primary",
|
||||
size: "medium",
|
||||
},
|
||||
});
|
||||
|
||||
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
||||
export type ButtonProps = React.ComponentProps<"button"> & ButtonVariants;
|
||||
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
||||
export type ButtonProps = ComponentProps<"button"> & ButtonVariants;
|
||||
|
||||
export const Button = ({
|
||||
className,
|
||||
@@ -54,8 +52,5 @@ export const Button = ({
|
||||
size,
|
||||
...props
|
||||
}: ButtonProps & { className?: string }) => (
|
||||
<button
|
||||
className={twMerge(buttonVariants({ intent, size, className }))}
|
||||
{...props}
|
||||
/>
|
||||
<button className={twMerge(buttonVariants({ intent, size, className }))} {...props} />
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user