@bikdotai/bik-component-library 0.0.679-2 → 0.0.679-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.
@@ -12,4 +12,6 @@ export declare const CountryCodePicker: React.FC<{
12
12
  disabled?: boolean;
13
13
  hideFlagImage?: boolean;
14
14
  containerStyles?: React.CSSProperties;
15
+ codeColor?: string;
16
+ dialColor?: string;
15
17
  }>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("../../assets/icons/chevronDown.svg.js"),r=require("react"),t=require("./CountryCodePicker.modal.js"),n=require("./CountryCodePicker.styled.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var d=require("../TypographyStyle.js"),i=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../icon-button/IconButton.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");exports.CountryCodePicker=c=>{var l,u,a,p,m,j;const[y,w]=r.useState(null!==(l=c.selectedCountry)&&void 0!==l?l:{name:"India",dial:"+91",code:"IN"}),h=`https://flagcdn.com/${null===(u=y.code)||void 0===u?void 0:u.toLowerCase()}.svg`;r.useEffect((()=>{c.selectedCountry&&w(c.selectedCountry)}),[null===(a=c.selectedCountry)||void 0===a?void 0:a.code]);return e.jsx(s.DropdownPopover,Object.assign({version:c.version,isSearchable:!0,width:null!==(p=c.popoverWidth)&&void 0!==p?p:"200px",placement:null!==(m=c.placement)&&void 0!==m?m:"bottom-start",strategy:null!==(j=c.placementStrategy)&&void 0!==j?j:"absolute",options:t.CountriesData.map((o=>{var r;const t=`https://flagcdn.com/${null===(r=o.code)||void 0===r?void 0:r.toLowerCase()}.svg`;return{value:o.code,label:o.dial,searchKey:o.name,customComponent:e.jsxs(n.StyledCountryPickerOption,{children:[!c.hideFlagImage&&e.jsx("img",{src:t,className:"country-flag__option",alt:o.name}),e.jsxs(d.BodySecondary,{children:[o.code," ",o.dial]})]}),selected:y.code===o.code}})),disabled:c.disabled,onSelect:e=>{const o=t.CountriesData.filter((o=>o.code===e.value));w(o[0]),c.onCountrySelect(o[0])}},{children:e.jsxs(n.StyledCountryPickerWrapper,Object.assign({height:c.height,style:c.containerStyles},{children:[e.jsxs("div",Object.assign({className:"content__wrapper"},{children:[!c.hideFlagImage&&e.jsx("img",{src:h,className:"country-flag__selected-option",alt:y.name}),e.jsx(d.BodySecondary,{children:y.dial})]})),e.jsx(o.default,{width:24,height:24,color:i.COLORS.content.primary})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("../../assets/icons/chevronDown.svg.js"),r=require("react"),t=require("./CountryCodePicker.modal.js"),n=require("./CountryCodePicker.styled.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var d=require("../TypographyStyle.js"),i=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../icon-button/IconButton.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");exports.CountryCodePicker=l=>{var c,a,u,p,m,j;const[y,h]=r.useState(null!==(c=l.selectedCountry)&&void 0!==c?c:{name:"India",dial:"+91",code:"IN"}),v=`https://flagcdn.com/${null===(a=y.code)||void 0===a?void 0:a.toLowerCase()}.svg`;r.useEffect((()=>{l.selectedCountry&&h(l.selectedCountry)}),[null===(u=l.selectedCountry)||void 0===u?void 0:u.code]);return e.jsx(s.DropdownPopover,Object.assign({version:l.version,isSearchable:!0,width:null!==(p=l.popoverWidth)&&void 0!==p?p:"200px",placement:null!==(m=l.placement)&&void 0!==m?m:"bottom-start",strategy:null!==(j=l.placementStrategy)&&void 0!==j?j:"absolute",options:t.CountriesData.map((o=>{var r,t,s;const c=`https://flagcdn.com/${null===(r=o.code)||void 0===r?void 0:r.toLowerCase()}.svg`;return{value:o.code,label:o.dial,searchKey:o.name,customComponent:e.jsxs(n.StyledCountryPickerOption,{children:[!l.hideFlagImage&&e.jsx("img",{src:c,className:"country-flag__option",alt:o.name}),e.jsxs(d.BodySecondary,{children:[e.jsx("span",Object.assign({style:{color:null!==(t=l.codeColor)&&void 0!==t?t:i.COLORS.text.primary}},{children:o.code}))," ",e.jsx("span",Object.assign({style:{color:null!==(s=l.dialColor)&&void 0!==s?s:i.COLORS.text.primary}},{children:o.dial}))]})]}),selected:y.code===o.code}})),disabled:l.disabled,onSelect:e=>{const o=t.CountriesData.filter((o=>o.code===e.value));h(o[0]),l.onCountrySelect(o[0])}},{children:e.jsxs(n.StyledCountryPickerWrapper,Object.assign({height:l.height,style:l.containerStyles},{children:[e.jsxs("div",Object.assign({className:"content__wrapper"},{children:[!l.hideFlagImage&&e.jsx("img",{src:v,className:"country-flag__selected-option",alt:y.name}),e.jsx(d.BodySecondary,{children:y.dial})]})),e.jsx(o.default,{width:24,height:24,color:i.COLORS.content.primary})]}))}))};
@@ -12,4 +12,6 @@ export declare const CountryCodePicker: React.FC<{
12
12
  disabled?: boolean;
13
13
  hideFlagImage?: boolean;
14
14
  containerStyles?: React.CSSProperties;
15
+ codeColor?: string;
16
+ dialColor?: string;
15
17
  }>;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e}from"react/jsx-runtime";import t from"../../assets/icons/chevronDown.svg.js";import{useState as n,useEffect as r}from"react";import{CountriesData as d}from"./CountryCodePicker.modal.js";import{StyledCountryPickerWrapper as s,StyledCountryPickerOption as i}from"./CountryCodePicker.styled.js";import{DropdownPopover as p}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{BodySecondary as c}from"../TypographyStyle.js";import{COLORS as l}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";const m=m=>{var a,u,h,w,j,y;const[v,g]=n(null!==(a=m.selectedCountry)&&void 0!==a?a:{name:"India",dial:"+91",code:"IN"}),C=`https://flagcdn.com/${null===(u=v.code)||void 0===u?void 0:u.toLowerCase()}.svg`;r((()=>{m.selectedCountry&&g(m.selectedCountry)}),[null===(h=m.selectedCountry)||void 0===h?void 0:h.code]);return o(p,Object.assign({version:m.version,isSearchable:!0,width:null!==(w=m.popoverWidth)&&void 0!==w?w:"200px",placement:null!==(j=m.placement)&&void 0!==j?j:"bottom-start",strategy:null!==(y=m.placementStrategy)&&void 0!==y?y:"absolute",options:d.map((t=>{var n;const r=`https://flagcdn.com/${null===(n=t.code)||void 0===n?void 0:n.toLowerCase()}.svg`;return{value:t.code,label:t.dial,searchKey:t.name,customComponent:e(i,{children:[!m.hideFlagImage&&o("img",{src:r,className:"country-flag__option",alt:t.name}),e(c,{children:[t.code," ",t.dial]})]}),selected:v.code===t.code}})),disabled:m.disabled,onSelect:o=>{const e=d.filter((e=>e.code===o.value));g(e[0]),m.onCountrySelect(e[0])}},{children:e(s,Object.assign({height:m.height,style:m.containerStyles},{children:[e("div",Object.assign({className:"content__wrapper"},{children:[!m.hideFlagImage&&o("img",{src:C,className:"country-flag__selected-option",alt:v.name}),o(c,{children:v.dial})]})),o(t,{width:24,height:24,color:l.content.primary})]}))}))};export{m as CountryCodePicker};
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import t from"../../assets/icons/chevronDown.svg.js";import{useState as n,useEffect as r}from"react";import{CountriesData as d}from"./CountryCodePicker.modal.js";import{StyledCountryPickerWrapper as s,StyledCountryPickerOption as i}from"./CountryCodePicker.styled.js";import{DropdownPopover as p}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{BodySecondary as l}from"../TypographyStyle.js";import{COLORS as c}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";const m=m=>{var a,u,h,y,j,w;const[v,g]=n(null!==(a=m.selectedCountry)&&void 0!==a?a:{name:"India",dial:"+91",code:"IN"}),C=`https://flagcdn.com/${null===(u=v.code)||void 0===u?void 0:u.toLowerCase()}.svg`;r((()=>{m.selectedCountry&&g(m.selectedCountry)}),[null===(h=m.selectedCountry)||void 0===h?void 0:h.code]);return o(p,Object.assign({version:m.version,isSearchable:!0,width:null!==(y=m.popoverWidth)&&void 0!==y?y:"200px",placement:null!==(j=m.placement)&&void 0!==j?j:"bottom-start",strategy:null!==(w=m.placementStrategy)&&void 0!==w?w:"absolute",options:d.map((t=>{var n,r,d;const s=`https://flagcdn.com/${null===(n=t.code)||void 0===n?void 0:n.toLowerCase()}.svg`;return{value:t.code,label:t.dial,searchKey:t.name,customComponent:e(i,{children:[!m.hideFlagImage&&o("img",{src:s,className:"country-flag__option",alt:t.name}),e(l,{children:[o("span",Object.assign({style:{color:null!==(r=m.codeColor)&&void 0!==r?r:c.text.primary}},{children:t.code}))," ",o("span",Object.assign({style:{color:null!==(d=m.dialColor)&&void 0!==d?d:c.text.primary}},{children:t.dial}))]})]}),selected:v.code===t.code}})),disabled:m.disabled,onSelect:o=>{const e=d.filter((e=>e.code===o.value));g(e[0]),m.onCountrySelect(e[0])}},{children:e(s,Object.assign({height:m.height,style:m.containerStyles},{children:[e("div",Object.assign({className:"content__wrapper"},{children:[!m.hideFlagImage&&o("img",{src:C,className:"country-flag__selected-option",alt:v.name}),o(l,{children:v.dial})]})),o(t,{width:24,height:24,color:c.content.primary})]}))}))};export{m as CountryCodePicker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.679-2",
3
+ "version": "0.0.679-4",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",