Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@purpurds/accordion

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/accordion - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0

7

dist/accordion-item.d.ts

@@ -19,5 +19,10 @@ import { default as React, ReactElement, ReactNode, ReactPortal } from 'react';

value?: string;
/**
* onClick is called when accordion item is expanded or collapsed
* event.target.dataset.state will be either "open" or "closed"
*/
onClick?: () => void;
};
export declare const AccordionItem: ({ children, className, title, negative, ...props }: AccordionItemProps) => React.JSX.Element;
export declare const AccordionItem: ({ children, className, title, negative, onClick, ...props }: AccordionItemProps) => React.JSX.Element;
export declare const isAccordionItem: (child: ReactElement | Iterable<ReactNode> | ReactPortal | string | number | boolean | null | undefined) => child is React.ReactElement<AccordionItemProps, string | React.JSXElementConstructor<any>>;
//# sourceMappingURL=accordion-item.d.ts.map

2

dist/accordion.cjs.js

@@ -17,3 +17,3 @@ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),a=require("react"),Ne=require("react-dom");function Ie(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const re=Ie(a);function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe={exports:{}};/*!

http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ce);var jt=Ce.exports;const Lt=Dt(jt),P={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},qt={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},w="purpur-paragraph",Vt=({["data-testid"]:e,children:r,className:n="",disabled:o,enableHyphenation:i=!1,negative:t=!1,variant:c=qt.PARAGRAPH100,...s})=>{const l=Lt([n,P[w],P[`${w}--${c}`],{[P[`${w}--hyphens`]]:i,[P[`${w}--disabled`]]:o,[P[`${w}--negative`]]:t}]);return y.jsx("p",{...s,className:l,"data-testid":e,children:r})},Ut="_slideDown_8k8nf_1",Bt="_slideUp_8k8nf_1",Ht={"purpur-accordion-item":"_purpur-accordion-item_8k8nf_1","purpur-accordion-item__header":"_purpur-accordion-item__header_8k8nf_8","purpur-accordion-item__trigger":"_purpur-accordion-item__trigger_8k8nf_11","purpur-accordion-item__content":"_purpur-accordion-item__content_8k8nf_35",slideDown:Ut,slideUp:Bt,"purpur-accordion-item__contentText":"_purpur-accordion-item__contentText_8k8nf_44","purpur-accordion-item__icon":"_purpur-accordion-item__icon_8k8nf_48","purpur-accordion-item__title":"_purpur-accordion-item__title_8k8nf_60","purpur-accordion-item--negative":"_purpur-accordion-item--negative_8k8nf_78"},N=ve.bind(Ht),A="purpur-accordion-item",Ae=({children:e,className:r,title:n,negative:o,...i})=>{const t=N([r,A,{[`${A}--negative`]:o}]);return y.jsxs(ht,{className:t,value:n,...i,children:[y.jsx(gt,{className:N(`${A}__header`),asChild:!0,children:y.jsxs(vt,{className:N(`${A}__trigger`,r),children:[y.jsx(ae,{tag:"h3",variant:"title-100",className:N(`${A}__title`),children:n}),y.jsx(ye,{size:"md",className:N(`${A}__icon`),"aria-hidden":!0})]})}),y.jsx(xt,{className:N(`${A}__content`,r),children:y.jsx("div",{className:N(`${A}__contentText`),children:typeof e=="string"?y.jsx(Vt,{variant:"paragraph-200",children:e}):e})})]})},Gt=e=>a.isValidElement(e)&&(e==null?void 0:e.type)===Ae,ne=ve.bind(At),H="purpur-accordion",X=({["data-testid"]:e,children:r,className:n,negative:o=!1,title:i,titleVariant:t="title-300"})=>{const c=ne([n,H,{[`${H}--negative`]:o}]),s=()=>a.Children.map(r,l=>Gt(l)?a.cloneElement(l,{negative:o}):null);return y.jsxs(_t,{className:c,type:"multiple","data-testid":e,children:[i?y.jsx(ae,{tag:"h2",variant:t,className:ne(`${H}__title`),children:i}):null,s()]})};X.Item=Ae;X.displayName="Accordion";exports.Accordion=X;
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ce);var jt=Ce.exports;const Lt=Dt(jt),P={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},qt={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},w="purpur-paragraph",Vt=({["data-testid"]:e,children:r,className:n="",disabled:o,enableHyphenation:i=!1,negative:t=!1,variant:c=qt.PARAGRAPH100,...s})=>{const l=Lt([n,P[w],P[`${w}--${c}`],{[P[`${w}--hyphens`]]:i,[P[`${w}--disabled`]]:o,[P[`${w}--negative`]]:t}]);return y.jsx("p",{...s,className:l,"data-testid":e,children:r})},Ut="_slideDown_8k8nf_1",Bt="_slideUp_8k8nf_1",Ht={"purpur-accordion-item":"_purpur-accordion-item_8k8nf_1","purpur-accordion-item__header":"_purpur-accordion-item__header_8k8nf_8","purpur-accordion-item__trigger":"_purpur-accordion-item__trigger_8k8nf_11","purpur-accordion-item__content":"_purpur-accordion-item__content_8k8nf_35",slideDown:Ut,slideUp:Bt,"purpur-accordion-item__contentText":"_purpur-accordion-item__contentText_8k8nf_44","purpur-accordion-item__icon":"_purpur-accordion-item__icon_8k8nf_48","purpur-accordion-item__title":"_purpur-accordion-item__title_8k8nf_60","purpur-accordion-item--negative":"_purpur-accordion-item--negative_8k8nf_78"},N=ve.bind(Ht),A="purpur-accordion-item",Ae=({children:e,className:r,title:n,negative:o,onClick:i,...t})=>{const c=N([r,A,{[`${A}--negative`]:o}]);return y.jsxs(ht,{className:c,value:n,...t,children:[y.jsx(gt,{className:N(`${A}__header`),asChild:!0,children:y.jsxs(vt,{onClick:i,className:N(`${A}__trigger`,r),children:[y.jsx(ae,{tag:"h3",variant:"title-100",className:N(`${A}__title`),children:n}),y.jsx(ye,{size:"md",className:N(`${A}__icon`),"aria-hidden":!0})]})}),y.jsx(xt,{className:N(`${A}__content`,r),children:y.jsx("div",{className:N(`${A}__contentText`),children:typeof e=="string"?y.jsx(Vt,{variant:"paragraph-200",children:e}):e})})]})},Gt=e=>a.isValidElement(e)&&(e==null?void 0:e.type)===Ae,ne=ve.bind(At),H="purpur-accordion",X=({["data-testid"]:e,children:r,className:n,negative:o=!1,title:i,titleVariant:t="title-300"})=>{const c=ne([n,H,{[`${H}--negative`]:o}]),s=()=>a.Children.map(r,l=>Gt(l)?a.cloneElement(l,{negative:o}):null);return y.jsxs(_t,{className:c,type:"multiple","data-testid":e,children:[i?y.jsx(ae,{tag:"h2",variant:t,className:ne(`${H}__title`),children:i}):null,s()]})};X.Item=Ae;X.displayName="Accordion";exports.Accordion=X;
//# sourceMappingURL=accordion.cjs.js.map

@@ -23,5 +23,5 @@ import { TitleVariantType } from '@purpurds/heading';

({ ["data-testid"]: dataTestId, children, className, negative, title, titleVariant, }: AccordionProps): React.JSX.Element;
Item: ({ children, className, title, negative, ...props }: import('./accordion-item').AccordionItemProps) => React.JSX.Element;
Item: ({ children, className, title, negative, onClick, ...props }: import('./accordion-item').AccordionItemProps) => React.JSX.Element;
displayName: string;
};
//# sourceMappingURL=accordion.d.ts.map

@@ -1001,5 +1001,6 @@ import { jsx as A, jsxs as X } from "react/jsx-runtime";

negative: o,
...c
onClick: c,
...t
}) => {
const t = P([
const a = P([
r,

@@ -1011,7 +1012,14 @@ E,

]);
return /* @__PURE__ */ X(Tt, { className: t, value: n, ...c, children: [
/* @__PURE__ */ A(Mt, { className: P(`${E}__header`), asChild: !0, children: /* @__PURE__ */ X(kt, { className: P(`${E}__trigger`, r), children: [
/* @__PURE__ */ A(me, { tag: "h3", variant: "title-100", className: P(`${E}__title`), children: n }),
/* @__PURE__ */ A(Me, { size: "md", className: P(`${E}__icon`), "aria-hidden": !0 })
] }) }),
return /* @__PURE__ */ X(Tt, { className: a, value: n, ...t, children: [
/* @__PURE__ */ A(Mt, { className: P(`${E}__header`), asChild: !0, children: /* @__PURE__ */ X(
kt,
{
onClick: c,
className: P(`${E}__trigger`, r),
children: [
/* @__PURE__ */ A(me, { tag: "h3", variant: "title-100", className: P(`${E}__title`), children: n }),
/* @__PURE__ */ A(Me, { size: "md", className: P(`${E}__icon`), "aria-hidden": !0 })
]
}
) }),
/* @__PURE__ */ A(Dt, { className: P(`${E}__content`, r), children: /* @__PURE__ */ A("div", { className: P(`${E}__contentText`), children: typeof e == "string" ? /* @__PURE__ */ A(tn, { variant: "paragraph-200", children: e }) : e }) })

@@ -1018,0 +1026,0 @@ ] });

Name: @purpurds/heading
Version: 5.2.0
Version: 5.3.0
License: AGPL-3.0-only

@@ -205,3 +205,3 @@ Private: false

Name: @purpurds/icon
Version: 5.2.0
Version: 5.3.0
License: AGPL-3.0-only

@@ -213,4 +213,4 @@ Private: false

Name: @purpurds/paragraph
Version: 5.2.0
Version: 5.3.0
License: AGPL-3.0-only
Private: false
{
"name": "@purpurds/accordion",
"version": "5.3.0",
"version": "5.4.0",
"license": "AGPL-3.0-only",

@@ -19,6 +19,6 @@ "main": "./dist/accordion.cjs.js",

"@radix-ui/react-accordion": "~1.1.2",
"@purpurds/tokens": "5.3.0",
"@purpurds/heading": "5.3.0",
"@purpurds/icon": "5.3.0",
"@purpurds/paragraph": "5.3.0"
"@purpurds/tokens": "5.4.0",
"@purpurds/icon": "5.4.0",
"@purpurds/paragraph": "5.4.0",
"@purpurds/heading": "5.4.0"
},

@@ -25,0 +25,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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc