From aa144205c0a5a316e054e70e81034394eacf9861 Mon Sep 17 00:00:00 2001 From: tigawanna Date: Fri, 29 Nov 2024 18:55:02 +0300 Subject: [PATCH 1/5] configure eslint and cleanup existing eslint issues --- eslint.config.js | 27 ++++-- package.json | 3 +- pnpm-lock.yaml | 86 +++++++++++++++++++ src/App.tsx | 28 ++++++ .../pagination/ReactresponsivePagination.tsx | 2 +- src/components/ui/alert-dialog.tsx | 3 +- src/components/ui/badge-extras.ts | 21 +++++ src/components/ui/badge.tsx | 27 ++---- src/components/ui/button-extras.ts | 30 +++++++ src/components/ui/button.tsx | 54 +++--------- src/components/ui/calendar.tsx | 2 +- src/components/ui/chart.tsx | 4 +- src/components/ui/navigation-menu-extras.ts | 5 ++ src/components/ui/navigation-menu.tsx | 8 +- src/components/ui/pagination.tsx | 3 +- src/components/ui/sidebar-extras.ts | 22 +++++ src/components/ui/sidebar.tsx | 22 +---- src/components/ui/toggle-extras.ts | 23 +++++ src/components/ui/toggle-group.tsx | 3 +- src/components/ui/toggle.tsx | 28 +----- src/components/wrappers/GenericTable.tsx | 2 +- src/hooks/use-media-query.ts | 29 +++---- src/hooks/use-storage.tsx | 4 +- src/main.tsx | 30 +------ .../-components/DashboardUserDropdown.tsx | 2 +- .../DashboardLayoutActions.tsx | 1 + .../DashboardSidebarActions.tsx | 2 +- .../DashboardSidebarHeader.tsx | 2 +- .../DashboardSidebarLinks.tsx | 2 +- .../dashoboard-sidebar/DashboardTheme.tsx | 2 +- src/scripts/scafold-pages/script.ts | 14 +-- src/utils/concaterrors.ts | 6 -- tsconfig.app.tsbuildinfo | 2 +- 33 files changed, 303 insertions(+), 196 deletions(-) create mode 100644 src/App.tsx create mode 100644 src/components/ui/badge-extras.ts create mode 100644 src/components/ui/button-extras.ts create mode 100644 src/components/ui/navigation-menu-extras.ts create mode 100644 src/components/ui/sidebar-extras.ts create mode 100644 src/components/ui/toggle-extras.ts diff --git a/eslint.config.js b/eslint.config.js index 092408a..98b96f6 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,26 +3,39 @@ import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import tseslint from 'typescript-eslint' +import pluginQuery from '@tanstack/eslint-plugin-query' export default tseslint.config( - { ignores: ['dist'] }, + ...pluginQuery.configs["flat/recommended"], + { ignores: ["dist"] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx}'], + files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, + "react-hooks": reactHooks, + "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], + 'no-empty-pattern': 'off', + 'no-empty-object-type': 'off', + 'allowEmptyCatch': 'off', + 'allowInterface': 'off', + 'no-unused-vars': 'off', + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-unused-vars": "off", + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-expressions': 'off' + }, + }, -) +); diff --git a/package.json b/package.json index 76b2e1e..cf48ade 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "eslint . --fix", "format": "prettier --write --ignore-unknown src", "page": "tsx src/scripts/scafold-pages/script.ts", - "playwright":"playwright test --ui", + "playwright": "playwright test --ui", "preview": "vite preview" }, "dependencies": { @@ -66,6 +66,7 @@ "devDependencies": { "@eslint/js": "^9.13.0", "@playwright/test": "^1.49.0", + "@tanstack/eslint-plugin-query": "^5.61.6", "@tanstack/react-query-devtools": "^5.59.19", "@tanstack/router-devtools": "^1.79.0", "@tanstack/router-plugin": "^1.79.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a63af8..ac023b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -162,6 +162,9 @@ importers: '@playwright/test': specifier: ^1.49.0 version: 1.49.0 + '@tanstack/eslint-plugin-query': + specifier: ^5.61.6 + version: 5.61.6(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3) '@tanstack/react-query-devtools': specifier: ^5.59.19 version: 5.59.19(@tanstack/react-query@5.59.19(react@18.3.1))(react@18.3.1) @@ -1618,6 +1621,11 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@tanstack/eslint-plugin-query@5.61.6': + resolution: {integrity: sha512-39DEve67KRcUOv4WI3svSyKzFGEhPTH4gzy99UBh2PmrDOUvAjfG59zSheNJFLHHokpSOQYJhFRNuMlC00CBMw==} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + '@tanstack/history@1.61.1': resolution: {integrity: sha512-2CqERleeqO3hkhJmyJm37tiL3LYgeOpmo8szqdjgtnnG0z7ZpvzkZz6HkfOr9Ca/ha7mhAiouSvLYuLkM37AMg==} engines: {node: '>=12'} @@ -1772,6 +1780,10 @@ packages: resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/scope-manager@8.16.0': + resolution: {integrity: sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/type-utils@8.12.2': resolution: {integrity: sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1785,6 +1797,10 @@ packages: resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/types@8.16.0': + resolution: {integrity: sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@8.12.2': resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1794,16 +1810,39 @@ packages: typescript: optional: true + '@typescript-eslint/typescript-estree@8.16.0': + resolution: {integrity: sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/utils@8.12.2': resolution: {integrity: sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/utils@8.16.0': + resolution: {integrity: sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/visitor-keys@8.12.2': resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.16.0': + resolution: {integrity: sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitejs/plugin-react@4.3.3': resolution: {integrity: sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4295,6 +4334,14 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + '@tanstack/eslint-plugin-query@5.61.6(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3)': + dependencies: + '@typescript-eslint/utils': 8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3) + eslint: 9.13.0(jiti@1.21.6) + transitivePeerDependencies: + - supports-color + - typescript + '@tanstack/history@1.61.1': {} '@tanstack/query-core@5.59.17': {} @@ -4477,6 +4524,11 @@ snapshots: '@typescript-eslint/types': 8.12.2 '@typescript-eslint/visitor-keys': 8.12.2 + '@typescript-eslint/scope-manager@8.16.0': + dependencies: + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/visitor-keys': 8.16.0 + '@typescript-eslint/type-utils@8.12.2(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.6.3) @@ -4491,6 +4543,8 @@ snapshots: '@typescript-eslint/types@8.12.2': {} + '@typescript-eslint/types@8.16.0': {} + '@typescript-eslint/typescript-estree@8.12.2(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 8.12.2 @@ -4506,6 +4560,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@8.16.0(typescript@5.6.3)': + dependencies: + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/visitor-keys': 8.16.0 + debug: 4.3.7 + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@8.12.2(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.13.0(jiti@1.21.6)) @@ -4517,11 +4586,28 @@ snapshots: - supports-color - typescript + '@typescript-eslint/utils@8.16.0(eslint@9.13.0(jiti@1.21.6))(typescript@5.6.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@9.13.0(jiti@1.21.6)) + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) + eslint: 9.13.0(jiti@1.21.6) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/visitor-keys@8.12.2': dependencies: '@typescript-eslint/types': 8.12.2 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@8.16.0': + dependencies: + '@typescript-eslint/types': 8.16.0 + eslint-visitor-keys: 4.2.0 + '@vitejs/plugin-react@4.3.3(vite@5.4.10(@types/node@22.10.1))': dependencies: '@babel/core': 7.26.0 diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..f8e6d58 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,28 @@ +import { RouterProvider } from "@tanstack/react-router"; +import { useEffect } from "react"; +import { themeChange } from "theme-change"; +import { useViewer } from "./lib/tanstack/query/use-viewer"; +import { queryClient, router } from "./main"; + +export function App() { + useEffect(() => { + // other view transition styles include "angled", "wipe", "slides", "flip", "vertical" + // currently doesn't work in firefox + document.documentElement.dataset.style = "vertical"; + themeChange(false); + }, []); + + const viewer = useViewer(); + return ( + <> + + + ); +} diff --git a/src/components/pagination/ReactresponsivePagination.tsx b/src/components/pagination/ReactresponsivePagination.tsx index acb95af..86cf2ce 100644 --- a/src/components/pagination/ReactresponsivePagination.tsx +++ b/src/components/pagination/ReactresponsivePagination.tsx @@ -22,7 +22,7 @@ export function ListPagination({ total_pages }: ListingsPaginationProps) { onPageChange={(e) => { navigate({ search: { - // @ts-expect-error + // @ts-expect-error : search param type is possibly undefined but it will exist when we need it globalPage: e, }, }); diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx index 0648f8e..d08fd7c 100644 --- a/src/components/ui/alert-dialog.tsx +++ b/src/components/ui/alert-dialog.tsx @@ -2,9 +2,8 @@ import * as React from "react"; import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"; - import { cn } from "@/components/lib/utils"; -import { buttonVariants } from "@/components/ui/button"; +import { buttonVariants } from "@/components/ui/button-extras"; const AlertDialog = AlertDialogPrimitive.Root; diff --git a/src/components/ui/badge-extras.ts b/src/components/ui/badge-extras.ts new file mode 100644 index 0000000..27051e1 --- /dev/null +++ b/src/components/ui/badge-extras.ts @@ -0,0 +1,21 @@ +import { cva } from "class-variance-authority"; + +export const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index 5d1f475..3682877 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -1,27 +1,9 @@ import * as React from "react"; -import { cva, type VariantProps } from "class-variance-authority"; - +import { type VariantProps } from "class-variance-authority"; import { cn } from "@/components/lib/utils"; +import { badgeVariants } from "./badge-extras"; + -const badgeVariants = cva( - "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", - { - variants: { - variant: { - default: - "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", - destructive: - "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", - outline: "text-foreground", - }, - }, - defaultVariants: { - variant: "default", - }, - }, -); export interface BadgeProps extends React.HTMLAttributes, @@ -33,4 +15,5 @@ function Badge({ className, variant, ...props }: BadgeProps) { ); } -export { Badge, badgeVariants }; + +export { Badge }; diff --git a/src/components/ui/button-extras.ts b/src/components/ui/button-extras.ts new file mode 100644 index 0000000..8d3cbed --- /dev/null +++ b/src/components/ui/button-extras.ts @@ -0,0 +1,30 @@ +import { cva } from "class-variance-authority"; + +export const buttonVariants = cva( + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input bg-background hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + }, +); diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index bc75dda..14430ce 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,56 +1,26 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" - -import { cn } from "@/components/lib/utils" - -const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", - { - variants: { - variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - } -) +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { type VariantProps } from "class-variance-authority"; +import { cn } from "@/components/lib/utils"; +import { buttonVariants } from "./button-extras"; export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { - asChild?: boolean + asChild?: boolean; } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" + const Comp = asChild ? Slot : "button"; return ( - ) - } -) -Button.displayName = "Button" - -export { Button, buttonVariants } + ); + }, +); +Button.displayName = "Button"; +export { Button }; diff --git a/src/components/ui/calendar.tsx b/src/components/ui/calendar.tsx index b9c5805..d4b2e49 100644 --- a/src/components/ui/calendar.tsx +++ b/src/components/ui/calendar.tsx @@ -4,7 +4,7 @@ import * as React from "react"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { DayPicker } from "react-day-picker"; import { cn } from "@/components/lib/utils"; -import { buttonVariants } from "@/components/ui/button"; +import { buttonVariants } from "@/components/ui/button-extras"; export type CalendarProps = React.ComponentProps; diff --git a/src/components/ui/chart.tsx b/src/components/ui/chart.tsx index 3826336..aca8d3e 100644 --- a/src/components/ui/chart.tsx +++ b/src/components/ui/chart.tsx @@ -143,7 +143,7 @@ const ChartTooltipContent = React.forwardRef< const itemConfig = getPayloadConfigFromPayload(config, item, key); const value = !labelKey && typeof label === "string" - ? config[label as keyof typeof config]?.label || label + ? config[label]?.label || label : itemConfig?.label; if (labelFormatter) { @@ -352,7 +352,7 @@ function getPayloadConfigFromPayload( return configLabelKey in config ? config[configLabelKey] - : config[key as keyof typeof config]; + : config[key]; } export { diff --git a/src/components/ui/navigation-menu-extras.ts b/src/components/ui/navigation-menu-extras.ts new file mode 100644 index 0000000..c41f16c --- /dev/null +++ b/src/components/ui/navigation-menu-extras.ts @@ -0,0 +1,5 @@ +import { cva } from "class-variance-authority"; + +export const navigationMenuTriggerStyle = cva( + "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50", +); diff --git a/src/components/ui/navigation-menu.tsx b/src/components/ui/navigation-menu.tsx index 8717597..d08f725 100644 --- a/src/components/ui/navigation-menu.tsx +++ b/src/components/ui/navigation-menu.tsx @@ -1,9 +1,8 @@ import * as React from "react"; import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"; -import { cva } from "class-variance-authority"; import { ChevronDown } from "lucide-react"; - import { cn } from "@/components/lib/utils"; +import { navigationMenuTriggerStyle } from "./navigation-menu-extras"; const NavigationMenu = React.forwardRef< React.ElementRef, @@ -40,9 +39,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName; const NavigationMenuItem = NavigationMenuPrimitive.Item; -const navigationMenuTriggerStyle = cva( - "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50", -); + const NavigationMenuTrigger = React.forwardRef< React.ElementRef, @@ -116,7 +113,6 @@ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName; export { - navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, diff --git a/src/components/ui/pagination.tsx b/src/components/ui/pagination.tsx index 04eae82..20e8dad 100644 --- a/src/components/ui/pagination.tsx +++ b/src/components/ui/pagination.tsx @@ -2,7 +2,8 @@ import * as React from "react"; import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"; import { cn } from "@/components/lib/utils"; -import { ButtonProps, buttonVariants } from "@/components/ui/button"; +import { ButtonProps } from "@/components/ui/button"; +import { buttonVariants } from "./button-extras"; const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (