@bikdotai/bik-component-library 0.0.212-beta.4 → 0.0.212-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,5 +10,6 @@ export interface AccordionProps {
10
10
  headerPadding?: string;
11
11
  childrenPadding?: string;
12
12
  showBorders?: boolean;
13
+ backgroundColor?: string;
13
14
  }
14
15
  export declare const BikAccordion: React.FC<AccordionProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{const[o,a]=r.useState(!1),c=r.useRef(null),d=r.useRef(null),l=(e,r)=>{var t;d.current&&c.current&&("keydown"===r.type&&"Enter"!==r.key||(a(e),d.current.style.maxHeight?(d.current.style.maxHeight="",c.current.style.transform="rotate(0deg)",c.current.style.transition="transform 0.25s ease-in-out",d.current.style.padding="0",d.current.style.transition=" padding 0s"):(d.current.style.maxHeight=d.current.scrollHeight+"px",c.current.style.transform="rotate(180deg)",d.current.style.padding=null!==(t=s.childrenPadding)&&void 0!==t?t:"0px 24px 24px 24px",c.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return e.jsxs(n.default,Object.assign({className:"accordion",isActive:o,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(o?"active":""),onClick:e=>l(!o,e),onKeyDown:e=>l(!o,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,e.jsx(i.default,{isNewIcon:!1,ref:c})]})),s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{isNewIcon:!0,ref:c}),"string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation()},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:s.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:s.children}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../TypographyStyle.js"),n=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{const[o,a]=r.useState(!1),c=r.useRef(null),d=r.useRef(null),l=(e,r)=>{d.current&&c.current&&("keydown"===r.type&&"Enter"!==r.key||(a(e),d.current.style.maxHeight?(d.current.style.maxHeight="",c.current.style.transform="rotate(0deg)",c.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="padding 0s"):(d.current.style.maxHeight=d.current.scrollHeight+"px",c.current.style.transform="rotate(180deg)",c.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return e.jsxs(n.default,Object.assign({className:"accordion",isActive:o,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,backgroundColor:s.backgroundColor},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(o?"active":""),onClick:e=>l(!o,e),onKeyDown:e=>l(!o,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,e.jsx(i.default,{isNewIcon:!1,ref:c})]})),s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:[e.jsxs("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[e.jsx(i.default,{isNewIcon:!0,ref:c}),"string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation()},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:s.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:s.children}))]}))};
@@ -5,5 +5,6 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
5
5
  skipHoverState?: boolean | undefined;
6
6
  headerPadding?: string | undefined;
7
7
  showBorders?: boolean | undefined;
8
+ backgroundColor?: string | undefined;
8
9
  }, never>;
9
10
  export default AccordionStyle;
@@ -4,6 +4,7 @@
4
4
  flex-direction: column;
5
5
  border: ${e=>e.showBorders?"1px solid "+r.COLORS.stroke.primary:""};
6
6
  border-radius: ${e=>e.showBorders?"4px":""};
7
+ background: ${e=>e.backgroundColor||"transparent"};
7
8
  .accordion {
8
9
  &__overview {
9
10
  display: flex;
@@ -10,5 +10,6 @@ export interface AccordionProps {
10
10
  headerPadding?: string;
11
11
  childrenPadding?: string;
12
12
  showBorders?: boolean;
13
+ backgroundColor?: string;
13
14
  }
14
15
  export declare const BikAccordion: React.FC<AccordionProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t}from"react";import{TitleRegular as i,BodySecondary as o}from"../TypographyStyle.js";import c from"./Accordion.style.js";import a from"./AccordionArrow.js";const s=s=>{const[d,l]=n(!1),h=t(null),p=t(null),g=(e,r)=>{var n;p.current&&h.current&&("keydown"===r.type&&"Enter"!==r.key||(l(e),p.current.style.maxHeight?(p.current.style.maxHeight="",h.current.style.transform="rotate(0deg)",h.current.style.transition="transform 0.25s ease-in-out",p.current.style.padding="0",p.current.style.transition=" padding 0s"):(p.current.style.maxHeight=p.current.scrollHeight+"px",h.current.style.transform="rotate(180deg)",p.current.style.padding=null!==(n=s.childrenPadding)&&void 0!==n?n:"0px 24px 24px 24px",h.current.style.transition="transform 0.25s ease-in-out",p.current.style.transition="max-height 0.25s ease-in-out")))};return e(c,Object.assign({className:"accordion",isActive:d,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders},{children:[e("div",Object.assign({className:"accordion__overview "+(d?"active":""),onClick:e=>g(!d,e),onKeyDown:e=>g(!d,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof s.header?r(i,{children:null==s?void 0:s.header}):s.header,r(a,{isNewIcon:!1,ref:h})]})),s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(a,{isNewIcon:!0,ref:h}),"string"==typeof s.header?r(i,{children:null==s?void 0:s.header}):s.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation()},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(o,{children:s.caption})}))]})),r("div",Object.assign({ref:p,className:"accordion__content"},{children:s.children}))]}))};export{s as BikAccordion};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t}from"react";import{TitleRegular as o,BodySecondary as i}from"../TypographyStyle.js";import c from"./Accordion.style.js";import a from"./AccordionArrow.js";const s=s=>{const[d,l]=n(!1),h=t(null),g=t(null),m=(e,r)=>{g.current&&h.current&&("keydown"===r.type&&"Enter"!==r.key||(l(e),g.current.style.maxHeight?(g.current.style.maxHeight="",h.current.style.transform="rotate(0deg)",h.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="padding 0s"):(g.current.style.maxHeight=g.current.scrollHeight+"px",h.current.style.transform="rotate(180deg)",h.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="max-height 0.25s ease-in-out")))};return e(c,Object.assign({className:"accordion",isActive:d,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,backgroundColor:s.backgroundColor},{children:[e("div",Object.assign({className:"accordion__overview "+(d?"active":""),onClick:e=>m(!d,e),onKeyDown:e=>m(!d,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof s.header?r(o,{children:null==s?void 0:s.header}):s.header,r(a,{isNewIcon:!1,ref:h})]})),s.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(a,{isNewIcon:!0,ref:h}),"string"==typeof s.header?r(o,{children:null==s?void 0:s.header}):s.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation()},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(i,{children:s.caption})}))]})),r("div",Object.assign({ref:g,className:"accordion__content"},{children:s.children}))]}))};export{s as BikAccordion};
@@ -5,5 +5,6 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
5
5
  skipHoverState?: boolean | undefined;
6
6
  headerPadding?: string | undefined;
7
7
  showBorders?: boolean | undefined;
8
+ backgroundColor?: string | undefined;
8
9
  }, never>;
9
10
  export default AccordionStyle;
@@ -4,6 +4,7 @@ import e from"styled-components";import{COLORS as r}from"../../constants/Theme.j
4
4
  flex-direction: column;
5
5
  border: ${e=>e.showBorders?"1px solid "+r.stroke.primary:""};
6
6
  border-radius: ${e=>e.showBorders?"4px":""};
7
+ background: ${e=>e.backgroundColor||"transparent"};
7
8
  .accordion {
8
9
  &__overview {
9
10
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.212-beta.4",
3
+ "version": "0.0.212-beta.5",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",