Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@interop-ui/react-accordion

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interop-ui/react-accordion - npm Package Compare versions

Comparing version 0.0.1-10 to 0.0.1-11

2

dist/index.js

@@ -1,2 +0,2 @@

var e,t=require("@interop-ui/react-collapsible"),r=t.Collapsible,n=t.styles,o=require("@interop-ui/react-utils"),i=o.composeEventHandlers,a=o.createContext,u=o.createStyleObj,c=o.forwardRef,l=o.useComposedRefs,d=o.useControlledState,s=o.useId,f=require("@interop-ui/utils").cssReset,b=(e=require("react"))&&e.__esModule?e.default:e;function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function g(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var j=h(a("AccordionContext","Accordion"),2),P=j[0],I=j[1],S=h(a("AccordionItemContext","Accordion.Item"),2),E=S[0],C=S[1],D=c((function(e,t){var n,o=e.value,i=(e.isOpen,e.defaultIsOpen,e.children),a=(e.onToggle,g(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=I("Accordion.Item"),c="accordion-button-".concat(s()),l=e.id||c,d=o&&o===u.value||!1,f=b.useMemo((function(){return{isOpen:d,buttonId:l}}),[d,l]);return b.createElement(r,O({},a,M("item"),{ref:t,disabled:null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,isOpen:d,onToggle:function(){return u.setValue(o)}}),b.createElement(E.Provider,{value:f},i))})),x=c((function(e,t){var r=e.as,n=void 0===r?"h3":r,o=g(e,["as"]);return b.createElement(n,O({ref:t},o,M("header")))})),R=c((function(e,t){var n=Object.assign({},e),o=I("Accordion.Button").buttonNodesRef,i=C("Accordion.Button"),a=b.useRef(null),u=l(a,t);return b.useEffect((function(){var e=o.current,t=a.current;if(t)return e.add(t),function(){e.delete(t)}}),[o]),b.createElement(r.Button,O({},n,M("button"),{ref:u,"aria-disabled":i.isOpen||void 0,id:i.buttonId}))})),k=c((function(e,t){var n=C("Accordion.Panel");return b.createElement(r.Content,O({},e,M("panel"),{ref:t,role:"region","aria-labelledby":n.buttonId}))})),B=["Home","End","ArrowDown","ArrowUp"],H=c((function(e,t){var r=e.as,n=void 0===r?"div":r,o=e.value,a=e.defaultValue,u=e.children,c=e.disabled,s=e.onChange,f=void 0===s?function(){}:s,p=g(e,["as","value","defaultValue","children","disabled","onChange"]),y=b.useRef(new Set),v=b.useRef(null),A=l(v,t),w=h(d({prop:o,defaultProp:a,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return e&&f(e)}))}),2),j=w[0],I=w[1],S=i(e.onKeyDown,(function(e){var t,r=e.target;if(B.includes(e.key)&&r instanceof HTMLButtonElement){var n=m(y.current).filter((function(e){return!(e&&e.disabled)})),o=n.length,i=n.indexOf(r);if(-1!==i){e.preventDefault();var a=i;switch(e.key){case"Home":a=0;break;case"End":a=o-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":(a=i-1)<0&&(a=o-1)}null===(t=n[a%o])||void 0===t||t.focus()}}})),E=b.useMemo((function(){return{isDisabled:c,buttonNodesRef:y,value:j,setValue:I}}),[c,j,I]);return b.createElement(n,O({},p,M("root"),{ref:A,onKeyDown:c?void 0:S}),b.createElement(P.Provider,{value:E},u))}));exports.Accordion=H,H.Item=D,H.Header=x,H.Button=R,H.Panel=k,H.displayName="Accordion",H.Item.displayName="Accordion.Item",H.Header.displayName="Accordion.Header",H.Button.displayName="Accordion.Button",H.Panel.displayName="Accordion.Panel";var N=h(u("Accordion",{root:y({},f("div")),item:y(y({},f("div")),n.root),header:y({},f("h3")),button:y(y({},f("button")),n.button),panel:y(y({},f("div")),n.content)}),2),T=N[0],M=N[1];exports.styles=T;
var e,t=require("@interop-ui/react-collapsible"),r=t.Collapsible,n=t.styles,o=require("@interop-ui/react-utils"),i=o.composeEventHandlers,a=o.createContext,u=o.createStyleObj,c=o.forwardRef,l=o.useComposedRefs,d=o.useControlledState,s=o.useId,f=require("@interop-ui/utils").cssReset,b=(e=require("react"))&&e.__esModule?e.default:e;function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function g(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var j=h(a("AccordionContext","Accordion"),2),P=j[0],I=j[1],S=h(a("AccordionItemContext","Accordion.Item"),2),E=S[0],C=S[1],D=c((function(e,t){var n,o=e.value,i=(e.isOpen,e.defaultIsOpen,e.children),a=(e.onToggle,g(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=I("Accordion.Item"),c="accordion-button-".concat(s()),l=e.id||c,d=o&&o===u.value||!1,f=null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,p=b.useMemo((function(){return{isOpen:d,buttonId:l}}),[d,l]);return b.createElement(r,O({},a,M("item"),{ref:t,"data-state":d?"open":"closed","data-disabled":f||void 0,disabled:f,isOpen:d,onToggle:function(){return u.setValue(o)}}),b.createElement(E.Provider,{value:p},i))})),x=c((function(e,t){var r=e.as,n=void 0===r?"h3":r,o=g(e,["as"]);return b.createElement(n,O({ref:t},o,M("header")))})),R=c((function(e,t){var n=Object.assign({},e),o=I("Accordion.Button").buttonNodesRef,i=C("Accordion.Button"),a=b.useRef(null),u=l(a,t);return b.useEffect((function(){var e=o.current,t=a.current;if(t)return e.add(t),function(){e.delete(t)}}),[o]),b.createElement(r.Button,O({},n,M("button"),{ref:u,"aria-disabled":i.isOpen||void 0,id:i.buttonId}))})),k=c((function(e,t){var n=C("Accordion.Panel");return b.createElement(r.Content,O({},e,M("panel"),{ref:t,role:"region","aria-labelledby":n.buttonId}))})),B=["Home","End","ArrowDown","ArrowUp"],H=c((function(e,t){var r=e.as,n=void 0===r?"div":r,o=e.value,a=e.defaultValue,u=e.children,c=e.disabled,s=e.onChange,f=void 0===s?function(){}:s,p=g(e,["as","value","defaultValue","children","disabled","onChange"]),y=b.useRef(new Set),v=b.useRef(null),A=l(v,t),w=h(d({prop:o,defaultProp:a,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return e&&f(e)}))}),2),j=w[0],I=w[1],S=i(e.onKeyDown,(function(e){var t,r=e.target;if(B.includes(e.key)&&r instanceof HTMLButtonElement){var n=m(y.current).filter((function(e){return!(e&&e.disabled)})),o=n.length,i=n.indexOf(r);if(-1!==i){e.preventDefault();var a=i;switch(e.key){case"Home":a=0;break;case"End":a=o-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":(a=i-1)<0&&(a=o-1)}null===(t=n[a%o])||void 0===t||t.focus()}}})),E=b.useMemo((function(){return{isDisabled:c,buttonNodesRef:y,value:j,setValue:I}}),[c,j,I]);return b.createElement(n,O({},p,M("root"),{ref:A,onKeyDown:c?void 0:S}),b.createElement(P.Provider,{value:E},u))}));exports.Accordion=H,H.Item=D,H.Header=x,H.Button=R,H.Panel=k,H.displayName="Accordion",H.Item.displayName="Accordion.Item",H.Header.displayName="Accordion.Header",H.Button.displayName="Accordion.Button",H.Panel.displayName="Accordion.Panel";var N=h(u("Accordion",{root:y({},f("div")),item:y(y({},f("div")),n.root),header:y({},f("h3")),button:y(y({},f("button")),n.button),panel:y(y({},f("div")),n.content)}),2),T=N[0],M=N[1];exports.styles=T;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{Collapsible as e,styles as t}from"@interop-ui/react-collapsible";import{composeEventHandlers as n,createContext as r,createStyleObj as o,forwardRef as c,useComposedRefs as i,useControlledState as a,useId as l}from"@interop-ui/react-utils";import{cssReset as u}from"@interop-ui/utils";import d from"react";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const[O,y]=r("AccordionContext","Accordion"),[v,g]=r("AccordionItemContext","Accordion.Item"),A=c((function(t,n){var r;const{value:o,isOpen:c,defaultIsOpen:i,children:a,onToggle:u}=t,s=m(t,["value","isOpen","defaultIsOpen","children","onToggle"]),f=y("Accordion.Item"),p="accordion-button-".concat(l()),O=t.id||p,g=o&&o===f.value||!1,A=d.useMemo((()=>({isOpen:g,buttonId:O})),[g,O]);return d.createElement(e,b({},s,k("item"),{ref:n,disabled:null!==(r=f.isDisabled)&&void 0!==r?r:t.disabled,isOpen:g,onToggle:()=>f.setValue(o)}),d.createElement(v.Provider,{value:A},a))})),h="h3",w=c((function(e,t){const{as:n=h}=e,r=m(e,["as"]);return d.createElement(n,b({ref:t},r,k("header")))})),j=c((function(t,n){const r=Object.assign({},t),{buttonNodesRef:o}=y("Accordion.Button"),c=g("Accordion.Button"),a=d.useRef(null),l=i(a,n);return d.useEffect((()=>{const e=o.current,t=a.current;if(t)return e.add(t),()=>{e.delete(t)}}),[o]),d.createElement(e.Button,b({},r,k("button"),{ref:l,"aria-disabled":c.isOpen||void 0,id:c.buttonId}))})),P=c((function(t,n){const r=g("Accordion.Panel");return d.createElement(e.Content,b({},t,k("panel"),{ref:n,role:"region","aria-labelledby":r.buttonId}))})),E="div",I=["Home","End","ArrowDown","ArrowUp"];export const Accordion=c((function(e,t){const{as:r=E,value:o,defaultValue:c,children:l,disabled:u,onChange:s=(()=>{})}=e,f=m(e,["as","value","defaultValue","children","disabled","onChange"]),p=d.useRef(new Set),y=d.useRef(null),v=i(y,t),[g,A]=a({prop:o,defaultProp:c,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((e=>e&&s(e)))}),h=n(e.onKeyDown,(e=>{var t;const n=e.target;if(!(I.includes(e.key)&&(r=n,r instanceof HTMLButtonElement)))return;var r;const o=[...p.current].filter((e=>!(e&&e.disabled))),c=o.length,i=o.indexOf(n);if(-1===i)return;e.preventDefault();let a=i;switch(e.key){case"Home":a=0;break;case"End":a=c-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":a=i-1,a<0&&(a=c-1)}null===(t=o[a%c])||void 0===t||t.focus()})),w=d.useMemo((()=>({isDisabled:u,buttonNodesRef:p,value:g,setValue:A})),[u,g,A]);return d.createElement(r,b({},f,k("root"),{ref:v,onKeyDown:u?void 0:h}),d.createElement(O.Provider,{value:w},l))}));Accordion.Item=A,Accordion.Header=w,Accordion.Button=j,Accordion.Panel=P,Accordion.displayName="Accordion",Accordion.Item.displayName="Accordion.Item",Accordion.Header.displayName="Accordion.Header",Accordion.Button.displayName="Accordion.Button",Accordion.Panel.displayName="Accordion.Panel";const[D,k]=o("Accordion",{root:f({},u(E)),item:f(f({},u("div")),t.root),header:f({},u(h)),button:f(f({},u("button")),t.button),panel:f(f({},u("div")),t.content)});export{D as styles};
import{Collapsible as e,styles as t}from"@interop-ui/react-collapsible";import{composeEventHandlers as n,createContext as r,createStyleObj as o,forwardRef as c,useComposedRefs as i,useControlledState as a,useId as l}from"@interop-ui/react-utils";import{cssReset as u}from"@interop-ui/utils";import d from"react";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const[O,y]=r("AccordionContext","Accordion"),[v,g]=r("AccordionItemContext","Accordion.Item"),A=c((function(t,n){var r;const{value:o,isOpen:c,defaultIsOpen:i,children:a,onToggle:u}=t,s=m(t,["value","isOpen","defaultIsOpen","children","onToggle"]),f=y("Accordion.Item"),p="accordion-button-".concat(l()),O=t.id||p,g=o&&o===f.value||!1,A=null!==(r=f.isDisabled)&&void 0!==r?r:t.disabled,h=d.useMemo((()=>({isOpen:g,buttonId:O})),[g,O]);return d.createElement(e,b({},s,k("item"),{ref:n,"data-state":g?"open":"closed","data-disabled":A||void 0,disabled:A,isOpen:g,onToggle:()=>f.setValue(o)}),d.createElement(v.Provider,{value:h},a))})),h="h3",w=c((function(e,t){const{as:n=h}=e,r=m(e,["as"]);return d.createElement(n,b({ref:t},r,k("header")))})),j=c((function(t,n){const r=Object.assign({},t),{buttonNodesRef:o}=y("Accordion.Button"),c=g("Accordion.Button"),a=d.useRef(null),l=i(a,n);return d.useEffect((()=>{const e=o.current,t=a.current;if(t)return e.add(t),()=>{e.delete(t)}}),[o]),d.createElement(e.Button,b({},r,k("button"),{ref:l,"aria-disabled":c.isOpen||void 0,id:c.buttonId}))})),P=c((function(t,n){const r=g("Accordion.Panel");return d.createElement(e.Content,b({},t,k("panel"),{ref:n,role:"region","aria-labelledby":r.buttonId}))})),E="div",I=["Home","End","ArrowDown","ArrowUp"];export const Accordion=c((function(e,t){const{as:r=E,value:o,defaultValue:c,children:l,disabled:u,onChange:s=(()=>{})}=e,f=m(e,["as","value","defaultValue","children","disabled","onChange"]),p=d.useRef(new Set),y=d.useRef(null),v=i(y,t),[g,A]=a({prop:o,defaultProp:c,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((e=>e&&s(e)))}),h=n(e.onKeyDown,(e=>{var t;const n=e.target;if(!(I.includes(e.key)&&(r=n,r instanceof HTMLButtonElement)))return;var r;const o=[...p.current].filter((e=>!(e&&e.disabled))),c=o.length,i=o.indexOf(n);if(-1===i)return;e.preventDefault();let a=i;switch(e.key){case"Home":a=0;break;case"End":a=c-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":a=i-1,a<0&&(a=c-1)}null===(t=o[a%c])||void 0===t||t.focus()})),w=d.useMemo((()=>({isDisabled:u,buttonNodesRef:p,value:g,setValue:A})),[u,g,A]);return d.createElement(r,b({},f,k("root"),{ref:v,onKeyDown:u?void 0:h}),d.createElement(O.Provider,{value:w},l))}));Accordion.Item=A,Accordion.Header=w,Accordion.Button=j,Accordion.Panel=P,Accordion.displayName="Accordion",Accordion.Item.displayName="Accordion.Item",Accordion.Header.displayName="Accordion.Header",Accordion.Button.displayName="Accordion.Button",Accordion.Panel.displayName="Accordion.Panel";const[D,k]=o("Accordion",{root:f({},u(E)),item:f(f({},u("div")),t.root),header:f({},u(h)),button:f(f({},u("button")),t.button),panel:f(f({},u("div")),t.content)});export{D as styles};
//# sourceMappingURL=index.module.js.map
{
"name": "@interop-ui/react-accordion",
"version": "0.0.1-10",
"version": "0.0.1-11",
"license": "MIT",

@@ -21,4 +21,4 @@ "source": "src/index.ts",

"dependencies": {
"@interop-ui/react-collapsible": "0.0.1-9",
"@interop-ui/react-utils": "0.0.1-9",
"@interop-ui/react-collapsible": "0.0.1-10",
"@interop-ui/react-utils": "0.0.1-10",
"@interop-ui/utils": "0.0.1-3"

@@ -25,0 +25,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc