UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 1.65 kB
import"react";import i from"styled-components";import{margin as t}from"styled-system";import o from"../icon/icon.component.js";import e from"../profile/profile.config.js";import r from"../../style/themes/apply-base-theme.js";import{PORTRAIT_SIZE_PARAMS as n}from"./portrait.config.js";import s from"./__internal__/get-colors.js";const d=i.div.withConfig({displayName:"portrait.style__StyledPortraitInitials",componentId:"sc-db9324dd-0"})(["font-weight:500;font-size:",";display:flex;white-space:nowrap;align-items:center;justify-content:center;height:inherit;width:inherit;"],(({size:i})=>e[i].initialSize)),a=i.img.withConfig({displayName:"portrait.style__StyledCustomImg",componentId:"sc-db9324dd-1"})(["height:inherit;min-width:inherit;"]),m=i(o).withConfig({displayName:"portrait.style__StyledIcon",componentId:"sc-db9324dd-2"})(["&&{color:inherit;height:inherit;min-width:inherit;::before{font-size:","px;}}"],(({size:i})=>n[i].iconDimensions)),l=i.div.attrs(r).withConfig({displayName:"portrait.style__StyledPortraitContainer",componentId:"sc-db9324dd-3"})(["",";"," min-width:","px;height:","px;overflow:hidden;border-radius:",";border:1px solid var(--colorsUtilityReadOnly600);display:inline-block;"," ",""],(({darkBackground:i,backgroundColor:t,size:o,foregroundColor:e})=>s(t,i,!["XS","S"].includes(o),!0,e)),(({hasValidImg:i,size:t})=>i&&`max-width: ${n[t].dimensions}px;`),(({size:i})=>n[i].dimensions),(({size:i})=>n[i].dimensions),(({shape:i})=>"square"===i?"0px":"var(--borderRadiusCircle)"),(({onClick:i})=>i&&"cursor: pointer"),t);export{a as StyledCustomImg,m as StyledIcon,l as StyledPortraitContainer,d as StyledPortraitInitials};