@bikdotai/bik-component-library 0.0.567-beta.b-2 → 0.0.567-beta.b-3

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 e=require("react/jsx-runtime"),t=require("../../assets/icons/searchIcon.js"),s=require("react"),a=require("../../assets/icons/cross.svg.js"),n=require("../input/Input.js");exports.SearchBar=r=>{const{isEnabled:o,onEnter:c,placeholder:i,width:u,variant:l,validate:d,isActive:h}=r,[v,f]=s.useState("search"),[p,b]=s.useState("default"),[g,C]=s.useState(h?"active":o?"none":"disabled"),[x,j]=s.useState(r.initialValue||"");s.useEffect((()=>{C(h?"active":o?"none":"disabled")}),[o,h]),s.useEffect((()=>{r.reset&&I()}),[null==r?void 0:r.reset]);const k=e=>{o&&c(e)},I=()=>{f("search"),b("default"),j(""),r.onChange(""),C("none"),c("")};return e.jsx(n.Input,{id:"search-bar",validate:d,onFocus:()=>{x.length&&f("cross"),"default"===p&&o&&(b("clicked"),C("active"))},width:u,state:g,leftIcon:"search"===v&&"default"===p?{icon:t.SearchIcon}:void 0,rightIcon:"cross"===v?{icon:a.default,callback:()=>{I(),r.onClickCross&&r.onClickCross()}}:void 0,onChangeText:(e,t)=>{r.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:l,value:x,onBlur:()=>{x.length||b("default"),C("none")},button:{text:"",buttonProps:r.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"),n=require("../input/Input.js");exports.SearchBar=r=>{const{isEnabled:o,onEnter:i,placeholder:c,width:u,variant:l,validate:d,isActive:h}=r,[f,v]=s.useState("search"),[p,b]=s.useState("default"),[g,x]=s.useState(h?"active":o?"none":"disabled"),[C,j]=s.useState(r.initialValue||"");s.useEffect((()=>{x(h?"active":o?"none":"disabled")}),[o,h]),s.useEffect((()=>{r.reset&&I()}),[null==r?void 0:r.reset]);const k=e=>{o&&i(e)},I=()=>{v("search"),b("default"),j(""),r.onChange(""),x("none"),i("")};return e.jsx(n.Input,{id:"search-bar",validate:d,onFocus:()=>{C.length&&v("cross"),"default"===p&&o&&(b("clicked"),x("active"))},width:u,state:g,leftIcon:"search"===f&&"default"===p?{icon:t.SearchIcon}:void 0,rightIcon:"cross"!==f||r.suffixButton?void 0:{icon:a.default,callback:()=>{I(),r.onClickCross&&r.onClickCross()}},onChangeText:(e,t)=>{r.onChange(e),j(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?v("cross"):v("search"):k(e)},placeholder:c,variant:l,value:C,onBlur:()=>{C.length||b("default"),x("none")},button:{text:"",buttonProps:r.suffixButton}})};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{SearchIcon as t}from"../../assets/icons/searchIcon.js";import{useState as o,useEffect as n}from"react";import s from"../../assets/icons/cross.svg.js";import{Input as a}from"../input/Input.js";const i=i=>{const{isEnabled:r,onEnter:c,placeholder:l,width:d,variant:h,validate:u,isActive:v}=i,[f,m]=o("search"),[p,g]=o("default"),[C,b]=o(v?"active":r?"none":"disabled"),[k,x]=o(i.initialValue||"");n((()=>{b(v?"active":r?"none":"disabled")}),[r,v]),n((()=>{i.reset&&w()}),[null==i?void 0:i.reset]);const j=e=>{r&&c(e)},w=()=>{m("search"),g("default"),x(""),i.onChange(""),b("none"),c("")};return e(a,{id:"search-bar",validate:u,onFocus:()=>{k.length&&m("cross"),"default"===p&&r&&(g("clicked"),b("active"))},width:d,state:C,leftIcon:"search"===f&&"default"===p?{icon:t}:void 0,rightIcon:"cross"===f?{icon:s,callback:()=>{w(),i.onClickCross&&i.onClickCross()}}:void 0,onChangeText:(e,t)=>{i.onChange(e),x(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?m("cross"):m("search"):j(e)},placeholder:l,variant:h,value:k,onBlur:()=>{k.length||g("default"),b("none")},button:{text:"",buttonProps:i.suffixButton}})};export{i as SearchBar};
1
+ import{jsx as e}from"react/jsx-runtime";import{SearchIcon as t}from"../../assets/icons/searchIcon.js";import{useState as o,useEffect as n}from"react";import s from"../../assets/icons/cross.svg.js";import{Input as a}from"../input/Input.js";const i=i=>{const{isEnabled:r,onEnter:c,placeholder:l,width:d,variant:u,validate:h,isActive:f}=i,[v,m]=o("search"),[p,g]=o("default"),[C,b]=o(f?"active":r?"none":"disabled"),[k,x]=o(i.initialValue||"");n((()=>{b(f?"active":r?"none":"disabled")}),[r,f]),n((()=>{i.reset&&w()}),[null==i?void 0:i.reset]);const j=e=>{r&&c(e)},w=()=>{m("search"),g("default"),x(""),i.onChange(""),b("none"),c("")};return e(a,{id:"search-bar",validate:h,onFocus:()=>{k.length&&m("cross"),"default"===p&&r&&(g("clicked"),b("active"))},width:d,state:C,leftIcon:"search"===v&&"default"===p?{icon:t}:void 0,rightIcon:"cross"!==v||i.suffixButton?void 0:{icon:s,callback:()=>{w(),i.onClickCross&&i.onClickCross()}},onChangeText:(e,t)=>{i.onChange(e),x(e),"keydown"!==(null==t?void 0:t.type)||13!==t.which&&13!==t.keyCode?e.trim().length?m("cross"):m("search"):j(e)},placeholder:l,variant:u,value:k,onBlur:()=>{k.length||g("default"),b("none")},button:{text:"",buttonProps:i.suffixButton}})};export{i as SearchBar};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.567-beta.b-2",
3
+ "version": "0.0.567-beta.b-3",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",