@sikt/sds-accordion
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -12,4 +12,4 @@ /// <reference types="react" /> | ||
} | ||
declare const Accordion: ({ title, children, className, isExpanded, size, headingLevel, onClick, ...rest }: AccordionProps) => JSX.Element; | ||
declare const Accordion: ({ title, children, className, isExpanded, size, headingLevel, onClick, ...rest }: AccordionProps) => import("react/jsx-runtime").JSX.Element; | ||
export type { AccordionProps }; | ||
export { Accordion }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var s=require("react/jsx-runtime"),e=require("react"),a=require("clsx");const c=({className:e,...c})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",className:a("sds-icon",e),"aria-hidden":"true",...c,children:s.jsx("path",{d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm45.66-109.66a8 8 0 0 1 0 11.32l-40 40a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L128 140.69l34.34-34.35a8 8 0 0 1 11.32 0Z"})});exports.Accordion=({title:i,children:n,className:r,isExpanded:d=!1,size:o="large",headingLevel:t="h3",onClick:l,...x})=>{const[h,m]=e.useState(d),u=`${t}`,_=e.useId();return s.jsxs("section",{className:a("sds-accordion",`sds-accordion--${o}`,r),...x,children:[s.jsxs("button",{id:`${_}-title`,"aria-expanded":h,"aria-controls":`${_}-content`,className:"sds-accordion__button",onClick:s=>{const e=!h;m(e),l&&l(s,e)},children:[s.jsx(u,{className:"sds-accordion__title",children:i}),s.jsx(c,{className:a("sds-accordion__icon",h&&"sds-accordion__icon--expanded")})]}),s.jsx("div",{role:"region",id:`${_}-content`,"aria-labelledby":`${_}-title`,className:"sds-accordion__content",hidden:!h,children:n})]})}; | ||
"use strict";var s=require("react/jsx-runtime"),e=require("react"),c=require("clsx");const a=({className:e,...a})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",className:c("sds-icon",e),"aria-hidden":"true",...a,children:s.jsx("path",{d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm45.66-109.66a8 8 0 0 1 0 11.32l-40 40a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L128 140.69l34.34-34.35a8 8 0 0 1 11.32 0Z"})});exports.Accordion=({title:i,children:n,className:o,isExpanded:r=!1,size:d="large",headingLevel:l="h3",onClick:t,...x})=>{const[h,m]=e.useState(r),u=`${l}`,_=e.useId();return s.jsxs("section",{className:c("sds-accordion",`sds-accordion--${d}`,o),...x,children:[s.jsxs("button",{id:`${_}-title`,"aria-expanded":h,"aria-controls":`${_}-content`,className:"sds-accordion__button",onClick:s=>{const e=!h;m(e),t&&t(s,e)},children:[s.jsx(u,{className:"sds-accordion__title",children:i}),s.jsx("span",{className:"sds-accordion__icon",children:s.jsx(a,{className:c("sds-accordion__icon-icon",h&&"sds-accordion__icon-icon--expanded")})})]}),s.jsx("div",{role:"region",id:`${_}-content`,"aria-labelledby":`${_}-title`,className:"sds-accordion__content",hidden:!h,children:n})]})}; | ||
//# sourceMappingURL=index.js.map |
@@ -12,4 +12,4 @@ /// <reference types="react" /> | ||
} | ||
declare const Accordion: ({ title, children, className, isExpanded, size, headingLevel, onClick, ...rest }: AccordionProps) => JSX.Element; | ||
declare const Accordion: ({ title, children, className, isExpanded, size, headingLevel, onClick, ...rest }: AccordionProps) => import("react/jsx-runtime").JSX.Element; | ||
export type { AccordionProps }; | ||
export { Accordion }; |
@@ -1,2 +0,2 @@ | ||
import{jsx as a,jsxs as e}from"react/jsx-runtime";import{useState as c,useId as s}from"react";import o from"clsx";const i=({className:e,...c})=>a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",className:o("sds-icon",e),"aria-hidden":"true",...c,children:a("path",{d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm45.66-109.66a8 8 0 0 1 0 11.32l-40 40a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L128 140.69l34.34-34.35a8 8 0 0 1 11.32 0Z"})}),n=({title:n,children:r,className:d,isExpanded:t=!1,size:l="large",headingLevel:m="h3",onClick:h,..._})=>{const[p,x]=c(t),N=`${m}`,g=s();return e("section",{className:o("sds-accordion",`sds-accordion--${l}`,d),..._,children:[e("button",{id:`${g}-title`,"aria-expanded":p,"aria-controls":`${g}-content`,className:"sds-accordion__button",onClick:a=>{const e=!p;x(e),h&&h(a,e)},children:[a(N,{className:"sds-accordion__title",children:n}),a(i,{className:o("sds-accordion__icon",p&&"sds-accordion__icon--expanded")})]}),a("div",{role:"region",id:`${g}-content`,"aria-labelledby":`${g}-title`,className:"sds-accordion__content",hidden:!p,children:r})]})};export{n as Accordion}; | ||
import{jsx as c,jsxs as a}from"react/jsx-runtime";import{useState as s,useId as e}from"react";import n from"clsx";const o=({className:a,...s})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 256 256",className:n("sds-icon",a),"aria-hidden":"true",...s,children:c("path",{d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm45.66-109.66a8 8 0 0 1 0 11.32l-40 40a8 8 0 0 1-11.32 0l-40-40a8 8 0 0 1 11.32-11.32L128 140.69l34.34-34.35a8 8 0 0 1 11.32 0Z"})}),i=({title:i,children:d,className:r,isExpanded:l=!1,size:t="large",headingLevel:m="h3",onClick:h,..._})=>{const[p,N]=s(l),x=`${m}`,g=e();return a("section",{className:n("sds-accordion",`sds-accordion--${t}`,r),..._,children:[a("button",{id:`${g}-title`,"aria-expanded":p,"aria-controls":`${g}-content`,className:"sds-accordion__button",onClick:c=>{const a=!p;N(a),h&&h(c,a)},children:[c(x,{className:"sds-accordion__title",children:i}),c("span",{className:"sds-accordion__icon",children:c(o,{className:n("sds-accordion__icon-icon",p&&"sds-accordion__icon-icon--expanded")})})]}),c("div",{role:"region",id:`${g}-content`,"aria-labelledby":`${g}-title`,className:"sds-accordion__content",hidden:!p,children:d})]})};export{i as Accordion}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sikt/sds-accordion", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"license": "UNLICENSED", | ||
@@ -20,7 +20,8 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@sikt/sds-core": "^1.0.1", | ||
"@sikt/sds-icons": "^1.0.0" | ||
"@sikt/sds-core": "^3.0.0", | ||
"@sikt/sds-icons": "^1.2.0", | ||
"@sikt/sds-tokens": "^1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"clsx": "^1.2.1", | ||
"clsx": "^1.0.0 || ^2.0.0", | ||
"react": "^18.0.0", | ||
@@ -27,0 +28,0 @@ "react-dom": "^18.0.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
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
100770
60
6
+ Added@sikt/sds-tokens@^1.0.0
+ Added@sikt/sds-core@3.1.0(transitive)
+ Added@sikt/sds-tokens@1.0.12.1.0(transitive)
+ Addedclsx@2.1.1(transitive)
- Removed@sikt/sds-core@1.0.1(transitive)
- Removedclsx@1.2.1(transitive)
Updated@sikt/sds-core@^3.0.0
Updated@sikt/sds-icons@^1.2.0