@delightui/components 0.1.165 → 0.1.167
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/cjs/components/atoms/Tooltip/Tooltip.constants.d.ts +5 -10
- package/dist/cjs/components/atoms/Tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/components/atoms/Tooltip/Tooltip.examples.d.ts +2 -0
- package/dist/cjs/components/atoms/Tooltip/Tooltip.presenter.d.ts +6 -7
- package/dist/cjs/library.css +59 -21
- package/dist/cjs/library.js +3 -3
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/atoms/Tooltip/Tooltip.constants.d.ts +5 -10
- package/dist/esm/components/atoms/Tooltip/Tooltip.d.ts +1 -1
- package/dist/esm/components/atoms/Tooltip/Tooltip.examples.d.ts +2 -0
- package/dist/esm/components/atoms/Tooltip/Tooltip.presenter.d.ts +6 -7
- package/dist/esm/library.css +59 -21
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly OFFSET: 12;
|
|
6
|
-
};
|
|
7
|
-
export declare const ARROW_DIMENSIONS_MAP: Record<TooltipDirectionEnum, {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
}>;
|
|
1
|
+
import type { Placement } from 'react-overlays/usePopper';
|
|
2
|
+
import type { TooltipAlignEnum, TooltipDirectionEnum } from './Tooltip.types';
|
|
3
|
+
export declare const PLACEMENT_TO_DIRECTION: Record<string, string>;
|
|
4
|
+
export declare const PLACEMENT_TO_ALIGNMENT: Record<string, string>;
|
|
11
5
|
export declare const TOOLTIP_VARIANT_MAP: {
|
|
12
6
|
readonly 'Top-Center': "center-top";
|
|
13
7
|
readonly 'Top-Start': "start-top";
|
|
@@ -22,3 +16,4 @@ export declare const TOOLTIP_VARIANT_MAP: {
|
|
|
22
16
|
readonly 'Right-Start': "start-right";
|
|
23
17
|
readonly 'Right-End': "end-right";
|
|
24
18
|
};
|
|
19
|
+
export declare const getPlacement: (direction?: TooltipDirectionEnum, alignment?: TooltipAlignEnum) => Placement;
|
|
@@ -2,23 +2,22 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
import { TooltipProps } from './Tooltip.types';
|
|
3
3
|
declare const usePresenter: (props: TooltipProps) => {
|
|
4
4
|
direction: import("./Tooltip.types").TooltipDirectionEnum;
|
|
5
|
+
alignment: import("./Tooltip.types").TooltipAlignEnum;
|
|
5
6
|
action: import("./Tooltip.types").TooltipActionType;
|
|
6
7
|
target: import("react").ReactNode;
|
|
7
|
-
position: {
|
|
8
|
-
top: number;
|
|
9
|
-
left: number;
|
|
10
|
-
};
|
|
11
8
|
showTooltip: () => void;
|
|
12
9
|
hideTooltip: () => void;
|
|
13
10
|
toggleTooltip: () => void;
|
|
14
11
|
targetRef: import("react").RefObject<HTMLDivElement>;
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
cursorRef: import("react").RefObject<HTMLDivElement>;
|
|
13
|
+
updateRef: import("react").MutableRefObject<(() => void) | null>;
|
|
14
|
+
handleMouseMove: (e: React.MouseEvent) => void;
|
|
17
15
|
variantProps: {
|
|
18
16
|
'component-variant': string;
|
|
19
17
|
};
|
|
20
|
-
arrowStyle: CSSProperties;
|
|
21
18
|
style: import("./Tooltip.types").TooltipStyleEnum;
|
|
22
19
|
visible: boolean;
|
|
20
|
+
placement: import("@popperjs/core").Placement;
|
|
21
|
+
arrowOffsetStyle: CSSProperties | undefined;
|
|
23
22
|
};
|
|
24
23
|
export default usePresenter;
|
package/dist/cjs/library.css
CHANGED
|
@@ -736,7 +736,7 @@
|
|
|
736
736
|
padding-bottom: var(--tooltip-target-padding-bottom);
|
|
737
737
|
padding-left: var(--tooltip-target-padding-left);
|
|
738
738
|
}
|
|
739
|
-
.Tooltip-
|
|
739
|
+
.Tooltip-module_tooltipContent__iio4V {
|
|
740
740
|
position: absolute;
|
|
741
741
|
display: flex;
|
|
742
742
|
flex-direction: column;
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
border-radius: var(--tooltip-content-border-radius, 4px);
|
|
773
773
|
box-shadow: var(--tooltip-content-box-shadow-x) var(--tooltip-content-box-shadow-blur) var(--tooltip-content-box-shadow-y) var(--tooltip-content-box-shadow-spread) var(--tooltip-content-box-shadow-color);
|
|
774
774
|
}
|
|
775
|
-
.Tooltip-
|
|
775
|
+
.Tooltip-module_tooltipContent__iio4V .Tooltip-module_text__Or6qX {
|
|
776
776
|
--text-font-family: var(--tooltip-content-font-family);
|
|
777
777
|
--text-font-weight: var(--tooltip-content-font-weight);
|
|
778
778
|
--text-font-size: var(--tooltip-content-font-size);
|
|
@@ -784,62 +784,100 @@
|
|
|
784
784
|
line-height: var(--tooltip-content-line-height);
|
|
785
785
|
letter-spacing: var(--tooltip-content-letter-spacing);
|
|
786
786
|
}
|
|
787
|
-
.Tooltip-
|
|
787
|
+
.Tooltip-module_tooltipContent__iio4V .Tooltip-module_tooltipArrow__4y3Pi {
|
|
788
788
|
position: absolute;
|
|
789
789
|
}
|
|
790
|
-
.Tooltip-
|
|
790
|
+
.Tooltip-module_tooltipContent__iio4V .Tooltip-module_tooltipArrowIcon__XKQ-5 {
|
|
791
791
|
--icon-size: fit-content;
|
|
792
792
|
}
|
|
793
|
-
.Tooltip-
|
|
793
|
+
.Tooltip-module_tooltipContent__iio4V .Tooltip-module_tailFill__1Iv5j {
|
|
794
794
|
--icon-fill: var(--tooltip-content-background, var(--surface-background-6));
|
|
795
795
|
z-index: 1;
|
|
796
796
|
}
|
|
797
|
-
.Tooltip-
|
|
797
|
+
.Tooltip-module_tooltipContent__iio4V .Tooltip-module_tailOutline__7l774 {
|
|
798
798
|
display: none;
|
|
799
799
|
}
|
|
800
|
-
.Tooltip-
|
|
800
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Top] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
801
801
|
top: 100%;
|
|
802
802
|
left: 50%;
|
|
803
803
|
transform: translateX(-50%);
|
|
804
804
|
}
|
|
805
|
-
.Tooltip-
|
|
806
|
-
--svg-stroke-width: calc(var(--tooltip-content-border-bottom-width, 2px) -
|
|
805
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Top] .Tooltip-module_tailOutline__7l774 {
|
|
806
|
+
--svg-stroke-width: calc(var(--tooltip-content-border-bottom-width, 2px) - 1px);
|
|
807
807
|
}
|
|
808
|
-
.Tooltip-
|
|
809
|
-
|
|
808
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Top][data-align=Start] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
809
|
+
left: 14px;
|
|
810
|
+
left: var(--arrow-offset, 14px);
|
|
811
|
+
}
|
|
812
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Top][data-align=End] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
813
|
+
left: auto;
|
|
814
|
+
left: initial;
|
|
815
|
+
right: 0;
|
|
816
|
+
}
|
|
817
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Bottom] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
818
|
+
bottom: 100%;
|
|
810
819
|
left: 50%;
|
|
811
820
|
transform: translateX(-50%) rotate(180deg);
|
|
812
821
|
}
|
|
813
|
-
.Tooltip-
|
|
814
|
-
--svg-stroke-width: calc(var(--tooltip-content-border-top-width, 2px) -
|
|
822
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Bottom] .Tooltip-module_tailOutline__7l774 {
|
|
823
|
+
--svg-stroke-width: calc(var(--tooltip-content-border-top-width, 2px) - 1px);
|
|
815
824
|
opacity: clamp(0, 2px / 1px, 1);
|
|
816
825
|
opacity: clamp(0, var(--tooltip-content-border-top-width, 2px) / 1px, 1);
|
|
817
826
|
}
|
|
818
|
-
.Tooltip-
|
|
827
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Bottom][data-align=Start] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
828
|
+
left: 14px;
|
|
829
|
+
left: var(--arrow-offset, 14px);
|
|
830
|
+
}
|
|
831
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Bottom][data-align=End] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
832
|
+
left: auto;
|
|
833
|
+
left: initial;
|
|
834
|
+
right: 0;
|
|
835
|
+
}
|
|
836
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Left] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
819
837
|
width: -moz-max-content;
|
|
820
838
|
width: max-content;
|
|
821
839
|
right: -18px;
|
|
822
840
|
top: 50%;
|
|
823
841
|
transform: translateY(-50%) rotate(-90deg);
|
|
824
842
|
}
|
|
825
|
-
.Tooltip-
|
|
826
|
-
--svg-stroke-width: calc(var(--tooltip-content-border-right-width, 2px) -
|
|
843
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Left] .Tooltip-module_tailOutline__7l774 {
|
|
844
|
+
--svg-stroke-width: calc(var(--tooltip-content-border-right-width, 2px) - 1px);
|
|
827
845
|
opacity: clamp(0, 2px / 1px, 1);
|
|
828
846
|
opacity: clamp(0, var(--tooltip-content-border-right-width, 2px) / 1px, 1);
|
|
829
847
|
}
|
|
830
|
-
.Tooltip-
|
|
848
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Left][data-align=Start] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
849
|
+
top: 50%;
|
|
850
|
+
top: var(--arrow-offset, 50%);
|
|
851
|
+
}
|
|
852
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Left][data-align=End] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
853
|
+
top: auto;
|
|
854
|
+
top: initial;
|
|
855
|
+
top: 50%;
|
|
856
|
+
top: var(--arrow-offset, 50%);
|
|
857
|
+
}
|
|
858
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Right] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
831
859
|
width: -moz-max-content;
|
|
832
860
|
width: max-content;
|
|
833
861
|
left: -18px;
|
|
834
862
|
top: 50%;
|
|
835
863
|
transform: translateY(-50%) rotate(90deg);
|
|
836
864
|
}
|
|
837
|
-
.Tooltip-
|
|
838
|
-
--svg-stroke-width: calc(var(--tooltip-content-border-left-width, 2px) -
|
|
865
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Right] .Tooltip-module_tailOutline__7l774 {
|
|
866
|
+
--svg-stroke-width: calc(var(--tooltip-content-border-left-width, 2px) - 1px);
|
|
839
867
|
opacity: clamp(0, 2px / 1px, 1);
|
|
840
868
|
opacity: clamp(0, var(--tooltip-content-border-left-width, 2px) / 1px, 1);
|
|
841
869
|
}
|
|
842
|
-
.Tooltip-
|
|
870
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Right][data-align=Start] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
871
|
+
top: 50%;
|
|
872
|
+
top: var(--arrow-offset, 50%);
|
|
873
|
+
}
|
|
874
|
+
.Tooltip-module_tooltipContent__iio4V[data-direction=Right][data-align=End] .Tooltip-module_tooltipArrow__4y3Pi {
|
|
875
|
+
top: auto;
|
|
876
|
+
top: initial;
|
|
877
|
+
top: 50%;
|
|
878
|
+
top: var(--arrow-offset, 50%);
|
|
879
|
+
}
|
|
880
|
+
.Tooltip-module_tooltipContent__iio4V.Tooltip-module_outlined__EUk52 {
|
|
843
881
|
border-bottom-width: 2px;
|
|
844
882
|
border-bottom-width: var(--tooltip-content-border-bottom-width, 2px);
|
|
845
883
|
border-left-width: 2px;
|
|
@@ -856,7 +894,7 @@
|
|
|
856
894
|
outline-style: var(--tooltip-content-outline-style);
|
|
857
895
|
outline-color: var(--tooltip-content-outline-color);
|
|
858
896
|
}
|
|
859
|
-
.Tooltip-
|
|
897
|
+
.Tooltip-module_tooltipContent__iio4V.Tooltip-module_outlined__EUk52 .Tooltip-module_tailOutline__7l774 {
|
|
860
898
|
--svg-stroke: var(--tooltip-content-border-color, #4E5059);
|
|
861
899
|
--icon-fill: var(--tooltip-content-border-color, #4E5059);
|
|
862
900
|
display: block;
|