carbon-react 105.1.1 → 106.0.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 +1 -11
- package/esm/__internal__/utils/helpers/browser/index.d.ts +15 -1
- package/esm/__internal__/utils/helpers/browser/index.js +33 -1
- package/esm/__internal__/utils/helpers/browser-type-check/index.d.ts +7 -1
- package/esm/__internal__/utils/helpers/browser-type-check/index.js +8 -1
- package/esm/__internal__/utils/helpers/events/composedPath.d.ts +1 -1
- package/esm/__internal__/utils/helpers/events/events.d.ts +132 -31
- package/esm/__internal__/utils/helpers/events/events.js +10 -125
- package/esm/__internal__/utils/helpers/guid/index.d.ts +5 -0
- package/esm/__internal__/utils/helpers/guid/{guid.js → index.js} +0 -2
- package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +4 -2
- package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +2 -1
- package/esm/__internal__/utils/helpers/tags/tags.d.ts +10 -6
- package/esm/__internal__/utils/helpers/tags/tags.js +2 -6
- package/esm/__internal__/utils/helpers/useUniqueId/index.d.ts +2 -0
- package/esm/__internal__/utils/helpers/useUniqueId/index.js +7 -0
- package/esm/__internal__/utils/logger/index.d.ts +5 -1
- package/esm/__internal__/utils/logger/index.js +25 -1
- package/esm/__spec_helper__/mock-match-media.d.ts +3 -1
- package/esm/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/esm/components/app-wrapper/app-wrapper.component.js +5 -3
- 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/confirm/confirm.component.js +1 -1
- package/esm/components/dialog/dialog.component.js +1 -1
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +1 -1
- 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/fieldset/fieldset.component.d.ts +6 -1
- package/esm/components/fieldset/fieldset.component.js +14 -15
- 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/portrait/portrait-initials.component.js +1 -1
- 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/select/option/index.d.ts +1 -1
- package/esm/components/select/select-list/select-list.component.js +1 -1
- package/esm/components/select/select-textbox/select-textbox.component.js +1 -1
- 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/textbox/textbox.component.d.ts +1 -2
- package/esm/components/textbox/textbox.component.js +7 -6
- 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/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
- package/esm/hooks/__internal__/useCharacterCount/index.js +1 -18
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +24 -0
- package/esm/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
- package/esm/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
- package/esm/hooks/__internal__/useIsAboveBreakpoint/index.js +1 -6
- package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
- package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +6 -0
- package/esm/hooks/__internal__/useLocale/index.d.ts +1 -1
- package/esm/hooks/__internal__/useLocale/index.js +1 -5
- package/esm/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
- package/esm/hooks/__internal__/useLocale/useLocale.js +5 -0
- package/esm/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
- package/esm/hooks/__internal__/useResizeObserver/index.js +1 -23
- package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
- package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.js +29 -0
- package/esm/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
- package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
- package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
- package/esm/hooks/useMediaQuery/index.d.ts +1 -1
- package/esm/hooks/useMediaQuery/index.js +1 -19
- package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/esm/hooks/useMediaQuery/useMediaQuery.js +19 -0
- 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/esm/style/{fonts → assets}/carbon-icons-webfont.woff +0 -0
- package/esm/style/fonts.css +30 -0
- package/esm/style/global-style.js +1 -1
- package/esm/style/themes/base/base-theme.config.d.ts +17 -8
- package/esm/style/themes/sage/index.d.ts +17 -8
- package/lib/__internal__/tooltip-provider/index.d.ts +19 -24
- package/lib/__internal__/tooltip-provider/index.js +2 -13
- package/lib/__internal__/utils/helpers/browser/index.d.ts +15 -1
- package/lib/__internal__/utils/helpers/browser/index.js +33 -8
- package/lib/__internal__/utils/helpers/browser-type-check/index.d.ts +7 -1
- package/lib/__internal__/utils/helpers/browser-type-check/index.js +10 -21
- package/lib/__internal__/utils/helpers/events/composedPath.d.ts +1 -1
- package/lib/__internal__/utils/helpers/events/events.d.ts +132 -31
- package/lib/__internal__/utils/helpers/events/events.js +10 -125
- package/lib/__internal__/utils/helpers/guid/index.d.ts +5 -0
- package/lib/__internal__/utils/helpers/guid/{guid.js → index.js} +0 -2
- package/lib/__internal__/utils/helpers/guid/package.json +5 -2
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +4 -2
- package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +2 -1
- package/lib/__internal__/utils/helpers/tags/tags.d.ts +10 -6
- package/lib/__internal__/utils/helpers/tags/tags.js +2 -6
- package/lib/__internal__/utils/helpers/useUniqueId/index.d.ts +2 -0
- package/lib/__internal__/utils/helpers/useUniqueId/index.js +20 -0
- package/lib/__internal__/utils/helpers/useUniqueId/package.json +6 -0
- package/lib/__internal__/utils/logger/index.d.ts +5 -1
- package/lib/__internal__/utils/logger/index.js +26 -8
- package/lib/__spec_helper__/mock-match-media.d.ts +3 -1
- package/lib/components/app-wrapper/app-wrapper.component.d.ts +4 -0
- package/lib/components/app-wrapper/app-wrapper.component.js +5 -4
- 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/confirm/confirm.component.js +1 -1
- package/lib/components/dialog/dialog.component.js +1 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -1
- 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/fieldset/fieldset.component.d.ts +6 -1
- package/lib/components/fieldset/fieldset.component.js +14 -16
- 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/portrait/portrait-initials.component.js +1 -1
- 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/select/option/index.d.ts +1 -1
- package/lib/components/select/select-list/select-list.component.js +1 -1
- package/lib/components/select/select-textbox/select-textbox.component.js +1 -1
- 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/textbox/textbox.component.d.ts +1 -2
- package/lib/components/textbox/textbox.component.js +7 -8
- 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/components/vertical-divider/vertical-divider.component.js +3 -0
- package/lib/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
- package/lib/hooks/__internal__/useCharacterCount/index.js +8 -27
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +40 -0
- package/lib/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
- package/lib/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
- package/lib/hooks/__internal__/useIsAboveBreakpoint/index.js +8 -9
- package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
- package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +16 -0
- package/lib/hooks/__internal__/useLocale/index.d.ts +1 -1
- package/lib/hooks/__internal__/useLocale/index.js +8 -9
- package/lib/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
- package/lib/hooks/__internal__/useLocale/useLocale.js +16 -0
- package/lib/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
- package/lib/hooks/__internal__/useResizeObserver/index.js +8 -24
- package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
- package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.js +37 -0
- package/lib/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
- package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
- package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
- package/lib/hooks/useMediaQuery/index.d.ts +1 -1
- package/lib/hooks/useMediaQuery/index.js +8 -25
- package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/lib/hooks/useMediaQuery/useMediaQuery.js +32 -0
- 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/{__internal__/utils/ether → locales}/package.json +1 -1
- package/lib/locales/pl-pl.d.ts +3 -5
- package/lib/locales/pl-pl.js +2 -1
- package/lib/style/{fonts → assets}/carbon-icons-webfont.woff +0 -0
- package/lib/style/fonts.css +30 -0
- package/lib/style/global-style.js +1 -1
- package/lib/style/themes/base/base-theme.config.d.ts +17 -8
- package/lib/style/themes/sage/index.d.ts +17 -8
- package/package.json +10 -5
- package/esm/__internal__/utils/ether/ether.d.ts +0 -19
- package/esm/__internal__/utils/ether/ether.js +0 -29
- package/esm/__internal__/utils/ether/index.d.ts +0 -1
- package/esm/__internal__/utils/ether/index.js +0 -1
- package/esm/__internal__/utils/helpers/browser/browser.d.ts +0 -17
- package/esm/__internal__/utils/helpers/browser/browser.js +0 -198
- package/esm/__internal__/utils/helpers/browser-type-check/browser-type-check.d.ts +0 -7
- package/esm/__internal__/utils/helpers/browser-type-check/browser-type-check.js +0 -14
- package/esm/__internal__/utils/helpers/guid/__spec__.d.ts +0 -1
- package/esm/__internal__/utils/helpers/guid/__spec__.js +0 -10
- package/esm/__internal__/utils/helpers/guid/guid.d.ts +0 -2
- package/esm/__internal__/utils/helpers/guid/package.json +0 -3
- package/esm/__internal__/utils/helpers/immutable/__spec__.d.ts +0 -1
- package/esm/__internal__/utils/helpers/immutable/__spec__.js +0 -117
- package/esm/__internal__/utils/helpers/immutable/immutable.d.ts +0 -4
- package/esm/__internal__/utils/helpers/immutable/immutable.js +0 -36
- package/esm/__internal__/utils/helpers/immutable/package.json +0 -4
- package/esm/__internal__/utils/helpers/with-unique-id-props/index.d.ts +0 -1
- package/esm/__internal__/utils/helpers/with-unique-id-props/index.js +0 -1
- package/esm/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.d.ts +0 -7
- package/esm/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.js +0 -82
- package/esm/__internal__/utils/logger/logger.d.ts +0 -9
- package/esm/__internal__/utils/logger/logger.js +0 -71
- package/esm/components/button/button.d.ts +0 -85
- package/esm/components/tooltip/tooltip.d.ts +0 -40
- package/lib/__internal__/utils/ether/ether.d.ts +0 -19
- package/lib/__internal__/utils/ether/ether.js +0 -33
- package/lib/__internal__/utils/ether/index.d.ts +0 -1
- package/lib/__internal__/utils/ether/index.js +0 -18
- package/lib/__internal__/utils/helpers/browser/browser.d.ts +0 -17
- package/lib/__internal__/utils/helpers/browser/browser.js +0 -213
- package/lib/__internal__/utils/helpers/browser-type-check/browser-type-check.d.ts +0 -7
- package/lib/__internal__/utils/helpers/browser-type-check/browser-type-check.js +0 -26
- package/lib/__internal__/utils/helpers/guid/__spec__.d.ts +0 -1
- package/lib/__internal__/utils/helpers/guid/__spec__.js +0 -15
- package/lib/__internal__/utils/helpers/guid/guid.d.ts +0 -2
- package/lib/__internal__/utils/helpers/immutable/__spec__.d.ts +0 -1
- package/lib/__internal__/utils/helpers/immutable/__spec__.js +0 -135
- package/lib/__internal__/utils/helpers/immutable/immutable.d.ts +0 -4
- package/lib/__internal__/utils/helpers/immutable/immutable.js +0 -46
- package/lib/__internal__/utils/helpers/immutable/package.json +0 -4
- package/lib/__internal__/utils/helpers/with-unique-id-props/index.d.ts +0 -1
- package/lib/__internal__/utils/helpers/with-unique-id-props/index.js +0 -15
- package/lib/__internal__/utils/helpers/with-unique-id-props/package.json +0 -6
- package/lib/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.d.ts +0 -7
- package/lib/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.js +0 -96
- package/lib/__internal__/utils/logger/logger.d.ts +0 -9
- package/lib/__internal__/utils/logger/logger.js +0 -78
- package/lib/components/button/button.d.ts +0 -85
- package/lib/components/tooltip/tooltip.d.ts +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default SplitButton;
|
|
2
|
-
declare function SplitButton({ align, as, buttonType, children, disabled, iconPosition, iconType, onClick, size, subtext, text, ...rest }: {
|
|
2
|
+
declare function SplitButton({ align, as, buttonType, children, disabled, iconPosition, iconType, onClick, size, subtext, text, "data-element": dataElement, "data-role": dataRole, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
align?: string | undefined;
|
|
5
5
|
as: any;
|
|
@@ -12,6 +12,8 @@ declare function SplitButton({ align, as, buttonType, children, disabled, iconPo
|
|
|
12
12
|
size?: string | undefined;
|
|
13
13
|
subtext: any;
|
|
14
14
|
text: any;
|
|
15
|
+
"data-element": any;
|
|
16
|
+
"data-role": any;
|
|
15
17
|
}): JSX.Element;
|
|
16
18
|
declare namespace SplitButton {
|
|
17
19
|
const propTypes: {
|
|
@@ -61,6 +61,8 @@ const SplitButton = ({
|
|
|
61
61
|
size = "medium",
|
|
62
62
|
subtext,
|
|
63
63
|
text,
|
|
64
|
+
"data-element": dataElement,
|
|
65
|
+
"data-role": dataRole,
|
|
64
66
|
...rest
|
|
65
67
|
}) => {
|
|
66
68
|
if (!deprecatedWarnTriggered && as) {
|
|
@@ -145,7 +147,8 @@ const SplitButton = ({
|
|
|
145
147
|
iconType,
|
|
146
148
|
onClick,
|
|
147
149
|
size,
|
|
148
|
-
subtext
|
|
150
|
+
subtext,
|
|
151
|
+
...(0, _utils.filterOutStyledSystemSpacingProps)(rest)
|
|
149
152
|
};
|
|
150
153
|
}
|
|
151
154
|
|
|
@@ -173,8 +176,8 @@ const SplitButton = ({
|
|
|
173
176
|
function componentTags() {
|
|
174
177
|
return {
|
|
175
178
|
"data-component": "split-button",
|
|
176
|
-
"data-element":
|
|
177
|
-
"data-role":
|
|
179
|
+
"data-element": dataElement,
|
|
180
|
+
"data-role": dataRole
|
|
178
181
|
};
|
|
179
182
|
}
|
|
180
183
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
2
3
|
|
|
3
|
-
export interface SplitButtonProps
|
|
4
|
+
export interface SplitButtonProps
|
|
5
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
6
|
+
MarginProps {
|
|
4
7
|
/** Set align of the rendered content */
|
|
5
8
|
align?: "left" | "right";
|
|
6
9
|
/** Button type: "primary" | "secondary" for legacy theme */
|
|
@@ -23,6 +26,6 @@ export interface SplitButtonProps {
|
|
|
23
26
|
text: string;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
declare
|
|
29
|
+
declare function SplitButton(props: SplitButtonProps): JSX.Element;
|
|
27
30
|
|
|
28
31
|
export default SplitButton;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { Textbox as OriginalTextbox };
|
|
2
|
-
|
|
3
|
-
export default _default;
|
|
2
|
+
export default Textbox;
|
|
4
3
|
declare function Textbox({ align, autoFocus, children, disabled, inputIcon, leftChildren, labelId: externalLabelId, label, labelAlign, labelHelp, labelInline, labelSpacing, id, formattedValue, fieldHelp, error, warning, info, name, reverse, size, value, readOnly, placeholder, inputRef, onBlur, onClick, onFocus, onChange, onMouseDown, onChangeDeferred, deferTimeout, isOptional, iconOnClick, iconOnMouseDown, iconTabIndex, validationOnLabel, labelWidth, inputWidth, prefix, adaptiveLabelBreakpoint, required, positionedChildren, tooltipPosition, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, enforceCharacterLimit, characterLimit, warnOverLimit, helpAriaLabel, ...props }: {
|
|
5
4
|
[x: string]: any;
|
|
6
5
|
align: any;
|
|
@@ -19,7 +19,7 @@ var _inputIconToggle = _interopRequireDefault(require("../../__internal__/input-
|
|
|
19
19
|
|
|
20
20
|
var _formField = _interopRequireDefault(require("../../__internal__/form-field"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _useUniqueId = _interopRequireDefault(require("../../__internal__/utils/helpers/useUniqueId"));
|
|
23
23
|
|
|
24
24
|
var _inputBehaviour = require("../../__internal__/input-behaviour");
|
|
25
25
|
|
|
@@ -113,13 +113,14 @@ const Textbox = ({
|
|
|
113
113
|
|
|
114
114
|
const computeLabelPropValues = prop => validationRedesignOptIn ? undefined : prop;
|
|
115
115
|
|
|
116
|
+
const [uniqueId, uniqueName] = (0, _useUniqueId.default)(id, name);
|
|
116
117
|
const {
|
|
117
118
|
labelId: internalLabelId,
|
|
118
119
|
validationIconId,
|
|
119
120
|
fieldHelpId,
|
|
120
121
|
ariaDescribedBy
|
|
121
122
|
} = (0, _useInputAccessibility.default)({
|
|
122
|
-
id,
|
|
123
|
+
id: uniqueId,
|
|
123
124
|
error,
|
|
124
125
|
warning,
|
|
125
126
|
info,
|
|
@@ -145,7 +146,7 @@ const Textbox = ({
|
|
|
145
146
|
labelInline: computeLabelPropValues(labelInline),
|
|
146
147
|
labelSpacing: labelSpacing,
|
|
147
148
|
labelWidth: computeLabelPropValues(labelWidth),
|
|
148
|
-
id:
|
|
149
|
+
id: uniqueId,
|
|
149
150
|
reverse: computeLabelPropValues(reverse),
|
|
150
151
|
isOptional: isOptional,
|
|
151
152
|
useValidationIcon: computeLabelPropValues(validationOnLabel),
|
|
@@ -185,9 +186,9 @@ const Textbox = ({
|
|
|
185
186
|
autoFocus: autoFocus,
|
|
186
187
|
deferTimeout: deferTimeout,
|
|
187
188
|
disabled: disabled,
|
|
188
|
-
id:
|
|
189
|
+
id: uniqueId,
|
|
189
190
|
inputRef: inputRef,
|
|
190
|
-
name:
|
|
191
|
+
name: uniqueName,
|
|
191
192
|
onBlur: onBlur,
|
|
192
193
|
onChange: onChange,
|
|
193
194
|
onChangeDeferred: onChangeDeferred,
|
|
@@ -410,7 +411,5 @@ Textbox.defaultProps = {
|
|
|
410
411
|
size: "medium",
|
|
411
412
|
validationOnLabel: false
|
|
412
413
|
};
|
|
413
|
-
|
|
414
|
-
var _default = (0, _withUniqueIdProps.default)(Textbox);
|
|
415
|
-
|
|
414
|
+
var _default = Textbox;
|
|
416
415
|
exports.default = _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./tooltip";
|
|
1
|
+
export { default } from "./tooltip.component";
|
|
2
|
+
export type { TooltipProps } from "./tooltip.component";
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { Placement } from "tippy.js";
|
|
2
|
+
interface StyledTooltipPointer {
|
|
3
|
+
/** Sets position of the tooltip */
|
|
4
|
+
position?: Placement;
|
|
5
|
+
/** Defines the message type */
|
|
6
|
+
type?: string;
|
|
7
|
+
/** Override background color of the Tooltip, provide any color from palette or any valid css color value. */
|
|
8
|
+
bgColor?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const StyledTooltipPointer: import("styled-components").StyledComponent<"div", any, StyledTooltipPointer, never>;
|
|
1
11
|
export default StyledTooltipPointer;
|
|
2
|
-
declare const StyledTooltipPointer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -5,21 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
9
|
|
|
12
10
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
11
|
|
|
14
12
|
var _color = require("../../style/utils/color");
|
|
15
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
16
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
17
17
|
|
|
18
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const pointerColor = (type, theme, bgColor) => {
|
|
20
|
+
const pointerColor = (theme, bgColor, type) => {
|
|
23
21
|
if (bgColor) return (0, _color.toColor)(theme, bgColor);
|
|
24
22
|
return type === "error" ? "var(--colorsSemanticNegative500)" : "var(--colorsSemanticNeutral500)";
|
|
25
23
|
};
|
|
@@ -38,7 +36,7 @@ const StyledTooltipPointer = _styledComponents.default.div`
|
|
|
38
36
|
${position === "top" && (0, _styledComponents.css)`
|
|
39
37
|
border-left: 8px solid transparent;
|
|
40
38
|
border-right: 8px solid transparent;
|
|
41
|
-
border-top: 8px solid ${pointerColor(
|
|
39
|
+
border-top: 8px solid ${pointerColor(theme, bgColor, type)};
|
|
42
40
|
bottom: calc(-1 * var(--spacing100));
|
|
43
41
|
@-moz-document url-prefix() {
|
|
44
42
|
bottom: -7px;
|
|
@@ -48,7 +46,7 @@ const StyledTooltipPointer = _styledComponents.default.div`
|
|
|
48
46
|
${position === "bottom" && (0, _styledComponents.css)`
|
|
49
47
|
border-left: 8px solid transparent;
|
|
50
48
|
border-right: 8px solid transparent;
|
|
51
|
-
border-bottom: 8px solid ${pointerColor(
|
|
49
|
+
border-bottom: 8px solid ${pointerColor(theme, bgColor, type)};
|
|
52
50
|
top: calc(-1 * var(--spacing100));
|
|
53
51
|
@-moz-document url-prefix() {
|
|
54
52
|
top: -7px;
|
|
@@ -58,7 +56,7 @@ const StyledTooltipPointer = _styledComponents.default.div`
|
|
|
58
56
|
${position === "right" && (0, _styledComponents.css)`
|
|
59
57
|
border-top: 8px solid transparent;
|
|
60
58
|
border-bottom: 8px solid transparent;
|
|
61
|
-
border-right: 8px solid ${pointerColor(
|
|
59
|
+
border-right: 8px solid ${pointerColor(theme, bgColor, type)};
|
|
62
60
|
left: calc(-1 * var(--spacing100));
|
|
63
61
|
@-moz-document url-prefix() {
|
|
64
62
|
left: -7px;
|
|
@@ -68,7 +66,7 @@ const StyledTooltipPointer = _styledComponents.default.div`
|
|
|
68
66
|
${position === "left" && (0, _styledComponents.css)`
|
|
69
67
|
border-top: 8px solid transparent;
|
|
70
68
|
border-bottom: 8px solid transparent;
|
|
71
|
-
border-left: 8px solid ${pointerColor(
|
|
69
|
+
border-left: 8px solid ${pointerColor(theme, bgColor, type)};
|
|
72
70
|
right: calc(-1 * var(--spacing100));
|
|
73
71
|
@-moz-document url-prefix() {
|
|
74
72
|
right: -7px;
|
|
@@ -80,11 +78,5 @@ StyledTooltipPointer.defaultProps = {
|
|
|
80
78
|
theme: _base.default,
|
|
81
79
|
position: "top"
|
|
82
80
|
};
|
|
83
|
-
StyledTooltipPointer.propTypes = {
|
|
84
|
-
position: _propTypes.default.oneOf(["bottom", "left", "right", "top"]),
|
|
85
|
-
theme: _propTypes.default.object,
|
|
86
|
-
type: _propTypes.default.string,
|
|
87
|
-
bgColor: _propTypes.default.string
|
|
88
|
-
};
|
|
89
81
|
var _default = StyledTooltipPointer;
|
|
90
82
|
exports.default = _default;
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
export default Tooltip;
|
|
2
|
-
declare const Tooltip: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
1
|
import React from "react";
|
|
2
|
+
import { TooltipPositions } from "./tooltip.config";
|
|
3
|
+
export declare type InputSizes = "small" | "medium" | "large";
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
/** The message to be displayed within the tooltip */
|
|
6
|
+
message: React.ReactNode;
|
|
7
|
+
/** The id attribute to use for the tooltip */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Whether to to show the Tooltip */
|
|
10
|
+
isVisible?: boolean;
|
|
11
|
+
/** Sets position of the tooltip */
|
|
12
|
+
position?: TooltipPositions;
|
|
13
|
+
/** Defines the message type */
|
|
14
|
+
type?: string;
|
|
15
|
+
/** Children elements */
|
|
16
|
+
children: React.ReactElement;
|
|
17
|
+
/** Defines the size of the tooltip content */
|
|
18
|
+
size?: "medium" | "large";
|
|
19
|
+
/** Override background color of the Tooltip, provide any color from palette or any valid css color value. */
|
|
20
|
+
bgColor?: string;
|
|
21
|
+
/** Override font color of the Tooltip, provide any color from palette or any valid css color value. */
|
|
22
|
+
fontColor?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Overrides the default flip behaviour of the Tooltip,
|
|
25
|
+
* must be an array containing some or all of ["top", "bottom", "left", "right"]
|
|
26
|
+
* (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
|
|
27
|
+
*/
|
|
28
|
+
flipOverrides?: TooltipPositions[];
|
|
29
|
+
target?: Element;
|
|
30
|
+
isPartOfInput?: boolean;
|
|
31
|
+
inputSize?: InputSizes;
|
|
32
|
+
}
|
|
33
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement | null>>;
|
|
34
|
+
export default Tooltip;
|
|
@@ -1,158 +1,249 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
exports.default = exports.Tooltip = void 0;
|
|
9
8
|
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _headless = _interopRequireDefault(require("@tippyjs/react/headless"));
|
|
13
13
|
|
|
14
14
|
var _tippy = require("tippy.js");
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _tooltipPointer = _interopRequireDefault(require("./tooltip-pointer.style"));
|
|
19
|
-
|
|
20
|
-
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
21
|
-
|
|
22
|
-
var _carbonScopedTokensProvider = _interopRequireDefault(require("../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
var _invariant = _interopRequireDefault(require("invariant"));
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
var _tooltip = _interopRequireDefault(require("./tooltip.style"));
|
|
29
19
|
|
|
30
|
-
|
|
20
|
+
var _tooltipPointer = _interopRequireDefault(
|
|
21
|
+
require("./tooltip-pointer.style")
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
var _tooltip2 = require("./tooltip.config");
|
|
25
|
+
|
|
26
|
+
var _tags = _interopRequireDefault(
|
|
27
|
+
require("../../__internal__/utils/helpers/tags/tags")
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
var _carbonScopedTokensProvider = _interopRequireDefault(
|
|
31
|
+
require("../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component")
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
function _interopRequireDefault(obj) {
|
|
35
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _extends() {
|
|
39
|
+
_extends =
|
|
40
|
+
Object.assign ||
|
|
41
|
+
function (target) {
|
|
42
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
43
|
+
var source = arguments[i];
|
|
44
|
+
for (var key in source) {
|
|
45
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
46
|
+
target[key] = source[key];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return target;
|
|
51
|
+
};
|
|
52
|
+
return _extends.apply(this, arguments);
|
|
53
|
+
}
|
|
31
54
|
|
|
32
55
|
const TOOLTIP_DELAY = 100;
|
|
33
56
|
const tippyPlugins = [_tippy.sticky];
|
|
34
57
|
|
|
35
|
-
const Tooltip = /*#__PURE__*/_react.default.forwardRef(
|
|
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
|
-
|
|
58
|
+
const Tooltip = /*#__PURE__*/ _react.default.forwardRef(
|
|
59
|
+
(
|
|
60
|
+
{
|
|
61
|
+
children,
|
|
62
|
+
isVisible,
|
|
63
|
+
position = "top",
|
|
64
|
+
message,
|
|
65
|
+
type,
|
|
66
|
+
size = "medium",
|
|
67
|
+
isPartOfInput,
|
|
68
|
+
inputSize,
|
|
69
|
+
id,
|
|
70
|
+
bgColor,
|
|
71
|
+
fontColor,
|
|
72
|
+
flipOverrides,
|
|
73
|
+
target,
|
|
74
|
+
...rest
|
|
75
|
+
},
|
|
76
|
+
ref
|
|
77
|
+
) => {
|
|
78
|
+
const isFlipOverridesValid =
|
|
79
|
+
!flipOverrides ||
|
|
80
|
+
(Array.isArray(flipOverrides) &&
|
|
81
|
+
flipOverrides.every((placement) =>
|
|
82
|
+
_tooltip2.TOOLTIP_POSITIONS.includes(placement)
|
|
83
|
+
));
|
|
84
|
+
(0, _invariant.default)(
|
|
85
|
+
isFlipOverridesValid,
|
|
86
|
+
`The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].`
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const tooltip = (attrs, content) => {
|
|
90
|
+
const currentPosition = attrs["data-placement"] || position;
|
|
91
|
+
return /*#__PURE__*/ _react.default.createElement(
|
|
92
|
+
_carbonScopedTokensProvider.default,
|
|
93
|
+
null,
|
|
94
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
95
|
+
_tooltip.default,
|
|
96
|
+
_extends(
|
|
97
|
+
{
|
|
98
|
+
"data-element": "tooltip",
|
|
99
|
+
role: "tooltip",
|
|
100
|
+
tabIndex: -1,
|
|
101
|
+
type: type,
|
|
102
|
+
size: size,
|
|
103
|
+
id: id,
|
|
104
|
+
},
|
|
105
|
+
(0, _tags.default)("tooltip", rest),
|
|
106
|
+
{
|
|
107
|
+
isPartOfInput: isPartOfInput,
|
|
108
|
+
inputSize: inputSize,
|
|
109
|
+
},
|
|
110
|
+
attrs,
|
|
111
|
+
{
|
|
112
|
+
position: currentPosition,
|
|
113
|
+
ref: ref,
|
|
114
|
+
bgColor: bgColor,
|
|
115
|
+
fontColor: fontColor,
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
119
|
+
_tooltipPointer.default,
|
|
120
|
+
_extends(
|
|
121
|
+
{
|
|
122
|
+
key: "pointer",
|
|
123
|
+
type: type,
|
|
124
|
+
},
|
|
125
|
+
attrs,
|
|
126
|
+
{
|
|
127
|
+
position: currentPosition,
|
|
128
|
+
"data-popper-arrow": "",
|
|
129
|
+
"data-element": "tooltip-pointer",
|
|
130
|
+
bgColor: bgColor,
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
content
|
|
135
|
+
)
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return /*#__PURE__*/ _react.default.createElement(
|
|
140
|
+
_headless.default,
|
|
141
|
+
_extends(
|
|
142
|
+
{
|
|
143
|
+
placement: position,
|
|
144
|
+
delay: TOOLTIP_DELAY,
|
|
145
|
+
},
|
|
146
|
+
isVisible !== undefined && {
|
|
147
|
+
visible: isVisible,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
plugins: tippyPlugins,
|
|
151
|
+
sticky: true,
|
|
152
|
+
render: (attrs) => tooltip(attrs, message),
|
|
153
|
+
reference: target,
|
|
154
|
+
popperOptions: {
|
|
155
|
+
modifiers: [
|
|
156
|
+
...(flipOverrides
|
|
157
|
+
? [
|
|
158
|
+
{
|
|
159
|
+
name: "flip",
|
|
160
|
+
options: {
|
|
161
|
+
fallbackPlacements: flipOverrides,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
]
|
|
165
|
+
: []),
|
|
166
|
+
{
|
|
167
|
+
name: "computeStyles",
|
|
168
|
+
options: {
|
|
169
|
+
gpuAcceleration: false,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
101
174
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
175
|
+
),
|
|
176
|
+
children
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
);
|
|
106
180
|
|
|
107
|
-
const placements = ["top", "bottom", "left", "right"];
|
|
108
181
|
Tooltip.propTypes = {
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/** The id attribute to use for the tooltip */
|
|
113
|
-
id: _propTypes.default.string,
|
|
114
|
-
|
|
115
|
-
/** Whether to to show the Tooltip */
|
|
116
|
-
isVisible: _propTypes.default.bool,
|
|
117
|
-
|
|
118
|
-
/** Sets position of the tooltip */
|
|
119
|
-
position: _propTypes.default.oneOf(placements),
|
|
120
|
-
|
|
121
|
-
/** Defines the message type */
|
|
122
|
-
type: _propTypes.default.string,
|
|
123
|
-
|
|
124
|
-
/** Children elements */
|
|
125
|
-
children: _propTypes.default.node.isRequired,
|
|
126
|
-
|
|
127
|
-
/** Defines the size of the tooltip content */
|
|
128
|
-
size: _propTypes.default.oneOf(["medium", "large"]),
|
|
129
|
-
// Reference element, tooltip will be positioned in relation to this element
|
|
130
|
-
target: _propTypes.default.instanceOf(Element),
|
|
131
|
-
|
|
132
|
-
/** Override background color of the Tooltip, provide design token, any color from palette or any valid css color value. */
|
|
182
|
+
/**
|
|
183
|
+
* Override background color of the Tooltip, provide any color from palette or any valid css color value.
|
|
184
|
+
*/
|
|
133
185
|
bgColor: _propTypes.default.string,
|
|
134
|
-
|
|
135
|
-
|
|
186
|
+
/**
|
|
187
|
+
* Children elements
|
|
188
|
+
*/
|
|
189
|
+
children: _propTypes.default.element.isRequired,
|
|
190
|
+
/**
|
|
191
|
+
* Overrides the default flip behaviour of the Tooltip,
|
|
192
|
+
* must be an array containing some or all of ["top", "bottom", "left", "right"]
|
|
193
|
+
* (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
|
|
194
|
+
*/
|
|
195
|
+
flipOverrides: _propTypes.default.arrayOf(
|
|
196
|
+
_propTypes.default.oneOf(["bottom", "left", "right", "top"])
|
|
197
|
+
),
|
|
198
|
+
/**
|
|
199
|
+
* Override font color of the Tooltip, provide any color from palette or any valid css color value.
|
|
200
|
+
*/
|
|
136
201
|
fontColor: _propTypes.default.string,
|
|
137
|
-
|
|
138
|
-
|
|
202
|
+
/**
|
|
203
|
+
* The id attribute to use for the tooltip
|
|
204
|
+
*/
|
|
205
|
+
id: _propTypes.default.string,
|
|
206
|
+
inputSize: _propTypes.default.oneOf(["large", "medium", "small"]),
|
|
139
207
|
isPartOfInput: _propTypes.default.bool,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
208
|
+
/**
|
|
209
|
+
* Whether to to show the Tooltip
|
|
210
|
+
*/
|
|
211
|
+
isVisible: _propTypes.default.bool,
|
|
212
|
+
key: _propTypes.default.oneOfType([
|
|
213
|
+
_propTypes.default.number,
|
|
214
|
+
_propTypes.default.string,
|
|
215
|
+
]),
|
|
216
|
+
/**
|
|
217
|
+
* The message to be displayed within the tooltip
|
|
218
|
+
*/
|
|
219
|
+
message: _propTypes.default.node,
|
|
220
|
+
/**
|
|
221
|
+
* Sets position of the tooltip
|
|
222
|
+
*/
|
|
223
|
+
position: _propTypes.default.oneOf(["bottom", "left", "right", "top"]),
|
|
224
|
+
/**
|
|
225
|
+
* Defines the size of the tooltip content
|
|
226
|
+
*/
|
|
227
|
+
size: _propTypes.default.oneOf(["large", "medium"]),
|
|
228
|
+
target: function (props, propName) {
|
|
229
|
+
if (props[propName] == null) {
|
|
150
230
|
return null;
|
|
231
|
+
} else if (
|
|
232
|
+
typeof props[propName] !== "object" ||
|
|
233
|
+
props[propName].nodeType !== 1
|
|
234
|
+
) {
|
|
235
|
+
return new Error(
|
|
236
|
+
"Expected prop '" + propName + "' to be of type Element"
|
|
237
|
+
);
|
|
151
238
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* Defines the message type
|
|
242
|
+
*/
|
|
243
|
+
type: _propTypes.default.string,
|
|
156
244
|
};
|
|
245
|
+
|
|
246
|
+
exports.Tooltip = Tooltip;
|
|
247
|
+
Tooltip.displayName = "Tooltip";
|
|
157
248
|
var _default = Tooltip;
|
|
158
|
-
exports.default = _default;
|
|
249
|
+
exports.default = _default;
|
|
@@ -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;
|