carbon-react 106.3.1 → 106.4.1
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__/input/input-presentation.component.js +13 -0
- package/esm/__internal__/input/input.component.js +294 -0
- package/esm/__internal__/input-behaviour/input-behaviour.component.js +4 -0
- package/esm/__internal__/input-behaviour/input-group-behaviour.component.js +5 -0
- package/esm/__internal__/validation-message/validation-message.component.js +5 -0
- package/esm/__internal__/validations/validation-icon.component.js +41 -1
- package/esm/components/alert/alert.component.js +38 -252
- package/esm/components/alert/index.d.ts +1 -0
- package/esm/components/badge/badge.component.js +20 -60
- package/esm/components/button/button.component.js +760 -3310
- package/esm/components/carbon-provider/carbon-provider.component.js +48 -106
- package/esm/components/heading/heading.style.d.ts +2 -2
- package/esm/components/hr/hr.component.js +171 -1305
- package/esm/components/hr/index.d.ts +1 -0
- package/esm/components/inline-inputs/inline-inputs.component.js +35 -90
- package/esm/components/link/index.d.ts +1 -0
- package/esm/components/link/link.component.js +123 -1228
- package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/esm/components/navigation-bar/index.d.ts +1 -0
- package/esm/components/navigation-bar/navigation-bar.component.js +1018 -10761
- package/esm/components/pager/pager.style.d.ts +1 -1
- package/esm/components/pod/pod.style.d.ts +1 -1
- package/esm/components/radio-button/radio-button-svg.component.js +16 -29
- package/esm/components/select/filterable-select/filterable-select.component.js +1 -4
- package/esm/components/select/multi-select/multi-select.component.js +1 -4
- package/esm/components/select/select-list/select-list.component.js +1 -4
- package/esm/components/select/simple-select/simple-select.component.js +1 -4
- package/esm/components/select/utils/get-next-index-by-key.d.ts +1 -0
- package/esm/components/select/utils/get-next-index-by-key.js +50 -18
- package/esm/components/select/utils/is-navigation-key.d.ts +1 -0
- package/esm/components/select/utils/is-navigation-key.js +4 -0
- package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
- package/esm/components/tooltip/tooltip.component.js +85 -254
- package/esm/components/vertical-divider/index.d.ts +1 -0
- package/esm/components/vertical-divider/vertical-divider.component.d.ts +2 -2
- package/esm/components/vertical-divider/vertical-divider.component.js +328 -1406
- package/esm/components/vertical-divider/vertical-divider.style.d.ts +3 -3
- package/lib/__internal__/input/input-presentation.component.js +16 -0
- package/lib/__internal__/input/input.component.js +295 -0
- package/lib/__internal__/input-behaviour/input-behaviour.component.js +6 -1
- package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +7 -1
- package/lib/__internal__/validation-message/validation-message.component.js +6 -0
- package/lib/__internal__/validations/validation-icon.component.js +39 -0
- package/lib/components/alert/alert.component.js +42 -143
- package/lib/components/alert/index.d.ts +1 -0
- package/lib/components/badge/badge.component.js +24 -50
- package/lib/components/button/button.component.js +768 -3378
- package/lib/components/carbon-provider/carbon-provider.component.js +54 -110
- package/lib/components/heading/heading.style.d.ts +2 -2
- package/lib/components/hr/hr.component.js +175 -676
- package/lib/components/hr/index.d.ts +1 -0
- package/lib/components/inline-inputs/inline-inputs.component.js +43 -137
- package/lib/components/link/index.d.ts +1 -0
- package/lib/components/link/link.component.js +142 -746
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/lib/components/navigation-bar/index.d.ts +1 -0
- package/lib/components/navigation-bar/navigation-bar.component.js +1022 -5426
- package/lib/components/pager/pager.style.d.ts +1 -1
- package/lib/components/pod/pod.style.d.ts +1 -1
- package/lib/components/radio-button/radio-button-svg.component.js +20 -38
- package/lib/components/select/filterable-select/filterable-select.component.js +3 -5
- package/lib/components/select/multi-select/multi-select.component.js +3 -5
- package/lib/components/select/select-list/select-list.component.js +3 -5
- package/lib/components/select/simple-select/simple-select.component.js +3 -5
- package/lib/components/select/utils/get-next-index-by-key.d.ts +1 -0
- package/lib/components/select/utils/get-next-index-by-key.js +52 -18
- package/lib/components/select/utils/is-navigation-key.d.ts +1 -0
- package/lib/components/select/utils/is-navigation-key.js +11 -0
- package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
- package/lib/components/tooltip/tooltip.component.js +98 -215
- package/lib/components/vertical-divider/index.d.ts +1 -0
- package/lib/components/vertical-divider/vertical-divider.component.d.ts +2 -2
- package/lib/components/vertical-divider/vertical-divider.component.js +334 -1457
- package/lib/components/vertical-divider/vertical-divider.style.d.ts +3 -3
- package/package.json +4 -3
|
@@ -3,7 +3,7 @@ export const StyledPagerSizeOptions: import("styled-components").StyledComponent
|
|
|
3
3
|
export const StyledPagerSizeOptionsInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export const StyledPagerNavigation: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export const StyledPagerNavInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export const StyledPagerLinkStyles: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link
|
|
6
|
+
export const StyledPagerLinkStyles: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
|
|
7
7
|
export const StyledPagerNoSelect: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
8
8
|
export const StyledPagerSummary: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
9
|
export const StyledSelectContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const StyledBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export const StyledContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export const StyledEditAction: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link
|
|
3
|
+
export const StyledEditAction: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
|
|
4
4
|
export const StyledActionsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export const StyledDeleteButton: import("styled-components").StyledComponent<typeof IconButton, any, {}, never>;
|
|
6
6
|
export const StyledUndoButton: import("styled-components").StyledComponent<typeof IconButton, any, {}, never>;
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import StyledCheckableInputSvgWrapper from "../../__internal__/checkable-input/checkable-input-svg-wrapper.style";
|
|
4
3
|
|
|
5
4
|
const RadioButtonSvg = () => {
|
|
6
|
-
return /*#__PURE__*/ React.createElement(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
fillRule: "evenodd",
|
|
22
|
-
},
|
|
23
|
-
/*#__PURE__*/ React.createElement("circle", {
|
|
24
|
-
className: "radio-button-check",
|
|
25
|
-
fill: "#FFFFFF",
|
|
26
|
-
cx: "7.5",
|
|
27
|
-
cy: "7.5",
|
|
28
|
-
r: "5",
|
|
29
|
-
})
|
|
30
|
-
)
|
|
31
|
-
)
|
|
32
|
-
);
|
|
5
|
+
return /*#__PURE__*/React.createElement(StyledCheckableInputSvgWrapper, null, /*#__PURE__*/React.createElement("svg", {
|
|
6
|
+
focusable: "false",
|
|
7
|
+
viewBox: "0 0 15 15"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
9
|
+
stroke: "none",
|
|
10
|
+
strokeWidth: "1",
|
|
11
|
+
fill: "none",
|
|
12
|
+
fillRule: "evenodd"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
14
|
+
className: "radio-button-check",
|
|
15
|
+
fill: "#FFFFFF",
|
|
16
|
+
cx: "7.5",
|
|
17
|
+
cy: "7.5",
|
|
18
|
+
r: "5"
|
|
19
|
+
}))));
|
|
33
20
|
};
|
|
34
21
|
|
|
35
|
-
export default /*#__PURE__*/
|
|
22
|
+
export default /*#__PURE__*/React.memo(RadioButtonSvg, () => true);
|
|
@@ -10,6 +10,7 @@ import withFilter from "../utils/with-filter.hoc";
|
|
|
10
10
|
import StyledSelect from "../select.style";
|
|
11
11
|
import SelectList from "../select-list/select-list.component";
|
|
12
12
|
import isExpectedOption from "../utils/is-expected-option";
|
|
13
|
+
import isNavigationKey from "../utils/is-navigation-key";
|
|
13
14
|
const FilterableSelectList = withFilter(SelectList);
|
|
14
15
|
const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
15
16
|
value,
|
|
@@ -386,10 +387,6 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
386
387
|
};
|
|
387
388
|
}
|
|
388
389
|
|
|
389
|
-
function isNavigationKey(key) {
|
|
390
|
-
return key === "ArrowDown" || key === "ArrowUp" || key === "Home" || key === "End";
|
|
391
|
-
}
|
|
392
|
-
|
|
393
390
|
const selectList = /*#__PURE__*/React.createElement(FilterableSelectList, {
|
|
394
391
|
ref: listboxRef,
|
|
395
392
|
id: selectListId.current,
|
|
@@ -12,6 +12,7 @@ import { StyledSelectPillContainer, StyledSelectMultiSelect, StyledAccessibility
|
|
|
12
12
|
import Pill from "../../pill";
|
|
13
13
|
import isExpectedOption from "../utils/is-expected-option";
|
|
14
14
|
import isExpectedValue from "../utils/is-expected-value";
|
|
15
|
+
import isNavigationKey from "../utils/is-navigation-key";
|
|
15
16
|
const FilterableSelectList = withFilter(SelectList);
|
|
16
17
|
const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
17
18
|
value,
|
|
@@ -401,10 +402,6 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
401
402
|
};
|
|
402
403
|
}
|
|
403
404
|
|
|
404
|
-
function isNavigationKey(key) {
|
|
405
|
-
return key === "ArrowDown" || key === "ArrowUp" || key === "Home" || key === "End";
|
|
406
|
-
}
|
|
407
|
-
|
|
408
405
|
const selectList = /*#__PURE__*/React.createElement(FilterableSelectList, {
|
|
409
406
|
ref: listboxRef,
|
|
410
407
|
"aria-multiselectable": true,
|
|
@@ -9,6 +9,7 @@ import OptionRow from "../option-row/option-row.component";
|
|
|
9
9
|
import updateListScrollTop from "./update-list-scroll";
|
|
10
10
|
import getNextChildByText from "../utils/get-next-child-by-text";
|
|
11
11
|
import getNextIndexByKey from "../utils/get-next-index-by-key";
|
|
12
|
+
import isNavigationKey from "../utils/is-navigation-key";
|
|
12
13
|
import ListActionButton from "../list-action-button/list-action-button.component";
|
|
13
14
|
import StyledSelectListContainer from "./select-list-container.style";
|
|
14
15
|
import Loader from "../../loader";
|
|
@@ -276,10 +277,6 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
276
277
|
enabled: flipEnabled
|
|
277
278
|
}], [flipEnabled]);
|
|
278
279
|
|
|
279
|
-
function isNavigationKey(keyEvent) {
|
|
280
|
-
return keyEvent === "ArrowDown" || keyEvent === "ArrowUp" || keyEvent === "Home" || keyEvent === "End";
|
|
281
|
-
}
|
|
282
|
-
|
|
283
280
|
const loader = () => /*#__PURE__*/React.createElement(StyledSelectLoaderContainer, {
|
|
284
281
|
key: "loader",
|
|
285
282
|
as: multiColumn ? "div" : "li"
|
|
@@ -11,6 +11,7 @@ import SelectList from "../select-list/select-list.component";
|
|
|
11
11
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
12
12
|
import getNextChildByText from "../utils/get-next-child-by-text";
|
|
13
13
|
import isExpectedOption from "../utils/is-expected-option";
|
|
14
|
+
import isNavigationKey from "../utils/is-navigation-key";
|
|
14
15
|
const SimpleSelect = /*#__PURE__*/React.forwardRef(({
|
|
15
16
|
value,
|
|
16
17
|
defaultValue,
|
|
@@ -285,10 +286,6 @@ const SimpleSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
285
286
|
setOpenState(false);
|
|
286
287
|
}
|
|
287
288
|
|
|
288
|
-
function isNavigationKey(key) {
|
|
289
|
-
return key === "ArrowDown" || key === "ArrowUp" || key === "Home" || key === "End";
|
|
290
|
-
}
|
|
291
|
-
|
|
292
289
|
function assignInput(input) {
|
|
293
290
|
setTextboxRef(input.current);
|
|
294
291
|
|
|
@@ -1,27 +1,59 @@
|
|
|
1
|
+
export const PAGE_SIZE = 4;
|
|
1
2
|
export default function getNextIndexByKey(key, currentIndex, lastIndex, isLoading) {
|
|
2
3
|
const isNoOptionSelected = currentIndex === -1;
|
|
3
4
|
let newIndex = currentIndex;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} else if (key === "End") {
|
|
8
|
-
newIndex = lastIndex;
|
|
9
|
-
} else if (key === "ArrowDown") {
|
|
10
|
-
if (isLoading && currentIndex === lastIndex) {
|
|
11
|
-
return lastIndex;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (currentIndex === lastIndex || isNoOptionSelected) {
|
|
6
|
+
switch (key) {
|
|
7
|
+
case "Home":
|
|
15
8
|
newIndex = 0;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} else if (key === "ArrowUp") {
|
|
20
|
-
if (currentIndex === 0 || isNoOptionSelected) {
|
|
9
|
+
break;
|
|
10
|
+
|
|
11
|
+
case "End":
|
|
21
12
|
newIndex = lastIndex;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
break;
|
|
14
|
+
|
|
15
|
+
case "ArrowDown":
|
|
16
|
+
if (isLoading && currentIndex === lastIndex) {
|
|
17
|
+
return lastIndex;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (currentIndex === lastIndex || isNoOptionSelected) {
|
|
21
|
+
newIndex = 0;
|
|
22
|
+
} else {
|
|
23
|
+
newIndex = currentIndex + 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
case "ArrowUp":
|
|
29
|
+
if (currentIndex === 0 || isNoOptionSelected) {
|
|
30
|
+
newIndex = lastIndex;
|
|
31
|
+
} else {
|
|
32
|
+
newIndex = currentIndex - 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "PageDown":
|
|
38
|
+
if (isNoOptionSelected) {
|
|
39
|
+
newIndex = Math.min(PAGE_SIZE - 1, lastIndex);
|
|
40
|
+
} else {
|
|
41
|
+
newIndex = Math.min(currentIndex + PAGE_SIZE, lastIndex);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case "PageUp":
|
|
47
|
+
if (isNoOptionSelected) {
|
|
48
|
+
newIndex = Math.max(lastIndex + 1 - PAGE_SIZE, 0);
|
|
49
|
+
} else {
|
|
50
|
+
newIndex = Math.max(currentIndex - PAGE_SIZE, 0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
default:
|
|
56
|
+
break;
|
|
25
57
|
}
|
|
26
58
|
|
|
27
59
|
return newIndex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isNavigationKey(key: any): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default StyledEditorLink;
|
|
2
|
-
declare const StyledEditorLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../link
|
|
2
|
+
declare const StyledEditorLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
|
|
@@ -1,19 +1,4 @@
|
|
|
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
|
-
}
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
2
|
|
|
18
3
|
import React from "react";
|
|
19
4
|
import PropTypes from "prop-types";
|
|
@@ -27,253 +12,99 @@ import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
|
27
12
|
import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
|
|
28
13
|
const TOOLTIP_DELAY = 100;
|
|
29
14
|
const tippyPlugins = [sticky];
|
|
30
|
-
const Tooltip = /*#__PURE__*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
);
|
|
15
|
+
const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
16
|
+
children,
|
|
17
|
+
isVisible,
|
|
18
|
+
position = "top",
|
|
19
|
+
message,
|
|
20
|
+
type,
|
|
21
|
+
size = "medium",
|
|
22
|
+
isPartOfInput,
|
|
23
|
+
inputSize,
|
|
24
|
+
id,
|
|
25
|
+
bgColor,
|
|
26
|
+
fontColor,
|
|
27
|
+
flipOverrides,
|
|
28
|
+
target,
|
|
29
|
+
...rest
|
|
30
|
+
}, ref) => {
|
|
31
|
+
const isFlipOverridesValid = !flipOverrides || Array.isArray(flipOverrides) && flipOverrides.every(placement => TOOLTIP_POSITIONS.includes(placement));
|
|
32
|
+
invariant(isFlipOverridesValid, `The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].`);
|
|
60
33
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
};
|
|
34
|
+
const tooltip = (attrs, content) => {
|
|
35
|
+
const currentPosition = attrs["data-placement"] || position;
|
|
36
|
+
return /*#__PURE__*/React.createElement(CarbonScopedTokensProvider, null, /*#__PURE__*/React.createElement(StyledTooltip, _extends({
|
|
37
|
+
"data-element": "tooltip",
|
|
38
|
+
role: "tooltip",
|
|
39
|
+
tabIndex: -1,
|
|
40
|
+
type: type,
|
|
41
|
+
size: size,
|
|
42
|
+
id: id
|
|
43
|
+
}, tagComponent("tooltip", rest), {
|
|
44
|
+
isPartOfInput: isPartOfInput,
|
|
45
|
+
inputSize: inputSize
|
|
46
|
+
}, attrs, {
|
|
47
|
+
position: currentPosition,
|
|
48
|
+
ref: ref,
|
|
49
|
+
bgColor: bgColor,
|
|
50
|
+
fontColor: fontColor
|
|
51
|
+
}), /*#__PURE__*/React.createElement(StyledPointer, _extends({
|
|
52
|
+
key: "pointer",
|
|
53
|
+
type: type
|
|
54
|
+
}, attrs, {
|
|
55
|
+
position: currentPosition,
|
|
56
|
+
"data-popper-arrow": "",
|
|
57
|
+
"data-element": "tooltip-pointer",
|
|
58
|
+
bgColor: bgColor
|
|
59
|
+
})), content));
|
|
60
|
+
};
|
|
110
61
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
},
|
|
62
|
+
return /*#__PURE__*/React.createElement(Tippy, _extends({
|
|
63
|
+
placement: position,
|
|
64
|
+
delay: TOOLTIP_DELAY
|
|
65
|
+
}, isVisible !== undefined && {
|
|
66
|
+
visible: isVisible
|
|
67
|
+
}, {
|
|
68
|
+
plugins: tippyPlugins,
|
|
69
|
+
sticky: true,
|
|
70
|
+
render: attrs => tooltip(attrs, message),
|
|
71
|
+
reference: target,
|
|
72
|
+
popperOptions: {
|
|
73
|
+
modifiers: [...(flipOverrides ? [{
|
|
74
|
+
name: "flip",
|
|
75
|
+
options: {
|
|
76
|
+
fallbackPlacements: flipOverrides
|
|
146
77
|
}
|
|
147
|
-
),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
*/
|
|
177
|
-
id: PropTypes.string,
|
|
178
|
-
inputSize: PropTypes.oneOf(["large", "medium", "small"]),
|
|
179
|
-
isPartOfInput: PropTypes.bool,
|
|
180
|
-
/**
|
|
181
|
-
* Whether to to show the Tooltip
|
|
182
|
-
*/
|
|
183
|
-
isVisible: PropTypes.bool,
|
|
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
|
-
);
|
|
78
|
+
}] : []), {
|
|
79
|
+
name: "computeStyles",
|
|
80
|
+
options: {
|
|
81
|
+
gpuAcceleration: false
|
|
82
|
+
}
|
|
83
|
+
}]
|
|
207
84
|
}
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
* Defines the message type
|
|
211
|
-
*/
|
|
212
|
-
type: PropTypes.string,
|
|
213
|
-
};
|
|
214
|
-
|
|
85
|
+
}), children);
|
|
86
|
+
});
|
|
215
87
|
Tooltip.propTypes = {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
*/
|
|
235
|
-
fontColor: PropTypes.string,
|
|
236
|
-
/**
|
|
237
|
-
* The id attribute to use for the tooltip
|
|
238
|
-
*/
|
|
239
|
-
id: PropTypes.string,
|
|
240
|
-
inputSize: PropTypes.oneOf(["large", "medium", "small"]),
|
|
241
|
-
isPartOfInput: PropTypes.bool,
|
|
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) {
|
|
88
|
+
"bgColor": PropTypes.string,
|
|
89
|
+
"children": PropTypes.element.isRequired,
|
|
90
|
+
"flipOverrides": PropTypes.arrayOf(PropTypes.oneOf(["bottom", "left", "right", "top"])),
|
|
91
|
+
"fontColor": PropTypes.string,
|
|
92
|
+
"id": PropTypes.string,
|
|
93
|
+
"inputSize": PropTypes.oneOf(["large", "medium", "small"]),
|
|
94
|
+
"isPartOfInput": PropTypes.bool,
|
|
95
|
+
"isVisible": PropTypes.bool,
|
|
96
|
+
"message": PropTypes.node,
|
|
97
|
+
"position": PropTypes.oneOf(["bottom", "left", "right", "top"]),
|
|
98
|
+
"size": PropTypes.oneOf(["large", "medium"]),
|
|
99
|
+
"target": function (props, propName) {
|
|
260
100
|
if (props[propName] == null) {
|
|
261
101
|
return null;
|
|
262
|
-
} else if (
|
|
263
|
-
|
|
264
|
-
props[propName].nodeType !== 1
|
|
265
|
-
) {
|
|
266
|
-
return new Error(
|
|
267
|
-
"Expected prop '" + propName + "' to be of type Element"
|
|
268
|
-
);
|
|
102
|
+
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
103
|
+
return new Error("Expected prop '" + propName + "' to be of type Element");
|
|
269
104
|
}
|
|
270
105
|
},
|
|
271
|
-
|
|
272
|
-
* Defines the message type
|
|
273
|
-
*/
|
|
274
|
-
type: PropTypes.string,
|
|
106
|
+
"type": PropTypes.string
|
|
275
107
|
};
|
|
276
|
-
|
|
277
108
|
export { Tooltip };
|
|
278
109
|
Tooltip.displayName = "Tooltip";
|
|
279
|
-
export default Tooltip;
|
|
110
|
+
export default Tooltip;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
declare type TintRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 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 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
|
|
4
|
-
export interface
|
|
4
|
+
export interface VerticalDividerProps extends SpaceProps {
|
|
5
5
|
h?: number | string;
|
|
6
6
|
height?: number | string;
|
|
7
7
|
displayInline?: boolean;
|
|
8
8
|
/** the supported rage is 1-100 */
|
|
9
9
|
tint?: TintRange;
|
|
10
10
|
}
|
|
11
|
-
declare const VerticalDivider: ({ h, height, displayInline, tint, ...props }:
|
|
11
|
+
declare const VerticalDivider: ({ h, height, displayInline, tint, ...props }: VerticalDividerProps) => JSX.Element;
|
|
12
12
|
export default VerticalDivider;
|