@bikdotai/bik-component-library 0.0.433-beta.product-picker-39 → 0.0.433

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.
Files changed (73) hide show
  1. package/dist/cjs/components/bik-layout/SidebarStyles.js +1 -1
  2. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  3. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +0 -2
  4. package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -1
  5. package/dist/cjs/components/product-picker-v2/modal.d.ts +1 -10
  6. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  7. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +2 -9
  8. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  9. package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +1 -4
  10. package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -1
  11. package/dist/cjs/components/product-picker-v2/reducers.js +1 -1
  12. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +1 -3
  13. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  14. package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +1 -5
  15. package/dist/cjs/components/product-picker-v2/selectedScreen.js +1 -1
  16. package/dist/cjs/components/product-picker-v2/style.js +3 -9
  17. package/dist/cjs/components/product-picker-v2/variant.js +1 -1
  18. package/dist/cjs/components/tag/Tag.js +1 -1
  19. package/dist/cjs/components/tag/Tag.styled.js +1 -1
  20. package/dist/cjs/components/tag/model.d.ts +1 -3
  21. package/dist/cjs/components/tag/model.js +1 -1
  22. package/dist/cjs/components/tag/themes.js +1 -1
  23. package/dist/cjs/helpers/index.d.ts +0 -1
  24. package/dist/cjs/index.d.ts +0 -1
  25. package/dist/cjs/index.js +1 -1
  26. package/dist/esm/components/bik-layout/SidebarStyles.js +1 -1
  27. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
  28. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +0 -2
  29. package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -1
  30. package/dist/esm/components/product-picker-v2/modal.d.ts +1 -10
  31. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  32. package/dist/esm/components/product-picker-v2/productScreen.d.ts +2 -9
  33. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  34. package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +1 -4
  35. package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
  36. package/dist/esm/components/product-picker-v2/reducers.js +1 -1
  37. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +1 -3
  38. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  39. package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +1 -5
  40. package/dist/esm/components/product-picker-v2/selectedScreen.js +1 -1
  41. package/dist/esm/components/product-picker-v2/style.js +3 -9
  42. package/dist/esm/components/product-picker-v2/variant.js +1 -1
  43. package/dist/esm/components/tag/Tag.js +1 -1
  44. package/dist/esm/components/tag/Tag.styled.js +1 -1
  45. package/dist/esm/components/tag/model.d.ts +1 -3
  46. package/dist/esm/components/tag/model.js +1 -1
  47. package/dist/esm/components/tag/themes.js +1 -1
  48. package/dist/esm/helpers/index.d.ts +0 -1
  49. package/dist/esm/index.d.ts +0 -1
  50. package/dist/esm/index.js +1 -1
  51. package/package.json +2 -2
  52. package/dist/cjs/assets/icons/bik_ai_stars_icon.svg.js +0 -1
  53. package/dist/cjs/components/product-picker-v2/ProductPickerTag.d.ts +0 -8
  54. package/dist/cjs/components/product-picker-v2/ProductPickerTag.js +0 -1
  55. package/dist/cjs/components/product-picker-v2/productInfoOverlay.d.ts +0 -11
  56. package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +0 -40
  57. package/dist/cjs/components/product-picker-v2/useFetchFbStatus.d.ts +0 -5
  58. package/dist/cjs/components/product-picker-v2/useFetchFbStatus.js +0 -1
  59. package/dist/cjs/components/resizeImage/index.d.ts +0 -8
  60. package/dist/cjs/components/resizeImage/index.js +0 -1
  61. package/dist/cjs/utils/resizeImage.d.ts +0 -1
  62. package/dist/cjs/utils/resizeImage.js +0 -1
  63. package/dist/esm/assets/icons/bik_ai_stars_icon.svg.js +0 -1
  64. package/dist/esm/components/product-picker-v2/ProductPickerTag.d.ts +0 -8
  65. package/dist/esm/components/product-picker-v2/ProductPickerTag.js +0 -1
  66. package/dist/esm/components/product-picker-v2/productInfoOverlay.d.ts +0 -11
  67. package/dist/esm/components/product-picker-v2/productInfoOverlay.js +0 -40
  68. package/dist/esm/components/product-picker-v2/useFetchFbStatus.d.ts +0 -5
  69. package/dist/esm/components/product-picker-v2/useFetchFbStatus.js +0 -1
  70. package/dist/esm/components/resizeImage/index.d.ts +0 -8
  71. package/dist/esm/components/resizeImage/index.js +0 -1
  72. package/dist/esm/utils/resizeImage.d.ts +0 -1
  73. package/dist/esm/utils/resizeImage.js +0 -1
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import{Button as d}from"../button/Button.js";import{Input as a}from"../input/Input.js";import{StyledModal as u}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as p}from"../tag/Tag.js";import{CollectionsScreen as m}from"./collectionScreen.js";import{ProductInfoOverlay as C}from"./productInfoOverlay.js";import{ProductsScreen as g}from"./productScreen.js";import{RearrangeScreen as f}from"./rearrangeScreen.js";import{collectionsReducer as b,selectedColectionsReducer as S,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as y}from"./searchScreen.js";import{SelectedScreen as P}from"./selectedScreen.js";import{ContainerStyle as j,ScrollContainerStyle as k}from"./style.js";import{OUT_OF_STOCK_ACTION as x}from"./type.js";var I;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(I||(I={}));const F=F=>{const{storeId:O,selectedItems:T,onClose:D,visible:R,zIndex:w,limit:E,hideCollectionCheckbox:A,hideProductCheckbox:V,outOfStockAction:B=x.BLUR,hideVariantCheckbox:L,selectProductsFromCustomCollection:M,hideSelectionCount:z,title:G,width:H,renderWithoutModal:W,onClickSave:$,pickerType:K,hideProductVariants:U=!1,startupScreen:Y=I.Collections,rearrangeEnabled:q,showProductDetailInfoIcon:J}=F,[N,Q]=r(b,{}),[X,Z]=s([I.Collections,I.RearrangeProducts].includes(Y)?Y:I.Collections),[_,ee]=s("grid"),[te,oe]=s(""),[ce,re]=s(0),[se,ie]=s(!1),[ne,le]=s(0),[de,ae]=s(""),[ue,he]=s(!1),[pe,me]=s(!1),[Ce,ge]=s(),[fe,be]=r(S,Object.keys(T).length>0?T:{}),Se=i(null),[ve,ye]=s(!1),[Pe,je]=s();n((()=>{ie(!0),me(!0),F.collectionFetcher(ce,O).then((e=>{Q({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ie(!1),re((e=>e+1)),me(!1)})).catch()}),[]),n((()=>{let e=0;Object.keys(fe||[]).forEach((t=>{var o;Object.keys((null===(o=fe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=fe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),le(e)})),n((()=>{var e;te&&!(null===(e=null==N?void 0:N[te])||void 0===e?void 0:e.products)&&(ie(!0),F.productFetcher(te,O).then((e=>{Object.keys(e).length&&Q({type:"productsFetched",data:{collectionId:te,products:e}}),ie(!1)})).catch())}),[te]),n((()=>{const e=setTimeout((()=>{"rearrange"!==X&&(de.length?(he(!0),F.searchFetcher(O,de).then((e=>{ge(Object.assign({},e)),Z("searchProducts"),ie(!1),he(!1)}))):Z("collections"))}),800);return()=>clearTimeout(e)}),[de]),n((()=>{$&&(F.onAdd(fe,ne),ke())}),[$]);const ke=()=>{be({type:"reset",data:{}})},xe=e(j,{children:[F.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:F.postHeader})),!F.hideGlobalSearch&&t(o,{children:("collections"===X||"searchProducts"===X)&&t("div",Object.assign({style:{padding:W?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(a,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ue?t(h,{size:"small",color:l.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:de,onChangeText:e=>{e.length&&e.trim().length?ae(e):ae("")}})}))}),e(k,Object.assign({ref:Se},{children:["collections"===X&&t(m,{customCollectionRestriction:F.customCollectionRestriction,dataLoading:pe,collections:N,selectedCollectionsDispatch:be,setCollectionId:oe,setScreen:Z,selectedCollections:fe,collectionFetcher:F.collectionFetcher,storeId:O,collectionsDispatch:Q,setSaveDisabled:ie,pagingControls:{curPage:ce,setCurPage:re},hideCollectionCheckbox:A,renderWithoutModal:W,pickerType:K}),"products"===X&&te&&t(v.Provider,Object.assign({value:te},{children:t(g,{hideInCollectionSearch:F.hideInCollectionSearch,customCollectionRestriction:F.customCollectionRestriction,productFetcher:F.productFetcher,setScreen:Z,storeId:O,data:N[te],collectionsDispatch:Q,selectedCollectionsDispatch:be,selectedData:fe,setSaveDisabled:ie,searchInCollectionFetcher:F.searchInCollectionFetcher,hideProductCheckbox:V,outOfStockAction:B,hideVariantCheckbox:L,selectProductsFromCustomCollection:M,renderWithoutModal:W,pickerType:K,hideProductVariants:U,fbStatusFetcher:F.fbStatusFetcher,onInfoIconClick:e=>{ye(!0),je(e)},showProductDetailInfoIcon:J})})),"view"===X&&t(P,{selectedCollections:fe||{},selectedCollectionsDispatch:be,setScreen:Z,collections:N,outOfStockAction:B,storeId:O,fbStatusFetcher:F.fbStatusFetcher}),"rearrange"===X&&t(f,{selectedCollections:fe||{},selectedCollectionsDispatch:be,setScreen:Z,outOfStockAction:B,rearrangeViewType:"grid"===_?"list":"grid",scrollContainerRef:Se,storeId:O,fbStatusFetcher:F.fbStatusFetcher}),"searchProducts"===X&&t(y,{customCollectionRestriction:F.customCollectionRestriction,selectedCollections:fe||{},searchedCollections:Ce||{},selectedCollectionsDispatch:be,setScreen:Z,collections:N,onBackPress:()=>{ae(""),ge({})},pickerType:K,hideProductCheckbox:V,hideProductVariants:U,hideVariantCheckbox:L,storeId:O,fbStatusFetcher:F.fbStatusFetcher})]}))]});return t(o,{children:W?xe:e(u,Object.assign({zIndex:w,open:R,onClose:()=>{null==D||D(),ke()},headingTitle:G||("collections"===X||"products"===X?"Select Products":"view"===X?"Selected Products":"searchProducts"===X?"Searched Products":"rearrange"===X?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:H||"480px"},headerRightCustomElement:"rearrange"===X?(console.log("ignore:",ee),t(o,{})):t(o,{}),primaryButton:{buttonText:se?"Loading...":X===I.RearrangeProducts?"Done":"Add",disabled:se||ne<1||E&&ne>E||!1,onClick:()=>{F.onAdd(fe,ne),ke()}},footerLeftCustomElement:z?t(o,{}):E&&ne>E?t(p,{tagText:`You can only select ${E} products`,type:"negative"}):t(d,ne>0?{onClick:()=>{Z(q?I.RearrangeProducts:I.SelectedProducts)},buttonText:`${ne} products selected`,buttonType:["rearrange","view"].includes(X)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(X)}:{disabled:!0,buttonText:`${ne} products selected`,buttonType:"tertiaryGray"}),hideCrossButton:ve},{children:[xe,ve&&Pe?t(C,{productData:Pe,outOfStockAction:B,onClose:()=>{ye(!1)}}):t(o,{})]}))})};export{F as ProductPickerModal,I as ScreenName};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as i,useEffect as s}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as u}from"../tag/Tag.js";import{CollectionsScreen as p}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{RearrangeScreen as C}from"./rearrangeScreen.js";import{collectionsReducer as g,selectedColectionsReducer as b,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as y}from"./searchScreen.js";import{SelectedScreen as S}from"./selectedScreen.js";import{ContainerStyle as P,ScrollContainerStyle as f}from"./style.js";import{OUT_OF_STOCK_ACTION as j}from"./type.js";var x;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(x||(x={}));const k=k=>{const{storeId:T,selectedItems:I,onClose:O,visible:R,zIndex:D,limit:F,hideCollectionCheckbox:w,hideProductCheckbox:E,outOfStockAction:V=j.BLUR,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,hideSelectionCount:L,title:M,width:z,renderWithoutModal:G,onClickSave:H,pickerType:W,hideProductVariants:$=!1,startupScreen:K=x.Collections,rearrangeEnabled:U}=k,[Y,q]=r(g,{}),[J,N]=i([x.Collections,x.RearrangeProducts].includes(K)?K:x.Collections),[Q,X]=i("grid"),[Z,_]=i(""),[ee,te]=i(0),[oe,ce]=i(!1),[re,ie]=i(0),[se,ne]=i(""),[le,de]=i(!1),[ae,he]=i(!1),[ue,pe]=i(),[me,Ce]=r(b,Object.keys(I).length>0?I:{});s((()=>{ce(!0),he(!0),k.collectionFetcher(ee,T).then((e=>{q({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ce(!1),te((e=>e+1)),he(!1)})).catch()}),[]),s((()=>{let e=0;Object.keys(me||[]).forEach((t=>{var o;Object.keys((null===(o=me[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=me[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ie(e)})),s((()=>{var e;Z&&!(null===(e=null==Y?void 0:Y[Z])||void 0===e?void 0:e.products)&&(ce(!0),k.productFetcher(Z,T).then((e=>{Object.keys(e).length&&q({type:"productsFetched",data:{collectionId:Z,products:e}}),ce(!1)})).catch())}),[Z]),s((()=>{const e=setTimeout((()=>{"rearrange"!==J&&(se.length?(de(!0),k.searchFetcher(T,se).then((e=>{pe(Object.assign({},e)),N("searchProducts"),ce(!1),de(!1)}))):N("collections"))}),800);return()=>clearTimeout(e)}),[se]),s((()=>{H&&(k.onAdd(me,re),ge())}),[H]);const ge=()=>{Ce({type:"reset",data:{}})},be=e(P,{children:[k.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:k.postHeader})),!k.hideGlobalSearch&&t(o,{children:("collections"===J||"searchProducts"===J)&&t("div",Object.assign({style:{padding:G?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(d,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>le?t(h,{size:"small",color:n.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:se,onChangeText:e=>{e.length&&e.trim().length?ne(e):ne("")}})}))}),e(f,{children:["collections"===J&&t(p,{customCollectionRestriction:k.customCollectionRestriction,dataLoading:ae,collections:Y,selectedCollectionsDispatch:Ce,setCollectionId:_,setScreen:N,selectedCollections:me,collectionFetcher:k.collectionFetcher,storeId:T,collectionsDispatch:q,setSaveDisabled:ce,pagingControls:{curPage:ee,setCurPage:te},hideCollectionCheckbox:w,renderWithoutModal:G,pickerType:W}),"products"===J&&Z&&t(v.Provider,Object.assign({value:Z},{children:t(m,{hideInCollectionSearch:k.hideInCollectionSearch,customCollectionRestriction:k.customCollectionRestriction,productFetcher:k.productFetcher,setScreen:N,storeId:T,data:Y[Z],collectionsDispatch:q,selectedCollectionsDispatch:Ce,selectedData:me,setSaveDisabled:ce,searchInCollectionFetcher:k.searchInCollectionFetcher,hideProductCheckbox:E,outOfStockAction:V,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,renderWithoutModal:G,pickerType:W,hideProductVariants:$})})),"view"===J&&t(S,{selectedCollections:me||{},selectedCollectionsDispatch:Ce,setScreen:N,collections:Y}),"rearrange"===J&&t(C,{selectedCollections:me||{},selectedCollectionsDispatch:Ce,setScreen:N,outOfStockAction:V,rearrangeViewType:"grid"===Q?"list":"grid"}),"searchProducts"===J&&t(y,{customCollectionRestriction:k.customCollectionRestriction,selectedCollections:me||{},searchedCollections:ue||{},selectedCollectionsDispatch:Ce,setScreen:N,collections:Y,onBackPress:()=>{ne(""),pe({})},pickerType:W,hideProductCheckbox:E,hideProductVariants:$,hideVariantCheckbox:A})]})]});return t(o,{children:G?be:t(a,Object.assign({zIndex:D,open:R,onClose:()=>{null==O||O(),ge()},headingTitle:M||("collections"===J||"products"===J?"Select Products":"view"===J?"Selected Products":"searchProducts"===J?"Searched Products":"rearrange"===J?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:z||"480px"},headerRightCustomElement:"rearrange"===J?(console.log("ignore:",X),t(o,{})):t(o,{}),primaryButton:{buttonText:oe?"Loading...":J===x.RearrangeProducts?"Done":"Add",disabled:oe||re<1||F&&re>F||!1,onClick:()=>{k.onAdd(me,re),ge()}},footerLeftCustomElement:L?t(o,{}):F&&re>F?t(u,{tagText:`You can only select ${F} products`,type:"negative"}):t(l,re>0?{onClick:()=>{N(U?x.RearrangeProducts:x.SelectedProducts)},buttonText:`${re} products selected`,buttonType:["rearrange","view"].includes(J)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(J)}:{disabled:!0,buttonText:`${re} products selected`,buttonType:"tertiaryGray"})},{children:be}))})};export{k as ProductPickerModal,x as ScreenName};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Collection, FbStatusFetcherReturn, Product, ProductFetcherReturn, ProductVariant, SelectedItems } from '.';
2
+ import { Collection, Product, ProductFetcherReturn, ProductVariant, SelectedItems } from '.';
3
3
  import { CollectionsActions, SelectedCollectionsActions } from './reducers';
4
4
  import { OUT_OF_STOCK_ACTION } from './type';
5
5
  interface ProductsScreenInterface {
@@ -10,7 +10,7 @@ interface ProductsScreenInterface {
10
10
  selectedData: SelectedItems;
11
11
  selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
12
12
  searchInCollectionFetcher: (storeId: string, collectionId: string, query: string) => Promise<string[]>;
13
- productFetcher: (collectionId: string, storeId: string, offset?: number) => ProductFetcherReturn;
13
+ productFetcher: (collectionId: string, storeId: string) => ProductFetcherReturn;
14
14
  storeId: string;
15
15
  setScreen: React.Dispatch<React.SetStateAction<string>>;
16
16
  setSaveDisabled: React.Dispatch<React.SetStateAction<boolean>>;
@@ -21,9 +21,6 @@ interface ProductsScreenInterface {
21
21
  renderWithoutModal?: boolean;
22
22
  pickerType?: 'COLLECTION' | 'PRODUCT';
23
23
  hideProductVariants?: boolean;
24
- showProductDetailInfoIcon?: boolean;
25
- fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
26
- onInfoIconClick: (productData: Product | ProductVariant) => void;
27
24
  }
28
25
  export declare const ProductsScreen: (props: ProductsScreenInterface) => import("react/jsx-runtime").JSX.Element;
29
26
  interface ProductGroupInterface {
@@ -39,9 +36,7 @@ interface ProductGroupInterface {
39
36
  outOfStockAction?: OUT_OF_STOCK_ACTION;
40
37
  hideVariantCheckbox?: boolean;
41
38
  hideProductVariants?: boolean;
42
- showProductDetailInfoIcon?: boolean;
43
39
  pickerType?: 'COLLECTION' | 'PRODUCT';
44
- onInfoIconClick?: (productData: Product | ProductVariant) => void;
45
40
  }
46
41
  export declare const ProductGroup: (props: ProductGroupInterface) => import("react/jsx-runtime").JSX.Element;
47
42
  interface ProductCardInterface {
@@ -59,9 +54,7 @@ interface ProductCardInterface {
59
54
  outOfStockAction?: OUT_OF_STOCK_ACTION;
60
55
  hideVariantCheckbox?: boolean;
61
56
  hideProductVariants?: boolean;
62
- showProductDetailInfoIcon?: boolean;
63
57
  pickerType?: 'COLLECTION' | 'PRODUCT';
64
- onInfoIconClick?: (productData: Product | ProductVariant) => void;
65
58
  }
66
59
  export declare const ProductCard: (props: ProductCardInterface) => import("react/jsx-runtime").JSX.Element;
67
60
  export {};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as t,Fragment as e}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import n from"../../assets/icons/box.svg.js";import c from"../../assets/icons/search.svg.js";import{cloneDeep as l}from"lodash";import{useContext as s,useRef as r,useState as d,useEffect as a}from"react";import{COLORS as u}from"../../constants/Theme.js";import v from"../../assets/icons/info.svg.js";import{CheckBox as h}from"../checkBox/CheckBox.js";import{IconButton as p}from"../icon-button/IconButton.js";import{Input as g}from"../input/Input.js";import{BikShimmer as f}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as b}from"../shimmer-image/ShimmerImage.js";import{Spinner as m}from"../spinner/Spinner.js";import{Tooltip as j}from"../tooltips/Tooltip.js";import{BodyCaption as y,TitleRegular as k}from"../TypographyStyle.js";import{EmptyState as I}from"./emptyState.js";import{ProductPickerTag as O}from"./ProductPickerTag.js";import{CollectionIdContext as C}from"./reducers.js";import{ProductScreenHeader as P,ProductScreenCollectionCardStyle as S,ProductCardStyle as x}from"./style.js";import{OUT_OF_STOCK_ACTION as E}from"./type.js";import{liftTheStateUp as D}from"./utility.js";const V=e=>{const{data:v,collectionsDispatch:b,selectedData:j,selectedCollectionsDispatch:O,productFetcher:x,storeId:V,setScreen:A,setSaveDisabled:T,hideInCollectionSearch:F,customCollectionRestriction:R,hideProductCheckbox:B,outOfStockAction:U=E.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:H=!1,pickerType:J,hideProductVariants:W,fbStatusFetcher:z,onInfoIconClick:K,showProductDetailInfoIcon:M}=e,N=s(C),_=r(null),q=r(0),[G,Q]=d(!1),[X,Y]=d(""),[Z,$]=d(!1),[oo,to]=d(v),eo=r(!1);a((()=>{const o=setTimeout((()=>{X.length?($(!0),e.searchInCollectionFetcher(V,N,X).then((o=>{var t;const e=l(v);e.products={};for(const i of o)(null===(t=null==v?void 0:v.products)||void 0===t?void 0:t[i])&&(e.products[i]=v.products[i]);to(e),T(!1),$(!1)}))):to(v)}),800);return()=>clearTimeout(o)}),[X]),a((()=>{var o,t,e,i,n,c;console.log("vj: collectionId change before",v,v.products,null===(t=Object.keys(null!==(o=v.products)&&void 0!==o?o:{}))||void 0===t?void 0:t.length,eo),eo.current=!1,q.current=Math.floor((null===(i=Object.keys(null!==(e=v.products)&&void 0!==e?e:{}))||void 0===i?void 0:i.length)/10),console.log("vj: collectionId change after",v,v.products,null===(c=Object.keys(null!==(n=v.products)&&void 0!==n?n:{}))||void 0===c?void 0:c.length,eo)}),[N]);const io=!!R&&v.isSmartCollection,no=o=>{var t,e,i,n,c,l,s,r;let d=0,a=0;return!!((null===(e=null===(t=null==j?void 0:j[N])||void 0===t?void 0:t.products)||void 0===e?void 0:e[o])&&(null===(c=Object.keys((null===(n=null===(i=null==v?void 0:v.products)||void 0===i?void 0:i[o])||void 0===n?void 0:n.variants)||[]))||void 0===c||c.forEach((()=>a++)),Object.keys((null===(r=null===(s=null===(l=null==j?void 0:j[N])||void 0===l?void 0:l.products)||void 0===s?void 0:s[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>d++)),d>0&&a!==d))};a((()=>{(null==v?void 0:v.products)||so()}),[]);const co=o=>{const t=[];return console.log("vj: getVariantIdsForFbStatusFetch",o),Object.keys(null!=o?o:{}).forEach((e=>{var i,n;const c=null!==(n=null===(i=null==o?void 0:o[e])||void 0===i?void 0:i.variants)&&void 0!==n?n:{};Object.keys(c).forEach((o=>{var i,n,c;const l=null===(c=null===(n=null===(i=null==v?void 0:v.products)||void 0===i?void 0:i[e])||void 0===n?void 0:n.variants)||void 0===c?void 0:c[o];console.log("vj: variant fb status",{data:v,variant:l}),(null==l?void 0:l.fbStatus)||t.push(o)}))})),console.log("vj: getVariantIdsForFbStatusFetch returning",t),t},lo=(o,t)=>{if(console.log("fetchFbStatusAndDispatchProducts",{variantIdsToFetchFbStatus:o,fbStatusFetcher:z}),!z){const o=Object.assign({},t);Object.keys(t).forEach((e=>{var i,n,c;console.log("vj: response variants",null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.variants),Object.keys(null!==(c=null===(n=null==t?void 0:t[e])||void 0===n?void 0:n.variants)&&void 0!==c?c:{}).forEach((i=>{var n,c;const l=null===(n=null==t?void 0:t[e].variants)||void 0===n?void 0:n[i];l&&(l.fbStatus="APPROVED");const s=null===(c=null==o?void 0:o[e])||void 0===c?void 0:c.variants;s&&s[i]&&(s[i]=l)}))})),console.log("vj: fetchFbStatusAndDispatchProducts updated Products",o),b({type:"productsPaged",data:{collectionId:N,products:o}})}o.length>0&&z&&z(V,o).then((o=>{console.log("vj: response",{response:o,products:t});const e=Object.assign({},t);Object.keys(t).forEach((i=>{var n,c,l;console.log("vj: response variants",null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.variants),Object.keys(null!==(l=null===(c=null==t?void 0:t[i])||void 0===c?void 0:c.variants)&&void 0!==l?l:{}).forEach((n=>{var c,l;const s=null===(c=null==t?void 0:t[i].variants)||void 0===c?void 0:c[n];console.log("vj: v",{v:s,vId:n,status:o[n],response:o}),s&&"REJECTED"===o[n]?s.fbStatus="REJECTED":s&&"APPROVED"===o[n]&&(s.fbStatus="APPROVED");const r=null===(l=null==e?void 0:e[i])||void 0===l?void 0:l.variants;r&&r[n]&&(r[n]=s)}))})),console.log("vj: updated Products",e),b({type:"productsPaged",data:{collectionId:N,products:e}})})).catch((o=>{const e=Object.assign({},t);Object.keys(t).forEach((o=>{var i,n,c;console.log("vj: response variants",null===(i=null==t?void 0:t[o])||void 0===i?void 0:i.variants),Object.keys(null!==(c=null===(n=null==t?void 0:t[o])||void 0===n?void 0:n.variants)&&void 0!==c?c:{}).forEach((i=>{var n,c;const l=null===(n=null==t?void 0:t[o].variants)||void 0===n?void 0:n[i];l&&(l.fbStatus="APPROVED");const s=null===(c=null==e?void 0:e[o])||void 0===c?void 0:c.variants;s&&s[i]&&(s[i]=l)}))})),console.log("vj: fetchFbStatusAndDispatchProducts updated Products",e),b({type:"productsPaged",data:{collectionId:N,products:e}})}))};a((()=>{console.log("vj: observertarget",_.current);const o=new IntersectionObserver((o=>{console.log("vj: observertargetinside",o),o[0].isIntersecting&&(console.log("vj: nextPageRef",q.current,eo),q.current>=0&&(T(!0),Q(!0),x(N,V,q.current).then((o=>{if(console.log("vj: fetched products",o,eo,Object.keys(o).length),Object.keys(o).length<10&&(console.log("vj: setHasAllCollectionLoaded ",!0),eo.current=!0),Object.keys(o).length){const t=co(o);lo(t,o),q.current+=1}Q(!1),T(!1)})).catch()))}),{threshold:1});return _.current&&o.observe(_.current),()=>{_.current&&o.unobserve(_.current)}}),[_]);const so=()=>{console.log("vj: getProductsForCollection"),T(!0),$(!0),x(N,V,q.current).then((o=>{if(Object.keys(o).length<10&&(console.log("vj: setHasAllCollectionLoaded ",!0),eo.current=!0),Object.keys(o).length){to(Object.assign(Object.assign({},oo),{products:o})),console.log("vj: next page when products loaded",q.current);const t=co(o);lo(t,o),q.current+=1}T(!1),$(!1)})).catch()},ro=(o,t)=>{const e=D(t,v);O({type:o,data:Object.assign(Object.assign({},e),{isRestricted:R})})};return o("div",{children:[o(P,{children:[t(p,{Icon:i,height:16,onClick:()=>{A("collections")}}),t(y,Object.assign({style:{color:u.content.secondary}},{children:v.name}))]}),!F&&t("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:t(g,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Z&&X.length?t(m,{size:"small",color:u.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:X,onChangeText:o=>{o.length&&o.trim().length?Y(o):Y("")},placeholder:"Search products in this collection..."})})),o("div",{children:[Object.keys((null==oo?void 0:oo.products)||[]).length>0&&!io&&!X.length&&!B&&o(S,{children:[t(h,{isChecked:!!(null==j?void 0:j[N]),isPartiallyChecked:(o=>{var t;let e=0,i=0;if(j[o]){const n=null==v?void 0:v.products;n&&Object.keys(n).forEach((o=>{var t;const i=null===(t=n[o])||void 0===t?void 0:t.variants;i&&Object.keys(i).forEach((o=>e+=1))}));const c=null===(t=j[o])||void 0===t?void 0:t.products;return c&&Object.keys(c).forEach((o=>{var t;const e=null===(t=c[o])||void 0===t?void 0:t.variants;e&&Object.keys(e).forEach((()=>i+=1))})),i>0&&e!==i}return!1})(N),onValueChange:function(o){O(o?{type:"selected",data:{id:N,val:v}}:{type:"unselected",data:{id:N}})}}),t("div",Object.assign({style:{width:40,height:40}},{children:t(n,{})})),t(k,{children:"All Products"})]}),Object.keys((null==oo?void 0:oo.products)||[]).length?Object.keys(oo.products||[]).map((o=>t(w,{outOfStockAction:U,collectionId:N,isProductPartiallyChecked:no(o),productId:o,data:oo.products[o],selectedData:j,selectedCollectionsDispatch:O,viewOnly:!H&&!!io,upliftAdditions:ro,hideProductCheckbox:B,hideVariantCheckbox:L,hideProductVariants:W,pickerType:J,onInfoIconClick:K,showProductDetailInfoIcon:M},o))):Z?[1,2,3,4,5,6,7,8,9,10].map(((o,e)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(f,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),e))):t(I,{title:"No products to show",subtitle:X.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."}),t("div",{ref:_})]}),G&&[1,2,3,4,5].map(((o,e)=>t("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:t(f,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),e)))]})},w=e=>{const{collectionId:i,productId:n,data:c,selectedData:l,selectedCollectionsDispatch:s,viewOnly:r,upliftAdditions:d,isProductPartiallyChecked:a,hideProductCheckbox:u,outOfStockAction:v,hideVariantCheckbox:h,hideProductVariants:p,pickerType:g,onInfoIconClick:f,showProductDetailInfoIcon:b}=e,m=o=>{var t,e,c,s,r,d;if(!(null===(e=null===(t=null==l?void 0:l[i])||void 0===t?void 0:t.products)||void 0===e?void 0:e[n]))return!1;return!!(null===(d=null===(r=null===(s=null===(c=null==l?void 0:l[i])||void 0===c?void 0:c.products)||void 0===s?void 0:s[n])||void 0===r?void 0:r.variants)||void 0===d?void 0:d[o])};return o("div",{children:[t(A,{isVariant:!1,data:c,productId:n,collectionId:i,isSelected:!!(null===(y=null===(j=null==l?void 0:l[i])||void 0===j?void 0:j.products)||void 0===y?void 0:y[n]),isPartiallyChecked:a,selectedCollectionsDispatch:s,upliftAdditions:d,viewOnly:r,hideProductCheckbox:u,hideVariantCheckbox:h,hideProductVariants:p,pickerType:g,outOfStockAction:v,onInfoIconClick:f,showProductDetailInfoIcon:b},n),p?null:Object.keys(c.variants||[]).map((o=>t(A,{isVariant:!0,hideVariantCheckbox:h,data:c.variants[o],variantId:o,productId:n,viewOnly:r,upliftAdditions:d,collectionId:i,isSelected:m(o),selectedCollectionsDispatch:s,outOfStockAction:v,onInfoIconClick:f,showProductDetailInfoIcon:b},o)))]});var j,y},A=i=>{const{isVariant:n,data:c,productId:l,collectionId:s,variantId:r,isSelected:d,selectedCollectionsDispatch:a,viewOnly:u,upliftAdditions:g,isPartiallyChecked:f,hideProductCheckbox:m,outOfStockAction:y,hideVariantCheckbox:I,hideProductVariants:C,pickerType:P,onInfoIconClick:S,showProductDetailInfoIcon:E}=i;return o(x,Object.assign({isVariant:n,onClick:o=>{"PRODUCT"===P&&C&&(o.stopPropagation(),a({type:"reset",data:{}}),g("variantSelected",{productId:l,variantId:r||Object.keys(c.variants)[0],collectionId:s,variant:c}))},isActive:d},{children:[n&&!u&&!I||!n&&!u&&!m?t(h,{isChecked:d,isPartiallyChecked:f||!1,onValueChange:function(o){n?o?g("variantSelected",{productId:l,variantId:r,collectionId:s,variant:c}):a({type:"variantUnselected",data:{productId:l,variantId:r,collectionId:s}}):o?g("productSelected",{productId:l,collectionId:s,product:c}):a({type:"productUnselected",data:{productId:l,collectionId:s}})}}):t(e,{}),t("div",{children:t(b,{width:40,height:40,imageUrl:c.image,alt:"Item",borderRadius:4})}),t(j,Object.assign({body:c.name,placement:"bottom",delay:400},{children:o("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[o("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t(k,Object.assign({numberOfLines:1},{children:c.name})),E&&n&&t(p,{onClick:()=>{null==S||S(c)},Icon:v,width:20,height:20})]})),t(O,{isVariant:n,data:c,outOfStockAction:y})]}))}))]}))};export{A as ProductCard,w as ProductGroup,V as ProductsScreen};
1
+ import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import d from"../../assets/icons/search.svg.js";import{cloneDeep as r}from"lodash";import{useContext as n,useState as l,useEffect as s}from"react";import{Tag as a}from"../tag/Tag.js";import{COLORS as u}from"../../constants/Theme.js";import{CheckBox as p}from"../checkBox/CheckBox.js";import{IconButton as h}from"../icon-button/IconButton.js";import{Input as v}from"../input/Input.js";import{BikShimmer as m}from"../shimmer/ShimmerComponent/BikShimmer.js";import{ShimmerImage as y}from"../shimmer-image/ShimmerImage.js";import{Spinner as f}from"../spinner/Spinner.js";import{Tooltip as g}from"../tooltips/Tooltip.js";import{BodyCaption as k,TitleRegular as b}from"../TypographyStyle.js";import{truncate as j}from"./collectionScreen.js";import{EmptyState as C}from"./emptyState.js";import{ProductHelper as I}from"./helpers/ProductHelper.js";import{CollectionIdContext as O}from"./reducers.js";import{ProductScreenHeader as x,ProductScreenCollectionCardStyle as P,ProductCardStyle as S}from"./style.js";import{OUT_OF_STOCK_ACTION as V}from"./type.js";import{liftTheStateUp as T}from"./utility.js";const w=o=>{const a=n(O),{data:y,collectionsDispatch:g,selectedData:j,selectedCollectionsDispatch:I,productFetcher:S,storeId:w,setScreen:E,setSaveDisabled:A,hideInCollectionSearch:B,customCollectionRestriction:R,hideProductCheckbox:U,outOfStockAction:F=V.BLUR,hideVariantCheckbox:H=!1,selectProductsFromCustomCollection:L=!1,pickerType:W,hideProductVariants:z}=o,[K,N]=l(""),[_,q]=l(!1),[G,J]=l(y);s((()=>{const t=setTimeout((()=>{K.length?(q(!0),o.searchInCollectionFetcher(w,a,K).then((t=>{var e;const o=r(y);o.products={};for(const i of t)(null===(e=null==y?void 0:y.products)||void 0===e?void 0:e[i])&&(o.products[i]=y.products[i]);J(o),A(!1),q(!1)}))):J(y)}),800);return()=>clearTimeout(t)}),[K]);const M=!!R&&y.isSmartCollection,Q=t=>{var e,o,i,c,d,r,n,l;let s=0,u=0;return!!((null===(o=null===(e=null==j?void 0:j[a])||void 0===e?void 0:e.products)||void 0===o?void 0:o[t])&&(null===(d=Object.keys((null===(c=null===(i=null==y?void 0:y.products)||void 0===i?void 0:i[t])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>u++)),Object.keys((null===(l=null===(n=null===(r=null==j?void 0:j[a])||void 0===r?void 0:r.products)||void 0===n?void 0:n[t])||void 0===l?void 0:l.variants)||[]).forEach((()=>s++)),s>0&&u!==s))};s((()=>{(null==y?void 0:y.products)||X()}),[]);const X=()=>{A(!0),q(!0),S(a,w).then((t=>{Object.keys(t).length&&(g({type:"productsFetched",data:{collectionId:a,products:t}}),J(Object.assign(Object.assign({},G),{products:t}))),A(!1),q(!1)})).catch()},Y=(t,e)=>{const o=T(e,y);I({type:t,data:Object.assign(Object.assign({},o),{isRestricted:R})})};return t("div",{children:[t(x,{children:[e(h,{Icon:i,height:16,onClick:()=>{E("collections")}}),e(k,Object.assign({style:{color:u.content.secondary}},{children:y.name}))]}),!B&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(v,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>_&&K.length?e(f,{size:"small",color:u.content.primary}):e(d,{})},id:"listInput",height:"24px",type:"text",value:K,onChangeText:t=>{t.length&&t.trim().length?N(t):N("")},placeholder:"Search products in this collection..."})})),t("div",{children:[Object.keys((null==G?void 0:G.products)||[]).length>0&&!M&&!K.length&&!U&&t(P,{children:[e(p,{isChecked:!!(null==j?void 0:j[a]),isPartiallyChecked:(t=>{var e;let o=0,i=0;if(j[t]){const c=null==y?void 0:y.products;c&&Object.keys(c).forEach((t=>{var e;const i=null===(e=c[t])||void 0===e?void 0:e.variants;i&&Object.keys(i).forEach((t=>o+=1))}));const d=null===(e=j[t])||void 0===e?void 0:e.products;return d&&Object.keys(d).forEach((t=>{var e;const o=null===(e=d[t])||void 0===e?void 0:e.variants;o&&Object.keys(o).forEach((()=>i+=1))})),i>0&&o!==i}return!1})(a),onValueChange:function(t){I(t?{type:"selected",data:{id:a,val:y}}:{type:"unselected",data:{id:a}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(b,{children:"All Products"})]}),Object.keys((null==G?void 0:G.products)||[]).length?Object.keys(G.products||[]).map((t=>e(D,{outOfStockAction:F,collectionId:a,isProductPartiallyChecked:Q(t),productId:t,data:G.products[t],selectedData:j,selectedCollectionsDispatch:I,viewOnly:!L&&!!M,upliftAdditions:Y,hideProductCheckbox:U,hideVariantCheckbox:H,hideProductVariants:z,pickerType:W},t))):_?[1,2,3,4,5,6,7,8,9,10].map(((t,o)=>e("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e(m,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),o))):e(C,{title:"No products to show",subtitle:K.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})]})]})},D=o=>{const{collectionId:i,productId:c,data:d,selectedData:r,selectedCollectionsDispatch:n,viewOnly:l,upliftAdditions:s,isProductPartiallyChecked:a,hideProductCheckbox:u,outOfStockAction:p,hideVariantCheckbox:h,hideProductVariants:v,pickerType:m}=o,y=t=>{var e,o,d,n,l,s;if(!(null===(o=null===(e=null==r?void 0:r[i])||void 0===e?void 0:e.products)||void 0===o?void 0:o[c]))return!1;return!!(null===(s=null===(l=null===(n=null===(d=null==r?void 0:r[i])||void 0===d?void 0:d.products)||void 0===n?void 0:n[c])||void 0===l?void 0:l.variants)||void 0===s?void 0:s[t])};return t("div",{children:[e(E,{isVariant:!1,data:d,productId:c,collectionId:i,isSelected:!!(null===(g=null===(f=null==r?void 0:r[i])||void 0===f?void 0:f.products)||void 0===g?void 0:g[c]),isPartiallyChecked:a,selectedCollectionsDispatch:n,upliftAdditions:s,viewOnly:l,hideProductCheckbox:u,hideVariantCheckbox:h,hideProductVariants:v,pickerType:m},c),v?null:Object.keys(d.variants||[]).map((t=>e(E,{isVariant:!0,hideVariantCheckbox:h,data:d.variants[t],variantId:t,productId:c,viewOnly:l,upliftAdditions:s,collectionId:i,isSelected:y(t),selectedCollectionsDispatch:n,outOfStockAction:p},t)))]});var f,g},E=i=>{const{isVariant:c,data:d,productId:r,collectionId:n,variantId:l,isSelected:s,selectedCollectionsDispatch:u,viewOnly:h,upliftAdditions:v,isPartiallyChecked:m,hideProductCheckbox:f,outOfStockAction:k,hideVariantCheckbox:C,hideProductVariants:O,pickerType:x}=i,P=I.getProductLabels(d,k);return t(S,Object.assign({isVariant:c,onClick:t=>{"PRODUCT"===x&&O&&(t.stopPropagation(),u({type:"reset",data:{}}),v("variantSelected",{productId:r,variantId:l||Object.keys(d.variants)[0],collectionId:n,variant:d}))},isActive:s},{children:[c&&!h&&!C||!c&&!h&&!f?e(p,{isChecked:s,isPartiallyChecked:m||!1,onValueChange:function(t){c?t?v("variantSelected",{productId:r,variantId:l,collectionId:n,variant:d}):u({type:"variantUnselected",data:{productId:r,variantId:l,collectionId:n}}):t?v("productSelected",{productId:r,collectionId:n,product:d}):u({type:"productUnselected",data:{productId:r,collectionId:n}})}}):e(o,{}),e("div",{children:e(y,{width:40,height:40,imageUrl:d.image,alt:"Item",borderRadius:4})}),e(g,Object.assign({body:d.name,placement:"bottom",delay:400},{children:t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e(b,{children:j(d.name,40,!0)}),P?e("div",Object.assign({style:{width:90,display:"flex"}},{children:e(a,{tagText:P,type:"warning",theme:"light"})})):e(o,{})]}))}))]}))};export{E as ProductCard,D as ProductGroup,w as ProductsScreen};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FbStatusFetcherReturn, SelectedItems } from '.';
2
+ import { SelectedItems } from '.';
3
3
  import { SelectedCollectionsActions } from './reducers';
4
4
  import { OUT_OF_STOCK_ACTION } from './type';
5
5
  interface RearrangeScreenInterface {
@@ -8,9 +8,6 @@ interface RearrangeScreenInterface {
8
8
  setScreen: React.Dispatch<React.SetStateAction<string>>;
9
9
  rearrangeViewType: 'grid' | 'list';
10
10
  outOfStockAction?: OUT_OF_STOCK_ACTION;
11
- scrollContainerRef: React.RefObject<HTMLDivElement>;
12
- storeId: string;
13
- fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
14
11
  }
15
12
  /**
16
13
  * Screen will be opened on two conditions -
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as r,useEffect as s}from"react";import{DragDropContext as c}from"react-beautiful-dnd";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as a}from"./emptyState.js";import{parseSelectedVariantsToArray as d}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as p}from"./style.js";import{useFetchFbStatusForCollections as m}from"./useFetchFbStatus.js";import{VariantsList as u,VariantsGrid as f}from"./variantComponents.js";const h=h=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:y,rearrangeViewType:b,outOfStockAction:g,scrollContainerRef:C,storeId:O,fbStatusFetcher:v}=h,[V,k]=r(d(j)),{fetchFbStatus:w}=m(j,O,S,v,!1);s((()=>{var t;null===(t=null==C?void 0:C.current)||void 0===t||t.scrollTo({top:0}),w(),k(d(j))}),[j]);return t(c,Object.assign({onDragEnd:t=>{if(!t.destination)return;const e=V,[o]=e.splice(t.source.index,1);e.splice(t.destination.index,0,o),e.forEach(((t,e)=>{t.displayOrder=e})),k(e)}},{children:[t(p,{children:[e(n,{Icon:o,width:16,height:16,color:i.content.secondary,onClick:()=>{y("collections")}}),e(l,Object.assign({color:i.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===b?e(u,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:S,outOfStockAction:g}):e(f,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:S}):e(a,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};export{h as RearrangeScreen};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as r,useEffect as s}from"react";import{DragDropContext as c}from"react-beautiful-dnd";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as a}from"./emptyState.js";import{parseSelectedVariantsToArray as d}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as p}from"./style.js";import{VariantsList as m,VariantsGrid as f}from"./variantComponents.js";const h=h=>{const{selectedCollections:u,selectedCollectionsDispatch:j,setScreen:y,rearrangeViewType:S,outOfStockAction:g}=h,[b,C]=r(d(u));s((()=>{C(d(u))}),[u]);return e(c,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=b,[o]=t.splice(e.source.index,1);t.splice(e.destination.index,0,o),t.forEach(((e,t)=>{e.displayOrder=t})),C(t)}},{children:[e(p,{children:[t(n,{Icon:o,width:16,height:16,color:i.content.secondary,onClick:()=>{y("collections")}}),t(l,Object.assign({color:i.content.secondary},{children:"All Products"}))]}),Object.keys(u).length>0?"list"===S?t(m,{selectedVariants:b,setSelectedVariants:C,selectedCollectionsDispatch:j,outOfStockAction:g}):t(f,{selectedVariants:b,setSelectedVariants:C,selectedCollectionsDispatch:j}):t(a,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};export{h as RearrangeScreen};
@@ -1 +1 @@
1
- import{cloneDeep as t}from"lodash";import{createContext as a}from"react";function d(a,d){var e,o,c,s,l,r;let n={},i="",u="",p="";switch(console.log("vj: selected Items",a),d.type){case"selected":return n=t(a),d.data.val.isSmartCollection&&(d.data.isRestricted&&(n={}),n.isCustom=!0),n[d.data.id]=d.data.val,n;case"unselected":return n=t(a),(null==n?void 0:n.isCustom)&&(n.isCustom=!1),delete n[d.data.id],n;case"productUnselected":return n=t(a),i=d.data.productId,u=d.data.collectionId,delete n[u].products[i],Object.keys(n[u].products).length||((null==n?void 0:n.isCustom)&&(n.isCustom=!1),delete n[u]),n;case"productSelected":return n=t(a),i=d.data.productId,u=d.data.collectionId,(null===(e=d.data.catalogOnlyData)||void 0===e?void 0:e.isSmartCollection)&&(d.data.isRestricted&&(n={}),n.isCustom=!0),(null==n?void 0:n[u])||(n[u]=d.data.catalogOnlyData,n[u].products={}),n[u].products[i]=d.data.product,n;case"variantSelected":return n=t(a),i=d.data.productId,u=d.data.collectionId,p=d.data.variantId,(null===(o=d.data.catalogOnlyData)||void 0===o?void 0:o.isSmartCollection)&&(d.data.isRestricted&&(n={}),n.isCustom=!0),(null==n?void 0:n[u])||(n[u]=d.data.catalogOnlyData,n[u].products={},n[u].products[i]=d.data.productOnlyData,n[u].products[i].variants={}),(null===(s=null===(c=null==n?void 0:n[u])||void 0===c?void 0:c.products)||void 0===s?void 0:s[i])||((null===(l=null==n?void 0:n[u])||void 0===l?void 0:l.products)||(n[u].products={}),n[u].products[i]=d.data.productOnlyData,n[u].products[i].variants={}),n[u].products[i].variants[p]=d.data.variant,n;case"variantUnselected":return n=t(a),i=d.data.productId,u=d.data.collectionId,p=d.data.variantId,delete n[u].products[i].variants[p],Object.keys(n[u].products[i].variants).length||(delete n[u].products[i],Object.keys(n[u].products).length||((null===(r=n[u])||void 0===r?void 0:r.isSmartCollection)&&(n.isCustom=!1),delete n[u])),n;case"reset":return{};default:return a}}function e(t,a){let d={};switch(a.type){case"fetched":return d=Object.assign({},a.data),d;case"productsFetched":return console.log("vj: productsFetched",{collections:t,action:a}),d=Object.assign({},t),d[a.data.collectionId].products=a.data.products,console.log("vj: collectionsCopy",{collectionsCopy:d}),d;case"paged":return console.log("vj: paged",{collections:t,action:a}),d=Object.assign(Object.assign({},t),a.data),d;case"productsPaged":return console.log("vj: pagedProducts",{collections:t,action:a}),d=Object.assign({},t),a.data.collectionId,d[a.data.collectionId].products=Object.assign(Object.assign({},d[a.data.collectionId].products),a.data.products),d;default:return{}}}const o=a("");export{o as CollectionIdContext,e as collectionsReducer,d as selectedColectionsReducer};
1
+ import{cloneDeep as t}from"lodash";import{createContext as a}from"react";function d(a,d){var e,o,c,s,r,l;let i={},u="",n="",p="";switch(d.type){case"selected":return i=t(a),d.data.val.isSmartCollection&&(d.data.isRestricted&&(i={}),i.isCustom=!0),i[d.data.id]=d.data.val,i;case"unselected":return i=t(a),(null==i?void 0:i.isCustom)&&(i.isCustom=!1),delete i[d.data.id],i;case"productUnselected":return i=t(a),u=d.data.productId,n=d.data.collectionId,delete i[n].products[u],Object.keys(i[n].products).length||((null==i?void 0:i.isCustom)&&(i.isCustom=!1),delete i[n]),i;case"productSelected":return i=t(a),u=d.data.productId,n=d.data.collectionId,(null===(e=d.data.catalogOnlyData)||void 0===e?void 0:e.isSmartCollection)&&(d.data.isRestricted&&(i={}),i.isCustom=!0),(null==i?void 0:i[n])||(i[n]=d.data.catalogOnlyData,i[n].products={}),i[n].products[u]=d.data.product,i;case"variantSelected":return i=t(a),u=d.data.productId,n=d.data.collectionId,p=d.data.variantId,(null===(o=d.data.catalogOnlyData)||void 0===o?void 0:o.isSmartCollection)&&(d.data.isRestricted&&(i={}),i.isCustom=!0),(null==i?void 0:i[n])||(i[n]=d.data.catalogOnlyData,i[n].products={},i[n].products[u]=d.data.productOnlyData,i[n].products[u].variants={}),(null===(s=null===(c=null==i?void 0:i[n])||void 0===c?void 0:c.products)||void 0===s?void 0:s[u])||((null===(r=null==i?void 0:i[n])||void 0===r?void 0:r.products)||(i[n].products={}),i[n].products[u]=d.data.productOnlyData,i[n].products[u].variants={}),i[n].products[u].variants[p]=d.data.variant,i;case"variantUnselected":return i=t(a),u=d.data.productId,n=d.data.collectionId,p=d.data.variantId,delete i[n].products[u].variants[p],Object.keys(i[n].products[u].variants).length||(delete i[n].products[u],Object.keys(i[n].products).length||((null===(l=i[n])||void 0===l?void 0:l.isSmartCollection)&&(i.isCustom=!1),delete i[n])),i;case"reset":return{};default:return a}}function e(t,a){let d={};switch(a.type){case"fetched":return d=Object.assign({},a.data),d;case"productsFetched":return d=Object.assign({},t),d[a.data.collectionId].products=a.data.products,d;case"paged":return d=Object.assign(Object.assign({},t),a.data),d;default:return{}}}const o=a("");export{o as CollectionIdContext,e as collectionsReducer,d as selectedColectionsReducer};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
2
+ import { Collection, SelectedItems } from '.';
3
3
  import { SelectedCollectionsActions } from './reducers';
4
4
  interface SearchScreenInterface {
5
5
  customCollectionRestriction?: boolean;
@@ -15,8 +15,6 @@ interface SearchScreenInterface {
15
15
  pickerType?: 'COLLECTION' | 'PRODUCT';
16
16
  hideProductVariants?: boolean;
17
17
  hideProductCheckbox?: boolean;
18
- storeId: string;
19
- fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
20
18
  }
21
19
  export declare const SearchScreen: (props: SearchScreenInterface) => import("react/jsx-runtime").JSX.Element;
22
20
  export {};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as t,Fragment as e}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import{IconButton as r}from"../icon-button/IconButton.js";import{BodyCaption as c}from"../TypographyStyle.js";import{EmptyState as l}from"./emptyState.js";import{ProductGroup as s}from"./productScreen.js";import{SelectedScreenHeader as d}from"./style.js";import{useFetchFbStatusForCollections as n}from"./useFetchFbStatus.js";import{liftTheStateUp as u}from"./utility.js";const a=a=>{const{customCollectionRestriction:v,selectedCollections:p,searchedCollections:h,selectedCollectionsDispatch:m,setScreen:f,collections:y,onBackPress:j,hideVariantCheckbox:b,pickerType:k,hideProductVariants:C,hideProductCheckbox:O,storeId:P,fbStatusFetcher:S}=a;n(h,P,m,S);const g=(o,t)=>{var e,i,r,c,l,s,d,n,u;let a=0,v=0;return!!((null===(i=null===(e=null==p?void 0:p[o])||void 0===e?void 0:e.products)||void 0===i?void 0:i[t])&&(null===(s=Object.keys((null===(l=null===(c=null===(r=null==y?void 0:y[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[t])||void 0===l?void 0:l.variants)||[]))||void 0===s||s.forEach((()=>v++)),Object.keys((null===(u=null===(n=null===(d=null==p?void 0:p[o])||void 0===d?void 0:d.products)||void 0===n?void 0:n[t])||void 0===u?void 0:u.variants)||[]).forEach((()=>a++)),a>0&&v!==a))};return o("div",{children:[o(d,{children:[t(r,{Icon:i,onClick:()=>{f("collections"),j()}}),t(c,{children:"Searched Products"})]}),t("div",{children:Object.keys(h).length?t(e,{children:Object.keys(h).map((o=>{var e;return Object.keys((null===(e=null==h?void 0:h[o])||void 0===e?void 0:e.products)||[]).map((e=>{let i=!1;return(null==h?void 0:h.isCustom)&&(i=!0),t(s,{collectionId:o,upliftAdditions:(t,e)=>((o,t,e)=>{const i=u(e,h[o]);m({type:t,data:Object.assign(Object.assign({},i),{isRestricted:v})})})(o,t,e),productId:e,data:h[o].products[e],isProductPartiallyChecked:g(o,e),selectedData:p,selectedCollectionsDispatch:m,viewOnly:i,hideProductCheckbox:O,hideVariantCheckbox:b,hideProductVariants:C,pickerType:k},e)}))}))}):t(l,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{a as SearchScreen};
1
+ import{jsxs as o,jsx as t,Fragment as e}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import{IconButton as r}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as c}from"./emptyState.js";import{ProductGroup as d}from"./productScreen.js";import{SelectedScreenHeader as s}from"./style.js";import{liftTheStateUp as n}from"./utility.js";const u=u=>{const{customCollectionRestriction:a,selectedCollections:v,searchedCollections:p,selectedCollectionsDispatch:h,setScreen:m,collections:y,onBackPress:f,hideVariantCheckbox:j,pickerType:k,hideProductVariants:b,hideProductCheckbox:C}=u,O=(o,t)=>{var e,i,r,l,c,d,s,n,u;let a=0,p=0;return!!((null===(i=null===(e=null==v?void 0:v[o])||void 0===e?void 0:e.products)||void 0===i?void 0:i[t])&&(null===(d=Object.keys((null===(c=null===(l=null===(r=null==y?void 0:y[o])||void 0===r?void 0:r.products)||void 0===l?void 0:l[t])||void 0===c?void 0:c.variants)||[]))||void 0===d||d.forEach((()=>p++)),Object.keys((null===(u=null===(n=null===(s=null==v?void 0:v[o])||void 0===s?void 0:s.products)||void 0===n?void 0:n[t])||void 0===u?void 0:u.variants)||[]).forEach((()=>a++)),a>0&&p!==a))};return o("div",{children:[o(s,{children:[t(r,{Icon:i,onClick:()=>{m("collections"),f()}}),t(l,{children:"Searched Products"})]}),t("div",{children:Object.keys(p).length?t(e,{children:Object.keys(p).map((o=>{var e;return Object.keys((null===(e=null==p?void 0:p[o])||void 0===e?void 0:e.products)||[]).map((e=>{let i=!1;return(null==p?void 0:p.isCustom)&&(i=!0),t(d,{collectionId:o,upliftAdditions:(t,e)=>((o,t,e)=>{const i=n(e,p[o]);h({type:t,data:Object.assign(Object.assign({},i),{isRestricted:a})})})(o,t,e),productId:e,data:p[o].products[e],isProductPartiallyChecked:O(o,e),selectedData:v,selectedCollectionsDispatch:h,viewOnly:i,hideProductCheckbox:C,hideVariantCheckbox:j,hideProductVariants:b,pickerType:k},e)}))}))}):t(c,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{u as SearchScreen};
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
2
+ import { Collection, SelectedItems } from '.';
3
3
  import { SelectedCollectionsActions } from './reducers';
4
- import { OUT_OF_STOCK_ACTION } from './type';
5
4
  interface SelectedScreenInterface {
6
5
  selectedCollections: SelectedItems;
7
6
  selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
@@ -9,9 +8,6 @@ interface SelectedScreenInterface {
9
8
  collections: {
10
9
  [key: string]: Collection;
11
10
  };
12
- outOfStockAction?: OUT_OF_STOCK_ACTION;
13
- storeId: string;
14
- fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
15
11
  }
16
12
  export declare const SelectedScreen: (props: SelectedScreenInterface) => import("react/jsx-runtime").JSX.Element;
17
13
  export {};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as o,Fragment as e}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{IconButton as i}from"../icon-button/IconButton.js";import{BodyCaption as c}from"../TypographyStyle.js";import{EmptyState as r}from"./emptyState.js";import{ProductGroup as d}from"./productScreen.js";import{SelectedScreenHeader as s}from"./style.js";import{useFetchFbStatusForCollections as n}from"./useFetchFbStatus.js";const u=u=>{const{selectedCollections:v,selectedCollectionsDispatch:a,setScreen:p,collections:m,outOfStockAction:f,storeId:h,fbStatusFetcher:j}=u;n(v,h,a,j);const y=(t,o)=>{var e,l,i,c,r,d,s,n,u;let a=0,p=0;return!!((null===(l=null===(e=null==v?void 0:v[t])||void 0===e?void 0:e.products)||void 0===l?void 0:l[o])&&(null===(d=Object.keys((null===(r=null===(c=null===(i=null==m?void 0:m[t])||void 0===i?void 0:i.products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]))||void 0===d||d.forEach((()=>p++)),Object.keys((null===(u=null===(n=null===(s=null==v?void 0:v[t])||void 0===s?void 0:s.products)||void 0===n?void 0:n[o])||void 0===u?void 0:u.variants)||[]).forEach((()=>a++)),a>0&&p!==a))};return t("div",{children:[t(s,{children:[o(i,{Icon:l,onClick:()=>{p("collections")}}),o(c,{children:"Selected Products"})]}),o("div",{children:Object.keys(v).length>0?o(e,{children:Object.keys(v).map((t=>{var e;return Object.keys((null===(e=null==v?void 0:v[t])||void 0===e?void 0:e.products)||[]).map((e=>{let l=!1;return(null==v?void 0:v.isCustom)&&(l=!0),o(d,{upliftAdditions:null,collectionId:t,productId:e,data:v[t].products[e],isProductPartiallyChecked:y(t,e),selectedData:v,selectedCollectionsDispatch:a,viewOnly:l,outOfStockAction:f},e)}))}))}):o(r,{title:"No Products Selected",subtitle:"Select products will appear here"})})]})};export{u as SelectedScreen};
1
+ import{jsxs as o,jsx as t,Fragment as l}from"react/jsx-runtime";import e from"../../assets/icons/arrow_left.svg.js";import{IconButton as i}from"../icon-button/IconButton.js";import{BodyCaption as r}from"../TypographyStyle.js";import{EmptyState as d}from"./emptyState.js";import{ProductGroup as c}from"./productScreen.js";import{SelectedScreenHeader as n}from"./style.js";const s=s=>{const{selectedCollections:u,selectedCollectionsDispatch:v,setScreen:p,collections:a}=s,m=(o,t)=>{var l,e,i,r,d,c,n,s,v;let p=0,m=0;return!!((null===(e=null===(l=null==u?void 0:u[o])||void 0===l?void 0:l.products)||void 0===e?void 0:e[t])&&(null===(c=Object.keys((null===(d=null===(r=null===(i=null==a?void 0:a[o])||void 0===i?void 0:i.products)||void 0===r?void 0:r[t])||void 0===d?void 0:d.variants)||[]))||void 0===c||c.forEach((()=>m++)),Object.keys((null===(v=null===(s=null===(n=null==u?void 0:u[o])||void 0===n?void 0:n.products)||void 0===s?void 0:s[t])||void 0===v?void 0:v.variants)||[]).forEach((()=>p++)),p>0&&m!==p))};return o("div",{children:[o(n,{children:[t(i,{Icon:e,onClick:()=>{p("collections")}}),t(r,{children:"Selected Products"})]}),t("div",{children:Object.keys(u).length>0?t(l,{children:Object.keys(u).map((o=>{var l;return Object.keys((null===(l=null==u?void 0:u[o])||void 0===l?void 0:l.products)||[]).map((l=>{let e=!1;return(null==u?void 0:u.isCustom)&&(e=!0),t(c,{upliftAdditions:null,collectionId:o,productId:l,data:u[o].products[l],isProductPartiallyChecked:m(o,l),selectedData:u,selectedCollectionsDispatch:v,viewOnly:e},l)}))}))}):t(d,{title:"No Products Selected",subtitle:"Select products will appear here"})})]})};export{s as SelectedScreen};
@@ -31,7 +31,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  justify-content: center;
34
- `,p=e.div`
34
+ `,l=e.div`
35
35
  display: flex;
36
36
  flex-direction: row;
37
37
  max-height: 32px;
@@ -41,10 +41,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
41
41
  align-items: center;
42
42
  padding: 8px 16px;
43
43
  margin-top: 16px;
44
- position: sticky;
45
- top: 0;
46
- z-index: 10;
47
- `,l=e.div`
44
+ `,p=e.div`
48
45
  display: flex;
49
46
  flex-direction: row;
50
47
  column-gap: 16px;
@@ -75,9 +72,6 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
75
72
  justify-content: flex-start;
76
73
  align-items: center;
77
74
  padding: 8px 16px;
78
- position: sticky;
79
- top: 0;
80
- z-index: 10;
81
75
  `,a=e.div`
82
76
  display: flex;
83
77
  flex-direction: column;
@@ -113,4 +107,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
113
107
  align-items: center;
114
108
  border: 1px solid ${i.stroke.primary};
115
109
  border-radius: 4px;
116
- `;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,l as ProductScreenCollectionCardStyle,p as ProductScreenHeader,o as ScrollContainerStyle,c as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
110
+ `;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,p as ProductScreenCollectionCardStyle,l as ProductScreenHeader,o as ScrollContainerStyle,c as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/delete.svg.js";import i from"../../assets/icons/drag_handle.svg.js";import{COLORS as r}from"../../constants/Theme.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as c}from"../TypographyStyle.js";import{truncate as m}from"./collectionScreen.js";import{ProductPickerTag as s}from"./ProductPickerTag.js";import{VariantCardListStyle as l,VariantCardGridStyle as d}from"./style.js";import{Tooltip as h}from"../tooltips/Tooltip.js";const p=d=>{const{data:p,selectedCollectionsDispatch:g,outOfStockAction:u}=d,j=t=>{let e;return e=p.name.includes(p.productName)?p.name:`${p.productName} ${p.name}`,t?m(e,34,!0):e};return t(l,{children:[e(i,{width:24,height:24,color:r.content.placeholder}),e("div",{children:e(n,{width:40,height:40,imageUrl:p.image,alt:"Item",borderRadius:4},p.variantId)}),t("div",Object.assign({className:"tooltip-title-tag"},{children:[e(h,Object.assign({body:j(!1),placement:"bottom",delay:400},{children:e(c,{children:j(!0)})})),e(s,{isVariant:!0,data:p,outOfStockAction:u})]})),e(a,{Icon:()=>e(o,{width:24,height:24,color:r.content.placeholder}),onClick:()=>{g&&g({type:"variantUnselected",data:{productId:p.productId,variantId:p.variantId,collectionId:p.collectionId}}),d.onDelete&&d.onDelete()}})]})},g=t=>{const{data:o}=t;return e(d,{children:e(h,Object.assign({body:o.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e(n,{width:72,height:72,imageUrl:o.image,alt:"Item",borderRadius:4})}))})};export{g as VariantCardGridView,p as VariantCardListView};
1
+ import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/delete.svg.js";import r from"../../assets/icons/drag_handle.svg.js";import{COLORS as a}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as l}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as s}from"../TypographyStyle.js";import{truncate as c}from"./collectionScreen.js";import{ProductHelper as m}from"./helpers/ProductHelper.js";import{VariantCardListStyle as d,VariantCardGridStyle as h}from"./style.js";import{Tooltip as p}from"../tooltips/Tooltip.js";import{Tag as g}from"../tag/Tag.js";const j=h=>{const{data:j,selectedCollectionsDispatch:u,outOfStockAction:f}=h,b=m.getProductLabels(j,f),y=t=>{let e;return e=j.name.includes(j.productName)?j.name:`${j.productName} ${j.name}`,t?c(e,34,!0):e};return t(d,{children:[e(r,{width:24,height:24,color:a.content.placeholder}),e("div",{children:e(l,{width:40,height:40,imageUrl:j.image,alt:"Item",borderRadius:4},j.variantId)}),t("div",Object.assign({className:"tooltip-title-tag"},{children:[e(p,Object.assign({body:y(!1),placement:"bottom",delay:400},{children:e(s,{children:y(!0)})})),b?e("div",Object.assign({style:{width:90,display:"flex"}},{children:e(g,{tagText:b,type:"warning",theme:"light"})})):e(o,{})]})),e(n,{Icon:()=>e(i,{width:24,height:24,color:a.content.placeholder}),onClick:()=>{u&&u({type:"variantUnselected",data:{productId:j.productId,variantId:j.variantId,collectionId:j.collectionId}}),h.onDelete&&h.onDelete()}})]})},u=t=>{const{data:o}=t;return e(h,{children:e(p,Object.assign({body:o.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e(l,{width:72,height:72,imageUrl:o.image,alt:"Item",borderRadius:4})}))})};export{u as VariantCardGridView,j as VariantCardListView};
@@ -1 +1 @@
1
- import{jsx as i,jsxs as e}from"react/jsx-runtime";import n from"../../assets/icons/bik_ai_stars_icon.svg.js";import r from"react";import{BodyCaption as a}from"../TypographyStyle.js";import{ValidTagTypeMap as t}from"./model.js";import{Tag as s}from"./Tag.styled.js";import{getTagIconColor as c}from"./themes.js";const o=o=>{let{tagText:l,LeadingIcon:g,TrailingIcon:d,onLeadingIconClicked:m,leadingIconId:p,trailingIconId:j,onTrailingIconClicked:b,theme:h="light",type:u="neutral",variant:y="regular",version:O,cursor:f}=o;var v;let I=l,k=h,T=u;t[y][u]||(T="neutral"),"circle"===y&&(k="dark","number"==typeof I&&I>99&&(I="99+"));const w={height:16,width:16,color:c(h,T),style:{display:"block"}},N=()=>"ai"!==u||g?g:n;return i(s,Object.assign({cursor:f,theme:k,type:u,variant:y,version:O},{children:e("div",Object.assign({className:"container"},{children:[N()&&i("button",Object.assign({className:"icon-leading",onClick:m,id:`${p}-wrapper`||"leading-icon-wrapper"},{children:r.createElement(null!==(v=N())&&void 0!==v?v:"",Object.assign(Object.assign({},w),{id:p||"leading-icon"}))})),i(a,Object.assign({className:"text"},{children:I})),d&&i("button",Object.assign({className:"icon-trailing",onClick:b,id:`${j}-wrapper`||"trailing-icon-wrapper"},{children:r.createElement(d,Object.assign(Object.assign({},w),{id:j||"trailing-icon"}))}))]}))}))};o.displayName="Tag";export{o as Tag};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{BodyCaption as r}from"../TypographyStyle.js";import{ValidTagTypeMap as t}from"./model.js";import{Tag as a}from"./Tag.styled.js";import{getTagIconColor as c}from"./themes.js";const o=o=>{let{tagText:s,LeadingIcon:l,TrailingIcon:g,onLeadingIconClicked:d,leadingIconId:m,trailingIconId:p,onTrailingIconClicked:j,theme:b="light",type:h="neutral",variant:u="regular",version:y,cursor:O}=o,I=s,f=b,T=h;t[u][h]||(T="neutral"),"circle"===u&&(f="dark","number"==typeof I&&I>99&&(I="99+"));const k={height:16,width:16,color:c(b,T),style:{display:"block"}};return e(a,Object.assign({cursor:O,theme:f,type:h,variant:u,version:y},{children:i("div",Object.assign({className:"container"},{children:[l&&e("button",Object.assign({className:"icon-leading",onClick:d,id:`${m}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(l,Object.assign(Object.assign({},k),{id:m||"leading-icon"}))})),e(r,Object.assign({className:"text"},{children:I})),g&&e("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(g,Object.assign(Object.assign({},k),{id:p||"trailing-icon"}))}))]}))}))};o.displayName="Tag";export{o as Tag};
@@ -1 +1 @@
1
- import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as t}from"./themes.js";const e=c("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var l;return null!==(l=c.cursor)&&void 0!==l?l:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>l(c.variant)),";background:",(c=>b(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${d(c.type)};`)," .text{color:",(c=>t(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmN1cnNvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ2RlZmF1bHQnOyB9fTtcblx0JHsocHJvcHMpID0+IHByb3BzLnZhcmlhbnQgPT09ICdyZWd1bGFyJ1xyXG4gICAgPyBgZGlzcGxheTogYmxvY2s7XG5cdFx0ICAgICBtaW4taGVpZ2h0OiAyNnB4O1xuXHRcdGBcclxuICAgIDogYG1pbi1oZWlnaHQ6IDIwcHg7YH1cblx0LmNvbnRhaW5lciB7XG5cdFx0ZGlzcGxheTogZmxleDtcblx0XHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRcdGdhcDogNnB4O1xuXHRcdHBhZGRpbmc6ICR7KHByb3BzKSA9PiBnZXRQYWRkaW5nKHByb3BzLnZhcmlhbnQpfTtcblxuXHRcdGJhY2tncm91bmQ6ICR7KHByb3BzKSA9PiBnZXRCYWNrZ3JvdW5kQ29sb3IocHJvcHMudGhlbWUsIHByb3BzLnR5cGUpfTtcblxuXHRcdGJvcmRlci1yYWRpdXM6ICR7KHByb3BzKSA9PiAocHJvcHMudmFyaWFudCA9PT0gJ3JlZ3VsYXInID8gJzRweCcgOiAnMTJweCcpfTtcblxuXHRcdCR7KHByb3BzKSA9PiBwcm9wcy50aGVtZSA9PT0gJ2xpZ2h0JyAmJlxyXG4gICAgYGJvcmRlcjogJHtwcm9wcy52ZXJzaW9uID09PSAnMi4wJyA/IDAuNSA6IDF9cHggc29saWQgJHtnZW5lcmF0ZUJvcmRlcihwcm9wcy50eXBlKX07YH1cblxuXHRcdC50ZXh0IHtcblx0XHRcdGNvbG9yOiAkeyhwcm9wcykgPT4gZ2V0VGV4dENvbG9yKHByb3BzLnRoZW1lLCBwcm9wcy50eXBlKX07XG5cdFx0fVxuXG5cdFx0Lmljb24tdHJhaWxpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXG5cdFx0Lmljb24tbGVhZGluZyB7XG5cdFx0XHRhbGw6IHVuc2V0O1xuXHRcdFx0ZGlzcGxheTogZmxleDtcblx0XHR9XG5cdH1cbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRhZy5zdHlsZWQuanMubWFwIl19 */"));export{e as Tag};
1
+ import c from"@emotion/styled/base";import{getPadding as l,getBackgroundColor as b,generateBorder as d,getTextColor as t}from"./themes.js";const e=c("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var l;return null!==(l=c.cursor)&&void 0!==l?l:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>l(c.variant)),";background-color:",(c=>b(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${d(c.type)};`)," .text{color:",(c=>t(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0UGFkZGluZywgZ2V0VGV4dENvbG9yLCB9IGZyb20gJy4vdGhlbWVzJztcclxuZXhwb3J0IGNvbnN0IFRhZyA9IHN0eWxlZC5kaXYgYFxuXHRjdXJzb3I6ICR7KHByb3BzKSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHByb3BzLmN1cnNvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogJ2RlZmF1bHQnOyB9fTtcblx0JHsocHJvcHMpID0+IHByb3BzLnZhcmlhbnQgPT09ICdyZWd1bGFyJ1xyXG4gICAgPyBgZGlzcGxheTogYmxvY2s7XG5cdFx0ICAgICBtaW4taGVpZ2h0OiAyNnB4O1xuXHRcdGBcclxuICAgIDogYG1pbi1oZWlnaHQ6IDIwcHg7YH1cblx0LmNvbnRhaW5lciB7XG5cdFx0ZGlzcGxheTogZmxleDtcblx0XHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRcdGdhcDogNnB4O1xuXHRcdHBhZGRpbmc6ICR7KHByb3BzKSA9PiBnZXRQYWRkaW5nKHByb3BzLnZhcmlhbnQpfTtcblxuXHRcdGJhY2tncm91bmQtY29sb3I6ICR7KHByb3BzKSA9PiBnZXRCYWNrZ3JvdW5kQ29sb3IocHJvcHMudGhlbWUsIHByb3BzLnR5cGUpfTtcblxuXHRcdGJvcmRlci1yYWRpdXM6ICR7KHByb3BzKSA9PiAocHJvcHMudmFyaWFudCA9PT0gJ3JlZ3VsYXInID8gJzRweCcgOiAnMTJweCcpfTtcblxuXHRcdCR7KHByb3BzKSA9PiBwcm9wcy50aGVtZSA9PT0gJ2xpZ2h0JyAmJlxyXG4gICAgYGJvcmRlcjogJHtwcm9wcy52ZXJzaW9uID09PSAnMi4wJyA/IDAuNSA6IDF9cHggc29saWQgJHtnZW5lcmF0ZUJvcmRlcihwcm9wcy50eXBlKX07YH1cblxuXHRcdC50ZXh0IHtcblx0XHRcdGNvbG9yOiAkeyhwcm9wcykgPT4gZ2V0VGV4dENvbG9yKHByb3BzLnRoZW1lLCBwcm9wcy50eXBlKX07XG5cdFx0fVxuXG5cdFx0Lmljb24tdHJhaWxpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXG5cdFx0Lmljb24tbGVhZGluZyB7XG5cdFx0XHRhbGw6IHVuc2V0O1xuXHRcdFx0ZGlzcGxheTogZmxleDtcblx0XHR9XG5cdH1cbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRhZy5zdHlsZWQuanMubWFwIl19 */"));export{e as Tag};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { MouseEventHandler } from 'react';
3
3
  export type TagTheme = 'light' | 'dark';
4
4
  export type TagVariant = 'regular' | 'circle';
5
- export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
5
+ export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey';
6
6
  export declare const ValidTagTypeMap: {
7
7
  regular: {
8
8
  negative: boolean;
@@ -12,7 +12,6 @@ export declare const ValidTagTypeMap: {
12
12
  white: boolean;
13
13
  purple: boolean;
14
14
  blue: boolean;
15
- ai: boolean;
16
15
  };
17
16
  circle: {
18
17
  negative: boolean;
@@ -21,7 +20,6 @@ export declare const ValidTagTypeMap: {
21
20
  neutral: boolean;
22
21
  blue: boolean;
23
22
  grey: boolean;
24
- ai: boolean;
25
23
  };
26
24
  };
27
25
  export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
@@ -1 +1 @@
1
- const e={regular:{negative:!0,warning:!0,positive:!0,neutral:!0,white:!0,purple:!0,blue:!0,ai:!0},circle:{negative:!0,warning:!0,positive:!0,neutral:!0,blue:!0,grey:!0,ai:!0}};export{e as ValidTagTypeMap};
1
+ const e={regular:{negative:!0,warning:!0,positive:!0,neutral:!0,white:!0,purple:!0,blue:!0},circle:{negative:!0,warning:!0,positive:!0,neutral:!0,blue:!0,grey:!0}};export{e as ValidTagTypeMap};
@@ -1 +1 @@
1
- import{COLORS as r}from"../../constants/Theme.js";const n={blue:{iconColor:{light:r.content.blue,dark:r.content.primaryInverse},textColor:{light:r.content.blue,dark:r.content.primaryInverse},border:r.stroke.blue.lightAlt,backgroundColor:{light:r.background.blue.light,dark:r.content.blue,circle:r.content.blue}},purple:{iconColor:{light:r.background.inverseLight,dark:r.content.primaryInverse},textColor:{light:r.background.inverseLight,dark:r.content.primaryInverse},border:r.stroke.brandLightAlt,backgroundColor:{light:r.background.brandLight,dark:r.background.inverse,circle:r.background.inverse}},negative:{iconColor:{light:r.content.negative,dark:r.content.primaryInverse},textColor:{light:r.content.negative,dark:r.content.primaryInverse},border:r.stroke.negative.lightAlt,backgroundColor:{light:r.background.negative.light,dark:r.background.negative.vibrant,circle:r.background.negative.vibrant}},positive:{iconColor:{light:r.content.positive,dark:r.content.primaryInverse},textColor:{light:r.content.positive,dark:r.content.primaryInverse},border:r.stroke.positive.lightAlt,backgroundColor:{light:r.background.positive.light,dark:r.background.positive.vibrant,circle:r.background.positive.vibrant}},warning:{iconColor:{light:r.content.warning,dark:r.content.primary},textColor:{light:r.content.warning,dark:r.content.primary},border:r.stroke.warning.lightAlt,backgroundColor:{light:r.background.warning.light,dark:r.background.warning.vibrant,circle:r.background.warning.vibrant}},neutral:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.subdued,dark:r.background.inverse,circle:r.background.inverseLight}},white:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.standard,dark:r.background.inverse,circle:r.background.inverseLight}},grey:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.subdued,dark:r.content.secondary,circle:r.content.secondary}},ai:{iconColor:{light:r.content.primaryInverse,dark:r.content.primaryInverse},textColor:{light:r.content.primaryInverse,dark:r.content.primaryInverse},border:"none",backgroundColor:{light:r.surface.ai,dark:r.surface.ai,circle:r.surface.ai}}},e=(r,e)=>n[e].iconColor[r],t=(r,e)=>n[e].textColor[r],o=r=>n[r].border,i=(r,e)=>n[e].backgroundColor[r],a=r=>"regular"===r?"4px 8px":"2px 6px";export{o as generateBorder,i as getBackgroundColor,a as getPadding,e as getTagIconColor,t as getTextColor};
1
+ import{COLORS as r}from"../../constants/Theme.js";const n={blue:{iconColor:{light:r.content.blue,dark:r.content.primaryInverse},textColor:{light:r.content.blue,dark:r.content.primaryInverse},border:r.stroke.blue.lightAlt,backgroundColor:{light:r.background.blue.light,dark:r.content.blue,circle:r.content.blue}},purple:{iconColor:{light:r.background.inverseLight,dark:r.content.primaryInverse},textColor:{light:r.background.inverseLight,dark:r.content.primaryInverse},border:r.stroke.brandLightAlt,backgroundColor:{light:r.background.brandLight,dark:r.background.inverse,circle:r.background.inverse}},negative:{iconColor:{light:r.content.negative,dark:r.content.primaryInverse},textColor:{light:r.content.negative,dark:r.content.primaryInverse},border:r.stroke.negative.lightAlt,backgroundColor:{light:r.background.negative.light,dark:r.background.negative.vibrant,circle:r.background.negative.vibrant}},positive:{iconColor:{light:r.content.positive,dark:r.content.primaryInverse},textColor:{light:r.content.positive,dark:r.content.primaryInverse},border:r.stroke.positive.lightAlt,backgroundColor:{light:r.background.positive.light,dark:r.background.positive.vibrant,circle:r.background.positive.vibrant}},warning:{iconColor:{light:r.content.warning,dark:r.content.primary},textColor:{light:r.content.warning,dark:r.content.primary},border:r.stroke.warning.lightAlt,backgroundColor:{light:r.background.warning.light,dark:r.background.warning.vibrant,circle:r.background.warning.vibrant}},neutral:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.subdued,dark:r.background.inverse,circle:r.background.inverseLight}},white:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.standard,dark:r.background.inverse,circle:r.background.inverseLight}},grey:{iconColor:{light:r.content.secondary,dark:r.content.primaryInverse},textColor:{light:r.content.secondary,dark:r.content.primaryInverse},border:r.stroke.primary,backgroundColor:{light:r.surface.subdued,dark:r.content.secondary,circle:r.content.secondary}}},t=(r,t)=>n[t].iconColor[r],o=(r,t)=>n[t].textColor[r],e=r=>n[r].border,i=(r,t)=>n[t].backgroundColor[r],a=r=>"regular"===r?"4px 8px":"2px 6px";export{e as generateBorder,i as getBackgroundColor,a as getPadding,t as getTagIconColor,o as getTextColor};
@@ -1,3 +1,2 @@
1
1
  export * from './BaseWhatsappContentLang.helper';
2
2
  export * from '../components/curtain/CurtainHelper';
3
- export * from '../utils/resizeImage';
@@ -74,4 +74,3 @@ export * from './components/dashboard-review-popup';
74
74
  export * from './components/star-rating';
75
75
  export * from './components/testimonial-card';
76
76
  export * from './components/slider';
77
- export * from './components/resizeImage';
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD}from"./components/template-preview/models/WhatsAppTemplate.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodyTiny,ButtonLarge,ButtonRegular,Caption,Display,SmallRegular,SubHeading,TitleLarge,TitleMedium,TitleRegular,TitleSmall}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{COUPON_EXPIRATION,CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal,ScreenName}from"./components/product-picker-v2/modal.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";
1
+ import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD}from"./components/template-preview/models/WhatsAppTemplate.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodyTiny,ButtonLarge,ButtonRegular,Caption,Display,SmallRegular,SubHeading,TitleLarge,TitleMedium,TitleRegular,TitleSmall}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{COUPON_EXPIRATION,CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal,ScreenName}from"./components/product-picker-v2/modal.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.433-beta.product-picker-39",
3
+ "version": "0.0.433",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -166,6 +166,6 @@
166
166
  "styled-components": "^5.3.3"
167
167
  },
168
168
  "engines": {
169
- "node": ">=20"
169
+ "node": ">=16"
170
170
  }
171
171
  }
@@ -1 +0,0 @@
1
- "use strict";function e(e){if(e&&e.__esModule)return e;var a=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var t=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(a,l,t.get?t:{enumerable:!0,get:function(){return e[l]}})}})),a.default=e,Object.freeze(a)}Object.defineProperty(exports,"__esModule",{value:!0});var a,l=e(require("react"));function t(){return t=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t])}return e},t.apply(this,arguments)}var r=e=>l.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),a||(a=l.createElement("path",{fill:"currentColor",d:"M11.216 1.025a.133.133 0 0 1 .235 0l.743 1.392a.134.134 0 0 0 .055.055l1.392.743a.133.133 0 0 1 0 .235l-1.392.743a.134.134 0 0 0-.055.054L11.45 5.64a.133.133 0 0 1-.235 0l-.742-1.393a.133.133 0 0 0-.055-.054L9.027 3.45a.133.133 0 0 1 0-.235l1.392-.743a.133.133 0 0 0 .055-.055l.742-1.392Zm-4.124 5.16a.133.133 0 0 0 .055.055l3.077 1.641a.133.133 0 0 1 0 .236l-3.077 1.64a.133.133 0 0 0-.055.056l-1.64 3.077a.133.133 0 0 1-.236 0l-1.64-3.077a.133.133 0 0 0-.056-.055L.443 8.117a.133.133 0 0 1 0-.236l3.077-1.64a.133.133 0 0 0 .055-.055l1.641-3.077a.133.133 0 0 1 .235 0l1.641 3.077Zm.299 1.932a.133.133 0 0 0 0-.236l-1.23-.655a.133.133 0 0 1-.054-.055l-.656-1.23a.133.133 0 0 0-.235 0l-.655 1.23a.133.133 0 0 1-.055.055l-1.23.655a.133.133 0 0 0 0 .236l1.23.655a.133.133 0 0 1 .055.055l.655 1.23c.05.093.185.093.235 0l.656-1.23a.133.133 0 0 1 .055-.055l1.229-.655Zm5.756 2.79a.134.134 0 0 1-.055-.055l-.974-1.827a.133.133 0 0 0-.235 0l-.975 1.827a.133.133 0 0 1-.054.055l-1.827.975a.133.133 0 0 0 0 .235l1.827.974a.132.132 0 0 1 .054.055l.975 1.827c.05.094.185.094.235 0l.974-1.827a.133.133 0 0 1 .055-.055l1.827-.974a.133.133 0 0 0 0-.236l-1.827-.974Z"})));exports.default=r;
@@ -1,8 +0,0 @@
1
- import { Product, ProductVariant } from './modal';
2
- import { OUT_OF_STOCK_ACTION } from './type';
3
- export type ProductPickerTagType = {
4
- isVariant: boolean;
5
- data: Product | ProductVariant;
6
- outOfStockAction?: OUT_OF_STOCK_ACTION;
7
- };
8
- export declare const ProductPickerTag: (props: ProductPickerTagType) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../shimmer/ShimmerComponent/BikShimmer.js"),r=require("../tag/Tag.js"),i=require("./helpers/ProductHelper.js");exports.ProductPickerTag=s=>{const{isVariant:a,data:l,outOfStockAction:o}=s,u=i.ProductHelper.getProductLabels(l,o),c=i.ProductHelper.getTagType(null!=u?u:"");return e.jsx("div",Object.assign({style:{display:"flex"}},{children:!(null==l?void 0:l.fbStatus)&&a?e.jsx(t.BikShimmer,{boxes:[{height:"24px",width:"100px",marginTop:"0px"}]}):u?e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.Tag,{tagText:u,type:c,theme:"light"})})):e.jsx(e.Fragment,{})}))};
@@ -1,11 +0,0 @@
1
- import { Product, ProductVariant } from './modal';
2
- import { OUT_OF_STOCK_ACTION } from './type';
3
- export declare const ProductInfoOverlay: (props: {
4
- productData: Product | ProductVariant;
5
- onClose: () => void;
6
- outOfStockAction?: OUT_OF_STOCK_ACTION;
7
- }) => import("react/jsx-runtime").JSX.Element;
8
- export declare const ProductInfoCard: (props: {
9
- productData: Product | ProductVariant;
10
- outOfStockAction?: OUT_OF_STOCK_ACTION;
11
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,40 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/cross.svg.js"),i=require("../icon-button/IconButton.js"),a=require("../shimmer-image/ShimmerImage.js"),s=require("../TypographyStyle.js"),d=require("./ProductPickerTag.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t);const c=t=>{var o;console.log("vj: product data",t);const r=void 0===t.productData.variants;return e.jsxs(f,{children:[e.jsx(g,{children:e.jsx(a.ShimmerImage,{imageUrl:t.productData.image,width:"200px",height:200,borderRadius:4})}),e.jsxs(h,{children:[e.jsx(s.TitleSmall,Object.assign({style:{display:"flex"}},{children:t.productData.name})),e.jsx(s.BodyCaption,{style:{display:"flex"},dangerouslySetInnerHTML:{__html:null!==(o=t.productData.description)&&void 0!==o?o:""}}),e.jsx(d.ProductPickerTag,{isVariant:r,data:t.productData,outOfStockAction:t.outOfStockAction})]})]})},u=l.default.div`
2
- display: flex;
3
- flex: 1;
4
- background: rgba(0, 0, 0, 0.5);
5
- flex-direction: column;
6
- width: 100%;
7
- height: 100%;
8
- position: absolute;
9
- bottom: 0;
10
- z-index: 10;
11
- `,p=l.default.div`
12
- display: flex;
13
- flex: 1;
14
- background: rgba(0, 0, 0, 0.5);
15
- `,x=l.default.div`
16
- position: relative;
17
-
18
- .close-button {
19
- position: absolute;
20
- top: -50px;
21
- right: 0px;
22
- margin: 10px;
23
- background: ${o.COLORS.surface.standard};
24
- border-radius: 50%;
25
- }
26
- `,f=l.default.div`
27
- display: flex;
28
- background: white;
29
- padding: 24px;
30
- gap: 24px;
31
- border-radius: 8px 8px 0px 0px;
32
- `,g=l.default.div`
33
- display: flex;
34
- flex: 1;
35
- `,h=l.default.div`
36
- display: flex;
37
- flex: 1;
38
- flex-direction: column;
39
- gap: 10px;
40
- `;exports.ProductInfoCard=c,exports.ProductInfoOverlay=t=>e.jsxs(u,{children:[e.jsx(p,{}),e.jsx(x,{children:e.jsx(i.IconButton,{className:"close-button",onClick:t.onClose,Icon:r.default,width:20,height:20})}),e.jsx(c,{productData:t.productData,outOfStockAction:t.outOfStockAction})]});
@@ -1,5 +0,0 @@
1
- import { FbStatusFetcherReturn, SelectedItems } from './modal';
2
- import { SelectedCollectionsActions } from './reducers';
3
- export declare const useFetchFbStatusForCollections: (data: SelectedItems, storeId: string, selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>, fbStatusFetcher?: ((storeId: string, variantIds: string[]) => FbStatusFetcherReturn) | undefined, autoFetch?: boolean) => {
4
- fetchFbStatus: () => void;
5
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.useFetchFbStatusForCollections=function(o,v,d,i){const t=()=>{if(!i){const v=Object.assign({},o);Object.keys(v).forEach((o=>{var d,i;const t=null!==(i=null===(d=v[o])||void 0===d?void 0:d.products)&&void 0!==i?i:{};Object.keys(t).forEach((d=>{var i,t,l,n;const s=null!==(n=null===(l=null===(t=null===(i=v[o])||void 0===i?void 0:i.products)||void 0===t?void 0:t[d])||void 0===l?void 0:l.variants)&&void 0!==n?n:{};Object.keys(s).forEach((i=>{var t,l,n,s;const u=null===(s=null===(n=null===(l=null===(t=v[o])||void 0===t?void 0:t.products)||void 0===l?void 0:l[d])||void 0===n?void 0:n.variants)||void 0===s?void 0:s[i];u&&(u.fbStatus="APPROVED")}))}))})),d({type:"paged",data:v})}const t=(()=>{const v=[];return Object.keys(o).forEach((d=>{var i,t;const l=null!==(t=null===(i=o[d])||void 0===i?void 0:i.products)&&void 0!==t?t:{};Object.keys(l).forEach((i=>{var t,l,n,s;const u=null!==(s=null===(n=null===(l=null===(t=o[d])||void 0===t?void 0:t.products)||void 0===l?void 0:l[i])||void 0===n?void 0:n.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var l,n,s,u;const c=null===(u=null===(s=null===(n=null===(l=o[d])||void 0===l?void 0:l.products)||void 0===n?void 0:n[i])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];(null==c?void 0:c.fbStatus)||v.push(t)}))}))})),v})();t.length>0&&i&&i(v,t).then((v=>{const i=Object.assign({},o);Object.keys(i).forEach((o=>{var d,t;const l=null!==(t=null===(d=i[o])||void 0===d?void 0:d.products)&&void 0!==t?t:{};Object.keys(l).forEach((d=>{var t,l,n,s;const u=null!==(s=null===(n=null===(l=null===(t=i[o])||void 0===t?void 0:t.products)||void 0===l?void 0:l[d])||void 0===n?void 0:n.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var l,n,s,u;const c=null===(u=null===(s=null===(n=null===(l=i[o])||void 0===l?void 0:l.products)||void 0===n?void 0:n[d])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];c&&"REJECTED"===v[t]?c.fbStatus="REJECTED":c&&"APPROVED"===v[t]&&(c.fbStatus="APPROVED")}))}))})),d({type:"paged",data:i})})).catch((v=>{const i=Object.assign({},o);Object.keys(i).forEach((o=>{var v,d;const t=null!==(d=null===(v=i[o])||void 0===v?void 0:v.products)&&void 0!==d?d:{};Object.keys(t).forEach((v=>{var d,t,l,n;const s=null!==(n=null===(l=null===(t=null===(d=i[o])||void 0===d?void 0:d.products)||void 0===t?void 0:t[v])||void 0===l?void 0:l.variants)&&void 0!==n?n:{};Object.keys(s).forEach((d=>{var t,l,n,s;const u=null===(s=null===(n=null===(l=null===(t=i[o])||void 0===t?void 0:t.products)||void 0===l?void 0:l[v])||void 0===n?void 0:n.variants)||void 0===s?void 0:s[d];u&&(u.fbStatus="APPROVED")}))}))})),d({type:"paged",data:i})}))};return(!(arguments.length>4&&void 0!==arguments[4])||arguments[4])&&t(),{fetchFbStatus:t}};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export interface ResizableImageProps {
3
- imageUrl: string;
4
- targetSize: number;
5
- alt?: string;
6
- style?: React.CSSProperties;
7
- }
8
- export declare const ResizableImage: React.FC<ResizableImageProps>;