@dndbuilder.com/react
Version:
Drag and drop builder for React
30 lines (29 loc) • 1.28 kB
JavaScript
"use client";
import { jsx as e } from "react/jsx-runtime";
import i from "react";
import { Root as t, Thumb as n } from "../../../../../node_modules/.pnpm/@radix-ui_react-switch@1.1.3_@types_react-dom@19.0.4_@types_react@19.0.10__@types_react@19.0._moyrweh32pybfkj2g2egstnieq/node_modules/@radix-ui/react-switch/dist/index.js";
import { classNames as r } from "../../../../../utils.js";
const d = i.forwardRef(({ className: a, ...o }, s) => /* @__PURE__ */ e(
t,
{
className: r(
"focus-visible:outline-hidden relative inline-flex h-4 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-600 data-[state=unchecked]:bg-gray-300",
a
),
...o,
ref: s,
children: /* @__PURE__ */ e(
n,
{
className: r(
"pointer-events-none absolute left-0 inline-block size-5 transform rounded-full border border-gray-200 bg-white shadow ring-0 transition-transform duration-200 ease-in-out data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-[-3px]"
)
}
)
}
));
d.displayName = t.displayName;
export {
d as Switch
};
//# sourceMappingURL=switch.js.map