chore(ui,dashboard): Use radix-ui package (#11195)
* update deps for ui * chore(ui,dashboard): Use radix-ui package --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
12c3e6a03d
commit
9822bd930b
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { CheckMini, MinusMini } from "@medusajs/icons"
|
||||
import * as Primitives from "@radix-ui/react-checkbox"
|
||||
import { Checkbox as RadixCheckbox } from "radix-ui"
|
||||
import * as React from "react"
|
||||
|
||||
import { clx } from "@/utils/clx"
|
||||
@@ -11,13 +11,13 @@ import { CheckboxCheckedState } from "./types"
|
||||
* This component is based on the [Radix UI Checkbox](https://www.radix-ui.com/primitives/docs/components/checkbox) primitive.
|
||||
*/
|
||||
const Checkbox = React.forwardRef<
|
||||
React.ElementRef<typeof Primitives.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof Primitives.Root> & {
|
||||
React.ElementRef<typeof RadixCheckbox.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof RadixCheckbox.Root> & {
|
||||
checked?: CheckboxCheckedState | undefined
|
||||
}
|
||||
>(({ className, checked, ...props }, ref) => {
|
||||
return (
|
||||
<Primitives.Root
|
||||
<RadixCheckbox.Root
|
||||
{...props}
|
||||
ref={ref}
|
||||
checked={checked}
|
||||
@@ -36,11 +36,11 @@ const Checkbox = React.forwardRef<
|
||||
"group-data-[state=indeterminate]:bg-ui-bg-interactive group-data-[state=indeterminate]:shadow-borders-interactive-with-shadow"
|
||||
)}
|
||||
>
|
||||
<Primitives.Indicator>
|
||||
<RadixCheckbox.Indicator>
|
||||
{checked === "indeterminate" ? <MinusMini /> : <CheckMini />}
|
||||
</Primitives.Indicator>
|
||||
</RadixCheckbox.Indicator>
|
||||
</div>
|
||||
</Primitives.Root>
|
||||
</RadixCheckbox.Root>
|
||||
)
|
||||
})
|
||||
Checkbox.displayName = "Checkbox"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { CheckedState } from "@radix-ui/react-checkbox"
|
||||
import type { Checkbox } from "radix-ui"
|
||||
|
||||
export type CheckboxCheckedState = CheckedState
|
||||
export type CheckboxCheckedState = Checkbox.CheckedState
|
||||
|
||||
Reference in New Issue
Block a user