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,t as o,y as n}from"./common-7RW_NFNf.js";const e=[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 e;return Object.assign(Object.assign({},t),{hooks:{afterPatch:(e,a,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(e,a,s,r)),"string"==typeof e&&!1===i(e,3)&&!1===c(e)&&o(`The heading or label ("${e}") is inaccessible. A label should consist of at least three readable characters.`),"string"==typeof e&&e.length>80&&n("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=(e,o,a={})=>{t(e,"_label",(t=>"string"==typeof t),f,o,l(a))},d=u;export{d as a,i as b,c,e as h,u as v};