@thecb/components 11.8.0-beta.4 → 11.8.1-beta.0
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 +463 -555
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +463 -555
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/atoms/display-card/DisplayCard.js +88 -0
- package/src/components/atoms/display-card/DisplayCard.mdx +13 -0
- package/src/components/atoms/display-card/DisplayCard.stories.js +165 -0
- package/src/components/atoms/display-card/index.js +3 -0
- package/src/components/atoms/icons/IconAdd.js +2 -2
- package/src/components/atoms/index.js +1 -0
- package/src/components/molecules/index.js +0 -1
- package/src/components/templates/sidebar-stack-content/SidebarStackContent.js +1 -1
- package/src/components/molecules/tooltip/Tooltip.js +0 -149
- package/src/components/molecules/tooltip/Tooltip.mdx +0 -15
- package/src/components/molecules/tooltip/Tooltip.stories.js +0 -203
- package/src/components/molecules/tooltip/Tooltip.theme.js +0 -9
- package/src/components/molecules/tooltip/index.d.ts +0 -31
- package/src/components/molecules/tooltip/index.js +0 -3
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import Tooltip from "./Tooltip";
|
|
2
|
-
import WarningIconXS from "../../atoms/icons/WarningIconXS";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Molecules/Tooltip",
|
|
5
|
-
component: Tooltip,
|
|
6
|
-
tags: ["!autodocs"],
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
controls: { expanded: true }
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
12
|
-
triggerText: "",
|
|
13
|
-
content: "",
|
|
14
|
-
hasIconTrigger: false,
|
|
15
|
-
IconTrigger: WarningIconXS,
|
|
16
|
-
iconHelpText: "",
|
|
17
|
-
tooltipID: 0,
|
|
18
|
-
extraStyles: undefined,
|
|
19
|
-
textExtraStyles: undefined,
|
|
20
|
-
minWidth: "250px",
|
|
21
|
-
maxWidth: "300px",
|
|
22
|
-
height: "auto",
|
|
23
|
-
position: undefined,
|
|
24
|
-
arrowPosition: undefined,
|
|
25
|
-
arrowDirection: "down",
|
|
26
|
-
transform: "none",
|
|
27
|
-
buttonExtraStyles: undefined,
|
|
28
|
-
backgroundColor: "white",
|
|
29
|
-
borderColor: "rgba(255, 255, 255, 0.85)",
|
|
30
|
-
tooltipExtraStyles: undefined
|
|
31
|
-
},
|
|
32
|
-
argTypes: {
|
|
33
|
-
triggerText: {
|
|
34
|
-
description:
|
|
35
|
-
"Text element that tooltip is anchored to. Only used if hasIcon is false.",
|
|
36
|
-
table: {
|
|
37
|
-
type: { summary: "string" },
|
|
38
|
-
defaultValue: { summary: "" }
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
content: {
|
|
42
|
-
description: "Content of the tooltip",
|
|
43
|
-
table: {
|
|
44
|
-
type: { summary: "string" },
|
|
45
|
-
defaultValue: { summary: "" }
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
hasIconTrigger: {
|
|
49
|
-
description:
|
|
50
|
-
"Whether an icon is the trigger for the tooltip, instead of text",
|
|
51
|
-
table: {
|
|
52
|
-
type: { summary: "boolean" },
|
|
53
|
-
defaultValue: { summary: false }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
IconTrigger: {
|
|
57
|
-
description:
|
|
58
|
-
"The icon component to display. Requires hasIcon to be true.",
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: "React Component" },
|
|
61
|
-
defaultValue: { summary: "WarningIconXS" }
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
iconHelpText: {
|
|
65
|
-
description: "Accessible description of the icon",
|
|
66
|
-
table: {
|
|
67
|
-
type: { summary: "string" },
|
|
68
|
-
defaultValue: { summary: undefined }
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
tooltipID: {
|
|
72
|
-
description:
|
|
73
|
-
"ID value for tooltip. Use if displaying multiple tooltips on the same page.",
|
|
74
|
-
table: {
|
|
75
|
-
type: { summary: "number" },
|
|
76
|
-
defaultValue: { summary: 0 }
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
extraStyles: {
|
|
80
|
-
description:
|
|
81
|
-
"Extra CSS styles to apply to the wrapper component around the trigger and tooltip",
|
|
82
|
-
table: {
|
|
83
|
-
type: { summary: "CSS string" },
|
|
84
|
-
defaultValue: { summary: undefined }
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
textExtraStyles: {
|
|
88
|
-
description: "Extra styles to apply to the text trigger of the tooltip",
|
|
89
|
-
table: {
|
|
90
|
-
type: { summary: "CSS string" },
|
|
91
|
-
defaultValue: { summary: undefined }
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
minWidth: {
|
|
95
|
-
description: "Minimum width of the tooltip component",
|
|
96
|
-
table: {
|
|
97
|
-
type: { summary: "string" },
|
|
98
|
-
defaultValue: { summary: "250px" }
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
maxWidth: {
|
|
102
|
-
description: "Maximum width of the tooltip component",
|
|
103
|
-
table: {
|
|
104
|
-
type: { summary: "string" },
|
|
105
|
-
defaultValue: { summary: "300px" }
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
height: {
|
|
109
|
-
description: "Height of the tooltip component. Default sizes to content.",
|
|
110
|
-
table: {
|
|
111
|
-
type: { summary: "string" },
|
|
112
|
-
defaultValue: { summary: "auto" }
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
position: {
|
|
116
|
-
description:
|
|
117
|
-
"Object containing values for top/right/bottom/left position of tooltip relative to trigger",
|
|
118
|
-
table: {
|
|
119
|
-
type: { summary: "Object" },
|
|
120
|
-
defaultValue: { summary: undefined }
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
arrowPosition: {
|
|
124
|
-
description:
|
|
125
|
-
"Object containing values for arrowTop/arrowRight/arrowBottom/arrowLeft position of arrow on tooltip",
|
|
126
|
-
table: {
|
|
127
|
-
type: { summary: "Object" },
|
|
128
|
-
defaultValue: { summary: undefined }
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
arrowDirection: {
|
|
132
|
-
description: "Direction the tooltip arrow points",
|
|
133
|
-
table: {
|
|
134
|
-
type: { summary: "string" },
|
|
135
|
-
defaultValue: { summary: "down" }
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
transform: {
|
|
139
|
-
description: "CSS transform to apply to tooltip",
|
|
140
|
-
table: {
|
|
141
|
-
type: { summary: "string" },
|
|
142
|
-
defaultValue: { summary: undefined }
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
buttonExtraStyles: {
|
|
146
|
-
description:
|
|
147
|
-
"Extra styles to apply to the button that wraps tooltip trigger",
|
|
148
|
-
table: {
|
|
149
|
-
type: { summary: "string" },
|
|
150
|
-
defaultValue: { summary: undefined }
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
backgroundColor: {
|
|
154
|
-
description: "Background color of the tooltip",
|
|
155
|
-
table: {
|
|
156
|
-
type: { summary: "string" },
|
|
157
|
-
defaultValue: { summary: "white" }
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
borderColor: {
|
|
161
|
-
description: "Color of the tooltip arrow",
|
|
162
|
-
table: {
|
|
163
|
-
type: { summary: "string" },
|
|
164
|
-
defaultValue: { summary: "rgba(255, 255, 255, 0.85)" }
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
tooltipExtraStyles: {
|
|
168
|
-
description: "Extra styles to apply to the tooltip",
|
|
169
|
-
table: {
|
|
170
|
-
type: { summary: "string" },
|
|
171
|
-
defaultValue: { summary: undefined }
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export const BasicTooltip = {
|
|
178
|
-
args: {
|
|
179
|
-
triggerText: "Help",
|
|
180
|
-
content:
|
|
181
|
-
"Contact support at 1-800-CTY-VILL for help with your account balance."
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export const IconTooltip = {
|
|
186
|
-
args: {
|
|
187
|
-
hasIconTrigger: true,
|
|
188
|
-
IconTrigger: WarningIconXS,
|
|
189
|
-
content:
|
|
190
|
-
"Contact support at 1-800-CTY-VILL for help with your account balance."
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export const UnderneathTooltip = {
|
|
195
|
-
args: {
|
|
196
|
-
triggerText: "What's this?",
|
|
197
|
-
content:
|
|
198
|
-
"Contact support at 1-800-CTY-VILL for help with your account balance.",
|
|
199
|
-
position: { top: "50px", left: "-100px" },
|
|
200
|
-
arrowPosition: { arrowTop: "-8px", arrowLeft: "50%" },
|
|
201
|
-
arrowDirection: "up"
|
|
202
|
-
}
|
|
203
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Expand from "../../../util/expand";
|
|
3
|
-
|
|
4
|
-
export interface TooltipProps {
|
|
5
|
-
triggerText?: string | JSX.Element;
|
|
6
|
-
content?: string | JSX.Element;
|
|
7
|
-
hasIcon?: boolean;
|
|
8
|
-
iconHelpText?: string;
|
|
9
|
-
tooltipID?: number;
|
|
10
|
-
extraStyles?: string;
|
|
11
|
-
textExtraStyles?: string;
|
|
12
|
-
minWidth?: string;
|
|
13
|
-
maxWidth?: string;
|
|
14
|
-
height?: string;
|
|
15
|
-
position?: { top: string; right: string; bottom: string; left: string };
|
|
16
|
-
arrowPosition?: {
|
|
17
|
-
arrowTop: string;
|
|
18
|
-
arrowRight: string;
|
|
19
|
-
arrowBottom: string;
|
|
20
|
-
arrowLeft: string;
|
|
21
|
-
};
|
|
22
|
-
arrowDirection?: "left" | "right" | "top" | "bottom";
|
|
23
|
-
transform?: string;
|
|
24
|
-
buttonExtraStyles?: string;
|
|
25
|
-
borderColor?: string;
|
|
26
|
-
backgroundColor?: string;
|
|
27
|
-
tooltipExtraStyles?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const Tooltip: React.FC<Expand<TooltipProps> &
|
|
31
|
-
React.HTMLAttributes<HTMLElement>>;
|