@octaviaflow/utilities-react 1.0.0 → 1.1.3

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octaviaflow/utilities-react",
3
3
  "description": "Utilities and helpers to drive consistency across software products using the OctaviaFlow Design System with React",
4
- "version": "1.0.0",
4
+ "version": "1.1.3",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -32,7 +32,8 @@
32
32
  "build:types": "tsc",
33
33
  "build": "bun run build:es & bun run build:cjs & bun run build:types",
34
34
  "watch": "bun run build:es --watch & bun run build:cjs --watch",
35
- "clean": "rimraf es lib"
35
+ "clean": "rimraf es lib",
36
+ "test": "bun test ."
36
37
  },
37
38
  "peerDependencies": {
38
39
  "react": "^19.2.0"
@@ -1,14 +0,0 @@
1
- /**
2
- * Copyright OctaviaFlow
3
- * Author: Vishal Kumar
4
- * Created: 11/November/2025
5
- *
6
- * This source code is licensed under the Apache-2.0 license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
10
- import{useEffect as i}from"react";function d(r,t="component should have no interactive child nodes"){__DEV__&&i(()=>{const e=r.current?n(r.current):!1;if(e)throw new Error(`Error: ${t}.
11
-
12
- Instead found: ${e.outerHTML}`)})}function s(r,t="interactive child node(s) should have an `aria-describedby` property"){__DEV__&&i(()=>{const e=r.current?n(r.current):!1;if(e&&!e.hasAttribute("aria-describedby"))throw new Error(`Error: ${t}.
13
-
14
- Instead found: ${e.outerHTML}`)})}function n(r){if(!r||!r.childNodes)return null;if(u(r))return r;for(const t of r.childNodes){const e=n(t);if(e)return e}return null}function o(r){if(!r||!r.childNodes)return null;if(r?.getAttribute?.("role")&&r.getAttribute("role")!=="")return r;for(const t of r.childNodes){const e=o(t);if(e)return e}return null}function u(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{n as getInteractiveContent,o as getRoleContent,s as useInteractiveChildrenNeedDescription,d as useNoInteractiveChildren};
@@ -1,14 +0,0 @@
1
- /**
2
- * Copyright OctaviaFlow
3
- * Author: Vishal Kumar
4
- * Created: 11/November/2025
5
- *
6
- * This source code is licensed under the Apache-2.0 license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
10
- "use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of f(e))!a.call(r,n)&&n!==t&&o(r,n,{get:()=>e[n],enumerable:!(c=s(e,n))||c.enumerable});return r};var N=r=>h(o({},"__esModule",{value:!0}),r);var I={};l(I,{getInteractiveContent:()=>i,getRoleContent:()=>d,useInteractiveChildrenNeedDescription:()=>p,useNoInteractiveChildren:()=>b});module.exports=N(I);var u=require("react");function b(r,e="component should have no interactive child nodes"){__DEV__&&(0,u.useEffect)(()=>{const t=r.current?i(r.current):!1;if(t)throw new Error(`Error: ${e}.
11
-
12
- Instead found: ${t.outerHTML}`)})}function p(r,e="interactive child node(s) should have an `aria-describedby` property"){__DEV__&&(0,u.useEffect)(()=>{const t=r.current?i(r.current):!1;if(t&&!t.hasAttribute("aria-describedby"))throw new Error(`Error: ${e}.
13
-
14
- Instead found: ${t.outerHTML}`)})}function i(r){if(!r||!r.childNodes)return null;if(v(r))return r;for(const e of r.childNodes){const t=i(e);if(t)return t}return null}function d(r){if(!r||!r.childNodes)return null;if(r?.getAttribute?.("role")&&r.getAttribute("role")!=="")return r;for(const e of r.childNodes){const t=d(e);if(t)return t}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}}