@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 1.03 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{w as t,b as e,u as o}from"./index-88dea7b1.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 l(t){return s.test(t)}function c(t){var a;return Object.assign(Object.assign({},t),{hooks:{afterPatch:(a,n,s,r)=>{var c,h;"function"==typeof(null===(c=t.hooks)||void 0===c?void 0:c.afterPatch)&&(null===(h=t.hooks)||void 0===h||h.afterPatch(a,n,s,r)),"string"==typeof a&&!1===i(a,3)&&!1===l(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"]),d=(e,a,o={})=>{t(e,"_label",(t=>"string"==typeof t),f,a,c(o))},u=d;export{u as a,i as b,l as c,n as h,d as v};