UNPKG

@lanaco/lnc-react-ui

Version:

React component library

89 lines (83 loc) 2.61 kB
"use strict";const e=require("react/jsx-runtime"),u=require("react"),a=require("./emotion-styled.browser.esm-Cle7tAM9.cjs"),r=require("./utils-NZLCh-J5.cjs"),f=a.newStyled.div` background-color: var(--gray-200, #dddfe4); border-radius: 0.75rem; min-width: 11.625rem; min-height: 11.625rem; max-width: 11.625rem; max-height: 11.625rem; ${r.linearGradientAnimation("-90deg")} `,b=a.newStyled.div` display: flex; flex-direction: column; justify-content: end; position: relative; border-radius: 0.75rem; overflow: hidden; cursor: pointer; background: linear-gradient( 178deg, rgba(0, 0, 0, 0) 1.5%, rgba(0, 0, 0, 0.16) 8.95%, #000 98.39% ); & .text-block { padding: 0.75rem; z-index: 1; display: flex; flex-direction: column; gap: 0.5rem; position: absolute; bottom: 0rem; left: 0rem; } & .img-wrapper { position: absolute; top: 0; left: 0; z-index: 0; background: linear-gradient( 178deg, rgba(0, 0, 0, 0) 1.5%, rgba(0, 0, 0, 0.16) 8.95%, #000 98.39% ); } & img { width: 100%; aspect-ratio: 1 / 1; /* defining the aspect ratio of the image */ object-fit: cover; /* making sure the image isn't distorted */ border-radius: 0.75rem; mix-blend-mode: multiply; } & .fallback-image { mix-blend-mode: multiply; } font-size: 0.875rem; font-weight: 500; & .price-chip { font-size: 0.75rem; font-weight: 500; padding: 0 0.38rem; min-height: 1.25rem; max-height: 1.25rem; width: fit-content; display: flex; align-items: center; justify-content: center; border-radius: 62.4375rem; z-index: 1; background-color: var(--white, #fff); color: var(--gray-950, #14161a); } & .title-simple-product-card { z-index: 1; color: var(--white, #fff); transition: all 0.2s ease; } &:hover { & .title-simple-product-card { z-index: 1; color: var(--primary-500, #f59e0b); } } `,h=u.forwardRef((n,x)=>{const{uuid:y,title:d,price:i,currency:t,isNegotiable:l,isFree:c,image:s,sellerUuid:v,onSelectCard:m=()=>{},imageComponent:o,negotiableText:p="Negotiable",freeText:g="Free"}=n;return e.jsxs(b,{className:"simple-product-card",onClick:m,children:[r.isDefined(o)?o:e.jsx("img",{src:s}),e.jsxs("div",{className:"text-block",children:[e.jsx("div",{className:"title-simple-product-card",children:d}),e.jsxs("div",{className:"price-chip",children:[i&&t&&`${r.formatPrice(i)} ${r.GetCurrencySymbol(t)}`,l&&p,c&&g]})]})]})});exports.SimpleProductCard=h;exports.SkeletonWrapper=f;