@radix-ui/react-collapsible
Advanced tools
Comparing version 0.1.1-rc.10 to 0.1.1-rc.11
@@ -1,2 +0,2 @@ | ||
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.div,p({"data-state":y(c),"data-disabled":i?"":void 0},d,{ref:t})))}));exports.Collapsible=x;const C=/*#__PURE__*/u.forwardRef(((e,t)=>{const r=b("CollapsibleTrigger");/*#__PURE__*/return u.createElement(a.button,p({"aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":y(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled},e,{ref:t,onClick:c(e.onClick,r.onOpenToggle)}))}));exports.CollapsibleTrigger=C;const g=/*#__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(m,p({},n,{ref:t,present:e}))))}));exports.CollapsibleContent=g;const m=/*#__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.div,p({"data-state":y(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 y(e){return e?"open":"closed"}const v=x;exports.Root=v;const h=C;exports.Trigger=h;const q=g;exports.Content=q; | ||
var e,t,r,n=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-presence").Presence,i=require("@radix-ui/react-primitive").Primitive,a=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:a,onOpenChange:s,...d}=e,[c=!1,b]=l({prop:r,defaultProp:o,onChange:s});/*#__PURE__*/return u.createElement(f,{disabled:a,contentId:n(),open:c,onOpenToggle:u.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/u.createElement(i.div,p({"data-state":h(c),"data-disabled":a?"":void 0},d,{ref:t})))}));exports.Collapsible=x;const C=/*#__PURE__*/u.forwardRef(((e,t)=>{const r=b("CollapsibleTrigger");/*#__PURE__*/return u.createElement(i.button,p({"aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":h(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled},e,{ref:t,onClick:c(e.onClick,r.onOpenToggle)}))}));exports.CollapsibleTrigger=C;const g=/*#__PURE__*/u.forwardRef(((e,t)=>{const{forceMount:r,...n}=e,i=b("CollapsibleContent");/*#__PURE__*/return u.createElement(o,{present:r||i.open},(({present:e})=>/*#__PURE__*/u.createElement(m,p({},n,{ref:t,present:e}))))}));exports.CollapsibleContent=g;const m=/*#__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=a(t,f),C=u.useRef(0),g=C.current,m=u.useRef(0),v=m.current,y=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,m.current=o.width,e.style.transition=t,e.style.animation=n,c(r)}}),[l.open,r]),/*#__PURE__*/u.createElement(i.div,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":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&n)}));function h(e){return e?"open":"closed"}const v=x;exports.Root=v;const y=C;exports.Trigger=y;const q=g;exports.Content=q; | ||
//# 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 r}from"@radix-ui/react-compose-refs";import{useLayoutEffect as n}from"@radix-ui/react-use-layout-effect";import{useControllableState as i}from"@radix-ui/react-use-controllable-state";import{createContext as a}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]=a("Collapsible");export const Collapsible=/*#__PURE__*/s.forwardRef(((t,r)=>{const{open:n,defaultOpen:a,disabled:l,onOpenChange:c,...m}=t,[u=!1,b]=i({prop:n,defaultProp:a,onChange:c});/*#__PURE__*/return s.createElement(p,{disabled:l,contentId:e(),open:u,onOpenToggle:s.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/s.createElement(o.div,d({"data-state":f(u),"data-disabled":l?"":void 0},m,{ref:r})))}));/*#__PURE__*/export const CollapsibleTrigger=/*#__PURE__*/s.forwardRef(((e,t)=>{const r=c("CollapsibleTrigger");/*#__PURE__*/return s.createElement(o.button,d({"aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":f(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled},e,{ref:t,onClick:l(e.onClick,r.onOpenToggle)}))}));/*#__PURE__*/export const CollapsibleContent=/*#__PURE__*/s.forwardRef(((e,o)=>{const{forceMount:r,...n}=e,i=c("CollapsibleContent");/*#__PURE__*/return s.createElement(t,{present:r||i.open},(({present:e})=>/*#__PURE__*/s.createElement(m,d({},n,{ref:o,present:e}))))}));/*#__PURE__*/const m=/*#__PURE__*/s.forwardRef(((e,t)=>{const{present:i,children:a,...l}=e,p=c("CollapsibleContent"),[m,u]=s.useState(i),b=s.useRef(null),C=r(t,b),x=s.useRef(0),g=x.current,h=p.open||m;return n((()=>{const e=b.current;if(e){const t=e.style.transition,o=e.style.animation;e.style.transition="none",e.style.animation="none";const r=e.getBoundingClientRect();x.current=r.height,e.style.transition=t,e.style.animation=o,u(i)}}),[p.open,i]),/*#__PURE__*/s.createElement(o.div,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&&a)}));function f(e){return e?"open":"closed"}export const Root=Collapsible;export const Trigger=CollapsibleTrigger;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 r}from"@radix-ui/react-compose-refs";import{useLayoutEffect as n}from"@radix-ui/react-use-layout-effect";import{useControllableState as i}from"@radix-ui/react-use-controllable-state";import{createContext as a}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]=a("Collapsible");export const Collapsible=/*#__PURE__*/s.forwardRef(((t,r)=>{const{open:n,defaultOpen:a,disabled:l,onOpenChange:c,...m}=t,[f=!1,b]=i({prop:n,defaultProp:a,onChange:c});/*#__PURE__*/return s.createElement(p,{disabled:l,contentId:e(),open:f,onOpenToggle:s.useCallback((()=>b((e=>!e))),[b])},/*#__PURE__*/s.createElement(o.div,d({"data-state":u(f),"data-disabled":l?"":void 0},m,{ref:r})))}));/*#__PURE__*/export const CollapsibleTrigger=/*#__PURE__*/s.forwardRef(((e,t)=>{const r=c("CollapsibleTrigger");/*#__PURE__*/return s.createElement(o.button,d({"aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":u(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled},e,{ref:t,onClick:l(e.onClick,r.onOpenToggle)}))}));/*#__PURE__*/export const CollapsibleContent=/*#__PURE__*/s.forwardRef(((e,o)=>{const{forceMount:r,...n}=e,i=c("CollapsibleContent");/*#__PURE__*/return s.createElement(t,{present:r||i.open},(({present:e})=>/*#__PURE__*/s.createElement(m,d({},n,{ref:o,present:e}))))}));/*#__PURE__*/const m=/*#__PURE__*/s.forwardRef(((e,t)=>{const{present:i,children:a,...l}=e,p=c("CollapsibleContent"),[m,f]=s.useState(i),b=s.useRef(null),x=r(t,b),C=s.useRef(0),g=C.current,h=s.useRef(0),v=h.current,y=p.open||m;return n((()=>{const e=b.current;if(e){const t=e.style.transition,o=e.style.animation;e.style.transition="none",e.style.animation="none";const r=e.getBoundingClientRect();C.current=r.height,h.current=r.width,e.style.transition=t,e.style.animation=o,f(i)}}),[p.open,i]),/*#__PURE__*/s.createElement(o.div,d({"data-state":u(p.open),"data-disabled":p.disabled?"":void 0,id:p.contentId,hidden:!y},l,{ref:x,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&a)}));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.1.1-rc.10", | ||
"version": "0.1.1-rc.11", | ||
"license": "MIT", | ||
@@ -24,4 +24,4 @@ "source": "src/index.ts", | ||
"@radix-ui/react-id": "0.1.0", | ||
"@radix-ui/react-presence": "0.1.1-rc.7", | ||
"@radix-ui/react-primitive": "0.1.1-rc.10", | ||
"@radix-ui/react-presence": "0.1.1-rc.8", | ||
"@radix-ui/react-primitive": "0.1.1-rc.11", | ||
"@radix-ui/react-use-controllable-state": "0.1.0", | ||
@@ -28,0 +28,0 @@ "@radix-ui/react-use-layout-effect": "0.1.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
32338
+ Added@radix-ui/react-presence@0.1.1-rc.8(transitive)
+ Added@radix-ui/react-primitive@0.1.1-rc.11(transitive)
+ Added@radix-ui/react-slot@0.1.1-rc.7(transitive)
- Removed@radix-ui/react-presence@0.1.1-rc.7(transitive)
- Removed@radix-ui/react-primitive@0.1.1-rc.10(transitive)
- Removed@radix-ui/react-slot@0.1.1-rc.6(transitive)