UNPKG

@bothub-chat/ui

Version:

Bothub UI Components

33 lines (32 loc) 4.92 kB
import{styled as o,css as r,keyframes as i}from"styled-components";import{Typography as e}from"../../typography/index.js";import{Tooltip as t}from"../../tooltip/index.js";import{Skeleton as a}from"../../skeleton/index.js";import{ArrowDownIcon as d}from"../../../icons/arrow-down/index.js";import{DragDotIcon as n}from"../../../icons/drag-dot/index.js";import{FolderIcon as s}from"../../../icons/folder/index.js";import{Checkbox as p}from"../../checkbox/index.js";import{adaptive as l}from"../../../adaptive/index.js";import"tslib";import"react/jsx-runtime";import"react";import"@react-spring/web";import{SidebarDropdownStyled as m}from"../dropdown/styled.js";import"../../icon/styled.js";import"react-dom";import"../../portal/styled.js";import"../../../theme/index.js";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import{colorToRgba as c}from"../../../utils/colors/colorToRgba.js";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";import"../dropdown/item/styled.js";const y=o.div.withConfig({displayName:"styled__SidebarGroupsStyled",componentId:"sc-1b5rk7r-0"})(["display:flex;position:relative;flex-direction:column;width:100%;"]),f=o.div.withConfig({displayName:"styled__SidebarGroupStyled",componentId:"sc-1b5rk7r-1"})(["display:flex;flex-direction:column;align-items:flex-start;width:100%;",""],(({$over:o,theme:i})=>{if(o)return r` background: ${c(i.colors.accent.primaryLight,.4)}; border-radius: 10px; `})),b=o(d).withConfig({displayName:"styled__SidebarGroupArrowDown",componentId:"sc-1b5rk7r-2"})(["transition:transform 0.2s ease;"]),h=i` from { opacity: 0; left: 0; } to { opacity: 1; left: -3px; } `,g=o.div.withConfig({displayName:"styled__SidebarGroupNameWithOutline",componentId:"sc-1b5rk7r-3"})(["width:100%;position:relative;&:before{content:'';width:100%;height:100%;position:absolute;top:0;left:0;border-radius:10px;z-index:0;}&:hover{&:before{background-color:",";}}",""],(({theme:o})=>o.colors.accent.primary),(({$active:o,theme:i})=>o&&r` width: calc(100% - 3px); margin-left: 3px; &:before { background-color: ${i.colors.accent.primary}; animation: ${h} 0.3s ease-out 1 forwards; } `)),x=o.div.withConfig({displayName:"styled__SidebarGroupNameWithBg",componentId:"sc-1b5rk7r-4"})(["width:100%;border-radius:10px;background-color:",";position:relative;"],(({theme:o})=>o.colors.grayScale.gray4)),u=o(e).attrs({variant:"body-l-medium",component:"div"}).withConfig({displayName:"styled__SidebarGroupName",componentId:"sc-1b5rk7r-5"})(["display:flex;cursor:",";padding:8px;align-items:center;position:relative;width:100%;&:hover{background-color:",";border-radius:10px;transition:background-color 0.3s ease-out;}& > ","{display:flex;width:24px;margin-left:16px;}& > ","{transform:",";}"],(({$skeleton:o})=>o?"not-allowed":"pointer"),(({theme:o})=>c(o.colors.accent.primaryLight,.5)),m,b,(({$open:o})=>o?"rotate(180deg)":"rotate(0deg)")),w=o.div.withConfig({displayName:"styled__SidebarGroupNameBox",componentId:"sc-1b5rk7r-6"})(["width:100%;white-space:nowrap;display:block;margin-right:8px;overflow:hidden;text-overflow:ellipsis;"]),k=o.div.withConfig({displayName:"styled__SidebarChatList",componentId:"sc-1b5rk7r-7"})(["display:flex;flex-direction:column;width:100%;min-height:40px;"," transition:opacity 0.3s;"],(({$open:o})=>o?r` margin-top: 3px; `:r` display: none; `)),_=o(p).withConfig({displayName:"styled__SidebarGroupCheckbox",componentId:"sc-1b5rk7r-8"})(["margin-left:16px !important;"]),v=o(n).withConfig({displayName:"styled__SidebarGroupDragHandle",componentId:"sc-1b5rk7r-9"})(["margin-right:8px;"]),S=o(s).withConfig({displayName:"styled__SidebarGroupDragFolder",componentId:"sc-1b5rk7r-10"})(["margin-right:10px;"]),C=o(t).withConfig({displayName:"styled__SidebarGroupTooltip",componentId:"sc-1b5rk7r-11"})(["overflow:hidden;",""],l({variant:"dashboard",desktop:r` display: flex; `,tablet:r` display: none; `})),N=o.div.withConfig({displayName:"styled__SidebarGroupIconContainer",componentId:"sc-1b5rk7r-12"})(["",""],l({variant:"dashboard",desktop:r` display: none; `,tablet:r` display: flex; `})),j=o(a).withConfig({displayName:"styled__SidebarGroupSkeleton",componentId:"sc-1b5rk7r-13"})(["margin-left:10px;"]),I=o(a).withConfig({displayName:"styled__SidebarGroupSkeletonIcon",componentId:"sc-1b5rk7r-14"})([""]);export{k as SidebarChatList,b as SidebarGroupArrowDown,_ as SidebarGroupCheckbox,S as SidebarGroupDragFolder,v as SidebarGroupDragHandle,N as SidebarGroupIconContainer,u as SidebarGroupName,w as SidebarGroupNameBox,x as SidebarGroupNameWithBg,g as SidebarGroupNameWithOutline,j as SidebarGroupSkeleton,I as SidebarGroupSkeletonIcon,f as SidebarGroupStyled,C as SidebarGroupTooltip,y as SidebarGroupsStyled};