@interop-ui/react-accordion
Advanced tools
Comparing version 0.0.1-12 to 0.0.1-13
@@ -51,4 +51,3 @@ import React from "react"; | ||
} | ||
export const styles: import("@interop-ui/react-utils").PrimitiveStyles<"button" | "header" | "root" | "item" | "panel">; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
var e,t=require("@interop-ui/react-collapsible"),r=t.Collapsible,n=t.styles,o=require("@interop-ui/react-utils"),i=o.composeEventHandlers,a=o.createContext,u=o.createStyleObj,c=o.forwardRef,l=o.useComposedRefs,d=o.useControlledState,s=o.useId,f=require("@interop-ui/utils").cssReset,b=(e=require("react"))&&e.__esModule?e.default:e;function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){return function(e){if(Array.isArray(e))return w(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 O(){return(O=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 g(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 h(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,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||A(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 A(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function w(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 j=h(a("AccordionContext","Accordion"),2),P=j[0],I=j[1],S=h(a("AccordionItemContext","Accordion.Item"),2),E=S[0],C=S[1],D=c((function(e,t){var n,o=e.value,i=(e.isOpen,e.defaultIsOpen,e.children),a=(e.onToggle,g(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=I("Accordion.Item"),c="accordion-button-".concat(s()),l=e.id||c,d=o&&o===u.value||!1,f=null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,p=b.useMemo((function(){return{isOpen:d,buttonId:l}}),[d,l]);return b.createElement(r,O({},a,M("item"),{ref:t,"data-state":d?"open":"closed","data-disabled":f||void 0,disabled:f,isOpen:d,onToggle:function(){return u.setValue(o)}}),b.createElement(E.Provider,{value:p},i))})),x=c((function(e,t){var r=e.as,n=void 0===r?"h3":r,o=g(e,["as"]);return b.createElement(n,O({ref:t},o,M("header")))})),R=c((function(e,t){var n=Object.assign({},e),o=I("Accordion.Button").buttonNodesRef,i=C("Accordion.Button"),a=b.useRef(null),u=l(a,t);return b.useEffect((function(){var e=o.current,t=a.current;if(t)return e.add(t),function(){e.delete(t)}}),[o]),b.createElement(r.Button,O({},n,M("button"),{ref:u,"aria-disabled":i.isOpen||void 0,id:i.buttonId}))})),k=c((function(e,t){var n=C("Accordion.Panel");return b.createElement(r.Content,O({},e,M("panel"),{ref:t,role:"region","aria-labelledby":n.buttonId}))})),B=["Home","End","ArrowDown","ArrowUp"],H=c((function(e,t){var r=e.as,n=void 0===r?"div":r,o=e.value,a=e.defaultValue,u=e.children,c=e.disabled,s=e.onChange,f=void 0===s?function(){}:s,p=g(e,["as","value","defaultValue","children","disabled","onChange"]),y=b.useRef(new Set),v=b.useRef(null),A=l(v,t),w=h(d({prop:o,defaultProp:a,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return e&&f(e)}))}),2),j=w[0],I=w[1],S=i(e.onKeyDown,(function(e){var t,r=e.target;if(B.includes(e.key)&&r instanceof HTMLButtonElement){var n=m(y.current).filter((function(e){return!(e&&e.disabled)})),o=n.length,i=n.indexOf(r);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===(t=n[a%o])||void 0===t||t.focus()}}})),E=b.useMemo((function(){return{isDisabled:c,buttonNodesRef:y,value:j,setValue:I}}),[c,j,I]);return b.createElement(n,O({},p,M("root"),{ref:A,onKeyDown:c?void 0:S}),b.createElement(P.Provider,{value:E},u))}));exports.Accordion=H,H.Item=D,H.Header=x,H.Button=R,H.Panel=k,H.displayName="Accordion",H.Item.displayName="Accordion.Item",H.Header.displayName="Accordion.Header",H.Button.displayName="Accordion.Button",H.Panel.displayName="Accordion.Panel";var N=h(u("Accordion",{root:y({},f("div")),item:y(y({},f("div")),n.root),header:y({},f("h3")),button:y(y({},f("button")),n.button),panel:y(y({},f("div")),n.content)}),2),T=N[0],M=N[1];exports.styles=T; | ||
var e,r=require("@interop-ui/react-collapsible").Collapsible,t=require("@interop-ui/react-utils"),n=t.composeEventHandlers,o=t.createContext,a=t.forwardRef,i=t.useComposedRefs,u=t.useControlledState,c=t.useId,l=require("@interop-ui/utils").getPartDataAttrObj,d=(e=require("react"))&&e.__esModule?e.default:e;function s(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||v(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 f(){return(f=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 p(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 b(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)||v(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 v(e,r){if(e){if("string"==typeof e)return y(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)?y(e,r):void 0}}function y(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 m=b(o("AccordionContext","Accordion"),2),A=m[0],g=m[1],h=b(o("AccordionItemContext","Accordion.Item"),2),O=h[0],w=h[1],I=a((function(e,t){var n,o=e.value,a=(e.isOpen,e.defaultIsOpen,e.children),i=(e.onToggle,p(e,["value","isOpen","defaultIsOpen","children","onToggle"])),u=g("Accordion.Item"),s="accordion-button-".concat(c()),b=e.id||s,v=o&&o===u.value||!1,y=null!==(n=u.isDisabled)&&void 0!==n?n:e.disabled,m=d.useMemo((function(){return{isOpen:v,buttonId:b}}),[v,b]);return d.createElement(r,f({},i,l("Accordion.Item"),{ref:t,"data-state":v?"open":"closed","data-disabled":y||void 0,disabled:y,isOpen:v,onToggle:function(){return u.setValue(o)}}),d.createElement(O.Provider,{value:m},a))})),E=a((function(e,r){var t=e.as,n=void 0===t?"h3":t,o=p(e,["as"]);return d.createElement(n,f({ref:r},o,l("Accordion.Header")))})),S=a((function(e,t){var n=Object.assign({},e),o=g("Accordion.Button").buttonNodesRef,a=w("Accordion.Button"),u=d.useRef(null),c=i(u,t);return d.useEffect((function(){var e=o.current,r=u.current;if(r)return e.add(r),function(){e.delete(r)}}),[o]),d.createElement(r.Button,f({},n,l("Accordion.Button"),{ref:c,"aria-disabled":a.isOpen||void 0,id:a.buttonId}))})),j=a((function(e,t){var n=w("Accordion.Panel");return d.createElement(r.Content,f({},e,l("Accordion.Panel"),{ref:t,role:"region","aria-labelledby":n.buttonId}))})),P=["Home","End","ArrowDown","ArrowUp"],C=a((function(e,r){var t=e.as,o=void 0===t?"div":t,a=e.value,c=e.defaultValue,v=e.children,y=e.disabled,m=e.onChange,g=void 0===m?function(){}:m,h=p(e,["as","value","defaultValue","children","disabled","onChange"]),O=d.useRef(new Set),w=d.useRef(null),I=i(w,r),E=b(u({prop:a,defaultProp:c,onChange:function(e){function r(r){return e.apply(this,arguments)}return r.toString=function(){return e.toString()},r}((function(e){return e&&g(e)}))}),2),S=E[0],j=E[1],C=n(e.onKeyDown,(function(e){var r,t=e.target;if(P.includes(e.key)&&t instanceof HTMLButtonElement){var n=s(O.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()}}})),x=d.useMemo((function(){return{isDisabled:y,buttonNodesRef:O,value:S,setValue:j}}),[y,S,j]);return d.createElement(o,f({},h,l("Accordion"),{ref:I,onKeyDown:y?void 0:C}),d.createElement(A.Provider,{value:x},v))}));exports.Accordion=C,C.Item=I,C.Header=E,C.Button=S,C.Panel=j,C.displayName="Accordion",C.Item.displayName="Accordion.Item",C.Header.displayName="Accordion.Header",C.Button.displayName="Accordion.Button",C.Panel.displayName="Accordion.Panel"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{Collapsible as e,styles as t}from"@interop-ui/react-collapsible";import{composeEventHandlers as n,createContext as r,createStyleObj as o,forwardRef as c,useComposedRefs as i,useControlledState as a,useId as l}from"@interop-ui/react-utils";import{cssReset as u}from"@interop-ui/utils";import d from"react";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const[O,y]=r("AccordionContext","Accordion"),[v,g]=r("AccordionItemContext","Accordion.Item"),A=c((function(t,n){var r;const{value:o,isOpen:c,defaultIsOpen:i,children:a,onToggle:u}=t,s=m(t,["value","isOpen","defaultIsOpen","children","onToggle"]),f=y("Accordion.Item"),p="accordion-button-".concat(l()),O=t.id||p,g=o&&o===f.value||!1,A=null!==(r=f.isDisabled)&&void 0!==r?r:t.disabled,h=d.useMemo((()=>({isOpen:g,buttonId:O})),[g,O]);return d.createElement(e,b({},s,k("item"),{ref:n,"data-state":g?"open":"closed","data-disabled":A||void 0,disabled:A,isOpen:g,onToggle:()=>f.setValue(o)}),d.createElement(v.Provider,{value:h},a))})),h="h3",w=c((function(e,t){const{as:n=h}=e,r=m(e,["as"]);return d.createElement(n,b({ref:t},r,k("header")))})),j=c((function(t,n){const r=Object.assign({},t),{buttonNodesRef:o}=y("Accordion.Button"),c=g("Accordion.Button"),a=d.useRef(null),l=i(a,n);return d.useEffect((()=>{const e=o.current,t=a.current;if(t)return e.add(t),()=>{e.delete(t)}}),[o]),d.createElement(e.Button,b({},r,k("button"),{ref:l,"aria-disabled":c.isOpen||void 0,id:c.buttonId}))})),P=c((function(t,n){const r=g("Accordion.Panel");return d.createElement(e.Content,b({},t,k("panel"),{ref:n,role:"region","aria-labelledby":r.buttonId}))})),E="div",I=["Home","End","ArrowDown","ArrowUp"];export const Accordion=c((function(e,t){const{as:r=E,value:o,defaultValue:c,children:l,disabled:u,onChange:s=(()=>{})}=e,f=m(e,["as","value","defaultValue","children","disabled","onChange"]),p=d.useRef(new Set),y=d.useRef(null),v=i(y,t),[g,A]=a({prop:o,defaultProp:c,onChange:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((e=>e&&s(e)))}),h=n(e.onKeyDown,(e=>{var t;const n=e.target;if(!(I.includes(e.key)&&(r=n,r instanceof HTMLButtonElement)))return;var r;const o=[...p.current].filter((e=>!(e&&e.disabled))),c=o.length,i=o.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===(t=o[a%c])||void 0===t||t.focus()})),w=d.useMemo((()=>({isDisabled:u,buttonNodesRef:p,value:g,setValue:A})),[u,g,A]);return d.createElement(r,b({},f,k("root"),{ref:v,onKeyDown:u?void 0:h}),d.createElement(O.Provider,{value:w},l))}));Accordion.Item=A,Accordion.Header=w,Accordion.Button=j,Accordion.Panel=P,Accordion.displayName="Accordion",Accordion.Item.displayName="Accordion.Item",Accordion.Header.displayName="Accordion.Header",Accordion.Button.displayName="Accordion.Button",Accordion.Panel.displayName="Accordion.Panel";const[D,k]=o("Accordion",{root:f({},u(E)),item:f(f({},u("div")),t.root),header:f({},u(h)),button:f(f({},u("button")),t.button),panel:f(f({},u("div")),t.content)});export{D as styles}; | ||
import{Collapsible as e}from"@interop-ui/react-collapsible";import{composeEventHandlers as n,createContext as o,forwardRef as t,useComposedRefs as r,useControlledState as c,useId as i}from"@interop-ui/react-utils";import{getPartDataAttrObj as a}from"@interop-ui/utils";import d from"react";function l(){return(l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e}).apply(this,arguments)}function u(e,n){if(null==e)return{};var o,t,r=function(e,n){if(null==e)return{};var o,t,r={},c=Object.keys(e);for(t=0;t<c.length;t++)o=c[t],n.indexOf(o)>=0||(r[o]=e[o]);return r}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(t=0;t<c.length;t++)o=c[t],n.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}const[s,f]=o("AccordionContext","Accordion"),[p,m]=o("AccordionItemContext","Accordion.Item"),A=t((function(n,o){var t;const{value:r,isOpen:c,defaultIsOpen:s,children:m,onToggle:A}=n,b=u(n,["value","isOpen","defaultIsOpen","children","onToggle"]),v=f("Accordion.Item"),g="accordion-button-".concat(i()),y=n.id||g,O=r&&r===v.value||!1,h=null!==(t=v.isDisabled)&&void 0!==t?t:n.disabled,w=d.useMemo((()=>({isOpen:O,buttonId:y})),[O,y]);return d.createElement(e,l({},b,a("Accordion.Item"),{ref:o,"data-state":O?"open":"closed","data-disabled":h||void 0,disabled:h,isOpen:O,onToggle:()=>v.setValue(r)}),d.createElement(p.Provider,{value:w},m))})),b="h3",v=t((function(e,n){const{as:o=b}=e,t=u(e,["as"]);return d.createElement(o,l({ref:n},t,a("Accordion.Header")))})),g=t((function(n,o){const t=Object.assign({},n),{buttonNodesRef:c}=f("Accordion.Button"),i=m("Accordion.Button"),u=d.useRef(null),s=r(u,o);return d.useEffect((()=>{const e=c.current,n=u.current;if(n)return e.add(n),()=>{e.delete(n)}}),[c]),d.createElement(e.Button,l({},t,a("Accordion.Button"),{ref:s,"aria-disabled":i.isOpen||void 0,id:i.buttonId}))})),y=t((function(n,o){const t=m("Accordion.Panel");return d.createElement(e.Content,l({},n,a("Accordion.Panel"),{ref:o,role:"region","aria-labelledby":t.buttonId}))})),O="div",h=["Home","End","ArrowDown","ArrowUp"];export const Accordion=t((function(e,o){const{as:t=O,value:i,defaultValue:f,children:p,disabled:m,onChange:A=(()=>{})}=e,b=u(e,["as","value","defaultValue","children","disabled","onChange"]),v=d.useRef(new Set),g=d.useRef(null),y=r(g,o),[w,I]=c({prop:i,defaultProp:f,onChange:function(e){function n(n){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((e=>e&&A(e)))}),E=n(e.onKeyDown,(e=>{var n;const o=e.target;if(!(h.includes(e.key)&&(t=o,t instanceof HTMLButtonElement)))return;var t;const r=[...v.current].filter((e=>!(e&&e.disabled))),c=r.length,i=r.indexOf(o);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===(n=r[a%c])||void 0===n||n.focus()})),P=d.useMemo((()=>({isDisabled:m,buttonNodesRef:v,value:w,setValue:I})),[m,w,I]);return d.createElement(t,l({},b,a("Accordion"),{ref:y,onKeyDown:m?void 0:E}),d.createElement(s.Provider,{value:P},p))}));Accordion.Item=A,Accordion.Header=v,Accordion.Button=g,Accordion.Panel=y,Accordion.displayName="Accordion",Accordion.Item.displayName="Accordion.Item",Accordion.Header.displayName="Accordion.Header",Accordion.Button.displayName="Accordion.Button",Accordion.Panel.displayName="Accordion.Panel"; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/react-accordion", | ||
"version": "0.0.1-12", | ||
"version": "0.0.1-13", | ||
"license": "MIT", | ||
@@ -14,4 +14,3 @@ "source": "src/index.ts", | ||
"scripts": { | ||
"build": "parcel build src/index.ts --no-cache && yarn build:styles", | ||
"build:styles": "node ../../../scripts/build-styles accordion", | ||
"build": "parcel build src/index.ts --no-cache", | ||
"clean": "rm -rf dist", | ||
@@ -22,5 +21,5 @@ "version": "yarn version", | ||
"dependencies": { | ||
"@interop-ui/react-collapsible": "0.0.1-11", | ||
"@interop-ui/react-utils": "0.0.1-11", | ||
"@interop-ui/utils": "0.0.1-3" | ||
"@interop-ui/react-collapsible": "0.0.1-12", | ||
"@interop-ui/react-utils": "0.0.1-12", | ||
"@interop-ui/utils": "0.0.1-4" | ||
}, | ||
@@ -27,0 +26,0 @@ "devDependencies": { |
@@ -15,12 +15,12 @@ # `react-accordion` | ||
import * as React from 'react'; | ||
import { Accordion, styles } from '@interop-ui/react-accordion'; | ||
import { Accordion } from '@interop-ui/react-accordion'; | ||
function MyComponent(domProps) { | ||
function MyComponent() { | ||
return ( | ||
<Accordion {...domProps} style={{ ...styles.root, ...domProps.style }}> | ||
<Accordion> | ||
{/* start items */} | ||
<Accordion.Item style={styles.item} value="one"> | ||
<Accordion.Header style={styles.header}> | ||
<Accordion.Button style={styles.button}>One</Accordion.Button> | ||
<Accordion.Item value="one"> | ||
<Accordion.Header> | ||
<Accordion.Button>One</Accordion.Button> | ||
</Accordion.Header> | ||
@@ -30,5 +30,5 @@ <Accordion.Panel>Content for item 1</Accordion.Panel> | ||
<Accordion.Item style={styles.item} value="two"> | ||
<Accordion.Header style={styles.header}> | ||
<Accordion.Button style={styles.button}>Two</Accordion.Button> | ||
<Accordion.Item value="two"> | ||
<Accordion.Header> | ||
<Accordion.Button>Two</Accordion.Button> | ||
</Accordion.Header> | ||
@@ -35,0 +35,0 @@ <Accordion.Panel>Content for item 2</Accordion.Panel> |
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
60282
8
135
+ Added@interop-ui/react-collapsible@0.0.1-12(transitive)
+ Added@interop-ui/react-utils@0.0.1-12(transitive)
+ Added@interop-ui/utils@0.0.1-4(transitive)
- Removed@interop-ui/react-collapsible@0.0.1-11(transitive)
- Removed@interop-ui/react-utils@0.0.1-11(transitive)
- Removed@interop-ui/utils@0.0.1-3(transitive)
- Removedlodash.camelcase@4.3.0(transitive)
- Removedlodash.kebabcase@4.1.1(transitive)
Updated@interop-ui/utils@0.0.1-4