@pi-spi/app 2.0.0 → 2.1.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.
Files changed (146) hide show
  1. package/lib/module/core/api.js +14 -5
  2. package/lib/module/core/api.js.map +1 -1
  3. package/lib/module/l10n/app_localizations.js.map +1 -1
  4. package/lib/module/l10n/app_localizations_en.js +8 -0
  5. package/lib/module/l10n/app_localizations_en.js.map +1 -1
  6. package/lib/module/l10n/app_localizations_fr.js +8 -0
  7. package/lib/module/l10n/app_localizations_fr.js.map +1 -1
  8. package/lib/module/l10n/app_localizations_pt.js +8 -0
  9. package/lib/module/l10n/app_localizations_pt.js.map +1 -1
  10. package/lib/module/modules/categorie/presentation/pages/categorie_edit_icon_btn.js +25 -35
  11. package/lib/module/modules/categorie/presentation/pages/categorie_edit_icon_btn.js.map +1 -1
  12. package/lib/module/modules/profile/presentation/pages/profile_page_avatar.js +6 -28
  13. package/lib/module/modules/profile/presentation/pages/profile_page_avatar.js.map +1 -1
  14. package/lib/module/modules/profile/presentation/pages/profile_page_contacts.js +0 -1
  15. package/lib/module/modules/profile/presentation/pages/profile_page_contacts.js.map +1 -1
  16. package/lib/module/modules/profile/presentation/pages/profile_page_contacts_actions.js +122 -162
  17. package/lib/module/modules/profile/presentation/pages/profile_page_contacts_actions.js.map +1 -1
  18. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page.js +0 -1
  19. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page.js.map +1 -1
  20. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page_share.js +26 -38
  21. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page_share.js.map +1 -1
  22. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page.js +0 -1
  23. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page.js.map +1 -1
  24. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.js +0 -1
  25. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.js.map +1 -1
  26. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.js +38 -93
  27. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.js.map +1 -1
  28. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.js +0 -1
  29. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.js.map +1 -1
  30. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.js +0 -1
  31. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.js.map +1 -1
  32. package/lib/module/modules/subscription/presentation/pages/subscription_menu_widget.js +23 -42
  33. package/lib/module/modules/subscription/presentation/pages/subscription_menu_widget.js.map +1 -1
  34. package/lib/module/modules/transactions/infra/transaction_output_remote.js +2 -1
  35. package/lib/module/modules/transactions/infra/transaction_output_remote.js.map +1 -1
  36. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.js +0 -1
  37. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.js.map +1 -1
  38. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.js +34 -61
  39. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.js.map +1 -1
  40. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.js +49 -62
  41. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.js.map +1 -1
  42. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.js +68 -88
  43. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.js.map +1 -1
  44. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.js +77 -0
  45. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.js.map +1 -0
  46. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.js +49 -155
  47. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.js.map +1 -1
  48. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.js +8 -28
  49. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.js.map +1 -1
  50. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.js +0 -1
  51. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.js.map +1 -1
  52. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.js +50 -42
  53. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.js.map +1 -1
  54. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.js +0 -1
  55. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.js.map +1 -1
  56. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.js +0 -1
  57. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.js.map +1 -1
  58. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.js +37 -67
  59. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.js.map +1 -1
  60. package/lib/module/shared/widgets/confirm_action_sheet_widget.js +34 -67
  61. package/lib/module/shared/widgets/confirm_action_sheet_widget.js.map +1 -1
  62. package/lib/module/shared/widgets/image_select_widget.js +43 -107
  63. package/lib/module/shared/widgets/image_select_widget.js.map +1 -1
  64. package/lib/module/shared/widgets/notification_dialog.js +25 -35
  65. package/lib/module/shared/widgets/notification_dialog.js.map +1 -1
  66. package/lib/module/shared/widgets/selection.js +381 -5
  67. package/lib/module/shared/widgets/selection.js.map +1 -1
  68. package/lib/typescript/src/core/api.d.ts +6 -0
  69. package/lib/typescript/src/core/api.d.ts.map +1 -1
  70. package/lib/typescript/src/l10n/app_localizations.d.ts +16 -0
  71. package/lib/typescript/src/l10n/app_localizations.d.ts.map +1 -1
  72. package/lib/typescript/src/l10n/app_localizations_en.d.ts.map +1 -1
  73. package/lib/typescript/src/l10n/app_localizations_fr.d.ts.map +1 -1
  74. package/lib/typescript/src/l10n/app_localizations_pt.d.ts.map +1 -1
  75. package/lib/typescript/src/modules/categorie/presentation/pages/categorie_edit_icon_btn.d.ts.map +1 -1
  76. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_avatar.d.ts.map +1 -1
  77. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_contacts.d.ts.map +1 -1
  78. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_contacts_actions.d.ts.map +1 -1
  79. package/lib/typescript/src/modules/qrcode/presentation/pages/qrcode_alias_page.d.ts.map +1 -1
  80. package/lib/typescript/src/modules/qrcode/presentation/pages/qrcode_alias_page_share.d.ts.map +1 -1
  81. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page.d.ts.map +1 -1
  82. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.d.ts.map +1 -1
  83. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.d.ts +2 -2
  84. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.d.ts.map +1 -1
  85. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_menu_widget.d.ts.map +1 -1
  86. package/lib/typescript/src/modules/transactions/infra/transaction_output_remote.d.ts.map +1 -1
  87. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.d.ts.map +1 -1
  88. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.d.ts.map +1 -1
  89. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.d.ts.map +1 -1
  90. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.d.ts +17 -0
  91. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.d.ts.map +1 -0
  92. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.d.ts +6 -2
  93. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.d.ts.map +1 -1
  94. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.d.ts.map +1 -1
  95. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.d.ts.map +1 -1
  96. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.d.ts.map +1 -1
  97. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.d.ts.map +1 -1
  98. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.d.ts.map +1 -1
  99. package/lib/typescript/src/shared/widgets/confirm_action_sheet_widget.d.ts +4 -1
  100. package/lib/typescript/src/shared/widgets/confirm_action_sheet_widget.d.ts.map +1 -1
  101. package/lib/typescript/src/shared/widgets/image_select_widget.d.ts +6 -4
  102. package/lib/typescript/src/shared/widgets/image_select_widget.d.ts.map +1 -1
  103. package/lib/typescript/src/shared/widgets/notification_dialog.d.ts +2 -2
  104. package/lib/typescript/src/shared/widgets/notification_dialog.d.ts.map +1 -1
  105. package/lib/typescript/src/shared/widgets/selection.d.ts +69 -2
  106. package/lib/typescript/src/shared/widgets/selection.d.ts.map +1 -1
  107. package/package.json +1 -1
  108. package/src/core/api.ts +11 -2
  109. package/src/l10n/app_localizations.ts +16 -0
  110. package/src/l10n/app_localizations_en.ts +8 -0
  111. package/src/l10n/app_localizations_fr.ts +8 -0
  112. package/src/l10n/app_localizations_pt.ts +8 -0
  113. package/src/modules/categorie/presentation/pages/categorie_edit_icon_btn.tsx +25 -27
  114. package/src/modules/profile/presentation/pages/profile_page_avatar.tsx +6 -12
  115. package/src/modules/profile/presentation/pages/profile_page_contacts.tsx +0 -1
  116. package/src/modules/profile/presentation/pages/profile_page_contacts_actions.tsx +111 -117
  117. package/src/modules/qrcode/presentation/pages/qrcode_alias_page.tsx +0 -1
  118. package/src/modules/qrcode/presentation/pages/qrcode_alias_page_share.tsx +32 -40
  119. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page.tsx +0 -1
  120. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.tsx +0 -1
  121. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.tsx +20 -59
  122. package/src/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.tsx +1 -1
  123. package/src/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.tsx +1 -1
  124. package/src/modules/subscription/presentation/pages/subscription_menu_widget.tsx +25 -39
  125. package/src/modules/transactions/infra/transaction_output_remote.ts +6 -1
  126. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.tsx +0 -1
  127. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.tsx +39 -41
  128. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.tsx +41 -46
  129. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.tsx +46 -40
  130. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.tsx +92 -0
  131. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.tsx +48 -94
  132. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.tsx +4 -17
  133. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.tsx +0 -1
  134. package/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.tsx +49 -42
  135. package/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.tsx +1 -1
  136. package/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.tsx +0 -1
  137. package/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.tsx +47 -48
  138. package/src/shared/widgets/confirm_action_sheet_widget.tsx +30 -34
  139. package/src/shared/widgets/image_select_widget.tsx +46 -61
  140. package/src/shared/widgets/notification_dialog.tsx +66 -70
  141. package/src/shared/widgets/selection.tsx +292 -4
  142. package/lib/module/modules/transactions/presentation/pages/transaction_details/sheet_box.js +0 -47
  143. package/lib/module/modules/transactions/presentation/pages/transaction_details/sheet_box.js.map +0 -1
  144. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/sheet_box.d.ts +0 -10
  145. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/sheet_box.d.ts.map +0 -1
  146. package/src/modules/transactions/presentation/pages/transaction_details/sheet_box.tsx +0 -30
@@ -1,11 +1,94 @@
1
1
  import { MaterialIcons } from '@expo/vector-icons';
2
- import type { ReactNode } from 'react';
3
- import { Pressable, StyleSheet, Text, useWindowDimensions, View } from 'react-native';
2
+ import { Image } from 'expo-image';
3
+ import type { ComponentProps, ReactNode } from 'react';
4
+ import {
5
+ ActivityIndicator,
6
+ Keyboard,
7
+ Platform,
8
+ Pressable,
9
+ ScrollView,
10
+ StyleSheet,
11
+ Text,
12
+ TextInput,
13
+ useWindowDimensions,
14
+ View,
15
+ } from 'react-native';
4
16
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
17
 
6
18
  import { Themer, useTheme } from '../../core/theme';
19
+ import { Card } from '../material/card';
7
20
  import { withAlpha } from '../utils/color';
8
21
 
22
+ type IconName = ComponentProps<typeof MaterialIcons>['name'];
23
+
24
+ /**
25
+ * Champ de formulaire qui ouvre une feuille de sélection ([onPress]) :
26
+ * [libelle] seul tant que rien n'est choisi, sinon [pastille], [libelle]
27
+ * en petit, [valeur] et éventuellement [detail] (code BIC…).
28
+ */
29
+ export function SelectionChamp({
30
+ libelle,
31
+ valeur,
32
+ detail,
33
+ pastille,
34
+ onPress,
35
+ chargement = false,
36
+ actif = true,
37
+ }: {
38
+ libelle: string;
39
+ valeur?: string | null;
40
+ detail?: string | null;
41
+ pastille?: ReactNode;
42
+ /** Absent : le champ ne réagit pas au toucher. */
43
+ onPress?: () => void;
44
+ /** Liste en cours de chargement : indicateur à la place de la flèche. */
45
+ chargement?: boolean;
46
+ /** `false` : champ grisé (ex. institution tant que le pays n'est pas choisi). */
47
+ actif?: boolean;
48
+ }) {
49
+ const theme = useTheme();
50
+ const desactive = onPress == null || chargement || !actif;
51
+ return (
52
+ <Card style={[styles.champCarte, !actif ? styles.inactif : null]}>
53
+ <Pressable
54
+ accessibilityRole="button"
55
+ disabled={desactive}
56
+ onPress={() => {
57
+ Keyboard.dismiss();
58
+ onPress?.();
59
+ }}
60
+ style={({ pressed }) => [styles.champ, pressed ? { backgroundColor: theme.colorScheme.secondary } : null]}
61
+ >
62
+ {valeur != null && pastille != null && <View style={styles.marge12}>{pastille}</View>}
63
+ <View style={styles.flex}>
64
+ {valeur == null ? (
65
+ <Text style={theme.textTheme.bodySmall}>{libelle}</Text>
66
+ ) : (
67
+ <>
68
+ <Text style={theme.textTheme.displaySmall}>{libelle}</Text>
69
+ <View style={styles.gap2} />
70
+ <Text numberOfLines={1} style={theme.textTheme.displayMedium}>
71
+ {valeur}
72
+ </Text>
73
+ {detail != null && detail.length > 0 && (
74
+ <Text numberOfLines={1} style={[theme.textTheme.displaySmall, { color: Themer.neural03Color }]}>
75
+ {detail}
76
+ </Text>
77
+ )}
78
+ </>
79
+ )}
80
+ </View>
81
+ <View style={styles.gap8w} />
82
+ {chargement ? (
83
+ <ActivityIndicator size="small" color={theme.colorScheme.primary} />
84
+ ) : (
85
+ <MaterialIcons name="keyboard-arrow-down" size={24} color={theme.colorScheme.primary} />
86
+ )}
87
+ </Pressable>
88
+ </Card>
89
+ );
90
+ }
91
+
9
92
  /**
10
93
  * Feuille de sélection : poignée, [titre], [entete] facultatif, puis le
11
94
  * [contenu] (qui défile s'il est trop long : utiliser un ScrollView).
@@ -14,11 +97,14 @@ import { withAlpha } from '../utils/color';
14
97
  export function SelectionSheet({
15
98
  titre,
16
99
  titreSize,
100
+ hauteurMax = 0.75,
17
101
  entete,
18
102
  contenu,
19
103
  }: {
20
104
  titre?: string;
21
105
  titreSize?: number;
106
+ /** Hauteur maximale, en part de la hauteur de l'écran. */
107
+ hauteurMax?: number;
22
108
  entete?: ReactNode;
23
109
  contenu: ReactNode;
24
110
  }) {
@@ -29,7 +115,7 @@ export function SelectionSheet({
29
115
  <View
30
116
  style={[
31
117
  styles.sheet,
32
- { maxHeight: height * 0.75, backgroundColor: theme.colorScheme.surface, paddingBottom: insets.bottom },
118
+ { maxHeight: height * hauteurMax, backgroundColor: theme.colorScheme.surface, paddingBottom: insets.bottom },
33
119
  ]}
34
120
  >
35
121
  {/* Poignée */}
@@ -44,6 +130,55 @@ export function SelectionSheet({
44
130
  );
45
131
  }
46
132
 
133
+ /** Liste d'une feuille de sélection : les [lignes], ou [vide] s'il n'y en a aucune. */
134
+ export function SbSelectionListe({ lignes, vide }: { lignes: ReactNode[]; vide: string }) {
135
+ const theme = useTheme();
136
+ if (lignes.length === 0) {
137
+ return (
138
+ <View style={styles.vide}>
139
+ <Text style={[theme.textTheme.bodySmall, styles.centre]}>{vide}</Text>
140
+ </View>
141
+ );
142
+ }
143
+ return (
144
+ <ScrollView bounces={false} keyboardShouldPersistTaps="handled" contentContainerStyle={styles.liste}>
145
+ {lignes}
146
+ </ScrollView>
147
+ );
148
+ }
149
+
150
+ /** [texte] contient-il [motCle], sans tenir compte des accents ni de la casse ? */
151
+ export function selectionContient(texte: string | null | undefined, motCle: string): boolean {
152
+ if (texte == null) return false;
153
+ const normaliser = (valeur: string) =>
154
+ valeur
155
+ .toLowerCase()
156
+ .trim()
157
+ .normalize('NFD')
158
+ .replace(/[̀-ͯ]/g, '');
159
+ return normaliser(texte).includes(normaliser(motCle));
160
+ }
161
+
162
+ /** Champ de recherche d'une feuille de sélection. */
163
+ export function SbSelectionRecherche({ hintText, onChanged }: { hintText: string; onChanged: (texte: string) => void }) {
164
+ const theme = useTheme();
165
+ return (
166
+ <Card style={styles.rechercheCarte}>
167
+ <View style={[styles.recherche, { backgroundColor: theme.colorScheme.secondary }]}>
168
+ <MaterialIcons name="search" size={22} color={Themer.neural03Color} />
169
+ <TextInput
170
+ style={[theme.textTheme.displayLarge, styles.rechercheInput]}
171
+ placeholder={hintText}
172
+ placeholderTextColor={Themer.neural03Color}
173
+ returnKeyType="search"
174
+ autoCorrect={false}
175
+ onChangeText={onChanged}
176
+ />
177
+ </View>
178
+ </Card>
179
+ );
180
+ }
181
+
47
182
  /** Ligne d'une feuille de sélection : [pastille], [texte], [detail] facultatif et coche si elle est [choisie]. */
48
183
  export function SbSelectionLigne({
49
184
  pastille,
@@ -86,13 +221,166 @@ export function SbSelectionLigne({
86
221
  );
87
222
  }
88
223
 
224
+ /** Pastille d'une ligne : un code (EUR, CIV…) ou une icône ; pleine si la ligne est choisie. */
225
+ export function SbSelectionPastille({ code, icone, choisie = false }: { code?: string; icone?: IconName; choisie?: boolean }) {
226
+ const theme = useTheme();
227
+ const primaire = theme.colorScheme.primary;
228
+ const couleur = choisie ? theme.colorScheme.onPrimary : primaire;
229
+ return (
230
+ <View style={[styles.pastille, { backgroundColor: choisie ? primaire : withAlpha(primaire, 0.12) }]}>
231
+ {code != null ? (
232
+ <Text style={[theme.textTheme.displaySmall, styles.pastilleCode, { color: couleur }]}>{code.toUpperCase()}</Text>
233
+ ) : (
234
+ <MaterialIcons name={icone ?? 'circle'} size={20} color={couleur} />
235
+ )}
236
+ </View>
237
+ );
238
+ }
239
+
240
+ /**
241
+ * Option d'une feuille d'actions : pastille avec [icone] ou [image]
242
+ * (asset), [titre], [sousTitre] et flèche vers l'écran ouvert. [couleur]
243
+ * remplace la couleur principale (ex. rouge pour une action destructive).
244
+ */
245
+ export function SbSelectionOption({
246
+ icone,
247
+ image,
248
+ titre,
249
+ sousTitre,
250
+ onPress,
251
+ couleur,
252
+ }: {
253
+ icone?: IconName;
254
+ image?: number;
255
+ titre: string;
256
+ sousTitre?: string | null;
257
+ onPress: () => void;
258
+ couleur?: string;
259
+ }) {
260
+ const theme = useTheme();
261
+ const primaire = couleur ?? theme.colorScheme.primary;
262
+ return (
263
+ <Pressable
264
+ accessibilityRole="button"
265
+ onPress={onPress}
266
+ style={({ pressed }) => [
267
+ styles.option,
268
+ {
269
+ backgroundColor: withAlpha(primaire, pressed ? 0.12 : 0.05),
270
+ borderColor: withAlpha(primaire, 0.12),
271
+ },
272
+ ]}
273
+ >
274
+ <View style={[styles.optionPastille, { backgroundColor: withAlpha(primaire, 0.12) }]}>
275
+ {image != null ? (
276
+ <Image source={image} style={styles.optionImage} tintColor={primaire} contentFit="contain" />
277
+ ) : (
278
+ <MaterialIcons name={icone ?? 'circle'} size={24} color={primaire} />
279
+ )}
280
+ </View>
281
+ <View style={styles.textes}>
282
+ <Text style={[theme.textTheme.displayLarge, styles.gras, couleur != null ? { color: couleur } : null]}>{titre}</Text>
283
+ {sousTitre != null && (
284
+ <>
285
+ <View style={styles.gap2} />
286
+ <Text style={[theme.textTheme.displaySmall, { color: Themer.neural03Color }]}>{sousTitre}</Text>
287
+ </>
288
+ )}
289
+ </View>
290
+ <MaterialIcons name={Platform.OS === 'ios' ? 'arrow-forward-ios' : 'arrow-forward'} size={18} color={primaire} />
291
+ </Pressable>
292
+ );
293
+ }
294
+
295
+ /**
296
+ * Boutons fixés en bas d'une feuille, sous un trait : ils restent visibles
297
+ * quand le contenu défile ou que le clavier est ouvert. Les [boutons] sont
298
+ * côte à côte, sur la même largeur.
299
+ */
300
+ export function SelectionBoutons({ boutons }: { boutons: ReactNode[] }) {
301
+ return (
302
+ <View style={[styles.boutons, { borderTopColor: Themer.neural01Color }]}>
303
+ {boutons.map((bouton, i) => (
304
+ <View key={i} style={[styles.flex, i > 0 ? styles.boutonSuivant : null]}>
305
+ {bouton}
306
+ </View>
307
+ ))}
308
+ </View>
309
+ );
310
+ }
311
+
312
+ /** Choix d'une liste à choix unique (ex. motif d'annulation) : [texte] et rond coché si [choisi]. */
313
+ export function SelectionChoix({ texte, choisi, onPress }: { texte: string; choisi: boolean; onPress: () => void }) {
314
+ const theme = useTheme();
315
+ const primaire = theme.colorScheme.primary;
316
+ return (
317
+ <Pressable
318
+ accessibilityRole="radio"
319
+ accessibilityState={{ selected: choisi }}
320
+ onPress={onPress}
321
+ style={({ pressed }) => [
322
+ styles.choix,
323
+ {
324
+ backgroundColor: choisi ? withAlpha(primaire, 0.08) : pressed ? theme.colorScheme.secondary : 'transparent',
325
+ borderColor: choisi ? primaire : withAlpha(Themer.neural03Color, 0.25),
326
+ },
327
+ ]}
328
+ >
329
+ <Text style={[theme.textTheme.displayLarge, styles.flex, { fontWeight: choisi ? '600' : '400' }]}>{texte}</Text>
330
+ <View style={styles.gap12w} />
331
+ <MaterialIcons
332
+ name={choisi ? 'check-circle' : 'radio-button-unchecked'}
333
+ size={22}
334
+ color={choisi ? primaire : Themer.neural03Color}
335
+ />
336
+ </Pressable>
337
+ );
338
+ }
339
+
89
340
  const styles = StyleSheet.create({
341
+ flex: { flex: 1 },
342
+ centre: { textAlign: 'center' },
343
+ gras: { fontWeight: '700' },
344
+ inactif: { opacity: 0.5 },
345
+ gap2: { height: 2 },
346
+ gap8: { height: 8 },
347
+ gap8w: { width: 8 },
348
+ gap12w: { width: 12 },
349
+ marge12: { marginRight: 12 },
350
+ champCarte: { margin: 0 },
351
+ champ: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 16, paddingVertical: 12 },
90
352
  sheet: { width: '100%', borderTopLeftRadius: 20, borderTopRightRadius: 20 },
91
353
  poignee: { alignSelf: 'center', marginTop: 10, marginBottom: 14, width: 36, height: 4, borderRadius: 2 },
92
354
  titre: { paddingHorizontal: 20 },
93
355
  entete: { paddingHorizontal: 20, paddingTop: 12 },
94
356
  contenu: { flexShrink: 1 },
95
- gap8: { height: 8 },
357
+ vide: { padding: 24, alignItems: 'center' },
358
+ liste: { paddingHorizontal: 12, paddingBottom: 12 },
359
+ rechercheCarte: { margin: 0 },
360
+ recherche: { flexDirection: 'row', alignItems: 'center', height: 40, paddingHorizontal: 12 },
361
+ rechercheInput: { flex: 1, marginLeft: 8, paddingVertical: 0 },
96
362
  ligne: { flexDirection: 'row', alignItems: 'center', marginVertical: 2, paddingHorizontal: 8, paddingVertical: 10, borderRadius: 14 },
97
363
  textes: { flex: 1, marginHorizontal: 14 },
364
+ pastille: { width: 48, height: 36, borderRadius: 10, alignItems: 'center', justifyContent: 'center' },
365
+ pastilleCode: { fontWeight: '700', letterSpacing: 0.5 },
366
+ option: { flexDirection: 'row', alignItems: 'center', padding: 14, borderRadius: 16, borderWidth: 1 },
367
+ optionPastille: { width: 44, height: 44, borderRadius: 12, alignItems: 'center', justifyContent: 'center' },
368
+ optionImage: { width: 20, height: 20 },
369
+ boutons: {
370
+ flexDirection: 'row',
371
+ paddingHorizontal: 20,
372
+ paddingTop: 12,
373
+ paddingBottom: 8,
374
+ borderTopWidth: StyleSheet.hairlineWidth,
375
+ },
376
+ boutonSuivant: { marginLeft: 12 },
377
+ choix: {
378
+ flexDirection: 'row',
379
+ alignItems: 'center',
380
+ marginVertical: 4,
381
+ paddingHorizontal: 14,
382
+ paddingVertical: 12,
383
+ borderRadius: 14,
384
+ borderWidth: 1,
385
+ },
98
386
  });
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- import { ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
- import { useTheme } from "../../../../../core/theme.js";
6
-
7
- /**
8
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
9
- * la largeur) : marge de 20, fond `surface` aux coins de
10
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
11
- */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export function SheetBox({
14
- children
15
- }) {
16
- const theme = useTheme();
17
- const {
18
- height
19
- } = useWindowDimensions();
20
- const insets = useSafeAreaInsets();
21
- return /*#__PURE__*/_jsx(View, {
22
- style: [styles.padding, {
23
- paddingBottom: 20 + insets.bottom
24
- }],
25
- children: /*#__PURE__*/_jsx(View, {
26
- style: [styles.box, {
27
- backgroundColor: theme.colorScheme.surface,
28
- maxHeight: height * 0.7 - 40
29
- }],
30
- children: /*#__PURE__*/_jsx(ScrollView, {
31
- keyboardShouldPersistTaps: "handled",
32
- bounces: false,
33
- children: children
34
- })
35
- })
36
- });
37
- }
38
- const styles = StyleSheet.create({
39
- padding: {
40
- padding: 20
41
- },
42
- box: {
43
- borderRadius: 20,
44
- overflow: 'hidden'
45
- }
46
- });
47
- //# sourceMappingURL=sheet_box.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ScrollView","StyleSheet","useWindowDimensions","View","useSafeAreaInsets","useTheme","jsx","_jsx","SheetBox","children","theme","height","insets","style","styles","padding","paddingBottom","bottom","box","backgroundColor","colorScheme","surface","maxHeight","keyboardShouldPersistTaps","bounces","create","borderRadius","overflow"],"sourceRoot":"../../../../../../../src","sources":["modules/transactions/presentation/pages/transaction_details/sheet_box.tsx"],"mappings":";;AACA,SAASA,UAAU,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAChF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,QAAQ,QAAQ,8BAA2B;;AAEpD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,QAAQA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EAC9D,MAAMC,KAAK,GAAGL,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEM;EAAO,CAAC,GAAGT,mBAAmB,CAAC,CAAC;EACxC,MAAMU,MAAM,GAAGR,iBAAiB,CAAC,CAAC;EAClC,oBACEG,IAAA,CAACJ,IAAI;IAACU,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAE;MAAEC,aAAa,EAAE,EAAE,GAAGJ,MAAM,CAACK;IAAO,CAAC,CAAE;IAAAR,QAAA,eACnEF,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACI,GAAG,EAAE;QAAEC,eAAe,EAAET,KAAK,CAACU,WAAW,CAACC,OAAO;QAAEC,SAAS,EAAEX,MAAM,GAAG,GAAG,GAAG;MAAG,CAAC,CAAE;MAAAF,QAAA,eACtGF,IAAA,CAACP,UAAU;QAACuB,yBAAyB,EAAC,SAAS;QAACC,OAAO,EAAE,KAAM;QAAAf,QAAA,EAC5DA;MAAQ,CACC;IAAC,CACT;EAAC,CACH,CAAC;AAEX;AAEA,MAAMK,MAAM,GAAGb,UAAU,CAACwB,MAAM,CAAC;EAC/BV,OAAO,EAAE;IAAEA,OAAO,EAAE;EAAG,CAAC;EACxBG,GAAG,EAAE;IAAEQ,YAAY,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAS;AAC9C,CAAC,CAAC","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- /**
3
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
4
- * la largeur) : marge de 20, fond `surface` aux coins de
5
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
6
- */
7
- export declare function SheetBox({ children }: {
8
- children: ReactNode;
9
- }): import("react").JSX.Element;
10
- //# sourceMappingURL=sheet_box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet_box.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/transactions/presentation/pages/transaction_details/sheet_box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAa7D"}
@@ -1,30 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
-
5
- import { useTheme } from '../../../../../core/theme';
6
-
7
- /**
8
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
9
- * la largeur) : marge de 20, fond `surface` aux coins de
10
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
11
- */
12
- export function SheetBox({ children }: { children: ReactNode }) {
13
- const theme = useTheme();
14
- const { height } = useWindowDimensions();
15
- const insets = useSafeAreaInsets();
16
- return (
17
- <View style={[styles.padding, { paddingBottom: 20 + insets.bottom }]}>
18
- <View style={[styles.box, { backgroundColor: theme.colorScheme.surface, maxHeight: height * 0.7 - 40 }]}>
19
- <ScrollView keyboardShouldPersistTaps="handled" bounces={false}>
20
- {children}
21
- </ScrollView>
22
- </View>
23
- </View>
24
- );
25
- }
26
-
27
- const styles = StyleSheet.create({
28
- padding: { padding: 20 },
29
- box: { borderRadius: 20, overflow: 'hidden' },
30
- });