@bikdotai/bik-component-library 0.0.605 → 0.0.607
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.
- package/dist/cjs/components/searchBar/searchBar.d.ts +1 -0
- package/dist/cjs/components/searchBar/searchBar.js +1 -1
- package/dist/cjs/components/tabs/Tabs.js +1 -1
- package/dist/cjs/components/tabs/Tabs.model.d.ts +2 -0
- package/dist/esm/components/searchBar/searchBar.d.ts +1 -0
- package/dist/esm/components/searchBar/searchBar.js +1 -1
- package/dist/esm/components/tabs/Tabs.js +1 -1
- package/dist/esm/components/tabs/Tabs.model.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/searchIcon.js"),s=require("react"),a=require("../../assets/icons/cross.svg.js"),r=require("../input/Input.js");exports.SearchBar=n=>{const{isEnabled:o,onEnter:c,placeholder:i,width:l,variant:u,validate:d,isActive:h}=n,[v,f]=s.useState("search"),[p,g]=s.useState("default"),[b,x]=s.useState(h?"active":o?"none":"disabled"),[C,j]=s.useState(n.initialValue||n.searchValue||"");s.useEffect((()=>{var e,t,s;j(null!==(e=n.searchValue)&&void 0!==e?e:""),(null===(s=null===(t=n.searchValue)||void 0===t?void 0:t.trim())||void 0===s?void 0:s.length)?f("cross"):f("search")}),[n.searchValue]),s.useEffect((()=>{x(h?"active":o?"none":"disabled")}),[o,h]),s.useEffect((()=>{n.reset&&I()}),[null==n?void 0:n.reset]);const k=e=>{o&&c(e)},I=()=>{f("search"),g("default"),j(""),n.onChange(""),x("none"),c("")};return e.jsx(r.Input,{id:"search-bar",validate:d,onFocus:()=>{C.length&&f("cross"),"default"===p&&o&&(g("clicked"),x("active"))},width:l,state:b,leftIcon:"search"===v&&"default"===p?{icon:t.SearchIcon}:void 0,rightIcon:"cross"!==v||n.suffixButton?void 0:{icon:a.default,callback:()=>{I(),n.onClickCross&&n.onClickCross()}},onChangeText:(e,t)=>{n.onChange(e),j(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?f("cross"):f("search"):k(e)},placeholder:i,variant:u,value:C,onBlur:()=>{C.length||g("default"),x("none")},button:{text:"",buttonProps:n.suffixButton}})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/searchIcon.js"),s=require("react"),a=require("../../assets/icons/cross.svg.js"),r=require("../input/Input.js");exports.SearchBar=n=>{const{isEnabled:o,onEnter:c,placeholder:i,width:l,variant:u,validate:d,isActive:h}=n,[v,f]=s.useState("search"),[p,g]=s.useState("default"),[b,x]=s.useState(h?"active":o?"none":"disabled"),[C,j]=s.useState(n.initialValue||n.searchValue||"");s.useEffect((()=>{var e,t,s;j(null!==(e=n.searchValue)&&void 0!==e?e:""),(null===(s=null===(t=n.searchValue)||void 0===t?void 0:t.trim())||void 0===s?void 0:s.length)?f("cross"):f("search")}),[n.searchValue]),s.useEffect((()=>{x(h?"active":o?"none":"disabled")}),[o,h]),s.useEffect((()=>{n.reset&&I()}),[null==n?void 0:n.reset]);const k=e=>{o&&c(e)},I=()=>{f("search"),g("default"),j(""),n.onChange(""),x("none"),c("")};return e.jsx(r.Input,{"data-test":n["data-test"],id:"search-bar",validate:d,onFocus:()=>{C.length&&f("cross"),"default"===p&&o&&(g("clicked"),x("active"))},width:l,state:b,leftIcon:"search"===v&&"default"===p?{icon:t.SearchIcon}:void 0,rightIcon:"cross"!==v||n.suffixButton?void 0:{icon:a.default,callback:()=>{I(),n.onClickCross&&n.onClickCross()}},onChangeText:(e,t)=>{n.onChange(e),j(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?f("cross"):f("search"):k(e)},placeholder:i,variant:u,value:C,onBlur:()=>{C.length||g("default"),x("none")},button:{text:"",buttonProps:n.suffixButton}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../constants/Theme.js"),a=require("../TypographyStyle.js"),r=require("./Tabs.styles.js");const n=a=>{var n,l;const{tabs:i,initialTab:c,onTabSelected:d,TabItemStyledProps:b,selectedTab:u,extendedBorder:p,rightComponent:x,size:T="default",isSquared:m=!1,containerStyles:g}=a,[y,C]=t.useState(c||i[0].key),{colorsV2:j}=s.DEFAULT_THEME;t.useEffect((()=>{u&&u!==y&&C(u)}),[u,y]);const S=a.backgroundColor,h=null!==(n=a.selectedTextColor)&&void 0!==n?n:j.background.brand,q=null!==(l=a.textColor)&&void 0!==l?l:j.content.secondary;return e.jsxs(r.TabHeader,Object.assign({style:null!=g?g:{},bgColor:S,"data-test":a["data-test"]},{children:[i.map(((t,s)=>e.jsx(o,{hasEqualSpacing:a.hasEqualSpacing,selectedTextColor:h,textColor:q,tab:t,currentTab:y,TabItemStyledProps:b,IconComponent:t.icon,size:T,setCurrentTab:e=>{C(e),d&&d(e)},isSquared:m,isFirstlement:0==s,isLastElement:s==i.length-1},t.key))),p&&e.jsx(r.EmptyTab,{}),e.jsx(r.RightComponent,{children:x})]}))},o=n=>{const{tab:o,currentTab:l,setCurrentTab:i,TabItemStyledProps:c,IconComponent:d,size:b="default",isSquared:u=!1,isFirstlement:p,isLastElement:x}=n,T=o.key===l,{colorsV2:m}=s.DEFAULT_THEME,g=t.useCallback((()=>Object.assign(Object.assign({},c),{borderRadius:n.isSquared?p?"4px 0px 0px 4px":x?"0px 4px 4px 0px":"":""})),[]);return e.jsxs(r.TabItem,Object.assign({style:g(),selected:T,hasEqualSpacing:n.hasEqualSpacing,onClick:()=>i(n.tab.key),selectedTextColor:n.selectedTextColor,isSquared:u,"data-test":n["data-test"]},{children:[d&&e.jsx(d,{selected:T?m.background.brand:m.content.secondary}),e.jsx(r.TabItemText,Object.assign({style:"small"===b?{fontSize:14,fontStyle:"normal",fontWeight:600}:void 0,textColor:n.textColor,selectedTextColor:n.selectedTextColor,selected:T},{children:o.title})),void 0!==o.trailingNumber&&null!==o.trailingNumber&&e.jsx(r.TrailingNumberContainer,Object.assign({selected:T},{children:e.jsx(a.BodyCaption,Object.assign({color:m.content.primaryInverse},{children:o.trailingNumber}))}))]}))};n.displayName="Tabs",o.displayName="TabItemComponent",exports.TabItemComponent=o,exports.Tabs=n;
|
|
@@ -37,6 +37,7 @@ export interface TabViewHeaderProps {
|
|
|
37
37
|
size?: 'small' | 'default';
|
|
38
38
|
isSquared?: boolean;
|
|
39
39
|
containerStyles?: React.CSSProperties;
|
|
40
|
+
'data-test'?: string;
|
|
40
41
|
}
|
|
41
42
|
export interface TabItemComponentProps {
|
|
42
43
|
hasEqualSpacing?: boolean;
|
|
@@ -53,4 +54,5 @@ export interface TabItemComponentProps {
|
|
|
53
54
|
isSquared?: boolean;
|
|
54
55
|
isFirstlement?: boolean;
|
|
55
56
|
isLastElement?: boolean;
|
|
57
|
+
'data-test'?: string;
|
|
56
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{SearchIcon as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{SearchIcon as t}from"../../assets/icons/searchIcon.js";import{useState as o,useEffect as a}from"react";import s from"../../assets/icons/cross.svg.js";import{Input as n}from"../input/Input.js";const r=r=>{const{isEnabled:i,onEnter:c,placeholder:l,width:d,variant:u,validate:h,isActive:v}=r,[f,m]=o("search"),[p,g]=o("default"),[C,b]=o(v?"active":i?"none":"disabled"),[k,x]=o(r.initialValue||r.searchValue||"");a((()=>{var e,t,o;x(null!==(e=r.searchValue)&&void 0!==e?e:""),(null===(o=null===(t=r.searchValue)||void 0===t?void 0:t.trim())||void 0===o?void 0:o.length)?m("cross"):m("search")}),[r.searchValue]),a((()=>{b(v?"active":i?"none":"disabled")}),[i,v]),a((()=>{r.reset&&j()}),[null==r?void 0:r.reset]);const V=e=>{i&&c(e)},j=()=>{m("search"),g("default"),x(""),r.onChange(""),b("none"),c("")};return e(n,{"data-test":r["data-test"],id:"search-bar",validate:h,onFocus:()=>{k.length&&m("cross"),"default"===p&&i&&(g("clicked"),b("active"))},width:d,state:C,leftIcon:"search"===f&&"default"===p?{icon:t}:void 0,rightIcon:"cross"!==f||r.suffixButton?void 0:{icon:s,callback:()=>{j(),r.onClickCross&&r.onClickCross()}},onChangeText:(e,t)=>{r.onChange(e),x(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?m("cross"):m("search"):V(e)},placeholder:l,variant:u,value:k,onBlur:()=>{k.length||g("default"),b("none")},button:{text:"",buttonProps:r.suffixButton}})};export{r as SearchBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useCallback as s}from"react";import{DEFAULT_THEME as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as r,useCallback as s}from"react";import{DEFAULT_THEME as a}from"../../constants/Theme.js";import{BodyCaption as n}from"../TypographyStyle.js";import{TabHeader as l,EmptyTab as i,RightComponent as c,TabItem as d,TabItemText as b,TrailingNumberContainer as m}from"./Tabs.styles.js";const p=s=>{var n,d;const{tabs:b,initialTab:m,onTabSelected:p,TabItemStyledProps:g,selectedTab:x,extendedBorder:y,rightComponent:T,size:C="default",isSquared:S=!1,containerStyles:h}=s,[j,f]=o(m||b[0].key),{colorsV2:q}=a;r((()=>{x&&x!==j&&f(x)}),[x,j]);const k=s.backgroundColor,I=null!==(n=s.selectedTextColor)&&void 0!==n?n:q.background.brand,O=null!==(d=s.textColor)&&void 0!==d?d:q.content.secondary;return e(l,Object.assign({style:null!=h?h:{},bgColor:k,"data-test":s["data-test"]},{children:[b.map(((e,o)=>t(u,{hasEqualSpacing:s.hasEqualSpacing,selectedTextColor:I,textColor:O,tab:e,currentTab:j,TabItemStyledProps:g,IconComponent:e.icon,size:C,setCurrentTab:e=>{f(e),p&&p(e)},isSquared:S,isFirstlement:0==o,isLastElement:o==b.length-1},e.key))),y&&t(i,{}),t(c,{children:T})]}))},u=o=>{const{tab:r,currentTab:l,setCurrentTab:i,TabItemStyledProps:c,IconComponent:p,size:u="default",isSquared:g=!1,isFirstlement:x,isLastElement:y}=o,T=r.key===l,{colorsV2:C}=a,S=s((()=>Object.assign(Object.assign({},c),{borderRadius:o.isSquared?x?"4px 0px 0px 4px":y?"0px 4px 4px 0px":"":""})),[]);return e(d,Object.assign({style:S(),selected:T,hasEqualSpacing:o.hasEqualSpacing,onClick:()=>i(o.tab.key),selectedTextColor:o.selectedTextColor,isSquared:g,"data-test":o["data-test"]},{children:[p&&t(p,{selected:T?C.background.brand:C.content.secondary}),t(b,Object.assign({style:"small"===u?{fontSize:14,fontStyle:"normal",fontWeight:600}:void 0,textColor:o.textColor,selectedTextColor:o.selectedTextColor,selected:T},{children:r.title})),void 0!==r.trailingNumber&&null!==r.trailingNumber&&t(m,Object.assign({selected:T},{children:t(n,Object.assign({color:C.content.primaryInverse},{children:r.trailingNumber}))}))]}))};p.displayName="Tabs",u.displayName="TabItemComponent";export{u as TabItemComponent,p as Tabs};
|
|
@@ -37,6 +37,7 @@ export interface TabViewHeaderProps {
|
|
|
37
37
|
size?: 'small' | 'default';
|
|
38
38
|
isSquared?: boolean;
|
|
39
39
|
containerStyles?: React.CSSProperties;
|
|
40
|
+
'data-test'?: string;
|
|
40
41
|
}
|
|
41
42
|
export interface TabItemComponentProps {
|
|
42
43
|
hasEqualSpacing?: boolean;
|
|
@@ -53,4 +54,5 @@ export interface TabItemComponentProps {
|
|
|
53
54
|
isSquared?: boolean;
|
|
54
55
|
isFirstlement?: boolean;
|
|
55
56
|
isLastElement?: boolean;
|
|
57
|
+
'data-test'?: string;
|
|
56
58
|
}
|