@bikdotai/bik-component-library 0.0.722 → 0.0.723
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,s,n=require("../../node_modules/react/jsx-runtime.js"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/retryIcon.svg.js"),a=require("../../assets/icons/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,s,n=require("../../node_modules/react/jsx-runtime.js"),r=require("../../constants/Theme.js"),o=require("../../assets/icons/errorIcon.svg.js"),i=require("../../assets/icons/retryIcon.svg.js"),a=require("../../assets/icons/state_icon.svg.js"),x=require("../../assets/icons/successIcon.svg.js"),c=require("../../assets/icons/warningIcon.svg.js"),u=require("../button/Button.js"),p=require("../spinner/Spinner.js"),j=require("../TypographyStyle.js"),d=require("./StateComponent.styled.js");exports.StateInterface=void 0,(t=exports.StateInterface||(exports.StateInterface={})).SUCCESS="success",t.ERROR="error",t.WARNING="warning",t.LOADING="loading",t.RETRY="retry",t.INFO="info",exports.ButtonActions=void 0,(e=exports.ButtonActions||(exports.ButtonActions={})).CANCEL="cancel",e.OTHER="other",exports.ButtonTypes=void 0,(s=exports.ButtonTypes||(exports.ButtonTypes={})).SINGLE="SINGLE",s.DOUBLE="DOUBLE";exports.StateComponent=t=>{var e;const s=()=>l==exports.StateInterface.SUCCESS?n.jsxRuntimeExports.jsx(x.default,{}):l==exports.StateInterface.WARNING?n.jsxRuntimeExports.jsx(c.default,{}):l==exports.StateInterface.ERROR?n.jsxRuntimeExports.jsx(o.default,{}):l===exports.StateInterface.LOADING?n.jsxRuntimeExports.jsx(p.Spinner,{size:"large"}):l===exports.StateInterface.RETRY?n.jsxRuntimeExports.jsx(i.default,{}):l==exports.StateInterface.INFO?n.jsxRuntimeExports.jsx(a.default,{}):void 0,{states:l,heading:R,subline:m,errorText:E,icon:S=s(),isButtonEnabled:g,type:h,buttonText:y,buttonType:I,onButtonClick:O,leadingIcon:B,width:T,headerImage:L,iconWidth:C,iconHeight:b,closeButtonType:f,secondaryButtonText:A,"data-test":v}=t;return n.jsxRuntimeExports.jsxs(d.StateComponentContainer,Object.assign({width:T,"data-test":v},{children:[n.jsxRuntimeExports.jsx(d.StateIcon,Object.assign({iconWidth:C,iconHeight:b},{children:L?n.jsxRuntimeExports.jsx("img",{src:L,width:"100%",height:"auto",alt:""}):S})),n.jsxRuntimeExports.jsxs(d.StateHeading,Object.assign({size:t.size},{children:["SMALL"===t.size&&n.jsxRuntimeExports.jsx(j.TitleRegular,{children:R}),"SMALL"!==t.size&&n.jsxRuntimeExports.jsx(j.TitleMedium,{children:R})]})),n.jsxRuntimeExports.jsxs(d.StateSubline,{children:["SMALL"!==t.size&&n.jsxRuntimeExports.jsx(j.BodyPrimary,Object.assign({color:r.COLORS.content.secondary},{children:m})),"SMALL"===t.size&&n.jsxRuntimeExports.jsx(j.BodySecondary,Object.assign({color:r.COLORS.content.secondary},{children:m})),E&&n.jsxRuntimeExports.jsx(j.BodySecondary,Object.assign({color:r.COLORS.content.negative,style:{marginTop:8,whiteSpace:"pre-line"}},{children:E}))]}),null!==(e=t.children)&&void 0!==e?e:n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{}),g&&n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:n.jsxRuntimeExports.jsxs(d.ButtonContainer,Object.assign({size:t.size},{children:[h==exports.ButtonTypes.DOUBLE&&n.jsxRuntimeExports.jsx(u.Button,{"data-test":`${v}-cancel`,onClick:()=>O&&O(exports.ButtonActions.CANCEL),buttonType:f||"secondary",buttonText:A||"Cancel",matchParentWidth:!0}),n.jsxRuntimeExports.jsx(u.Button,{"data-test":`${v}-primary`,onClick:()=>O&&O(exports.ButtonActions.OTHER),buttonType:null!=I?I:"primary",LeadingIcon:B,buttonText:null!=y?y:"Retry",matchParentWidth:!0})]}))})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as t}from"../../node_modules/react/jsx-runtime.js";import{COLORS as s}from"../../constants/Theme.js";import e from"../../assets/icons/errorIcon.svg.js";import n from"../../assets/icons/retryIcon.svg.js";import o from"../../assets/icons/state_icon.svg.js";import i 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 j,TitleMedium as l,BodyPrimary as d,BodySecondary as m}from"../TypographyStyle.js";import{StateComponentContainer as h,StateIcon as g,StateHeading as x,StateSubline as p,ButtonContainer as u}from"./StateComponent.styled.js";var y,L,O;!function(t){t.SUCCESS="success",t.ERROR="error",t.WARNING="warning",t.LOADING="loading",t.RETRY="retry",t.INFO="info"}(y||(y={})),function(t){t.CANCEL="cancel",t.OTHER="other"}(L||(L={})),function(t){t.SINGLE="SINGLE",t.DOUBLE="DOUBLE"}(O||(O={}));const b=b=>{var E;const S=()=>T==y.SUCCESS?t.jsx(i,{}):T==y.WARNING?t.jsx(r,{}):T==y.ERROR?t.jsx(e,{}):T===y.LOADING?t.jsx(a,{size:"large"}):T===y.RETRY?t.jsx(n,{}):T==y.INFO?t.jsx(o,{}):void 0,{states:T,heading:f,subline:I,errorText:R,icon:C=S(),isButtonEnabled:N,type:v,buttonText:A,buttonType:z,onButtonClick:B,leadingIcon:w,width:G,headerImage:W,iconWidth:D,iconHeight:U,closeButtonType:F,secondaryButtonText:H,"data-test":M}=b;return t.jsxs(h,Object.assign({width:G,"data-test":M},{children:[t.jsx(g,Object.assign({iconWidth:D,iconHeight:U},{children:W?t.jsx("img",{src:W,width:"100%",height:"auto",alt:""}):C})),t.jsxs(x,Object.assign({size:b.size},{children:["SMALL"===b.size&&t.jsx(j,{children:f}),"SMALL"!==b.size&&t.jsx(l,{children:f})]})),t.jsxs(p,{children:["SMALL"!==b.size&&t.jsx(d,Object.assign({color:s.content.secondary},{children:I})),"SMALL"===b.size&&t.jsx(m,Object.assign({color:s.content.secondary},{children:I})),R&&t.jsx(m,Object.assign({color:s.content.negative,style:{marginTop:8,whiteSpace:"pre-line"}},{children:R}))]}),null!==(E=b.children)&&void 0!==E?E:t.jsx(t.Fragment,{}),N&&t.jsx(t.Fragment,{children:t.jsxs(u,Object.assign({size:b.size},{children:[v==O.DOUBLE&&t.jsx(c,{"data-test":`${M}-cancel`,onClick:()=>B&&B(L.CANCEL),buttonType:F||"secondary",buttonText:H||"Cancel",matchParentWidth:!0}),t.jsx(c,{"data-test":`${M}-primary`,onClick:()=>B&&B(L.OTHER),buttonType:null!=z?z:"primary",LeadingIcon:w,buttonText:null!=A?A:"Retry",matchParentWidth:!0})]}))})]}))};export{L as ButtonActions,O as ButtonTypes,b as StateComponent,y as StateInterface};
|