nextuiq
Version:
NextUIQ is a modern, lightweight, and developer-friendly UI component library for React and Next.js. Built with TypeScript and Tailwind CSS, it offers customizable, accessible, and performance-optimized components with built-in dark mode, theme customizat
2 lines (1 loc) • 2.27 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index46.js"),r=require("react"),t=r.forwardRef((({label:t,checked:s,id:o,onChange:n,className:a="",disabled:i=!1,required:d=!1,name:l,"aria-label":c,"aria-describedby":h,...u},x)=>{const m=r.useId(),p=o||m;return e.jsxRuntimeExports.jsxs("label",{htmlFor:p,className:"flex items-center space-x-3 group "+(i?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[e.jsxRuntimeExports.jsxs("div",{className:"relative w-5 h-5",children:[e.jsxRuntimeExports.jsx("input",{ref:x,id:p,type:"checkbox",name:l,className:`w-5 h-5 appearance-none border rounded-md\n border-[oklch(var(--theme-border))]\n checked:border-transparent\n checked:bg-[oklch(var(--theme-primary))]\n disabled:opacity-60 \n focus-visible:outline-none \n focus-visible:ring-2 \n focus-visible:ring-[oklch(var(--theme-ring))]\n ${i?"cursor-not-allowed":"cursor-pointer"}\n ${a}`,checked:s,onChange:e=>n(e.target.checked),disabled:i,required:d,"aria-label":c||("string"==typeof t?t:void 0),"aria-describedby":h,"aria-checked":s,...u}),s&&e.jsxRuntimeExports.jsx("svg",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"oklch(var(--theme-primary-foreground))",strokeWidth:"1.94437",strokeLinecap:"round",strokeLinejoin:"round"})}),i&&e.jsxRuntimeExports.jsx("svg",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:e.jsxRuntimeExports.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"oklch(var(--theme-muted-foreground))",strokeWidth:"2.33333",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&e.jsxRuntimeExports.jsx("span",{className:"text-sm font-medium text-[oklch(var(--theme-foreground))]",children:t})]})}));t.displayName="Checkbox",exports.Checkbox=t;