the-omelet-ui 1.1.9 → 1.2.0
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.
- package/dist/{chunk-BKI53MQ2.js → chunk-M4JODKXJ.js} +1 -1
- package/dist/{chunk-O65FXMUH.js → chunk-TQZABTAM.js} +1 -1
- package/dist/entries/districtDropdown.js +1 -1
- package/dist/entries/provinceDropdown.js +1 -1
- package/dist/entries/searchSelect.js +1 -1
- package/dist/entries/subDistrictDropdown.js +1 -1
- package/dist/entries/textInput.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-DM45BGDQ.js';import {a as a$1}from'./chunk-6GLPXMGB.js';import*as o from'react';import {cva}from'class-variance-authority';import {jsxs,jsx}from'react/jsx-runtime';var w=cva("block w-full rounded-md bg-white outline-none text-sm borderborder disabled:border-none transition-shadow disabled:bg-[#f4f4f4] disabled:pointer-events-none disabled:text-[#BDC2BE] disabled:font-boldfocus-visible:ring-2",{variants:{size:{sm:"h-10 px-2 py-3 text-sm",md:"h-12 px-2 py-4 text-md",lg:"h-14 px-4 py-6 text-xl"},tone:{neutral:"border border-[#C9D7E3] focus-visible:ring-black/20",success:"border border-green-500/60 focus-visible:ring-green-300",danger:"border border-red-500/60 focus-visible:ring-red-300",warning:"border border-yellow-500/60 focus-visible:ring-yellow-300",info:"border border-blue-500/60 focus-visible:ring-blue-300"},withStart:{true:"",false:""},withEnd:{true:"",false:""}},compoundVariants:[{withStart:true,class:"ps-10"},{withEnd:true,class:"pe-10"}],defaultVariants:{size:"md",tone:"neutral"}}),d=o.forwardRef(({className:p,start:s,end:a$2,size:u,tone:b,withStart:c,withEnd:f,error:t,label:r,required:m,disabled:x=false,...g},v)=>jsxs("fieldset",{className:"relative flex flex-col gap-2
|
|
1
|
+
import {a}from'./chunk-DM45BGDQ.js';import {a as a$1}from'./chunk-6GLPXMGB.js';import*as o from'react';import {cva}from'class-variance-authority';import {jsxs,jsx}from'react/jsx-runtime';var w=cva("block w-full rounded-md bg-white outline-none text-sm borderborder disabled:border-none transition-shadow disabled:bg-[#f4f4f4] disabled:pointer-events-none disabled:text-[#BDC2BE] disabled:font-boldfocus-visible:ring-2",{variants:{size:{sm:"h-10 px-2 py-3 text-sm",md:"h-12 px-2 py-4 text-md",lg:"h-14 px-4 py-6 text-xl"},tone:{neutral:"border border-[#C9D7E3] focus-visible:ring-black/20",success:"border border-green-500/60 focus-visible:ring-green-300",danger:"border border-red-500/60 focus-visible:ring-red-300",warning:"border border-yellow-500/60 focus-visible:ring-yellow-300",info:"border border-blue-500/60 focus-visible:ring-blue-300"},withStart:{true:"",false:""},withEnd:{true:"",false:""}},compoundVariants:[{withStart:true,class:"ps-10"},{withEnd:true,class:"pe-10"}],defaultVariants:{size:"md",tone:"neutral"}}),d=o.forwardRef(({className:p,start:s,end:a$2,size:u,tone:b,withStart:c,withEnd:f,error:t,label:r,required:m,disabled:x=false,...g},v)=>jsxs("fieldset",{className:"relative flex flex-col gap-2 ",children:[r&&jsx(a,{label:r,required:m}),jsxs("div",{className:"relative flex flex-col gap-2 items-start text-start",children:[s?jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center ps-3","aria-hidden":"true",children:jsx("span",{className:"text-black/50",children:s})}):null,jsx("input",{ref:v,"data-state":t?"invalid":void 0,className:a$1(w({size:u,tone:t?"danger":b,withStart:c??!!s,withEnd:f??!!a$2}),p),disabled:x,...g}),a$2?jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pe-3",children:a$2}):null]}),t&&jsx("small",{className:"text-red-500 text-xs",children:t})]}));d.displayName="TextInput";var S=d;export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-
|
|
1
|
+
import {a as a$3}from'./chunk-M4JODKXJ.js';import {a as a$4}from'./chunk-IX36POX2.js';import {f,b}from'./chunk-AFEF2EXB.js';import {a as a$1}from'./chunk-DM45BGDQ.js';import {a as a$2}from'./chunk-6GLPXMGB.js';import*as a from'react';import*as l from'@radix-ui/react-popover';import {jsxs,jsx}from'react/jsx-runtime';function ae(i){return typeof i=="string"?{id:i,label:i}:i}var se={neutral:"border-neutral-900 bg-neutral-900 text-white",primary:"border-black bg-black text-white",red:"border-red-600 bg-red-600 text-white",green:"border-green-600 bg-green-600 text-white",blue:"border-blue-600 bg-blue-600 text-white",yellow:"border-yellow-500 bg-yellow-500 text-black",violet:"border-violet-600 bg-violet-600 text-white"};function le({trigger:i,triggerPlaceholder:v="Choose",items:x,selectionMode:b$1="multiple",value:y,defaultValue:q,onChange:z,searchable:w=true,placeholder:Q="Placeholder Text",searchButtonLabel:A="Search",onQueryChange:O,onSearch:V,loading:m=false,emptyLabel:j="No results",contentClassName:D,maxHeight:H=288,renderItem:k,buttonColor:W="primary",searchButtonColor:_,searchButtonClassName:$,checkedColor:E="primary",checkedClassName:F,renderTriggerValue:R,label:N,required:G}){let[C,P]=a.useState(false),[p,J]=a.useState(""),[g,K]=a.useState(""),s=b$1==="multiple",[U,X]=a.useState(q??(s?[]:"")),o=y??U,d=a.useMemo(()=>x.map(ae),[x]),S=a.useMemo(()=>{let e=g.trim().toLowerCase();return e?d.filter(r=>String(r.label).toLowerCase().includes(e)):d},[d,g]),I=e=>{z?.(e),y===void 0&&X(e);},Y=e=>{if(s){let r=new Set(o);r.has(e)?r.delete(e):r.add(e),I(Array.from(r));}else I(e),P(false);},Z=e=>s?o.includes(e):o===e,ee=()=>{K(p),V?.(p);},f$1=a.useMemo(()=>s?o:o?[o]:[],[o,s]),u=a.useMemo(()=>d.filter(e=>f$1.includes(e.id)),[d,f$1]),te=a.useMemo(()=>u.length===0?v:s?`\u0E40\u0E25\u0E37\u0E2D\u0E01 ${u.length} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23`:u[0].label,[u,s,v]);return jsxs(l.Root,{open:C,onOpenChange:P,children:[N&&jsx(a$1,{label:N,required:G}),jsx("div",{className:"mb-2"}),jsx(l.Trigger,{asChild:true,children:i??jsxs("button",{type:"button",className:a$2("flex w-full min-w-[260px] items-center justify-between","rounded-md border border-black/15 bg-white px-4 py-3 text-left","outline-none focus-visible:ring-2 ring-black/20"),children:[jsx("span",{className:a$2("flex-1 ",{"text-gray-400":s?o?.length===0:!o,"text-black":s?o?.length>0:!!o}),children:R?R(f$1,u):te}),jsx("svg",{className:a$2("ml-3 h-5 w-5 text-black/60 transition-transform",C?"rotate-180":"rotate-0"),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})]})}),jsx(l.Portal,{children:jsxs(l.Content,{sideOffset:8,className:a$2("w-[420px] rounded-md border border-black/10 bg-white p-2 shadow-xl",D),children:[w&&jsxs("form",{className:"grid grid-cols-[1fr_auto] gap-3",onSubmit:e=>{e.preventDefault(),ee();},children:[jsx(a$3,{start:jsx(f,{className:"h-3 w-3 text-black/50"}),value:p,onChange:e=>{J(e.currentTarget.value),O?.(e.currentTarget.value);},size:"sm",placeholder:Q}),jsx(a$4,{color:_??W,type:"submit",disabled:m||p.trim()===g.trim(),size:"md",className:$,children:A})]}),jsxs("div",{role:"listbox","aria-multiselectable":s||void 0,className:a$2(" overflow-y-auto rounded-md",{"mt-3":w}),style:{maxHeight:H},children:[m&&jsx("div",{className:"p-6 text-center text-black/60",children:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026"}),!m&&S.length===0&&jsx("div",{className:"p-6 text-center text-black/50",children:j}),!m&&S.map(e=>{let r=Z(e.id),re=se[E],oe=jsxs(a$4,{type:"button",role:"option","aria-selected":r,onClick:()=>Y(e.id),disabled:e.disabled,size:"sm",className:a$2("group flex w-full items-center justify-between gap-3 rounded-md px-2 py-2 text-left bg-white","hover:bg-black/[0.04] disabled:opacity-50",{"bg-black/[0.04]":r&&b$1==="single"}),children:[jsx("span",{className:"text-md text-black",children:e.label}),b$1==="multiple"&&jsx("span",{className:a$2("grid h-5 w-5 place-items-center rounded-full border-2",r?re:"border-black/20",r&&F),children:r?jsx(b,{className:"h-2 w-2"}):null})]},e.id);return k?jsx("div",{children:k(e,false,r)},e.id):oe})]}),jsx(l.Arrow,{className:"fill-white stroke-black/10"})]})})]})}var me=le;export{me as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-TQZABTAM.js';import'../chunk-M4JODKXJ.js';import'../chunk-IX36POX2.js';import'../chunk-AFEF2EXB.js';import'../chunk-DM45BGDQ.js';import'../chunk-6GLPXMGB.js';import {useState,useEffect,useCallback}from'react';import {jsx}from'react/jsx-runtime';var S=(t,s)=>s==="en"?{id:t.id,name:t.name_en,value:t.id,label:t.name_en}:{id:t.id,name:t.name_th,value:t.id,label:t.name_th},P=async t=>(await(await fetch("https://raw.githubusercontent.com/kongvut/thai-province-data/refs/heads/master/api/latest/district.json")).json()).filter(a=>a.province_id===t),w=({locale:t="th",searchPlaceholder:s="Search District",placeholder:c="Select District",label:l,searchButtonClassName:a$1="bg-blue-500",onChange:f,value:n,required:D=false,provinceId:o})=>{let[i,g]=useState([]),[b,d]=useState(null);useEffect(()=>{o&&P(o).then(g);},[o]),useEffect(()=>{if(n){let e=i.find(r=>t==="th"?r.name_th===n:r.name_en===n);e&&d(e);}},[i,n,t]);let _=useCallback(e=>{let r=i.find(v=>v.id===e);r&&(d(r),f?.(r));},[i]);return jsx("div",{children:jsx(a,{items:i.map(e=>S(e,t)),placeholder:s,triggerPlaceholder:c,label:l,selectionMode:"single",searchButtonClassName:a$1,onChange:e=>{typeof e=="string"&&_(e);},value:b?.id,required:D})})},x=w;
|
|
2
2
|
export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-TQZABTAM.js';import'../chunk-M4JODKXJ.js';import'../chunk-IX36POX2.js';import'../chunk-AFEF2EXB.js';import'../chunk-DM45BGDQ.js';import'../chunk-6GLPXMGB.js';import {useState,useEffect,useCallback}from'react';import {jsx}from'react/jsx-runtime';var C=(e,o)=>o==="en"?{id:e.id,name:e.name_en,value:e.id,label:e.name_en}:{id:e.id,name:e.name_th,value:e.id,label:e.name_th},S=async()=>await(await fetch("https://raw.githubusercontent.com/kongvut/thai-province-data/refs/heads/master/api/latest/province.json")).json(),w=({locale:e="th",searchPlaceholder:o="Search Province",placeholder:h="Select Province",label:u,searchButtonClassName:P="bg-blue-500",onChange:m,value:i,required:f=false})=>{let[r,v]=useState([]),[p,s]=useState(null);useEffect(()=>{S().then(v);},[]),useEffect(()=>{if(i){let n=r.find(t=>e==="th"?t.name_th===i:t.name_en===i);n&&s(n);}},[r,i,e]);let g=useCallback(n=>{let t=r.find(b=>b.id===n);t&&(s(t),m?.(t));},[r]);return jsx("div",{children:jsx(a,{items:r.map(n=>C(n,e)),placeholder:o,triggerPlaceholder:h,label:u,selectionMode:"single",searchButtonClassName:P,onChange:n=>{typeof n=="string"&&g(n);},value:p?.id,required:f})})},x=w;
|
|
2
2
|
export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as default}from'../chunk-
|
|
1
|
+
export{a as default}from'../chunk-TQZABTAM.js';import'../chunk-M4JODKXJ.js';import'../chunk-IX36POX2.js';import'../chunk-AFEF2EXB.js';import'../chunk-DM45BGDQ.js';import'../chunk-6GLPXMGB.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-TQZABTAM.js';import'../chunk-M4JODKXJ.js';import'../chunk-IX36POX2.js';import'../chunk-AFEF2EXB.js';import'../chunk-DM45BGDQ.js';import'../chunk-6GLPXMGB.js';import {useState,useEffect,useCallback}from'react';import {jsx}from'react/jsx-runtime';var v=(t,s)=>s==="en"?{id:t.id,name:t.name_en,value:t.id,label:t.name_en}:{id:t.id,name:t.name_th,value:t.id,label:t.name_th},P=async t=>(await(await fetch("https://raw.githubusercontent.com/kongvut/thai-province-data/refs/heads/master/api/latest/sub_district.json")).json()).filter(a=>a.district_id===t),w=({locale:t="th",searchPlaceholder:s="Search District",placeholder:c="Select District",label:l,searchButtonClassName:a$1="bg-blue-500",onChange:p,value:n,required:b=false,districtId:o})=>{let[r,S]=useState([]),[g,d]=useState(null);useEffect(()=>{o&&P(o).then(S);},[o]),useEffect(()=>{if(n){let e=r.find(i=>t==="th"?i.name_th===n:i.name_en===n);e&&d(e);}},[r,n,t]);let D=useCallback(e=>{let i=r.find(_=>_.id===e);i&&(d(i),p?.(i));},[r]);return jsx("div",{children:jsx(a,{items:r.map(e=>v(e,t)),placeholder:s,triggerPlaceholder:c,label:l,selectionMode:"single",searchButtonClassName:a$1,onChange:e=>{typeof e=="string"&&D(e);},value:g?.id,required:b})})},x=w;
|
|
2
2
|
export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as default}from'../chunk-
|
|
1
|
+
export{a as default}from'../chunk-M4JODKXJ.js';import'../chunk-DM45BGDQ.js';import'../chunk-6GLPXMGB.js';
|