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

@radix-ui/react-accordion

Package Overview
Dependencies
Maintainers
8
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.2-rc.2 to 0.1.2-rc.3

2

dist/index.js

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

var e,r,o=require("@radix-ui/react-id").useId,t=require("@radix-ui/react-collapsible"),n=(e={},r=t,Object.keys(r).forEach((function(o){"default"!==o&&"__esModule"!==o&&Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[o]}})})),e),c=t.createCollapsibleScope,i=require("@radix-ui/react-primitive").Primitive,a=require("@radix-ui/react-use-controllable-state").useControllableState,l=require("@radix-ui/primitive").composeEventHandlers,s=require("@radix-ui/react-compose-refs").useComposedRefs,d=require("@radix-ui/react-context").createContextScope,u=f(require("react")),p=f(require("@babel/runtime/helpers/extends"));function f(e){return e&&e.__esModule?e.default:e}const g=["Home","End","ArrowDown","ArrowUp"],[m,A]=d("Accordion",[c]);exports.createAccordionScope=A;const b=c(),v=/*#__PURE__*/u.forwardRef(((e,r)=>{const{type:o,...t}=e;if("single"===o){const e=t;/*#__PURE__*/return u.createElement(_,p({},e,{ref:r}))}if("multiple"===o){const e=t;/*#__PURE__*/return u.createElement(h,p({},e,{ref:r}))}throw new Error("Missing prop `type` expected on `Accordion`")}));exports.Accordion=v,v.propTypes={type(e){const r=e.value||e.defaultValue;return"multiple"===e.type&&"string"==typeof r?new Error("Invalid prop `type` of value `multiple` supplied to `Accordion`. Expects `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(r)?new Error("Invalid prop `type` of value `single` supplied to `Accordion`. Expects `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[x,w]=m("Accordion"),[E,y]=m("Accordion",{collapsible:!1}),_=/*#__PURE__*/u.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),collapsible:c=!1,...i}=e,[l,s]=a({prop:o,defaultProp:t,onChange:n});/*#__PURE__*/return u.createElement(x,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:s,onItemClose:u.useCallback((()=>c&&s("")),[c,s])},/*#__PURE__*/u.createElement(E,{scope:e.__scopeAccordion,collapsible:c},/*#__PURE__*/u.createElement(R,p({},i,{ref:r}))))})),h=/*#__PURE__*/u.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),...c}=e,[i=[],l]=a({prop:o,defaultProp:t,onChange:n}),s=u.useCallback((e=>l(((r=[])=>[...r,e]))),[l]),d=u.useCallback((e=>l(((r=[])=>r.filter((r=>r!==e))))),[l]);/*#__PURE__*/return u.createElement(x,{scope:e.__scopeAccordion,value:i,onItemOpen:s,onItemClose:d},/*#__PURE__*/u.createElement(E,{scope:e.__scopeAccordion,collapsible:!0},/*#__PURE__*/u.createElement(R,p({},c,{ref:r}))))})),[C,I]=m("Accordion"),R=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,disabled:t,...n}=e,c=u.useRef(new Set),a=u.useRef(null),d=s(a,r),f=l(e.onKeyDown,(e=>{var r;const o=e.target;if(!(g.includes(e.key)&&(t=o,t instanceof HTMLButtonElement)))return;var t;const n=[...c.current].filter((e=>!(null!=e&&e.disabled))),i=n.length,a=n.indexOf(o);if(-1===a)return;e.preventDefault();let l=a;switch(e.key){case"Home":l=0;break;case"End":l=i-1;break;case"ArrowDown":l=a+1;break;case"ArrowUp":l=a-1,l<0&&(l=i-1)}null===(r=n[l%i])||void 0===r||r.focus()}));/*#__PURE__*/return u.createElement(C,{scope:o,triggerNodesRef:c,disabled:t},/*#__PURE__*/u.createElement(i.div,p({},n,{ref:d,onKeyDown:t?void 0:f})))})),[k,q]=m("AccordionItem"),T=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:t,value:c,...i}=e,a=I("AccordionItem",t),l=w("AccordionItem",t),s=b(t),d=o(),f=c&&l.value.includes(c)||!1,g=a.disabled||e.disabled;/*#__PURE__*/return u.createElement(k,{scope:t,open:f,disabled:g,triggerId:d},/*#__PURE__*/u.createElement(n.Root,p({"data-state":f?"open":"closed"},s,i,{ref:r,disabled:g,open:f,onOpenChange:e=>{e?l.onItemOpen(c):l.onItemClose(c)}})))}));exports.AccordionItem=T;const H=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,n=q("AccordionHeader",o);/*#__PURE__*/return u.createElement(i.h3,p({"data-state":(c=n.open,c?"open":"closed"),"data-disabled":n.disabled?"":void 0},t,{ref:r}));var c}));exports.AccordionHeader=H;const O=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,{triggerNodesRef:c}=I("AccordionTrigger",o),i=q("AccordionTrigger",o),a=y("AccordionTrigger",o),l=b(o),d=u.useRef(null),f=s(d,r);return u.useEffect((()=>{const e=c.current,r=d.current;if(r)return e.add(r),()=>{e.delete(r)}}),[c]),/*#__PURE__*/u.createElement(n.Trigger,p({"aria-disabled":i.open&&!a.collapsible||void 0,id:i.triggerId},l,t,{ref:f}))}));exports.AccordionTrigger=O;const V=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,c=q("AccordionContent",o),i=b(o);/*#__PURE__*/return u.createElement(n.Content,p({role:"region","aria-labelledby":c.triggerId},i,t,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))}));exports.AccordionContent=V;const D=v;exports.Root=D;const S=T;exports.Item=S;const M=H;exports.Header=M;const P=O;exports.Trigger=P;const j=V;exports.Content=j;
var e,r,o=require("@radix-ui/react-id").useId,t=require("@radix-ui/react-collapsible"),n=(e={},r=t,Object.keys(r).forEach((function(o){"default"!==o&&"__esModule"!==o&&Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[o]}})})),e),c=t.createCollapsibleScope,i=require("@radix-ui/react-primitive").Primitive,a=require("@radix-ui/react-use-controllable-state").useControllableState,l=require("@radix-ui/primitive").composeEventHandlers,d=require("@radix-ui/react-compose-refs").useComposedRefs,s=require("@radix-ui/react-collection").createCollection,p=require("@radix-ui/react-context").createContextScope,u=m(require("react")),f=m(require("@babel/runtime/helpers/extends"));function m(e){return e&&e.__esModule?e.default:e}const A=["Home","End","ArrowDown","ArrowUp"],[b,g,v]=s("Accordion"),[x,E]=p("Accordion",[v,c]);exports.createAccordionScope=E;const w=c(),y=/*#__PURE__*/u.forwardRef(((e,r)=>{const{type:o,...t}=e,n=t,c=t;/*#__PURE__*/return u.createElement(b.Provider,{scope:e.__scopeAccordion},"multiple"===o?/*#__PURE__*/u.createElement(q,f({},c,{ref:r})):/*#__PURE__*/u.createElement(R,f({},n,{ref:r})))}));exports.Accordion=y,y.propTypes={type(e){const r=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof r?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(r)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[_,C]=x("Accordion"),[I,h]=x("Accordion",{collapsible:!1}),R=/*#__PURE__*/u.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),collapsible:c=!1,...i}=e,[l,d]=a({prop:o,defaultProp:t,onChange:n});/*#__PURE__*/return u.createElement(_,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:d,onItemClose:u.useCallback((()=>c&&d("")),[c,d])},/*#__PURE__*/u.createElement(I,{scope:e.__scopeAccordion,collapsible:c},/*#__PURE__*/u.createElement(H,f({},i,{ref:r}))))})),q=/*#__PURE__*/u.forwardRef(((e,r)=>{const{value:o,defaultValue:t,onValueChange:n=(()=>{}),...c}=e,[i=[],l]=a({prop:o,defaultProp:t,onChange:n}),d=u.useCallback((e=>l(((r=[])=>[...r,e]))),[l]),s=u.useCallback((e=>l(((r=[])=>r.filter((r=>r!==e))))),[l]);/*#__PURE__*/return u.createElement(_,{scope:e.__scopeAccordion,value:i,onItemOpen:d,onItemClose:s},/*#__PURE__*/u.createElement(I,{scope:e.__scopeAccordion,collapsible:!0},/*#__PURE__*/u.createElement(H,f({},c,{ref:r}))))})),[k,V]=x("Accordion"),H=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,disabled:t,...n}=e,c=u.useRef(null),a=d(c,r),s=g(o),p=l(e.onKeyDown,(e=>{var r;if(!A.includes(e.key))return;const o=e.target,t=s().filter((e=>{var r;return!(null!==(r=e.ref.current)&&void 0!==r&&r.disabled)})),n=t.findIndex((e=>e.ref.current===o)),c=t.length;if(-1===n)return;e.preventDefault();let i=n;switch(e.key){case"Home":i=0;break;case"End":i=c-1;break;case"ArrowDown":i=n+1;break;case"ArrowUp":i=n-1,i<0&&(i=c-1)}null===(r=t[i%c].ref.current)||void 0===r||r.focus()}));/*#__PURE__*/return u.createElement(k,{scope:o,disabled:t},/*#__PURE__*/u.createElement(b.Slot,{scope:o},/*#__PURE__*/u.createElement(i.div,f({},n,{ref:a,onKeyDown:t?void 0:p}))))})),[O,S]=x("AccordionItem"),T=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:t,value:c,...i}=e,a=V("AccordionItem",t),l=C("AccordionItem",t),d=w(t),s=o(),p=c&&l.value.includes(c)||!1,m=a.disabled||e.disabled;/*#__PURE__*/return u.createElement(O,{scope:t,open:p,disabled:m,triggerId:s},/*#__PURE__*/u.createElement(n.Root,f({"data-state":p?"open":"closed"},d,i,{ref:r,disabled:m,open:p,onOpenChange:e=>{e?l.onItemOpen(c):l.onItemClose(c)}})))}));exports.AccordionItem=T;const D=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,n=S("AccordionHeader",o);/*#__PURE__*/return u.createElement(i.h3,f({"data-state":(c=n.open,c?"open":"closed"),"data-disabled":n.disabled?"":void 0},t,{ref:r}));var c}));exports.AccordionHeader=D;const P=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,c=S("AccordionTrigger",o),i=h("AccordionTrigger",o),a=w(o);/*#__PURE__*/return u.createElement(b.ItemSlot,{scope:o},/*#__PURE__*/u.createElement(n.Trigger,f({"aria-disabled":c.open&&!i.collapsible||void 0,id:c.triggerId},a,t,{ref:r})))}));exports.AccordionTrigger=P;const j=/*#__PURE__*/u.forwardRef(((e,r)=>{const{__scopeAccordion:o,...t}=e,c=S("AccordionContent",o),i=w(o);/*#__PURE__*/return u.createElement(n.Content,f({role:"region","aria-labelledby":c.triggerId},i,t,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))}));exports.AccordionContent=j;const K=y;exports.Root=K;const M=T;exports.Item=M;const U=D;exports.Header=U;const z=P;exports.Trigger=z;const B=j;exports.Content=B;
//# sourceMappingURL=index.js.map

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

import{useId as e}from"@radix-ui/react-id";import*as o from"@radix-ui/react-collapsible";import{createCollapsibleScope as r}from"@radix-ui/react-collapsible";import{Primitive as t}from"@radix-ui/react-primitive";import{useControllableState as n}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as c}from"@radix-ui/primitive";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{createContextScope as a}from"@radix-ui/react-context";import l from"react";import d from"@babel/runtime/helpers/esm/extends";const s=["Home","End","ArrowDown","ArrowUp"],[p,u]=a("Accordion",[r]);export{u as createAccordionScope};const f=r();export const Accordion=/*#__PURE__*/l.forwardRef(((e,o)=>{const{type:r,...t}=e;if("single"===r){const e=t;/*#__PURE__*/return l.createElement(x,d({},e,{ref:o}))}if("multiple"===r){const e=t;/*#__PURE__*/return l.createElement(v,d({},e,{ref:o}))}throw new Error("Missing prop `type` expected on `Accordion`")}));/*#__PURE__*/Accordion.propTypes={type(e){const o=e.value||e.defaultValue;return"multiple"===e.type&&"string"==typeof o?new Error("Invalid prop `type` of value `multiple` supplied to `Accordion`. Expects `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(o)?new Error("Invalid prop `type` of value `single` supplied to `Accordion`. Expects `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[m,g]=p("Accordion"),[A,b]=p("Accordion",{collapsible:!1}),x=/*#__PURE__*/l.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:c=(()=>{}),collapsible:i=!1,...a}=e,[s,p]=n({prop:r,defaultProp:t,onChange:c});/*#__PURE__*/return l.createElement(m,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:p,onItemClose:l.useCallback((()=>i&&p("")),[i,p])},/*#__PURE__*/l.createElement(A,{scope:e.__scopeAccordion,collapsible:i},/*#__PURE__*/l.createElement(y,d({},a,{ref:o}))))})),v=/*#__PURE__*/l.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:c=(()=>{}),...i}=e,[a=[],s]=n({prop:r,defaultProp:t,onChange:c}),p=l.useCallback((e=>s(((o=[])=>[...o,e]))),[s]),u=l.useCallback((e=>s(((o=[])=>o.filter((o=>o!==e))))),[s]);/*#__PURE__*/return l.createElement(m,{scope:e.__scopeAccordion,value:a,onItemOpen:p,onItemClose:u},/*#__PURE__*/l.createElement(A,{scope:e.__scopeAccordion,collapsible:!0},/*#__PURE__*/l.createElement(y,d({},i,{ref:o}))))})),[w,E]=p("Accordion"),y=/*#__PURE__*/l.forwardRef(((e,o)=>{const{__scopeAccordion:r,disabled:n,...a}=e,p=l.useRef(new Set),u=l.useRef(null),f=i(u,o),m=c(e.onKeyDown,(e=>{var o;const r=e.target;if(!(s.includes(e.key)&&(t=r,t instanceof HTMLButtonElement)))return;var t;const n=[...p.current].filter((e=>!(null!=e&&e.disabled))),c=n.length,i=n.indexOf(r);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===(o=n[a%c])||void 0===o||o.focus()}));/*#__PURE__*/return l.createElement(w,{scope:r,triggerNodesRef:p,disabled:n},/*#__PURE__*/l.createElement(t.div,d({},a,{ref:f,onKeyDown:n?void 0:m})))})),[h,_]=p("AccordionItem");export const AccordionItem=/*#__PURE__*/l.forwardRef(((r,t)=>{const{__scopeAccordion:n,value:c,...i}=r,a=E("AccordionItem",n),s=g("AccordionItem",n),p=f(n),u=e(),m=c&&s.value.includes(c)||!1,A=a.disabled||r.disabled;/*#__PURE__*/return l.createElement(h,{scope:n,open:m,disabled:A,triggerId:u},/*#__PURE__*/l.createElement(o.Root,d({"data-state":m?"open":"closed"},p,i,{ref:t,disabled:A,open:m,onOpenChange:e=>{e?s.onItemOpen(c):s.onItemClose(c)}})))}));/*#__PURE__*/export const AccordionHeader=/*#__PURE__*/l.forwardRef(((e,o)=>{const{__scopeAccordion:r,...n}=e,c=_("AccordionHeader",r);/*#__PURE__*/return l.createElement(t.h3,d({"data-state":(i=c.open,i?"open":"closed"),"data-disabled":c.disabled?"":void 0},n,{ref:o}));var i}));/*#__PURE__*/export const AccordionTrigger=/*#__PURE__*/l.forwardRef(((e,r)=>{const{__scopeAccordion:t,...n}=e,{triggerNodesRef:c}=E("AccordionTrigger",t),a=_("AccordionTrigger",t),s=b("AccordionTrigger",t),p=f(t),u=l.useRef(null),m=i(u,r);return l.useEffect((()=>{const e=c.current,o=u.current;if(o)return e.add(o),()=>{e.delete(o)}}),[c]),/*#__PURE__*/l.createElement(o.Trigger,d({"aria-disabled":a.open&&!s.collapsible||void 0,id:a.triggerId},p,n,{ref:m}))}));/*#__PURE__*/export const AccordionContent=/*#__PURE__*/l.forwardRef(((e,r)=>{const{__scopeAccordion:t,...n}=e,c=_("AccordionContent",t),i=f(t);/*#__PURE__*/return l.createElement(o.Content,d({role:"region","aria-labelledby":c.triggerId},i,n,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))}));/*#__PURE__*/export const Root=Accordion;export const Item=AccordionItem;export const Header=AccordionHeader;export const Trigger=AccordionTrigger;export const Content=AccordionContent;
import{useId as e}from"@radix-ui/react-id";import*as o from"@radix-ui/react-collapsible";import{createCollapsibleScope as r}from"@radix-ui/react-collapsible";import{Primitive as t}from"@radix-ui/react-primitive";import{useControllableState as c}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as n}from"@radix-ui/primitive";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{createCollection as a}from"@radix-ui/react-collection";import{createContextScope as l}from"@radix-ui/react-context";import d from"react";import p from"@babel/runtime/helpers/esm/extends";const s=["Home","End","ArrowDown","ArrowUp"],[u,m,f]=a("Accordion"),[A,g]=l("Accordion",[f,r]);export{g as createAccordionScope};const b=r();export const Accordion=/*#__PURE__*/d.forwardRef(((e,o)=>{const{type:r,...t}=e,c=t,n=t;/*#__PURE__*/return d.createElement(u.Provider,{scope:e.__scopeAccordion},"multiple"===r?/*#__PURE__*/d.createElement(I,p({},n,{ref:o})):/*#__PURE__*/d.createElement(y,p({},c,{ref:o})))}));/*#__PURE__*/Accordion.propTypes={type(e){const o=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof o?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(o)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[x,v]=A("Accordion"),[E,w]=A("Accordion",{collapsible:!1}),y=/*#__PURE__*/d.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),collapsible:i=!1,...a}=e,[l,s]=c({prop:r,defaultProp:t,onChange:n});/*#__PURE__*/return d.createElement(x,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:s,onItemClose:d.useCallback((()=>i&&s("")),[i,s])},/*#__PURE__*/d.createElement(E,{scope:e.__scopeAccordion,collapsible:i},/*#__PURE__*/d.createElement(C,p({},a,{ref:o}))))})),I=/*#__PURE__*/d.forwardRef(((e,o)=>{const{value:r,defaultValue:t,onValueChange:n=(()=>{}),...i}=e,[a=[],l]=c({prop:r,defaultProp:t,onChange:n}),s=d.useCallback((e=>l(((o=[])=>[...o,e]))),[l]),u=d.useCallback((e=>l(((o=[])=>o.filter((o=>o!==e))))),[l]);/*#__PURE__*/return d.createElement(x,{scope:e.__scopeAccordion,value:a,onItemOpen:s,onItemClose:u},/*#__PURE__*/d.createElement(E,{scope:e.__scopeAccordion,collapsible:!0},/*#__PURE__*/d.createElement(C,p({},i,{ref:o}))))})),[_,h]=A("Accordion"),C=/*#__PURE__*/d.forwardRef(((e,o)=>{const{__scopeAccordion:r,disabled:c,...a}=e,l=d.useRef(null),f=i(l,o),A=m(r),g=n(e.onKeyDown,(e=>{var o;if(!s.includes(e.key))return;const r=e.target,t=A().filter((e=>{var o;return!(null!==(o=e.ref.current)&&void 0!==o&&o.disabled)})),c=t.findIndex((e=>e.ref.current===r)),n=t.length;if(-1===c)return;e.preventDefault();let i=c;switch(e.key){case"Home":i=0;break;case"End":i=n-1;break;case"ArrowDown":i=c+1;break;case"ArrowUp":i=c-1,i<0&&(i=n-1)}null===(o=t[i%n].ref.current)||void 0===o||o.focus()}));/*#__PURE__*/return d.createElement(_,{scope:r,disabled:c},/*#__PURE__*/d.createElement(u.Slot,{scope:r},/*#__PURE__*/d.createElement(t.div,p({},a,{ref:f,onKeyDown:c?void 0:g}))))})),[R,k]=A("AccordionItem");export const AccordionItem=/*#__PURE__*/d.forwardRef(((r,t)=>{const{__scopeAccordion:c,value:n,...i}=r,a=h("AccordionItem",c),l=v("AccordionItem",c),s=b(c),u=e(),m=n&&l.value.includes(n)||!1,f=a.disabled||r.disabled;/*#__PURE__*/return d.createElement(R,{scope:c,open:m,disabled:f,triggerId:u},/*#__PURE__*/d.createElement(o.Root,p({"data-state":m?"open":"closed"},s,i,{ref:t,disabled:f,open:m,onOpenChange:e=>{e?l.onItemOpen(n):l.onItemClose(n)}})))}));/*#__PURE__*/export const AccordionHeader=/*#__PURE__*/d.forwardRef(((e,o)=>{const{__scopeAccordion:r,...c}=e,n=k("AccordionHeader",r);/*#__PURE__*/return d.createElement(t.h3,p({"data-state":(i=n.open,i?"open":"closed"),"data-disabled":n.disabled?"":void 0},c,{ref:o}));var i}));/*#__PURE__*/export const AccordionTrigger=/*#__PURE__*/d.forwardRef(((e,r)=>{const{__scopeAccordion:t,...c}=e,n=k("AccordionTrigger",t),i=w("AccordionTrigger",t),a=b(t);/*#__PURE__*/return d.createElement(u.ItemSlot,{scope:t},/*#__PURE__*/d.createElement(o.Trigger,p({"aria-disabled":n.open&&!i.collapsible||void 0,id:n.triggerId},a,c,{ref:r})))}));/*#__PURE__*/export const AccordionContent=/*#__PURE__*/d.forwardRef(((e,r)=>{const{__scopeAccordion:t,...c}=e,n=k("AccordionContent",t),i=b(t);/*#__PURE__*/return d.createElement(o.Content,p({role:"region","aria-labelledby":n.triggerId},i,c,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))}));/*#__PURE__*/export const Root=Accordion;export const Item=AccordionItem;export const Header=AccordionHeader;export const Trigger=AccordionTrigger;export const Content=AccordionContent;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-accordion",
"version": "0.1.2-rc.2",
"version": "0.1.2-rc.3",
"license": "MIT",

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

"@radix-ui/primitive": "0.1.0",
"@radix-ui/react-collapsible": "0.1.2-rc.1",
"@radix-ui/react-collapsible": "0.1.2-rc.2",
"@radix-ui/react-compose-refs": "0.1.0",

@@ -24,0 +24,0 @@ "@radix-ui/react-context": "0.1.1",

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