This requires the path to the Codex modules directory to be configurable, so we can use static manifest and component files in tests. This is achieved by changing the constant storing the Codex modules dir from private to protected so it can be overridden when creating a test module. Bug: T350054 Change-Id: Icd3c6c5d2a82f5a5fb1c38b52e54893034e7375c
1 line
609 B
JavaScript
1 line
609 B
JavaScript
"use strict";const i=require("vue"),n=require("./useSlotContents.js"),c=require("./useWarnOnce.js");function l(u,t,r){const o=i.computed(()=>{const s=n.useSlotContents(u);if(s.length!==1)return!1;const e=s[0];return!!(typeof e=="object"&&(n.isComponentVNode(e,"CdxIcon")||n.isTagVNode(e,"svg")))});return c.useWarnOnce(()=>o.value&&!t["aria-label"]&&!t["aria-hidden"],"".concat(r,": Icon-only buttons require one of the following attributes: aria-label or aria-hidden. See documentation at https://doc.wikimedia.org/codex/latest/components/demos/button.html#icon-only-button")),o}exports.useIconOnlyButton=l;
|