@ikas/loyalty-widget-renderer 1.0.0-alpha.36 → 1.0.0-alpha.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import e,{useState as t}from"react";import{observer as n}from"mobx-react";import l from"../button/index.js";import{CheckCircleFill as i}from"../../../assets/icons/check-circle-fill.js";import{ChevronLeft as r}from"../../../assets/icons/chevron-left.js";import{Container as o,Header as c,IconWrapper as a,Content as m,Title as s,Description as d,ArrowButton as p,AccordionWrapper as u,AccordionInner as f}from"./style.js";var E=n(function(n){var E=n.title,x=n.description,g=n.icon,$=n.action,b=n.isCompleted,v=n.mode,y=n.children,C=n.padding,k=n.settings,j=t(!1),h=j[0],O=j[1],S=!b&&(null==$?void 0:$.text)&&(null==$?void 0:$.onClick);return e.createElement(o,{$borderRadius:k.borderRadius,$isCompleted:b,$padding:C},e.createElement(c,{onClick:function(){"accordion"===v&&O(!h)},style:{cursor:"accordion"===v?"pointer":"default"}},e.createElement(a,{$iconType:k.widgetIconType},g),e.createElement(m,null,e.createElement(s,null,E),e.createElement(d,null,x)),"card"===v?e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},b&&e.createElement(i,null),S&&e.createElement(l,{button:k.button,paddingSize:"small",fontSize:"textSMMedium",onClick:$.onClick},$.text)):e.createElement(p,{$isOpen:h},e.createElement(r,null))),"accordion"===v&&e.createElement(u,{$isOpen:h},e.createElement(f,{$isOpen:h},y)))});export{E as default};
1
+ import e,{useState as t}from"react";import{observer as n}from"mobx-react";import{WidgetIconTypeEnum as i}from"../../../models/loyalty-widget/types/index.js";import l from"../button/index.js";import{CheckCircleFill as o}from"../../../assets/icons/check-circle-fill.js";import{ChevronLeft as r}from"../../../assets/icons/chevron-left.js";import{Container as c,Header as a,IconWrapper as m,Content as s,Title as d,Description as p,ArrowButton as u,AccordionWrapper as f,AccordionInner as E}from"./style.js";var y=n(function(n){var y=n.title,g=n.description,x=n.icon,$=n.action,b=n.isCompleted,v=n.mode,C=n.children,j=n.padding,k=n.settings,O=t(!1),h=O[0],w=O[1],I=!b&&(null==$?void 0:$.text)&&(null==$?void 0:$.onClick);return e.createElement(c,{$borderRadius:k.borderRadius,$isCompleted:b,$padding:j},e.createElement(a,{onClick:function(){"accordion"===v&&w(!h)},style:{cursor:"accordion"===v?"pointer":"default"}},k.widgetIconType!==i.NONE&&e.createElement(m,{$iconType:k.widgetIconType},x),e.createElement(s,null,e.createElement(d,null,y),e.createElement(p,null,g)),"card"===v?e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},b&&e.createElement(o,null),I&&e.createElement(l,{button:k.button,paddingSize:"small",fontSize:"textSMMedium",onClick:$.onClick},$.text)):e.createElement(u,{$isOpen:h},e.createElement(r,null))),"accordion"===v&&e.createElement(f,{$isOpen:h},e.createElement(E,{$isOpen:h},C)))});export{y as default};
@@ -1 +1 @@
1
- import e from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as t}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{observer as n}from"mobx-react";import{LoyaltyWidgetScreenTypeEnum as r}from"../../../../models/types/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as o,GridContainer as i,SmallCard as a,SmallCardIconWrapper as s,SmallCardBottom as c,Title as m,ArrowWrapper as u,RowCard as E}from"./style.js";import{getScreenIcon as d}from"../../../../utils.js";var R=function(){return e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))},_=n(function(n){var _=n.viewModel,g=n.onNavigate,y=t().t,T=_.user,p=!!T,C=_.loyaltyWidget.settings.widgetIconType;return e.createElement(o,null,e.createElement(i,null,e.createElement(a,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_EARNING_METHODS_SCREEN)}},e.createElement(s,{$hasBgColor:C===l.ILLUSTRATION,$iconType:C},d(r.CREDIT_EARNING_METHODS_SCREEN,C)),e.createElement(c,null,e.createElement(m,null,y("main_screen.earnPoints")),e.createElement(u,null,e.createElement(R,null)))),e.createElement(a,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_SPENDING_METHODS_SCREEN)}},e.createElement(s,{$hasBgColor:C===l.ILLUSTRATION,$iconType:C},d(r.CREDIT_SPENDING_METHODS_SCREEN,C)),e.createElement(c,null,e.createElement(m,null,y("main_screen.allRewards")),e.createElement(u,null,e.createElement(R,null))))),p&&e.createElement(e.Fragment,null,(null==T?void 0:T.customerTierId)&&e.createElement(E,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.LOYALTY_LEVEL_SCREEN)}},e.createElement(m,null,y("main_screen.tiers")),e.createElement(u,null,e.createElement(R,null))),_.pointHistory.length>0&&e.createElement(E,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_HISTORY_SCREEN)}},e.createElement(m,null,y("main_screen.pointHistory")),e.createElement(u,null,e.createElement(R,null)))))});export{_ as default};
1
+ import e from"react";import'./../../../../ext/react-i18next/dist/es/context.js';import{useTranslation as t}from'./../../../../ext/react-i18next/dist/es/useTranslation.js';import{observer as n}from"mobx-react";import{LoyaltyWidgetScreenTypeEnum as r}from"../../../../models/types/index.js";import{WidgetIconTypeEnum as l}from"../../../../models/loyalty-widget/types/index.js";import{Container as o,GridContainer as i,SmallCard as a,SmallCardIconWrapper as s,SmallCardBottom as c,Title as E,ArrowWrapper as m,RowCard as u}from"./style.js";import{getScreenIcon as d}from"../../../../utils.js";var R=function(){return e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"}))},_=n(function(n){var _=n.viewModel,g=n.onNavigate,N=t().t,y=_.user,T=!!y,p=_.loyaltyWidget.settings.widgetIconType;return e.createElement(o,null,e.createElement(i,null,e.createElement(a,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_EARNING_METHODS_SCREEN)}},p!==l.NONE&&e.createElement(s,{$hasBgColor:p===l.ILLUSTRATION,$iconType:p},d(r.CREDIT_EARNING_METHODS_SCREEN,p)),e.createElement(c,null,e.createElement(E,null,N("main_screen.earnPoints")),e.createElement(m,null,e.createElement(R,null)))),e.createElement(a,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_SPENDING_METHODS_SCREEN)}},p!==l.NONE&&e.createElement(s,{$hasBgColor:p===l.ILLUSTRATION,$iconType:p},d(r.CREDIT_SPENDING_METHODS_SCREEN,p)),e.createElement(c,null,e.createElement(E,null,N("main_screen.allRewards")),e.createElement(m,null,e.createElement(R,null))))),T&&e.createElement(e.Fragment,null,(null==y?void 0:y.customerTierId)&&e.createElement(u,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.LOYALTY_LEVEL_SCREEN)}},e.createElement(E,null,N("main_screen.tiers")),e.createElement(m,null,e.createElement(R,null))),_.pointHistory.length>0&&e.createElement(u,{$borderRadius:_.loyaltyWidget.settings.cartBorderRadius,onClick:function(){return null==g?void 0:g(r.CREDIT_HISTORY_SCREEN)}},e.createElement(E,null,N("main_screen.pointHistory")),e.createElement(m,null,e.createElement(R,null)))))});export{_ as default};