UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

4 lines 1.02 kB
/*! * KoliBri - The accessible HTML-Standard */ import{w as t,c as e,u as o}from"./index-ebe5a881.js";const n=[0,1,2,3,4,5,6],a=/[a-zA-Z0-9äöüÄÖÜß]/g,s=/^\d+$/;function r(t){var e;return"string"==typeof t&&(null===(e=t.match(a))||void 0===e?void 0:e.length)||0}function i(t,e=1){return r(t)>=e}function c(t){return s.test(t)}function l(t){var a;return Object.assign(Object.assign({},t),{hooks:{afterPatch:(a,n,s,r)=>{var l,h;"function"==typeof(null===(l=t.hooks)||void 0===l?void 0:l.afterPatch)&&(null===(h=t.hooks)||void 0===h||h.afterPatch(a,n,s,r)),"string"==typeof a&&!1===i(a,3)&&!1===c(a)&&e(`The heading or label ("${a}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof a&&a.length>80&&o("A heading or label should not be longer than 80 characters.")},beforePatch:null===(a=t.hooks)||void 0===a?void 0:a.beforePatch}})}const f=new Set(["string"]),u=(e,o,a={})=>{t(e,"_label",(t=>"string"==typeof t),f,o,l(a))},d=u;export{d as a,i as b,c,n as h,u as v};