@forthtilliath/react-native-kit 0.14.8 → 0.15.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 +37 -17
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/list/SwipeableRow.d.ts +14 -1
- package/dist/components/list/SwipeableRow.d.ts.map +1 -1
- package/dist/components/list/SwipeableRow.js +18 -16
- package/dist/components/list/Thumbnail.d.ts.map +1 -1
- package/dist/components/list/Thumbnail.js +2 -6
- package/dist/components/list/UndoToast.d.ts +10 -4
- package/dist/components/list/UndoToast.d.ts.map +1 -1
- package/dist/components/list/UndoToast.js +11 -8
- package/dist/components/list/index.d.ts +4 -4
- package/dist/components/list/index.d.ts.map +1 -1
- package/dist/components/list/index.js +4 -4
- package/dist/components/picker/PhotoPicker.d.ts +7 -1
- package/dist/components/picker/PhotoPicker.d.ts.map +1 -1
- package/dist/components/picker/PhotoPicker.js +33 -28
- package/dist/components/picker/PickerModal.d.ts +7 -1
- package/dist/components/picker/PickerModal.d.ts.map +1 -1
- package/dist/components/picker/PickerModal.js +8 -28
- package/dist/components/picker/PickerModal.styles.d.ts +18 -1
- package/dist/components/picker/PickerModal.styles.d.ts.map +1 -1
- package/dist/components/picker/PickerModal.styles.js +16 -6
- package/dist/components/picker/VoiceSearchButton.d.ts +13 -2
- package/dist/components/picker/VoiceSearchButton.d.ts.map +1 -1
- package/dist/components/picker/VoiceSearchButton.js +18 -1
- package/dist/components/picker/index.d.ts +3 -3
- package/dist/components/picker/index.d.ts.map +1 -1
- package/dist/components/picker/index.js +3 -3
- package/dist/components/settings/AboutSettingsScreen.d.ts +7 -1
- package/dist/components/settings/AboutSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/AboutSettingsScreen.js +13 -13
- package/dist/components/settings/BackupSettingsScreen.d.ts +9 -59
- package/dist/components/settings/BackupSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/BackupSettingsScreen.js +32 -141
- package/dist/components/settings/BackupSettingsScreen.styles.d.ts +173 -0
- package/dist/components/settings/BackupSettingsScreen.styles.d.ts.map +1 -0
- package/dist/components/settings/BackupSettingsScreen.styles.js +98 -0
- package/dist/components/settings/ContactSettingsScreen.d.ts +7 -1
- package/dist/components/settings/ContactSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/ContactSettingsScreen.js +15 -14
- package/dist/components/settings/PrivacySettingsScreen.d.ts +7 -1
- package/dist/components/settings/PrivacySettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/PrivacySettingsScreen.js +50 -28
- package/dist/components/settings/SettingsMenu.d.ts.map +1 -1
- package/dist/components/settings/SettingsMenu.js +2 -9
- package/dist/components/settings/ThemeSettingsScreen.d.ts +7 -1
- package/dist/components/settings/ThemeSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/ThemeSettingsScreen.js +17 -19
- package/dist/components/settings/UpdateSettingsScreen.d.ts +11 -2
- package/dist/components/settings/UpdateSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/UpdateSettingsScreen.js +7 -31
- package/dist/components/settings/UpdateSettingsScreen.styles.d.ts +28 -1
- package/dist/components/settings/UpdateSettingsScreen.styles.d.ts.map +1 -1
- package/dist/components/settings/UpdateSettingsScreen.styles.js +26 -11
- package/dist/components/settings/index.d.ts +7 -7
- package/dist/components/settings/index.d.ts.map +1 -1
- package/dist/components/settings/index.js +7 -7
- package/dist/components/theme/ThemeOptionList.d.ts +7 -1
- package/dist/components/theme/ThemeOptionList.d.ts.map +1 -1
- package/dist/components/theme/ThemeOptionList.js +6 -17
- package/dist/components/theme/ThemeToggle.d.ts +7 -1
- package/dist/components/theme/ThemeToggle.d.ts.map +1 -1
- package/dist/components/theme/ThemeToggle.js +6 -20
- package/dist/components/theme/index.d.ts +2 -2
- package/dist/components/theme/index.d.ts.map +1 -1
- package/dist/components/theme/index.js +2 -2
- package/dist/components/theme/themeLabels.d.ts +14 -0
- package/dist/components/theme/themeLabels.d.ts.map +1 -0
- package/dist/components/theme/themeLabels.js +5 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/useDebouncedChange.d.ts.map +1 -1
- package/dist/hooks/useDebouncedChange.js +6 -7
- package/dist/hooks/useSubmitGuard.d.ts.map +1 -1
- package/dist/hooks/useSubmitGuard.js +9 -5
- package/dist/i18n/KitLocaleProvider.d.ts +19 -0
- package/dist/i18n/KitLocaleProvider.d.ts.map +1 -0
- package/dist/i18n/KitLocaleProvider.js +16 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/locale.d.ts +14 -0
- package/dist/i18n/locale.d.ts.map +1 -0
- package/dist/i18n/locale.js +18 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/utils/helpers/confirmDestructive.d.ts +6 -0
- package/dist/utils/helpers/confirmDestructive.d.ts.map +1 -1
- package/dist/utils/helpers/confirmDestructive.js +20 -6
- package/dist/utils/helpers/index.d.ts +1 -0
- package/dist/utils/helpers/index.d.ts.map +1 -1
- package/dist/utils/helpers/index.js +1 -0
- package/dist/utils/helpers/mergeSlotStyles.d.ts +20 -0
- package/dist/utils/helpers/mergeSlotStyles.d.ts.map +1 -0
- package/dist/utils/helpers/mergeSlotStyles.js +26 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +14 -10
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import type { Ionicons } from "@expo/vector-icons";
|
|
3
|
+
export interface BackupSettingsScreenReminder {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** Set while a permission request or the toggle's own persistence is in flight. */
|
|
6
|
+
busy?: boolean;
|
|
7
|
+
onToggle: (value: boolean) => void;
|
|
8
|
+
/** How often the reminder fires, only used to word the hint (e.g. "every 7 days"). */
|
|
9
|
+
intervalDays: number;
|
|
10
|
+
}
|
|
11
|
+
export interface BackupSettingsScreenInfo {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BackupSettingsScreenIcons {
|
|
16
|
+
export?: keyof typeof Ionicons.glyphMap;
|
|
17
|
+
import?: keyof typeof Ionicons.glyphMap;
|
|
18
|
+
}
|
|
19
|
+
export interface BackupSettingsScreenStyles {
|
|
20
|
+
container?: StyleProp<ViewStyle>;
|
|
21
|
+
infoBox?: StyleProp<ViewStyle>;
|
|
22
|
+
infoLabel?: StyleProp<TextStyle>;
|
|
23
|
+
infoValue?: StyleProp<TextStyle>;
|
|
24
|
+
sectionTitle?: StyleProp<TextStyle>;
|
|
25
|
+
hint?: StyleProp<TextStyle>;
|
|
26
|
+
row?: StyleProp<ViewStyle>;
|
|
27
|
+
button?: StyleProp<ViewStyle>;
|
|
28
|
+
buttonDisabled?: StyleProp<ViewStyle>;
|
|
29
|
+
buttonText?: StyleProp<TextStyle>;
|
|
30
|
+
iconColor?: string;
|
|
31
|
+
/** Merged on top of `button`/`buttonText` — defaults to the same look as the export button. */
|
|
32
|
+
importButton?: StyleProp<ViewStyle>;
|
|
33
|
+
importButtonText?: StyleProp<TextStyle>;
|
|
34
|
+
reminderRow?: StyleProp<ViewStyle>;
|
|
35
|
+
reminderTextColumn?: StyleProp<ViewStyle>;
|
|
36
|
+
reminderLabel?: StyleProp<TextStyle>;
|
|
37
|
+
reminderHint?: StyleProp<TextStyle>;
|
|
38
|
+
activityIndicatorColor?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface BackupSettingsScreenLabels {
|
|
41
|
+
hint?: string;
|
|
42
|
+
exportButton?: string;
|
|
43
|
+
importButton?: string;
|
|
44
|
+
/** Only shown in `layout="sections"`. */
|
|
45
|
+
exportSectionTitle?: string;
|
|
46
|
+
exportHelpText?: string;
|
|
47
|
+
importSectionTitle?: string;
|
|
48
|
+
importHelpText?: string;
|
|
49
|
+
importConfirmTitle?: string;
|
|
50
|
+
importConfirmMessage?: string;
|
|
51
|
+
importConfirmLabel?: string;
|
|
52
|
+
importConfirmCancelLabel?: string;
|
|
53
|
+
reminderLabel?: string;
|
|
54
|
+
reminderHint?: (intervalDays: number) => string;
|
|
55
|
+
exportErrorTitle?: string;
|
|
56
|
+
importErrorTitle?: string;
|
|
57
|
+
genericErrorMessage?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare const defaultLabels: {
|
|
60
|
+
fr: {
|
|
61
|
+
hint: string;
|
|
62
|
+
exportButton: string;
|
|
63
|
+
importButton: string;
|
|
64
|
+
exportSectionTitle: string;
|
|
65
|
+
exportHelpText: string;
|
|
66
|
+
importSectionTitle: string;
|
|
67
|
+
importHelpText: string;
|
|
68
|
+
importConfirmTitle: string;
|
|
69
|
+
importConfirmMessage: string;
|
|
70
|
+
importConfirmLabel: string;
|
|
71
|
+
importConfirmCancelLabel: string;
|
|
72
|
+
reminderLabel: string;
|
|
73
|
+
reminderHint: (intervalDays: number) => string;
|
|
74
|
+
exportErrorTitle: string;
|
|
75
|
+
importErrorTitle: string;
|
|
76
|
+
genericErrorMessage: string;
|
|
77
|
+
};
|
|
78
|
+
en: {
|
|
79
|
+
hint: string;
|
|
80
|
+
exportButton: string;
|
|
81
|
+
importButton: string;
|
|
82
|
+
exportSectionTitle: string;
|
|
83
|
+
exportHelpText: string;
|
|
84
|
+
importSectionTitle: string;
|
|
85
|
+
importHelpText: string;
|
|
86
|
+
importConfirmTitle: string;
|
|
87
|
+
importConfirmMessage: string;
|
|
88
|
+
importConfirmLabel: string;
|
|
89
|
+
importConfirmCancelLabel: string;
|
|
90
|
+
reminderLabel: string;
|
|
91
|
+
reminderHint: (intervalDays: number) => string;
|
|
92
|
+
exportErrorTitle: string;
|
|
93
|
+
importErrorTitle: string;
|
|
94
|
+
genericErrorMessage: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export declare const defaultStyles: {
|
|
98
|
+
container: {};
|
|
99
|
+
infoBox: {
|
|
100
|
+
backgroundColor: string;
|
|
101
|
+
borderWidth: number;
|
|
102
|
+
borderColor: string;
|
|
103
|
+
borderRadius: number;
|
|
104
|
+
padding: number;
|
|
105
|
+
marginBottom: number;
|
|
106
|
+
gap: number;
|
|
107
|
+
};
|
|
108
|
+
infoLabel: {
|
|
109
|
+
fontSize: number;
|
|
110
|
+
color: string;
|
|
111
|
+
};
|
|
112
|
+
infoValue: {
|
|
113
|
+
fontSize: number;
|
|
114
|
+
color: string;
|
|
115
|
+
fontWeight: "600";
|
|
116
|
+
};
|
|
117
|
+
sectionTitle: {
|
|
118
|
+
fontSize: number;
|
|
119
|
+
fontWeight: "700";
|
|
120
|
+
color: string;
|
|
121
|
+
marginTop: number;
|
|
122
|
+
};
|
|
123
|
+
hint: {
|
|
124
|
+
fontSize: number;
|
|
125
|
+
color: string;
|
|
126
|
+
marginTop: number;
|
|
127
|
+
marginBottom: number;
|
|
128
|
+
lineHeight: number;
|
|
129
|
+
};
|
|
130
|
+
row: {
|
|
131
|
+
flexDirection: "row";
|
|
132
|
+
gap: number;
|
|
133
|
+
};
|
|
134
|
+
button: {
|
|
135
|
+
flexDirection: "row";
|
|
136
|
+
flex: number;
|
|
137
|
+
paddingVertical: number;
|
|
138
|
+
borderRadius: number;
|
|
139
|
+
borderWidth: number;
|
|
140
|
+
borderColor: string;
|
|
141
|
+
alignItems: "center";
|
|
142
|
+
justifyContent: "center";
|
|
143
|
+
gap: number;
|
|
144
|
+
};
|
|
145
|
+
buttonDisabled: {
|
|
146
|
+
opacity: number;
|
|
147
|
+
};
|
|
148
|
+
buttonText: {
|
|
149
|
+
color: string;
|
|
150
|
+
fontWeight: "700";
|
|
151
|
+
};
|
|
152
|
+
reminderRow: {
|
|
153
|
+
flexDirection: "row";
|
|
154
|
+
alignItems: "center";
|
|
155
|
+
gap: number;
|
|
156
|
+
marginTop: number;
|
|
157
|
+
};
|
|
158
|
+
reminderTextColumn: {
|
|
159
|
+
flex: number;
|
|
160
|
+
};
|
|
161
|
+
reminderLabel: {
|
|
162
|
+
fontSize: number;
|
|
163
|
+
fontWeight: "600";
|
|
164
|
+
color: string;
|
|
165
|
+
marginBottom: number;
|
|
166
|
+
};
|
|
167
|
+
reminderHint: {
|
|
168
|
+
fontSize: number;
|
|
169
|
+
color: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
export declare const defaultIconColor = "#2563eb";
|
|
173
|
+
//# sourceMappingURL=BackupSettingsScreen.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackupSettingsScreen.styles.d.ts","sourceRoot":"","sources":["../../../src/components/settings/BackupSettingsScreen.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAInD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;CACzC;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACj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C,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;qCAiBO,MAAM;;;;;;;;;;;;;;;;;;qCAsBN,MAAM;;;;;CAM4B,CAAC;AAEpE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAY,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export const defaultLabels = {
|
|
2
|
+
fr: {
|
|
3
|
+
hint: "Les données sont stockées uniquement sur cet appareil et sont perdues en cas de réinstallation ou de mise à jour incompatible. Exporte-les régulièrement pour pouvoir les restaurer.",
|
|
4
|
+
exportButton: "⬆️ Exporter",
|
|
5
|
+
importButton: "⬇️ Importer",
|
|
6
|
+
exportSectionTitle: "Exporter",
|
|
7
|
+
exportHelpText: "Exporte toutes tes données dans un fichier que tu peux garder précieusement ou transférer vers un autre appareil.",
|
|
8
|
+
importSectionTitle: "Importer",
|
|
9
|
+
importHelpText: "Restaure une sauvegarde exportée précédemment. Remplace entièrement les données actuelles — il n'y a pas de fusion.",
|
|
10
|
+
importConfirmTitle: "Importer une sauvegarde ?",
|
|
11
|
+
importConfirmMessage: "Toutes les données actuelles seront remplacées par celles du fichier choisi.",
|
|
12
|
+
importConfirmLabel: "Choisir un fichier",
|
|
13
|
+
importConfirmCancelLabel: "Annuler",
|
|
14
|
+
reminderLabel: "🔔 Rappel de sauvegarde",
|
|
15
|
+
reminderHint: (intervalDays) => `Une notification tous les ${String(intervalDays)} jours pour penser à exporter.`,
|
|
16
|
+
exportErrorTitle: "Échec de l'export",
|
|
17
|
+
importErrorTitle: "Échec de l'import",
|
|
18
|
+
genericErrorMessage: "Une erreur inconnue s'est produite.",
|
|
19
|
+
},
|
|
20
|
+
en: {
|
|
21
|
+
hint: "Your data is only stored on this device and is lost if the app is reinstalled or an update is incompatible. Export it regularly so you can restore it.",
|
|
22
|
+
exportButton: "⬆️ Export",
|
|
23
|
+
importButton: "⬇️ Import",
|
|
24
|
+
exportSectionTitle: "Export",
|
|
25
|
+
exportHelpText: "Exports all your data to a file you can keep safe or move to another device.",
|
|
26
|
+
importSectionTitle: "Import",
|
|
27
|
+
importHelpText: "Restores a previously exported backup. It fully replaces the current data — nothing is merged.",
|
|
28
|
+
importConfirmTitle: "Import a backup?",
|
|
29
|
+
importConfirmMessage: "All current data will be replaced by the chosen file's.",
|
|
30
|
+
importConfirmLabel: "Choose a file",
|
|
31
|
+
importConfirmCancelLabel: "Cancel",
|
|
32
|
+
reminderLabel: "🔔 Backup reminder",
|
|
33
|
+
reminderHint: (intervalDays) => `A notification every ${String(intervalDays)} days as a reminder to export.`,
|
|
34
|
+
exportErrorTitle: "Export failed",
|
|
35
|
+
importErrorTitle: "Import failed",
|
|
36
|
+
genericErrorMessage: "An unknown error occurred.",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export const defaultStyles = {
|
|
40
|
+
container: {},
|
|
41
|
+
infoBox: {
|
|
42
|
+
backgroundColor: "#f9fafb",
|
|
43
|
+
borderWidth: 1,
|
|
44
|
+
borderColor: "#e5e7eb",
|
|
45
|
+
borderRadius: 10,
|
|
46
|
+
padding: 12,
|
|
47
|
+
marginBottom: 20,
|
|
48
|
+
gap: 2,
|
|
49
|
+
},
|
|
50
|
+
infoLabel: { fontSize: 12, color: "#6b7280" },
|
|
51
|
+
infoValue: {
|
|
52
|
+
fontSize: 12,
|
|
53
|
+
color: "#111827",
|
|
54
|
+
fontWeight: "600",
|
|
55
|
+
},
|
|
56
|
+
sectionTitle: {
|
|
57
|
+
fontSize: 15,
|
|
58
|
+
fontWeight: "700",
|
|
59
|
+
color: "#111827",
|
|
60
|
+
marginTop: 20,
|
|
61
|
+
},
|
|
62
|
+
hint: {
|
|
63
|
+
fontSize: 13,
|
|
64
|
+
color: "#6b7280",
|
|
65
|
+
marginTop: 6,
|
|
66
|
+
marginBottom: 14,
|
|
67
|
+
lineHeight: 18,
|
|
68
|
+
},
|
|
69
|
+
row: { flexDirection: "row", gap: 10 },
|
|
70
|
+
button: {
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
flex: 1,
|
|
73
|
+
paddingVertical: 12,
|
|
74
|
+
borderRadius: 8,
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
borderColor: "#2563eb",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
justifyContent: "center",
|
|
79
|
+
gap: 8,
|
|
80
|
+
},
|
|
81
|
+
buttonDisabled: { opacity: 0.5 },
|
|
82
|
+
buttonText: { color: "#2563eb", fontWeight: "700" },
|
|
83
|
+
reminderRow: {
|
|
84
|
+
flexDirection: "row",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
gap: 12,
|
|
87
|
+
marginTop: 24,
|
|
88
|
+
},
|
|
89
|
+
reminderTextColumn: { flex: 1 },
|
|
90
|
+
reminderLabel: {
|
|
91
|
+
fontSize: 15,
|
|
92
|
+
fontWeight: "600",
|
|
93
|
+
color: "#111827",
|
|
94
|
+
marginBottom: 4,
|
|
95
|
+
},
|
|
96
|
+
reminderHint: { fontSize: 13, color: "#6b7280" },
|
|
97
|
+
};
|
|
98
|
+
export const defaultIconColor = "#2563eb";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
2
|
import { Ionicons } from "@expo/vector-icons";
|
|
3
|
+
import { type KitLocale } from "../../i18n/locale.js";
|
|
3
4
|
export interface ContactSettingsScreenAction {
|
|
4
5
|
icon: keyof typeof Ionicons.glyphMap;
|
|
5
6
|
label: string;
|
|
@@ -34,7 +35,12 @@ export interface ContactSettingsScreenProps {
|
|
|
34
35
|
actions?: ContactSettingsScreenAction[];
|
|
35
36
|
emailIcon?: keyof typeof Ionicons.glyphMap;
|
|
36
37
|
labels?: ContactSettingsScreenLabels;
|
|
38
|
+
/**
|
|
39
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
40
|
+
* `KitLocaleProvider`'s. `labels` still overrides individual strings.
|
|
41
|
+
*/
|
|
42
|
+
locale?: KitLocale;
|
|
37
43
|
styles?: ContactSettingsScreenStyles;
|
|
38
44
|
}
|
|
39
|
-
export declare function ContactSettingsScreen({ email, actions, emailIcon, labels, styles, }: ContactSettingsScreenProps): import("react").JSX.Element;
|
|
45
|
+
export declare function ContactSettingsScreen({ email, actions, emailIcon, labels, locale, styles, }: ContactSettingsScreenProps): import("react").JSX.Element;
|
|
40
46
|
//# sourceMappingURL=ContactSettingsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/ContactSettingsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAC,S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Linking, Pressable, Text, View } from "react-native";
|
|
3
3
|
import { Ionicons } from "@expo/vector-icons";
|
|
4
|
+
import { useKitLocale } from "../../i18n/locale.js";
|
|
5
|
+
import { mergeSlotStyles } from "../../utils/helpers/mergeSlotStyles.js";
|
|
4
6
|
const defaultLabels = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
fr: {
|
|
8
|
+
hint: "Une question, un bug, une suggestion ?",
|
|
9
|
+
footer: "Si tu remontes un bug, précise si possible ce que tu faisais et ce que tu attendais — ça aide à le reproduire.",
|
|
10
|
+
emailRowLabel: "Me contacter",
|
|
11
|
+
},
|
|
12
|
+
en: {
|
|
13
|
+
hint: "A question, a bug, a suggestion?",
|
|
14
|
+
footer: "When reporting a bug, please describe what you were doing and what you expected — it helps reproduce it.",
|
|
15
|
+
emailRowLabel: "Contact me",
|
|
16
|
+
},
|
|
8
17
|
};
|
|
9
18
|
const defaultStyles = {
|
|
10
19
|
container: {},
|
|
@@ -40,17 +49,9 @@ const defaultStyles = {
|
|
|
40
49
|
// A mailto: button plus a short "how to report a bug" hint — the standard
|
|
41
50
|
// "Contact" section of a settings tab. Pass `actions` for extra rows (share
|
|
42
51
|
// the app, a donation link...), switching email + those to a rows layout.
|
|
43
|
-
export function ContactSettingsScreen({ email, actions, emailIcon = "mail-outline", labels, styles, }) {
|
|
44
|
-
const merged =
|
|
45
|
-
|
|
46
|
-
hint: [defaultStyles.hint, styles?.hint],
|
|
47
|
-
emailButton: [defaultStyles.emailButton, styles?.emailButton],
|
|
48
|
-
emailButtonText: [defaultStyles.emailButtonText, styles?.emailButtonText],
|
|
49
|
-
separator: [defaultStyles.separator, styles?.separator],
|
|
50
|
-
row: [defaultStyles.row, styles?.row],
|
|
51
|
-
rowText: [defaultStyles.rowText, styles?.rowText],
|
|
52
|
-
};
|
|
53
|
-
const t = { ...defaultLabels, ...labels };
|
|
52
|
+
export function ContactSettingsScreen({ email, actions, emailIcon = "mail-outline", labels, locale, styles, }) {
|
|
53
|
+
const merged = mergeSlotStyles(defaultStyles, styles);
|
|
54
|
+
const t = { ...defaultLabels[useKitLocale(locale)], ...labels };
|
|
54
55
|
const rowIconColor = styles?.rowIconColor ?? defaultStyles.rowIconColor;
|
|
55
56
|
function openEmail() {
|
|
56
57
|
void Linking.openURL(`mailto:${email}`);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import { type KitLocale } from "../../i18n/locale.js";
|
|
2
3
|
export interface PrivacySettingsScreenSection {
|
|
3
4
|
title: string;
|
|
4
5
|
paragraphs: string[];
|
|
@@ -17,7 +18,12 @@ export interface PrivacySettingsScreenProps {
|
|
|
17
18
|
* to a server) — this fully replaces the default, it isn't merged with it.
|
|
18
19
|
*/
|
|
19
20
|
sections?: PrivacySettingsScreenSection[];
|
|
21
|
+
/**
|
|
22
|
+
* Language of the default `sections` — French by default, or the nearest
|
|
23
|
+
* `KitLocaleProvider`'s. Ignored when `sections` is passed.
|
|
24
|
+
*/
|
|
25
|
+
locale?: KitLocale;
|
|
20
26
|
styles?: PrivacySettingsScreenStyles;
|
|
21
27
|
}
|
|
22
|
-
export declare function PrivacySettingsScreen({ sections, styles, }: PrivacySettingsScreenProps): import("react").JSX.Element;
|
|
28
|
+
export declare function PrivacySettingsScreen({ sections: customSections, locale, styles, }: PrivacySettingsScreenProps): import("react").JSX.Element;
|
|
23
29
|
//# sourceMappingURL=PrivacySettingsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivacySettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/PrivacySettingsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC1C,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC;
|
|
1
|
+
{"version":3,"file":"PrivacySettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/PrivacySettingsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAGpE,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC1C;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC;AAmED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EAAE,cAAc,EACxB,MAAM,EACN,MAAM,GACP,EAAE,0BAA0B,+BAoB5B"}
|
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
import { useKitLocale } from "../../i18n/locale.js";
|
|
4
|
+
import { mergeSlotStyles } from "../../utils/helpers/mergeSlotStyles.js";
|
|
5
|
+
const defaultSections = {
|
|
6
|
+
fr: [
|
|
7
|
+
{
|
|
8
|
+
title: "Aucune donnée envoyée nulle part",
|
|
9
|
+
paragraphs: [
|
|
10
|
+
"Cette application ne collecte aucune donnée, ne fait appel à aucun serveur, et ne contient aucun outil de suivi ni de publicité.",
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
title: "Stockage local uniquement",
|
|
15
|
+
paragraphs: [
|
|
16
|
+
"Tout ce que tu saisis reste stocké uniquement sur cet appareil, dans le stockage local de l'application. Rien n'est envoyé ailleurs.",
|
|
17
|
+
"Ces données sont perdues si tu désinstalles l'application ou si tu effaces son stockage — pense à utiliser une sauvegarde régulière pour pouvoir les restaurer.",
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "Partage volontaire uniquement",
|
|
22
|
+
paragraphs: [
|
|
23
|
+
"La seule façon pour une donnée de quitter cet appareil, c'est quand tu choisis toi-même de la partager (export d'une sauvegarde...), via le sélecteur de partage natif du téléphone.",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
en: [
|
|
28
|
+
{
|
|
29
|
+
title: "No data sent anywhere",
|
|
30
|
+
paragraphs: [
|
|
31
|
+
"This app collects no data, calls no server, and contains no tracking or advertising tools.",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Local storage only",
|
|
36
|
+
paragraphs: [
|
|
37
|
+
"Everything you enter stays on this device only, in the app's local storage. Nothing is sent anywhere else.",
|
|
38
|
+
"This data is lost if you uninstall the app or clear its storage — remember to back it up regularly so you can restore it.",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "Sharing only when you choose to",
|
|
43
|
+
paragraphs: [
|
|
44
|
+
"The only way for data to leave this device is when you choose to share it yourself (exporting a backup...), through the phone's native share sheet.",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
24
49
|
const defaultStyles = {
|
|
25
50
|
container: {},
|
|
26
51
|
title: { fontSize: 15, fontWeight: "700", color: "#111827", marginBottom: 6 },
|
|
@@ -40,12 +65,9 @@ const defaultStyles = {
|
|
|
40
65
|
// separated by a thin rule. Ships with the standard "everything stays local"
|
|
41
66
|
// copy as a default — override `sections` entirely for an app with different
|
|
42
67
|
// data handling (e.g. one that does sync to a server).
|
|
43
|
-
export function PrivacySettingsScreen({ sections
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
paragraph: [defaultStyles.paragraph, styles?.paragraph],
|
|
48
|
-
separator: [defaultStyles.separator, styles?.separator],
|
|
49
|
-
};
|
|
68
|
+
export function PrivacySettingsScreen({ sections: customSections, locale, styles, }) {
|
|
69
|
+
const resolvedLocale = useKitLocale(locale);
|
|
70
|
+
const sections = customSections ?? defaultSections[resolvedLocale];
|
|
71
|
+
const merged = mergeSlotStyles(defaultStyles, styles);
|
|
50
72
|
return (_jsx(View, { style: merged.container, children: sections.map((section, index) => (_jsxs(View, { children: [index > 0 && _jsx(View, { style: merged.separator }), _jsx(Text, { style: merged.title, children: section.title }), section.paragraphs.map((paragraph) => (_jsx(Text, { style: merged.paragraph, children: paragraph }, paragraph)))] }, section.title))) }));
|
|
51
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/settings/SettingsMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC7B,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAclE,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,oFAAoF;IACpF,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACnC,gHAAgH;IAChH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAmDD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,eAAyB,EACzB,SAAgB,EAChB,MAAM,GACP,EAAE,iBAAiB,+BA8CnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Pressable, Text, View } from "react-native";
|
|
3
3
|
import { Ionicons } from "@expo/vector-icons";
|
|
4
|
+
import { mergeSlotStyles } from "../../utils/helpers/mergeSlotStyles.js";
|
|
4
5
|
const defaultSectionIcons = {
|
|
5
6
|
backup: { emoji: "💾", icon: "save-outline" },
|
|
6
7
|
theme: { emoji: "🎨", icon: "contrast-outline" },
|
|
@@ -56,15 +57,7 @@ function resolveIcon(item, defaultIconKind) {
|
|
|
56
57
|
// `() => router.push("/settings/xxx")`), so this doesn't depend on
|
|
57
58
|
// expo-router or any other specific navigator.
|
|
58
59
|
export function SettingsMenu({ items, groups, defaultIconKind = "emoji", showHints = true, styles, }) {
|
|
59
|
-
const merged =
|
|
60
|
-
container: [defaultStyles.container, styles?.container],
|
|
61
|
-
groupTitle: [defaultStyles.groupTitle, styles?.groupTitle],
|
|
62
|
-
row: [defaultStyles.row, styles?.row],
|
|
63
|
-
titleColumn: [defaultStyles.titleColumn, styles?.titleColumn],
|
|
64
|
-
emoji: [defaultStyles.emoji, styles?.emoji],
|
|
65
|
-
title: [defaultStyles.title, styles?.title],
|
|
66
|
-
hint: [defaultStyles.hint, styles?.hint],
|
|
67
|
-
};
|
|
60
|
+
const merged = mergeSlotStyles(defaultStyles, styles);
|
|
68
61
|
const chevronColor = styles?.chevronColor ?? defaultStyles.chevronColor;
|
|
69
62
|
const iconColor = styles?.iconColor ?? defaultStyles.iconColor;
|
|
70
63
|
function renderItem(item) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
2
|
import { Ionicons } from "@expo/vector-icons";
|
|
3
3
|
import type { ThemePreference } from "../../hooks/useEffectiveColorScheme.js";
|
|
4
|
+
import { type KitLocale } from "../../i18n/locale.js";
|
|
4
5
|
export interface ThemeSettingsScreenEmojis {
|
|
5
6
|
light?: string;
|
|
6
7
|
dark?: string;
|
|
@@ -43,9 +44,14 @@ export interface ThemeSettingsScreenProps {
|
|
|
43
44
|
emojis?: ThemeSettingsScreenEmojis;
|
|
44
45
|
icons?: ThemeSettingsScreenIcons;
|
|
45
46
|
labels?: ThemeSettingsScreenLabels;
|
|
47
|
+
/**
|
|
48
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
49
|
+
* `KitLocaleProvider`'s. `labels` still overrides individual strings.
|
|
50
|
+
*/
|
|
51
|
+
locale?: KitLocale;
|
|
46
52
|
/** Set to `false` to hide the hint above the list. Defaults to `true`. */
|
|
47
53
|
showHint?: boolean;
|
|
48
54
|
styles?: ThemeSettingsScreenStyles;
|
|
49
55
|
}
|
|
50
|
-
export declare function ThemeSettingsScreen({ value, onChange, variant, emojis, icons, labels, showHint, styles, }: ThemeSettingsScreenProps): import("react").JSX.Element;
|
|
56
|
+
export declare function ThemeSettingsScreen({ value, onChange, variant, emojis, icons, labels, locale, showHint, styles, }: ThemeSettingsScreenProps): import("react").JSX.Element;
|
|
51
57
|
//# sourceMappingURL=ThemeSettingsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/ThemeSettingsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/ThemeSettingsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAGpE,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC,QAAQ,CAAC;IACtC,MAAM,CAAC,EA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AAC;CACpC;AAsED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,OAAiB,EACjB,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAe,EACf,MAAM,GACP,EAAE,wBAAwB,+BAqD1B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Pressable, Text, View } from "react-native";
|
|
3
3
|
import { Ionicons } from "@expo/vector-icons";
|
|
4
|
+
import { useKitLocale } from "../../i18n/locale.js";
|
|
5
|
+
import { mergeSlotStyles } from "../../utils/helpers/mergeSlotStyles.js";
|
|
4
6
|
const OPTIONS = ["light", "dark", "system"];
|
|
5
7
|
const defaultEmojis = {
|
|
6
8
|
light: "☀️",
|
|
@@ -13,10 +15,18 @@ const defaultIcons = {
|
|
|
13
15
|
system: "phone-portrait-outline",
|
|
14
16
|
};
|
|
15
17
|
const defaultLabels = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
fr: {
|
|
19
|
+
light: "Clair",
|
|
20
|
+
dark: "Sombre",
|
|
21
|
+
system: "Système",
|
|
22
|
+
hint: "« Système » suit automatiquement le réglage clair/sombre de ton téléphone.",
|
|
23
|
+
},
|
|
24
|
+
en: {
|
|
25
|
+
light: "Light",
|
|
26
|
+
dark: "Dark",
|
|
27
|
+
system: "System",
|
|
28
|
+
hint: "“System” automatically follows your phone's light/dark setting.",
|
|
29
|
+
},
|
|
20
30
|
};
|
|
21
31
|
const defaultStyles = {
|
|
22
32
|
container: { gap: 10 },
|
|
@@ -56,23 +66,11 @@ const defaultStyles = {
|
|
|
56
66
|
// second visual (`variant="emoji"`, the default) alongside the vector-icon
|
|
57
67
|
// one (`variant="icon"`). Pick whichever fits your app; both cover the exact
|
|
58
68
|
// same `light`/`dark`/`system` preference.
|
|
59
|
-
export function ThemeSettingsScreen({ value, onChange, variant = "emoji", emojis, icons, labels, showHint = true, styles, }) {
|
|
60
|
-
|
|
61
|
-
// override only changes the properties it specifies instead of replacing
|
|
62
|
-
// the whole default style object.
|
|
63
|
-
const merged = {
|
|
64
|
-
container: [defaultStyles.container, styles?.container],
|
|
65
|
-
hint: [defaultStyles.hint, styles?.hint],
|
|
66
|
-
row: [defaultStyles.row, styles?.row],
|
|
67
|
-
rowActive: [defaultStyles.rowActive, styles?.rowActive],
|
|
68
|
-
emoji: [defaultStyles.emoji, styles?.emoji],
|
|
69
|
-
label: [defaultStyles.label, styles?.label],
|
|
70
|
-
labelActive: [defaultStyles.labelActive, styles?.labelActive],
|
|
71
|
-
check: [defaultStyles.check, styles?.check],
|
|
72
|
-
};
|
|
69
|
+
export function ThemeSettingsScreen({ value, onChange, variant = "emoji", emojis, icons, labels, locale, showHint = true, styles, }) {
|
|
70
|
+
const merged = mergeSlotStyles(defaultStyles, styles);
|
|
73
71
|
const e = { ...defaultEmojis, ...emojis };
|
|
74
72
|
const i = { ...defaultIcons, ...icons };
|
|
75
|
-
const t = { ...defaultLabels, ...labels };
|
|
73
|
+
const t = { ...defaultLabels[useKitLocale(locale)], ...labels };
|
|
76
74
|
const iconColor = styles?.iconColor ?? defaultStyles.iconColor;
|
|
77
75
|
const iconColorActive = styles?.iconColorActive ?? defaultStyles.iconColorActive;
|
|
78
76
|
const checkColor = styles?.checkColor ?? defaultStyles.checkColor;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type KitLocale } from "../../i18n/locale.js";
|
|
1
2
|
import type { UpdateSettingsScreenHistoryEntry, UpdateSettingsScreenLabels, UpdateSettingsScreenRelease, UpdateSettingsScreenStyles } from "./UpdateSettingsScreen.styles.js";
|
|
2
3
|
export type { UpdateSettingsScreenHistoryEntry, UpdateSettingsScreenLabels, UpdateSettingsScreenRelease, UpdateSettingsScreenStyles, } from "./UpdateSettingsScreen.styles.js";
|
|
3
4
|
export interface UpdateSettingsScreenProps {
|
|
@@ -9,10 +10,18 @@ export interface UpdateSettingsScreenProps {
|
|
|
9
10
|
downloadAndInstallApk: (apkUrl: string, onProgress?: (fraction: number) => void) => Promise<void>;
|
|
10
11
|
/** Omit to not show a version history section at all. */
|
|
11
12
|
fetchReleaseHistory?: () => Promise<UpdateSettingsScreenHistoryEntry[]>;
|
|
12
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Locale for formatting each history entry's date. Defaults to the
|
|
15
|
+
* locale's (`"fr-FR"`, or `"en-US"` with `locale="en"`).
|
|
16
|
+
*/
|
|
13
17
|
dateLocale?: string;
|
|
14
18
|
labels?: UpdateSettingsScreenLabels;
|
|
19
|
+
/**
|
|
20
|
+
* Language of the built-in labels — French by default, or the nearest
|
|
21
|
+
* `KitLocaleProvider`'s. `labels` still overrides individual strings.
|
|
22
|
+
*/
|
|
23
|
+
locale?: KitLocale;
|
|
15
24
|
styles?: UpdateSettingsScreenStyles;
|
|
16
25
|
}
|
|
17
|
-
export declare function UpdateSettingsScreen({ currentVersion, checkForUpdate, compareVersions, downloadAndInstallApk, fetchReleaseHistory, dateLocale, labels, styles, }: UpdateSettingsScreenProps): import("react").JSX.Element;
|
|
26
|
+
export declare function UpdateSettingsScreen({ currentVersion, checkForUpdate, compareVersions, downloadAndInstallApk, fetchReleaseHistory, dateLocale: customDateLocale, labels, locale, styles, }: UpdateSettingsScreenProps): import("react").JSX.Element;
|
|
18
27
|
//# sourceMappingURL=UpdateSettingsScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAI1C,YAAY,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAU1C,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IAClE,mEAAmE;IACnE,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,qBAAqB,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACpC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,gCAAgC,EAAE,CAAC,CAAC;IACxE
|
|
1
|
+
{"version":3,"file":"UpdateSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAI1C,YAAY,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAU1C,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IAClE,mEAAmE;IACnE,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,qBAAqB,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACpC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,gCAAgC,EAAE,CAAC,CAAC;IACxE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,0BAA0B,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC;AAQD,wBAAgB,oBAAoB,CAAC,EACnC,cAAc,EACd,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EAAE,gBAAgB,EAC5B,MAAM,EACN,MAAM,EACN,MAAM,GACP,EAAE,yBAAyB,+BAuJ3B"}
|