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