UNPKG

braid-design-system

Version:
20 lines (17 loc) 848 B
"use strict"; const dedent = require("dedent"); const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e }; const dedent__default = /* @__PURE__ */ _interopDefaultCompat(dedent); const validTabIndexes = [0, -1]; const validateTabIndex = (tabIndex) => { if (tabIndex && !validTabIndexes.includes(tabIndex)) { throw new Error(dedent__default.default` Braid only supports “tabIndex” values of 0 and -1. Avoid using tabindex values greater than 0 and CSS properties that can change the order of focusable HTML elements. Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#:~:text=only%20use%200%20and%20%2D1%20as%20tabindex%20values `); } }; exports.validTabIndexes = validTabIndexes; exports.validateTabIndex = validateTabIndex;