@bikdotai/bik-component-library 0.0.265 → 0.0.266

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.
@@ -12,5 +12,6 @@ export interface AccordionProps {
12
12
  showBorders?: boolean;
13
13
  backgroundColor?: string;
14
14
  refresh?: number | boolean;
15
+ isInitiallyExpanded?: boolean;
15
16
  }
16
17
  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=o=>{var s;const[a,c]=r.useState(!1),l=r.useRef(null),d=r.useRef(null),u=(e,r)=>{d.current&&l.current&&("keydown"===r.type&&"Enter"!==r.key||(c(e),d.current.style.maxHeight?(d.current.style.maxHeight="",l.current.style.transform="rotate(0deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="padding 0s"):(d.current.style.maxHeight=d.current.scrollHeight+"px",l.current.style.transform="rotate(180deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return r.useEffect((()=>{var e;a&&(null==o?void 0:o.refresh)&&(null===(e=null==d?void 0:d.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{d.current.style.maxHeight=d.current.scrollHeight+"px"}),100)}),[a,null==o?void 0:o.refresh,null===(s=null==d?void 0:d.current)||void 0===s?void 0:s.scrollHeight]),e.jsxs(n.default,Object.assign({className:"accordion",isActive:a,width:null==o?void 0:o.width,contentMargin:null==o?void 0:o.contentMargin,headerPadding:o.headerPadding,skipHoverState:o.skipHoverHeader,showBorders:o.showBorders,backgroundColor:o.backgroundColor},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(a?"active":""),onClick:e=>u(!a,e),onKeyDown:e=>u(!a,e),role:"button",tabIndex:0},{children:[!o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header,e.jsx(i.default,{isNewIcon:!1,ref:l})]})),o.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:l}),"string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:o.rightActionComponent}))]})),(null==o?void 0:o.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:o.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:o.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=o=>{var s;const[a,c]=r.useState(!1),l=r.useRef(null),d=r.useRef(null),u=(e,r)=>{d.current&&l.current&&(r&&"keydown"===r.type&&"Enter"!==r.key||(c(e),d.current.style.maxHeight?(d.current.style.maxHeight="",l.current.style.transform="rotate(0deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="padding 0s"):(d.current.style.maxHeight=d.current.scrollHeight+"px",l.current.style.transform="rotate(180deg)",l.current.style.transition="transform 0.25s ease-in-out",d.current.style.transition="max-height 0.25s ease-in-out")))};return r.useEffect((()=>{o.isInitiallyExpanded&&u(!0,void 0)}),[o.isInitiallyExpanded]),r.useEffect((()=>{var e;a&&(null==o?void 0:o.refresh)&&(null===(e=null==d?void 0:d.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{d.current.style.maxHeight=d.current.scrollHeight+"px"}),100)}),[a,null==o?void 0:o.refresh,null===(s=null==d?void 0:d.current)||void 0===s?void 0:s.scrollHeight]),e.jsxs(n.default,Object.assign({className:"accordion",isActive:a,width:null==o?void 0:o.width,contentMargin:null==o?void 0:o.contentMargin,headerPadding:o.headerPadding,skipHoverState:o.skipHoverHeader,showBorders:o.showBorders,backgroundColor:o.backgroundColor},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(a?"active":""),onClick:e=>u(!a,e),onKeyDown:e=>u(!a,e),role:"button",tabIndex:0},{children:[!o.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header,e.jsx(i.default,{isNewIcon:!1,ref:l})]})),o.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:l}),"string"==typeof o.header?e.jsx(t.TitleRegular,{children:null==o?void 0:o.header}):o.header]})),e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:o.rightActionComponent}))]})),(null==o?void 0:o.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:o.caption})}))]})),e.jsx("div",Object.assign({ref:d,className:"accordion__content"},{children:o.children}))]}))};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
@@ -12,5 +12,6 @@ export interface AccordionProps {
12
12
  showBorders?: boolean;
13
13
  backgroundColor?: string;
14
14
  refresh?: number | boolean;
15
+ isInitiallyExpanded?: boolean;
15
16
  }
16
17
  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,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import a from"./Accordion.style.js";import s from"./AccordionArrow.js";const l=l=>{var d;const[h,u]=n(!1),v=t(null),g=t(null),m=(e,r)=>{g.current&&v.current&&("keydown"===r.type&&"Enter"!==r.key||(u(e),g.current.style.maxHeight?(g.current.style.maxHeight="",v.current.style.transform="rotate(0deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="padding 0s"):(g.current.style.maxHeight=g.current.scrollHeight+"px",v.current.style.transform="rotate(180deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="max-height 0.25s ease-in-out")))};return o((()=>{var e;h&&(null==l?void 0:l.refresh)&&(null===(e=null==g?void 0:g.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{g.current.style.maxHeight=g.current.scrollHeight+"px"}),100)}),[h,null==l?void 0:l.refresh,null===(d=null==g?void 0:g.current)||void 0===d?void 0:d.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:h,width:null==l?void 0:l.width,contentMargin:null==l?void 0:l.contentMargin,headerPadding:l.headerPadding,skipHoverState:l.skipHoverHeader,showBorders:l.showBorders,backgroundColor:l.backgroundColor},{children:[e("div",Object.assign({className:"accordion__overview "+(h?"active":""),onClick:e=>m(!h,e),onKeyDown:e=>m(!h,e),role:"button",tabIndex:0},{children:[!l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof l.header?r(i,{children:null==l?void 0:l.header}):l.header,r(s,{isNewIcon:!1,ref:v})]})),l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(s,{isNewIcon:!0,ref:v}),"string"==typeof l.header?r(i,{children:null==l?void 0:l.header}):l.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:l.rightActionComponent}))]})),(null==l?void 0:l.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:l.caption})}))]})),r("div",Object.assign({ref:g,className:"accordion__content"},{children:l.children}))]}))};export{l as BikAccordion};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t,useEffect as i}from"react";import{TitleRegular as o,BodySecondary as a}from"../TypographyStyle.js";import c from"./Accordion.style.js";import s from"./AccordionArrow.js";const l=l=>{var d;const[h,u]=n(!1),v=t(null),g=t(null),m=(e,r)=>{g.current&&v.current&&(r&&"keydown"===r.type&&"Enter"!==r.key||(u(e),g.current.style.maxHeight?(g.current.style.maxHeight="",v.current.style.transform="rotate(0deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="padding 0s"):(g.current.style.maxHeight=g.current.scrollHeight+"px",v.current.style.transform="rotate(180deg)",v.current.style.transition="transform 0.25s ease-in-out",g.current.style.transition="max-height 0.25s ease-in-out")))};return i((()=>{l.isInitiallyExpanded&&m(!0,void 0)}),[l.isInitiallyExpanded]),i((()=>{var e;h&&(null==l?void 0:l.refresh)&&(null===(e=null==g?void 0:g.current)||void 0===e?void 0:e.scrollHeight)&&setTimeout((()=>{g.current.style.maxHeight=g.current.scrollHeight+"px"}),100)}),[h,null==l?void 0:l.refresh,null===(d=null==g?void 0:g.current)||void 0===d?void 0:d.scrollHeight]),e(c,Object.assign({className:"accordion",isActive:h,width:null==l?void 0:l.width,contentMargin:null==l?void 0:l.contentMargin,headerPadding:l.headerPadding,skipHoverState:l.skipHoverHeader,showBorders:l.showBorders,backgroundColor:l.backgroundColor},{children:[e("div",Object.assign({className:"accordion__overview "+(h?"active":""),onClick:e=>m(!h,e),onKeyDown:e=>m(!h,e),role:"button",tabIndex:0},{children:[!l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:["string"==typeof l.header?r(o,{children:null==l?void 0:l.header}):l.header,r(s,{isNewIcon:!1,ref:v})]})),l.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(s,{isNewIcon:!0,ref:v}),"string"==typeof l.header?r(o,{children:null==l?void 0:l.header}):l.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:l.rightActionComponent}))]})),(null==l?void 0:l.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(a,{children:l.caption})}))]})),r("div",Object.assign({ref:g,className:"accordion__content"},{children:l.children}))]}))};export{l as BikAccordion};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const WorkingStepper: () => JSX.Element;
2
3
  export declare enum STEPENUM {
3
4
  STEP1 = "STEP1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.265",
3
+ "version": "0.0.266",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",