@@ -14,6 +14,7 @@ import {
1414export const tooltipBackgroundColor = `background-contrast` ;
1515export const tooltipArrowHeight = `1rem` ;
1616const containerOffsetVertical = 12 ;
17+ const borderColor = 'border-primary' ;
1718
1819export const narrowWidth = 64 ;
1920export const centerWidths = { minWidth : 64 , maxWidth : 128 } as const ;
@@ -31,16 +32,26 @@ export const topStyles = {
3132 pb : containerOffsetVertical ,
3233} as const ;
3334
34- const beforeStyles = {
35+ const beforeStylesVert = {
3536 content : '""' ,
3637 position : 'absolute' ,
3738 width : '100%' ,
3839} ;
3940
40- export const topStylesBefore = { ...beforeStyles , height : 16 , bottom : '-4px' } ;
41+ const beforeStylesHorizontal = {
42+ content : '""' ,
43+ position : 'absolute' ,
44+ height : '100%' ,
45+ } ;
46+
47+ export const topStylesBefore = {
48+ ...beforeStylesVert ,
49+ height : 16 ,
50+ bottom : '-4px' ,
51+ } ;
4152
4253export const topStylesAfter = {
43- borderColor : 'border-primary' ,
54+ borderColor,
4455 borderWidth : '0 1px 1px 0' ,
4556 bottom : '0.25rem' ,
4657} as const ;
@@ -51,13 +62,31 @@ export const bottomStyles = {
5162} as const ;
5263
5364export const bottomStylesBefore = {
54- ...beforeStyles ,
65+ ...beforeStylesVert ,
5566 height : 24 ,
5667 top : '-8px' ,
5768} ;
5869
5970export const bottomStylesAfter = {
60- borderColor : 'border-primary' ,
71+ borderColor,
72+ borderWidth : '1px 0 0 1px' ,
73+ top : '0.25rem' ,
74+ } as const ;
75+
76+ export const rightAlignStyles = {
77+ top : 'calc(100% + 4px)' ,
78+ pt : containerOffsetVertical ,
79+ } as const ;
80+
81+ export const rightAlignStylesBefore = {
82+ ...beforeStylesHorizontal ,
83+ height : 24 ,
84+ left : '-8px' ,
85+ bg : 'red' ,
86+ } ;
87+
88+ export const rightAlignStylesAfter = {
89+ borderColor,
6190 borderWidth : '1px 0 0 1px' ,
6291 top : '0.25rem' ,
6392} as const ;
@@ -84,6 +113,10 @@ export const verticalCenterStylesAfter = {
84113 left : 'calc(50% - 0.5rem)' ,
85114} as const ;
86115
116+ export const horizontalCenterStylesAfter = {
117+ left : 'calc(50% - 0.5rem)' ,
118+ } as const ;
119+
87120// This halfway fills the square we use to create the 'beak' of the tip so it does not overlap the tip text on the 'center' alignments
88121export const topCenterStylesAfter = {
89122 backgroundImage : `linear-gradient(to top left, ${ theme . colors [ tooltipBackgroundColor ] } 55%, rgba(0,0,0,0) 20%)` ,
0 commit comments