UNPKG

@guruhotel/aura-ui

Version:

⚛️ React UI library by GuruHotel

1 lines 1.57 kB
export const getStylesWithColorScheme=({isRoundedLeft:e,isSelected:o,colorScheme:t,isSelectionStart:r,isSelectionEnd:n,isFocusVisible:s,isUnavailable:l,isDisabled:i})=>{const c={backgroundColor:`$${t}9`,"&:hover":{backgroundColor:`$${t}11`}},a={"&:hover":{backgroundColor:`$${t}7`}},$={"&:hover":{backgroundColor:`$${t}11 !important`}};return{containerBg:e||o?`$${t}5`:void 0,boxShadowFocusVisible:s?`0 0 0 2px $colors$surfaceLight, 0 0 0 4px $colors$${t}9`:void 0,stylesWhenIsSelectionStart:r?{...c}:{},stylesWhenIsSelectionEnd:n?{...c}:{},compoundVariantsForSelectionStart:!o||r||l?{}:{...a},compoundVariantsForSelectionEnd:!o||n||l?{}:{...a},hoverElementThatIsNotSelection:o||l||i?{}:{"&:hover":{backgroundColor:`$${t}5`}},hoverStartSelection:o&&r&&!l?{...$}:{},hoverEndSelection:o&&n&&!l?{...$}:{}}};export function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}export const getTooltipLabels=({day:e,night:o,numberOfDays:t})=>{let r=null,n=null;if(o){const{singular:e,plural:n}=o;r=t-1==1?`${t-1} ${e}`:`${t-1} ${n}`}if(e){const{singular:o,plural:r}=e;n=1===t?`${t} ${o}`:`${t} ${r}`}return{nightLabel:r,dayLabel:n}};const e={xs:"$sm",sm:"$md",md:"$lg",lg:"$xl"},o={xs:"$2xs",sm:"$xs",md:"$sm",lg:"$md"};export const decreaseResponsiveValue=(e,t)=>{if("string"==typeof e)return{[`${t}`]:o[e]};const r={};return Object.keys(e).forEach((n=>{r[`${n}`]={[`${t}`]:o[e[n]]}})),r};export const increaseResponsiveValue=(o,t)=>{if("string"==typeof o)return{[`${t}`]:e[o]};const r={};return Object.keys(o).forEach((n=>{r[`${n}`]={[`${t}`]:e[o[n]]}})),r};