@radix-ui/react-collapsible
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -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,{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,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; | ||
//# 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,{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,...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; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-collapsible", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"license": "MIT", | ||
@@ -26,4 +26,4 @@ "source": "src/index.ts", | ||
"@radix-ui/react-polymorphic": "0.0.11", | ||
"@radix-ui/react-presence": "0.0.13", | ||
"@radix-ui/react-primitive": "0.0.12", | ||
"@radix-ui/react-presence": "0.0.14", | ||
"@radix-ui/react-primitive": "0.0.13", | ||
"@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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32555
+ Added@radix-ui/react-presence@0.0.14(transitive)
+ Added@radix-ui/react-primitive@0.0.13(transitive)
- Removed@radix-ui/react-presence@0.0.13(transitive)
- Removed@radix-ui/react-primitive@0.0.12(transitive)