@guruhotel/aura-ui
Version:
⚛️ React UI library by GuruHotel
1 lines • 10.5 kB
JavaScript
exports.__esModule=!0,exports.Tr=exports.Th=exports.TdText=exports.TdHorizontal=exports.TdContainer=exports.Td=exports.Table=exports.THead=exports.TBody=exports.NumberDayText=exports.HorizontalTitle=exports.HorizontalContainer=exports.HorizontalCalendarView=exports.HeaderTitle=exports.DayText=exports.CalendarContainer=exports.Button=void 0;var o=require("../box"),r=require("../text"),e=require("../theme"),t=require("../common-variants");const d=(0,e.styled)("button",{all:"unset",display:"inline-flex",alignItems:"center",justifyContent:"center",rounded:"$full",backgroundColor:"$surfaceWhite",variants:{isDisabled:{true:{"&:disabled":{"&:hover":{backgroundColor:"$gray3 !important"},cursor:"no-drop"}}},rounded:{none:{rounded:"$none"},xs:{rounded:"$xs"},sm:{rounded:"$xs"},md:{rounded:"$sm"},lg:{rounded:"$md"},xl:{rounded:"$lg"},"2xl":{rounded:"$xl"},"3xl":{rounded:"$2xl"},full:{rounded:"$full"},halfBase:{rounded:Math.abs(parseInt(e.theme.radii.halfBase.value.replace(/\D/g,""),10)/2)},base:{rounded:"$halfBase"}}}});exports.Button=d;const n=(0,e.styled)(r.Text,{flex:"1 1 0%",textAlign:"center"});exports.HeaderTitle=n;const a=(0,e.styled)("table",{flex:"1 1 0%",borderSpacing:0});exports.Table=a;const i=(0,e.styled)("thead",{color:"$gray11"});exports.THead=i;const l=(0,e.styled)("tr",{});exports.Tr=l;const s=(0,e.styled)("th",{});exports.Th=s;const $=(0,e.styled)("td",{position:"relative",variants:{isCell:{true:{py:"$1"}},isFocusVisible:{true:{zIndex:10},false:{zIndex:0}}}});exports.Td=$;const u=(0,e.styled)(o.Box,{width:"$full",height:"$full",outline:"2px solid transparent",outlineOffset:"2px",variants:{isRoundedLeft:{none:{borderTopLeftRadius:"$none",borderBottomLeftRadius:"$none"},xs:{borderTopLeftRadius:"$xs",borderBottomLeftRadius:"$xs"},sm:{borderTopLeftRadius:"$sm",borderBottomLeftRadius:"$sm"},md:{borderTopLeftRadius:"$md",borderBottomLeftRadius:"$md"},lg:{borderTopLeftRadius:"$lg",borderBottomLeftRadius:"$lg"},xl:{borderTopLeftRadius:"$xl",borderBottomLeftRadius:"$xl"},"2xl":{borderTopLeftRadius:"$2xl",borderBottomLeftRadius:"$2xl"},"3xl":{borderTopLeftRadius:"$3xl",borderBottomLeftRadius:"$3xl"},full:{borderTopLeftRadius:"$full",borderBottomLeftRadius:"$full"},base:{borderTopLeftRadius:"$base",borderBottomLeftRadius:"$base"},halfBase:{borderTopLeftRadius:"$halfBase",borderBottomLeftRadius:"$halfBase"}},isRoundedRight:{none:{borderTopRightRadius:"$none",borderBottomRightRadius:"$none"},xs:{borderTopRightRadius:"$xs",borderBottomRightRadius:"$xs"},sm:{borderTopRightRadius:"$sm",borderBottomRightRadius:"$sm"},md:{borderTopRightRadius:"$md",borderBottomRightRadius:"$md"},lg:{borderTopRightRadius:"$lg",borderBottomRightRadius:"$lg"},xl:{borderTopRightRadius:"$xl",borderBottomRightRadius:"$xl"},"2xl":{borderTopRightRadius:"$2xl",borderBottomRightRadius:"$2xl"},"3xl":{borderTopRightRadius:"$3xl",borderBottomRightRadius:"$3xl"},full:{borderTopRightRadius:"$full",borderBottomRightRadius:"$full"},base:{borderTopRightRadius:"$base",borderBottomRightRadius:"$base"},halfBase:{borderTopRightRadius:"$halfBase",borderBottomRightRadius:"$halfBase"}},isDisabled:{true:{cursor:"default",color:"$gray8"}}}});exports.TdContainer=u;const c=(0,e.styled)(o.Box,{minW:"$10",minH:"$10",width:"$full",height:"$full",p:"$3 $2",cursor:"default",rounded:"$full",display:"flex",justifyContent:"center",alignItems:"center",fontWeight:500,variants:{isFocusVisible:{true:{zIndex:2}},isSelectionStart:{true:{color:"$surfaceLight !important"}},isSelectionEnd:{true:{color:"$surfaceLight !important"}},isSelected:{true:{}},isDisabled:{true:{cursor:"default",color:"$gray8"}},isUnavailable:{true:{color:"$gray8",cursor:"no-drop"}},containDot:{true:{}},rounded:t.rounded},compoundVariants:[{containDot:!0,isUnavailable:!0,css:{color:"$gray12"}}]});exports.TdText=c;const h=(0,e.styled)("tbody",{});exports.TBody=h;const x=(0,e.styled)("div",{boxSizing:"border-box",p:"$4",variants:{size:{xs:{[`& ${n}`]:{fontSize:"$sm"},[`& ${d}`]:{fontSize:"60%",height:"$6",paddingInlineStart:"$2",paddingInlineEnd:"$2"},[`& ${c}, & ${s}`]:{fontSize:"$xs",minW:"$4",minH:"$4",p:"$2"}},sm:{[`& ${n}`]:{fontSize:"$md"},[`& ${d}`]:{fontSize:"60%",height:"$8",paddingInlineStart:"$3",paddingInlineEnd:"$3"},[`& ${c}, & ${s}`]:{fontSize:"$sm",minW:"$4",minH:"$4",p:"$3"}},md:{p:"$6",[`& ${n}`]:{fontSize:"$lg"},[`& ${d}`]:{fontSize:"60%",height:"$10",paddingInlineStart:"$4",paddingInlineEnd:"$4"},[`& ${c}, & ${s}`]:{fontSize:"$md",minW:"$4",minH:"$4",p:"$3"}},lg:{p:"$6",[`& ${n}`]:{fontSize:"$xl"},[`& ${d}`]:{fontSize:"60%",height:"$12",paddingInlineStart:"$6",paddingInlineEnd:"$6"},[`& ${c}, & ${s}`]:{fontSize:"$md",minW:"$4",minH:"$4",p:"$4"}},xl:{p:"$8",[`& ${n}`]:{fontSize:"$2xl"},[`& ${d}`]:{fontSize:"60%",height:"$14",paddingInlineStart:"$8",paddingInlineEnd:"$8"},[`& ${c}, & ${s}`]:{fontSize:"$lg",minW:"$4",minH:"$4",p:"$4"}}},colorScheme:{text:{[`& ${n}`]:{color:"$text12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$text4"},"&:focus":{boxShadow:"0 0 0 2px $colors$text9"}}},guru:{[`& ${n}`]:{color:"$guru12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$guru4"},"&:focus":{boxShadow:"0 0 0 2px $colors$guru9"}}},fellow:{[`& ${n}`]:{color:"$fellow12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$fellow4"},"&:focus":{boxShadow:"0 0 0 2px $colors$fellow9"}}},darkie:{[`& ${n}`]:{color:"$darkie12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$darkie4"},"&:focus":{boxShadow:"0 0 0 2px $colors$darkie9"}}},red:{[`& ${n}`]:{color:"$red12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$red4"},"&:focus":{boxShadow:"0 0 0 2px $colors$red9"}}},nature:{[`& ${n}`]:{color:"$nature12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$nature4"},"&:focus":{boxShadow:"0 0 0 2px $colors$nature9"}}},sunshine:{[`& ${n}`]:{color:"$sunshine12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$sunshine4"},"&:focus":{boxShadow:"0 0 0 2px $colors$sunshine9"}}},violet:{[`& ${n}`]:{color:"$violet12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$violet4"},"&:focus":{boxShadow:"0 0 0 2px $colors$violet9"}}},gray:{[`& ${n}`]:{color:"$gray12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$gray4"},"&:focus":{boxShadow:"0 0 0 2px $colors$gray9"}}},primary:{[`& ${n}`]:{color:"$primary12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$primary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$primary9"}}},secondary:{[`& ${n}`]:{color:"$secondary12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$secondary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$secondary9"}}},utilitary:{[`& ${n}`]:{color:"$utilitary12"},[`& ${d}`]:{"&:hover":{backgroundColor:"$utilitary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$utilitary9"}}}},rounded:t.rounded}});exports.CalendarContainer=x;const g=(0,e.styled)("h3",{gridArea:"1 / span 3",textAlign:"center"});exports.HorizontalTitle=g;const p=(0,e.styled)("div",{display:"inline-grid",width:"100%",gridTemplateColumns:"auto 1fr auto",alignItems:"center",variants:{size:{xs:{[`& ${g}`]:{fontSize:"$sm"},[`& ${d}`]:{fontSize:"60%",height:"$6",paddingInlineStart:"$2",paddingInlineEnd:"$2"}},sm:{[`& ${g}`]:{fontSize:"$md"},[`& ${d}`]:{fontSize:"60%",height:"$8",paddingInlineStart:"$3",paddingInlineEnd:"$3"}},md:{[`& ${g}`]:{fontSize:"$lg"},[`& ${d}`]:{fontSize:"60%",height:"$10",paddingInlineStart:"$4",paddingInlineEnd:"$4"}},lg:{[`& ${d}`]:{fontSize:"60%",height:"$12",paddingInlineStart:"$6",paddingInlineEnd:"$6"}},xl:{[`& ${d}`]:{fontSize:"60%",height:"$14",paddingInlineStart:"$8",paddingInlineEnd:"$8"}}},colorScheme:{text:{[`& ${d}`]:{"&:hover":{backgroundColor:"$text4"},"&:focus":{boxShadow:"0 0 0 2px $colors$text9"}}},guru:{[`& ${d}`]:{"&:hover":{backgroundColor:"$guru4"},"&:focus":{boxShadow:"0 0 0 2px $colors$guru9"}}},fellow:{[`& ${d}`]:{"&:hover":{backgroundColor:"$fellow4"},"&:focus":{boxShadow:"0 0 0 2px $colors$fellow9"}}},darkie:{[`& ${d}`]:{"&:hover":{backgroundColor:"$darkie4"},"&:focus":{boxShadow:"0 0 0 2px $colors$darkie9"}}},red:{[`& ${d}`]:{"&:hover":{backgroundColor:"$red4"},"&:focus":{boxShadow:"0 0 0 2px $colors$red9"}}},nature:{[`& ${d}`]:{"&:hover":{backgroundColor:"$nature4"},"&:focus":{boxShadow:"0 0 0 2px $colors$nature9"}}},sunshine:{[`& ${d}`]:{"&:hover":{backgroundColor:"$sunshine4"},"&:focus":{boxShadow:"0 0 0 2px $colors$sunshine9"}}},violet:{[`& ${d}`]:{"&:hover":{backgroundColor:"$violet4"},"&:focus":{boxShadow:"0 0 0 2px $colors$violet9"}}},gray:{[`& ${d}`]:{"&:hover":{backgroundColor:"$gray4"},"&:focus":{boxShadow:"0 0 0 2px $colors$gray9"}}},primary:{[`& ${d}`]:{"&:hover":{backgroundColor:"$primary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$primary9"}}},secondary:{[`& ${d}`]:{"&:hover":{backgroundColor:"$secondary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$secondary9"}}},utilitary:{[`& ${d}`]:{"&:hover":{backgroundColor:"$utilitary4"},"&:focus":{boxShadow:"0 0 0 2px $colors$utilitary9"}}}}}});exports.HorizontalCalendarView=p;const b=(0,e.styled)("div",{display:"flex",flexDirection:"column",rowGap:"$1",alignItems:"center",justifyContent:"center",width:"$full",height:"$full",px:"$6",appearance:"none",border:"none",outline:"none","&:hover":{cursor:"pointer"},variants:{isDisabled:{true:{opacity:.5,"&:hover":{cursor:"not-allowed"}},false:{"&:hover":{cursor:"pointer"}}},isFocusVisible:{true:{boxShadow:"0 0 0 2px"}},colorScheme:{text:{"&:hover":{backgroundColor:"$text3","span:nth-child(1)":{color:"$gray11"}}},guru:{"&:hover":{backgroundColor:"$guru3","span:nth-child(1)":{color:"$gray11"}}},fellow:{"&:hover":{backgroundColor:"$fellow3","span:nth-child(1)":{color:"$gray11"}}},darkie:{"&:hover":{backgroundColor:"$darkie3","span:nth-child(1)":{color:"$gray11"}}},red:{"&:hover":{backgroundColor:"$red3","span:nth-child(1)":{color:"$gray11"}}},nature:{"&:hover":{backgroundColor:"$nature3","span:nth-child(1)":{color:"$gray11"}}},sunshine:{"&:hover":{backgroundColor:"$sunshine3","span:nth-child(1)":{color:"$gray11"}}},violet:{"&:hover":{backgroundColor:"$violet3","span:nth-child(1)":{color:"$gray11"}}},gray:{"&:hover":{backgroundColor:"$gray3","span:nth-child(1)":{color:"$gray11"}}},primary:{"&:hover":{backgroundColor:"$primary3","span:nth-child(1)":{color:"$gray11"}}},secondary:{"&:hover":{backgroundColor:"$secondary3","span:nth-child(1)":{color:"$gray11"}}},utilitary:{"&:hover":{backgroundColor:"$utilitary3","span:nth-child(1)":{color:"$gray11"}}}},rounded:t.rounded}});exports.HorizontalContainer=b;const f=(0,e.styled)("td",{px:"$1"});exports.TdHorizontal=f;const m=(0,e.styled)(r.Text,{color:"$gray9"});exports.DayText=m;const y=(0,e.styled)(r.Text,{variants:{isSelected:{true:{fontWeight:"$bold"},false:{fontWeight:"$semibold"}}}});exports.NumberDayText=y;