sit-onyx 1.0.0-alpha.63 → 1.0.0-alpha.65

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.
@@ -4,7 +4,7 @@ declare const _default: <TValue extends string | number | boolean>(__VLS_props:
4
4
  skeleton?: number | undefined;
5
5
  modelValue?: TValue[] | undefined;
6
6
  "onUpdate:modelValue"?: ((value: TValue[]) => any) | undefined;
7
- options: import('../../index').CheckboxGroupOption<TValue>[];
7
+ options: import('./types').CheckboxGroupOption<TValue>[];
8
8
  headline?: string | undefined;
9
9
  direction?: "horizontal" | "vertical" | undefined;
10
10
  withCheckAll?: boolean | undefined;
@@ -20,7 +20,7 @@ declare const _default: <TValue extends string | number | boolean>(__VLS_props:
20
20
  skeleton?: number | undefined;
21
21
  modelValue?: TValue[] | undefined;
22
22
  "onUpdate:modelValue"?: ((value: TValue[]) => any) | undefined;
23
- options: import('../../index').CheckboxGroupOption<TValue>[];
23
+ options: import('./types').CheckboxGroupOption<TValue>[];
24
24
  headline?: string | undefined;
25
25
  direction?: "horizontal" | "vertical" | undefined;
26
26
  withCheckAll?: boolean | undefined;
@@ -40,7 +40,7 @@ declare const _default: <TValue extends string | number | boolean>(__VLS_props:
40
40
  skeleton?: number | undefined;
41
41
  modelValue?: TValue[] | undefined;
42
42
  "onUpdate:modelValue"?: ((value: TValue[]) => any) | undefined;
43
- options: import('../../index').CheckboxGroupOption<TValue>[];
43
+ options: import('./types').CheckboxGroupOption<TValue>[];
44
44
  headline?: string | undefined;
45
45
  direction?: "horizontal" | "vertical" | undefined;
46
46
  withCheckAll?: boolean | undefined;
@@ -0,0 +1,25 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, Readonly<{
2
+ /**
3
+ * Label / text to display.
4
+ */
5
+ default(): unknown;
6
+ /**
7
+ * Optional slot to override the default icon.
8
+ */
9
+ icon?(): unknown;
10
+ }> & {
11
+ /**
12
+ * Label / text to display.
13
+ */
14
+ default(): unknown;
15
+ /**
16
+ * Optional slot to override the default icon.
17
+ */
18
+ icon?(): unknown;
19
+ }>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),P={key:0,class:"onyx-app__nav"},A={class:"onyx-app__page"},U={key:1,class:"onyx-app__page-overlay"},R={key:2,class:"onyx-app__app-overlay"},F=e.defineComponent({__name:"OnyxAppLayout",props:{navBarAlignment:{default:"top"}},setup(o){const n=o,t=e.useSlots();return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-app",{"onyx-app--horizontal":n.navBarAlignment==="left"}])},[e.unref(t).navBar?(e.openBlock(),e.createElementBlock("nav",P,[e.renderSlot(l.$slots,"navBar")])):e.createCommentVNode("",!0),e.createElementVNode("div",A,[e.renderSlot(l.$slots,"default")]),e.unref(t).pageOverlay?(e.openBlock(),e.createElementBlock("div",U,[e.renderSlot(l.$slots,"pageOverlay")])):e.createCommentVNode("",!0),e.unref(t).appOverlay?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"appOverlay")])):e.createCommentVNode("",!0)],2))}}),Y=["cozy","default","compact"],_=o=>({densityClass:e.computed(()=>({[`onyx-density-${o.density}`]:o.density}))}),j=["innerHTML"],v=e.defineComponent({__name:"OnyxIcon",props:{icon:{},size:{default:"24px"},color:{default:"currentColor"}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createElementBlock("figure",{class:e.normalizeClass(["onyx-icon",[n.size!=="24px"?`onyx-icon--${n.size}`:"",n.color!=="currentColor"?`onyx-icon--${n.color}`:""]]),"aria-hidden":"true",innerHTML:n.icon},null,10,j))}}),E=(o,n)=>{const t=o.__vccOpts||o;for(const[l,a]of n)t[l]=a;return t},Z={},G={class:"onyx-circle-spinner",viewBox:"0 0 50 50"},H=e.createElementVNode("circle",{class:"onyx-circle-spinner__circle",cx:"50%",cy:"50%",r:"45%"},null,-1),K=[H];function X(o,n){return e.openBlock(),e.createElementBlock("svg",G,K)}const W=E(Z,[["render",X]]),J={},Q={class:"onyx-loading-dots"},ee=e.createElementVNode("span",{class:"onyx-loading-dots__center"},null,-1),te=[ee];function ne(o,n){return e.openBlock(),e.createElementBlock("div",Q,te)}const oe=E(J,[["render",ne]]),x=e.defineComponent({__name:"OnyxLoadingIndicator",props:{type:{default:"dots"}},setup(o){const n=o;return(t,l)=>n.type==="circle"?(e.openBlock(),e.createBlock(W,{key:0})):n.type==="dots"?(e.openBlock(),e.createBlock(oe,{key:1})):e.createCommentVNode("",!0)}}),le={},ae={"aria-hidden":"true",class:"onyx-skeleton"};function se(o,n){return e.openBlock(),e.createElementBlock("figure",ae)}const k=E(le,[["render",se]]),re=["disabled"],ce={key:2,class:"onyx-button__label onyx-truncation-ellipsis"},ie=e.defineComponent({__name:"OnyxButton",props:{density:{},label:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},type:{default:"button"},variation:{default:"primary"},mode:{default:"default"},icon:{},skeleton:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n;return(d,s)=>t.skeleton?(e.openBlock(),e.createBlock(k,{key:0,class:e.normalizeClass(["onyx-button-skeleton",e.unref(l)])},null,8,["class"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["onyx-button",`onyx-button--${t.variation}`,`onyx-button--${t.mode}`,{"onyx-button--loading":t.loading},e.unref(l)]),disabled:t.disabled||t.loading,onClick:s[0]||(s[0]=r=>a("click"))},[t.icon&&!t.loading?(e.openBlock(),e.createBlock(v,{key:0,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(x,{key:1,class:"onyx-button__loading"})):(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(t.label),1))],10,re))}}),de=["button","submit","reset"],ue=["primary","secondary","danger"],pe=["default","outline","plain"],me=e.defineComponent({__name:"OnyxBadge",props:{density:{},variation:{default:"primary"},icon:{}},setup(o){const n=o,{densityClass:t}=_(n);return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-badge",["onyx-truncation-ellipsis","onyx-text",`onyx-badge--${n.variation}`,e.unref(t)]])},[n.icon?(e.openBlock(),e.createBlock(v,{key:0,class:"onyx-badge__icon",icon:n.icon,size:n.density==="compact"?"16px":"24px"},null,8,["icon","size"])):e.renderSlot(l.$slots,"default",{key:1})],2))}}),ye="(optional)",fe={tooShort:"Please lengthen this text to {minLength} characters or more (you are currently using 1 character) | Please lengthen this text to {minLength} characters or more (you are currently using {n} characters)",tooLong:"Please shorten this text to {maxLength} characters or less (you are currently using 1 character) | Please shorten this text to {maxLength} characters or less (you are currently using {n} characters)",rangeUnderflow:"Value must be greater than or equal to {min}",rangeOverflow:"Value must be less than or equal to {max}",patternMismatch:"Please match the format requested.",valueMissing:"Please fill in this field.",stepMismatch:"Please enter a value that is a multiple of {step}.",badInput:'"{value}" does not match the expected type.',typeMismatch:{generic:'"{value}" does not match the expected type.',email:'"{value}" must be a valid email address.',number:'"{value}" must be a number.',tel:'"{value}" must be a valid phone number.',url:'"{value}" must a valid URL.'}},_e={selectAll:"Select all",currentSelection:"{n} selected"},C={optional:ye,validations:fe,selections:_e},T=Symbol(),L=o=>{const n=e.computed(()=>e.unref(o==null?void 0:o.locale)??"en-US"),t=e.computed(()=>o!=null&&o.messages&&n.value in o.messages?o.messages[n.value]:C),l=e.computed(()=>(a,d={})=>{let s=N(a,t.value)??N(a,C)??"";const r=typeof d.n=="number"?d.n:void 0;return s=ve(s,r),xe(s,d)});return{locale:n,t:l}},ke=(o,n)=>o.provide(T,L(n)),b=()=>e.inject(T,()=>L(),!0),N=(o,n)=>{const t=o.split(".").reduce((l,a)=>!l||typeof l=="string"?l:l[a],n);return t&&typeof t=="string"?t:void 0},ve=(o,n)=>{const t=o.split(" | ").map(a=>a.trim());if(t.length<=1)return o;let l=1;return n===0&&(l=0),n&&(n<=0||n>1)&&(l=2),t.length===2?l===1?t[0]:t[1]:t[l]},xe=(o,n)=>n?Object.entries(n).reduce((l,[a,d])=>d===void 0?l:l.replace(new RegExp(`{${a}}`,"gi"),d.toString()),o).replace(/\s?{.*}\s?/gi,""):o,g=o=>({requiredTypeClass:e.computed(()=>({[`onyx-use-${o.requiredMarker}`]:o.requiredMarker})),requiredMarkerClass:e.computed(()=>({"onyx-required-marker":o.required,"onyx-optional-marker":!o.required}))}),he={class:"onyx-checkbox__container"},ge=["aria-label","title","indeterminate","disabled","required"],B=e.defineComponent({__name:"OnyxCheckbox",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},modelValue:{type:Boolean,default:!1},label:{},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hideLabel:{type:Boolean},truncation:{default:"ellipsis"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{requiredMarkerClass:l,requiredTypeClass:a}=g(t),d=n,s=e.computed({get:()=>t.modelValue,set:c=>d("update:modelValue",c)}),r=e.ref(!1),{densityClass:u}=_(t);return(c,p)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-checkbox-skeleton",e.unref(u)])},[e.createVNode(k,{class:"onyx-checkbox-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-checkbox-skeleton__label"}))],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-checkbox",[e.unref(a),e.unref(u)]])},[e.createElementVNode("div",he,[t.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-checkbox__loading",type:"circle"})):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":p[0]||(p[0]=m=>s.value=m),"aria-label":t.hideLabel?t.label:void 0,title:t.hideLabel?t.label:void 0,class:e.normalizeClass(["onyx-checkbox__input",{"onyx-checkbox__input--touched":r.value}]),type:"checkbox",indeterminate:t.indeterminate,disabled:t.disabled,required:t.required,onBlur:p[1]||(p[1]=m=>r.value=!0)},null,42,ge)),[[e.vModelCheckbox,s.value]])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("p",{class:e.normalizeClass(["onyx-checkbox__label",[`onyx-truncation-${t.truncation}`,t.truncation==="multiline"?e.unref(l):void 0]])},e.toDisplayString(t.label),3),t.truncation==="ellipsis"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-checkbox__marker",[e.unref(l)]])},null,2)):e.createCommentVNode("",!0)],64))],2))}}),be=["disabled"],Be={key:0,class:"onyx-checkbox-group__label"},Ce=e.defineComponent({__name:"OnyxCheckboxGroup",props:{density:{},options:{},modelValue:{default:()=>[]},headline:{},direction:{default:"vertical"},withCheckAll:{type:Boolean,default:!1},checkAllLabel:{},disabled:{type:Boolean,default:!1},skeleton:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n,{t:d}=b(),s=(p,m)=>{const i=m?[...t.modelValue,p]:t.modelValue.filter(y=>y!==p);a("update:modelValue",i)},r=e.computed(()=>t.options.filter(p=>!p.disabled&&!p.skeleton)),u=p=>{const m=p?r.value.map(({id:i})=>i):[];a("update:modelValue",m)},c=e.computed(()=>{const p=r.value.map(({id:i})=>i),m=t.modelValue.filter(i=>p.includes(i));return!p.length||!m.length?{modelValue:!1}:m.length===p.length?{modelValue:!0}:{indeterminate:!0,modelValue:!1}});return(p,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-checkbox-group",e.unref(l)]),disabled:t.disabled},[t.headline?(e.openBlock(),e.createElementBlock("legend",Be,[e.createVNode(e.unref(V),{is:"h3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.headline),1)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["onyx-checkbox-group__content",{"onyx-checkbox-group__content--horizontal":t.direction==="horizontal"}])},[t.skeleton===void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.withCheckAll?(e.openBlock(),e.createBlock(B,e.mergeProps({key:0},c.value,{label:t.checkAllLabel||e.unref(d)("selections.selectAll"),"onUpdate:modelValue":u}),null,16,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createBlock(B,e.mergeProps({key:i.id.toString()},i,{"model-value":t.modelValue.includes(i.id),"onUpdate:modelValue":y=>s(i.id,y)}),null,16,["model-value","onUpdate:modelValue"]))),128))],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,i=>(e.openBlock(),e.createBlock(B,{key:i,label:`Skeleton ${i}`,skeleton:""},null,8,["label"]))),128))],2)],10,be))}}),V=e.defineComponent({__name:"OnyxHeadline",props:{is:{},monospace:{type:Boolean,default:!1}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:e.normalizeClass(["onyx-headline",`onyx-headline--${n.is}`,n.monospace?"onyx-headline--monospace":""])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["class"]))}}),Ee=["h1","h2","h3","h4","h5","h6"],Ve=["12px","16px","24px","32px","48px","64px","96px"],Se=["aria-label","title","disabled"],Oe=e.defineComponent({__name:"OnyxIconButton",props:{density:{},label:{},disabled:{type:Boolean,default:!1},type:{default:"button"},variation:{default:"primary"},loading:{type:Boolean},icon:{}},emits:["click"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n;return(d,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["onyx-icon-button",[`onyx-icon-button--${t.variation}`,{"onyx-icon-button--loading":t.loading},e.unref(l)]]),"aria-label":t.label,title:t.label,disabled:t.disabled||t.loading,onClick:s[0]||(s[0]=r=>a("click"))},[t.loading?(e.openBlock(),e.createBlock(x,{key:0,type:"circle"})):t.icon?(e.openBlock(),e.createBlock(v,{key:1,icon:t.icon},null,8,["icon"])):e.renderSlot(d.$slots,"default",{key:2})],10,Se))}}),$e={class:"onyx-truncation-ellipsis"},Ne={class:"onyx-input__wrapper"},we=["placeholder","type","required","autocapitalize","autocomplete","autofocus","name","pattern","readonly","disabled","minlength","maxlength","aria-label","title"],Te={key:0,class:"onyx-input__footer onyx-text--small"},Le={key:0,class:"onyx-truncation-ellipsis"},Ie={key:1,class:"onyx-input__counter"},Me=e.defineComponent({__name:"OnyxInput",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},label:{},modelValue:{default:""},type:{default:"text"},placeholder:{},autocapitalize:{default:"sentences"},autocomplete:{},autofocus:{type:Boolean},name:{},pattern:{},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},maxlength:{},minlength:{},withCounter:{type:Boolean},message:{},hideLabel:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(o,{emit:n}){const t=o,l=n,{requiredMarkerClass:a,requiredTypeClass:d}=g(t),{densityClass:s}=_(t),r=e.computed({get:()=>t.modelValue,set:m=>l("update:modelValue",m)}),u=m=>{const i=m.target.value;l("change",i)},c=e.computed(()=>t.pattern instanceof RegExp?t.pattern.source:t.pattern),p=e.computed(()=>t.withCounter&&t.maxlength);return(m,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-input",e.unref(d),e.unref(s)])},[e.createElementVNode("label",null,[t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-input__label","onyx-text--small",e.unref(a)])},[e.createElementVNode("div",$e,e.toDisplayString(t.label),1)],2)),e.createElementVNode("div",Ne,[t.loading?(e.openBlock(),e.createBlock(x,{key:0,class:"onyx-input__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=y=>r.value=y),class:"onyx-input__native",placeholder:t.placeholder,type:t.type,required:t.required,autocapitalize:t.autocapitalize,autocomplete:t.autocomplete,autofocus:t.autofocus,name:t.name,pattern:c.value,readonly:t.readonly,disabled:t.disabled||t.loading,minlength:t.minlength,maxlength:t.maxlength,"aria-label":t.hideLabel?t.label:void 0,title:t.hideLabel?t.label:void 0,onChange:u,onFocus:i[1]||(i[1]=y=>l("focus")),onBlur:i[2]||(i[2]=y=>l("blur"))},null,40,we),[[e.vModelDynamic,r.value]])])]),t.message||p.value?(e.openBlock(),e.createElementBlock("div",Te,[t.message?(e.openBlock(),e.createElementBlock("span",Le,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(r.value.length)+"/"+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),ze=["email","password","search","tel","text","url"],qe=["none","sentences","words","characters"],De='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="M12.2 10.55v2h5.836l-8.193 8.193 1.414 1.414 8.193-8.193V19.8h2v-9.25z"/></svg>',Pe=o=>/^http(s?):\/\//.test(o),Ae=["href","target","rel"],Ue=e.defineComponent({__name:"OnyxLink",props:{href:{},target:{default:"_self"},withExternalIcon:{type:[Boolean,String],default:"auto"}},emits:["click"],setup(o,{emit:n}){const t=o,l=n,a=e.computed(()=>t.withExternalIcon!=="auto"?t.withExternalIcon:Pe(t.href));return(d,s)=>(e.openBlock(),e.createElementBlock("a",{class:"onyx-link",href:t.href,target:t.target,rel:t.target==="_blank"?"noreferrer":void 0,onClick:s[0]||(s[0]=r=>l("click"))},[e.renderSlot(d.$slots,"default"),a.value?(e.openBlock(),e.createBlock(v,{key:0,class:"onyx-link__icon",icon:e.unref(De),size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0)],8,Ae))}}),Re=["_self","_blank","_parent","_top"],I=o=>o,Fe=(()=>{let o=1;return()=>o++})(),S=o=>`${o}-${Fe()}`,Ye=I(o=>{const n=e.computed(()=>e.unref(o.multiselect)??!1),t=new Map,l=s=>(t.has(s)||t.set(s,S("listbox-option")),t.get(s)),a=e.ref(!1);e.watchEffect(()=>{var r;if(o.activeOption.value==null||!a.value)return;const s=l(o.activeOption.value);(r=document.getElementById(s))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})});const d=s=>{var r,u,c,p,m,i,y;switch(s.key){case" ":s.preventDefault(),o.activeOption.value!=null&&((r=o.onSelect)==null||r.call(o,o.activeOption.value));break;case"ArrowUp":case"ArrowDown":if(s.preventDefault(),o.activeOption.value==null){(u=o.onActivateFirst)==null||u.call(o);return}s.key==="ArrowDown"?(c=o.onActivateNext)==null||c.call(o,o.activeOption.value):(p=o.onActivatePrevious)==null||p.call(o,o.activeOption.value);break;case"Home":s.preventDefault(),(m=o.onActivateFirst)==null||m.call(o);break;case"End":s.preventDefault(),(i=o.onActivateLast)==null||i.call(o);break;default:(y=o.onTypeAhead)==null||y.call(o,s.key)}};return{elements:{listbox:e.computed(()=>({role:"listbox","aria-multiselectable":n.value,"aria-label":e.unref(o.label),tabindex:"0","aria-activedescendant":o.activeOption.value!=null?l(o.activeOption.value):void 0,onFocus:()=>a.value=!0,onBlur:()=>a.value=!1,onKeydown:d})),group:e.computed(()=>s=>({role:"group","aria-label":s.label})),option:e.computed(()=>s=>{const r=s.selected??!1;return{id:l(s.value),role:"option","aria-label":s.label,"aria-checked":n.value?r:void 0,"aria-selected":n.value?void 0:r,"aria-disabled":s.disabled,onClick:()=>{var u;return(u=o.onSelect)==null?void 0:u.call(o,s.value)}}})},state:{isFocused:a}}}),je=I(o=>{const n=S("tooltip"),t=e.ref(!1);let l;const a=e.computed(()=>{const i=e.unref(o.open);return typeof i!="object"?200:i.debounce}),d=e.computed(()=>{const i=e.unref(o.open);return typeof i!="object"?i:i.type}),s=e.computed({get:()=>t.value,set:i=>{clearTimeout(l),l=setTimeout(()=>{t.value=i},a.value)}}),r=e.computed(()=>typeof d.value=="boolean"?d.value:s.value),u=()=>{t.value=!t.value},c=e.computed(()=>{if(d.value==="hover")return{onMouseover:()=>s.value=!0,onMouseout:()=>s.value=!1,onFocusin:()=>t.value=!0,onFocusout:()=>t.value=!1}}),p=i=>{i.key==="Escape"&&(t.value=!1)},m=i=>{var h;const y=(h=document.getElementById(n))==null?void 0:h.parentElement;if(!y||!(i.target instanceof Node))return;!y.contains(i.target)&&(t.value=!1)};return document.addEventListener("keydown",p),e.watchEffect(()=>{d.value==="click"?document.addEventListener("click",m):document.removeEventListener("click",m)}),e.onBeforeUnmount(()=>{document.addEventListener("keydown",p),document.addEventListener("click",m)}),{elements:{trigger:e.computed(()=>({"aria-describedby":n,onClick:d.value==="click"?u:void 0,...c.value})),tooltip:e.computed(()=>({role:"tooltip",id:n,tabindex:"-1",...c.value}))},state:{isVisible:r}}}),Ze={class:"onyx-truncation-ellipsis"},Ge=e.defineComponent({__name:"OnyxListboxOption",props:{active:{type:Boolean}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["onyx-listbox-option",{"onyx-listbox-option--active":n.active}])},[e.createElementVNode("span",Ze,[e.renderSlot(t.$slots,"default")])],2))}}),He={class:"onyx-listbox"},Ke={key:0,class:"onyx-listbox__message onyx-text--small"},Xe=e.defineComponent({__name:"OnyxListbox",props:{label:{},options:{},message:{},modelValue:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,l=n,a=e.ref();e.watch(()=>t.modelValue,r=>{a.value=r});const{elements:{listbox:d,option:s}}=Ye({label:e.computed(()=>t.label),selectedOption:e.computed(()=>t.modelValue),activeOption:a,onSelect:r=>{t.modelValue===r?l("update:modelValue",void 0):l("update:modelValue",r)},onActivateFirst:()=>{var r;return a.value=(r=t.options.at(0))==null?void 0:r.id},onActivateLast:()=>{var r;return a.value=(r=t.options.at(-1))==null?void 0:r.id},onActivateNext:r=>{const u=t.options.findIndex(c=>c.id===r);u<t.options.length-1&&(a.value=t.options[u+1].id)},onActivatePrevious:r=>{const u=t.options.findIndex(c=>c.id===r);u>0&&(a.value=t.options[u-1].id)},onTypeAhead:r=>{const u=t.options.find(c=>c.label.toLowerCase().trim().startsWith(r.toLowerCase()));u&&(a.value=u.id)}});return(r,u)=>(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("ul",e.mergeProps(e.unref(d),{class:"onyx-listbox__options"}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createBlock(Ge,e.mergeProps({key:c.id.toString()},e.unref(s)({value:c.id,label:c.label,disabled:c.disabled,selected:c.id===t.modelValue}),{active:c.id===a.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1040,["active"]))),128))],16),t.message?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0)]))}}),We={key:0,class:"onyx-page__sidebar"},Je={class:"onyx-page__main"},Qe={key:1,class:"onyx-page__footer"},et={key:2,class:"onyx-page__toasts"},tt=e.defineComponent({__name:"OnyxPageLayout",props:{footerAsideSidebar:{type:Boolean},hideSidebar:{type:Boolean}},setup(o){const n=o,t=e.useSlots(),l=e.computed(()=>{let a="";return!t.footer&&t.sidebar&&(a="onyx-page--side-main"),t.footer&&(!t.sidebar||n.hideSidebar)&&(a="onyx-page--main-footer"),t.footer&&t.sidebar&&(n.footerAsideSidebar?a="onyx-page--side-main-footer-partial":a="onyx-page--side-main-footer-full"),a});return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-page",l.value])},[e.unref(t).sidebar&&!n.hideSidebar?(e.openBlock(),e.createElementBlock("aside",We,[e.renderSlot(a.$slots,"sidebar")])):e.createCommentVNode("",!0),e.createElementVNode("main",Je,[e.renderSlot(a.$slots,"default")]),e.unref(t).footer?(e.openBlock(),e.createElementBlock("footer",Qe,[e.renderSlot(a.$slots,"footer")])):e.createCommentVNode("",!0),e.unref(t).toasts?(e.openBlock(),e.createElementBlock("div",et,[e.renderSlot(a.$slots,"toasts")])):e.createCommentVNode("",!0)],2))}}),nt=["title"],ot=["required","name","value","checked","disabled"],w=e.defineComponent({__name:"OnyxRadioButton",props:{id:{},label:{},value:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},truncation:{default:"ellipsis"},skeleton:{type:Boolean},density:{},name:{},selected:{type:Boolean,default:!1},required:{type:Boolean,default:!1},errorMessage:{}},setup(o){const n=o,t=e.ref(),{densityClass:l}=_(n);return e.watchEffect(()=>{var a;return(a=t.value)==null?void 0:a.setCustomValidity(n.errorMessage??"")}),(a,d)=>n.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-radio-button-skeleton",e.unref(l)])},[e.createVNode(k,{class:"onyx-radio-button-skeleton__input"}),e.createVNode(k,{class:"onyx-radio-button-skeleton__label"})],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-radio-button",e.unref(l)]),title:n.errorMessage},[n.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-radio-button__loading",type:"circle"})):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"selectorRef",ref:t,class:"onyx-radio-button__selector",type:"radio",required:n.required,name:n.name,value:n.id,checked:n.selected,disabled:n.disabled},null,8,ot)),e.createElementVNode("span",{class:e.normalizeClass(["onyx-radio-button__label",[`onyx-truncation-${n.truncation}`]])},e.toDisplayString(n.label),3)],10,nt))}}),lt=["disabled"],at={key:0,class:"onyx-radio-button-group__headline"},st=e.defineComponent({__name:"OnyxRadioButtonGroup",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},name:{default:()=>S("radio-button-group-name")},modelValue:{},headline:{default:""},disabled:{type:Boolean,default:!1},errorMessage:{default:""},direction:{default:"vertical"},options:{},skeleton:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),{requiredMarkerClass:a,requiredTypeClass:d}=g(t),s=n,r=u=>s("update:modelValue",t.options.find(({id:c})=>u.target.value===c));return(u,c)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-radio-button-group",e.unref(l),e.unref(d)]),disabled:t.disabled,onChange:c[0]||(c[0]=p=>r(p))},[t.headline?(e.openBlock(),e.createElementBlock("legend",at,[e.createVNode(V,{is:"h3",class:e.normalizeClass(e.unref(a))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.headline),1)]),_:1},8,["class"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["onyx-radio-button-group__content",{"onyx-radio-button-group__content--horizontal":t.direction==="horizontal"}])},[t.skeleton===void 0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,p=>{var m;return e.openBlock(),e.createBlock(w,e.mergeProps({key:p.id.toString()},p,{name:t.name,"error-message":t.errorMessage,selected:p.id===((m=t.modelValue)==null?void 0:m.id),required:t.required}),null,16,["name","error-message","selected","required"])}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,p=>(e.openBlock(),e.createBlock(w,{id:`skeleton-${p}`,key:p,label:"Skeleton ${i}",name:t.name,skeleton:""},null,8,["id","name"]))),128))],2)],42,lt))}}),rt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="m22.29 18.83 1.41 1.41-7.71 7.71-7.71-7.71 1.41-1.41 6.29 6.29 6.29-6.29ZM16 6.87l6.29 6.29 1.41-1.41-7.71-7.71-7.71 7.71 1.41 1.41 6.29-6.29Z"/></svg>',ct={class:"onyx-truncation-ellipsis"},it={class:"onyx-select__wrapper"},dt=["placeholder","required","disabled","aria-label","title"],ut={class:"onyx-badge"},pt={key:0,class:"onyx-select__footer onyx-text--small onyx-truncation-ellipsis"},mt=e.defineComponent({__name:"OnyxSelect",props:{density:{},required:{type:Boolean},requiredMarker:{},modelValue:{},label:{},hideLabel:{type:Boolean,default:!1},disabled:{type:Boolean},skeleton:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},placeholder:{},multiple:{},message:{}},emits:["update:modelValue"],setup(o){const n=o,{t}=b(),l=e.computed(()=>{var c;if(n.multiple)return typeof n.multiple=="boolean"?"summary":((c=n.multiple)==null?void 0:c.textMode)??"summary"}),a=e.computed(()=>{if(n.modelValue&&l.value==="preview")return n.modelValue.length}),d=e.computed(()=>{if(Array.isArray(n.modelValue)){const c=n.modelValue.length;if(!c)return"";if(c===1)return n.modelValue[0];switch(l.value){case"preview":return n.modelValue.join(", ");case"summary":default:return t.value("selections.currentSelection",{n:c})}}return n.modelValue??""}),{requiredMarkerClass:s,requiredTypeClass:r}=g(n),{densityClass:u}=_(n);return(c,p)=>n.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-select-skeleton",e.unref(u)])},[n.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-select-skeleton__label"})),e.createVNode(e.unref(k),{class:"onyx-select-skeleton__input"})],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["onyx-select",e.unref(r),e.unref(u),n.readonly?"onyx-select--readonly":"onyx-select--editable"])},[e.createElementVNode("label",null,[n.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-select__label","onyx-text--small",e.unref(s)])},[e.createElementVNode("div",ct,e.toDisplayString(n.label),1)],2)),e.createElementVNode("div",it,[n.loading?(e.openBlock(),e.createBlock(x,{key:0,class:"onyx-select__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),class:"onyx-select__input onyx-truncation-ellipsis",placeholder:n.placeholder,type:"text",role:"presentation",required:n.required,readonly:"",disabled:n.disabled||n.loading,"aria-label":n.hideLabel?n.label:void 0,title:n.hideLabel?n.label:void 0},null,8,dt),[[e.vModelText,d.value]]),a.value?(e.openBlock(),e.createBlock(e.unref(D),{key:1,text:d.value,position:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",ut,e.toDisplayString(a.value),1)]),_:1},8,["text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v),{icon:e.unref(rt),class:"onyx-select__icon"},null,8,["icon"])])]),n.message?(e.openBlock(),e.createElementBlock("div",pt,e.toDisplayString(n.message),1)):e.createCommentVNode("",!0)],2))}}),yt=["summary","preview"],M=(o,n)=>{const t=Object.entries(o).filter(([a,d])=>d!==void 0),l=Object.entries(n).filter(([a,d])=>d!==void 0);return t.length!==l.length?!1:t.every(([a,d])=>d===n[a])},z=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([o,n])=>n.enumerable).map(([o])=>o),q=o=>z().reduce((n,t)=>(n[t]=o[t],n),{}),ft=o=>{if(o.valueMissing)return"valueMissing";const n=z().filter(t=>t!=="valid").sort();for(const t of n)if(t in o&&o[t])return t},_t='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="m21.311 10.793-8.293 8.293-3.291-3.292-1.415 1.415 4.706 4.705 9.707-9.707z"/></svg>',kt='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="m22.707 10.707-1.414-1.414L16 14.586l-5.293-5.293-1.414 1.414L14.586 16l-5.293 5.293 1.414 1.414L16 17.414l5.293 5.293 1.414-1.414L17.414 16z"/></svg>',vt=["title"],xt=["aria-label","disabled","required"],ht={class:"onyx-switch__container"},gt={class:"onyx-switch__icon"},bt=e.defineComponent({__name:"OnyxSwitch",props:{density:{},required:{type:Boolean},requiredMarker:{},modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},errorMessage:{},hideLabel:{type:Boolean},truncation:{default:"ellipsis"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","validityChange"],setup(o,{emit:n}){var m;const t=o,l=n,{requiredMarkerClass:a,requiredTypeClass:d}=g(t),{errorMessage:s}=e.toRefs(t),{densityClass:r}=_(t),u=e.ref(),c=e.ref((m=u.value)==null?void 0:m.validity),p=e.computed({get:()=>t.modelValue,set:i=>{l("update:modelValue",i)}});return e.watch([u,s],()=>{u.value&&u.value.setCustomValidity(t.errorMessage||"")}),e.watch([u,p,s],()=>{if(!u.value)return;const i=q(u.value.validity);(!c.value||!M(i,c.value))&&(c.value=i,l("validityChange",c.value))},{immediate:!0}),(i,y)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-switch-skeleton",e.unref(r)])},[e.createVNode(k,{class:"onyx-switch-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-switch-skeleton__label"}))],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-switch",[e.unref(d),e.unref(r)]]),title:t.hideLabel?t.label:void 0},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputElement",ref:u,"onUpdate:modelValue":y[0]||(y[0]=f=>p.value=f),type:"checkbox",role:"switch",class:e.normalizeClass({"onyx-switch__input":!0,"onyx-switch__loading":t.loading}),"aria-label":t.hideLabel?t.label:void 0,disabled:t.disabled||t.loading,required:t.required},null,10,xt),[[e.vModelCheckbox,p.value]]),e.createElementVNode("span",ht,[e.createElementVNode("span",gt,[t.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-switch__spinner",type:"circle"})):(e.openBlock(),e.createBlock(e.unref(v),{key:1,icon:p.value?e.unref(_t):e.unref(kt),size:"24px"},null,8,["icon"]))])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["onyx-switch__label",[`onyx-truncation-${t.truncation}`,e.unref(a)]])},e.toDisplayString(t.label),3))],10,vt))}}),Bt={class:"onyx-tooltip-wrapper"},D=e.defineComponent({__name:"OnyxTooltip",props:{text:{},icon:{},color:{default:"neutral"},position:{default:"top"},fitParent:{type:Boolean,default:!1},open:{type:[String,Boolean,Object],default:"hover"}},setup(o){const n=o,{elements:{trigger:t,tooltip:l},state:{isVisible:a}}=je({open:e.computed(()=>n.open)});return(d,s)=>(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("div",e.mergeProps(e.unref(l),{class:["onyx-tooltip onyx-text--small onyx-truncation-multiline",{"onyx-tooltip--danger":n.color==="danger","onyx-tooltip--bottom":n.position==="bottom","onyx-tooltip--fit-parent":n.fitParent,"onyx-tooltip--hidden":!e.unref(a)}]}),[n.icon?(e.openBlock(),e.createBlock(v,{key:0,icon:n.icon,size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"tooltip",{},()=>[e.createElementVNode("span",null,e.toDisplayString(n.text),1)])],16),e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(t))),[e.renderSlot(d.$slots,"default")],16)]))}}),Ct=["top","bottom"],Et=Object.keys(C.validations.typeMismatch),Vt={key:0,class:"onyx-test-input__error","aria-live":"polite"},St={class:"onyx-test-input__info"},Ot=e.defineComponent({__name:"TestInput",props:{modelValue:{default:""},label:{default:""},errorMessage:{},required:{type:Boolean},pattern:{},type:{default:"text"},max:{},maxLength:{},min:{},step:{},minLength:{}},emits:["update:modelValue","change","validityChange"],setup(o,{emit:n}){var i;const t=o,l=n,{t:a}=b(),{errorMessage:d}=e.toRefs(t),s=e.ref(!1),r=e.ref(null),u=e.ref((i=r.value)==null?void 0:i.validity),c=e.computed({get:()=>t.modelValue,set:y=>l("update:modelValue",y)}),p=e.computed(()=>{if(!u.value||u.value.valid)return"";const y=ft(u.value);if(t.errorMessage||y==="customError")return t.errorMessage;if(!y)return"";if(y==="typeMismatch"){const f=Et.includes(t.type)?t.type:"generic";return a.value(`validations.typeMismatch.${f}`,{value:c.value})}return a.value(`validations.${y}`,{value:c.value,n:c.value.toString().length,minLength:t.minLength,maxLength:t.maxLength,min:t.min,max:t.max,step:t.step})}),m=y=>{const f=y.target;l("change",f.value)};return e.watch([r,d],()=>{r.value&&r.value.setCustomValidity(t.errorMessage||"")}),e.watch([r,c,d],()=>{if(!r.value)return;const y=q(r.value.validity);(!u.value||!M(y,u.value))&&(u.value=y,l("validityChange",u.value))},{immediate:!0}),(y,f)=>{var h,O;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["onyx-test-input",{"onyx-test-input--touched":s.value}])},[e.createElementVNode("span",{class:e.normalizeClass(["onyx-test-input__label",{"onyx-test-input__label--required":t.required}])},e.toDisplayString(t.label),3),e.withDirectives(e.createElementVNode("input",e.mergeProps(t,{ref_key:"inputElement",ref:r,"onUpdate:modelValue":f[0]||(f[0]=$=>c.value=$),onChange:m,onBlur:f[1]||(f[1]=$=>s.value=!0)}),null,16),[[e.vModelDynamic,c.value]]),s.value&&!((h=u.value)!=null&&h.valid)?(e.openBlock(),e.createElementBlock("p",Vt,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0),e.createElementVNode("p",St,' Model value: "'+e.toDisplayString(c.value)+'", is valid: '+e.toDisplayString((O=u.value)==null?void 0:O.valid),1)],2)}}}),$t=["primary","secondary","neutral","danger","warning","success","info"],Nt=["small","default","large"],wt=["ellipsis","multiline"],Tt=["horizontal","vertical"],Lt=o=>({install:n=>{ke(n,o.i18n);const t=n.runWithContext(()=>b());e.watchEffect(()=>It(t.t.value("optional")))}}),It=o=>globalThis.document.body.style.setProperty("--onyx-global-optional-text",o);exports.AUTOCAPITALIZE=qe;exports.BUTTON_MODES=pe;exports.BUTTON_TYPES=de;exports.BUTTON_VARIATIONS=ue;exports.DENSITY=Y;exports.DIRECTIONS=Tt;exports.HEADLINE_TYPES=Ee;exports.ICON_SIZES=Ve;exports.INPUT_TYPES=ze;exports.LINK_TARGETS=Re;exports.MULTISELECT_TEXT_MODE=yt;exports.ONYX_COLORS=$t;exports.OnyxAppLayout=F;exports.OnyxBadge=me;exports.OnyxButton=ie;exports.OnyxCheckboxGroup=Ce;exports.OnyxHeadline=V;exports.OnyxIcon=v;exports.OnyxIconButton=Oe;exports.OnyxInput=Me;exports.OnyxLink=Ue;exports.OnyxListbox=Xe;exports.OnyxLoadingIndicator=x;exports.OnyxPageLayout=tt;exports.OnyxRadioButtonGroup=st;exports.OnyxSelect=mt;exports.OnyxSkeleton=k;exports.OnyxSwitch=bt;exports.OnyxTooltip=D;exports.TEXT_SIZES=Nt;exports.TOOLTIP_POSITIONS=Ct;exports.TRUNCATION_TYPES=wt;exports.TestInput=Ot;exports.createOnyx=Lt;exports.useDensity=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A={key:0,class:"onyx-app__nav"},U={class:"onyx-app__page"},R={key:1,class:"onyx-app__page-overlay"},F={key:2,class:"onyx-app__app-overlay"},Y=e.defineComponent({__name:"OnyxAppLayout",props:{navBarAlignment:{default:"top"}},setup(o){const n=o,t=e.useSlots();return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-app",{"onyx-app--horizontal":n.navBarAlignment==="left"}])},[e.unref(t).navBar?(e.openBlock(),e.createElementBlock("nav",A,[e.renderSlot(l.$slots,"navBar")])):e.createCommentVNode("",!0),e.createElementVNode("div",U,[e.renderSlot(l.$slots,"default")]),e.unref(t).pageOverlay?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"pageOverlay")])):e.createCommentVNode("",!0),e.unref(t).appOverlay?(e.openBlock(),e.createElementBlock("div",F,[e.renderSlot(l.$slots,"appOverlay")])):e.createCommentVNode("",!0)],2))}}),j=["cozy","default","compact"],_=o=>({densityClass:e.computed(()=>({[`onyx-density-${o.density}`]:o.density}))}),Z=["innerHTML"],v=e.defineComponent({__name:"OnyxIcon",props:{icon:{},size:{default:"24px"},color:{default:"currentColor"}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createElementBlock("figure",{class:e.normalizeClass(["onyx-icon",[n.size!=="24px"?`onyx-icon--${n.size}`:"",n.color!=="currentColor"?`onyx-icon--${n.color}`:""]]),"aria-hidden":"true",innerHTML:n.icon},null,10,Z))}}),E=(o,n)=>{const t=o.__vccOpts||o;for(const[l,a]of n)t[l]=a;return t},G={},H={class:"onyx-circle-spinner",viewBox:"0 0 50 50"},K=e.createElementVNode("circle",{class:"onyx-circle-spinner__circle",cx:"50%",cy:"50%",r:"45%"},null,-1),X=[K];function W(o,n){return e.openBlock(),e.createElementBlock("svg",H,X)}const J=E(G,[["render",W]]),Q={},ee={class:"onyx-loading-dots"},te=e.createElementVNode("span",{class:"onyx-loading-dots__center"},null,-1),ne=[te];function oe(o,n){return e.openBlock(),e.createElementBlock("div",ee,ne)}const le=E(Q,[["render",oe]]),x=e.defineComponent({__name:"OnyxLoadingIndicator",props:{type:{default:"dots"}},setup(o){const n=o;return(t,l)=>n.type==="circle"?(e.openBlock(),e.createBlock(J,{key:0})):n.type==="dots"?(e.openBlock(),e.createBlock(le,{key:1})):e.createCommentVNode("",!0)}}),ae={},se={"aria-hidden":"true",class:"onyx-skeleton"};function re(o,n){return e.openBlock(),e.createElementBlock("figure",se)}const k=E(ae,[["render",re]]),ce=["disabled"],ie={key:2,class:"onyx-button__label onyx-truncation-ellipsis"},de=e.defineComponent({__name:"OnyxButton",props:{density:{},label:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},type:{default:"button"},variation:{default:"primary"},mode:{default:"default"},icon:{},skeleton:{type:Boolean,default:!1}},emits:["click"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n;return(d,s)=>t.skeleton?(e.openBlock(),e.createBlock(k,{key:0,class:e.normalizeClass(["onyx-button-skeleton",e.unref(l)])},null,8,["class"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["onyx-button",`onyx-button--${t.variation}`,`onyx-button--${t.mode}`,{"onyx-button--loading":t.loading},e.unref(l)]),disabled:t.disabled||t.loading,onClick:s[0]||(s[0]=r=>a("click"))},[t.icon&&!t.loading?(e.openBlock(),e.createBlock(v,{key:0,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(x,{key:1,class:"onyx-button__loading"})):(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(t.label),1))],10,ce))}}),ue=["button","submit","reset"],pe=["primary","secondary","danger"],me=["default","outline","plain"],T=e.defineComponent({__name:"OnyxBadge",props:{density:{},variation:{default:"primary"},icon:{}},setup(o){const n=o,{densityClass:t}=_(n);return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-badge",["onyx-truncation-ellipsis","onyx-text",`onyx-badge--${n.variation}`,e.unref(t)]])},[n.icon?(e.openBlock(),e.createBlock(v,{key:0,class:"onyx-badge__icon",icon:n.icon,size:n.density==="compact"?"16px":"24px"},null,8,["icon","size"])):e.renderSlot(l.$slots,"default",{key:1})],2))}}),ye="(optional)",fe={tooShort:"Please lengthen this text to {minLength} characters or more (you are currently using 1 character) | Please lengthen this text to {minLength} characters or more (you are currently using {n} characters)",tooLong:"Please shorten this text to {maxLength} characters or less (you are currently using 1 character) | Please shorten this text to {maxLength} characters or less (you are currently using {n} characters)",rangeUnderflow:"Value must be greater than or equal to {min}",rangeOverflow:"Value must be less than or equal to {max}",patternMismatch:"Please match the format requested.",valueMissing:"Please fill in this field.",stepMismatch:"Please enter a value that is a multiple of {step}.",badInput:'"{value}" does not match the expected type.',typeMismatch:{generic:'"{value}" does not match the expected type.',email:'"{value}" must be a valid email address.',number:'"{value}" must be a number.',tel:'"{value}" must be a valid phone number.',url:'"{value}" must a valid URL.'}},_e={selectAll:"Select all",currentSelection:"{n} selected"},C={optional:ye,validations:fe,selections:_e},L=Symbol(),I=o=>{const n=e.computed(()=>e.unref(o==null?void 0:o.locale)??"en-US"),t=e.computed(()=>o!=null&&o.messages&&n.value in o.messages?o.messages[n.value]:C),l=e.computed(()=>(a,d={})=>{let s=N(a,t.value)??N(a,C)??"";const r=typeof d.n=="number"?d.n:void 0;return s=ve(s,r),xe(s,d)});return{locale:n,t:l}},ke=(o,n)=>o.provide(L,I(n)),b=()=>e.inject(L,()=>I(),!0),N=(o,n)=>{const t=o.split(".").reduce((l,a)=>!l||typeof l=="string"?l:l[a],n);return t&&typeof t=="string"?t:void 0},ve=(o,n)=>{const t=o.split(" | ").map(a=>a.trim());if(t.length<=1)return o;let l=1;return n===0&&(l=0),n&&(n<=0||n>1)&&(l=2),t.length===2?l===1?t[0]:t[1]:t[l]},xe=(o,n)=>n?Object.entries(n).reduce((l,[a,d])=>d===void 0?l:l.replace(new RegExp(`{${a}}`,"gi"),d.toString()),o).replace(/\s?{.*}\s?/gi,""):o,g=o=>({requiredTypeClass:e.computed(()=>({[`onyx-use-${o.requiredMarker}`]:o.requiredMarker})),requiredMarkerClass:e.computed(()=>({"onyx-required-marker":o.required,"onyx-optional-marker":!o.required}))}),he={class:"onyx-checkbox__container"},ge=["aria-label","title","indeterminate","disabled","required"],B=e.defineComponent({__name:"OnyxCheckbox",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},modelValue:{type:Boolean,default:!1},label:{},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},hideLabel:{type:Boolean},truncation:{default:"ellipsis"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{requiredMarkerClass:l,requiredTypeClass:a}=g(t),d=n,s=e.computed({get:()=>t.modelValue,set:c=>d("update:modelValue",c)}),r=e.ref(!1),{densityClass:u}=_(t);return(c,p)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-checkbox-skeleton",e.unref(u)])},[e.createVNode(k,{class:"onyx-checkbox-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-checkbox-skeleton__label"}))],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-checkbox",[e.unref(a),e.unref(u)]])},[e.createElementVNode("div",he,[t.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-checkbox__loading",type:"circle"})):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":p[0]||(p[0]=m=>s.value=m),"aria-label":t.hideLabel?t.label:void 0,title:t.hideLabel?t.label:void 0,class:e.normalizeClass(["onyx-checkbox__input",{"onyx-checkbox__input--touched":r.value}]),type:"checkbox",indeterminate:t.indeterminate,disabled:t.disabled,required:t.required,onBlur:p[1]||(p[1]=m=>r.value=!0)},null,42,ge)),[[e.vModelCheckbox,s.value]])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("p",{class:e.normalizeClass(["onyx-checkbox__label",[`onyx-truncation-${t.truncation}`,t.truncation==="multiline"?e.unref(l):void 0]])},e.toDisplayString(t.label),3),t.truncation==="ellipsis"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-checkbox__marker",[e.unref(l)]])},null,2)):e.createCommentVNode("",!0)],64))],2))}}),be=["disabled"],Be={key:0,class:"onyx-checkbox-group__label"},Ce=e.defineComponent({__name:"OnyxCheckboxGroup",props:{density:{},options:{},modelValue:{default:()=>[]},headline:{},direction:{default:"vertical"},withCheckAll:{type:Boolean,default:!1},checkAllLabel:{},disabled:{type:Boolean,default:!1},skeleton:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n,{t:d}=b(),s=(p,m)=>{const i=m?[...t.modelValue,p]:t.modelValue.filter(y=>y!==p);a("update:modelValue",i)},r=e.computed(()=>t.options.filter(p=>!p.disabled&&!p.skeleton)),u=p=>{const m=p?r.value.map(({id:i})=>i):[];a("update:modelValue",m)},c=e.computed(()=>{const p=r.value.map(({id:i})=>i),m=t.modelValue.filter(i=>p.includes(i));return!p.length||!m.length?{modelValue:!1}:m.length===p.length?{modelValue:!0}:{indeterminate:!0,modelValue:!1}});return(p,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-checkbox-group",e.unref(l)]),disabled:t.disabled},[t.headline?(e.openBlock(),e.createElementBlock("legend",Be,[e.createVNode(e.unref(V),{is:"h3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.headline),1)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["onyx-checkbox-group__content",{"onyx-checkbox-group__content--horizontal":t.direction==="horizontal"}])},[t.skeleton===void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.withCheckAll?(e.openBlock(),e.createBlock(B,e.mergeProps({key:0},c.value,{label:t.checkAllLabel||e.unref(d)("selections.selectAll"),"onUpdate:modelValue":u}),null,16,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createBlock(B,e.mergeProps({key:i.id.toString()},i,{"model-value":t.modelValue.includes(i.id),"onUpdate:modelValue":y=>s(i.id,y)}),null,16,["model-value","onUpdate:modelValue"]))),128))],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,i=>(e.openBlock(),e.createBlock(B,{key:i,label:`Skeleton ${i}`,skeleton:""},null,8,["label"]))),128))],2)],10,be))}}),Ee='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="M25.899 6.1C23.166 3.367 19.583 2 16 2S8.834 3.367 6.101 6.1c-5.467 5.467-5.467 14.332 0 19.799C8.834 28.633 12.417 30 16 30s7.166-1.367 9.899-4.101c5.468-5.467 5.468-14.331 0-19.799m-1.414 18.385C22.219 26.752 19.205 28 16 28s-6.219-1.248-8.485-3.515C5.248 22.219 4 19.205 4 16s1.248-6.219 3.515-8.485C9.781 5.248 12.795 4 16 4s6.219 1.248 8.485 3.515S28 12.795 28 16s-1.248 6.219-3.515 8.485"/><path d="M20.814 9.771 16 14.586l-4.814-4.815-1.415 1.414L14.586 16l-4.815 4.814 1.415 1.415L16 17.414l4.814 4.815 1.415-1.415L17.414 16l4.815-4.815z"/></svg>',Ve={class:"onyx-empty"},Se={class:"onyx-empty__label onyx-text onyx-truncation-multiline"},Oe=e.defineComponent({__name:"OnyxEmpty",setup(o){return(n,t)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(n.$slots,"icon",{},()=>[e.createVNode(v,{icon:e.unref(Ee),size:"48px"},null,8,["icon"])]),e.createElementVNode("div",Se,[e.renderSlot(n.$slots,"default")])]))}}),V=e.defineComponent({__name:"OnyxHeadline",props:{is:{},monospace:{type:Boolean,default:!1}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.is),{class:e.normalizeClass(["onyx-headline",`onyx-headline--${n.is}`,n.monospace?"onyx-headline--monospace":""])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["class"]))}}),$e=["h1","h2","h3","h4","h5","h6"],Ne=["12px","16px","24px","32px","48px","64px","96px"],we=["aria-label","title","disabled"],Te=e.defineComponent({__name:"OnyxIconButton",props:{density:{},label:{},disabled:{type:Boolean,default:!1},type:{default:"button"},variation:{default:"primary"},loading:{type:Boolean},icon:{}},emits:["click"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),a=n;return(d,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["onyx-icon-button",[`onyx-icon-button--${t.variation}`,{"onyx-icon-button--loading":t.loading},e.unref(l)]]),"aria-label":t.label,title:t.label,disabled:t.disabled||t.loading,onClick:s[0]||(s[0]=r=>a("click"))},[t.loading?(e.openBlock(),e.createBlock(x,{key:0,type:"circle"})):t.icon?(e.openBlock(),e.createBlock(v,{key:1,icon:t.icon},null,8,["icon"])):e.renderSlot(d.$slots,"default",{key:2})],10,we))}}),Le={class:"onyx-truncation-ellipsis"},Ie={class:"onyx-input__wrapper"},Me=["placeholder","type","required","autocapitalize","autocomplete","autofocus","name","pattern","readonly","disabled","minlength","maxlength","aria-label","title"],ze={key:0,class:"onyx-input__footer onyx-text--small"},qe={key:0,class:"onyx-truncation-ellipsis"},De={key:1,class:"onyx-input__counter"},Pe=e.defineComponent({__name:"OnyxInput",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},label:{},modelValue:{default:""},type:{default:"text"},placeholder:{},autocapitalize:{default:"sentences"},autocomplete:{},autofocus:{type:Boolean},name:{},pattern:{},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},maxlength:{},minlength:{},withCounter:{type:Boolean},message:{},hideLabel:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(o,{emit:n}){const t=o,l=n,{requiredMarkerClass:a,requiredTypeClass:d}=g(t),{densityClass:s}=_(t),r=e.computed({get:()=>t.modelValue,set:m=>l("update:modelValue",m)}),u=m=>{const i=m.target.value;l("change",i)},c=e.computed(()=>t.pattern instanceof RegExp?t.pattern.source:t.pattern),p=e.computed(()=>t.withCounter&&t.maxlength);return(m,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-input",e.unref(d),e.unref(s)])},[e.createElementVNode("label",null,[t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-input__label","onyx-text--small",e.unref(a)])},[e.createElementVNode("div",Le,e.toDisplayString(t.label),1)],2)),e.createElementVNode("div",Ie,[t.loading?(e.openBlock(),e.createBlock(x,{key:0,class:"onyx-input__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=y=>r.value=y),class:"onyx-input__native",placeholder:t.placeholder,type:t.type,required:t.required,autocapitalize:t.autocapitalize,autocomplete:t.autocomplete,autofocus:t.autofocus,name:t.name,pattern:c.value,readonly:t.readonly,disabled:t.disabled||t.loading,minlength:t.minlength,maxlength:t.maxlength,"aria-label":t.hideLabel?t.label:void 0,title:t.hideLabel?t.label:void 0,onChange:u,onFocus:i[1]||(i[1]=y=>l("focus")),onBlur:i[2]||(i[2]=y=>l("blur"))},null,40,Me),[[e.vModelDynamic,r.value]])])]),t.message||p.value?(e.openBlock(),e.createElementBlock("div",ze,[t.message?(e.openBlock(),e.createElementBlock("span",qe,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(r.value.length)+"/"+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),Ae=["email","password","search","tel","text","url"],Ue=["none","sentences","words","characters"],Re='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="M12.2 10.55v2h5.836l-8.193 8.193 1.414 1.414 8.193-8.193V19.8h2v-9.25z"/></svg>',Fe=o=>/^http(s?):\/\//.test(o),Ye=["href","target","rel"],je=e.defineComponent({__name:"OnyxLink",props:{href:{},target:{default:"_self"},withExternalIcon:{type:[Boolean,String],default:"auto"}},emits:["click"],setup(o,{emit:n}){const t=o,l=n,a=e.computed(()=>t.withExternalIcon!=="auto"?t.withExternalIcon:Fe(t.href));return(d,s)=>(e.openBlock(),e.createElementBlock("a",{class:"onyx-link",href:t.href,target:t.target,rel:t.target==="_blank"?"noreferrer":void 0,onClick:s[0]||(s[0]=r=>l("click"))},[e.renderSlot(d.$slots,"default"),a.value?(e.openBlock(),e.createBlock(v,{key:0,class:"onyx-link__icon",icon:e.unref(Re),size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0)],8,Ye))}}),Ze=["_self","_blank","_parent","_top"],M=o=>o,Ge=(()=>{let o=1;return()=>o++})(),S=o=>`${o}-${Ge()}`,He=M(o=>{const n=e.computed(()=>e.unref(o.multiselect)??!1),t=new Map,l=s=>(t.has(s)||t.set(s,S("listbox-option")),t.get(s)),a=e.ref(!1);e.watchEffect(()=>{var r;if(o.activeOption.value==null||!a.value)return;const s=l(o.activeOption.value);(r=document.getElementById(s))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})});const d=s=>{var r,u,c,p,m,i,y;switch(s.key){case" ":s.preventDefault(),o.activeOption.value!=null&&((r=o.onSelect)==null||r.call(o,o.activeOption.value));break;case"ArrowUp":case"ArrowDown":if(s.preventDefault(),o.activeOption.value==null){(u=o.onActivateFirst)==null||u.call(o);return}s.key==="ArrowDown"?(c=o.onActivateNext)==null||c.call(o,o.activeOption.value):(p=o.onActivatePrevious)==null||p.call(o,o.activeOption.value);break;case"Home":s.preventDefault(),(m=o.onActivateFirst)==null||m.call(o);break;case"End":s.preventDefault(),(i=o.onActivateLast)==null||i.call(o);break;default:(y=o.onTypeAhead)==null||y.call(o,s.key)}};return{elements:{listbox:e.computed(()=>({role:"listbox","aria-multiselectable":n.value,"aria-label":e.unref(o.label),tabindex:"0","aria-activedescendant":o.activeOption.value!=null?l(o.activeOption.value):void 0,onFocus:()=>a.value=!0,onBlur:()=>a.value=!1,onKeydown:d})),group:e.computed(()=>s=>({role:"group","aria-label":s.label})),option:e.computed(()=>s=>{const r=s.selected??!1;return{id:l(s.value),role:"option","aria-label":s.label,"aria-checked":n.value?r:void 0,"aria-selected":n.value?void 0:r,"aria-disabled":s.disabled,onClick:()=>{var u;return(u=o.onSelect)==null?void 0:u.call(o,s.value)}}})},state:{isFocused:a}}}),Ke=M(o=>{const n=S("tooltip"),t=e.ref(!1);let l;const a=e.computed(()=>{const i=e.unref(o.open);return typeof i!="object"?200:i.debounce}),d=e.computed(()=>{const i=e.unref(o.open);return typeof i!="object"?i:i.type}),s=e.computed({get:()=>t.value,set:i=>{clearTimeout(l),l=setTimeout(()=>{t.value=i},a.value)}}),r=e.computed(()=>typeof d.value=="boolean"?d.value:s.value),u=()=>{t.value=!t.value},c=e.computed(()=>{if(d.value==="hover")return{onMouseover:()=>s.value=!0,onMouseout:()=>s.value=!1,onFocusin:()=>t.value=!0,onFocusout:()=>t.value=!1}}),p=i=>{i.key==="Escape"&&(t.value=!1)},m=i=>{var h;const y=(h=document.getElementById(n))==null?void 0:h.parentElement;if(!y||!(i.target instanceof Node))return;!y.contains(i.target)&&(t.value=!1)};return document.addEventListener("keydown",p),e.watchEffect(()=>{d.value==="click"?document.addEventListener("click",m):document.removeEventListener("click",m)}),e.onBeforeUnmount(()=>{document.addEventListener("keydown",p),document.addEventListener("click",m)}),{elements:{trigger:e.computed(()=>({"aria-describedby":n,onClick:d.value==="click"?u:void 0,...c.value})),tooltip:e.computed(()=>({role:"tooltip",id:n,tabindex:"-1",...c.value}))},state:{isVisible:r}}}),Xe={class:"onyx-truncation-ellipsis"},We=e.defineComponent({__name:"OnyxListboxOption",props:{active:{type:Boolean}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["onyx-listbox-option",{"onyx-listbox-option--active":n.active}])},[e.createElementVNode("span",Xe,[e.renderSlot(t.$slots,"default")])],2))}}),Je={class:"onyx-listbox"},Qe={key:0,class:"onyx-listbox__message onyx-text--small"},et=e.defineComponent({__name:"OnyxListbox",props:{label:{},options:{},message:{},modelValue:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,l=n,a=e.ref();e.watch(()=>t.modelValue,r=>{a.value=r});const{elements:{listbox:d,option:s}}=He({label:e.computed(()=>t.label),selectedOption:e.computed(()=>t.modelValue),activeOption:a,onSelect:r=>{t.modelValue===r?l("update:modelValue",void 0):l("update:modelValue",r)},onActivateFirst:()=>{var r;return a.value=(r=t.options.at(0))==null?void 0:r.id},onActivateLast:()=>{var r;return a.value=(r=t.options.at(-1))==null?void 0:r.id},onActivateNext:r=>{const u=t.options.findIndex(c=>c.id===r);u<t.options.length-1&&(a.value=t.options[u+1].id)},onActivatePrevious:r=>{const u=t.options.findIndex(c=>c.id===r);u>0&&(a.value=t.options[u-1].id)},onTypeAhead:r=>{const u=t.options.find(c=>c.label.toLowerCase().trim().startsWith(r.toLowerCase()));u&&(a.value=u.id)}});return(r,u)=>(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("ul",e.mergeProps(e.unref(d),{class:"onyx-listbox__options"}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createBlock(We,e.mergeProps({key:c.id.toString()},e.unref(s)({value:c.id,label:c.label,disabled:c.disabled,selected:c.id===t.modelValue}),{active:c.id===a.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1040,["active"]))),128))],16),t.message?(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0)]))}}),tt={key:0,class:"onyx-page__sidebar"},nt={class:"onyx-page__main"},ot={key:1,class:"onyx-page__footer"},lt={key:2,class:"onyx-page__toasts"},at=e.defineComponent({__name:"OnyxPageLayout",props:{footerAsideSidebar:{type:Boolean},hideSidebar:{type:Boolean}},setup(o){const n=o,t=e.useSlots(),l=e.computed(()=>{let a="";return!t.footer&&t.sidebar&&(a="onyx-page--side-main"),t.footer&&(!t.sidebar||n.hideSidebar)&&(a="onyx-page--main-footer"),t.footer&&t.sidebar&&(n.footerAsideSidebar?a="onyx-page--side-main-footer-partial":a="onyx-page--side-main-footer-full"),a});return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-page",l.value])},[e.unref(t).sidebar&&!n.hideSidebar?(e.openBlock(),e.createElementBlock("aside",tt,[e.renderSlot(a.$slots,"sidebar")])):e.createCommentVNode("",!0),e.createElementVNode("main",nt,[e.renderSlot(a.$slots,"default")]),e.unref(t).footer?(e.openBlock(),e.createElementBlock("footer",ot,[e.renderSlot(a.$slots,"footer")])):e.createCommentVNode("",!0),e.unref(t).toasts?(e.openBlock(),e.createElementBlock("div",lt,[e.renderSlot(a.$slots,"toasts")])):e.createCommentVNode("",!0)],2))}}),st=["title"],rt=["required","name","value","checked","disabled"],w=e.defineComponent({__name:"OnyxRadioButton",props:{id:{},label:{},value:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},truncation:{default:"ellipsis"},skeleton:{type:Boolean},density:{},name:{},selected:{type:Boolean,default:!1},required:{type:Boolean,default:!1},errorMessage:{}},setup(o){const n=o,t=e.ref(),{densityClass:l}=_(n);return e.watchEffect(()=>{var a;return(a=t.value)==null?void 0:a.setCustomValidity(n.errorMessage??"")}),(a,d)=>n.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-radio-button-skeleton",e.unref(l)])},[e.createVNode(k,{class:"onyx-radio-button-skeleton__input"}),e.createVNode(k,{class:"onyx-radio-button-skeleton__label"})],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-radio-button",e.unref(l)]),title:n.errorMessage},[n.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-radio-button__loading",type:"circle"})):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"selectorRef",ref:t,class:"onyx-radio-button__selector",type:"radio",required:n.required,name:n.name,value:n.id,checked:n.selected,disabled:n.disabled},null,8,rt)),e.createElementVNode("span",{class:e.normalizeClass(["onyx-radio-button__label",[`onyx-truncation-${n.truncation}`]])},e.toDisplayString(n.label),3)],10,st))}}),ct=["disabled"],it={key:0,class:"onyx-radio-button-group__headline"},dt=e.defineComponent({__name:"OnyxRadioButtonGroup",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},name:{default:()=>S("radio-button-group-name")},modelValue:{},headline:{default:""},disabled:{type:Boolean,default:!1},errorMessage:{default:""},direction:{default:"vertical"},options:{},skeleton:{}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,{densityClass:l}=_(t),{requiredMarkerClass:a,requiredTypeClass:d}=g(t),s=n,r=u=>s("update:modelValue",t.options.find(({id:c})=>u.target.value===c));return(u,c)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-radio-button-group",e.unref(l),e.unref(d)]),disabled:t.disabled,onChange:c[0]||(c[0]=p=>r(p))},[t.headline?(e.openBlock(),e.createElementBlock("legend",it,[e.createVNode(V,{is:"h3",class:e.normalizeClass(e.unref(a))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.headline),1)]),_:1},8,["class"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["onyx-radio-button-group__content",{"onyx-radio-button-group__content--horizontal":t.direction==="horizontal"}])},[t.skeleton===void 0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,p=>{var m;return e.openBlock(),e.createBlock(w,e.mergeProps({key:p.id.toString()},p,{name:t.name,"error-message":t.errorMessage,selected:p.id===((m=t.modelValue)==null?void 0:m.id),required:t.required}),null,16,["name","error-message","selected","required"])}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,p=>(e.openBlock(),e.createBlock(w,{id:`skeleton-${p}`,key:p,label:"Skeleton ${i}",name:t.name,skeleton:""},null,8,["id","name"]))),128))],2)],42,ct))}}),ut='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="m22.29 18.83 1.41 1.41-7.71 7.71-7.71-7.71 1.41-1.41 6.29 6.29 6.29-6.29ZM16 6.87l6.29 6.29 1.41-1.41-7.71-7.71-7.71 7.71 1.41 1.41 6.29-6.29Z"/></svg>',pt={class:"onyx-truncation-ellipsis"},mt={class:"onyx-select__wrapper"},yt=["placeholder","required","disabled","aria-label","title"],ft={key:0,class:"onyx-select__footer onyx-text--small onyx-truncation-ellipsis"},_t=e.defineComponent({__name:"OnyxSelect",props:{density:{},required:{type:Boolean},requiredMarker:{},modelValue:{},label:{},hideLabel:{type:Boolean,default:!1},disabled:{type:Boolean},skeleton:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},placeholder:{},multiple:{},message:{}},emits:["update:modelValue"],setup(o){const n=o,{t}=b(),l=e.computed(()=>{var c;if(n.multiple)return typeof n.multiple=="boolean"?"summary":((c=n.multiple)==null?void 0:c.textMode)??"summary"}),a=e.computed(()=>{if(n.modelValue&&l.value==="preview")return n.modelValue.length}),d=e.computed(()=>{if(Array.isArray(n.modelValue)){const c=n.modelValue.length;if(!c)return"";if(c===1)return n.modelValue[0];switch(l.value){case"preview":return n.modelValue.join(", ");case"summary":default:return t.value("selections.currentSelection",{n:c})}}return n.modelValue??""}),{requiredMarkerClass:s,requiredTypeClass:r}=g(n),{densityClass:u}=_(n);return(c,p)=>n.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-select-skeleton",e.unref(u)])},[n.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-select-skeleton__label"})),e.createVNode(e.unref(k),{class:"onyx-select-skeleton__input"})],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["onyx-select",e.unref(r),e.unref(u),n.readonly?"onyx-select--readonly":"onyx-select--editable"])},[e.createElementVNode("label",null,[n.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-select__label","onyx-text--small",e.unref(s)])},[e.createElementVNode("div",pt,e.toDisplayString(n.label),1)],2)),e.createElementVNode("div",mt,[n.loading?(e.openBlock(),e.createBlock(x,{key:0,class:"onyx-select__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),class:"onyx-select__input onyx-truncation-ellipsis",placeholder:n.placeholder,type:"text",role:"presentation",required:n.required,readonly:"",disabled:n.disabled||n.loading,"aria-label":n.hideLabel?n.label:void 0,title:n.hideLabel?n.label:void 0},null,8,yt),[[e.vModelText,d.value]]),a.value?(e.openBlock(),e.createBlock(e.unref(P),{key:1,text:d.value,position:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(T),{class:"onyx-select__badge",variation:"neutral"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1})]),_:1},8,["text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v),{icon:e.unref(ut),class:"onyx-select__icon"},null,8,["icon"])])]),n.message?(e.openBlock(),e.createElementBlock("div",ft,e.toDisplayString(n.message),1)):e.createCommentVNode("",!0)],2))}}),kt=["summary","preview"],z=(o,n)=>{const t=Object.entries(o).filter(([a,d])=>d!==void 0),l=Object.entries(n).filter(([a,d])=>d!==void 0);return t.length!==l.length?!1:t.every(([a,d])=>d===n[a])},q=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([o,n])=>n.enumerable).map(([o])=>o),D=o=>q().reduce((n,t)=>(n[t]=o[t],n),{}),vt=o=>{if(o.valueMissing)return"valueMissing";const n=q().filter(t=>t!=="valid").sort();for(const t of n)if(t in o&&o[t])return t},xt='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="m21.311 10.793-8.293 8.293-3.291-3.292-1.415 1.415 4.706 4.705 9.707-9.707z"/></svg>',ht='<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32"><path d="m22.707 10.707-1.414-1.414L16 14.586l-5.293-5.293-1.414 1.414L14.586 16l-5.293 5.293 1.414 1.414L16 17.414l5.293 5.293 1.414-1.414L17.414 16z"/></svg>',gt=["title"],bt=["aria-label","disabled","required"],Bt={class:"onyx-switch__container"},Ct={class:"onyx-switch__icon"},Et=e.defineComponent({__name:"OnyxSwitch",props:{density:{},required:{type:Boolean},requiredMarker:{},modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},errorMessage:{},hideLabel:{type:Boolean},truncation:{default:"ellipsis"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","validityChange"],setup(o,{emit:n}){var m;const t=o,l=n,{requiredMarkerClass:a,requiredTypeClass:d}=g(t),{errorMessage:s}=e.toRefs(t),{densityClass:r}=_(t),u=e.ref(),c=e.ref((m=u.value)==null?void 0:m.validity),p=e.computed({get:()=>t.modelValue,set:i=>{l("update:modelValue",i)}});return e.watch([u,s],()=>{u.value&&u.value.setCustomValidity(t.errorMessage||"")}),e.watch([u,p,s],()=>{if(!u.value)return;const i=D(u.value.validity);(!c.value||!z(i,c.value))&&(c.value=i,l("validityChange",c.value))},{immediate:!0}),(i,y)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-switch-skeleton",e.unref(r)])},[e.createVNode(k,{class:"onyx-switch-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-switch-skeleton__label"}))],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-switch",[e.unref(d),e.unref(r)]]),title:t.hideLabel?t.label:void 0},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputElement",ref:u,"onUpdate:modelValue":y[0]||(y[0]=f=>p.value=f),type:"checkbox",role:"switch",class:e.normalizeClass({"onyx-switch__input":!0,"onyx-switch__loading":t.loading}),"aria-label":t.hideLabel?t.label:void 0,disabled:t.disabled||t.loading,required:t.required},null,10,bt),[[e.vModelCheckbox,p.value]]),e.createElementVNode("span",Bt,[e.createElementVNode("span",Ct,[t.loading?(e.openBlock(),e.createBlock(e.unref(x),{key:0,class:"onyx-switch__spinner",type:"circle"})):(e.openBlock(),e.createBlock(e.unref(v),{key:1,icon:p.value?e.unref(xt):e.unref(ht),size:"24px"},null,8,["icon"]))])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["onyx-switch__label",[`onyx-truncation-${t.truncation}`,e.unref(a)]])},e.toDisplayString(t.label),3))],10,gt))}}),Vt={class:"onyx-tooltip-wrapper"},P=e.defineComponent({__name:"OnyxTooltip",props:{text:{},icon:{},color:{default:"neutral"},position:{default:"top"},fitParent:{type:Boolean,default:!1},open:{type:[String,Boolean,Object],default:"hover"}},setup(o){const n=o,{elements:{trigger:t,tooltip:l},state:{isVisible:a}}=Ke({open:e.computed(()=>n.open)});return(d,s)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",e.mergeProps(e.unref(l),{class:["onyx-tooltip onyx-text--small onyx-truncation-multiline",{"onyx-tooltip--danger":n.color==="danger","onyx-tooltip--bottom":n.position==="bottom","onyx-tooltip--fit-parent":n.fitParent,"onyx-tooltip--hidden":!e.unref(a)}]}),[n.icon?(e.openBlock(),e.createBlock(v,{key:0,icon:n.icon,size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"tooltip",{},()=>[e.createElementVNode("span",null,e.toDisplayString(n.text),1)])],16),e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(t))),[e.renderSlot(d.$slots,"default")],16)]))}}),St=["top","bottom"],Ot=Object.keys(C.validations.typeMismatch),$t={key:0,class:"onyx-test-input__error","aria-live":"polite"},Nt={class:"onyx-test-input__info"},wt=e.defineComponent({__name:"TestInput",props:{modelValue:{default:""},label:{default:""},errorMessage:{},required:{type:Boolean},pattern:{},type:{default:"text"},max:{},maxLength:{},min:{},step:{},minLength:{}},emits:["update:modelValue","change","validityChange"],setup(o,{emit:n}){var i;const t=o,l=n,{t:a}=b(),{errorMessage:d}=e.toRefs(t),s=e.ref(!1),r=e.ref(null),u=e.ref((i=r.value)==null?void 0:i.validity),c=e.computed({get:()=>t.modelValue,set:y=>l("update:modelValue",y)}),p=e.computed(()=>{if(!u.value||u.value.valid)return"";const y=vt(u.value);if(t.errorMessage||y==="customError")return t.errorMessage;if(!y)return"";if(y==="typeMismatch"){const f=Ot.includes(t.type)?t.type:"generic";return a.value(`validations.typeMismatch.${f}`,{value:c.value})}return a.value(`validations.${y}`,{value:c.value,n:c.value.toString().length,minLength:t.minLength,maxLength:t.maxLength,min:t.min,max:t.max,step:t.step})}),m=y=>{const f=y.target;l("change",f.value)};return e.watch([r,d],()=>{r.value&&r.value.setCustomValidity(t.errorMessage||"")}),e.watch([r,c,d],()=>{if(!r.value)return;const y=D(r.value.validity);(!u.value||!z(y,u.value))&&(u.value=y,l("validityChange",u.value))},{immediate:!0}),(y,f)=>{var h,O;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["onyx-test-input",{"onyx-test-input--touched":s.value}])},[e.createElementVNode("span",{class:e.normalizeClass(["onyx-test-input__label",{"onyx-test-input__label--required":t.required}])},e.toDisplayString(t.label),3),e.withDirectives(e.createElementVNode("input",e.mergeProps(t,{ref_key:"inputElement",ref:r,"onUpdate:modelValue":f[0]||(f[0]=$=>c.value=$),onChange:m,onBlur:f[1]||(f[1]=$=>s.value=!0)}),null,16),[[e.vModelDynamic,c.value]]),s.value&&!((h=u.value)!=null&&h.valid)?(e.openBlock(),e.createElementBlock("p",$t,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0),e.createElementVNode("p",Nt,' Model value: "'+e.toDisplayString(c.value)+'", is valid: '+e.toDisplayString((O=u.value)==null?void 0:O.valid),1)],2)}}}),Tt=["primary","secondary","neutral","danger","warning","success","info"],Lt=["small","default","large"],It=["ellipsis","multiline"],Mt=["horizontal","vertical"],zt=o=>({install:n=>{ke(n,o.i18n);const t=n.runWithContext(()=>b());e.watchEffect(()=>qt(t.t.value("optional")))}}),qt=o=>globalThis.document.body.style.setProperty("--onyx-global-optional-text",o);exports.AUTOCAPITALIZE=Ue;exports.BUTTON_MODES=me;exports.BUTTON_TYPES=ue;exports.BUTTON_VARIATIONS=pe;exports.DENSITY=j;exports.DIRECTIONS=Mt;exports.HEADLINE_TYPES=$e;exports.ICON_SIZES=Ne;exports.INPUT_TYPES=Ae;exports.LINK_TARGETS=Ze;exports.MULTISELECT_TEXT_MODE=kt;exports.ONYX_COLORS=Tt;exports.OnyxAppLayout=Y;exports.OnyxBadge=T;exports.OnyxButton=de;exports.OnyxCheckboxGroup=Ce;exports.OnyxEmpty=Oe;exports.OnyxHeadline=V;exports.OnyxIcon=v;exports.OnyxIconButton=Te;exports.OnyxInput=Pe;exports.OnyxLink=je;exports.OnyxListbox=et;exports.OnyxLoadingIndicator=x;exports.OnyxPageLayout=at;exports.OnyxRadioButtonGroup=dt;exports.OnyxSelect=_t;exports.OnyxSkeleton=k;exports.OnyxSwitch=Et;exports.OnyxTooltip=P;exports.TEXT_SIZES=Lt;exports.TOOLTIP_POSITIONS=St;exports.TRUNCATION_TYPES=It;exports.TestInput=wt;exports.createOnyx=zt;exports.useDensity=_;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './components/OnyxBadge/types';
8
8
  export * from './components/OnyxCheckbox/types';
9
9
  export { default as OnyxCheckboxGroup } from './components/OnyxCheckboxGroup/OnyxCheckboxGroup.vue';
10
10
  export * from './components/OnyxCheckboxGroup/types';
11
+ export { default as OnyxEmpty } from './components/OnyxEmpty/OnyxEmpty.vue';
11
12
  export { default as OnyxHeadline } from './components/OnyxHeadline/OnyxHeadline.vue';
12
13
  export * from './components/OnyxHeadline/types';
13
14
  export { default as OnyxIcon } from './components/OnyxIcon/OnyxIcon.vue';
@@ -34,7 +35,7 @@ export * from './components/OnyxSwitch/types';
34
35
  export { default as OnyxTooltip } from './components/OnyxTooltip/OnyxTooltip.vue';
35
36
  export * from './components/OnyxTooltip/types';
36
37
  export { default as TestInput } from './components/TestInput/TestInput.vue';
38
+ export * from './composables/density';
37
39
  export type { OnyxTranslations, ProvideI18nOptions } from './i18n';
38
40
  export * from './types';
39
- export * from './composables/density';
40
41
  export { createOnyx } from './utils/plugin';