@pagopa/io-app-design-system 4.4.2 → 5.0.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/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
- package/lib/commonjs/components/accordion/index.js +0 -11
- package/lib/commonjs/components/accordion/index.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js +4 -4
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/lib/commonjs/components/banner/Banner.js +4 -4
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/lib/commonjs/components/buttons/ButtonLink.js +25 -32
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +18 -86
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +9 -53
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +6 -36
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +5 -50
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -36
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +5 -15
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +2 -9
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/commonjs/components/layout/FooterActions.js +1 -5
- package/lib/commonjs/components/layout/FooterActions.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +3 -3
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/ModalBSHeader.js +3 -15
- package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -4
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +1 -4
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/lib/commonjs/components/modules/ModuleIDP.js +4 -5
- package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberButton.js +3 -18
- package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/lib/commonjs/components/radio/AnimatedRadio.js +4 -14
- package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/commonjs/components/searchInput/SearchInput.js +6 -10
- package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
- package/lib/commonjs/components/stepper/Stepper.js +1 -10
- package/lib/commonjs/components/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/components/switch/NativeSwitch.js +2 -15
- package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +6 -46
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +4 -4
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +10 -20
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js +4 -6
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/BodySmall.js +3 -3
- package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
- package/lib/commonjs/components/typography/ButtonText.js +6 -7
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
- package/lib/commonjs/components/typography/Caption.js +6 -12
- package/lib/commonjs/components/typography/Caption.js.map +1 -1
- package/lib/commonjs/components/typography/H1.js +6 -13
- package/lib/commonjs/components/typography/H1.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js +8 -17
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +4 -8
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H4.js +7 -14
- package/lib/commonjs/components/typography/H4.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js +5 -10
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +7 -10
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/Hero.js +8 -17
- package/lib/commonjs/components/typography/Hero.js.map +1 -1
- package/lib/commonjs/components/typography/LabelMini.js +4 -6
- package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/lib/commonjs/components/typography/markdown/MdH1.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
- package/lib/commonjs/components/typography/markdown/MdH2.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
- package/lib/commonjs/components/typography/markdown/MdH3.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +1 -8
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/commonjs/core/IODSExperimentalContextProvider.js +4 -3
- package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/commonjs/core/IONewTypefaceContextProvider.js +33 -0
- package/lib/commonjs/core/IONewTypefaceContextProvider.js.map +1 -0
- package/lib/commonjs/core/IOStyles.js +1 -49
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/commonjs/core/IOThemeContextProvider.js +4 -15
- package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
- package/lib/commonjs/core/index.js +11 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
- package/lib/module/components/accordion/index.js +0 -1
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/badge/Badge.js +5 -5
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/lib/module/components/banner/Banner.js +5 -5
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/lib/module/components/buttons/ButtonLink.js +28 -35
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +19 -87
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +10 -54
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +6 -37
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +6 -51
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +6 -37
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/lib/module/components/checkbox/AnimatedCheckbox.js +6 -16
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +3 -10
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/module/components/layout/FooterActions.js +2 -6
- package/lib/module/components/layout/FooterActions.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +4 -4
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/ModalBSHeader.js +5 -17
- package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +2 -5
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +2 -5
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/lib/module/components/modules/ModuleIDP.js +4 -5
- package/lib/module/components/modules/ModuleIDP.js.map +1 -1
- package/lib/module/components/numberpad/NumberButton.js +5 -20
- package/lib/module/components/numberpad/NumberButton.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/lib/module/components/radio/AnimatedRadio.js +5 -15
- package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/module/components/searchInput/SearchInput.js +7 -11
- package/lib/module/components/searchInput/SearchInput.js.map +1 -1
- package/lib/module/components/stepper/Stepper.js +2 -11
- package/lib/module/components/stepper/Stepper.js.map +1 -1
- package/lib/module/components/switch/NativeSwitch.js +3 -16
- package/lib/module/components/switch/NativeSwitch.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +7 -47
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js +5 -5
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +11 -21
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/typography/Body.js +5 -7
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/BodySmall.js +4 -4
- package/lib/module/components/typography/BodySmall.js.map +1 -1
- package/lib/module/components/typography/ButtonText.js +7 -8
- package/lib/module/components/typography/ButtonText.js.map +1 -1
- package/lib/module/components/typography/Caption.js +6 -12
- package/lib/module/components/typography/Caption.js.map +1 -1
- package/lib/module/components/typography/H1.js +6 -13
- package/lib/module/components/typography/H1.js.map +1 -1
- package/lib/module/components/typography/H2.js +8 -17
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H3.js +4 -8
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H4.js +7 -14
- package/lib/module/components/typography/H4.js.map +1 -1
- package/lib/module/components/typography/H5.js +6 -11
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/H6.js +7 -10
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/Hero.js +8 -17
- package/lib/module/components/typography/Hero.js.map +1 -1
- package/lib/module/components/typography/LabelMini.js +5 -7
- package/lib/module/components/typography/LabelMini.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/lib/module/components/typography/markdown/MdH1.js +4 -4
- package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
- package/lib/module/components/typography/markdown/MdH2.js +4 -4
- package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
- package/lib/module/components/typography/markdown/MdH3.js +4 -4
- package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
- package/lib/module/core/IOColors.js +0 -6
- package/lib/module/core/IOColors.js.map +1 -1
- package/lib/module/core/IODSExperimentalContextProvider.js +2 -2
- package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/module/core/IONewTypefaceContextProvider.js +22 -0
- package/lib/module/core/IONewTypefaceContextProvider.js.map +1 -0
- package/lib/module/core/IOStyles.js +0 -46
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/module/core/IOThemeContextProvider.js +3 -12
- package/lib/module/core/IOThemeContextProvider.js.map +1 -1
- package/lib/module/core/index.js +1 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/typescript/components/accordion/index.d.ts +0 -1
- package/lib/typescript/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
- package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
- package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
- package/lib/typescript/components/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
- package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
- package/lib/typescript/components/typography/H1.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts +0 -3
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
- package/lib/typescript/core/IOColors.d.ts +0 -1
- package/lib/typescript/core/IOColors.d.ts.map +1 -1
- package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/IONewTypefaceContextProvider.d.ts +16 -0
- package/lib/typescript/core/IONewTypefaceContextProvider.d.ts.map +1 -0
- package/lib/typescript/core/IOStyles.d.ts +2 -32
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/lib/typescript/core/IOThemeContextProvider.d.ts +0 -4
- package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +1 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/utils/fonts.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
- package/src/components/accordion/index.tsx +0 -1
- package/src/components/badge/Badge.tsx +3 -3
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/src/components/banner/Banner.tsx +3 -4
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/src/components/buttons/ButtonLink.tsx +38 -41
- package/src/components/buttons/ButtonOutline.tsx +31 -103
- package/src/components/buttons/ButtonSolid.tsx +11 -69
- package/src/components/buttons/IconButton.tsx +5 -49
- package/src/components/buttons/IconButtonContained.tsx +11 -58
- package/src/components/buttons/IconButtonSolid.tsx +9 -47
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/src/components/checkbox/AnimatedCheckbox.tsx +6 -34
- package/src/components/checkbox/AnimatedMessageCheckbox.tsx +3 -14
- package/src/components/layout/FooterActions.tsx +1 -4
- package/src/components/layout/HeaderSecondLevel.tsx +4 -3
- package/src/components/layout/ModalBSHeader.tsx +11 -29
- package/src/components/listitems/ListItemNavAlert.tsx +1 -4
- package/src/components/listitems/ListItemTransaction.tsx +1 -5
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/src/components/modules/ModuleIDP.tsx +3 -8
- package/src/components/numberpad/NumberButton.tsx +4 -27
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/src/components/radio/AnimatedRadio.tsx +5 -33
- package/src/components/searchInput/SearchInput.tsx +11 -20
- package/src/components/stepper/Stepper.tsx +2 -20
- package/src/components/switch/NativeSwitch.tsx +3 -21
- package/src/components/tabs/TabItem.tsx +14 -61
- package/src/components/tag/Tag.tsx +3 -3
- package/src/components/textInput/TextInputBase.tsx +19 -34
- package/src/components/typography/Body.tsx +4 -11
- package/src/components/typography/BodySmall.tsx +3 -3
- package/src/components/typography/ButtonText.tsx +6 -8
- package/src/components/typography/Caption.tsx +6 -13
- package/src/components/typography/H1.tsx +6 -14
- package/src/components/typography/H2.tsx +8 -18
- package/src/components/typography/H3.tsx +4 -8
- package/src/components/typography/H4.tsx +7 -15
- package/src/components/typography/H5.tsx +6 -14
- package/src/components/typography/H6.tsx +7 -11
- package/src/components/typography/Hero.tsx +8 -18
- package/src/components/typography/LabelMini.tsx +4 -11
- package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/src/components/typography/markdown/MdH1.tsx +3 -3
- package/src/components/typography/markdown/MdH2.tsx +3 -3
- package/src/components/typography/markdown/MdH3.tsx +3 -3
- package/src/core/IOColors.ts +0 -7
- package/src/core/IODSExperimentalContextProvider.tsx +2 -2
- package/src/core/IONewTypefaceContextProvider.tsx +37 -0
- package/src/core/IOStyles.ts +0 -52
- package/src/core/IOThemeContextProvider.tsx +3 -16
- package/src/core/index.ts +1 -0
- package/lib/commonjs/components/accordion/RawAccordion.js +0 -93
- package/lib/commonjs/components/accordion/RawAccordion.js.map +0 -1
- package/lib/module/components/accordion/RawAccordion.js +0 -86
- package/lib/module/components/accordion/RawAccordion.js.map +0 -1
- package/lib/typescript/components/accordion/RawAccordion.d.ts +0 -17
- package/lib/typescript/components/accordion/RawAccordion.d.ts.map +0 -1
- package/src/components/accordion/RawAccordion.tsx +0 -116
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../../core";
|
|
4
4
|
import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,11 +10,11 @@ import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
|
10
10
|
export const MdH1 = forwardRef<View, TypographicStyleProps>(
|
|
11
11
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
12
12
|
const theme = useIOTheme();
|
|
13
|
-
const {
|
|
13
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
14
14
|
|
|
15
15
|
const MdH1Props: IOTextProps = {
|
|
16
16
|
...props,
|
|
17
|
-
font:
|
|
17
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
18
18
|
weight: "Semibold",
|
|
19
19
|
size: 20,
|
|
20
20
|
lineHeight: 24,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../../core";
|
|
4
4
|
import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -9,11 +9,11 @@ import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
|
9
9
|
export const MdH2 = forwardRef<View, TypographicStyleProps>(
|
|
10
10
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
11
11
|
const theme = useIOTheme();
|
|
12
|
-
const {
|
|
12
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
13
13
|
|
|
14
14
|
const MdH2Props: IOTextProps = {
|
|
15
15
|
...props,
|
|
16
|
-
font:
|
|
16
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
17
17
|
weight: "Semibold",
|
|
18
18
|
size: 16,
|
|
19
19
|
lineHeight: 24,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../../core";
|
|
4
4
|
import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -9,11 +9,11 @@ import { IOText, IOTextProps, TypographicStyleProps } from "../IOText";
|
|
|
9
9
|
export const MdH3 = forwardRef<View, TypographicStyleProps>(
|
|
10
10
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
11
11
|
const theme = useIOTheme();
|
|
12
|
-
const {
|
|
12
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
13
13
|
|
|
14
14
|
const MdH3Props: IOTextProps = {
|
|
15
15
|
...props,
|
|
16
|
-
font:
|
|
16
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
17
17
|
weight: "Regular",
|
|
18
18
|
size: 16,
|
|
19
19
|
lineHeight: 24,
|
package/src/core/IOColors.ts
CHANGED
|
@@ -338,13 +338,6 @@ export const IOThemeLight: IOTheme = {
|
|
|
338
338
|
"pictogram-tint-tertiary": "blueIO-400"
|
|
339
339
|
};
|
|
340
340
|
|
|
341
|
-
export const IOThemeLightLegacy: IOTheme = {
|
|
342
|
-
...IOThemeLight,
|
|
343
|
-
"appBackground-accent": "blue",
|
|
344
|
-
"interactiveElem-default": "blue",
|
|
345
|
-
"pictogram-hands": "blue"
|
|
346
|
-
};
|
|
347
|
-
|
|
348
341
|
export const IOThemeDark: IOTheme = {
|
|
349
342
|
...IOThemeLight,
|
|
350
343
|
// General
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
|
|
3
3
|
type IOExperimentalContextType = {
|
|
4
4
|
isExperimental: boolean;
|
|
@@ -24,7 +24,7 @@ export const IODSExperimentalContextProvider = ({
|
|
|
24
24
|
children,
|
|
25
25
|
isExperimentaEnabled
|
|
26
26
|
}: React.PropsWithChildren<IOExperimentalContextProviderProps>) => {
|
|
27
|
-
const [isExperimental, setExperimental] =
|
|
27
|
+
const [isExperimental, setExperimental] = useState(
|
|
28
28
|
isExperimentaEnabled ?? false
|
|
29
29
|
);
|
|
30
30
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useState } from "react";
|
|
2
|
+
|
|
3
|
+
type IONewTypefaceContextType = {
|
|
4
|
+
newTypefaceEnabled: boolean;
|
|
5
|
+
setNewTypefaceEnabled: (newTypefaceEnabled: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Experimental Context for new UI Representations
|
|
9
|
+
*/
|
|
10
|
+
export const IONewTypefaceContext =
|
|
11
|
+
React.createContext<IONewTypefaceContextType>({
|
|
12
|
+
newTypefaceEnabled: true,
|
|
13
|
+
setNewTypefaceEnabled: () => void 0
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const useIONewTypeface = () => React.useContext(IONewTypefaceContext);
|
|
17
|
+
|
|
18
|
+
type IOExperimentalContextProviderProps = {
|
|
19
|
+
isNewTypefaceEnabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const IONewTypefaceContextProvider = ({
|
|
23
|
+
children,
|
|
24
|
+
isNewTypefaceEnabled
|
|
25
|
+
}: PropsWithChildren<IOExperimentalContextProviderProps>) => {
|
|
26
|
+
const [newTypefaceEnabled, setNewTypefaceEnabled] = useState(
|
|
27
|
+
isNewTypefaceEnabled ?? true
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<IONewTypefaceContext.Provider
|
|
32
|
+
value={{ newTypefaceEnabled, setNewTypefaceEnabled }}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</IONewTypefaceContext.Provider>
|
|
36
|
+
);
|
|
37
|
+
};
|
package/src/core/IOStyles.ts
CHANGED
|
@@ -104,7 +104,6 @@ export const IOStyles = StyleSheet.create({
|
|
|
104
104
|
- Height for classic buttons
|
|
105
105
|
- Width and height for icon buttons
|
|
106
106
|
*/
|
|
107
|
-
const btnLegacySizeDefault = 40;
|
|
108
107
|
const btnSizeLarge = 56;
|
|
109
108
|
// NEW Design System
|
|
110
109
|
const btnBorderRadius = 8;
|
|
@@ -116,46 +115,6 @@ export const iconBtnSizeSmall: number = 24;
|
|
|
116
115
|
|
|
117
116
|
export const numberPadBtnSize: number = 56;
|
|
118
117
|
|
|
119
|
-
export const IOButtonLegacyStyles = StyleSheet.create({
|
|
120
|
-
/* BaseButton, used in the:
|
|
121
|
-
ButtonSolid, ButtonOutline
|
|
122
|
-
*/
|
|
123
|
-
button: {
|
|
124
|
-
flexDirection: "row",
|
|
125
|
-
alignItems: "center",
|
|
126
|
-
justifyContent: "center",
|
|
127
|
-
textAlignVertical: "center", // Prop supported on Android only
|
|
128
|
-
/* Legacy visual properties. They will be replaced with
|
|
129
|
-
dynamic ones once NativeBase is gone */
|
|
130
|
-
borderRadius: 4,
|
|
131
|
-
paddingHorizontal: 16,
|
|
132
|
-
// Reset default visual parameters
|
|
133
|
-
elevation: 0
|
|
134
|
-
// Visual parameters based on the FontScale
|
|
135
|
-
// paddingVertical: PixelRatio.getFontScale() * 10,
|
|
136
|
-
// paddingHorizontal: PixelRatio.getFontScale() * 16,
|
|
137
|
-
// borderRadius: PixelRatio.getFontScale() * 8
|
|
138
|
-
},
|
|
139
|
-
buttonInner: {
|
|
140
|
-
flexDirection: "row",
|
|
141
|
-
alignItems: "center",
|
|
142
|
-
justifyContent: "center"
|
|
143
|
-
},
|
|
144
|
-
/* Labels */
|
|
145
|
-
label: {
|
|
146
|
-
alignSelf: "center"
|
|
147
|
-
},
|
|
148
|
-
labelSizeDefault: {
|
|
149
|
-
fontSize: 16
|
|
150
|
-
},
|
|
151
|
-
/* Heights
|
|
152
|
-
Must be replaced with dynamic values, depending on the
|
|
153
|
-
fontScale parameter */
|
|
154
|
-
buttonSizeDefault: {
|
|
155
|
-
height: btnLegacySizeDefault
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
|
|
159
118
|
export const IOButtonStyles = StyleSheet.create({
|
|
160
119
|
/* BaseButton, used in the:
|
|
161
120
|
ButtonSolid, ButtonOutline
|
|
@@ -326,11 +285,6 @@ interface IOSwitchVisualParams {
|
|
|
326
285
|
padding: number;
|
|
327
286
|
}
|
|
328
287
|
|
|
329
|
-
interface IOSelectionTickLegacyVisualParams {
|
|
330
|
-
borderColorOffState: IOColors;
|
|
331
|
-
bgColorOnState: IOColors;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
288
|
export const IOSelectionTickVisualParams: IOSelectionTickVisualParams = {
|
|
335
289
|
size: 24,
|
|
336
290
|
borderWidth: 2,
|
|
@@ -350,12 +304,6 @@ export const IOSwitchVisualParams: IOSwitchVisualParams = {
|
|
|
350
304
|
padding: 2
|
|
351
305
|
};
|
|
352
306
|
|
|
353
|
-
export const IOSelectionTickLegacyVisualParams: IOSelectionTickLegacyVisualParams =
|
|
354
|
-
{
|
|
355
|
-
borderColorOffState: "bluegrey",
|
|
356
|
-
bgColorOnState: "blue"
|
|
357
|
-
};
|
|
358
|
-
|
|
359
307
|
interface IOSelectionListItemVisualParams {
|
|
360
308
|
paddingVertical: IOSpacingScale;
|
|
361
309
|
paddingHorizontal: IOAppMargin;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Appearance } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
IOTheme,
|
|
5
|
-
IOThemeDark,
|
|
6
|
-
IOThemeLight,
|
|
7
|
-
IOThemeLightLegacy
|
|
8
|
-
} from "./IOColors";
|
|
9
|
-
import { useIOExperimentalDesign } from "./IODSExperimentalContextProvider";
|
|
3
|
+
import { IOTheme, IOThemeDark, IOThemeLight } from "./IOColors";
|
|
10
4
|
|
|
11
5
|
export const IOThemes = { light: IOThemeLight, dark: IOThemeDark };
|
|
12
|
-
export const legacyIOThemes = { light: IOThemeLightLegacy, dark: IOThemeDark };
|
|
13
6
|
type IOThemeType = keyof typeof IOThemes;
|
|
14
7
|
|
|
15
8
|
type IOThemeContextType = {
|
|
@@ -41,18 +34,12 @@ export const IOThemeContextProvider = ({
|
|
|
41
34
|
const [currentTheme, setCurrentTheme] = React.useState<IOThemeType>(
|
|
42
35
|
theme ?? "light"
|
|
43
36
|
);
|
|
44
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
45
|
-
|
|
46
|
-
const themeMap = useMemo(
|
|
47
|
-
() => (isExperimental ? IOThemes : legacyIOThemes),
|
|
48
|
-
[isExperimental]
|
|
49
|
-
);
|
|
50
37
|
|
|
51
38
|
return (
|
|
52
39
|
<IOThemeContext.Provider
|
|
53
40
|
value={{
|
|
54
41
|
themeType: currentTheme,
|
|
55
|
-
theme:
|
|
42
|
+
theme: IOThemes[currentTheme],
|
|
56
43
|
setTheme: setCurrentTheme
|
|
57
44
|
}}
|
|
58
45
|
>
|
package/src/core/index.ts
CHANGED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.RawAccordion = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _IOStyles = require("../../core/IOStyles");
|
|
10
|
-
var _Icon = require("../icons/Icon");
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
// TODO: handle external initial open/closed state
|
|
14
|
-
|
|
15
|
-
const styles = _reactNative.StyleSheet.create({
|
|
16
|
-
headerIcon: {
|
|
17
|
-
alignSelf: "center"
|
|
18
|
-
},
|
|
19
|
-
row: {
|
|
20
|
-
..._IOStyles.IOStyles.row,
|
|
21
|
-
justifyContent: "space-between"
|
|
22
|
-
},
|
|
23
|
-
internalHeader: {
|
|
24
|
-
flex: 1,
|
|
25
|
-
paddingRight: _IOStyles.IOVisualCostants.appMarginDefault
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Obtains the degree starting from the open state
|
|
31
|
-
* @param isOpen
|
|
32
|
-
*/
|
|
33
|
-
const getDegree = isOpen => isOpen ? "-90deg" : "-270deg";
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The base accordion component, implements the opening and closing logic for viewing the children
|
|
37
|
-
* @param props
|
|
38
|
-
* @constructor
|
|
39
|
-
*/
|
|
40
|
-
const RawAccordion = props => {
|
|
41
|
-
const [isOpen, setOpen] = (0, React.useState)(false);
|
|
42
|
-
const animatedController = (0, React.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
43
|
-
const shouldAnimate = props.animated ?? true;
|
|
44
|
-
const headerStyle = props.headerStyle ?? {};
|
|
45
|
-
const accessibilityLabel = props.accessibilityLabel ? `${props.accessibilityLabel}, ` : "";
|
|
46
|
-
const arrowAngle = shouldAnimate ? animatedController.interpolate({
|
|
47
|
-
inputRange: [0, 1],
|
|
48
|
-
outputRange: ["0deg", "-180deg"]
|
|
49
|
-
}) : getDegree(isOpen);
|
|
50
|
-
(0, React.useEffect)(() => {
|
|
51
|
-
if (_reactNative.Platform.OS === "android") {
|
|
52
|
-
_reactNative.UIManager.setLayoutAnimationEnabledExperimental(shouldAnimate);
|
|
53
|
-
}
|
|
54
|
-
}, [shouldAnimate]);
|
|
55
|
-
const onPress = () => {
|
|
56
|
-
if (shouldAnimate) {
|
|
57
|
-
_reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut);
|
|
58
|
-
_reactNative.Animated.timing(animatedController, {
|
|
59
|
-
duration: 300,
|
|
60
|
-
toValue: isOpen ? 1 : 0,
|
|
61
|
-
useNativeDriver: true,
|
|
62
|
-
easing: _reactNative.Easing.linear
|
|
63
|
-
}).start();
|
|
64
|
-
}
|
|
65
|
-
setOpen(!isOpen);
|
|
66
|
-
};
|
|
67
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
68
|
-
style: _IOStyles.IOStyles.flex
|
|
69
|
-
}, /*#__PURE__*/React.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
70
|
-
onPress: onPress,
|
|
71
|
-
accessible: true,
|
|
72
|
-
accessibilityRole: "button",
|
|
73
|
-
accessibilityLabel: accessibilityLabel + (isOpen ? "Paragrafo espanso" : "Paragrafo chiuso")
|
|
74
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
75
|
-
style: [styles.row, headerStyle]
|
|
76
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
77
|
-
style: styles.internalHeader
|
|
78
|
-
}, props.header), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
79
|
-
testID: "ArrowAccordion",
|
|
80
|
-
style: {
|
|
81
|
-
...styles.headerIcon,
|
|
82
|
-
transform: [{
|
|
83
|
-
rotateZ: arrowAngle
|
|
84
|
-
}]
|
|
85
|
-
}
|
|
86
|
-
}, /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
87
|
-
name: "chevronTop",
|
|
88
|
-
color: "blue",
|
|
89
|
-
size: 24
|
|
90
|
-
})))), isOpen && props.children);
|
|
91
|
-
};
|
|
92
|
-
exports.RawAccordion = RawAccordion;
|
|
93
|
-
//# sourceMappingURL=RawAccordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_IOStyles","_Icon","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","styles","StyleSheet","create","headerIcon","alignSelf","row","IOStyles","justifyContent","internalHeader","flex","paddingRight","IOVisualCostants","appMarginDefault","getDegree","isOpen","RawAccordion","props","setOpen","useState","animatedController","useRef","Animated","Value","current","shouldAnimate","animated","headerStyle","accessibilityLabel","arrowAngle","interpolate","inputRange","outputRange","useEffect","Platform","OS","UIManager","setLayoutAnimationEnabledExperimental","onPress","LayoutAnimation","configureNext","Presets","easeInEaseOut","timing","duration","toValue","useNativeDriver","easing","Easing","linear","start","createElement","View","style","TouchableWithoutFeedback","accessible","accessibilityRole","header","testID","transform","rotateZ","Icon","name","color","size","children","exports"],"sourceRoot":"../../../../src","sources":["components/accordion/RawAccordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,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,SAAAN,wBAAAU,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,IAA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A,CAAC3E,YAAA,CAAA8C,QAAQ,CAAC8B,IAAI;IACZM,MAAM,EAAE,gBAAiB;IACzBL,KAAK,EAAE;MACL,GAAGpD,MAAM,CAACG,UAAU;MACpBuD,SAAS,EAAE,CAAC;QAAEC,OAAO,EAAE/B;MAAW,CAAC;IACrC;EAAE,gBAEFxD,KAAA,CAAA8E,aAAA,CAACzE,KAAA,CAAAmF,IAAI;IAACC,IAAI,EAAC,YAAY;IAACC,KAAK,EAAC,MAAM;IAACC,IAAI,EAAE;EAAG,CAAE,CACnC,CACX,CACkB,CAAC,EAC1BjD,MAAM,IAAIE,KAAK,CAACgD,QACb,CAAC;AAEX,CAAC;AAACC,OAAA,CAAAlD,YAAA,GAAAA,YAAA"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Animated, Easing, LayoutAnimation, Platform, StyleSheet, TouchableWithoutFeedback, UIManager, View } from "react-native";
|
|
4
|
-
import { IOStyles, IOVisualCostants } from "../../core/IOStyles";
|
|
5
|
-
import { Icon } from "../icons/Icon";
|
|
6
|
-
|
|
7
|
-
// TODO: handle external initial open/closed state
|
|
8
|
-
|
|
9
|
-
const styles = StyleSheet.create({
|
|
10
|
-
headerIcon: {
|
|
11
|
-
alignSelf: "center"
|
|
12
|
-
},
|
|
13
|
-
row: {
|
|
14
|
-
...IOStyles.row,
|
|
15
|
-
justifyContent: "space-between"
|
|
16
|
-
},
|
|
17
|
-
internalHeader: {
|
|
18
|
-
flex: 1,
|
|
19
|
-
paddingRight: IOVisualCostants.appMarginDefault
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Obtains the degree starting from the open state
|
|
25
|
-
* @param isOpen
|
|
26
|
-
*/
|
|
27
|
-
const getDegree = isOpen => isOpen ? "-90deg" : "-270deg";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The base accordion component, implements the opening and closing logic for viewing the children
|
|
31
|
-
* @param props
|
|
32
|
-
* @constructor
|
|
33
|
-
*/
|
|
34
|
-
export const RawAccordion = props => {
|
|
35
|
-
const [isOpen, setOpen] = useState(false);
|
|
36
|
-
const animatedController = useRef(new Animated.Value(1)).current;
|
|
37
|
-
const shouldAnimate = props.animated ?? true;
|
|
38
|
-
const headerStyle = props.headerStyle ?? {};
|
|
39
|
-
const accessibilityLabel = props.accessibilityLabel ? `${props.accessibilityLabel}, ` : "";
|
|
40
|
-
const arrowAngle = shouldAnimate ? animatedController.interpolate({
|
|
41
|
-
inputRange: [0, 1],
|
|
42
|
-
outputRange: ["0deg", "-180deg"]
|
|
43
|
-
}) : getDegree(isOpen);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (Platform.OS === "android") {
|
|
46
|
-
UIManager.setLayoutAnimationEnabledExperimental(shouldAnimate);
|
|
47
|
-
}
|
|
48
|
-
}, [shouldAnimate]);
|
|
49
|
-
const onPress = () => {
|
|
50
|
-
if (shouldAnimate) {
|
|
51
|
-
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
52
|
-
Animated.timing(animatedController, {
|
|
53
|
-
duration: 300,
|
|
54
|
-
toValue: isOpen ? 1 : 0,
|
|
55
|
-
useNativeDriver: true,
|
|
56
|
-
easing: Easing.linear
|
|
57
|
-
}).start();
|
|
58
|
-
}
|
|
59
|
-
setOpen(!isOpen);
|
|
60
|
-
};
|
|
61
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
62
|
-
style: IOStyles.flex
|
|
63
|
-
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
64
|
-
onPress: onPress,
|
|
65
|
-
accessible: true,
|
|
66
|
-
accessibilityRole: "button",
|
|
67
|
-
accessibilityLabel: accessibilityLabel + (isOpen ? "Paragrafo espanso" : "Paragrafo chiuso")
|
|
68
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
69
|
-
style: [styles.row, headerStyle]
|
|
70
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
71
|
-
style: styles.internalHeader
|
|
72
|
-
}, props.header), /*#__PURE__*/React.createElement(Animated.View, {
|
|
73
|
-
testID: "ArrowAccordion",
|
|
74
|
-
style: {
|
|
75
|
-
...styles.headerIcon,
|
|
76
|
-
transform: [{
|
|
77
|
-
rotateZ: arrowAngle
|
|
78
|
-
}]
|
|
79
|
-
}
|
|
80
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
81
|
-
name: "chevronTop",
|
|
82
|
-
color: "blue",
|
|
83
|
-
size: 24
|
|
84
|
-
})))), isOpen && props.children);
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=RawAccordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Easing","LayoutAnimation","Platform","StyleSheet","TouchableWithoutFeedback","UIManager","View","IOStyles","IOVisualCostants","Icon","styles","create","headerIcon","alignSelf","row","justifyContent","internalHeader","flex","paddingRight","appMarginDefault","getDegree","isOpen","RawAccordion","props","setOpen","animatedController","Value","current","shouldAnimate","animated","headerStyle","accessibilityLabel","arrowAngle","interpolate","inputRange","outputRange","OS","setLayoutAnimationEnabledExperimental","onPress","configureNext","Presets","easeInEaseOut","timing","duration","toValue","useNativeDriver","easing","linear","start","createElement","style","accessible","accessibilityRole","header","testID","transform","rotateZ","name","color","size","children"],"sourceRoot":"../../../../src","sources":["components/accordion/RawAccordion.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAEEC,QAAQ,EACRC,MAAM,EACNC,eAAe,EACfC,QAAQ,EACRC,UAAU,EACVC,wBAAwB,EACxBC,SAAS,EACTC,IAAI,QACC,cAAc;AACrB,SAASC,QAAQ,EAAEC,gBAAgB,QAAQ,qBAAqB;AAChE,SAASC,IAAI,QAAQ,eAAe;;AAEpC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C,YAAY;IAACC,KAAK,EAAC,MAAM;IAACC,IAAI,EAAE;EAAG,CAAE,CACnC,CACX,CACkB,CAAC,EAC1BtC,MAAM,IAAIE,KAAK,CAACqC,QACb,CAAC;AAEX,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { AccessibilityProps, View } from "react-native";
|
|
3
|
-
type Props = {
|
|
4
|
-
header: React.ReactElement;
|
|
5
|
-
children: React.ReactElement;
|
|
6
|
-
animated?: boolean;
|
|
7
|
-
headerStyle?: React.ComponentProps<typeof View>["style"];
|
|
8
|
-
accessibilityLabel?: AccessibilityProps["accessibilityLabel"];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The base accordion component, implements the opening and closing logic for viewing the children
|
|
12
|
-
* @param props
|
|
13
|
-
* @constructor
|
|
14
|
-
*/
|
|
15
|
-
export declare const RawAccordion: React.FC<Props>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=RawAccordion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RawAccordion.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/RawAccordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAQlB,IAAI,EACL,MAAM,cAAc,CAAC;AAKtB,KAAK,KAAK,GAAG;IAEX,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAE3B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAE7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;CAC/D,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA8DxC,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
AccessibilityProps,
|
|
5
|
-
Animated,
|
|
6
|
-
Easing,
|
|
7
|
-
LayoutAnimation,
|
|
8
|
-
Platform,
|
|
9
|
-
StyleSheet,
|
|
10
|
-
TouchableWithoutFeedback,
|
|
11
|
-
UIManager,
|
|
12
|
-
View
|
|
13
|
-
} from "react-native";
|
|
14
|
-
import { IOStyles, IOVisualCostants } from "../../core/IOStyles";
|
|
15
|
-
import { Icon } from "../icons/Icon";
|
|
16
|
-
|
|
17
|
-
// TODO: handle external initial open/closed state
|
|
18
|
-
type Props = {
|
|
19
|
-
// The header component, an arrow indicating the open/closed state will be added on the right
|
|
20
|
-
header: React.ReactElement;
|
|
21
|
-
// The accordion component must accept one children
|
|
22
|
-
children: React.ReactElement;
|
|
23
|
-
// The component should be animated? default: true
|
|
24
|
-
animated?: boolean;
|
|
25
|
-
headerStyle?: React.ComponentProps<typeof View>["style"];
|
|
26
|
-
accessibilityLabel?: AccessibilityProps["accessibilityLabel"];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const styles = StyleSheet.create({
|
|
30
|
-
headerIcon: {
|
|
31
|
-
alignSelf: "center"
|
|
32
|
-
},
|
|
33
|
-
row: {
|
|
34
|
-
...IOStyles.row,
|
|
35
|
-
justifyContent: "space-between"
|
|
36
|
-
},
|
|
37
|
-
internalHeader: {
|
|
38
|
-
flex: 1,
|
|
39
|
-
paddingRight: IOVisualCostants.appMarginDefault
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Obtains the degree starting from the open state
|
|
45
|
-
* @param isOpen
|
|
46
|
-
*/
|
|
47
|
-
const getDegree = (isOpen: boolean) => (isOpen ? "-90deg" : "-270deg");
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The base accordion component, implements the opening and closing logic for viewing the children
|
|
51
|
-
* @param props
|
|
52
|
-
* @constructor
|
|
53
|
-
*/
|
|
54
|
-
export const RawAccordion: React.FC<Props> = props => {
|
|
55
|
-
const [isOpen, setOpen] = useState<boolean>(false);
|
|
56
|
-
const animatedController = useRef(new Animated.Value(1)).current;
|
|
57
|
-
const shouldAnimate = props.animated ?? true;
|
|
58
|
-
const headerStyle = props.headerStyle ?? {};
|
|
59
|
-
const accessibilityLabel = props.accessibilityLabel
|
|
60
|
-
? `${props.accessibilityLabel}, `
|
|
61
|
-
: "";
|
|
62
|
-
|
|
63
|
-
const arrowAngle = shouldAnimate
|
|
64
|
-
? animatedController.interpolate({
|
|
65
|
-
inputRange: [0, 1],
|
|
66
|
-
outputRange: ["0deg", "-180deg"]
|
|
67
|
-
})
|
|
68
|
-
: getDegree(isOpen);
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (Platform.OS === "android") {
|
|
72
|
-
UIManager.setLayoutAnimationEnabledExperimental(shouldAnimate);
|
|
73
|
-
}
|
|
74
|
-
}, [shouldAnimate]);
|
|
75
|
-
|
|
76
|
-
const onPress = () => {
|
|
77
|
-
if (shouldAnimate) {
|
|
78
|
-
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
79
|
-
Animated.timing(animatedController, {
|
|
80
|
-
duration: 300,
|
|
81
|
-
toValue: isOpen ? 1 : 0,
|
|
82
|
-
useNativeDriver: true,
|
|
83
|
-
easing: Easing.linear
|
|
84
|
-
}).start();
|
|
85
|
-
}
|
|
86
|
-
setOpen(!isOpen);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<View style={IOStyles.flex}>
|
|
91
|
-
<TouchableWithoutFeedback
|
|
92
|
-
onPress={onPress}
|
|
93
|
-
accessible={true}
|
|
94
|
-
accessibilityRole={"button"}
|
|
95
|
-
accessibilityLabel={
|
|
96
|
-
accessibilityLabel +
|
|
97
|
-
(isOpen ? "Paragrafo espanso" : "Paragrafo chiuso")
|
|
98
|
-
}
|
|
99
|
-
>
|
|
100
|
-
<View style={[styles.row, headerStyle]}>
|
|
101
|
-
<View style={styles.internalHeader}>{props.header}</View>
|
|
102
|
-
<Animated.View
|
|
103
|
-
testID={"ArrowAccordion"}
|
|
104
|
-
style={{
|
|
105
|
-
...styles.headerIcon,
|
|
106
|
-
transform: [{ rotateZ: arrowAngle }]
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
<Icon name="chevronTop" color="blue" size={24} />
|
|
110
|
-
</Animated.View>
|
|
111
|
-
</View>
|
|
112
|
-
</TouchableWithoutFeedback>
|
|
113
|
-
{isOpen && props.children}
|
|
114
|
-
</View>
|
|
115
|
-
);
|
|
116
|
-
};
|