@sudobility/entity-components 1.0.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/__tests__/setup.d.ts +1 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/components/EntityCard.d.ts +16 -0
- package/dist/components/EntityCard.d.ts.map +1 -0
- package/dist/components/EntityList.d.ts +20 -0
- package/dist/components/EntityList.d.ts.map +1 -0
- package/dist/components/EntitySelector.d.ts +20 -0
- package/dist/components/EntitySelector.d.ts.map +1 -0
- package/dist/components/InvitationForm.d.ts +16 -0
- package/dist/components/InvitationForm.d.ts.map +1 -0
- package/dist/components/InvitationList.d.ts +24 -0
- package/dist/components/InvitationList.d.ts.map +1 -0
- package/dist/components/MemberList.d.ts +24 -0
- package/dist/components/MemberList.d.ts.map +1 -0
- package/dist/components/MemberRoleSelector.d.ts +16 -0
- package/dist/components/MemberRoleSelector.d.ts.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3392 -0
- package/dist/index.umd.js +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(k,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("lucide-react"),require("react"),require("@sudobility/types")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","lucide-react","react","@sudobility/types"],r):(k=typeof globalThis<"u"?globalThis:k||self,r(k.EntityComponents={},k.ReactJSXRuntime,k.LucideReact,k.React,k.SudobilityTypes))})(this,(function(k,r,x,$,J){"use strict";function ue(e){var o,t,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(o=0;o<a;o++)e[o]&&(t=ue(e[o]))&&(s&&(s+=" "),s+=t)}else for(t in e)e[t]&&(s&&(s+=" "),s+=t);return s}function De(){for(var e,o,t=0,s="",a=arguments.length;t<a;t++)(e=arguments[t])&&(o=ue(e))&&(s&&(s+=" "),s+=o);return s}const We=(e,o)=>{const t=new Array(e.length+o.length);for(let s=0;s<e.length;s++)t[s]=e[s];for(let s=0;s<o.length;s++)t[e.length+s]=o[s];return t},_e=(e,o)=>({classGroupId:e,validator:o}),fe=(e=new Map,o=null,t)=>({nextPart:e,validators:o,classGroupId:t}),H="-",ge=[],$e="arbitrary..",qe=e=>{const o=Ye(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:n=>{if(n.startsWith("[")&&n.endsWith("]"))return Xe(n);const p=n.split(H),l=p[0]===""&&p.length>1?1:0;return be(p,l,o)},getConflictingClassGroupIds:(n,p)=>{if(p){const l=s[n],f=t[n];return l?f?We(f,l):l:f||ge}return t[n]||ge}}},be=(e,o,t)=>{if(e.length-o===0)return t.classGroupId;const a=e[o],i=t.nextPart.get(a);if(i){const f=be(e,o+1,i);if(f)return f}const n=t.validators;if(n===null)return;const p=o===0?e.join(H):e.slice(o).join(H),l=n.length;for(let f=0;f<l;f++){const b=n[f];if(b.validator(p))return b.classGroupId}},Xe=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=e.slice(1,-1),t=o.indexOf(":"),s=o.slice(0,t);return s?$e+s:void 0})(),Ye=e=>{const{theme:o,classGroups:t}=e;return Je(t,o)},Je=(e,o)=>{const t=fe();for(const s in e){const a=e[s];se(a,t,s,o)}return t},se=(e,o,t,s)=>{const a=e.length;for(let i=0;i<a;i++){const n=e[i];He(n,o,t,s)}},He=(e,o,t,s)=>{if(typeof e=="string"){Ke(e,o,t);return}if(typeof e=="function"){Qe(e,o,t,s);return}Ze(e,o,t,s)},Ke=(e,o,t)=>{const s=e===""?o:he(o,e);s.classGroupId=t},Qe=(e,o,t,s)=>{if(Re(e)){se(e(s),o,t,s);return}o.validators===null&&(o.validators=[]),o.validators.push(_e(t,e))},Ze=(e,o,t,s)=>{const a=Object.entries(e),i=a.length;for(let n=0;n<i;n++){const[p,l]=a[n];se(l,he(o,p),t,s)}},he=(e,o)=>{let t=e;const s=o.split(H),a=s.length;for(let i=0;i<a;i++){const n=s[i];let p=t.nextPart.get(n);p||(p=fe(),t.nextPart.set(n,p)),t=p}return t},Re=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,er=e=>{if(e<1)return{get:()=>{},set:()=>{}};let o=0,t=Object.create(null),s=Object.create(null);const a=(i,n)=>{t[i]=n,o++,o>e&&(o=0,s=t,t=Object.create(null))};return{get(i){let n=t[i];if(n!==void 0)return n;if((n=s[i])!==void 0)return a(i,n),n},set(i,n){i in t?t[i]=n:a(i,n)}}},ae="!",xe=":",rr=[],ye=(e,o,t,s,a)=>({modifiers:e,hasImportantModifier:o,baseClassName:t,maybePostfixModifierPosition:s,isExternal:a}),or=e=>{const{prefix:o,experimentalParseClassName:t}=e;let s=a=>{const i=[];let n=0,p=0,l=0,f;const b=a.length;for(let A=0;A<b;A++){const C=a[A];if(n===0&&p===0){if(C===xe){i.push(a.slice(l,A)),l=A+1;continue}if(C==="/"){f=A;continue}}C==="["?n++:C==="]"?n--:C==="("?p++:C===")"&&p--}const v=i.length===0?a:a.slice(l);let S=v,G=!1;v.endsWith(ae)?(S=v.slice(0,-1),G=!0):v.startsWith(ae)&&(S=v.slice(1),G=!0);const O=f&&f>l?f-l:void 0;return ye(i,G,S,O)};if(o){const a=o+xe,i=s;s=n=>n.startsWith(a)?i(n.slice(a.length)):ye(rr,!1,n,void 0,!0)}if(t){const a=s;s=i=>t({className:i,parseClassName:a})}return s},tr=e=>{const o=new Map;return e.orderSensitiveModifiers.forEach((t,s)=>{o.set(t,1e6+s)}),t=>{const s=[];let a=[];for(let i=0;i<t.length;i++){const n=t[i],p=n[0]==="[",l=o.has(n);p||l?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(n)):a.push(n)}return a.length>0&&(a.sort(),s.push(...a)),s}},sr=e=>({cache:er(e.cacheSize),parseClassName:or(e),sortModifiers:tr(e),...qe(e)}),ar=/\s+/,nr=(e,o)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:i}=o,n=[],p=e.trim().split(ar);let l="";for(let f=p.length-1;f>=0;f-=1){const b=p[f],{isExternal:v,modifiers:S,hasImportantModifier:G,baseClassName:O,maybePostfixModifierPosition:A}=t(b);if(v){l=b+(l.length>0?" "+l:l);continue}let C=!!A,j=s(C?O.substring(0,A):O);if(!j){if(!C){l=b+(l.length>0?" "+l:l);continue}if(j=s(O),!j){l=b+(l.length>0?" "+l:l);continue}C=!1}const Z=S.length===0?"":S.length===1?S[0]:i(S).join(":"),X=G?Z+ae:Z,D=X+j;if(n.indexOf(D)>-1)continue;n.push(D);const W=a(j,C);for(let L=0;L<W.length;++L){const Y=W[L];n.push(X+Y)}l=b+(l.length>0?" "+l:l)}return l},lr=(...e)=>{let o=0,t,s,a="";for(;o<e.length;)(t=e[o++])&&(s=we(t))&&(a&&(a+=" "),a+=s);return a},we=e=>{if(typeof e=="string")return e;let o,t="";for(let s=0;s<e.length;s++)e[s]&&(o=we(e[s]))&&(t&&(t+=" "),t+=o);return t},ir=(e,...o)=>{let t,s,a,i;const n=l=>{const f=o.reduce((b,v)=>v(b),e());return t=sr(f),s=t.cache.get,a=t.cache.set,i=p,p(l)},p=l=>{const f=s(l);if(f)return f;const b=nr(l,t);return a(l,b),b};return i=n,(...l)=>i(lr(...l))},cr=[],y=e=>{const o=t=>t[e]||cr;return o.isThemeGetter=!0,o},ke=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ve=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dr=/^\d+\/\d+$/,pr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ur=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>dr.test(e),g=e=>!!e&&!Number.isNaN(Number(e)),T=e=>!!e&&Number.isInteger(Number(e)),ne=e=>e.endsWith("%")&&g(e.slice(0,-1)),I=e=>pr.test(e),br=()=>!0,hr=e=>mr.test(e)&&!ur.test(e),Ne=()=>!1,xr=e=>fr.test(e),yr=e=>gr.test(e),wr=e=>!c(e)&&!d(e),kr=e=>B(e,Ie,Ne),c=e=>ke.test(e),P=e=>B(e,Me,hr),le=e=>B(e,Sr,g),Ce=e=>B(e,Se,Ne),vr=e=>B(e,Ae,yr),K=e=>B(e,Ee,xr),d=e=>ve.test(e),q=e=>U(e,Me),Nr=e=>U(e,Ar),ze=e=>U(e,Se),Cr=e=>U(e,Ie),zr=e=>U(e,Ae),Q=e=>U(e,Ee,!0),B=(e,o,t)=>{const s=ke.exec(e);return s?s[1]?o(s[1]):t(s[2]):!1},U=(e,o,t=!1)=>{const s=ve.exec(e);return s?s[1]?o(s[1]):t:!1},Se=e=>e==="position"||e==="percentage",Ae=e=>e==="image"||e==="url",Ie=e=>e==="length"||e==="size"||e==="bg-size",Me=e=>e==="length",Sr=e=>e==="number",Ar=e=>e==="family-name",Ee=e=>e==="shadow",Ir=ir(()=>{const e=y("color"),o=y("font"),t=y("text"),s=y("font-weight"),a=y("tracking"),i=y("leading"),n=y("breakpoint"),p=y("container"),l=y("spacing"),f=y("radius"),b=y("shadow"),v=y("inset-shadow"),S=y("text-shadow"),G=y("drop-shadow"),O=y("blur"),A=y("perspective"),C=y("aspect"),j=y("ease"),Z=y("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...D(),d,c],L=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],u=()=>[d,c,l],M=()=>[V,"full","auto",...u()],Ge=()=>[T,"none","subgrid",d,c],Oe=()=>["auto",{span:["full",T,d,c]},T,d,c],R=()=>[T,"auto",d,c],je=()=>["auto","min","max","fr",d,c],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...u()],F=()=>[V,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],m=()=>[e,d,c],Le=()=>[...D(),ze,Ce,{position:[d,c]}],Fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ve=()=>["auto","cover","contain",Cr,kr,{size:[d,c]}],pe=()=>[ne,q,P],N=()=>["","none","full",f,d,c],z=()=>["",g,q,P],ee=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],w=()=>[g,ne,ze,Ce],Ue=()=>["","none",O,d,c],re=()=>["none",g,d,c],oe=()=>["none",g,d,c],me=()=>[g,d,c],te=()=>[V,"full",...u()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[I],breakpoint:[I],color:[br],container:[I],"drop-shadow":[I],ease:["in","out","in-out"],font:[wr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[I],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[I],shadow:[I],spacing:["px",g],text:[I],"text-shadow":[I],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",V,c,d,C]}],container:["container"],columns:[{columns:[g,c,d,p]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[T,"auto",d,c]}],basis:[{basis:[V,"full","auto",p,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[g,V,"auto","initial","none",c]}],grow:[{grow:["",g,d,c]}],shrink:[{shrink:["",g,d,c]}],order:[{order:[T,"first","last","none",d,c]}],"grid-cols":[{"grid-cols":Ge()}],"col-start-end":[{col:Oe()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":Ge()}],"row-start-end":[{row:Oe()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":je()}],"auto-rows":[{"auto-rows":je()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[p,"screen",...F()]}],"min-w":[{"min-w":[p,"screen","none",...F()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[n]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",t,q,P]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,d,le]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ne,c]}],"font-family":[{font:[Nr,c,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,d,c]}],"line-clamp":[{"line-clamp":[g,"none",d,le]}],leading:[{leading:[i,...u()]}],"list-image":[{"list-image":["none",d,c]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",d,c]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:m()}],"text-color":[{text:m()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[g,"from-font","auto",d,P]}],"text-decoration-color":[{decoration:m()}],"underline-offset":[{"underline-offset":[g,"auto",d,c]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d,c]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d,c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Le()}],"bg-repeat":[{bg:Fe()}],"bg-size":[{bg:Ve()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},T,d,c],radial:["",d,c],conic:[T,d,c]},zr,vr]}],"bg-color":[{bg:m()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:m()}],"gradient-via":[{via:m()}],"gradient-to":[{to:m()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:m()}],"border-color-x":[{"border-x":m()}],"border-color-y":[{"border-y":m()}],"border-color-s":[{"border-s":m()}],"border-color-e":[{"border-e":m()}],"border-color-t":[{"border-t":m()}],"border-color-r":[{"border-r":m()}],"border-color-b":[{"border-b":m()}],"border-color-l":[{"border-l":m()}],"divide-color":[{divide:m()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[g,d,c]}],"outline-w":[{outline:["",g,q,P]}],"outline-color":[{outline:m()}],shadow:[{shadow:["","none",b,Q,K]}],"shadow-color":[{shadow:m()}],"inset-shadow":[{"inset-shadow":["none",v,Q,K]}],"inset-shadow-color":[{"inset-shadow":m()}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:m()}],"ring-offset-w":[{"ring-offset":[g,P]}],"ring-offset-color":[{"ring-offset":m()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":m()}],"text-shadow":[{"text-shadow":["none",S,Q,K]}],"text-shadow-color":[{"text-shadow":m()}],opacity:[{opacity:[g,d,c]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[g]}],"mask-image-linear-from-pos":[{"mask-linear-from":w()}],"mask-image-linear-to-pos":[{"mask-linear-to":w()}],"mask-image-linear-from-color":[{"mask-linear-from":m()}],"mask-image-linear-to-color":[{"mask-linear-to":m()}],"mask-image-t-from-pos":[{"mask-t-from":w()}],"mask-image-t-to-pos":[{"mask-t-to":w()}],"mask-image-t-from-color":[{"mask-t-from":m()}],"mask-image-t-to-color":[{"mask-t-to":m()}],"mask-image-r-from-pos":[{"mask-r-from":w()}],"mask-image-r-to-pos":[{"mask-r-to":w()}],"mask-image-r-from-color":[{"mask-r-from":m()}],"mask-image-r-to-color":[{"mask-r-to":m()}],"mask-image-b-from-pos":[{"mask-b-from":w()}],"mask-image-b-to-pos":[{"mask-b-to":w()}],"mask-image-b-from-color":[{"mask-b-from":m()}],"mask-image-b-to-color":[{"mask-b-to":m()}],"mask-image-l-from-pos":[{"mask-l-from":w()}],"mask-image-l-to-pos":[{"mask-l-to":w()}],"mask-image-l-from-color":[{"mask-l-from":m()}],"mask-image-l-to-color":[{"mask-l-to":m()}],"mask-image-x-from-pos":[{"mask-x-from":w()}],"mask-image-x-to-pos":[{"mask-x-to":w()}],"mask-image-x-from-color":[{"mask-x-from":m()}],"mask-image-x-to-color":[{"mask-x-to":m()}],"mask-image-y-from-pos":[{"mask-y-from":w()}],"mask-image-y-to-pos":[{"mask-y-to":w()}],"mask-image-y-from-color":[{"mask-y-from":m()}],"mask-image-y-to-color":[{"mask-y-to":m()}],"mask-image-radial":[{"mask-radial":[d,c]}],"mask-image-radial-from-pos":[{"mask-radial-from":w()}],"mask-image-radial-to-pos":[{"mask-radial-to":w()}],"mask-image-radial-from-color":[{"mask-radial-from":m()}],"mask-image-radial-to-color":[{"mask-radial-to":m()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[g]}],"mask-image-conic-from-pos":[{"mask-conic-from":w()}],"mask-image-conic-to-pos":[{"mask-conic-to":w()}],"mask-image-conic-from-color":[{"mask-conic-from":m()}],"mask-image-conic-to-color":[{"mask-conic-to":m()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Le()}],"mask-repeat":[{mask:Fe()}],"mask-size":[{mask:Ve()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",d,c]}],filter:[{filter:["","none",d,c]}],blur:[{blur:Ue()}],brightness:[{brightness:[g,d,c]}],contrast:[{contrast:[g,d,c]}],"drop-shadow":[{"drop-shadow":["","none",G,Q,K]}],"drop-shadow-color":[{"drop-shadow":m()}],grayscale:[{grayscale:["",g,d,c]}],"hue-rotate":[{"hue-rotate":[g,d,c]}],invert:[{invert:["",g,d,c]}],saturate:[{saturate:[g,d,c]}],sepia:[{sepia:["",g,d,c]}],"backdrop-filter":[{"backdrop-filter":["","none",d,c]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[g,d,c]}],"backdrop-contrast":[{"backdrop-contrast":[g,d,c]}],"backdrop-grayscale":[{"backdrop-grayscale":["",g,d,c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g,d,c]}],"backdrop-invert":[{"backdrop-invert":["",g,d,c]}],"backdrop-opacity":[{"backdrop-opacity":[g,d,c]}],"backdrop-saturate":[{"backdrop-saturate":[g,d,c]}],"backdrop-sepia":[{"backdrop-sepia":["",g,d,c]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",d,c]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[g,"initial",d,c]}],ease:[{ease:["linear","initial",j,d,c]}],delay:[{delay:[g,d,c]}],animate:[{animate:["none",Z,d,c]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,d,c]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[d,c,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:m()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:m()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d,c]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d,c]}],fill:[{fill:["none",...m()]}],"stroke-w":[{stroke:[g,q,P,le]}],stroke:[{stroke:["none",...m()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function h(...e){return Ir(De(e))}const Mr={admin:"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300",manager:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300",viewer:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"};function Te({entity:e,isSelected:o=!1,onClick:t,className:s}){const a=e.entityType==="personal",i=a?x.User:x.Building2;return r.jsx("div",{onClick:t,className:h("rounded-lg border p-4 transition-all",t&&"cursor-pointer hover:border-primary",o&&"border-primary bg-primary/5",!o&&"border-border bg-card",s),children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:h("flex h-10 w-10 items-center justify-center rounded-full",a?"bg-blue-100 dark:bg-blue-900":"bg-purple-100 dark:bg-purple-900"),children:e.avatarUrl?r.jsx("img",{src:e.avatarUrl,alt:e.displayName,className:"h-10 w-10 rounded-full object-cover"}):r.jsx(i,{className:h("h-5 w-5",a?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400")})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-medium text-foreground truncate",children:e.displayName}),r.jsx("span",{className:h("text-xs px-2 py-0.5 rounded-full font-medium",Mr[e.userRole]),children:e.userRole})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a?"Personal workspace":"Organization"}),e.description&&r.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function Er({entities:e,selectedSlug:o,onSelect:t,isLoading:s=!1,emptyMessage:a="No workspaces found",className:i}){return s?r.jsx("div",{className:h("space-y-3",i),children:[1,2,3].map(n=>r.jsx("div",{className:"h-24 rounded-lg border border-border bg-muted animate-pulse"},n))}):e.length===0?r.jsx("div",{className:h("text-center py-8 text-muted-foreground",i),children:a}):r.jsx("div",{className:h("space-y-3",i),children:e.map(n=>r.jsx(Te,{entity:n,isSelected:n.entitySlug===o,onClick:t?()=>t(n):void 0},n.id))})}function Tr({entities:e,currentEntity:o,onSelect:t,onCreateNew:s,isLoading:a=!1,className:i}){const[n,p]=$.useState(!1),l=b=>{t(b),p(!1)},f=()=>{s?.(),p(!1)};return r.jsxs("div",{className:h("relative",i),children:[r.jsxs("button",{type:"button",onClick:()=>p(!n),disabled:a,className:h("flex items-center gap-2 px-3 py-2 rounded-lg border","bg-background hover:bg-muted transition-colors","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",a&&"opacity-50 cursor-not-allowed"),children:[o?r.jsxs(r.Fragment,{children:[o.entityType==="personal"?r.jsx(x.User,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}):r.jsx(x.Building2,{className:"h-4 w-4 text-purple-600 dark:text-purple-400"}),r.jsx("span",{className:"font-medium text-sm truncate max-w-[150px]",children:o.displayName})]}):r.jsx("span",{className:"text-sm text-muted-foreground",children:"Select workspace"}),r.jsx(x.ChevronDown,{className:h("h-4 w-4 text-muted-foreground transition-transform",n&&"rotate-180")})]}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>p(!1)}),r.jsx("div",{className:h("absolute top-full left-0 mt-1 z-50","min-w-[220px] rounded-lg border bg-popover shadow-lg","animate-in fade-in-0 zoom-in-95"),children:r.jsxs("div",{className:"p-1",children:[e.filter(b=>b.entityType==="personal").map(b=>r.jsx(Pe,{entity:b,isSelected:b.id===o?.id,onClick:()=>l(b)},b.id)),e.some(b=>b.entityType==="personal")&&e.some(b=>b.entityType==="organization")&&r.jsx("div",{className:"my-1 h-px bg-border"}),e.filter(b=>b.entityType==="organization").map(b=>r.jsx(Pe,{entity:b,isSelected:b.id===o?.id,onClick:()=>l(b)},b.id)),s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"my-1 h-px bg-border"}),r.jsxs("button",{type:"button",onClick:f,className:h("flex items-center gap-2 w-full px-2 py-1.5 rounded","text-sm text-primary hover:bg-muted transition-colors"),children:[r.jsx(x.Plus,{className:"h-4 w-4"}),r.jsx("span",{children:"Create organization"})]})]})]})})]})]})}function Pe({entity:e,isSelected:o,onClick:t}){const s=e.entityType==="personal",a=s?x.User:x.Building2;return r.jsxs("button",{type:"button",onClick:t,className:h("flex items-center gap-2 w-full px-2 py-1.5 rounded","text-sm transition-colors",o?"bg-primary/10 text-primary":"hover:bg-muted text-foreground"),children:[r.jsx(a,{className:h("h-4 w-4",s?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400")}),r.jsx("span",{className:"flex-1 text-left truncate",children:e.displayName}),o&&r.jsx(x.Check,{className:"h-4 w-4"})]})}const ie=[{value:J.EntityRole.ADMIN,label:"Admin",description:"Full access to all settings and members",icon:x.Shield,color:"text-purple-600 dark:text-purple-400"},{value:J.EntityRole.MANAGER,label:"Manager",description:"Can manage projects and API keys",icon:x.Briefcase,color:"text-blue-600 dark:text-blue-400"},{value:J.EntityRole.VIEWER,label:"Viewer",description:"Read-only access",icon:x.Eye,color:"text-gray-600 dark:text-gray-400"}];function ce({value:e,onChange:o,disabled:t=!1,className:s}){const[a,i]=$.useState(!1),n=ie.find(l=>l.value===e)||ie[2],p=l=>{o(l),i(!1)};return r.jsxs("div",{className:h("relative",s),children:[r.jsxs("button",{type:"button",onClick:()=>!t&&i(!a),disabled:t,className:h("flex items-center gap-1.5 px-2 py-1 rounded border text-sm","bg-background transition-colors",t?"opacity-50 cursor-not-allowed":"hover:bg-muted cursor-pointer"),children:[r.jsx(n.icon,{className:h("h-3.5 w-3.5",n.color)}),r.jsx("span",{children:n.label}),r.jsx(x.ChevronDown,{className:h("h-3.5 w-3.5 text-muted-foreground transition-transform",a&&"rotate-180")})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>i(!1)}),r.jsx("div",{className:h("absolute top-full right-0 mt-1 z-50","min-w-[200px] rounded-lg border bg-popover shadow-lg p-1","animate-in fade-in-0 zoom-in-95"),children:ie.map(l=>r.jsxs("button",{type:"button",onClick:()=>p(l.value),className:h("flex items-start gap-2 w-full px-2 py-2 rounded text-left","transition-colors",l.value===e?"bg-primary/10":"hover:bg-muted"),children:[r.jsx(l.icon,{className:h("h-4 w-4 mt-0.5",l.color)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-medium text-sm",children:l.label}),l.value===e&&r.jsx(x.Check,{className:"h-3.5 w-3.5 text-primary"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]})]},l.value))})]})]})}const Pr={admin:"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300",manager:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300",viewer:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"};function Gr({members:e,currentUserId:o,canManage:t=!1,onRoleChange:s,onRemove:a,isLoading:i=!1,emptyMessage:n="No members found",className:p}){return i?r.jsx("div",{className:h("space-y-2",p),children:[1,2,3].map(l=>r.jsx("div",{className:"h-16 rounded-lg border border-border bg-muted animate-pulse"},l))}):e.length===0?r.jsx("div",{className:h("text-center py-8 text-muted-foreground",p),children:n}):r.jsx("div",{className:h("divide-y divide-border rounded-lg border",p),children:e.map(l=>r.jsx(Or,{member:l,isSelf:l.userId===o,canManage:t,onRoleChange:s,onRemove:a},l.id))})}function Or({member:e,isSelf:o,canManage:t,onRoleChange:s,onRemove:a}){const i=e.user?.displayName||e.user?.email||"Unknown user",n=e.user?.email;return r.jsxs("div",{className:"flex items-center gap-3 p-3",children:[r.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:r.jsx(x.User,{className:"h-5 w-5 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-medium text-foreground truncate",children:i}),o&&r.jsx("span",{className:"text-xs text-muted-foreground",children:"(you)"})]}),n&&r.jsx("p",{className:"text-sm text-muted-foreground truncate",children:n})]}),t&&s&&!o?r.jsx(ce,{value:e.role,onChange:p=>s(e.userId,p)}):r.jsx("span",{className:h("text-xs px-2 py-1 rounded-full font-medium",Pr[e.role]),children:e.role}),t&&a&&!o&&r.jsx("button",{type:"button",onClick:()=>a(e.userId),className:h("p-1.5 rounded hover:bg-destructive/10 text-muted-foreground","hover:text-destructive transition-colors"),title:"Remove member",children:r.jsx(x.Trash2,{className:"h-4 w-4"})})]})}function jr({onSubmit:e,isSubmitting:o=!1,defaultRole:t=J.EntityRole.VIEWER,className:s}){const[a,i]=$.useState(""),[n,p]=$.useState(t),[l,f]=$.useState(null),b=async v=>{if(v.preventDefault(),f(null),!a.trim()){f("Email is required");return}if(!Lr(a)){f("Please enter a valid email address");return}try{await e({email:a.trim(),role:n}),i(""),p(t)}catch(S){f(S.message||"Failed to send invitation")}};return r.jsxs("form",{onSubmit:b,className:h("space-y-4",s),children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(x.Mail,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx("input",{type:"email",value:a,onChange:v=>i(v.target.value),placeholder:"Enter email address",disabled:o,className:h("w-full pl-10 pr-3 py-2 rounded-lg border bg-background","text-sm placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",l&&"border-destructive focus:ring-destructive",o&&"opacity-50 cursor-not-allowed")})]}),r.jsx(ce,{value:n,onChange:p,disabled:o}),r.jsxs("button",{type:"submit",disabled:o||!a.trim(),className:h("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",(o||!a.trim())&&"opacity-50 cursor-not-allowed"),children:[o?r.jsx(x.Loader2,{className:"h-4 w-4 animate-spin"}):r.jsx(x.Send,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Invite"})]})]}),l&&r.jsx("p",{className:"text-sm text-destructive",children:l})]})}function Lr(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}const Fr={admin:"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300",manager:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300",viewer:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"};function Vr({invitations:e,mode:o,onCancel:t,onAccept:s,onDecline:a,isLoading:i=!1,emptyMessage:n="No pending invitations",className:p}){const l=e.filter(f=>f.status==="pending");return i?r.jsx("div",{className:h("space-y-2",p),children:[1,2].map(f=>r.jsx("div",{className:"h-16 rounded-lg border border-border bg-muted animate-pulse"},f))}):l.length===0?r.jsx("div",{className:h("text-center py-8 text-muted-foreground",p),children:n}):r.jsx("div",{className:h("divide-y divide-border rounded-lg border",p),children:l.map(f=>r.jsx(Br,{invitation:f,mode:o,onCancel:t,onAccept:s,onDecline:a},f.id))})}function Br({invitation:e,mode:o,onCancel:t,onAccept:s,onDecline:a}){const i=new Date(e.expiresAt),n=i<new Date,p=Math.ceil((i.getTime()-Date.now())/(1e3*60*60*24));return r.jsxs("div",{className:"flex items-center gap-3 p-3",children:[r.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:r.jsx(x.Mail,{className:"h-5 w-5 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[o==="user"&&e.entity?r.jsx("p",{className:"font-medium text-foreground truncate",children:e.entity.displayName}):r.jsx("p",{className:"font-medium text-foreground truncate",children:e.email}),r.jsx("span",{className:h("text-xs px-2 py-0.5 rounded-full font-medium",Fr[e.role]),children:e.role})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[r.jsx(x.Clock,{className:"h-3.5 w-3.5"}),n?r.jsx("span",{className:"text-destructive",children:"Expired"}):r.jsxs("span",{children:["Expires in ",p," days"]})]})]}),o==="admin"&&t&&r.jsx("button",{type:"button",onClick:()=>t(e.id),className:h("p-1.5 rounded hover:bg-destructive/10 text-muted-foreground","hover:text-destructive transition-colors"),title:"Cancel invitation",children:r.jsx(x.XCircle,{className:"h-4 w-4"})}),o==="user"&&r.jsxs("div",{className:"flex items-center gap-2",children:[a&&r.jsxs("button",{type:"button",onClick:()=>a(e.token),className:h("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm","border hover:bg-muted transition-colors"),children:[r.jsx(x.X,{className:"h-4 w-4"}),r.jsx("span",{children:"Decline"})]}),s&&r.jsxs("button",{type:"button",onClick:()=>s(e.token),disabled:n,className:h("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm","bg-primary text-primary-foreground","hover:bg-primary/90 transition-colors",n&&"opacity-50 cursor-not-allowed"),children:[r.jsx(x.Check,{className:"h-4 w-4"}),r.jsx("span",{children:"Accept"})]})]})]})}k.EntityCard=Te,k.EntityList=Er,k.EntitySelector=Tr,k.InvitationForm=jr,k.InvitationList=Vr,k.MemberList=Gr,k.MemberRoleSelector=ce,k.cn=h,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sudobility/entity-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Entity/Organization UI components for React",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.umd.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.esm.js",
|
|
13
|
+
"require": "./dist/index.umd.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc && vite build",
|
|
22
|
+
"dev": "vite build --watch",
|
|
23
|
+
"type-check": "tsc --noEmit",
|
|
24
|
+
"lint": "eslint src/",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"react",
|
|
30
|
+
"components",
|
|
31
|
+
"entity",
|
|
32
|
+
"organization",
|
|
33
|
+
"workspace",
|
|
34
|
+
"members",
|
|
35
|
+
"invitations",
|
|
36
|
+
"typescript"
|
|
37
|
+
],
|
|
38
|
+
"author": "John Q Huang",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@sudobility/components": "^4.0.36",
|
|
42
|
+
"@sudobility/design": "^1.1.14",
|
|
43
|
+
"@sudobility/types": "^1.9.37",
|
|
44
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
45
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/js": "^9.38.0",
|
|
49
|
+
"ajv": "^8.17.1",
|
|
50
|
+
"@sudobility/components": "^4.0.36",
|
|
51
|
+
"@sudobility/design": "^1.1.14",
|
|
52
|
+
"@sudobility/types": "^1.9.37",
|
|
53
|
+
"@testing-library/dom": "^10.4.0",
|
|
54
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
55
|
+
"@testing-library/react": "^16.0.0",
|
|
56
|
+
"@types/node": "^24.7.1",
|
|
57
|
+
"@types/react": "^19.2.2",
|
|
58
|
+
"@types/react-dom": "^19.2.2",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
60
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
61
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
62
|
+
"class-variance-authority": "^0.7.1",
|
|
63
|
+
"clsx": "^2.1.1",
|
|
64
|
+
"eslint": "^9.38.0",
|
|
65
|
+
"eslint-config-prettier": "^10.1.8",
|
|
66
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
67
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
68
|
+
"eslint-plugin-react-refresh": "^0.4.0",
|
|
69
|
+
"jsdom": "^24.0.0",
|
|
70
|
+
"lucide-react": "^0.511.0",
|
|
71
|
+
"prettier": "^3.6.2",
|
|
72
|
+
"react": "^19.2.0",
|
|
73
|
+
"react-dom": "^19.2.0",
|
|
74
|
+
"tailwind-merge": "^3.3.1",
|
|
75
|
+
"typescript": "^5.9.3",
|
|
76
|
+
"vite": "^7.1.12",
|
|
77
|
+
"vite-plugin-dts": "^4.5.4",
|
|
78
|
+
"vitest": "^1.3.1"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
82
|
+
},
|
|
83
|
+
"optionalDependencies": {
|
|
84
|
+
"@rollup/rollup-linux-x64-gnu": "4.52.5",
|
|
85
|
+
"@rollup/rollup-linux-x64-musl": "4.52.5"
|
|
86
|
+
}
|
|
87
|
+
}
|