@fremtind/jkl-accordion-react
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -6,4 +6,5 @@ import { ReactNode } from "react"; | ||
startExpanded?: boolean; | ||
className?: string; | ||
} | ||
export declare function AccordionItem({ children, title, startExpanded }: Props): JSX.Element; | ||
export declare function AccordionItem({ children, title, className, startExpanded }: Props): JSX.Element; | ||
export {}; |
@@ -50,2 +50,3 @@ import CoreToggle from '@nrk/core-toggle/jsx'; | ||
title = _ref.title, | ||
className = _ref.className, | ||
_ref$startExpanded = _ref.startExpanded, | ||
@@ -63,3 +64,3 @@ startExpanded = _ref$startExpanded === void 0 ? false : _ref$startExpanded; | ||
var openClassName = isOpen ? " jkl-accordion-item--expanded" : ""; | ||
var componentClassName = "jkl-accordion-item".concat(isOpen ? " jkl-accordion-item--expanded" : "", className ? " ".concat(className) : ""); | ||
@@ -72,3 +73,3 @@ var onToggle = function onToggle() { | ||
"data-testid": "jkl-accordion-item", | ||
className: "jkl-accordion-item".concat(openClassName) | ||
className: componentClassName | ||
}, React.createElement("button", { | ||
@@ -75,0 +76,0 @@ className: "jkl-accordion-item__title", |
@@ -1,1 +0,1 @@ | ||
import t from"@nrk/core-toggle/jsx";import e,{useState as r}from"react";import{useAnimatedHeight as n}from"@fremtind/jkl-react-hooks";function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var c,i=t[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(o){var c=o.children,i=o.title,l=o.startExpanded,d=a(r(void 0!==l&&l),2),m=d[0],s=d[1],u=a(n(m),1)[0],f=m?" jkl-accordion-item--expanded":"";return e.createElement("div",{"data-testid":"jkl-accordion-item",className:"jkl-accordion-item".concat(f)},e.createElement("button",{className:"jkl-accordion-item__title",type:"button"},e.createElement("span",{className:"jkl-accordion-item__title-text"},i),e.createElement("span",{className:"jkl-accordion-item__title-icon"})),e.createElement(t,{ref:u,"data-testid":"jkl-accordion-item__content-wrapper",className:"jkl-accordion-item__content-wrapper",hidden:!m,onToggle:function(){return s(!m)}},e.createElement("div",{className:"jkl-accordion-item__content"},c)))}function c(t){var r=t.children,n=t.className,a=void 0===n?"":n;return e.createElement("div",{"data-testid":"jkl-accordion",className:"jkl-accordion ".concat(a)},r)}export{c as Accordion,o as AccordionItem}; | ||
import t from"@nrk/core-toggle/jsx";import e,{useState as r}from"react";import{useAnimatedHeight as n}from"@fremtind/jkl-react-hooks";function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var c,i=t[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(o){var c=o.children,i=o.title,l=o.className,m=o.startExpanded,d=a(r(void 0!==m&&m),2),s=d[0],u=d[1],f=a(n(s),1)[0],p="jkl-accordion-item".concat(s?" jkl-accordion-item--expanded":"",l?" ".concat(l):"");return e.createElement("div",{"data-testid":"jkl-accordion-item",className:p},e.createElement("button",{className:"jkl-accordion-item__title",type:"button"},e.createElement("span",{className:"jkl-accordion-item__title-text"},i),e.createElement("span",{className:"jkl-accordion-item__title-icon"})),e.createElement(t,{ref:f,"data-testid":"jkl-accordion-item__content-wrapper",className:"jkl-accordion-item__content-wrapper",hidden:!s,onToggle:function(){return u(!s)}},e.createElement("div",{className:"jkl-accordion-item__content"},c)))}function c(t){var r=t.children,n=t.className,a=void 0===n?"":n;return e.createElement("div",{"data-testid":"jkl-accordion",className:"jkl-accordion ".concat(a)},r)}export{c as Accordion,o as AccordionItem}; |
@@ -57,2 +57,3 @@ 'use strict'; | ||
title = _ref.title, | ||
className = _ref.className, | ||
_ref$startExpanded = _ref.startExpanded, | ||
@@ -70,3 +71,3 @@ startExpanded = _ref$startExpanded === void 0 ? false : _ref$startExpanded; | ||
var openClassName = isOpen ? " jkl-accordion-item--expanded" : ""; | ||
var componentClassName = "jkl-accordion-item".concat(isOpen ? " jkl-accordion-item--expanded" : "", className ? " ".concat(className) : ""); | ||
@@ -79,3 +80,3 @@ var onToggle = function onToggle() { | ||
"data-testid": "jkl-accordion-item", | ||
className: "jkl-accordion-item".concat(openClassName) | ||
className: componentClassName | ||
}, React__default.createElement("button", { | ||
@@ -82,0 +83,0 @@ className: "jkl-accordion-item__title", |
@@ -50,2 +50,3 @@ import CoreToggle from '@nrk/core-toggle/jsx'; | ||
title = _ref.title, | ||
className = _ref.className, | ||
_ref$startExpanded = _ref.startExpanded, | ||
@@ -63,3 +64,3 @@ startExpanded = _ref$startExpanded === void 0 ? false : _ref$startExpanded; | ||
var openClassName = isOpen ? " jkl-accordion-item--expanded" : ""; | ||
var componentClassName = "jkl-accordion-item".concat(isOpen ? " jkl-accordion-item--expanded" : "", className ? " ".concat(className) : ""); | ||
@@ -72,3 +73,3 @@ var onToggle = function onToggle() { | ||
"data-testid": "jkl-accordion-item", | ||
className: "jkl-accordion-item".concat(openClassName) | ||
className: componentClassName | ||
}, React.createElement("button", { | ||
@@ -75,0 +76,0 @@ className: "jkl-accordion-item__title", |
@@ -1,1 +0,1 @@ | ||
import t from"@nrk/core-toggle/jsx";import e,{useState as r}from"react";import{useAnimatedHeight as n}from"@fremtind/jkl-react-hooks";function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var c,i=t[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(o){var c=o.children,i=o.title,l=o.startExpanded,d=a(r(void 0!==l&&l),2),m=d[0],s=d[1],u=a(n(m),1)[0],f=m?" jkl-accordion-item--expanded":"";return e.createElement("div",{"data-testid":"jkl-accordion-item",className:"jkl-accordion-item".concat(f)},e.createElement("button",{className:"jkl-accordion-item__title",type:"button"},e.createElement("span",{className:"jkl-accordion-item__title-text"},i),e.createElement("span",{className:"jkl-accordion-item__title-icon"})),e.createElement(t,{ref:u,"data-testid":"jkl-accordion-item__content-wrapper",className:"jkl-accordion-item__content-wrapper",hidden:!m,onToggle:function(){return s(!m)}},e.createElement("div",{className:"jkl-accordion-item__content"},c)))}function c(t){var r=t.children,n=t.className,a=void 0===n?"":n;return e.createElement("div",{"data-testid":"jkl-accordion",className:"jkl-accordion ".concat(a)},r)}export{c as Accordion,o as AccordionItem}; | ||
import t from"@nrk/core-toggle/jsx";import e,{useState as r}from"react";import{useAnimatedHeight as n}from"@fremtind/jkl-react-hooks";function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var c,i=t[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(o){var c=o.children,i=o.title,l=o.className,m=o.startExpanded,d=a(r(void 0!==m&&m),2),s=d[0],u=d[1],f=a(n(s),1)[0],p="jkl-accordion-item".concat(s?" jkl-accordion-item--expanded":"",l?" ".concat(l):"");return e.createElement("div",{"data-testid":"jkl-accordion-item",className:p},e.createElement("button",{className:"jkl-accordion-item__title",type:"button"},e.createElement("span",{className:"jkl-accordion-item__title-text"},i),e.createElement("span",{className:"jkl-accordion-item__title-icon"})),e.createElement(t,{ref:f,"data-testid":"jkl-accordion-item__content-wrapper",className:"jkl-accordion-item__content-wrapper",hidden:!s,onToggle:function(){return u(!s)}},e.createElement("div",{className:"jkl-accordion-item__content"},c)))}function c(t){var r=t.children,n=t.className,a=void 0===n?"":n;return e.createElement("div",{"data-testid":"jkl-accordion",className:"jkl-accordion ".concat(a)},r)}export{c as Accordion,o as AccordionItem}; |
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.1.0](https://github.com/fremtind/jokul/compare/@fremtind/jkl-accordion-react@1.0.0...@fremtind/jkl-accordion-react@1.1.0) (2019-12-10) | ||
### Features | ||
* **accordion-react:** add support for custom className on AccordionItem ([ae612ef](https://github.com/fremtind/jokul/commit/ae612ef1b95c80989b81b650dda926d749a0f0c9)) | ||
# [1.0.0](https://github.com/fremtind/jokul/compare/@fremtind/jkl-accordion-react@0.9.4...@fremtind/jkl-accordion-react@1.0.0) (2019-12-03) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@fremtind/jkl-accordion-react", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"publishConfig": { | ||
@@ -59,3 +59,3 @@ "access": "public" | ||
], | ||
"gitHead": "49884b65f0a87f0d71227ca55defeba80c6b0867" | ||
"gitHead": "6ad80e1275a1bf1068620bb2a9158cab975ff5fe" | ||
} |
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
23488
290