carbon-react 105.1.2 → 105.2.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/esm/__internal__/tooltip-provider/index.d.ts +19 -24
- package/esm/__internal__/tooltip-provider/index.js +0 -10
- package/esm/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/esm/components/badge/badge.style.d.ts +4 -2
- package/esm/components/button/button-types.style.d.ts +1 -2
- package/esm/components/button/button-types.style.js +3 -1
- package/esm/components/button/button.component.d.ts +67 -36
- package/esm/components/button/button.component.js +3314 -165
- package/esm/components/button/button.config.d.ts +4 -3
- package/esm/components/button/button.style.d.ts +6 -8
- package/esm/components/button/button.style.js +51 -95
- package/esm/components/button/index.d.ts +2 -2
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/esm/components/heading/heading.component.d.ts +5 -0
- package/esm/components/icon/index.d.ts +1 -0
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +3 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +7 -5
- package/esm/components/multi-action-button/multi-action-button.d.ts +4 -2
- package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
- package/esm/components/multi-step-wizard/step/step.d.ts +6 -0
- package/esm/components/multi-step-wizard/step/step.style.d.ts +4 -2
- package/esm/components/radio-button/radio-button-svg.component.js +29 -16
- package/esm/components/scrollable-list/scrollable-list.component.d.ts +8 -0
- package/esm/components/split-button/split-button-toggle.style.d.ts +2 -6
- package/esm/components/split-button/split-button.component.d.ts +3 -1
- package/esm/components/split-button/split-button.component.js +7 -4
- package/esm/components/split-button/split-button.d.ts +5 -2
- package/esm/components/tooltip/index.d.ts +2 -1
- package/esm/components/tooltip/tooltip-pointer.style.d.ts +10 -1
- package/esm/components/tooltip/tooltip-pointer.style.js +5 -12
- package/esm/components/tooltip/tooltip.component.d.ts +33 -2
- package/esm/components/tooltip/tooltip.component.js +255 -110
- package/esm/components/tooltip/tooltip.config.d.ts +2 -1
- package/esm/components/tooltip/tooltip.style.d.ts +7 -2
- package/esm/components/tooltip/tooltip.style.js +7 -21
- package/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/locales/en-gb.d.ts +3 -5
- package/esm/locales/en-gb.js +5 -4
- package/esm/locales/index.d.ts +1 -1
- package/esm/locales/index.js +2 -0
- package/esm/locales/locale.d.ts +99 -105
- package/esm/locales/locale.js +1 -0
- package/esm/locales/pl-pl.d.ts +3 -5
- package/esm/locales/pl-pl.js +5 -4
- package/lib/__internal__/tooltip-provider/index.d.ts +19 -24
- package/lib/__internal__/tooltip-provider/index.js +1 -12
- package/lib/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/lib/components/badge/badge.style.d.ts +4 -2
- package/lib/components/button/button-types.style.d.ts +1 -2
- package/lib/components/button/button-types.style.js +0 -1
- package/lib/components/button/button.component.d.ts +67 -36
- package/lib/components/button/button.component.js +3381 -172
- package/lib/components/button/button.config.d.ts +4 -3
- package/lib/components/button/button.style.d.ts +6 -8
- package/lib/components/button/button.style.js +52 -101
- package/lib/components/button/index.d.ts +2 -2
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
- package/lib/components/heading/heading.component.d.ts +5 -0
- package/lib/components/icon/index.d.ts +1 -0
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +3 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +6 -4
- package/lib/components/multi-action-button/multi-action-button.d.ts +4 -2
- package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
- package/lib/components/multi-step-wizard/step/step.d.ts +6 -0
- package/lib/components/multi-step-wizard/step/step.style.d.ts +4 -2
- package/lib/components/radio-button/radio-button-svg.component.js +38 -20
- package/lib/components/scrollable-list/scrollable-list.component.d.ts +8 -0
- package/lib/components/split-button/split-button-toggle.style.d.ts +2 -6
- package/lib/components/split-button/split-button.component.d.ts +3 -1
- package/lib/components/split-button/split-button.component.js +6 -3
- package/lib/components/split-button/split-button.d.ts +5 -2
- package/lib/components/tooltip/index.d.ts +2 -1
- package/lib/components/tooltip/tooltip-pointer.style.d.ts +10 -1
- package/lib/components/tooltip/tooltip-pointer.style.js +7 -15
- package/lib/components/tooltip/tooltip.component.d.ts +33 -2
- package/lib/components/tooltip/tooltip.component.js +221 -130
- package/lib/components/tooltip/tooltip.config.d.ts +2 -1
- package/lib/components/tooltip/tooltip.style.d.ts +7 -2
- package/lib/components/tooltip/tooltip.style.js +7 -22
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/locales/en-gb.d.ts +3 -5
- package/lib/locales/en-gb.js +2 -1
- package/lib/locales/index.d.ts +1 -1
- package/lib/locales/index.js +23 -0
- package/lib/locales/locale.d.ts +99 -105
- package/lib/locales/locale.js +5 -0
- package/lib/locales/package.json +6 -0
- package/lib/locales/pl-pl.d.ts +3 -5
- package/lib/locales/pl-pl.js +2 -1
- package/package.json +7 -4
- package/esm/components/button/button.d.ts +0 -85
- package/esm/components/tooltip/tooltip.d.ts +0 -40
- package/lib/components/button/button.d.ts +0 -85
- package/lib/components/tooltip/tooltip.d.ts +0 -40
|
@@ -1,134 +1,279 @@
|
|
|
1
|
-
function _extends() {
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends =
|
|
3
|
+
Object.assign ||
|
|
4
|
+
function (target) {
|
|
5
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
+
var source = arguments[i];
|
|
7
|
+
for (var key in source) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9
|
+
target[key] = source[key];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
return _extends.apply(this, arguments);
|
|
16
|
+
}
|
|
2
17
|
|
|
3
|
-
import React
|
|
18
|
+
import React from "react";
|
|
4
19
|
import PropTypes from "prop-types";
|
|
5
20
|
import Tippy from "@tippyjs/react/headless";
|
|
6
21
|
import { sticky } from "tippy.js";
|
|
22
|
+
import invariant from "invariant";
|
|
7
23
|
import StyledTooltip from "./tooltip.style";
|
|
8
24
|
import StyledPointer from "./tooltip-pointer.style";
|
|
25
|
+
import { TOOLTIP_POSITIONS } from "./tooltip.config";
|
|
9
26
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
10
27
|
import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
|
|
11
28
|
const TOOLTIP_DELAY = 100;
|
|
12
29
|
const tippyPlugins = [sticky];
|
|
13
|
-
const Tooltip = /*#__PURE__*/React.forwardRef(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const Tooltip = /*#__PURE__*/ React.forwardRef(
|
|
31
|
+
(
|
|
32
|
+
{
|
|
33
|
+
children,
|
|
34
|
+
isVisible,
|
|
35
|
+
position = "top",
|
|
36
|
+
message,
|
|
37
|
+
type,
|
|
38
|
+
size = "medium",
|
|
39
|
+
isPartOfInput,
|
|
40
|
+
inputSize,
|
|
41
|
+
id,
|
|
42
|
+
bgColor,
|
|
43
|
+
fontColor,
|
|
44
|
+
flipOverrides,
|
|
45
|
+
target,
|
|
46
|
+
...rest
|
|
47
|
+
},
|
|
48
|
+
ref
|
|
49
|
+
) => {
|
|
50
|
+
const isFlipOverridesValid =
|
|
51
|
+
!flipOverrides ||
|
|
52
|
+
(Array.isArray(flipOverrides) &&
|
|
53
|
+
flipOverrides.every((placement) =>
|
|
54
|
+
TOOLTIP_POSITIONS.includes(placement)
|
|
55
|
+
));
|
|
56
|
+
invariant(
|
|
57
|
+
isFlipOverridesValid,
|
|
58
|
+
`The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].`
|
|
59
|
+
);
|
|
30
60
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
const tooltip = (attrs, content) => {
|
|
62
|
+
const currentPosition = attrs["data-placement"] || position;
|
|
63
|
+
return /*#__PURE__*/ React.createElement(
|
|
64
|
+
CarbonScopedTokensProvider,
|
|
65
|
+
null,
|
|
66
|
+
/*#__PURE__*/ React.createElement(
|
|
67
|
+
StyledTooltip,
|
|
68
|
+
_extends(
|
|
69
|
+
{
|
|
70
|
+
"data-element": "tooltip",
|
|
71
|
+
role: "tooltip",
|
|
72
|
+
tabIndex: -1,
|
|
73
|
+
type: type,
|
|
74
|
+
size: size,
|
|
75
|
+
id: id,
|
|
76
|
+
},
|
|
77
|
+
tagComponent("tooltip", rest),
|
|
78
|
+
{
|
|
79
|
+
isPartOfInput: isPartOfInput,
|
|
80
|
+
inputSize: inputSize,
|
|
81
|
+
},
|
|
82
|
+
attrs,
|
|
83
|
+
{
|
|
84
|
+
position: currentPosition,
|
|
85
|
+
ref: ref,
|
|
86
|
+
bgColor: bgColor,
|
|
87
|
+
fontColor: fontColor,
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/*#__PURE__*/ React.createElement(
|
|
91
|
+
StyledPointer,
|
|
92
|
+
_extends(
|
|
93
|
+
{
|
|
94
|
+
key: "pointer",
|
|
95
|
+
type: type,
|
|
96
|
+
},
|
|
97
|
+
attrs,
|
|
98
|
+
{
|
|
99
|
+
position: currentPosition,
|
|
100
|
+
"data-popper-arrow": "",
|
|
101
|
+
"data-element": "tooltip-pointer",
|
|
102
|
+
bgColor: bgColor,
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
),
|
|
106
|
+
content
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
};
|
|
58
110
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
111
|
+
return /*#__PURE__*/ React.createElement(
|
|
112
|
+
Tippy,
|
|
113
|
+
_extends(
|
|
114
|
+
{
|
|
115
|
+
placement: position,
|
|
116
|
+
delay: TOOLTIP_DELAY,
|
|
117
|
+
},
|
|
118
|
+
isVisible !== undefined && {
|
|
119
|
+
visible: isVisible,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
plugins: tippyPlugins,
|
|
123
|
+
sticky: true,
|
|
124
|
+
render: (attrs) => tooltip(attrs, message),
|
|
125
|
+
reference: target,
|
|
126
|
+
popperOptions: {
|
|
127
|
+
modifiers: [
|
|
128
|
+
...(flipOverrides
|
|
129
|
+
? [
|
|
130
|
+
{
|
|
131
|
+
name: "flip",
|
|
132
|
+
options: {
|
|
133
|
+
fallbackPlacements: flipOverrides,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
: []),
|
|
138
|
+
{
|
|
139
|
+
name: "computeStyles",
|
|
140
|
+
options: {
|
|
141
|
+
gpuAcceleration: false,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
79
146
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
Tooltip.propTypes = {
|
|
86
|
-
/** The message to be displayed within the tooltip */
|
|
87
|
-
message: PropTypes.node.isRequired,
|
|
147
|
+
),
|
|
148
|
+
children
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
);
|
|
88
152
|
|
|
89
|
-
|
|
153
|
+
Tooltip.propTypes = {
|
|
154
|
+
/**
|
|
155
|
+
* Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
156
|
+
*/
|
|
157
|
+
bgColor: PropTypes.string,
|
|
158
|
+
/**
|
|
159
|
+
* Children elements
|
|
160
|
+
*/
|
|
161
|
+
children: PropTypes.element.isRequired,
|
|
162
|
+
/**
|
|
163
|
+
* Overrides the default flip behaviour of the Tooltip,
|
|
164
|
+
* must be an array containing some or all of ["top", "bottom", "left", "right"]
|
|
165
|
+
* (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
|
|
166
|
+
*/
|
|
167
|
+
flipOverrides: PropTypes.arrayOf(
|
|
168
|
+
PropTypes.oneOf(["bottom", "left", "right", "top"])
|
|
169
|
+
),
|
|
170
|
+
/**
|
|
171
|
+
* Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
172
|
+
*/
|
|
173
|
+
fontColor: PropTypes.string,
|
|
174
|
+
/**
|
|
175
|
+
* The id attribute to use for the tooltip
|
|
176
|
+
*/
|
|
90
177
|
id: PropTypes.string,
|
|
91
|
-
|
|
92
|
-
|
|
178
|
+
inputSize: PropTypes.oneOf(["large", "medium", "small"]),
|
|
179
|
+
isPartOfInput: PropTypes.bool,
|
|
180
|
+
/**
|
|
181
|
+
* Whether to to show the Tooltip
|
|
182
|
+
*/
|
|
93
183
|
isVisible: PropTypes.bool,
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
184
|
+
key: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
185
|
+
/**
|
|
186
|
+
* The message to be displayed within the tooltip
|
|
187
|
+
*/
|
|
188
|
+
message: PropTypes.node,
|
|
189
|
+
/**
|
|
190
|
+
* Sets position of the tooltip
|
|
191
|
+
*/
|
|
192
|
+
position: PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
193
|
+
/**
|
|
194
|
+
* Defines the size of the tooltip content
|
|
195
|
+
*/
|
|
196
|
+
size: PropTypes.oneOf(["large", "medium"]),
|
|
197
|
+
target: function (props, propName) {
|
|
198
|
+
if (props[propName] == null) {
|
|
199
|
+
return null;
|
|
200
|
+
} else if (
|
|
201
|
+
typeof props[propName] !== "object" ||
|
|
202
|
+
props[propName].nodeType !== 1
|
|
203
|
+
) {
|
|
204
|
+
return new Error(
|
|
205
|
+
"Expected prop '" + propName + "' to be of type Element"
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* Defines the message type
|
|
211
|
+
*/
|
|
99
212
|
type: PropTypes.string,
|
|
213
|
+
};
|
|
100
214
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
size: PropTypes.oneOf(["medium", "large"]),
|
|
106
|
-
// Reference element, tooltip will be positioned in relation to this element
|
|
107
|
-
target: PropTypes.instanceOf(Element),
|
|
108
|
-
|
|
109
|
-
/** Override background color of the Tooltip, provide design token, any color from palette or any valid css color value. */
|
|
215
|
+
Tooltip.propTypes = {
|
|
216
|
+
/**
|
|
217
|
+
* Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
218
|
+
*/
|
|
110
219
|
bgColor: PropTypes.string,
|
|
111
|
-
|
|
112
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Children elements
|
|
222
|
+
*/
|
|
223
|
+
children: PropTypes.element.isRequired,
|
|
224
|
+
/**
|
|
225
|
+
* Overrides the default flip behaviour of the Tooltip,
|
|
226
|
+
* must be an array containing some or all of ["top", "bottom", "left", "right"]
|
|
227
|
+
* (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
|
|
228
|
+
*/
|
|
229
|
+
flipOverrides: PropTypes.arrayOf(
|
|
230
|
+
PropTypes.oneOf(["bottom", "left", "right", "top"])
|
|
231
|
+
),
|
|
232
|
+
/**
|
|
233
|
+
* Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
234
|
+
*/
|
|
113
235
|
fontColor: PropTypes.string,
|
|
114
|
-
|
|
115
|
-
|
|
236
|
+
/**
|
|
237
|
+
* The id attribute to use for the tooltip
|
|
238
|
+
*/
|
|
239
|
+
id: PropTypes.string,
|
|
240
|
+
inputSize: PropTypes.oneOf(["large", "medium", "small"]),
|
|
116
241
|
isPartOfInput: PropTypes.bool,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
242
|
+
/**
|
|
243
|
+
* Whether to to show the Tooltip
|
|
244
|
+
*/
|
|
245
|
+
isVisible: PropTypes.bool,
|
|
246
|
+
key: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
247
|
+
/**
|
|
248
|
+
* The message to be displayed within the tooltip
|
|
249
|
+
*/
|
|
250
|
+
message: PropTypes.node,
|
|
251
|
+
/**
|
|
252
|
+
* Sets position of the tooltip
|
|
253
|
+
*/
|
|
254
|
+
position: PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
255
|
+
/**
|
|
256
|
+
* Defines the size of the tooltip content
|
|
257
|
+
*/
|
|
258
|
+
size: PropTypes.oneOf(["large", "medium"]),
|
|
259
|
+
target: function (props, propName) {
|
|
260
|
+
if (props[propName] == null) {
|
|
127
261
|
return null;
|
|
262
|
+
} else if (
|
|
263
|
+
typeof props[propName] !== "object" ||
|
|
264
|
+
props[propName].nodeType !== 1
|
|
265
|
+
) {
|
|
266
|
+
return new Error(
|
|
267
|
+
"Expected prop '" + propName + "' to be of type Element"
|
|
268
|
+
);
|
|
128
269
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* Defines the message type
|
|
273
|
+
*/
|
|
274
|
+
type: PropTypes.string,
|
|
133
275
|
};
|
|
134
|
-
|
|
276
|
+
|
|
277
|
+
export { Tooltip };
|
|
278
|
+
Tooltip.displayName = "Tooltip";
|
|
279
|
+
export default Tooltip;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export const TOOLTIP_POSITIONS: string[];
|
|
1
|
+
export declare const TOOLTIP_POSITIONS: string[];
|
|
2
|
+
export declare type TooltipPositions = "top" | "bottom" | "left" | "right";
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Placement } from "tippy.js";
|
|
2
|
+
import { TooltipProps } from "./tooltip.component";
|
|
3
|
+
interface StyledTooltipProps extends Omit<TooltipProps, "children" | "message" | "position"> {
|
|
4
|
+
position: Placement;
|
|
5
|
+
}
|
|
6
|
+
declare const StyledTooltip: import("styled-components").StyledComponent<"div", any, StyledTooltipProps, never>;
|
|
7
|
+
export default StyledTooltip;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css, keyframes } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import baseTheme from "../../style/themes/base";
|
|
4
3
|
import { toColor } from "../../style/utils/color";
|
|
5
4
|
const fadeIn = keyframes`
|
|
@@ -12,7 +11,7 @@ const fadeIn = keyframes`
|
|
|
12
11
|
}
|
|
13
12
|
`;
|
|
14
13
|
|
|
15
|
-
const tooltipColor = (
|
|
14
|
+
const tooltipColor = (theme, bgColor, type) => {
|
|
16
15
|
if (bgColor) return toColor(theme, bgColor);
|
|
17
16
|
return type === "error" ? "var(--colorsSemanticNegative500)" : "var(--colorsSemanticNeutral500)";
|
|
18
17
|
};
|
|
@@ -51,14 +50,14 @@ const tooltipOffset = (position, inputSize, isPartOfInput) => {
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
|
|
54
|
-
const
|
|
53
|
+
const StyledTooltip = styled.div`
|
|
55
54
|
${({
|
|
56
55
|
position,
|
|
57
56
|
size,
|
|
58
57
|
theme,
|
|
59
58
|
type,
|
|
60
59
|
isPartOfInput,
|
|
61
|
-
inputSize,
|
|
60
|
+
inputSize = "medium",
|
|
62
61
|
bgColor,
|
|
63
62
|
fontColor
|
|
64
63
|
}) => css`
|
|
@@ -77,24 +76,11 @@ const StyledTooltipWrapper = styled.div`
|
|
|
77
76
|
font-size: ${size === "medium" ? "14px" : "16px"};
|
|
78
77
|
line-height: 1.5rem;
|
|
79
78
|
font-weight: 400;
|
|
80
|
-
background-color: ${tooltipColor(
|
|
79
|
+
background-color: ${tooltipColor(theme, bgColor, type)};
|
|
81
80
|
${tooltipOffset(position, inputSize, isPartOfInput)};
|
|
82
81
|
`}
|
|
83
82
|
`;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
size: PropTypes.oneOf(["medium", "large"]),
|
|
87
|
-
theme: PropTypes.object,
|
|
88
|
-
type: PropTypes.string,
|
|
89
|
-
isPartOfInput: PropTypes.bool,
|
|
90
|
-
inputSize: PropTypes.oneOf(["small", "medium", "large"]),
|
|
91
|
-
bgColor: PropTypes.string,
|
|
92
|
-
fontColor: PropTypes.string
|
|
83
|
+
StyledTooltip.defaultProps = {
|
|
84
|
+
theme: baseTheme
|
|
93
85
|
};
|
|
94
|
-
|
|
95
|
-
theme: baseTheme,
|
|
96
|
-
size: "medium",
|
|
97
|
-
inputSize: "medium",
|
|
98
|
-
position: "top"
|
|
99
|
-
};
|
|
100
|
-
export default StyledTooltipWrapper;
|
|
86
|
+
export default StyledTooltip;
|
|
@@ -12,4 +12,4 @@ declare const Typography: import("styled-components").StyledComponent<"span", an
|
|
|
12
12
|
color: any;
|
|
13
13
|
bg: any;
|
|
14
14
|
backgroundColor: any;
|
|
15
|
-
}, "as" | "
|
|
15
|
+
}, "as" | "textDecoration" | "size" | "lineHeight" | "textTransform" | "weight" | "defaultMargin">;
|
package/esm/locales/en-gb.d.ts
CHANGED
package/esm/locales/en-gb.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { enGB } from "./date-fns-locales";
|
|
1
|
+
import { enGB as enGBDateLocale } from "./date-fns-locales";
|
|
2
2
|
|
|
3
3
|
const isSingular = count => (typeof count === "string" ? parseInt(count) : count) === 1;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const enGB = {
|
|
6
6
|
locale: () => "en-GB",
|
|
7
7
|
actions: {
|
|
8
8
|
edit: () => "Edit",
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
yes: () => "Yes"
|
|
20
20
|
},
|
|
21
21
|
date: {
|
|
22
|
-
dateFnsLocale: () =>
|
|
22
|
+
dateFnsLocale: () => enGBDateLocale
|
|
23
23
|
},
|
|
24
24
|
dialog: {
|
|
25
25
|
ariaLabels: {
|
|
@@ -128,4 +128,5 @@ export default {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
};
|
|
131
|
+
};
|
|
132
|
+
export default enGB;
|
package/esm/locales/index.d.ts
CHANGED