UNPKG

@guruhotel/aura-ui

Version:

⚛️ React UI library by GuruHotel

1 lines 6.94 kB
exports.__esModule=!0,exports.StyledViewport=exports.StyledTrigger=exports.StyledSeparator=exports.StyledSelectValue=exports.StyledSelectIcon=exports.StyledScrollUpButton=exports.StyledScrollDownButton=exports.StyledLabel=exports.StyledItemIndicator=exports.StyledItem=exports.StyledContent=void 0;var o=require("../theme"),e=function(o,e){if(!e&&o&&o.__esModule)return o;if(null===o||"object"!=typeof o&&"function"!=typeof o)return{default:o};var r=l(e);if(r&&r.has(o))return r.get(o);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in o)if("default"!==d&&Object.prototype.hasOwnProperty.call(o,d)){var n=a?Object.getOwnPropertyDescriptor(o,d):null;n&&(n.get||n.set)?Object.defineProperty(t,d,n):t[d]=o[d]}t.default=o,r&&r.set(o,t);return t}(require("@radix-ui/react-select")),r=require("./select.constants"),t=require("../common-variants");function l(o){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(l=function(o){return o?r:e})(o)}const a=(0,o.styled)(e.Viewport,{padding:"$2"});exports.StyledViewport=a;const d=(0,o.styled)(e.Item,{all:"unset",lineHeight:1,display:"flex",alignItems:"center",position:"relative",userSelect:"none",fontSize:"$sm",height:25,padding:"0 35px 0 25px","&[data-disabled]":{color:"$gray8",pointerEvents:"none"},_hover:{cursor:"pointer"}});exports.StyledItem=d;const n=(0,o.styled)(e.Label,{padding:"0 25px",lineHeight:"2rem",color:"$gray11",userSelect:"none"});exports.StyledLabel=n;const i=(0,o.styled)(e.Separator,{height:1,margin:5});exports.StyledSeparator=i;const c=(0,o.styled)(e.ItemIndicator,{position:"absolute",left:0,width:25,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"70%"});exports.StyledItemIndicator=c;const $=(0,o.styled)(e.ScrollUpButton,r.scrollButtonStyles);exports.StyledScrollUpButton=$;const s=(0,o.styled)(e.ScrollDownButton,r.scrollButtonStyles);exports.StyledScrollDownButton=s;const u=(0,o.styled)(e.SelectIcon,{svg:{fontSize:"70%"}});exports.StyledSelectIcon=u;const h=(0,o.styled)(e.SelectTrigger,{all:"unset",display:"inline-flex",alignItems:"center",justifyContent:"space-between",padding:"0 15px",gap:"$2",lineHeight:1,backgroundColor:"$surfaceLight",boxShadow:"0 0 0 1px $colors$gray7",_hover:{backgroundColor:"$gray3",cursor:"pointer"},variants:{rounded:t.rounded,size:t.size,colorScheme:{text:{color:"$text11",_focusWithin:{boxShadow:"0 0 0 2px $colors$text9"},"&[data-placeholder]":{color:"$text9"}},guru:{color:"$guru11",_focusWithin:{boxShadow:"0 0 0 2px $colors$guru9"},"&[data-placeholder]":{color:"$guru9"}},fellow:{color:"$fellow11",_focusWithin:{boxShadow:"0 0 0 2px $colors$fellow9"},"&[data-placeholder]":{color:"$fellow9"}},darkie:{color:"$darkie11",_focusWithin:{boxShadow:"0 0 0 2px $colors$darkie9"},"&[data-placeholder]":{color:"$darkie9"}},red:{color:"$red11",_focusWithin:{boxShadow:"0 0 0 2px $colors$red9"},"&[data-placeholder]":{color:"$red9"}},nature:{color:"$nature11",_focusWithin:{boxShadow:"0 0 0 2px $colors$nature9"},"&[data-placeholder]":{color:"$nature9"}},sunshine:{color:"$sunshine11",_focusWithin:{boxShadow:"0 0 0 2px $colors$sunshine9"},"&[data-placeholder]":{color:"$sunshine9"}},violet:{color:"$violet11",_focusWithin:{boxShadow:"0 0 0 2px $colors$violet9"},"&[data-placeholder]":{color:"$violet9"}},gray:{color:"$gray11",_focusWithin:{boxShadow:"0 0 0 2px $colors$gray9"},"&[data-placeholder]":{color:"$gray9"}},primary:{color:"$primary11",_focusWithin:{boxShadow:"0 0 0 2px $colors$primary9"},"&[data-placeholder]":{color:"$primary9"}},secondary:{color:"$secondary11",_focusWithin:{boxShadow:"0 0 0 2px $colors$secondary9"},"&[data-placeholder]":{color:"$secondary9"}},utilitary:{color:"$utilitary11",_focusWithin:{boxShadow:"0 0 0 2px $colors$utilitary9"},"&[data-placeholder]":{color:"$utilitary9"}}}},defaultVariants:{colorScheme:"guru",rounded:"lg"}});exports.StyledTrigger=h;const g=(0,o.styled)(e.Content,{overflow:"hidden",backgroundColor:"white",borderRadius:"$sm",boxShadow:"$md",zIndex:"$sticky",maxHeight:"var(--radix-select-content-available-height)",variants:{rounded:{none:{rounded:"$none"},xs:{rounded:"$xs",[`& ${d}`]:{rounded:"$xs"}},sm:{rounded:"$sm",[`& ${d}`]:{rounded:"$xs"}},md:{rounded:"$md",[`& ${d}`]:{rounded:"$sm"}},lg:{rounded:"$lg",[`& ${d}`]:{rounded:"$md"}},xl:{rounded:"$xl",[`& ${d}`]:{rounded:"$lg"}},"2xl":{rounded:"$2xl",[`& ${d}`]:{rounded:"$xl"}},"3xl":{rounded:"$3xl",[`& ${d}`]:{rounded:"$2xl"}},full:{rounded:"$full",[`& ${d}`]:{rounded:"$full"}},base:{rounded:"$base",[`& ${d}`]:{rounded:"$halfBase"}},halfBase:{rounded:"$halfBase",[`& ${d}`]:{rounded:Math.abs(parseInt(o.theme.radii.halfBase.value.replace(/\D/g,""),10)/2)}}},colorScheme:{text:{[`& ${d}`]:{color:"$text11","&[data-highlighted]":{backgroundColor:"$text9",color:"$text1"}},[`& ${i}`]:{backgroundColor:"$text4"}},darkie:{[`& ${d}`]:{color:"$darkie11","&[data-highlighted]":{backgroundColor:"$darkie9",color:"$darkie1"}},[`& ${i}`]:{backgroundColor:"$darkie4"}},fellow:{[`& ${d}`]:{color:"$fellow11","&[data-highlighted]":{backgroundColor:"$fellow9",color:"$fellow1"}},[`& ${i}`]:{backgroundColor:"$fellow4"}},guru:{[`& ${d}`]:{color:"$guru11","&[data-highlighted]":{backgroundColor:"$guru9",color:"$guru1"}},[`& ${i}`]:{backgroundColor:"$guru4"}},red:{[`& ${d}`]:{color:"$red11","&[data-highlighted]":{backgroundColor:"$red9",color:"$red1"}},[`& ${i}`]:{backgroundColor:"$red4"}},nature:{[`& ${d}`]:{color:"$nature11","&[data-highlighted]":{backgroundColor:"$nature9",color:"$nature1"}},[`& ${i}`]:{backgroundColor:"$nature4"}},sunshine:{[`& ${d}`]:{color:"$sunshine11","&[data-highlighted]":{backgroundColor:"$sunshine9",color:"$sunshine1"}},[`& ${i}`]:{backgroundColor:"$sunshine4"}},violet:{[`& ${d}`]:{color:"$violet11","&[data-highlighted]":{backgroundColor:"$violet9",color:"$violet1"}},[`& ${i}`]:{backgroundColor:"$violet4"}},gray:{[`& ${d}`]:{color:"$gray11","&[data-highlighted]":{backgroundColor:"$gray9",color:"$gray1"}},[`& ${i}`]:{backgroundColor:"$gray4"}},primary:{[`& ${d}`]:{color:"$primary11","&[data-highlighted]":{backgroundColor:"$primary9",color:"$primary1"}},[`& ${i}`]:{backgroundColor:"$primary4"}},secondary:{[`& ${d}`]:{color:"$secondary11","&[data-highlighted]":{backgroundColor:"$secondary9",color:"$secondary1"}},[`& ${i}`]:{backgroundColor:"$secondary4"}},utilitary:{[`& ${d}`]:{color:"$utilitary11","&[data-highlighted]":{backgroundColor:"$utilitary9",color:"$utilitary1"}},[`& ${i}`]:{backgroundColor:"$utilitary4"}}},size:{xs:{[`& ${d}`]:{fontSize:"$xs"},[`& ${n}`]:{fontSize:"$xs"}},sm:{[`& ${d}`]:{fontSize:"$sm"},[`& ${n}`]:{fontSize:"$sm"}},md:{[`& ${d}`]:{fontSize:"$sm",height:30},[`& ${n}`]:{fontSize:"$sm"}},lg:{[`& ${d}`]:{fontSize:"$md",height:32},[`& ${n}`]:{fontSize:"$md"}},xl:{[`& ${d}`]:{fontSize:"$lg",height:35},[`& ${n}`]:{fontSize:"$lg"}}}},defaultVariants:{colorScheme:"guru",rounded:"lg",size:"md"}});exports.StyledContent=g;const p=(0,o.styled)(e.Value);exports.StyledSelectValue=p;