mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Silence fast-refresh warnings and modernize toast
Extract non-component exports (cva variants, contexts, hooks, constants) into sibling *-variants.ts / *-utils.ts files so every .tsx exports only components. This clears the react-refresh/only-export-components warnings introduced when regenerating the shadcn v4 components. Affected: - badge, button, toggle, navigation-menu, tabs: variants extracted - form: FormFieldContext, FormItemContext, useFormField extracted - sidebar: SIDEBAR_* constants, SidebarContext, useSidebar, sidebarMenuButtonVariants extracted - calendar, pagination: updated to import buttonVariants from button-variants Also upgrade toast.tsx to React 19 idioms: drop forwardRef + ElementRef + ComponentPropsWithoutRef in favor of ref-as-prop + React.ComponentProps, add data-slot attributes, replace z-[100] with z-100, and extract toastVariants to toast-variants.ts. Includes canonical-class cleanups in chart, checkbox, command, context-menu, and drawer (e.g. min-w-[8rem] \u2192 min-w-32, data-[inset] \u2192 data-inset, [&_[cmdk-*]] \u2192 **:[[cmdk-*]]).
This commit is contained in:
24 files changed
+356
-316
No files matched your search
@@ -5,7 +5,7 @@ import { type VariantProps } from "class-variance-authority"
|
||||
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { toggleVariants } from "@/components/ui/toggle"
|
||||
import { toggleVariants } from "@/components/ui/toggle-variants"
|
||||
|
||||
const ToggleGroupContext = React.createContext<
|
||||
VariantProps<typeof toggleVariants> & {
|
||||
|
||||
Reference in new issue
Block a user