UNPKG

@premieroctet/next-admin

Version:

Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje

26 lines (25 loc) 1.67 kB
import { jsx, jsxs } from "react/jsx-runtime"; import { Root, Thumb } from "@radix-ui/react-switch"; import external_clsx_default from "clsx"; import { forwardRef } from "react"; const SwitchRoot = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsxs(Root, { className: external_clsx_default("group relative inline-flex h-5 w-10 shrink-0 cursor-pointer items-center justify-center rounded-full bg-transparent data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", className), ref: ref, ...props, children: [ /*#__PURE__*/ jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute h-full w-full bg-transparent" }), /*#__PURE__*/ jsx("span", { className: "bg-nextadmin-background-muted dark:bg-dark-nextadmin-background-muted group-data-[state=checked]:bg-nextadmin-brand-subtle dark:group-data-[state=checked]:bg-dark-nextadmin-brand-subtle pointer-events-none absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out" }), children ] })); const SwitchThumb = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Thumb, { className: external_clsx_default("border-nextadmin-border-default absolute left-0 inline-block h-5 w-5 translate-x-0.5 rounded-full border bg-white shadow ring-0 transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-5", "data-[disabled]:cursor-not-allowed", className), ref: ref, ...props })); export { SwitchRoot, SwitchThumb };