fansunited-management-components 1.50.1 → 1.50.3

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/index.es.js CHANGED
@@ -35948,7 +35948,7 @@ const Iy = Qe(/* @__PURE__ */ u.jsx("path", {
35948
35948
  data-poll-url="${s}"` : "", x = d ? Math.min(50, Math.max(1, d)) : 1, b = h ? Math.min(5, Math.max(1, h)) : 1, I = `
35949
35949
  data-items-count="${x}"`, A = `
35950
35950
  data-items-per-row="${b}"`, E = `
35951
- data-widget-model="${m}"`, _ = `<div
35951
+ data-widget-mode="${m}"`, _ = `<div
35952
35952
  data-component="fu-widget"
35953
35953
  data-content-type="list"${v}${w}${C}${y}${I}${A}${E}
35954
35954
  ></div>`, H = ({ title: N }) => /* @__PURE__ */ u.jsx(Oe, { title: N, sx: { maxWidth: 300 }, children: /* @__PURE__ */ u.jsx(vi, { color: "primary" }) }), $ = () => /* @__PURE__ */ u.jsxs(pn, { sx: { pb: 1, mb: 3 }, children: [
package/index.umd.js CHANGED
@@ -2487,7 +2487,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2487
2487
  data-poll-url="${l}"`:"",w=d?Math.min(50,Math.max(1,d)):1,y=h?Math.min(5,Math.max(1,h)):1,A=`
2488
2488
  data-items-count="${w}"`,E=`
2489
2489
  data-items-per-row="${y}"`,_=`
2490
- data-widget-model="${m}"`,D=`<div
2490
+ data-widget-mode="${m}"`,D=`<div
2491
2491
  data-component="fu-widget"
2492
2492
  data-content-type="list"${v}${S}${I}${x}${A}${E}${_}
2493
2493
  ></div>`,G=({title:j})=>u.jsx(b.Tooltip,{title:j,sx:{maxWidth:300},children:u.jsx(ni,{color:"primary"})}),F=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xn,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.quizzesInfoMessage}),onChange:j=>o(j.target.value)}),u.jsx(xn,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:j=>s(j.target.value)}),u.jsx(xn,{label:t.pollURL,placeholder:"",defaultValue:l,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.pollsInfoMessage}),onChange:j=>c(j.target.value)})]}),T=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:d,onChange:j=>f(j||null),size:"md"}),u.jsx(xu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:j=>p(j||null),size:"md"}),u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:t.mode}),u.jsx(b.Select,{defaultValue:m,onChange:(j,Y)=>g(Y),children:hF.map((j,Y)=>u.jsx(b.Option,{value:j,children:pF[j]},`basic-select-${j}-${Y}`))}),u.jsx(b.FormHelperText,{children:t.modeDescription})]})]});return u.jsxs(b.Box,{mt:1,children:[T(),u.jsx(fs,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:j=>{j===!1&&(o(""),s(""),c("")),r(j)}}),n&&F(),u.jsxs(b.Box,{position:"relative",mb:1,children:[u.jsx(b.Textarea,{value:D,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:j=>j.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),u.jsx(b.Tooltip,{title:t.copyToClipboard,children:u.jsx(b.Button,{onClick:()=>{navigator.clipboard.writeText(D)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:u.jsx(Oe.ContentCopy,{})})})]}),u.jsx(b.Alert,{variant:"outlined",color:"primary",startDecorator:u.jsx(ni,{}),sx:{mb:1,width:"fit-content"},children:u.jsxs(b.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,u.jsx(b.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},db=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],mF={Login:qR,InformationInput:xn,RichText:dc,HeaderButtons:SP,MarketSelection:uL,Accordion:fT,DynamicFields:jP,BasicSelect:pT,BooleanSwitch:fs,Branding:IP,ProfileSearchSelect:DM,RangeCalendar:FP,CompetitionSearchSelect:_M,Related:pL,Images:AR,Duration:NP,DatePickerComponent:no,Flags:CR,Spinner:ds,Tags:Rm,Toast:at,AdContent:hT,Match:dL,Winners:xB,CompetitionsSearchSelect:PM,TeamsSearchSelect:OM,CustomSelect:PL,Schedule:IL,NoPermissionCard:zP,CustomFlatpickrCalendar:qc,ContextSelectFilter:wB,NumberInput:xu,EntityContext:e$,MiniGamesImages:n$,AuthRequirement:r$,SortableList:YN,ItemsPerPageFilter:KN,ImageCard:lo,RelatedRelationship:lF,ExportUsersLeads:cF,SignOutButton:sg,BasicSortableList:dF,WidgetEmbedCode:fF,WidgetListEmbedCode:gF,AdvancedProfileSearchSelect:({labels:e,ids:t,onChange:n})=>{const[r,i]=C.useState([]),[o,a]=C.useState([]),[s,l]=C.useState(""),[c,d]=C.useState("name"),[f,h]=C.useState(!1),[p,m]=C.useState(!1),{sdk:g}=ft(),v=!0,S=()=>m(!p),I=(A,E)=>{i(E);const _=E.map(D=>D.id);n(_&&_.length?_:null)},x=3;C.useEffect(()=>{!s&&t&&t.length&&g.profile.getByIds(t,void 0,v).then(A=>{i(db(A))}).catch(A=>{S(),console.error(A),i([])})},[]);const w=C.useMemo(()=>Sr((A,E)=>{h(!0),g.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,v).then(_=>{a([...db(_)]),h(!1)}).catch(_=>{console.error(_),S(),a([]),h(!1)})},300),[]);C.useEffect(()=>{if(!s||s.length<x){a([]);return}return w(s,c),()=>w.cancel()},[s,w,c]);const y=(A,E)=>A.map((_,D)=>{var G;return u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:F=>E({index:D}).onClick(F),children:u.jsx(Oe.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=_.avatar)!=null?G:st.avatar}),u.jsx(b.Typography,{children:_.label})]})},_.id)});return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:f,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:u.jsxs(u.Fragment,{children:[f&&u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),u.jsx(b.Divider,{orientation:"vertical"}),u.jsxs(b.Select,{variant:"plain",value:c,onChange:(A,E)=>d(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[u.jsx(b.Option,{value:"name",children:e.searchByName}),u.jsx(b.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(_=>_.value===E.value)),onInputChange:(A,E)=>{l(E)},onChange:I,getOptionKey:A=>A.id,value:r,renderTags:y,renderOption:(A,E)=>{var _;return u.jsx(b.AutocompleteOption,Q(N({},A),{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(_=E.avatar)!=null?_:st.avatar}),u.jsx(b.Typography,{children:E.label})]})}))}})}),u.jsx(at,{showToast:p,message:e.searchProfilesErrorMessage,color:"danger",hideToast:S})]})},FormatNumber:({value:e,sx:t,tooltipPlacement:n})=>{const r=l=>{const c=Math.abs(l);return c>=1e9?(l/1e9).toFixed(1)+"b":c>=1e6?(l/1e6).toFixed(1)+"m":c>=1e3?(l/1e3).toFixed(1)+"k":l.toString()},i=l=>new Intl.NumberFormat("en-US").format(l),o=Math.abs(e)>=1e3,a=r(e),s=i(e);return o?u.jsx(b.Tooltip,{title:s,placement:n,arrow:!0,children:u.jsx(b.Typography,{sx:t,children:a})}):u.jsx(b.Typography,{sx:t,children:a})}},fb=C.createContext(null),vF=({children:e})=>u.jsx(fb.Provider,{value:mF,children:e}),bF=()=>{const e=C.useContext(fb);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},hb=425,pb=1024;return{APIProvider:AI,AuthProvider:TI,AuthContext:jf,ComponentProvider:vF,useComponentContext:bF,useAPIContext:ft,useIsMobile:()=>{const[e,t]=C.useState(window.innerWidth<=pb),[n,r]=C.useState(window.innerWidth<=hb);return C.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=pb),r(window.innerWidth<=hb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-management-components",
3
- "version": "1.50.1",
3
+ "version": "1.50.3",
4
4
  "main": "index.es.js",
5
5
  "author": "Fans United",
6
6
  "description": "",
@@ -1,7 +1,26 @@
1
1
  import * as React from 'react';
2
+ /**
3
+ * Accordion container that groups content under a collapsible summary.
4
+ *
5
+ * Useful for settings forms and management pages to keep sections tidy.
6
+ *
7
+ * Props combine AccordionProps with React.PropsWithChildren.
8
+ * @property {string} label - Text shown in the accordion summary/header.
9
+ * @property {boolean} [disabled=false] - When true, prevents the accordion from expanding.
10
+ */
2
11
  type AccordionProps = {
3
12
  label: string;
4
13
  disabled?: boolean;
5
14
  };
15
+ /**
16
+ * Renders a collapsible section using MUI Joy's Accordion primitives.
17
+ *
18
+ * @param {{ label: string; disabled?: boolean; children?: React.ReactNode }} props - Component props.
19
+ * @returns {JSX.Element}
20
+ * @example
21
+ * <Accordion label="Branding">
22
+ * <Branding ... />
23
+ * </Accordion>
24
+ */
6
25
  declare const Accordion: React.FC<AccordionProps & React.PropsWithChildren>;
7
26
  export default Accordion;
@@ -1,9 +1,22 @@
1
1
  import { default as React } from 'react';
2
2
 
3
+ /**
4
+ * Displays advertising content input with Rich Text and Plain Text tabs.
5
+ *
6
+ * @property {object} labels - I18n labels; expects `richText` and `plainText` keys.
7
+ * @property {string} defaultValue - Initial content value.
8
+ * @property {(value: string) => void} onChange - Callback when content changes.
9
+ */
3
10
  type AdContentProps = {
4
11
  labels: any;
5
12
  defaultValue: string;
6
13
  onChange: (value: string) => void;
7
14
  };
15
+ /**
16
+ * Ad content editor providing both rich-text and textarea modes.
17
+ *
18
+ * @param {{ labels: any; defaultValue: string; onChange: (value: string) => void }} props
19
+ * @returns {JSX.Element}
20
+ */
8
21
  declare const AdContent: React.FC<AdContentProps>;
9
22
  export default AdContent;
@@ -1,8 +1,20 @@
1
1
  import { default as React } from 'react';
2
2
 
3
+ /**
4
+ * Minimal email/password login form wired to Fans United Firebase auth.
5
+ *
6
+ * @property {string} environment - Firebase environment key used to pick project configuration.
7
+ * @property {string} userNotFound - Error message displayed when auth fails.
8
+ */
3
9
  type LoginProps = {
4
10
  userNotFound: string;
5
11
  environment: string;
6
12
  };
13
+ /**
14
+ * Renders a sign-in form and triggers Firebase authentication.
15
+ *
16
+ * @param {{ environment: string; userNotFound: string }} props
17
+ * @returns {JSX.Element}
18
+ */
7
19
  declare const Login: React.FC<LoginProps>;
8
20
  export default Login;