sit-onyx 0.1.0-alpha.4 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,12 @@
1
- <p>
2
- <a href="https://gruppe.schwarz">
3
- <div align="center">
4
- <img src="../../.github/schwarz-group.svg" width="400px" />
5
- </div>
6
- </a>
7
- </p>
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-light.svg">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg">
5
+ <img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg" width="160px">
6
+ </picture>
7
+ </div>
8
+
9
+ <br>
8
10
 
9
11
  # onyx
10
12
 
@@ -0,0 +1,24 @@
1
+ import type { Meta } from "@storybook/vue3";
2
+ import OnyxHeadline from "./OnyxHeadline.vue";
3
+ /**
4
+ * Headline that can e.g. be used to structure the page content.
5
+ */
6
+ declare const meta: Meta<typeof OnyxHeadline>;
7
+ export default meta;
8
+ /**
9
+ * This example shows a default h1 headline.
10
+ */
11
+ export declare const Default: {
12
+ args: {
13
+ is: "h1";
14
+ };
15
+ };
16
+ /**
17
+ * This example shows a h1 headline with the monospace font family.
18
+ */
19
+ export declare const Monospace: {
20
+ args: {
21
+ monospace: true;
22
+ is: "h1";
23
+ };
24
+ };
@@ -0,0 +1,41 @@
1
+ import type { OnyxHeadlineProps } from "./types";
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxHeadlineProps>, {
3
+ monospace: boolean;
4
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxHeadlineProps>, {
5
+ monospace: boolean;
6
+ }>>>, {
7
+ monospace: boolean;
8
+ }, {}>, Readonly<{
9
+ /**
10
+ * Headline content.
11
+ */
12
+ default(): unknown;
13
+ }> & {
14
+ /**
15
+ * Headline content.
16
+ */
17
+ default(): unknown;
18
+ }>;
19
+ export default _default;
20
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
29
+ type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,11 @@
1
+ export type OnyxHeadlineProps = {
2
+ /**
3
+ * Headline type. Please note that only h1-h4 are intended to be used from UX perspective.
4
+ * h5 and h6 will have the same styles as h4 and should only be used for semantic reasons.
5
+ */
6
+ is: HeadlineType;
7
+ /** If `true`, the monospace font family will be used instead of the default one. */
8
+ monospace?: boolean;
9
+ };
10
+ export declare const HEADLINE_TYPES: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
11
+ export type HeadlineType = (typeof HEADLINE_TYPES)[number];
@@ -56,9 +56,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
56
56
  onChange?: ((value: string) => any) | undefined;
57
57
  onValidityChange?: ((state: ValidityState) => any) | undefined;
58
58
  }, {
59
+ type: "number" | "search" | "email" | "tel" | "url" | "password" | "text";
59
60
  modelValue: string | number;
60
61
  label: string;
61
- type: "number" | "search" | "email" | "tel" | "url" | "password" | "text";
62
62
  }, {}>;
63
63
  export default _default;
64
64
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),V={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.'}},v={validations:V},_=Symbol(),b=t=>{const n=r.computed(()=>r.unref(t==null?void 0:t.locale)??"en-US"),e=r.computed(()=>t!=null&&t.messages&&n.value in t.messages?t.messages[n.value]:v),a=r.computed(()=>(s,l={})=>{let m=y(s,e.value)??y(s,v)??"";const o=typeof l.n=="number"?l.n:void 0;return m=I(m,o),T(m,l)});return{locale:n,t:a}},E=t=>{r.provide(_,b(t))},P=()=>r.inject(_,()=>b(),!0),y=(t,n)=>{const e=t.split(".").reduce((a,s)=>!a||typeof a=="string"?a:a[s],n);return e&&typeof e=="string"?e:void 0},I=(t,n)=>{const e=t.split(" | ").map(s=>s.trim());if(e.length<=1)return t;let a=1;return n===0&&(a=0),n&&(n<=0||n>1)&&(a=2),e.length===2?a===1?e[0]:e[1]:e[a]},T=(t,n)=>n?Object.entries(n).reduce((a,[s,l])=>l===void 0?a:a.replace(new RegExp(`{${s}}`,"gi"),l.toString()),t).replace(/\s?{.*}\s?/gi,""):t,x=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([t,n])=>n.enumerable).map(([t])=>t),L=t=>x().reduce((n,e)=>(n[e]=t[e],n),{}),O=t=>{if(t.valueMissing)return"valueMissing";const n=x().filter(e=>e!=="valid").sort();for(const e of n)if(e in t&&t[e])return e},C=(t,n)=>{const e=Object.entries(t).filter(([s,l])=>l!==void 0),a=Object.entries(n).filter(([s,l])=>l!==void 0);return e.length!==a.length?!1:e.every(([s,l])=>l===n[s])},N={key:0,class:"onyx-input__error","aria-live":"polite"},q={class:"onyx-input__info"},w=Object.keys(v.validations.typeMismatch),D=r.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(t,{emit:n}){var p;const e=t,a=n,{t:s}=P(),{errorMessage:l}=r.toRefs(e),m=r.ref(!1),o=r.ref(null),u=r.ref((p=o.value)==null?void 0:p.validity),d=r.computed({get:()=>e.modelValue,set:i=>a("update:modelValue",i)}),M=r.computed(()=>{if(!u.value||u.value.valid)return"";const i=O(u.value);if(e.errorMessage||i==="customError")return e.errorMessage;if(!i)return"";if(i==="typeMismatch"){const c=w.includes(e.type)?e.type:"generic";return s.value(`validations.typeMismatch.${c}`,{value:d.value})}return s.value(`validations.${i}`,{value:d.value,n:d.value.toString().length,minLength:e.minLength,maxLength:e.maxLength,min:e.min,max:e.max,step:e.step})}),S=i=>{const c=i.target;a("change",c.value)};return r.watch([o,l],()=>{o.value&&o.value.setCustomValidity(e.errorMessage||"")}),r.watch([o,d,l],()=>{if(!o.value)return;const i=L(o.value.validity);(!u.value||!C(i,u.value))&&(u.value=i,a("validityChange",u.value))},{immediate:!0}),(i,c)=>{var g,h;return r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(["onyx-input",{"onyx-input--touched":m.value}])},[r.createElementVNode("span",{class:r.normalizeClass(["onyx-input__label",{"onyx-input__label--required":e.required}])},r.toDisplayString(e.label),3),r.withDirectives(r.createElementVNode("input",r.mergeProps(e,{ref_key:"inputElement",ref:o,"onUpdate:modelValue":c[0]||(c[0]=f=>d.value=f),onChange:S,onBlur:c[1]||(c[1]=f=>m.value=!0)}),null,16),[[r.vModelDynamic,d.value]]),m.value&&!((g=u.value)!=null&&g.valid)?(r.openBlock(),r.createElementBlock("p",N,r.toDisplayString(M.value),1)):r.createCommentVNode("",!0),r.createElementVNode("p",q,'Model value: "'+r.toDisplayString(d.value)+'", is valid: '+r.toDisplayString((h=u.value)==null?void 0:h.valid),1)],2)}}}),U=(t,n)=>{const e=t.__vccOpts||t;for(const[a,s]of n)e[a]=s;return e},j=U(D,[["__scopeId","data-v-6632dbdc"]]);exports.TestInput=j;exports.provideI18n=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),M=t.defineComponent({__name:"OnyxHeadline",props:{is:{},monospace:{type:Boolean,default:!1}},setup(n){const a=n;return(e,r)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.is),{class:t.normalizeClass(["onyx-headline",`onyx-headline--${a.is}`,a.monospace?"onyx-headline--monospace":""])},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["class"]))}}),V=["h1","h2","h3","h4","h5","h6"],P={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.'}},p={validations:P},_=Symbol(),x=n=>{const a=t.computed(()=>t.unref(n==null?void 0:n.locale)??"en-US"),e=t.computed(()=>n!=null&&n.messages&&a.value in n.messages?n.messages[a.value]:p),r=t.computed(()=>(s,l={})=>{let d=y(s,e.value)??y(s,p)??"";const i=typeof l.n=="number"?l.n:void 0;return d=L(d,i),O(d,l)});return{locale:a,t:r}},I=n=>{t.provide(_,x(n))},T=()=>t.inject(_,()=>x(),!0),y=(n,a)=>{const e=n.split(".").reduce((r,s)=>!r||typeof r=="string"?r:r[s],a);return e&&typeof e=="string"?e:void 0},L=(n,a)=>{const e=n.split(" | ").map(s=>s.trim());if(e.length<=1)return n;let r=1;return a===0&&(r=0),a&&(a<=0||a>1)&&(r=2),e.length===2?r===1?e[0]:e[1]:e[r]},O=(n,a)=>a?Object.entries(a).reduce((r,[s,l])=>l===void 0?r:r.replace(new RegExp(`{${s}}`,"gi"),l.toString()),n).replace(/\s?{.*}\s?/gi,""):n,b=()=>Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([n,a])=>a.enumerable).map(([n])=>n),C=n=>b().reduce((a,e)=>(a[e]=n[e],a),{}),D=n=>{if(n.valueMissing)return"valueMissing";const a=b().filter(e=>e!=="valid").sort();for(const e of a)if(e in n&&n[e])return e},N=(n,a)=>{const e=Object.entries(n).filter(([s,l])=>l!==void 0),r=Object.entries(a).filter(([s,l])=>l!==void 0);return e.length!==r.length?!1:e.every(([s,l])=>l===a[s])},w={key:0,class:"onyx-input__error","aria-live":"polite"},B={class:"onyx-input__info"},k=Object.keys(p.validations.typeMismatch),q=t.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:a}){var v;const e=n,r=a,{t:s}=T(),{errorMessage:l}=t.toRefs(e),d=t.ref(!1),i=t.ref(null),u=t.ref((v=i.value)==null?void 0:v.validity),m=t.computed({get:()=>e.modelValue,set:o=>r("update:modelValue",o)}),E=t.computed(()=>{if(!u.value||u.value.valid)return"";const o=D(u.value);if(e.errorMessage||o==="customError")return e.errorMessage;if(!o)return"";if(o==="typeMismatch"){const c=k.includes(e.type)?e.type:"generic";return s.value(`validations.typeMismatch.${c}`,{value:m.value})}return s.value(`validations.${o}`,{value:m.value,n:m.value.toString().length,minLength:e.minLength,maxLength:e.maxLength,min:e.min,max:e.max,step:e.step})}),S=o=>{const c=o.target;r("change",c.value)};return t.watch([i,l],()=>{i.value&&i.value.setCustomValidity(e.errorMessage||"")}),t.watch([i,m,l],()=>{if(!i.value)return;const o=C(i.value.validity);(!u.value||!N(o,u.value))&&(u.value=o,r("validityChange",u.value))},{immediate:!0}),(o,c)=>{var g,h;return t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["onyx-input",{"onyx-input--touched":d.value}])},[t.createElementVNode("span",{class:t.normalizeClass(["onyx-input__label",{"onyx-input__label--required":e.required}])},t.toDisplayString(e.label),3),t.withDirectives(t.createElementVNode("input",t.mergeProps(e,{ref_key:"inputElement",ref:i,"onUpdate:modelValue":c[0]||(c[0]=f=>m.value=f),onChange:S,onBlur:c[1]||(c[1]=f=>d.value=!0)}),null,16),[[t.vModelDynamic,m.value]]),d.value&&!((g=u.value)!=null&&g.valid)?(t.openBlock(),t.createElementBlock("p",w,t.toDisplayString(E.value),1)):t.createCommentVNode("",!0),t.createElementVNode("p",B,'Model value: "'+t.toDisplayString(m.value)+'", is valid: '+t.toDisplayString((h=u.value)==null?void 0:h.valid),1)],2)}}}),U=(n,a)=>{const e=n.__vccOpts||n;for(const[r,s]of a)e[r]=s;return e},j=U(q,[["__scopeId","data-v-6632dbdc"]]);exports.HEADLINE_TYPES=V;exports.OnyxHeadline=M;exports.TestInput=j;exports.provideI18n=I;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { default as OnyxHeadline } from './components/OnyxHeadline/OnyxHeadline.vue';
2
+ export * from './components/OnyxHeadline/types';
1
3
  export { default as TestInput } from './components/TestInput/TestInput.vue';
2
4
  export * from './types/i18n';
3
5
  export * from './types/utils';
package/dist/index.js CHANGED
@@ -1,5 +1,26 @@
1
- import { provide as C, inject as U, computed as d, unref as q, defineComponent as w, toRefs as N, ref as p, watch as b, openBlock as M, createElementBlock as V, normalizeClass as E, createElementVNode as g, toDisplayString as v, withDirectives as j, mergeProps as D, vModelDynamic as k, createCommentVNode as z } from "vue";
2
- const B = {
1
+ import { defineComponent as S, openBlock as g, createBlock as w, resolveDynamicComponent as N, normalizeClass as f, withCtx as U, renderSlot as q, provide as D, inject as $, computed as d, unref as j, toRefs as B, ref as v, watch as E, createElementBlock as V, createElementVNode as h, toDisplayString as p, withDirectives as k, mergeProps as z, vModelDynamic as R, createCommentVNode as A } from "vue";
2
+ const ae = /* @__PURE__ */ S({
3
+ __name: "OnyxHeadline",
4
+ props: {
5
+ is: {},
6
+ monospace: { type: Boolean, default: !1 }
7
+ },
8
+ setup(t) {
9
+ const n = t;
10
+ return (e, a) => (g(), w(N(n.is), {
11
+ class: f([
12
+ "onyx-headline",
13
+ `onyx-headline--${n.is}`,
14
+ n.monospace ? "onyx-headline--monospace" : ""
15
+ ])
16
+ }, {
17
+ default: U(() => [
18
+ q(e.$slots, "default")
19
+ ]),
20
+ _: 3
21
+ }, 8, ["class"]));
22
+ }
23
+ }), re = ["h1", "h2", "h3", "h4", "h5", "h6"], H = {
3
24
  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)",
4
25
  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)",
5
26
  rangeUnderflow: "Value must be greater than or equal to {min}",
@@ -15,46 +36,46 @@ const B = {
15
36
  tel: '"{value}" must be a valid phone number.',
16
37
  url: '"{value}" must a valid URL.'
17
38
  }
18
- }, h = {
19
- validations: B
20
- }, L = Symbol(), S = (t) => {
21
- const r = d(() => q(t == null ? void 0 : t.locale) ?? "en-US"), e = d(() => t != null && t.messages && r.value in t.messages ? t.messages[r.value] : h), a = d(() => (n, s = {}) => {
22
- let c = P(n, e.value) ?? P(n, h) ?? "";
39
+ }, y = {
40
+ validations: H
41
+ }, L = Symbol(), O = (t) => {
42
+ const n = d(() => j(t == null ? void 0 : t.locale) ?? "en-US"), e = d(() => t != null && t.messages && n.value in t.messages ? t.messages[n.value] : y), a = d(() => (r, s = {}) => {
43
+ let c = P(r, e.value) ?? P(r, y) ?? "";
23
44
  const i = typeof s.n == "number" ? s.n : void 0;
24
- return c = $(c, i), A(c, s);
45
+ return c = F(c, i), J(c, s);
25
46
  });
26
- return { locale: r, t: a };
27
- }, Z = (t) => {
28
- C(L, S(t));
29
- }, R = () => U(L, () => S(), !0), P = (t, r) => {
30
- const e = t.split(".").reduce((a, n) => !a || typeof a == "string" ? a : a[n], r);
47
+ return { locale: n, t: a };
48
+ }, se = (t) => {
49
+ D(L, O(t));
50
+ }, Y = () => $(L, () => O(), !0), P = (t, n) => {
51
+ const e = t.split(".").reduce((a, r) => !a || typeof a == "string" ? a : a[r], n);
31
52
  return e && typeof e == "string" ? e : void 0;
32
- }, $ = (t, r) => {
33
- const e = t.split(" | ").map((n) => n.trim());
53
+ }, F = (t, n) => {
54
+ const e = t.split(" | ").map((r) => r.trim());
34
55
  if (e.length <= 1)
35
56
  return t;
36
57
  let a = 1;
37
- return r === 0 && (a = 0), r && (r <= 0 || r > 1) && (a = 2), e.length === 2 ? a === 1 ? e[0] : e[1] : e[a];
38
- }, A = (t, r) => r ? Object.entries(r).reduce((a, [n, s]) => s === void 0 ? a : a.replace(new RegExp(`{${n}}`, "gi"), s.toString()), t).replace(/\s?{.*}\s?/gi, "") : t, I = () => Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([t, r]) => r.enumerable).map(([t]) => t), F = (t) => I().reduce(
39
- (r, e) => (r[e] = t[e], r),
58
+ return n === 0 && (a = 0), n && (n <= 0 || n > 1) && (a = 2), e.length === 2 ? a === 1 ? e[0] : e[1] : e[a];
59
+ }, J = (t, n) => n ? Object.entries(n).reduce((a, [r, s]) => s === void 0 ? a : a.replace(new RegExp(`{${r}}`, "gi"), s.toString()), t).replace(/\s?{.*}\s?/gi, "") : t, I = () => Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([t, n]) => n.enumerable).map(([t]) => t), K = (t) => I().reduce(
60
+ (n, e) => (n[e] = t[e], n),
40
61
  {}
41
- ), Y = (t) => {
62
+ ), G = (t) => {
42
63
  if (t.valueMissing)
43
64
  return "valueMissing";
44
- const r = I().filter((e) => e !== "valid").sort();
45
- for (const e of r)
65
+ const n = I().filter((e) => e !== "valid").sort();
66
+ for (const e of n)
46
67
  if (e in t && t[e])
47
68
  return e;
48
- }, J = (t, r) => {
49
- const e = Object.entries(t).filter(([n, s]) => s !== void 0), a = Object.entries(r).filter(([n, s]) => s !== void 0);
50
- return e.length !== a.length ? !1 : e.every(([n, s]) => s === r[n]);
51
- }, K = {
69
+ }, Q = (t, n) => {
70
+ const e = Object.entries(t).filter(([r, s]) => s !== void 0), a = Object.entries(n).filter(([r, s]) => s !== void 0);
71
+ return e.length !== a.length ? !1 : e.every(([r, s]) => s === n[r]);
72
+ }, W = {
52
73
  key: 0,
53
74
  class: "onyx-input__error",
54
75
  "aria-live": "polite"
55
- }, G = { class: "onyx-input__info" }, H = Object.keys(
56
- h.validations.typeMismatch
57
- ), Q = /* @__PURE__ */ w({
76
+ }, X = { class: "onyx-input__info" }, Z = Object.keys(
77
+ y.validations.typeMismatch
78
+ ), ee = /* @__PURE__ */ S({
58
79
  __name: "TestInput",
59
80
  props: {
60
81
  modelValue: { default: "" },
@@ -70,24 +91,24 @@ const B = {
70
91
  minLength: {}
71
92
  },
72
93
  emits: ["update:modelValue", "change", "validityChange"],
73
- setup(t, { emit: r }) {
74
- var f;
75
- const e = t, a = r, { t: n } = R(), { errorMessage: s } = N(e), c = p(!1), i = p(null), u = p((f = i.value) == null ? void 0 : f.validity), m = d({
94
+ setup(t, { emit: n }) {
95
+ var _;
96
+ const e = t, a = n, { t: r } = Y(), { errorMessage: s } = B(e), c = v(!1), i = v(null), o = v((_ = i.value) == null ? void 0 : _.validity), m = d({
76
97
  get: () => e.modelValue,
77
98
  set: (l) => a("update:modelValue", l)
78
- }), O = d(() => {
79
- if (!u.value || u.value.valid)
99
+ }), T = d(() => {
100
+ if (!o.value || o.value.valid)
80
101
  return "";
81
- const l = Y(u.value);
102
+ const l = G(o.value);
82
103
  if (e.errorMessage || l === "customError")
83
104
  return e.errorMessage;
84
105
  if (!l)
85
106
  return "";
86
107
  if (l === "typeMismatch") {
87
- const o = H.includes(e.type) ? e.type : "generic";
88
- return n.value(`validations.typeMismatch.${o}`, { value: m.value });
108
+ const u = Z.includes(e.type) ? e.type : "generic";
109
+ return r.value(`validations.typeMismatch.${u}`, { value: m.value });
89
110
  }
90
- return n.value(`validations.${l}`, {
111
+ return r.value(`validations.${l}`, {
91
112
  value: m.value,
92
113
  n: m.value.toString().length,
93
114
  minLength: e.minLength,
@@ -96,50 +117,52 @@ const B = {
96
117
  max: e.max,
97
118
  step: e.step
98
119
  });
99
- }), T = (l) => {
100
- const o = l.target;
101
- a("change", o.value);
120
+ }), C = (l) => {
121
+ const u = l.target;
122
+ a("change", u.value);
102
123
  };
103
- return b([i, s], () => {
124
+ return E([i, s], () => {
104
125
  i.value && i.value.setCustomValidity(e.errorMessage || "");
105
- }), b(
126
+ }), E(
106
127
  [i, m, s],
107
128
  () => {
108
129
  if (!i.value)
109
130
  return;
110
- const l = F(i.value.validity);
111
- (!u.value || !J(l, u.value)) && (u.value = l, a("validityChange", u.value));
131
+ const l = K(i.value.validity);
132
+ (!o.value || !Q(l, o.value)) && (o.value = l, a("validityChange", o.value));
112
133
  },
113
134
  { immediate: !0 }
114
- ), (l, o) => {
115
- var y, _;
116
- return M(), V("label", {
117
- class: E(["onyx-input", { "onyx-input--touched": c.value }])
135
+ ), (l, u) => {
136
+ var x, b;
137
+ return g(), V("label", {
138
+ class: f(["onyx-input", { "onyx-input--touched": c.value }])
118
139
  }, [
119
- g("span", {
120
- class: E(["onyx-input__label", { "onyx-input__label--required": e.required }])
121
- }, v(e.label), 3),
122
- j(g("input", D(e, {
140
+ h("span", {
141
+ class: f(["onyx-input__label", { "onyx-input__label--required": e.required }])
142
+ }, p(e.label), 3),
143
+ k(h("input", z(e, {
123
144
  ref_key: "inputElement",
124
145
  ref: i,
125
- "onUpdate:modelValue": o[0] || (o[0] = (x) => m.value = x),
126
- onChange: T,
127
- onBlur: o[1] || (o[1] = (x) => c.value = !0)
146
+ "onUpdate:modelValue": u[0] || (u[0] = (M) => m.value = M),
147
+ onChange: C,
148
+ onBlur: u[1] || (u[1] = (M) => c.value = !0)
128
149
  }), null, 16), [
129
- [k, m.value]
150
+ [R, m.value]
130
151
  ]),
131
- c.value && !((y = u.value) != null && y.valid) ? (M(), V("p", K, v(O.value), 1)) : z("", !0),
132
- g("p", G, 'Model value: "' + v(m.value) + '", is valid: ' + v((_ = u.value) == null ? void 0 : _.valid), 1)
152
+ c.value && !((x = o.value) != null && x.valid) ? (g(), V("p", W, p(T.value), 1)) : A("", !0),
153
+ h("p", X, 'Model value: "' + p(m.value) + '", is valid: ' + p((b = o.value) == null ? void 0 : b.valid), 1)
133
154
  ], 2);
134
155
  };
135
156
  }
136
- }), W = (t, r) => {
157
+ }), te = (t, n) => {
137
158
  const e = t.__vccOpts || t;
138
- for (const [a, n] of r)
139
- e[a] = n;
159
+ for (const [a, r] of n)
160
+ e[a] = r;
140
161
  return e;
141
- }, ee = /* @__PURE__ */ W(Q, [["__scopeId", "data-v-6632dbdc"]]);
162
+ }, le = /* @__PURE__ */ te(ee, [["__scopeId", "data-v-6632dbdc"]]);
142
163
  export {
143
- ee as TestInput,
144
- Z as provideI18n
164
+ re as HEADLINE_TYPES,
165
+ ae as OnyxHeadline,
166
+ le as TestInput,
167
+ se as provideI18n
145
168
  };