@pagopa/io-app-design-system 3.0.1 → 4.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/lib/commonjs/components/alert/Alert.js +1 -2
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js +2 -2
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/commonjs/components/banner/Banner.js +1 -1
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/lib/commonjs/components/buttons/ButtonLink.js +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +3 -2
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +1 -0
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -2
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +2 -2
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/lib/commonjs/components/modules/ModuleAttachment.js +1 -1
- package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleNavigation.js +3 -2
- package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +2 -2
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleSummary.js +1 -1
- package/lib/commonjs/components/modules/ModuleSummary.js.map +1 -1
- package/lib/commonjs/components/otpInput/BoxedInput.js +4 -6
- package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/commonjs/components/otpInput/OTPInput.js +5 -4
- package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +1 -1
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +2 -2
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/tooltip/Arrows.js +49 -0
- package/lib/commonjs/components/tooltip/Arrows.js.map +1 -0
- package/lib/commonjs/components/tooltip/Tooltip.js +174 -0
- package/lib/commonjs/components/tooltip/Tooltip.js.map +1 -0
- package/lib/commonjs/components/tooltip/index.js +17 -0
- package/lib/commonjs/components/tooltip/index.js.map +1 -0
- package/lib/commonjs/components/tooltip/styles.js +50 -0
- package/lib/commonjs/components/tooltip/styles.js.map +1 -0
- package/lib/commonjs/components/tooltip/utils/index.js +180 -0
- package/lib/commonjs/components/tooltip/utils/index.js.map +1 -0
- package/lib/commonjs/components/tooltip/utils/types.js +2 -0
- package/lib/commonjs/components/tooltip/utils/types.js.map +1 -0
- package/lib/commonjs/components/typography/{LabelSmall.js → BodySmall.js} +8 -10
- package/lib/commonjs/components/typography/BodySmall.js.map +1 -0
- package/lib/commonjs/components/typography/ButtonText.js +1 -3
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +3 -6
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +4 -5
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/lib/commonjs/components/typography/__test__/typography.test.js +6 -18
- package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/commonjs/components/typography/index.js +28 -72
- package/lib/commonjs/components/typography/index.js.map +1 -1
- package/lib/module/components/alert/Alert.js +2 -3
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/alert/AlertEdgeToEdge.js +2 -2
- package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/module/components/banner/Banner.js +2 -2
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/lib/module/components/buttons/ButtonLink.js +1 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +1 -1
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/lib/module/components/featureInfo/FeatureInfo.js +4 -3
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/layout/HeaderFirstLevel.js +1 -0
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +2 -2
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +2 -2
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +2 -2
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +2 -2
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +2 -2
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +2 -2
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +3 -3
- package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemSwitch.js +2 -2
- package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +3 -3
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/lib/module/components/modules/ModuleAttachment.js +2 -2
- package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/module/components/modules/ModuleCheckout.js +2 -2
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/modules/ModuleCredential.js +2 -2
- package/lib/module/components/modules/ModuleCredential.js.map +1 -1
- package/lib/module/components/modules/ModuleNavigation.js +4 -3
- package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/module/components/modules/ModulePaymentNotice.js +3 -3
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/modules/ModuleSummary.js +2 -2
- package/lib/module/components/modules/ModuleSummary.js.map +1 -1
- package/lib/module/components/otpInput/BoxedInput.js +5 -7
- package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/module/components/otpInput/OTPInput.js +5 -4
- package/lib/module/components/otpInput/OTPInput.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +2 -2
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +3 -3
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/tooltip/Arrows.js +36 -0
- package/lib/module/components/tooltip/Arrows.js.map +1 -0
- package/lib/module/components/tooltip/Tooltip.js +165 -0
- package/lib/module/components/tooltip/Tooltip.js.map +1 -0
- package/lib/module/components/tooltip/index.js +2 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/tooltip/styles.js +43 -0
- package/lib/module/components/tooltip/styles.js.map +1 -0
- package/lib/module/components/tooltip/utils/index.js +163 -0
- package/lib/module/components/tooltip/utils/index.js.map +1 -0
- package/lib/module/components/tooltip/utils/types.js +2 -0
- package/lib/module/components/tooltip/utils/types.js.map +1 -0
- package/lib/module/components/typography/{LabelSmall.js → BodySmall.js} +6 -8
- package/lib/module/components/typography/BodySmall.js.map +1 -0
- package/lib/module/components/typography/ButtonText.js +1 -3
- package/lib/module/components/typography/ButtonText.js.map +1 -1
- package/lib/module/components/typography/H3.js +3 -6
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H6.js +4 -5
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/lib/module/components/typography/__test__/typography.test.js +6 -18
- package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/module/components/typography/index.js +6 -10
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/Arrows.d.ts +14 -0
- package/lib/typescript/components/tooltip/Arrows.d.ts.map +1 -0
- package/lib/typescript/components/tooltip/Tooltip.d.ts +64 -0
- package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -0
- package/lib/typescript/components/tooltip/index.d.ts +2 -0
- package/lib/typescript/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/components/tooltip/styles.d.ts +41 -0
- package/lib/typescript/components/tooltip/styles.d.ts.map +1 -0
- package/lib/typescript/components/tooltip/utils/index.d.ts +89 -0
- package/lib/typescript/components/tooltip/utils/index.d.ts.map +1 -0
- package/lib/typescript/components/tooltip/utils/types.d.ts +10 -0
- package/lib/typescript/components/tooltip/utils/types.d.ts.map +1 -0
- package/lib/typescript/components/typography/Body.d.ts +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/BodySmall.d.ts +13 -0
- package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -0
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts +2 -0
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
- package/lib/typescript/components/typography/index.d.ts +6 -10
- package/lib/typescript/components/typography/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/alert/Alert.tsx +3 -4
- package/src/components/alert/AlertEdgeToEdge.tsx +3 -3
- package/src/components/banner/Banner.tsx +7 -5
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/src/components/buttons/ButtonLink.tsx +1 -1
- package/src/components/buttons/ButtonOutline.tsx +1 -1
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/src/components/featureInfo/FeatureInfo.tsx +6 -6
- package/src/components/index.tsx +1 -0
- package/src/components/layout/HeaderFirstLevel.tsx +1 -0
- package/src/components/listitems/ListItemCheckbox.tsx +3 -3
- package/src/components/listitems/ListItemInfo.tsx +3 -3
- package/src/components/listitems/ListItemInfoCopy.tsx +3 -3
- package/src/components/listitems/ListItemNav.tsx +3 -3
- package/src/components/listitems/ListItemNavAlert.tsx +3 -3
- package/src/components/listitems/ListItemRadio.tsx +3 -3
- package/src/components/listitems/ListItemRadioWithAmount.tsx +5 -5
- package/src/components/listitems/ListItemSwitch.tsx +4 -4
- package/src/components/listitems/ListItemTransaction.tsx +5 -5
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/src/components/modules/ModuleAttachment.tsx +3 -3
- package/src/components/modules/ModuleCheckout.tsx +3 -3
- package/src/components/modules/ModuleCredential.tsx +3 -3
- package/src/components/modules/ModuleNavigation.tsx +6 -4
- package/src/components/modules/ModulePaymentNotice.tsx +5 -5
- package/src/components/modules/ModuleSummary.tsx +3 -3
- package/src/components/otpInput/BoxedInput.tsx +6 -5
- package/src/components/otpInput/OTPInput.tsx +23 -8
- package/src/components/tabs/TabItem.tsx +3 -3
- package/src/components/textInput/TextInputBase.tsx +5 -5
- package/src/components/tooltip/Arrows.tsx +36 -0
- package/src/components/tooltip/Tooltip.tsx +313 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/styles.ts +44 -0
- package/src/components/tooltip/utils/index.ts +179 -0
- package/src/components/tooltip/utils/types.ts +9 -0
- package/src/components/typography/Body.tsx +1 -1
- package/src/components/typography/{LabelSmall.tsx → BodySmall.tsx} +7 -14
- package/src/components/typography/ButtonText.tsx +2 -4
- package/src/components/typography/H3.tsx +11 -8
- package/src/components/typography/H6.tsx +5 -6
- package/src/components/typography/LabelMini.tsx +1 -1
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/src/components/typography/__test__/typography.test.tsx +8 -24
- package/src/components/typography/index.tsx +6 -10
- package/lib/commonjs/components/typography/BaseTypography.js +0 -52
- package/lib/commonjs/components/typography/BaseTypography.js.map +0 -1
- package/lib/commonjs/components/typography/Chip.js +0 -41
- package/lib/commonjs/components/typography/Chip.js.map +0 -1
- package/lib/commonjs/components/typography/Factory.js +0 -62
- package/lib/commonjs/components/typography/Factory.js.map +0 -1
- package/lib/commonjs/components/typography/Label.js +0 -51
- package/lib/commonjs/components/typography/Label.js.map +0 -1
- package/lib/commonjs/components/typography/LabelSmall.js.map +0 -1
- package/lib/module/components/typography/BaseTypography.js +0 -44
- package/lib/module/components/typography/BaseTypography.js.map +0 -1
- package/lib/module/components/typography/Chip.js +0 -32
- package/lib/module/components/typography/Chip.js.map +0 -1
- package/lib/module/components/typography/Factory.js +0 -55
- package/lib/module/components/typography/Factory.js.map +0 -1
- package/lib/module/components/typography/Label.js +0 -42
- package/lib/module/components/typography/Label.js.map +0 -1
- package/lib/module/components/typography/LabelSmall.js.map +0 -1
- package/lib/typescript/components/typography/BaseTypography.d.ts +0 -29
- package/lib/typescript/components/typography/BaseTypography.d.ts.map +0 -1
- package/lib/typescript/components/typography/Chip.d.ts +0 -13
- package/lib/typescript/components/typography/Chip.d.ts.map +0 -1
- package/lib/typescript/components/typography/Factory.d.ts +0 -43
- package/lib/typescript/components/typography/Factory.d.ts.map +0 -1
- package/lib/typescript/components/typography/Label.d.ts +0 -13
- package/lib/typescript/components/typography/Label.d.ts.map +0 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts +0 -13
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +0 -1
- package/src/components/typography/BaseTypography.tsx +0 -71
- package/src/components/typography/Chip.tsx +0 -33
- package/src/components/typography/Factory.tsx +0 -98
- package/src/components/typography/Label.tsx +0 -62
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Tooltip = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _core = require("../../core");
|
|
12
|
+
var _typography = require("../typography");
|
|
13
|
+
var _buttons = require("../buttons");
|
|
14
|
+
var _Arrows = require("./Arrows");
|
|
15
|
+
var _utils = require("./utils");
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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
|
+
const screenDimensions = _reactNative.Dimensions.get("window");
|
|
20
|
+
const INITIAL_COORDS = {
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0,
|
|
23
|
+
width: 0,
|
|
24
|
+
height: 0
|
|
25
|
+
};
|
|
26
|
+
const ARROWS_BY_PLACEMENT = {
|
|
27
|
+
top: _Arrows.TopArrow,
|
|
28
|
+
bottom: _Arrows.BottomArrow,
|
|
29
|
+
left: _Arrows.LeftArrow,
|
|
30
|
+
right: _Arrows.RightArrow
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip component that displays a contextual tooltip around its children.
|
|
34
|
+
* The tooltip position is controlled by the `placement` prop and can adjust
|
|
35
|
+
* dynamically if there is insufficient space.
|
|
36
|
+
* @param {Props} props - The component props
|
|
37
|
+
*
|
|
38
|
+
* @returns {ReactElement} A tooltip component rendered around the specified children.
|
|
39
|
+
*/
|
|
40
|
+
const Tooltip = ({
|
|
41
|
+
children,
|
|
42
|
+
title,
|
|
43
|
+
content,
|
|
44
|
+
placement: initialPlacement = "top",
|
|
45
|
+
closeIconAccessibilityLabel,
|
|
46
|
+
isVisible,
|
|
47
|
+
displayInsets = {},
|
|
48
|
+
allowCloseOnBackgroundTap,
|
|
49
|
+
childrenInteractionsEnabled = false,
|
|
50
|
+
onClose
|
|
51
|
+
}) => {
|
|
52
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
53
|
+
const [currentPlacement, setCurrentPlacement] = (0, _react.useState)(initialPlacement);
|
|
54
|
+
const [childrenCoords, setChildrenCoords] = (0, _react.useState)(INITIAL_COORDS);
|
|
55
|
+
const [tooltipLayout, setTooltipLayout] = (0, _react.useState)();
|
|
56
|
+
const childRef = (0, _react.useRef)(null);
|
|
57
|
+
const titleRef = (0, _react.useRef)(null);
|
|
58
|
+
const timeoutRef = (0, _react.useRef)();
|
|
59
|
+
const Arrow = (0, _react.useMemo)(() => ARROWS_BY_PLACEMENT[currentPlacement], [currentPlacement]);
|
|
60
|
+
const isChildrenMeasurementFinished = (0, _lodash.every)(childrenCoords, _utils.isDefined) && (0, _lodash.some)(childrenCoords, _utils.isNotZero);
|
|
61
|
+
const isTooltipMeasurementCompleted = (0, _utils.isDefined)(tooltipLayout);
|
|
62
|
+
const tooltipVisibility = {
|
|
63
|
+
opacity: isTooltipMeasurementCompleted ? 1 : 0
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* This function sets the `Tooltip` children coordinates
|
|
68
|
+
*/
|
|
69
|
+
const measureChildrenCoords = (0, _react.useCallback)(() => {
|
|
70
|
+
if (childRef.current && typeof childRef.current.measure === "function") {
|
|
71
|
+
childRef.current.measure((_, __, width, height, px, py) => {
|
|
72
|
+
const coords = {
|
|
73
|
+
x: px,
|
|
74
|
+
y: py,
|
|
75
|
+
width,
|
|
76
|
+
height
|
|
77
|
+
};
|
|
78
|
+
if ((0, _lodash.every)(coords, _utils.isDefined)) {
|
|
79
|
+
setChildrenCoords(coords);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, []);
|
|
84
|
+
(0, _react.useEffect)(() => {
|
|
85
|
+
if (isVisible) {
|
|
86
|
+
// A new measure is executed every time the `Tooltip` is visible
|
|
87
|
+
// This is required for use within ScrollView components.
|
|
88
|
+
// eslint-disable-next-line functional/immutable-data
|
|
89
|
+
timeoutRef.current = setTimeout(measureChildrenCoords, 100);
|
|
90
|
+
} else {
|
|
91
|
+
setChildrenCoords(INITIAL_COORDS);
|
|
92
|
+
setCurrentPlacement(initialPlacement);
|
|
93
|
+
}
|
|
94
|
+
return () => {
|
|
95
|
+
if (isVisible) {
|
|
96
|
+
clearTimeout(timeoutRef.current);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}, [isVisible, initialPlacement, measureChildrenCoords]);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* This function works with `top` and `bottom` placement and sets the current placement to their opposite value
|
|
103
|
+
* if in the selected one there is no space to prompt the tooltip
|
|
104
|
+
*/
|
|
105
|
+
const invertPlacementIfNeeded = (0, _react.useCallback)(nativeEvent => {
|
|
106
|
+
if (initialPlacement === "top") {
|
|
107
|
+
const hasSpace = nativeEvent.layout.y >= insets.top;
|
|
108
|
+
if (!hasSpace) {
|
|
109
|
+
setCurrentPlacement("bottom");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (initialPlacement === "bottom") {
|
|
113
|
+
const remainingSpace = screenDimensions.height - nativeEvent.layout.y - insets.bottom;
|
|
114
|
+
const tooltipMinHeight = nativeEvent.layout.height + _utils.ARROW_HEIGHT + _utils.EMPTY_SPACE;
|
|
115
|
+
const hasSpace = remainingSpace >= tooltipMinHeight;
|
|
116
|
+
if (!hasSpace) {
|
|
117
|
+
setCurrentPlacement("top");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [insets.bottom, insets.top, initialPlacement]);
|
|
121
|
+
const handleTooltipOnLayout = (0, _react.useCallback)(({
|
|
122
|
+
nativeEvent
|
|
123
|
+
}) => {
|
|
124
|
+
invertPlacementIfNeeded(nativeEvent);
|
|
125
|
+
setTooltipLayout(nativeEvent.layout);
|
|
126
|
+
}, [invertPlacementIfNeeded]);
|
|
127
|
+
const handleTapOnBackground = (0, _react.useCallback)(() => {
|
|
128
|
+
if (allowCloseOnBackgroundTap) {
|
|
129
|
+
onClose();
|
|
130
|
+
}
|
|
131
|
+
}, [allowCloseOnBackgroundTap, onClose]);
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View
|
|
133
|
+
// This prop is necessary for .measure to work correctly, as explained here: https://github.com/facebook/react-native/issues/29712
|
|
134
|
+
, {
|
|
135
|
+
collapsable: false,
|
|
136
|
+
ref: childRef
|
|
137
|
+
}, children), /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
|
|
138
|
+
transparent: true,
|
|
139
|
+
visible: isVisible && isChildrenMeasurementFinished
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
141
|
+
accessibilityElementsHidden: !childrenInteractionsEnabled,
|
|
142
|
+
importantForAccessibility: childrenInteractionsEnabled ? 'auto' : 'no-hide-descendants',
|
|
143
|
+
pointerEvents: childrenInteractionsEnabled ? "auto" : "box-only",
|
|
144
|
+
style: [_styles.tooltipStyles.childrenContainer, (0, _styles.getChildrenPosition)(childrenCoords)]
|
|
145
|
+
}, children), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
146
|
+
accessible: allowCloseOnBackgroundTap,
|
|
147
|
+
accessibilityRole: allowCloseOnBackgroundTap ? "button" : "none",
|
|
148
|
+
importantForAccessibility: allowCloseOnBackgroundTap ? 'yes' : 'no',
|
|
149
|
+
accessibilityElementsHidden: !allowCloseOnBackgroundTap,
|
|
150
|
+
onPress: handleTapOnBackground
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
152
|
+
style: [_styles.tooltipStyles.overlay, {
|
|
153
|
+
height: screenDimensions.height
|
|
154
|
+
}]
|
|
155
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
156
|
+
onLayout: handleTooltipOnLayout,
|
|
157
|
+
style: [_styles.tooltipStyles.tooltipContainer, (0, _utils.getTooltipCoords)(currentPlacement, childrenCoords, (0, _utils.getDisplayInsets)(displayInsets), screenDimensions), (0, _utils.getTooltipVerticalAlignment)(currentPlacement, childrenCoords.height, tooltipLayout === null || tooltipLayout === void 0 ? void 0 : tooltipLayout.height), tooltipVisibility]
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_typography.H6, {
|
|
159
|
+
ref: titleRef
|
|
160
|
+
}, title), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
161
|
+
style: _styles.tooltipStyles.closeIcon
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_buttons.IconButton, {
|
|
163
|
+
color: "neutral",
|
|
164
|
+
icon: "closeSmall",
|
|
165
|
+
accessibilityLabel: closeIconAccessibilityLabel,
|
|
166
|
+
onPress: onClose
|
|
167
|
+
})), /*#__PURE__*/_react.default.createElement(_typography.Body, null, content)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
168
|
+
style: [_styles.tooltipStyles.arrowContainer, (0, _utils.getArrowBoxByPlacement)(currentPlacement), (0, _utils.getArrowCoords)(currentPlacement, childrenCoords, screenDimensions), (0, _utils.getArrowVerticalAlignment)(currentPlacement, childrenCoords.height), tooltipVisibility]
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement(Arrow, {
|
|
170
|
+
color: _core.IOColors.white
|
|
171
|
+
}))));
|
|
172
|
+
};
|
|
173
|
+
exports.Tooltip = Tooltip;
|
|
174
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_lodash","_core","_typography","_buttons","_Arrows","_utils","_styles","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","screenDimensions","Dimensions","INITIAL_COORDS","x","y","width","height","ARROWS_BY_PLACEMENT","top","TopArrow","bottom","BottomArrow","left","LeftArrow","right","RightArrow","Tooltip","children","title","content","placement","initialPlacement","closeIconAccessibilityLabel","isVisible","displayInsets","allowCloseOnBackgroundTap","childrenInteractionsEnabled","onClose","insets","useSafeAreaInsets","currentPlacement","setCurrentPlacement","useState","childrenCoords","setChildrenCoords","tooltipLayout","setTooltipLayout","childRef","useRef","titleRef","timeoutRef","Arrow","useMemo","isChildrenMeasurementFinished","every","isDefined","some","isNotZero","isTooltipMeasurementCompleted","tooltipVisibility","opacity","measureChildrenCoords","useCallback","current","measure","_","__","px","py","coords","useEffect","setTimeout","clearTimeout","invertPlacementIfNeeded","nativeEvent","hasSpace","layout","remainingSpace","tooltipMinHeight","ARROW_HEIGHT","EMPTY_SPACE","handleTooltipOnLayout","handleTapOnBackground","createElement","Fragment","View","collapsable","ref","Modal","transparent","visible","accessibilityElementsHidden","importantForAccessibility","pointerEvents","style","tooltipStyles","childrenContainer","getChildrenPosition","TouchableWithoutFeedback","accessible","accessibilityRole","onPress","overlay","onLayout","tooltipContainer","getTooltipCoords","getDisplayInsets","getTooltipVerticalAlignment","H6","closeIcon","IconButton","color","icon","accessibilityLabel","Body","arrowContainer","getArrowBoxByPlacement","getArrowCoords","getArrowVerticalAlignment","IOColors","white","exports"],"sourceRoot":"../../../../src","sources":["components/tooltip/Tooltip.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAYA,IAAAS,OAAA,GAAAT,OAAA;AAA8D,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAgB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,I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,EAAEtC;EAAS,GAAErB,KAAU,CAAC,eAC/BpD,MAAA,CAAAmB,OAAA,CAAAwF,aAAA,CAACxG,YAAA,CAAA0G,IAAI;IAACS,KAAK,EAAEC,qBAAa,CAACc;EAAU,gBACnCrI,MAAA,CAAAmB,OAAA,CAAAwF,aAAA,CAACnG,QAAA,CAAA8H,UAAU;IACTC,KAAK,EAAC,SAAS;IACfC,IAAI,EAAC,YAAY;IACjBC,kBAAkB,EAAEjF,2BAA4B;IAChDqE,OAAO,EAAEhE;EAAQ,CAClB,CACG,CAAC,eACP7D,MAAA,CAAAmB,OAAA,CAAAwF,aAAA,CAACpG,WAAA,CAAAmI,IAAI,QAAErF,OAAc,CACjB,CAAC,eACPrD,MAAA,CAAAmB,OAAA,CAAAwF,aAAA,CAACxG,YAAA,CAAA0G,IAAI;IACHS,KAAK,EAAE,CACLC,qBAAa,CAACoB,cAAc,EAC5B,IAAAC,6BAAsB,EAAC5E,gBAAgB,CAAC,EACxC,IAAA6E,qBAAc,EACZ7E,gBAAgB,EAChBG,cAAc,EACdjC,gBACF,CAAC,EACD,IAAA4G,gCAAyB,EAAC9E,gBAAgB,EAAEG,cAAc,CAAC3B,MAAM,CAAC,EAClE2C,iBAAiB;EACjB,gBAEFnF,MAAA,CAAAmB,OAAA,CAAAwF,aAAA,CAAChC,KAAK;IAAC4D,KAAK,EAAEQ,cAAQ,CAACC;EAAM,CAAE,CAC3B,CACD,CACP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA/F,OAAA,GAAAA,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Tooltip = require("./Tooltip");
|
|
7
|
+
Object.keys(_Tooltip).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Tooltip[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Tooltip[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Tooltip","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../src","sources":["components/tooltip/index.ts"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.tooltipStyles = exports.getChildrenPosition = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _core = require("../../core");
|
|
9
|
+
const tooltipStyles = _reactNative.StyleSheet.create({
|
|
10
|
+
overlay: {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "100%",
|
|
14
|
+
backgroundColor: _core.IOColors["grey-850"],
|
|
15
|
+
opacity: 0.6,
|
|
16
|
+
zIndex: 997
|
|
17
|
+
},
|
|
18
|
+
childrenContainer: {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
zIndex: 1000
|
|
21
|
+
},
|
|
22
|
+
tooltipContainer: {
|
|
23
|
+
position: "absolute",
|
|
24
|
+
paddingHorizontal: 16,
|
|
25
|
+
paddingVertical: 16,
|
|
26
|
+
backgroundColor: _core.IOColors.white,
|
|
27
|
+
borderRadius: 8,
|
|
28
|
+
zIndex: 2000,
|
|
29
|
+
overflow: "visible"
|
|
30
|
+
},
|
|
31
|
+
arrowContainer: {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
display: 'flex',
|
|
34
|
+
zIndex: 3000
|
|
35
|
+
},
|
|
36
|
+
closeIcon: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
right: 8,
|
|
39
|
+
top: 9 // It's been used `9` instead of `8` to fix accessibility focus order. In this way title is read before close icon.
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
exports.tooltipStyles = tooltipStyles;
|
|
43
|
+
const getChildrenPosition = childrenCoords => ({
|
|
44
|
+
top: childrenCoords.y,
|
|
45
|
+
left: childrenCoords.x,
|
|
46
|
+
width: childrenCoords.width,
|
|
47
|
+
height: childrenCoords.height
|
|
48
|
+
});
|
|
49
|
+
exports.getChildrenPosition = getChildrenPosition;
|
|
50
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_core","tooltipStyles","StyleSheet","create","overlay","position","width","height","backgroundColor","IOColors","opacity","zIndex","childrenContainer","tooltipContainer","paddingHorizontal","paddingVertical","white","borderRadius","overflow","arrowContainer","display","closeIcon","right","top","exports","getChildrenPosition","childrenCoords","y","left","x"],"sourceRoot":"../../../../src","sources":["components/tooltip/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC7CC,OAAO,EAAE;IACPC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEC,cAAQ,CAAC,UAAU,CAAC;IACrCC,OAAO,EAAE,GAAG;IACZC,MAAM,EAAE;EACV,CAAC;EACDC,iBAAiB,EAAE;IACjBP,QAAQ,EAAE,UAAU;IACpBM,MAAM,EAAE;EACV,CAAC;EACDE,gBAAgB,EAAE;IAChBR,QAAQ,EAAE,UAAU;IACpBS,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBP,eAAe,EAAEC,cAAQ,CAACO,KAAK;IAC/BC,YAAY,EAAE,CAAC;IACfN,MAAM,EAAE,IAAI;IACZO,QAAQ,EAAE;EACZ,CAAC;EACDC,cAAc,EAAE;IACdd,QAAQ,EAAE,UAAU;IACpBe,OAAO,EAAE,MAAM;IACfT,MAAM,EAAE;EACV,CAAC;EACDU,SAAS,EAAE;IACThB,QAAQ,EAAE,UAAU;IACpBiB,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC,CAAC;EACT;AACF,CAAC,CAAC;AAACC,OAAA,CAAAvB,aAAA,GAAAA,aAAA;AAEI,MAAMwB,mBAAmB,GAAIC,cAA8B,KAAM;EACtEH,GAAG,EAAEG,cAAc,CAACC,CAAC;EACrBC,IAAI,EAAEF,cAAc,CAACG,CAAC;EACtBvB,KAAK,EAAEoB,cAAc,CAACpB,KAAK;EAC3BC,MAAM,EAAEmB,cAAc,CAACnB;AACzB,CAAC,CAAC;AAACiB,OAAA,CAAAC,mBAAA,GAAAA,mBAAA"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isNotZero = exports.isDefined = exports.getTooltipVerticalAlignment = exports.getTooltipCoords = exports.getDisplayInsets = exports.getArrowVerticalAlignment = exports.getArrowCoords = exports.getArrowBoxByPlacement = exports.EMPTY_SPACE = exports.ARROW_WIDTH = exports.ARROW_HEIGHT = void 0;
|
|
7
|
+
var _core = require("../../../core");
|
|
8
|
+
const ARROW_WIDTH = 24;
|
|
9
|
+
exports.ARROW_WIDTH = ARROW_WIDTH;
|
|
10
|
+
const ARROW_HEIGHT = 14;
|
|
11
|
+
exports.ARROW_HEIGHT = ARROW_HEIGHT;
|
|
12
|
+
const EMPTY_SPACE = 8;
|
|
13
|
+
exports.EMPTY_SPACE = EMPTY_SPACE;
|
|
14
|
+
const DEFAULT_INSETS = {
|
|
15
|
+
top: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
left: _core.IOVisualCostants.appMarginDefault,
|
|
18
|
+
right: _core.IOVisualCostants.appMarginDefault
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param displayInsets custom display insets
|
|
23
|
+
* @returns An `object` based on `DEFAULT_INSETS` and `displayInsets`
|
|
24
|
+
*/
|
|
25
|
+
const getDisplayInsets = displayInsets => ({
|
|
26
|
+
...DEFAULT_INSETS,
|
|
27
|
+
...displayInsets
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param placement The `Tooltip` placement
|
|
33
|
+
* @returns The `Arrow` box `width` and `height` based on `placement` value
|
|
34
|
+
*/
|
|
35
|
+
exports.getDisplayInsets = getDisplayInsets;
|
|
36
|
+
const getArrowBoxByPlacement = placement => {
|
|
37
|
+
switch (placement) {
|
|
38
|
+
case 'left':
|
|
39
|
+
case 'right':
|
|
40
|
+
return {
|
|
41
|
+
width: ARROW_HEIGHT,
|
|
42
|
+
height: ARROW_WIDTH
|
|
43
|
+
};
|
|
44
|
+
default:
|
|
45
|
+
return {
|
|
46
|
+
height: ARROW_HEIGHT,
|
|
47
|
+
width: ARROW_WIDTH
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A utility function to calculate the `Tooltip` coordinates and dimensions
|
|
54
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
55
|
+
* @param childrenCoords The measures in screen of the `Tooltip` children
|
|
56
|
+
* @param displayInsets The active display insets
|
|
57
|
+
* @param screenDimensions The dimensions of the device screen
|
|
58
|
+
* @returns The `Tooltip` coordinates
|
|
59
|
+
*/
|
|
60
|
+
exports.getArrowBoxByPlacement = getArrowBoxByPlacement;
|
|
61
|
+
const getTooltipCoords = (placement, childrenCoords, displayInsets, screenDimensions) => {
|
|
62
|
+
const {
|
|
63
|
+
width: screenWidth,
|
|
64
|
+
height: screenHeight
|
|
65
|
+
} = screenDimensions;
|
|
66
|
+
switch (placement) {
|
|
67
|
+
case "top":
|
|
68
|
+
return {
|
|
69
|
+
bottom: screenHeight - childrenCoords.y + ARROW_HEIGHT + EMPTY_SPACE,
|
|
70
|
+
left: displayInsets.left,
|
|
71
|
+
width: screenWidth - displayInsets.left - displayInsets.right
|
|
72
|
+
};
|
|
73
|
+
case "bottom":
|
|
74
|
+
return {
|
|
75
|
+
top: childrenCoords.y + childrenCoords.height + ARROW_HEIGHT + EMPTY_SPACE,
|
|
76
|
+
left: displayInsets.left,
|
|
77
|
+
width: screenWidth - displayInsets.left - displayInsets.right
|
|
78
|
+
};
|
|
79
|
+
case "left":
|
|
80
|
+
return {
|
|
81
|
+
top: childrenCoords.y,
|
|
82
|
+
left: displayInsets.left,
|
|
83
|
+
width: screenWidth - (screenWidth - childrenCoords.x) - ARROW_HEIGHT - displayInsets.left - EMPTY_SPACE
|
|
84
|
+
};
|
|
85
|
+
case "right":
|
|
86
|
+
const elementSize = childrenCoords.width + childrenCoords.x + ARROW_HEIGHT + EMPTY_SPACE;
|
|
87
|
+
return {
|
|
88
|
+
top: childrenCoords.y,
|
|
89
|
+
left: elementSize,
|
|
90
|
+
width: screenWidth - (elementSize + displayInsets.right)
|
|
91
|
+
};
|
|
92
|
+
// TODO: provide a default center position in case of Tooltip without children
|
|
93
|
+
default:
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A utility function to calculate the `Tooltip`'s `Arrow` coordinates
|
|
100
|
+
* @param placement The `Arrow` placement in relation of the `Tooltip` children
|
|
101
|
+
* @param childrenCoords The measures in screen of the `Tooltip` children
|
|
102
|
+
* @param screenDimensions The active display insets
|
|
103
|
+
* @returns The `Tooltip`'s Arrow coordinates
|
|
104
|
+
*/
|
|
105
|
+
exports.getTooltipCoords = getTooltipCoords;
|
|
106
|
+
const getArrowCoords = (placement, childrenCoords, screenDimensions) => {
|
|
107
|
+
const {
|
|
108
|
+
width: screenWidth,
|
|
109
|
+
height: screenHeight
|
|
110
|
+
} = screenDimensions;
|
|
111
|
+
switch (placement) {
|
|
112
|
+
case "top":
|
|
113
|
+
return {
|
|
114
|
+
bottom: screenHeight - childrenCoords.y + EMPTY_SPACE,
|
|
115
|
+
left: childrenCoords.x + childrenCoords.width / 2 - ARROW_WIDTH / 2
|
|
116
|
+
};
|
|
117
|
+
case "bottom":
|
|
118
|
+
return {
|
|
119
|
+
top: childrenCoords.y + childrenCoords.height + EMPTY_SPACE,
|
|
120
|
+
left: childrenCoords.x + childrenCoords.width / 2 - ARROW_WIDTH / 2
|
|
121
|
+
};
|
|
122
|
+
case "left":
|
|
123
|
+
return {
|
|
124
|
+
top: childrenCoords.y,
|
|
125
|
+
left: screenWidth - (screenWidth - childrenCoords.x) - ARROW_HEIGHT - EMPTY_SPACE - 1 // FIXME -> This `-1` is necessary because of the Svg size doesn't match the box size
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
case "right":
|
|
129
|
+
return {
|
|
130
|
+
top: childrenCoords.y,
|
|
131
|
+
left: childrenCoords.width + childrenCoords.x + EMPTY_SPACE
|
|
132
|
+
};
|
|
133
|
+
default:
|
|
134
|
+
// TODO: provide a default center position in case of Tooltip without children
|
|
135
|
+
return {};
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A utility function to calculate the `Tooltip` vertical alignment
|
|
141
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
142
|
+
* @param childrenHeight The `Tooltip`'s children height
|
|
143
|
+
* @param tooltipHeight The `Tooltip`'s height
|
|
144
|
+
* @returns If placement is `left` or `right` it returns the vertical tranlsation to align the `Tooltip` center with its `children` center,
|
|
145
|
+
* otherwise `null` is returned
|
|
146
|
+
*/
|
|
147
|
+
exports.getArrowCoords = getArrowCoords;
|
|
148
|
+
const getTooltipVerticalAlignment = (placement, childrenHeight, tooltipHeight) => {
|
|
149
|
+
if ((placement === "left" || placement === "right") && tooltipHeight) {
|
|
150
|
+
return {
|
|
151
|
+
transform: [{
|
|
152
|
+
translateY: -tooltipHeight / 2 + childrenHeight / 2
|
|
153
|
+
}]
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* A utility function to calculate the `Arrow` vertical alignment
|
|
161
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
162
|
+
* @param childrenHeight The `Tooltip`'s children height
|
|
163
|
+
*/
|
|
164
|
+
exports.getTooltipVerticalAlignment = getTooltipVerticalAlignment;
|
|
165
|
+
const getArrowVerticalAlignment = (placement, childrenHeight) => {
|
|
166
|
+
if (placement === "left" || placement === "right") {
|
|
167
|
+
return {
|
|
168
|
+
transform: [{
|
|
169
|
+
translateY: -ARROW_WIDTH / 2 + childrenHeight / 2
|
|
170
|
+
}]
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return null;
|
|
174
|
+
};
|
|
175
|
+
exports.getArrowVerticalAlignment = getArrowVerticalAlignment;
|
|
176
|
+
const isDefined = v => v !== undefined;
|
|
177
|
+
exports.isDefined = isDefined;
|
|
178
|
+
const isNotZero = v => v !== 0;
|
|
179
|
+
exports.isNotZero = isNotZero;
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","ARROW_WIDTH","exports","ARROW_HEIGHT","EMPTY_SPACE","DEFAULT_INSETS","top","bottom","left","IOVisualCostants","appMarginDefault","right","getDisplayInsets","displayInsets","getArrowBoxByPlacement","placement","width","height","getTooltipCoords","childrenCoords","screenDimensions","screenWidth","screenHeight","y","x","elementSize","getArrowCoords","getTooltipVerticalAlignment","childrenHeight","tooltipHeight","transform","translateY","getArrowVerticalAlignment","isDefined","v","undefined","isNotZero"],"sourceRoot":"../../../../../src","sources":["components/tooltip/utils/index.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,GAAG,EAAE;AAACC,OAAA,CAAAD,WAAA,GAAAA,WAAA;AACvB,MAAME,YAAY,GAAG,EAAE;AAACD,OAAA,CAAAC,YAAA,GAAAA,YAAA;AACxB,MAAMC,WAAW,GAAG,CAAC;AAACF,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAC7B,MAAMC,cAA6B,GAAG;EACpCC,GAAG,EAAE,CAAC;EACNC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAEC,sBAAgB,CAACC,gBAAgB;EACvCC,KAAK,EAAEF,sBAAgB,CAACC;AAC1B,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAME,gBAAgB,GAC3BC,aAAqC,KAClB;EAAE,GAAGR,cAAc;EAAE,GAAGQ;AAAc,CAAC,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AAJAX,OAAA,CAAAU,gBAAA,GAAAA,gBAAA;AAKO,MAAME,sBAAsB,GAAIC,SAAoB,IAAK;EAC9D,QAAQA,SAAS;IACf,KAAK,MAAM;IACX,KAAK,OAAO;MACV,OAAO;QACLC,KAAK,EAAEb,YAAY;QACnBc,MAAM,EAAEhB;MACV,CAAC;IACH;MACE,OAAO;QACLgB,MAAM,EAAEd,YAAY;QACpBa,KAAK,EAAEf;MACT,CAAC;EACL;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAC,OAAA,CAAAY,sBAAA,GAAAA,sBAAA;AAQO,MAAMI,gB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S,KAAK,MAAM,IAAIA,SAAS,KAAK,OAAO,KAAKc,aAAa,EAAE;IACpE,OAAO;MACLC,SAAS,EAAE,CACT;QACEC,UAAU,EACR,CAACF,aAAa,GAAG,CAAC,GAAGD,cAAc,GAAG;MAC1C,CAAC;IAEL,CAAC;EACH;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA1B,OAAA,CAAAyB,2BAAA,GAAAA,2BAAA;AAKO,MAAMK,yBAAyB,GAAGA,CAACjB,SAAoB,EAAEa,cAAsB,KAAK;EACzF,IAAIb,SAAS,KAAK,MAAM,IAAIA,SAAS,KAAK,OAAO,EAAE;IACjD,OAAO;MACLe,SAAS,EAAE,CACT;QACEC,UAAU,EACR,CAAC9B,WAAW,GAAG,CAAC,GAAG2B,cAAc,GAAG;MACxC,CAAC;IAEL,CAAC;EACH;EACA,OAAO,IAAI;AACb,CAAC;AAAC1B,OAAA,CAAA8B,yBAAA,GAAAA,yBAAA;AAEK,MAAMC,SAAS,GAAOC,CAAI,IAAKA,CAAC,KAAKC,SAAS;AAACjC,OAAA,CAAA+B,SAAA,GAAAA,SAAA;AAC/C,MAAMG,SAAS,GAAIF,CAAS,IAAKA,CAAC,KAAK,CAAC;AAAChC,OAAA,CAAAkC,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/tooltip/utils/types.ts"],"mappings":""}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.BodySmall = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _core = require("../../core");
|
|
9
9
|
var _IOText = require("./IOText");
|
|
@@ -11,14 +11,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
12
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
13
13
|
const fontName = "Titillio";
|
|
14
|
-
const fontWeight = "Semibold";
|
|
15
14
|
const legacyFontName = "TitilliumSansPro";
|
|
16
|
-
const legacyFontWeight = "Semibold";
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
|
-
* `
|
|
17
|
+
* `BodySmall` typographic style
|
|
20
18
|
*/
|
|
21
|
-
const
|
|
19
|
+
const BodySmall = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
22
20
|
weight: customWeight,
|
|
23
21
|
color: customColor,
|
|
24
22
|
asLink,
|
|
@@ -29,11 +27,11 @@ const LabelSmall = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
29
27
|
isExperimental
|
|
30
28
|
} = (0, _core.useIOExperimentalDesign)();
|
|
31
29
|
const defaultColor = asLink ? theme["interactiveElem-default"] : theme["textBody-tertiary"];
|
|
32
|
-
const
|
|
30
|
+
const BodySmallProps = {
|
|
33
31
|
...props,
|
|
34
32
|
dynamicTypeRamp: "footnote" /* iOS only */,
|
|
35
33
|
font: isExperimental ? fontName : legacyFontName,
|
|
36
|
-
weight: customWeight
|
|
34
|
+
weight: customWeight ?? "Regular",
|
|
37
35
|
size: 14,
|
|
38
36
|
lineHeight: 21,
|
|
39
37
|
color: customColor ?? defaultColor,
|
|
@@ -46,7 +44,7 @@ const LabelSmall = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
46
44
|
};
|
|
47
45
|
return /*#__PURE__*/_react.default.createElement(_IOText.IOText, _extends({
|
|
48
46
|
ref: ref
|
|
49
|
-
},
|
|
47
|
+
}, BodySmallProps), props.children);
|
|
50
48
|
});
|
|
51
|
-
exports.
|
|
52
|
-
//# sourceMappingURL=
|
|
49
|
+
exports.BodySmall = BodySmall;
|
|
50
|
+
//# sourceMappingURL=BodySmall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","fontName","legacyFontName","BodySmall","forwardRef","weight","customWeight","color","customColor","asLink","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","defaultColor","BodySmallProps","dynamicTypeRamp","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","IOText","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/BodySmall.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAKkB,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,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@@ const buttonTextFontSize = 16;
|
|
|
16
16
|
exports.buttonTextFontSize = buttonTextFontSize;
|
|
17
17
|
const defaultColor = "white";
|
|
18
18
|
const fontName = "Titillio";
|
|
19
|
-
const fontWeight = "Semibold";
|
|
20
19
|
|
|
21
20
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
22
21
|
const legacyFontName = "TitilliumSansPro";
|
|
23
|
-
const legacyFontWeight = "Bold";
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* `ButtonText` typographic style
|
|
@@ -35,7 +33,7 @@ const ButtonText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
35
33
|
const ButtonTextProps = {
|
|
36
34
|
...props,
|
|
37
35
|
font: isExperimental ? fontName : legacyFontName,
|
|
38
|
-
weight:
|
|
36
|
+
weight: "Semibold",
|
|
39
37
|
size: buttonTextFontSize,
|
|
40
38
|
lineHeight: 20,
|
|
41
39
|
color: customColor ?? defaultColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","buttonTextFontSize","exports","defaultColor","fontName","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","buttonTextFontSize","exports","defaultColor","fontName","legacyFontName","ButtonText","forwardRef","color","customColor","props","ref","isExperimental","useIOExperimentalDesign","ButtonTextProps","font","weight","size","line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Ae,GAClCJ,KAAK,CAACW,QACD,CAAC;AAEb,CACF,CAAC;AAACnB,OAAA,CAAAI,UAAA,GAAAA,UAAA"}
|
|
@@ -10,24 +10,21 @@ var _IOText = require("./IOText");
|
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
12
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
13
|
-
const defaultColor = "textHeading-default";
|
|
14
|
-
|
|
15
13
|
/* Common typographic styles */
|
|
16
14
|
const h3FontSize = 22;
|
|
17
15
|
exports.h3FontSize = h3FontSize;
|
|
18
16
|
const h3LineHeight = 33;
|
|
19
17
|
exports.h3LineHeight = h3LineHeight;
|
|
20
18
|
const fontName = "Titillio";
|
|
21
|
-
const fontWeight = "Semibold";
|
|
22
19
|
|
|
23
20
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
24
21
|
const legacyFontName = "TitilliumSansPro";
|
|
25
|
-
const legacyFontWeight = "Semibold";
|
|
26
22
|
|
|
27
23
|
/**
|
|
28
24
|
* `H3` typographic style
|
|
29
25
|
*/
|
|
30
26
|
const H3 = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
|
+
weight: customWeight,
|
|
31
28
|
color: customColor,
|
|
32
29
|
...props
|
|
33
30
|
}, ref) => {
|
|
@@ -40,10 +37,10 @@ const H3 = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
40
37
|
dynamicTypeRamp: "title2",
|
|
41
38
|
// iOS only
|
|
42
39
|
font: isExperimental ? fontName : legacyFontName,
|
|
43
|
-
weight:
|
|
40
|
+
weight: customWeight ?? "Semibold",
|
|
44
41
|
size: h3FontSize,
|
|
45
42
|
lineHeight: h3LineHeight,
|
|
46
|
-
color: customColor ?? theme[
|
|
43
|
+
color: customColor ?? theme["textHeading-default"]
|
|
47
44
|
};
|
|
48
45
|
return /*#__PURE__*/_react.default.createElement(_IOText.IOText, _extends({
|
|
49
46
|
ref: ref
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","h3FontSize","exports","h3LineHeight","fontName","legacyFontName","H3","forwardRef","weight","customWeight","color","customColor","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","H3Props","dynamicTypeRamp","font","size","lineHeight","createElement","IOText","children"],"sourceRoot":"../../../../src","sources":["components/typography/H3.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAAsE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,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