@bikdotai/bik-component-library 0.0.679-0 → 0.0.679-10

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 (121) hide show
  1. package/dist/cjs/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
  2. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +11 -0
  3. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  4. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  5. package/dist/cjs/components/checkBox/CheckBox.d.ts +1 -0
  6. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  7. package/dist/cjs/components/country-code-picker/CountryCodePicker.d.ts +4 -0
  8. package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
  9. package/dist/cjs/components/data-source-panel/DataSourcePanel.d.ts +2 -1
  10. package/dist/cjs/components/data-source-panel/DataSourcePanel.js +1 -1
  11. package/dist/cjs/components/data-source-panel/DataSourcePanel.style.js +40 -3
  12. package/dist/cjs/components/data-source-panel/Modals/DescriptionModal.d.ts +8 -0
  13. package/dist/cjs/components/data-source-panel/Modals/DescriptionModal.js +48 -0
  14. package/dist/cjs/components/data-source-panel/model.d.ts +8 -0
  15. package/dist/cjs/components/discount-modal/DiscountModal.d.ts +2 -0
  16. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  17. package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  18. package/dist/cjs/components/dropdown/ChipInput.d.ts +2 -0
  19. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  20. package/dist/cjs/components/dropdown/Common.styled.d.ts +3 -1
  21. package/dist/cjs/components/dropdown/Common.styled.js +4 -4
  22. package/dist/cjs/components/dropdown/Dropdown.d.ts +1 -0
  23. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  24. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  25. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  26. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  27. package/dist/cjs/components/dropdown/hooks/useDropdown.d.ts +4 -1
  28. package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
  29. package/dist/cjs/components/dropdown/type.d.ts +1 -0
  30. package/dist/cjs/components/input/Input.d.ts +2 -0
  31. package/dist/cjs/components/input/Input.js +1 -1
  32. package/dist/cjs/components/modals/Modal.d.ts +2 -0
  33. package/dist/cjs/components/modals/Modal.js +1 -1
  34. package/dist/cjs/components/modals/modal.styled.d.ts +6 -0
  35. package/dist/cjs/components/modals/modal.styled.js +1 -1
  36. package/dist/cjs/components/modals/styledModal.d.ts +2 -0
  37. package/dist/cjs/components/modals/styledModal.js +1 -1
  38. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +3 -1
  39. package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
  40. package/dist/cjs/components/product-picker-v2/modal.d.ts +7 -5
  41. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  42. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +5 -3
  43. package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
  44. package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +3 -1
  45. package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -1
  46. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +3 -1
  47. package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
  48. package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +3 -1
  49. package/dist/cjs/components/product-picker-v2/selectedScreen.js +1 -1
  50. package/dist/cjs/components/product-picker-v2/utility.d.ts +2 -1
  51. package/dist/cjs/components/product-picker-v2/utility.js +1 -1
  52. package/dist/cjs/components/states-modal/StateModalComponent.d.ts +1 -0
  53. package/dist/cjs/components/states-modal/StateModalComponent.js +1 -1
  54. package/dist/cjs/components/tag/Tag.d.ts +1 -1
  55. package/dist/cjs/components/tag/Tag.js +1 -1
  56. package/dist/cjs/components/tag/Tag.stories.d.ts +22 -0
  57. package/dist/cjs/components/tag/model.d.ts +12 -1
  58. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  59. package/dist/cjs/components/zeroState/ZeroState.d.ts +1 -0
  60. package/dist/cjs/components/zeroState/ZeroState.js +1 -1
  61. package/dist/esm/components/QueryBuilder/redux/queryBuilder.reducer.js +1 -1
  62. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +11 -0
  63. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
  64. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  65. package/dist/esm/components/checkBox/CheckBox.d.ts +1 -0
  66. package/dist/esm/components/checkBox/CheckBox.js +1 -1
  67. package/dist/esm/components/country-code-picker/CountryCodePicker.d.ts +4 -0
  68. package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
  69. package/dist/esm/components/data-source-panel/DataSourcePanel.d.ts +2 -1
  70. package/dist/esm/components/data-source-panel/DataSourcePanel.js +1 -1
  71. package/dist/esm/components/data-source-panel/DataSourcePanel.style.js +40 -3
  72. package/dist/esm/components/data-source-panel/Modals/DescriptionModal.d.ts +8 -0
  73. package/dist/esm/components/data-source-panel/Modals/DescriptionModal.js +48 -0
  74. package/dist/esm/components/data-source-panel/model.d.ts +8 -0
  75. package/dist/esm/components/discount-modal/DiscountModal.d.ts +2 -0
  76. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  77. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
  78. package/dist/esm/components/dropdown/ChipInput.d.ts +2 -0
  79. package/dist/esm/components/dropdown/ChipInput.js +1 -1
  80. package/dist/esm/components/dropdown/Common.styled.d.ts +3 -1
  81. package/dist/esm/components/dropdown/Common.styled.js +1 -1
  82. package/dist/esm/components/dropdown/Dropdown.d.ts +1 -0
  83. package/dist/esm/components/dropdown/Dropdown.js +1 -1
  84. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  85. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  86. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  87. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +4 -1
  88. package/dist/esm/components/dropdown/hooks/useDropdown.js +1 -1
  89. package/dist/esm/components/dropdown/type.d.ts +1 -0
  90. package/dist/esm/components/input/Input.d.ts +2 -0
  91. package/dist/esm/components/input/Input.js +1 -1
  92. package/dist/esm/components/modals/Modal.d.ts +2 -0
  93. package/dist/esm/components/modals/Modal.js +1 -1
  94. package/dist/esm/components/modals/modal.styled.d.ts +6 -0
  95. package/dist/esm/components/modals/modal.styled.js +1 -1
  96. package/dist/esm/components/modals/styledModal.d.ts +2 -0
  97. package/dist/esm/components/modals/styledModal.js +1 -1
  98. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +3 -1
  99. package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
  100. package/dist/esm/components/product-picker-v2/modal.d.ts +7 -5
  101. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  102. package/dist/esm/components/product-picker-v2/productScreen.d.ts +5 -3
  103. package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
  104. package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +3 -1
  105. package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
  106. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +3 -1
  107. package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
  108. package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +3 -1
  109. package/dist/esm/components/product-picker-v2/selectedScreen.js +1 -1
  110. package/dist/esm/components/product-picker-v2/utility.d.ts +2 -1
  111. package/dist/esm/components/product-picker-v2/utility.js +1 -1
  112. package/dist/esm/components/states-modal/StateModalComponent.d.ts +1 -0
  113. package/dist/esm/components/states-modal/StateModalComponent.js +1 -1
  114. package/dist/esm/components/tag/Tag.d.ts +1 -1
  115. package/dist/esm/components/tag/Tag.js +1 -1
  116. package/dist/esm/components/tag/Tag.stories.d.ts +22 -0
  117. package/dist/esm/components/tag/model.d.ts +12 -1
  118. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  119. package/dist/esm/components/zeroState/ZeroState.d.ts +1 -0
  120. package/dist/esm/components/zeroState/ZeroState.js +5 -5
  121. package/package.json +1 -1
@@ -1 +1 @@
1
- import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{useEffect as i}from"react";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as d}from"../TypographyStyle.js";import{CollectionCard as s}from"./collectionScreen.js";import{EmptyState as r}from"./emptyState.js";import{ProductGroup as n}from"./product.js";import{SelectedScreenHeader as u}from"./style.js";import{fetchFbStatusCollection as a,isCollectionPartiallyChecked as p,isProductPartiallyChecked as h,liftTheStateUp as v}from"./utility.js";const m=m=>{var C;const{customCollectionRestriction:k,selectedCollections:y,searchedCollections:b,searchedCollectionsDispatch:f,selectedCollectionsDispatch:j,setScreen:S,collections:O,onBackPress:P,hideVariantCheckbox:I,pickerType:g,hideProductVariants:x,hideProductCheckbox:D,storeId:T,fbStatusFetcher:V,setCollectionId:w,setSelectedCollectionId:A,hideCollectionCheckbox:R,renderWithoutModal:W,outOfStockAction:B}=m;i((()=>{var o;a(null!==(o=b.products)&&void 0!==o?o:{},T,f,V,"setProducts")}),[null==b?void 0:b.products]);const M=!!k&&(null==y?void 0:y.isCustom);return o("div",{children:[o(u,{children:[e(c,{Icon:l,onClick:()=>{S("collections"),P()}}),e(d,{children:(null===(C=Object.keys(null==b?void 0:b.collections))||void 0===C?void 0:C.length)?"Searched Collections & Products":"Searched Products"})]}),e("div",{children:Object.keys(null==b?void 0:b.products).length||Object.keys(null==b?void 0:b.collections).length?o(t,{children:[e(t,{children:Object.keys(null==b?void 0:b.collections).map((o=>e(s,{customCollectionRestriction:k,data:null==O?void 0:O[o],isDisabled:M&&!(null==y?void 0:y[o]),isChecked:!!(null==y?void 0:y[o]),isPartiallyChecked:p(o,null==O?void 0:O[o],y,x),selectedCollectionsDispatch:j,setCollectionId:w,setSelectedCollectionId:A,setScreen:S,id:o,hideCollectionCheckbox:R||"-1"===o,selectedCollections:y,renderWithoutModal:W,pickerType:g,usedInSearch:!0},o)))}),e(t,{children:Object.keys(null==b?void 0:b.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==b?void 0:b.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let d=!1;return(null===(l=null==b?void 0:b.products)||void 0===l?void 0:l.isCustom)&&(d=!0),e(n,{collectionId:o,upliftAdditions:(e,t)=>((o,e,t)=>{var l;const i=v(t,null===(l=null==b?void 0:b.products)||void 0===l?void 0:l[o]);j({type:e,data:Object.assign(Object.assign({},i),{isRestricted:k})})})(o,e,t),productId:t,data:(null===(i=null==b?void 0:b.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:h(o,t,y,null===(c=b.products)||void 0===c?void 0:c[o],x),selectedData:y,selectedCollectionsDispatch:j,viewOnly:d,hideProductCheckbox:D,hideVariantCheckbox:I,hideProductVariants:x,pickerType:g,outOfStockAction:B},t)}))}))})]}):e(r,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{m as SearchScreen};
1
+ import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{useEffect as i}from"react";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as d}from"../TypographyStyle.js";import{CollectionCard as s}from"./collectionScreen.js";import{EmptyState as r}from"./emptyState.js";import{ProductGroup as n}from"./product.js";import{SelectedScreenHeader as u}from"./style.js";import{fetchFbStatusCollection as a,isCollectionPartiallyChecked as p,isProductPartiallyChecked as h,liftTheStateUp as v}from"./utility.js";const m=m=>{var C;const{customCollectionRestriction:k,selectedCollections:y,searchedCollections:b,searchedCollectionsDispatch:f,selectedCollectionsDispatch:j,setScreen:S,collections:O,onBackPress:P,hideVariantCheckbox:I,pickerType:g,hideProductVariants:x,hideProductCheckbox:D,storeId:T,fbStatusFetcher:V,setCollectionId:w,setSelectedCollectionId:A,hideCollectionCheckbox:R,renderWithoutModal:W,outOfStockAction:B,appType:M}=m;i((()=>{var o;a(null!==(o=b.products)&&void 0!==o?o:{},T,M,f,V,"setProducts")}),[null==b?void 0:b.products]);const F=!!k&&(null==y?void 0:y.isCustom);return o("div",{children:[o(u,{children:[e(c,{Icon:l,onClick:()=>{S("collections"),P()}}),e(d,{children:(null===(C=Object.keys(null==b?void 0:b.collections))||void 0===C?void 0:C.length)?"Searched Collections & Products":"Searched Products"})]}),e("div",{children:Object.keys(null==b?void 0:b.products).length||Object.keys(null==b?void 0:b.collections).length?o(t,{children:[e(t,{children:Object.keys(null==b?void 0:b.collections).map((o=>e(s,{customCollectionRestriction:k,data:null==O?void 0:O[o],isDisabled:F&&!(null==y?void 0:y[o]),isChecked:!!(null==y?void 0:y[o]),isPartiallyChecked:p(o,null==O?void 0:O[o],y,x),selectedCollectionsDispatch:j,setCollectionId:w,setSelectedCollectionId:A,setScreen:S,id:o,hideCollectionCheckbox:R||"-1"===o,selectedCollections:y,renderWithoutModal:W,pickerType:g,usedInSearch:!0},o)))}),e(t,{children:Object.keys(null==b?void 0:b.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==b?void 0:b.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i,c;let d=!1;return(null===(l=null==b?void 0:b.products)||void 0===l?void 0:l.isCustom)&&(d=!0),e(n,{collectionId:o,upliftAdditions:(e,t)=>((o,e,t)=>{var l;const i=v(t,null===(l=null==b?void 0:b.products)||void 0===l?void 0:l[o]);j({type:e,data:Object.assign(Object.assign({},i),{isRestricted:k})})})(o,e,t),productId:t,data:(null===(i=null==b?void 0:b.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:h(o,t,y,null===(c=b.products)||void 0===c?void 0:c[o],x),selectedData:y,selectedCollectionsDispatch:j,viewOnly:d,hideProductCheckbox:D,hideVariantCheckbox:I,hideProductVariants:x,pickerType:g,outOfStockAction:B},t)}))}))})]}):e(r,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{m as SearchScreen};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
3
  import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
3
4
  import { SelectedCollectionsActions } from './reducers';
4
5
  import { OUT_OF_STOCK_ACTION } from './type';
@@ -12,7 +13,8 @@ interface SelectedScreenInterface {
12
13
  hideProductVariants?: boolean;
13
14
  outOfStockAction?: OUT_OF_STOCK_ACTION;
14
15
  storeId: string;
15
- fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
16
+ appType: ApplicationType;
17
+ fbStatusFetcher?: (storeId: string, variantIds: string[], appType: ApplicationType) => FbStatusFetcherReturn;
16
18
  }
17
19
  export declare const SelectedScreen: (props: SelectedScreenInterface) => import("react/jsx-runtime").JSX.Element;
18
20
  export {};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e,Fragment as r}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useRef as c,useReducer as i,useEffect as n}from"react";import{IconButton as s}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as d}from"./emptyState.js";import{ProductGroup as u}from"./product.js";import{paginationReducer as a}from"./reducers.js";import{SelectedScreenHeader as p}from"./style.js";import{paginateSelectedItems as m,fetchFbStatusCollection as f,isProductPartiallyChecked as h}from"./utility.js";const v=v=>{const{selectedCollections:y,selectedCollectionsDispatch:j,setScreen:b,collections:S,hideProductVariants:k=!1,outOfStockAction:I,storeId:O,fbStatusFetcher:g}=v,C=c(0),P=c(null),[w,A]=i(a,{});n((()=>{C.current=0;const t=m(y,10,0);A({type:"paginate",data:t}),f(t,O,A,g,"set"),C.current+=1}),[]),n((()=>{A({type:"filter",data:y})}),[y]),n((()=>{const t=new IntersectionObserver((t=>{if(t[0].isIntersecting&&C.current>0){const t=m(y,10,C.current);A({type:"paginate",data:t}),f(t,O,A,g,"update"),C.current+=1}}),{threshold:1});return P.current&&t.observe(P.current),()=>{P.current&&t.unobserve(P.current)}}),[P,y]);const D=y;return t("div",{children:[t(p,{children:[e(s,{Icon:o,onClick:()=>{b("collections")}}),e(l,{children:"Selected Products"})]}),t("div",{children:[Object.keys(w).length>0?e(r,{children:Object.keys(w).map((t=>{var r;return Object.keys((null===(r=null==w?void 0:w[t])||void 0===r?void 0:r.products)||[]).map((r=>{let o=!1;return(null==D?void 0:D.isCustom)&&(o=!0),e(u,{upliftAdditions:null,collectionId:t,productId:r,data:w[t].products[r],isProductPartiallyChecked:h(t,r,D,null==S?void 0:S[t],k),selectedData:D,selectedCollectionsDispatch:j,viewOnly:o,hideProductVariants:k,outOfStockAction:I},r)}))}))}):e(d,{title:"No Products Selected",subtitle:"Select products will appear here"}),e("div",{ref:P})]})]})};export{v as SelectedScreen};
1
+ import{jsxs as t,jsx as e,Fragment as r}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useRef as c,useReducer as i,useEffect as n}from"react";import{IconButton as s}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as d}from"./emptyState.js";import{ProductGroup as u}from"./product.js";import{paginationReducer as a}from"./reducers.js";import{SelectedScreenHeader as p}from"./style.js";import{paginateSelectedItems as m,fetchFbStatusCollection as f,isProductPartiallyChecked as h}from"./utility.js";const y=y=>{const{selectedCollections:v,selectedCollectionsDispatch:j,setScreen:b,collections:S,hideProductVariants:k=!1,outOfStockAction:I,storeId:O,fbStatusFetcher:g,appType:C}=y,P=c(0),w=c(null),[A,D]=i(a,{});n((()=>{P.current=0;const t=m(v,10,0);D({type:"paginate",data:t}),f(t,O,C,D,g,"set"),P.current+=1}),[]),n((()=>{D({type:"filter",data:v})}),[v]),n((()=>{const t=new IntersectionObserver((t=>{if(t[0].isIntersecting&&P.current>0){const t=m(v,10,P.current);D({type:"paginate",data:t}),f(t,O,C,D,g,"update"),P.current+=1}}),{threshold:1});return w.current&&t.observe(w.current),()=>{w.current&&t.unobserve(w.current)}}),[w,v]);const x=v;return t("div",{children:[t(p,{children:[e(s,{Icon:o,onClick:()=>{b("collections")}}),e(l,{children:"Selected Products"})]}),t("div",{children:[Object.keys(A).length>0?e(r,{children:Object.keys(A).map((t=>{var r;return Object.keys((null===(r=null==A?void 0:A[t])||void 0===r?void 0:r.products)||[]).map((r=>{let o=!1;return(null==x?void 0:x.isCustom)&&(o=!0),e(u,{upliftAdditions:null,collectionId:t,productId:r,data:A[t].products[r],isProductPartiallyChecked:h(t,r,x,null==S?void 0:S[t],k),selectedData:x,selectedCollectionsDispatch:j,viewOnly:o,hideProductVariants:k,outOfStockAction:I},r)}))}))}):e(d,{title:"No Products Selected",subtitle:"Select products will appear here"}),e("div",{ref:w})]})]})};export{y as SelectedScreen};
@@ -1,3 +1,4 @@
1
+ import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
2
  import { Collection, FbStatusFetcherReturn, Product, ProductVariant, SearchedItems, SelectedItems } from './modal';
2
3
  import { CollectionsActions } from './reducers';
3
4
  export declare const liftTheStateUp: (payload: any, data: any) => any;
@@ -12,7 +13,7 @@ export declare function paginateSelectedItems(selectedItems: SelectedItems, limi
12
13
  *
13
14
  * We first get the variant ids to fetch and only if we have variant ids, we call api.
14
15
  */
15
- export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string, dispatcher: any, fbStatusFetcher?: ((storeId: string, variantIds: string[]) => FbStatusFetcherReturn) | undefined, dispatchType?: string) => void;
16
+ export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string, appType: ApplicationType, dispatcher: any, fbStatusFetcher?: ((storeId: string, variantIds: string[], appType: ApplicationType) => FbStatusFetcherReturn) | undefined, dispatchType?: string) => void;
16
17
  /**
17
18
  * Instead of collection level, we do it product level.
18
19
  *
@@ -1 +1 @@
1
- import{cloneDeep as o}from"lodash";const l=(l,i)=>{const n=o(i);if(delete n.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:n})).productId&&i.products){const t=o(i.products[l.productId]);(null==t?void 0:t.variants)&&delete t.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:n,productOnlyData:t})}return l};function i(o,l,i){var t;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const u=o[s],c=n(u.products,l,i-v);c&&Object.keys(c).length>0&&(d[s]=Object.assign(Object.assign({},u),{products:c})),v+=Object.keys(null!==(t=u.products)&&void 0!==t?t:{}).length}return d}function n(o,l,i){if(!o)return{};const n=Object.keys(o).slice(i,i+l),t={};return n.forEach((l=>{t[l]=o[l]})),t}const t=(o,l,i)=>{Object.keys(o).forEach((l=>{var i,n;const t=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(t).forEach((i=>{var n,t,d,v;const s=null!==(v=null===(d=null===(t=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===t?void 0:t[i])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((n=>{var t,d,v,s;const u=null===(s=null===(v=null===(d=null===(t=o[l])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n];u&&!u.fbStatus&&(u.fbStatus="APPROVED")}))}))})),l({type:i,data:o})},d=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((i=>{var n,t;const d=null!==(t=null===(n=o[i])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=o[i])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=o[i])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];(null==c?void 0:c.fbStatus)||l.push(t)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const n=Object.assign({},o);Object.keys(n).forEach((o=>{var i,t;const d=null!==(t=null===(i=n[o])||void 0===i?void 0:i.products)&&void 0!==t?t:{};Object.keys(d).forEach((i=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=n[o])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=n[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];c&&"REJECTED"===l[t]?c.fbStatus="REJECTED":c&&"APPROVED"===l[t]&&(c.fbStatus="APPROVED")}))}))})),i({type:d,data:n})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},v=(o,l)=>{const i=[];return Object.keys(null!=o?o:{}).forEach((n=>{var t,d;const v=null!==(d=null===(t=null==o?void 0:o[n])||void 0===t?void 0:t.variants)&&void 0!==d?d:{};Object.keys(v).forEach((t=>{var d,v,s,u,c;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[t]:null===(c=null===(u=null==o?void 0:o[n])||void 0===u?void 0:u.variants)||void 0===c?void 0:c[t],(null==r?void 0:r.fbStatus)||i.push(t)}))})),i},s=(o,l,i,n,t)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var i,n;Object.keys(null!==(n=null===(i=null==o?void 0:o[l])||void 0===i?void 0:i.variants)&&void 0!==n?n:{}).forEach((i=>{var n,t;const v=null===(n=null==o?void 0:o[l].variants)||void 0===n?void 0:n[i];v&&(v.fbStatus="APPROVED");const s=null===(t=null==d?void 0:d[l])||void 0===t?void 0:t.variants;s&&s[i]&&(s[i]=v)}))})),n&&t){const o=Object.assign({},n);o.products=d,t(o),l({type:"productsPaged",data:{collectionId:i,products:d}})}else l({type:"productsPaged",data:{collectionId:i,products:d}})},u=o=>{const l=Object.keys(o.variants||[]);let i=!1;return!(l.length<=1)||(l.forEach((l=>{var n,t;i=null!==(t=null===(n=o.variants)||void 0===n?void 0:n[l].name.includes(o.name))&&void 0!==t&&t})),!i)},c=(o,l,i,n,t)=>{var d,v,s,u,c,r,a,e,p,b,O,f,j,h,y,g,E,k,P;let D=0,V=0;if(null===(v=null===(d=null==i?void 0:i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(t)return!1;const d=(null===(c=null===(u=null===(s=null==i?void 0:i[o])||void 0===s?void 0:s.products)||void 0===u?void 0:u[l])||void 0===c?void 0:c.variants)||[];if(1===Object.keys(d).length)for(const n in d){const t=null===(a=null===(r=null==i?void 0:i[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[l],d=null===(O=null===(b=null===(p=null===(e=null==i?void 0:i[o])||void 0===e?void 0:e.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[n];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==t?void 0:t.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==n?void 0:n.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>V++)),Object.keys((null===(P=null===(k=null===(E=null==i?void 0:i[o])||void 0===E?void 0:E.products)||void 0===k?void 0:k[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&V!==D)return!0}return!1},r=function(o,l,i){var n,t,d,v;let s=0,u=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(n=null==l?void 0:l.products)&&void 0!==n?n:{};s=Object.keys(v).length;const c=null!==(d=null===(t=i[o])||void 0===t?void 0:t.products)&&void 0!==d?d:{};u=Object.keys(c).length}else if(i[o]){const n=null==l?void 0:l.products;n&&Object.keys(n).forEach((o=>{var l;const i=null===(l=n[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>s+=1))}));const t=null===(v=i[o])||void 0===v?void 0:v.products;if(t&&Object.keys(t).forEach((o=>{var l;const i=null===(l=t[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>u+=1))})),s<=0&&u>0)return!1}return u>0&&s!==u},a=(l,i,n)=>Object.keys(l).reduce(((t,d)=>{var v;return d in i?(t[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((t,v)=>{var s,u,c,r,a,e,p,b,O,f;const j=null===(s=i[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(c=null===(u=null==n?void 0:n.products)||void 0===u?void 0:u[d])||void 0===c?void 0:c.products)||void 0===r?void 0:r[v];return j?t[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o(j.variants)}):h?t[v]=Object.assign(Object.assign({},(null===(e=l[d].products)||void 0===e?void 0:e[v])||{}),{allVariants:o(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(t[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),t}),{})}),t):t}),{}),e=(o,l)=>{var i;if(l)return o.skuId;const n=Object.values(null!==(i=null==o?void 0:o.variants)&&void 0!==i?i:{});return 1===n.length&&n[0].name.includes(o.name)?n[0].skuId:""};export{d as fetchFbStatusCollection,e as getSkuId,v as getVariantIdsToFetchAtProductLevel,r as isCollectionPartiallyChecked,c as isProductPartiallyChecked,l as liftTheStateUp,s as markVariantsAsApprovedProductsLevel,i as paginateSelectedItems,u as shouldShowVariant,a as updateAllVariantsForSelectedProducts};
1
+ import{cloneDeep as o}from"lodash";const l=(l,i)=>{const n=o(i);if(delete n.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:n})).productId&&i.products){const t=o(i.products[l.productId]);(null==t?void 0:t.variants)&&delete t.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:n,productOnlyData:t})}return l};function i(o,l,i){var t;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const u=o[s],c=n(u.products,l,i-v);c&&Object.keys(c).length>0&&(d[s]=Object.assign(Object.assign({},u),{products:c})),v+=Object.keys(null!==(t=u.products)&&void 0!==t?t:{}).length}return d}function n(o,l,i){if(!o)return{};const n=Object.keys(o).slice(i,i+l),t={};return n.forEach((l=>{t[l]=o[l]})),t}const t=(o,l,i)=>{Object.keys(o).forEach((l=>{var i,n;const t=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(t).forEach((i=>{var n,t,d,v;const s=null!==(v=null===(d=null===(t=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===t?void 0:t[i])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((n=>{var t,d,v,s;const u=null===(s=null===(v=null===(d=null===(t=o[l])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n];u&&!u.fbStatus&&(u.fbStatus="APPROVED")}))}))})),l({type:i,data:o})},d=function(o,l,i,n,d){let v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"paged";d||t(o,n,v);const s=(o=>{const l=[];return Object.keys(o).forEach((i=>{var n,t;const d=null!==(t=null===(n=o[i])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=o[i])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=o[i])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];(null==c?void 0:c.fbStatus)||l.push(t)}))}))})),l})(o);s.length>0&&d&&d(l,s,i).then((l=>{const i=Object.assign({},o);Object.keys(i).forEach((o=>{var n,t;const d=null!==(t=null===(n=i[o])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=i[o])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];c&&"REJECTED"===l[t]?c.fbStatus="REJECTED":c&&"APPROVED"===l[t]&&(c.fbStatus="APPROVED")}))}))})),n({type:v,data:i})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,n,v)}))},v=(o,l)=>{const i=[];return Object.keys(null!=o?o:{}).forEach((n=>{var t,d;const v=null!==(d=null===(t=null==o?void 0:o[n])||void 0===t?void 0:t.variants)&&void 0!==d?d:{};Object.keys(v).forEach((t=>{var d,v,s,u,c;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[t]:null===(c=null===(u=null==o?void 0:o[n])||void 0===u?void 0:u.variants)||void 0===c?void 0:c[t],(null==r?void 0:r.fbStatus)||i.push(t)}))})),i},s=(o,l,i,n,t)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var i,n;Object.keys(null!==(n=null===(i=null==o?void 0:o[l])||void 0===i?void 0:i.variants)&&void 0!==n?n:{}).forEach((i=>{var n,t;const v=null===(n=null==o?void 0:o[l].variants)||void 0===n?void 0:n[i];v&&(v.fbStatus="APPROVED");const s=null===(t=null==d?void 0:d[l])||void 0===t?void 0:t.variants;s&&s[i]&&(s[i]=v)}))})),n&&t){const o=Object.assign({},n);o.products=d,t(o),l({type:"productsPaged",data:{collectionId:i,products:d}})}else l({type:"productsPaged",data:{collectionId:i,products:d}})},u=o=>{const l=Object.keys(o.variants||[]);let i=!1;return!(l.length<=1)||(l.forEach((l=>{var n,t;i=null!==(t=null===(n=o.variants)||void 0===n?void 0:n[l].name.includes(o.name))&&void 0!==t&&t})),!i)},c=(o,l,i,n,t)=>{var d,v,s,u,c,r,a,e,p,b,O,f,j,h,y,g,E,k,P;let D=0,V=0;if(null===(v=null===(d=null==i?void 0:i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(t)return!1;const d=(null===(c=null===(u=null===(s=null==i?void 0:i[o])||void 0===s?void 0:s.products)||void 0===u?void 0:u[l])||void 0===c?void 0:c.variants)||[];if(1===Object.keys(d).length)for(const n in d){const t=null===(a=null===(r=null==i?void 0:i[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[l],d=null===(O=null===(b=null===(p=null===(e=null==i?void 0:i[o])||void 0===e?void 0:e.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[n];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==t?void 0:t.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==n?void 0:n.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>V++)),Object.keys((null===(P=null===(k=null===(E=null==i?void 0:i[o])||void 0===E?void 0:E.products)||void 0===k?void 0:k[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&V!==D)return!0}return!1},r=function(o,l,i){var n,t,d,v;let s=0,u=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(n=null==l?void 0:l.products)&&void 0!==n?n:{};s=Object.keys(v).length;const c=null!==(d=null===(t=i[o])||void 0===t?void 0:t.products)&&void 0!==d?d:{};u=Object.keys(c).length}else if(i[o]){const n=null==l?void 0:l.products;n&&Object.keys(n).forEach((o=>{var l;const i=null===(l=n[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>s+=1))}));const t=null===(v=i[o])||void 0===v?void 0:v.products;if(t&&Object.keys(t).forEach((o=>{var l;const i=null===(l=t[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>u+=1))})),s<=0&&u>0)return!1}return u>0&&s!==u},a=(l,i,n)=>Object.keys(l).reduce(((t,d)=>{var v;return d in i?(t[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((t,v)=>{var s,u,c,r,a,e,p,b,O,f;const j=null===(s=i[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(c=null===(u=null==n?void 0:n.products)||void 0===u?void 0:u[d])||void 0===c?void 0:c.products)||void 0===r?void 0:r[v];return j?t[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o(j.variants)}):h?t[v]=Object.assign(Object.assign({},(null===(e=l[d].products)||void 0===e?void 0:e[v])||{}),{allVariants:o(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(t[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),t}),{})}),t):t}),{}),e=(o,l)=>{var i;if(l)return o.skuId;const n=Object.values(null!==(i=null==o?void 0:o.variants)&&void 0!==i?i:{});return 1===n.length&&n[0].name.includes(o.name)?n[0].skuId:""};export{d as fetchFbStatusCollection,e as getSkuId,v as getVariantIdsToFetchAtProductLevel,r as isCollectionPartiallyChecked,c as isProductPartiallyChecked,l as liftTheStateUp,s as markVariantsAsApprovedProductsLevel,i as paginateSelectedItems,u as shouldShowVariant,a as updateAllVariantsForSelectedProducts};
@@ -21,5 +21,6 @@ export type StateModalComponentProps = {
21
21
  iconHeight?: number;
22
22
  closeButtonType?: Type;
23
23
  'data-test'?: string;
24
+ secondaryButtonText?: string;
24
25
  };
25
26
  export declare const StateModalComponent: React.FC<React.PropsWithChildren<StateModalComponentProps>>;
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{ComponentZindex as n}from"../../constants/zindex.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as d}from"../states/StateComponent.js";const l=l=>{const m=()=>p==a.SUCCESS?t(s,{}):p==a.WARNING?t(i,{}):p==a.ERROR?t(o,{}):p===a.LOADING?t(c,{size:"large"}):void 0,{states:p,heading:u,subline:g,icon:h=m(),isButtonEnabled:I,type:f,buttonText:C,onButtonClick:j,leadingIcon:O,width:b,zIndex:x,headerImage:y,iconHeight:B,iconWidth:S,closeButtonType:A}=l,[T,E]=e(!0);return t(r,Object.assign({"data-test":l["data-test"],open:T,onClose:function(){l.onClose&&l.onClose(),E(!1)},closeOnOutsideClick:!(p===a.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:b},hideCrossButton:p===a.LOADING,zIndex:x||n.STATE_MODAL},{children:t(d,Object.assign({states:p,heading:u,subline:g,isButtonEnabled:I,leadingIcon:O,type:f,buttonText:C,onButtonClick:j,icon:h,width:b||400,headerImage:y,iconHeight:B,iconWidth:S,closeButtonType:A},{children:l.children}))}))};export{l as StateModalComponent};
1
+ import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{ComponentZindex as n}from"../../constants/zindex.js";import o from"../../assets/icons/errorIcon.svg.js";import s from"../../assets/icons/successIcon.svg.js";import i from"../../assets/icons/warningIcon.svg.js";import{StyledModal as r}from"../modals/styledModal.js";import{Spinner as c}from"../spinner/Spinner.js";import{StateInterface as a,StateComponent as d}from"../states/StateComponent.js";const l=l=>{const m=()=>p==a.SUCCESS?t(s,{}):p==a.WARNING?t(i,{}):p==a.ERROR?t(o,{}):p===a.LOADING?t(c,{size:"large"}):void 0,{states:p,heading:u,subline:g,icon:h=m(),isButtonEnabled:I,type:f,buttonText:C,onButtonClick:j,leadingIcon:x,width:y,zIndex:B,headerImage:O,iconHeight:b,iconWidth:T,closeButtonType:S,secondaryButtonText:A}=l,[E,N]=e(!0);return t(r,Object.assign({"data-test":l["data-test"],open:E,onClose:function(){l.onClose&&l.onClose(),N(!1)},closeOnOutsideClick:!(p===a.LOADING),centralContainerStyles:{display:"flex",alignItems:"center",justifyContent:"center",width:y},hideCrossButton:p===a.LOADING,zIndex:B||n.STATE_MODAL},{children:t(d,Object.assign({states:p,heading:u,subline:g,isButtonEnabled:I,leadingIcon:x,type:f,buttonText:C,onButtonClick:j,icon:h,width:y||400,headerImage:O,iconHeight:b,iconWidth:T,closeButtonType:S,secondaryButtonText:A},{children:l.children}))}))};export{l as StateModalComponent};
@@ -1,5 +1,5 @@
1
1
  import { TagProps } from './model';
2
2
  export declare const Tag: {
3
- ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, }: TagProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: TagProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyCaption as t,BodyCaption as r}from"../TypographyStyle.js";import{ValidTagTypeMap as a}from"./model.js";import{Tag as c}from"./Tag.styled.js";import{getTagIconColor as o}from"./themes.js";const s=s=>{let{tagText:l,LeadingIcon:g,TrailingIcon:d,onLeadingIconClicked:m,leadingIconId:p,trailingIconId:h,onTrailingIconClicked:j,theme:b="light",type:u="neutral",variant:y="regular",version:I,cursor:O,alignIcon:T,noBorder:f,tagHtmlText:x,contentPadding:N}=s,k=l;const v=b;let w=u;a[y][u]||(w="neutral"),"circle"===y&&"number"==typeof k&&k>99&&(k="99+");const C={height:"compressed"===y?12:16,width:"compressed"===y?12:16,color:o(b,w),style:{display:"block"}};return e(c,Object.assign({cursor:O,theme:v,type:u,variant:y,version:I,alignIcon:T,noBorder:f,contentPadding:N},{children:i("div",Object.assign({className:"container"},{children:[g&&e("button",Object.assign({className:"icon-leading",onClick:m,id:`${p}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(g,Object.assign(Object.assign({},C),{id:p||"leading-icon"}))})),x&&("ai"===u&&"light"===b?e(t,{children:x}):e(r,Object.assign({className:"text"},{children:x}))),!x&&""!==k&&("ai"===u&&"light"===b?e(t,{children:k}):e(r,Object.assign({className:"text"},{children:k}))),d&&e("button",Object.assign({className:"icon-trailing",onClick:j,id:`${h}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(d,Object.assign(Object.assign({},C),{id:h||"trailing-icon"}))}))]}))}))};s.displayName="Tag";export{s as Tag};
1
+ import{jsx as i,jsxs as e}from"react/jsx-runtime";import n from"react";import{Tooltip as t}from"../tooltips/Tooltip.js";import{AiBodyCaption as a,BodyCaption as c}from"../TypographyStyle.js";import{ValidTagTypeMap as r}from"./model.js";import{Tag as o}from"./Tag.styled.js";import{getTagIconColor as s}from"./themes.js";const l=l=>{let{tagText:g,LeadingIcon:d,TrailingIcon:p,onLeadingIconClicked:m,leadingIconId:b,trailingIconId:j,onTrailingIconClicked:h,theme:O="light",type:u="neutral",variant:I="regular",version:T,cursor:y,alignIcon:w,noBorder:f,tagHtmlText:N,contentPadding:k,leadingIconTooltip:x,trailingIconTooltip:C}=l,v=g;const E=O;let $=u;r[I][u]||($="neutral"),"circle"===I&&"number"==typeof v&&v>99&&(v="99+");const B={height:"compressed"===I?12:16,width:"compressed"===I?12:16,color:s(O,$),style:{display:"block"}};return i(o,Object.assign({cursor:y,theme:E,type:u,variant:I,version:T,alignIcon:w,noBorder:f,contentPadding:k},{children:e("div",Object.assign({className:"container"},{children:[d&&(x?i(t,Object.assign({},x,{children:i("button",Object.assign({className:"icon-leading",onClick:m,id:`${b}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(d,Object.assign(Object.assign({},B),{id:b||"leading-icon"}))}))})):i("button",Object.assign({className:"icon-leading",onClick:m,id:`${b}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(d,Object.assign(Object.assign({},B),{id:b||"leading-icon"}))}))),N&&("ai"===u&&"light"===O?i(a,{children:N}):i(c,Object.assign({className:"text"},{children:N}))),!N&&""!==v&&("ai"===u&&"light"===O?i(a,{children:v}):i(c,Object.assign({className:"text"},{children:v}))),p&&(C?i(t,Object.assign({},C,{children:i("button",Object.assign({className:"icon-trailing",onClick:h,id:`${j}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(p,Object.assign(Object.assign({},B),{id:j||"trailing-icon"}))}))})):i("button",Object.assign({className:"icon-trailing",onClick:h,id:`${j}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(p,Object.assign(Object.assign({},B),{id:j||"trailing-icon"}))})))]}))}))};l.displayName="Tag";export{l as Tag};
@@ -0,0 +1,22 @@
1
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
2
+ declare const _default: ComponentMeta<{
3
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ }>;
6
+ export default _default;
7
+ export declare const Default: ComponentStory<{
8
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ }>;
11
+ export declare const WithIcons: ComponentStory<{
12
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
13
+ displayName: string;
14
+ }>;
15
+ export declare const WithIconTooltips: ComponentStory<{
16
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ }>;
19
+ export declare const DarkTheme: ComponentStory<{
20
+ ({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
21
+ displayName: string;
22
+ }>;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MouseEventHandler } from 'react';
3
+ import { TooltipProps } from '../tooltips/Tooltip';
3
4
  export type TagTheme = 'light' | 'dark';
4
5
  export type TagVariant = 'regular' | 'circle' | 'compressed';
5
6
  export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
@@ -62,9 +63,14 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
62
63
  */
63
64
  trailingIconId?: string;
64
65
  /**
65
- * The left icon on click event, defaults to () => {}
66
+ * The right icon on click event, defaults to () => {}
66
67
  */
67
68
  onTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;
69
+ /**
70
+ * Tooltip props for the trailing icon
71
+ * @default undefined
72
+ */
73
+ trailingIconTooltip?: Omit<TooltipProps, 'children'>;
68
74
  /**
69
75
  * The icon component that is to the left of the text
70
76
  * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
@@ -80,6 +86,11 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
80
86
  * @default leading-icon
81
87
  */
82
88
  leadingIconId?: string;
89
+ /**
90
+ * Tooltip props for the leading icon
91
+ * @default undefined
92
+ */
93
+ leadingIconTooltip?: Omit<TooltipProps, 'children'>;
83
94
  tagText: string | number;
84
95
  version?: '1.0' | '2.0';
85
96
  cursor?: string;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cloneDeep as l}from"lodash";import{useState as s,useEffect as a}from"react";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{Input as i}from"../../input/Input.js";import{editableVarPattern as o}from"../../template-preview/constants/regexPatterns.js";import{STATIC_URL_CTA_OPTION as r,CUSTOM_URL_NAME as u}from"../../template-preview/models/TemplateMeta.js";import{POD as c}from"../../template-preview/models/WhatsAppTemplate.js";import{BodySecondary as d}from"../../TypographyStyle.js";import{COLORS as b}from"../../../constants/Theme.js";import{useTemplateModalContext as p}from"../context/templateModalContext.js";import{STATIC_URL_VARIABLE_NAME as m}from"../utils/constants.js";import{validateIsUrl as j}from"../utils/validateIsUrl.js";import v,{Container as g}from"./VariableConnector.js";const O=O=>{let{variableListIndex:f,button:x,updateSelectedURLTemplateBtn:y,updateSelectedQRBTemplateBtn:h,currentVariableList:L,CTAoptions:R,QRBoptions:U,disableEdit:V}=O;var T,w,C,I,E;const[P,H]=s(""),[N,B]=s(),_=null==R?void 0:R.map((e=>Object.assign(Object.assign({},e),{selected:(null==N?void 0:N.value)===e.value}))),Q=null==U?void 0:U.map((e=>Object.assign(Object.assign({},e),{selected:(null==N?void 0:N.value)===e.value}))),{isError:k,disableEditVariable:S,pod:K,selectedCarouselIndex:Y,originalVariableList:$,setOriginalVariableList:q,isProductCarouselType:A,ctaOptionsErrors:M,setCtaOptionsErrors:D}=p();function W(e){if(H(e),null!=Y&&Y>-1&&A){const t=l($);if("URL"===x.type){const l=t.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[f];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==q||q((e=>Object.assign(Object.assign({},e),{cards:l}))),null==y||y(`https://${e}`,"custom",f)}return}let t=L.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=L.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),a=Object.assign({},null!=Y&&Y>-1?$.cards[Y]:$);if(a.buttons=s,null!=Y&&Y>-1){const e=[...$.cards];e[Y]=a,null==q||q((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==q||q((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==y||y(`https://${e}`,"custom",f)}return a((()=>{var e;if(x.buttonVariable&&o.test(x.buttonVariable))x.buttonVariable===m?B(r):B(u),H((null===(e=x.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===x.type?R:U;e="URL"===x.type?t.findIndex((e=>e.placeHolder===x.buttonVariable)):t.findIndex((e=>e.label===x.flowName)),e>-1?B(t[e]):null==D||D((e=>Object.assign(Object.assign({},e),{[f]:"Required field!"})))}}),[]),K!==c.CHATBOT?e(g,{children:[t("div",Object.assign({style:{marginBottom:8}},{children:e(d,Object.assign({style:{color:b.content.primary}},{children:[x.text," button"]}))})),t("div",Object.assign({style:{marginBottom:12}},{children:t(n,{disabled:S||V,truncatedText:!1,options:"URL"===x.type?"static_link"===(null==N?void 0:N.value)?[r]:_:Q,isSearchable:!0,onSelect:function(e,t){null==D||D((e=>(delete e[f],Object.assign({},e))));const s=e;B(s);const a=("URL"===x.type?R:U).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=Y&&Y>-1&&A){const e=l($);if("URL"===x.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==y||y({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",f),null==q||q((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===x.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[f];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==h||h({flowName:s.label,flowId:s.value},"placeholder",f),null==q||q((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===x.type){let t=L.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=L.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==y||y({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",f)}else{let t=L.buttons.filter((e=>"QUICK_REPLY"===e.type))[f];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=L.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==h||h({flowName:s.label,flowId:s.value},"placeholder",f)}const t=Object.assign({},null!=Y&&Y>-1?$.cards[Y]:$);if(t.buttons=e,null!=Y&&Y>-1){const e=[...$.cards];e[Y]=t,null==q||q((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==q||q((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else W("")},defaultOptions:N?[Object.assign(Object.assign({},N),{selected:!0})]:[],error:k?null==M?void 0:M[f]:void 0})})),("custom_link"===(null==N?void 0:N.value)||"static_link"===(null==N?void 0:N.value))&&t("div",Object.assign({style:{marginBottom:20}},{children:t(i,{state:S||V?"disabled":"none",errorMessage:k?P?j(P)?"":"Enter valid URL":"Required field":"",value:P,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:W,maxCharLimit:2e3})}))]}):t(v,{index:f,variable:{variableName:null!==(T=x.text)&&void 0!==T?T:"",updatedValue:"((customPlaceholderName))"===x.buttonVariable?`${null===(w=x.example)||void 0===w?void 0:w[0]}`:null!==(C=x.buttonVariable)&&void 0!==C?C:"",type:"link",isEditableVariable:!0,index:null!==(I=x.index)&&void 0!==I?I:0,queryParams:null!==(E=x.queryParams)&&void 0!==E?E:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:x.type,CTAoptions:R})};export{O as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cloneDeep as l}from"lodash";import{useState as s,useEffect as a}from"react";import{Dropdown as n}from"../../dropdown/Dropdown.js";import{Input as i}from"../../input/Input.js";import{editableVarPattern as o}from"../../template-preview/constants/regexPatterns.js";import{STATIC_URL_CTA_OPTION as r,CUSTOM_URL_NAME as u}from"../../template-preview/models/TemplateMeta.js";import{POD as c}from"../../template-preview/models/WhatsAppTemplate.js";import{BodySecondary as d}from"../../TypographyStyle.js";import{COLORS as b}from"../../../constants/Theme.js";import{useTemplateModalContext as p}from"../context/templateModalContext.js";import{STATIC_URL_VARIABLE_NAME as m}from"../utils/constants.js";import{validateIsUrl as j}from"../utils/validateIsUrl.js";import v,{Container as g}from"./VariableConnector.js";const O=O=>{let{variableListIndex:f,button:x,updateSelectedURLTemplateBtn:y,updateSelectedQRBTemplateBtn:h,currentVariableList:L,CTAoptions:R,QRBoptions:U,disableEdit:V}=O;var T,w,C,I,E;const[P,H]=s(""),[N,B]=s(),_=null==R?void 0:R.map((e=>Object.assign(Object.assign({},e),{selected:(null==N?void 0:N.value)===e.value&&N.label===e.label}))),Q=null==U?void 0:U.map((e=>Object.assign(Object.assign({},e),{selected:(null==N?void 0:N.value)===e.value}))),{isError:k,disableEditVariable:S,pod:K,selectedCarouselIndex:Y,originalVariableList:$,setOriginalVariableList:q,isProductCarouselType:A,ctaOptionsErrors:M,setCtaOptionsErrors:D}=p();function W(e){if(H(e),null!=Y&&Y>-1&&A){const t=l($);if("URL"===x.type){const l=t.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[f];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==q||q((e=>Object.assign(Object.assign({},e),{cards:l}))),null==y||y(`https://${e}`,"custom",f)}return}let t=L.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=L.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),a=Object.assign({},null!=Y&&Y>-1?$.cards[Y]:$);if(a.buttons=s,null!=Y&&Y>-1){const e=[...$.cards];e[Y]=a,null==q||q((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==q||q((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==y||y(`https://${e}`,"custom",f)}return a((()=>{var e;if(x.buttonVariable&&o.test(x.buttonVariable))x.buttonVariable===m?B(r):B(u),H((null===(e=x.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===x.type?R:U;e="URL"===x.type?t.findIndex((e=>e.placeHolder===x.buttonVariable)):t.findIndex((e=>e.label===x.flowName)),e>-1?B(t[e]):null==D||D((e=>Object.assign(Object.assign({},e),{[f]:"Required field!"})))}}),[]),K!==c.CHATBOT?e(g,{children:[t("div",Object.assign({style:{marginBottom:8}},{children:e(d,Object.assign({style:{color:b.content.primary}},{children:[x.text," button"]}))})),t("div",Object.assign({style:{marginBottom:12}},{children:t(n,{disabled:S||V,truncatedText:!1,options:"URL"===x.type?"static_link"===(null==N?void 0:N.value)?[r]:_:Q,isSearchable:!0,onSelect:function(e,t){null==D||D((e=>(delete e[f],Object.assign({},e))));const s=e;B(s);const a=("URL"===x.type?R:U).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=Y&&Y>-1&&A){const e=l($);if("URL"===x.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==y||y({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",f),null==q||q((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===x.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[f];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==h||h({flowName:s.label,flowId:s.value},"placeholder",f),null==q||q((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===x.type){let t=L.buttons.filter((e=>"URL"===e.type))[f];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=L.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==y||y({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",f)}else{let t=L.buttons.filter((e=>"QUICK_REPLY"===e.type))[f];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=L.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==h||h({flowName:s.label,flowId:s.value},"placeholder",f)}const t=Object.assign({},null!=Y&&Y>-1?$.cards[Y]:$);if(t.buttons=e,null!=Y&&Y>-1){const e=[...$.cards];e[Y]=t,null==q||q((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==q||q((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else W("")},defaultOptions:N?[Object.assign(Object.assign({},N),{selected:!0})]:[],error:k?null==M?void 0:M[f]:void 0})})),("custom_link"===(null==N?void 0:N.value)||"static_link"===(null==N?void 0:N.value))&&t("div",Object.assign({style:{marginBottom:20}},{children:t(i,{state:S||V?"disabled":"none",errorMessage:k?P?j(P)?"":"Enter valid URL":"Required field":"",value:P,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:W,maxCharLimit:2e3})}))]}):t(v,{index:f,variable:{variableName:null!==(T=x.text)&&void 0!==T?T:"",updatedValue:"((customPlaceholderName))"===x.buttonVariable?`${null===(w=x.example)||void 0===w?void 0:w[0]}`:null!==(C=x.buttonVariable)&&void 0!==C?C:"",type:"link",isEditableVariable:!0,index:null!==(I=x.index)&&void 0!==I?I:0,queryParams:null!==(E=x.queryParams)&&void 0!==E?E:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:x.type,CTAoptions:R})};export{O as default};
@@ -9,4 +9,5 @@ export declare const ZeroState: React.FC<{
9
9
  actionButton?: ButtonProps;
10
10
  buttonWidth?: number;
11
11
  Icon?: React.ReactNode;
12
+ containerWidth?: string;
12
13
  }>;
@@ -1,12 +1,12 @@
1
- import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n}from"react/jsx-runtime";import o from"styled-components";import{Spinner as i}from"../spinner/Spinner.js";import{TitleRegular as r,BodyCaption as l}from"../TypographyStyle.js";import{COLORS as s}from"../../constants/Theme.js";import c from"../../assets/icons/alert.svg.js";import{Button as d}from"../button/Button.js";const a=o.div`
2
- background: ${s.surface.standard};
1
+ import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n}from"react/jsx-runtime";import i from"styled-components";import{Spinner as o}from"../spinner/Spinner.js";import{BodyCaption as r,TitleRegular as l,TitleSmall as s}from"../TypographyStyle.js";import{COLORS as c}from"../../constants/Theme.js";import a from"../../assets/icons/alert.svg.js";import{Button as d}from"../button/Button.js";const u=i.div`
2
+ background: ${c.surface.standard};
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  align-items: center;
6
6
  justify-content: center;
7
7
  flex: 1;
8
- `,u=o.div`
9
- background: ${s.background.base};
8
+ `,m=i.div`
9
+ background: ${c.background.base};
10
10
  width: 48px;
11
11
  height: 48px;
12
12
  display: flex;
@@ -14,4 +14,4 @@ import{__rest as t}from"../../_virtual/_tslib.js";import{jsxs as e,jsx as n}from
14
14
  align-items: center;
15
15
  justify-content: center;
16
16
  border-radius: 24px;
17
- `,m=o=>{var{subTitle:m,title:p,IconHolderStyle:g,style:y,isLoading:b}=o,f=t(o,["subTitle","title","IconHolderStyle","style","isLoading"]);return e(a,Object.assign({style:null!=y?y:{}},{children:[b?n(i,{size:"large",color:s.stroke.brand}):n(u,Object.assign({style:null!=g?g:{}},{children:(null==f?void 0:f.Icon)||n(c,{color:s.content.placeholder,height:24,width:24})})),n(r,Object.assign({style:{marginTop:8,color:s.content.primary}},{children:b?"Loading...":p||"No results found"})),!!m&&!b&&n(l,Object.assign({style:{marginTop:4,color:s.content.secondary,textAlign:"center",maxWidth:184}},{children:m})),!!(null==f?void 0:f.actionButton)&&n("div",Object.assign({style:(null==f?void 0:f.buttonWidth)?{width:null==f?void 0:f.buttonWidth,display:"flex"}:{}},{children:n(d,Object.assign({},null==f?void 0:f.actionButton))}))]}))};export{m as ZeroState};
17
+ `,p=i=>{var{subTitle:p,title:g,IconHolderStyle:h,style:y,isLoading:b,containerWidth:f}=i,j=t(i,["subTitle","title","IconHolderStyle","style","isLoading","containerWidth"]);let x=l;const v=f?parseFloat(f):0;return v&&!isNaN(v)&&v<=150&&(x=s),e(u,Object.assign({style:null!=y?y:{}},{children:[b?n(o,{size:"large",color:c.stroke.brand}):n(m,Object.assign({style:null!=h?h:{}},{children:(null==j?void 0:j.Icon)||n(a,{color:c.content.placeholder,height:24,width:24})})),n(x,Object.assign({style:{marginTop:8,color:c.content.primary}},{children:b?"Loading...":g||"No results found"})),!!p&&!b&&n(r,Object.assign({style:{marginTop:4,color:c.content.secondary,textAlign:"center",maxWidth:184}},{children:p})),!!(null==j?void 0:j.actionButton)&&n("div",Object.assign({style:(null==j?void 0:j.buttonWidth)?{width:null==j?void 0:j.buttonWidth,display:"flex"}:{}},{children:n(d,Object.assign({},null==j?void 0:j.actionButton))}))]}))};export{p as ZeroState};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.679-0",
3
+ "version": "0.0.679-10",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",