@bikdotai/bik-component-library 0.0.630-0 → 0.0.630

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.
Files changed (23) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/accordion/Accordion.d.ts +2 -1
  7. package/dist/cjs/components/accordion/Accordion.js +1 -1
  8. package/dist/cjs/components/accordion/Accordion.style.d.ts +2 -0
  9. package/dist/cjs/components/accordion/Accordion.style.js +6 -4
  10. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  11. package/dist/cjs/components/icon-button/model.d.ts +0 -1
  12. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  14. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  15. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  16. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  17. package/dist/esm/components/accordion/Accordion.d.ts +2 -1
  18. package/dist/esm/components/accordion/Accordion.js +1 -1
  19. package/dist/esm/components/accordion/Accordion.style.d.ts +2 -0
  20. package/dist/esm/components/accordion/Accordion.style.js +16 -14
  21. package/dist/esm/components/icon-button/IconButton.js +1 -1
  22. package/dist/esm/components/icon-button/model.d.ts +0 -1
  23. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -8,7 +8,6 @@ export interface AccordionProps {
8
8
  contentMargin?: string;
9
9
  skipHoverHeader?: boolean;
10
10
  headerPadding?: string;
11
- childrenPadding?: string;
12
11
  showBorders?: boolean;
13
12
  backgroundColor?: string;
14
13
  refresh?: number | boolean;
@@ -22,5 +21,7 @@ export interface AccordionProps {
22
21
  buttonLinkText?: string;
23
22
  onButtonLinkClick?: () => void;
24
23
  captionStyle?: React.CSSProperties;
24
+ borderColor?: string;
25
+ borderRadius?: string;
25
26
  }
26
27
  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("../button/Button.js"),o=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{var c,a;const[l,d]=r.useState(!1),u=r.useRef(null),h=r.useRef(null);r.useEffect((()=>{s.autoOpen&&v(s.autoOpen,{})}),[s.autoOpen]),r.useEffect((()=>{void 0!==s.isOpen&&v(s.isOpen,{})}),[s.isOpen]);const v=(e,r)=>{var t,n;h.current&&u.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==l&&d(e),e?(h.current.style.maxHeight=(null!==(t=s.childrenMaxHeight)&&void 0!==t?t:h.current.scrollHeight)+"px",u.current.style.transform="rotate(180deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="max-height 0.25s ease-in-out"):(h.current.style.maxHeight="",u.current.style.transform="rotate(0deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="padding 0s"),null===(n=s.onToggleAccordion)||void 0===n||n.call(s,e)))};return r.useEffect((()=>{const e=new MutationObserver((()=>{l&&h.current&&(h.current.style.maxHeight=h.current.scrollHeight+"px")}));return h.current&&e.observe(h.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[l]),r.useEffect((()=>{var e;l&&(null==s?void 0:s.refresh)&&(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.scrollHeight)&&!s.childrenMaxHeight&&setTimeout((()=>{h.current.style.maxHeight=h.current.scrollHeight+"px"}),100)}),[l,null==s?void 0:s.refresh,null===(c=null==h?void 0:h.current)||void 0===c?void 0:c.scrollHeight]),e.jsxs(o.default,Object.assign({className:"accordion",isActive:l,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,openDirection:s.openDirection},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(l?"active":""),onClick:e=>v(!l,e),onKeyDown:e=>v(!l,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header",style:null!==(a=s.headerStyles)&&void 0!==a?a:{}},{children:[e.jsxs(o.AccordionHeaderGroup,{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,s.buttonLinkText&&e.jsx(n.Button,{buttonText:s.buttonLinkText,buttonType:"text",darkMode:!0,onClick:s.onButtonLinkClick})]}),e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u})]})),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,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u}),"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(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:e.jsx("div",Object.assign({style:s.captionStyle},{children:s.caption}))})}))]})),e.jsx("div",Object.assign({ref:h,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("../button/Button.js"),o=require("./Accordion.style.js"),i=require("./AccordionArrow.js");exports.BikAccordion=s=>{var c,a;const[l,d]=r.useState(!1),u=r.useRef(null),h=r.useRef(null);r.useEffect((()=>{s.autoOpen&&v(s.autoOpen,{})}),[s.autoOpen]),r.useEffect((()=>{void 0!==s.isOpen&&v(s.isOpen,{})}),[s.isOpen]);const v=(e,r)=>{var t,n;h.current&&u.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==l&&d(e),e?(h.current.style.maxHeight=(null!==(t=s.childrenMaxHeight)&&void 0!==t?t:h.current.scrollHeight)+"px",u.current.style.transform="rotate(180deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="max-height 0.25s ease-in-out"):(h.current.style.maxHeight="",u.current.style.transform="rotate(0deg)",u.current.style.transition="transform 0.25s ease-in-out",h.current.style.transition="padding 0s"),null===(n=s.onToggleAccordion)||void 0===n||n.call(s,e)))};return r.useEffect((()=>{const e=new MutationObserver((()=>{l&&h.current&&(h.current.style.maxHeight=h.current.scrollHeight+"px")}));return h.current&&e.observe(h.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[l]),r.useEffect((()=>{var e;l&&(null==s?void 0:s.refresh)&&(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.scrollHeight)&&!s.childrenMaxHeight&&setTimeout((()=>{h.current.style.maxHeight=h.current.scrollHeight+"px"}),100)}),[l,null==s?void 0:s.refresh,null===(c=null==h?void 0:h.current)||void 0===c?void 0:c.scrollHeight]),e.jsxs(o.default,Object.assign({className:"accordion",isActive:l,width:null==s?void 0:s.width,contentMargin:null==s?void 0:s.contentMargin,headerPadding:s.headerPadding,skipHoverState:s.skipHoverHeader,showBorders:s.showBorders,borderColor:s.borderColor,backgroundColor:s.backgroundColor,openDirection:s.openDirection,borderRadius:s.borderRadius},{children:[e.jsxs("div",Object.assign({className:"accordion__overview "+(l?"active":""),onClick:e=>v(!l,e),onKeyDown:e=>v(!l,e),role:"button",tabIndex:0},{children:[!s.rightActionComponent&&e.jsxs("div",Object.assign({className:"accordion__overview__header",style:null!==(a=s.headerStyles)&&void 0!==a?a:{}},{children:[e.jsxs(o.AccordionHeaderGroup,{children:["string"==typeof s.header?e.jsx(t.TitleRegular,{children:null==s?void 0:s.header}):s.header,s.buttonLinkText&&e.jsx(n.Button,{buttonText:s.buttonLinkText,buttonType:"text",darkMode:!0,onClick:s.onButtonLinkClick})]}),e.jsx(i.default,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u})]})),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,{arrowColor:s.arrowColor,isNewIcon:!0,ref:u}),"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(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:s.rightActionComponent}))]})),(null==s?void 0:s.caption)&&e.jsx("div",Object.assign({className:"accordion__overview__caption"},{children:e.jsx(t.BodySecondary,{children:e.jsx("div",Object.assign({style:s.captionStyle},{children:s.caption}))})}))]})),e.jsx("div",Object.assign({ref:h,className:"accordion__content"},{children:s.children}))]}))};
@@ -6,6 +6,8 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
6
6
  skipHoverState?: boolean | undefined;
7
7
  headerPadding?: string | undefined;
8
8
  showBorders?: boolean | undefined;
9
+ borderColor?: string | undefined;
10
+ borderRadius?: string | undefined;
9
11
  backgroundColor?: string | undefined;
10
12
  hasChildrenMaxHeight?: boolean | undefined;
11
13
  openDirection?: AccordionProps['openDirection'];
@@ -1,9 +1,10 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const d=i.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=o(e);const i=d.default.div`
2
2
  width: ${e=>(null==e?void 0:e.width)||"100%"};
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  border: ${e=>e.showBorders?"1px solid "+r.COLORS.stroke.primary:""};
6
- border-radius: ${e=>e.showBorders?"4px":""};
6
+ border-color: ${e=>e.borderColor||r.COLORS.stroke.primary};
7
+ border-radius: ${e=>e.borderRadius?e.borderRadius:e.showBorders?"4px":""};
7
8
  background: ${e=>e.backgroundColor||"unset"};
8
9
  .accordion {
9
10
  &__overview {
@@ -12,6 +13,7 @@
12
13
  gap: 4px;
13
14
  padding: ${e=>e.headerPadding?e.headerPadding:"24px"};
14
15
  border-bottom: ${e=>e.showBorders&&e.isActive?"1px solid "+r.COLORS.stroke.primary:""};
16
+ border-color: ${e=>e.borderColor||r.COLORS.stroke.primary};
15
17
  &__header {
16
18
  display: flex;
17
19
  flex-direction: row;
@@ -34,8 +36,8 @@
34
36
  order: ${e=>"UP"===e.openDirection?-1:0};
35
37
  }
36
38
  }
37
- `,t=i.default.div`
39
+ `,t=d.default.div`
38
40
  display: flex;
39
41
  align-items: center;
40
42
  gap: 24px;
41
- `;exports.AccordionHeaderGroup=t,exports.default=d;
43
+ `;exports.AccordionHeaderGroup=t,exports.default=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),o=require("react"),i=require("../tooltips/Tooltip.js"),r=require("./IconButton.styled.js"),l=require("./theme.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=s(o);const n=o.forwardRef(((o,s)=>{var{id:n,iconButtonType:c="default",Icon:a,height:u=20,width:b=20,bordered:y,disabled:p,isSelected:j,style:h,svgStyle:f,iconColor:g,disabledTooltip:v}=o,B=e.__rest(o,["id","iconButtonType","Icon","height","width","bordered","disabled","isSelected","style","svgStyle","iconColor","disabledTooltip"]);const I=l.getIconColor(c,p,j),T=t.jsx(r.IconButton,Object.assign({id:n,ref:s,style:h,iconButtonType:c,bordered:y,disabled:p,isSelected:j},B,{children:d.default.createElement(a,{height:u,width:b,color:g||I,style:Object.assign({display:"block"},null!=f?f:{})})}));return p&&v?t.jsx(i.Tooltip,Object.assign({body:v},{children:t.jsx("span",Object.assign({style:{display:"inline-block",cursor:"not-allowed"}},{children:T}))})):T}));n.displayName="IconButton",exports.IconButton=n;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),o=require("./IconButton.styled.js"),i=require("./theme.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(r);const d=r.forwardRef(((r,n)=>{var{id:d,iconButtonType:l="default",Icon:c,height:u=20,width:a=20,bordered:y,disabled:b,isSelected:h,style:f,svgStyle:j,iconColor:p}=r,g=e.__rest(r,["id","iconButtonType","Icon","height","width","bordered","disabled","isSelected","style","svgStyle","iconColor"]);const v=i.getIconColor(l,b,h);return t.jsx(o.IconButton,Object.assign({id:d,ref:n,style:f,iconButtonType:l,bordered:y,disabled:b,isSelected:h},g,{children:s.default.createElement(c,{height:u,width:a,color:p||v,style:Object.assign({display:"block"},null!=j?j:{})})}))}));d.displayName="IconButton",exports.IconButton=d;
@@ -40,5 +40,4 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
40
40
  */
41
41
  isSelected?: boolean;
42
42
  iconColor?: string;
43
- disabledTooltip?: string;
44
43
  }
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -8,7 +8,6 @@ export interface AccordionProps {
8
8
  contentMargin?: string;
9
9
  skipHoverHeader?: boolean;
10
10
  headerPadding?: string;
11
- childrenPadding?: string;
12
11
  showBorders?: boolean;
13
12
  backgroundColor?: string;
14
13
  refresh?: number | boolean;
@@ -22,5 +21,7 @@ export interface AccordionProps {
22
21
  buttonLinkText?: string;
23
22
  onButtonLinkClick?: () => void;
24
23
  captionStyle?: React.CSSProperties;
24
+ borderColor?: string;
25
+ borderRadius?: string;
25
26
  }
26
27
  export declare const BikAccordion: React.FC<AccordionProps>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as t,useRef as n,useEffect as o}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import{Button as s}from"../button/Button.js";import a,{AccordionHeaderGroup as l}from"./Accordion.style.js";import d from"./AccordionArrow.js";const u=u=>{var h,v;const[g,p]=t(!1),m=n(null),y=n(null);o((()=>{u.autoOpen&&b(u.autoOpen,{})}),[u.autoOpen]),o((()=>{void 0!==u.isOpen&&b(u.isOpen,{})}),[u.isOpen]);const b=(e,r)=>{var t,n;y.current&&m.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==g&&p(e),e?(y.current.style.maxHeight=(null!==(t=u.childrenMaxHeight)&&void 0!==t?t:y.current.scrollHeight)+"px",m.current.style.transform="rotate(180deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="max-height 0.25s ease-in-out"):(y.current.style.maxHeight="",m.current.style.transform="rotate(0deg)",m.current.style.transition="transform 0.25s ease-in-out",y.current.style.transition="padding 0s"),null===(n=u.onToggleAccordion)||void 0===n||n.call(u,e)))};return o((()=>{const e=new MutationObserver((()=>{g&&y.current&&(y.current.style.maxHeight=y.current.scrollHeight+"px")}));return y.current&&e.observe(y.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[g]),o((()=>{var e;g&&(null==u?void 0:u.refresh)&&(null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.scrollHeight)&&!u.childrenMaxHeight&&setTimeout((()=>{y.current.style.maxHeight=y.current.scrollHeight+"px"}),100)}),[g,null==u?void 0:u.refresh,null===(h=null==y?void 0:y.current)||void 0===h?void 0:h.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:g,width:null==u?void 0:u.width,contentMargin:null==u?void 0:u.contentMargin,headerPadding:u.headerPadding,skipHoverState:u.skipHoverHeader,showBorders:u.showBorders,backgroundColor:u.backgroundColor,openDirection:u.openDirection},{children:[e("div",Object.assign({className:"accordion__overview "+(g?"active":""),onClick:e=>b(!g,e),onKeyDown:e=>b(!g,e),role:"button",tabIndex:0},{children:[!u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header",style:null!==(v=u.headerStyles)&&void 0!==v?v:{}},{children:[e(l,{children:["string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header,u.buttonLinkText&&r(s,{buttonText:u.buttonLinkText,buttonType:"text",darkMode:!0,onClick:u.onButtonLinkClick})]}),r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m})]})),u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m}),"string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:u.rightActionComponent}))]})),(null==u?void 0:u.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:r("div",Object.assign({style:u.captionStyle},{children:u.caption}))})}))]})),r("div",Object.assign({ref:y,className:"accordion__content"},{children:u.children}))]}))};export{u as BikAccordion};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useState as o,useRef as t,useEffect as n}from"react";import{TitleRegular as i,BodySecondary as c}from"../TypographyStyle.js";import{Button as s}from"../button/Button.js";import a,{AccordionHeaderGroup as l}from"./Accordion.style.js";import d from"./AccordionArrow.js";const u=u=>{var h,v;const[g,p]=o(!1),m=t(null),b=t(null);n((()=>{u.autoOpen&&y(u.autoOpen,{})}),[u.autoOpen]),n((()=>{void 0!==u.isOpen&&y(u.isOpen,{})}),[u.isOpen]);const y=(e,r)=>{var o,t;b.current&&m.current&&("keydown"===r.type&&"Enter"!==r.key||(e!==g&&p(e),e?(b.current.style.maxHeight=(null!==(o=u.childrenMaxHeight)&&void 0!==o?o:b.current.scrollHeight)+"px",m.current.style.transform="rotate(180deg)",m.current.style.transition="transform 0.25s ease-in-out",b.current.style.transition="max-height 0.25s ease-in-out"):(b.current.style.maxHeight="",m.current.style.transform="rotate(0deg)",m.current.style.transition="transform 0.25s ease-in-out",b.current.style.transition="padding 0s"),null===(t=u.onToggleAccordion)||void 0===t||t.call(u,e)))};return n((()=>{const e=new MutationObserver((()=>{g&&b.current&&(b.current.style.maxHeight=b.current.scrollHeight+"px")}));return b.current&&e.observe(b.current,{childList:!0,subtree:!0}),()=>{e.disconnect()}}),[g]),n((()=>{var e;g&&(null==u?void 0:u.refresh)&&(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.scrollHeight)&&!u.childrenMaxHeight&&setTimeout((()=>{b.current.style.maxHeight=b.current.scrollHeight+"px"}),100)}),[g,null==u?void 0:u.refresh,null===(h=null==b?void 0:b.current)||void 0===h?void 0:h.scrollHeight]),e(a,Object.assign({className:"accordion",isActive:g,width:null==u?void 0:u.width,contentMargin:null==u?void 0:u.contentMargin,headerPadding:u.headerPadding,skipHoverState:u.skipHoverHeader,showBorders:u.showBorders,borderColor:u.borderColor,backgroundColor:u.backgroundColor,openDirection:u.openDirection,borderRadius:u.borderRadius},{children:[e("div",Object.assign({className:"accordion__overview "+(g?"active":""),onClick:e=>y(!g,e),onKeyDown:e=>y(!g,e),role:"button",tabIndex:0},{children:[!u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header",style:null!==(v=u.headerStyles)&&void 0!==v?v:{}},{children:[e(l,{children:["string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header,u.buttonLinkText&&r(s,{buttonText:u.buttonLinkText,buttonType:"text",darkMode:!0,onClick:u.onButtonLinkClick})]}),r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m})]})),u.rightActionComponent&&e("div",Object.assign({className:"accordion__overview__header"},{children:[e("div",Object.assign({className:"accordion__overview__title-wrapper"},{children:[r(d,{arrowColor:u.arrowColor,isNewIcon:!0,ref:m}),"string"==typeof u.header?r(i,{children:null==u?void 0:u.header}):u.header]})),r("div",Object.assign({onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key&&e.stopPropagation()},role:"button",tabIndex:0},{children:u.rightActionComponent}))]})),(null==u?void 0:u.caption)&&r("div",Object.assign({className:"accordion__overview__caption"},{children:r(c,{children:r("div",Object.assign({style:u.captionStyle},{children:u.caption}))})}))]})),r("div",Object.assign({ref:b,className:"accordion__content"},{children:u.children}))]}))};export{u as BikAccordion};
@@ -6,6 +6,8 @@ declare const AccordionStyle: import("styled-components").StyledComponent<"div",
6
6
  skipHoverState?: boolean | undefined;
7
7
  headerPadding?: string | undefined;
8
8
  showBorders?: boolean | undefined;
9
+ borderColor?: string | undefined;
10
+ borderRadius?: string | undefined;
9
11
  backgroundColor?: string | undefined;
10
12
  hasChildrenMaxHeight?: boolean | undefined;
11
13
  openDirection?: AccordionProps['openDirection'];
@@ -1,17 +1,19 @@
1
- import e from"styled-components";import{COLORS as r}from"../../constants/Theme.js";const o=e.div`
2
- width: ${e=>(null==e?void 0:e.width)||"100%"};
1
+ import r from"styled-components";import{COLORS as e}from"../../constants/Theme.js";const o=r.div`
2
+ width: ${r=>(null==r?void 0:r.width)||"100%"};
3
3
  display: flex;
4
4
  flex-direction: column;
5
- border: ${e=>e.showBorders?"1px solid "+r.stroke.primary:""};
6
- border-radius: ${e=>e.showBorders?"4px":""};
7
- background: ${e=>e.backgroundColor||"unset"};
5
+ border: ${r=>r.showBorders?"1px solid "+e.stroke.primary:""};
6
+ border-color: ${r=>r.borderColor||e.stroke.primary};
7
+ border-radius: ${r=>r.borderRadius?r.borderRadius:r.showBorders?"4px":""};
8
+ background: ${r=>r.backgroundColor||"unset"};
8
9
  .accordion {
9
10
  &__overview {
10
11
  display: flex;
11
12
  flex-direction: column;
12
13
  gap: 4px;
13
- padding: ${e=>e.headerPadding?e.headerPadding:"24px"};
14
- border-bottom: ${e=>e.showBorders&&e.isActive?"1px solid "+r.stroke.primary:""};
14
+ padding: ${r=>r.headerPadding?r.headerPadding:"24px"};
15
+ border-bottom: ${r=>r.showBorders&&r.isActive?"1px solid "+e.stroke.primary:""};
16
+ border-color: ${r=>r.borderColor||e.stroke.primary};
15
17
  &__header {
16
18
  display: flex;
17
19
  flex-direction: row;
@@ -23,19 +25,19 @@ import e from"styled-components";import{COLORS as r}from"../../constants/Theme.j
23
25
  gap: 8px;
24
26
  }
25
27
  :hover {
26
- background: ${e=>e.skipHoverState?null:r.surface.subdued};
27
- border-radius: ${e=>e.skipHoverState?null:"4px"};
28
+ background: ${r=>r.skipHoverState?null:e.surface.subdued};
29
+ border-radius: ${r=>r.skipHoverState?null:"4px"};
28
30
  }
29
31
  }
30
32
  &__content {
31
- ${e=>e.isActive?{margin:(null==e?void 0:e.contentMargin)||"0px"}:{}};
32
- overflow: ${e=>e.hasChildrenMaxHeight?"scroll":"hidden"};
33
+ ${r=>r.isActive?{margin:(null==r?void 0:r.contentMargin)||"0px"}:{}};
34
+ overflow: ${r=>r.hasChildrenMaxHeight?"scroll":"hidden"};
33
35
  max-height: 0;
34
- order: ${e=>"UP"===e.openDirection?-1:0};
36
+ order: ${r=>"UP"===r.openDirection?-1:0};
35
37
  }
36
38
  }
37
- `,i=e.div`
39
+ `,d=r.div`
38
40
  display: flex;
39
41
  align-items: center;
40
42
  gap: 24px;
41
- `;export{i as AccordionHeaderGroup,o as default};
43
+ `;export{d as AccordionHeaderGroup,o as default};
@@ -1 +1 @@
1
- import{__rest as t}from"../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import o,{forwardRef as i}from"react";import{Tooltip as l}from"../tooltips/Tooltip.js";import{IconButton as s}from"./IconButton.styled.js";import{getIconColor as r}from"./theme.js";const d=i(((i,d)=>{var{id:n,iconButtonType:c="default",Icon:a,height:p=20,width:b=20,bordered:m,disabled:y,isSelected:h,style:u,svgStyle:g,iconColor:j,disabledTooltip:f}=i,B=t(i,["id","iconButtonType","Icon","height","width","bordered","disabled","isSelected","style","svgStyle","iconColor","disabledTooltip"]);const T=r(c,y,h),I=e(s,Object.assign({id:n,ref:d,style:u,iconButtonType:c,bordered:m,disabled:y,isSelected:h},B,{children:o.createElement(a,{height:p,width:b,color:j||T,style:Object.assign({display:"block"},null!=g?g:{})})}));return y&&f?e(l,Object.assign({body:f},{children:e("span",Object.assign({style:{display:"inline-block",cursor:"not-allowed"}},{children:I}))})):I}));d.displayName="IconButton";export{d as IconButton};
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import o,{forwardRef as i}from"react";import{IconButton as r}from"./IconButton.styled.js";import{getIconColor as s}from"./theme.js";const d=i(((i,d)=>{var{id:l,iconButtonType:n="default",Icon:c,height:a=20,width:m=20,bordered:y,disabled:h,isSelected:p,style:u,svgStyle:b,iconColor:f}=i,g=e(i,["id","iconButtonType","Icon","height","width","bordered","disabled","isSelected","style","svgStyle","iconColor"]);const j=s(n,h,p);return t(r,Object.assign({id:l,ref:d,style:u,iconButtonType:n,bordered:y,disabled:h,isSelected:p},g,{children:o.createElement(c,{height:a,width:m,color:f||j,style:Object.assign({display:"block"},null!=b?b:{})})}))}));d.displayName="IconButton";export{d as IconButton};
@@ -40,5 +40,4 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
40
40
  */
41
41
  isSelected?: boolean;
42
42
  iconColor?: string;
43
- disabledTooltip?: string;
44
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.630-0",
3
+ "version": "0.0.630",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",