@pagopa/io-app-design-system 5.3.9 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/lib/commonjs/components/accordion/AccordionItem.js +4 -2
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/alert/Alert.js +5 -11
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js +3 -2
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/commonjs/components/alert/AlertEdgeToEdgeWrapper.js +3 -2
- package/lib/commonjs/components/alert/AlertEdgeToEdgeWrapper.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +5 -2
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +20 -15
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IOButton/IOButton.js +230 -0
- package/lib/commonjs/components/buttons/IOButton/IOButton.js.map +1 -0
- package/lib/commonjs/components/buttons/IOButton/__test__/IOButton.test.js +43 -0
- package/lib/commonjs/components/buttons/IOButton/__test__/IOButton.test.js.map +1 -0
- package/lib/commonjs/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
- package/lib/commonjs/components/buttons/IOButton/index.js +17 -0
- package/lib/commonjs/components/buttons/IOButton/index.js.map +1 -0
- package/lib/commonjs/components/buttons/IOButton/styles.js +166 -0
- package/lib/commonjs/components/buttons/IOButton/styles.js.map +1 -0
- package/lib/commonjs/components/buttons/IconButton.js +2 -3
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +1 -2
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
- package/lib/commonjs/components/buttons/__test__/button.test.js +0 -24
- package/lib/commonjs/components/buttons/__test__/button.test.js.map +1 -1
- package/lib/commonjs/components/buttons/index.js +11 -0
- package/lib/commonjs/components/buttons/index.js.map +1 -1
- package/lib/commonjs/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
- package/lib/commonjs/components/icons/Icon.js +11 -9
- package/lib/commonjs/components/icons/Icon.js.map +1 -1
- package/lib/commonjs/components/layout/FooterActions.js +10 -9
- package/lib/commonjs/components/layout/FooterActions.js.map +1 -1
- package/lib/commonjs/components/layout/FooterActionsInline.js +8 -8
- package/lib/commonjs/components/layout/FooterActionsInline.js.map +1 -1
- package/lib/commonjs/components/layout/GradientBottomActions.js +8 -8
- package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
- package/lib/commonjs/components/layout/GradientScrollView.js.map +1 -1
- package/lib/commonjs/components/layout/ModalBSHeader.js +3 -1
- package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAmount.js +3 -1
- package/lib/commonjs/components/listitems/ListItemAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +3 -2
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +4 -2
- package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +3 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +3 -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 +3 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +10 -2
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
- package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js +6 -6
- package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberButton.js +15 -2
- package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberPad.js +9 -6
- package/lib/commonjs/components/numberpad/NumberPad.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
- package/lib/commonjs/components/otpInput/OTPInput.js +3 -3
- package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js +3 -3
- package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/commonjs/components/stepper/Stepper.js +5 -2
- package/lib/commonjs/components/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/components/typography/IOText.js +4 -1
- package/lib/commonjs/components/typography/IOText.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +3 -53
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/module/components/accordion/AccordionItem.js +5 -3
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/alert/Alert.js +6 -12
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/alert/AlertEdgeToEdge.js +3 -2
- package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/module/components/alert/AlertEdgeToEdgeWrapper.js +3 -2
- package/lib/module/components/alert/AlertEdgeToEdgeWrapper.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +6 -3
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +21 -16
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +4 -1
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IOButton/IOButton.js +223 -0
- package/lib/module/components/buttons/IOButton/IOButton.js.map +1 -0
- package/lib/module/components/buttons/IOButton/__test__/IOButton.test.js +40 -0
- package/lib/module/components/buttons/IOButton/__test__/IOButton.test.js.map +1 -0
- package/lib/module/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
- package/lib/module/components/buttons/IOButton/index.js +4 -0
- package/lib/module/components/buttons/IOButton/index.js.map +1 -0
- package/lib/module/components/buttons/IOButton/styles.js +160 -0
- package/lib/module/components/buttons/IOButton/styles.js.map +1 -0
- package/lib/module/components/buttons/IconButton.js +4 -5
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +2 -3
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
- package/lib/module/components/buttons/__test__/button.test.js +0 -24
- package/lib/module/components/buttons/__test__/button.test.js.map +1 -1
- package/lib/module/components/buttons/index.js +1 -0
- package/lib/module/components/buttons/index.js.map +1 -1
- package/lib/module/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
- package/lib/module/components/icons/Icon.js +10 -7
- package/lib/module/components/icons/Icon.js.map +1 -1
- package/lib/module/components/layout/FooterActions.js +11 -10
- package/lib/module/components/layout/FooterActions.js.map +1 -1
- package/lib/module/components/layout/FooterActionsInline.js +9 -9
- package/lib/module/components/layout/FooterActionsInline.js.map +1 -1
- package/lib/module/components/layout/GradientBottomActions.js +9 -9
- package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
- package/lib/module/components/layout/GradientScrollView.js.map +1 -1
- package/lib/module/components/layout/ModalBSHeader.js +4 -2
- package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemAmount.js +4 -2
- package/lib/module/components/listitems/ListItemAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +4 -3
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +5 -3
- package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +4 -2
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +4 -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 +4 -2
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +11 -3
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
- package/lib/module/components/loadingSpinner/LoadingSpinner.js +6 -6
- package/lib/module/components/loadingSpinner/LoadingSpinner.js.map +1 -1
- package/lib/module/components/numberpad/NumberButton.js +16 -3
- package/lib/module/components/numberpad/NumberButton.js.map +1 -1
- package/lib/module/components/numberpad/NumberPad.js +10 -7
- package/lib/module/components/numberpad/NumberPad.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
- package/lib/module/components/otpInput/OTPInput.js +3 -3
- package/lib/module/components/otpInput/OTPInput.js.map +1 -1
- package/lib/module/components/radio/RadioButtonLabel.js +3 -3
- package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/module/components/stepper/Stepper.js +6 -3
- package/lib/module/components/stepper/Stepper.js.map +1 -1
- package/lib/module/components/typography/IOText.js +2 -0
- package/lib/module/components/typography/IOText.js.map +1 -1
- package/lib/module/core/IOStyles.js +3 -53
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/alert/AlertEdgeToEdge.d.ts.map +1 -1
- package/lib/typescript/components/alert/AlertEdgeToEdgeWrapper.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +3 -0
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +3 -0
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +3 -0
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IOButton/IOButton.d.ts +57 -0
- package/lib/typescript/components/buttons/IOButton/IOButton.d.ts.map +1 -0
- package/lib/typescript/components/buttons/IOButton/__test__/IOButton.test.d.ts +2 -0
- package/lib/typescript/components/buttons/IOButton/__test__/IOButton.test.d.ts.map +1 -0
- package/lib/typescript/components/buttons/IOButton/index.d.ts +2 -0
- package/lib/typescript/components/buttons/IOButton/index.d.ts.map +1 -0
- package/lib/typescript/components/buttons/IOButton/styles.d.ts +35 -0
- package/lib/typescript/components/buttons/IOButton/styles.d.ts.map +1 -0
- 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/index.d.ts +1 -0
- package/lib/typescript/components/buttons/index.d.ts.map +1 -1
- package/lib/typescript/components/icons/Icon.d.ts +1 -4
- package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/components/icons/types.d.ts +3 -2
- package/lib/typescript/components/icons/types.d.ts.map +1 -1
- package/lib/typescript/components/layout/FooterActions.d.ts +10 -8
- package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
- package/lib/typescript/components/layout/FooterActionsInline.d.ts +5 -4
- package/lib/typescript/components/layout/FooterActionsInline.d.ts.map +1 -1
- package/lib/typescript/components/layout/GradientBottomActions.d.ts +12 -6
- package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
- package/lib/typescript/components/layout/GradientScrollView.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
- package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts +2 -2
- package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberButton.d.ts +11 -0
- package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberPad.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
- package/lib/typescript/components/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/components/typography/IOText.d.ts +1 -0
- package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +0 -47
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/AccordionItem.tsx +7 -14
- package/src/components/alert/Alert.tsx +7 -21
- package/src/components/alert/AlertEdgeToEdge.tsx +1 -2
- package/src/components/alert/AlertEdgeToEdgeWrapper.tsx +1 -2
- package/src/components/buttons/ButtonLink.tsx +6 -6
- package/src/components/buttons/ButtonOutline.tsx +21 -21
- package/src/components/buttons/ButtonSolid.tsx +4 -1
- package/src/components/buttons/IOButton/IOButton.tsx +363 -0
- package/src/components/buttons/IOButton/__test__/IOButton.test.tsx +46 -0
- package/src/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
- package/src/components/buttons/IOButton/index.tsx +1 -0
- package/src/components/buttons/IOButton/styles.tsx +228 -0
- package/src/components/buttons/IconButton.tsx +4 -9
- package/src/components/buttons/IconButtonContained.tsx +3 -6
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
- package/src/components/buttons/__test__/button.test.tsx +1 -33
- package/src/components/buttons/index.tsx +1 -0
- package/src/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
- package/src/components/icons/Icon.tsx +12 -3
- package/src/components/icons/types.ts +3 -2
- package/src/components/layout/FooterActions.tsx +26 -14
- package/src/components/layout/FooterActionsInline.tsx +19 -12
- package/src/components/layout/GradientBottomActions.tsx +17 -18
- package/src/components/layout/GradientScrollView.tsx +2 -1
- package/src/components/layout/ModalBSHeader.tsx +2 -2
- package/src/components/listitems/ListItemAmount.tsx +1 -2
- package/src/components/listitems/ListItemCheckbox.tsx +8 -11
- package/src/components/listitems/ListItemHeader.tsx +2 -3
- package/src/components/listitems/ListItemInfo.tsx +1 -2
- package/src/components/listitems/ListItemInfoCopy.tsx +1 -2
- package/src/components/listitems/ListItemNav.tsx +1 -1
- package/src/components/listitems/ListItemNavAlert.tsx +1 -2
- package/src/components/listitems/ListItemRadio.tsx +7 -7
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
- package/src/components/loadingSpinner/LoadingSpinner.tsx +8 -8
- package/src/components/numberpad/NumberButton.tsx +18 -11
- package/src/components/numberpad/NumberPad.tsx +8 -10
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
- package/src/components/otpInput/OTPInput.tsx +1 -2
- package/src/components/radio/RadioButtonLabel.tsx +7 -10
- package/src/components/stepper/Stepper.tsx +7 -12
- package/src/components/typography/IOText.tsx +3 -0
- package/src/core/IOStyles.ts +3 -55
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Test Buttons Components IOButton Snapshot · Link variant 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityLabel="accessibilityLabel"
|
|
6
|
+
accessibilityRole="button"
|
|
7
|
+
accessibilityState={
|
|
8
|
+
{
|
|
9
|
+
"busy": false,
|
|
10
|
+
"checked": undefined,
|
|
11
|
+
"disabled": false,
|
|
12
|
+
"expanded": undefined,
|
|
13
|
+
"selected": undefined,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
accessibilityValue={
|
|
17
|
+
{
|
|
18
|
+
"max": undefined,
|
|
19
|
+
"min": undefined,
|
|
20
|
+
"now": undefined,
|
|
21
|
+
"text": undefined,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
accessible={true}
|
|
25
|
+
collapsable={false}
|
|
26
|
+
focusable={true}
|
|
27
|
+
hitSlop={
|
|
28
|
+
{
|
|
29
|
+
"bottom": 14,
|
|
30
|
+
"left": 24,
|
|
31
|
+
"right": 24,
|
|
32
|
+
"top": 14,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
onBlur={[Function]}
|
|
36
|
+
onClick={[Function]}
|
|
37
|
+
onFocus={[Function]}
|
|
38
|
+
onResponderGrant={[Function]}
|
|
39
|
+
onResponderMove={[Function]}
|
|
40
|
+
onResponderRelease={[Function]}
|
|
41
|
+
onResponderTerminate={[Function]}
|
|
42
|
+
onResponderTerminationRequest={[Function]}
|
|
43
|
+
onStartShouldSetResponder={[Function]}
|
|
44
|
+
style={
|
|
45
|
+
{
|
|
46
|
+
"alignSelf": "flex-start",
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
<View
|
|
51
|
+
style={
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"alignItems": "center",
|
|
55
|
+
"borderCurve": "continuous",
|
|
56
|
+
"elevation": 0,
|
|
57
|
+
"flexDirection": "row",
|
|
58
|
+
"justifyContent": "center",
|
|
59
|
+
"overflow": "hidden",
|
|
60
|
+
"textAlignVertical": "center",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"paddingHorizontal": 0,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"backgroundColor": "transparent",
|
|
67
|
+
"borderColor": "#0B3EE3",
|
|
68
|
+
"borderRadius": 8,
|
|
69
|
+
"borderWidth": 0,
|
|
70
|
+
"height": undefined,
|
|
71
|
+
},
|
|
72
|
+
{},
|
|
73
|
+
{
|
|
74
|
+
"transform": [
|
|
75
|
+
{
|
|
76
|
+
"scale": undefined,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{},
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
>
|
|
84
|
+
<View
|
|
85
|
+
style={
|
|
86
|
+
[
|
|
87
|
+
{
|
|
88
|
+
"alignItems": "center",
|
|
89
|
+
"flexDirection": "row",
|
|
90
|
+
"justifyContent": "center",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"columnGap": 8,
|
|
94
|
+
},
|
|
95
|
+
false,
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
<Text
|
|
100
|
+
accessibilityElementsHidden={true}
|
|
101
|
+
accessible={false}
|
|
102
|
+
allowFontScaling={true}
|
|
103
|
+
ellipsizeMode="tail"
|
|
104
|
+
importantForAccessibility="no-hide-descendants"
|
|
105
|
+
maxFontSizeMultiplier={1.5}
|
|
106
|
+
numberOfLines={1}
|
|
107
|
+
style={
|
|
108
|
+
[
|
|
109
|
+
{},
|
|
110
|
+
{
|
|
111
|
+
"color": "#0E0F13",
|
|
112
|
+
"fontFamily": "Titillio",
|
|
113
|
+
"fontSize": 16,
|
|
114
|
+
"fontStyle": "normal",
|
|
115
|
+
"fontWeight": "600",
|
|
116
|
+
"lineHeight": 20,
|
|
117
|
+
},
|
|
118
|
+
[
|
|
119
|
+
{
|
|
120
|
+
"textAlign": "auto",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"color": undefined,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
>
|
|
129
|
+
label
|
|
130
|
+
</Text>
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
</View>
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
exports[`Test Buttons Components IOButton Snapshot · Outline variant 1`] = `
|
|
137
|
+
<View
|
|
138
|
+
accessibilityLabel="accessibilityLabel"
|
|
139
|
+
accessibilityRole="button"
|
|
140
|
+
accessibilityState={
|
|
141
|
+
{
|
|
142
|
+
"busy": false,
|
|
143
|
+
"checked": undefined,
|
|
144
|
+
"disabled": false,
|
|
145
|
+
"expanded": undefined,
|
|
146
|
+
"selected": undefined,
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
accessibilityValue={
|
|
150
|
+
{
|
|
151
|
+
"max": undefined,
|
|
152
|
+
"min": undefined,
|
|
153
|
+
"now": undefined,
|
|
154
|
+
"text": undefined,
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
accessible={true}
|
|
158
|
+
collapsable={false}
|
|
159
|
+
focusable={true}
|
|
160
|
+
onBlur={[Function]}
|
|
161
|
+
onClick={[Function]}
|
|
162
|
+
onFocus={[Function]}
|
|
163
|
+
onResponderGrant={[Function]}
|
|
164
|
+
onResponderMove={[Function]}
|
|
165
|
+
onResponderRelease={[Function]}
|
|
166
|
+
onResponderTerminate={[Function]}
|
|
167
|
+
onResponderTerminationRequest={[Function]}
|
|
168
|
+
onStartShouldSetResponder={[Function]}
|
|
169
|
+
style={
|
|
170
|
+
{
|
|
171
|
+
"alignSelf": "auto",
|
|
172
|
+
"flexShrink": 1,
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
>
|
|
176
|
+
<View
|
|
177
|
+
style={
|
|
178
|
+
[
|
|
179
|
+
{
|
|
180
|
+
"alignItems": "center",
|
|
181
|
+
"borderCurve": "continuous",
|
|
182
|
+
"elevation": 0,
|
|
183
|
+
"flexDirection": "row",
|
|
184
|
+
"justifyContent": "center",
|
|
185
|
+
"overflow": "hidden",
|
|
186
|
+
"textAlignVertical": "center",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"paddingHorizontal": 24,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"backgroundColor": "rgba(9,50,182,0)",
|
|
193
|
+
"borderColor": "#0B3EE3",
|
|
194
|
+
"borderRadius": 8,
|
|
195
|
+
"borderWidth": 2,
|
|
196
|
+
"height": 48,
|
|
197
|
+
},
|
|
198
|
+
{},
|
|
199
|
+
{
|
|
200
|
+
"transform": [
|
|
201
|
+
{
|
|
202
|
+
"scale": undefined,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"backgroundColor": undefined,
|
|
208
|
+
"borderColor": undefined,
|
|
209
|
+
},
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
>
|
|
213
|
+
<View
|
|
214
|
+
style={
|
|
215
|
+
[
|
|
216
|
+
{
|
|
217
|
+
"alignItems": "center",
|
|
218
|
+
"flexDirection": "row",
|
|
219
|
+
"justifyContent": "center",
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"columnGap": 8,
|
|
223
|
+
},
|
|
224
|
+
false,
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
>
|
|
228
|
+
<Text
|
|
229
|
+
accessibilityElementsHidden={true}
|
|
230
|
+
accessible={false}
|
|
231
|
+
allowFontScaling={true}
|
|
232
|
+
ellipsizeMode="tail"
|
|
233
|
+
importantForAccessibility="no-hide-descendants"
|
|
234
|
+
maxFontSizeMultiplier={1.5}
|
|
235
|
+
numberOfLines={1}
|
|
236
|
+
style={
|
|
237
|
+
[
|
|
238
|
+
{},
|
|
239
|
+
{
|
|
240
|
+
"color": "#0E0F13",
|
|
241
|
+
"fontFamily": "Titillio",
|
|
242
|
+
"fontSize": 16,
|
|
243
|
+
"fontStyle": "normal",
|
|
244
|
+
"fontWeight": "600",
|
|
245
|
+
"lineHeight": undefined,
|
|
246
|
+
},
|
|
247
|
+
[
|
|
248
|
+
{
|
|
249
|
+
"textAlign": "auto",
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"color": undefined,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
>
|
|
258
|
+
label
|
|
259
|
+
</Text>
|
|
260
|
+
</View>
|
|
261
|
+
</View>
|
|
262
|
+
</View>
|
|
263
|
+
`;
|
|
264
|
+
|
|
265
|
+
exports[`Test Buttons Components IOButton Snapshot · Solid variant 1`] = `
|
|
266
|
+
<View
|
|
267
|
+
accessibilityLabel="accessibilityLabel"
|
|
268
|
+
accessibilityRole="button"
|
|
269
|
+
accessibilityState={
|
|
270
|
+
{
|
|
271
|
+
"busy": false,
|
|
272
|
+
"checked": undefined,
|
|
273
|
+
"disabled": false,
|
|
274
|
+
"expanded": undefined,
|
|
275
|
+
"selected": undefined,
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
accessibilityValue={
|
|
279
|
+
{
|
|
280
|
+
"max": undefined,
|
|
281
|
+
"min": undefined,
|
|
282
|
+
"now": undefined,
|
|
283
|
+
"text": undefined,
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
accessible={true}
|
|
287
|
+
collapsable={false}
|
|
288
|
+
focusable={true}
|
|
289
|
+
onBlur={[Function]}
|
|
290
|
+
onClick={[Function]}
|
|
291
|
+
onFocus={[Function]}
|
|
292
|
+
onResponderGrant={[Function]}
|
|
293
|
+
onResponderMove={[Function]}
|
|
294
|
+
onResponderRelease={[Function]}
|
|
295
|
+
onResponderTerminate={[Function]}
|
|
296
|
+
onResponderTerminationRequest={[Function]}
|
|
297
|
+
onStartShouldSetResponder={[Function]}
|
|
298
|
+
style={
|
|
299
|
+
{
|
|
300
|
+
"alignSelf": "auto",
|
|
301
|
+
"flexShrink": 1,
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
>
|
|
305
|
+
<View
|
|
306
|
+
style={
|
|
307
|
+
[
|
|
308
|
+
{
|
|
309
|
+
"alignItems": "center",
|
|
310
|
+
"borderCurve": "continuous",
|
|
311
|
+
"elevation": 0,
|
|
312
|
+
"flexDirection": "row",
|
|
313
|
+
"justifyContent": "center",
|
|
314
|
+
"overflow": "hidden",
|
|
315
|
+
"textAlignVertical": "center",
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"paddingHorizontal": 24,
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"backgroundColor": "#0B3EE3",
|
|
322
|
+
"borderColor": "#FFFFFF",
|
|
323
|
+
"borderRadius": 8,
|
|
324
|
+
"borderWidth": 0,
|
|
325
|
+
"height": 48,
|
|
326
|
+
},
|
|
327
|
+
{},
|
|
328
|
+
{
|
|
329
|
+
"transform": [
|
|
330
|
+
{
|
|
331
|
+
"scale": undefined,
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"backgroundColor": undefined,
|
|
337
|
+
},
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
>
|
|
341
|
+
<View
|
|
342
|
+
style={
|
|
343
|
+
[
|
|
344
|
+
{
|
|
345
|
+
"alignItems": "center",
|
|
346
|
+
"flexDirection": "row",
|
|
347
|
+
"justifyContent": "center",
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"columnGap": 8,
|
|
351
|
+
},
|
|
352
|
+
false,
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
>
|
|
356
|
+
<Text
|
|
357
|
+
accessibilityElementsHidden={true}
|
|
358
|
+
accessible={false}
|
|
359
|
+
allowFontScaling={true}
|
|
360
|
+
ellipsizeMode="tail"
|
|
361
|
+
importantForAccessibility="no-hide-descendants"
|
|
362
|
+
maxFontSizeMultiplier={1.5}
|
|
363
|
+
numberOfLines={1}
|
|
364
|
+
style={
|
|
365
|
+
[
|
|
366
|
+
{},
|
|
367
|
+
{
|
|
368
|
+
"color": "#0E0F13",
|
|
369
|
+
"fontFamily": "Titillio",
|
|
370
|
+
"fontSize": 16,
|
|
371
|
+
"fontStyle": "normal",
|
|
372
|
+
"fontWeight": "600",
|
|
373
|
+
"lineHeight": undefined,
|
|
374
|
+
},
|
|
375
|
+
[
|
|
376
|
+
{
|
|
377
|
+
"textAlign": "auto",
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"color": undefined,
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
>
|
|
386
|
+
label
|
|
387
|
+
</Text>
|
|
388
|
+
</View>
|
|
389
|
+
</View>
|
|
390
|
+
</View>
|
|
391
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./IOButton";
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
interpolateColor,
|
|
3
|
+
SharedValue,
|
|
4
|
+
useAnimatedProps,
|
|
5
|
+
useAnimatedStyle
|
|
6
|
+
} from "react-native-reanimated";
|
|
7
|
+
import { IOColors, hexToRgba, useIOTheme } from "../../../core";
|
|
8
|
+
import { IOButtonColor, IOButtonProps, IOButtonVariant } from "./IOButton";
|
|
9
|
+
|
|
10
|
+
type ColorStates = {
|
|
11
|
+
background: {
|
|
12
|
+
default: string;
|
|
13
|
+
pressed: string;
|
|
14
|
+
disabled: string;
|
|
15
|
+
};
|
|
16
|
+
foreground: {
|
|
17
|
+
default: string;
|
|
18
|
+
pressed: string;
|
|
19
|
+
disabled: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const useButtonColorMap = (variant: IOButtonVariant) => {
|
|
24
|
+
const theme = useIOTheme();
|
|
25
|
+
|
|
26
|
+
const mapColorStatesVariantSolid: Record<
|
|
27
|
+
NonNullable<IOButtonProps["color"]>,
|
|
28
|
+
ColorStates
|
|
29
|
+
> = {
|
|
30
|
+
// Primary
|
|
31
|
+
primary: {
|
|
32
|
+
background: {
|
|
33
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
34
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
35
|
+
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
36
|
+
},
|
|
37
|
+
foreground: {
|
|
38
|
+
default: IOColors[theme["buttonText-default"]],
|
|
39
|
+
pressed: IOColors[theme["buttonText-default"]],
|
|
40
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
// Danger
|
|
44
|
+
danger: {
|
|
45
|
+
background: {
|
|
46
|
+
default: IOColors["error-600"],
|
|
47
|
+
pressed: IOColors["error-500"],
|
|
48
|
+
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
49
|
+
},
|
|
50
|
+
foreground: {
|
|
51
|
+
default: IOColors[theme["buttonText-danger"]],
|
|
52
|
+
pressed: IOColors[theme["buttonText-danger"]],
|
|
53
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
// Contrast
|
|
57
|
+
contrast: {
|
|
58
|
+
background: {
|
|
59
|
+
default: IOColors.white,
|
|
60
|
+
pressed: IOColors["blueIO-50"],
|
|
61
|
+
disabled: IOColors["blueIO-50"]
|
|
62
|
+
},
|
|
63
|
+
foreground: {
|
|
64
|
+
default: IOColors["blueIO-500"],
|
|
65
|
+
pressed: IOColors["blueIO-500"],
|
|
66
|
+
disabled: IOColors["blueIO-500"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const mapColorStatesVariantOutline: Record<
|
|
72
|
+
NonNullable<IOButtonProps["color"]>,
|
|
73
|
+
ColorStates
|
|
74
|
+
> = {
|
|
75
|
+
// Primary
|
|
76
|
+
primary: {
|
|
77
|
+
background: {
|
|
78
|
+
default: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0),
|
|
79
|
+
pressed: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0.1),
|
|
80
|
+
disabled: "transparent"
|
|
81
|
+
},
|
|
82
|
+
foreground: {
|
|
83
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
84
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
85
|
+
disabled: IOColors[theme["interactiveOutline-disabled"]]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
// Danger
|
|
89
|
+
danger: {
|
|
90
|
+
background: {
|
|
91
|
+
default: hexToRgba(IOColors["error-600"], 0),
|
|
92
|
+
pressed: hexToRgba(IOColors["error-600"], 0.1),
|
|
93
|
+
disabled: "transparent"
|
|
94
|
+
},
|
|
95
|
+
foreground: {
|
|
96
|
+
default: IOColors[theme.errorText],
|
|
97
|
+
pressed: IOColors[theme.errorText],
|
|
98
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
// Contrast
|
|
102
|
+
contrast: {
|
|
103
|
+
background: {
|
|
104
|
+
default: hexToRgba(IOColors["blueIO-600"], 0),
|
|
105
|
+
pressed: hexToRgba(IOColors["blueIO-600"], 0.5),
|
|
106
|
+
disabled: "transparent"
|
|
107
|
+
},
|
|
108
|
+
foreground: {
|
|
109
|
+
default: IOColors.white,
|
|
110
|
+
pressed: IOColors.white,
|
|
111
|
+
disabled: IOColors["blueIO-200"]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const transparentLinkBackground: ColorStates["background"] = {
|
|
117
|
+
default: "transparent",
|
|
118
|
+
pressed: "transparent",
|
|
119
|
+
disabled: "transparent"
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const mapColorStatesVariantLink: Record<
|
|
123
|
+
NonNullable<IOButtonProps["color"]>,
|
|
124
|
+
ColorStates
|
|
125
|
+
> = {
|
|
126
|
+
// Primary
|
|
127
|
+
primary: {
|
|
128
|
+
foreground: {
|
|
129
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
130
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
131
|
+
disabled: hexToRgba(IOColors[theme["interactiveElem-default"]], 0.85)
|
|
132
|
+
},
|
|
133
|
+
background: transparentLinkBackground
|
|
134
|
+
},
|
|
135
|
+
// Danger
|
|
136
|
+
danger: {
|
|
137
|
+
foreground: {
|
|
138
|
+
default: IOColors[theme.errorText],
|
|
139
|
+
pressed: IOColors[theme.errorText],
|
|
140
|
+
disabled: hexToRgba(IOColors[theme.errorText], 0.85)
|
|
141
|
+
},
|
|
142
|
+
background: transparentLinkBackground
|
|
143
|
+
},
|
|
144
|
+
// Contrast
|
|
145
|
+
contrast: {
|
|
146
|
+
foreground: {
|
|
147
|
+
default: IOColors.white,
|
|
148
|
+
pressed: hexToRgba(IOColors.white, 0.85),
|
|
149
|
+
disabled: hexToRgba(IOColors.white, 0.5)
|
|
150
|
+
},
|
|
151
|
+
background: transparentLinkBackground
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const colorMap = {
|
|
156
|
+
solid: mapColorStatesVariantSolid,
|
|
157
|
+
outline: mapColorStatesVariantOutline,
|
|
158
|
+
link: mapColorStatesVariantLink
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
return colorMap[variant];
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const useButtonAnimatedStyles = (
|
|
165
|
+
variant: IOButtonVariant,
|
|
166
|
+
color: IOButtonColor,
|
|
167
|
+
progress: SharedValue<number>
|
|
168
|
+
) => {
|
|
169
|
+
const mapColorStates = useButtonColorMap(variant);
|
|
170
|
+
|
|
171
|
+
// Interpolate animation values from `isPressed` values
|
|
172
|
+
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
173
|
+
// `link` variant doesn't need this animated style
|
|
174
|
+
if (variant === "link") {
|
|
175
|
+
return {};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const backgroundColor = interpolateColor(
|
|
179
|
+
progress.value,
|
|
180
|
+
[0, 1],
|
|
181
|
+
[
|
|
182
|
+
mapColorStates[color].background.default,
|
|
183
|
+
mapColorStates[color].background.pressed
|
|
184
|
+
]
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const borderColor = interpolateColor(
|
|
188
|
+
progress.value,
|
|
189
|
+
[0, 1],
|
|
190
|
+
[
|
|
191
|
+
mapColorStates[color].foreground.default,
|
|
192
|
+
mapColorStates[color].foreground.pressed
|
|
193
|
+
]
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
return variant === "outline"
|
|
197
|
+
? { backgroundColor, borderColor }
|
|
198
|
+
: { backgroundColor };
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const pressedColorLabelAnimationStyle = useAnimatedStyle(() => ({
|
|
202
|
+
color: interpolateColor(
|
|
203
|
+
progress.value,
|
|
204
|
+
[0, 1],
|
|
205
|
+
[
|
|
206
|
+
mapColorStates[color].foreground.default,
|
|
207
|
+
mapColorStates[color].foreground.pressed
|
|
208
|
+
]
|
|
209
|
+
)
|
|
210
|
+
}));
|
|
211
|
+
|
|
212
|
+
const iconColorAnimatedStyle = useAnimatedProps(() => ({
|
|
213
|
+
color: interpolateColor(
|
|
214
|
+
progress.value,
|
|
215
|
+
[0, 1],
|
|
216
|
+
[
|
|
217
|
+
mapColorStates[color]?.foreground?.default,
|
|
218
|
+
mapColorStates[color]?.foreground?.pressed
|
|
219
|
+
]
|
|
220
|
+
)
|
|
221
|
+
}));
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
buttonAnimatedStyle: pressedAnimationStyle,
|
|
225
|
+
labelAnimatedStyle: pressedColorLabelAnimationStyle,
|
|
226
|
+
iconColorAnimatedStyle
|
|
227
|
+
};
|
|
228
|
+
};
|
|
@@ -8,7 +8,6 @@ import Animated, {
|
|
|
8
8
|
import {
|
|
9
9
|
IOColors,
|
|
10
10
|
IOIconButtonStyles,
|
|
11
|
-
IOStyles,
|
|
12
11
|
IOThemeLight,
|
|
13
12
|
hexToRgba,
|
|
14
13
|
useIOTheme
|
|
@@ -17,9 +16,9 @@ import { useScaleAnimation } from "../../hooks";
|
|
|
17
16
|
import { WithTestID } from "../../utils/types";
|
|
18
17
|
import {
|
|
19
18
|
AnimatedIcon,
|
|
19
|
+
AnimatedIconWithColorTransition,
|
|
20
20
|
IOIconSizeScale,
|
|
21
|
-
IOIcons
|
|
22
|
-
IconClassComponent
|
|
21
|
+
IOIcons
|
|
23
22
|
} from "../icons";
|
|
24
23
|
|
|
25
24
|
export type IconButton = WithTestID<{
|
|
@@ -41,9 +40,6 @@ type ColorStates = {
|
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
42
|
|
|
44
|
-
const AnimatedIconClassComponent =
|
|
45
|
-
Animated.createAnimatedComponent(IconClassComponent);
|
|
46
|
-
|
|
47
43
|
export const IconButton = ({
|
|
48
44
|
color = "primary",
|
|
49
45
|
persistentColorMode = false,
|
|
@@ -127,14 +123,13 @@ export const IconButton = ({
|
|
|
127
123
|
>
|
|
128
124
|
<Animated.View
|
|
129
125
|
style={[
|
|
126
|
+
IOIconButtonStyles.button,
|
|
130
127
|
IOIconButtonStyles.buttonSizeSmall,
|
|
131
|
-
IOStyles.alignCenter,
|
|
132
|
-
IOStyles.centerJustified,
|
|
133
128
|
!disabled && !reducedMotion && scaleAnimatedStyle
|
|
134
129
|
]}
|
|
135
130
|
>
|
|
136
131
|
{!disabled ? (
|
|
137
|
-
<
|
|
132
|
+
<AnimatedIconWithColorTransition
|
|
138
133
|
allowFontScaling
|
|
139
134
|
name={icon}
|
|
140
135
|
size={iconSize}
|
|
@@ -8,8 +8,8 @@ import Animated, {
|
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
9
|
import {
|
|
10
10
|
AnimatedIcon,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
AnimatedIconWithColorTransition,
|
|
12
|
+
IOIcons
|
|
13
13
|
} from "../../components/icons";
|
|
14
14
|
import { IOColors, IOIconButtonStyles, hexToRgba } from "../../core";
|
|
15
15
|
import { useScaleAnimation } from "../../hooks";
|
|
@@ -82,9 +82,6 @@ const mapColorStates: Record<
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const AnimatedIconClassComponent =
|
|
86
|
-
Animated.createAnimatedComponent(IconClassComponent);
|
|
87
|
-
|
|
88
85
|
export const IconButtonContained = ({
|
|
89
86
|
icon,
|
|
90
87
|
color = "primary",
|
|
@@ -141,7 +138,7 @@ export const IconButtonContained = ({
|
|
|
141
138
|
]}
|
|
142
139
|
>
|
|
143
140
|
{!disabled ? (
|
|
144
|
-
<
|
|
141
|
+
<AnimatedIconWithColorTransition
|
|
145
142
|
name={icon}
|
|
146
143
|
animatedProps={iconColorAnimationStyle}
|
|
147
144
|
color={mapColorStates[color]?.icon?.default}
|