UNPKG

@guruhotel/aura-ui

Version:

⚛️ React UI library by GuruHotel

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