@bikdotai/bik-component-library 0.0.488-beta-3 → 0.0.488-beta-4

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -16,6 +16,7 @@ export declare enum ButtonTypes {
16
16
  DOUBLE = "DOUBLE"
17
17
  }
18
18
  export type StateComponentProps = {
19
+ headerImage?: string;
19
20
  states: StateInterface;
20
21
  heading: string;
21
22
  subline: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,s=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),a=require("../../assets/icons/warningIcon.svg.js"),c=require("../button/Button.js"),u=require("../spinner/Spinner.js"),l=require("../TypographyStyle.js"),d=require("./StateComponent.styled.js");exports.StateInterface=void 0,(e=exports.StateInterface||(exports.StateInterface={})).SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.LOADING="loading",exports.ButtonActions=void 0,(t=exports.ButtonActions||(exports.ButtonActions={})).CANCEL="cancel",t.OTHER="other",exports.ButtonTypes=void 0,(n=exports.ButtonTypes||(exports.ButtonTypes={})).SINGLE="SINGLE",n.DOUBLE="DOUBLE";exports.StateComponent=e=>{var t;const n=()=>x==exports.StateInterface.SUCCESS?s.jsx(i.default,{}):x==exports.StateInterface.WARNING?s.jsx(a.default,{}):x==exports.StateInterface.ERROR?s.jsx(o.default,{}):x===exports.StateInterface.LOADING?s.jsx(u.Spinner,{size:"large"}):void 0,{states:x,heading:p,subline:j,icon:S=n(),isButtonEnabled:y,type:h,buttonText:g,buttonType:B,onButtonClick:L,leadingIcon:C,width:I}=e;return s.jsxs(d.StateComponentContainer,Object.assign({width:I},{children:[s.jsx(d.StateIcon,{children:S}),s.jsxs(d.StateHeading,Object.assign({size:e.size},{children:["SMALL"===e.size&&s.jsx(l.TitleRegular,{children:p}),"SMALL"!==e.size&&s.jsx(l.TitleMedium,{children:p})]})),s.jsxs(d.StateSubline,{children:["SMALL"!==e.size&&s.jsx(l.BodyPrimary,Object.assign({color:r.COLORS.content.secondary},{children:j})),"SMALL"===e.size&&s.jsx(l.BodySecondary,Object.assign({color:r.COLORS.content.secondary},{children:j}))]}),null!==(t=e.children)&&void 0!==t?t:s.jsx(s.Fragment,{}),y&&s.jsx(s.Fragment,{children:s.jsxs(d.ButtonContainer,Object.assign({size:e.size},{children:[h==exports.ButtonTypes.DOUBLE&&s.jsx(c.Button,{onClick:()=>L&&L(exports.ButtonActions.CANCEL),buttonType:"secondary",buttonText:"Cancel",matchParentWidth:!0}),s.jsx(c.Button,{onClick:()=>L&&L(exports.ButtonActions.OTHER),buttonType:null!=B?B:"primary",LeadingIcon:C,buttonText:null!=g?g:"Retry",matchParentWidth:!0})]}))})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,s=require("react/jsx-runtime"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),a=require("../../assets/icons/warningIcon.svg.js"),c=require("../button/Button.js"),u=require("../spinner/Spinner.js"),d=require("../TypographyStyle.js"),l=require("./StateComponent.styled.js");exports.StateInterface=void 0,(e=exports.StateInterface||(exports.StateInterface={})).SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.LOADING="loading",exports.ButtonActions=void 0,(t=exports.ButtonActions||(exports.ButtonActions={})).CANCEL="cancel",t.OTHER="other",exports.ButtonTypes=void 0,(n=exports.ButtonTypes||(exports.ButtonTypes={})).SINGLE="SINGLE",n.DOUBLE="DOUBLE";exports.StateComponent=e=>{var t;const n=()=>x==exports.StateInterface.SUCCESS?s.jsx(i.default,{}):x==exports.StateInterface.WARNING?s.jsx(a.default,{}):x==exports.StateInterface.ERROR?s.jsx(o.default,{}):x===exports.StateInterface.LOADING?s.jsx(u.Spinner,{size:"large"}):void 0,{states:x,heading:p,subline:j,icon:S=n(),isButtonEnabled:h,type:g,buttonText:y,buttonType:B,onButtonClick:I,leadingIcon:L,width:C,headerImage:O}=e;return s.jsxs(l.StateComponentContainer,Object.assign({width:C},{children:[s.jsx(l.StateIcon,{children:O?s.jsx("img",{src:O,width:"100%",height:"auto",alt:""}):S}),s.jsxs(l.StateHeading,Object.assign({size:e.size},{children:["SMALL"===e.size&&s.jsx(d.TitleRegular,{children:p}),"SMALL"!==e.size&&s.jsx(d.TitleMedium,{children:p})]})),s.jsxs(l.StateSubline,{children:["SMALL"!==e.size&&s.jsx(d.BodyPrimary,Object.assign({color:r.COLORS.content.secondary},{children:j})),"SMALL"===e.size&&s.jsx(d.BodySecondary,Object.assign({color:r.COLORS.content.secondary},{children:j}))]}),null!==(t=e.children)&&void 0!==t?t:s.jsx(s.Fragment,{}),h&&s.jsx(s.Fragment,{children:s.jsxs(l.ButtonContainer,Object.assign({size:e.size},{children:[g==exports.ButtonTypes.DOUBLE&&s.jsx(c.Button,{onClick:()=>I&&I(exports.ButtonActions.CANCEL),buttonType:"secondary",buttonText:"Cancel",matchParentWidth:!0}),s.jsx(c.Button,{onClick:()=>I&&I(exports.ButtonActions.OTHER),buttonType:null!=B?B:"primary",LeadingIcon:L,buttonText:null!=y?y:"Retry",matchParentWidth:!0})]}))})]}))};
@@ -15,5 +15,6 @@ export type StateModalComponentProps = {
15
15
  width?: number;
16
16
  onClose?: () => void;
17
17
  zIndex?: number;
18
+ headerImage?: string;
18
19
  };
19
20
  export declare const StateModalComponent: React.FC<React.PropsWithChildren<StateModalComponentProps>>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/successIcon.svg.js"),o=require("../../assets/icons/warningIcon.svg.js"),r=require("../modals/styledModal.js"),a=require("../spinner/Spinner.js"),c=require("../states/StateComponent.js");exports.StateModalComponent=l=>{const d=()=>u==c.StateInterface.SUCCESS?e.jsx(i.default,{}):u==c.StateInterface.WARNING?e.jsx(o.default,{}):u==c.StateInterface.ERROR?e.jsx(s.default,{}):u===c.StateInterface.LOADING?e.jsx(a.Spinner,{size:"large"}):void 0,{states:u,heading:j,subline:I,icon:S=d(),isButtonEnabled:x,type:C,buttonText:p,onButtonClick:f,leadingIcon:g,width:O,zIndex:b}=l,[h,q]=t.useState(!0);return e.jsx(r.StyledModal,Object.assign({open:h,onClose:function(){l.onClose&&l.onClose(),q(!1)},closeOnOutsideClick:!(u===c.StateInterface.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:O},hideCrossButton:u===c.StateInterface.LOADING,zIndex:b||n.ComponentZindex.STATE_MODAL},{children:e.jsx(c.StateComponent,Object.assign({states:u,heading:j,subline:I,isButtonEnabled:x,leadingIcon:g,type:C,buttonText:p,onButtonClick:f,icon:S,width:O||400},{children:l.children}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../constants/zindex.js"),s=require("../../assets/icons/errorIcon.svg.js"),r=require("../../assets/icons/successIcon.svg.js"),a=require("../../assets/icons/warningIcon.svg.js"),i=require("../modals/styledModal.js"),o=require("../spinner/Spinner.js"),c=require("../states/StateComponent.js");exports.StateModalComponent=d=>{const l=()=>u==c.StateInterface.SUCCESS?e.jsx(r.default,{}):u==c.StateInterface.WARNING?e.jsx(a.default,{}):u==c.StateInterface.ERROR?e.jsx(s.default,{}):u===c.StateInterface.LOADING?e.jsx(o.Spinner,{size:"large"}):void 0,{states:u,heading:I,subline:j,icon:S=l(),isButtonEnabled:x,type:C,buttonText:g,onButtonClick:p,leadingIcon:f,width:h,zIndex:O,headerImage:b}=d,[m,q]=t.useState(!0);return e.jsx(i.StyledModal,Object.assign({open:m,onClose:function(){d.onClose&&d.onClose(),q(!1)},closeOnOutsideClick:!(u===c.StateInterface.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:h},hideCrossButton:u===c.StateInterface.LOADING,zIndex:O||n.ComponentZindex.STATE_MODAL},{children:e.jsx(c.StateComponent,Object.assign({states:u,heading:I,subline:j,isButtonEnabled:x,leadingIcon:f,type:C,buttonText:g,onButtonClick:p,icon:S,width:h||400,headerImage:b},{children:d.children}))}))};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -16,6 +16,7 @@ export declare enum ButtonTypes {
16
16
  DOUBLE = "DOUBLE"
17
17
  }
18
18
  export type StateComponentProps = {
19
+ headerImage?: string;
19
20
  states: StateInterface;
20
21
  heading: string;
21
22
  subline: string;
@@ -1 +1 @@
1
- import{jsxs as n,jsx as t,Fragment as e}from"react/jsx-runtime";import{COLORS as o}from"../../constants/Theme.js";import i from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import r from"../../assets/icons/warningIcon.svg.js";import{Button as c}from"../button/Button.js";import{Spinner as a}from"../spinner/Spinner.js";import{TitleRegular as l,TitleMedium as d,BodyPrimary as m,BodySecondary as h}from"../TypographyStyle.js";import{StateComponentContainer as u,StateIcon as p,StateHeading as L,StateSubline as g,ButtonContainer as S}from"./StateComponent.styled.js";var b,j,E;!function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.LOADING="loading"}(b||(b={})),function(n){n.CANCEL="cancel",n.OTHER="other"}(j||(j={})),function(n){n.SINGLE="SINGLE",n.DOUBLE="DOUBLE"}(E||(E={}));const O=O=>{var y;const C=()=>f==b.SUCCESS?t(s,{}):f==b.WARNING?t(r,{}):f==b.ERROR?t(i,{}):f===b.LOADING?t(a,{size:"large"}):void 0,{states:f,heading:I,subline:R,icon:A=C(),isButtonEnabled:N,type:T,buttonText:z,buttonType:v,onButtonClick:B,leadingIcon:G,width:x}=O;return n(u,Object.assign({width:x},{children:[t(p,{children:A}),n(L,Object.assign({size:O.size},{children:["SMALL"===O.size&&t(l,{children:I}),"SMALL"!==O.size&&t(d,{children:I})]})),n(g,{children:["SMALL"!==O.size&&t(m,Object.assign({color:o.content.secondary},{children:R})),"SMALL"===O.size&&t(h,Object.assign({color:o.content.secondary},{children:R}))]}),null!==(y=O.children)&&void 0!==y?y:t(e,{}),N&&t(e,{children:n(S,Object.assign({size:O.size},{children:[T==E.DOUBLE&&t(c,{onClick:()=>B&&B(j.CANCEL),buttonType:"secondary",buttonText:"Cancel",matchParentWidth:!0}),t(c,{onClick:()=>B&&B(j.OTHER),buttonType:null!=v?v:"primary",LeadingIcon:G,buttonText:null!=z?z:"Retry",matchParentWidth:!0})]}))})]}))};export{j as ButtonActions,E as ButtonTypes,O as StateComponent,b as StateInterface};
1
+ import{jsxs as n,jsx as t,Fragment as e}from"react/jsx-runtime";import{COLORS as o}from"../../constants/Theme.js";import i from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import r from"../../assets/icons/warningIcon.svg.js";import{Button as c}from"../button/Button.js";import{Spinner as a}from"../spinner/Spinner.js";import{TitleRegular as l,TitleMedium as d,BodyPrimary as m,BodySecondary as h}from"../TypographyStyle.js";import{StateComponentContainer as u,StateIcon as p,StateHeading as g,StateSubline as L,ButtonContainer as S}from"./StateComponent.styled.js";var b,j,E;!function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.LOADING="loading"}(b||(b={})),function(n){n.CANCEL="cancel",n.OTHER="other"}(j||(j={})),function(n){n.SINGLE="SINGLE",n.DOUBLE="DOUBLE"}(E||(E={}));const O=O=>{var y;const C=()=>f==b.SUCCESS?t(s,{}):f==b.WARNING?t(r,{}):f==b.ERROR?t(i,{}):f===b.LOADING?t(a,{size:"large"}):void 0,{states:f,heading:I,subline:R,icon:A=C(),isButtonEnabled:N,type:T,buttonText:z,buttonType:v,onButtonClick:B,leadingIcon:G,width:w,headerImage:x}=O;return n(u,Object.assign({width:w},{children:[t(p,{children:x?t("img",{src:x,width:"100%",height:"auto",alt:""}):A}),n(g,Object.assign({size:O.size},{children:["SMALL"===O.size&&t(l,{children:I}),"SMALL"!==O.size&&t(d,{children:I})]})),n(L,{children:["SMALL"!==O.size&&t(m,Object.assign({color:o.content.secondary},{children:R})),"SMALL"===O.size&&t(h,Object.assign({color:o.content.secondary},{children:R}))]}),null!==(y=O.children)&&void 0!==y?y:t(e,{}),N&&t(e,{children:n(S,Object.assign({size:O.size},{children:[T==E.DOUBLE&&t(c,{onClick:()=>B&&B(j.CANCEL),buttonType:"secondary",buttonText:"Cancel",matchParentWidth:!0}),t(c,{onClick:()=>B&&B(j.OTHER),buttonType:null!=v?v:"primary",LeadingIcon:G,buttonText:null!=z?z:"Retry",matchParentWidth:!0})]}))})]}))};export{j as ButtonActions,E as ButtonTypes,O as StateComponent,b as StateInterface};
@@ -15,5 +15,6 @@ export type StateModalComponentProps = {
15
15
  width?: number;
16
16
  onClose?: () => void;
17
17
  zIndex?: number;
18
+ headerImage?: string;
18
19
  };
19
20
  export declare const StateModalComponent: React.FC<React.PropsWithChildren<StateModalComponentProps>>;
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{ComponentZindex as o}from"../../constants/zindex.js";import s from"../../assets/icons/errorIcon.svg.js";import e from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as l}from"../states/StateComponent.js";const d=d=>{const m=()=>p==a.SUCCESS?t(e,{}):p==a.WARNING?t(i,{}):p==a.ERROR?t(s,{}):p===a.LOADING?t(c,{size:"large"}):void 0,{states:p,heading:u,subline:f,icon:g=m(),isButtonEnabled:C,type:I,buttonText:j,onButtonClick:h,leadingIcon:O,width:b,zIndex:x}=d,[S,y]=n(!0);return t(r,Object.assign({open:S,onClose:function(){d.onClose&&d.onClose(),y(!1)},closeOnOutsideClick:!(p===a.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:b},hideCrossButton:p===a.LOADING,zIndex:x||o.STATE_MODAL},{children:t(l,Object.assign({states:p,heading:u,subline:f,isButtonEnabled:C,leadingIcon:O,type:I,buttonText:j,onButtonClick:h,icon:g,width:b||400},{children:d.children}))}))};export{d as StateModalComponent};
1
+ import{jsx as t}from"react/jsx-runtime";import{useState as n}from"react";import{ComponentZindex as e}from"../../constants/zindex.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as a}from"../spinner/Spinner.js";import{StateInterface as c,StateComponent as l}from"../states/StateComponent.js";const d=d=>{const m=()=>p==c.SUCCESS?t(s,{}):p==c.WARNING?t(i,{}):p==c.ERROR?t(o,{}):p===c.LOADING?t(a,{size:"large"}):void 0,{states:p,heading:u,subline:g,icon:I=m(),isButtonEnabled:f,type:C,buttonText:h,onButtonClick:j,leadingIcon:O,width:b,zIndex:x,headerImage:S}=d,[y,A]=n(!0);return t(r,Object.assign({open:y,onClose:function(){d.onClose&&d.onClose(),A(!1)},closeOnOutsideClick:!(p===c.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:b},hideCrossButton:p===c.LOADING,zIndex:x||e.STATE_MODAL},{children:t(l,Object.assign({states:p,heading:u,subline:g,isButtonEnabled:f,leadingIcon:O,type:C,buttonText:h,onButtonClick:j,icon:I,width:b||400,headerImage:S},{children:d.children}))}))};export{d as StateModalComponent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.488-beta-3",
3
+ "version": "0.0.488-beta-4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",