the-omelet-ui 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-6GLPXMGB.js';import {memo,useId}from'react';import {jsx,jsxs}from'react/jsx-runtime';var m=memo(({label:s,name:u,value:b,checked:e=false,disabled:i=false,onChange:c,className:f="",size:p="md",error:o=false,radioClassName:l,required:x})=>{let a$1=useId(),n={sm:{radio:"w-4 h-4",dot:"w-1.5 h-1.5",label:"text-sm",description:"text-xs"},md:{radio:"w-5 h-5",dot:"w-2.5 h-2.5",label:"text-base",description:"text-sm"},lg:{radio:"w-6 h-6",dot:"w-3 h-3",label:"text-lg",description:"text-base"}}[p];return jsx("div",{className:`inline-flex flex-col ${f}`,children:jsxs("label",{htmlFor:a$1,className:a("inline-flex items-center gap-2 cursor-pointer",i&&"opacity-50 cursor-not-allowed"),children:[jsxs("div",{className:"relative flex items-center justify-center flex-shrink-0 mt-0.5",children:[jsx("input",{type:"radio",id:a$1,name:u,value:b,checked:e,disabled:i,onChange:c,className:"sr-only peer"}),jsx("div",{className:a(n.radio,"rounded-full border-2 transition-all duration-200 flex items-center justify-center",o&&"border-red-500",!o&&e&&!l&&"border-blue-500 bg-blue-500",!o&&!e&&"border-gray-300 bg-white",!o&&!i&&!e&&"peer-hover:border-blue-400",i&&"bg-gray-100","peer-focus-visible:ring-2 peer-focus-visible:ring-blue-500 peer-focus-visible:ring-offset-2",e&&l),children:e&&jsx("div",{className:a(n.dot,"rounded-full bg-white transition-all duration-200")})})]}),s&&jsx("div",{className:"flex flex-col",children:jsx("label",{className:"block text-sm text-[#444] font-medium",children:s})})]})})});m.displayName="RadioButton";var y=m;export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as default}from'../chunk-
|
|
1
|
+
export{a as default}from'../chunk-P7O33B4C.js';import'../chunk-6GLPXMGB.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'../chunk-
|
|
1
|
+
import {a as a$1}from'../chunk-P7O33B4C.js';import {a as a$2}from'../chunk-QRYSV225.js';import {a}from'../chunk-FK7R34ZH.js';import'../chunk-6GLPXMGB.js';import {memo,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';function p(...r){return r.filter(Boolean).join(" ")}var u=memo(({name:r,options:m,value:f,onChange:o,size:c="md",direction:g="vertical",error:i,label:l,required:t=false,className:v="",disabled:b=false,radioClassName:R})=>{let x=useCallback(e=>{o&&o(e.target.value);},[o]);return jsxs("div",{className:p("flex flex-col gap-2",v),children:[l&&jsx(a,{label:l,required:t}),jsx("div",{className:p("flex gap-4",g==="vertical"?"flex-col":"flex-row flex-wrap"),role:"radiogroup","aria-label":l,"aria-required":t,children:m.map(e=>jsx(a$1,{name:r,label:e.label,value:e.value,description:e.description,checked:f===e.value,disabled:b||e.disabled,onChange:x,size:c,radioClassName:R,error:!!i},e.value))}),i&&jsx(a$2,{message:i})]})});u.displayName="RadioGroup";var C=u;export{C as default};
|
package/package.json
CHANGED
package/dist/chunk-ZFVK2AWO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-FK7R34ZH.js';import {a}from'./chunk-6GLPXMGB.js';import {memo,useId}from'react';import {jsx,jsxs}from'react/jsx-runtime';var u=memo(({label:s,name:b,value:f,checked:e=false,disabled:i=false,onChange:p,className:c="",size:g="md",error:o=false,radioClassName:a$2,required:v})=>{let l=useId(),n={sm:{radio:"w-4 h-4",dot:"w-1.5 h-1.5",label:"text-sm",description:"text-xs"},md:{radio:"w-5 h-5",dot:"w-2.5 h-2.5",label:"text-base",description:"text-sm"},lg:{radio:"w-6 h-6",dot:"w-3 h-3",label:"text-lg",description:"text-base"}}[g];return jsx("div",{className:`inline-flex flex-col ${c}`,children:jsxs("label",{htmlFor:l,className:a("inline-flex items-start gap-2 cursor-pointer",i&&"opacity-50 cursor-not-allowed"),children:[jsxs("div",{className:"relative flex items-center justify-center flex-shrink-0 mt-0.5",children:[jsx("input",{type:"radio",id:l,name:b,value:f,checked:e,disabled:i,onChange:p,className:"sr-only peer"}),jsx("div",{className:a(n.radio,"rounded-full border-2 transition-all duration-200 flex items-center justify-center",o&&"border-red-500",!o&&e&&!a$2&&"border-blue-500 bg-blue-500",!o&&!e&&"border-gray-300 bg-white",!o&&!i&&!e&&"peer-hover:border-blue-400",i&&"bg-gray-100","peer-focus-visible:ring-2 peer-focus-visible:ring-blue-500 peer-focus-visible:ring-offset-2",e&&a$2),children:e&&jsx("div",{className:a(n.dot,"rounded-full bg-white transition-all duration-200")})})]}),jsx("div",{className:"flex flex-col",children:s&&jsx(a$1,{label:s,required:v})})]})})});u.displayName="RadioButton";var C=u;export{C as a};
|