@bothub-chat/ui 2.51.3-develop-9f08ea59-23a2-4914-8b0e-6fffbc345508 → 2.51.4-develop-d03412cc-3909-4f68-830f-ca6c73c647a2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/adaptive-button/styled.d.ts +0 -1
- package/dist/components/sidebar/chat/styled.d.ts +0 -2
- package/dist/components/sidebar/group/styled.d.ts +0 -1
- package/dist/components/tooltip/index.d.ts +0 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/styled.d.ts +0 -1
- package/dist/components/tooltip/styled.js +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ export declare const AdaptiveButtonTooltip: import("styled-components").IStyledC
|
|
|
30
30
|
align?: import("@/ui/components/tooltip").TooltipAlign | undefined;
|
|
31
31
|
inverted?: boolean | undefined;
|
|
32
32
|
label?: import("react").ReactNode;
|
|
33
|
-
contentWidth?: number | undefined;
|
|
34
33
|
disabled?: boolean | undefined;
|
|
35
34
|
disableHiddenAnimation?: boolean | undefined;
|
|
36
35
|
markdown?: boolean | undefined;
|
|
@@ -4024,7 +4024,6 @@ export declare const SidebarChatTooltip: import("styled-components").IStyledComp
|
|
|
4024
4024
|
align?: import("@/ui/components/tooltip").TooltipAlign | undefined;
|
|
4025
4025
|
inverted?: boolean | undefined;
|
|
4026
4026
|
label?: import("react").ReactNode;
|
|
4027
|
-
contentWidth?: number | undefined;
|
|
4028
4027
|
disabled?: boolean | undefined;
|
|
4029
4028
|
disableHiddenAnimation?: boolean | undefined;
|
|
4030
4029
|
markdown?: boolean | undefined;
|
|
@@ -4526,7 +4525,6 @@ export declare const SidebarChatNameTooltip: import("styled-components").IStyled
|
|
|
4526
4525
|
align?: import("@/ui/components/tooltip").TooltipAlign | undefined;
|
|
4527
4526
|
inverted?: boolean | undefined;
|
|
4528
4527
|
label?: import("react").ReactNode;
|
|
4529
|
-
contentWidth?: number | undefined;
|
|
4530
4528
|
disabled?: boolean | undefined;
|
|
4531
4529
|
disableHiddenAnimation?: boolean | undefined;
|
|
4532
4530
|
markdown?: boolean | undefined;
|
|
@@ -2946,7 +2946,6 @@ export declare const SidebarGroupTooltip: import("styled-components").IStyledCom
|
|
|
2946
2946
|
align?: import("@/ui/components/tooltip").TooltipAlign | undefined;
|
|
2947
2947
|
inverted?: boolean | undefined;
|
|
2948
2948
|
label?: import("react").ReactNode;
|
|
2949
|
-
contentWidth?: number | undefined;
|
|
2950
2949
|
disabled?: boolean | undefined;
|
|
2951
2950
|
disableHiddenAnimation?: boolean | undefined;
|
|
2952
2951
|
markdown?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as n,useCallback as c,useEffect as o}from"react";import{useTransition as a}from"@react-spring/web";import i from"react-markdown";import{Portal as s}from"../portal/index.js";import{TooltipStyled as l,TooltipBlock as p,TooltipLabel as d,TooltipMarkdown as h,TooltipLabelBold as m,TooltipCode as u}from"./styled.js";export{TooltipColumn,TooltipImage}from"./styled.js";import{TooltipArrow as f}from"./arrow/index.js";import{TooltipProvider as g}from"./context.js";export{TooltipConsumer,TooltipContext,useTooltip}from"./context.js";const b={enter:150,exit:150,leaveDisabledHiddenAnimation:0},w=({className:w,variant:v="primary",placement:x="top",placementX:k=0,placementY:y=-5,align:T="auto",inverted:j=!1,label:$,
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as n,useCallback as c,useEffect as o}from"react";import{useTransition as a}from"@react-spring/web";import i from"react-markdown";import{Portal as s}from"../portal/index.js";import{TooltipStyled as l,TooltipBlock as p,TooltipLabel as d,TooltipMarkdown as h,TooltipLabelBold as m,TooltipCode as u}from"./styled.js";export{TooltipColumn,TooltipImage}from"./styled.js";import{TooltipArrow as f}from"./arrow/index.js";import{TooltipProvider as g}from"./context.js";export{TooltipConsumer,TooltipContext,useTooltip}from"./context.js";const b={enter:150,exit:150,leaveDisabledHiddenAnimation:0},w=({className:w,variant:v="primary",placement:x="top",placementX:k=0,placementY:y=-5,align:T="auto",inverted:j=!1,label:$,disabled:E=!1,disableHiddenAnimation:C=!1,markdown:L=!1,children:M,hideOnScroll:O=!0})=>{const Y=r(null),[A,B]=n(),[H,N]=n([0,0]),R=!$||E,X=c(()=>{const e=Y.current;if(null===e)return[0,0];const t=A;if(!(t instanceof Element))return[0,0];const{width:r,height:n}=e.getBoundingClientRect(),c=t.getBoundingClientRect(),{width:o}=c,a=c.left+window.scrollX,i=c.top+window.scrollY,s=c.bottom+window.scrollY;let l=0;switch(x){case"top-left":switch(T){case"left":case"auto":l=a;break;case"center":l=a-r/2;break;case"right":l=a-r}break;case"top":switch(T){case"left":l=a+o/2;break;case"center":case"auto":l=a+o/2-r/2;break;case"right":l=a+o/2-r}break;case"top-right":switch(T){case"left":l=a+o;break;case"center":l=a+o-r/2;break;case"right":case"auto":l=a+o-r}break;case"center-right":l=a+o-18;break;case"center-left":l=a-r+18}let p=0;switch(x){case"top-left":case"top":case"top-right":p=j?s+6:i-n-6;break;case"center-right":case"center-left":p=(i+s-n+10)/2;break;default:p=s+6}return[l,p]},[x,T,A]),D=c(()=>{A&&N(X())},[A,X]),I=c(()=>{B(null)},[]),P=[`${H[1]}px`];0!==y&&P.push(`calc(var(--bothub-scale, 1) * ${y}px)`);const S=[`${H[0]}px`];switch(x){case"top-left":switch(T){case"center":S.push("14.5px");break;case"right":S.push("29px")}break;case"top":switch(T){case"left":S.push("-14.5px");break;case"right":S.push("14.5px")}break;case"top-right":switch(T){case"left":S.push("-29px");break;case"center":S.push("-14.5px")}}0!==k&&S.push(`calc(var(--bothub-scale, 1) * ${k}px)`);const q=a(!!A,{from:{opacity:0,y:-6},enter:{opacity:1,y:0},leave:{opacity:0,y:-6,transition:{duration:C?0:.3}},config:{duration:b.enter}})((r,n)=>n&&e(l,{$placement:x,$align:T,$inverted:j,ref:Y,className:w,style:Object.assign(Object.assign({},r),{top:P.length<=1?P[0]:`calc(${P.join(" + ")})`,left:S.length<=1?S[0]:`calc(${S.join(" + ")})`}),children:[j&&t(f,{placement:x,variant:v,inverted:j}),e(p,{$variant:v,children:["string"==typeof $&&!L&&e(d,{children:[$.slice(0,272),$.length>272&&"..."]}),"string"==typeof $&&L&&t(h,{children:t(i,{components:{p:({children:e})=>t(d,{component:"p",children:e}),b:({children:e})=>t(m,{children:e}),strong:({children:e})=>t(m,{component:"strong",children:e}),code:({children:e})=>t(u,{children:e})},children:$})}),"string"!=typeof $&&$]}),!j&&t(f,{placement:x,variant:v,inverted:j})]}));o(()=>{D()},[A,D]);const z=c(e=>{!R&&e.currentTarget instanceof Element&&(B(e.currentTarget),D())},[R,D]);return o(()=>{const e=()=>{I()},t=()=>{I()};return window.addEventListener("mouseleave",e),window.addEventListener("scroll",t,O),()=>{window.removeEventListener("mouseleave",e),window.removeEventListener("scroll",t,O)}},[I]),e(g,{handleTooltipMouseEnter:e=>{!R&&e.currentTarget instanceof Element&&B(e.currentTarget)},handleTooltipMouseLeave:()=>{B(null)},handleTooltipPointerMove:z,children:[t(s,{children:q}),M]})};export{w as Tooltip,b as TooltipAnimationDuration,p as TooltipBlock,u as TooltipCode,d as TooltipLabel,m as TooltipLabelBold,h as TooltipMarkdown,g as TooltipProvider,l as TooltipStyled};
|
|
@@ -1142,7 +1142,6 @@ export declare const TooltipStyled: import("styled-components").IStyledComponent
|
|
|
1142
1142
|
}, TooltipStyledProps>>;
|
|
1143
1143
|
export interface TooltipBlockProps {
|
|
1144
1144
|
$variant: TooltipVariant;
|
|
1145
|
-
$contentWidth?: number;
|
|
1146
1145
|
}
|
|
1147
1146
|
export declare const TooltipBlock: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, TooltipBlockProps>>;
|
|
1148
1147
|
export declare const TooltipLabel: import("styled-components").IStyledComponent<"web", {
|
|
@@ -28,4 +28,4 @@ import{styled as e,css as t}from"styled-components";import{animated as i}from"@r
|
|
|
28
28
|
align-items: center;
|
|
29
29
|
`;case"top-right":return t`
|
|
30
30
|
align-items: flex-end;
|
|
31
|
-
`}}),a=e.span.withConfig({displayName:"styled__TooltipBlock",componentId:"sc-1kd2o9y-1"})(["display:inline-flex;padding:8px;background:",";overflow:hidden;border-radius:6px;box-sizing:border-box;
|
|
31
|
+
`}}),a=e.span.withConfig({displayName:"styled__TooltipBlock",componentId:"sc-1kd2o9y-1"})(["display:inline-flex;width:max-content;max-width:260px;padding:8px;background:",";overflow:hidden;border-radius:6px;box-sizing:border-box;"],({theme:e,$variant:t})=>{switch(t){case"primary":return e.colors.grayScale.gray2;case"secondary":return e.colors.grayScale.gray3}}),l=e(o).attrs({variant:"body-s-medium"}).withConfig({displayName:"styled__TooltipLabel",componentId:"sc-1kd2o9y-2"})(["white-space:pre-wrap;"]),s=e.div.withConfig({displayName:"styled__TooltipMarkdown",componentId:"sc-1kd2o9y-3"})(["display:flex;flex-direction:column;align-items:flex-start;"]),d=e(o).attrs({variant:"body-s-semibold"}).withConfig({displayName:"styled__TooltipLabelBold",componentId:"sc-1kd2o9y-4"})([""]),c=e(o).attrs({component:"code",variant:"body-s-medium"}).withConfig({displayName:"styled__TooltipCode",componentId:"sc-1kd2o9y-5"})(["display:inline-flex;border-radius:4px;background:",";"],({theme:e})=>e.colors.grayScale.gray3),p=e.div.withConfig({displayName:"styled__TooltipColumn",componentId:"sc-1kd2o9y-6"})(["display:inline-flex;flex-direction:column;align-items:center;gap:8px;"]),m=e(n).withConfig({displayName:"styled__TooltipImage",componentId:"sc-1kd2o9y-7"})(["border-radius:4px;"]);export{a as TooltipBlock,c as TooltipCode,p as TooltipColumn,m as TooltipImage,l as TooltipLabel,d as TooltipLabelBold,s as TooltipMarkdown,r as TooltipStyled};
|