@simple-parlay/components 2.2.0 → 2.2.1
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/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -6
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +4 -5
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.mjs +4 -5
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -431,11 +431,10 @@ return g("div",{style:{display:"flex",gap:8,flexShrink:0,width:t?"100%":void 0},
|
|
|
431
431
|
return g("div",{className:"bsk-root",role:"status","aria-live":"polite","aria-label":"Loading picks","data-testid":`skeleton-picks-${s}`,children:[/* @__PURE__ */g("div",{"aria-hidden":!0,className:"dense"===s?void 0:"space-y-4 sm:space-y-6 pb-16",children:["dense"!==s&&(()=>{if(void 0===n)return null;if(n<2)return z();const t="shelf"===d.pages.picks,i=Math.min(n,5);/* @__PURE__ */
|
|
432
432
|
return g("div",{className:"min-w-0",children:[!t&&/* @__PURE__ */g("div",{className:"min-w-0 max-w-full",children:[N(14,1.25,112),N(12,1.375,96,0,6)]}),"chips"===d.sportRail?/* @__PURE__ */g(h,{children:[r&&/* @__PURE__ */g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:6},children:[N(12,1.375,104),k({width:Rn.height.md,height:Rn.height.md,borderRadius:Tt(e,Rn.radius)})]}),P([104,60,60,60,60].slice(0,i))]}):/* @__PURE__ */u("div",{className:"border p-[5px]",style:{borderRadius:Tt(e,999),backgroundColor:c.backgroundAlt??c.background??"#fff",borderColor:c.border,boxShadow:`inset 0 1px 2px ${St(c.text,.06)}`},children:/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:Array.from({length:i},(t,n)=>/* @__PURE__ */u(ss,{color:m,style:{flex:"1 1 0",height:33,borderRadius:Tt(e,999)}},n))})}),r&&"chips"!==d.sportRail&&/* @__PURE__ */u("div",{className:"mt-2.5",children:z()})]})})(),L]}),/* @__PURE__ */u("style",{children:".bsk-root{container-type:inline-size}.bsk-narrow{display:block}@container (min-width:480px){.bsk-narrow{display:none}}"})]})}function qd({matchup:e,renderTeamLogo:t,altText:n,mutedColor:r,size:i="sm"}){const[o,a=""]=e.split(" vs "),l="md"===i?"text-sm sm:text-base":"text-sm";if(!(a.length>0))/* @__PURE__ */return u("span",{className:`font-semibold ${l} leading-snug break-words`,style:{color:n},children:e});const s=(e,n)=>/* @__PURE__ */g("span",{className:`inline-flex items-center gap-1 leading-snug min-w-0 max-w-full ${n}`,children:[t?.(e),/* @__PURE__ */u("span",{className:"break-words min-w-0",children:e})]});/* @__PURE__ */
|
|
433
433
|
return g("span",{className:`font-semibold ${l} grid grid-cols-[auto_1fr] items-center gap-x-1.5 min-w-0 max-w-full sm:flex sm:flex-wrap sm:items-center`,style:{color:n},children:[s(o,"col-start-2 row-start-1"),
|
|
434
|
-
/* @__PURE__ */u("span",{className:"text-xs font-normal flex-shrink-0 col-start-1 row-start-1 row-span-2 self-center",style:{color:r},children:"vs"}),s(a,"col-start-2 row-start-2")]})}function Xd({game:t,propositions:n,selections:r,onToggleSelection:i,onNext:l,onBack:s,loading:c,error:p,theme:m,colorScheme:f,hideActions:x=!1,initialSport:y,renderTeamLogo:b,disableQuickPick:v=!1,selectedPropositionCount:w,onPropositionCountChange:k,gameCategory:N,headerExtra:C,railSlot:S,variant:M,disableEventSwipe:P}){const z=o(Eo),A=Di(t),B=A&&z&&!Tn(z.uiVariant)?Yi(z.correlation,Object.keys(r).length):null,T=z?.sportBaseKey,F=z?.compositeComponentById,L=M??z?.selectionVariant??("playbook"===z?.uiVariant?"shelf":z?.uiVariant&&"default"!==z.uiVariant?z.uiVariant:void 0),W=P??z?.disableEventSwipe??!1,j=fn(m,f),R=j.colors,H=La(j),D=H.colors,I=Vt(j),U=Qt(j),E=R.matchupHeader??(t.color?St(t.color,.14):Jt(j))
|
|
435
|
-
return g("div",{className:bn(z?.uiVariant)?"relative":"relative space-y-4 sm:space-y-6 pb-16",style:{fontFamily:
|
|
436
|
-
return g("div",{className:"
|
|
437
|
-
return
|
|
438
|
-
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:U,opacity:s?.45:1,borderTop:n?`1px solid ${R.border}`:void 0},children:/* @__PURE__ */g("div",{className:"flex flex-wrap justify-between items-center gap-x-2 gap-y-2 sm:gap-4",children:[/* @__PURE__ */g("div",{className:"flex-1 min-w-0 flex items-start gap-2",style:{minWidth:"8rem"},children:[Xs(t,b,e),/* @__PURE__ */u(Qs,{id:t.id,kind:"text",children:/* @__PURE__ */u(Js,{prop:t,colors:R,size:"md",componentById:F,renderTeamLogo:b,theme:j})})]}),/* @__PURE__ */u(Qs,{id:t.id,kind:"answers",children:/* @__PURE__ */u(_n,{yesDisabled:!(i||!z?.canSelectAnswer||z.canSelectAnswer(t.id,"yes")),noDisabled:!(i||!z?.canSelectAnswer||z.canSelectAnswer(t.id,"no")),theme:j,size:"sm",value:o?"yes":a?"no":null,onYes:()=>i?z?.swapSelection(t.id,"yes",i()):he(t.id,"yes"),onNo:()=>i?z?.swapSelection(t.id,"no",i()):he(t.id,"no"),disabled:s})})]})},t.id)},o=_(t);return o.some(e=>e.family)?o.map(e=>/* @__PURE__ */u(Rd,{theme:j,group:e,selections:r,caps:me,game:z?.selectedGame,pool:n,componentById:F,pickOrder:z?.pickOrder,rowsBackground:U,renderRow:i},e.family??"other")):t.map(e=>i(e,{top:!1}))})()})]},e)})}),0===n.length&&!(A&&z?.correlation.loading)&&/* @__PURE__ */u("div",{className:"text-center p-8",style:{color:D.textMuted},children:"No propositions available at this time"}),!x&&/* @__PURE__ */g("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:R.border,backgroundColor:I},children:[/* @__PURE__ */u(Gn,{theme:j,size:"lg",variant:"secondary",onPress:s,children:"Back"}),/* @__PURE__ */u("div",{className:"flex items-center gap-2 sm:gap-3",children:/* @__PURE__ */u(Gn,{theme:j,size:"lg",disabled:!de,onPress:l,children:"Wager"})})]})]})}function Vd({propositions:e,selections:t,onToggleSelection:n,onNext:r,onBack:i,theme:o,colorScheme:a,hideActions:l=!1,renderTeamLogo:s,allowAnswerToggle:d=!0,gameName:c,potentialPayout:m,defaultExpanded:f=!1,componentById:x,addMorePicks:y}){const b="shelf"===Nn(),v=fn(o,a),w=v.colors,k=Vt(v),N=Fn(v),C=Ln(v),S=Rt(v),M=w.textAlt??w.text,P=w.matchupHeader??Jt(v),z=Qt(v),[A,B]=p(f),T=e.filter(e=>e.id in t),F=T.length,L=kt(T);/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */u("span",{className:"text-xs font-normal flex-shrink-0 col-start-1 row-start-1 row-span-2 self-center",style:{color:r},children:"vs"}),s(a,"col-start-2 row-start-2")]})}function Xd({game:t,propositions:n,selections:r,onToggleSelection:i,onNext:l,onBack:s,loading:c,error:p,theme:m,colorScheme:f,hideActions:x=!1,initialSport:y,renderTeamLogo:b,disableQuickPick:v=!1,selectedPropositionCount:w,onPropositionCountChange:k,gameCategory:N,headerExtra:C,railSlot:S,variant:M,disableEventSwipe:P}){const z=o(Eo),A=Di(t),B=A&&z&&!Tn(z.uiVariant)?Yi(z.correlation,Object.keys(r).length):null,T=z?.sportBaseKey,F=z?.compositeComponentById,L=M??z?.selectionVariant??("playbook"===z?.uiVariant?"shelf":z?.uiVariant&&"default"!==z.uiVariant?z.uiVariant:void 0),W=P??z?.disableEventSwipe??!1,j=fn(m,f),R=j.colors,H=La(j),D=H.colors,I=Vt(j),U=Qt(j),E=R.matchupHeader??(t.color?St(t.color,.14):Jt(j));R.textAlt??R.text;const O=Lt(j),Y=Fn(j);Ln(j),Rt(j);const G=!!(t.allowed_propositions&&t.allowed_propositions.length>0),{min:q,max:V}=Je(t,w),J=q,Q=V,[K,$]=e.useState(()=>new Set(Object.keys(wt(n,N,T)))),ee=J>0&&J===Q,te=J||1,ne=Q||n.length,re=Q||J||n.length,[ie,oe]=e.useState(re),ae=Object.keys(r).length,le=Q>0&&ae>=Q,se=G?null!=w&&ae===w:Xe(ae,t.min_propositions,t.max_propositions);t.min_bet,Q>0?Math.max(2,2*Q):Math.max(2,2*ae);const de=e.useRef(ae),ce=G?null!=w&&ae===w:Q>0&&ae===Q;a(()=>{!A&&ce&&ae>de.current&&l?.(),de.current=ae},[ae,ce]);const pe=d(()=>Z(n,r,F,t),[n,r,F,t]);d(()=>n.some(e=>null!==X(e)),[n]);const me=(e,t)=>{if(e in r)return void i(e,t);if(le)return;const o=n.find(t=>t.id===e);o&&!A&&pe.isCapped(o)||i(e,t)};a(()=>{const e=Q||n.length,t=J||1;oe(n=>ee?Q:Math.max(t,Math.min(n,e)))},[n.length,J,Q,ee]);const he=d(()=>Ke(N,n,T),[N,n,T]),ue=d(()=>wt(n,N,T),[n,N,T]),ge=Object.keys(ue);if(e.useEffect(()=>{const e=Object.keys(ue);e.length>0&&$(t=>e.every(e=>t.has(e))?t:new Set(e))},[ue]),c)/* @__PURE__ */return u(Gd,{theme:j,variant:L,sports:S?z?.sportOptions.length??0:void 0,actions:!!C,headerBg:E,shadow:O,logos:!!b,swipe:!W});if(p)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:Y},children:/* @__PURE__ */u("div",{style:{color:R.error},children:p})});const fe=!v&&n.length>0;/* @__PURE__ */
|
|
435
|
+
return g("div",{className:bn(z?.uiVariant)?"relative":"relative space-y-4 sm:space-y-6 pb-16",style:{fontFamily:Y},children:[(()=>{const e=C?/* @__PURE__ */u("div",{className:"flex w-full min-w-0 items-center gap-2",children:C}):null;return e||S?"function"==typeof S?S(e):/* @__PURE__ */g("div",{className:"flex flex-col gap-2.5",children:[S,e]}):null})(),fe&&/* @__PURE__ */u("div",{className:"flex flex-wrap items-center justify-end gap-2",children:/* @__PURE__ */g("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[!ee&&/* @__PURE__ */g("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */u("input",{type:"number",min:te,max:ne,value:ie,onChange:e=>{const t=parseInt(e.target.value,10);isNaN(t)||oe(Math.max(te,Math.min(ne,t)))},"aria-label":"QuickPick count",...On(H,D.border),className:"w-10 sm:w-14 px-1 sm:px-2 py-1 sm:py-1.5 text-xs sm:text-sm font-semibold text-center",style:{borderRadius:Tt(j,8),color:D.textAlt??D.text,backgroundColor:D.backgroundAlt,border:`2px solid ${D.border}`,outline:"none"}}),/* @__PURE__ */g("span",{className:"text-xs whitespace-nowrap",style:{color:D.textMuted},children:["/ ",n.length]})]}),/* @__PURE__ */u(Cl,{onPress:()=>{const e=ee?Q:ie;for(const n of Object.keys(r)){const e=Number(n);i(e,r[e])}const{yesPicks:t,noPicks:o}=function(e,t){const n=[...e].sort(()=>Math.random()-.5).slice(0,t),r=[],i=[];for(const o of n)Math.random()<.5?r.push(o):i.push(o);return{yesPicks:r,noPicks:i}}(n,e);for(const n of t)i(n.id,"yes");for(const n of o)i(n.id,"no");l?.()}})]})}),"recalculating"===B&&/* @__PURE__ */u("span",{role:"status","data-testid":"correlation-loading",className:"sr-only",children:"Updating your picks…"}),"stuck"===B&&/* @__PURE__ */u("div",{className:"fixed inset-x-0 top-4 z-50 flex justify-center px-4 pointer-events-none",children:/* @__PURE__ */u("div",{role:"status","data-testid":"correlation-stuck",className:"px-5 py-3 text-sm font-semibold text-center",style:{borderRadius:Tt(j,16),maxWidth:360,backgroundColor:R.warningBg,color:R.warningText,border:`1px solid ${R.warning}`,boxShadow:"0 12px 36px rgba(0,0,0,0.22)"},children:Gi})}),n.length>0&&L&&/* @__PURE__ */u(Dd,{variant:L,groups:ue,racing:he,selections:r,onToggleSelection:me,atMax:le,theme:j,renderTeamLogo:b,componentById:F,disableEventSwipe:W}),n.length>0&&!L&&/* @__PURE__ */u("div",{className:"space-y-4",children:ge.map(e=>{const t=ue[e],i=K.has(e),o=t.filter(e=>e.id in r).length,a=t[0]?.commence_time;/* @__PURE__ */
|
|
436
|
+
return g("div",{className:"border overflow-hidden",style:{borderRadius:Tt(j,12),borderColor:R.border,backgroundColor:I,boxShadow:O},children:[/* @__PURE__ */u("button",{type:"button","aria-expanded":i,onClick:()=>{return t=e,$(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},className:"w-full block p-0 border-0 text-left transition-colors",style:{backgroundColor:E,cursor:"pointer"},children:/* @__PURE__ */u(Fd,{inButton:!0,theme:j,title:e,...Nd(e,he),racing:he,date:a?new Date(a):null,renderTeamLogo:b,trailing:/* @__PURE__ */g(h,{children:[o>0&&/* @__PURE__ */g("span",{className:"text-xs px-2 py-0.5 font-medium",style:{borderRadius:Tt(j,999),color:R.successText,backgroundColor:R.successBg},children:[o,"/",t.length]}),/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",style:{color:R.textAltMuted??R.textMuted,transform:i?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},"aria-hidden":!0,children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})})]})})}),i&&/* @__PURE__ */u("div",{className:"divide-y",style:{borderColor:R.border},children:(()=>{const i=(t,{top:n,swap:i})=>{const o="yes"===r[t.id],a="no"===r[t.id],l=t.id in r,s=!i&&(le&&!l||!A&&pe.isCapped(t));/* @__PURE__ */
|
|
437
|
+
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:U,opacity:s?.45:1,borderTop:n?`1px solid ${R.border}`:void 0},children:/* @__PURE__ */g("div",{className:"flex flex-wrap justify-between items-center gap-x-2 gap-y-2 sm:gap-4",children:[/* @__PURE__ */g("div",{className:"flex-1 min-w-0 flex items-start gap-2",style:{minWidth:"8rem"},children:[Xs(t,b,e),/* @__PURE__ */u(Qs,{id:t.id,kind:"text",children:/* @__PURE__ */u(Js,{prop:t,colors:R,size:"md",componentById:F,renderTeamLogo:b,theme:j})})]}),/* @__PURE__ */u(Qs,{id:t.id,kind:"answers",children:/* @__PURE__ */u(_n,{yesDisabled:!(i||!z?.canSelectAnswer||z.canSelectAnswer(t.id,"yes")),noDisabled:!(i||!z?.canSelectAnswer||z.canSelectAnswer(t.id,"no")),theme:j,size:"sm",value:o?"yes":a?"no":null,onYes:()=>i?z?.swapSelection(t.id,"yes",i()):me(t.id,"yes"),onNo:()=>i?z?.swapSelection(t.id,"no",i()):me(t.id,"no"),disabled:s})})]})},t.id)},o=_(t);return o.some(e=>e.family)?o.map(e=>/* @__PURE__ */u(Rd,{theme:j,group:e,selections:r,caps:pe,game:z?.selectedGame,pool:n,componentById:F,pickOrder:z?.pickOrder,rowsBackground:U,renderRow:i},e.family??"other")):t.map(e=>i(e,{top:!1}))})()})]},e)})}),0===n.length&&!(A&&z?.correlation.loading)&&/* @__PURE__ */u("div",{className:"text-center p-8",style:{color:D.textMuted},children:"No propositions available at this time"}),!x&&/* @__PURE__ */g("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:R.border,backgroundColor:I},children:[/* @__PURE__ */u(Gn,{theme:j,size:"lg",variant:"secondary",onPress:s,children:"Back"}),/* @__PURE__ */u("div",{className:"flex items-center gap-2 sm:gap-3",children:/* @__PURE__ */u(Gn,{theme:j,size:"lg",disabled:!se,onPress:l,children:"Wager"})})]})]})}function Vd({propositions:e,selections:t,onToggleSelection:n,onNext:r,onBack:i,theme:o,colorScheme:a,hideActions:l=!1,renderTeamLogo:s,allowAnswerToggle:d=!0,gameName:c,potentialPayout:m,defaultExpanded:f=!1,componentById:x,addMorePicks:y}){const b="shelf"===Nn(),v=fn(o,a),w=v.colors,k=Vt(v),N=Fn(v),C=Ln(v),S=Rt(v),M=w.textAlt??w.text,P=w.matchupHeader??Jt(v),z=Qt(v),[A,B]=p(f),T=e.filter(e=>e.id in t),F=T.length,L=kt(T);/* @__PURE__ */
|
|
439
438
|
return g("div",{className:"space-y-4 sm:space-y-6 pb-16",style:{fontFamily:N},children:[
|
|
440
439
|
/* @__PURE__ */g("div",{className:"p-4 sm:p-6 border",style:{borderRadius:Tt(v,12),backgroundColor:k,borderColor:w.border,boxShadow:Lt(v)},children:[
|
|
441
440
|
/* @__PURE__ */g("button",{type:"button",onClick:()=>B(e=>!e),"aria-expanded":A,"aria-controls":"selection-review-list",className:"w-full flex items-center justify-between gap-3 text-left",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit"},children:[/* @__PURE__ */g("div",{className:"flex items-center gap-2 min-w-0",children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:w.textMuted,flexShrink:0,transform:A?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */g("div",{className:"min-w-0",children:[/* @__PURE__ */g("h3",{className:"text-base sm:text-lg font-semibold flex items-center gap-2",style:{color:S,fontFamily:C},children:[/* @__PURE__ */u("span",{children:"Your Selections"}),/* @__PURE__ */u("span",{className:"text-xs font-semibold px-1.5 py-0.5",style:{borderRadius:Tt(v,999),color:w.primaryText,backgroundColor:w.primary},children:F})]}),c&&/* @__PURE__ */u("p",{className:"text-sm mt-0.5 truncate",style:{color:w.textMuted},children:c})]})]}),null!=m&&m>0&&/* @__PURE__ */g("div",{className:"text-right flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[10px] uppercase tracking-wide block",style:{color:w.textMuted},children:"Potential Payout"}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:S},children:He(m)})]})]}),y&&y.remaining>0&&/* @__PURE__ */g("div",{className:"mt-3 sm:mt-4 p-3 flex items-center justify-between gap-3",style:{borderRadius:Tt(v,8),backgroundColor:`${w.primary}12`},children:[/* @__PURE__ */g("p",{className:"text-xs",style:{color:w.textMuted},children:[1===y.remaining?"Add ":"Add up to ",
|