@trafilea/afrodita-components 7.5.0 → 7.5.2
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.
- package/build/es/components/pricing/discount/DiscountTag.js +1 -1
- package/build/es/components/search-bar/components/ResultsPanel/ResultsPanel.js +1 -1
- package/build/index.d.ts +2 -1
- package/build/lib/components/pricing/discount/DiscountTag.js +1 -1
- package/build/lib/components/search-bar/components/ResultsPanel/ResultsPanel.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as r,jsx as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as r,jsx as i,Fragment as s}from"react/jsx-runtime";import{useTheme as e}from"../../../core/theme/Theme.js";import{ComponentSize as n}from"../../../types/enums.js";import{Container as t,IconContainer as d,H3 as c}from"./styled.js";var a=function(o){var r=o.discount,e=o.offText,n=o.savings,t=o.showSavings,d=void 0!==t&&t,c=o.showOnlySavings;if(void 0!==c&&c&&n)return i(s,{children:n},void 0);var a="".concat(r,"% ").concat(e),v=d&&n?" - ".concat(n):"";return i(s,{children:"".concat(a).concat(v).trim()},void 0)},v=function(s){var v=s.discount,l=s.offText,f=s.savings,h=s.showSavings,m=void 0!==h&&h,u=s.showOnlySavings,g=void 0!==u&&u,p=s.disabled,b=s.backgroundColor,w=void 0===b?"#fff":b,y=s.borderColor,x=void 0===y?"transparent":y,S=s.textColor,C=void 0===S?"#fff":S,j=s.size,T=void 0===j?n.Medium:j,z=s.style,O=s.bordersRounded,k=void 0!==O&&O,R=s.icon,M=e();return r(t,o({backgroundColor:p?M.colors.shades[50].color:w,borderColor:p?M.colors.shades[50].color:x,size:T,"data-testid":"discount-container",style:z,bordersRounded:k},{children:[R&&i(d,{children:R},void 0),i(c,o({textColor:p?M.colors.shades[250].color:C,size:T,style:o(o({},z),{whiteSpace:"nowrap"}),theme:M},{children:i(a,{discount:v,offText:l,savings:f,showSavings:m,showOnlySavings:g},void 0)}),void 0)]}),void 0)};export{v as DiscountTag,a as SavingsText};
|
|
2
2
|
//# sourceMappingURL=DiscountTag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as t,__rest as r}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as o}from"../../../../core/theme/Theme.js";import{Text as n}from"../../../text/Text.js";import{Footer as m}from"../Footer/Footer.js";import{ProductItem as c}from"../ProductItem/ProductItem.js";import{Container as d,Header as l,OptionsList as p,OptionItem as h,Anchor as s}from"./styled.js";var v=function(v){var a=v.options,f=v.header,u=v.footer,j=v.onViewAll,x=v.testId,I=v.onItemClick,k=o();return e(d,t({"data-testid":x,theme:k},{children:[f&&i(l,t({theme:k},{children:i(n,t({variant:"heading6",weight:"demi"},{children:f}),void 0)}),void 0),i(p,{children:a.map((function(e){var o=e.optionUrl,n=e.price,m=e.src,d=e.title,l=r(e,["optionUrl","price","src","title"]);return i(h,t({theme:k},{children:i(s,t({href:o,onClick:function(){return r=t({optionUrl:o,price:n,src:m,title:d},l),void(null==I||I(r));var r}},{children:i(c,{src:m,title:d,price:n},void 0)}),void 0)}),d)}))},void 0),u&&i(m,{text:u,onClick:j},void 0)]}),void 0)};export{v as ResultsPanel};
|
|
2
2
|
//# sourceMappingURL=ResultsPanel.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ interface DiscountTagProps$1 {
|
|
|
90
90
|
offText: string;
|
|
91
91
|
savings?: string;
|
|
92
92
|
showSavings?: boolean;
|
|
93
|
+
showOnlySavings?: boolean;
|
|
93
94
|
disabled?: boolean;
|
|
94
95
|
backgroundColor?: string;
|
|
95
96
|
borderColor?: string;
|
|
@@ -99,7 +100,7 @@ interface DiscountTagProps$1 {
|
|
|
99
100
|
bordersRounded?: boolean;
|
|
100
101
|
icon?: ReactNode;
|
|
101
102
|
}
|
|
102
|
-
declare const DiscountTag: ({ discount, offText, savings, showSavings, disabled, backgroundColor, borderColor, textColor, size, style, bordersRounded, icon, }: DiscountTagProps$1) => JSX.Element;
|
|
103
|
+
declare const DiscountTag: ({ discount, offText, savings, showSavings, showOnlySavings, disabled, backgroundColor, borderColor, textColor, size, style, bordersRounded, icon, }: DiscountTagProps$1) => JSX.Element;
|
|
103
104
|
|
|
104
105
|
interface PriceLabelProps {
|
|
105
106
|
finalPrice: string | number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),e=require("react/jsx-runtime"),s=require("../../../core/theme/Theme.js"),r=require("../../../types/enums.js"),i=require("./styled.js"),n=function(o){var s=o.discount,r=o.offText,i=o.savings,n=o.showSavings,t=void 0!==n&&n,d=o.showOnlySavings;if(void 0!==d&&d&&i)return e.jsx(e.Fragment,{children:i},void 0);var a="".concat(s,"% ").concat(r),c=t&&i?" - ".concat(i):"";return e.jsx(e.Fragment,{children:"".concat(a).concat(c).trim()},void 0)};exports.DiscountTag=function(t){var d=t.discount,a=t.offText,c=t.savings,v=t.showSavings,l=void 0!==v&&v,u=t.showOnlySavings,g=void 0!==u&&u,h=t.disabled,f=t.backgroundColor,x=void 0===f?"#fff":f,j=t.borderColor,m=void 0===j?"transparent":j,_=t.textColor,b=void 0===_?"#fff":_,p=t.size,y=void 0===p?r.ComponentSize.Medium:p,C=t.style,S=t.bordersRounded,w=void 0!==S&&S,T=t.icon,q=s.useTheme();return e.jsxs(i.Container,o.__assign({backgroundColor:h?q.colors.shades[50].color:x,borderColor:h?q.colors.shades[50].color:m,size:y,"data-testid":"discount-container",style:C,bordersRounded:w},{children:[T&&e.jsx(i.IconContainer,{children:T},void 0),e.jsx(i.H3,o.__assign({textColor:h?q.colors.shades[250].color:b,size:y,style:o.__assign(o.__assign({},C),{whiteSpace:"nowrap"}),theme:q},{children:e.jsx(n,{discount:d,offText:a,savings:c,showSavings:l,showOnlySavings:g},void 0)}),void 0)]}),void 0)},exports.SavingsText=n;
|
|
2
2
|
//# sourceMappingURL=DiscountTag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("../../../../core/theme/Theme.js"),i=require("../../../text/Text.js"),s=require("../Footer/Footer.js"),o=require("../ProductItem/ProductItem.js"),n=require("./styled.js");exports.ResultsPanel=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("../../../../core/theme/Theme.js"),i=require("../../../text/Text.js"),s=require("../Footer/Footer.js"),o=require("../ProductItem/ProductItem.js"),n=require("./styled.js");exports.ResultsPanel=function(c){var d=c.options,l=c.header,u=c.footer,a=c.onViewAll,h=c.testId,_=c.onItemClick,j=t.useTheme();return r.jsxs(n.Container,e.__assign({"data-testid":h,theme:j},{children:[l&&r.jsx(n.Header,e.__assign({theme:j},{children:r.jsx(i.Text,e.__assign({variant:"heading6",weight:"demi"},{children:l}),void 0)}),void 0),r.jsx(n.OptionsList,{children:d.map((function(t){var i=t.optionUrl,s=t.price,c=t.src,d=t.title,l=e.__rest(t,["optionUrl","price","src","title"]);return r.jsx(n.OptionItem,e.__assign({theme:j},{children:r.jsx(n.Anchor,e.__assign({href:i,onClick:function(){return r=e.__assign({optionUrl:i,price:s,src:c,title:d},l),void(null==_||_(r));var r}},{children:r.jsx(o.ProductItem,{src:c,title:d,price:s},void 0)}),void 0)}),d)}))},void 0),u&&r.jsx(s.Footer,{text:u,onClick:a},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=ResultsPanel.js.map
|
package/package.json
CHANGED