@pagopa/io-app-design-system 5.3.8 → 5.4.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/README.md +3 -2
- 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 +1 -2
- 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 +3 -395
- 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 +3 -12
- package/lib/commonjs/components/contentWrapper/ContentWrapper.js +6 -2
- package/lib/commonjs/components/contentWrapper/ContentWrapper.js.map +1 -1
- 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/listitems/ListItemNav.js +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.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 +36 -86
- 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 +2 -17
- package/lib/commonjs/core/IOStyles.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 +2 -3
- 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 +3 -395
- 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 +3 -12
- package/lib/module/components/contentWrapper/ContentWrapper.js +6 -2
- package/lib/module/components/contentWrapper/ContentWrapper.js.map +1 -1
- 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/listitems/ListItemNav.js +2 -2
- package/lib/module/components/listitems/ListItemNav.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 +36 -86
- 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 +1 -16
- package/lib/module/core/IOStyles.js.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/contentWrapper/ContentWrapper.d.ts +6 -4
- package/lib/typescript/components/contentWrapper/ContentWrapper.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/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/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 -14
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/package.json +1 -1
- 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 +3 -6
- package/src/components/buttons/IconButtonContained.tsx +3 -6
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -395
- 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 +3 -12
- package/src/components/contentWrapper/ContentWrapper.tsx +18 -8
- 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/listitems/ListItemNav.tsx +1 -1
- 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 +36 -86
- package/src/components/typography/IOText.tsx +3 -0
- package/src/core/IOStyles.ts +1 -18
|
@@ -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
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/buttons/IOButton/index.tsx"],"mappings":";;AAAA,cAAc,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { interpolateColor, useAnimatedProps, useAnimatedStyle } from "react-native-reanimated";
|
|
4
|
+
import { IOColors, hexToRgba, useIOTheme } from "../../../core";
|
|
5
|
+
export const useButtonColorMap = variant => {
|
|
6
|
+
const theme = useIOTheme();
|
|
7
|
+
const mapColorStatesVariantSolid = {
|
|
8
|
+
// Primary
|
|
9
|
+
primary: {
|
|
10
|
+
background: {
|
|
11
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
12
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
13
|
+
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
14
|
+
},
|
|
15
|
+
foreground: {
|
|
16
|
+
default: IOColors[theme["buttonText-default"]],
|
|
17
|
+
pressed: IOColors[theme["buttonText-default"]],
|
|
18
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
// Danger
|
|
22
|
+
danger: {
|
|
23
|
+
background: {
|
|
24
|
+
default: IOColors["error-600"],
|
|
25
|
+
pressed: IOColors["error-500"],
|
|
26
|
+
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
27
|
+
},
|
|
28
|
+
foreground: {
|
|
29
|
+
default: IOColors[theme["buttonText-danger"]],
|
|
30
|
+
pressed: IOColors[theme["buttonText-danger"]],
|
|
31
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
// Contrast
|
|
35
|
+
contrast: {
|
|
36
|
+
background: {
|
|
37
|
+
default: IOColors.white,
|
|
38
|
+
pressed: IOColors["blueIO-50"],
|
|
39
|
+
disabled: IOColors["blueIO-50"]
|
|
40
|
+
},
|
|
41
|
+
foreground: {
|
|
42
|
+
default: IOColors["blueIO-500"],
|
|
43
|
+
pressed: IOColors["blueIO-500"],
|
|
44
|
+
disabled: IOColors["blueIO-500"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const mapColorStatesVariantOutline = {
|
|
49
|
+
// Primary
|
|
50
|
+
primary: {
|
|
51
|
+
background: {
|
|
52
|
+
default: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0),
|
|
53
|
+
pressed: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0.1),
|
|
54
|
+
disabled: "transparent"
|
|
55
|
+
},
|
|
56
|
+
foreground: {
|
|
57
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
58
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
59
|
+
disabled: IOColors[theme["interactiveOutline-disabled"]]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
// Danger
|
|
63
|
+
danger: {
|
|
64
|
+
background: {
|
|
65
|
+
default: hexToRgba(IOColors["error-600"], 0),
|
|
66
|
+
pressed: hexToRgba(IOColors["error-600"], 0.1),
|
|
67
|
+
disabled: "transparent"
|
|
68
|
+
},
|
|
69
|
+
foreground: {
|
|
70
|
+
default: IOColors[theme.errorText],
|
|
71
|
+
pressed: IOColors[theme.errorText],
|
|
72
|
+
disabled: IOColors[theme["buttonText-disabled"]]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
// Contrast
|
|
76
|
+
contrast: {
|
|
77
|
+
background: {
|
|
78
|
+
default: hexToRgba(IOColors["blueIO-600"], 0),
|
|
79
|
+
pressed: hexToRgba(IOColors["blueIO-600"], 0.5),
|
|
80
|
+
disabled: "transparent"
|
|
81
|
+
},
|
|
82
|
+
foreground: {
|
|
83
|
+
default: IOColors.white,
|
|
84
|
+
pressed: IOColors.white,
|
|
85
|
+
disabled: IOColors["blueIO-200"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const transparentLinkBackground = {
|
|
90
|
+
default: "transparent",
|
|
91
|
+
pressed: "transparent",
|
|
92
|
+
disabled: "transparent"
|
|
93
|
+
};
|
|
94
|
+
const mapColorStatesVariantLink = {
|
|
95
|
+
// Primary
|
|
96
|
+
primary: {
|
|
97
|
+
foreground: {
|
|
98
|
+
default: IOColors[theme["interactiveElem-default"]],
|
|
99
|
+
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
100
|
+
disabled: hexToRgba(IOColors[theme["interactiveElem-default"]], 0.85)
|
|
101
|
+
},
|
|
102
|
+
background: transparentLinkBackground
|
|
103
|
+
},
|
|
104
|
+
// Danger
|
|
105
|
+
danger: {
|
|
106
|
+
foreground: {
|
|
107
|
+
default: IOColors[theme.errorText],
|
|
108
|
+
pressed: IOColors[theme.errorText],
|
|
109
|
+
disabled: hexToRgba(IOColors[theme.errorText], 0.85)
|
|
110
|
+
},
|
|
111
|
+
background: transparentLinkBackground
|
|
112
|
+
},
|
|
113
|
+
// Contrast
|
|
114
|
+
contrast: {
|
|
115
|
+
foreground: {
|
|
116
|
+
default: IOColors.white,
|
|
117
|
+
pressed: hexToRgba(IOColors.white, 0.85),
|
|
118
|
+
disabled: hexToRgba(IOColors.white, 0.5)
|
|
119
|
+
},
|
|
120
|
+
background: transparentLinkBackground
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const colorMap = {
|
|
124
|
+
solid: mapColorStatesVariantSolid,
|
|
125
|
+
outline: mapColorStatesVariantOutline,
|
|
126
|
+
link: mapColorStatesVariantLink
|
|
127
|
+
};
|
|
128
|
+
return colorMap[variant];
|
|
129
|
+
};
|
|
130
|
+
export const useButtonAnimatedStyles = (variant, color, progress) => {
|
|
131
|
+
const mapColorStates = useButtonColorMap(variant);
|
|
132
|
+
|
|
133
|
+
// Interpolate animation values from `isPressed` values
|
|
134
|
+
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
135
|
+
// `link` variant doesn't need this animated style
|
|
136
|
+
if (variant === "link") {
|
|
137
|
+
return {};
|
|
138
|
+
}
|
|
139
|
+
const backgroundColor = interpolateColor(progress.value, [0, 1], [mapColorStates[color].background.default, mapColorStates[color].background.pressed]);
|
|
140
|
+
const borderColor = interpolateColor(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed]);
|
|
141
|
+
return variant === "outline" ? {
|
|
142
|
+
backgroundColor,
|
|
143
|
+
borderColor
|
|
144
|
+
} : {
|
|
145
|
+
backgroundColor
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
const pressedColorLabelAnimationStyle = useAnimatedStyle(() => ({
|
|
149
|
+
color: interpolateColor(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed])
|
|
150
|
+
}));
|
|
151
|
+
const iconColorAnimatedStyle = useAnimatedProps(() => ({
|
|
152
|
+
color: interpolateColor(progress.value, [0, 1], [mapColorStates[color]?.foreground?.default, mapColorStates[color]?.foreground?.pressed])
|
|
153
|
+
}));
|
|
154
|
+
return {
|
|
155
|
+
buttonAnimatedStyle: pressedAnimationStyle,
|
|
156
|
+
labelAnimatedStyle: pressedColorLabelAnimationStyle,
|
|
157
|
+
iconColorAnimatedStyle
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["interpolateColor","useAnimatedProps","useAnimatedStyle","IOColors","hexToRgba","useIOTheme","useButtonColorMap","variant","theme","mapColorStatesVariantSolid","primary","background","default","pressed","disabled","foreground","danger","contrast","white","mapColorStatesVariantOutline","errorText","transparentLinkBackground","mapColorStatesVariantLink","colorMap","solid","outline","link","useButtonAnimatedStyles","color","progress","mapColorStates","pressedAnimationStyle","backgroundColor","value","borderColor","pressedColorLabelAnimationStyle","iconColorAnimatedStyle","buttonAnimatedStyle","labelAnimatedStyle"],"sourceRoot":"../../../../../src","sources":["components/buttons/IOButton/styles.tsx"],"mappings":";;AAAA,SACEA,gBAAgB,EAEhBC,gBAAgB,EAChBC,gBAAgB,QAC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,CACEH,cAAc,CAACF,KAAK,CAAC,CAACb,UAAU,CAACH,OAAO,EACxCkB,cAAc,CAACF,KAAK,CAAC,CAACb,UAAU,CAACF,OAAO,CAE5C;EACF,CAAC,CAAC,CAAC;EAEH,MAAMuB,sBAAsB,GAAGnC,gBAAgB,CAAC,OAAO;IACrD2B,KAAK,EAAE5B,gBAAgB,CACrB6B,QAAQ,CAACI,KAAK,EACd,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CACEH,cAAc,CAACF,KAAK,CAAC,EAAEb,UAAU,EAAEH,OAAO,EAC1CkB,cAAc,CAACF,KAAK,CAAC,EAAEb,UAAU,EAAEF,OAAO,CAE9C;EACF,CAAC,CAAC,CAAC;EAEH,OAAO;IACLwB,mBAAmB,EAAEN,qBAAqB;IAC1CO,kBAAkB,EAAEH,+BAA+B;IACnDC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,8 @@ import { Pressable } from "react-native";
|
|
|
5
5
|
import Animated, { interpolateColor, useAnimatedProps, useReducedMotion } from "react-native-reanimated";
|
|
6
6
|
import { IOColors, IOIconButtonStyles, IOStyles, IOThemeLight, hexToRgba, useIOTheme } from "../../core";
|
|
7
7
|
import { useScaleAnimation } from "../../hooks";
|
|
8
|
-
import { AnimatedIcon,
|
|
8
|
+
import { AnimatedIcon, AnimatedIconWithColorTransition } from "../icons";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const AnimatedIconClassComponent = Animated.createAnimatedComponent(IconClassComponent);
|
|
11
10
|
export const IconButton = ({
|
|
12
11
|
color = "primary",
|
|
13
12
|
persistentColorMode = false,
|
|
@@ -86,7 +85,7 @@ export const IconButton = ({
|
|
|
86
85
|
testID: testID,
|
|
87
86
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
88
87
|
style: [IOIconButtonStyles.buttonSizeSmall, IOStyles.alignCenter, IOStyles.centerJustified, !disabled && !reducedMotion && scaleAnimatedStyle],
|
|
89
|
-
children: !disabled ? /*#__PURE__*/_jsx(
|
|
88
|
+
children: !disabled ? /*#__PURE__*/_jsx(AnimatedIconWithColorTransition, {
|
|
90
89
|
allowFontScaling: true,
|
|
91
90
|
name: icon,
|
|
92
91
|
size: iconSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","Animated","interpolateColor","useAnimatedProps","useReducedMotion","IOColors","IOIconButtonStyles","IOStyles","IOThemeLight","hexToRgba","useIOTheme","useScaleAnimation","AnimatedIcon","
|
|
1
|
+
{"version":3,"names":["React","Pressable","Animated","interpolateColor","useAnimatedProps","useReducedMotion","IOColors","IOIconButtonStyles","IOStyles","IOThemeLight","hexToRgba","useIOTheme","useScaleAnimation","AnimatedIcon","AnimatedIconWithColorTransition","jsx","_jsx","IconButton","color","persistentColorMode","icon","iconSize","disabled","onPress","accessibilityLabel","accessibilityHint","testID","theme","progress","onPressIn","onPressOut","scaleAnimatedStyle","reducedMotion","mapColorStates","primary","default","pressed","neutral","contrast","white","animatedColor","iconColor","value","accessible","accessibilityRole","accessibilityState","hitSlop","children","View","style","buttonSizeSmall","alignCenter","centerJustified","allowFontScaling","name","size","animatedProps"],"sourceRoot":"../../../../src","sources":["components/buttons/IconButton.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,SAAS,QAAQ,cAAc;AAC/D,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAChC,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,UAAU,QACL,YAAY;AACnB,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,SACEC,YAAY,EACZC,+BAA+B,QAG1B,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqBlB,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,KAAK,GAAG,SAAS;EACjBC,mBAAmB,GAAG,KAAK;EAC3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AEe,cAAc,CAACf,KAAK,CAAC,EAAEE,IAAI,EAAEe;MAAQ,CAC7C,CAAC,gBAEFnB,IAAA,CAACH,YAAY;QACXwC,gBAAgB;QAChBC,IAAI,EAAElC,IAAK;QACXmC,IAAI,EAAElC,QAAS;QACfH,KAAK,EAAEe,cAAc,CAACf,KAAK,CAAC,EAAEE,IAAI,EAAEE;MAAS,CAC9C;IACF,CACY;EAAC,CACP,CAAC;AAEhB,CAAC;AAED,eAAeL,UAAU","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Pressable } from "react-native";
|
|
5
5
|
import Animated, { interpolateColor, useAnimatedProps, useAnimatedStyle, useReducedMotion } from "react-native-reanimated";
|
|
6
|
-
import { AnimatedIcon,
|
|
6
|
+
import { AnimatedIcon, AnimatedIconWithColorTransition } from "../../components/icons";
|
|
7
7
|
import { IOColors, IOIconButtonStyles, hexToRgba } from "../../core";
|
|
8
8
|
import { useScaleAnimation } from "../../hooks";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -48,7 +48,6 @@ const mapColorStates = {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
const AnimatedIconClassComponent = Animated.createAnimatedComponent(IconClassComponent);
|
|
52
51
|
export const IconButtonContained = ({
|
|
53
52
|
icon,
|
|
54
53
|
color = "primary",
|
|
@@ -91,7 +90,7 @@ export const IconButtonContained = ({
|
|
|
91
90
|
},
|
|
92
91
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
93
92
|
style: [IOIconButtonStyles.button, IOIconButtonStyles.buttonSizeDefault, !disabled && !reducedMotion && scaleAnimatedStyle, !disabled && backgroundColorAnimationStyle],
|
|
94
|
-
children: !disabled ? /*#__PURE__*/_jsx(
|
|
93
|
+
children: !disabled ? /*#__PURE__*/_jsx(AnimatedIconWithColorTransition, {
|
|
95
94
|
name: icon,
|
|
96
95
|
animatedProps: iconColorAnimationStyle,
|
|
97
96
|
color: mapColorStates[color]?.icon?.default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Pressable","Animated","interpolateColor","useAnimatedProps","useAnimatedStyle","useReducedMotion","AnimatedIcon","
|
|
1
|
+
{"version":3,"names":["React","Pressable","Animated","interpolateColor","useAnimatedProps","useAnimatedStyle","useReducedMotion","AnimatedIcon","AnimatedIconWithColorTransition","IOColors","IOIconButtonStyles","hexToRgba","useScaleAnimation","jsx","_jsx","mapColorStates","primary","background","default","pressed","disabled","icon","neutral","white","black","contrast","IconButtonContained","color","onPress","accessibilityLabel","accessibilityHint","testID","progress","onPressIn","onPressOut","scaleAnimatedStyle","reducedMotion","backgroundColorAnimationStyle","backgroundColor","value","iconColorAnimationStyle","accessibilityRole","accessibilityState","accessible","style","alignSelf","children","View","button","buttonSizeDefault","name","animatedProps"],"sourceRoot":"../../../../src","sources":["components/buttons/IconButtonContained.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAgCC,SAAS,QAAQ,cAAc;AAC/D,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAChC,SACEC,YAAY,EACZC,+BAA+B,QAE1B,wBAAwB;AAC/B,SAASC,QAAQ,EAAEC,kBAAkB,EAAEC,SAAS,QAAQ,YAAY;AACpE,SAASC,iBAAiB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAyBhD,MAAMC,cAGL,GAAG;EACF;EACAC,OAAO,EAAE;IACPC,UAAU,EAAE;MACVC,OAAO,EAAEP,SAAS,CAACF,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;MAC7CU,OAAO,EAAER,SAAS,CAACF,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;MAChDW,QAAQ,EAAE;IACZ,CAAC;IACDC,IAAI,EAAE;MACJH,OAAO,EAAET,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