sit-onyx 1.0.0-alpha.49 → 1.0.0-alpha.50

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.
@@ -1,3 +1,4 @@
1
+ import type { Direction } from "../../types";
1
2
  import type { OnyxCheckboxProps } from "../OnyxCheckbox/types";
2
3
  import type { SelectionOptionValue } from "../OnyxRadioButton/types";
3
4
  export type OnyxCheckboxGroupProps<TValue extends SelectionOptionValue = SelectionOptionValue> = {
@@ -16,7 +17,7 @@ export type OnyxCheckboxGroupProps<TValue extends SelectionOptionValue = Selecti
16
17
  /**
17
18
  * Direction of the checkboxes.
18
19
  */
19
- direction?: CheckboxGroupDirection;
20
+ direction?: Direction;
20
21
  /**
21
22
  * If true, an additional checkbox will be displayed to check/uncheck all options.
22
23
  * Disabled and skeleton checkboxes will be excluded from the check/uncheck behavior.
@@ -39,5 +40,3 @@ export type OnyxCheckboxGroupProps<TValue extends SelectionOptionValue = Selecti
39
40
  export type CheckboxGroupOption<T extends SelectionOptionValue> = Omit<OnyxCheckboxProps, "modelValue" | "indeterminate" | "hideLabel"> & {
40
41
  id: T;
41
42
  };
42
- export declare const CHECKBOX_GROUP_DIRECTIONS: readonly ["horizontal", "vertical"];
43
- export type CheckboxGroupDirection = (typeof CHECKBOX_GROUP_DIRECTIONS)[number];
@@ -5,6 +5,16 @@ import OnyxListbox from "./OnyxListbox.vue";
5
5
  * dropdowns, navigation bars, paginations, tables, etc.
6
6
  * It provides the users with the ability to open a small modal window,
7
7
  * facilitating single or multi-selection based on the context in which it is employed.
8
+ *
9
+ * ### Keyboard shortcuts
10
+ * The following keyboard shortcuts are available:
11
+ * - **Tab**: Focuses / blurs the listbox
12
+ * - **Arrow down**: Focuses the next option
13
+ * - **Arrow up**: Focuses the previous option
14
+ * - **Home**: Focuses the first option
15
+ * - **End**: Focuses the last option
16
+ * - **Space**: Selects currently focused option
17
+ * - **Other** characters: Focuses first option that starts with the pressed key
8
18
  */
9
19
  declare const meta: Meta<typeof OnyxListbox>;
10
20
  export default meta;
@@ -15,7 +25,7 @@ export declare const Default: {
15
25
  args: {
16
26
  label: string;
17
27
  options: {
18
- id: number;
28
+ id: string;
19
29
  label: string;
20
30
  }[];
21
31
  };
@@ -1,6 +1,6 @@
1
1
  export type OnyxListboxOptionProps = {
2
2
  /**
3
- * Whether the option is focused.
3
+ * Whether the option is active.
4
4
  */
5
- focused?: boolean;
5
+ active?: boolean;
6
6
  };
@@ -1,5 +1,6 @@
1
1
  import type { DensityProp } from "../../composables/density";
2
2
  import type { RequiredMarkerProp } from "../../composables/required";
3
+ import type { Direction } from "../../types";
3
4
  import type { SelectionOption, SelectionOptionValue } from "../OnyxRadioButton/types";
4
5
  export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue> = DensityProp & RequiredMarkerProp & {
5
6
  /**
@@ -28,7 +29,7 @@ export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue> = Den
28
29
  /**
29
30
  * Direction of the checkboxes. Can be vertical (default) or horizontal.
30
31
  */
31
- direction?: RadioButtonGroupDirection;
32
+ direction?: Direction;
32
33
  /**
33
34
  * Options for the individual radio buttons of the group.
34
35
  */
@@ -38,5 +39,3 @@ export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue> = Den
38
39
  */
39
40
  skeleton?: number;
40
41
  };
41
- export declare const RADIO_BUTTON_GROUP_DIRECTIONS: readonly ["horizontal", "vertical"];
42
- export type RadioButtonGroupDirection = (typeof RADIO_BUTTON_GROUP_DIRECTIONS)[number];
@@ -0,0 +1,49 @@
1
+ import type { Meta } from "@storybook/vue3";
2
+ import OnyxTooltip from "./OnyxTooltip.vue";
3
+ /**
4
+ * Tooltips offer contextual information or additional details to a parent element.
5
+ */
6
+ declare const meta: Meta<typeof OnyxTooltip>;
7
+ export default meta;
8
+ /**
9
+ * This example shows a default tooltip.
10
+ */
11
+ export declare const Default: {
12
+ args: {
13
+ text: string;
14
+ default: () => string;
15
+ icon: string;
16
+ };
17
+ };
18
+ /**
19
+ * This example shows a tooltip with a very long text that wraps to a new line.
20
+ */
21
+ export declare const LongText: {
22
+ args: {
23
+ text: string;
24
+ default: () => string;
25
+ icon: string;
26
+ };
27
+ };
28
+ /**
29
+ * This example shows a tooltip that uses the full width of the parent/slot element.
30
+ */
31
+ export declare const MatchParentWidth: {
32
+ args: {
33
+ fitParent: true;
34
+ text: string;
35
+ default: () => string;
36
+ icon: string;
37
+ };
38
+ };
39
+ /**
40
+ * This example shows a danger tooltip.
41
+ */
42
+ export declare const Danger: {
43
+ args: {
44
+ color: "danger";
45
+ text: string;
46
+ default: () => string;
47
+ icon: string;
48
+ };
49
+ };
@@ -0,0 +1,22 @@
1
+ import type { OnyxColor } from "../../types";
2
+ export type OnyxTooltipProps = {
3
+ /**
4
+ * Text to display inside the tooltip.
5
+ */
6
+ text: string;
7
+ /**
8
+ * Optional icon to show on the left of the text.
9
+ */
10
+ icon?: string;
11
+ color?: Extract<OnyxColor, "neutral" | "danger">;
12
+ /**
13
+ * How to position the tooltip relative to the parent element.
14
+ */
15
+ position?: TooltipPosition;
16
+ /**
17
+ * If `true`, the tooltip will match the width of the parent/slot element.
18
+ */
19
+ fitParent?: boolean;
20
+ };
21
+ export declare const TOOLTIP_POSITIONS: readonly ["top", "bottom"];
22
+ export type TooltipPosition = (typeof TOOLTIP_POSITIONS)[number];
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q={key:0,class:"onyx-app__nav"},z={class:"onyx-app__page"},P={key:1,class:"onyx-app__page-overlay"},D={key:2,class:"onyx-app__app-overlay"},A=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",q,[e.renderSlot(l.$slots,"navBar")])):e.createCommentVNode("",!0),e.createElementVNode("div",z,[e.renderSlot(l.$slots,"default")]),e.unref(t).pageOverlay?(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(l.$slots,"pageOverlay")])):e.createCommentVNode("",!0),e.unref(t).appOverlay?(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(l.$slots,"appOverlay")])):e.createCommentVNode("",!0)],2))}}),U=["innerHTML"],h=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,U))}}),B=(o,n)=>{const t=o.__vccOpts||o;for(const[l,a]of n)t[l]=a;return t},R={},Y={class:"onyx-circle-spinner",viewBox:"0 0 50 50"},F=e.createElementVNode("circle",{class:"onyx-circle-spinner__circle",cx:"50%",cy:"50%",r:"45%"},null,-1),G=[F];function j(o,n){return e.openBlock(),e.createElementBlock("svg",Y,G)}const H=B(R,[["render",j]]),X={},Z={class:"onyx-loading-dots"},K=e.createElementVNode("span",{class:"onyx-loading-dots__center"},null,-1),J=[K];function W(o,n){return e.openBlock(),e.createElementBlock("div",Z,J)}const Q=B(X,[["render",W]]),k=e.defineComponent({__name:"OnyxLoadingIndicator",props:{type:{default:"dots"}},setup(o){const n=o;return(t,l)=>n.type==="circle"?(e.openBlock(),e.createBlock(H,{key:0})):n.type==="dots"?(e.openBlock(),e.createBlock(Q,{key:1})):e.createCommentVNode("",!0)}}),ee={},te={class:"onyx-skeleton"};function oe(o,n){return e.openBlock(),e.createElementBlock("figure",te)}const f=B(ee,[["render",oe]]),ne=["disabled"],le={key:2,class:"onyx-button__label onyx-truncation-ellipsis"},ae=e.defineComponent({__name:"OnyxButton",props:{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,l=n;return(a,r)=>t.skeleton?(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-button-skeleton"})):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["onyx-button",{[`onyx-button--${t.variation}`]:!0,[`onyx-button--${t.mode}`]:!0,"onyx-button--loading":t.loading}]),disabled:t.disabled||t.loading,onClick:r[0]||(r[0]=i=>l("click"))},[t.icon&&!t.loading?(e.openBlock(),e.createBlock(h,{key:0,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(k,{key:1,class:"onyx-button__loading"})):(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(t.label),1))],10,ne))}}),se=["button","submit","reset"],re=["primary","secondary","danger"],ce=["default","outline","plain"],ie="(optional)",de={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.'}},ue="Select all",b={optional:ie,validations:de,selectAll:ue},N=Symbol(),T=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]:b),l=e.computed(()=>(a,r={})=>{let i=$(a,t.value)??$(a,b)??"";const u=typeof r.n=="number"?r.n:void 0;return i=me(i,u),ye(i,r)});return{locale:n,t:l}},pe=(o,n)=>o.provide(N,T(n)),v=()=>e.inject(N,()=>T(),!0),$=(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},me=(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]},ye=(o,n)=>n?Object.entries(n).reduce((l,[a,r])=>r===void 0?l:l.replace(new RegExp(`{${a}}`,"gi"),r.toString()),o).replace(/\s?{.*}\s?/gi,""):o,x=o=>({requiredTypeClass:e.computed(()=>({[`onyx-use-${o.requiredMarker}`]:o.requiredMarker})),requiredMarkerClass:e.computed(()=>({"onyx-required-marker":o.required,"onyx-optional-marker":!o.required}))}),_e={key:0,class:"onyx-checkbox-skeleton"},fe={class:"onyx-checkbox__container"},ke=["aria-label","indeterminate","disabled","required"],g=e.defineComponent({__name:"OnyxCheckbox",props:{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}=x(t),r=n,i=e.computed({get:()=>t.modelValue,set:d=>r("update:modelValue",d)}),u=e.ref(!1);return(d,s)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(f,{class:"onyx-checkbox-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-checkbox-skeleton__label"}))])):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-checkbox",[e.unref(a)]])},[e.createElementVNode("div",fe,[t.loading?(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-checkbox__loading",type:"circle"})):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":s[0]||(s[0]=p=>i.value=p),"aria-label":t.hideLabel?t.label:void 0,class:e.normalizeClass(["onyx-checkbox__input",{"onyx-checkbox__input--touched":u.value}]),type:"checkbox",indeterminate:t.indeterminate,disabled:t.disabled,required:t.required,onBlur:s[1]||(s[1]=p=>u.value=!0)},null,42,ke)),[[e.vModelCheckbox,i.value]])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["onyx-checkbox__label",[`onyx-truncation-${t.truncation}`,e.unref(l)]])},e.toDisplayString(t.label),3))],2))}}),he=["disabled"],xe={key:0,class:"onyx-checkbox-group__label"},ge=e.defineComponent({__name:"OnyxCheckboxGroup",props:{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,l=n,{t:a}=v(),r=(s,p)=>{const c=p?[...t.modelValue,s]:t.modelValue.filter(y=>y!==s);l("update:modelValue",c)},i=e.computed(()=>t.options.filter(s=>!s.disabled&&!s.skeleton)),u=s=>{const p=s?i.value.map(({id:c})=>c):[];l("update:modelValue",p)},d=e.computed(()=>{const s=i.value.map(({id:c})=>c),p=t.modelValue.filter(c=>s.includes(c));return!s.length||!p.length?{modelValue:!1}:p.length===s.length?{modelValue:!0}:{indeterminate:!0,modelValue:!1}});return(s,p)=>(e.openBlock(),e.createElementBlock("fieldset",{class:"onyx-checkbox-group",disabled:t.disabled},[t.headline?(e.openBlock(),e.createElementBlock("legend",xe,[e.createVNode(e.unref(C),{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(g,e.mergeProps({key:0},d.value,{label:t.checkAllLabel||e.unref(a)("selectAll"),"onUpdate:modelValue":u}),null,16,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createBlock(g,e.mergeProps({key:c.id.toString()},c,{"model-value":t.modelValue.includes(c.id),"onUpdate:modelValue":y=>r(c.id,y)}),null,16,["model-value","onUpdate:modelValue"]))),128))],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,c=>(e.openBlock(),e.createBlock(g,{key:c,label:`Skeleton ${c}`,skeleton:""},null,8,["label"]))),128))],2)],8,he))}}),be=["horizontal","vertical"],Be=o=>o,ve=(()=>{let o=0;return()=>o++})(),Ce=o=>`${o}-${ve()}`,Ee=Be(o=>{const n=e.computed(()=>e.unref(o.multiselect)??!1);return{elements:{listbox:e.computed(()=>({role:"listbox","aria-multiselectable":n.value,"aria-label":e.unref(o.label),tabindex:"0"})),group:e.computed(()=>t=>({role:"group","aria-label":t.label})),option:e.computed(()=>t=>{const l=t.selected??!1;return{role:"option","aria-label":t.label,"aria-checked":n.value?l:void 0,"aria-selected":n.value?void 0:l,"aria-disabled":t.disabled,onClick:()=>{var a;return(a=o.onSelect)==null?void 0:a.call(o,t.id)}}})},state:{}}}),Ve={class:"onyx-truncation-ellipsis"},Se=e.defineComponent({__name:"OnyxListboxOption",props:{focused:{type:Boolean}},setup(o){const n=o;return(t,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["onyx-listbox-option",{"onyx-listbox-option--focused":n.focused}])},[e.createElementVNode("span",Ve,[e.renderSlot(t.$slots,"default")])],2))}}),$e={class:"onyx-listbox"},Oe={key:0,class:"onyx-listbox__label onyx-text--small"},Ne=e.defineComponent({__name:"OnyxListbox",props:{options:{},label:{},modelValue:{},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:n}){const t=o,l=n,{elements:{listbox:a,option:r}}=Ee({label:e.computed(()=>t.label),onSelect:i=>{t.modelValue===i?l("update:modelValue",void 0):l("update:modelValue",i)}});return(i,u)=>(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("ul",e.mergeProps({class:"onyx-listbox__options"},e.unref(a)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,d=>(e.openBlock(),e.createBlock(Se,e.mergeProps({key:d.id.toString()},e.unref(r)({id:d.id,label:d.label,disabled:d.disabled,selected:d.id===t.modelValue})),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1040))),128))],16),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(t.label),1))]))}}),C=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"]))}}),Te=["h1","h2","h3","h4","h5","h6"],we=["12px","16px","24px","32px","48px","64px","96px"],Le=["aria-label","disabled"],Ie=e.defineComponent({__name:"OnyxIconButton",props:{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,l=n;return(a,r)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["onyx-icon-button",{[`onyx-icon-button--${t.variation}`]:!0,"onyx-icon-button--loading":t.loading}]),"aria-label":t.label,disabled:t.disabled||t.loading,onClick:r[0]||(r[0]=i=>l("click"))},[t.loading?(e.openBlock(),e.createBlock(k,{key:0,type:"circle"})):t.icon?(e.openBlock(),e.createBlock(h,{key:1,icon:t.icon},null,8,["icon"])):e.renderSlot(a.$slots,"default",{key:2})],10,Le))}}),Me={class:"onyx-truncation-ellipsis"},qe={class:"onyx-input__wrapper"},ze=["placeholder","type","required","autocapitalize","autocomplete","autofocus","name","pattern","readonly","disabled","minlength","maxlength","aria-label"],Pe={key:0,class:"onyx-input__footer onyx-text--small"},De={key:0,class:"onyx-truncation-ellipsis"},Ae={key:1,class:"onyx-input__counter"},Ue=e.defineComponent({__name:"OnyxInput",props:{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:r}=x(t),i=e.computed({get:()=>t.modelValue,set:p=>l("update:modelValue",p)}),u=p=>{const c=p.target.value;l("change",c)},d=e.computed(()=>t.pattern instanceof RegExp?t.pattern.source:t.pattern),s=e.computed(()=>t.withCounter&&t.maxlength);return(p,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-input",e.unref(r)])},[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",Me,e.toDisplayString(t.label),1)],2)),e.createElementVNode("div",qe,[t.loading?(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-input__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=y=>i.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:d.value,readonly:t.readonly,disabled:t.disabled||t.loading,minlength:t.minlength,maxlength:t.maxlength,"aria-label":t.hideLabel?t.label:void 0,onChange:u,onFocus:c[1]||(c[1]=y=>l("focus")),onBlur:c[2]||(c[2]=y=>l("blur"))},null,40,ze),[[e.vModelDynamic,i.value]])])]),t.message||s.value?(e.openBlock(),e.createElementBlock("div",Pe,[t.message?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(i.value.length)+"/"+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),Re=["email","password","search","tel","text","url"],Ye=["none","sentences","words","characters"],Fe='<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>',Ge=o=>/^http(s?):\/\//.test(o),je=["href","target","rel"],He=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:Ge(t.href));return(r,i)=>(e.openBlock(),e.createElementBlock("a",{class:"onyx-link",href:t.href,target:t.target,rel:t.target==="_blank"?"noreferrer":void 0,onClick:i[0]||(i[0]=u=>l("click"))},[e.renderSlot(r.$slots,"default"),a.value?(e.openBlock(),e.createBlock(h,{key:0,class:"onyx-link__icon",icon:e.unref(Fe),size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0)],8,je))}}),Xe=["_self","_blank","_parent","_top"],Ze={key:0,class:"onyx-page__sidebar"},Ke={class:"onyx-page__main"},Je={key:1,class:"onyx-page__footer"},We={key:2,class:"onyx-page__toasts"},Qe=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,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-page",l.value])},[e.unref(t).sidebar&&!n.hideSidebar?(e.openBlock(),e.createElementBlock("aside",Ze,[e.renderSlot(a.$slots,"sidebar")])):e.createCommentVNode("",!0),e.createElementVNode("main",Ke,[e.renderSlot(a.$slots,"default")]),e.unref(t).footer?(e.openBlock(),e.createElementBlock("footer",Je,[e.renderSlot(a.$slots,"footer")])):e.createCommentVNode("",!0),e.unref(t).toasts?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(a.$slots,"toasts")])):e.createCommentVNode("",!0)],2))}}),w=o=>({densityClass:e.computed(()=>({[`onyx-density-${o.density}`]:o.density}))}),et=["title"],tt=["required","name","value","checked","disabled"],O=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}=w(n);return e.watchEffect(()=>{var a;return(a=t.value)==null?void 0:a.setCustomValidity(n.errorMessage??"")}),(a,r)=>n.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-radio-button-skeleton",e.unref(l)])},[e.createVNode(f,{class:"onyx-radio-button-skeleton__input"}),e.createVNode(f,{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(k),{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,tt)),e.createElementVNode("span",{class:e.normalizeClass(["onyx-radio-button__label",[`onyx-truncation-${n.truncation}`]])},e.toDisplayString(n.label),3)],10,et))}}),ot=["disabled"],nt={key:0,class:"onyx-radio-button-group__headline"},lt=e.defineComponent({__name:"OnyxRadioButtonGroup",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},name:{default:()=>Ce("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}=w(t),{requiredMarkerClass:a,requiredTypeClass:r}=x(t),i=n,u=d=>i("update:modelValue",t.options.find(({id:s})=>d.target.value===s));return(d,s)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-radio-button-group",e.unref(l),e.unref(r)]),disabled:t.disabled,onChange:s[0]||(s[0]=p=>u(p))},[t.headline?(e.openBlock(),e.createElementBlock("legend",nt,[e.createVNode(C,{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 c;return e.openBlock(),e.createBlock(O,e.mergeProps({key:p.id.toString()},p,{name:t.name,"error-message":t.errorMessage,selected:p.id===((c=t.modelValue)==null?void 0:c.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(O,{id:`skeleton-${p}`,key:p,label:"Skeleton ${i}",name:t.name,skeleton:""},null,8,["id","name"]))),128))],2)],42,ot))}}),L=(o,n)=>{const t=Object.entries(o).filter(([a,r])=>r!==void 0),l=Object.entries(n).filter(([a,r])=>r!==void 0);return t.length!==l.length?!1:t.every(([a,r])=>r===n[a])},I=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([o,n])=>n.enumerable).map(([o])=>o),M=o=>I().reduce((n,t)=>(n[t]=o[t],n),{}),at=o=>{if(o.valueMissing)return"valueMissing";const n=I().filter(t=>t!=="valid").sort();for(const t of n)if(t in o&&o[t])return t},st='<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>',rt='<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>',ct={key:0,class:"onyx-switch-skeleton"},it=["aria-label","disabled","required"],dt={class:"onyx-switch__container"},ut={class:"onyx-switch__icon"},pt=e.defineComponent({__name:"OnyxSwitch",props:{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 p;const t=o,l=n,{requiredMarkerClass:a,requiredTypeClass:r}=x(t),{errorMessage:i}=e.toRefs(t),u=e.ref(),d=e.ref((p=u.value)==null?void 0:p.validity),s=e.computed({get:()=>t.modelValue,set:c=>{l("update:modelValue",c)}});return e.watch([u,i],()=>{u.value&&u.value.setCustomValidity(t.errorMessage||"")}),e.watch([u,s,i],()=>{if(!u.value)return;const c=M(u.value.validity);(!d.value||!L(c,d.value))&&(d.value=c,l("validityChange",d.value))},{immediate:!0}),(c,y)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",ct,[e.createVNode(f,{class:"onyx-switch-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-switch-skeleton__label"}))])):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-switch",[e.unref(r)]])},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputElement",ref:u,"onUpdate:modelValue":y[0]||(y[0]=m=>s.value=m),class:e.normalizeClass({"onyx-switch__input":!0,"onyx-switch__loading":t.loading}),type:"checkbox","aria-label":t.hideLabel?t.label:void 0,disabled:t.disabled||t.loading,required:t.required},null,10,it),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",dt,[e.createElementVNode("span",ut,[t.loading?(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-switch__spinner",type:"circle"})):(e.openBlock(),e.createBlock(e.unref(h),{key:1,icon:s.value?e.unref(st):e.unref(rt),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))],2))}}),mt=Object.keys(b.validations.typeMismatch),yt={key:0,class:"onyx-test-input__error","aria-live":"polite"},_t={class:"onyx-test-input__info"},ft=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 y;const t=o,l=n,{t:a}=v(),{errorMessage:r}=e.toRefs(t),i=e.ref(!1),u=e.ref(null),d=e.ref((y=u.value)==null?void 0:y.validity),s=e.computed({get:()=>t.modelValue,set:m=>l("update:modelValue",m)}),p=e.computed(()=>{if(!d.value||d.value.valid)return"";const m=at(d.value);if(t.errorMessage||m==="customError")return t.errorMessage;if(!m)return"";if(m==="typeMismatch"){const _=mt.includes(t.type)?t.type:"generic";return a.value(`validations.typeMismatch.${_}`,{value:s.value})}return a.value(`validations.${m}`,{value:s.value,n:s.value.toString().length,minLength:t.minLength,maxLength:t.maxLength,min:t.min,max:t.max,step:t.step})}),c=m=>{const _=m.target;l("change",_.value)};return e.watch([u,r],()=>{u.value&&u.value.setCustomValidity(t.errorMessage||"")}),e.watch([u,s,r],()=>{if(!u.value)return;const m=M(u.value.validity);(!d.value||!L(m,d.value))&&(d.value=m,l("validityChange",d.value))},{immediate:!0}),(m,_)=>{var E,V;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["onyx-test-input",{"onyx-test-input--touched":i.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:u,"onUpdate:modelValue":_[0]||(_[0]=S=>s.value=S),onChange:c,onBlur:_[1]||(_[1]=S=>i.value=!0)}),null,16),[[e.vModelDynamic,s.value]]),i.value&&!((E=d.value)!=null&&E.valid)?(e.openBlock(),e.createElementBlock("p",yt,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0),e.createElementVNode("p",_t,' Model value: "'+e.toDisplayString(s.value)+'", is valid: '+e.toDisplayString((V=d.value)==null?void 0:V.valid),1)],2)}}}),kt=["primary","secondary","neutral","danger","warning","success","info"],ht=["small","default","large"],xt=["ellipsis","multiline"],gt=o=>({install:n=>{pe(n,o.i18n);const t=n.runWithContext(()=>v());e.watchEffect(()=>bt(t.t.value("optional")))}}),bt=o=>globalThis.document.body.style.setProperty("--onyx-global-optional-text",o);exports.AUTOCAPITALIZE=Ye;exports.BUTTON_MODES=ce;exports.BUTTON_TYPES=se;exports.BUTTON_VARIATIONS=re;exports.CHECKBOX_GROUP_DIRECTIONS=be;exports.HEADLINE_TYPES=Te;exports.ICON_SIZES=we;exports.INPUT_TYPES=Re;exports.LINK_TARGETS=Xe;exports.ONYX_COLORS=kt;exports.OnyxAppLayout=A;exports.OnyxButton=ae;exports.OnyxCheckboxGroup=ge;exports.OnyxHeadline=C;exports.OnyxIcon=h;exports.OnyxIconButton=Ie;exports.OnyxInput=Ue;exports.OnyxLink=He;exports.OnyxListbox=Ne;exports.OnyxLoadingIndicator=k;exports.OnyxPageLayout=Qe;exports.OnyxRadioButtonGroup=lt;exports.OnyxSkeleton=f;exports.OnyxSwitch=pt;exports.TEXT_SIZES=ht;exports.TRUNCATION_TYPES=xt;exports.TestInput=ft;exports.createOnyx=gt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z={key:0,class:"onyx-app__nav"},A={class:"onyx-app__page"},D={key:1,class:"onyx-app__page-overlay"},P={key:2,class:"onyx-app__app-overlay"},U=e.defineComponent({__name:"OnyxAppLayout",props:{navBarAlignment:{default:"top"}},setup(n){const o=n,t=e.useSlots();return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-app",{"onyx-app--horizontal":o.navBarAlignment==="left"}])},[e.unref(t).navBar?(e.openBlock(),e.createElementBlock("nav",z,[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",D,[e.renderSlot(l.$slots,"pageOverlay")])):e.createCommentVNode("",!0),e.unref(t).appOverlay?(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(l.$slots,"appOverlay")])):e.createCommentVNode("",!0)],2))}}),R=["innerHTML"],h=e.defineComponent({__name:"OnyxIcon",props:{icon:{},size:{default:"24px"},color:{default:"currentColor"}},setup(n){const o=n;return(t,l)=>(e.openBlock(),e.createElementBlock("figure",{class:e.normalizeClass(["onyx-icon",[o.size!=="24px"?`onyx-icon--${o.size}`:"",o.color!=="currentColor"?`onyx-icon--${o.color}`:""]]),"aria-hidden":"true",innerHTML:o.icon},null,10,R))}}),b=(n,o)=>{const t=n.__vccOpts||n;for(const[l,a]of o)t[l]=a;return t},F={},Y={class:"onyx-circle-spinner",viewBox:"0 0 50 50"},j=e.createElementVNode("circle",{class:"onyx-circle-spinner__circle",cx:"50%",cy:"50%",r:"45%"},null,-1),G=[j];function H(n,o){return e.openBlock(),e.createElementBlock("svg",Y,G)}const K=b(F,[["render",H]]),Z={},X={class:"onyx-loading-dots"},W=e.createElementVNode("span",{class:"onyx-loading-dots__center"},null,-1),J=[W];function Q(n,o){return e.openBlock(),e.createElementBlock("div",X,J)}const ee=b(Z,[["render",Q]]),k=e.defineComponent({__name:"OnyxLoadingIndicator",props:{type:{default:"dots"}},setup(n){const o=n;return(t,l)=>o.type==="circle"?(e.openBlock(),e.createBlock(K,{key:0})):o.type==="dots"?(e.openBlock(),e.createBlock(ee,{key:1})):e.createCommentVNode("",!0)}}),te={},ne={class:"onyx-skeleton"};function oe(n,o){return e.openBlock(),e.createElementBlock("figure",ne)}const f=b(te,[["render",oe]]),le=["disabled"],ae={key:2,class:"onyx-button__label onyx-truncation-ellipsis"},re=e.defineComponent({__name:"OnyxButton",props:{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(n,{emit:o}){const t=n,l=o;return(a,d)=>t.skeleton?(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-button-skeleton"})):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["onyx-button",{[`onyx-button--${t.variation}`]:!0,[`onyx-button--${t.mode}`]:!0,"onyx-button--loading":t.loading}]),disabled:t.disabled||t.loading,onClick:d[0]||(d[0]=c=>l("click"))},[t.icon&&!t.loading?(e.openBlock(),e.createBlock(h,{key:0,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(k,{key:1,class:"onyx-button__loading"})):(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(t.label),1))],10,le))}}),se=["button","submit","reset"],ce=["primary","secondary","danger"],ie=["default","outline","plain"],de="(optional)",ue={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.'}},pe="Select all",g={optional:de,validations:ue,selectAll:pe},N=Symbol(),w=n=>{const o=e.computed(()=>e.unref(n==null?void 0:n.locale)??"en-US"),t=e.computed(()=>n!=null&&n.messages&&o.value in n.messages?n.messages[o.value]:g),l=e.computed(()=>(a,d={})=>{let c=$(a,t.value)??$(a,g)??"";const r=typeof d.n=="number"?d.n:void 0;return c=ye(c,r),_e(c,d)});return{locale:o,t:l}},me=(n,o)=>n.provide(N,w(o)),B=()=>e.inject(N,()=>w(),!0),$=(n,o)=>{const t=n.split(".").reduce((l,a)=>!l||typeof l=="string"?l:l[a],o);return t&&typeof t=="string"?t:void 0},ye=(n,o)=>{const t=n.split(" | ").map(a=>a.trim());if(t.length<=1)return n;let l=1;return o===0&&(l=0),o&&(o<=0||o>1)&&(l=2),t.length===2?l===1?t[0]:t[1]:t[l]},_e=(n,o)=>o?Object.entries(o).reduce((l,[a,d])=>d===void 0?l:l.replace(new RegExp(`{${a}}`,"gi"),d.toString()),n).replace(/\s?{.*}\s?/gi,""):n,x=n=>({requiredTypeClass:e.computed(()=>({[`onyx-use-${n.requiredMarker}`]:n.requiredMarker})),requiredMarkerClass:e.computed(()=>({"onyx-required-marker":n.required,"onyx-optional-marker":!n.required}))}),fe={key:0,class:"onyx-checkbox-skeleton"},ke={class:"onyx-checkbox__container"},he=["aria-label","indeterminate","disabled","required"],v=e.defineComponent({__name:"OnyxCheckbox",props:{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(n,{emit:o}){const t=n,{requiredMarkerClass:l,requiredTypeClass:a}=x(t),d=o,c=e.computed({get:()=>t.modelValue,set:i=>d("update:modelValue",i)}),r=e.ref(!1);return(i,s)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(f,{class:"onyx-checkbox-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-checkbox-skeleton__label"}))])):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-checkbox",[e.unref(a)]])},[e.createElementVNode("div",ke,[t.loading?(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-checkbox__loading",type:"circle"})):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":s[0]||(s[0]=p=>c.value=p),"aria-label":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:s[1]||(s[1]=p=>r.value=!0)},null,42,he)),[[e.vModelCheckbox,c.value]])]),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["onyx-checkbox__label",[`onyx-truncation-${t.truncation}`,e.unref(l)]])},e.toDisplayString(t.label),3))],2))}}),xe=["disabled"],ve={key:0,class:"onyx-checkbox-group__label"},ge=e.defineComponent({__name:"OnyxCheckboxGroup",props:{options:{},modelValue:{default:()=>[]},headline:{},direction:{default:"vertical"},withCheckAll:{type:Boolean,default:!1},checkAllLabel:{},disabled:{type:Boolean,default:!1},skeleton:{}},emits:["update:modelValue"],setup(n,{emit:o}){const t=n,l=o,{t:a}=B(),d=(s,p)=>{const u=p?[...t.modelValue,s]:t.modelValue.filter(y=>y!==s);l("update:modelValue",u)},c=e.computed(()=>t.options.filter(s=>!s.disabled&&!s.skeleton)),r=s=>{const p=s?c.value.map(({id:u})=>u):[];l("update:modelValue",p)},i=e.computed(()=>{const s=c.value.map(({id:u})=>u),p=t.modelValue.filter(u=>s.includes(u));return!s.length||!p.length?{modelValue:!1}:p.length===s.length?{modelValue:!0}:{indeterminate:!0,modelValue:!1}});return(s,p)=>(e.openBlock(),e.createElementBlock("fieldset",{class:"onyx-checkbox-group",disabled:t.disabled},[t.headline?(e.openBlock(),e.createElementBlock("legend",ve,[e.createVNode(e.unref(C),{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(v,e.mergeProps({key:0},i.value,{label:t.checkAllLabel||e.unref(a)("selectAll"),"onUpdate:modelValue":r}),null,16,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,u=>(e.openBlock(),e.createBlock(v,e.mergeProps({key:u.id.toString()},u,{"model-value":t.modelValue.includes(u.id),"onUpdate:modelValue":y=>d(u.id,y)}),null,16,["model-value","onUpdate:modelValue"]))),128))],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.skeleton,u=>(e.openBlock(),e.createBlock(v,{key:u,label:`Skeleton ${u}`,skeleton:""},null,8,["label"]))),128))],2)],8,xe))}}),be=n=>n,Be=(()=>{let n=1;return()=>n++})(),T=n=>`${n}-${Be()}`,Ce=be(n=>{const o=e.computed(()=>e.unref(n.multiselect)??!1),t=new Map,l=c=>(t.has(c)||t.set(c,T("listbox-option")),t.get(c)),a=e.ref(!1);e.watchEffect(()=>{var r;if(n.activeOption.value==null||!a.value)return;const c=l(n.activeOption.value);(r=document.getElementById(c))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})});const d=c=>{var r,i,s,p,u,y,m;switch(c.key){case" ":c.preventDefault(),n.activeOption.value!=null&&((r=n.onSelect)==null||r.call(n,n.activeOption.value));break;case"ArrowUp":case"ArrowDown":if(c.preventDefault(),n.activeOption.value==null){(i=n.onActivateFirst)==null||i.call(n);return}c.key==="ArrowDown"?(s=n.onActivateNext)==null||s.call(n,n.activeOption.value):(p=n.onActivatePrevious)==null||p.call(n,n.activeOption.value);break;case"Home":c.preventDefault(),(u=n.onActivateFirst)==null||u.call(n);break;case"End":c.preventDefault(),(y=n.onActivateLast)==null||y.call(n);break;default:(m=n.onTypeAhead)==null||m.call(n,c.key)}};return{elements:{listbox:e.computed(()=>({role:"listbox","aria-multiselectable":o.value,"aria-label":e.unref(n.label),tabindex:"0","aria-activedescendant":n.activeOption.value!=null?l(n.activeOption.value):void 0,onFocus:()=>a.value=!0,onBlur:()=>a.value=!1,onKeydown:d})),group:e.computed(()=>c=>({role:"group","aria-label":c.label})),option:e.computed(()=>c=>{const r=c.selected??!1;return{id:l(c.value),role:"option","aria-label":c.label,"aria-checked":o.value?r:void 0,"aria-selected":o.value?void 0:r,"aria-disabled":c.disabled,onClick:()=>{var i;return(i=n.onSelect)==null?void 0:i.call(n,c.value)}}})},state:{isFocused:a}}}),Ve={class:"onyx-truncation-ellipsis"},Ee=e.defineComponent({__name:"OnyxListboxOption",props:{active:{type:Boolean}},setup(n){const o=n;return(t,l)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["onyx-listbox-option",{"onyx-listbox-option--active":o.active}])},[e.createElementVNode("span",Ve,[e.renderSlot(t.$slots,"default")])],2))}}),Se={class:"onyx-listbox"},$e={key:0,class:"onyx-listbox__label onyx-text--small"},Oe=e.defineComponent({__name:"OnyxListbox",props:{options:{},label:{},modelValue:{},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:o}){const t=n,l=o,a=e.ref();e.watch(()=>t.modelValue,r=>{a.value=r});const{elements:{listbox:d,option:c}}=Ce({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 i=t.options.findIndex(s=>s.id===r);i<t.options.length-1&&(a.value=t.options[i+1].id)},onActivatePrevious:r=>{const i=t.options.findIndex(s=>s.id===r);i>0&&(a.value=t.options[i-1].id)},onTypeAhead:r=>{const i=t.options.find(s=>s.label.toLowerCase().trim().startsWith(r.toLowerCase()));i&&(a.value=i.id)}});return(r,i)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("ul",e.mergeProps(e.unref(d),{class:"onyx-listbox__options"}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,s=>(e.openBlock(),e.createBlock(Ee,e.mergeProps({key:s.id.toString()},e.unref(c)({value:s.id,label:s.label,disabled:s.disabled,selected:s.id===t.modelValue}),{active:s.id===a.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:2},1040,["active"]))),128))],16),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(t.label),1))]))}}),C=e.defineComponent({__name:"OnyxHeadline",props:{is:{},monospace:{type:Boolean,default:!1}},setup(n){const o=n;return(t,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.is),{class:e.normalizeClass(["onyx-headline",`onyx-headline--${o.is}`,o.monospace?"onyx-headline--monospace":""])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["class"]))}}),Ne=["h1","h2","h3","h4","h5","h6"],we=["12px","16px","24px","32px","48px","64px","96px"],Te=["aria-label","disabled"],Le=e.defineComponent({__name:"OnyxIconButton",props:{label:{},disabled:{type:Boolean,default:!1},type:{default:"button"},variation:{default:"primary"},loading:{type:Boolean},icon:{}},emits:["click"],setup(n,{emit:o}){const t=n,l=o;return(a,d)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["onyx-icon-button",{[`onyx-icon-button--${t.variation}`]:!0,"onyx-icon-button--loading":t.loading}]),"aria-label":t.label,disabled:t.disabled||t.loading,onClick:d[0]||(d[0]=c=>l("click"))},[t.loading?(e.openBlock(),e.createBlock(k,{key:0,type:"circle"})):t.icon?(e.openBlock(),e.createBlock(h,{key:1,icon:t.icon},null,8,["icon"])):e.renderSlot(a.$slots,"default",{key:2})],10,Te))}}),Ie={class:"onyx-truncation-ellipsis"},Me={class:"onyx-input__wrapper"},qe=["placeholder","type","required","autocapitalize","autocomplete","autofocus","name","pattern","readonly","disabled","minlength","maxlength","aria-label"],ze={key:0,class:"onyx-input__footer onyx-text--small"},Ae={key:0,class:"onyx-truncation-ellipsis"},De={key:1,class:"onyx-input__counter"},Pe=e.defineComponent({__name:"OnyxInput",props:{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(n,{emit:o}){const t=n,l=o,{requiredMarkerClass:a,requiredTypeClass:d}=x(t),c=e.computed({get:()=>t.modelValue,set:p=>l("update:modelValue",p)}),r=p=>{const u=p.target.value;l("change",u)},i=e.computed(()=>t.pattern instanceof RegExp?t.pattern.source:t.pattern),s=e.computed(()=>t.withCounter&&t.maxlength);return(p,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["onyx-input",e.unref(d)])},[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",Ie,e.toDisplayString(t.label),1)],2)),e.createElementVNode("div",Me,[t.loading?(e.openBlock(),e.createBlock(k,{key:0,class:"onyx-input__loading",type:"circle"})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=y=>c.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:i.value,readonly:t.readonly,disabled:t.disabled||t.loading,minlength:t.minlength,maxlength:t.maxlength,"aria-label":t.hideLabel?t.label:void 0,onChange:r,onFocus:u[1]||(u[1]=y=>l("focus")),onBlur:u[2]||(u[2]=y=>l("blur"))},null,40,qe),[[e.vModelDynamic,c.value]])])]),t.message||s.value?(e.openBlock(),e.createElementBlock("div",ze,[t.message?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(c.value.length)+"/"+e.toDisplayString(t.maxlength),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),Ue=["email","password","search","tel","text","url"],Re=["none","sentences","words","characters"],Fe='<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>',Ye=n=>/^http(s?):\/\//.test(n),je=["href","target","rel"],Ge=e.defineComponent({__name:"OnyxLink",props:{href:{},target:{default:"_self"},withExternalIcon:{type:[Boolean,String],default:"auto"}},emits:["click"],setup(n,{emit:o}){const t=n,l=o,a=e.computed(()=>t.withExternalIcon!=="auto"?t.withExternalIcon:Ye(t.href));return(d,c)=>(e.openBlock(),e.createElementBlock("a",{class:"onyx-link",href:t.href,target:t.target,rel:t.target==="_blank"?"noreferrer":void 0,onClick:c[0]||(c[0]=r=>l("click"))},[e.renderSlot(d.$slots,"default"),a.value?(e.openBlock(),e.createBlock(h,{key:0,class:"onyx-link__icon",icon:e.unref(Fe),size:"16px"},null,8,["icon"])):e.createCommentVNode("",!0)],8,je))}}),He=["_self","_blank","_parent","_top"],Ke={key:0,class:"onyx-page__sidebar"},Ze={class:"onyx-page__main"},Xe={key:1,class:"onyx-page__footer"},We={key:2,class:"onyx-page__toasts"},Je=e.defineComponent({__name:"OnyxPageLayout",props:{footerAsideSidebar:{type:Boolean},hideSidebar:{type:Boolean}},setup(n){const o=n,t=e.useSlots(),l=e.computed(()=>{let a="";return!t.footer&&t.sidebar&&(a="onyx-page--side-main"),t.footer&&(!t.sidebar||o.hideSidebar)&&(a="onyx-page--main-footer"),t.footer&&t.sidebar&&(o.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&&!o.hideSidebar?(e.openBlock(),e.createElementBlock("aside",Ke,[e.renderSlot(a.$slots,"sidebar")])):e.createCommentVNode("",!0),e.createElementVNode("main",Ze,[e.renderSlot(a.$slots,"default")]),e.unref(t).footer?(e.openBlock(),e.createElementBlock("footer",Xe,[e.renderSlot(a.$slots,"footer")])):e.createCommentVNode("",!0),e.unref(t).toasts?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(a.$slots,"toasts")])):e.createCommentVNode("",!0)],2))}}),L=n=>({densityClass:e.computed(()=>({[`onyx-density-${n.density}`]:n.density}))}),Qe=["title"],et=["required","name","value","checked","disabled"],O=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(n){const o=n,t=e.ref(),{densityClass:l}=L(o);return e.watchEffect(()=>{var a;return(a=t.value)==null?void 0:a.setCustomValidity(o.errorMessage??"")}),(a,d)=>o.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["onyx-radio-button-skeleton",e.unref(l)])},[e.createVNode(f,{class:"onyx-radio-button-skeleton__input"}),e.createVNode(f,{class:"onyx-radio-button-skeleton__label"})],2)):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-radio-button",e.unref(l)]),title:o.errorMessage},[o.loading?(e.openBlock(),e.createBlock(e.unref(k),{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:o.required,name:o.name,value:o.id,checked:o.selected,disabled:o.disabled},null,8,et)),e.createElementVNode("span",{class:e.normalizeClass(["onyx-radio-button__label",[`onyx-truncation-${o.truncation}`]])},e.toDisplayString(o.label),3)],10,Qe))}}),tt=["disabled"],nt={key:0,class:"onyx-radio-button-group__headline"},ot=e.defineComponent({__name:"OnyxRadioButtonGroup",props:{density:{},required:{type:Boolean,default:!1},requiredMarker:{},name:{default:()=>T("radio-button-group-name")},modelValue:{},headline:{default:""},disabled:{type:Boolean,default:!1},errorMessage:{default:""},direction:{default:"vertical"},options:{},skeleton:{}},emits:["update:modelValue"],setup(n,{emit:o}){const t=n,{densityClass:l}=L(t),{requiredMarkerClass:a,requiredTypeClass:d}=x(t),c=o,r=i=>c("update:modelValue",t.options.find(({id:s})=>i.target.value===s));return(i,s)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["onyx-radio-button-group",e.unref(l),e.unref(d)]),disabled:t.disabled,onChange:s[0]||(s[0]=p=>r(p))},[t.headline?(e.openBlock(),e.createElementBlock("legend",nt,[e.createVNode(C,{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 u;return e.openBlock(),e.createBlock(O,e.mergeProps({key:p.id.toString()},p,{name:t.name,"error-message":t.errorMessage,selected:p.id===((u=t.modelValue)==null?void 0:u.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(O,{id:`skeleton-${p}`,key:p,label:"Skeleton ${i}",name:t.name,skeleton:""},null,8,["id","name"]))),128))],2)],42,tt))}}),I=(n,o)=>{const t=Object.entries(n).filter(([a,d])=>d!==void 0),l=Object.entries(o).filter(([a,d])=>d!==void 0);return t.length!==l.length?!1:t.every(([a,d])=>d===o[a])},M=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([n,o])=>o.enumerable).map(([n])=>n),q=n=>M().reduce((o,t)=>(o[t]=n[t],o),{}),lt=n=>{if(n.valueMissing)return"valueMissing";const o=M().filter(t=>t!=="valid").sort();for(const t of o)if(t in n&&n[t])return t},at='<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>',rt='<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>',st={key:0,class:"onyx-switch-skeleton"},ct=["aria-label","disabled","required"],it={class:"onyx-switch__container"},dt={class:"onyx-switch__icon"},ut=e.defineComponent({__name:"OnyxSwitch",props:{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(n,{emit:o}){var p;const t=n,l=o,{requiredMarkerClass:a,requiredTypeClass:d}=x(t),{errorMessage:c}=e.toRefs(t),r=e.ref(),i=e.ref((p=r.value)==null?void 0:p.validity),s=e.computed({get:()=>t.modelValue,set:u=>{l("update:modelValue",u)}});return e.watch([r,c],()=>{r.value&&r.value.setCustomValidity(t.errorMessage||"")}),e.watch([r,s,c],()=>{if(!r.value)return;const u=q(r.value.validity);(!i.value||!I(u,i.value))&&(i.value=u,l("validityChange",i.value))},{immediate:!0}),(u,y)=>t.skeleton?(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(f,{class:"onyx-switch-skeleton__input"}),t.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:0,class:"onyx-switch-skeleton__label"}))])):(e.openBlock(),e.createElementBlock("label",{key:1,class:e.normalizeClass(["onyx-switch",[e.unref(d)]])},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputElement",ref:r,"onUpdate:modelValue":y[0]||(y[0]=m=>s.value=m),class:e.normalizeClass({"onyx-switch__input":!0,"onyx-switch__loading":t.loading}),type:"checkbox","aria-label":t.hideLabel?t.label:void 0,disabled:t.disabled||t.loading,required:t.required},null,10,ct),[[e.vModelCheckbox,s.value]]),e.createElementVNode("span",it,[e.createElementVNode("span",dt,[t.loading?(e.openBlock(),e.createBlock(e.unref(k),{key:0,class:"onyx-switch__spinner",type:"circle"})):(e.openBlock(),e.createBlock(e.unref(h),{key:1,icon:s.value?e.unref(at):e.unref(rt),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))],2))}}),pt=Object.keys(g.validations.typeMismatch),mt={key:0,class:"onyx-test-input__error","aria-live":"polite"},yt={class:"onyx-test-input__info"},_t=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(n,{emit:o}){var y;const t=n,l=o,{t:a}=B(),{errorMessage:d}=e.toRefs(t),c=e.ref(!1),r=e.ref(null),i=e.ref((y=r.value)==null?void 0:y.validity),s=e.computed({get:()=>t.modelValue,set:m=>l("update:modelValue",m)}),p=e.computed(()=>{if(!i.value||i.value.valid)return"";const m=lt(i.value);if(t.errorMessage||m==="customError")return t.errorMessage;if(!m)return"";if(m==="typeMismatch"){const _=pt.includes(t.type)?t.type:"generic";return a.value(`validations.typeMismatch.${_}`,{value:s.value})}return a.value(`validations.${m}`,{value:s.value,n:s.value.toString().length,minLength:t.minLength,maxLength:t.maxLength,min:t.min,max:t.max,step:t.step})}),u=m=>{const _=m.target;l("change",_.value)};return e.watch([r,d],()=>{r.value&&r.value.setCustomValidity(t.errorMessage||"")}),e.watch([r,s,d],()=>{if(!r.value)return;const m=q(r.value.validity);(!i.value||!I(m,i.value))&&(i.value=m,l("validityChange",i.value))},{immediate:!0}),(m,_)=>{var V,E;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["onyx-test-input",{"onyx-test-input--touched":c.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":_[0]||(_[0]=S=>s.value=S),onChange:u,onBlur:_[1]||(_[1]=S=>c.value=!0)}),null,16),[[e.vModelDynamic,s.value]]),c.value&&!((V=i.value)!=null&&V.valid)?(e.openBlock(),e.createElementBlock("p",mt,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0),e.createElementVNode("p",yt,' Model value: "'+e.toDisplayString(s.value)+'", is valid: '+e.toDisplayString((E=i.value)==null?void 0:E.valid),1)],2)}}}),ft=["primary","secondary","neutral","danger","warning","success","info"],kt=["small","default","large"],ht=["ellipsis","multiline"],xt=["horizontal","vertical"],vt=n=>({install:o=>{me(o,n.i18n);const t=o.runWithContext(()=>B());e.watchEffect(()=>gt(t.t.value("optional")))}}),gt=n=>globalThis.document.body.style.setProperty("--onyx-global-optional-text",n);exports.AUTOCAPITALIZE=Re;exports.BUTTON_MODES=ie;exports.BUTTON_TYPES=se;exports.BUTTON_VARIATIONS=ce;exports.DIRECTIONS=xt;exports.HEADLINE_TYPES=Ne;exports.ICON_SIZES=we;exports.INPUT_TYPES=Ue;exports.LINK_TARGETS=He;exports.ONYX_COLORS=ft;exports.OnyxAppLayout=U;exports.OnyxButton=re;exports.OnyxCheckboxGroup=ge;exports.OnyxHeadline=C;exports.OnyxIcon=h;exports.OnyxIconButton=Le;exports.OnyxInput=Pe;exports.OnyxLink=Ge;exports.OnyxListbox=Oe;exports.OnyxLoadingIndicator=k;exports.OnyxPageLayout=Je;exports.OnyxRadioButtonGroup=ot;exports.OnyxSkeleton=f;exports.OnyxSwitch=ut;exports.TEXT_SIZES=kt;exports.TRUNCATION_TYPES=ht;exports.TestInput=_t;exports.createOnyx=vt;