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

@radix-ui/react-collapsible

Package Overview
Dependencies
Maintainers
8
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.15 to 0.0.16

10

dist/index.d.ts

@@ -11,6 +11,6 @@ import { Primitive } from "@radix-ui/react-primitive";

export const Collapsible: CollapsiblePrimitive;
declare const BUTTON_DEFAULT_TAG = "button";
type CollapsibleButtonOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type CollapsibleButtonPrimitive = Polymorphic.ForwardRefComponent<typeof BUTTON_DEFAULT_TAG, CollapsibleButtonOwnProps>;
export const CollapsibleButton: CollapsibleButtonPrimitive;
declare const TRIGGER_DEFAULT_TAG = "button";
type CollapsibleTriggerOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type CollapsibleTriggerPrimitive = Polymorphic.ForwardRefComponent<typeof TRIGGER_DEFAULT_TAG, CollapsibleTriggerOwnProps>;
export const CollapsibleTrigger: CollapsibleTriggerPrimitive;
type CollapsibleContentOwnProps = Polymorphic.Merge<Omit<Polymorphic.OwnProps<typeof CollapsibleContentImpl>, 'present'>, {

@@ -31,5 +31,5 @@ /**

export const Root: CollapsiblePrimitive;
export const Button: CollapsibleButtonPrimitive;
export const Trigger: CollapsibleTriggerPrimitive;
export const Content: CollapsibleContentPrimitive;
//# sourceMappingURL=index.d.ts.map

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

var e,t,n,r=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-presence").Presence,a=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-compose-refs").useComposedRefs,s=require("@radix-ui/react-use-layout-effect").useLayoutEffect,l=require("@radix-ui/react-use-controllable-state").useControllableState,d=require("@radix-ui/react-context").createContext,c=require("@radix-ui/primitive").composeEventHandlers,u=(e={},t=require("react"),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e),p=(n=require("@babel/runtime/helpers/extends"))&&n.__esModule?n.default:n;const[f,b]=d("Collapsible"),x=/*#__PURE__*/u.forwardRef(((e,t)=>{const{open:n,defaultOpen:o,disabled:i,onOpenChange:s,...d}=e,[c=!1,b]=l({prop:n,defaultProp:o,onChange:s});/*#__PURE__*/return u.createElement(f,{disabled:i,contentId:r(),open:c,onOpenToggle:u.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/u.createElement(a,p({"data-state":h(c),"data-disabled":i?"":void 0},d,{ref:t})))}));exports.Collapsible=x;const C="button",m=/*#__PURE__*/u.forwardRef(((e,t)=>{const{as:n=C,onClick:r,...o}=e,i=b("CollapsibleButton");/*#__PURE__*/return u.createElement(a,p({"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":h(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},o,{as:n,ref:t,onClick:c(r,i.onOpenToggle)}))}));exports.CollapsibleButton=m;const y=/*#__PURE__*/u.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=b("CollapsibleContent");/*#__PURE__*/return u.createElement(o,{present:n||a.open},(({present:e})=>/*#__PURE__*/u.createElement(g,p({},r,{ref:t,present:e}))))}));exports.CollapsibleContent=y;const g=/*#__PURE__*/u.forwardRef(((e,t)=>{const{present:n,children:r,...o}=e,l=b("CollapsibleContent"),[d,c]=u.useState(n),f=u.useRef(null),x=i(t,f),C=u.useRef(0),m=C.current,y=l.open||d;return s((()=>{const e=f.current;if(e){const t=e.style.transition,r=e.style.animation;e.style.transition="none",e.style.animation="none";const o=e.getBoundingClientRect();C.current=o.height,e.style.transition=t,e.style.animation=r,c(n)}}),[l.open,n]),/*#__PURE__*/u.createElement(a,p({"data-state":h(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y},o,{ref:x,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,...e.style}}),y&&r)}));function h(e){return e?"open":"closed"}const q=x;exports.Root=q;const v=m;exports.Button=v;const E=y;exports.Content=E;
var e,t,r,n=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-presence").Presence,a=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-compose-refs").useComposedRefs,s=require("@radix-ui/react-use-layout-effect").useLayoutEffect,l=require("@radix-ui/react-use-controllable-state").useControllableState,d=require("@radix-ui/react-context").createContext,c=require("@radix-ui/primitive").composeEventHandlers,u=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),p=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const[f,b]=d("Collapsible"),x=/*#__PURE__*/u.forwardRef(((e,t)=>{const{open:r,defaultOpen:o,disabled:i,onOpenChange:s,...d}=e,[c=!1,b]=l({prop:r,defaultProp:o,onChange:s});/*#__PURE__*/return u.createElement(f,{disabled:i,contentId:n(),open:c,onOpenToggle:u.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/u.createElement(a,p({"data-state":h(c),"data-disabled":i?"":void 0},d,{ref:t})))}));exports.Collapsible=x;const C="button",g=/*#__PURE__*/u.forwardRef(((e,t)=>{const{as:r=C,onClick:n,...o}=e,i=b("CollapsibleTrigger");/*#__PURE__*/return u.createElement(a,p({"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":h(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},o,{as:r,ref:t,onClick:c(n,i.onOpenToggle)}))}));exports.CollapsibleTrigger=g;const m=/*#__PURE__*/u.forwardRef(((e,t)=>{const{forceMount:r,...n}=e,a=b("CollapsibleContent");/*#__PURE__*/return u.createElement(o,{present:r||a.open},(({present:e})=>/*#__PURE__*/u.createElement(y,p({},n,{ref:t,present:e}))))}));exports.CollapsibleContent=m;const y=/*#__PURE__*/u.forwardRef(((e,t)=>{const{present:r,children:n,...o}=e,l=b("CollapsibleContent"),[d,c]=u.useState(r),f=u.useRef(null),x=i(t,f),C=u.useRef(0),g=C.current,m=l.open||d;return s((()=>{const e=f.current;if(e){const t=e.style.transition,n=e.style.animation;e.style.transition="none",e.style.animation="none";const o=e.getBoundingClientRect();C.current=o.height,e.style.transition=t,e.style.animation=n,c(r)}}),[l.open,r]),/*#__PURE__*/u.createElement(a,p({"data-state":h(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m},o,{ref:x,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,...e.style}}),m&&n)}));function h(e){return e?"open":"closed"}const q=x;exports.Root=q;const v=g;exports.Trigger=v;const E=m;exports.Content=E;
//# sourceMappingURL=index.js.map

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

import{useId as e}from"@radix-ui/react-id";import{Presence as t}from"@radix-ui/react-presence";import{Primitive as o}from"@radix-ui/react-primitive";import{useComposedRefs as n}from"@radix-ui/react-compose-refs";import{useLayoutEffect as r}from"@radix-ui/react-use-layout-effect";import{useControllableState as a}from"@radix-ui/react-use-controllable-state";import{createContext as i}from"@radix-ui/react-context";import{composeEventHandlers as l}from"@radix-ui/primitive";import*as s from"react";import d from"@babel/runtime/helpers/esm/extends";const[p,c]=i("Collapsible");export const Collapsible=/*#__PURE__*/s.forwardRef(((t,n)=>{const{open:r,defaultOpen:i,disabled:l,onOpenChange:c,...u}=t,[m=!1,b]=a({prop:r,defaultProp:i,onChange:c});/*#__PURE__*/return s.createElement(p,{disabled:l,contentId:e(),open:m,onOpenToggle:s.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/s.createElement(o,d({"data-state":f(m),"data-disabled":l?"":void 0},u,{ref:n})))}));/*#__PURE__*/const u="button";export const CollapsibleButton=/*#__PURE__*/s.forwardRef(((e,t)=>{const{as:n=u,onClick:r,...a}=e,i=c("CollapsibleButton");/*#__PURE__*/return s.createElement(o,d({"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":f(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},a,{as:n,ref:t,onClick:l(r,i.onOpenToggle)}))}));/*#__PURE__*/export const CollapsibleContent=/*#__PURE__*/s.forwardRef(((e,o)=>{const{forceMount:n,...r}=e,a=c("CollapsibleContent");/*#__PURE__*/return s.createElement(t,{present:n||a.open},(({present:e})=>/*#__PURE__*/s.createElement(m,d({},r,{ref:o,present:e}))))}));/*#__PURE__*/const m=/*#__PURE__*/s.forwardRef(((e,t)=>{const{present:a,children:i,...l}=e,p=c("CollapsibleContent"),[u,m]=s.useState(a),b=s.useRef(null),C=n(t,b),x=s.useRef(0),g=x.current,h=p.open||u;return r((()=>{const e=b.current;if(e){const t=e.style.transition,o=e.style.animation;e.style.transition="none",e.style.animation="none";const n=e.getBoundingClientRect();x.current=n.height,e.style.transition=t,e.style.animation=o,m(a)}}),[p.open,a]),/*#__PURE__*/s.createElement(o,d({"data-state":f(p.open),"data-disabled":p.disabled?"":void 0,id:p.contentId,hidden:!h},l,{ref:C,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,...e.style}}),h&&i)}));function f(e){return e?"open":"closed"}export const Root=Collapsible;export const Button=CollapsibleButton;export const Content=CollapsibleContent;
import{useId as e}from"@radix-ui/react-id";import{Presence as t}from"@radix-ui/react-presence";import{Primitive as o}from"@radix-ui/react-primitive";import{useComposedRefs as n}from"@radix-ui/react-compose-refs";import{useLayoutEffect as r}from"@radix-ui/react-use-layout-effect";import{useControllableState as a}from"@radix-ui/react-use-controllable-state";import{createContext as i}from"@radix-ui/react-context";import{composeEventHandlers as l}from"@radix-ui/primitive";import*as s from"react";import d from"@babel/runtime/helpers/esm/extends";const[p,c]=i("Collapsible");export const Collapsible=/*#__PURE__*/s.forwardRef(((t,n)=>{const{open:r,defaultOpen:i,disabled:l,onOpenChange:c,...m}=t,[f=!1,b]=a({prop:r,defaultProp:i,onChange:c});/*#__PURE__*/return s.createElement(p,{disabled:l,contentId:e(),open:f,onOpenToggle:s.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/s.createElement(o,d({"data-state":u(f),"data-disabled":l?"":void 0},m,{ref:n})))}));/*#__PURE__*/const m="button";export const CollapsibleTrigger=/*#__PURE__*/s.forwardRef(((e,t)=>{const{as:n=m,onClick:r,...a}=e,i=c("CollapsibleTrigger");/*#__PURE__*/return s.createElement(o,d({"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":u(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},a,{as:n,ref:t,onClick:l(r,i.onOpenToggle)}))}));/*#__PURE__*/export const CollapsibleContent=/*#__PURE__*/s.forwardRef(((e,o)=>{const{forceMount:n,...r}=e,a=c("CollapsibleContent");/*#__PURE__*/return s.createElement(t,{present:n||a.open},(({present:e})=>/*#__PURE__*/s.createElement(f,d({},r,{ref:o,present:e}))))}));/*#__PURE__*/const f=/*#__PURE__*/s.forwardRef(((e,t)=>{const{present:a,children:i,...l}=e,p=c("CollapsibleContent"),[m,f]=s.useState(a),b=s.useRef(null),C=n(t,b),x=s.useRef(0),g=x.current,h=p.open||m;return r((()=>{const e=b.current;if(e){const t=e.style.transition,o=e.style.animation;e.style.transition="none",e.style.animation="none";const n=e.getBoundingClientRect();x.current=n.height,e.style.transition=t,e.style.animation=o,f(a)}}),[p.open,a]),/*#__PURE__*/s.createElement(o,d({"data-state":u(p.open),"data-disabled":p.disabled?"":void 0,id:p.contentId,hidden:!h},l,{ref:C,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,...e.style}}),h&&i)}));function u(e){return e?"open":"closed"}export const Root=Collapsible;export const Trigger=CollapsibleTrigger;export const Content=CollapsibleContent;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-collapsible",
"version": "0.0.15",
"version": "0.0.16",
"license": "MIT",

@@ -25,5 +25,5 @@ "source": "src/index.ts",

"@radix-ui/react-id": "0.0.6",
"@radix-ui/react-polymorphic": "0.0.11",
"@radix-ui/react-polymorphic": "0.0.12",
"@radix-ui/react-presence": "0.0.14",
"@radix-ui/react-primitive": "0.0.13",
"@radix-ui/react-primitive": "0.0.14",
"@radix-ui/react-use-controllable-state": "0.0.6",

@@ -30,0 +30,0 @@ "@radix-ui/react-use-layout-effect": "0.0.5"

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