@thecb/components 11.11.0-beta.2 → 11.11.0-beta.4
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/index.cjs.js +6 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/tooltip/Tooltip.js +4 -1
- package/src/components/molecules/tooltip/Tooltip.stories.js +22 -5
- package/src/components/molecules/tooltip/index.d.ts +3 -1
package/package.json
CHANGED
|
@@ -86,7 +86,9 @@ const Tooltip = ({
|
|
|
86
86
|
"aria-describedby": tooltipID,
|
|
87
87
|
onFocus: () => handleToggleTooltip(true),
|
|
88
88
|
onBlur: () => handleToggleTooltip(false),
|
|
89
|
-
onKeyDown: handleKeyDown
|
|
89
|
+
onKeyDown: handleKeyDown,
|
|
90
|
+
tabIndex: "0",
|
|
91
|
+
style: { cursor: "pointer" }
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -101,6 +103,7 @@ const Tooltip = ({
|
|
|
101
103
|
onTouchStart={() => handleToggleTooltip(true)}
|
|
102
104
|
data-qa={`tooltip-trigger-${tooltipID}`}
|
|
103
105
|
text={triggerText}
|
|
106
|
+
tabIndex="0"
|
|
104
107
|
extraStyles={`
|
|
105
108
|
color: ${themeValues.linkColor};
|
|
106
109
|
&:hover { color: ${themeValues.hoverColor}; text-decoration: none;}
|
|
@@ -40,10 +40,18 @@ const meta = {
|
|
|
40
40
|
maxWidth: "300px",
|
|
41
41
|
height: "auto",
|
|
42
42
|
containerExtraStyles: "",
|
|
43
|
-
contentExtraStyles: ""
|
|
44
|
-
contentBackgroundColor: ""
|
|
43
|
+
contentExtraStyles: ""
|
|
45
44
|
},
|
|
46
45
|
argTypes: {
|
|
46
|
+
hasCustomTrigger: {
|
|
47
|
+
description:
|
|
48
|
+
"When true, the component uses the children prop as the trigger element instead of the default ButtonWithAction.",
|
|
49
|
+
control: { type: "boolean" },
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: "boolean" },
|
|
52
|
+
defaultValue: { summary: false }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
47
55
|
children: {
|
|
48
56
|
description:
|
|
49
57
|
"Optional trigger element. When provided, it replaces the default ButtonWithAction trigger. The child element will receive aria-describedby, focus, blur, and keydown handlers.",
|
|
@@ -76,6 +84,14 @@ const meta = {
|
|
|
76
84
|
defaultValue: { summary: '""' }
|
|
77
85
|
}
|
|
78
86
|
},
|
|
87
|
+
triggerButtonVariant: {
|
|
88
|
+
description:
|
|
89
|
+
"Variant passed to the default ButtonWithAction trigger. Has no effect when a custom trigger is used.",
|
|
90
|
+
table: {
|
|
91
|
+
type: { summary: "string" },
|
|
92
|
+
defaultValue: { summary: '"smallGhost"' }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
79
95
|
contentPosition: {
|
|
80
96
|
description:
|
|
81
97
|
"CSS position values (top, right, bottom, left) for the tooltip content box relative to the trigger.",
|
|
@@ -145,11 +161,12 @@ const meta = {
|
|
|
145
161
|
defaultValue: { summary: '""' }
|
|
146
162
|
}
|
|
147
163
|
},
|
|
148
|
-
|
|
149
|
-
description:
|
|
164
|
+
arrowColor: {
|
|
165
|
+
description:
|
|
166
|
+
"Override color for the tooltip arrow. Defaults to the theme border color when not provided.",
|
|
150
167
|
table: {
|
|
151
168
|
type: { summary: "string" },
|
|
152
|
-
defaultValue: { summary:
|
|
169
|
+
defaultValue: { summary: undefined }
|
|
153
170
|
}
|
|
154
171
|
}
|
|
155
172
|
}
|
|
@@ -5,7 +5,9 @@ export interface TooltipProps {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
content: string | React.ReactNode;
|
|
7
7
|
tooltipID: string;
|
|
8
|
+
hasCustomTrigger?: boolean;
|
|
8
9
|
triggerText?: string;
|
|
10
|
+
triggerButtonVariant?: string;
|
|
9
11
|
contentPosition?: {
|
|
10
12
|
top: string;
|
|
11
13
|
right: string;
|
|
@@ -24,7 +26,7 @@ export interface TooltipProps {
|
|
|
24
26
|
height?: string;
|
|
25
27
|
containerExtraStyles?: string;
|
|
26
28
|
contentExtraStyles?: string;
|
|
27
|
-
|
|
29
|
+
arrowColor?: string;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export const Tooltip: React.FC<Expand<TooltipProps> &
|