@interop-ui/react-collapsible
Advanced tools
Comparing version 0.0.1-13 to 0.0.1-14
@@ -10,3 +10,6 @@ type CollapsibleOwnProps = { | ||
export const CollapsibleContent: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>; | ||
export const Root: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", CollapsibleOwnProps>; | ||
export const Button: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"button", {}>; | ||
export const Content: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
var e,t,r=require("@interop-ui/react-polymorphic").forwardRefWithAs,n=require("@interop-ui/utils").getPartDataAttrObj,o=require("@interop-ui/react-utils"),i=o.createContext,l=o.useId,a=o.composeEventHandlers,u=o.useControlledState,s=(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);function c(){return(c=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 p(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 d(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 l,a=e[Symbol.iterator]();!(n=(l=a.next()).done)&&(r.push(l.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(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 f(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 b=d(i("CollapsibleContext","Collapsible"),2),y=b[0],v=b[1],C=r((function(e,t){var r=e.as,o=void 0===r?"div":r,i=(e.id,e.children),l=e.isOpen,a=e.defaultIsOpen,f=e.disabled,b=e.onToggle,v=p(e,["as","id","children","isOpen","defaultIsOpen","disabled","onToggle"]),C=d(u({prop:l,defaultProp:a,onChange:b}),2),O=C[0],m=C[1],h=d(s.useState(),2),j=h[0],I=h[1],S=s.useMemo((function(){return{contentId:j,isOpen:O,isDisabled:f,toggle:function(){return m((function(e){return!e}))},setContentId:I}}),[j,f,O,m]);return s.createElement(o,c({},n("Collapsible"),v,{"data-state":g(S.isOpen),ref:t}),s.createElement(y.Provider,{value:S},i))}));exports.Collapsible=C,C.displayName="Collapsible";var O=r((function(e,t){var r=e.as,o=void 0===r?"button":r,i=e.onClick,l=p(e,["as","onClick"]),u=v("CollapsibleButton");return s.createElement(o,c({},n("CollapsibleButton"),{ref:t,"aria-controls":u.contentId,"aria-expanded":u.isOpen||!1,"data-state":g(u.isOpen)},l,{onClick:a(i,u.toggle),disabled:u.isDisabled}))}));exports.CollapsibleButton=O,O.displayName="CollapsibleButton";var m=r((function(e,t){var r=e.as,o=void 0===r?"div":r,i=e.id,a=e.children,u=p(e,["as","id","children"]),d=v("CollapsibleContent"),f=d.setContentId,b=d.isOpen,y="collapsible-".concat(l()),C=i||y;return s.useEffect((function(){f(C)}),[C,f]),s.createElement(o,c({},n("CollapsibleContent"),{ref:t},u,{id:C,hidden:!b}),b&&a)}));function g(e){return e?"open":"closed"}exports.CollapsibleContent=m,m.displayName="CollapsibleContent"; | ||
var e,t,r=require("@interop-ui/react-presence").Presence,n=require("@interop-ui/react-polymorphic").forwardRefWithAs,o=require("@interop-ui/utils").getPartDataAttrObj,i=require("@interop-ui/react-utils"),a=i.createContext,l=i.useId,u=i.composeEventHandlers,s=i.useControlledState,c=(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);function p(){return(p=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 d(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 f(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,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(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 b(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 v=f(a("CollapsibleContext","Collapsible"),2),y=v[0],C=v[1],m=n((function(e,t){var r=e.as,n=void 0===r?"div":r,i=(e.id,e.children),a=e.isOpen,l=e.defaultIsOpen,u=e.disabled,b=e.onToggle,v=d(e,["as","id","children","isOpen","defaultIsOpen","disabled","onToggle"]),C=f(s({prop:a,defaultProp:l,onChange:b}),2),m=C[0],O=void 0!==m&&m,g=C[1],j=f(c.useState(),2),x=j[0],I=j[1],E=c.useMemo((function(){return{contentId:x,isOpen:O,isDisabled:u,toggle:function(){return g((function(e){return!e}))},setContentId:I}}),[x,u,O,g]);return c.createElement(n,p({},o("Collapsible"),v,{"data-state":h(E.isOpen),ref:t}),c.createElement(y.Provider,{value:E},i))}));exports.Collapsible=m,m.displayName="Collapsible";var O=n((function(e,t){var r=e.as,n=void 0===r?"button":r,i=e.onClick,a=d(e,["as","onClick"]),l=C("CollapsibleButton");return c.createElement(n,p({},o("CollapsibleButton"),{ref:t,"aria-controls":l.contentId,"aria-expanded":l.isOpen||!1,"data-state":h(l.isOpen)},a,{onClick:u(i,l.toggle),disabled:l.isDisabled}))}));exports.CollapsibleButton=O,O.displayName="CollapsibleButton";var g=n((function(e,t){var n=e.as,i=void 0===n?"div":n,a=e.id,u=e.children,s=d(e,["as","id","children"]),f=C("CollapsibleContent"),b=f.setContentId,v=f.isOpen,y="collapsible-".concat(l()),m=a||y;return c.useEffect((function(){b(m)}),[m,b]),c.createElement(r,{present:v},(function(e){var r=e.present;return c.createElement(i,p({},s,o("CollapsibleContent"),{ref:t,id:m,hidden:!r,"data-state":h(v)}),r&&u)}))}));function h(e){return e?"open":"closed"}exports.CollapsibleContent=g,g.displayName="CollapsibleContent";var j=m;exports.Root=j;var x=O;exports.Button=x;var I=g;exports.Content=I; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{forwardRefWithAs as e}from"@interop-ui/react-polymorphic";import{getPartDataAttrObj as t}from"@interop-ui/utils";import{createContext as n,useId as l,composeEventHandlers as o,useControlledState as i}from"@interop-ui/react-utils";import*as r from"react";function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(this,arguments)}function s(e,t){if(null==e)return{};var n,l,o=function(e,t){if(null==e)return{};var n,l,o={},i=Object.keys(e);for(l=0;l<i.length;l++)n=i[l],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(l=0;l<i.length;l++)n=i[l],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const p="div",[c,d]=n("CollapsibleContext","Collapsible");export const Collapsible=e(((e,n)=>{const{as:l=p,id:o,children:d,isOpen:u,defaultIsOpen:b,disabled:f,onToggle:m}=e,O=s(e,["as","id","children","isOpen","defaultIsOpen","disabled","onToggle"]),[g,y]=i({prop:u,defaultProp:b,onChange:m}),[h,v]=r.useState(),x=r.useMemo((()=>({contentId:h,isOpen:g,isDisabled:f,toggle:()=>y((e=>!e)),setContentId:v})),[h,f,g,y]);return r.createElement(l,a({},t("Collapsible"),O,{"data-state":C(x.isOpen),ref:n}),r.createElement(c.Provider,{value:x},d))}));Collapsible.displayName="Collapsible";const u="button";export const CollapsibleButton=e(((e,n)=>{const{as:l=u,onClick:i}=e,p=s(e,["as","onClick"]),c=d("CollapsibleButton");return r.createElement(l,a({},t("CollapsibleButton"),{ref:n,"aria-controls":c.contentId,"aria-expanded":c.isOpen||!1,"data-state":C(c.isOpen)},p,{onClick:o(i,c.toggle),disabled:c.isDisabled}))}));CollapsibleButton.displayName="CollapsibleButton";const b="div";export const CollapsibleContent=e(((e,n)=>{const{as:o=b,id:i,children:p}=e,c=s(e,["as","id","children"]),{setContentId:u,isOpen:C}=d("CollapsibleContent"),f="collapsible-".concat(l()),m=i||f;return r.useEffect((()=>{u(m)}),[m,u]),r.createElement(o,a({},t("CollapsibleContent"),{ref:n},c,{id:m,hidden:!C}),C&&p)}));function C(e){return e?"open":"closed"}CollapsibleContent.displayName="CollapsibleContent"; | ||
import{Presence as e}from"@interop-ui/react-presence";import{forwardRefWithAs as t}from"@interop-ui/react-polymorphic";import{getPartDataAttrObj as o}from"@interop-ui/utils";import{createContext as n,useId as l,composeEventHandlers as r,useControlledState as i}from"@interop-ui/react-utils";import*as s from"react";function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function p(e,t){if(null==e)return{};var o,n,l=function(e,t){if(null==e)return{};var o,n,l={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(l[o]=e[o]);return l}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(l[o]=e[o])}return l}const c="div",[d,u]=n("CollapsibleContext","Collapsible");export const Collapsible=t(((e,t)=>{const{as:n=c,id:l,children:r,isOpen:u,defaultIsOpen:b,disabled:C,onToggle:m}=e,O=p(e,["as","id","children","isOpen","defaultIsOpen","disabled","onToggle"]),[g=!1,y]=i({prop:u,defaultProp:b,onChange:m}),[h,v]=s.useState(),x=s.useMemo((()=>({contentId:h,isOpen:g,isDisabled:C,toggle:()=>y((e=>!e)),setContentId:v})),[h,C,g,y]);return s.createElement(n,a({},o("Collapsible"),O,{"data-state":f(x.isOpen),ref:t}),s.createElement(d.Provider,{value:x},r))}));Collapsible.displayName="Collapsible";const b="button";export const CollapsibleButton=t(((e,t)=>{const{as:n=b,onClick:l}=e,i=p(e,["as","onClick"]),c=u("CollapsibleButton");return s.createElement(n,a({},o("CollapsibleButton"),{ref:t,"aria-controls":c.contentId,"aria-expanded":c.isOpen||!1,"data-state":f(c.isOpen)},i,{onClick:r(l,c.toggle),disabled:c.isDisabled}))}));CollapsibleButton.displayName="CollapsibleButton";const C="div";export const CollapsibleContent=t(((t,n)=>{const{as:r=C,id:i,children:c}=t,d=p(t,["as","id","children"]),{setContentId:b,isOpen:m}=u("CollapsibleContent"),O="collapsible-".concat(l()),g=i||O;return s.useEffect((()=>{b(g)}),[g,b]),s.createElement(e,{present:m},(({present:e})=>s.createElement(r,a({},d,o("CollapsibleContent"),{ref:n,id:g,hidden:!e,"data-state":f(m)}),e&&c)))}));function f(e){return e?"open":"closed"}CollapsibleContent.displayName="CollapsibleContent";export const Root=Collapsible;export const Button=CollapsibleButton;export const Content=CollapsibleContent; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-collapsible", | ||
"version": "0.0.1-13", | ||
"version": "0.0.1-14", | ||
"license": "MIT", | ||
@@ -20,5 +20,6 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-polymorphic": "0.0.1-0", | ||
"@interop-ui/react-utils": "0.0.1-13", | ||
"@interop-ui/utils": "0.0.1-5" | ||
"@interop-ui/react-polymorphic": "0.0.1-1", | ||
"@interop-ui/react-presence": "0.0.1-0", | ||
"@interop-ui/react-utils": "0.0.1-14", | ||
"@interop-ui/utils": "0.0.1-6" | ||
}, | ||
@@ -25,0 +26,0 @@ "devDependencies": { |
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
25801
40
5
+ Added@interop-ui/react-polymorphic@0.0.1-1(transitive)
+ Added@interop-ui/react-presence@0.0.1-0(transitive)
+ Added@interop-ui/react-utils@0.0.1-14(transitive)
+ Added@interop-ui/utils@0.0.1-6(transitive)
+ Added@xstate/fsm@1.6.5(transitive)
- Removed@interop-ui/react-polymorphic@0.0.1-0(transitive)
- Removed@interop-ui/react-utils@0.0.1-13(transitive)
- Removed@interop-ui/utils@0.0.1-5(transitive)
Updated@interop-ui/utils@0.0.1-6