@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,43 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { IOColors } from '../../core';
|
|
3
|
+
export const tooltipStyles = StyleSheet.create({
|
|
4
|
+
overlay: {
|
|
5
|
+
position: "absolute",
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
backgroundColor: IOColors["grey-850"],
|
|
9
|
+
opacity: 0.6,
|
|
10
|
+
zIndex: 997
|
|
11
|
+
},
|
|
12
|
+
childrenContainer: {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
zIndex: 1000
|
|
15
|
+
},
|
|
16
|
+
tooltipContainer: {
|
|
17
|
+
position: "absolute",
|
|
18
|
+
paddingHorizontal: 16,
|
|
19
|
+
paddingVertical: 16,
|
|
20
|
+
backgroundColor: IOColors.white,
|
|
21
|
+
borderRadius: 8,
|
|
22
|
+
zIndex: 2000,
|
|
23
|
+
overflow: "visible"
|
|
24
|
+
},
|
|
25
|
+
arrowContainer: {
|
|
26
|
+
position: "absolute",
|
|
27
|
+
display: 'flex',
|
|
28
|
+
zIndex: 3000
|
|
29
|
+
},
|
|
30
|
+
closeIcon: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
right: 8,
|
|
33
|
+
top: 9 // It's been used `9` instead of `8` to fix accessibility focus order. In this way title is read before close icon.
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const getChildrenPosition = childrenCoords => ({
|
|
38
|
+
top: childrenCoords.y,
|
|
39
|
+
left: childrenCoords.x,
|
|
40
|
+
width: childrenCoords.width,
|
|
41
|
+
height: childrenCoords.height
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","IOColors","tooltipStyles","create","overlay","position","width","height","backgroundColor","opacity","zIndex","childrenContainer","tooltipContainer","paddingHorizontal","paddingVertical","white","borderRadius","overflow","arrowContainer","display","closeIcon","right","top","getChildrenPosition","childrenCoords","y","left","x"],"sourceRoot":"../../../../src","sources":["components/tooltip/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,QAAQ,QAAQ,YAAY;AAGrC,OAAO,MAAMC,aAAa,GAAGF,UAAU,CAACG,MAAM,CAAC;EAC7CC,OAAO,EAAE;IACPC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEP,QAAQ,CAAC,UAAU,CAAC;IACrCQ,OAAO,EAAE,GAAG;IACZC,MAAM,EAAE;EACV,CAAC;EACDC,iBAAiB,EAAE;IACjBN,QAAQ,EAAE,UAAU;IACpBK,MAAM,EAAE;EACV,CAAC;EACDE,gBAAgB,EAAE;IAChBP,QAAQ,EAAE,UAAU;IACpBQ,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBN,eAAe,EAAEP,QAAQ,CAACc,KAAK;IAC/BC,YAAY,EAAE,CAAC;IACfN,MAAM,EAAE,IAAI;IACZO,QAAQ,EAAE;EACZ,CAAC;EACDC,cAAc,EAAE;IACdb,QAAQ,EAAE,UAAU;IACpBc,OAAO,EAAE,MAAM;IACfT,MAAM,EAAE;EACV,CAAC;EACDU,SAAS,EAAE;IACTf,QAAQ,EAAE,UAAU;IACpBgB,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC,CAAC;EACT;AACF,CAAC,CAAC;;AAEF,OAAO,MAAMC,mBAAmB,GAAIC,cAA8B,KAAM;EACtEF,GAAG,EAAEE,cAAc,CAACC,CAAC;EACrBC,IAAI,EAAEF,cAAc,CAACG,CAAC;EACtBrB,KAAK,EAAEkB,cAAc,CAAClB,KAAK;EAC3BC,MAAM,EAAEiB,cAAc,CAACjB;AACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { IOVisualCostants } from '../../../core';
|
|
2
|
+
export const ARROW_WIDTH = 24;
|
|
3
|
+
export const ARROW_HEIGHT = 14;
|
|
4
|
+
export const EMPTY_SPACE = 8;
|
|
5
|
+
const DEFAULT_INSETS = {
|
|
6
|
+
top: 0,
|
|
7
|
+
bottom: 0,
|
|
8
|
+
left: IOVisualCostants.appMarginDefault,
|
|
9
|
+
right: IOVisualCostants.appMarginDefault
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param displayInsets custom display insets
|
|
14
|
+
* @returns An `object` based on `DEFAULT_INSETS` and `displayInsets`
|
|
15
|
+
*/
|
|
16
|
+
export const getDisplayInsets = displayInsets => ({
|
|
17
|
+
...DEFAULT_INSETS,
|
|
18
|
+
...displayInsets
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param placement The `Tooltip` placement
|
|
24
|
+
* @returns The `Arrow` box `width` and `height` based on `placement` value
|
|
25
|
+
*/
|
|
26
|
+
export const getArrowBoxByPlacement = placement => {
|
|
27
|
+
switch (placement) {
|
|
28
|
+
case 'left':
|
|
29
|
+
case 'right':
|
|
30
|
+
return {
|
|
31
|
+
width: ARROW_HEIGHT,
|
|
32
|
+
height: ARROW_WIDTH
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
return {
|
|
36
|
+
height: ARROW_HEIGHT,
|
|
37
|
+
width: ARROW_WIDTH
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A utility function to calculate the `Tooltip` coordinates and dimensions
|
|
44
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
45
|
+
* @param childrenCoords The measures in screen of the `Tooltip` children
|
|
46
|
+
* @param displayInsets The active display insets
|
|
47
|
+
* @param screenDimensions The dimensions of the device screen
|
|
48
|
+
* @returns The `Tooltip` coordinates
|
|
49
|
+
*/
|
|
50
|
+
export const getTooltipCoords = (placement, childrenCoords, displayInsets, screenDimensions) => {
|
|
51
|
+
const {
|
|
52
|
+
width: screenWidth,
|
|
53
|
+
height: screenHeight
|
|
54
|
+
} = screenDimensions;
|
|
55
|
+
switch (placement) {
|
|
56
|
+
case "top":
|
|
57
|
+
return {
|
|
58
|
+
bottom: screenHeight - childrenCoords.y + ARROW_HEIGHT + EMPTY_SPACE,
|
|
59
|
+
left: displayInsets.left,
|
|
60
|
+
width: screenWidth - displayInsets.left - displayInsets.right
|
|
61
|
+
};
|
|
62
|
+
case "bottom":
|
|
63
|
+
return {
|
|
64
|
+
top: childrenCoords.y + childrenCoords.height + ARROW_HEIGHT + EMPTY_SPACE,
|
|
65
|
+
left: displayInsets.left,
|
|
66
|
+
width: screenWidth - displayInsets.left - displayInsets.right
|
|
67
|
+
};
|
|
68
|
+
case "left":
|
|
69
|
+
return {
|
|
70
|
+
top: childrenCoords.y,
|
|
71
|
+
left: displayInsets.left,
|
|
72
|
+
width: screenWidth - (screenWidth - childrenCoords.x) - ARROW_HEIGHT - displayInsets.left - EMPTY_SPACE
|
|
73
|
+
};
|
|
74
|
+
case "right":
|
|
75
|
+
const elementSize = childrenCoords.width + childrenCoords.x + ARROW_HEIGHT + EMPTY_SPACE;
|
|
76
|
+
return {
|
|
77
|
+
top: childrenCoords.y,
|
|
78
|
+
left: elementSize,
|
|
79
|
+
width: screenWidth - (elementSize + displayInsets.right)
|
|
80
|
+
};
|
|
81
|
+
// TODO: provide a default center position in case of Tooltip without children
|
|
82
|
+
default:
|
|
83
|
+
return {};
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A utility function to calculate the `Tooltip`'s `Arrow` coordinates
|
|
89
|
+
* @param placement The `Arrow` placement in relation of the `Tooltip` children
|
|
90
|
+
* @param childrenCoords The measures in screen of the `Tooltip` children
|
|
91
|
+
* @param screenDimensions The active display insets
|
|
92
|
+
* @returns The `Tooltip`'s Arrow coordinates
|
|
93
|
+
*/
|
|
94
|
+
export const getArrowCoords = (placement, childrenCoords, screenDimensions) => {
|
|
95
|
+
const {
|
|
96
|
+
width: screenWidth,
|
|
97
|
+
height: screenHeight
|
|
98
|
+
} = screenDimensions;
|
|
99
|
+
switch (placement) {
|
|
100
|
+
case "top":
|
|
101
|
+
return {
|
|
102
|
+
bottom: screenHeight - childrenCoords.y + EMPTY_SPACE,
|
|
103
|
+
left: childrenCoords.x + childrenCoords.width / 2 - ARROW_WIDTH / 2
|
|
104
|
+
};
|
|
105
|
+
case "bottom":
|
|
106
|
+
return {
|
|
107
|
+
top: childrenCoords.y + childrenCoords.height + EMPTY_SPACE,
|
|
108
|
+
left: childrenCoords.x + childrenCoords.width / 2 - ARROW_WIDTH / 2
|
|
109
|
+
};
|
|
110
|
+
case "left":
|
|
111
|
+
return {
|
|
112
|
+
top: childrenCoords.y,
|
|
113
|
+
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
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
case "right":
|
|
117
|
+
return {
|
|
118
|
+
top: childrenCoords.y,
|
|
119
|
+
left: childrenCoords.width + childrenCoords.x + EMPTY_SPACE
|
|
120
|
+
};
|
|
121
|
+
default:
|
|
122
|
+
// TODO: provide a default center position in case of Tooltip without children
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A utility function to calculate the `Tooltip` vertical alignment
|
|
129
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
130
|
+
* @param childrenHeight The `Tooltip`'s children height
|
|
131
|
+
* @param tooltipHeight The `Tooltip`'s height
|
|
132
|
+
* @returns If placement is `left` or `right` it returns the vertical tranlsation to align the `Tooltip` center with its `children` center,
|
|
133
|
+
* otherwise `null` is returned
|
|
134
|
+
*/
|
|
135
|
+
export const getTooltipVerticalAlignment = (placement, childrenHeight, tooltipHeight) => {
|
|
136
|
+
if ((placement === "left" || placement === "right") && tooltipHeight) {
|
|
137
|
+
return {
|
|
138
|
+
transform: [{
|
|
139
|
+
translateY: -tooltipHeight / 2 + childrenHeight / 2
|
|
140
|
+
}]
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A utility function to calculate the `Arrow` vertical alignment
|
|
148
|
+
* @param placement The `Tooltip` placement in relation of its children
|
|
149
|
+
* @param childrenHeight The `Tooltip`'s children height
|
|
150
|
+
*/
|
|
151
|
+
export const getArrowVerticalAlignment = (placement, childrenHeight) => {
|
|
152
|
+
if (placement === "left" || placement === "right") {
|
|
153
|
+
return {
|
|
154
|
+
transform: [{
|
|
155
|
+
translateY: -ARROW_WIDTH / 2 + childrenHeight / 2
|
|
156
|
+
}]
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
};
|
|
161
|
+
export const isDefined = v => v !== undefined;
|
|
162
|
+
export const isNotZero = v => v !== 0;
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IOVisualCostants","ARROW_WIDTH","ARROW_HEIGHT","EMPTY_SPACE","DEFAULT_INSETS","top","bottom","left","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":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/tooltip/utils/types.ts"],"mappings":""}
|
|
@@ -3,14 +3,12 @@ import React, { forwardRef } from "react";
|
|
|
3
3
|
import { useIOExperimentalDesign, useIOTheme } from "../../core";
|
|
4
4
|
import { IOText } from "./IOText";
|
|
5
5
|
const fontName = "Titillio";
|
|
6
|
-
const fontWeight = "Semibold";
|
|
7
6
|
const legacyFontName = "TitilliumSansPro";
|
|
8
|
-
const legacyFontWeight = "Semibold";
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
|
-
* `
|
|
9
|
+
* `BodySmall` typographic style
|
|
12
10
|
*/
|
|
13
|
-
export const
|
|
11
|
+
export const BodySmall = /*#__PURE__*/forwardRef(({
|
|
14
12
|
weight: customWeight,
|
|
15
13
|
color: customColor,
|
|
16
14
|
asLink,
|
|
@@ -21,11 +19,11 @@ export const LabelSmall = /*#__PURE__*/forwardRef(({
|
|
|
21
19
|
isExperimental
|
|
22
20
|
} = useIOExperimentalDesign();
|
|
23
21
|
const defaultColor = asLink ? theme["interactiveElem-default"] : theme["textBody-tertiary"];
|
|
24
|
-
const
|
|
22
|
+
const BodySmallProps = {
|
|
25
23
|
...props,
|
|
26
24
|
dynamicTypeRamp: "footnote" /* iOS only */,
|
|
27
25
|
font: isExperimental ? fontName : legacyFontName,
|
|
28
|
-
weight: customWeight
|
|
26
|
+
weight: customWeight ?? "Regular",
|
|
29
27
|
size: 14,
|
|
30
28
|
lineHeight: 21,
|
|
31
29
|
color: customColor ?? defaultColor,
|
|
@@ -38,6 +36,6 @@ export const LabelSmall = /*#__PURE__*/forwardRef(({
|
|
|
38
36
|
};
|
|
39
37
|
return /*#__PURE__*/React.createElement(IOText, _extends({
|
|
40
38
|
ref: ref
|
|
41
|
-
},
|
|
39
|
+
}, BodySmallProps), props.children);
|
|
42
40
|
});
|
|
43
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=BodySmall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","fontName","legacyFontName","BodySmall","weight","customWeight","color","customColor","asLink","props","ref","theme","isExperimental","defaultColor","BodySmallProps","dynamicTypeRamp","font","size","lineHeight","accessibilityRole","textStyle","textDecorationLine","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/BodySmall.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SACEC,MAAM,QAID,UAAU;AAMjB,MAAMC,QAAsB,GAAG,UAAU;AACzC,MAAMC,cAA4B,GAAG,kBAAkB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,SAAS,gBAAGN,UAAU,CACjC,CACE;EAAEO,MAAM,EAAEC,YAAY;EAAEC,KAAK,EAAEC,WAAW;EAAEC,MAAM;EAAE,GAAGC;AAAM,CAAC,EAC9DC,GAAwB,KACrB;EACH,MAAMC,KAAK,GAAGZ,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEa;EAAe,CAAC,GAAGd,uBAAuB,CAAC,CAAC;EAEpD,MAAMe,YAAY,GAAGL,MAAM,GACvBG,KAAK,CAAC,yBAAyB,CAAC,GAChCA,KAAK,CAAC,mBAAmB,CAAC;EAE9B,MAAMG,cAA2B,GAAG;IAClC,GAAGL,KAAK;IACRM,eAAe,EAAE,UAAU,CAAC;IAC5BC,IAAI,EAAEJ,cAAc,GAAGX,QAAQ,GAAGC,cAAc;IAChDE,MAAM,EAAEC,YAAY,IAAI,SAAS;IACjCY,IAAI,EAAE,EAAE;IACRC,UAAU,EAAE,EAAE;IACdZ,KAAK,EAAEC,WAAW,IAAIM,YAAY;IAClC,IAAIL,MAAM,GACN;MACEW,iBAAiB,EAAE,MAAM;MACzBC,SAAS,EAAE;QAAEC,kBAAkB,EAAE;MAAY;IAC/C,CAAC,GACD,CAAC,CAAC;EACR,CAAC;EAED,oBACEzB,KAAA,CAAA0B,aAAA,CAACtB,MAAM,EAAAuB,QAAA;IAACb,GAAG,EAAEA;EAAI,GAAKI,cAAc,GACjCL,KAAK,CAACe,QACD,CAAC;AAEb,CACF,CAAC"}
|
|
@@ -7,11 +7,9 @@ export const buttonTextFontSize = 16;
|
|
|
7
7
|
`AnimatedText` for color transition through Reanimated */
|
|
8
8
|
const defaultColor = "white";
|
|
9
9
|
const fontName = "Titillio";
|
|
10
|
-
const fontWeight = "Semibold";
|
|
11
10
|
|
|
12
11
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
13
12
|
const legacyFontName = "TitilliumSansPro";
|
|
14
|
-
const legacyFontWeight = "Bold";
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* `ButtonText` typographic style
|
|
@@ -26,7 +24,7 @@ export const ButtonText = /*#__PURE__*/forwardRef(({
|
|
|
26
24
|
const ButtonTextProps = {
|
|
27
25
|
...props,
|
|
28
26
|
font: isExperimental ? fontName : legacyFontName,
|
|
29
|
-
weight:
|
|
27
|
+
weight: "Semibold",
|
|
30
28
|
size: buttonTextFontSize,
|
|
31
29
|
lineHeight: 20,
|
|
32
30
|
color: customColor ?? defaultColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","IOText","buttonTextFontSize","defaultColor","fontName","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","IOText","buttonTextFontSize","defaultColor","fontName","legacyFontName","ButtonText","color","customColor","props","ref","isExperimental","ButtonTextProps","font","weight","size","lineHeight","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/ButtonText.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,QAAQ,YAAY;AAGpD,SAASC,MAAM,QAA4C,UAAU;AAErE,OAAO,MAAMC,kBAA8B,GAAG,EAAE;AAChD;AACA;AACA,MAAMC,YAAsB,GAAG,OAAO;AACtC,MAAMC,QAAsB,GAAG,UAAU;;AAEzC;AACA,MAAMC,cAA4B,GAAG,kBAAkB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,UAAU,gBAAGP,UAAU,CAClC,CAAC;EAAEQ,KAAK,EAAEC,WAAW;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAwB,KAAK;EAC9D,MAAM;IAAEC;EAAe,CAAC,GAAGX,uBAAuB,CAAC,CAAC;EAEpD,MAAMY,eAA4B,GAAG;IACnC,GAAGH,KAAK;IACRI,IAAI,EAAEF,cAAc,GAAGP,QAAQ,GAAGC,cAAc;IAChDS,MAAM,EAAE,UAAU;IAClBC,IAAI,EAAEb,kBAAkB;IACxBc,UAAU,EAAE,EAAE;IACdT,KAAK,EAAEC,WAAW,IAAIL;EACxB,CAAC;EAED,oBACEL,KAAA,CAAAmB,aAAA,CAAChB,MAAM,EAAAiB,QAAA;IAACR,GAAG,EAAEA;EAAI,GAAKE,eAAe,GAClCH,KAAK,CAACU,QACD,CAAC;AAEb,CACF,CAAC"}
|
|
@@ -2,22 +2,19 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import { useIOExperimentalDesign, useIOTheme } from "../../core";
|
|
4
4
|
import { IOText } from "./IOText";
|
|
5
|
-
const defaultColor = "textHeading-default";
|
|
6
|
-
|
|
7
5
|
/* Common typographic styles */
|
|
8
6
|
export const h3FontSize = 22;
|
|
9
7
|
export const h3LineHeight = 33;
|
|
10
8
|
const fontName = "Titillio";
|
|
11
|
-
const fontWeight = "Semibold";
|
|
12
9
|
|
|
13
10
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
14
11
|
const legacyFontName = "TitilliumSansPro";
|
|
15
|
-
const legacyFontWeight = "Semibold";
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* `H3` typographic style
|
|
19
15
|
*/
|
|
20
16
|
export const H3 = /*#__PURE__*/forwardRef(({
|
|
17
|
+
weight: customWeight,
|
|
21
18
|
color: customColor,
|
|
22
19
|
...props
|
|
23
20
|
}, ref) => {
|
|
@@ -30,10 +27,10 @@ export const H3 = /*#__PURE__*/forwardRef(({
|
|
|
30
27
|
dynamicTypeRamp: "title2",
|
|
31
28
|
// iOS only
|
|
32
29
|
font: isExperimental ? fontName : legacyFontName,
|
|
33
|
-
weight:
|
|
30
|
+
weight: customWeight ?? "Semibold",
|
|
34
31
|
size: h3FontSize,
|
|
35
32
|
lineHeight: h3LineHeight,
|
|
36
|
-
color: customColor ?? theme[
|
|
33
|
+
color: customColor ?? theme["textHeading-default"]
|
|
37
34
|
};
|
|
38
35
|
return /*#__PURE__*/React.createElement(IOText, _extends({
|
|
39
36
|
ref: ref
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","h3FontSize","h3LineHeight","fontName","legacyFontName","H3","weight","customWeight","color","customColor","props","ref","theme","isExperimental","H3Props","dynamicTypeRamp","font","size","lineHeight","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/H3.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SAASC,MAAM,QAA4C,UAAU;AAMrE;AACA,OAAO,MAAMC,UAAsB,GAAG,EAAE;AACxC,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,MAAMC,QAAsB,GAAG,UAAU;;AAEzC;AACA,MAAMC,cAA4B,GAAG,kBAAkB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,EAAE,gBAAGR,UAAU,CAC1B,CACE;EAAES,MAAM,EAAEC,YAAY;EAAEC,KAAK,EAAEC,WAAW;EAAE,GAAGC;AAAM,CAAC,EACtDC,GAAwB,KACrB;EACH,MAAMC,KAAK,GAAGb,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEc;EAAe,CAAC,GAAGf,uBAAuB,CAAC,CAAC;EAEpD,MAAMgB,OAAoB,GAAG;IAC3B,GAAGJ,KAAK;IACRK,eAAe,EAAE,QAAQ;IAAE;IAC3BC,IAAI,EAAEH,cAAc,GAAGV,QAAQ,GAAGC,cAAc;IAChDE,MAAM,EAAEC,YAAY,IAAI,UAAU;IAClCU,IAAI,EAAEhB,UAAU;IAChBiB,UAAU,EAAEhB,YAAY;IACxBM,KAAK,EAAEC,WAAW,IAAIG,KAAK,CAAC,qBAAqB;EACnD,CAAC;EAED,oBACEhB,KAAA,CAAAuB,aAAA,CAACnB,MAAM,EAAAoB,QAAA;IAACT,GAAG,EAAEA;EAAI,GAAKG,OAAO,GAC1BJ,KAAK,CAACW,QACD,CAAC;AAEb,CACF,CAAC"}
|
|
@@ -3,14 +3,13 @@ import React, { forwardRef } from "react";
|
|
|
3
3
|
import { useIOExperimentalDesign, useIOTheme } from "../../core";
|
|
4
4
|
import { IOText } from "./IOText";
|
|
5
5
|
const defaultColor = "textHeading-default";
|
|
6
|
-
export const h6FontSize =
|
|
6
|
+
export const h6FontSize = 16;
|
|
7
7
|
export const h6LineHeight = 24;
|
|
8
8
|
const fontName = "Titillio";
|
|
9
|
-
const fontWeight = "Semibold";
|
|
10
9
|
|
|
11
10
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
11
|
+
const legacyFontSize = 18;
|
|
12
12
|
const legacyFontName = "TitilliumSansPro";
|
|
13
|
-
const legacyFontWeight = "Semibold";
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* `H6` typographic style
|
|
@@ -28,9 +27,9 @@ export const H6 = /*#__PURE__*/forwardRef(({
|
|
|
28
27
|
dynamicTypeRamp: "headline",
|
|
29
28
|
// iOS only
|
|
30
29
|
font: isExperimental ? fontName : legacyFontName,
|
|
31
|
-
size: h6FontSize,
|
|
30
|
+
size: isExperimental ? h6FontSize : legacyFontSize,
|
|
32
31
|
lineHeight: h6LineHeight,
|
|
33
|
-
weight:
|
|
32
|
+
weight: "Semibold",
|
|
34
33
|
color: customColor ?? theme[defaultColor]
|
|
35
34
|
};
|
|
36
35
|
return /*#__PURE__*/React.createElement(IOText, _extends({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","defaultColor","h6FontSize","h6LineHeight","fontName","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","defaultColor","h6FontSize","h6LineHeight","fontName","legacyFontSize","legacyFontName","H6","color","customColor","props","ref","theme","isExperimental","H6Props","dynamicTypeRamp","font","size","lineHeight","weight","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/H6.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAAkBC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEzE,SAASC,MAAM,QAA4C,UAAU;AAErE,MAAMC,YAA2B,GAAG,qBAAqB;AAEzD,OAAO,MAAMC,UAAsB,GAAG,EAAE;AACxC,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,MAAMC,QAAsB,GAAG,UAAU;;AAEzC;AACA,MAAMC,cAA0B,GAAG,EAAE;AACrC,MAAMC,cAA4B,GAAG,kBAAkB;;AAEvD;AACA;AACA;AACA,OAAO,MAAMC,EAAE,gBAAGV,UAAU,CAC1B,CAAC;EAAEW,KAAK,EAAEC,WAAW;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAwB,KAAK;EAC9D,MAAMC,KAAK,GAAGb,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEc;EAAe,CAAC,GAAGf,uBAAuB,CAAC,CAAC;EAEpD,MAAMgB,OAAoB,GAAG;IAC3B,GAAGJ,KAAK;IACRK,eAAe,EAAE,UAAU;IAAE;IAC7BC,IAAI,EAAEH,cAAc,GAAGT,QAAQ,GAAGE,cAAc;IAChDW,IAAI,EAAEJ,cAAc,GAAGX,UAAU,GAAGG,cAAc;IAClDa,UAAU,EAAEf,YAAY;IACxBgB,MAAM,EAAE,UAAU;IAClBX,KAAK,EAAEC,WAAW,IAAIG,KAAK,CAACX,YAAY;EAC1C,CAAC;EAED,oBACEL,KAAA,CAAAwB,aAAA,CAACpB,MAAM,EAAAqB,QAAA;IAACV,GAAG,EAAEA;EAAI,GAAKG,OAAO,GAC1BJ,KAAK,CAACY,QACD,CAAC;AAEb,CACF,CAAC"}
|