@interop-ui/react-accordion
Advanced tools
Comparing version 0.0.1-14 to 0.0.1-15
type AccordionItemOwnProps = { | ||
/** | ||
* Whether or not an accordion item is disabled from user interaction. | ||
* | ||
* @defaultValue false | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* A string value for the accordion item. All items within an accordion should use a unique value. | ||
*/ | ||
value: string; | ||
}; | ||
/** | ||
* `AccordionItem` contains all of the parts of a collapsible section inside of an `Accordion`. | ||
*/ | ||
export const AccordionItem: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", import("@interop-ui/react-polymorphic").MergeProps<import("@interop-ui/react-collapsible").CollapsibleOwnProps, AccordionItemOwnProps>>; | ||
type AccordionHeaderOwnProps = {}; | ||
/** | ||
* `AccordionHeader` contains the content for the parts of an `AccordionItem` that will be visible | ||
* whether or not its content is collapsed. | ||
*/ | ||
export const AccordionHeader: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"h3", AccordionHeaderOwnProps>; | ||
/** | ||
* `AccordionButton` is the trigger that toggles the collapsed state of an `AccordionItem`. It | ||
* should always be nested inside of an `AccordionHeader`. | ||
*/ | ||
export const AccordionButton: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"button", Pick<{}, never>>; | ||
/** | ||
* `AccordionPanel` contains the collapsible content for an `AccordionItem`. | ||
*/ | ||
export const AccordionPanel: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", Pick<{}, never>>; | ||
type AccordionOwnProps = { | ||
/** | ||
* The controlled stateful value of the accordion item whose panel is expanded. | ||
*/ | ||
value?: string; | ||
/** | ||
* The value of the item whose panel is expanded when the accordion is initially rendered. Use | ||
* `defaultValue` if you do not need to control the state of an accordion. | ||
*/ | ||
defaultValue?: string; | ||
/** | ||
* Whether or not an accordion is disabled from user interaction. | ||
* | ||
* @defaultValue false | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* The callback that fires when the state of the accordion changes. | ||
* | ||
* @param value | ||
*/ | ||
onChange?(value: string): void; | ||
}; | ||
/** | ||
* `Accordion` is the root component. | ||
*/ | ||
export const Accordion: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", AccordionOwnProps>; | ||
export const Root: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", AccordionOwnProps>; | ||
export const Item: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", import("@interop-ui/react-polymorphic").MergeProps<import("@interop-ui/react-collapsible").CollapsibleOwnProps, AccordionItemOwnProps>>; | ||
export const Header: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"h3", AccordionHeaderOwnProps>; | ||
export const Button: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"button", Pick<{}, never>>; | ||
export const Panel: import("@interop-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", Pick<{}, never>>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
var e,r=require("@interop-ui/react-collapsible"),t=r.Collapsible,n=r.CollapsibleButton,o=r.CollapsibleContent,i=require("@interop-ui/react-polymorphic").forwardRefWithAs,a=require("@interop-ui/react-utils"),u=a.composeEventHandlers,c=a.createContext,l=a.useComposedRefs,d=a.useControlledState,s=a.useId,f=require("@interop-ui/utils").getPartDataAttrObj,p=(e=require("react"))&&e.__esModule?e.default:e;function b(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(){return(v=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function y(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return t}(e,r)||A(e,r)||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 A(e,r){if(e){if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,r):void 0}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var g=m(c("AccordionContext","Accordion"),2),O=g[0],w=g[1],I=m(c("AccordionItemContext","AccordionItem"),2),E=I[0],S=I[1],j=i((function(e,r){var n,o=e.value,i=(e.isOpen,e.defaultIsOpen,e.children),a=(e.onToggle,y(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=w("AccordionItem"),c="accordion-button-".concat(s()),l=e.id||c,d=o&&o===u.value||!1,b=null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,m=p.useMemo((function(){return{isOpen:d,buttonId:l}}),[d,l]);return p.createElement(t,v({},a,f("AccordionItem"),{ref:r,"data-state":d?"open":"closed","data-disabled":b||void 0,disabled:b,isOpen:d,onToggle:function(){return u.setValue(o)}}),p.createElement(E.Provider,{value:m},i))}));exports.AccordionItem=j,j.displayName="AccordionItem";var C=i((function(e,r){var t=e.as,n=void 0===t?"h3":t,o=y(e,["as"]);return p.createElement(n,v({ref:r},o,f("AccordionHeader")))}));exports.AccordionHeader=C,C.displayName="AccordionHeader";var x=i((function(e,r){var t=Object.assign({},e),o=w("AccordionButton").buttonNodesRef,i=S("AccordionButton"),a=p.useRef(null),u=l(a,r);return p.useEffect((function(){var e=o.current,r=a.current;if(r)return e.add(r),function(){e.delete(r)}}),[o]),p.createElement(n,v({},t,f("AccordionButton"),{ref:u,"aria-disabled":i.isOpen||void 0,id:i.buttonId}))}));exports.AccordionButton=x,x.displayName="AccordionButton";var P=i((function(e,r){var t=S("AccordionPanel");return p.createElement(o,v({},e,f("AccordionPanel"),{ref:r,role:"region","aria-labelledby":t.buttonId}))}));exports.AccordionPanel=P,P.displayName="AccordionPanel";var D=["Home","End","ArrowDown","ArrowUp"],B=i((function(e,r){var t=e.as,n=void 0===t?"div":t,o=e.value,i=e.defaultValue,a=e.children,c=e.disabled,s=e.onChange,A=void 0===s?function(){}:s,h=y(e,["as","value","defaultValue","children","disabled","onChange"]),g=p.useRef(new Set),w=p.useRef(null),I=l(w,r),E=m(d({prop:o,defaultProp:i,onChange:function(e){function r(r){return e.apply(this,arguments)}return r.toString=function(){return e.toString()},r}((function(e){return e&&A(e)}))}),2),S=E[0],j=E[1],C=u(e.onKeyDown,(function(e){var r,t=e.target;if(D.includes(e.key)&&t instanceof HTMLButtonElement){var n=b(g.current).filter((function(e){return!(e&&e.disabled)})),o=n.length,i=n.indexOf(t);if(-1!==i){e.preventDefault();var a=i;switch(e.key){case"Home":a=0;break;case"End":a=o-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":(a=i-1)<0&&(a=o-1)}null===(r=n[a%o])||void 0===r||r.focus()}}})),x=p.useMemo((function(){return{isDisabled:c,buttonNodesRef:g,value:S,setValue:j}}),[c,S,j]);return p.createElement(n,v({},h,f("Accordion"),{ref:I,onKeyDown:c?void 0:C}),p.createElement(O.Provider,{value:x},a))}));exports.Accordion=B,B.displayName="Accordion"; | ||
var e,r=require("@interop-ui/react-collapsible"),t=r.Collapsible,n=r.CollapsibleButton,o=r.CollapsibleContent,a=require("@interop-ui/react-polymorphic").forwardRefWithAs,i=require("@interop-ui/react-utils"),u=i.composeEventHandlers,c=i.createContext,l=i.useComposedRefs,d=i.useControlledState,s=i.useId,f=require("@interop-ui/utils").getPartDataAttrObj,p=(e=require("react"))&&e.__esModule?e.default:e;function v(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(){return(b=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function y(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||A(e,r)||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 A(e,r){if(e){if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,r):void 0}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var g=m(c("AccordionContext","Accordion"),2),O=g[0],w=g[1],I=m(c("AccordionItemContext","AccordionItem"),2),x=I[0],E=I[1],S=a((function(e,r){var n,o=e.value,a=(e.isOpen,e.defaultIsOpen,e.children),i=(e.onToggle,y(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=w("AccordionItem"),c="accordion-button-".concat(s()),l=e.id||c,d=o&&o===u.value||!1,v=null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,m=p.useMemo((function(){return{isOpen:d,buttonId:l}}),[d,l]);return p.createElement(t,b({},i,f("AccordionItem"),{ref:r,"data-state":d?"open":"closed","data-disabled":v||void 0,disabled:v,isOpen:d,onToggle:function(){return u.setValue(o)}}),p.createElement(x.Provider,{value:m},a))}));exports.AccordionItem=S,S.displayName="AccordionItem";var j=a((function(e,r){var t=e.as,n=void 0===t?"h3":t,o=y(e,["as"]);return p.createElement(n,b({ref:r},o,f("AccordionHeader")))}));exports.AccordionHeader=j,j.displayName="AccordionHeader";var C=a((function(e,r){var t=Object.assign({},e),o=w("AccordionButton").buttonNodesRef,a=E("AccordionButton"),i=p.useRef(null),u=l(i,r);return p.useEffect((function(){var e=o.current,r=i.current;if(r)return e.add(r),function(){e.delete(r)}}),[o]),p.createElement(n,b({},t,f("AccordionButton"),{ref:u,"aria-disabled":a.isOpen||void 0,id:a.buttonId}))}));exports.AccordionButton=C,C.displayName="AccordionButton";var P=a((function(e,r){var t=E("AccordionPanel");return p.createElement(o,b({},e,f("AccordionPanel"),{ref:r,role:"region","aria-labelledby":t.buttonId}))}));exports.AccordionPanel=P,P.displayName="AccordionPanel";var B=["Home","End","ArrowDown","ArrowUp"],D=a((function(e,r){var t=e.as,n=void 0===t?"div":t,o=e.value,a=e.defaultValue,i=e.children,c=e.disabled,s=e.onChange,A=void 0===s?function(){}:s,h=y(e,["as","value","defaultValue","children","disabled","onChange"]),g=p.useRef(new Set),w=p.useRef(null),I=l(w,r),x=m(d({prop:o,defaultProp:a,onChange:function(e){function r(r){return e.apply(this,arguments)}return r.toString=function(){return e.toString()},r}((function(e){return e&&A(e)}))}),2),E=x[0],S=x[1],j=u(e.onKeyDown,(function(e){var r,t=e.target;if(B.includes(e.key)&&t instanceof HTMLButtonElement){var n=v(g.current).filter((function(e){return!(e&&e.disabled)})),o=n.length,a=n.indexOf(t);if(-1!==a){e.preventDefault();var i=a;switch(e.key){case"Home":i=0;break;case"End":i=o-1;break;case"ArrowDown":i=a+1;break;case"ArrowUp":(i=a-1)<0&&(i=o-1)}null===(r=n[i%o])||void 0===r||r.focus()}}})),C=p.useMemo((function(){return{isDisabled:c,buttonNodesRef:g,value:E,setValue:S}}),[c,E,S]);return p.createElement(n,b({},h,f("Accordion"),{ref:I,onKeyDown:c?void 0:j}),p.createElement(O.Provider,{value:C},i))}));exports.Accordion=D,D.displayName="Accordion";var H=D;exports.Root=H;var R=S;exports.Item=R;var N=j;exports.Header=N;var k=C;exports.Button=k;var T=P;exports.Panel=T; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{Collapsible as e,CollapsibleButton as o,CollapsibleContent as n}from"@interop-ui/react-collapsible";import{forwardRefWithAs as t}from"@interop-ui/react-polymorphic";import{composeEventHandlers as r,createContext as c,useComposedRefs as i,useControlledState as a,useId as l}from"@interop-ui/react-utils";import{getPartDataAttrObj as d}from"@interop-ui/utils";import u from"react";function s(){return(s=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}function p(e,o){if(null==e)return{};var n,t,r=function(e,o){if(null==e)return{};var n,t,r={},c=Object.keys(e);for(t=0;t<c.length;t++)n=c[t],o.indexOf(n)>=0||(r[n]=e[n]);return r}(e,o);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(t=0;t<c.length;t++)n=c[t],o.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const[f,m]=c("AccordionContext","Accordion"),[A,b]=c("AccordionItemContext","AccordionItem");export const AccordionItem=t(((o,n)=>{var t;const{value:r,isOpen:c,defaultIsOpen:i,children:a,onToggle:f}=o,b=p(o,["value","isOpen","defaultIsOpen","children","onToggle"]),v=m("AccordionItem"),y="accordion-button-".concat(l()),g=o.id||y,O=r&&r===v.value||!1,h=null!==(t=v.isDisabled)&&void 0!==t?t:o.disabled,w=u.useMemo((()=>({isOpen:O,buttonId:g})),[O,g]);return u.createElement(e,s({},b,d("AccordionItem"),{ref:n,"data-state":O?"open":"closed","data-disabled":h||void 0,disabled:h,isOpen:O,onToggle:()=>v.setValue(r)}),u.createElement(A.Provider,{value:w},a))}));AccordionItem.displayName="AccordionItem";const v="h3";export const AccordionHeader=t(((e,o)=>{const{as:n=v}=e,t=p(e,["as"]);return u.createElement(n,s({ref:o},t,d("AccordionHeader")))}));AccordionHeader.displayName="AccordionHeader";export const AccordionButton=t(((e,n)=>{const t=Object.assign({},e),{buttonNodesRef:r}=m("AccordionButton"),c=b("AccordionButton"),a=u.useRef(null),l=i(a,n);return u.useEffect((()=>{const e=r.current,o=a.current;if(o)return e.add(o),()=>{e.delete(o)}}),[r]),u.createElement(o,s({},t,d("AccordionButton"),{ref:l,"aria-disabled":c.isOpen||void 0,id:c.buttonId}))}));AccordionButton.displayName="AccordionButton";export const AccordionPanel=t(((e,o)=>{const t=b("AccordionPanel");return u.createElement(n,s({},e,d("AccordionPanel"),{ref:o,role:"region","aria-labelledby":t.buttonId}))}));AccordionPanel.displayName="AccordionPanel";const y="div",g=["Home","End","ArrowDown","ArrowUp"];export const Accordion=t(((e,o)=>{const{as:n=y,value:t,defaultValue:c,children:l,disabled:m,onChange:A=(()=>{})}=e,b=p(e,["as","value","defaultValue","children","disabled","onChange"]),v=u.useRef(new Set),O=u.useRef(null),h=i(O,o),[w,I]=a({prop:t,defaultProp:c,onChange:function(e){function o(o){return e.apply(this,arguments)}return o.toString=function(){return e.toString()},o}((e=>e&&A(e)))}),E=r(e.onKeyDown,(e=>{var o;const n=e.target;if(!(g.includes(e.key)&&(t=n,t instanceof HTMLButtonElement)))return;var t;const r=[...v.current].filter((e=>!(e&&e.disabled))),c=r.length,i=r.indexOf(n);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=r[a%c])||void 0===o||o.focus()})),P=u.useMemo((()=>({isDisabled:m,buttonNodesRef:v,value:w,setValue:I})),[m,w,I]);return u.createElement(n,s({},b,d("Accordion"),{ref:h,onKeyDown:m?void 0:E}),u.createElement(f.Provider,{value:P},l))}));Accordion.displayName="Accordion"; | ||
import{Collapsible as e,CollapsibleButton as o,CollapsibleContent as n}from"@interop-ui/react-collapsible";import{forwardRefWithAs as t}from"@interop-ui/react-polymorphic";import{composeEventHandlers as r,createContext as c,useComposedRefs as i,useControlledState as a,useId as d}from"@interop-ui/react-utils";import{getPartDataAttrObj as l}from"@interop-ui/utils";import s from"react";function u(){return(u=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}function p(e,o){if(null==e)return{};var n,t,r=function(e,o){if(null==e)return{};var n,t,r={},c=Object.keys(e);for(t=0;t<c.length;t++)n=c[t],o.indexOf(n)>=0||(r[n]=e[n]);return r}(e,o);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(t=0;t<c.length;t++)n=c[t],o.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const[f,m]=c("AccordionContext","Accordion"),[A,b]=c("AccordionItemContext","AccordionItem");export const AccordionItem=t(((o,n)=>{var t;const{value:r,isOpen:c,defaultIsOpen:i,children:a,onToggle:f}=o,b=p(o,["value","isOpen","defaultIsOpen","children","onToggle"]),v=m("AccordionItem"),y="accordion-button-".concat(d()),g=o.id||y,O=r&&r===v.value||!1,h=null!==(t=v.isDisabled)&&void 0!==t?t:o.disabled,x=s.useMemo((()=>({isOpen:O,buttonId:g})),[O,g]);return s.createElement(e,u({},b,l("AccordionItem"),{ref:n,"data-state":O?"open":"closed","data-disabled":h||void 0,disabled:h,isOpen:O,onToggle:()=>v.setValue(r)}),s.createElement(A.Provider,{value:x},a))}));AccordionItem.displayName="AccordionItem";const v="h3";export const AccordionHeader=t(((e,o)=>{const{as:n=v}=e,t=p(e,["as"]);return s.createElement(n,u({ref:o},t,l("AccordionHeader")))}));AccordionHeader.displayName="AccordionHeader";export const AccordionButton=t(((e,n)=>{const t=Object.assign({},e),{buttonNodesRef:r}=m("AccordionButton"),c=b("AccordionButton"),a=s.useRef(null),d=i(a,n);return s.useEffect((()=>{const e=r.current,o=a.current;if(o)return e.add(o),()=>{e.delete(o)}}),[r]),s.createElement(o,u({},t,l("AccordionButton"),{ref:d,"aria-disabled":c.isOpen||void 0,id:c.buttonId}))}));AccordionButton.displayName="AccordionButton";export const AccordionPanel=t(((e,o)=>{const t=b("AccordionPanel");return s.createElement(n,u({},e,l("AccordionPanel"),{ref:o,role:"region","aria-labelledby":t.buttonId}))}));AccordionPanel.displayName="AccordionPanel";const y="div",g=["Home","End","ArrowDown","ArrowUp"];export const Accordion=t(((e,o)=>{const{as:n=y,value:t,defaultValue:c,children:d,disabled:m,onChange:A=(()=>{})}=e,b=p(e,["as","value","defaultValue","children","disabled","onChange"]),v=s.useRef(new Set),O=s.useRef(null),h=i(O,o),[x,I]=a({prop:t,defaultProp:c,onChange:function(e){function o(o){return e.apply(this,arguments)}return o.toString=function(){return e.toString()},o}((e=>e&&A(e)))}),w=r(e.onKeyDown,(e=>{var o;const n=e.target;if(!(g.includes(e.key)&&(t=n,t instanceof HTMLButtonElement)))return;var t;const r=[...v.current].filter((e=>!(e&&e.disabled))),c=r.length,i=r.indexOf(n);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=r[a%c])||void 0===o||o.focus()})),P=s.useMemo((()=>({isDisabled:m,buttonNodesRef:v,value:x,setValue:I})),[m,x,I]);return s.createElement(n,u({},b,l("Accordion"),{ref:h,onKeyDown:m?void 0:w}),s.createElement(f.Provider,{value:P},d))}));Accordion.displayName="Accordion";export const Root=Accordion;export const Item=AccordionItem;export const Header=AccordionHeader;export const Button=AccordionButton;export const Panel=AccordionPanel; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-accordion", | ||
"version": "0.0.1-14", | ||
"version": "0.0.1-15", | ||
"license": "MIT", | ||
@@ -20,6 +20,6 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@interop-ui/react-collapsible": "0.0.1-13", | ||
"@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-collapsible": "0.0.1-14", | ||
"@interop-ui/react-polymorphic": "0.0.1-1", | ||
"@interop-ui/react-utils": "0.0.1-14", | ||
"@interop-ui/utils": "0.0.1-6" | ||
}, | ||
@@ -26,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
46651
101
+ Added@interop-ui/react-collapsible@0.0.1-14(transitive)
+ 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-collapsible@0.0.1-13(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