UNPKG

@bothub-chat/ui

Version:

Bothub UI Components

96 lines (94 loc) • 8.57 kB
import{jsx as e}from"react/jsx-runtime";import{styled as a,css as o}from"styled-components";import{Typography as t}from"../../typography/index.js";import{Button as r}from"../../button/index.js";import{adaptive as i}from"../../../adaptive/index.js";import{LogoutIcon as d}from"../../../icons/logout/index.js";import"react";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import{colorToRgba as s}from"../../../utils/colors/colorToRgba.js";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";const n=a.div.withConfig({displayName:"styled__SidebarUserInfoBottom",componentId:"sc-1ewmvku-0"})(["display:flex;align-items:center;overflow:hidden;"]),l=a.div.withConfig({displayName:"styled__SidebarUserInfoStyled",componentId:"sc-1ewmvku-1"})(["display:flex;overflow:hidden;background:",";width:100%;transition:padding 0.3s;"," "," "," transition:border-width 0.3s ease-out,border-color 0.3s ease-out,border-radius 0.3s ease-out,background-color 0.3s ease-out;"],(({theme:e})=>e.colors.grayScale.gray4),(({$open:e})=>e&&i({variant:"dashboard",desktop:o` padding: 20px; `,tablet:o` padding: 0px; `,mobile:o` padding: 0px; `})),(({$open:e})=>!e&&i({variant:"dashboard",merge:!0,desktop:o` padding: 0px; `,tablet:o` padding: 18px; `,mobile:o` padding: 14px; `})),(({theme:e,$open:a})=>i(a?{variant:"dashboard",desktop:o` border: 1px solid ${"light"===e.mode?e.colors.grayScale.gray3:e.colors.grayScale.gray2}; border-radius: 18px; background: ${"light"===e.mode&&"standard"===e.scheme?e.default.colors.base.white:e.colors.grayScale.gray4}; `,tablet:o` border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0); `,mobile:o` border-radius: 0px; border: 0px solid rgba(0, 0, 0, 0); `}:{variant:"dashboard",merge:!0,desktop:o` border: 0px solid rgba(0, 0, 0, 0); border-radius: 0px; background: rgba(0, 0, 0, 0); `,tablet:o` border-radius: 10px; background: ${"light"===e.mode&&"standard"===e.scheme?e.default.colors.base.white:e.colors.grayScale.gray4}; border: 1px solid ${"light"===e.mode?e.colors.grayScale.gray2:e.colors.grayScale.gray3}; `,mobile:o` border-radius: 8px; border: 1px solid ${"light"===e.mode?e.colors.grayScale.gray2:e.colors.grayScale.gray3}; `}))),p=a.div.withConfig({displayName:"styled__SidebarUserInfoContent",componentId:"sc-1ewmvku-2"})(["display:flex;flex-direction:column;width:100%;"]),c=a.div.withConfig({displayName:"styled__SidebarUserInfoMain",componentId:"sc-1ewmvku-3"})(["display:flex;justify-content:space-between;align-items:center;"]),m=a.div.withConfig({displayName:"styled__SidebarUserInfoLeft",componentId:"sc-1ewmvku-4"})(["display:flex;align-items:center;"]),g=a.div.withConfig({displayName:"styled__SidebarUserInfoTariffContainer",componentId:"sc-1ewmvku-5"})([""," ",""],(({$open:e})=>!e&&i({variant:"dashboard",desktop:o` display: none; `,tablet:o` display: flex; `,mobile:o` display: flex; `})),(({$open:e})=>e&&i({variant:"dashboard",desktop:o` display: flex; `,tablet:o` display: none; `,mobile:o` display: none; `}))),b=a.div.withConfig({displayName:"styled__SidebarUserInfoUpdateTariffContainer",componentId:"sc-1ewmvku-6"})(["display:flex;transition:all 0.3s;width:100%;height:40px;white-space:nowrap;overflow:hidden;",""],(({$open:e})=>i(e?{variant:"dashboard",desktop:o` opacity: 1; height: auto; margin-top: 14px; `,tablet:o` opacity: 0; height: 0px; margin-top: 0px; `,mobile:o` opacity: 0; height: 0px; margin-top: 0px; `}:{variant:"dashboard",desktop:o` opacity: 0; height: 0px; margin-top: 0px; `,tablet:o` opacity: 1; height: auto; margin-top: 12px; `,mobile:o` opacity: 1; height: auto; margin-top: 10px; `}))),f=a.div.withConfig({displayName:"styled__SidebarUserInfoText",componentId:"sc-1ewmvku-7"})(["display:flex;flex-direction:column;margin-left:12px;"]),y=a(t).attrs({variant:"body-m-semibold",component:"span"}).withConfig({displayName:"styled__SidebarUserInfoName",componentId:"sc-1ewmvku-8"})(["white-space:nowrap;"]),u=a(t).attrs({variant:"body-s-medium",component:"span"}).withConfig({displayName:"styled__SidebarUserInfoCaps",componentId:"sc-1ewmvku-9"})(["color:",";white-space:nowrap;"],(({theme:e})=>e.colors.grayScale.gray1)),h=a(t).attrs({variant:"body-m-medium",component:"span"}).withConfig({displayName:"styled__SidebarUserInfoTariff",componentId:"sc-1ewmvku-10"})(["display:inline-flex;color:",";background:",";padding:4px 8px;border-radius:10px;margin-top:14px;justify-content:center;width:100%;cursor:default;"],(({theme:e})=>e.default.colors.base.white),(({theme:e})=>"light"===e.mode?e.colors.grayScale.gray2:e.colors.grayScale.gray1)),x=a.button.withConfig({displayName:"styled__SidebarUserInfoUpdateTariffButton",componentId:"sc-1ewmvku-11"})(["all:unset;margin-top:4px;width:100%;display:flex;justify-content:start;flex-shrink:1;align-items:center;border-radius:8px;padding:6px 18px 6px 6px;box-shadow:inset 0 1px 1px 0 #ffffff60;background:",";font-weight:500;&:hover{filter:brightness(0.8);cursor:pointer;}&:active{filter:brightness(0.7);transform:translateY(1px);}transition:all 0.2s ease-out;user-select:none;-moz-user-select:none;-webkit-user-select:none;"],(({theme:e})=>"standard"===e.scheme?"dark"===e.mode?o` ${e.colors.gradient.basic} `:o` ${e.colors.gradient.light} `:"dark"===e.mode?o` linear-gradient(90deg, ${e.colors.base.black} 0%, ${s(e.colors.accent.primary,.75)} 100%); `:o` linear-gradient(90deg, ${e.colors.accent.primary} 0%, ${s(e.colors.accent.primary,.3)} 100%); `)),w=a(t).attrs({variant:"body-m-medium"}).withConfig({displayName:"styled__SidebarUserInfoUpdateTariffButtonText",componentId:"sc-1ewmvku-12"})(["color:",";margin-inline:auto;"],(({theme:e})=>{switch(e.mode){case"dark":return e.colors.base.white;case"light":return e.bright?e.default.colors.base.black:e.default.colors.base.white}})),v=a.div.withConfig({displayName:"styled__SidebarUserInfoUpdateTariffBadge",componentId:"sc-1ewmvku-13"})(["padding:2px 8px;display:flex;justify-content:center;align-items:center;border-radius:8px;background-color:",";"],(({theme:e})=>e.default.colors.base.white)),k=a(t).attrs({variant:"body-m-semibold"}).withConfig({displayName:"styled__SidebarUserInfoUpdateTariffBadgeText",componentId:"sc-1ewmvku-14"})(["color:transparent;background:",";background-clip:text;"],(({children:e,theme:a})=>{switch(null==e?void 0:e.toUpperCase()){case"FREE":return a.default.colors.grayScale.gray1;case"BASIC":return a.default.colors.accent.primary;default:return a.default.colors.premiumGradient}})),I=a.div.withConfig({displayName:"styled__SidebarUserInfoLogoutButtonContainer",componentId:"sc-1ewmvku-15"})(["",""],(({$open:e})=>i(e?{variant:"dashboard",desktop:o` display: flex; `,tablet:o` display: none; `,mobile:o` display: none; `}:{variant:"dashboard",desktop:o` display: none; `,tablet:o` display: flex; `,mobile:o` display: flex; `}))),S=a(r).attrs((()=>({variant:"text",iconSize:18,children:e(d,{})}))).withConfig({displayName:"styled__SidebarUserInfoLogoutButton",componentId:"sc-1ewmvku-16"})(["svg path{fill:"," !important;}&:hover{svg path{fill:"," !important;}}"],(({theme:e})=>e.colors.critic),(({theme:e})=>e.colors.critic));export{n as SidebarUserInfoBottom,u as SidebarUserInfoCaps,p as SidebarUserInfoContent,m as SidebarUserInfoLeft,S as SidebarUserInfoLogoutButton,I as SidebarUserInfoLogoutButtonContainer,c as SidebarUserInfoMain,y as SidebarUserInfoName,l as SidebarUserInfoStyled,h as SidebarUserInfoTariff,g as SidebarUserInfoTariffContainer,f as SidebarUserInfoText,v as SidebarUserInfoUpdateTariffBadge,k as SidebarUserInfoUpdateTariffBadgeText,x as SidebarUserInfoUpdateTariffButton,w as SidebarUserInfoUpdateTariffButtonText,b as SidebarUserInfoUpdateTariffContainer};