@feedmepos/ui-library 1.2.1 → 1.2.2-rc.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.
@@ -6,7 +6,7 @@
6
6
  fm-btn--${y.variant}
7
7
  ${y.disabled||y.loading?"fm-btn--disabled":""}
8
8
  ${o.value&&y.variant==="plain"?"!text-fm-color-system-warning-400":""}
9
- `),disabled:y.disabled,type:y.type,onMousedown:x[0]||(x[0]=()=>m(!0)),onMouseleave:x[1]||(x[1]=()=>m(!1)),onMouseup:x[2]||(x[2]=()=>m(!1))},[y.icon&&y.iconPosition==="prepend"||y.prependIcon?(h.openBlock(),h.createBlock(Wo,{key:0,class:h.normalizeClass({invisible:y.loading}),color:y.disabled?"neutral-gray-200":y.iconColor??"",name:y.icon||y.prependIcon,outline:!o.value,size:"md"},null,8,["class","color","name","outline"])):h.createCommentVNode("",!0),y.label?(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass([{invisible:y.loading},"fm-typo-en-body-lg-600 label line-clamp-1"])},h.toDisplayString(y.label),3)):h.createCommentVNode("",!0),y.icon&&y.iconPosition==="append"||y.appendIcon?(h.openBlock(),h.createBlock(Wo,{key:2,class:h.normalizeClass({invisible:y.loading}),color:y.disabled?"neutral-gray-200":y.iconColor??"",name:y.icon||y.appendIcon,outline:!o.value,size:"md"},null,8,["class","color","name","outline"])):h.createCommentVNode("",!0),h.createElementVNode("div",vXe,[y.loading?(h.openBlock(),h.createBlock(Y8,{key:0,color:"neutral-gray-300",size:"md"})):h.createCommentVNode("",!0)])],42,yXe)),[[E,!y.disabled&&!y.loading&&y.variant!=="plain"]])}}}),[["__scopeId","data-v-3b971f91"]]),bXe={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},SXe=["disabled","v-wave","onClick","onMousedown"],xXe=h.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(i,{emit:s}){const o=i,u=s,f=N=>{u("update:modelValue",N)},m=h.ref(null),y=N=>{m.value=N},x=N=>N.disabled||o.disabled,E=N=>JSON.stringify(N)===JSON.stringify(o.modelValue);return(N,R)=>(h.openBlock(),h.createElementBlock("div",bXe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(N.items,(I,U)=>(h.openBlock(),h.createElementBlock("button",{key:U,class:h.normalizeClass([{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":E(I),"hover:bg-fm-color-neutral-white cursor-not-allowed":x(I)},"border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[5px]"]),disabled:x(I),"v-wave":x(I),type:"button",onClick:Y=>f(I),onMousedown:Y=>y(I),onMouseleave:R[0]||(R[0]=Y=>y(null)),onMouseup:R[1]||(R[1]=Y=>y(null))},[I.icon?(h.openBlock(),h.createBlock(Wo,{key:0,color:x(I)?"neutral-gray-200":E(I)?"primary":"",name:I.icon,outline:JSON.stringify(m.value)!==JSON.stringify(I)&&!E(I),size:"md"},null,8,["color","name","outline"])):h.createCommentVNode("",!0),I.label?(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass([[x(I)?"text-fm-color-typo-disabled":E(I)?"text-fm-color-primary":"text-fm-color-typo-primary"],"fm-typo-en-body-lg-600"])},h.toDisplayString(I.label),3)):h.createCommentVNode("",!0)],42,SXe))),128))]))}}),bve=Symbol.for("fm:form"),$_=Symbol.for("fm:form-state"),Sve=Symbol.for("fm:radio-group"),xve=Symbol.for("fm:stepper"),Tve=Symbol.for("fm:dialog"),kve=Symbol.for("fm:menu"),Cve=Symbol.for("fm:menu-to-item"),lK=Symbol.for("fm:snackbar"),EC=Symbol.for("fm:card"),uK=h.defineComponent({__name:"FmCard",props:{variant:{default:"elevated"},horizontal:{type:Boolean,default:!1},disabled:{type:Boolean}},setup(i){const s=i;return h.provide(EC,{disabled:s.disabled,horizontal:s.horizontal}),(o,u)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([`fm-card--${o.variant}`,{"fm-card--horizontal":o.horizontal}])},[h.renderSlot(o.$slots,"default",{disabled:s.disabled})],2))}}),TXe=h.defineComponent({__name:"FmCardActionArea",props:{disabled:{type:Boolean,default:!1}},setup(i){const s=h.inject(EC,null);return(o,u)=>{var m,y;const f=h.resolveDirective("wave");return h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass((m=h.unref(s))!=null&&m.disabled||o.disabled?"cursor-not-allowed":"cursor-pointer")},[h.renderSlot(o.$slots,"default")],2)),[[f,!((y=h.unref(s))!=null&&y.disabled)&&!o.disabled]])}}}),fK=h.defineComponent({__name:"FmCardSection",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__section",{"fm-card__subtitle--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),kXe={class:"fm-card__actions"},CXe=h.defineComponent({__name:"FmCardActions",setup(i){const s=h.inject(EC,null);return(o,u)=>(h.openBlock(),h.createBlock(fK,null,{default:h.withCtx(()=>{var f;return[h.createElementVNode("div",kXe,[h.renderSlot(o.$slots,"default",{disabled:((f=h.unref(s))==null?void 0:f.disabled)??!1})])]}),_:3}))}}),Eve=h.defineComponent({__name:"FmCardTitle",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__title",{"fm-card__title--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),Dve=h.defineComponent({__name:"FmCardSubtitle",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__subtitle",{"fm-card__subtitle--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),EXe={class:"flex flex-col gap-4"},DXe=h.defineComponent({__name:"FmCardHeader",props:{title:{default:""},subtitle:{default:""}},setup(i){const s=h.inject(EC,null);return(o,u)=>(h.openBlock(),h.createBlock(fK,{class:"fm-card__header"},{default:h.withCtx(()=>{var f,m;return[h.createElementVNode("div",EXe,[o.title?(h.openBlock(),h.createBlock(Eve,{key:0,disabled:(f=h.unref(s))==null?void 0:f.disabled},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(o.title),1)]),_:1},8,["disabled"])):h.createCommentVNode("",!0),o.subtitle?(h.openBlock(),h.createBlock(Dve,{key:1,disabled:(m=h.unref(s))==null?void 0:m.disabled},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(o.subtitle),1)]),_:1},8,["disabled"])):h.createCommentVNode("",!0)])]}),_:1}))}}),wXe=["src","width"],AXe=h.defineComponent({__name:"FmCardMedia",props:{src:{},width:{default:"100%"}},setup(i){const s=h.inject(EC,null);return(o,u)=>{var f,m;return h.openBlock(),h.createElementBlock("img",{src:o.src,class:h.normalizeClass(["object-cover",[{"opacity-60":((f=h.unref(s))==null?void 0:f.disabled)??!1},(m=h.unref(s))!=null&&m.horizontal?"aspect-square":"aspect-4/3"]]),width:o.width},null,10,wXe)}}}),_K=h.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},rightIcon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},variant:{default:"plain"}},emits:["chip-closed"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(!1),m=h.ref(!1);function y(te){o.selectable&&(m.value=te)}const x=()=>{!o.selectable||o.disabled||(f.value=!f.value)},E=te=>{te.stopPropagation(),!o.disabled&&u("chip-closed")};h.onMounted(()=>{f.value=o.selected}),h.watch(()=>o.selected,()=>{f.value=o.selected});function N(te,ae,ye){if(te)return"text-fm-color-typo-disabled";switch(ye){case"plain":return ae?"text-fm-color-neutral-white":"";case"neutral":case"info":case"success":case"critical":return"text-fm-color-neutral-white";case"warning":return"text-fm-color-neutral-black"}}function R(te,ae,ye){if(te)return"bg-fm-color-neutral-gray-100 cursor-not-allowed";switch(ye){case"plain":return ae?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100";case"neutral":return"bg-fm-color-neutral-black";case"info":return"bg-fm-color-secondary-blueberry";case"success":return"bg-fm-color-secondary-mint";case"critical":return"bg-fm-color-secondary-salmon";case"warning":return"bg-fm-color-secondary-mustard"}}const I=h.ref(),U=h.ref(!1);function Y(te=0){if(o.label&&!(!I.value&&te>500)){if(!I.value){h.nextTick(()=>Y(te+1));return}U.value=I.value.offsetWidth<I.value.scrollWidth}}return h.onMounted(()=>{Y()}),(te,ae)=>{const ye=h.resolveDirective("tooltip");return h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center",te.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",R(te.disabled,f.value,te.variant),{"cursor-pointer":te.selectable&&!te.disabled,"hover:bg-fm-color-opacity-sm":!f.value&&!te.disabled&&te.selectable}]),onClick:x,onMousedown:ae[0]||(ae[0]=()=>y(!0)),onMouseleave:ae[1]||(ae[1]=()=>y(!1)),onMouseup:ae[2]||(ae[2]=()=>y(!1))},[h.renderSlot(te.$slots,"default",{},()=>[te.icon?(h.openBlock(),h.createBlock(Wo,{key:0,color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:te.icon,outline:!m.value&&!f.value,size:"sm"},null,8,["color","name","outline"])):h.createCommentVNode("",!0),te.label?(h.openBlock(),h.createElementBlock("div",{key:1,ref_key:"labelRef",ref:I,class:h.normalizeClass(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",N(te.disabled,f.value,te.variant)])},h.toDisplayString(te.label),3)):h.createCommentVNode("",!0),te.rightIcon?(h.openBlock(),h.createBlock(Wo,{key:2,color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:te.rightIcon,outline:!m.value&&!f.value,size:"sm"},null,8,["color","name","outline"])):h.createCommentVNode("",!0)]),te.removable?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["flex items-center justify-center rounded-xxxl",!f.value&&!te.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":te.disabled,"cursor-pointer":te.selectable&&!te.disabled}]),onClick:E},[h.createVNode(Wo,{color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:"close",size:"sm"},null,8,["color"])],2)):h.createCommentVNode("",!0)],34)),[[ye,U.value?te.label:null]])}}}),dK=h.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(null),m=h.ref(0),y=h.ref(null),x=h.ref(),E=()=>{var U,Y;if(!f.value)return;const R=f.value.getBoundingClientRect();m.value>0&&y.value&&((U=x.value)==null||U.splice(y.value,1)),m.value=0;let I=0;Array.from(f.value.children).forEach((te,ae)=>{const ye=te.getBoundingClientRect(),fe=ye.y-R.y;I=Math.max(ye.height*2+4,I),fe>I&&(m.value+=1,y.value=y.value===null?ae:ae-m.value)}),m.value>0&&y.value&&((Y=x.value)==null||Y.splice(y.value,0,{label:`+${m.value}`,removable:!1,selectable:!1,compact:o.compact}))},N=R=>{u("chip-closed",R)};return h.onMounted(()=>{x.value=o.items,E(),new ResizeObserver(()=>{E()}).observe(f.value)}),h.watch(()=>o.items,()=>{x.value=o.items,E()}),(R,I)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chipsContainer",ref:f,class:h.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",R.compact?"max-h-48":"max-h-64"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.value,(U,Y)=>(h.openBlock(),h.createBlock(_K,{key:Y,label:U.label,icon:U.icon,selected:U.selected,removable:U.removable!==void 0?U.removable:R.removable,selectable:U.selectable!==void 0?U.selectable:R.selectable,disabled:U.disabled!==void 0?U.disabled:R.disabled,compact:R.compact,variant:U.variant,onChipClosed:te=>N(Y)},null,8,["label","icon","selected","removable","selectable","disabled","compact","variant","onChipClosed"]))),128))],2))}}),NXe={class:"flex h-48 items-center justify-center w-48"},wve=h.defineComponent({__name:"FmDialogContent",props:{modelValue:{type:Boolean,default:!1},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{}},emits:["update:modelValue"],setup(i,{emit:s}){const o=s,u=h.ref(null),f=h.ref(!1),m=h.ref(!1),y=E=>{const N=E.scrollHeight,R=E.scrollTop+E.clientHeight;m.value=N===R,f.value=E.scrollTop===0},x=E=>{E.stopPropagation();const N=E.target;y(N)};return h.watchEffect(()=>{u.value&&y(u.value)}),(E,N)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-dialog",`min-w-[${E.minWidth}px] max-w-[min(calc(100%-48px),560px)] max-h-[600px]`])},[h.createElementVNode("div",{class:h.normalizeClass(["fm-dialog--header","flex items-center justify-between","fm-typo-en-title-sm-800 text-fm-color-typo-primary",!f.value&&"fm-shadow-light-300"])},[h.renderSlot(E.$slots,"dialog-header"),h.createElementVNode("div",NXe,[E.closeButton?(h.openBlock(),h.createBlock(Wo,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:N[0]||(N[0]=R=>o("update:modelValue",!1))})):h.createCommentVNode("",!0)])],2),h.createElementVNode("div",{ref_key:"contentRef",ref:u,class:"fm-dialog--content overflow-y-auto",onScrollPassive:x},[h.renderSlot(E.$slots,"default")],544),E.$slots["dialog-footer"]?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["fm-dialog--footer","flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse",!m.value&&"shadow-[0_-8px_16px_0px_rgba(199,199,204,0.24)]"])},[h.renderSlot(E.$slots,"dialog-footer")],2)):h.createCommentVNode("",!0)],2))}});function DC(){const i=h.ref(window.innerWidth),s=()=>{i.value=window.innerWidth};h.onMounted(()=>{window.addEventListener("resize",s)}),h.onUnmounted(()=>{window.removeEventListener("resize",s)});const o=h.computed(()=>({xs:i.value>=0&&i.value<=647,sm:i.value>=648&&i.value<=959,md:i.value>=960&&i.value<=1247,lg:i.value>=1248})),u={xs:[0,647],sm:[648,959],md:[960,1247],lg:[1248,1/0]};function f(x){return u[x]}function m(x){const E=u[x][1];return i.value<=E}function y(x){return!!u[x]}return{breakpoints:o,isAtMost:m,getBreakpointsBoundary:f,isBreakpointKeyword:y}}function PXe(){const i=h.inject(Tve);if(!i)throw new Error("No provider");return i}function IXe(){var i;return(i=h.getCurrentInstance())==null?void 0:i.emit}function OXe(){const i=IXe();return{emitData(s){i==null||i("dialog:emit-data",s)}}}function H9(){const i=h.ref(!1);function s(){i.value=!0}function o(){i.value=!1}return{focus:s,blur:o,isFocused:i}}function Ave(i,s){const o=h.ref([]);function u(){const m=[];if(s.value&&s.value.length>0)for(const y of s.value){const E=(typeof y=="function"?y:()=>y)(i.value);E!==!0&&m.push(E)}return o.value=m,o.value}function f(){o.value=[]}return{validate:u,resetValidation:f,errorMessages:o}}function Nve(i,s=null,o=null){let u=null;const f=Ml(i,"modelValue"),m=h.ref(!0),y=h.inject(bve,null),{validate:x,resetValidation:E,errorMessages:N}=Ave(f,h.toRef(()=>i.rules)),R=(I=o)=>{m.value=!0,E(),I&&typeof I=="function"&&I(),f.value=s};return h.onMounted(()=>{y&&(u=y.register({validate:x,resetValidation:E,resetValue:R}))}),h.onUnmounted(()=>{y&&y.unregister(u)}),h.watch(()=>f.value,()=>{m.value=!1,f.value!==s&&x()}),h.watch(()=>i.focused,I=>{m.value=!1,I||x()}),{validate:x,resetValidation:E,errorMessages:N,resetValue:R,isPristine:m}}function FXe(){return h.inject(lK)}const MXe=h.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(i,{emit:s}){const o=i,u=s,f=Ml(o,"modelValue"),m=document.body.style.overflow;return h.watch(()=>f,y=>{y?document.body.style.overflow="hidden":document.body.style.overflow=m}),(y,x)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[y.$slots["dialog-button"]?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:x[1]||(x[1]=E=>f.value=!0)},[h.renderSlot(y.$slots,"dialog-button",{onClick:x[0]||(x[0]=E=>f.value=!0)})])):h.createCommentVNode("",!0),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(h.Transition,{name:"fm-dialog"},{default:h.withCtx(()=>[h.unref(f)?(h.openBlock(),h.createBlock(G8,{key:0,"dismiss-away":y.overlay,"prevent-backdrop-event":!y.overlay,transparent:!y.overlay,"center-content":"","z-index":y.zIndex,onClose:x[3]||(x[3]=E=>u("update:modelValue",!1))},{default:h.withCtx(()=>[h.createVNode(wve,{"close-button":y.closeButton,"min-width":y.minWidth,"model-value":h.unref(f),"onUpdate:modelValue":x[2]||(x[2]=E=>f.value=E)},{"dialog-header":h.withCtx(()=>[h.renderSlot(y.$slots,"dialog-header")]),"dialog-footer":h.withCtx(()=>[h.renderSlot(y.$slots,"dialog-footer")]),default:h.withCtx(()=>[h.renderSlot(y.$slots,"default")]),_:3},8,["close-button","min-width","model-value"])]),_:3},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):h.createCommentVNode("",!0)]),_:3})]))],64))}}),LXe={class:"fm-drop-field"},RXe=["accept","disabled"],$Xe=Au(h.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(!1),m=h.ref(),y=h.ref(),x=h.ref(),E=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault())},N=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!0)},R=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!1)},I=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!1,U(Me))},U=Me=>{var Et;x.value=((Et=Me.dataTransfer)==null?void 0:Et.files)??Me.target.files;const mt=x.value;if(m.value=te(mt[0]),y.value=ae(mt[0]),m.value&&y.value)u("file-upload",mt[0]);else{const Xt=Y();u("file-rejected",[{file:mt[0],reason:Xt}])}},Y=()=>{const Me=[];return m.value||Me.push("invalid-type"),y.value||Me.push("invalid-size"),Me},te=Me=>{if(!o.accept)return!0;const mt=o.accept.split(",").map(Et=>Et.trim());for(const Et of mt)if(ye(Et)){if(Ae(Et)===Ae(Me.type))return!0}else if(fe(Me)===Et||Me.type===Et)return!0;return!1},ae=Me=>Me.size<=o.maxFileSize,ye=Me=>Me.indexOf("*")!==-1,fe=Me=>"."+Me.name.split(".").pop(),Ae=Me=>Me.substring(0,Me.indexOf("/")),Ne=h.computed(()=>{if(f.value)return"Drop file to upload";if(m.value){if(!y.value)return`File size exceeds ${o.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),Fe=h.computed(()=>x.value?!m.value||!y.value:!1);return(Me,mt)=>(h.openBlock(),h.createElementBlock("label",LXe,[h.renderSlot(Me.$slots,"label",{},()=>[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-en-body-lg-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},h.toDisplayString(Me.label),3)],!0),h.createElementVNode("div",{class:h.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":f.value,"fm-drop-field__container--invalid":Fe.value&&!Me.disabled,"fm-drop-field__container--disabled":Me.disabled}]),onDragenter:E,onDragover:N,onDragleave:R,onDrop:I},[(f.value||Fe.value)&&!Me.disabled?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass({"fm-typo-en-body-lg-600":!0,"text-fm-color-primary":f.value,"text-fm-color-typo-error":Fe.value})},h.toDisplayString(Ne.value),3)):(h.openBlock(),h.createBlock(gl,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:Me.disabled},null,8,["disabled"])),h.renderSlot(Me.$slots,"accept-text",{},()=>[o.accept?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["fm-typo-en-body-md-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},h.toDisplayString(`Accepts ${o.accept}`),3)):h.createCommentVNode("",!0)],!0),h.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:Me.accept,disabled:Me.disabled,onChange:U},null,40,RXe)],34),h.renderSlot(Me.$slots,"helper-text",{},()=>[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-en-body-sm-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},h.toDisplayString(`Max size ${o.maxFileSize*1e-6}mb`),3)],!0)]))}}),[["__scopeId","data-v-5be808dd"]]),BXe={},VXe={class:"flex-grow"};function jXe(i,s){return h.openBlock(),h.createElementBlock("div",VXe)}const wC=Au(BXe,[["render",jXe]]),zXe={install:i=>{const s={currentDialog:{vNode:null,container:null},open:o=>{const u={primary:[],secondary:[],tertiary:[]},f=new Array,m={onPrimary:R=>(u.primary.push(R),m),onSecondary:R=>(u.secondary.push(R),m),onTertiary:R=>(u.tertiary.push(R),m),onClose:R=>(f.push(R),m)};function y(){s.close()}const x=document.createElement("div");document.body.appendChild(x);const E=h.markRaw(Pve),N=h.createVNode(E,{...o,unmount:y,storedFunctions:u,"onDialog-closed"(R){f.forEach(I=>I(R))}});return N.appContext=i._context,h.render(N,x),s.currentDialog.vNode=N,s.currentDialog.container=x,m},close:()=>{const{vNode:o,container:u}=s.currentDialog;o===null&&u===null||(u&&h.render(null,u),s.currentDialog={vNode:null,container:null})}};i.config.globalProperties.$dialog=s,i.provide(Tve,s)}},JXe={key:0,class:"block relative"},UXe={key:1,class:"fm-typo-en-body-md-400 text-fm-color-neutral-black"},Pve=h.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},dismissAway:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null},zIndex:{default:void 0}},emits:["dialog-opened","dialog-closed"],setup(i,{emit:s}){const o=h.ref(!1),u=h.ref(),f=h.computed(()=>m.primaryActions||m.secondaryActions||m.tertiaryActions),m=i,y=s,x=()=>{m.overlay&&(o.value=!1,setTimeout(()=>{m.unmount()},500))},E=(N,R)=>{m.storedFunctions[R].forEach(I=>I(u.value)),N.close&&x()};return h.onMounted(()=>{y("dialog-opened"),o.value=!0}),h.onUnmounted(()=>{y("dialog-closed",u.value)}),(N,R)=>(h.openBlock(),h.createBlock(h.Transition,{name:"fm-dialog"},{default:h.withCtx(()=>[o.value?(h.openBlock(),h.createBlock(G8,{key:0,"dismiss-away":N.overlay,"prevent-backdrop-event":!N.overlay,transparent:!N.overlay,"center-content":"","z-index":m.zIndex,onClose:x},{default:h.withCtx(()=>[N.dialogComponent?(h.openBlock(),h.createElementBlock("div",JXe,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(N.dialogComponent),h.normalizeProps(h.guardReactiveProps(N.dialogComponentProps)),null,16)),N.closeButton?(h.openBlock(),h.createBlock(Wo,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:x})):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(wve,{key:1,modelValue:o.value,"onUpdate:modelValue":R[4]||(R[4]=I=>o.value=I),"close-button":N.closeButton,"min-width":N.minWidth},h.createSlots({"dialog-header":h.withCtx(()=>[h.createElementVNode("div",null,h.toDisplayString(N.title??"Notification"),1)]),default:h.withCtx(()=>[N.contentComponent?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(N.contentComponent),h.mergeProps({key:0},N.contentComponentProps,{"onDialog:emitData":R[0]||(R[0]=I=>u.value=I)}),null,16)):(h.openBlock(),h.createElementBlock("div",UXe,h.toDisplayString(N.message),1))]),_:2},[f.value?{name:"dialog-footer",fn:h.withCtx(()=>[N.tertiaryActions?(h.openBlock(),h.createBlock(gl,{key:0,label:N.tertiaryActions.text,variant:N.tertiaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:R[1]||(R[1]=I=>E(N.tertiaryActions,"tertiary"))},null,8,["label","variant"])):h.createCommentVNode("",!0),h.createVNode(wC,{class:"sm:hidden xs:hidden"}),N.secondaryActions?(h.openBlock(),h.createBlock(gl,{key:1,label:N.secondaryActions.text,variant:N.secondaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:R[2]||(R[2]=I=>E(N.secondaryActions,"secondary"))},null,8,["label","variant"])):h.createCommentVNode("",!0),N.primaryActions?(h.openBlock(),h.createBlock(gl,{key:2,label:N.primaryActions.text,variant:N.primaryActions.variant??"primary",class:"sm:w-full xs:w-full",size:"md",onClick:R[3]||(R[3]=I=>E(N.primaryActions,"primary"))},null,8,["label","variant"])):h.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","close-button","min-width"]))]),_:1},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):h.createCommentVNode("",!0)]),_:1}))}});/*!
9
+ `),disabled:y.disabled,type:y.type,onMousedown:x[0]||(x[0]=()=>m(!0)),onMouseleave:x[1]||(x[1]=()=>m(!1)),onMouseup:x[2]||(x[2]=()=>m(!1))},[y.icon&&y.iconPosition==="prepend"||y.prependIcon?(h.openBlock(),h.createBlock(Wo,{key:0,class:h.normalizeClass({invisible:y.loading}),color:y.disabled?"neutral-gray-200":y.iconColor??"",name:y.icon||y.prependIcon,outline:!o.value,size:"md"},null,8,["class","color","name","outline"])):h.createCommentVNode("",!0),y.label?(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass([{invisible:y.loading},"fm-typo-en-body-lg-600 label line-clamp-1"])},h.toDisplayString(y.label),3)):h.createCommentVNode("",!0),y.icon&&y.iconPosition==="append"||y.appendIcon?(h.openBlock(),h.createBlock(Wo,{key:2,class:h.normalizeClass({invisible:y.loading}),color:y.disabled?"neutral-gray-200":y.iconColor??"",name:y.icon||y.appendIcon,outline:!o.value,size:"md"},null,8,["class","color","name","outline"])):h.createCommentVNode("",!0),h.createElementVNode("div",vXe,[y.loading?(h.openBlock(),h.createBlock(Y8,{key:0,color:"neutral-gray-300",size:"md"})):h.createCommentVNode("",!0)])],42,yXe)),[[E,!y.disabled&&!y.loading&&y.variant!=="plain"]])}}}),[["__scopeId","data-v-3b971f91"]]),bXe={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},SXe=["disabled","v-wave","onClick","onMousedown"],xXe=h.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(i,{emit:s}){const o=i,u=s,f=N=>{u("update:modelValue",N)},m=h.ref(null),y=N=>{m.value=N},x=N=>N.disabled||o.disabled,E=N=>JSON.stringify(N)===JSON.stringify(o.modelValue);return(N,R)=>(h.openBlock(),h.createElementBlock("div",bXe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(N.items,(I,U)=>(h.openBlock(),h.createElementBlock("button",{key:U,class:h.normalizeClass([{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":E(I),"hover:bg-fm-color-neutral-white cursor-not-allowed":x(I)},"border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[5px]"]),disabled:x(I),"v-wave":x(I),type:"button",onClick:Y=>f(I),onMousedown:Y=>y(I),onMouseleave:R[0]||(R[0]=Y=>y(null)),onMouseup:R[1]||(R[1]=Y=>y(null))},[I.icon?(h.openBlock(),h.createBlock(Wo,{key:0,color:x(I)?"neutral-gray-200":E(I)?"primary":"",name:I.icon,outline:JSON.stringify(m.value)!==JSON.stringify(I)&&!E(I),size:"md"},null,8,["color","name","outline"])):h.createCommentVNode("",!0),I.label?(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass([[x(I)?"text-fm-color-typo-disabled":E(I)?"text-fm-color-primary":"text-fm-color-typo-primary"],"fm-typo-en-body-lg-600"])},h.toDisplayString(I.label),3)):h.createCommentVNode("",!0)],42,SXe))),128))]))}}),bve=Symbol.for("fm:form"),$_=Symbol.for("fm:form-state"),Sve=Symbol.for("fm:radio-group"),xve=Symbol.for("fm:stepper"),Tve=Symbol.for("fm:dialog"),kve=Symbol.for("fm:menu"),Cve=Symbol.for("fm:menu-to-item"),lK=Symbol.for("fm:snackbar"),EC=Symbol.for("fm:card"),uK=h.defineComponent({__name:"FmCard",props:{variant:{default:"elevated"},horizontal:{type:Boolean,default:!1},disabled:{type:Boolean}},setup(i){const s=i;return h.provide(EC,{disabled:s.disabled,horizontal:s.horizontal}),(o,u)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([`fm-card--${o.variant}`,{"fm-card--horizontal":o.horizontal}])},[h.renderSlot(o.$slots,"default",{disabled:s.disabled})],2))}}),TXe=h.defineComponent({__name:"FmCardActionArea",props:{disabled:{type:Boolean,default:!1}},setup(i){const s=h.inject(EC,null);return(o,u)=>{var m,y;const f=h.resolveDirective("wave");return h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass((m=h.unref(s))!=null&&m.disabled||o.disabled?"cursor-not-allowed":"cursor-pointer")},[h.renderSlot(o.$slots,"default")],2)),[[f,!((y=h.unref(s))!=null&&y.disabled)&&!o.disabled]])}}}),fK=h.defineComponent({__name:"FmCardSection",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__section",{"fm-card__subtitle--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),kXe={class:"fm-card__actions"},CXe=h.defineComponent({__name:"FmCardActions",setup(i){const s=h.inject(EC,null);return(o,u)=>(h.openBlock(),h.createBlock(fK,null,{default:h.withCtx(()=>{var f;return[h.createElementVNode("div",kXe,[h.renderSlot(o.$slots,"default",{disabled:((f=h.unref(s))==null?void 0:f.disabled)??!1})])]}),_:3}))}}),Eve=h.defineComponent({__name:"FmCardTitle",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__title",{"fm-card__title--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),Dve=h.defineComponent({__name:"FmCardSubtitle",setup(i){const s=h.inject(EC,null);return(o,u)=>{var f;return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-card__subtitle",{"fm-card__subtitle--disabled":(f=h.unref(s))==null?void 0:f.disabled}])},[h.renderSlot(o.$slots,"default")],2)}}}),EXe={class:"flex flex-col gap-4"},DXe=h.defineComponent({__name:"FmCardHeader",props:{title:{default:""},subtitle:{default:""}},setup(i){const s=h.inject(EC,null);return(o,u)=>(h.openBlock(),h.createBlock(fK,{class:"fm-card__header"},{default:h.withCtx(()=>{var f,m;return[h.createElementVNode("div",EXe,[o.title?(h.openBlock(),h.createBlock(Eve,{key:0,disabled:(f=h.unref(s))==null?void 0:f.disabled},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(o.title),1)]),_:1},8,["disabled"])):h.createCommentVNode("",!0),o.subtitle?(h.openBlock(),h.createBlock(Dve,{key:1,disabled:(m=h.unref(s))==null?void 0:m.disabled},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(o.subtitle),1)]),_:1},8,["disabled"])):h.createCommentVNode("",!0)])]}),_:1}))}}),wXe=["src","width"],AXe=h.defineComponent({__name:"FmCardMedia",props:{src:{},width:{default:"100%"}},setup(i){const s=h.inject(EC,null);return(o,u)=>{var f,m;return h.openBlock(),h.createElementBlock("img",{src:o.src,class:h.normalizeClass(["object-cover",[{"opacity-60":((f=h.unref(s))==null?void 0:f.disabled)??!1},(m=h.unref(s))!=null&&m.horizontal?"aspect-square":"aspect-4/3"]]),width:o.width},null,10,wXe)}}}),_K=h.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},rightIcon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},variant:{default:"plain"}},emits:["chip-closed"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(!1),m=h.ref(!1);function y(te){o.selectable&&(m.value=te)}const x=()=>{!o.selectable||o.disabled||(f.value=!f.value)},E=te=>{te.stopPropagation(),!o.disabled&&u("chip-closed")};h.onMounted(()=>{f.value=o.selected}),h.watch(()=>o.selected,()=>{f.value=o.selected});function N(te,ae,ye){if(te)return"text-fm-color-typo-disabled";switch(ye){case"plain":return ae?"text-fm-color-neutral-white":"";case"neutral":case"info":case"success":case"critical":return"text-fm-color-neutral-white";case"warning":return"text-fm-color-neutral-black"}}function R(te,ae,ye){if(te)return"bg-fm-color-neutral-gray-100 cursor-not-allowed";switch(ye){case"plain":return ae?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100";case"neutral":return"bg-fm-color-neutral-black";case"info":return"bg-fm-color-secondary-blueberry";case"success":return"bg-fm-color-secondary-mint";case"critical":return"bg-fm-color-secondary-salmon";case"warning":return"bg-fm-color-secondary-mustard"}}const I=h.ref(),U=h.ref(!1);function Y(te=0){if(o.label&&!(!I.value&&te>500)){if(!I.value){h.nextTick(()=>Y(te+1));return}U.value=I.value.offsetWidth<I.value.scrollWidth}}return h.onMounted(()=>{Y()}),(te,ae)=>{const ye=h.resolveDirective("tooltip");return h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center",te.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",R(te.disabled,f.value,te.variant),{"cursor-pointer":te.selectable&&!te.disabled,"hover:bg-fm-color-opacity-sm":!f.value&&!te.disabled&&te.selectable}]),onClick:x,onMousedown:ae[0]||(ae[0]=()=>y(!0)),onMouseleave:ae[1]||(ae[1]=()=>y(!1)),onMouseup:ae[2]||(ae[2]=()=>y(!1))},[h.renderSlot(te.$slots,"default",{},()=>[te.icon?(h.openBlock(),h.createBlock(Wo,{key:0,color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:te.icon,outline:!m.value&&!f.value,size:"sm"},null,8,["color","name","outline"])):h.createCommentVNode("",!0),te.label?(h.openBlock(),h.createElementBlock("div",{key:1,ref_key:"labelRef",ref:I,class:h.normalizeClass(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",N(te.disabled,f.value,te.variant)])},h.toDisplayString(te.label),3)):h.createCommentVNode("",!0),te.rightIcon?(h.openBlock(),h.createBlock(Wo,{key:2,color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:te.rightIcon,outline:!m.value&&!f.value,size:"sm"},null,8,["color","name","outline"])):h.createCommentVNode("",!0)]),te.removable?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["flex items-center justify-center rounded-xxxl",!f.value&&!te.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":te.disabled,"cursor-pointer":te.selectable&&!te.disabled}]),onClick:E},[h.createVNode(Wo,{color:te.disabled?"neutral-gray-200":f.value?"neutral-white":"neutral-black",name:"close",size:"sm"},null,8,["color"])],2)):h.createCommentVNode("",!0)],34)),[[ye,U.value?te.label:null]])}}}),dK=h.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(null),m=h.ref(0),y=h.ref(null),x=h.ref(),E=()=>{var U,Y;if(!f.value)return;const R=f.value.getBoundingClientRect();m.value>0&&y.value&&((U=x.value)==null||U.splice(y.value,1)),m.value=0;let I=0;Array.from(f.value.children).forEach((te,ae)=>{const ye=te.getBoundingClientRect(),fe=ye.y-R.y;I=Math.max(ye.height*2+4,I),fe>I&&(m.value+=1,y.value=y.value===null?ae:ae-m.value)}),m.value>0&&y.value&&((Y=x.value)==null||Y.splice(y.value,0,{label:`+${m.value}`,removable:!1,selectable:!1,compact:o.compact}))},N=R=>{u("chip-closed",R)};return h.onMounted(()=>{x.value=o.items,E(),new ResizeObserver(()=>{E()}).observe(f.value)}),h.watch(()=>o.items,()=>{x.value=o.items,E()}),(R,I)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"chipsContainer",ref:f,class:h.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",R.compact?"max-h-48":"max-h-64"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(x.value,(U,Y)=>(h.openBlock(),h.createBlock(_K,{key:Y,label:U.label,icon:U.icon,selected:U.selected,removable:U.removable!==void 0?U.removable:R.removable,selectable:U.selectable!==void 0?U.selectable:R.selectable,disabled:U.disabled!==void 0?U.disabled:R.disabled,compact:R.compact,variant:U.variant,onChipClosed:te=>N(Y)},null,8,["label","icon","selected","removable","selectable","disabled","compact","variant","onChipClosed"]))),128))],2))}}),NXe={class:"flex h-48 items-center justify-center w-48"},wve=h.defineComponent({__name:"FmDialogContent",props:{modelValue:{type:Boolean,default:!1},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{}},emits:["update:modelValue"],setup(i,{emit:s}){const o=s,u=h.ref(null),f=h.ref(!1),m=h.ref(!1),y=E=>{const N=E.scrollHeight,R=E.scrollTop+E.clientHeight;m.value=N===R,f.value=E.scrollTop===0},x=E=>{E.stopPropagation();const N=E.target;y(N)};return h.watchEffect(()=>{u.value&&y(u.value)}),(E,N)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["fm-dialog",`min-w-[${E.minWidth}px] max-w-[min(calc(100%-48px),560px)] max-h-[600px]`])},[h.createElementVNode("div",{class:h.normalizeClass(["fm-dialog--header","flex items-center justify-between","fm-typo-en-title-sm-800 text-fm-color-typo-primary",!f.value&&"fm-shadow-light-300"])},[h.renderSlot(E.$slots,"dialog-header"),h.createElementVNode("div",NXe,[E.closeButton?(h.openBlock(),h.createBlock(Wo,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:N[0]||(N[0]=R=>o("update:modelValue",!1))})):h.createCommentVNode("",!0)])],2),h.createElementVNode("div",{ref_key:"contentRef",ref:u,class:"fm-dialog--content overflow-y-auto",onScrollPassive:x},[h.renderSlot(E.$slots,"default")],544),E.$slots["dialog-footer"]?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["fm-dialog--footer","flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse",!m.value&&"shadow-[0_-8px_16px_0px_rgba(199,199,204,0.24)]"])},[h.renderSlot(E.$slots,"dialog-footer")],2)):h.createCommentVNode("",!0)],2))}});function DC(){const i=h.ref(window.innerWidth),s=()=>{i.value=window.innerWidth};h.onMounted(()=>{window.addEventListener("resize",s)}),h.onUnmounted(()=>{window.removeEventListener("resize",s)});const o=h.computed(()=>({xs:i.value>=0&&i.value<=647,sm:i.value>=648&&i.value<=959,md:i.value>=960&&i.value<=1247,lg:i.value>=1248})),u={xs:[0,647],sm:[648,959],md:[960,1247],lg:[1248,1/0]};function f(x){return u[x]}function m(x){const E=u[x][1];return i.value<=E}function y(x){return!!u[x]}return{breakpoints:o,isAtMost:m,getBreakpointsBoundary:f,isBreakpointKeyword:y}}function PXe(){const i=h.inject(Tve);if(!i)throw new Error("No provider");return i}function IXe(){var i;return(i=h.getCurrentInstance())==null?void 0:i.emit}function OXe(){const i=IXe();return{emitData(s){i==null||i("dialog:emit-data",s)}}}function H9(){const i=h.ref(!1);function s(){i.value=!0}function o(){i.value=!1}return{focus:s,blur:o,isFocused:i}}function Ave(i,s){const o=h.ref([]);function u(){const m=[];if(s.value&&s.value.length>0)for(const y of s.value){const E=(typeof y=="function"?y:()=>y)(i.value);E!==!0&&m.push(E)}return o.value=m,o.value}function f(){o.value=[]}return{validate:u,resetValidation:f,errorMessages:o}}function Nve(i,s=null,o=null){let u=null;const f=Ml(i,"modelValue"),m=h.ref(!0),y=h.inject(bve,null),{validate:x,resetValidation:E,errorMessages:N}=Ave(f,h.toRef(()=>i.rules)),R=(I=o)=>{m.value=!0,E(),I&&typeof I=="function"&&I(),f.value=s};return h.onMounted(()=>{y&&(u=y.register({validate:x,resetValidation:E,resetValue:R}))}),h.onUnmounted(()=>{y&&y.unregister(u)}),h.watch(()=>f.value,()=>{m.value=!1,f.value!==s&&x()}),h.watch(()=>i.focused,I=>{m.value=!1,I||x()}),{validate:x,resetValidation:E,errorMessages:N,resetValue:R,isPristine:m}}function FXe(){return h.inject(lK)}const MXe=h.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(i,{emit:s}){const o=i,u=s,f=Ml(o,"modelValue"),m=document.body.style.overflow;return h.watch(()=>f,y=>{y?document.body.style.overflow="hidden":document.body.style.overflow=m}),(y,x)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[y.$slots["dialog-button"]?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:x[1]||(x[1]=E=>f.value=!0)},[h.renderSlot(y.$slots,"dialog-button",{onClick:x[0]||(x[0]=E=>f.value=!0)})])):h.createCommentVNode("",!0),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(h.Transition,{name:"fm-dialog"},{default:h.withCtx(()=>[h.unref(f)?(h.openBlock(),h.createBlock(G8,{key:0,"dismiss-away":y.overlay,"prevent-backdrop-event":!y.overlay,transparent:!y.overlay,"center-content":"","z-index":y.zIndex,onClose:x[3]||(x[3]=E=>u("update:modelValue",!1))},{default:h.withCtx(()=>[h.createVNode(wve,{"close-button":y.closeButton,"min-width":y.minWidth,"model-value":h.unref(f),"onUpdate:modelValue":x[2]||(x[2]=E=>f.value=E)},h.createSlots({"dialog-header":h.withCtx(()=>[h.renderSlot(y.$slots,"dialog-header")]),default:h.withCtx(()=>[h.renderSlot(y.$slots,"default")]),_:2},[y.$slots["dialog-footer"]?{name:"dialog-footer",fn:h.withCtx(()=>[h.renderSlot(y.$slots,"dialog-footer")]),key:"0"}:void 0]),1032,["close-button","min-width","model-value"])]),_:3},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):h.createCommentVNode("",!0)]),_:3})]))],64))}}),LXe={class:"fm-drop-field"},RXe=["accept","disabled"],$Xe=Au(h.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(i,{emit:s}){const o=i,u=s,f=h.ref(!1),m=h.ref(),y=h.ref(),x=h.ref(),E=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault())},N=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!0)},R=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!1)},I=Me=>{o.disabled||(Me.stopPropagation(),Me.preventDefault(),f.value=!1,U(Me))},U=Me=>{var Et;x.value=((Et=Me.dataTransfer)==null?void 0:Et.files)??Me.target.files;const mt=x.value;if(m.value=te(mt[0]),y.value=ae(mt[0]),m.value&&y.value)u("file-upload",mt[0]);else{const Xt=Y();u("file-rejected",[{file:mt[0],reason:Xt}])}},Y=()=>{const Me=[];return m.value||Me.push("invalid-type"),y.value||Me.push("invalid-size"),Me},te=Me=>{if(!o.accept)return!0;const mt=o.accept.split(",").map(Et=>Et.trim());for(const Et of mt)if(ye(Et)){if(Ae(Et)===Ae(Me.type))return!0}else if(fe(Me)===Et||Me.type===Et)return!0;return!1},ae=Me=>Me.size<=o.maxFileSize,ye=Me=>Me.indexOf("*")!==-1,fe=Me=>"."+Me.name.split(".").pop(),Ae=Me=>Me.substring(0,Me.indexOf("/")),Ne=h.computed(()=>{if(f.value)return"Drop file to upload";if(m.value){if(!y.value)return`File size exceeds ${o.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),Fe=h.computed(()=>x.value?!m.value||!y.value:!1);return(Me,mt)=>(h.openBlock(),h.createElementBlock("label",LXe,[h.renderSlot(Me.$slots,"label",{},()=>[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-en-body-lg-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},h.toDisplayString(Me.label),3)],!0),h.createElementVNode("div",{class:h.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":f.value,"fm-drop-field__container--invalid":Fe.value&&!Me.disabled,"fm-drop-field__container--disabled":Me.disabled}]),onDragenter:E,onDragover:N,onDragleave:R,onDrop:I},[(f.value||Fe.value)&&!Me.disabled?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass({"fm-typo-en-body-lg-600":!0,"text-fm-color-primary":f.value,"text-fm-color-typo-error":Fe.value})},h.toDisplayString(Ne.value),3)):(h.openBlock(),h.createBlock(gl,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:Me.disabled},null,8,["disabled"])),h.renderSlot(Me.$slots,"accept-text",{},()=>[o.accept?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["fm-typo-en-body-md-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},h.toDisplayString(`Accepts ${o.accept}`),3)):h.createCommentVNode("",!0)],!0),h.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:Me.accept,disabled:Me.disabled,onChange:U},null,40,RXe)],34),h.renderSlot(Me.$slots,"helper-text",{},()=>[h.createElementVNode("div",{class:h.normalizeClass(["fm-typo-en-body-sm-400",[Me.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},h.toDisplayString(`Max size ${o.maxFileSize*1e-6}mb`),3)],!0)]))}}),[["__scopeId","data-v-5be808dd"]]),BXe={},VXe={class:"flex-grow"};function jXe(i,s){return h.openBlock(),h.createElementBlock("div",VXe)}const wC=Au(BXe,[["render",jXe]]),zXe={install:i=>{const s={currentDialog:{vNode:null,container:null},open:o=>{const u={primary:[],secondary:[],tertiary:[]},f=new Array,m={onPrimary:R=>(u.primary.push(R),m),onSecondary:R=>(u.secondary.push(R),m),onTertiary:R=>(u.tertiary.push(R),m),onClose:R=>(f.push(R),m)};function y(){s.close()}const x=document.createElement("div");document.body.appendChild(x);const E=h.markRaw(Pve),N=h.createVNode(E,{...o,unmount:y,storedFunctions:u,"onDialog-closed"(R){f.forEach(I=>I(R))}});return N.appContext=i._context,h.render(N,x),s.currentDialog.vNode=N,s.currentDialog.container=x,m},close:()=>{const{vNode:o,container:u}=s.currentDialog;o===null&&u===null||(u&&h.render(null,u),s.currentDialog={vNode:null,container:null})}};i.config.globalProperties.$dialog=s,i.provide(Tve,s)}},JXe={key:0,class:"block relative"},UXe={key:1,class:"fm-typo-en-body-md-400 text-fm-color-neutral-black"},Pve=h.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},dismissAway:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null},zIndex:{default:void 0}},emits:["dialog-opened","dialog-closed"],setup(i,{emit:s}){const o=h.ref(!1),u=h.ref(),f=h.computed(()=>m.primaryActions||m.secondaryActions||m.tertiaryActions),m=i,y=s,x=()=>{m.overlay&&(o.value=!1,setTimeout(()=>{m.unmount()},500))},E=(N,R)=>{m.storedFunctions[R].forEach(I=>I(u.value)),N.close&&x()};return h.onMounted(()=>{y("dialog-opened"),o.value=!0}),h.onUnmounted(()=>{y("dialog-closed",u.value)}),(N,R)=>(h.openBlock(),h.createBlock(h.Transition,{name:"fm-dialog"},{default:h.withCtx(()=>[o.value?(h.openBlock(),h.createBlock(G8,{key:0,"dismiss-away":N.overlay,"prevent-backdrop-event":!N.overlay,transparent:!N.overlay,"center-content":"","z-index":m.zIndex,onClose:x},{default:h.withCtx(()=>[N.dialogComponent?(h.openBlock(),h.createElementBlock("div",JXe,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(N.dialogComponent),h.normalizeProps(h.guardReactiveProps(N.dialogComponentProps)),null,16)),N.closeButton?(h.openBlock(),h.createBlock(Wo,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:x})):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(wve,{key:1,modelValue:o.value,"onUpdate:modelValue":R[4]||(R[4]=I=>o.value=I),"close-button":N.closeButton,"min-width":N.minWidth},h.createSlots({"dialog-header":h.withCtx(()=>[h.createElementVNode("div",null,h.toDisplayString(N.title??"Notification"),1)]),default:h.withCtx(()=>[N.contentComponent?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(N.contentComponent),h.mergeProps({key:0},N.contentComponentProps,{"onDialog:emitData":R[0]||(R[0]=I=>u.value=I)}),null,16)):(h.openBlock(),h.createElementBlock("div",UXe,h.toDisplayString(N.message),1))]),_:2},[f.value?{name:"dialog-footer",fn:h.withCtx(()=>[N.tertiaryActions?(h.openBlock(),h.createBlock(gl,{key:0,label:N.tertiaryActions.text,variant:N.tertiaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:R[1]||(R[1]=I=>E(N.tertiaryActions,"tertiary"))},null,8,["label","variant"])):h.createCommentVNode("",!0),h.createVNode(wC,{class:"sm:hidden xs:hidden"}),N.secondaryActions?(h.openBlock(),h.createBlock(gl,{key:1,label:N.secondaryActions.text,variant:N.secondaryActions.variant??"tertiary",class:"sm:w-full xs:w-full",size:"md",onClick:R[2]||(R[2]=I=>E(N.secondaryActions,"secondary"))},null,8,["label","variant"])):h.createCommentVNode("",!0),N.primaryActions?(h.openBlock(),h.createBlock(gl,{key:2,label:N.primaryActions.text,variant:N.primaryActions.variant??"primary",class:"sm:w-full xs:w-full",size:"md",onClick:R[3]||(R[3]=I=>E(N.primaryActions,"primary"))},null,8,["label","variant"])):h.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["modelValue","close-button","min-width"]))]),_:1},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):h.createCommentVNode("",!0)]),_:1}))}});/*!
10
10
  * @kurkle/color v0.3.2
11
11
  * https://github.com/kurkle/color#readme
12
12
  * (c) 2023 Jukka Kurkela
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/ui-library",
3
- "version": "1.2.1",
3
+ "version": "1.2.2-rc.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1 +0,0 @@
1
- import{importShared as m,__tla as V}from"./__federation_fn_import-DzgSLNaX.js";import{_ as C,__tla as x}from"./FmDialogContent.vue_vue_type_script_setup_true_lang-aArQwa6a.js";import{F as $,__tla as z}from"./FmOverlay-DgS2AGto.js";import{__tla as F}from"./useBreakpoints-BoARERQ5.js";import{__tla as I}from"./useSnackbar-BBZda2PM.js";import{__tla as N}from"./useFormChild-CIMfi6hc.js";import{u as S,__tla as T}from"./useProxiedModel-tBxtSc23.js";let h,W=Promise.all([(()=>{try{return V}catch{}})(),(()=>{try{return x}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return F}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return T}catch{}})()]).then(async()=>{let c,l,r,d,i,s,a,u,_,p,y,f,v;({defineComponent:c}=await m("vue")),{renderSlot:l,openBlock:r,createElementBlock:d,createCommentVNode:i,unref:s,withCtx:a,createVNode:u,createBlock:_,Transition:p,Teleport:y,Fragment:f}=await m("vue"),{watch:v}=await m("vue"),h=c({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0},zIndex:{default:void 0}},emits:["update:modelValue"],setup(w,{emit:b}){const g=w,k=b,o=S(g,"modelValue"),B=document.body.style.overflow;return v(()=>o,t=>{t?document.body.style.overflow="hidden":document.body.style.overflow=B}),(t,e)=>(r(),d(f,null,[t.$slots["dialog-button"]?(r(),d("div",{key:0,onClick:e[1]||(e[1]=n=>o.value=!0)},[l(t.$slots,"dialog-button",{onClick:e[0]||(e[0]=n=>o.value=!0)})])):i("",!0),(r(),_(y,{to:"body"},[u(p,{name:"fm-dialog"},{default:a(()=>[s(o)?(r(),_($,{key:0,"dismiss-away":t.overlay,"prevent-backdrop-event":!t.overlay,transparent:!t.overlay,"center-content":"","z-index":t.zIndex,onClose:e[3]||(e[3]=n=>k("update:modelValue",!1))},{default:a(()=>[u(C,{"close-button":t.closeButton,"min-width":t.minWidth,"model-value":s(o),"onUpdate:modelValue":e[2]||(e[2]=n=>o.value=n)},{"dialog-header":a(()=>[l(t.$slots,"dialog-header")]),"dialog-footer":a(()=>[l(t.$slots,"dialog-footer")]),default:a(()=>[l(t.$slots,"default")]),_:3},8,["close-button","min-width","model-value"])]),_:3},8,["dismiss-away","prevent-backdrop-event","transparent","z-index"])):i("",!0)]),_:3})]))],64))}})});export{h as _,W as __tla};