@carbon/utilities-react 0.19.0-rc.0 → 0.20.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as u}from"react";function f(r,e="component should have no interactive child nodes"){u(()=>{if(process.env.NODE_ENV==="production")return;const{current:t}=r,n=t?o(t):null;if(n){const i=`Error: ${e}.
|
|
2
2
|
|
|
3
|
-
Instead found: ${
|
|
3
|
+
Instead found: ${n.outerHTML}`;throw console.error(i),new Error(i)}},[e,r])}function l(r,e="interactive child node(s) should have an `aria-describedby` property"){u(()=>{if(process.env.NODE_ENV==="production")return;const{current:t}=r,n=t?o(t):null;if(n&&!n.hasAttribute("aria-describedby"))throw new Error(`Error: ${e}.
|
|
4
4
|
|
|
5
|
-
Instead found: ${
|
|
5
|
+
Instead found: ${n.outerHTML}`)},[e,r])}function o(r){if(!r||!r.childNodes)return null;if(s(r))return r;for(const e of r.childNodes){const t=o(e);if(t)return t}return null}function c(r){if(!r||!r.childNodes)return null;if(r?.getAttribute?.("role")&&r.getAttribute("role")!=="")return r;for(const e of r.childNodes){const t=c(e);if(t)return t}return null}function s(r){if(r.tabIndex===void 0||r.tabIndex<0||r.disabled)return!1;switch(r.nodeName){case"A":return!!r.href&&r.rel!=="ignore";case"INPUT":return r.type!=="hidden";default:return!0}}export{o as getInteractiveContent,c as getRoleContent,l as useInteractiveChildrenNeedDescription,f as useNoInteractiveChildren};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(r,t)=>{for(var e in t)u(r,e,{get:t[e],enumerable:!0})},h=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f(t))!l.call(r,o)&&o!==e&&u(r,o,{get:()=>t[o],enumerable:!(n=d(t,o))||n.enumerable});return r};var N=r=>h(u({},"__esModule",{value:!0}),r);var E={};a(E,{getInteractiveContent:()=>i,getRoleContent:()=>s,useInteractiveChildrenNeedDescription:()=>b,useNoInteractiveChildren:()=>p});module.exports=N(E);var c=require("react");function p(r,t="component should have no interactive child nodes"){(0,c.useEffect)(()=>{if(process.env.NODE_ENV==="production")return;const{current:e}=r,n=e?i(e):null;if(n){const o=`Error: ${t}.
|
|
2
2
|
|
|
3
|
-
Instead found: ${
|
|
3
|
+
Instead found: ${n.outerHTML}`;throw console.error(o),new Error(o)}},[t,r])}function b(r,t="interactive child node(s) should have an `aria-describedby` property"){(0,c.useEffect)(()=>{if(process.env.NODE_ENV==="production")return;const{current:e}=r,n=e?i(e):null;if(n&&!n.hasAttribute("aria-describedby"))throw new Error(`Error: ${t}.
|
|
4
4
|
|
|
5
|
-
Instead found: ${
|
|
5
|
+
Instead found: ${n.outerHTML}`)},[t,r])}function i(r){if(!r||!r.childNodes)return null;if(v(r))return r;for(const t of r.childNodes){const e=i(t);if(e)return e}return null}function s(r){if(!r||!r.childNodes)return null;if(r?.getAttribute?.("role")&&r.getAttribute("role")!=="")return r;for(const t of r.childNodes){const e=s(t);if(e)return e}return null}function v(r){if(r.tabIndex===void 0||r.tabIndex<0||r.disabled)return!1;switch(r.nodeName){case"A":return!!r.href&&r.rel!=="ignore";case"INPUT":return r.type!=="hidden";default:return!0}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/utilities-react",
|
|
3
3
|
"description": "Utilities and helpers to drive consistency across software products using the Carbon Design System with React",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.20.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"typescript-config-carbon": "^0.9.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@carbon/utilities": "^0.
|
|
51
|
+
"@carbon/utilities": "^0.17.0-rc.0",
|
|
52
52
|
"@ibm/telemetry-js": "^1.6.1"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f3e7c2811340637ead19b4a1a550a20820602cc4"
|
|
55
55
|
}
|